mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix bugs in sales and purchases API.
This commit is contained in:
@@ -3,17 +3,17 @@ import { Customer } from '@/models';
|
||||
export default class CustomerRepository {
|
||||
|
||||
static changeDiffBalance(customerId, oldCustomerId, amount, oldAmount) {
|
||||
const diffAmount = (amount - oldAmount) * -1;
|
||||
const diffAmount = amount - oldAmount;
|
||||
const asyncOpers = [];
|
||||
|
||||
if (customerId != oldCustomerId) {
|
||||
const oldCustomerOper = Customer.changeBalance(
|
||||
oldCustomerId,
|
||||
oldAmount
|
||||
(oldAmount * -1)
|
||||
);
|
||||
const customerOper = Customer.changeBalance(
|
||||
customerId,
|
||||
(amount + diffAmount) * -1
|
||||
amount,
|
||||
);
|
||||
asyncOpers.push(customerOper);
|
||||
asyncOpers.push(oldCustomerOper);
|
||||
|
||||
7
server/src/repositories/SaleInvoiceRepository.js
Normal file
7
server/src/repositories/SaleInvoiceRepository.js
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
export default class SaleInvoiceRepository {
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user