mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: correct debit and credit calculations for local adjustments in BillGLEntries
This commit is contained in:
@@ -110,6 +110,7 @@ export class BillGLEntries {
|
||||
return {
|
||||
debit: 0,
|
||||
credit: 0,
|
||||
|
||||
currencyCode: bill.currencyCode,
|
||||
exchangeRate: bill.exchangeRate || 1,
|
||||
|
||||
@@ -281,11 +282,12 @@ export class BillGLEntries {
|
||||
otherExpensesAccountId: number
|
||||
) => {
|
||||
const commonEntry = this.getBillCommonEntry(bill);
|
||||
const adjustmentAmount = Math.abs(bill.adjustmentLocal);
|
||||
|
||||
return {
|
||||
...commonEntry,
|
||||
debit: bill.adjustmentLocal < 0 ? bill.adjustmentLocal : 0,
|
||||
credit: bill.adjustmentLocal > 0 ? bill.adjustmentLocal : 0,
|
||||
debit: bill.adjustmentLocal > 0 ? adjustmentAmount : 0,
|
||||
credit: bill.adjustmentLocal < 0 ? adjustmentAmount : 0,
|
||||
accountId: otherExpensesAccountId,
|
||||
accountNormal: AccountNormal.DEBIT,
|
||||
index: 1,
|
||||
|
||||
Reference in New Issue
Block a user