fix: add capture error when calculate pos formula
continuous-integration/drone/push Build is passing Details

pull/107/head
shancheas 2024-10-07 05:58:45 +07:00
parent c5590ab7b1
commit e6066b534c
1 changed files with 15 additions and 8 deletions

View File

@ -81,12 +81,16 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
// };
// });
const { dpp_value, tax_datas, other } = await this.calculator.calculate(
data,
);
mappingRevertTransaction(data, TransactionType.COUNTER);
Object.assign(data, {
profit_share_formula: profit_formula.formula_string,
sales_price_formula: sales_formula.formula_string,
});
try {
const { dpp_value, tax_datas, other } =
await this.calculator.calculate(data);
Object.assign(data, {
taxes: tax_datas,
payment_total_dpp: dpp_value,
@ -95,6 +99,9 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
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);