|  | @@ -9,6 +9,7 @@ import kd.bos.entity.datamodel.IDataModel;
 | 
	
		
			
				|  |  |  import kd.bos.form.IFormView;
 | 
	
		
			
				|  |  |  import kd.bos.form.control.events.ItemClickEvent;
 | 
	
		
			
				|  |  |  import kd.bos.form.plugin.AbstractFormPlugin;
 | 
	
		
			
				|  |  | +import kd.bos.orm.query.QCP;
 | 
	
		
			
				|  |  |  import kd.sdk.plugin.Plugin;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
	
		
			
				|  | @@ -75,7 +76,8 @@ public class DiscountBillFormPlugin extends AbstractFormPlugin implements Plugin
 | 
	
		
			
				|  |  |          DataSet qtyDataSet1 = qtyDataSet.select("customer,qty as actualqty,planqty,case when round(qty / planqty, 2) >= "+completeRate+" then round(qty / planqty, 2) else 0 end as completerate");
 | 
	
		
			
				|  |  |          //取销售单价,返利政策
 | 
	
		
			
				|  |  |          //返利政策dataSet
 | 
	
		
			
				|  |  | -        DataSet policyDataSet = util.getPolicyDataSet();
 | 
	
		
			
				|  |  | +        DataSet policyDataSet_nofilter = util.getPolicyDataSet();
 | 
	
		
			
				|  |  | +        DataSet policyDataSet = policyDataSet_nofilter.filter("entryentity.nckd_zbmc = '总销量'");
 | 
	
		
			
				|  |  |          //添加临时匹配字段 tempKey
 | 
	
		
			
				|  |  |          DataSet qtyDataSet2 = qtyDataSet1.addFields(new String[] {"1"}, new String[]{"tempkey"});
 | 
	
		
			
				|  |  |          DataSet policyDataSet1 = policyDataSet.addFields(new String[] {"1"}, new String[]{"tempkey"});
 | 
	
	
		
			
				|  | @@ -92,6 +94,7 @@ public class DiscountBillFormPlugin extends AbstractFormPlugin implements Plugin
 | 
	
		
			
				|  |  |                  .select(new String[]{"customer","actualqty","planqty","completerate","price"}, new String[]{"thht", "material", "qty"}).finish();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          DataSet finalDataSet = beforeOrderDataSet.orderBy(new String[]{"customer", "thht", "material"});
 | 
	
		
			
				|  |  | +        //设置返利明细分录数据
 | 
	
		
			
				|  |  |          setField(finalDataSet);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 |