fix: add capture error when calculate pos formula
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
c5590ab7b1
commit
e6066b534c
|
@ -81,21 +81,28 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
|||
// };
|
||||
// });
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue