mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: sale invoices payment amount once invoice created, edited or deleted.
This commit is contained in:
@@ -66,7 +66,9 @@ export default class CustomersService {
|
||||
const customer = await this.contactService.newContact(tenantId, contactDTO, 'customer');
|
||||
|
||||
this.logger.info('[customer] created successfully.', { tenantId, customerDTO });
|
||||
await this.eventDispatcher.dispatch(events.customers.onCreated);
|
||||
await this.eventDispatcher.dispatch(events.customers.onCreated, {
|
||||
customer, tenantId, customerId: customer.id,
|
||||
});
|
||||
|
||||
return customer;
|
||||
}
|
||||
@@ -89,7 +91,9 @@ export default class CustomersService {
|
||||
const customer = this.contactService.editContact(tenantId, customerId, contactDTO, 'customer');
|
||||
|
||||
this.eventDispatcher.dispatch(events.customers.onEdited);
|
||||
this.logger.info('[customer] edited successfully.', { tenantId, customerId });
|
||||
this.logger.info('[customer] edited successfully.', {
|
||||
tenantId, customerId, customer,
|
||||
});
|
||||
|
||||
return customer;
|
||||
}
|
||||
@@ -109,7 +113,7 @@ export default class CustomersService {
|
||||
|
||||
await Contact.query().findById(customerId).delete();
|
||||
|
||||
await this.eventDispatcher.dispatch(events.customers.onDeleted);
|
||||
await this.eventDispatcher.dispatch(events.customers.onDeleted, { tenantId, customerId });
|
||||
this.logger.info('[customer] deleted successfully.', { tenantId, customerId });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user