mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix: issue in edit payment receive with invoices payment amount chaning.
This commit is contained in:
@@ -190,10 +190,15 @@ const entriesAmountDiff = (
|
||||
.mapValues((group) => _.sumBy(group, amountAttribute) || 0)
|
||||
.value();
|
||||
|
||||
return _.chain(newEntries)
|
||||
const newEntriesTable = _.chain(newEntries)
|
||||
.groupBy(idAttribute)
|
||||
.mapValues((group) => _.sumBy(group, amountAttribute) || 0)
|
||||
.mapValues((value, key) => value - (oldEntriesTable[key] || 0))
|
||||
.mergeWith(oldEntriesTable, (objValue, srcValue) => {
|
||||
return (_.isNumber(objValue) ? objValue - srcValue : srcValue * -1);
|
||||
})
|
||||
.value();
|
||||
|
||||
return _.chain(newEntriesTable)
|
||||
.mapValues((value, key) => ({
|
||||
[idAttribute]: key,
|
||||
[amountAttribute]: value,
|
||||
|
||||
Reference in New Issue
Block a user