Commit 390a4b6a authored by 18083's avatar 18083

佣金支付优化

parent f81026fd
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
select * from( select * from(
select hb.batch_number, select hb.batch_number,
hc.batch_id, hc.batch_id,
hc.policy_hd_id, hc.policy_hd_id,
hc.bp_id, hc.bp_id,
(select cc.contract_number (select cc.contract_number
from con_contract cc from con_contract cc
where cc.contract_id = hc.contract_id) contract_number, where cc.contract_id = hc.contract_id) contract_number,
(select cc.contract_name (select cc.contract_name
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
from con_contract cc,hls_division hd from con_contract cc,hls_division hd
where cc.division= hd.division and cc.contract_id = hc.contract_id) con_business_type_n, where cc.division= hd.division and cc.contract_id = hc.contract_id) con_business_type_n,
hc.rental_re_times, hc.rental_re_times,
hc.overdue_max_days, nvl(hc.overdue_max_days,0) overdue_max_days,
hc.comsn_rate*100||'%' comsn_rate, round(hc.comsn_rate*100,2)||'%' comsn_rate,
hc.comsn_amount, hc.comsn_amount,
(select sum(i.unearned_finance_income) (select sum(i.unearned_finance_income)
from con_unearned_finance_income i from con_unearned_finance_income i
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
WHERE l.ref_doc_line_id=hc.cashflow_id WHERE l.ref_doc_line_id=hc.cashflow_id
AND l.ref_doc_category='CONTRACT' AND l.ref_doc_category='CONTRACT'
and l.payment_req_id=hd.payment_req_id and l.payment_req_id=hd.payment_req_id
and hd.approval_status in ('NEW','REJECT','APPROVED','APPROVING','RETURN') and hd.approval_status in ('NEW','APPROVED','APPROVING','RETURN')
) )
AND ('Y' = 'Y' AND EXISTS AND ('Y' = 'Y' AND EXISTS
(SELECT 1 (SELECT 1
...@@ -69,32 +69,13 @@ ...@@ -69,32 +69,13 @@
AND a1.trx_category = a2.trx_category AND a1.trx_category = a2.trx_category
AND a2.authorized_user_id = ${/session/@user_id} AND a2.authorized_user_id = ${/session/@user_id}
AND trunc(SYSDATE) BETWEEN a2.start_date AND AND trunc(SYSDATE) BETWEEN a2.start_date AND
nvl(a2.end_date, trunc(SYSDATE)))) nvl(a2.end_date, trunc(SYSDATE))))
AND NOT EXISTS (
SELECT 1
FROM csh_payment_req_ln l,csh_payment_req_hd hd
WHERE l.ref_doc_line_id=hc.cashflow_id
AND l.ref_doc_category='CONTRACT'
and l.payment_req_id=hd.payment_req_id
and hd.approval_status in ('NEW','REJECT','APPROVED','APPROVING','RETURN')
)
AND ('Y' = 'Y' AND EXISTS
(SELECT 1
FROM aut_trx_user_authorize a1, aut_owner_user_authorize a2
WHERE a1.trx_category = 'CONTRACT'
AND a1.trx_id = hc.contract_id
AND trunc(SYSDATE) BETWEEN a1.start_date AND
nvl(a1.end_date, trunc(SYSDATE))
AND a1.user_id = a2.owner_user_id
AND a1.trx_category = a2.trx_category
AND a2.authorized_user_id = ${/session/@user_id}
AND trunc(SYSDATE) BETWEEN a2.start_date AND
nvl(a2.end_date, trunc(SYSDATE))))
order by hc.overdue_max_days desc
) t1 ) t1
#WHERE_CLAUSE# #WHERE_CLAUSE#
#ORDER_BY_CLAUSE# order by t1.overdue_max_days desc
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
...@@ -103,7 +84,7 @@ order by hc.overdue_max_days desc ...@@ -103,7 +84,7 @@ order by hc.overdue_max_days desc
<bm:query-field name="batch_number" <bm:query-field name="batch_number"
queryExpression="t1.batch_number like &apos;%&apos;||${@batch_number}||&apos;%&apos;"/> queryExpression="t1.batch_number like &apos;%&apos;||${@batch_number}||&apos;%&apos;"/>
<bm:query-field name="contract_number" <bm:query-field name="contract_number"
queryExpression="t1.batch_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/> queryExpression="t1.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_id_agent_level1_n" queryExpression="t1.bp_id_agent_level1_n like &apos;%&apos;||${@bp_id_agent_level1_n}||&apos;%&apos;"/> <bm:query-field name="bp_id_agent_level1_n" queryExpression="t1.bp_id_agent_level1_n like &apos;%&apos;||${@bp_id_agent_level1_n}||&apos;%&apos;"/>
<bm:query-field name="division_n" queryExpression="t1.division_n like &apos;%&apos;||${@division_n}||&apos;%&apos;"/> <bm:query-field name="division_n" queryExpression="t1.division_n like &apos;%&apos;||${@division_n}||&apos;%&apos;"/>
<bm:query-field name="policy_name" queryExpression="t1.policy_name=${@policy_name}"/> <bm:query-field name="policy_name" queryExpression="t1.policy_name=${@policy_name}"/>
...@@ -111,5 +92,5 @@ order by hc.overdue_max_days desc ...@@ -111,5 +92,5 @@ order by hc.overdue_max_days desc
<bm:query-field name="overdue_max_days_t" queryExpression="t1.overdue_max_days &lt;= ${@overdue_max_days_t}"/> <bm:query-field name="overdue_max_days_t" queryExpression="t1.overdue_max_days &lt;= ${@overdue_max_days_t}"/>
<bm:query-field name="lease_start_date_f" queryExpression="t1.lease_start_date &gt;= TO_CHAR(TO_DATE(${@lease_start_date_f}, 'YYYY-MM-DD'), 'YYYY/MM/DD')"/> <bm:query-field name="lease_start_date_f" queryExpression="t1.lease_start_date &gt;= TO_CHAR(TO_DATE(${@lease_start_date_f}, 'YYYY-MM-DD'), 'YYYY/MM/DD')"/>
<bm:query-field name="lease_start_date_t" queryExpression="t1.lease_start_date &lt;= TO_CHAR(TO_DATE(${@lease_start_date_t}, 'YYYY-MM-DD'), 'YYYY/MM/DD')"/> <bm:query-field name="lease_start_date_t" queryExpression="t1.lease_start_date &lt;= TO_CHAR(TO_DATE(${@lease_start_date_t}, 'YYYY-MM-DD'), 'YYYY/MM/DD')"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -6,7 +6,7 @@ var override_queryfields = [ ...@@ -6,7 +6,7 @@ var override_queryfields = [
}, },
{ {
name : 'req_date_to', name : 'req_date_to',
queryexpression : "trunc(T1.req_date)<=to_date(${@req_date_to},'yyyy-mm-dd')" queryexpression : "T1.req_date<to_date(${@req_date_to},'yyyy-mm-dd')+1"
}, },
{ {
name:'payment_req_number', name:'payment_req_number',
...@@ -18,13 +18,16 @@ var override_queryfields = [ ...@@ -18,13 +18,16 @@ var override_queryfields = [
} }
]; ];
var add_datafilters = [ var add_datafilters = [
{
name : 'approval_status',
expression : "(t1.approval_status NOT in ('RETURN','CANCEL'))"
},
{ {
name : '', name : '',
expression : "exists(select 1\n" + expression : "exists(select 1\n" +
" from csh_payment_req_ln l,con_contract cc,con_contract_cashflow cf\n" + " from csh_payment_req_ln l,con_contract_cashflow cf\n" +
" where l.payment_req_id = t1.payment_req_id\n" + " where l.payment_req_id = t1.payment_req_id\n" +
" and l.ref_doc_category = 'CONTRACT'\n" +
" and l.ref_doc_id = cc.contract_id\n" +
" and l.ref_doc_line_id = cf.cashflow_id\n" + " and l.ref_doc_line_id = cf.cashflow_id\n" +
" and cf.cf_item in ('911'))" " and cf.cf_item in ('911'))"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<a:link id="csh_payment_comm_create_link" url="${/request/@context_path}/modules/csh/CSH501R/csh_payment_comm_selected.lview"/> <a:link id="csh_payment_comm_create_link" url="${/request/@context_path}/modules/csh/CSH501R/csh_payment_comm_selected.lview"/>
<a:link id="csh501_csh_comm_req_link_id" <a:link id="csh501_csh_comm_req_link_id"
url="${/request/@context_path}/modules/csh/CSH501R/csh_payment_comm_req.lview"/> url="${/request/@context_path}/modules/csh/CSH501R/csh_payment_comm_req.lview"/>
<a:link id="delete_comm_payment_req_link_id" model="csh.CSH501.delete_payment_req" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
//新增 //新增
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
...@@ -28,6 +29,54 @@ ...@@ -28,6 +29,54 @@
}); });
}; };
//新建状态单据取消
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
var ds_id = '${/parameter/@layout_code}_T_CSH_REQ_ASSET_csh_payment_req_hd_ds';
var records = $(ds_id).getSelected();
var param = {};
var datas = [];
if (!records.length) {
Leaf.showMessage('提示', '请至少选择一条数据!');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消该笔申请?', function okFun() {
for (var i = 0; i < records.length; i++) {
if (records[i].get('payment_req_id')) {
if (records[i].get('approval_status') != 'NEW' ) {
Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态不为新建,不能取消!');
return;
}
data = {};
data['payment_req_id'] = records[i].get('payment_req_id');
data['_status'] = 'update';
datas.push(data);
}
}
param['details'] = datas;
var url_l = $('delete_comm_payment_req_link_id').getUrl();
Leaf.request({
url: url_l,
para: datas,
success: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$(ds_id).query();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}, function cancelFun() {
Leaf.SideBar.enable = true;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
});
};
function detail_link(id, name, query_only) { function detail_link(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
...@@ -36,7 +85,7 @@ ...@@ -36,7 +85,7 @@
param['bp_id'] = record.get('bp_id_agent_level1'); param['bp_id'] = record.get('bp_id_agent_level1');
param['business_type'] = record.get('business_type'); param['business_type'] = record.get('business_type');
param['approval_status'] = record.get('approval_status'); param['approval_status'] = record.get('approval_status');
if (record.get('approval_status') == 'NEW' || record.get('approval_status') == 'RETURN' || record.get('approval_status') == 'REJECT') { if (record.get('approval_status') == 'NEW' || record.get('approval_status') == 'RETURN') {
param['function_usage'] = 'UPDATE'; param['function_usage'] = 'UPDATE';
param['function_code'] = 'CSH501D_COMM'; param['function_code'] = 'CSH501D_COMM';
} else{ } else{
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<a:link id="csh501d_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" <a:link id="csh501d_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/> modelaction="update"/>
<a:link id="con_rd_wfl_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/> <a:link id="con_rd_wfl_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<!--<a:link id="update_csh_payment_comm_info_link" model="csh.CSH501.csh_payment_req_get_num" modelaction="execute"/>--> <a:link id="update_csh_payment_comm_info_link" model="csh.CSH501.csh_payment_req_get_num" modelaction="execute"/>
<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/> <script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
...@@ -485,6 +485,48 @@ ...@@ -485,6 +485,48 @@
return check_flag || false; return check_flag || false;
}; };
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
dirty_flag = 'N';
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
//获得相应的行信息
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
if (payment_req_id) {
//更新头信息
Leaf.Masker.mask(Ext.getBody(), '正在保存中。。。');
Leaf.request({
url: $('update_csh_payment_comm_info_link').getUrl(),
para: {
payment_req_id: payment_req_id
},
success: function () {
Leaf.Masker.unmask(Ext.getBody());
$(hdds_id).setQueryParameter('payment_req_id', payment_req_id);
$(hdds_id).query();
},
failure: function () {
Leaf.Masker.unmask(detail_mask);
},
error: function () {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
$(lnds_id).setQueryParameter('payment_req_id', payment_req_id);
$(lnds_id).query();
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存数据');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
//合同编号超链接 //合同编号超链接
function open_con_contract_readonly_win(record_id, ds_id) { function open_con_contract_readonly_win(record_id, ds_id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment