|  | @@ -35,6 +35,9 @@ const gatherUtils = {
 | 
	
		
			
				|  |  |          gatherNode[prefix + "qty"] = helper.add(gatherNode[prefix + "qty"], sourceNode.quantity);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "tp"] = helper.add(gatherNode[prefix + "tp"], sourceNode.total_price);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "dgn_qty1"] = helper.add(gatherNode[prefix + "dgn_qty1"], sourceNode.dgn_qty1);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "dgn_qty2"] = helper.add(gatherNode[prefix + "dgn_qty2"], sourceNode.dgn_qty2);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          gatherNode[prefix + "contract_qty"] = helper.add(gatherNode[prefix + "contract_qty"], sourceNode.contract_qty);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "contract_tp"] = helper.add(gatherNode[prefix + "contract_tp"], sourceNode.contract_tp);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "qc_qty"] = helper.add(gatherNode[prefix + "qc_qty"], sourceNode.qc_qty);
 | 
	
	
		
			
				|  | @@ -56,6 +59,11 @@ const gatherUtils = {
 | 
	
		
			
				|  |  |          gatherNode[prefix + "end_gather_qty"] = helper.add(gatherNode[prefix + "end_gather_qty"], sourceNode.end_gather_qty);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "end_gather_tp"] = helper.add(gatherNode[prefix + "end_gather_tp"], sourceNode.end_gather_tp);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "deal_dgn_qty1"] = helper.add(gatherNode[prefix + "deal_dgn_qty1"], sourceNode.deal_dgn_qty1);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "deal_dgn_qty2"] = helper.add(gatherNode[prefix + "deal_dgn_qty2"], sourceNode.deal_dgn_qty2);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "c_dgn_qty1"] = helper.add(gatherNode[prefix + "c_dgn_qty1"], sourceNode.c_dgn_qty1);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "c_dgn_qty2"] = helper.add(gatherNode[prefix + "c_dgn_qty2"], sourceNode.c_dgn_qty2);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          gatherNode['s_' + "qty"] = helper.add(gatherNode['s_' + "qty"], sourceNode.quantity);
 | 
	
		
			
				|  |  |          gatherNode['s_' + "tp"] = helper.add(gatherNode['s_' + "tp"], sourceNode.total_price);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -87,6 +95,9 @@ const gatherUtils = {
 | 
	
		
			
				|  |  |          gatherNode[prefix + "qty"] = helper.add(gatherNode[prefix + "qty"], sourceNode.quantity);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "tp"] = helper.add(gatherNode[prefix + "tp"], sourceNode.total_price);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "dgn_qty1"] = helper.add(gatherNode[prefix + "dgn_qty1"], sourceNode.dgn_qty1);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "dgn_qty2"] = helper.add(gatherNode[prefix + "dgn_qty2"], sourceNode.dgn_qty2);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          gatherNode[prefix + "contract_qty"] = helper.add(gatherNode[prefix + "contract_qty"], sourceNode.contract_qty);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "contract_tp"] = helper.add(gatherNode[prefix + "contract_tp"], sourceNode.contract_tp);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "qc_qty"] = helper.add(gatherNode[prefix + "qc_qty"], sourceNode.qc_qty);
 | 
	
	
		
			
				|  | @@ -94,6 +105,11 @@ const gatherUtils = {
 | 
	
		
			
				|  |  |          gatherNode[prefix + "gather_qty"] = helper.add(gatherNode[prefix + "gather_qty"], sourceNode.gather_qty);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "gather_tp"] = helper.add(gatherNode[prefix + "gather_tp"], sourceNode.gather_tp);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "deal_dgn_qty1"] = helper.add(gatherNode[prefix + "deal_dgn_qty1"], sourceNode.deal_dgn_qty1);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "deal_dgn_qty2"] = helper.add(gatherNode[prefix + "deal_dgn_qty2"], sourceNode.deal_dgn_qty2);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "c_dgn_qty1"] = helper.add(gatherNode[prefix + "c_dgn_qty1"], sourceNode.c_dgn_qty1);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "c_dgn_qty2"] = helper.add(gatherNode[prefix + "c_dgn_qty2"], sourceNode.c_dgn_qty2);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          gatherNode['s_' + "qty"] = helper.add(gatherNode['s_' + "qty"], sourceNode.quantity);
 | 
	
		
			
				|  |  |          gatherNode['s_' + "tp"] = helper.add(gatherNode['s_' + "tp"], sourceNode.total_price);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -111,6 +127,9 @@ const gatherUtils = {
 | 
	
		
			
				|  |  |          gatherNode[prefix + "qty"] = helper.add(gatherNode[prefix + "qty"], sourceNode.quantity);
 | 
	
		
			
				|  |  |          gatherNode[prefix + "tp"] = helper.add(gatherNode[prefix + "tp"], sourceNode.total_price);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "dgn_qty1"] = helper.add(gatherNode[prefix + "dgn_qty1"], sourceNode.dgn_qty1);
 | 
	
		
			
				|  |  | +        gatherNode[prefix + "dgn_qty2"] = helper.add(gatherNode[prefix + "dgn_qty2"], sourceNode.dgn_qty2);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          gatherNode['s_' + "qty"] = helper.add(gatherNode['s_' + "qty"], sourceNode.quantity);
 | 
	
		
			
				|  |  |          gatherNode['s_' + "tp"] = helper.add(gatherNode['s_' + "tp"], sourceNode.total_price);
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -215,6 +234,13 @@ module.exports = app => {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  |              const billsData = await this.ctx.service.ledger.getData(tender.id);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            const dgnData = await this.ctx.service.stageBillsDgn.getDgnData(tender.id);
 | 
	
		
			
				|  |  | +            for (const d of dgnData) {
 | 
	
		
			
				|  |  | +                const l = this.ctx.helper._.find(billsData, {id: d.id});
 | 
	
		
			
				|  |  | +                this.ctx.helper._.assignIn(l, d);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              if (stage) {
 | 
	
		
			
				|  |  |                  await this.ctx.service.stage.doCheckStage(stage);
 | 
	
		
			
				|  |  |                  if (stage.readOnly) {
 | 
	
	
		
			
				|  | @@ -298,6 +324,12 @@ module.exports = app => {
 | 
	
		
			
				|  |  |              completeData.name = tender.name;
 | 
	
		
			
				|  |  |              const billsData = await this.ctx.service.ledger.getData(tender.id);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            const dgnData = await this.ctx.service.stageBillsDgn.getDgnData(tender.id);
 | 
	
		
			
				|  |  | +            for (const d of dgnData) {
 | 
	
		
			
				|  |  | +                const l = this.ctx.helper._.find(billsData, {id: d.id});
 | 
	
		
			
				|  |  | +                this.ctx.helper._.assignIn(l, d);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              let billsIndexData = {};
 | 
	
		
			
				|  |  |              for (const bd of billsData) {
 | 
	
		
			
				|  |  |                  billsIndexData[indexPre + bd.id] = bd;
 |