|
@@ -681,6 +681,11 @@ public class SRMSynPayApiPlugin implements Serializable {
|
|
type = invoiceEntry.getDynamicObjectType();
|
|
type = invoiceEntry.getDynamicObjectType();
|
|
JSONArray fpentry = inputData.getJSONArray("fpentry");
|
|
JSONArray fpentry = inputData.getJSONArray("fpentry");
|
|
|
|
|
|
|
|
+ //发票数量
|
|
|
|
+ int fpCount = fpentry.size();
|
|
|
|
+ //发票合计可用金额
|
|
|
|
+ BigDecimal totalInvAmount = BigDecimal.ZERO;
|
|
|
|
+
|
|
String invoiceCode = "";
|
|
String invoiceCode = "";
|
|
String invoiceName = "";
|
|
String invoiceName = "";
|
|
|
|
|
|
@@ -800,6 +805,13 @@ public class SRMSynPayApiPlugin implements Serializable {
|
|
bizAcctOutBill.set("automapinvoice", false);
|
|
bizAcctOutBill.set("automapinvoice", false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ totalInvAmount = totalInvAmount.add(entry.getBigDecimal("poolreimburseamount"));
|
|
|
|
+
|
|
|
|
+ if(fpCount == 1){
|
|
|
|
+ if(totalReimburseAmount.compareTo(entry.getBigDecimal("poolreimburseamount")) < 0) {
|
|
|
|
+ entry.set("poolreimburseamount", totalReimburseAmount);//本次报销金额
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
String invoiceGoodsName = "";
|
|
String invoiceGoodsName = "";
|
|
|
|
|
|
@@ -897,6 +909,13 @@ public class SRMSynPayApiPlugin implements Serializable {
|
|
}
|
|
}
|
|
invoiceEntry.add(entry);
|
|
invoiceEntry.add(entry);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(fpCount > 1 && totalInvAmount.compareTo(totalReimburseAmount) != 0){
|
|
|
|
+ for(DynamicObject checkEntry : invoiceEntry){
|
|
|
|
+ checkEntry.set("poolreimburseamount", BigDecimal.ZERO);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
bizAcctOutBill.set("invoiceentry", invoiceEntry);
|
|
bizAcctOutBill.set("invoiceentry", invoiceEntry);
|
|
|
|
|
|
if(invoiceName.length() > 200){
|
|
if(invoiceName.length() > 200){
|