Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
3e92771397
@ -75,6 +75,9 @@ public class GatheringClaimFormPlugin extends AbstractFormPlugin implements RowC
|
||||
DynamicObjectCollection collection = receiptdetail.getDynamicObjectCollection("yem_claimdetail");
|
||||
DynamicObjectCollection claimdetail = dataEntity.getDynamicObjectCollection("yem_claimdetail");
|
||||
|
||||
BigDecimal receivableamt = (BigDecimal) model.getValue("yem_receivableamt");
|
||||
BigDecimal claimamtA = (BigDecimal) model.getValue("yem_claimamt_a");
|
||||
model.setValue("yem_unclaimedamo", receivableamt.subtract(claimamtA));
|
||||
if ("claim".equals(opType)) {
|
||||
for (int i = 0; i < collection.size(); i++) {
|
||||
claim(model, i, collection, claimdetail);
|
||||
@ -91,36 +94,45 @@ public class GatheringClaimFormPlugin extends AbstractFormPlugin implements RowC
|
||||
}
|
||||
|
||||
// yem_unclaimedamo = yem_receivableamt - yem_claimamt_a
|
||||
BigDecimal receivableamt = (BigDecimal) model.getValue("yem_receivableamt");
|
||||
BigDecimal claimamtA = (BigDecimal) model.getValue("yem_claimamt_a");
|
||||
model.setValue("yem_unclaimedamo", receivableamt.subtract(claimamtA));
|
||||
}
|
||||
|
||||
private void claim(IDataModel model, int subRowIdx, DynamicObjectCollection collection, DynamicObjectCollection claimdetail) {
|
||||
DynamicObject dynamicObject = collection.get(subRowIdx);
|
||||
private void claim(IDataModel model, int row, DynamicObjectCollection collection, DynamicObjectCollection claimdetail) {
|
||||
DynamicObject dynamicObject = collection.get(row);
|
||||
DynamicObject object = claimdetail.addNew();
|
||||
setEntryValue(object, dynamicObject, "from");
|
||||
DynamicObjectCollection yemClaimdetail = this.getModel().getEntryEntity("yem_claimdetail");
|
||||
if (!yemClaimdetail.isEmpty()){
|
||||
for (int row = 0; row < yemClaimdetail.size(); row++) {
|
||||
String salcontract = (String) model.getValue("yem_salcontractno", row);
|
||||
String shippingDetailsNo = (String) model.getValue("yem_shippingdetailsno", row);
|
||||
if (YEM.isNotEmpty(salcontract) && YEM.isEmpty(shippingDetailsNo)) {
|
||||
DynamicObject salesorder = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", new QFilter[]{new QFilter("yem_es_salesorder.billno", QCP.equals, salcontract),});
|
||||
String salcontract = (String) model.getValue("yem_salcontractno", row);
|
||||
String shippingDetailsNo = (String) model.getValue("yem_shippingdetailsno", row);
|
||||
if (YEM.isNotEmpty(salcontract) && YEM.isEmpty(shippingDetailsNo)) {
|
||||
DynamicObject salesorder = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", new QFilter[]{new QFilter("yem_es_salesorder.billno", QCP.equals, salcontract),});
|
||||
BigDecimal amount = salesorder.getBigDecimal("yem_offeramount");
|
||||
BigDecimal shipPreRapRate = PaymentControlUtil.getShipPreRapRate(salesorder);
|
||||
BigDecimal procPreRapRate = PaymentControlUtil.getProcPreRapRate(salesorder);
|
||||
BigDecimal orderrefundamt = PaymentControlUtil.getAdvancePayment(amount, procPreRapRate);
|
||||
BigDecimal shiprefundamt = PaymentControlUtil.getAdvancePayment(amount, shipPreRapRate);
|
||||
BigDecimal rate = getPercentagePeriod(shipPreRapRate, procPreRapRate);
|
||||
BigDecimal periodrefundamt = rate.multiply(amount);
|
||||
model.setValue("yem_salcontractamt", amount, row);
|
||||
model.setValue("yem_orderrefundamt", orderrefundamt, row);
|
||||
model.setValue("yem_shiprefundamt", shiprefundamt, row);
|
||||
model.setValue("yem_periodrefundamt", periodrefundamt, row);
|
||||
}
|
||||
if (YEM.isNotEmpty(salcontract) && YEM.isNotEmpty(shippingDetailsNo)) {
|
||||
DynamicObject salesorder = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", new QFilter[]{new QFilter("yem_es_salesorder.billno", QCP.equals, salcontract),});
|
||||
DynamicObject shippingDetails = BusinessDataServiceHelper.loadSingle("yem_shippingdetails", new QFilter[]{new QFilter("billno", QCP.equals, shippingDetailsNo)});
|
||||
|
||||
BigDecimal shipPreRapRate = PaymentControlUtil.getShipPreRapRate(salesorder);
|
||||
BigDecimal procPreRapRate = PaymentControlUtil.getProcPreRapRate(salesorder);
|
||||
|
||||
BigDecimal amount = salesorder.getBigDecimal("yem_offeramount");
|
||||
BigDecimal orderrefundamt = PaymentControlUtil.getAdvancePayment(amount, procPreRapRate);
|
||||
BigDecimal shiprefundamt = PaymentControlUtil.getAdvancePayment(amount, shipPreRapRate);
|
||||
BigDecimal rate = getPercentagePeriod(shipPreRapRate, procPreRapRate);
|
||||
BigDecimal periodrefundamt = rate.multiply(amount);
|
||||
model.setValue("yem_orderrefundamt", orderrefundamt, row);
|
||||
model.setValue("yem_shiprefundamt", shiprefundamt, row);
|
||||
model.setValue("yem_periodrefundamt", periodrefundamt, row);
|
||||
}
|
||||
}
|
||||
BigDecimal shipPreRapRate = PaymentControlUtil.getShipPreRapRate(salesorder);
|
||||
BigDecimal procPreRapRate = PaymentControlUtil.getProcPreRapRate(salesorder);
|
||||
BigDecimal amounts = salesorder.getBigDecimal("yem_offeramount");
|
||||
BigDecimal amount = shippingDetails.getBigDecimal("yem_offeramount");
|
||||
BigDecimal orderrefundamt = PaymentControlUtil.getAdvancePayment(amount, procPreRapRate);
|
||||
BigDecimal shiprefundamt = PaymentControlUtil.getAdvancePayment(amount, shipPreRapRate);
|
||||
BigDecimal rate = getPercentagePeriod(shipPreRapRate, procPreRapRate);
|
||||
BigDecimal periodrefundamt = rate.multiply(amount);
|
||||
model.setValue("yem_orderrefundamt", orderrefundamt, row);
|
||||
model.setValue("yem_shiprefundamt", shiprefundamt, row);
|
||||
model.setValue("yem_periodrefundamt", periodrefundamt, row);
|
||||
model.setValue("yem_salcontractamt", amounts, row);
|
||||
model.setValue("yem_shipamt", amount, row);
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,7 +227,7 @@ public class GatheringClaimFormPlugin extends AbstractFormPlugin implements RowC
|
||||
yemclaimamt = yemclaimamt.add(yem_claimamt);
|
||||
if (yem_offeramount.compareTo(yemclaimamt) == 0) {
|
||||
//产生贷记单
|
||||
DynamicObject debcrednote = DebCredUtils.AddSKDGenerate(dataEntitie,emp.getString("billno"));
|
||||
DynamicObject debcrednote = DebCredUtils.AddSKDGenerate(dataEntitie, emp.getString("billno"));
|
||||
OperationResult Operate = OperationServiceHelper.executeOperate("save", debcrednote.getDynamicObjectType().getName(), new DynamicObject[]{debcrednote}, OperateOption.create());
|
||||
if (Operate.isSuccess()) {
|
||||
OperationResult submitResult = OperationServiceHelper.executeOperate("submit", "yem_debcrednote", new Object[]{debcrednote.getPkValue()}, OperateOption.create());
|
||||
|
Loading…
Reference in New Issue
Block a user