mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix: issue in sales invoices and bills.
This commit is contained in:
@@ -51,7 +51,7 @@ export default class PaymentMadesSubscriber {
|
||||
this.logger.info('[bill_payment] trying to increment vendor balance.', { tenantId });
|
||||
await vendorRepository.changeBalance(
|
||||
billPayment.vendorId,
|
||||
billPayment.amount,
|
||||
billPayment.amount * -1,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export default class PaymentMadesSubscriber {
|
||||
|
||||
await vendorRepository.changeBalance(
|
||||
oldPaymentMade.vendorId,
|
||||
oldPaymentMade.amount * -1,
|
||||
oldPaymentMade.amount,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,10 @@ export default class PaymentReceivesSubscriber {
|
||||
const { customerRepository } = this.tenancy.repositories(tenantId);
|
||||
|
||||
this.logger.info('[payment_receive] trying to increment customer balance.');
|
||||
await customerRepository.changeBalance(oldPaymentReceive.customerId, oldPaymentReceive.amount);
|
||||
await customerRepository.changeBalance(
|
||||
oldPaymentReceive.customerId,
|
||||
oldPaymentReceive.amount,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,8 +79,6 @@ export default class PaymentReceivesSubscriber {
|
||||
async handleCustomerBalanceDiffChange({ tenantId, paymentReceiveId, paymentReceive, oldPaymentReceive }) {
|
||||
const { customerRepository } = this.tenancy.repositories(tenantId);
|
||||
|
||||
console.log(paymentReceive, oldPaymentReceive, 'XX');
|
||||
|
||||
await customerRepository.changeDiffBalance(
|
||||
paymentReceive.customerId,
|
||||
paymentReceive.amount * -1,
|
||||
|
||||
Reference in New Issue
Block a user