mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix issues in sales and purchases API module.
This commit is contained in:
@@ -100,8 +100,8 @@ export default class PaymentReceiveService {
|
||||
...omit(paymentReceive, ['entries']),
|
||||
});
|
||||
const opers = [];
|
||||
const entriesIds = paymentReceive.entries.filter((i) => i.id);
|
||||
const entriesShouldInsert = paymentReceive.entries.filter((i) => !i.id);
|
||||
const entriesIds = paymentReceive.entries.filter((i: any) => i.id);
|
||||
const entriesShouldInsert = paymentReceive.entries.filter((i: any) => !i.id);
|
||||
|
||||
// Detarmines which entries ids should be deleted.
|
||||
const entriesIdsShouldDelete = ServiceItemsEntries.entriesShouldDeleted(
|
||||
@@ -142,7 +142,7 @@ export default class PaymentReceiveService {
|
||||
paymentReceive.customer_id,
|
||||
oldPaymentReceive.customerId,
|
||||
paymentAmount * -1,
|
||||
oldPaymentReceive.amount,
|
||||
oldPaymentReceive.amount * -1,
|
||||
);
|
||||
// Change the difference between the old and new invoice payment amount.
|
||||
const diffInvoicePaymentAmount = this.saveChangeInvoicePaymentAmount(
|
||||
|
||||
@@ -43,6 +43,7 @@ export default class SaleInvoicesService {
|
||||
});
|
||||
opers.push(oper);
|
||||
});
|
||||
// Increment the customer balance after deliver the sale invoice.
|
||||
const incrementOper = Customer.incrementBalance(
|
||||
saleInvoice.customer_id,
|
||||
balance,
|
||||
|
||||
Reference in New Issue
Block a user