科目分类通用插件优化
This commit is contained in:
parent
85478571da
commit
77eff0c809
|
@ -74,12 +74,12 @@ public class ReimbursementAccountTypePlugin extends AbstractBillPlugIn implement
|
||||||
if (expenseitem != null) {
|
if (expenseitem != null) {
|
||||||
QFilter filter = new QFilter("zcgj_entryentity.zcgj_fee", QCP.equals, expenseitem.getLong("id"));
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_fee", QCP.equals, expenseitem.getLong("id"));
|
||||||
String typeKey = "20"; //差旅报销单
|
String typeKey = "20"; //差旅报销单
|
||||||
if ("er_dailyreimbursebill".equals(billFormId)) { //费用报销单
|
if ("er_dailyreimbursebill".equals(billFormId)) {
|
||||||
typeKey = "30"; //差旅报销单
|
typeKey = "30"; //费用报销单
|
||||||
} else if ("er_publicreimbursebill".equals(billFormId)) { //对公报销单
|
} else if ("er_publicreimbursebill".equals(billFormId)) {
|
||||||
typeKey = "40"; //差旅报销单
|
typeKey = "40"; //对公报销单
|
||||||
} else if ("er_prepaybill".equals(billFormId)) { //预付单
|
} else if ("er_prepaybill".equals(billFormId)) {
|
||||||
typeKey = "50"; //差旅报销单
|
typeKey = "50"; //预付单
|
||||||
}
|
}
|
||||||
QFilter biztypefilter = new QFilter("zcgj_biztype", QCP.equals, typeKey); //过滤业务单据为支出财务确认单
|
QFilter biztypefilter = new QFilter("zcgj_biztype", QCP.equals, typeKey); //过滤业务单据为支出财务确认单
|
||||||
//分录过滤
|
//分录过滤
|
||||||
|
@ -187,17 +187,27 @@ public class ReimbursementAccountTypePlugin extends AbstractBillPlugIn implement
|
||||||
new QFilter[]{filter1});//默认科目分类
|
new QFilter[]{filter1});//默认科目分类
|
||||||
|
|
||||||
if (orgTypeDefaultCollection != null && orgTypeDefaultCollection.size() == 1) {
|
if (orgTypeDefaultCollection != null && orgTypeDefaultCollection.size() == 1) {
|
||||||
|
//默认科目分类中存在单条的费用项目
|
||||||
DynamicObject companyRule = BusinessDataServiceHelper.loadSingle("zcgj_companyrule",
|
DynamicObject companyRule = BusinessDataServiceHelper.loadSingle("zcgj_companyrule",
|
||||||
new QFilter("zcgj_costcompany.id", QCP.equals, costCompanyId).toArray());//公司科目分类规则
|
new QFilter("zcgj_costcompany.id", QCP.equals, costCompanyId).toArray());//公司科目分类规则
|
||||||
if (companyRule != null) {
|
if (companyRule != null) {
|
||||||
|
//公司科目分类规则中存在对应公司的信息
|
||||||
DynamicObjectCollection entryRuleCollection = companyRule.getDynamicObjectCollection("zcgj_entryrule");//公司费用分类规则分录
|
DynamicObjectCollection entryRuleCollection = companyRule.getDynamicObjectCollection("zcgj_entryrule");//公司费用分类规则分录
|
||||||
for (DynamicObject entryRule : entryRuleCollection) {
|
for (DynamicObject entryRule : entryRuleCollection) {
|
||||||
DynamicObject entryRuleExpenseItem = entryRule.getDynamicObject("zcgj_expenseitem");//费用项目
|
DynamicObject entryRuleExpenseItem = entryRule.getDynamicObject("zcgj_expenseitem");//费用项目
|
||||||
String entryRuleRuleType = entryRule.getString("zcgj_ruletype");//分类规则
|
String entryRuleRuleType = entryRule.getString("zcgj_ruletype");//分类规则
|
||||||
if (entryRuleRuleType.equals("公司") && entryRuleExpenseItem.getLong("id") == expenseItemId) {
|
if (entryRuleExpenseItem.getLong("id") == expenseItemId) {
|
||||||
DynamicObject entryRuleCompanyType = entryRule.getDynamicObject("zcgj_companytype");//公司默认分类(科目分类)
|
if (entryRuleRuleType.equals("公司")) {
|
||||||
this.getModel().setValue("zcgj_accounttype", entryRuleCompanyType, rowIndex);
|
DynamicObject entryRuleCompanyType = entryRule.getDynamicObject("zcgj_companytype");//公司默认分类(科目分类)
|
||||||
return;
|
this.getModel().setValue("zcgj_accounttype", entryRuleCompanyType, rowIndex);
|
||||||
|
return;
|
||||||
|
} else if (entryRuleRuleType.equals("部门属性")) {
|
||||||
|
|
||||||
|
} else if (entryRuleRuleType.equals("职位")) {
|
||||||
|
|
||||||
|
} else if (entryRuleRuleType.equals("人员")) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue