Compare commits
2 Commits
d2574fda05
...
fb06f5ffaa
Author | SHA1 | Date |
---|---|---|
|
fb06f5ffaa | |
|
f3efb93396 |
|
@ -5,6 +5,7 @@ import kd.bos.bill.BillShowParameter;
|
|||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.metadata.dynamicobject.DynamicObjectType;
|
||||
import kd.bos.dataentity.resource.ResManager;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.form.control.EntryGrid;
|
||||
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||
|
@ -37,7 +38,7 @@ public class ProCostSplitBillPlugin extends AbstractBillPlugIn implements HyperL
|
|||
super.beforeDoOperation(args);
|
||||
FormOperate formOperate = (FormOperate) args.getSource();
|
||||
if ("autogetdata".equals(formOperate.getOperateKey())) {
|
||||
//自动取数分摊
|
||||
//费用明细分录自动取数分摊按钮
|
||||
Object org = this.getModel().getValue("org");//所属组织
|
||||
if (org != null) {
|
||||
DynamicObject org1 = (DynamicObject) org;
|
||||
|
@ -55,8 +56,8 @@ public class ProCostSplitBillPlugin extends AbstractBillPlugIn implements HyperL
|
|||
if (entryCollection.size() > 0) {
|
||||
entryCollection.clear();
|
||||
}
|
||||
QFilter filter = new QFilter("costcompany", QCP.equals, org1.getPkValue());//费用承担公司
|
||||
filter.and(new QFilter("billstatus", QCP.in, new String[]{"G"}));//单据状态
|
||||
QFilter filter = new QFilter("paycompany", QCP.equals, org1.getPkValue());//费用承担公司1111111111
|
||||
filter.and(new QFilter("billstatus", QCP.in, new String[]{"A"}));//单据状态1111111
|
||||
filter.and(new QFilter("bizdate", QCP.less_equals, endDate));//申请日期
|
||||
DynamicObjectCollection er_dailyReimburseBillCollection = QueryServiceHelper.query("er_dailyreimbursebill",
|
||||
"id,billno,applier,bizdate,costdept,costcompany,expenseentryentity.std_entrycostcenter,expenseentryentity.expenseitem," +
|
||||
|
@ -72,6 +73,9 @@ public class ProCostSplitBillPlugin extends AbstractBillPlugIn implements HyperL
|
|||
continue;
|
||||
}
|
||||
DynamicObject newEntry = new DynamicObject(entryType);
|
||||
DynamicObjectCollection subEntryEntityCollection = newEntry.getDynamicObjectCollection("zcgj_subentryentity");//成本分摊明细
|
||||
DynamicObjectType subEntryEntityType = subEntryEntityCollection.getDynamicObjectType();
|
||||
DynamicObject newEntrySubEntryEntity = new DynamicObject(subEntryEntityType);
|
||||
newEntry.set("zcgj_materialentryid", expenseentryentityId);
|
||||
newEntry.set("zcgj_dailyld", er_dailyReimburseBill.get("id"));//单据ID
|
||||
newEntry.set("zcgj_entrybillno", er_dailyReimburseBill.get("billno"));//单据编码
|
||||
|
@ -87,21 +91,39 @@ public class ProCostSplitBillPlugin extends AbstractBillPlugIn implements HyperL
|
|||
newEntry.set("zcgj_entrycostcenter", loadSingleData("bos_costcenter", std_entrycostcenter));
|
||||
Object expenseitem = er_dailyReimburseBill.get("expenseentryentity.expenseitem");// 费用项目
|
||||
newEntry.set("zcgj_expenseitem", loadSingleData("er_expenseitemedit", expenseitem));
|
||||
newEntrySubEntryEntity.set("zcgj_expenseitem2", loadSingleData("er_expenseitemedit", expenseitem));
|
||||
Object zcgj_accounttype = er_dailyReimburseBill.get("expenseentryentity.zcgj_accounttype");// 科目属性
|
||||
newEntry.set("zcgj_accounttype", loadSingleData("zcgj_accounttype", zcgj_accounttype));
|
||||
newEntrySubEntryEntity.set("zcgj_accounttype2", loadSingleData("zcgj_accounttype", zcgj_accounttype));
|
||||
|
||||
newEntry.set("zcgj_expenseamount", er_dailyReimburseBill.get("expenseentryentity.expenseamount"));
|
||||
newEntrySubEntryEntity.set("zcgj_amount", er_dailyReimburseBill.get("expenseentryentity.expenseamount"));
|
||||
newEntry.set("zcgj_taxrate", er_dailyReimburseBill.get("expenseentryentity.taxrate"));
|
||||
newEntry.set("zcgj_taxamount", er_dailyReimburseBill.get("expenseentryentity.taxamount"));
|
||||
newEntry.set("zcgj_orientryamount", er_dailyReimburseBill.get("expenseentryentity.orientryamount"));
|
||||
newEntry.set("zcgj_remark", er_dailyReimburseBill.get("expenseentryentity.remark"));
|
||||
|
||||
entryCollection.add(newEntry);
|
||||
subEntryEntityCollection.add(newEntrySubEntryEntity);
|
||||
}
|
||||
this.getView().updateView("zcgj_entryentity");//刷新分录
|
||||
this.getView().updateView("zcgj_subentryentity");//刷新分录
|
||||
} else {
|
||||
this.getView().showTipNotification("请先填写所属组织");
|
||||
}
|
||||
} else if ("newentry2".equals(formOperate.getOperateKey())) {
|
||||
//成本核算维度明细子分录增行按钮
|
||||
int rowIndex = this.getModel().getEntryCurrentRowIndex("zcgj_entryentity");//费用明细分录行索引
|
||||
int rowCount = this.getModel().getEntryRowCount("zcgj_entryentity");//费用明细分录总行数
|
||||
if (rowCount > 0 && rowIndex >= 0) {
|
||||
int subInd = this.getModel().createNewEntryRow("zcgj_subentryentity");//新增子分录行数
|
||||
this.getModel().setValue("zcgj_expenseitem2", this.getModel().getValue("zcgj_expenseitem", rowIndex), subInd);
|
||||
this.getModel().setValue("zcgj_accounttype2", this.getModel().getValue("zcgj_accounttype", rowIndex), subInd);
|
||||
args.setCancel(true);
|
||||
} else {
|
||||
this.getView().showTipNotification(ResManager.loadKDString("请先选中1行费用明细行数据。", "MaterialCostBillPlugin_1", "ec-ecco-formplugin", new Object[0]));
|
||||
args.setCancel(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue