mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-23 16:19:49 +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 {
|
return {
|
||||||
debit: 0,
|
debit: 0,
|
||||||
credit: 0,
|
credit: 0,
|
||||||
|
|
||||||
currencyCode: bill.currencyCode,
|
currencyCode: bill.currencyCode,
|
||||||
exchangeRate: bill.exchangeRate || 1,
|
exchangeRate: bill.exchangeRate || 1,
|
||||||
|
|
||||||
@@ -281,11 +282,12 @@ export class BillGLEntries {
|
|||||||
otherExpensesAccountId: number
|
otherExpensesAccountId: number
|
||||||
) => {
|
) => {
|
||||||
const commonEntry = this.getBillCommonEntry(bill);
|
const commonEntry = this.getBillCommonEntry(bill);
|
||||||
|
const adjustmentAmount = Math.abs(bill.adjustmentLocal);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...commonEntry,
|
...commonEntry,
|
||||||
debit: bill.adjustmentLocal < 0 ? bill.adjustmentLocal : 0,
|
debit: bill.adjustmentLocal > 0 ? adjustmentAmount : 0,
|
||||||
credit: bill.adjustmentLocal > 0 ? bill.adjustmentLocal : 0,
|
credit: bill.adjustmentLocal < 0 ? adjustmentAmount : 0,
|
||||||
accountId: otherExpensesAccountId,
|
accountId: otherExpensesAccountId,
|
||||||
accountNormal: AccountNormal.DEBIT,
|
accountNormal: AccountNormal.DEBIT,
|
||||||
index: 1,
|
index: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user