Commit 87db2a38 authored by xsh241908's avatar xsh241908

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

# Conflicts:
#	src/main/webapp/WEB-INF/classes/csh/CSH501/csh_payment_req_ln_query.lwm
#	src/main/webapp/modules/csh/CSH501/csh_payment_req.lview
parents 089708ac 8db3d770
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="update">
<bm:parameters>
<bm:parameter name="same_flag" dataType="java.lang.String" input="false" output="true"/>
</bm:parameters>
<bm:update-sql><![CDATA[
BEGIN
cus_con_change_req_pkg.con_guarantor_comparison( p_change_req_id=>${@change_req_id},
p_same_flag =>${@same_flag});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -5,7 +5,7 @@
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1"
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1"
baseTable="CSH_PAYMENT_REQ_LN" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
......@@ -87,6 +87,7 @@
v.amount_tenant,
v.write_off_date,
v.write_off_amount,
v.division,
v.finance_amount
FROM (SELECT t.contract_id,
(SELECT hbbc.bank_account_id
......@@ -218,7 +219,8 @@
nvl((select sum(cwo.write_off_due_amount) write_off_amount
from csh_write_off cwo
where cwo.write_off_type='DEPOSIT_ENTRY' and cwo.contract_id=t.contract_id),0) write_off_amount,
t.finance_amount
t.finance_amount,
t.division
FROM con_contract_cashflow f
join con_contract t
on t.contract_id = f.contract_id
......
......@@ -130,8 +130,8 @@
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
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,
con_contract c,
hls_bp_master hbm,
......
......@@ -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="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="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-fields>
</bm:model>
......@@ -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="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="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-fields>
</bm:model>
......@@ -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="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="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-fields>
</bm:model>
......@@ -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="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="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-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gzj
$Date: 2022年6月14日
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:fields>
<bm:field name="wfl_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WFL_COUNT"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT count(1) wfl_count
FROM con_monthly_statement t
where t.history_flag='N'
and t.status_name ='APPROVING'
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="wfl_count"></bm:field>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gzj
$Date: 2022-10-9 14:14:34
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<!-- <bm:fields>-->
<!-- <bm:field name="sbo_file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ATTACH_FILE_NAME" prompt="HLS.ATTACH_FILE_NAME"/>-->
<!-- <bm:field name="business_file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ATTACH_FILE_NAME" prompt="HLS.ATTACH_FILE_NAME"/>-->
<!-- </bm:fields>-->
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t.*,
(SELECT sv.code_value_name
FROM sys_code_values_v sv
WHERE sv.code = 'HLS_REPORT_NAME'
and sv.code_value = t.report_name
and sv.code_enabled_flag = 'Y') report_name_desc,
hls_sys_upload_pkg.get_atm_file_names(p_table_pk_value => t.tab_id,
p_source_type => 'SBO_REPORT',
p_user_id => 10423) AS sbo_file_name,
hls_sys_upload_pkg.get_atm_file_names(p_table_pk_value => t.tab_id,
p_source_type => 'BUSINESS_REPORT',
p_user_id => 10423) AS business_file_name
FROM con_monthly_statement t
where t.monthly_date = (${@year}||${@month})
and t.history_flag = 'N'
order by t.tab_id asc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
con_monthly_statement_pkg.create_monthly_statement(p_user_id =>${/session/@user_id},
p_date =>${@date});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gzj
$Date: 2022-10-9 14:14:34
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t.*,
(SELECT sv.code_value_name
FROM sys_code_values_v sv
WHERE sv.code = 'HLS_REPORT_NAME'
and sv.code_value = t.report_name
and sv.code_enabled_flag = 'Y') report_name_desc,
hls_sys_upload_pkg.get_atm_file_names(p_table_pk_value => t.tab_id,
p_source_type => 'SBO_REPORT',
p_user_id => 10423) AS sbo_file_name,
hls_sys_upload_pkg.get_atm_file_names(p_table_pk_value => t.tab_id,
p_source_type => 'BUSINESS_REPORT',
p_user_id => 10423) AS business_file_name
FROM con_monthly_statement t
where t.monthly_date = ${@month_date}
and t.batch_number=${@batch_num}
order by t.tab_id asc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
con_monthly_statement_pkg.monthly_wfl_start(p_user_id =>${/session/@user_id},
p_date =>${@date});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gzj
$Date: 2022年6月14日
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT count(1) wfl_count
FROM con_monthly_statement t
where t.monthly_date = ${@date}
and t.status_name ='APPROVED'
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="wfl_count"></bm:field>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 34291
$Date: 2022-10-17 11:26:43
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CON_MONTHLY_ATTACHMENT_LIST">
<bm:fields>
<bm:field name="list_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LIST_ID" prompt="CON_MONTHLY_ATTACHMENT_LIST.LIST_ID"/>
<bm:field name="report_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REPORT_NAME" prompt="CON_MONTHLY_ATTACHMENT_LIST.REPORT_NAME"/>
</bm:fields>
<bm:features>
<o:sequence-pk sequenceName="con_monthly_attachment_list_s"/>
<f:standard-who/>
</bm:features>
<bm:primary-key>
<bm:pk-field name="list_id"/>
</bm:primary-key>
</bm:model>
......@@ -48,6 +48,7 @@
<bm:ref-field name="employee_name" prompt="WFL_WORKFLOW_DELIVER.DELIVER_TO" relationname="e" sourcefield="name"/>
</bm:ref-fields>
<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:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: niujiaqing1265 $
$Date: 2010/11/30 06:14:58 $
$Revision: 1.8 $
$Purpose: 系统级描述
-->
<a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-query model="sys.sys_enable_image_system_query" rootPath="enable_image_system_flag"/>
<p:switch test="/model/enable_image_system_flag/record/@enable_image_system">
<p:case value="Y">
<a:model-query model="img.img_attachment_url" rootPath="att_url"/>
<a:model-query model="img.img_document_num_query" rootPath="doc_info"/>
<a:model-execute model="db.img_pkg.add_doc_to_interface"/>
<a:model-query model="img.img_upload_seqid_query" rootPath="upload"/>
<a:model-execute model="db.img_pkg.add_img_upload_control"/>
<a:model-query model="img.img_download_seqid_query" rootPath="download"/>
<a:model-execute model="db.img_pkg.add_img_download_control"/>
</p:case>
</p:switch>
</a:init-procedure>
<a:view package="leaf.ui.std" template="default">
<!--<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>-->
<script type="text/javascript"><![CDATA[
function selectTabFun(tab,tabIndex){
if(tabIndex == 0){
reloadUpload();
}else if (tabIndex == 1){
reloadDownload();
}
}
function reloadUpload(){
document.getElementById('upload_att').src = '${/model/att_url/record/@img_attachment_url}?type=1&barcode=${/model/doc_info/record/@document_number}&seqid=${/model/upload/record/@upload_seqid}&IMGTYPE=${/model/doc_info/record/@img_type}&IMGNAME=${/model/doc_info/record/@img_name}&CURRENTIMGTYPE=${/model/doc_info/record/@current_img_type}&CURRENTIMGNAME=${/model/doc_info/record/@current_img_name}&_csrf=${/session/@_csrf.token}';
}
function reloadDownload(){
document.getElementById('download_att').src = '${/model/att_url/record/@img_attachment_url}?type=2&barcode=${/model/doc_info/record/@document_number}&seqid=${/model/download/record/@download_seqid}&IMGTYPE=${/model/doc_info/record/@img_type}&IMGNAME=${/model/doc_info/record/@img_name}&CURRENTIMGTYPE=${/model/doc_info/record/@current_img_type}&CURRENTIMGNAME=${/model/doc_info/record/@current_img_name}&_csrf=${/session/@_csrf.token}';
}
//Ext.ux.Lightbox.register('a[ref=img]', true);
]]></script>
<a:screenBody>
<a:switch test="/model/enable_image_system_flag/record/@enable_image_system">
<a:case value="N">
<div style="width:800px">
<a:switch test="/parameter/@useSubFolder">
<a:case value="Y">
<a:upload buttonWidth="75" fileType="*.*" pkvalue="${/parameter/@header_id}" showDelete="false" showUpload="false" sourcetype="${/parameter/@table_name}" text="附件上传" uploadurl="${/request/@context_path}/atm_upload_unUseSubFolder.lsc"/>
</a:case>
<a:case value="*">
<a:upload buttonWidth="75" fileType="*.*" pkvalue="${/parameter/@header_id}" showDelete="false" showUpload="false" sourcetype="${/parameter/@table_name}" text="附件上传" uploadurl="${/request/@context_path}/atm_upload.lsc"/>
</a:case>
</a:switch>
<br/>
</div>
</a:case>
<a:case value="Y">
<a:tabPanel height="380" width="580">
<a:tabs>
<a:tab prompt="附件上传">
<iframe id="upload_att" frameborder="no" height="345" src="${/model/att_url/record/@img_attachment_url}?type=1&amp;barcode=${/model/doc_info/record/@document_number}&amp;seqid=${/model/upload/record/@upload_seqid}&amp;IMGTYPE=${/model/doc_info/record/@img_type}&amp;IMGNAME=${/model/doc_info/record/@img_name}&amp;CURRENTIMGTYPE=${/model/doc_info/record/@current_img_type}&amp;CURRENTIMGNAME=${/model/doc_info/record/@current_img_name}&amp;_csrf=${/session/@_csrf.token}" style="broder:none;margin:0;padding:0;" width="570"/>
</a:tab>
<a:tab prompt="附件查看">
<iframe id="download_att" frameborder="no" height="345" src="${/model/att_url/record/@img_attachment_url}?type=2&amp;barcode=${/model/doc_info/record/@document_number}&amp;seqid=${/model/download/record/@download_seqid}&amp;IMGTYPE=${/model/doc_info/record/@img_type}&amp;IMGNAME=${/model/doc_info/record/@img_name}&amp;CURRENTIMGTYPE=${/model/doc_info/record/@current_img_type}&amp;CURRENTIMGNAME=${/model/doc_info/record/@current_img_name}&amp;_csrf=${/session/@_csrf.token}" style="broder:none;margin:0;padding:0;" width="570"/>
</a:tab>
</a:tabs>
<a:events>
<a:event name="select" handler="selectTabFun"/>
</a:events>
</a:tabPanel>
</a:case>
</a:switch>
</a:screenBody>
</a:view>
</a:screen>
......@@ -15,6 +15,7 @@
<a:link id="con733_quote_calc_change_req_link" model="cont.CON733.calc_change_req" modelaction="execute"/>
<a:link id="con731_submit_link" model="cont.CON731.submit_change_req" modelaction="execute"/>
<a:link id="con731_cancel_link" model="cont.CON731.cancel_change_req" modelaction="execute"/>
<a:link id="con_guarantor_comparison_link" model="cont.CON731.con_guarantor_comparison" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_prj500_cdd_uploadFile_id"
url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id"
......@@ -151,42 +152,42 @@
$(history_con_id).query();
var tennat_score_ds_id=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
var tenant_score_record=$(tennat_score_ds_id).getAt(0);
if(tenant_score_record){
Leaf.request({
url: $('${/parameter/@layout_code}get_bp_tenant_rate_detail_link').getUrl(),
para: {
bp_id: value
},
success: function (data) {
if (data.result.record && !data.result.record.length) {
//评分信息
for (var name in tenant_score_record.data) {
if (name != 'bp_detail_id' && name != 'project_id'&& name != 'contract_id') {
if(data.result.record[name]){
tenant_score_record.set(name, data.result.record[name]);
}else{
tenant_score_record.set(name, '');
}
if(tenant_score_record){
Leaf.request({
url: $('${/parameter/@layout_code}get_bp_tenant_rate_detail_link').getUrl(),
para: {
bp_id: value
},
success: function (data) {
if (data.result.record && !data.result.record.length) {
//评分信息
for (var name in tenant_score_record.data) {
if (name != 'bp_detail_id' && name != 'project_id'&& name != 'contract_id') {
if(data.result.record[name]){
tenant_score_record.set(name, data.result.record[name]);
}else{
tenant_score_record.set(name, '');
}
}
}else{
//未找到则置空
for (var name in tenant_score_record.data) {
if (name != 'bp_detail_id' && name != 'project_id'&& name != 'contract_id') {
tenant_score_record.set(name, '');
}
}
}else{
//未找到则置空
for (var name in tenant_score_record.data) {
if (name != 'bp_detail_id' && name != 'project_id'&& name != 'contract_id') {
tenant_score_record.set(name, '');
}
}
},
failure: function () {
},
error: function () {
},
scope: this
});
}
}
},
failure: function () {
},
error: function () {
},
scope: this
});
}
......@@ -366,17 +367,17 @@
if('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY'){
var tennat_score_ds_id1=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if(ds.id==tennat_score_ds_id1){
if(name=='third_guar_score'&&!Ext.isEmpty(value)){
if(value<0||value>10){
setTimeout(function () {
record.set('third_guar_score', '');
}, 0);
Leaf.showInfoMessage("提示", "第三方担保附件分数范围为0-10,请重新输入!");
}
}
}
if(ds.id==tennat_score_ds_id1){
if(name=='third_guar_score'&&!Ext.isEmpty(value)){
if(value<0||value>10){
setTimeout(function () {
record.set('third_guar_score', '');
}, 0);
Leaf.showInfoMessage("提示", "第三方担保附件分数范围为0-10,请重新输入!");
}
}
}
}
};
......@@ -419,14 +420,14 @@
}
}
var tennat_score_ds_id=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if(tennat_score_ds_id){
var division=record.get('division');
if(division!='70'){
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
}
if(tennat_score_ds_id){
var division=record.get('division');
if(division!='70'){
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
}
}
if ('${/parameter/@function_code}' == 'CON_REPO001D_WQ') {
if (!record.get('rec_residue_amount')) {
......@@ -434,67 +435,67 @@
record.set('rec_residue_amount', rec_residue_amount);
}
}
var tennat_score_ds_id1=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if(ds.id==tennat_score_ds_id1&&tennat_score_ds_id1){
var con_record=$(ds_id).getCurrentRecord();
if(con_record){
var division=con_record.get('division');
if(division!='70'){
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
var tennat_score_ds_id1=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if(ds.id==tennat_score_ds_id1&&tennat_score_ds_id1){
var con_record=$(ds_id).getCurrentRecord();
if(con_record){
var division=con_record.get('division');
if(division!='70'){
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
}
}
//add by xsh35973 调整后不为默认值高亮显示
//调整后逾期罚息
debugger;
var ds_id_req = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_change_req');
if (ds_id_req == ds.id && ds_id_req) {
if(record.get('document_type')=='REPUR_CHAG'|| record.get('document_type')=='ET_CHAG'){
if (record.get('ccr_penalty') != record.get('penalty')) {
var req_change_id_1 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_CCR_PENALTY');
var req_change_input_1 = req_change_id_1.getElementsByTagName('input');
req_change_input_1[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后资金占用费
if (record.get('fund_possession_cost') != record.get('ccr_fund_possession_cost')) {
var req_change_id_2 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_FUND_POSSESSION_COST');
var req_change_input_2 = req_change_id_2.getElementsByTagName('input');
req_change_input_2[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后提前结清手续费
var et_fee = record.get('et_fee');
if (et_fee != 500 && typeof (et_fee) != 'undefined') {
var req_change_id_3 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_ET_FEE');
var req_change_input_3 = req_change_id_3.getElementsByTagName('input');
req_change_input_3[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后留购价
var residual_value = record.get('residual_value');
var ccr_residual_value = record.get('ccr_residual_value');
var amount_250 = record.get('amount_250');
if (amount_250 == 0){
if (residual_value != ccr_residual_value && typeof (residual_value) != 'undefined') {
var req_change_id_4 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_RESIDUAL_VALUE');
var req_change_input_4 = req_change_id_4.getElementsByTagName('input');
req_change_input_4[0].style.setProperty('background-color', '#FF9965', 'important');
if (record.get('ccr_penalty') != record.get('penalty')) {
var req_change_id_1 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_CCR_PENALTY');
var req_change_input_1 = req_change_id_1.getElementsByTagName('input');
req_change_input_1[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后资金占用费
if (record.get('fund_possession_cost') != record.get('ccr_fund_possession_cost')) {
var req_change_id_2 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_FUND_POSSESSION_COST');
var req_change_input_2 = req_change_id_2.getElementsByTagName('input');
req_change_input_2[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后提前结清手续费
var et_fee = record.get('et_fee');
if (et_fee != 500 && typeof (et_fee) != 'undefined') {
var req_change_id_3 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_ET_FEE');
var req_change_input_3 = req_change_id_3.getElementsByTagName('input');
req_change_input_3[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后留购价
var residual_value = record.get('residual_value');
var ccr_residual_value = record.get('ccr_residual_value');
var amount_250 = record.get('amount_250');
if (amount_250 == 0){
if (residual_value != ccr_residual_value && typeof (residual_value) != 'undefined') {
var req_change_id_4 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_RESIDUAL_VALUE');
var req_change_input_4 = req_change_id_4.getElementsByTagName('input');
req_change_input_4[0].style.setProperty('background-color', '#FF9965', 'important');
}
}
if(amount_250 != 0){
if (residual_value != 0 && typeof (residual_value) != 'undefined') {
var req_change_id_4 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_RESIDUAL_VALUE');
var req_change_input_4 = req_change_id_4.getElementsByTagName('input');
req_change_input_4[0].style.setProperty('background-color', '#FF9965', 'important');
}
}
if(amount_250 != 0){
if (residual_value != 0 && typeof (residual_value) != 'undefined') {
var req_change_id_4 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_RESIDUAL_VALUE');
var req_change_input_4 = req_change_id_4.getElementsByTagName('input');
req_change_input_4[0].style.setProperty('background-color', '#FF9965', 'important');
}
}
}
}
}
};
......@@ -561,7 +562,32 @@
};
function con731_submit() {
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交审批?', function () {
var same_flag;
Leaf.request({
url: $('con_guarantor_comparison_link').getUrl(),
para: {
change_req_id: '${/parameter/@change_req_id}',
},
success: function (res) {
debugger;
same_flag= res.result.same_flag;
},
failure: function () {
},
error: function () {
},
scope: this,
sync: true
});
if(same_flag=='Y'){
var showMessage ='是否确认提交审批?';
}else{
var showMessage ='担保人未发生变更,是否确认提交审批?';
}
// debugger;
Leaf.showConfirm('${l:HLS.PROMPT}', showMessage, function () {
var req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var req_record = $(req_ds_id).getAt(0);
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
......@@ -841,14 +867,14 @@
var query_count = 1;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
if ('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY'){
var project_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_01', 'con_contract');
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
if(ds.id==ds_id&& ds_id && query_count == 1) {
query_count = query_count + 1;
var bp_id = $(project_ds_id).getAt(0).get('bp_id_tenant');
$(ds_id).setQueryParameter('bp_id', bp_id);
$(ds_id).query();
}
var project_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_01', 'con_contract');
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
if(ds.id==ds_id&& ds_id && query_count == 1) {
query_count = query_count + 1;
var bp_id = $(project_ds_id).getAt(0).get('bp_id_tenant');
$(ds_id).setQueryParameter('bp_id', bp_id);
$(ds_id).query();
}
}
};
//选择事件(grid,attach,gridbox,table)
......
......@@ -108,7 +108,8 @@
Leaf.showErrorMessage('${l:PROMPT}', '售后回租无法操作此项变更!');
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}', '铁甲业务无法操作此项变更!');
return;
}
......
......@@ -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) {
debugger;
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract_change_req');
......@@ -150,6 +151,7 @@
residual_value: record.get('ccr_residual_value') //update by xsh35973 20220613
},
success: function (res) {
clc_flag = 'Y';
//record.set('et_fee', res.result.et_fee);
var deposit_deduct =record.get('deposit_deduct')||0;
record.set('et_total_amount', minus(res.result.et_total_amount,deposit_deduct));
......@@ -163,6 +165,7 @@
record.set('fund_possession_rate', res.result.fund_possession_rate);
record.set('last_rent_due_date', res.result.last_rent_due_date);
record.set('sum_unreceived_principal', res.result.sum_unreceived_principal);
clc_flag = 'N';
},
failure: function () {
record.set('termination_date', '');
......@@ -194,7 +197,7 @@
});
}
//add by xsh35973 添加修改调整后资源占用费提前结清租金跟随变动
if(name == 'fund_possession_cost'){
if(name == 'fund_possession_cost' && clc_flag =='N'){
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的资金占用费金额应大于等于0!');
setTimeout(function () {
......@@ -208,7 +211,7 @@
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) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的留购金金额应大于等于0!');
setTimeout(function () {
......@@ -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'));
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) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的提前结清租金金额应大于等于0!');
setTimeout(function () {
......
......@@ -66,7 +66,6 @@
}
//如果头id 不为空,就使用自在定义的ds进行查询
Leaf.onReady(function () {
debugger;
if ('${/parameter/@source_type}' == 'WFL') {
document.getElementById('${/parameter/@layout_code}_save').style.display = "none";
}
......@@ -150,7 +149,6 @@
};
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 ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hd_ds, lineRecords, currency_code;
......@@ -192,7 +190,6 @@
var first_load_flag = 'N';
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 records = ds.getAll();
if (!'${/parameter/@payment_req_id}' && lnds_id && '${/parameter/@business_type}' == 'PAYMENT') {
......@@ -211,6 +208,12 @@
ln_record.getField('tenant_bank_account_number_n').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);
}
}
}
......@@ -312,7 +315,6 @@
//保存前调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
debugger;
var check_flag = false;
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');
......@@ -484,7 +486,6 @@
};
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
debugger;
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
dirty_flag = 'N';
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
......
......@@ -128,7 +128,7 @@
function onUpdate_csh511_receipt(ds, record, name, value, oldvalue) {
if (name == 'bp_id') {
if (value != oldvalue && '${/parameter/@import_source}' != 'HSBC_ADD') {
if (value != oldvalue && '${/parameter/@import_source}' != 'HSBC_ADD'&&'${/parameter/@import_source}' != 'EXCEL_ADD') {
record.set('bp_bank_account_id', '');
record.set('bp_bank_account_code', '');
record.set('bp_bank_account_name', '');
......@@ -843,7 +843,7 @@
Leaf.onReady(init);
function init() {
if('${/parameter/@import_source}' == 'HSBC_ADD'){
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);
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-8-9 下午03:55:25
$Revision: 1.0
$Purpose:
$Author: gaoyang
$Date: 2013-8-9 下午03:55:25
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
......@@ -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="get_exchange_rate_link_id" model="basic.hls_get_exchange_rate" modelaction="update"/>
<script type="text/javascript"><![CDATA[
var new_calc_flag = 'N';
var body_winId = '${/parameter/@winId}',
body = body_winId == '' ? Ext.getBody() : $(body_winId).wrap;
function lock_calc_current_window(msg) {
Leaf.Masker.mask(body, msg || '${l:HLS.EXECUTING}');
}
function unlock_calc_current_window() {
Leaf.Masker.unmask(body);
}
function get_warning_message(msg) {
var warning_message, duration;
if (msg) {
warning_message = msg;
warning_message = '<font color="red">'+warning_message + '</font>';
duration = 8000;
} else {
warning_message = '${l:HLS.SUBMIT_SUCCESS}';
duration = 2000;
}
parent.Leaf.SideBar.enable = true;
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>',
duration: duration
});
}
function set_field_limit(config_record, field) {
// if (config_record.get('lower_limit') || config_record.get('upper_limit')) {
// field.setPropertity('min', config_record.get('lower_limit'));
// field.setPropertity('max', config_record.get('upper_limit'));
// }
}
function set_field_input_mode(record, field, name, input_mode) {
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))) {
field.setRequired(true);
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))) {
field.setRequired(false);
field.setReadOnly(false);
} else {
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;
var new_calc_flag = 'N';
var body_winId = '${/parameter/@winId}',
body = body_winId == '' ? Ext.getBody() : $(body_winId).wrap;
function lock_calc_current_window(msg) {
Leaf.Masker.mask(body, msg || '${l:HLS.EXECUTING}');
}
function unlock_calc_current_window() {
Leaf.Masker.unmask(body);
}
function get_warning_message(msg) {
var warning_message, duration;
if (msg) {
warning_message = msg;
warning_message = '<font color="red">'+warning_message + '</font>';
duration = 8000;
} else {
warning_message = '${l:HLS.SUBMIT_SUCCESS}';
duration = 2000;
}
parent.Leaf.SideBar.enable = true;
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>',
duration: duration
});
}
function set_field_limit(config_record, field) {
// if (config_record.get('lower_limit') || config_record.get('upper_limit')) {
// field.setPropertity('min', config_record.get('lower_limit'));
// field.setPropertity('max', config_record.get('upper_limit'));
// }
}
function set_field_input_mode(record, field, name, input_mode) {
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))) {
field.setRequired(true);
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))) {
field.setRequired(false);
field.setReadOnly(false);
} else {
field.setReadOnly(true);
}
function success_sidebar_show() {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
}
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({
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);
}
function get_ds_record(ds1, ds2, name) {
return ds1.find('column_name', name) || ds2.find('column_name', name);
if (fromLoad) {
record.data[name] = value;
} else {
record.set(name, value);
}
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) {
record.data[name] = value;
}
function get_record_column_value(record) {
if (record) {
if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV')) {
return record.get('column_value_c');
} else {
record.set(name, value);
return record.get('column_value');
}
} else {
return null;
}
function get_record_column_value(record) {
if (record) {
if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV')) {
return record.get('column_value_c');
} else {
return record.get('column_value');
}
}
function get_data_column_value(record) {
if (record.data) {
if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'COMBOBOX' || record.data['validation_type'] == 'LOV')) {
return record.data['column_value_c'];
} else {
return null;
return record.data['column_value'];
}
} else {
return null;
}
function get_data_column_value(record) {
if (record.data) {
if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'COMBOBOX' || record.data['validation_type'] == 'LOV')) {
return record.data['column_value_c'];
} else {
return record.data['column_value'];
}
} else {
return null;
}
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')) {
from_load_or_update_set(record, fromLoad, 'column_value_c', value);
if (!Ext.isEmpty(display_value)) {
from_load_or_update_set(record, fromLoad, 'column_value', display_value);
}
} 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')) {
from_load_or_update_set(record, fromLoad, 'column_value_c', value);
if (!Ext.isEmpty(display_value)) {
from_load_or_update_set(record, fromLoad, 'column_value', display_value);
}
} else {
from_load_or_update_set(record, fromLoad, 'column_value', value);
}
}
function data_or_record_set(record, name, value) {
if (record.set) {
record.set(name, value);
} else {
record.data[name] = value;
}
function data_or_record_set(record, name, value) {
if (record.set) {
record.set(name, value);
} else {
record.data[name] = value;
}
}
function get_hls_special_field(record, value, value_name) {
data_or_record_set(record, 'column_value_c', value);
if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'LOV' || record.data['validation_type'] == 'COMBOBOX')) {
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);
if (record.data['lov_return_vcode'] == 'N' && (record.data['validation_type'] == 'LOV' || record.data['validation_type'] == 'COMBOBOX')) {
data_or_record_set(record, 'column_value', value_name);
return value_name;
}
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.setRequired(false);
} 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 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_type_field.setRequired(true);
exchange_rate_type_field.setReadOnly(false);
if (check_rate_method_code(rate_method_code)) {
exchange_rate_field.setReadOnly(true);
exchange_rate_field.setRequired(false);
} else {
exchange_rate_type_field.setRequired(true);
exchange_rate_type_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);
}
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;
if (fromLine) {
input_mode = config_record.get('input_mode');
lower_limit = config_record.get('lower_limit');
} else {
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({
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);
}, 5);
}
}
function call_back_after_check_input_mode(ds, record, name, value, old_value, config_record, fromLine) {
var input_mode, lower_limit;
if (fromLine) {
input_mode = config_record.get('input_mode');
lower_limit = config_record.get('lower_limit');
} else {
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({
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);
}, 5);
}
function create_record_column(temp_head_records, headRecord) {
for (var m = 0;m < temp_head_records.length;m++) {
var temp_head_record = temp_head_records[m];
var column_name = temp_head_record.get('column_name'),
validation_type = temp_head_record.get('validation_type'),
column_value_c = temp_head_record.get('column_value_c'),
column_value = temp_head_record.get('column_value'),
finnal_value = '';
if (column_name == 'price_list') {
finnal_value = '${/parameter/@price_list}';
}
if (column_name == 'currency') {
finnal_value = '${/parameter/@currency}';
}
if (column_name == 'currency_precision') {
finnal_value = '${/parameter/@precision}';
}
if (!Ext.isEmpty(column_value) || !Ext.isEmpty(column_value_c)) {
if (validation_type == 'DATEPICKER') {
finnal_value = Leaf.formatDate(column_value);
} else if (temp_head_record.get('lov_return_vcode') == 'N' && (validation_type == 'COMBOBOX' || validation_type == 'LOV')) {
if (temp_head_record.get('percent') == '%') {
finnal_value = div(column_value_c, 100);
} else {
finnal_value = column_value_c;
}
} else if (temp_head_record.get('percent') == '%') {
finnal_value = div(column_value, 100);
}
function create_record_column(temp_head_records, headRecord) {
for (var m = 0;m < temp_head_records.length;m++) {
var temp_head_record = temp_head_records[m];
var column_name = temp_head_record.get('column_name'),
validation_type = temp_head_record.get('validation_type'),
column_value_c = temp_head_record.get('column_value_c'),
column_value = temp_head_record.get('column_value'),
finnal_value = '';
if (column_name == 'price_list') {
finnal_value = '${/parameter/@price_list}';
}
if (column_name == 'currency') {
finnal_value = '${/parameter/@currency}';
}
if (column_name == 'currency_precision') {
finnal_value = '${/parameter/@precision}';
}
if (!Ext.isEmpty(column_value) || !Ext.isEmpty(column_value_c)) {
if (validation_type == 'DATEPICKER') {
finnal_value = Leaf.formatDate(column_value);
} else if (temp_head_record.get('lov_return_vcode') == 'N' && (validation_type == 'COMBOBOX' || validation_type == 'LOV')) {
if (temp_head_record.get('percent') == '%') {
finnal_value = div(column_value_c, 100);
} 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) {
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) {
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}');
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);
}
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);
}, 5);
} else {
if (name != 'column_value_c') {
Leaf.showMessage('${l:PROMPT}', record.get('prompt') + '${l:HLS500.VALUE_IS_NOT_BEYOND}');
}
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);
if (config_record) {
var input_mode = config_record.get('input_mode');
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');
var hd_records = hd_ds.getAll();
hd_lov_mapping_ds.setQueryParameter('price_list', '${/parameter/@price_list}');
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);
var detail_records = ds.getAll();
for (var m = 0;m < detail_records.length;m++) {
var detail_record = detail_records[m];
for (var name in detail_record.data) {
var current_name = detail_record.get(name).toLowerCase();
if (current_name != 'value_code' && current_name != 'value_name') {
for (var i = 0;i < hd_records.length;i++) {
var single_record = hd_records[i];
if (single_record.get('column_name').toLowerCase() == current_name) {
data_or_record_set(single_record, 'column_value_c', null);
data_or_record_set(single_record, 'column_value', null);
}
}
function onLineupdate_setEmpty(ds, record, name, value, old_value) {
var config_record = $('line_attribute_ds').find('column_name', name);
if (config_record) {
var input_mode = config_record.get('input_mode');
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');
var hd_records = hd_ds.getAll();
hd_lov_mapping_ds.setQueryParameter('price_list', '${/parameter/@price_list}');
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);
var detail_records = ds.getAll();
for (var m = 0;m < detail_records.length;m++) {
var detail_record = detail_records[m];
for (var name in detail_record.data) {
var current_name = detail_record.get(name).toLowerCase();
if (current_name != 'value_code' && current_name != 'value_name') {
for (var i = 0;i < hd_records.length;i++) {
var single_record = hd_records[i];
if (single_record.get('column_name').toLowerCase() == current_name) {
data_or_record_set(single_record, 'column_value_c', null);
data_or_record_set(single_record, 'column_value', null);
}
}
}
}
unlock_calc_current_window();
}
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) {
var column_name = record.get('column_name');
var all_records = ds.getAll();
for (var i = 0;i < all_records.length;i++) {
var all_record = all_records[i];
var lov_cascade_para1 = all_record.get('lov_cascade_para1'),
lov_cascade_para2 = all_record.get('lov_cascade_para2'),
lov_cascade_para3 = all_record.get('lov_cascade_para3');
if (column_name == lov_cascade_para1 || column_name == lov_cascade_para2 || column_name == lov_cascade_para3) {
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);
}
unlock_calc_current_window();
}
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) {
var column_name = record.get('column_name');
var all_records = ds.getAll();
for (var i = 0;i < all_records.length;i++) {
var all_record = all_records[i];
var lov_cascade_para1 = all_record.get('lov_cascade_para1'),
lov_cascade_para2 = all_record.get('lov_cascade_para2'),
lov_cascade_para3 = all_record.get('lov_cascade_para3');
if (column_name == lov_cascade_para1 || column_name == lov_cascade_para2 || column_name == lov_cascade_para3) {
data_or_record_set(all_record, 'column_value_c', null);
data_or_record_set(all_record, 'column_value', null);
}
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) {
debugger;
debugger;
var arr = date.toString().split('-');
var year = arr[0]; //获取当前日期的年份
var month = arr[1]; //获取当前日期的月份
......@@ -384,519 +384,519 @@
var t2 = year + '-' + month2 + '-' + day2;
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') {
return;
}
var column_name = record.get('column_name');
var column_value = record.get('column_value');
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;
//add by niminmin 填写租赁开始日期 自动带出支付日
if (column_name == 'lease_start_date'&&value&&column_value==value&&'${/parameter/@document_category}'!='CONTRACT') {
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 lease_start_date = get_record_column_value(lease_start_date_record);
var contract_inception_date = get_record_column_value(contract_inception_date_reocrd);
if(lease_start_date_record){
//var day = new Date(value.replace(/-/g, '/')).getDate();
var day = new Date(column_value).format('yyyy-mm-dd');
var nextDay=getNextMonth(day);
from_load_or_update_set(contract_inception_date_reocrd, fromLoad, 'column_value', nextDay);
}
}
if (column_name == 'lease_times' || column_name == 'annual_pay_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'),
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_times = get_record_column_value(lease_times_record);
if (column_name == 'lease_times' && !Ext.isEmpty(value)) {
if (annual_pay_times_record && !Ext.isEmpty(annual_pay_times)) {
if (lease_term_record) {
lease_term = div(value, annual_pay_times).toFixed(3) * 1;
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);
}
if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV') && name == 'column_value') {
return;
}
var column_name = record.get('column_name');
var column_value = record.get('column_value');
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;
//add by niminmin 填写租赁开始日期 自动带出支付日
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 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 contract_inception_date = get_record_column_value(contract_inception_date_reocrd);
if(lease_start_date_record){
//var day = new Date(value.replace(/-/g, '/')).getDate();
var day = new Date(column_value).format('yyyy-mm-dd');
var nextDay=getNextMonth(day);
from_load_or_update_set(contract_inception_date_reocrd, fromLoad, 'column_value', nextDay);
}
}
if (column_name == 'lease_times' || column_name == 'annual_pay_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'),
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_times = get_record_column_value(lease_times_record);
if (column_name == 'lease_times' && !Ext.isEmpty(value)) {
if (annual_pay_times_record && !Ext.isEmpty(annual_pay_times)) {
if (lease_term_record) {
lease_term = div(value, annual_pay_times).toFixed(3) * 1;
from_load_or_update_set(lease_term_record, fromLoad, 'column_value', lease_term);
}
}
} 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');
var base_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'base_rate_type');
currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency');
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 == '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 == '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);
}
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 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');
var base_rate_type_record = get_ds_record(ds, temp_hd_attribute_ds, 'base_rate_type');
currency_record = get_ds_record(ds, temp_hd_attribute_ds, 'currency');
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 {
exchange_rate_field.setRequired(true);
exchange_rate_field.setReadOnly(false);
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}');
}
var exchange_rate_quotation = res.result.exchange_rate_quotation;
if (!Ext.isDefined(exchange_rate_quotation)) {
exchange_rate_quotation = 'DIRECT QUOTATION';
}
execute_hls_save_special_field(exchange_rate_quotation_record, exchange_rate_quotation, false, null);
}
} 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);
}
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 {
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);
}
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';
}
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({
url: $('get_exchange_rate_link_id').getUrl(),
para: {
from_currency: param.fromCur,
to_currency: param.toCur,
exchange_date: param.exchangeDate,
exchange_rate_type: param.exchangeRateType
},
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);
},
failure: function(res) {
execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad);
},
scope: this
}
function getExchangeRate(param, ds, temp_hd_attribute_ds, fromLoad) {
Leaf.request({
url: $('get_exchange_rate_link_id').getUrl(),
para: {
from_currency: param.fromCur,
to_currency: param.toCur,
exchange_date: param.exchangeDate,
exchange_rate_type: param.exchangeRateType
},
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);
},
failure: function(res) {
execute_after_getexchangerate(res, ds, temp_hd_attribute_ds, fromLoad);
},
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)
});
}
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) {
} 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);
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)) {
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 == 'annual_pay_times' && annual_pay_times_record) {
onEditorupdate(ds, annual_pay_times_record, 'annual_pay_times', annual_pay_times, '', true);
}
}
// else if (name == 'calc_method' && Ext.isEmpty(value)) {
// var calc_method_record = get_ds_record(ds, temp_hd_attribute_ds, 'calc_method');
// var calc_method = calc_method_record.get('calc_method'),
// calc_method_name = calc_method_record.get('calc_method_name');
// get_hls_special_field(calc_method_record, calc_method, calc_method_name);
// }
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 == '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');
}
}
}
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 {
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({
// else if (name == 'calc_method' && Ext.isEmpty(value)) {
// var calc_method_record = get_ds_record(ds, temp_hd_attribute_ds, 'calc_method');
// var calc_method = calc_method_record.get('calc_method'),
// calc_method_name = calc_method_record.get('calc_method_name');
// get_hls_special_field(calc_method_record, calc_method, calc_method_name);
// }
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: record.get('currency'),
exchangeRateType: record.get('exchange_rate_type'),
exchangeDate: record.get('lease_start_date')
}, record, fromAdd);
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);
}
}
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 {
return false;
record.set('lease_term', lease_term);
}
}
function execute_after_quotation_getexchangerate(res, record, fromAdd, success_flag) {
var rate_method_code, exchange_rate, exchange_rate_field = record.getField('exchange_rate');
if (success_flag) {
rate_method_code = res.result.rate_method_code;
exchange_rate = res.result.exchange_rate;
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 = '';
}
from_load_or_update_set(record, fromAdd, 'exchange_rate', exchange_rate);
} else {
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 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 {
rate_method_code = $('gld_exchage_rate_types_ds').find('type_code', record.get('exchange_rate_type'));
if (check_rate_method_code(rate_method_code)) {
exchange_rate_field.setReadOnly(true);
exchange_rate_field.setRequired(false);
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}',
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({
url: $('get_exchange_rate_link_id').getUrl(),
para: {
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 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;
} else {
return false;
}
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));
}
}
function execute_after_quotation_getexchangerate(res, record, fromAdd, success_flag) {
var rate_method_code, exchange_rate, exchange_rate_field = record.getField('exchange_rate');
if (success_flag) {
rate_method_code = res.result.rate_method_code;
exchange_rate = res.result.exchange_rate;
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 = '';
}
from_load_or_update_set(record, fromAdd, 'exchange_rate', exchange_rate);
} else {
var head_record = $('hls_fin_calculator_hd_ds').getAt(0);
head_record.set('base_rate', mul(res.result.base_rate, 100));
}
}
function set_calc_record_para(object, record, combobox_ds, field, param) {
if (param && '${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') {
record = get_ds_record($('hls_fin_calculator_hd_ds'), $('temp_hd_attribute_ds'), param);
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));
}
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 {
rate_method_code = $('gld_exchage_rate_types_ds').find('type_code', record.get('exchange_rate_type'));
if (check_rate_method_code(rate_method_code)) {
exchange_rate_field.setReadOnly(true);
exchange_rate_field.setRequired(false);
}
}
function hls_fin_get_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;
}
function get_quotation_ExchangeRate(param, record, fromAdd) {
Leaf.request({
url: $('get_exchange_rate_link_id').getUrl(),
para: {
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)) {
return '';
} else {
return value;
}
function set_calc_record_para(object, record, combobox_ds, field, param) {
if (param && '${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') {
record = get_ds_record($('hls_fin_calculator_hd_ds'), $('temp_hd_attribute_ds'), param);
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) {
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 hls_fin_get_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 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'),
record = object.record,
display_name = object.binder.name;
var column_name, field;
if ('${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') {
column_name = record.get('column_name');
field = record.getField('column_value');
} else {
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'),
lov_cascade_para2 = record.get('lov_cascade_para2'),
lov_cascade_para3 = record.get('lov_cascade_para3');
if (object instanceof $L.Lov) {
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para1);
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para2);
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para3);
} else if (object instanceof $L.ComboBox) {
var combobox_ds = object.optionDataSet;
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_para2);
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'),
record = object.record,
name = object.binder.name;
var config_record = config_ds.find('column_name', name);
var lov_cascade_para1 = config_record.get('lov_cascade_para1'),
lov_cascade_para2 = config_record.get('lov_cascade_para2'),
lov_cascade_para3 = config_record.get('lov_cascade_para3'),
field = record.getField(name);
if (object instanceof $L.Lov) {
setObjectPara('LOV', '', field, lov_cascade_para1, 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)) {
//王炜5743修改,租赁申请项目类不是树组件
if(!Ext.isEmpty(document.getElementById('mainFrame2_id'))){
}
function on_object_hd_calc_focus(object) {
var config_ds = '${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR' ? $('hls_fin_calculator_hd_ds') : $('hd_field_ds'),
record = object.record,
display_name = object.binder.name;
var column_name, field;
if ('${/parameter/@calc_type}' == 'CLASSIC_CALCULATOR') {
column_name = record.get('column_name');
field = record.getField('column_value');
} else {
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'),
lov_cascade_para2 = record.get('lov_cascade_para2'),
lov_cascade_para3 = record.get('lov_cascade_para3');
if (object instanceof $L.Lov) {
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para1);
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para2);
set_calc_record_para('LOV', config_record, '', field, lov_cascade_para3);
} else if (object instanceof $L.ComboBox) {
var combobox_ds = object.optionDataSet;
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_para2);
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'),
record = object.record,
name = object.binder.name;
var config_record = config_ds.find('column_name', name);
var lov_cascade_para1 = config_record.get('lov_cascade_para1'),
lov_cascade_para2 = config_record.get('lov_cascade_para2'),
lov_cascade_para3 = config_record.get('lov_cascade_para3'),
field = record.getField(name);
if (object instanceof $L.Lov) {
setObjectPara('LOV', '', field, lov_cascade_para1, 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)) {
//王炜5743修改,租赁申请项目类不是树组件
if(!Ext.isEmpty(document.getElementById('mainFrame2_id'))){
(document_category == 'PROJECT' ? document.getElementById('mainFrame2_id').contentWindow : self)['$'](dsId).query();
}else{
$(dsId).query();
}
}else{
$(dsId).query();
}
}
function current_win_close() {
$('${/parameter/@winId}').close();
}
function on_object_hd_calc_beforecommit(object, record, lov_record) {
var display_name = object.binder.name,
exists_flag = false,
ds = object.binder.ds;
var all_records = ds.getAll();
for (var name in lov_record.data) {
if (name != 'value_code' && name != 'value_name') {
for (var m = 0;m < all_records.length;m++) {
var single_record = all_records[m];
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 current_win_close() {
$('${/parameter/@winId}').close();
}
function on_object_hd_calc_beforecommit(object, record, lov_record) {
var display_name = object.binder.name,
exists_flag = false,
ds = object.binder.ds;
var all_records = ds.getAll();
for (var name in lov_record.data) {
if (name != 'value_code' && name != 'value_name') {
for (var m = 0;m < all_records.length;m++) {
var single_record = all_records[m];
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,
field = record.getField(display_name),
mapping = field.get('mapping'),
exists_flag = false;
for (var name in lov_record.data) {
exists_flag = false;
for (var i = 0,
mapping_length = mapping.length;i < mapping_length;i++) {
if ((exists_flag = (name == mapping[i]['from']))) {
break;
}
}
if (!exists_flag) {
mapping.push({
from: name,
to: name
});
}
}
function on_object_ln_calc_beforecommit(object, record, lov_record) {
var display_name = object.binder.name,
field = record.getField(display_name),
mapping = field.get('mapping'),
exists_flag = false;
for (var name in lov_record.data) {
exists_flag = false;
for (var i = 0,
mapping_length = mapping.length;i < mapping_length;i++) {
if ((exists_flag = (name == mapping[i]['from']))) {
break;
}
}
if (!exists_flag) {
mapping.push({
from: name,
to: name
});
}
field.setMapping(mapping);
}
field.setMapping(mapping);
}
]]></script>
<a:dataSets>
<a:dataSet id="tax_type_codes_ds">
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: qwm
$Date: 2013-12-28 下午1:24:13
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query model="rsc.RSC510.workflow_info" defaultWhereClause="instance_id=${/parameter/@instance_id}" rootPath="wolkflow_path"></a:model-query>
</a:init-procedure>
<a:view>
<a:link id="hls_attachment_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="hls_attachment_uploadonlyFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="hls_month_end_print_id"
url="${/request/@context_path}/modules/cus_deposit/CUS_DEPOSIT106/hls_month_end_print.lsc"/>
<script><![CDATA[
//add by gzj
function detail_upload_window(record_id) {
if('${/model/wolkflow_path/record/@current_seq}' == '10'){
var url = $('hls_attachment_uploadFile_id').getUrl() + '?table_name=BUSINESS_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'hls_month_downloadFile_id',
width: 850,
height: 400
});
}else{
var url = $('hls_attachment_uploadonlyFile_id').getUrl() + '?table_name=BUSINESS_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'month_downloadFile_id',
width: 850,
height: 400
});
}
}
function attachment_upload(val,rec,name) {
return '<a href=javascript:detail_upload_window('+rec.get('tab_id')+')>附件上传</a>';
}
function sbo_detail_upload_window(record_id) {
if('${/model/wolkflow_path/record/@current_seq}' == '10'){
var url = $('hls_attachment_uploadFile_id').getUrl() + '?table_name=SBO_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'hls_sbo_month_downloadFile_id',
width: 850,
height: 400
});
}else{
var url = $('hls_attachment_uploadonlyFile_id').getUrl() + '?table_name=SBO_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'sbo_month_downloadFile_id',
width: 850,
height: 400
});
}
}
function sbo_attachment_upload(val,rec,name) {
return '<a href=javascript:sbo_detail_upload_window('+rec.get('tab_id')+')>附件上传</a>';
}
//审批通过打印审批记录
function month_approved_print() {
debugger;
var headers_ds = $('unearned_finance_income_query_ds');
var record = headers_ds.getCurrentRecord();
var year = record.get('year');
var month = record.get('month');
var date = year+month;
// var record = $('csh_transaction_return_wfl_ds').getCurrentRecord();
// var return_id = record.get('return_id');
var file_name = "报表确认流程" + "-" + year+'年'+ month + "月审批记录";
var url_l = $('hls_month_end_print_id').getUrl() + '?document_id=' + date + '&file_name=' + encodeURI(file_name) + '&document_table=HLS_MONTH_END&batch_flag=Y&source_type=common';
window.open(href = url_l, target = "_self");
}
]]></script>
<a:dataSets>
<a:dataSet id="unearned_finance_income_query_ds" autoCreate="true" >
<a:fields>
<a:field name="month_date" defaultValue="${/parameter/@month_date}"/>
<a:field name="year"/>
<a:field name="month"/>
<a:field name="batch_num" defaultValue="${/parameter/@batch_num}"/>
</a:fields>
</a:dataSet>
<a:dataSet id="report_name_ds" lookupCode="HLS_REPORT_NAME"/>
<a:dataSet id="month_report_ds" autoQuery="true" fetchAll="true" model="hls.HLS801.con_monthly_statement_wfl"
queryDataSet="unearned_finance_income_query_ds">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton id="month_approved_print_id" click="month_approved_print" text="月结报表审批记录打印"/>
</a:screenTopToolbar>
<a:form column="1" marginWidth="80" style="margin-left:3px" title="HLS.QUERY_TITLE">
<a:box column="3" labelWidth="150" style="margin-left:-80px">
<a:textField name="year" bindTarget="unearned_finance_income_query_ds"
prompt="HLS801.YEAR" readOnly="true"/>
<a:textField name="month" bindTarget="unearned_finance_income_query_ds"
prompt="HLS801.MONTH" readOnly="true"/>
</a:box>
</a:form>
<a:grid id="month_report_id" bindTarget="month_report_ds" marginHeight="300"
marginWidth="150">
<a:columns>
<a:column name="report_name" align="center" prompt="报表名称"
width="100" />
<a:column name="sbo_attachment_upload" align="center" prompt="SB0报表" renderer="sbo_attachment_upload" width="80"/>
<a:column name="sbo_file_name" align="center" prompt="附件名称"
width="100" />
<a:column name="attachment_upload" align="center" prompt="业务系统报表" renderer="attachment_upload" width="80"/>
<a:column name="business_file_name" align="center" prompt="附件名称"
width="100" />
</a:columns>
</a:grid>
</a:screenBody>
<script>
Leaf.onReady(function () {
Leaf.onReady(init);
function init() {
debugger;
var a = '${/parameter/@instance_id}';
alert(a);
var record = $('unearned_finance_income_query_ds').getCurrentRecord();
var year = "${/parameter/@month_date}".substring(0, 4);
var month = "${/parameter/@month_date}".substring(4, 6);
record.set('year',year);
record.set('month',month);
if ('${/model/wolkflow_path/record/@current_seq}' == '10'||'${/model/wolkflow_path/record/@current_seq}' == '20') {
document.getElementById("month_approved_print_id").style.display = "none";
}
// var records = $('month_report_ds').getAll()[0];
// var status=records.get('status_name');
// if (status != 'APPROVED') {
// document.getElementById("month_approved_print_id").style.display = "none";
// }
$('month_report_ds').query();
}
})
</script>
</a:view>
</a:screen>
......@@ -14,6 +14,9 @@
<a:model-query autoCount="false" fetchAll="true" model="gld.FND5800.gld_period_status_fieldset"
rootPath="fieldset"/>
<a:model-query autoCount="false" model="hls.HLS801.sys_role_flag" rootPath="sys_role_path"/>
<a:model-query defaultWhereClause="t1.role_id=${/session/@role_id}" fetchAll="true"
model="cont.CON733.query_roles_info" rootPath="role_code"/>
<a:model-query model="hls.HLS801.con_exist_approving" rootPath="con_status"/>
</a:init-procedure>
<a:view>
<a:link id="con_finance_income_link"
......@@ -40,9 +43,15 @@
<a:link id="hls_tax_refresh_link" model="hls.HLS801.hls_tax_act_confirm" modelaction="execute"/>
<a:link id="hls_tax_confirm_create_je_link"
url="${/request/@context_path}/modules/hls/HLS801/tax_confirm.lsc"/>
<a:link id="create_con_monthly_statement_link" model="hls.HLS801.con_monthly_statement" modelaction="update"/>
<a:link id="con_monthly_submit_link" model="hls.HLS801.con_monthly_statement_wfl" modelaction="update"/>
<!-- <a:link id="acp_invoice_attachment_uploadFile_id" url="${/request/@context_path}/check_uploadFile.lview"/>-->
<a:link id="hls_attachment_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="hls_attachment_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="hls_attachment_uploadonlyFile_id" url="${/request/@context_path}/uploadonlyFile.lview"/>
<script><![CDATA[
//HLS801.NEXT_STEP
var step = 0;
var step = 1;
var g_company_id;
var g_company_id_2;
......@@ -56,6 +65,15 @@
history.back();
});
}
if('${/model/role_code/record/@role_code}'!='0013'){
document.getElementById('step_0').style.display = "none";
document.getElementById('step_next').style.display = "none";
}
if('${/model/con_status/record/@wfl_count}'>0){
var rocode= $('attachment_list_ds');
rocode.getField('report_name').setReadOnly(true);
}
$('attachment_list_ds').query();
});
function nextStep() {
......@@ -396,6 +414,147 @@
}
var g_return_value;
function month_end_next() {
var headers_ds = $('hls_monthly_statement_ds');
var record = headers_ds.getAt(0);
var year = record.get('period_name').substring(0, 4);
var month = record.get('period_name').substring(5, 7);
var date = year+month;
var wfl_count;
$L.request({
url: '${/request/@context_path}/autocrud/hls.HLS801.get_wfl_status/query',
para: {
date: date
},
sync: true,
success: function (res) {
wfl_count=res.result.record.wfl_count;
},
error: function () {
},
failure: function () {
},
scope: this,
sync: true,
});
if( wfl_count ==0){
$L.showMessage('提示','请先提交审批在再进行下一步');
return ;
}else{
nextStep();
}
}
//add by gzj
function next_monthly_end() {
debugger;
//nextStep();
var headers_ds = $('hls_monthly_statement_ds');
var record = headers_ds.getAt(0);
var year = record.get('period_name').substring(0, 4);
var month = record.get('period_name').substring(5, 7);
var date = year+month;
Leaf.request({
url: $('create_con_monthly_statement_link').getUrl(),
para: {
date: date
},
success: function () {
$('month_report_ds').query();
nextStep();
},
scope: this
});
}
//add by 月结报表提交审批
function submit() {
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确定提交审批?', function() {
var headers_ds = $('hls_monthly_statement_ds');
var record = headers_ds.getAt(0);
var year = record.get('period_name').substring(0, 4);
var month = record.get('period_name').substring(5, 7);
var date = year+month;
Leaf.request({
url: $('con_monthly_submit_link').getUrl(),
para: {
date: date
},
success: function () {
Leaf.showMessage('${l:HLS.PROMPT}', '提交审批成功');
},
scope: this
});
});
}
function detail_upload_window(record_id) {
var record = $('month_report_ds').getAll()[0];
var status=record.get('status_name');
if(status=='APPROVING'){
var url = $('hls_attachment_downloadFile_id').getUrl() + '?table_name=BUSINESS_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'month_downloadFile_id',
width: 850,
height: 400
});
}else{
var url = $('hls_attachment_uploadFile_id').getUrl() + '?table_name=BUSINESS_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'month_uploadFile_id',
width: 850,
height: 400
});
}
win.on('close', function() {
$('month_report_ds').query();
});
}
function attachment_upload(val,rec,name) {
return '<a href=javascript:detail_upload_window('+rec.get('tab_id')+')>附件上传</a>';
}
function sbo_detail_upload_window(record_id) {
debugger;
var record = $('month_report_ds').getAll()[0];
var status=record.get('status_name');
if(status=='APPROVING'){
var url = $('hls_attachment_downloadFile_id').getUrl() + '?table_name=SBO_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'sbo_month_downloadFile_id',
width: 850,
height: 400
});
}else{
var url = $('hls_attachment_uploadFile_id').getUrl() + '?table_name=SBO_REPORT&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'sbo_month_uploadFile_id',
width: 850,
height: 400
});
}
win.on('close', function() {
$('month_report_ds').query();
});
}
function sbo_attachment_upload(val,rec,name) {
return '<a href=javascript:sbo_detail_upload_window('+rec.get('tab_id')+')>附件上传</a>';
}
function unearned_finance_income_confirm() {
var headers_ds = $('hls_monthly_statement_ds');
......@@ -465,9 +624,38 @@
@Description: 月结结束校验
@Param:
*/
var headers_ds = $('hls_monthly_statement_ds');
var record = headers_ds.getAt(0);
var role_flag = '${/model/sys_role_path/record/@role_code}';
//add by 34291 月结结束前需要提交审批
var year = record.get('period_name').substring(0, 4);
var month = record.get('period_name').substring(5, 7);
var date = year+month;
var wfl_count;
$L.request({
url: '${/request/@context_path}/autocrud/hls.HLS801.get_wfl_status/query',
para: {
date: date
},
sync: true,
success: function (res) {
wfl_count=res.result.record.wfl_count;
},
error: function () {
},
failure: function () {
},
scope: this,
sync: true,
});
if( wfl_count ==0){
$L.showMessage('提示','请先提交审批通过后在再进行下一步');
return ;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '本次月结结束后不可执行当月其他相关操作,是否确认结束?', function okFun() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.SAVING}');
$L.request({
......@@ -808,6 +996,30 @@
});
}
function hls801_add() {
var ds = $('attachment_list_ds');
var record = ds.create(ds.currentIndex);
$('attachment_list_id').showEditorByRecord(record);
}
function hls801_delete() {
var ds = $('attachment_list_ds');
var records = ds.getSelected();
if (records.length != 0) {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS030.CONFIRM_DELETE}', function() {
ds.remove(records);
});
}
}
function hls801_save() {
debugger
var ds = $('attachment_list_ds');
if (ds.validate()) {
ds.submit();
}
}
]]></script>
<a:dataSets>
......@@ -917,6 +1129,19 @@
<a:event name="beforeremove" handler="tax_confirm_beforeremove"/>
</a:events>
</a:dataSet>
<a:dataSet id="report_name_ds" lookupCode="HLS_REPORT_NAME"/>
<a:dataSet id="month_report_ds" autoQuery="false" fetchAll="true" model="hls.HLS801.con_monthly_statement"
queryDataSet="unearned_finance_income_query_ds">
<a:fields>
<a:field name="report_name" />
</a:fields>
</a:dataSet>
<a:dataSet id="attachment_list_ds" autoQuery="true" fetchAll="true" model="hls.HLS801.hls_attachment_list" selectable="true"
queryUrl="${/request/@context_path}/autocrud/hls.HLS801.hls_attachment_list/query">
<a:fields>
<a:field name="report_name" required="true"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
......@@ -928,7 +1153,7 @@
<a:hBox>
<a:tabPanel id="step" marginHeight="80" marginWidth="50">
<a:tabs>
<a:tab id="step_0" disabled="false" marginHeight="20" width="100" prompt="营业月结"
<a:tab id="step_1" disabled="false" marginHeight="20" width="100" prompt="营业月结"
selected="true">
<a:hBox height="50">
<!--<a:button click="upStep" text="HLS801.LAST_STEP"/>-->
......@@ -938,7 +1163,6 @@
<a:button click="csh_transaction_confirm" text="月结确认"/>
<a:label width="5"/>
</a:hBox>
<p/>
<a:grid id="csh_transaction_confirm_grid" bindTarget="csh_transaction_confirm_ds"
marginHeight="200" marginWidth="80" navBar="true" style="margin-left:3px">
......@@ -973,11 +1197,34 @@
<a:hBox>
<a:tabPanel id="step" marginHeight="80" marginWidth="50">
<a:tabs>
<a:tab id="step_0" disabled="false" marginHeight="20" width="100" prompt="营业月结"
selected="true">
<a:tab id="step_0" disabled="true" prompt="月结资料维护" selected="false"
width="100">
<a:hBox height="50">
<a:button disabled="true" click="upStep" text="HLS801.LAST_STEP"/>
<a:label width="5"/>
<a:button click="nextStep" text="HLS801.NEXT_STEP"/>
<a:label width="80"/>
<a:gridButton click="hls801_add" text="新增"/>
<a:gridButton click="hls801_delete" text="删除"/>
<a:gridButton click="hls801_save" text="HLS.SAVE"/>
</a:hBox>
<p/>
<a:grid id="attachment_list_id" bindTarget="attachment_list_ds" marginHeight="200"
marginWidth="80" navBar="true" >
<a:columns>
<a:column name="report_name" align="center" prompt="报表名称" editor="report_name_edit"
width="100" />
</a:columns>
<a:editors>
<a:textField id="report_name_edit"/>
</a:editors>
</a:grid>
</a:tab>
<a:tab id="step_1" disabled="false" marginHeight="20" width="100" prompt="营业月结"
selected="true">
<a:hBox height="50">
<a:button id="step_next" click="upStep" text="HLS801.LAST_STEP"/>
<a:label width="5"/>
<a:button click="csh_transaction_confirm" text="HLS801.NEXT_STEP"/>
</a:hBox>
<p/>
......@@ -1007,12 +1254,12 @@
</a:grid>
</a:tab>
<a:tab id="step_1" disabled="true" prompt="GLD_PERIODS.PERIOD_NAME" selected="false"
<a:tab id="step_2" disabled="true" prompt="GLD_PERIODS.PERIOD_NAME" selected="false"
width="100">
<a:hBox height="50">
<a:button click="upStep" text="HLS801.LAST_STEP"/>
<a:label width="5"/>
<a:button click="step_0NextStep" text="HLS801.NEXT_STEP"/>
<a:button click="step_0NextStep" text="HLS801.NEXT_STEP"/>
</a:hBox>
<a:hBox>
<a:fieldSet height="250" title="GLD_PERIODS.PERIOD_NAME" width="300">
......@@ -1024,7 +1271,7 @@
</a:fieldSet>
</a:hBox>
</a:tab>
<a:tab id="step_2" disabled="true" marginHeight="200" prompt="提前收款确认增值税"
<a:tab id="step_3" disabled="true" marginHeight="200" prompt="提前收款确认增值税"
selected="false"
width="140">
<a:hBox height="50">
......@@ -1069,7 +1316,7 @@
</a:columns>
</a:grid>
</a:tab>
<a:tab id="step_3" disabled="true" marginHeight="20" prompt="HLS801.INCOME"
<a:tab id="step_4" disabled="true" marginHeight="20" prompt="HLS801.INCOME"
selected="false"
width="100">
<a:hBox height="50">
......@@ -1147,30 +1394,12 @@
</a:columns>
</a:grid>
</a:tab>
<a:tab id="step_3" disabled="true" prompt="HLS801.MONTH_END" selected="false"
<a:tab id="step_4" disabled="true" prompt="HLS801.PERIOD_CONTROL" selected="false"
width="100">
<a:hBox height="50">
<a:button click="upStep" text="HLS801.LAST_STEP"/>
<a:label width="5"/>
<a:button click="nextStep" text="HLS801.NEXT_STEP"/>
<a:label width="80"/>
<a:button click="monthlyendFun" text="HLS801.MONTH_END"/>
</a:hBox>
<a:form column="1" marginWidth="80" style="margin-left:3px" title="HLS.QUERY_TITLE">
<a:box column="2" labelWidth="150" style="margin-left:-80px">
<a:textField name="year" bindTarget="unearned_finance_income_query_ds"
prompt="HLS801.YEAR" readOnly="true"/>
<a:textField name="month" bindTarget="unearned_finance_income_query_ds"
prompt="HLS801.MONTH" readOnly="true"/>
</a:box>
</a:form>
</a:tab>
<a:tab id="step_5" disabled="true" prompt="HLS801.PERIOD_CONTROL" selected="false"
width="100">
<a:hBox height="50">
<a:button click="upStep" text="HLS801.LAST_STEP"/>
<a:label width="5"/>
<a:button disabled="true" text="HLS801.NEXT_STEP"/>
<a:button click="next_monthly_end" text="HLS801.NEXT_STEP"/>
<a:label width="50"/>
</a:hBox>
<a:grid id="close_open_grid" bindTarget="close_open_ds" marginHeight="300"
......@@ -1208,6 +1437,38 @@
</a:editors>
</a:grid>
</a:tab>
<a:tab id="step_5" disabled="true" prompt="HLS801.MONTH_END" selected="false"
width="100">
<a:hBox height="50">
<a:button click="upStep" text="HLS801.LAST_STEP"/>
<a:label width="5"/>
<a:button disabled="true" click="month_end_next" text="HLS801.NEXT_STEP"/>
<a:label width="80"/>
<a:button click="submit" text="提交审批"/>
<!-- <a:button click="monthlyendFun" text="HLS801.MONTH_END"/>-->
</a:hBox>
<a:form column="1" marginWidth="80" style="margin-left:3px" title="HLS.QUERY_TITLE">
<a:box column="2" labelWidth="150" style="margin-left:-80px">
<a:textField name="year" bindTarget="unearned_finance_income_query_ds"
prompt="HLS801.YEAR" readOnly="true"/>
<a:textField name="month" bindTarget="unearned_finance_income_query_ds"
prompt="HLS801.MONTH" readOnly="true"/>
</a:box>
</a:form>
<a:grid id="month_report_id" bindTarget="month_report_ds" marginHeight="300"
marginWidth="80">
<a:columns>
<a:column name="report_name" align="center" prompt="报表名称"
width="100" />
<a:column name="sbo_attachment_upload" align="center" prompt="SB0报表" renderer="sbo_attachment_upload" width="80"/>
<a:column name="sbo_file_name" align="center" prompt="附件名称"
width="100" />
<a:column name="attachment_upload" align="center" prompt="业务系统报表" renderer="attachment_upload" width="80"/>
<a:column name="business_file_name" align="center" prompt="附件名称"
width="100" />
</a:columns>
</a:grid>
</a:tab>
</a:tabs>
</a:tabPanel>
</a:hBox>
......
......@@ -158,9 +158,11 @@
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();
......@@ -177,15 +179,17 @@
for (var i = 0;i < con_records.length;i++) {
sum = plus(sum, con_records[i].get('this_return_amount'));
}
form_record.set('total_unpaid_amount', sum);
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();
......@@ -202,7 +206,7 @@
for (var i = 0;i < con_records.length;i++) {
sum = plus(sum, con_records[i].get('this_return_amount'));
}
form_record.set('total_unpaid_amount', sum);
form_r_record.set('total_unpaid_amount', sum);
}
};
......
......@@ -9,10 +9,12 @@
<a:init-procedure/>
<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_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="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}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[
function open_project_win(ds_id, record_id) {
/*function open_project_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = {};
param['project_id'] = record.get('contract_id');
......@@ -35,16 +37,50 @@
param['url_title'] = '付款明细';
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}');
};
};*/
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) {
if (name == 'contract_number' && value && '${/parameter/@lease_channel}' == '01') {
return '<a href="javascript:open_project_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
if (name == 'contract_number' && value) {
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';
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') {
return value;
}
......
......@@ -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>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
......
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