mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix: adjust contact balance
This commit is contained in:
@@ -85,7 +85,6 @@ export class LedgerContactsBalanceStorage {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} tenantId
|
||||
* @param {ILedger} ledger
|
||||
* @param {number} contactId
|
||||
* @returns {Promise<void>}
|
||||
@@ -130,11 +129,8 @@ export class LedgerContactsBalanceStorage {
|
||||
change: number,
|
||||
trx?: Knex.Transaction,
|
||||
) => {
|
||||
// return this.contactModel.changeAmount(
|
||||
// { id: contactId },
|
||||
// 'balance',
|
||||
// change,
|
||||
// trx,
|
||||
// );
|
||||
return this.contactModel()
|
||||
.query(trx)
|
||||
.changeAmount({ id: contactId }, 'balance', change);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -157,11 +157,8 @@ export class LedegrAccountsStorage {
|
||||
.whereNull('amount')
|
||||
.patch({ amount: 0 });
|
||||
|
||||
// await this.accountModel.changeAmount(
|
||||
// { id: accountId },
|
||||
// 'amount',
|
||||
// change,
|
||||
// trx,
|
||||
// );
|
||||
await this.accountModel()
|
||||
.query(trx)
|
||||
.changeAmount({ id: accountId }, 'amount', change);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user