取消计算
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");//税率
|
// Object taxrate = this.getModel().getValue("taxrate");//税率
|
||||||
BigDecimal avgtaxrate = (BigDecimal) this.getModel().getValue("avgtaxrate");//综合税率
|
// BigDecimal avgtaxrate = (BigDecimal) this.getModel().getValue("avgtaxrate");//综合税率
|
||||||
boolean ismultirate = (boolean) this.getModel().getValue("ismultirate");//多税率
|
// boolean ismultirate = (boolean) this.getModel().getValue("ismultirate");//多税率
|
||||||
BigDecimal pRate = new BigDecimal(0);
|
// BigDecimal pRate = new BigDecimal(0);
|
||||||
if (ismultirate) {
|
// if (ismultirate) {
|
||||||
pRate = avgtaxrate;
|
// pRate = avgtaxrate;
|
||||||
} else {
|
// } else {
|
||||||
if (taxrate != null) {
|
// if (taxrate != null) {
|
||||||
DynamicObject taxrateInfo = (DynamicObject) taxrate;
|
// DynamicObject taxrateInfo = (DynamicObject) taxrate;
|
||||||
BigDecimal trate = taxrateInfo.getBigDecimal("taxrate");
|
// BigDecimal trate = taxrateInfo.getBigDecimal("taxrate");
|
||||||
pRate = trate.divide(new BigDecimal(100)).add(new BigDecimal(1));
|
// pRate = trate.divide(new BigDecimal(100)).add(new BigDecimal(1));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
BigDecimal amount = new BigDecimal(0);
|
// BigDecimal amount = new BigDecimal(0);
|
||||||
BigDecimal ofamount = new BigDecimal(0);
|
// BigDecimal ofamount = new BigDecimal(0);
|
||||||
BigDecimal rate = new BigDecimal(0);
|
// BigDecimal rate = new BigDecimal(0);
|
||||||
DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
// DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
||||||
if (name.equals("zcgj_pjnhhshte")) {
|
// if (name.equals("zcgj_pjnhhshte")) {
|
||||||
Object zcgjPjnhbhshte = this.getModel().getValue("zcgj_pjnhhshte");
|
// Object zcgjPjnhbhshte = this.getModel().getValue("zcgj_pjnhhshte");
|
||||||
if (zcgjPjnhbhshte != null) {
|
// if (zcgjPjnhbhshte != null) {
|
||||||
ofamount = new BigDecimal(zcgjPjnhbhshte.toString());
|
// ofamount = new BigDecimal(zcgjPjnhbhshte.toString());
|
||||||
}
|
// }
|
||||||
amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
// amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
||||||
rate = ofamount.subtract(amount);
|
// rate = ofamount.subtract(amount);
|
||||||
dataEntity.set("zcgj_pjnhbhshte", amount);
|
// dataEntity.set("zcgj_pjnhbhshte", amount);
|
||||||
dataEntity.set("zcgj_pjnhse", rate);
|
// dataEntity.set("zcgj_pjnhse", rate);
|
||||||
// this.getModel().setValue("zcgj_pjnhbhshte", amount);
|
//// 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);
|
|
||||||
//// this.getModel().setValue("zcgj_pjnhse", rate);
|
//// this.getModel().setValue("zcgj_pjnhse", rate);
|
||||||
// dataEntity.set("zcgj_pjnhbhshte", amount);
|
// this.getView().updateView();
|
||||||
// dataEntity.set("zcgj_pjnhhshte", ofamount);
|
// } else if (name.equals("zcgj_pjnhbhshte")) {
|
||||||
// dataEntity.set("zcgj_pjnhse", rate);
|
//// Object zcgjPjnhhshte = this.getModel().getValue("zcgj_pjnhbhshte");
|
||||||
// this.getView().updateView();
|
//// Object zcgjPjnhhshte = changeData.getNewValue();
|
||||||
} else if (name.equals("zcgj_yjhshtsr")) {
|
//// if (zcgjPjnhhshte != null) {
|
||||||
Object zcgjyjhshtsr = this.getModel().getValue("zcgj_yjhshtsr");
|
//// amount = new BigDecimal(zcgjPjnhhshte.toString());
|
||||||
if (zcgjyjhshtsr != null) {
|
//// }
|
||||||
ofamount = new BigDecimal(zcgjyjhshtsr.toString());
|
//// ofamount = amount.multiply(pRate);
|
||||||
}
|
//// rate = ofamount.subtract(amount);
|
||||||
amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
////// this.getModel().setValue("zcgj_pjnhhshte", ofamount);
|
||||||
rate = ofamount.subtract(amount);
|
////// this.getModel().setValue("zcgj_pjnhse", rate);
|
||||||
// this.getModel().setValue("zcgj_yjbhshtsr", amount);
|
//// dataEntity.set("zcgj_pjnhbhshte", amount);
|
||||||
// this.getModel().setValue("zcgj_yjzse", rate);
|
//// dataEntity.set("zcgj_pjnhhshte", ofamount);
|
||||||
dataEntity.set("zcgj_yjbhshtsr", amount);
|
//// dataEntity.set("zcgj_pjnhse", rate);
|
||||||
dataEntity.set("zcgj_yjzse", rate);
|
//// this.getView().updateView();
|
||||||
this.getView().updateView();
|
// } else if (name.equals("zcgj_yjhshtsr")) {
|
||||||
} else if (name.equals("zcgj_yjbhshtsr")) {
|
// Object zcgjyjhshtsr = this.getModel().getValue("zcgj_yjhshtsr");
|
||||||
Object zcgjyjbhshtsr = this.getModel().getValue("zcgj_yjbhshtsr");
|
// if (zcgjyjhshtsr != null) {
|
||||||
if (zcgjyjbhshtsr != null) {
|
// ofamount = new BigDecimal(zcgjyjhshtsr.toString());
|
||||||
amount = new BigDecimal(zcgjyjbhshtsr.toString());
|
// }
|
||||||
}
|
// amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
||||||
ofamount = amount.multiply(pRate);
|
// rate = ofamount.subtract(amount);
|
||||||
rate = ofamount.subtract(amount);
|
//// this.getModel().setValue("zcgj_yjbhshtsr", amount);
|
||||||
// this.getModel().setValue("zcgj_yjhshtsr", ofamount);
|
//// this.getModel().setValue("zcgj_yjzse", rate);
|
||||||
// this.getModel().setValue("zcgj_yjzse", rate);
|
// dataEntity.set("zcgj_yjbhshtsr", amount);
|
||||||
dataEntity.set("zcgj_yjhshtsr", ofamount);
|
// dataEntity.set("zcgj_yjzse", rate);
|
||||||
dataEntity.set("zcgj_yjzse", rate);
|
// this.getView().updateView();
|
||||||
this.getView().updateView();
|
// } else if (name.equals("zcgj_yjbhshtsr")) {
|
||||||
} else if (name.equals("zcgj_hshtdj")) {
|
// Object zcgjyjbhshtsr = this.getModel().getValue("zcgj_yjbhshtsr");
|
||||||
Object zcgjhshtdj = this.getModel().getValue("zcgj_hshtdj");
|
// if (zcgjyjbhshtsr != null) {
|
||||||
if (zcgjhshtdj != null) {
|
// amount = new BigDecimal(zcgjyjbhshtsr.toString());
|
||||||
ofamount = new BigDecimal(zcgjhshtdj.toString());
|
// }
|
||||||
}
|
// ofamount = amount.multiply(pRate);
|
||||||
amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
// rate = ofamount.subtract(amount);
|
||||||
dataEntity.set("zcgj_bhshtdj", amount);
|
//// this.getModel().setValue("zcgj_yjhshtsr", ofamount);
|
||||||
// this.getModel().setValue("zcgj_bhshtdj", ofamount);
|
//// this.getModel().setValue("zcgj_yjzse", rate);
|
||||||
this.getView().updateView();
|
// dataEntity.set("zcgj_yjhshtsr", ofamount);
|
||||||
} else if (name.equals("zcgj_bhshtdj")) {
|
// dataEntity.set("zcgj_yjzse", rate);
|
||||||
Object zcgjbhshtdj = this.getModel().getValue("zcgj_bhshtdj");
|
// this.getView().updateView();
|
||||||
if (zcgjbhshtdj != null) {
|
// } else if (name.equals("zcgj_hshtdj")) {
|
||||||
amount = new BigDecimal(zcgjbhshtdj.toString());
|
// Object zcgjhshtdj = this.getModel().getValue("zcgj_hshtdj");
|
||||||
}
|
// if (zcgjhshtdj != null) {
|
||||||
ofamount = amount.multiply(pRate);
|
// ofamount = new BigDecimal(zcgjhshtdj.toString());
|
||||||
dataEntity.set("zcgj_hshtdj", ofamount);
|
// }
|
||||||
// this.getModel().setValue("zcgj_hshtdj", ofamount);
|
// amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
||||||
this.getView().updateView();
|
// dataEntity.set("zcgj_bhshtdj", amount);
|
||||||
} else if (name.equals("zcgj_bnyjhshte")) {
|
//// this.getModel().setValue("zcgj_bhshtdj", ofamount);
|
||||||
Object zcgjbnyjbhshte = this.getModel().getValue("zcgj_bnyjhshte");
|
// this.getView().updateView();
|
||||||
if (zcgjbnyjbhshte != null) {
|
// } else if (name.equals("zcgj_bhshtdj")) {
|
||||||
ofamount = new BigDecimal(zcgjbnyjbhshte.toString());
|
// Object zcgjbhshtdj = this.getModel().getValue("zcgj_bhshtdj");
|
||||||
}
|
// if (zcgjbhshtdj != null) {
|
||||||
amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
// amount = new BigDecimal(zcgjbhshtdj.toString());
|
||||||
rate = ofamount.subtract(amount);
|
// }
|
||||||
dataEntity.set("zcgj_bnyjbhshte", amount);
|
// ofamount = amount.multiply(pRate);
|
||||||
dataEntity.set("zcgj_bnyjse", rate);
|
// dataEntity.set("zcgj_hshtdj", ofamount);
|
||||||
this.getView().updateView();
|
//// this.getModel().setValue("zcgj_hshtdj", ofamount);
|
||||||
} else if (name.equals("zcgj_bnyjbhshte")) {
|
// this.getView().updateView();
|
||||||
// Object zcgjbnyjhshte = this.getModel().getValue("zcgj_bnyjbhshte");
|
// } else if (name.equals("zcgj_bnyjhshte")) {
|
||||||
// if (zcgjbnyjhshte != null) {
|
// Object zcgjbnyjbhshte = this.getModel().getValue("zcgj_bnyjhshte");
|
||||||
// amount = new BigDecimal(zcgjbnyjhshte.toString());
|
// if (zcgjbnyjbhshte != null) {
|
||||||
// }
|
// ofamount = new BigDecimal(zcgjbnyjbhshte.toString());
|
||||||
// ofamount = amount.multiply(pRate);
|
// }
|
||||||
// rate = ofamount.subtract(amount);
|
// amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP);
|
||||||
// dataEntity.set("zcgj_bnyjhshte", ofamount);
|
// rate = ofamount.subtract(amount);
|
||||||
// dataEntity.set("zcgj_bnyjse", rate);
|
// dataEntity.set("zcgj_bnyjbhshte", amount);
|
||||||
// this.getView().updateView();
|
// 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