)}
-
+
);
}
diff --git a/front_end/src/Components/Table/index.jsx b/front_end/src/Components/Table/index.jsx
index c0fe245b..639b7d7f 100644
--- a/front_end/src/Components/Table/index.jsx
+++ b/front_end/src/Components/Table/index.jsx
@@ -24,7 +24,7 @@ import {
UNSELECT_ALL,
} from "../../Reducers/Selected";
-function Table({ rowData, sheetUpdating, payrollData }) {
+function Table({ sheetUpdating }) {
const dispatch = useDispatch();
const rows = useSelector((state) => state.allCells.cells);
@@ -194,7 +194,6 @@ function Table({ rowData, sheetUpdating, payrollData }) {
{
- const isPayrollEnabled = JSON.parse(localStorage.getItem("isPayrollEnabled"));
+const TableCell = ({ rowIndex, cellId, cellKey, sheetUpdating }) => {
+ let editing = false;
const dispatch = useDispatch();
@@ -20,15 +14,6 @@ const TableCell = ({
const cell = row[cellKey];
const isEditing = useSelector((state) => state.edit.cellId === cellId);
- const isOverride = () => {
- // Is override if cell exists, has an override amount and is not an actual
- return cell && cell.overrideAmount !== null && cell.isEditable;
- };
-
- if (isOverride()) {
- cell.amount = cell.overrideAmount;
- }
-
const [isUpdating, setIsUpdating] = useState(false);
const isRowSelected = useSelector(
@@ -72,7 +57,6 @@ const TableCell = ({
if (!cell) return classes.join(" ");
if (cell && cell.amount < 0) classes.push("negative");
- if (isOverride()) classes.push("override");
if (wasEdited()) classes.push("edited");
isActual ? classes.push("is-actual") : classes.push("is-forecast");
@@ -131,12 +115,11 @@ const TableCell = ({
setIsUpdating(false);
if (response.status === 200) {
// TODO (FFT-100): Test paste to excel with locked payroll forecast rows
- let rows = processForecastData(
- response.data,
- payrollData,
- isPayrollEnabled,
- );
- dispatch(SET_CELLS({ cells: rows }));
+ let rows = processForecastData(response.data);
+ dispatch({
+ type: SET_CELLS,
+ cells: rows,
+ });
} else {
dispatch(
SET_ERROR({
@@ -225,8 +208,12 @@ const TableCell = ({
className={getClasses()}
id={getId()}
onDoubleClick={() => {
- if (isEditable && !isOverride()) {
- dispatch(SET_EDITING_CELL({ cellId: cellId }));
+ if (isEditable) {
+ dispatch(
+ SET_EDITING_CELL({
+ cellId: cellId,
+ }),
+ );
}
}}
>
diff --git a/front_end/src/Util.js b/front_end/src/Util.js
index 1c857f18..cc31ec12 100644
--- a/front_end/src/Util.js
+++ b/front_end/src/Util.js
@@ -123,17 +123,8 @@ export async function postData(url = "", data = {}) {
};
}
-export const processForecastData = (
- forecastData,
- payrollData = null,
- isPayrollEnabled = false,
-) => {
+export const processForecastData = (forecastData) => {
let rows = [];
- let mappedPayrollData = null;
-
- if (isPayrollEnabled) {
- mappedPayrollData = processPayrollData(payrollData);
- }
let financialCodeCols = [
"analysis1_code",
@@ -167,35 +158,16 @@ export const processForecastData = (
colIndex++;
}
- const forecastKey = makeFinancialCodeKey(
- "",
- rowData.programme,
- rowData.natural_account_code,
- {
- analysis1: rowData.analysis1_code,
- analysis2: rowData.analysis2_code,
- project: rowData.project_code,
- },
- );
-
// eslint-disable-next-line
for (const [key, monthlyFigure] of Object.entries(
rowData["monthly_figures"],
)) {
- let overrideAmount = null;
-
- if (isPayrollEnabled && mappedPayrollData[forecastKey]) {
- const period = months[parseInt(key)];
- overrideAmount = mappedPayrollData[forecastKey][period];
- }
-
row[monthlyFigure.month] = {
rowIndex: rowIndex,
colIndex: colIndex,
key: monthlyFigure.month,
amount: monthlyFigure.amount,
startingAmount: monthlyFigure.starting_amount,
- overrideAmount: overrideAmount,
};
colIndex++;
@@ -207,22 +179,6 @@ export const processForecastData = (
return rows;
};
-const processPayrollData = (payrollData) => {
- const results = {};
-
- for (const [key, value] of Object.entries(payrollData)) {
- const generatedKey = makeFinancialCodeKey(
- "",
- value.programme_code,
- value.natural_account_code,
- );
-
- results[generatedKey] = value;
- }
-
- return results;
-};
-
export const makeFinancialCodeKey = (
costCentre,
programme,
diff --git a/front_end/styles/styles.scss b/front_end/styles/styles.scss
index 7c273e99..fa49d985 100644
--- a/front_end/styles/styles.scss
+++ b/front_end/styles/styles.scss
@@ -223,7 +223,6 @@ th {
background-color: rgba(86, 148, 202, 0.25);
}
-.override,
.not-editable.is-forecast {
background-color: rgba(201, 155, 75, 0.25);