parent
c513180ca5
commit
1223517501
|
|
@ -106,8 +106,8 @@ public class ClearBillFormPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
//上述两句应该可以跳过权限验证
|
||||
//如下代码设置目标界面打开时的高度和宽度
|
||||
StyleCss styleCss = new StyleCss();
|
||||
styleCss.setWidth("700");
|
||||
styleCss.setHeight("600");
|
||||
styleCss.setWidth("1400");
|
||||
styleCss.setHeight("800");
|
||||
showParameter.getOpenStyle().setInlineStyleCss(styleCss);
|
||||
|
||||
//设置页面ID
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl
|
|||
operateErrorInfo.setErrorLevel(ErrorLevel.Error.name());
|
||||
operateErrorInfo.setPkValue(bill.getPkValue());
|
||||
this.operationResult.addErrorInfo(operateErrorInfo);
|
||||
return;
|
||||
}
|
||||
//一次性供应商或客户信息(仅需要填写)
|
||||
String type = bill.getString("payeetype");
|
||||
|
|
@ -158,7 +159,8 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl
|
|||
if (null != acttradedate) {
|
||||
acttradedate1 = format.format(acttradedate);
|
||||
}
|
||||
IS_HEADER.put("BUDAT", acttradedate1);//过账日期_实际交易日期(付款单acttradedate)
|
||||
// IS_HEADER.put("BUDAT", acttradedate1);//todo:过账日期_实际交易日期(付款单acttradedate)
|
||||
IS_HEADER.put("BUDAT", bizdate1);//过账日期_业务日期(付款单bizdate)
|
||||
String isoCode = bill.getDynamicObject("currency").getString("number");
|
||||
IS_HEADER.put("WAERS", JhzjUtils.getCurrencyCode(isoCode));//币种_付款币种(付款单currency)
|
||||
IS_HEADER.put("XBLNR", bill.getString("billno"));//参考凭证号_单据编号(付款单billno)
|
||||
|
|
@ -213,7 +215,7 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl
|
|||
if (null != gl_voucher) {
|
||||
DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries");
|
||||
if (!entries.isEmpty()) {
|
||||
entries.forEach(entry -> {
|
||||
for (DynamicObject entry : entries) {
|
||||
JSONObject IT_ITEMS = new JSONObject();
|
||||
switch (payeetype) {
|
||||
case "bd_customer":
|
||||
|
|
@ -227,7 +229,14 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl
|
|||
}
|
||||
DynamicObject account = entry.getDynamicObject("account");//科目
|
||||
if (null != account) {
|
||||
//isbank
|
||||
boolean isbank = account.getBoolean("isbank");
|
||||
if (!isbank) {
|
||||
continue;//非银行科目
|
||||
}
|
||||
IT_ITEMS.put("HKONT", account.getString("number")); // 总账科目_科目(凭证分录account)
|
||||
}else {
|
||||
continue;
|
||||
}
|
||||
IT_ITEMS.put("RSTGR", RSTGR);//原因代码_原因码(付款明细shjh_yym)_必填
|
||||
IT_ITEMS.put("SGTXT", SGTXT);//行项目文本_SAP会计科目行项目号(付款明细shjh_voucherentrynum)
|
||||
|
|
@ -248,20 +257,28 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl
|
|||
boolean isSourceSystemA = "A".equals(shjhSourcesystem);
|
||||
boolean isEntryDC1 = "1".equals(entrydc);
|
||||
boolean isEntryDCNegative1 = "-1".equals(entrydc);
|
||||
|
||||
if (isSourceSystemA && isEntryDC1) {
|
||||
if (isEntryDC1) {
|
||||
amountToPut = debitlocal;
|
||||
} else if (!isSourceSystemA) {
|
||||
if (isEntryDC1) {
|
||||
amountToPut = debitlocal;
|
||||
} else if (isEntryDCNegative1) {
|
||||
amountToPut = creditlocal.negate();//相反
|
||||
}
|
||||
} else if (isEntryDCNegative1) {
|
||||
amountToPut = creditlocal.negate();//相反
|
||||
}
|
||||
// if (isSourceSystemA && isEntryDC1) {
|
||||
// amountToPut = debitlocal;
|
||||
// } else if (!isSourceSystemA) {
|
||||
//
|
||||
// }else if (!isSourceSystemA) {
|
||||
// if (isEntryDC1) {
|
||||
// amountToPut = debitlocal;
|
||||
// } else if (isEntryDCNegative1) {
|
||||
// amountToPut = creditlocal.negate();//相反
|
||||
// }
|
||||
IT_ITEMS.put("DMBTR", String.valueOf(amountToPut));
|
||||
}
|
||||
IT_ITEM.add(IT_ITEMS);
|
||||
});
|
||||
}
|
||||
// entries.forEach(entry -> {
|
||||
|
||||
// });
|
||||
}
|
||||
}
|
||||
return IT_ITEM;
|
||||
|
|
@ -300,7 +317,7 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl
|
|||
}
|
||||
jsonObject.put("HKONT", HKONT);//总账科目
|
||||
jsonObject.put("UMSKZ", "");//todo:特殊总账标识
|
||||
jsonObject.put("DMBTR", entry.getBigDecimal("e_actamt"));//未清金额_实付金额
|
||||
jsonObject.put("DMBTR1", entry.getBigDecimal("e_actamt"));//清账金额_实付金额
|
||||
IT_CLEAR.add(jsonObject);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue