|
@@ -69,25 +69,27 @@ public class DailyApplyBillAmountEditPlugin extends AbstractBillPlugIn {
|
|
|
|
|
|
private void showHeadBalanceAmount(){
|
|
|
((Label)this.getControl("nckd_reimbursecontrolinfo")).setText("");
|
|
|
- DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
|
|
- DynamicObjectCollection expenseEntries = dataEntity.getDynamicObjectCollection("expenseentryentity");
|
|
|
- String rowIndexStr = this.getPageCache().get("currentExpenseEntryIndex");
|
|
|
- int currentRowIndex;
|
|
|
- if (StringUtils.isNotBlank(rowIndexStr)) {
|
|
|
- currentRowIndex = Integer.parseInt(rowIndexStr);
|
|
|
- } else {
|
|
|
- currentRowIndex = this.getModel().getEntryCurrentRowIndex("expenseentryentity");
|
|
|
- }
|
|
|
+ this.getModel().setValue("nckd_limitamount", BigDecimal.ZERO);
|
|
|
|
|
|
- if (currentRowIndex >= 0 && expenseEntries.size() > 0) {
|
|
|
- if (currentRowIndex >= expenseEntries.size()) {
|
|
|
- currentRowIndex = 0;
|
|
|
- }
|
|
|
-
|
|
|
- DynamicObject expenseEntry = (DynamicObject)expenseEntries.get(currentRowIndex);
|
|
|
- if (!this.validRow(expenseEntry)) {
|
|
|
- ((Label)this.getControl("nckd_reimbursecontrolinfo")).setText("");
|
|
|
- } else {
|
|
|
+ DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
|
|
+// DynamicObjectCollection expenseEntries = dataEntity.getDynamicObjectCollection("expenseentryentity");
|
|
|
+// String rowIndexStr = this.getPageCache().get("currentExpenseEntryIndex");
|
|
|
+// int currentRowIndex;
|
|
|
+// if (StringUtils.isNotBlank(rowIndexStr)) {
|
|
|
+// currentRowIndex = Integer.parseInt(rowIndexStr);
|
|
|
+// } else {
|
|
|
+// currentRowIndex = this.getModel().getEntryCurrentRowIndex("expenseentryentity");
|
|
|
+// }
|
|
|
+
|
|
|
+// if (currentRowIndex >= 0 && expenseEntries.size() > 0) {
|
|
|
+// if (currentRowIndex >= expenseEntries.size()) {
|
|
|
+// currentRowIndex = 0;
|
|
|
+// }
|
|
|
+
|
|
|
+// DynamicObject expenseEntry = (DynamicObject)expenseEntries.get(currentRowIndex);
|
|
|
+// if (!this.validRow(expenseEntry)) {
|
|
|
+// ((Label)this.getControl("nckd_reimbursecontrolinfo")).setText("");
|
|
|
+// } else {
|
|
|
IDataModel model = this.getModel();
|
|
|
Long companyId = ErCommonUtils.getPk((DynamicObject)model.getValue("company"));
|
|
|
String personCtrlCurrency = (String)ErCommonUtils.getEMParameter(companyId, "personctlcurrency");
|
|
@@ -102,7 +104,7 @@ public class DailyApplyBillAmountEditPlugin extends AbstractBillPlugIn {
|
|
|
reimAmountBO.setCompanyId((Long)amountControlCompanyDO.getPkValue());
|
|
|
reimAmountBO.setEmpCtlBill(empCltList);
|
|
|
reimAmountBO.setDeptCtlBill(deptCltList);
|
|
|
- DynamicObject expenseitem = expenseEntry.getDynamicObject("expenseitem");
|
|
|
+ DynamicObject expenseitem = dataEntity.getDynamicObject("nckd_expenseitem");
|
|
|
|
|
|
expenseitem = BusinessDataServiceHelper.loadSingle(expenseitem.getPkValue(), expenseitem.getDynamicObjectType().getName());
|
|
|
|
|
@@ -122,15 +124,15 @@ public class DailyApplyBillAmountEditPlugin extends AbstractBillPlugIn {
|
|
|
|
|
|
reimAmountBO.setCtrlMode(isreimburseamountctl);
|
|
|
|
|
|
- Long oriCurrencyId = (Long)expenseEntry.getDynamicObject("entrycurrency").getPkValue();
|
|
|
+ Long oriCurrencyId = (Long)dataEntity.getDynamicObject("currency").getPkValue();
|
|
|
reimAmountBO.setUserOrDeptId((Long)dataEntity.getDynamicObject("applier").getPkValue());
|
|
|
QuotaCtrlUtil.genQuotaCurrency(reimAmountBO, personCtrlCurrency, oriCurrencyId, currencyId);
|
|
|
String showName = dataEntity.getDynamicObject("applier").getLocaleString("name").getLocaleValue();
|
|
|
|
|
|
- Date date = expenseEntry.getDate("happendate");
|
|
|
- if ("2".equals(this.quotaDateField)) {
|
|
|
- date = (Date)model.getValue("bizdate");
|
|
|
- }
|
|
|
+ Date date = (Date)model.getValue("bizdate");
|
|
|
+// if ("2".equals(this.quotaDateField)) {
|
|
|
+// date = (Date)model.getValue("bizdate");
|
|
|
+// }
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(date);
|
|
@@ -162,11 +164,13 @@ public class DailyApplyBillAmountEditPlugin extends AbstractBillPlugIn {
|
|
|
String template = ResManager.loadKDString("可用额度: %1$s|%2$s|%3$s", "ReimburseAmountControlFormPlugin_0", "fi-er-formplugin", new Object[0]);
|
|
|
String reimburseControlInfo = String.format(template, showName, expenseItemName, balanceAmountStr);
|
|
|
((Label)this.getControl("nckd_reimbursecontrolinfo")).setText(reimburseControlInfo);
|
|
|
+
|
|
|
+ this.getModel().setValue("nckd_limitamount", balanceAmount);
|
|
|
}
|
|
|
- }
|
|
|
- } else {
|
|
|
- ((Label)this.getControl("nckd_reimbursecontrolinfo")).setText("");
|
|
|
- }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// ((Label)this.getControl("nckd_reimbursecontrolinfo")).setText("");
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
private boolean validRow(DynamicObject entry) {
|