Commit 6797ed5f authored by 18083's avatar 18083

手工凭证开发

parent 93e692d5
......@@ -92,9 +92,13 @@
<bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<bm:query-field name="query_reversed_flag" queryExpression="(${@query_reversed_flag}=&apos;Y&apos; and nvl(t1.reversed_flag,&apos;N&apos;)=&apos;N&apos;)"/>
<bm:query-field name="status_list_flag" queryExpression="(${@status_list_flag}=&apos;Y&apos; and t1.status in (&apos;U&apos;,&apos;B&apos;))"/>
<bm:query-field name="gld_flag" queryExpression="exists (select 1 from gld_je_transaction d where d.je_transaction_code = t1.je_transaction_code and d.gld_flag = ${@gld_flag})"/>
<bm:query-field name="bp_id_tenant" queryExpression="exists (select 1 from hls_journal_detail_v dv where dv.reference1=(select a.bp_code from hls_bp_master a where a.bp_id=${@bp_id_tenant} )and dv.journal_header_id=t1.journal_header_id )"/>
<!--<bm:query-field name="gld_flag" queryExpression="exists (select 1 from gld_je_transaction d where d.je_transaction_code = t1.je_transaction_code and d.gld_flag = ${@gld_flag})"/>-->
<bm:query-field name="gld_flag" queryExpression="((nvl(t1.manual_flag,'N')=&apos;N&apos; and exists (select 1 from gld_je_transaction d where d.je_transaction_code = t1.je_transaction_code and d.gld_flag = ${@gld_flag})) or nvl(t1.manual_flag,&apos;N&apos;)=&apos;Y&apos;)"/>
<bm:query-field name="bp_id_tenant" queryExpression="exists (select 1 from hls_journal_detail_v dv where dv.reference1=(select a.bp_code from hls_bp_master a where a.bp_id=${@bp_id_tenant} )and dv.journal_header_id=t1.journal_header_id )"/>
<bm:query-field name="desc" queryExpression="t1.description like &apos;%&apos;||${@desc}||&apos;%&apos; "/>
<bm:query-field name="post_sap" queryExpression="(decode(t1.sap_belnr,null,'N','Y') = ${@post_sap})"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" expression="(CASE WHEN ${/session/@role_id} in (select role_id from sys_role where role_code in('HAND','0017')) THEN nvl(t1.manual_flag,&apos;N&apos;) else 'N' end =&apos;N&apos;)"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="year"/>
<bm:field name="month"/>
<bm:field name="base_journal_dir"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select sys_parameter_pkg.value('HLS_JOURNAL_DIR') base_journal_dir,
to_char(sysdate,'yyyy') year,
to_char(sysdate,'mm') month
from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023-03-21 14:20:22
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
delete from hls_journal_imp_tem ot where ot.session_id = ${/session/@session_id};
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
INSERT INTO hls_journal_imp_tem
(session_id, journal_header_id)
VALUES
(${/session/@session_id}, ${@journal_header_id});
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select ot.journal_header_id from hls_journal_imp_tem ot where ot.session_id = ${/session/@session_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-22 下午1:05:40
$Revision: 1.0
$Purpose: 批量刪除
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.delete_hls_journal_import( p_journal_header_id =>${@journal_header_id}, p_user_id =>${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: lixi
$Date: 2011-8-1 上午10:21:39
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fnd_interface_headers_s.nextval header_id from dual
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.reverse_hls_journal_import( p_journal_header_id =>${@journal_header_id}, p_user_id =>${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-6 下午2:36:27
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('014'))
and t1.journal_type in('COST_IMPORT','GLOBAL_TEMPLATE')
union
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('012'))
and t1.journal_type in('FUND_POOL','FINANCIAL_TEMPLATE')
union
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('0033','025'))
and t1.journal_type in('GENERAL_SALARIES','BPO_SALARIES')
union
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('002','013') or ${/session/@user_id} = 10418
)
and t1.journal_type in('GENERAL_SALARIES','BPO_SALARIES','COST_IMPORT','FUND_POOL','GLOBAL_TEMPLATE','FINANCIAL_TEMPLATE')
) t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like &apos;%&apos;||${@journal_num}||&apos;%&apos;"/>
<bm:query-field name="batch_number" queryExpression="t1.batch_number like &apos;%&apos;||${@batch_number}||&apos;%&apos;"/>
<bm:query-field name="reverse_batch_number" queryExpression="t1.reverse_batch_number like &apos;%&apos;||${@reverse_batch_number}||&apos;%&apos;"/>
<bm:query-field name="journal_date_from" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &gt;= to_date(${@journal_date_from},'yyyy-mm-dd')"/>
<bm:query-field name="journal_date_to" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &lt;= to_date(${@journal_date_to},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_dr_from" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &gt;= ${@total_amount_dr_from}"/>
<bm:query-field name="total_amount_dr_to" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &lt;= ${@total_amount_dr_to}"/>
<bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<bm:query-field name="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
<bm:query-field name="reverse_wfl_status" queryExpression="t1.reverse_wfl_status=${@reverse_wfl_status}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-6 下午2:36:27
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="query" expression="t1.reversed_journal_header_id is null "/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like &apos;%&apos;||${@journal_num}||&apos;%&apos;"/>
<bm:query-field name="batch_number" queryExpression="t1.batch_number like &apos;%&apos;||${@batch_number}||&apos;%&apos;"/>
<bm:query-field name="reverse_batch_number" queryExpression="t1.reverse_batch_number like &apos;%&apos;||${@reverse_batch_number}||&apos;%&apos;"/>
<bm:query-field name="journal_date_from" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &gt;= to_date(${@journal_date_from},'yyyy-mm-dd')"/>
<bm:query-field name="journal_date_to" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &lt;= to_date(${@journal_date_to},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_dr_from" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &gt;= ${@total_amount_dr_from}"/>
<bm:query-field name="total_amount_dr_to" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &lt;= ${@total_amount_dr_to}"/>
<bm:query-field name="journal_submit_batch_id" queryExpression="t1.journal_submit_batch_id = ${@journal_submit_batch_id}"/>
<bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<bm:query-field name="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
<bm:query-field name="reverse_wfl_status" queryExpression="t1.reverse_wfl_status=${@reverse_wfl_status}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-6 下午2:36:27
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t1.journal_header_id,
t1.journal_submit_batch_id,
t1.journal_reverse_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id) post_gl_status
FROM hls_journal_header_imp t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like &apos;%&apos;||${@journal_num}||&apos;%&apos;"/>
<bm:query-field name="journal_date_from" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &gt;= to_date(${@journal_date_from},'yyyy-mm-dd')"/>
<bm:query-field name="journal_date_to" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &lt;= to_date(${@journal_date_to},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_dr_from" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &gt;= ${@total_amount_dr_from}"/>
<bm:query-field name="total_amount_dr_to" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &lt;= ${@total_amount_dr_to}"/>
<bm:query-field name="journal_reverse_batch_id" queryExpression="t1.journal_reverse_batch_id = ${@journal_submit_batch_id}"/>
<bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<bm:query-field name="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
Select ep.position_code
From exp_employees e, exp_employee_assigns ea, exp_org_position ep
Where e.employee_id = ea.employee_id
And ea.position_id = ep.position_id
And nvl(e.enabled_flag, 'N') = 'Y'
And nvl(ea.enabled_flag, 'N') = 'Y'
And nvl(ep.enabled_flag, 'N') = 'Y'
And nvl(ea.primary_position_flag, 'N') = 'Y'
And e.employee_id = (Select t.employee_id
From sys_user t
Where t.user_id = ${/session/@user_id})
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id},
p_header_id => ${@header_id},
p_company_id => ${/session/@company_id},
p_count =>${@v_count},
p_template_type=>${@template_type}
);
END;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter inputPath="/session/@user_id"/>
<bm:parameter inputPath="/session/@session_id"/>
<bm:parameter inputPath="/session/@template_type"/>
<bm:parameter name="v_count" dataType="java.lang.Long" input="false" output="true" outputPath="@v_count"/>
</bm:parameters>
</bm:operation>
<bm:operation name="update" >
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.init_other_journal_atm(p_session_id =>${/session/@session_id},
p_file_path =>${@file_path},
p_file_name =>${@file_name},
p_file_type =>${@file_type},
p_file_length =>${@file_length},
p_user_id =>${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="insert">
<bm:parameters>
<bm:parameter name="journal_submit_batch_id" output="true" outputPath="@journal_submit_batch_id"/>
</bm:parameters>
<bm:update-sql>
<![CDATA[
declare
v_journal_submit_batch_id hls_journal_submit_batch.journal_submit_batch_id%TYPE := hls_journal_submit_batch_s.nextval;
begin
${@journal_submit_batch_id} := v_journal_submit_batch_id;
insert into hls_journal_submit_batch
(journal_submit_batch_id,
instance_id,
wfl_status,
wfl_type,
created_by,
creation_date,
last_updated_by,
last_update_date)
values
(v_journal_submit_batch_id,
null,
'NEW',
'',
${/session/@user_id},
sysdate,
${/session/@user_id},
sysdate
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql>
<![CDATA[
begin
update hls_journal_header_imp hjhi
set hjhi.reverse_wfl_status = 'APPROVING',
hjhi.journal_reverse_batch_id = ${/parameter/@journal_submit_batch_id},
hjhi.last_updated_by = ${/session/@user_id},
hjhi.last_update_date = sysdate
where hjhi.journal_header_id = ${@journal_header_id};
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql>
<![CDATA[
begin
hls_journal_import_pkg.submit_hls_journal_reverse(
p_journal_submit_batch_id => ${/parameter/@journal_submit_batch_id},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_id}
);
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="insert">
<bm:parameters>
<bm:parameter name="journal_submit_batch_id" output="true" outputPath="@journal_submit_batch_id"/>
</bm:parameters>
<bm:update-sql>
<![CDATA[
declare
v_journal_submit_batch_id hls_journal_submit_batch.journal_submit_batch_id%TYPE := hls_journal_submit_batch_s.nextval;
begin
${@journal_submit_batch_id} := v_journal_submit_batch_id;
insert into hls_journal_submit_batch
(journal_submit_batch_id,
instance_id,
wfl_status,
wfl_type,
created_by,
creation_date,
last_updated_by,
last_update_date)
values
(v_journal_submit_batch_id,
null,
null,
${@wfl_type},
${/session/@user_id},
sysdate,
${/session/@user_id},
sysdate
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql>
<![CDATA[
update hls_journal_header_imp hjhi
set
hjhi.journal_submit_batch_id = ${/parameter/@journal_submit_batch_id},
hjhi.last_updated_by = ${/session/@user_id},
hjhi.last_update_date = sysdate
where hjhi.journal_header_id = ${@journal_header_id}
]]>
</bm:update-sql>
<!--<bm:parameters>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>-->
</bm:operation>
<bm:operation name="execute">
<bm:update-sql>
<![CDATA[
begin
hls_journal_import_pkg.submit_hls_journal_tmp(
p_journal_submit_batch_id => ${/parameter/@journal_submit_batch_id},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_id}
);
end;
]]>
</bm:update-sql>
<!--<bm:parameters>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>-->
</bm:operation>
</bm:operations>
</bm:model>
......@@ -55,6 +55,22 @@
<bm:query-field name="approve_user_code" queryExpression="t1.approve_user_code like ${@approve_user_code}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" expression="( (${/session/@role_id} = (select role_id from sys_role where role_code = '0006') and t1.workflow_code in (&apos;CONTRACT_INCEPT_WFL&apos;, &apos;DCFL_CSH_PAYMENT_REQ&apos;)) or (${/session/@role_id} in (select role_id from sys_role where role_code in ('0012', '0013', '0014')) and t1.workflow_code in (&apos;DCFL_CSH_PAYMENT_REQ&apos;, &apos;DEPOSIT_RETURN&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0005') and t1.workflow_code in (&apos;PROJECT_WFL&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0008') and t1.workflow_code in (&apos;CON_ET_WFL&apos;,&apos;TENANT_CHANGE_WFL&apos;,&apos;CON_BUYBACK_WFL&apos;,&apos;DEPOSIT_RETURN&apos;,&apos;WFL_FEE_REMIT&apos;)) or (${/session/@role_id} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014')) and 1 = 1))"/>
<!--<bm:data-filter name="query" expression="( (${/session/@role_id} = (select role_id from sys_role where role_code = '0006') and t1.workflow_code in (&apos;CONTRACT_INCEPT_WFL&apos;, &apos;DCFL_CSH_PAYMENT_REQ&apos;)) or (${/session/@role_id} in (select role_id from sys_role where role_code in ('0012', '0013', '0014')) and t1.workflow_code in (&apos;DCFL_CSH_PAYMENT_REQ&apos;, &apos;DEPOSIT_RETURN&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0005') and t1.workflow_code in (&apos;PROJECT_WFL&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0008') and t1.workflow_code in (&apos;CON_ET_WFL&apos;,&apos;TENANT_CHANGE_WFL&apos;,&apos;CON_BUYBACK_WFL&apos;,&apos;DEPOSIT_RETURN&apos;,&apos;WFL_FEE_REMIT&apos;)) or (${/session/@role_id} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014')) and 1 = 1))"/>-->
<bm:data-filter name="query" expression="( (${/session/@role_id} = (select role_id from sys_role where role_code = '0006') and t1.workflow_code in (&apos;CONTRACT_INCEPT_WFL&apos;, &apos;DCFL_CSH_PAYMENT_REQ&apos;)) or (${/session/@role_id} in (select role_id from sys_role where role_code in ('0012', '0013', '0014')) and t1.workflow_code in (&apos;DCFL_CSH_PAYMENT_REQ&apos;, &apos;DEPOSIT_RETURN&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0005') and t1.workflow_code in (&apos;PROJECT_WFL&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0008') and t1.workflow_code in (&apos;CON_ET_WFL&apos;,&apos;TENANT_CHANGE_WFL&apos;,&apos;CON_BUYBACK_WFL&apos;,&apos;DEPOSIT_RETURN&apos;,&apos;WFL_FEE_REMIT&apos;)) or (${/session/@role_id} in (select role_id from sys_role where role_code in ('0017','HAND')) and t1.workflow_code not in (&apos;HLS_JOURNAL_WFL&apos;, &apos;HLS_JOURNAL_REVERSE_WFL&apos;)) or (${/session/@role_id} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014','0017','HAND')) and 1 = 1)
or( ((t1.SUBMITTED_BY = ${/session/@user_id}) or (
(${/session/@user_id}
in (Select t.user_id
From zj_wfl_instance_node_recipient t
Where t.instance_id = t1.instance_id
And t.record_type = 'APPROVER')
and t1.instance_status = 1)
or
(${/session/@user_id}
in (Select t.user_id
From zj_wfl_instance_node_rcpt_ht t
Where t.instance_id = t1.instance_id
And t.record_type = 'APPROVER')
and t1.instance_status in (-1000,-1,10))
) ) and t1.workflow_code in('HLS_JOURNAL_WFL','HLS_JOURNAL_REVERSE_WFL')))"/>
</bm:data-filters>
</bm:model>
......@@ -175,6 +175,7 @@ var enableLayoutConfig = {
'modules/cont/CON762/con_contract_finish_query.lview':true,
'modules/csh/CSH540/agent_deposit_return.lview':true,
'modules/hls/HLS530/manual_journal_create.lview':true,
'modules/hls/HLS536/hls_journal_import_create.lview':true,
'modules/csh/CSH541/agent_deposit_details.lview':true,
'modules/hls/HLS535/hls_sap_process_resend.lview':true,
'modules/prj/PRJ500/prj_project_create_entrance.lview':true,
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-delete model="hls.HLS536.hls_attachment_tmp" trace="true"/>
<a:batch-apply sourcepath="/parameter/details">
<a:model-insert model="hls.HLS536.hls_attachment_tmp" trace="true"/>
</a:batch-apply>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<p:echo></p:echo>
<a:model-insert model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
<a:batch-apply sourcepath="/parameter/details">
<a:model-update model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
</a:batch-apply>
<a:model-execute model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<p:echo></p:echo>
<a:model-insert model="hls.HLS536.submit_hls_journal_tmp" trace="true"/>
<a:batch-apply sourcepath="/parameter/details">
<a:model-update model="hls.HLS536.submit_hls_journal_tmp" trace="true"/>
</a:batch-apply>
<a:model-execute model="hls.HLS536.submit_hls_journal_tmp" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<p:echo/>
<s:server-script><![CDATA[
importPackage(java.io);
var request = $ctx['_instance.javax.servlet.http.HttpServletRequest'];
var response = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
try{
data = $bm('hls.HLS536.excel_system_parameter').queryAsMap().getChildren();
var base_dir=data[0].base_journal_dir;
var year=data[0].year;
var month=data[0].month;
var factory = new Packages.org.apache.commons.fileupload.disk.DiskFileItemFactory();
var up = new Packages.org.apache.commons.fileupload.servlet.ServletFileUpload(factory);
var items = up.parseRequest(request);
var i = items.iterator();
while (i.hasNext()) {
var item = i.next();
if (item.isFormField()) {
println("item.getFieldName()"+item.getFieldName() + "=" + item.getString());
} else {
var file_old_name =item.getName();
//println('文件名'+file_old_name);
var file_type_name = item.getName().substr(item.getName().lastIndexOf("."));
var file_type = item.getName().substr(item.getName().lastIndexOf(".")+1);
var guid_file_name_path = $bm('cont.CON500.con_contract_get_guid_file_name').queryAsMap();
var guid_file_name_tables = guid_file_name_path.getChildren();
var file_name=guid_file_name_tables[0].guid_file_name;
var file_path = base_dir+year+"\\"+month+"\\";
var dir=new File(String(file_path));
if(!dir.exists()){
createDir(file_path);
}
var f = item.getStoreLocation();
var input,output;
var tempFile=new File(String(f));
try{
input = new FileInputStream(tempFile);
output = new FileOutputStream(file_path+file_name);
var buf = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
var bytesRead;
while ((bytesRead = input.read(buf)) > 0) {
output.write(buf, 0, bytesRead);
}
input.close();
output.close();
}catch(e){
//删除临时表
$bm('hls.HLS536.hls_attachment_tmp').delete();
println('上传文件出错,请联系管联系管理员理员!e'+e);
if(input!=null){
input.close();
}
if(output!=null){
output.close();
}
raise_app_error('上传文件出错,请联系管理员!');
println('上传文件出错,请联系管理员!e');
}
var file_length=get_file_length(file_path+file_name);
//文件上传成功后进行附件挂载
$bm('hls.HLS536.insert_hls_journal_tmp').update({
"file_path":String(file_path+file_name),
//"file_name":String(file_name+file_type_name),
"file_name":file_old_name,
"file_type":file_type,
file_length:file_length
})
//删除临时表
$bm('hls.HLS536.hls_attachment_tmp').delete();
}
}
}catch (e) {
//删除临时表
$bm('hls.HLS536.hls_attachment_tmp').delete();
raise_app_error(e);
}
function createDir(dir){
var file=new File(String(dir));
if(!file.exists()){//如果文件夹不存在
file.mkdirs();//创建文件夹
}
}
//获取文件长度
function get_file_length(path){
var file=new File(String(path));
if (file.exists() && file.isFile()){
//println(f.length());
length=file.length();
return length;
} else{
return 0;
}
}
]]></s:server-script>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_entrance_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_entrance.lview"/>
<script type="text/javascript"> <![CDATA[
window.location.href = $('hls_journal_entrance_import_link').getUrl();
]]></script>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-11-9 上午10:30:00
$Revision: 1.0
$Purpose: 导入凭证模板修改
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
<a:view>
<a:link id="get_period_name_id" model="csh.CSH511.csh_transaction_get_period_name" modelaction="query"/>
<a:link id="get_new_journal_num_link_id" model="hls.HLS530.get_new_journal_number" modelaction="update"/>
<a:link id="get_document_type_id" model="csh.CSH511.get_document_type" modelaction="update"/>
<script><![CDATA[
Leaf.onReady(function() {
if ('${/parameter/@maintain_type}' == 'READONLY') {
const btn_dom = document.getElementById('${/parameter/@layout_code}' + '_save');
btn_dom.remove();
}
});
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
var journal_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header_imp');
var detail_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_LN', 'hls_journal_detail_imp');
var journal_record = $(journal_ds_id).getAt(0);
var je_records = $(detail_ds_id).getAll();
var sum_dr = 0;
var sum_cr = 0;
for (var i=0;i<je_records.length;i++){
var je_record = je_records[i];
if(!isNaN(je_record.get('amount_dr'))){
sum_dr = (Number(sum_dr) + Number(je_record.get('amount_dr'))).toFixed(2);
}
if(!isNaN(je_record.get('amount_cr'))){
sum_cr = (Number(sum_cr) + Number(je_record.get('amount_cr'))).toFixed(2);
}
}
var check_flag = false;
if((sum_dr != sum_cr)&&(sum_dr != 0)){
Leaf.showMessage('提示','借贷总额必须相等');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}else{
journal_record.set('total_amount_dr', sum_dr);
journal_record.set('total_amount_cr', sum_dr);
journal_record.set('total_amount_fuc_dr', sum_dr);
journal_record.set('total_amount_fuc_cr', sum_dr);
if (journal_record.get('journal_num')) {
return true;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('get_new_journal_num_link_id').getUrl(),
para: {
document_category: '${/parameter/@document_category}',
document_type: record.get('document_type')
},
success: function(res) {
var document_number = res.result.document_number;
journal_record.set('journal_num', document_number);
check_flag = true;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
sync: true,
scope: this
});
return check_flag;
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
var detail1_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_LN_REF1', 'hls_journal_detail_imp');
var header_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_HD', 'hls_journal_header_imp');
$(detail1_ds_id).query();
var header_ds_record = $(header_ds_id).getAt(0);
var document_type = header_ds_record.get('document_type');
var journal_num = header_ds_record.get('journal_num');
if (!header_ds_record.get('post_gl_status')){
header_ds_record.set('post_gl_status', 'N');
}
header_ds_record.set('reversed_flag', 'N');
// if (name = 'document_type') {
// Leaf.request({
// url: $('get_document_type_id').getUrl(),
// para: {
// document_type: document_type,
// //journal_header_id: '${/parameter/@journal_header_id}',
// journal_num: journal_num
// },
// success: periodname,
// scope: this
// });
// }
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
if(name=='journal_date'){
var journal_date = record.get('journal_date');
journal_date = Leaf.formatDate(journal_date);
Leaf.request({
url: $('get_period_name_id').getUrl(),
para: {
p_date: journal_date
},
success: periodname,
scope: this
});
}else if(name=='amount_dr'){
record.set('amount_fuc_dr',value);
}else if(name=='amount_cr'){
record.set('amount_fuc_cr',value);
}
};
function periodname(res) {
var journal_ds_id1 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header_imp');
var journal_record1 = $(journal_ds_id1).getAt(0);
if (res) {
var period_name = res.result.record.period_name;
var period_year = res.result.record.period_year;
var period_num = res.result.record.period_name.substring(5, 7);
var internal_period_num = res.result.record.internal_period_num;
var period_set_code = res.result.record.period_set_code;
journal_record1.set('period_name', period_name);
journal_record1.set('period_year', period_year);
journal_record1.set('period_num', period_num);
journal_record1.set('internal_period_num', internal_period_num);
journal_record1.set('period_set_code', period_set_code);
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var bp_info_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header_imp');
if( Ext.isEmpty(record.get('journal_header_id'))){
record.set('je_company_id', 1);
record.set('je_company_id_n', '宏菱租赁');
record.set('currency_code', 'CNY');
record.set('currency_code_n', '人民币');
//record.set('je_transaction_code', 'MANUAL');
//record.set('je_transaction_code_n', '手工生成');
//record.set('post_gl_status', 'N');
if(!record.get('post_gl_status')){
record.set('post_gl_status', 'N');
}
record.set('exchange_rate', 1);
record.set('reversed_flag', 'N');
record.set('source_table', 'hls_journal_header_imp');
record.set('company_id', 1);
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="welcome_link_id" url="${/request/@context_path}/welcome.lview"/>
<a:link id="hls_journal_con_contract_update_link_id" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_upload.lview"/>
<a:link id="hls_journal_other_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_other_attach_upload.lview"/>
<a:link id="hls_journal_submit_link_id" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_tmp.lsc"/>
<a:link id="hls_journal_reverse_link_id" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_reverse.lsc"/>
<a:link id="hls_journal_import_delete_link" model="hls.HLS536.hls_journal_import_delete"
modelaction="batch_update"/>
<a:link id="hls_journal_import_reverse_link" model="hls.HLS536.hls_journal_import_head_id"
modelaction="batch_update"/>
<a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="journal_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="batch_attachment_tmp_id" url="${/request/@context_path}/modules/hls/HLS536/batch_attchment_tmp.lsc"/>
<script><![CDATA[
Leaf.onReady(function() {
if ('${/session/@user_id}'!=10418) {
$('reverse_btn_id').hide();
$('reverse_submit_btn_id').hide();
}
});
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
//退出按钮
function hls536_journal_exit() {
location.href = $('welcome_link_id').getUrl();
parent.shMenu('show');
}
function hls536_journal_import(){
new Leaf.Window({
id: 'hls_journal_import_handle_winid',
url: $('hls_journal_import_link').getUrl(),
title: '凭证模板导入',
width: 420,
height: 320
});
}
//删除凭证
function hls536_journal_delete(){
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
var datas = [];
for (var i = 0; i < records.length; i++) {
if ((records[i].get('reversed_flag') == 'N'&&(records[i].get('wfl_status') == 'APPROVING' || records[i].get('wfl_status') == 'APPROVED'))||(records[i].get('reversed_flag') == 'R'&&(records[i].get('reverse_wfl_status') == 'APPROVING' || records[i].get('reverse_wfl_status') == 'APPROVED'))){
Leaf.showMessage('提示', '只有新建和拒绝状态的单据才能刪除!');
return;
}
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'delete';
datas[i] = obj;
}
Leaf.request({
url: $('hls_journal_import_delete_link').getUrl(),
para: datas,
success: function () {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('hls_journal_header_result_ds').query();
},
scope: this
});
}
// 提交审批
// 可以批量提交,批量提交审批的数据在一个工作流里面,有一个批次表 存 batch_id,这里要把批量提交的数据 update batch_id
function hls536_journal_send() {
var ds_id = 'hls_journal_header_result_ds';
var records = $(ds_id).getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '未选择!');
return ;
}
//审批中、审批通过的单据不可提交审批
for (let i = 0; i < records.length; i++) {
var record = records[i];
if (record.get('wfl_status') == 'APPROVING' || record.get('wfl_status') == 'APPROVED') {
Leaf.showMessage('提示', '审批中、审批通过的凭证不可提交审批!');
return;
}
if (!Ext.isEmpty(record.get('error_message'))){
Leaf.showMessage('提示', '凭证导入存在报错信息,不允许提交审批!');
return;
}
}
var journal_header_imp_list = [];
var journal_type_list = [];
//同一个模板的凭证才能批量提交
for (let i = 0; i < records.length; i++) {
var record = records[i];
//凭证模板类型
var journal_type = record.get('journal_type');
record.set('_status','update')
journal_header_imp_list.push(record.data);
journal_type_list.push(journal_type);
}
//普通工资和 BPO工资 共用一个 工资工作流,所以可以一起提交审批
var equal_flag = journal_type_list.every(val => val === journal_type_list[0]);
var is_salaries = journal_type_list.every(val => val === 'GENERAL_SALARIES' || val === 'BPO_SALARIES');
var check_flag = false;
if ((!equal_flag && is_salaries) || equal_flag){
check_flag = true;
}
if (!check_flag){
Leaf.showMessage('${l:PROMPT}', '同一个模板的凭证才能批量提交!');
return ;
}
var param = {};
param['details'] = journal_header_imp_list;
//判断要走哪个工作流
if (!equal_flag && is_salaries){
param['wfl_type'] = 'SALARIES';
}
if (equal_flag){
var journal_type = records[0].get('journal_type');
param['wfl_type'] = journal_type;
}
//当属于工资工作模板工作流的单条或多条凭证被提交时,wfl_type也要为 SALARIES
if(is_salaries){
param['wfl_type'] = 'SALARIES';
}
if ($(ds_id).validate()) {
if(param['wfl_type']!='FINANCIAL_TEMPLATE' && param['wfl_type']!='FUND_POOL'){
Leaf.showConfirm('${l:HLS.PROMPT}', '确认已无其它附件需要添加?', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('hls_journal_submit_link_id').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示', '提交审批成功!');
$('hls_journal_header_result_ds').query();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
},function(){},300,100);
}else{
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交审批?', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('hls_journal_submit_link_id').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示', '提交审批成功!');
$('hls_journal_header_result_ds').query();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
},function(){},300,100);
}
}
}
//生成反冲数据,生成后数据可编辑
function hls536_journal_reverse(){
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
for (var i = 0; i < records.length; i++) {
if (records[i].get('wfl_status') != 'APPROVED') {
Leaf.showMessage('提示', '凭证没有审批通过不能进行反冲,请检查!');
return;
}
if (records[i].get('reversed_flag') == 'R') {
Leaf.showMessage('提示', '存在已经反冲的凭证,请检查!');
return;
}
}
var datas = [];
for (var i = 0; i < records.length; i++) {
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'execute';
datas[i] = obj;
}
Leaf.request({
url: $('hls_journal_import_reverse_link').getUrl(),
para: datas,
success: function () {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('hls_journal_header_result_ds').query();
},
scope: this
});
}
//反冲提交流程
function hls536_journal_reverse_submit(){
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
//凭证传输状态不为Y的不能进行反冲
for (var i = 0; i < records.length; i++) {
if (records[i].get('wfl_status') != 'APPROVED') {
Leaf.showMessage('提示', '凭证没有审批通过不能提交反冲审批,请检查!');
return;
}
if (records[i].get('reversed_flag') != 'R') {
Leaf.showMessage('提示', '非反冲数据不能提交反冲审批,请检查!');
return;
}
if (records[i].get('reversed_flag') == 'R' && (records[i].get('reverse_wfl_status') == 'APPROVING'||records[i].get('reverse_wfl_status') == 'APPROVED')) {
Leaf.showMessage('提示', '反冲审批中或审批通过的单据不能提交审批,请检查!');
return;
}
}
var journal_header_imp_list = [];
for (var i = 0; i < records.length; i++) {
var record = records[i];
record.set('_status','update')
journal_header_imp_list.push(record.data);
}
var param = {};
param['details'] = journal_header_imp_list;
Leaf.showConfirm('${l:HLS.PROMPT}', '确认已无其它附件需要添加?', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('hls_journal_reverse_link_id').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示', '提交审批成功!');
$('hls_journal_header_result_ds').query();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, null);
}
function hls536_link_dynamic(reocrd_id, journal_header_id) {
//增加逻辑:审批中、审批通过的只读;新建、审批拒绝的可编辑
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
if((record.get('reversed_flag')=='N' && record.get('wfl_status') !='APPROVING' && record.get('wfl_status') != 'APPROVED') ||(record.get('reversed_flag')=='R' && record.get('reverse_wfl_status') != 'APPROVING' && record.get('reverse_wfl_status') != 'APPROVED')){
var maintain_type = 'UPDATE';
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}else{
var maintain_type = 'READONLY';
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
param['function_usage'] = 'QUERY';
param['query_only'] = 'Y';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
function receipt_attachment_upload(val,rec,name){
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>凭证模板附件</a>';
}
function open_upload_window(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_HEADER_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
$('hls_journal_header_result_ds').query();
});
}
function attachment_upload(val,rec,name){
if(rec.get('wfl_status')=='NEW'||rec.get('wfl_status')=='REJECT'||rec.get('reverse_wfl_status')=='NEW'||rec.get('reverse_wfl_status')=='REJECT'){
return '<a href=javascript:open_other_attachment_upload('+rec.get('journal_header_id')+')>其它附件</a>';
}else{
return '<a href=javascript:open_other_attachment_download('+rec.get('journal_header_id')+')>其它附件</a>';
}
}
//其它附件上传
function open_other_attachment_upload(record_id){
var url = $('journal_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_DETAIL_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'other_attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
$('hls_journal_header_result_ds').query();
});
}
//其它附件下载
function open_other_attachment_download(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_DETAIL_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'other_attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
$('hls_journal_header_result_ds').query();
});
}
function selected_attachment_upload(){
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录进行附件上传!');
return ;
}
for (var i = 0; i < records.length; i++) {
if ((records[i].get('reversed_flag') == 'R' && (records[i].get('reverse_wfl_status') == 'APPROVING'||records[i].get('reverse_wfl_status') == 'APPROVED'))||
(records[i].get('reversed_flag') == 'N' && (records[i].get('wfl_status') == 'APPROVING'||records[i].get('wfl_status') == 'APPROVED'))) {
Leaf.showMessage('提示', '凭证状态为审批中或者审批通过,不能进行批量附件上传!');
return;
}
}
var param = {};
var saveData = [];
for (var i = 0; i < records.length; i++) {
var record = records[i];
saveData.push({
'journal_header_id': record.get('journal_header_id'),
'_status': 'insert'
});
}
param['details'] = saveData;
Leaf.request({
url: $('batch_attachment_tmp_id').getUrl(),
para: param,
success: function () {
new Leaf.Window({
id: 'hls_journal_import_handle_winid',
url: $('hls_journal_other_import_link').getUrl(),
title: '附件导入',
width: 420,
height: 320
});
},
scope: this
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls536_wfl_status_ds" lookupCode="HLS536_WFL_STATUS"/>
<a:dataSet id="hls536_reverse_wfl_status_ds" lookupCode="HLS536_WFL_STATUS_REVERSE"/>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="journal_num"/>
<a:field name="batch_number"/>
<a:field name="reverse_batch_number"/>
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="description"/>
<a:field name="wfl_status_n" displayField="code_value_name" defaultValue="新建" options="hls536_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
<a:field name="wfl_status" defaultValue="NEW"/>
<a:field name="reverse_wfl_status_n" displayField="code_value_name" options="hls536_reverse_wfl_status_ds" returnField="reverse_wfl_status" valueField="code_value"/>
<a:field name="reverse_wfl_status" />
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_header" queryDataSet="hls_journal_header_query" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_exit" text="HLS.EXIT"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_import" text="导入凭证模板"/>
<a:toolbarButton click="hls536_journal_delete" text="删除凭证"/>
<a:toolbarButton click="hls536_journal_send" text="提交审批"/>
<a:toolbarButton id="reverse_btn_id" click="hls536_journal_reverse" text="生成反冲"/>
<a:toolbarButton id="reverse_submit_btn_id" click="hls536_journal_reverse_submit" text="提交反冲"/>
<a:toolbarButton id="hls536_upload_id" click="selected_attachment_upload" text="批量附件上传"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:textField name="description" bindTarget="hls_journal_header_query" prompt="凭证摘要"/>
<a:comboBox name="wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证导入状态"/>
<a:comboBox name="reverse_wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证反冲状态"/>
<a:textField name="batch_number" bindTarget="hls_journal_header_query" prompt="凭证导入批次号"/>
<a:textField name="reverse_batch_number" bindTarget="hls_journal_header_query" prompt="反冲凭证批次号"/>
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="batch_number" prompt="凭证导入批次号" width="120"/>
<a:column name="reverse_batch_number" prompt="凭证反冲批次号" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>
<a:column name="reverse_wfl_status_n" prompt="凭证反冲状态" width="100"/>
<a:column name="error_message" prompt="错误信息" width="150"/>
<a:column name="attachment_file" prompt="凭证模板附件" width="120" renderer="receipt_attachment_upload" align="center"/>
<a:column name="other_attachment_file" prompt="其它附件" width="120" renderer="attachment_upload" align="center"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<script><![CDATA[
Leaf.onReady(function () {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
})
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
// 审批流程中,叶唯吟节点可编辑页面
function hls536_link_dynamic(reocrd_id, journal_header_id) {
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
var edit_flag = '${/parameter/@edit_flag}';
if(edit_flag == 'Y' ){
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
}else {
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
}
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
function receipt_attachment_upload(val,rec,name){
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>附件</a>';
}
function open_upload_window(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_HEADER_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
$('hls_journal_header_result_ds').query();
});
}
function attachment_upload(val,rec,name){
return '<a href=javascript:open_other_attachment_download('+rec.get('journal_header_id')+')>其它附件</a>';
}
//其它附件下载
function open_other_attachment_download(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_DETAIL_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'other_attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
$('hls_journal_header_result_ds').query();
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls536_wfl_status_ds" lookupCode="HLS536_WFL_STATUS"/>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="journal_num"/>
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="description"/>
<a:field name="wfl_status_n" displayField="code_value_name" options="hls536_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
<a:field name="wfl_status" />
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_reverse_wfl" queryDataSet="hls_journal_header_query" selectable="true" queryUrl="${/request/@context_path}/autocrud/hls.HLS536.hls_journal_import_reverse_wfl/query?journal_reverse_batch_id=${/parameter/@journal_submit_batch_id}">
>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:textField name="description" bindTarget="hls_journal_header_query" prompt="凭证摘要"/>
<a:comboBox name="wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证导入状态"/>
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<!--<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>-->
<a:column name="reverse_wfl_status_n" prompt="凭证反冲状态" width="100"/>
<a:column name="other_attachment_file" prompt="其它附件" width="120" renderer="attachment_upload" align="center"/>
<!--<a:column name="error_message" prompt="错误信息" width="150"/>-->
<!--<a:column name="attachment_file" prompt="附件" width="120" renderer="receipt_attachment_upload" align="center"/>-->
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--<a:service xmlns:a="http://www.leaf-framework.org/application" trace="true">-->
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-execute model="hls.HLS536.insert_hls_journal_tmp" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure >
<!--<a:model-execute model="hls.HLS536.delete_hls_journal_tmp"/>-->
<a:model-query model="hls.HLS536.hls_journal_import_head_id" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" attribute5="D:\u01\hls_file\hls_journal,fnd_interface_headers,${/model/header/record/@header_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLS_JOURNAL_IMPORT" user_id="${/session/@user_id}" />
<!--<a:import-excel header_id="${/session/@session_id}" attribute5="D:\u01,fnd_interface_headers,${/session/@session_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLS_JOURNAL_IMPORT" user_id="${/session/@user_id}" />-->
<!--<a:model-execute model="hls.HLS536.insert_hls_journal_tmp"/>-->
</a:init-procedure>
<a:view>
<a:link id="hls_journal_entrance_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_entrance.lview"/>
<a:link id="import_save_data_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_save.lsc"/>
<script type="text/javascript"><![CDATA[
function loadComplete() {
var param = {};
param['template_type'] = '${/parameter/@template_type}';
param['header_id'] = '${/model/header/record/@header_id}';
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('import_save_data_link').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
if(res.result.v_count>0){
Leaf.showInfoMessage('成功','导入成功!',function(){
window.location.href = $('hls_journal_entrance_import_link').getUrl();
});
}else{
Leaf.showInfoMessage('失败','导入失败!',function(){
window.location.href = $('hls_journal_entrance_import_link').getUrl();
});
}
},
failure: function (res) {
Leaf.Masker.unmask(Ext.getBody());
},
error: function (res) {
Leaf.Masker.unmask(Ext.getBody());
},
sync: true,
scope: this
});
}
loadComplete();
]]></script>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="hls.HLS536.hls_journal_position_query" rootPath="hls536_position_code"/>
</a:init-procedure>
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick() {
if (!$('template_ds').validate()) {
return;
}
var templatetype = $('template_ds').getAt(0).get('template_type');
if (document.getElementById('importFile').value) {
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
fileType = fileType.toLowerCase();
if (fileType != '.xls'&&fileType != '.xlsx') {
alert('请选择正确的导入文件!请使用xls或者xlsx后缀的文件');
} else {
doSubmit(templatetype);
//document.getElementById('importForm').submit();
}
}
}
function doSubmit(templatetype) {
var form = document.getElementById('importForm');
var url = '${/request/@context_path}/modules/hls/HLS536/hls_journal_import_trans_upload.lview?_csrf=${/session/@_csrf.token}&template_type='+templatetype;
form.action = url;
form.submit();
}
]]></script>
<a:dataSets>
<a:dataSet id="template_type_desc_ds" autoCreate="true">
<a:datas>
<a:record code_value="GENERAL_SALARIES" code_value_name="普通工资导入模板"/>
<a:record code_value="BPO_SALARIES" code_value_name="BPO工资导入模板"/>
<a:record code_value="COST_IMPORT" code_value_name="成本导入模板"/>
<a:record code_value="FUND_POOL" code_value_name="资金池导入模板"/>
<a:record code_value="GLOBAL_TEMPLATE" code_value_name="通用模板"/>
<a:record code_value="FINANCIAL_TEMPLATE" code_value_name="财务模板"/>
</a:datas>
</a:dataSet>
<a:dataSet id="template_type_desc_ds1" autoCreate="true">
<a:datas>
<a:record code_value="GENERAL_SALARIES" code_value_name="普通工资导入模板"/>
<a:record code_value="BPO_SALARIES" code_value_name="BPO工资导入模板"/>
</a:datas>
</a:dataSet>
<a:dataSet id="template_type_desc_ds2" autoCreate="true">
<a:datas>
<a:record code_value="COST_IMPORT" code_value_name="成本导入模板"/>
<a:record code_value="GLOBAL_TEMPLATE" code_value_name="通用模板"/>
</a:datas>
</a:dataSet>
<a:dataSet id="template_type_desc_ds3" autoCreate="true">
<a:datas>
<a:record code_value="FUND_POOL" code_value_name="资金池导入模板"/>
<a:record code_value="FINANCIAL_TEMPLATE" code_value_name="财务模板"/>
</a:datas>
</a:dataSet>
<a:switch test="/model/hls536_position_code/record/@position_code">
<a:case value="0033">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds1"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
<a:case value="014">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds2"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
<a:case value="012">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds3"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
<a:case value="017">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
</a:switch>
<a:dataSet id="label_ds" autoCreate="true">
<a:fields>
<a:field name="label2" defaultValue="1、 严格按照导入模板整理数据,检查必输事项是否缺少数据。"/>
<a:field name="label3" defaultValue="2、 关闭Excel文件后,方可进行产品主数据导入。"/>
<a:field name="label4" defaultValue="3、 本导入程序只支持Office Excel。"/>
<a:field name="label5" defaultValue="仔细阅读上述事项,并检查确认无误。"/>
<a:field name="label6" defaultValue="导入完毕后,请在系统内核实数据是否导入成功。"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入注意事项" width="400">
<a:label name="label2" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label3" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label4" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label5" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
<a:label name="label6" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="选择模板" width="400">
<a:comboBox name="template_type_desc" bindTarget="template_ds" prompt="模板类型"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="hls_journal_import_trans_upload.lview?session_id=${/parameter/@session_id}&amp;template_type=${/parameter/@template_type}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;_csrf=${/session/@_csrf.token}" enctype="multipart/form-data" method="post">
<label style="margin-left:10px;margin-top:10px;"><![CDATA[请选择文件:]]></label>
<input name="CONTENT" id="importFile" style="margin-bottom:4px;width:160px;height:22px;" type="file"/>
<input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button" value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<script><![CDATA[
Leaf.onReady(function () {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
})
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
// 审批流程中,叶唯吟节点可编辑页面
function hls536_link_dynamic(reocrd_id, journal_header_id) {
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
param['query_only'] = 'Y';
var edit_flag = '${/parameter/@edit_flag}';
if(edit_flag == 'Y' ){
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
}else {
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
}
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
function receipt_attachment_upload(val,rec,name){
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>凭证模板附件</a>';
}
function open_upload_window(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_HEADER_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
hls536_journal_query();
});
}
function attachment_upload(val,rec,name){
return '<a href=javascript:open_attachment_upload('+rec.get('journal_header_id')+')>其它附件</a>';
}
function open_attachment_upload(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_DETAIL_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
hls536_journal_query();
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls536_wfl_status_ds" lookupCode="HLS536_WFL_STATUS"/>
<a:dataSet id="hls536_reverse_wfl_status_ds" lookupCode="HLS536_WFL_STATUS_REVERSE"/>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="journal_num"/>
<a:field name="batch_number"/>
<a:field name="reverse_batch_number"/>
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="description"/>
<a:field name="wfl_status_n" displayField="code_value_name" options="hls536_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
<a:field name="wfl_status"/>
<a:field name="reverse_wfl_status_n" displayField="code_value_name" options="hls536_reverse_wfl_status_ds" returnField="reverse_wfl_status" valueField="code_value"/>
<a:field name="reverse_wfl_status" />
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_header_wfl" queryDataSet="hls_journal_header_query" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:textField name="description" bindTarget="hls_journal_header_query" prompt="凭证摘要"/>
<a:comboBox name="wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证导入状态"/>
<a:comboBox name="reverse_wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证反冲状态"/>
<a:textField name="batch_number" bindTarget="hls_journal_header_query" prompt="凭证导入批次号"/>
<a:textField name="reverse_batch_number" bindTarget="hls_journal_header_query" prompt="反冲凭证批次号"/>
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="batch_number" prompt="凭证导入批次号" width="120"/>
<a:column name="reverse_batch_number" prompt="凭证反冲批次号" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>
<a:column name="reverse_wfl_status_n" prompt="凭证反冲状态" width="100"/>
<a:column name="attachment_file" prompt="凭证模板附件" width="120" renderer="receipt_attachment_upload" align="center"/>
<a:column name="other_attachment_file" prompt="其它附件" width="120" renderer="attachment_upload" align="center"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023-3-20 下午1:49:19
$Revision: 1.0
$Purpose: 手工凭证其它附件导入
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick(){
debugger;
if (document.getElementById('importFile').value){
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
document.getElementById('importForm').submit();
//doSubmit(fileType);
}
}
function doSubmit(fileType) {
var form = document.getElementById('importForm');
var url = '${/request/@context_path}/modules/hls/HLS536/hls_journal_attach_trans_upload.lview?_csrf=${/session/@_csrf.token}&fileType='+fileType;
form.action = url;
form.submit();
}
]]></script>
<a:dataSets>
<a:dataSet id="label_ds" autoCreate="true">
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="hls_journal_attach_trans_upload.lview?session_id=${/parameter/@session_id}&amp;_csrf=${/session/@_csrf.token}" enctype="multipart/form-data" method="post">
<label style="margin-left:10px;margin-top:10px;"><![CDATA[请选择文件:]]></label>
<input name="CONTENT" id="importFile" style="margin-bottom:4px;width:160px;height:22px;" type="file"/>
<input onclick="saveClick()" style="margin-left:50px;margin-top:10px;width:60px;" type="button" value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
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