From 8ba96e7343f343641ac08ca6c7da57094ae4b27f Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Tue, 7 Apr 2020 22:38:57 +0200 Subject: [PATCH] WIP Manual journals. --- .../DataTableCells/MoneyFieldCell.js | 6 +- .../Accounting/MakeJournalEntriesFooter.js | 1 - server/src/http/controllers/Accounting.js | 195 +++++++++- .../src/services/Accounting/JournalPoster.js | 29 +- server/tests/routes/accounting.test.js | 337 +++++++++++++++++- server/tests/services/JournalPoster.test.js | 96 ++++- 6 files changed, 650 insertions(+), 14 deletions(-) diff --git a/client/src/components/DataTableCells/MoneyFieldCell.js b/client/src/components/DataTableCells/MoneyFieldCell.js index 627433754..ab47e808a 100644 --- a/client/src/components/DataTableCells/MoneyFieldCell.js +++ b/client/src/components/DataTableCells/MoneyFieldCell.js @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useState, useEffect } from 'react'; import MoneyInputGroup from 'components/MoneyInputGroup'; // Input form cell renderer. @@ -23,6 +23,10 @@ const MoneyFieldCellRenderer = ({ payload.updateData(index, id, updateValue); }; + useEffect(() => { + setValue(initialValue); + }, [initialValue]) + return (