取消计算
This commit is contained in:
		
							parent
							
								
									930f9af9e1
								
							
						
					
					
						commit
						95dce05fef
					
				| 
						 | 
				
			
			@ -42,112 +42,112 @@ public class EcContractFromPlugin extends AbstractBillPlugIn implements Plugin {
 | 
			
		|||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        Object taxrate = this.getModel().getValue("taxrate");//税率
 | 
			
		||||
        BigDecimal avgtaxrate = (BigDecimal) this.getModel().getValue("avgtaxrate");//综合税率
 | 
			
		||||
        boolean ismultirate = (boolean) this.getModel().getValue("ismultirate");//多税率
 | 
			
		||||
        BigDecimal pRate = new BigDecimal(0);
 | 
			
		||||
        if (ismultirate) {
 | 
			
		||||
            pRate = avgtaxrate;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (taxrate != null) {
 | 
			
		||||
                DynamicObject taxrateInfo = (DynamicObject) taxrate;
 | 
			
		||||
                BigDecimal trate = taxrateInfo.getBigDecimal("taxrate");
 | 
			
		||||
                pRate = trate.divide(new BigDecimal(100)).add(new BigDecimal(1));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        BigDecimal amount = new BigDecimal(0);
 | 
			
		||||
        BigDecimal ofamount = new BigDecimal(0);
 | 
			
		||||
        BigDecimal rate = new BigDecimal(0);
 | 
			
		||||
        DynamicObject dataEntity = this.getModel().getDataEntity(true);
 | 
			
		||||
        if (name.equals("zcgj_pjnhhshte")) {
 | 
			
		||||
            Object zcgjPjnhbhshte = this.getModel().getValue("zcgj_pjnhhshte");
 | 
			
		||||
            if (zcgjPjnhbhshte != null) {
 | 
			
		||||
                ofamount = new BigDecimal(zcgjPjnhbhshte.toString());
 | 
			
		||||
            }
 | 
			
		||||
            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
            rate = ofamount.subtract(amount);
 | 
			
		||||
            dataEntity.set("zcgj_pjnhbhshte", amount);
 | 
			
		||||
            dataEntity.set("zcgj_pjnhse", rate);
 | 
			
		||||
//                this.getModel().setValue("zcgj_pjnhbhshte", amount);
 | 
			
		||||
//                this.getModel().setValue("zcgj_pjnhse", rate);
 | 
			
		||||
            this.getView().updateView();
 | 
			
		||||
        } else if (name.equals("zcgj_pjnhbhshte")) {
 | 
			
		||||
//                Object zcgjPjnhhshte = this.getModel().getValue("zcgj_pjnhbhshte");
 | 
			
		||||
//                Object zcgjPjnhhshte = changeData.getNewValue();
 | 
			
		||||
//                if (zcgjPjnhhshte != null) {
 | 
			
		||||
//                    amount = new BigDecimal(zcgjPjnhhshte.toString());
 | 
			
		||||
//                }
 | 
			
		||||
//                ofamount = amount.multiply(pRate);
 | 
			
		||||
//                rate = ofamount.subtract(amount);
 | 
			
		||||
////              this.getModel().setValue("zcgj_pjnhhshte", ofamount);
 | 
			
		||||
//        Object taxrate = this.getModel().getValue("taxrate");//税率
 | 
			
		||||
//        BigDecimal avgtaxrate = (BigDecimal) this.getModel().getValue("avgtaxrate");//综合税率
 | 
			
		||||
//        boolean ismultirate = (boolean) this.getModel().getValue("ismultirate");//多税率
 | 
			
		||||
//        BigDecimal pRate = new BigDecimal(0);
 | 
			
		||||
//        if (ismultirate) {
 | 
			
		||||
//            pRate = avgtaxrate;
 | 
			
		||||
//        } else {
 | 
			
		||||
//            if (taxrate != null) {
 | 
			
		||||
//                DynamicObject taxrateInfo = (DynamicObject) taxrate;
 | 
			
		||||
//                BigDecimal trate = taxrateInfo.getBigDecimal("taxrate");
 | 
			
		||||
//                pRate = trate.divide(new BigDecimal(100)).add(new BigDecimal(1));
 | 
			
		||||
//            }
 | 
			
		||||
//        }
 | 
			
		||||
//        BigDecimal amount = new BigDecimal(0);
 | 
			
		||||
//        BigDecimal ofamount = new BigDecimal(0);
 | 
			
		||||
//        BigDecimal rate = new BigDecimal(0);
 | 
			
		||||
//        DynamicObject dataEntity = this.getModel().getDataEntity(true);
 | 
			
		||||
//        if (name.equals("zcgj_pjnhhshte")) {
 | 
			
		||||
//            Object zcgjPjnhbhshte = this.getModel().getValue("zcgj_pjnhhshte");
 | 
			
		||||
//            if (zcgjPjnhbhshte != null) {
 | 
			
		||||
//                ofamount = new BigDecimal(zcgjPjnhbhshte.toString());
 | 
			
		||||
//            }
 | 
			
		||||
//            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
//            rate = ofamount.subtract(amount);
 | 
			
		||||
//            dataEntity.set("zcgj_pjnhbhshte", amount);
 | 
			
		||||
//            dataEntity.set("zcgj_pjnhse", rate);
 | 
			
		||||
////                this.getModel().setValue("zcgj_pjnhbhshte", amount);
 | 
			
		||||
////                this.getModel().setValue("zcgj_pjnhse", rate);
 | 
			
		||||
//                dataEntity.set("zcgj_pjnhbhshte", amount);
 | 
			
		||||
//                dataEntity.set("zcgj_pjnhhshte", ofamount);
 | 
			
		||||
//                dataEntity.set("zcgj_pjnhse", rate);
 | 
			
		||||
//                this.getView().updateView();
 | 
			
		||||
        } else if (name.equals("zcgj_yjhshtsr")) {
 | 
			
		||||
            Object zcgjyjhshtsr = this.getModel().getValue("zcgj_yjhshtsr");
 | 
			
		||||
            if (zcgjyjhshtsr != null) {
 | 
			
		||||
                ofamount = new BigDecimal(zcgjyjhshtsr.toString());
 | 
			
		||||
            }
 | 
			
		||||
            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
            rate = ofamount.subtract(amount);
 | 
			
		||||
//                this.getModel().setValue("zcgj_yjbhshtsr", amount);
 | 
			
		||||
//                this.getModel().setValue("zcgj_yjzse", rate);
 | 
			
		||||
            dataEntity.set("zcgj_yjbhshtsr", amount);
 | 
			
		||||
            dataEntity.set("zcgj_yjzse", rate);
 | 
			
		||||
            this.getView().updateView();
 | 
			
		||||
        } else if (name.equals("zcgj_yjbhshtsr")) {
 | 
			
		||||
            Object zcgjyjbhshtsr = this.getModel().getValue("zcgj_yjbhshtsr");
 | 
			
		||||
            if (zcgjyjbhshtsr != null) {
 | 
			
		||||
                amount = new BigDecimal(zcgjyjbhshtsr.toString());
 | 
			
		||||
            }
 | 
			
		||||
            ofamount = amount.multiply(pRate);
 | 
			
		||||
            rate = ofamount.subtract(amount);
 | 
			
		||||
//                this.getModel().setValue("zcgj_yjhshtsr", ofamount);
 | 
			
		||||
//                this.getModel().setValue("zcgj_yjzse", rate);
 | 
			
		||||
            dataEntity.set("zcgj_yjhshtsr", ofamount);
 | 
			
		||||
            dataEntity.set("zcgj_yjzse", rate);
 | 
			
		||||
            this.getView().updateView();
 | 
			
		||||
        } else if (name.equals("zcgj_hshtdj")) {
 | 
			
		||||
            Object zcgjhshtdj = this.getModel().getValue("zcgj_hshtdj");
 | 
			
		||||
            if (zcgjhshtdj != null) {
 | 
			
		||||
                ofamount = new BigDecimal(zcgjhshtdj.toString());
 | 
			
		||||
            }
 | 
			
		||||
            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
            dataEntity.set("zcgj_bhshtdj", amount);
 | 
			
		||||
//                this.getModel().setValue("zcgj_bhshtdj", ofamount);
 | 
			
		||||
            this.getView().updateView();
 | 
			
		||||
        } else if (name.equals("zcgj_bhshtdj")) {
 | 
			
		||||
            Object zcgjbhshtdj = this.getModel().getValue("zcgj_bhshtdj");
 | 
			
		||||
            if (zcgjbhshtdj != null) {
 | 
			
		||||
                amount = new BigDecimal(zcgjbhshtdj.toString());
 | 
			
		||||
            }
 | 
			
		||||
            ofamount = amount.multiply(pRate);
 | 
			
		||||
            dataEntity.set("zcgj_hshtdj", ofamount);
 | 
			
		||||
//                this.getModel().setValue("zcgj_hshtdj", ofamount);
 | 
			
		||||
            this.getView().updateView();
 | 
			
		||||
        } else if (name.equals("zcgj_bnyjhshte")) {
 | 
			
		||||
            Object zcgjbnyjbhshte = this.getModel().getValue("zcgj_bnyjhshte");
 | 
			
		||||
            if (zcgjbnyjbhshte != null) {
 | 
			
		||||
                ofamount = new BigDecimal(zcgjbnyjbhshte.toString());
 | 
			
		||||
            }
 | 
			
		||||
            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
            rate = ofamount.subtract(amount);
 | 
			
		||||
            dataEntity.set("zcgj_bnyjbhshte", amount);
 | 
			
		||||
            dataEntity.set("zcgj_bnyjse", rate);
 | 
			
		||||
            this.getView().updateView();
 | 
			
		||||
        } else if (name.equals("zcgj_bnyjbhshte")) {
 | 
			
		||||
//                Object zcgjbnyjhshte = this.getModel().getValue("zcgj_bnyjbhshte");
 | 
			
		||||
//                if (zcgjbnyjhshte != null) {
 | 
			
		||||
//                    amount = new BigDecimal(zcgjbnyjhshte.toString());
 | 
			
		||||
//                }
 | 
			
		||||
//                ofamount = amount.multiply(pRate);
 | 
			
		||||
//                rate = ofamount.subtract(amount);
 | 
			
		||||
//                dataEntity.set("zcgj_bnyjhshte", ofamount);
 | 
			
		||||
//                dataEntity.set("zcgj_bnyjse", rate);
 | 
			
		||||
//                this.getView().updateView();
 | 
			
		||||
        }
 | 
			
		||||
//            this.getView().updateView();
 | 
			
		||||
//        } else if (name.equals("zcgj_pjnhbhshte")) {
 | 
			
		||||
////                Object zcgjPjnhhshte = this.getModel().getValue("zcgj_pjnhbhshte");
 | 
			
		||||
////                Object zcgjPjnhhshte = changeData.getNewValue();
 | 
			
		||||
////                if (zcgjPjnhhshte != null) {
 | 
			
		||||
////                    amount = new BigDecimal(zcgjPjnhhshte.toString());
 | 
			
		||||
////                }
 | 
			
		||||
////                ofamount = amount.multiply(pRate);
 | 
			
		||||
////                rate = ofamount.subtract(amount);
 | 
			
		||||
//////              this.getModel().setValue("zcgj_pjnhhshte", ofamount);
 | 
			
		||||
//////                this.getModel().setValue("zcgj_pjnhse", rate);
 | 
			
		||||
////                dataEntity.set("zcgj_pjnhbhshte", amount);
 | 
			
		||||
////                dataEntity.set("zcgj_pjnhhshte", ofamount);
 | 
			
		||||
////                dataEntity.set("zcgj_pjnhse", rate);
 | 
			
		||||
////                this.getView().updateView();
 | 
			
		||||
//        } else if (name.equals("zcgj_yjhshtsr")) {
 | 
			
		||||
//            Object zcgjyjhshtsr = this.getModel().getValue("zcgj_yjhshtsr");
 | 
			
		||||
//            if (zcgjyjhshtsr != null) {
 | 
			
		||||
//                ofamount = new BigDecimal(zcgjyjhshtsr.toString());
 | 
			
		||||
//            }
 | 
			
		||||
//            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
//            rate = ofamount.subtract(amount);
 | 
			
		||||
////                this.getModel().setValue("zcgj_yjbhshtsr", amount);
 | 
			
		||||
////                this.getModel().setValue("zcgj_yjzse", rate);
 | 
			
		||||
//            dataEntity.set("zcgj_yjbhshtsr", amount);
 | 
			
		||||
//            dataEntity.set("zcgj_yjzse", rate);
 | 
			
		||||
//            this.getView().updateView();
 | 
			
		||||
//        } else if (name.equals("zcgj_yjbhshtsr")) {
 | 
			
		||||
//            Object zcgjyjbhshtsr = this.getModel().getValue("zcgj_yjbhshtsr");
 | 
			
		||||
//            if (zcgjyjbhshtsr != null) {
 | 
			
		||||
//                amount = new BigDecimal(zcgjyjbhshtsr.toString());
 | 
			
		||||
//            }
 | 
			
		||||
//            ofamount = amount.multiply(pRate);
 | 
			
		||||
//            rate = ofamount.subtract(amount);
 | 
			
		||||
////                this.getModel().setValue("zcgj_yjhshtsr", ofamount);
 | 
			
		||||
////                this.getModel().setValue("zcgj_yjzse", rate);
 | 
			
		||||
//            dataEntity.set("zcgj_yjhshtsr", ofamount);
 | 
			
		||||
//            dataEntity.set("zcgj_yjzse", rate);
 | 
			
		||||
//            this.getView().updateView();
 | 
			
		||||
//        } else if (name.equals("zcgj_hshtdj")) {
 | 
			
		||||
//            Object zcgjhshtdj = this.getModel().getValue("zcgj_hshtdj");
 | 
			
		||||
//            if (zcgjhshtdj != null) {
 | 
			
		||||
//                ofamount = new BigDecimal(zcgjhshtdj.toString());
 | 
			
		||||
//            }
 | 
			
		||||
//            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
//            dataEntity.set("zcgj_bhshtdj", amount);
 | 
			
		||||
////                this.getModel().setValue("zcgj_bhshtdj", ofamount);
 | 
			
		||||
//            this.getView().updateView();
 | 
			
		||||
//        } else if (name.equals("zcgj_bhshtdj")) {
 | 
			
		||||
//            Object zcgjbhshtdj = this.getModel().getValue("zcgj_bhshtdj");
 | 
			
		||||
//            if (zcgjbhshtdj != null) {
 | 
			
		||||
//                amount = new BigDecimal(zcgjbhshtdj.toString());
 | 
			
		||||
//            }
 | 
			
		||||
//            ofamount = amount.multiply(pRate);
 | 
			
		||||
//            dataEntity.set("zcgj_hshtdj", ofamount);
 | 
			
		||||
////                this.getModel().setValue("zcgj_hshtdj", ofamount);
 | 
			
		||||
//            this.getView().updateView();
 | 
			
		||||
//        } else if (name.equals("zcgj_bnyjhshte")) {
 | 
			
		||||
//            Object zcgjbnyjbhshte = this.getModel().getValue("zcgj_bnyjhshte");
 | 
			
		||||
//            if (zcgjbnyjbhshte != null) {
 | 
			
		||||
//                ofamount = new BigDecimal(zcgjbnyjbhshte.toString());
 | 
			
		||||
//            }
 | 
			
		||||
//            amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
//            rate = ofamount.subtract(amount);
 | 
			
		||||
//            dataEntity.set("zcgj_bnyjbhshte", amount);
 | 
			
		||||
//            dataEntity.set("zcgj_bnyjse", rate);
 | 
			
		||||
//            this.getView().updateView();
 | 
			
		||||
//        } else if (name.equals("zcgj_bnyjbhshte")) {
 | 
			
		||||
////                Object zcgjbnyjhshte = this.getModel().getValue("zcgj_bnyjbhshte");
 | 
			
		||||
////                if (zcgjbnyjhshte != null) {
 | 
			
		||||
////                    amount = new BigDecimal(zcgjbnyjhshte.toString());
 | 
			
		||||
////                }
 | 
			
		||||
////                ofamount = amount.multiply(pRate);
 | 
			
		||||
////                rate = ofamount.subtract(amount);
 | 
			
		||||
////                dataEntity.set("zcgj_bnyjhshte", ofamount);
 | 
			
		||||
////                dataEntity.set("zcgj_bnyjse", rate);
 | 
			
		||||
////                this.getView().updateView();
 | 
			
		||||
//        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue