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 collection = receiptdetail.getDynamicObjectCollection("yem_claimdetail");
|
||||||
DynamicObjectCollection claimdetail = dataEntity.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)) {
|
if ("claim".equals(opType)) {
|
||||||
for (int i = 0; i < collection.size(); i++) {
|
for (int i = 0; i < collection.size(); i++) {
|
||||||
claim(model, i, collection, claimdetail);
|
claim(model, i, collection, claimdetail);
|
||||||
@ -91,27 +94,36 @@ public class GatheringClaimFormPlugin extends AbstractFormPlugin implements RowC
|
|||||||
}
|
}
|
||||||
|
|
||||||
// yem_unclaimedamo = yem_receivableamt - yem_claimamt_a
|
// 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) {
|
private void claim(IDataModel model, int row, DynamicObjectCollection collection, DynamicObjectCollection claimdetail) {
|
||||||
DynamicObject dynamicObject = collection.get(subRowIdx);
|
DynamicObject dynamicObject = collection.get(row);
|
||||||
DynamicObject object = claimdetail.addNew();
|
DynamicObject object = claimdetail.addNew();
|
||||||
setEntryValue(object, dynamicObject, "from");
|
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 salcontract = (String) model.getValue("yem_salcontractno", row);
|
||||||
String shippingDetailsNo = (String) model.getValue("yem_shippingdetailsno", row);
|
String shippingDetailsNo = (String) model.getValue("yem_shippingdetailsno", row);
|
||||||
if (YEM.isNotEmpty(salcontract) && YEM.isEmpty(shippingDetailsNo)) {
|
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),});
|
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 shipPreRapRate = PaymentControlUtil.getShipPreRapRate(salesorder);
|
||||||
BigDecimal procPreRapRate = PaymentControlUtil.getProcPreRapRate(salesorder);
|
BigDecimal procPreRapRate = PaymentControlUtil.getProcPreRapRate(salesorder);
|
||||||
|
BigDecimal amounts = salesorder.getBigDecimal("yem_offeramount");
|
||||||
BigDecimal amount = salesorder.getBigDecimal("yem_offeramount");
|
BigDecimal amount = shippingDetails.getBigDecimal("yem_offeramount");
|
||||||
BigDecimal orderrefundamt = PaymentControlUtil.getAdvancePayment(amount, procPreRapRate);
|
BigDecimal orderrefundamt = PaymentControlUtil.getAdvancePayment(amount, procPreRapRate);
|
||||||
BigDecimal shiprefundamt = PaymentControlUtil.getAdvancePayment(amount, shipPreRapRate);
|
BigDecimal shiprefundamt = PaymentControlUtil.getAdvancePayment(amount, shipPreRapRate);
|
||||||
BigDecimal rate = getPercentagePeriod(shipPreRapRate, procPreRapRate);
|
BigDecimal rate = getPercentagePeriod(shipPreRapRate, procPreRapRate);
|
||||||
@ -119,8 +131,8 @@ public class GatheringClaimFormPlugin extends AbstractFormPlugin implements RowC
|
|||||||
model.setValue("yem_orderrefundamt", orderrefundamt, row);
|
model.setValue("yem_orderrefundamt", orderrefundamt, row);
|
||||||
model.setValue("yem_shiprefundamt", shiprefundamt, row);
|
model.setValue("yem_shiprefundamt", shiprefundamt, row);
|
||||||
model.setValue("yem_periodrefundamt", periodrefundamt, row);
|
model.setValue("yem_periodrefundamt", periodrefundamt, row);
|
||||||
}
|
model.setValue("yem_salcontractamt", amounts, row);
|
||||||
}
|
model.setValue("yem_shipamt", amount, row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user