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,12 +81,16 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
||||||
// };
|
// };
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const { dpp_value, tax_datas, other } = await this.calculator.calculate(
|
|
||||||
data,
|
|
||||||
);
|
|
||||||
|
|
||||||
mappingRevertTransaction(data, TransactionType.COUNTER);
|
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, {
|
Object.assign(data, {
|
||||||
taxes: tax_datas,
|
taxes: tax_datas,
|
||||||
payment_total_dpp: dpp_value,
|
payment_total_dpp: dpp_value,
|
||||||
|
@ -95,6 +99,9 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
||||||
payment_total_share: other.total_profit_share,
|
payment_total_share: other.total_profit_share,
|
||||||
payment_total_tax: other.payment_total_tax,
|
payment_total_tax: other.payment_total_tax,
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
apm.captureError(error);
|
||||||
|
}
|
||||||
|
|
||||||
apmTransactions.setLabel('Id', data?.id);
|
apmTransactions.setLabel('Id', data?.id);
|
||||||
apmTransactions.setLabel('Code', data?.code);
|
apmTransactions.setLabel('Code', data?.code);
|
||||||
|
|
Loading…
Reference in New Issue