fix: convert sale estimate to invoice.

This commit is contained in:
a.bouhuolia
2021-02-28 15:26:23 +02:00
parent fb9d68c2cf
commit 4d751f772e
6 changed files with 47 additions and 12 deletions

View File

@@ -26,15 +26,16 @@ export default class SaleInvoiceSubscriber {
* Marks the sale estimate as converted from the sale invoice once created.
*/
@On(events.saleInvoice.onCreated)
public async handleMarkEstimateConvert({
public async handleMarkEstimateConvertOnceInvoiceCreated({
tenantId,
saleInvoice,
saleInvoiceDTO,
saleInvoiceId,
}) {
if (saleInvoice.fromEstimateId) {
this.saleEstimatesService.convertEstimateToInvoice(
if (saleInvoiceDTO.fromEstimateId) {
await this.saleEstimatesService.convertEstimateToInvoice(
tenantId,
saleInvoice.fromEstiamteId,
saleInvoiceDTO.fromEstimateId,
saleInvoiceId
);
}