Commit 3445c74f authored by gzj34291's avatar gzj34291

Merge remote-tracking branch 'origin/develop' into develop

parents ebb55603 ae971f17
...@@ -86,7 +86,8 @@ ...@@ -86,7 +86,8 @@
v.entrusted_amount, v.entrusted_amount,
v.amount_tenant, v.amount_tenant,
v.write_off_date, v.write_off_date,
v.write_off_amount v.write_off_amount,
v.division
FROM (SELECT t.contract_id, FROM (SELECT t.contract_id,
(SELECT hbbc.bank_account_id (SELECT hbbc.bank_account_id
FROM hls_bp_master_bank_account hbbc FROM hls_bp_master_bank_account hbbc
...@@ -216,7 +217,8 @@ ...@@ -216,7 +217,8 @@
where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=t.contract_id) write_off_date, where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=t.contract_id) write_off_date,
nvl((select sum(cwo.write_off_due_amount) write_off_amount nvl((select sum(cwo.write_off_due_amount) write_off_amount
from csh_write_off cwo from csh_write_off cwo
where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=t.contract_id),0) write_off_amount where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=t.contract_id),0) write_off_amount,
t.division
FROM con_contract_cashflow f FROM con_contract_cashflow f
join con_contract t join con_contract t
on t.contract_id = f.contract_id on t.contract_id = f.contract_id
......
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=c.contract_id) write_off_date, where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=c.contract_id) write_off_date,
nvl((select sum(cwo.write_off_due_amount) write_off_amount nvl((select sum(cwo.write_off_due_amount) write_off_amount
from csh_write_off cwo from csh_write_off cwo
where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=c.contract_id),0) write_off_amount where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=c.contract_id),0) write_off_amount,
c.division
from csh_payment_req_ln cpr, from csh_payment_req_ln cpr,
con_contract c, con_contract c,
hls_bp_master hbm, hls_bp_master hbm,
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<!--</bm:data-filters>--> <!--</bm:data-filters>-->
<bm:query-fields> <bm:query-fields>
<bm:query-field name="contract_number" queryExpression="v.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/> <bm:query-field name="contract_number" queryExpression="v.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="v.bp_name = ${@bp_name_n}"/> <bm:query-field name="bp_name_n" queryExpression="v.bp_name like &apos;%&apos;||${@bp_name_n}||&apos;%&apos;"/>
<bm:query-field name="bp_id_telnet_n" queryExpression="v.bp_id_telnet_n =${@bp_id_telnet_n}"/> <bm:query-field name="bp_id_telnet_n" queryExpression="v.bp_id_telnet_n =${@bp_id_telnet_n}"/>
<bm:query-field name="deposit_trans_type" queryExpression="v.deposit_trans_type =${@deposit_trans_type}"/> <bm:query-field name="deposit_trans_type" queryExpression="v.deposit_trans_type =${@deposit_trans_type}"/>
<bm:query-field name="trans_review_status" queryExpression="v.trans_review_status =${@trans_review_status}"/> <bm:query-field name="trans_review_status" queryExpression="v.trans_review_status =${@trans_review_status}"/>
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</bm:operations> </bm:operations>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/> <bm:query-field name="contract_number" queryExpression="t1.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="t1.bp_name = ${@bp_name_n}"/> <bm:query-field name="bp_name_n" queryExpression="t1.bp_name like &apos;%&apos;||${@bp_name_n}||&apos;%&apos;"/>
<bm:query-field name="bp_id_telnet_n" queryExpression="t1.bp_id_telnet_n =${@bp_id_telnet_n}"/> <bm:query-field name="bp_id_telnet_n" queryExpression="t1.bp_id_telnet_n =${@bp_id_telnet_n}"/>
<bm:query-field name="deposit_trans_type" queryExpression="t1.source_trans_type = ${@deposit_trans_type}"/> <bm:query-field name="deposit_trans_type" queryExpression="t1.source_trans_type = ${@deposit_trans_type}"/>
<bm:query-field name="trans_review_status" queryExpression="t1.trans_review_status =${@trans_review_status}"/> <bm:query-field name="trans_review_status" queryExpression="t1.trans_review_status =${@trans_review_status}"/>
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
<!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>--> <!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>-->
<bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/> <bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/>
<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/> <bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like ${@bp_name_n} "/> <bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like &apos;%&apos;||${@bp_name_n}||&apos;%&apos; "/>
<bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/> <bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
<!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>--> <!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>-->
<bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/> <bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/>
<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/> <bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like ${@bp_name_n} "/> <bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like &apos;%&apos;||${@bp_name_n}||&apos;%&apos; "/>
<bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/> <bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
<!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>--> <!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>-->
<bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/> <bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/>
<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/> <bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like ${@bp_name_n} "/> <bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like &apos;%&apos;||${@bp_name_n}||&apos;%&apos; "/>
<bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/> <bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
<!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>--> <!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>-->
<bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/> <bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/>
<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/> <bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like ${@bp_name_n} "/> <bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like &apos;%&apos;||${@bp_name_n}||&apos;%&apos; "/>
<bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/> <bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<bm:ref-field name="employee_name" prompt="WFL_WORKFLOW_DELIVER.DELIVER_TO" relationname="e" sourcefield="name"/> <bm:ref-field name="employee_name" prompt="WFL_WORKFLOW_DELIVER.DELIVER_TO" relationname="e" sourcefield="name"/>
</bm:ref-fields> </bm:ref-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter name="query" expression="(exists (select 1 from sys_user su where su.user_id= ${/session/@user_id} and (su.user_name in('HAND','HL_ADMIN') or (su.user_name not in('HAND','HL_ADMIN') and su.user_id=t.recipient_id) )))"/> <!-- <bm:data-filter name="query" expression="(exists (select 1 from sys_user su where su.user_id= ${/session/@user_id} and (su.user_name in('HAND','HL_ADMIN') or (su.user_name not in('HAND','HL_ADMIN') and su.user_id=t.recipient_id) )))"/>-->
<bm:data-filter name="query" expression="(exists (select 1 from sys_role sr where sr.role_id= ${/session/@role_id} and (sr.role_code in('0017','HAND') or (sr.role_code not in('0017','HAND') and ${/session/@user_id}=t.recipient_id) )))"/>
</bm:data-filters> </bm:data-filters>
</bm:model> </bm:model>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<ns1:field name="employee_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="用户姓名"/> <ns1:field name="employee_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="用户姓名"/>
<ns1:field name="email" forDisplay="true" prompt="邮箱"/> <ns1:field name="email" forDisplay="true" prompt="邮箱"/>
<ns1:field name="mobil" forDisplay="true" prompt="号码"/> <ns1:field name="mobil" forDisplay="true" prompt="号码"/>
<ns1:field name="role_admin_amount" expression="(select count(1) from SYS_USER_ROLE_GROUPS_VL t where t.enabled_flag = &apos;Y&apos; and t.role_code in (&apos;0017&apos;,&apos;HAND&apos;) and t.user_id = t1.user_id and t.role_id = ${/session/@role_id})"/>
</ns1:fields> </ns1:fields>
<ns1:query-fields> <ns1:query-fields>
<ns1:query-field field="user_name" queryOperator="like"/> <ns1:query-field field="user_name" queryOperator="like"/>
......
...@@ -108,7 +108,8 @@ ...@@ -108,7 +108,8 @@
Leaf.showErrorMessage('${l:PROMPT}', '售后回租无法操作此项变更!'); Leaf.showErrorMessage('${l:PROMPT}', '售后回租无法操作此项变更!');
return; return;
} }
if(record.get('division') == '70' &&(ccr_document_type == 'LEASE_CHAG' ||ccr_document_type == 'CUT_CHAG')){ if(record.get('division') == '70' && ccr_document_type == 'LEASE_CHAG'){
//if(record.get('division') == '70' &&(ccr_document_type == 'LEASE_CHAG' ||ccr_document_type == 'CUT_CHAG')){
Leaf.showErrorMessage('${l:PROMPT}', '铁甲业务无法操作此项变更!'); Leaf.showErrorMessage('${l:PROMPT}', '铁甲业务无法操作此项变更!');
return; return;
} }
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
} }
}; };
var clc_flag = 'N';
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
debugger; debugger;
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract_change_req'); var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract_change_req');
...@@ -150,6 +151,7 @@ ...@@ -150,6 +151,7 @@
residual_value: record.get('ccr_residual_value') //update by xsh35973 20220613 residual_value: record.get('ccr_residual_value') //update by xsh35973 20220613
}, },
success: function (res) { success: function (res) {
clc_flag = 'Y';
//record.set('et_fee', res.result.et_fee); //record.set('et_fee', res.result.et_fee);
var deposit_deduct =record.get('deposit_deduct')||0; var deposit_deduct =record.get('deposit_deduct')||0;
record.set('et_total_amount', minus(res.result.et_total_amount,deposit_deduct)); record.set('et_total_amount', minus(res.result.et_total_amount,deposit_deduct));
...@@ -163,6 +165,7 @@ ...@@ -163,6 +165,7 @@
record.set('fund_possession_rate', res.result.fund_possession_rate); record.set('fund_possession_rate', res.result.fund_possession_rate);
record.set('last_rent_due_date', res.result.last_rent_due_date); record.set('last_rent_due_date', res.result.last_rent_due_date);
record.set('sum_unreceived_principal', res.result.sum_unreceived_principal); record.set('sum_unreceived_principal', res.result.sum_unreceived_principal);
clc_flag = 'N';
}, },
failure: function () { failure: function () {
record.set('termination_date', ''); record.set('termination_date', '');
...@@ -194,7 +197,7 @@ ...@@ -194,7 +197,7 @@
}); });
} }
//add by xsh35973 添加修改调整后资源占用费提前结清租金跟随变动 //add by xsh35973 添加修改调整后资源占用费提前结清租金跟随变动
if(name == 'fund_possession_cost'){ if(name == 'fund_possession_cost' && clc_flag =='N'){
if (value < 0 || value == NaN || value == undefined) { if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的资金占用费金额应大于等于0!'); Leaf.showMessage('${l:HLS.PROMPT}', '调整后的资金占用费金额应大于等于0!');
setTimeout(function () { setTimeout(function () {
...@@ -208,7 +211,7 @@ ...@@ -208,7 +211,7 @@
record.set('et_due_amount', et_due_amount_result); record.set('et_due_amount', et_due_amount_result);
} }
} }
if(name == 'residual_value'){ if(name == 'residual_value' && clc_flag =='N'){
if (value < 0 || value == NaN || value == undefined) { if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的留购金金额应大于等于0!'); Leaf.showMessage('${l:HLS.PROMPT}', '调整后的留购金金额应大于等于0!');
setTimeout(function () { setTimeout(function () {
...@@ -219,7 +222,7 @@ ...@@ -219,7 +222,7 @@
var et_total_amount_result=plus(plus(plus(plus(record.get('et_due_amount') || 0, record.get('et_fee') || 0), record.get('residual_value') || 0), record.get('overdue_amount') || 0), record.get('ccr_penalty')); var et_total_amount_result=plus(plus(plus(plus(record.get('et_due_amount') || 0, record.get('et_fee') || 0), record.get('residual_value') || 0), record.get('overdue_amount') || 0), record.get('ccr_penalty'));
record.set('et_total_amount',et_total_amount_result); record.set('et_total_amount',et_total_amount_result);
} }
if(name == 'et_due_amount'){ if(name == 'et_due_amount' && clc_flag =='N'){
if (value < 0 || value == NaN || value == undefined) { if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的提前结清租金金额应大于等于0!'); Leaf.showMessage('${l:HLS.PROMPT}', '调整后的提前结清租金金额应大于等于0!');
setTimeout(function () { setTimeout(function () {
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
} }
//如果头id 不为空,就使用自在定义的ds进行查询 //如果头id 不为空,就使用自在定义的ds进行查询
Leaf.onReady(function () { Leaf.onReady(function () {
debugger;
if ('${/parameter/@source_type}' == 'WFL') { if ('${/parameter/@source_type}' == 'WFL') {
document.getElementById('${/parameter/@layout_code}_save').style.display = "none"; document.getElementById('${/parameter/@layout_code}_save').style.display = "none";
} }
...@@ -150,7 +149,6 @@ ...@@ -150,7 +149,6 @@
}; };
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) { window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
debugger;
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd'); var hdds_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_ln'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hd_ds, lineRecords, currency_code; var hd_ds, lineRecords, currency_code;
...@@ -174,13 +172,21 @@ ...@@ -174,13 +172,21 @@
} }
} }
} }
var lnds_records = $(ds_id).getAll();
if (ds.id == ds_id) {
for (var i = 0; i < lnds_records.length; i++) {
if (lnds_records[i].get('division') == '70') {
lnds_records[i].getField('tenant_bank_account_number').setRequired(false);
lnds_records[i].getField('tenant_bank_account_number_n').setRequired(false);
}
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}; };
var first_load_flag = 'N'; var first_load_flag = 'N';
function on_csh_payment_req_temp_ln_ds_load(ds) { function on_csh_payment_req_temp_ln_ds_load(ds) {
debugger;
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln'); var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var records = ds.getAll(); var records = ds.getAll();
if (!'${/parameter/@payment_req_id}' && lnds_id && '${/parameter/@business_type}' == 'PAYMENT') { if (!'${/parameter/@payment_req_id}' && lnds_id && '${/parameter/@business_type}' == 'PAYMENT') {
...@@ -199,6 +205,12 @@ ...@@ -199,6 +205,12 @@
ln_record.getField('tenant_bank_account_number_n').setRequired(false); ln_record.getField('tenant_bank_account_number_n').setRequired(false);
ln_record.getField('tenant_bank_account_name').setRequired(false); ln_record.getField('tenant_bank_account_name').setRequired(false);
} }
var ln_record = $(lnds_id).getCurrentRecord();
if (ln_record.get('division') == '70'){
ln_record.getField('tenant_bank_account_number').setRequired(false);
ln_record.getField('tenant_bank_account_number_n').setRequired(false);
}
} }
} }
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
...@@ -276,7 +288,6 @@ ...@@ -276,7 +288,6 @@
//保存前调用 //保存前调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
debugger;
var check_flag = false; var check_flag = false;
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');
var ds_line_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln'); var ds_line_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
...@@ -448,7 +459,6 @@ ...@@ -448,7 +459,6 @@
}; };
//保存submitsuccess调用 //保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) { window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
debugger;
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
dirty_flag = 'N'; dirty_flag = 'N';
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd'); var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
function onUpdate_csh511_receipt(ds, record, name, value, oldvalue) { function onUpdate_csh511_receipt(ds, record, name, value, oldvalue) {
if (name == 'bp_id') { if (name == 'bp_id') {
if (value != oldvalue) { if (value != oldvalue && '${/parameter/@import_source}' != 'HSBC_ADD'&&'${/parameter/@import_source}' != 'EXCEL_ADD') {
record.set('bp_bank_account_id', ''); record.set('bp_bank_account_id', '');
record.set('bp_bank_account_code', ''); record.set('bp_bank_account_code', '');
record.set('bp_bank_account_name', ''); record.set('bp_bank_account_name', '');
...@@ -839,5 +839,20 @@ ...@@ -839,5 +839,20 @@
</a:screenBody> </a:screenBody>
<script type="text/javascript"><![CDATA[
Leaf.onReady(init);
function init() {
if('${/parameter/@import_source}' == 'HSBC_ADD'||'${/parameter/@import_source}' == 'EXCEL_ADD' ){
var record = $('csh_transaction_receipt_head_ds').getAt(0);
record.getField('transaction_date').setReadOnly(true);
record.getField('transaction_amount').setReadOnly(true);
record.getField('bank_slip_num').setReadOnly(true);
record.getField('ref_v05').setReadOnly(true);
record.getField('bank_account_name').setReadOnly(true);
record.getField('bp_bank_account_name').setReadOnly(true);
}
}
]]></script>
</a:view> </a:view>
</a:screen> </a:screen>
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
return value; return value;
}*/ }*/
if(record.get('confirmed_flag')=='NEW' || record.get('confirmed_flag') == 'CT_REJECTED'){ if(record.get('confirmed_flag')=='NEW' || record.get('confirmed_flag') == 'CT_REJECTED'){
url = $('csh_transaction_receipt_maintain_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=true'; url = $('csh_transaction_receipt_maintain_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=true'+'&import_source='+ record.get('import_source');
}else{ }else{
url = $('csh_transaction_receipt_maintain_readonly_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=false'; url = $('csh_transaction_receipt_maintain_readonly_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=false';
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
$Author: gaoyang $Author: gaoyang
$Date: 2013-8-9 下午03:55:25 $Date: 2013-8-9 下午03:55:25
$Revision: 1.0 $Revision: 1.0
$Purpose: $Purpose:
--> -->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true"> <a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure> <a:init-procedure>
...@@ -17,352 +17,352 @@ ...@@ -17,352 +17,352 @@
<a:link id="hls_fin_calc_get_base_rate_link_id" model="hls.HLS500.hls_fin_calc_get_base_rate" modelaction="update"/> <a:link id="hls_fin_calc_get_base_rate_link_id" model="hls.HLS500.hls_fin_calc_get_base_rate" modelaction="update"/>
<a:link id="get_exchange_rate_link_id" model="basic.hls_get_exchange_rate" modelaction="update"/> <a:link id="get_exchange_rate_link_id" model="basic.hls_get_exchange_rate" modelaction="update"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
var new_calc_flag = 'N'; var new_calc_flag = 'N';
var body_winId = '${/parameter/@winId}', var body_winId = '${/parameter/@winId}',
body = body_winId == '' ? Ext.getBody() : $(body_winId).wrap; body = body_winId == '' ? Ext.getBody() : $(body_winId).wrap;
function lock_calc_current_window(msg) { function lock_calc_current_window(msg) {
Leaf.Masker.mask(body, msg || '${l:HLS.EXECUTING}'); Leaf.Masker.mask(body, msg || '${l:HLS.EXECUTING}');
} }
function unlock_calc_current_window() { function unlock_calc_current_window() {
Leaf.Masker.unmask(body); Leaf.Masker.unmask(body);
} }
function get_warning_message(msg) { function get_warning_message(msg) {
var warning_message, duration; var warning_message, duration;
if (msg) { if (msg) {
warning_message = msg; warning_message = msg;
warning_message = '<font color="red">'+warning_message + '</font>'; warning_message = '<font color="red">'+warning_message + '</font>';
duration = 8000; duration = 8000;
} else { } else {
warning_message = '${l:HLS.SUBMIT_SUCCESS}'; warning_message = '${l:HLS.SUBMIT_SUCCESS}';
duration = 2000; duration = 2000;
} }
parent.Leaf.SideBar.enable = true; parent.Leaf.SideBar.enable = true;
parent.Leaf.SideBar.show({ parent.Leaf.SideBar.show({
html: '<div style="background-color:#ccfbd5;position:absolute;padding-top:5px;padding-bottom:5px;padding-left:20px;padding-right:20px;border:0px solid #009900"><b>'+warning_message+'</b></div>', html: '<div style="background-color:#ccfbd5;position:absolute;padding-top:5px;padding-bottom:5px;padding-left:20px;padding-right:20px;border:0px solid #009900"><b>'+warning_message+'</b></div>',
duration: duration duration: duration
}); });
} }
function set_field_limit(config_record, field) { function set_field_limit(config_record, field) {
// if (config_record.get('lower_limit') || config_record.get('upper_limit')) { // if (config_record.get('lower_limit') || config_record.get('upper_limit')) {
// field.setPropertity('min', config_record.get('lower_limit')); // field.setPropertity('min', config_record.get('lower_limit'));
// field.setPropertity('max', config_record.get('upper_limit')); // field.setPropertity('max', config_record.get('upper_limit'));
// } // }
} }
function set_field_input_mode(record, field, name, input_mode) { function set_field_input_mode(record, field, name, input_mode) {
var current_value = record.get(name); var current_value = record.get(name);
if (input_mode == 'REQUIRED' || (input_mode == 'REQUIRED_ONLY_NOT_NULL' && !Ext.isEmpty(current_value)) || (input_mode == 'REQUIRED_ONLY_NULL' && Ext.isEmpty(current_value))) { if (input_mode == 'REQUIRED' || (input_mode == 'REQUIRED_ONLY_NOT_NULL' && !Ext.isEmpty(current_value)) || (input_mode == 'REQUIRED_ONLY_NULL' && Ext.isEmpty(current_value))) {
field.setRequired(true); field.setRequired(true);
field.setReadOnly(false); field.setReadOnly(false);
} else if (input_mode == 'OPTION' || (input_mode == 'OPTION_ONLY_NOT_NULL' && !Ext.isEmpty(current_value)) || (input_mode == 'OPTION_ONLY_NULL' && Ext.isEmpty(current_value))) { } else if (input_mode == 'OPTION' || (input_mode == 'OPTION_ONLY_NOT_NULL' && !Ext.isEmpty(current_value)) || (input_mode == 'OPTION_ONLY_NULL' && Ext.isEmpty(current_value))) {
field.setRequired(false); field.setRequired(false);
field.setReadOnly(false); field.setReadOnly(false);
} else { } else {
field.setReadOnly(true); field.setReadOnly(true);
}
}
function get_config_column_name(name) {
var query_name, length = name.length;
if (name.substring(length - 2, length) == '_n') {
query_name = name.substring(0, length - 2);
} else {
query_name = name;
}
return query_name;
} }
}
function success_sidebar_show() {
Leaf.SideBar.show({ function get_config_column_name(name) {
msg: '${l:HLS.SUBMIT_SUCCESS}', var query_name, length = name.length;
duration: 2000 if (name.substring(length - 2, length) == '_n') {
}); query_name = name.substring(0, length - 2);
} else {
query_name = name;
}
return query_name;
}
function success_sidebar_show() {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
}
function get_ds_record(ds1, ds2, name) {
return ds1.find('column_name', name) || ds2.find('column_name', name);
}
function from_load_or_update_set(record, fromLoad, name, value) {
if (record.get('percent') == '%' && record.get('validation_type') == 'NUMBERFIELD') {
value = mul(value, 100);
} }
if (fromLoad) {
function get_ds_record(ds1, ds2, name) { record.data[name] = value;
return ds1.find('column_name', name) || ds2.find('column_name', name); } else {
record.set(name, value);
} }
}
function from_load_or_update_set(record, fromLoad, name, value) {
if (record.get('percent') == '%' && record.get('validation_type') == 'NUMBERFIELD') { function get_record_column_value(record) {
value = mul(value, 100); if (record) {
} if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV')) {
if (fromLoad) { return record.get('column_value_c');
record.data[name] = value;
} else { } else {
record.set(name, value); return record.get('column_value');
} }
} else {
return null;
} }
}
function get_record_column_value(record) {
if (record) { function get_data_column_value(record) {
if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV')) { if (record.data) {
return record.get('column_value_c'); if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'COMBOBOX' || record.data['validation_type'] == 'LOV')) {
} else { return record.data['column_value_c'];
return record.get('column_value');
}
} else { } else {
return null; return record.data['column_value'];
} }
} else {
return null;
} }
}
function get_data_column_value(record) {
if (record.data) { function execute_hls_save_special_field(record, value, fromLoad, display_value) {
if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'COMBOBOX' || record.data['validation_type'] == 'LOV')) { if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV')) {
return record.data['column_value_c']; from_load_or_update_set(record, fromLoad, 'column_value_c', value);
} else { if (!Ext.isEmpty(display_value)) {
return record.data['column_value']; from_load_or_update_set(record, fromLoad, 'column_value', display_value);
}
} else {
return null;
} }
} else {
from_load_or_update_set(record, fromLoad, 'column_value', value);
} }
}
function execute_hls_save_special_field(record, value, fromLoad, display_value) {
if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV')) { function data_or_record_set(record, name, value) {
from_load_or_update_set(record, fromLoad, 'column_value_c', value); if (record.set) {
if (!Ext.isEmpty(display_value)) { record.set(name, value);
from_load_or_update_set(record, fromLoad, 'column_value', display_value); } else {
} record.data[name] = value;
} else {
from_load_or_update_set(record, fromLoad, 'column_value', value);
}
} }
}
function data_or_record_set(record, name, value) {
if (record.set) { function get_hls_special_field(record, value, value_name) {
record.set(name, value); data_or_record_set(record, 'column_value_c', value);
} else { if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'LOV' || record.data['validation_type'] == 'COMBOBOX')) {
record.data[name] = value; data_or_record_set(record, 'column_value', value_name);
} return value_name;
} else {
data_or_record_set(record, 'column_value', value);
return value;
}
}
function set_after_check_empty(record, old_value, value, fromLoad, display_value) {
if (Ext.isEmpty(old_value)) {
execute_hls_save_special_field(record, value, fromLoad, display_value);
} }
}
function get_hls_special_field(record, value, value_name) {
data_or_record_set(record, 'column_value_c', value); function special_editor_function(ds, record, name) {
if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'LOV' || record.data['validation_type'] == 'COMBOBOX')) { var temp_hd_attribute_ds = $('temp_hd_attribute_ds'),
data_or_record_set(record, 'column_value', value_name); column_name = record.get('column_name'),
return value_name; exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type'),
exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate'),
currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency');
if (exchange_rate_type_record && exchange_rate_record && currency_record) {
var exchange_rate_type_field = exchange_rate_type_record.getField('column_value'),
exchange_rate_field = exchange_rate_record.getField('column_value');
var currency = get_record_column_value(currency_record),
exchange_rate_type = get_record_column_value(exchange_rate_type_record);
var rate_method_code_record = $('gld_exchage_rate_types_ds').find('type_code', exchange_rate_type);
var rate_method_code;
if (rate_method_code_record) {
rate_method_code = rate_method_code_record.get('rate_method_code');
}
if (currency == '${/model/doc_functional_currency_path/record/@functional_currency_code}') {
exchange_rate_type_field.setRequired(false);
exchange_rate_type_field.setReadOnly(true);
exchange_rate_field.setReadOnly(true);
exchange_rate_field.setRequired(false);
} else { } else {
data_or_record_set(record, 'column_value', value); exchange_rate_type_field.setRequired(true);
return value; exchange_rate_type_field.setReadOnly(false);
} if (check_rate_method_code(rate_method_code)) {
}
function set_after_check_empty(record, old_value, value, fromLoad, display_value) {
if (Ext.isEmpty(old_value)) {
execute_hls_save_special_field(record, value, fromLoad, display_value);
}
}
function special_editor_function(ds, record, name) {
var temp_hd_attribute_ds = $('temp_hd_attribute_ds'),
column_name = record.get('column_name'),
exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type'),
exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate'),
currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency');
if (exchange_rate_type_record && exchange_rate_record && currency_record) {
var exchange_rate_type_field = exchange_rate_type_record.getField('column_value'),
exchange_rate_field = exchange_rate_record.getField('column_value');
var currency = get_record_column_value(currency_record),
exchange_rate_type = get_record_column_value(exchange_rate_type_record);
var rate_method_code_record = $('gld_exchage_rate_types_ds').find('type_code', exchange_rate_type);
var rate_method_code;
if (rate_method_code_record) {
rate_method_code = rate_method_code_record.get('rate_method_code');
}
if (currency == '${/model/doc_functional_currency_path/record/@functional_currency_code}') {
exchange_rate_type_field.setRequired(false);
exchange_rate_type_field.setReadOnly(true);
exchange_rate_field.setReadOnly(true); exchange_rate_field.setReadOnly(true);
exchange_rate_field.setRequired(false); exchange_rate_field.setRequired(false);
} else { } else {
exchange_rate_type_field.setRequired(true); exchange_rate_field.setRequired(true);
exchange_rate_type_field.setReadOnly(false); exchange_rate_field.setReadOnly(false);
if (check_rate_method_code(rate_method_code)) {
exchange_rate_field.setReadOnly(true);
exchange_rate_field.setRequired(false);
} else {
exchange_rate_field.setRequired(true);
exchange_rate_field.setReadOnly(false);
}
} }
} }
} }
}
function call_back_after_check_input_mode(ds, record, name, value, old_value, config_record, fromLine) {
var input_mode, lower_limit; function call_back_after_check_input_mode(ds, record, name, value, old_value, config_record, fromLine) {
if (fromLine) { var input_mode, lower_limit;
input_mode = config_record.get('input_mode'); if (fromLine) {
lower_limit = config_record.get('lower_limit'); input_mode = config_record.get('input_mode');
} else { lower_limit = config_record.get('lower_limit');
input_mode = record.get('input_mode'); } else {
lower_limit = record.get('lower_limit'); input_mode = record.get('input_mode');
} lower_limit = record.get('lower_limit');
if (Ext.isEmpty(value) && (input_mode == 'REQUIRED_ONLY_NOT_NULL' || input_mode == 'OPTION_ONLY_NOT_NULL')) { }
Leaf.SideBar.show({ if (Ext.isEmpty(value) && (input_mode == 'REQUIRED_ONLY_NOT_NULL' || input_mode == 'OPTION_ONLY_NOT_NULL')) {
html: '<div style="background-color:#ccfbd5;position:absolute;padding:3px;border:1px solid #009900;font-size:20px;">' + '${l:HLS500.FIELD_IS_NOT_NULL}' + '</div>', Leaf.SideBar.show({
duration: 2000 html: '<div style="background-color:#ccfbd5;position:absolute;padding:3px;border:1px solid #009900;font-size:20px;">' + '${l:HLS500.FIELD_IS_NOT_NULL}' + '</div>',
}); duration: 2000
setTimeout(function() { });
record.set(name, old_value); setTimeout(function() {
}, 5); record.set(name, old_value);
} }, 5);
} }
}
function create_record_column(temp_head_records, headRecord) {
for (var m = 0;m < temp_head_records.length;m++) { function create_record_column(temp_head_records, headRecord) {
var temp_head_record = temp_head_records[m]; for (var m = 0;m < temp_head_records.length;m++) {
var column_name = temp_head_record.get('column_name'), var temp_head_record = temp_head_records[m];
validation_type = temp_head_record.get('validation_type'), var column_name = temp_head_record.get('column_name'),
column_value_c = temp_head_record.get('column_value_c'), validation_type = temp_head_record.get('validation_type'),
column_value = temp_head_record.get('column_value'), column_value_c = temp_head_record.get('column_value_c'),
finnal_value = ''; column_value = temp_head_record.get('column_value'),
if (column_name == 'price_list') { finnal_value = '';
finnal_value = '${/parameter/@price_list}'; if (column_name == 'price_list') {
} finnal_value = '${/parameter/@price_list}';
if (column_name == 'currency') { }
finnal_value = '${/parameter/@currency}'; if (column_name == 'currency') {
} finnal_value = '${/parameter/@currency}';
if (column_name == 'currency_precision') { }
finnal_value = '${/parameter/@precision}'; if (column_name == 'currency_precision') {
} finnal_value = '${/parameter/@precision}';
if (!Ext.isEmpty(column_value) || !Ext.isEmpty(column_value_c)) { }
if (validation_type == 'DATEPICKER') { if (!Ext.isEmpty(column_value) || !Ext.isEmpty(column_value_c)) {
finnal_value = Leaf.formatDate(column_value); if (validation_type == 'DATEPICKER') {
} else if (temp_head_record.get('lov_return_vcode') == 'N' && (validation_type == 'COMBOBOX' || validation_type == 'LOV')) { finnal_value = Leaf.formatDate(column_value);
if (temp_head_record.get('percent') == '%') { } else if (temp_head_record.get('lov_return_vcode') == 'N' && (validation_type == 'COMBOBOX' || validation_type == 'LOV')) {
finnal_value = div(column_value_c, 100); if (temp_head_record.get('percent') == '%') {
} else { finnal_value = div(column_value_c, 100);
finnal_value = column_value_c;
}
} else if (temp_head_record.get('percent') == '%') {
finnal_value = div(column_value, 100);
} else { } else {
finnal_value = column_value; finnal_value = column_value_c;
} }
} else if (temp_head_record.get('percent') == '%') {
finnal_value = div(column_value, 100);
} else {
finnal_value = column_value;
} }
headRecord.set(column_name, finnal_value);
} }
headRecord.set(column_name, finnal_value);
} }
}
function call_back_after_check_limit(ds, record, name, value, old_value, config_record, fromLine) {
var lower_limit, upper_limit, finnal_value, set_value, current_record; function call_back_after_check_limit(ds, record, name, value, old_value, config_record, fromLine) {
var lower_limit, upper_limit, finnal_value, set_value, current_record;
if (fromLine) {
current_record = config_record;
} else {
current_record = record;
}
lower_limit = current_record.get('lower_limit');
upper_limit = current_record.get('upper_limit');
if (current_record.get('percent') == '%') {
finnal_value = div(value, 100);
set_value = mul(lower_limit, 100);
} else {
finnal_value = value;
set_value = lower_limit;
}
if (!set_value) {
set_value = 0;
}
if (!Ext.isEmpty(value) && (finnal_value < lower_limit || finnal_value > upper_limit)) {
if (fromLine) { if (fromLine) {
current_record = config_record; Leaf.showMessage('${l:PROMPT}', config_record.get('prompt') + '${l:HLS500.VALUE_IS_NOT_BEYOND}');
} else { setTimeout(function() {
current_record = record; if (config_record.get('input_mode') != 'REQUIRED_ONLY_NOT_NULL' && config_record.get('input_mode') != 'OPTION_ONLY_NOT_NULL') {
} record.set(name, null);
lower_limit = current_record.get('lower_limit'); } else {
upper_limit = current_record.get('upper_limit'); record.set(name, set_value);
if (current_record.get('percent') == '%') {
finnal_value = div(value, 100);
set_value = mul(lower_limit, 100);
} else {
finnal_value = value;
set_value = lower_limit;
}
if (!set_value) {
set_value = 0;
}
if (!Ext.isEmpty(value) && (finnal_value < lower_limit || finnal_value > upper_limit)) {
if (fromLine) {
Leaf.showMessage('${l:PROMPT}', config_record.get('prompt') + '${l:HLS500.VALUE_IS_NOT_BEYOND}');
setTimeout(function() {
if (config_record.get('input_mode') != 'REQUIRED_ONLY_NOT_NULL' && config_record.get('input_mode') != 'OPTION_ONLY_NOT_NULL') {
record.set(name, null);
} else {
record.set(name, set_value);
}
}, 5);
} else {
if (name != 'column_value_c') {
Leaf.showMessage('${l:PROMPT}', record.get('prompt') + '${l:HLS500.VALUE_IS_NOT_BEYOND}');
} }
setTimeout(function() { }, 5);
if (record.get('input_mode') != 'REQUIRED_ONLY_NOT_NULL' && record.get('input_mode') != 'OPTION_ONLY_NOT_NULL') { } else {
data_or_record_set(record, 'column_value_c', null); if (name != 'column_value_c') {
data_or_record_set(record, 'column_value', null); Leaf.showMessage('${l:PROMPT}', record.get('prompt') + '${l:HLS500.VALUE_IS_NOT_BEYOND}');
} else {
data_or_record_set(record, 'column_value_c', set_value);
data_or_record_set(record, 'column_value', set_value);
}
}, 5);
} }
setTimeout(function() {
if (record.get('input_mode') != 'REQUIRED_ONLY_NOT_NULL' && record.get('input_mode') != 'OPTION_ONLY_NOT_NULL') {
data_or_record_set(record, 'column_value_c', null);
data_or_record_set(record, 'column_value', null);
} else {
data_or_record_set(record, 'column_value_c', set_value);
data_or_record_set(record, 'column_value', set_value);
}
}, 5);
} }
} }
}
function onLineupdate_setEmpty(ds, record, name, value, old_value) {
var config_record = $('line_attribute_ds').find('column_name', name); function onLineupdate_setEmpty(ds, record, name, value, old_value) {
if (config_record) { var config_record = $('line_attribute_ds').find('column_name', name);
var input_mode = config_record.get('input_mode'); if (config_record) {
call_back_after_check_input_mode(ds, record, name, value, old_value, config_record, true); var input_mode = config_record.get('input_mode');
call_back_after_check_limit(ds, record, name, value, old_value, config_record, true); call_back_after_check_input_mode(ds, record, name, value, old_value, config_record, true);
} call_back_after_check_limit(ds, record, name, value, old_value, config_record, true);
} }
}
function clear_hd_lov_sql_mapping(hd_ds, column_name) {
var hd_lov_mapping_ds = $('hls_fin_calc_lov_getmapping_ds'); function clear_hd_lov_sql_mapping(hd_ds, column_name) {
var hd_records = hd_ds.getAll(); var hd_lov_mapping_ds = $('hls_fin_calc_lov_getmapping_ds');
hd_lov_mapping_ds.setQueryParameter('price_list', '${/parameter/@price_list}'); var hd_records = hd_ds.getAll();
hd_lov_mapping_ds.setQueryParameter('column_name', column_name); hd_lov_mapping_ds.setQueryParameter('price_list', '${/parameter/@price_list}');
hd_lov_mapping_ds.setQueryParameter('layout_area_seq', 'H'); hd_lov_mapping_ds.setQueryParameter('column_name', column_name);
hd_lov_mapping_ds.setQueryParameter('layout_area_seq', 'H');
function clear_mapping_detail(ds) {
hd_lov_mapping_ds.un('load', clear_mapping_detail); function clear_mapping_detail(ds) {
var detail_records = ds.getAll(); hd_lov_mapping_ds.un('load', clear_mapping_detail);
for (var m = 0;m < detail_records.length;m++) { var detail_records = ds.getAll();
var detail_record = detail_records[m]; for (var m = 0;m < detail_records.length;m++) {
for (var name in detail_record.data) { var detail_record = detail_records[m];
var current_name = detail_record.get(name).toLowerCase(); for (var name in detail_record.data) {
if (current_name != 'value_code' && current_name != 'value_name') { var current_name = detail_record.get(name).toLowerCase();
for (var i = 0;i < hd_records.length;i++) { if (current_name != 'value_code' && current_name != 'value_name') {
var single_record = hd_records[i]; for (var i = 0;i < hd_records.length;i++) {
if (single_record.get('column_name').toLowerCase() == current_name) { var single_record = hd_records[i];
data_or_record_set(single_record, 'column_value_c', null); if (single_record.get('column_name').toLowerCase() == current_name) {
data_or_record_set(single_record, 'column_value', null); data_or_record_set(single_record, 'column_value_c', null);
} data_or_record_set(single_record, 'column_value', null);
} }
} }
} }
} }
unlock_calc_current_window(); }
} unlock_calc_current_window();
hd_lov_mapping_ds.on('load', clear_mapping_detail); }
hd_lov_mapping_ds.query(); hd_lov_mapping_ds.on('load', clear_mapping_detail);
} hd_lov_mapping_ds.query();
}
function onEditorupdate_setEmpty(ds, record, name, value, old_value, fromLoad) {
if (!fromLoad) { function onEditorupdate_setEmpty(ds, record, name, value, old_value, fromLoad) {
var column_name = record.get('column_name'); if (!fromLoad) {
var all_records = ds.getAll(); var column_name = record.get('column_name');
for (var i = 0;i < all_records.length;i++) { var all_records = ds.getAll();
var all_record = all_records[i]; for (var i = 0;i < all_records.length;i++) {
var lov_cascade_para1 = all_record.get('lov_cascade_para1'), var all_record = all_records[i];
lov_cascade_para2 = all_record.get('lov_cascade_para2'), var lov_cascade_para1 = all_record.get('lov_cascade_para1'),
lov_cascade_para3 = all_record.get('lov_cascade_para3'); lov_cascade_para2 = all_record.get('lov_cascade_para2'),
if (column_name == lov_cascade_para1 || column_name == lov_cascade_para2 || column_name == lov_cascade_para3) { lov_cascade_para3 = all_record.get('lov_cascade_para3');
data_or_record_set(all_record, 'column_value_c', null); if (column_name == lov_cascade_para1 || column_name == lov_cascade_para2 || column_name == lov_cascade_para3) {
data_or_record_set(all_record, 'column_value', null); data_or_record_set(all_record, 'column_value_c', null);
} data_or_record_set(all_record, 'column_value', null);
}
if (Ext.isEmpty(value) && (record.get('validation_type') == 'LOV' || record.get('validation_type') == 'LOV_C') && !fromLoad) {
lock_calc_current_window();
clear_hd_lov_sql_mapping(ds, column_name);
} }
call_back_after_check_input_mode(ds, record, name, value, old_value);
call_back_after_check_limit(ds, record, name, value, old_value);
} }
if (Ext.isEmpty(value) && (record.get('validation_type') == 'LOV' || record.get('validation_type') == 'LOV_C') && !fromLoad) {
lock_calc_current_window();
clear_hd_lov_sql_mapping(ds, column_name);
}
call_back_after_check_input_mode(ds, record, name, value, old_value);
call_back_after_check_limit(ds, record, name, value, old_value);
} }
}
function getNextMonth(date) { function getNextMonth(date) {
debugger; debugger;
var arr = date.toString().split('-'); var arr = date.toString().split('-');
var year = arr[0]; //获取当前日期的年份 var year = arr[0]; //获取当前日期的年份
var month = arr[1]; //获取当前日期的月份 var month = arr[1]; //获取当前日期的月份
...@@ -384,519 +384,519 @@ ...@@ -384,519 +384,519 @@
var t2 = year + '-' + month2 + '-' + day2; var t2 = year + '-' + month2 + '-' + day2;
return t2; return t2;
} }
function onEditorupdate(ds, record, name, value, old_value, fromLoad) { function onEditorupdate(ds, record, name, value, old_value, fromLoad) {
if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV') && name == 'column_value') { if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV') && name == 'column_value') {
return; return;
} }
var column_name = record.get('column_name'); var column_name = record.get('column_name');
var column_value = record.get('column_value'); var column_value = record.get('column_value');
var temp_hd_attribute_ds = $('temp_hd_attribute_ds'); var temp_hd_attribute_ds = $('temp_hd_attribute_ds');
var exchange_rate_type_record, exchange_rate_record, currency_record, lease_start_date_record, exchange_rate_type_field; var exchange_rate_type_record, exchange_rate_record, currency_record, lease_start_date_record, exchange_rate_type_field;
//add by niminmin 填写租赁开始日期 自动带出支付日 //add by niminmin 填写租赁开始日期 自动带出支付日
if (column_name == 'lease_start_date'&&value&&column_value==value&&'${/parameter/@document_category}'!='CONTRACT') { if (column_name == 'lease_start_date'&&value&&column_value==value) {
var lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date'); var lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date');
var contract_inception_date_reocrd = get_ds_record(ds, temp_hd_attribute_ds, 'contract_inception_date'); var contract_inception_date_reocrd = get_ds_record(ds, temp_hd_attribute_ds, 'contract_inception_date');
var lease_start_date = get_record_column_value(lease_start_date_record); var lease_start_date = get_record_column_value(lease_start_date_record);
var contract_inception_date = get_record_column_value(contract_inception_date_reocrd); var contract_inception_date = get_record_column_value(contract_inception_date_reocrd);
if(lease_start_date_record){ if(lease_start_date_record){
//var day = new Date(value.replace(/-/g, '/')).getDate(); //var day = new Date(value.replace(/-/g, '/')).getDate();
var day = new Date(column_value).format('yyyy-mm-dd'); var day = new Date(column_value).format('yyyy-mm-dd');
var nextDay=getNextMonth(day); var nextDay=getNextMonth(day);
from_load_or_update_set(contract_inception_date_reocrd, fromLoad, 'column_value', nextDay); from_load_or_update_set(contract_inception_date_reocrd, fromLoad, 'column_value', nextDay);
} }
} }
if (column_name == 'lease_times' || column_name == 'annual_pay_times') { if (column_name == 'lease_times' || column_name == 'annual_pay_times') {
var lease_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_times'), var lease_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_times'),
annual_pay_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'annual_pay_times'), annual_pay_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'annual_pay_times'),
lease_term_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_term'), lease_term_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_term'),
lease_term, annual_pay_times = get_record_column_value(annual_pay_times_record), lease_term, annual_pay_times = get_record_column_value(annual_pay_times_record),
lease_times = get_record_column_value(lease_times_record); lease_times = get_record_column_value(lease_times_record);
if (column_name == 'lease_times' && !Ext.isEmpty(value)) { if (column_name == 'lease_times' && !Ext.isEmpty(value)) {
if (annual_pay_times_record && !Ext.isEmpty(annual_pay_times)) { if (annual_pay_times_record && !Ext.isEmpty(annual_pay_times)) {
if (lease_term_record) { if (lease_term_record) {
lease_term = div(value, annual_pay_times).toFixed(3) * 1; lease_term = div(value, annual_pay_times).toFixed(3) * 1;
from_load_or_update_set(lease_term_record, fromLoad, 'column_value', lease_term); from_load_or_update_set(lease_term_record, fromLoad, 'column_value', lease_term);
}
}
} else if (column_name == 'annual_pay_times' && !Ext.isEmpty(value)) {
if (lease_times_record && !Ext.isEmpty(lease_times)) {
if (lease_term_record) {
lease_term = div(lease_times, value).toFixed(3) * 1;
from_load_or_update_set(lease_term_record, fromLoad, 'column_value', lease_term);
}
} }
} }
} else if (column_name == 'lease_term') { } else if (column_name == 'annual_pay_times' && !Ext.isEmpty(value)) {
value = get_record_column_value(record); if (lease_times_record && !Ext.isEmpty(lease_times)) {
lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date'); if (lease_term_record) {
var base_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'base_rate_type'); lease_term = div(lease_times, value).toFixed(3) * 1;
currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency'); from_load_or_update_set(lease_term_record, fromLoad, 'column_value', lease_term);
var base_rate_type = get_record_column_value(base_rate_type_record),
lease_start_date = get_record_column_value(lease_start_date_record),
currency;
if ('${/parameter/@calc_session_id}') {
currency = get_record_column_value(currency_record);
} else {
currency = '${/parameter/@currency}';
}
getBaseRate({
base_rate_type: base_rate_type,
currency: currency,
valid_date: lease_start_date,
month: mul(value, 12)
});
} else if (column_name == 'tax_type_id') {
var vat_flag_record = get_ds_record(ds, temp_hd_attribute_ds, 'vat_flag'),
vat_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'vat_rate');
if (!Ext.isEmpty(value)) {
var tax_type_codes_record = $('tax_type_codes_ds').find('tax_type_id', value);
from_load_or_update_set(vat_flag_record, fromLoad, 'column_value', tax_type_codes_record.get('vat_flag'));
// from_load_or_update_set(vat_rate_record, fromLoad, 'column_value', tax_type_codes_record.get('tax_type_rate'));
} else {
from_load_or_update_set(vat_flag_record, fromLoad, 'column_value', '');
// from_load_or_update_set(vat_rate_record, fromLoad, 'column_value', '');
}
} else if (column_name == 'currency') {
exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type');
exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate');
if (exchange_rate_type_record && exchange_rate_record) {
exchange_rate_type_field = exchange_rate_type_record.getField('column_value');
if (value == '${/model/doc_functional_currency_path/record/@functional_currency_code}') {
// var default_exchage_rate_type_record = $('gld_exchage_rate_types_ds').find('type_code', 'MANUAL');
// if (default_exchage_rate_type_record) {
// from_load_or_update_set(exchange_rate_type_record, fromLoad, 'column_value_c', 'MANUAL');
// from_load_or_update_set(exchange_rate_type_record, fromLoad, 'column_value', default_exchage_rate_type_record.get('type_name'));
// }
from_load_or_update_set(exchange_rate_record, fromLoad, 'column_value', 1);
} else {
set_after_check_empty(exchange_rate_type_record, get_record_column_value(exchange_rate_type_record), '${/model/fnd_financial_option_path/record/@default_exchange_rate_type}', fromLoad, '${/model/fnd_financial_option_path/record/@exchange_rate_type_display}');
} }
} }
} else if (column_name == 'exchange_rate_type' || column_name == 'lease_start_date') {
exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate');
currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency');
lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date');
exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type');
getExchangeRate({
fromCur: '${/model/doc_functional_currency_path/record/@functional_currency_code}',
toCur: get_record_column_value(currency_record),
exchangeRateType: get_record_column_value(exchange_rate_type_record),
exchangeDate: get_record_column_value(lease_start_date_record)
}, ds, temp_hd_attribute_ds, fromLoad);
if (!fromLoad && value != old_value) {
exchange_rate_record.set('column_value', '');
}
} }
onEditorupdate_setEmpty(ds, record, name, value, old_value, fromLoad); } else if (column_name == 'lease_term') {
} value = get_record_column_value(record);
lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date');
function execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad, success_flag) { var base_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'base_rate_type');
var rate_method_code, exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate'), currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency');
exchange_rate_field = exchange_rate_record.getField('column_value'); var base_rate_type = get_record_column_value(base_rate_type_record),
if (success_flag) { lease_start_date = get_record_column_value(lease_start_date_record),
var exchange_rate_quotation_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_quotation'), currency;
exchange_rate = res.result.exchange_rate; if ('${/parameter/@calc_session_id}') {
rate_method_code = res.result.rate_method_code; currency = get_record_column_value(currency_record);
if (check_rate_method_code(rate_method_code)) { } else {
exchange_rate_field.setReadOnly(true); currency = '${/parameter/@currency}';
exchange_rate_field.setRequired(false); }
if (!Ext.isDefined(exchange_rate)) { getBaseRate({
exchange_rate = ''; base_rate_type: base_rate_type,
} currency: currency,
execute_hls_save_special_field(exchange_rate_record, exchange_rate, false, null); valid_date: lease_start_date,
month: mul(value, 12)
});
} else if (column_name == 'tax_type_id') {
var vat_flag_record = get_ds_record(ds, temp_hd_attribute_ds, 'vat_flag'),
vat_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'vat_rate');
if (!Ext.isEmpty(value)) {
var tax_type_codes_record = $('tax_type_codes_ds').find('tax_type_id', value);
from_load_or_update_set(vat_flag_record, fromLoad, 'column_value', tax_type_codes_record.get('vat_flag'));
// from_load_or_update_set(vat_rate_record, fromLoad, 'column_value', tax_type_codes_record.get('tax_type_rate'));
} else {
from_load_or_update_set(vat_flag_record, fromLoad, 'column_value', '');
// from_load_or_update_set(vat_rate_record, fromLoad, 'column_value', '');
}
} else if (column_name == 'currency') {
exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type');
exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate');
if (exchange_rate_type_record && exchange_rate_record) {
exchange_rate_type_field = exchange_rate_type_record.getField('column_value');
if (value == '${/model/doc_functional_currency_path/record/@functional_currency_code}') {
// var default_exchage_rate_type_record = $('gld_exchage_rate_types_ds').find('type_code', 'MANUAL');
// if (default_exchage_rate_type_record) {
// from_load_or_update_set(exchange_rate_type_record, fromLoad, 'column_value_c', 'MANUAL');
// from_load_or_update_set(exchange_rate_type_record, fromLoad, 'column_value', default_exchage_rate_type_record.get('type_name'));
// }
from_load_or_update_set(exchange_rate_record, fromLoad, 'column_value', 1);
} else { } else {
exchange_rate_field.setRequired(true); set_after_check_empty(exchange_rate_type_record, get_record_column_value(exchange_rate_type_record), '${/model/fnd_financial_option_path/record/@default_exchange_rate_type}', fromLoad, '${/model/fnd_financial_option_path/record/@exchange_rate_type_display}');
exchange_rate_field.setReadOnly(false);
} }
var exchange_rate_quotation = res.result.exchange_rate_quotation; }
if (!Ext.isDefined(exchange_rate_quotation)) { } else if (column_name == 'exchange_rate_type' || column_name == 'lease_start_date') {
exchange_rate_quotation = 'DIRECT QUOTATION'; exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate');
} currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency');
execute_hls_save_special_field(exchange_rate_quotation_record, exchange_rate_quotation, false, null); lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date');
exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type');
getExchangeRate({
fromCur: '${/model/doc_functional_currency_path/record/@functional_currency_code}',
toCur: get_record_column_value(currency_record),
exchangeRateType: get_record_column_value(exchange_rate_type_record),
exchangeDate: get_record_column_value(lease_start_date_record)
}, ds, temp_hd_attribute_ds, fromLoad);
if (!fromLoad && value != old_value) {
exchange_rate_record.set('column_value', '');
}
}
onEditorupdate_setEmpty(ds, record, name, value, old_value, fromLoad);
}
function execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad, success_flag) {
var rate_method_code, exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate'),
exchange_rate_field = exchange_rate_record.getField('column_value');
if (success_flag) {
var exchange_rate_quotation_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_quotation'),
exchange_rate = res.result.exchange_rate;
rate_method_code = res.result.rate_method_code;
if (check_rate_method_code(rate_method_code)) {
exchange_rate_field.setReadOnly(true);
exchange_rate_field.setRequired(false);
if (!Ext.isDefined(exchange_rate)) {
exchange_rate = '';
}
execute_hls_save_special_field(exchange_rate_record, exchange_rate, false, null);
} else { } else {
var exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type'), exchange_rate_field.setRequired(true);
exchange_rate_type = get_record_column_value(exchange_rate_type_record); exchange_rate_field.setReadOnly(false);
var rate_method_code_record = $('gld_exchage_rate_types_ds').find('type_code', exchange_rate_type); }
rate_method_code = rate_method_code_record.get('rate_method_code'); var exchange_rate_quotation = res.result.exchange_rate_quotation;
if (check_rate_method_code(rate_method_code)) { if (!Ext.isDefined(exchange_rate_quotation)) {
exchange_rate_field.setRequired(true); exchange_rate_quotation = 'DIRECT QUOTATION';
exchange_rate_field.setReadOnly(true); }
} execute_hls_save_special_field(exchange_rate_quotation_record, exchange_rate_quotation, false, null);
} else {
var exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate_type'),
exchange_rate_type = get_record_column_value(exchange_rate_type_record);
var rate_method_code_record = $('gld_exchage_rate_types_ds').find('type_code', exchange_rate_type);
rate_method_code = rate_method_code_record.get('rate_method_code');
if (check_rate_method_code(rate_method_code)) {
exchange_rate_field.setRequired(true);
exchange_rate_field.setReadOnly(true);
} }
} }
}
function getExchangeRate(param, ds, temp_hd_attribute_ds, fromLoad) {
Leaf.request({ function getExchangeRate(param, ds, temp_hd_attribute_ds, fromLoad) {
url: $('get_exchange_rate_link_id').getUrl(), Leaf.request({
para: { url: $('get_exchange_rate_link_id').getUrl(),
from_currency: param.fromCur, para: {
to_currency: param.toCur, from_currency: param.fromCur,
exchange_date: param.exchangeDate, to_currency: param.toCur,
exchange_rate_type: param.exchangeRateType exchange_date: param.exchangeDate,
}, exchange_rate_type: param.exchangeRateType
success: function(res) { },
execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad, true); success: function(res) {
}, execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad, true);
error: function(res) { },
execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad); error: function(res) {
}, execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad);
failure: function(res) { },
execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad); failure: function(res) {
}, execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad);
scope: this },
scope: this
});
}
function onEditor_load_fire(ds, record, name, value, old_value) {
var temp_hd_attribute_ds = $('temp_hd_attribute_ds');
var currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency'),
currency = get_record_column_value(currency_record),
lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date'),
exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date'),
lease_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_times'),
lease_term_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_term'),
annual_pay_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'annual_pay_times'),
lease_times = get_record_column_value(lease_times_record),
annual_pay_times = get_record_column_value(annual_pay_times_record);
if (name == 'base_rate' && Ext.isEmpty(value)) {
var base_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'base_rate_type');
var base_rate_type = get_record_column_value(base_rate_type_record),
lease_start_date = get_record_column_value(lease_start_date_record),
lease_term = get_record_column_value(lease_term_record);
if (Ext.isEmpty(lease_term) && lease_times_record) {
onEditorupdate(ds, lease_times_record, 'lease_times', lease_times, '', true);
lease_term = get_record_column_value(lease_term_record);
}
getBaseRate({
base_rate_type: base_rate_type,
currency: currency,
valid_date: lease_start_date,
month: mul(lease_term, 12)
}); });
} } else if (name == 'lease_times' || name == 'annual_pay_times') {
if (Ext.isEmpty(lease_term)) {
function onEditor_load_fire(ds, record, name, value, old_value) { if (name == 'lease_times' && lease_times_record) {
var temp_hd_attribute_ds = $('temp_hd_attribute_ds');
var currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency'),
currency = get_record_column_value(currency_record),
lease_start_date_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date'),
exchange_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_start_date'),
lease_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_times'),
lease_term_record = get_ds_record(ds, temp_hd_attribute_ds, 'lease_term'),
annual_pay_times_record = get_ds_record(ds, temp_hd_attribute_ds, 'annual_pay_times'),
lease_times = get_record_column_value(lease_times_record),
annual_pay_times = get_record_column_value(annual_pay_times_record);
if (name == 'base_rate' && Ext.isEmpty(value)) {
var base_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'base_rate_type');
var base_rate_type = get_record_column_value(base_rate_type_record),
lease_start_date = get_record_column_value(lease_start_date_record),
lease_term = get_record_column_value(lease_term_record);
if (Ext.isEmpty(lease_term) && lease_times_record) {
onEditorupdate(ds, lease_times_record, 'lease_times', lease_times, '', true); onEditorupdate(ds, lease_times_record, 'lease_times', lease_times, '', true);
lease_term = get_record_column_value(lease_term_record); } else if (name == 'annual_pay_times' && annual_pay_times_record) {
} onEditorupdate(ds, annual_pay_times_record, 'annual_pay_times', annual_pay_times, '', true);
getBaseRate({
base_rate_type: base_rate_type,
currency: currency,
valid_date: lease_start_date,
month: mul(lease_term, 12)
});
} else if (name == 'lease_times' || name == 'annual_pay_times') {
if (Ext.isEmpty(lease_term)) {
if (name == 'lease_times' && lease_times_record) {
onEditorupdate(ds, lease_times_record, 'lease_times', lease_times, '', true);
} else if (name == 'annual_pay_times' && annual_pay_times_record) {
onEditorupdate(ds, annual_pay_times_record, 'annual_pay_times', annual_pay_times, '', true);
}
}
} else if (name == 'currency_precision') {
if (Ext.isEmpty(value)) {
var doc_currency_record = $('doc_currency_ds').find('currency_code', currency);
if (doc_currency_record) {
record.data['column_value'] = doc_currency_record.get('precision');
}
} }
} }
// else if (name == 'calc_method' && Ext.isEmpty(value)) { } else if (name == 'currency_precision') {
// var calc_method_record = get_ds_record(ds, temp_hd_attribute_ds, 'calc_method'); if (Ext.isEmpty(value)) {
// var calc_method = calc_method_record.get('calc_method'), var doc_currency_record = $('doc_currency_ds').find('currency_code', currency);
// calc_method_name = calc_method_record.get('calc_method_name'); if (doc_currency_record) {
// get_hls_special_field(calc_method_record, calc_method, calc_method_name); record.data['column_value'] = doc_currency_record.get('precision');
// }
else if (name == 'exchange_rate_type' || name == 'lease_start_date') {
var exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate');
if (Ext.isEmpty(get_record_column_value(exchange_rate_record))) {
getExchangeRate({
fromCur: '${/model/doc_functional_currency_path/record/@functional_currency_code}',
toCur: get_record_column_value(currency_record),
exchangeRateType: get_record_column_value(exchange_rate_type_record),
exchangeDate: get_record_column_value(lease_start_date_record)
}, ds, temp_hd_attribute_ds, true);
} }
} }
} }
// else if (name == 'calc_method' && Ext.isEmpty(value)) {
// var calc_method_record = get_ds_record(ds, temp_hd_attribute_ds, 'calc_method');
function onEditorupdate_header(ds, record, name, value, old_value, fromAdd) { // var calc_method = calc_method_record.get('calc_method'),
if (name == 'lease_times' || name == 'annual_pay_times') { // calc_method_name = calc_method_record.get('calc_method_name');
var lease_term; // get_hls_special_field(calc_method_record, calc_method, calc_method_name);
if (name == 'lease_times' && !Ext.isEmpty(record.get('annual_pay_times'))) { // }
lease_term = div(value, record.get('annual_pay_times')).toFixed(3) * 1; else if (name == 'exchange_rate_type' || name == 'lease_start_date') {
} else if (name == 'annual_pay_times' && !Ext.isEmpty(record.get('lease_times'))) { var exchange_rate_record = get_ds_record(ds, temp_hd_attribute_ds, 'exchange_rate');
lease_term = div(record.get('lease_times'), value).toFixed(3) * 1; if (Ext.isEmpty(get_record_column_value(exchange_rate_record))) {
} getExchangeRate({
if (fromAdd) {
record.data['lease_term'] = lease_term;
} else {
record.set('lease_term', lease_term);
}
} else if (name == 'lease_term') {
if (value != old_value) {
new_calc_flag = 'Y';
getBaseRate({
base_rate_type: record.get('base_rate_type'),
currency: record.get('currency'),
valid_date: record.get('lease_start_date'),
month: mul(value, 12)
});
}
} else if (name == 'tax_type_id') {
if (!Ext.isEmpty(value) && (record.get('vat_flag') || record.get('vat_rate'))) {
var tax_type_codes_record = $('tax_type_codes_ds').find('tax_type_id', value);
from_load_or_update_set(record, fromAdd, 'vat_flag', tax_type_codes_record.get('vat_flag'));
// from_load_or_update_set(record, fromAdd, 'vat_rate', tax_type_codes_record.get('tax_type_rate'));
} else {
from_load_or_update_set(record, fromAdd, 'vat_flag', '');
// from_load_or_update_set(record, fromAdd, 'vat_rate', '');
}
} else if (name == 'currency_precision') {
if (Ext.isEmpty(value) && fromAdd) {
var doc_currency_record = $('doc_currency_ds').find('currency_code', record.get('currency'));
if (doc_currency_record) {
record.data['currency_precision'] = doc_currency_record.get('precision');
}
}
} else if (name == 'exchange_rate_type' || name == 'lease_start_date') {
get_quotation_ExchangeRate({
fromCur: '${/model/doc_functional_currency_path/record/@functional_currency_code}', fromCur: '${/model/doc_functional_currency_path/record/@functional_currency_code}',
toCur: record.get('currency'), toCur: get_record_column_value(currency_record),
exchangeRateType: record.get('exchange_rate_type'), exchangeRateType: get_record_column_value(exchange_rate_type_record),
exchangeDate: record.get('lease_start_date') exchangeDate: get_record_column_value(lease_start_date_record)
}, record, fromAdd); }, ds, temp_hd_attribute_ds, true);
} }
} }
}
function check_rate_method_code(rate_method_code) {
if (!rate_method_code || !Ext.isDefined(rate_method_code) || rate_method_code == 'PERIOD' || rate_method_code == 'DAILY' || rate_method_code == 'FIXED') {
return true; function onEditorupdate_header(ds, record, name, value, old_value, fromAdd) {
if (name == 'lease_times' || name == 'annual_pay_times') {
var lease_term;
if (name == 'lease_times' && !Ext.isEmpty(record.get('annual_pay_times'))) {
lease_term = div(value, record.get('annual_pay_times')).toFixed(3) * 1;
} else if (name == 'annual_pay_times' && !Ext.isEmpty(record.get('lease_times'))) {
lease_term = div(record.get('lease_times'), value).toFixed(3) * 1;
}
if (fromAdd) {
record.data['lease_term'] = lease_term;
} else { } else {
return false; record.set('lease_term', lease_term);
} }
} } else if (name == 'lease_term') {
if (value != old_value) {
function execute_after_quotation_getexchangerate(res, record, fromAdd, success_flag) { new_calc_flag = 'Y';
var rate_method_code, exchange_rate, exchange_rate_field = record.getField('exchange_rate'); getBaseRate({
if (success_flag) { base_rate_type: record.get('base_rate_type'),
rate_method_code = res.result.rate_method_code; currency: record.get('currency'),
exchange_rate = res.result.exchange_rate; valid_date: record.get('lease_start_date'),
if (check_rate_method_code(rate_method_code)) { month: mul(value, 12)
exchange_rate_field.setReadOnly(true); });
exchange_rate_field.setRequired(false); }
if (!Ext.isDefined(exchange_rate)) { } else if (name == 'tax_type_id') {
exchange_rate = ''; if (!Ext.isEmpty(value) && (record.get('vat_flag') || record.get('vat_rate'))) {
} var tax_type_codes_record = $('tax_type_codes_ds').find('tax_type_id', value);
from_load_or_update_set(record, fromAdd, 'exchange_rate', exchange_rate); from_load_or_update_set(record, fromAdd, 'vat_flag', tax_type_codes_record.get('vat_flag'));
} else { // from_load_or_update_set(record, fromAdd, 'vat_rate', tax_type_codes_record.get('tax_type_rate'));
exchange_rate_field.setRequired(true);
exchange_rate_field.setReadOnly(false);
}
var exchange_rate_quotation = res.result.exchange_rate_quotation;
if (!Ext.isDefined(exchange_rate_quotation)) {
exchange_rate_quotation = 'DIRECT QUOTATION';
}
from_load_or_update_set(record, fromAdd, 'exchange_rate_quotation', exchange_rate_quotation);
} else { } else {
rate_method_code = $('gld_exchage_rate_types_ds').find('type_code', record.get('exchange_rate_type')); from_load_or_update_set(record, fromAdd, 'vat_flag', '');
if (check_rate_method_code(rate_method_code)) { // from_load_or_update_set(record, fromAdd, 'vat_rate', '');
exchange_rate_field.setReadOnly(true); }
exchange_rate_field.setRequired(false); } else if (name == 'currency_precision') {
if (Ext.isEmpty(value) && fromAdd) {
var doc_currency_record = $('doc_currency_ds').find('currency_code', record.get('currency'));
if (doc_currency_record) {
record.data['currency_precision'] = doc_currency_record.get('precision');
} }
} }
} else if (name == 'exchange_rate_type' || name == 'lease_start_date') {
get_quotation_ExchangeRate({
fromCur: '${/model/doc_functional_currency_path/record/@functional_currency_code}',
toCur: record.get('currency'),
exchangeRateType: record.get('exchange_rate_type'),
exchangeDate: record.get('lease_start_date')
}, record, fromAdd);
} }
}
function get_quotation_ExchangeRate(param, record, fromAdd) {
Leaf.request({ function check_rate_method_code(rate_method_code) {
url: $('get_exchange_rate_link_id').getUrl(), if (!rate_method_code || !Ext.isDefined(rate_method_code) || rate_method_code == 'PERIOD' || rate_method_code == 'DAILY' || rate_method_code == 'FIXED') {
para: { return true;
from_currency: param.fromCur, } else {
to_currency: param.toCur, return false;
exchange_date: param.exchangeDate,
exchange_rate_type: param.exchangeRateType
},
success: function(res) {
execute_after_quotation_getexchangerate(res, record, fromAdd, true);
},
error: function(res) {
execute_after_quotation_getexchangerate(res, record, fromAdd);
},
failure: function(res) {
execute_after_quotation_getexchangerate(res, record, fromAdd);
},
scope: this
});
}
function getBaseRate(param) {
Leaf.request({
url: $('hls_fin_calc_get_base_rate_link_id').getUrl(),
para: {
base_rate_type: param.base_rate_type,
currency: param.currency,
valid_date: param.valid_date,
month: param.month
},
sync: true,
success: setBaseRate,
failure: function() {},
error: function() {},
scope: this
});
} }
}
function setBaseRate(res) {
if (new_calc_flag == 'N') { function execute_after_quotation_getexchangerate(res, record, fromAdd, success_flag) {
base_rate_record = get_ds_record($('hls_fin_calculator_hd_ds'), $('temp_hd_attribute_ds'), 'base_rate'); var rate_method_code, exchange_rate, exchange_rate_field = record.getField('exchange_rate');
if (!base_rate_record) { if (success_flag) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS500.BASE_RATE_IS_NULL}'); rate_method_code = res.result.rate_method_code;
} exchange_rate = res.result.exchange_rate;
if (res.result.base_rate && base_rate_record) { if (check_rate_method_code(rate_method_code)) {
base_rate_record.set('column_value', mul(res.result.base_rate, 100)); exchange_rate_field.setReadOnly(true);
} exchange_rate_field.setRequired(false);
if (!Ext.isDefined(exchange_rate)) {
exchange_rate = '';
}
from_load_or_update_set(record, fromAdd, 'exchange_rate', exchange_rate);
} else { } else {
var head_record = $('hls_fin_calculator_hd_ds').getAt(0); exchange_rate_field.setRequired(true);
head_record.set('base_rate', mul(res.result.base_rate, 100)); exchange_rate_field.setReadOnly(false);
} }
} var exchange_rate_quotation = res.result.exchange_rate_quotation;
if (!Ext.isDefined(exchange_rate_quotation)) {
function set_calc_record_para(object, record, combobox_ds, field, param) { exchange_rate_quotation = 'DIRECT QUOTATION';
if (param && '${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') { }
record = get_ds_record($('hls_fin_calculator_hd_ds'), $('temp_hd_attribute_ds'), param); from_load_or_update_set(record, fromAdd, 'exchange_rate_quotation', exchange_rate_quotation);
if (object == 'LOV') { } else {
var temp = get_record_column_value(record); rate_method_code = $('gld_exchage_rate_types_ds').find('type_code', record.get('exchange_rate_type'));
field.setLovPara(param, get_record_column_value(record)); if (check_rate_method_code(rate_method_code)) {
} else if (object == 'COMBOBOX') { exchange_rate_field.setReadOnly(true);
combobox_ds.setQueryParameter(param, get_record_column_value(record)); exchange_rate_field.setRequired(false);
}
} else if (param && '${/parameter/@calc_type}' == 'LITE_CALCULATOR') {
var current_record = $('hls_fin_calculator_hd_ds').getCurrentRecord();
if (object == 'LOV') {
field.setLovPara(param, current_record.get(param));
} else if (object == 'COMBOBOX') {
combobox_ds.setQueryParameter(param, current_record.get(param));
}
} }
} }
}
function hls_fin_get_column_name(name) {
var query_name, length = name.length; function get_quotation_ExchangeRate(param, record, fromAdd) {
if (name.substring(length - 2, length) == '_n') { Leaf.request({
query_name = name.substring(0, length - 2); url: $('get_exchange_rate_link_id').getUrl(),
} else { para: {
query_name = name; from_currency: param.fromCur,
to_currency: param.toCur,
exchange_date: param.exchangeDate,
exchange_rate_type: param.exchangeRateType
},
success: function(res) {
execute_after_quotation_getexchangerate(res, record, fromAdd, true);
},
error: function(res) {
execute_after_quotation_getexchangerate(res, record, fromAdd);
},
failure: function(res) {
execute_after_quotation_getexchangerate(res, record, fromAdd);
},
scope: this
});
}
function getBaseRate(param) {
Leaf.request({
url: $('hls_fin_calc_get_base_rate_link_id').getUrl(),
para: {
base_rate_type: param.base_rate_type,
currency: param.currency,
valid_date: param.valid_date,
month: param.month
},
sync: true,
success: setBaseRate,
failure: function() {},
error: function() {},
scope: this
});
}
function setBaseRate(res) {
if (new_calc_flag == 'N') {
base_rate_record = get_ds_record($('hls_fin_calculator_hd_ds'), $('temp_hd_attribute_ds'), 'base_rate');
if (!base_rate_record) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS500.BASE_RATE_IS_NULL}');
}
if (res.result.base_rate && base_rate_record) {
base_rate_record.set('column_value', mul(res.result.base_rate, 100));
} }
return query_name; } else {
var head_record = $('hls_fin_calculator_hd_ds').getAt(0);
head_record.set('base_rate', mul(res.result.base_rate, 100));
} }
}
function get_lov_cascade(value) {
if (Ext.isEmpty(value)) { function set_calc_record_para(object, record, combobox_ds, field, param) {
return ''; if (param && '${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') {
} else { record = get_ds_record($('hls_fin_calculator_hd_ds'), $('temp_hd_attribute_ds'), param);
return value; if (object == 'LOV') {
var temp = get_record_column_value(record);
field.setLovPara(param, get_record_column_value(record));
} else if (object == 'COMBOBOX') {
combobox_ds.setQueryParameter(param, get_record_column_value(record));
}
} else if (param && '${/parameter/@calc_type}' == 'LITE_CALCULATOR') {
var current_record = $('hls_fin_calculator_hd_ds').getCurrentRecord();
if (object == 'LOV') {
field.setLovPara(param, current_record.get(param));
} else if (object == 'COMBOBOX') {
combobox_ds.setQueryParameter(param, current_record.get(param));
} }
} }
}
function setObjectPara(object, ds, field, para, record) {
if (para) { function hls_fin_get_column_name(name) {
if (object == 'LOV') { var query_name, length = name.length;
field.setLovPara(para, get_lov_cascade(record.get(para))); if (name.substring(length - 2, length) == '_n') {
} else if (object == 'COMBOBOX') { query_name = name.substring(0, length - 2);
ds.setQueryParameter(para, get_lov_cascade(record.get(para))); } else {
} query_name = name;
}
return query_name;
}
function get_lov_cascade(value) {
if (Ext.isEmpty(value)) {
return '';
} else {
return value;
}
}
function setObjectPara(object, ds, field, para, record) {
if (para) {
if (object == 'LOV') {
field.setLovPara(para, get_lov_cascade(record.get(para)));
} else if (object == 'COMBOBOX') {
ds.setQueryParameter(para, get_lov_cascade(record.get(para)));
} }
} }
}
function on_object_hd_calc_focus(object) {
var config_ds = '${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR' ? $('hls_fin_calculator_hd_ds') : $('hd_field_ds'), function on_object_hd_calc_focus(object) {
record = object.record, var config_ds = '${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR' ? $('hls_fin_calculator_hd_ds') : $('hd_field_ds'),
display_name = object.binder.name; record = object.record,
var column_name, field; display_name = object.binder.name;
if ('${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') { var column_name, field;
column_name = record.get('column_name'); if ('${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') {
field = record.getField('column_value'); column_name = record.get('column_name');
} else { field = record.getField('column_value');
column_name = hls_fin_get_column_name(display_name); } else {
field = record.getField(display_name); column_name = hls_fin_get_column_name(display_name);
} field = record.getField(display_name);
var config_record; }
var lov_cascade_para1 = record.get('lov_cascade_para1'), var config_record;
lov_cascade_para2 = record.get('lov_cascade_para2'), var lov_cascade_para1 = record.get('lov_cascade_para1'),
lov_cascade_para3 = record.get('lov_cascade_para3'); lov_cascade_para2 = record.get('lov_cascade_para2'),
if (object instanceof $L.Lov) { lov_cascade_para3 = record.get('lov_cascade_para3');
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para1); if (object instanceof $L.Lov) {
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para2); set_calc_record_para('LOV', config_record, '', field, lov_cascade_para1);
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para3); set_calc_record_para('LOV', config_record, '', field, lov_cascade_para2);
} else if (object instanceof $L.ComboBox) { set_calc_record_para('LOV', config_record, '', field, lov_cascade_para3);
var combobox_ds = object.optionDataSet; } else if (object instanceof $L.ComboBox) {
set_calc_record_para('COMBOBOX', config_record, combobox_ds, field, lov_cascade_para1); var combobox_ds = object.optionDataSet;
set_calc_record_para('COMBOBOX', config_record, combobox_ds, field, lov_cascade_para2); set_calc_record_para('COMBOBOX', config_record, combobox_ds, field, lov_cascade_para1);
set_calc_record_para('COMBOBOX', config_record, combobox_ds, field, lov_cascade_para3); set_calc_record_para('COMBOBOX', config_record, combobox_ds, field, lov_cascade_para2);
combobox_ds.query(); set_calc_record_para('COMBOBOX', config_record, combobox_ds, field, lov_cascade_para3);
} combobox_ds.query();
} }
}
function on_object_ln_calc_focus(object) {
var config_ds = $('line_field_ds'), function on_object_ln_calc_focus(object) {
record = object.record, var config_ds = $('line_field_ds'),
name = object.binder.name; record = object.record,
var config_record = config_ds.find('column_name', name); name = object.binder.name;
var lov_cascade_para1 = config_record.get('lov_cascade_para1'), var config_record = config_ds.find('column_name', name);
lov_cascade_para2 = config_record.get('lov_cascade_para2'), var lov_cascade_para1 = config_record.get('lov_cascade_para1'),
lov_cascade_para3 = config_record.get('lov_cascade_para3'), lov_cascade_para2 = config_record.get('lov_cascade_para2'),
field = record.getField(name); lov_cascade_para3 = config_record.get('lov_cascade_para3'),
if (object instanceof $L.Lov) { field = record.getField(name);
setObjectPara('LOV', '', field, lov_cascade_para1, record); if (object instanceof $L.Lov) {
setObjectPara('LOV', '', field, lov_cascade_para2, record); setObjectPara('LOV', '', field, lov_cascade_para1, record);
setObjectPara('LOV', '', field, lov_cascade_para3, record); setObjectPara('LOV', '', field, lov_cascade_para2, record);
} setObjectPara('LOV', '', field, lov_cascade_para3, record);
} }
}
function on_calc_success_query(dsId, document_category) {
if (!Ext.isEmpty(dsId)) { function on_calc_success_query(dsId, document_category) {
//王炜5743修改,租赁申请项目类不是树组件 if (!Ext.isEmpty(dsId)) {
if(!Ext.isEmpty(document.getElementById('mainFrame2_id'))){ //王炜5743修改,租赁申请项目类不是树组件
if(!Ext.isEmpty(document.getElementById('mainFrame2_id'))){
(document_category == 'PROJECT' ? document.getElementById('mainFrame2_id').contentWindow : self)['$'](dsId).query(); (document_category == 'PROJECT' ? document.getElementById('mainFrame2_id').contentWindow : self)['$'](dsId).query();
}else{ }else{
$(dsId).query(); $(dsId).query();
}
} }
} }
}
function current_win_close() {
$('${/parameter/@winId}').close(); function current_win_close() {
} $('${/parameter/@winId}').close();
}
function on_object_hd_calc_beforecommit(object, record, lov_record) {
var display_name = object.binder.name, function on_object_hd_calc_beforecommit(object, record, lov_record) {
exists_flag = false, var display_name = object.binder.name,
ds = object.binder.ds; exists_flag = false,
var all_records = ds.getAll(); ds = object.binder.ds;
for (var name in lov_record.data) { var all_records = ds.getAll();
if (name != 'value_code' && name != 'value_name') { for (var name in lov_record.data) {
for (var m = 0;m < all_records.length;m++) { if (name != 'value_code' && name != 'value_name') {
var single_record = all_records[m]; for (var m = 0;m < all_records.length;m++) {
if (single_record.get('column_name').toLowerCase() == name.toLowerCase()) { var single_record = all_records[m];
execute_hls_save_special_field(single_record, lov_record.get(name), false, lov_record.get(name + '_n')); if (single_record.get('column_name').toLowerCase() == name.toLowerCase()) {
} execute_hls_save_special_field(single_record, lov_record.get(name), false, lov_record.get(name + '_n'));
} }
} }
} }
} }
}
function on_object_ln_calc_beforecommit(object, record, lov_record) {
var display_name = object.binder.name, function on_object_ln_calc_beforecommit(object, record, lov_record) {
field = record.getField(display_name), var display_name = object.binder.name,
mapping = field.get('mapping'), field = record.getField(display_name),
exists_flag = false; mapping = field.get('mapping'),
for (var name in lov_record.data) { exists_flag = false;
exists_flag = false; for (var name in lov_record.data) {
for (var i = 0, exists_flag = false;
mapping_length = mapping.length;i < mapping_length;i++) { for (var i = 0,
if ((exists_flag = (name == mapping[i]['from']))) { mapping_length = mapping.length;i < mapping_length;i++) {
break; if ((exists_flag = (name == mapping[i]['from']))) {
} break;
} }
if (!exists_flag) { }
mapping.push({ if (!exists_flag) {
from: name, mapping.push({
to: name from: name,
}); to: name
} });
} }
field.setMapping(mapping);
} }
field.setMapping(mapping);
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:dataSet id="tax_type_codes_ds"> <a:dataSet id="tax_type_codes_ds">
......
...@@ -10,7 +10,45 @@ ...@@ -10,7 +10,45 @@
<a:view> <a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="pageLink_choose_acount" url="${/request/@context_path}/modules/hsbc/HSBC100/csh_bank_account_choose.lview"/> <a:link id="pageLink_choose_acount" url="${/request/@context_path}/modules/hsbc/HSBC100/csh_bank_account_choose.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link" url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<a:link id="transaction_return_downloadFile_link_id" url="${/request/@context_path}/downloadFile.lview"/>
<script src="${/request/@context_path}/javascripts/calculate.js"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id);
}
function open_return_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var header_id = record.data.return_id;
var url = $('transaction_return_downloadFile_link_id').getUrl() + '?table_name=CSH_TRANSACTION_RETURN&_csrf=${/session/@_csrf.token}&header_id=' + header_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'transaction_return_uploadFile_id',
width: 850,
height: 400
});
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'contract_number' && value) {
return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
if (name == 'attachment_r') {
return '<a href="javascript:open_return_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + '附件' + '</a>';
}
return value;
};
//创建代付单 //创建代付单
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() { window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln'); var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
...@@ -118,7 +156,61 @@ ...@@ -118,7 +156,61 @@
}); });
}; };
]]></script> window['${/parameter/@layout_code}_on_layout_dynamic_grid_select'] = function(ds, record, bp_seq) {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
var formr_r_ds_id = '${/parameter/@layout_code}_R_F_QUERY__ds';
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_transaction_return');
var form_record = $(form_ds_id).getAt(0);
var form_r_record = $(formr_r_ds_id).getAt(0);
var req_records = $(req_ln_ds_id).getSelected();
var con_records = $(con_ds_id).getSelected();
if (req_ln_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < req_records.length;i++) {
sum = plus(sum, req_records[i].get('unpaid_amount'));
}
form_record.set('total_unpaid_amount', sum);
}
if (con_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < con_records.length;i++) {
sum = plus(sum, con_records[i].get('this_return_amount'));
}
form_r_record.set('total_unpaid_amount', sum);
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_unselect'] = function(ds, record, bp_seq) {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
var formr_r_ds_id = '${/parameter/@layout_code}_R_F_QUERY__ds';
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_transaction_return');
var form_record = $(form_ds_id).getAt(0);
var form_r_record = $(formr_r_ds_id).getAt(0);
var req_records = $(req_ln_ds_id).getSelected();
var con_records = $(con_ds_id).getSelected();
if (req_ln_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < req_records.length;i++) {
sum = plus(sum, req_records[i].get('unpaid_amount'));
}
form_record.set('total_unpaid_amount', sum);
}
if (con_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < con_records.length;i++) {
sum = plus(sum, con_records[i].get('this_return_amount'));
}
form_r_record.set('total_unpaid_amount', sum);
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view> </a:view>
</a:screen> </a:screen>
\ No newline at end of file
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
<a:init-procedure/> <a:init-procedure/>
<a:view> <a:view>
<a:link id="prj_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="prj_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="prj_project_query_link" url="${/request/@context_path}/modules/prj/PRJ501DF/prj_project_maintain.screen"/> <!--<a:link id="prj_project_query_link" url="${/request/@context_path}/modules/prj/PRJ501DF/prj_project_maintain.screen"/>
<a:link id="${/parameter/@layout_code}_df_csh_payment_apply_link" url="${/request/@context_path}/modules/csh/CSH770/df_csh_payment_apply_wfl.screen"/> <a:link id="${/parameter/@layout_code}_df_csh_payment_apply_link" url="${/request/@context_path}/modules/csh/CSH770/df_csh_payment_apply_wfl.screen"/>-->
<a:link id="${/parameter/@layout_code}con_contract_query_link" url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<a:link id="transaction_return_downloadFile_link_id" url="${/request/@context_path}/downloadFile.lview"/>
<script><![CDATA[ <script><![CDATA[
function open_project_win(ds_id, record_id) { /*function open_project_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id); var record = $(ds_id).findById(record_id);
var param = {}; var param = {};
param['project_id'] = record.get('contract_id'); param['project_id'] = record.get('contract_id');
...@@ -35,16 +37,50 @@ ...@@ -35,16 +37,50 @@
param['url_title'] = '付款明细'; param['url_title'] = '付款明细';
param['winid'] = 'payment_req_number_link'; param['winid'] = 'payment_req_number_link';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, '${/parameter/@layout_code}_df_csh_payment_apply_link', ds_id,'${/parameter/@layout_code}'); hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, '${/parameter/@layout_code}_df_csh_payment_apply_link', ds_id,'${/parameter/@layout_code}');
}; };*/
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id,'${/parameter/@layout_code}');
}
function open_return_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var header_id = record.data.source_id;
var url = $('transaction_return_downloadFile_link_id').getUrl() + '?table_name=CSH_TRANSACTION_RETURN&_csrf=${/session/@_csrf.token}&header_id=' + header_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'transaction_return_uploadFile_id',
width: 850,
height: 400
});
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'contract_number' && value && '${/parameter/@lease_channel}' == '01') { if (name == 'contract_number' && value) {
return '<a href="javascript:open_project_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>'; return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
} }
if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') { if (name == 'attachment_r' && record.get('source_table') == 'CSH_TRANSACTION_RETURN') {
return '<a href="javascript:open_return_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + '附件' + '</a>';
}
/*if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') {
link_function = '${/parameter/@layout_code}_payment_req_number_win'; link_function = '${/parameter/@layout_code}_payment_req_number_win';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.get('payment_req_id') + '\',\'' + record.ds.id + '\',\'' + '\');">' + value + '</a>'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.get('payment_req_id') + '\',\'' + record.ds.id + '\',\'' + '\');">' + value + '</a>';
} }
if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') {
return value;
}*/
if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') {
link_function = '${/parameter/@layout_code}_payment_req_number_win';
return value
}
if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') { if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') {
return value; return value;
} }
......
...@@ -233,6 +233,60 @@ ...@@ -233,6 +233,60 @@
} }
}); });
window['${/parameter/@layout_code}_on_layout_dynamic_grid_select'] = function(ds, record, bp_seq) {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
var formr_r_ds_id = '${/parameter/@layout_code}_R_F_QUERY__ds';
var g_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_RESULT', 'hl_hsbc_paying_batch');
var r_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'R_RESULT', 'hl_hsbc_paying_batch');
var form_record = $(form_ds_id).getAt(0);
var form_r_record = $(formr_r_ds_id).getAt(0);
var g_records = $(g_ds_id).getSelected();
var r_records = $(r_ds_id).getSelected();
if (g_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < g_records.length;i++) {
sum = plus(sum, g_records[i].get('totalamt'));
}
form_record.set('total_unpaid_amount', sum);
}
if (r_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < r_records.length;i++) {
sum = plus(sum, r_records[i].get('totalamt'));
}
form_r_record.set('total_unpaid_amount', sum);
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_unselect'] = function(ds, record, bp_seq) {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
var formr_r_ds_id = '${/parameter/@layout_code}_R_F_QUERY__ds';
var g_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_RESULT', 'hl_hsbc_paying_batch');
var r_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'R_RESULT', 'hl_hsbc_paying_batch');
var form_record = $(form_ds_id).getAt(0);
var form_r_record = $(formr_r_ds_id).getAt(0);
var g_records = $(g_ds_id).getSelected();
var r_records = $(r_ds_id).getSelected();
if (g_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < g_records.length;i++) {
sum = plus(sum, g_records[i].get('totalamt'));
}
form_record.set('total_unpaid_amount', sum);
}
if (r_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < r_records.length;i++) {
sum = plus(sum, r_records[i].get('totalamt'));
}
form_r_record.set('total_unpaid_amount', sum);
}
};
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
Leaf.onReady(function () { Leaf.onReady(function () {
var record = $('wfl_workflow_deliver_batch_create_ds').getAt(0); var record = $('wfl_workflow_deliver_batch_create_ds').getAt(0);
if ('${/model/sys_user_employee_rp/record/@user_name}' != 'HAND' && '${/model/sys_user_employee_rp/record/@user_name}' != 'HL_ADMIN') { //if ('${/model/sys_user_employee_rp/record/@user_name}' != 'HAND' && '${/model/sys_user_employee_rp/record/@user_name}' != 'HL_ADMIN') {
if ('${/model/sys_user_employee_rp/record/@role_admin_amount}' == '0' ) {
record.set('recipient_name', '${/model/sys_user_employee_rp/record/@employee_name}'); record.set('recipient_name', '${/model/sys_user_employee_rp/record/@employee_name}');
record.set('recipient_id', '${/model/sys_user_employee_rp/record/@user_id}'); record.set('recipient_id', '${/model/sys_user_employee_rp/record/@user_id}');
record.getField('recipient_name').setReadOnly(true); record.getField('recipient_name').setReadOnly(true);
......
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