mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: add local adjustment and discount properties to SaleInvoice and SaleReceipt interfaces.
This commit is contained in:
@@ -281,7 +281,7 @@ export class SaleInvoiceGLEntries {
|
||||
|
||||
return {
|
||||
...commonEntry,
|
||||
debit: saleInvoice.discountAmount,
|
||||
debit: saleInvoice.discountAmountLocal,
|
||||
accountId: discountAccountId,
|
||||
accountNormal: AccountNormal.CREDIT,
|
||||
index: 1,
|
||||
@@ -299,12 +299,12 @@ export class SaleInvoiceGLEntries {
|
||||
otherChargesAccountId: number
|
||||
): ILedgerEntry => {
|
||||
const commonEntry = this.getInvoiceGLCommonEntry(saleInvoice);
|
||||
const adjustmentAmount = Math.abs(saleInvoice.adjustment);
|
||||
const adjustmentAmount = Math.abs(saleInvoice.adjustmentLocal);
|
||||
|
||||
return {
|
||||
...commonEntry,
|
||||
debit: saleInvoice.adjustment < 0 ? adjustmentAmount : 0,
|
||||
credit: saleInvoice.adjustment > 0 ? adjustmentAmount : 0,
|
||||
debit: saleInvoice.adjustmentLocal < 0 ? adjustmentAmount : 0,
|
||||
credit: saleInvoice.adjustmentLocal > 0 ? adjustmentAmount : 0,
|
||||
accountId: otherChargesAccountId,
|
||||
accountNormal: AccountNormal.CREDIT,
|
||||
index: 1,
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user