diff --git a/src/modules/transaction/transaction/domain/usecases/handlers/pos-transaction.handler.ts b/src/modules/transaction/transaction/domain/usecases/handlers/pos-transaction.handler.ts index 22748ba..b1915e4 100644 --- a/src/modules/transaction/transaction/domain/usecases/handlers/pos-transaction.handler.ts +++ b/src/modules/transaction/transaction/domain/usecases/handlers/pos-transaction.handler.ts @@ -81,21 +81,28 @@ export class PosTransactionHandler implements IEventHandler { // }; // }); - const { dpp_value, tax_datas, other } = await this.calculator.calculate( - data, - ); - mappingRevertTransaction(data, TransactionType.COUNTER); Object.assign(data, { - taxes: tax_datas, - payment_total_dpp: dpp_value, profit_share_formula: profit_formula.formula_string, sales_price_formula: sales_formula.formula_string, - payment_total_share: other.total_profit_share, - payment_total_tax: other.payment_total_tax, }); + try { + const { dpp_value, tax_datas, other } = + await this.calculator.calculate(data); + Object.assign(data, { + taxes: tax_datas, + payment_total_dpp: dpp_value, + profit_share_formula: profit_formula.formula_string, + sales_price_formula: sales_formula.formula_string, + payment_total_share: other.total_profit_share, + payment_total_tax: other.payment_total_tax, + }); + } catch (error) { + apm.captureError(error); + } + apmTransactions.setLabel('Id', data?.id); apmTransactions.setLabel('Code', data?.code); apmTransactions.setLabel('Status', data?.status);