|  | @@ -78,7 +78,7 @@ class BillsPosConvert {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      // v2
 | 
	
		
			
				|  |  | -    _loadCalcFields(node, data) {
 | 
	
		
			
				|  |  | +    _loadPosCalcFields(node, data) {
 | 
	
		
			
				|  |  |          const tpDecimal = this.ctx.tender.info.decimal.tp;
 | 
	
		
			
				|  |  |          node.quantity = this.ctx.helper.add(node.quantity, data.quantity);
 | 
	
		
			
				|  |  |          node.total_price = this.ctx.helper.add(node.total_price, this.ctx.helper.mul(node.unit_price, data.quantity, tpDecimal));
 | 
	
	
		
			
				|  | @@ -95,6 +95,22 @@ class BillsPosConvert {
 | 
	
		
			
				|  |  |          node.pre_qc_tp = this.ctx.helper.add(node.pre_qc_tp, this.ctx.helper.mul(node.unit_price, data.pre_qc_qty, tpDecimal));
 | 
	
		
			
				|  |  |          node.pre_gather_qty = this.ctx.helper.add(node.pre_gather_qty, data.pre_gather_qty);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +    _loadBillsCalcFields(node, data) {
 | 
	
		
			
				|  |  | +        node.quantity = this.ctx.helper.add(node.quantity, data.quantity);
 | 
	
		
			
				|  |  | +        node.total_price = this.ctx.helper.add(node.total_price, data.total_price);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        node.contract_qty = this.ctx.helper.add(node.contract_qty, data.contract_qty);
 | 
	
		
			
				|  |  | +        node.contract_tp = this.ctx.helper.add(node.contract_tp, data.contract_tp);
 | 
	
		
			
				|  |  | +        node.qc_qty = this.ctx.helper.add(node.qc_qty, data.qc_qty);
 | 
	
		
			
				|  |  | +        node.qc_tp = this.ctx.helper.add(node.qc_tp, );
 | 
	
		
			
				|  |  | +        node.gather_qty = this.ctx.helper.add(node.gather_qty, data.gather_qty);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        node.pre_contract_qty = this.ctx.helper.add(node.pre_contract_qty, data.pre_contract_qty);
 | 
	
		
			
				|  |  | +        node.pre_contract_tp = this.ctx.helper.add(node.pre_contract_tp, data.pre_contract_tp);
 | 
	
		
			
				|  |  | +        node.pre_qc_qty = this.ctx.helper.add(node.pre_qc_qty, data.pre_qc_qty);
 | 
	
		
			
				|  |  | +        node.pre_qc_tp = this.ctx.helper.add(node.pre_qc_tp, data.pre_qc_tp);
 | 
	
		
			
				|  |  | +        node.pre_gather_qty = this.ctx.helper.add(node.pre_gather_qty, data.pre_gather_qty);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      _convertGcl(node, xmj) {
 | 
	
		
			
				|  |  |          if (!xmj) return;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -110,7 +126,7 @@ class BillsPosConvert {
 | 
	
		
			
				|  |  |                      b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price
 | 
	
		
			
				|  |  |                  }, posUnit);
 | 
	
		
			
				|  |  |                  //loadField(gclUnit, p, baseCalcFields);
 | 
	
		
			
				|  |  | -                this._loadCalcFields(gclUnit, p);
 | 
	
		
			
				|  |  | +                this._loadPosCalcFields(gclUnit, p);
 | 
	
		
			
				|  |  |                  if (!gclUnit.changes) gclUnit.changes = [];
 | 
	
		
			
				|  |  |                  for (const c of this.bpcChange) {
 | 
	
		
			
				|  |  |                      if (c.lid === node.id && c.pid === p.id && c.qty && c.qty !== 0) {
 | 
	
	
		
			
				|  | @@ -119,10 +135,10 @@ class BillsPosConvert {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  | -            const unit = xmj.unitTree.addNode({pos_name: null,
 | 
	
		
			
				|  |  | +            const unit = xmj.unitTree.addNode({pos_name: '',
 | 
	
		
			
				|  |  |                  b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price});
 | 
	
		
			
				|  |  |              //loadField(unit, node, baseCalcFields);
 | 
	
		
			
				|  |  | -            this._loadCalcFields(unit, node);
 | 
	
		
			
				|  |  | +            this._loadBillsCalcFields(unit, node);
 | 
	
		
			
				|  |  |              if (!unit.changes) unit.changes = [];
 | 
	
		
			
				|  |  |              for (const c of this.bpcChange) {
 | 
	
		
			
				|  |  |                  if (c.lid === node.id && c.pid == -1 && c.qty && c.qty !== 0) {
 | 
	
	
		
			
				|  | @@ -155,7 +171,7 @@ class BillsPosConvert {
 | 
	
		
			
				|  |  |          //const tpDecimal = this.ctx.tender.info.decimal.tp;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          child.gather_qty = this.ctx.helper.add(child.contract_qty, child.qc_qty);
 | 
	
		
			
				|  |  | -        child.pre_gather_qty = this.ctx.helper.add(child.pre_contract_qty, child.pre_gather_qty);
 | 
	
		
			
				|  |  | +        child.pre_gather_qty = this.ctx.helper.add(child.pre_contract_qty, child.pre_qc_qty);
 | 
	
		
			
				|  |  |          child.end_contract_qty = this.ctx.helper.add(child.contract_qty, child.pre_contract_qty);
 | 
	
		
			
				|  |  |          child.end_qc_qty = this.ctx.helper.add(child.qc_qty, child.pre_qc_qty);
 | 
	
		
			
				|  |  |          child.end_gather_qty = this.ctx.helper.add(child.gather_qty, child.pre_gather_qty);
 |