|
@@ -223,8 +223,8 @@ module.exports = app => {
|
|
|
async calcQuantityByMB(transaction, mid, mb, msb, materialCalculator, decimal, pre_is_stage_self, qty_source) {
|
|
|
const [newmsg_spread, newm_spread] = await this.getSpread(mb, null, decimal.up);
|
|
|
if (mb.t_type === materialConst.t_type[0].value) {
|
|
|
- const newQuantity = await this.ctx.service.materialList.getMbQuantity(transaction, mid, qty_source, decimal.qty, mb.id, msb.ms_id, 0);
|
|
|
- const newTp = this.ctx.helper.round(this.ctx.helper.mul(this.ctx.helper.round(newQuantity, decimal.qty), newm_spread), decimal.tp);
|
|
|
+ const newQuantity = await this.ctx.service.materialList.getMbQuantity(transaction, mid, qty_source, decimal.qty, mb.id, msb.ms_id);
|
|
|
+ const newTp = this.ctx.helper.round(this.ctx.helper.mul(newQuantity, newm_spread), decimal.tp);
|
|
|
msb.quantity = newQuantity;
|
|
|
msb.msg_spread = newmsg_spread;
|
|
|
msb.m_spread = newm_spread;
|