feat: add local adjustment and discount properties to SaleInvoice and SaleReceipt interfaces.

This commit is contained in:
Ahmed Bouhuolia
2024-12-09 00:19:22 +02:00
parent b9963aa241
commit 477da0e7c0
5 changed files with 24 additions and 21 deletions

View File

@@ -204,7 +204,7 @@ export class SaleReceiptGLEntries {
return {
...commonEntry,
debit: saleReceipt.discountAmount,
debit: saleReceipt.discountAmountLocal,
accountId: discountAccountId,
index: 1,
accountNormal: AccountNormal.CREDIT,
@@ -222,12 +222,12 @@ export class SaleReceiptGLEntries {
adjustmentAccountId: number
): ILedgerEntry => {
const commonEntry = this.getIncomeGLCommonEntry(saleReceipt);
const adjustmentAmount = Math.abs(saleReceipt.adjustment);
const adjustmentAmount = Math.abs(saleReceipt.adjustmentLocal);
return {
...commonEntry,
debit: saleReceipt.adjustment < 0 ? adjustmentAmount : 0,
credit: saleReceipt.adjustment > 0 ? adjustmentAmount : 0,
debit: saleReceipt.adjustmentLocal < 0 ? adjustmentAmount : 0,
credit: saleReceipt.adjustmentLocal > 0 ? adjustmentAmount : 0,
accountId: adjustmentAccountId,
accountNormal: AccountNormal.CREDIT,
index: 1,
@@ -253,7 +253,6 @@ export class SaleReceiptGLEntries {
saleReceipt,
otherChargesAccountId
);
return [depositEntry, ...creditEntries, discountEntry, adjustmentEntry];
};
}