|
@@ -759,13 +759,15 @@ module.exports = app => {
|
|
|
d.c_tp = this.ctx.helper.mul(d.c_qty, d.unit_price, decimal.tp);
|
|
|
d.s_qty = d.samount ? parseFloat(d.samount) : 0;
|
|
|
d.s_tp = this.ctx.helper.mul(d.s_qty, d.unit_price, decimal.tp);
|
|
|
+ d.sp_qty = d.spamount;
|
|
|
+ d.sp_tp = this.ctx.helper.mul(d.sp_qty, d.unit_price, decimal.tp);
|
|
|
|
|
|
const auditAmount = d.audit_amount ? d.audit_amount.split(',') : [];
|
|
|
const relaChange = ctx.helper._.find(change, {cid: d.cid});
|
|
|
for (const [i, aa] of auditAmount.entries()) {
|
|
|
const amountField = 'qty_' + (i+1), tpField = 'tp_' + (i+1);
|
|
|
d[amountField] = aa ? parseFloat(aa) : 0;
|
|
|
- d[tpField] = ctx.helper.mul(d[amountField], d.unit_price, decimal.tp);
|
|
|
+ d[tpField] = ctx.helper.mul(d[amountField], d.unit_price, c.tp_decimal || decimal.tp);
|
|
|
if (relaChange) {
|
|
|
relaChange[tpField] = ctx.helper.add(relaChange[tpField], d[tpField]);
|
|
|
}
|