Commit 95fc39ac authored by liyuan.chen's avatar liyuan.chen

销项发票申请开发

parent ed545c7d
......@@ -98,7 +98,7 @@
t1.object_taxpayer_type) = 'SMALL_SCALE_TAXPAYER' and
to_char(t2.due_date,'yyyy-mm') <= to_char(SYSDATE,'yyyy-mm')) or (t2.write_off_flag = 'FULL' and t1.contract_status not in('REPURING','REPUR')) or(nvl(t2.write_off_flag,'NOT')='FULL' and t1.contract_status in('REPURING','REPUR') and t2.cf_item<>1) or (nvl(t2.write_off_flag,'NOT') <> 'NOT' and t1.contract_status in('REPURING','REPUR') and t2.cf_item=1 ) )
AND cf_item<> 9
AND ((t2.cf_status='RELEASE' and t1.contract_status not in('REPURING','REPUR') and t2.cf_direction='INFLOW') or(t1.contract_status in ('REPURING','REPUR') and t2.cf_item in(1,250) and t2.cf_status='RELEASE' )or ( t2.cf_status in('BLOCK') and nvl(t2.write_off_flag,'NOT')='PARTIAL' and nvl(t2.billing_status,'NOT') != 'FULL' and t1.contract_status in ('REPURING','REPUR') and t2.cf_item =1 and t2.cf_direction='NONCASH' and nvl(t2.billing_amount,0) <> t2.received_amount))
AND ((t2.cf_status='RELEASE' and t1.contract_status not in('REPURING','REPUR') and t2.cf_direction='INFLOW') or(t1.contract_status in ('REPURING','REPUR') and t2.cf_item in(1,2,250) and t2.cf_status='RELEASE' )or ( t2.cf_status in('BLOCK') and nvl(t2.write_off_flag,'NOT')='PARTIAL' and nvl(t2.billing_status,'NOT') != 'FULL' and t1.contract_status in ('REPURING','REPUR') and t2.cf_item =1 and t2.cf_direction='NONCASH' and nvl(t2.billing_amount,0) <> t2.received_amount))
and t2.cashflow_id not in (20265,34267,24445)
and nvl(t2.billing_status,'NOT') != 'FULL'
--and t2.cf_direction='INFLOW'
......
......@@ -111,7 +111,8 @@
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;CONFIRMING&apos;,&apos;REJECT&apos;)"/>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;REJECT&apos;)"/>
<bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
<bm:data-filter enforceOperations="query" expression="not exists (select 1 from acr_invoice_hd_wfl ah where ah.invoice_hd_id = t1.invoice_hd_id and ah.invoice_status = &apos;CONFIRMING&apos;)"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 下午06:07:55
$Author: Leauan
$Date: 20201106
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="execute">
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
acr_invoice_pkg.acr_invoice_status_change(p_invoice_hd=> ${@invoice_hd_ids},
p_want_status=>${@want_status},
p_user_id=>${/session/@user_id} );
end;
]]></bm:update-sql>
begin
acr_invoice_wfl_pkg.acr_invoice_apply_insert(p_invoice_apply_id => ${@invoice_apply_id},
p_invoice_hd_id_rec => ${@invoice_hd_ids},
p_note => ${@note},
p_company_id => ${/session/@company_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="invoice_apply_id" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@invoice_apply_id"/>
</bm:parameters>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
acr_invoice_pkg.acr_invoice_status_reject(p_invoice_hd_id=> ${@invoice_hd_id},
p_want_status=>${@want_status},
p_user_id=>${/session/@user_id} );
end;
]]></bm:update-sql>
begin
acr_invoice_wfl_pkg.acr_invoice_wfl_insert(p_invoice_apply_id => ${../../@invoice_apply_id},
p_invoice_hd_id => ${@invoice_hd_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -6,112 +6,281 @@
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM (SELECT t1.invoice_hd_id,
t1.document_number,
TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') AS invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
nvl(t1.contract_name,(select contract_name from con_contract
where contract_id =(select cf.contract_id
from con_contract_Cashflow cf,acr_invoice_ln ln
where ln.invoice_hd_id=t1.invoice_hd_id
and cf.cashflow_id=ln.cashflow_id
and rownum=1)
))contract_name, --modify by wuts 2019-1-22
--decode(t1.lease_channel,'01',t1.project_name,'') contract_name2,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.invoice_title,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
TO_CHAR(t1.accounting_date, 'yyyy-mm-dd') AS accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id
FROM acr_invoice_hd_v t1
ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE#
ORDER BY invoice_date DESC, document_number DESC
]]></bm:query-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.delete_invoice(p_invoice_hd_id => ${@invoice_hd_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
FROM (Select
aa.invoice_apply_id,
ah.invoice_hd_wfl_id,
al.invoice_ln_wfl_id,
ah.contract_id,
ah.project_id,
ah.bp_id,
al.cashflow_id,
ah.document_number,
cwo.write_off_id,
(Select c.contract_number
From con_contract c
Where c.contract_id = ah.contract_id) contract_number,
(Select hb.bp_code
From hls_bp_master hb
Where hb.bp_id = ah.bp_id) bp_code,
ah.bp_name,
nvl(cwo.times,
(Select t.times
From con_contract_cashflow t
Where t.cashflow_id = al.cashflow_id)) times,
decode(al.cf_item,
9,
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h
Where h.journal_header_id = al.ref_n03
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code =
'HL_CSH_CONSOLIDATION_DALAY_CM')
And rownum = 1),
1,
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_SALES_TAX_ACT_NEW',
'HL_SALES_TAX_ACT_NEW_LB'))
And rownum = 1),
2,
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code =
'HL_INCEPT_DOWN_PAYMENT_CF')
And rownum = 1),
11,
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code =
'HL_CON_FIN_ETFEE_N')
And rownum = 1),
250,
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_FIN_INCOME_REPURCHASE',
'HL_FIN_INCOME_REPURCHASE_N'))
And rownum = 1),
200,
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists
(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_CON_TAX_ET', 'HL_CON_TAX_ET_N'))
And rownum = 1),
8,
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists
(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_CON_TAX_ET', 'HL_CON_TAX_ET_N'))
And rownum = 1),
(Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And rownum = 1)) journal_month,
al.tax_type_rate,
al.total_amount,
al.net_amount,
al.tax_amount,
nvl((Select ctr.paid_byother_flag
From csh_transaction ctr
Where ctr.transaction_id = cwo.csh_transaction_id),
'F') paid_byother_flag,
(Select v.code_value_name
From sys_code_values_v v
Where v.code = 'PAID_BYOTHER_FLAG'
And v.code_value =
nvl((Select ctr.paid_byother_flag
From csh_transaction ctr
Where ctr.transaction_id = cwo.csh_transaction_id),
'F')) paid_byother_flag_n,
(Select ctr.bp_bank_account_name
From csh_transaction ctr
Where ctr.transaction_id = cwo.csh_transaction_id) bp_bank_account_name,
(Select ctr.transaction_amount
From csh_transaction ctr
Where ctr.transaction_id = cwo.csh_transaction_id) transaction_amount,
cwo.write_off_due_amount,
(Select ctr.transaction_num
From csh_transaction ctr
Where ctr.transaction_id = cwo.csh_transaction_id) transaction_num,
decode(al.cf_item,
9,
(Select h.journal_num
From hls_journal_header h
Where h.journal_header_id = al.ref_n03
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code =
'HL_CSH_CONSOLIDATION_DALAY_CM')
And rownum = 1),
1,
(Select h.journal_num
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_SALES_TAX_ACT_NEW',
'HL_SALES_TAX_ACT_NEW_LB'))
And rownum = 1),
2,
(Select h.journal_num
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code =
'HL_INCEPT_DOWN_PAYMENT_CF')
And rownum = 1),
11,
(Select h.journal_num
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code =
'HL_CON_FIN_ETFEE_N')
And rownum = 1),
250,
(Select h.journal_num
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_FIN_INCOME_REPURCHASE',
'HL_FIN_INCOME_REPURCHASE_N'))
And rownum = 1),
200,
(Select h.journal_num
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists
(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_CON_TAX_ET', 'HL_CON_TAX_ET_N'))
And rownum = 1),
8,
(Select h.journal_num
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And Exists
(Select 1
From gld_je_template_hds jh
Where jh.je_template_hd_id =
h.je_template_hd_id
And jh.je_template_code In
('HL_CON_TAX_ET', 'HL_CON_TAX_ET_N'))
And rownum = 1),
(Select h.journal_num
From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id
And l.cashflow_id = cwo.cashflow_id
And rownum = 1)) journal_num,
ah.invoice_hd_id,
(cwo.write_off_id + al.invoice_ln_wfl_id) file_id
From acr_invoice_apply aa,
acr_invoice_hd_wfl ah,
acr_invoice_ln_wfl al,
csh_write_off cwo
Where aa.invoice_apply_id = ah.invoice_apply_id
And ah.invoice_hd_wfl_id = al.invoice_hd_wfl_id
And al.cashflow_id = cwo.cashflow_id (+)) t1 #WHERE_CLAUSE#
order by t1.contract_id desc, t1.times asc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE
acr_invoice_hd a
SET
a.merge_flag = ${@merge_flag}
WHERE
a.invoice_hd_id = ${@invoice_hd_id};
acr_invoice_pkg.invoice_row_merge(p_invoice_hd_id => ${@invoice_hd_id}, p_user_id => ${/session/@user_id}, p_merge_flag =>${@merge_flag});
END;
]]></bm:update-sql>
begin
acr_invoice_wfl_pkg.acr_invoice_wfl_submit(p_invoice_apply_id => ${@invoice_apply_id},
p_company_id => ${/session/@company_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/>
<bm:query-field name="document_number_t" queryExpression="t1.document_number &lt;= ${@document_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &lt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<bm:query-field name="contract_name" queryExpression="t1.contract_name like ${@contract_name}"/>
<bm:query-field name="invoice_bp_name" queryExpression="t1.invoice_bp_name like ${@invoice_bp_name}"/>
<bm:query-field name="invoice_status" queryExpression="t1.invoice_status like ${@invoice_status}"/>
<bm:query-field name="invoice_date_f" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/>
<!--
<bm:query-field name="contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
-->
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_code" queryExpression="t1.bp_code = ${@bp_code}"/>
<bm:query-field name="journal_month" queryExpression="t1.journal_month = ${@journal_month}"/>
<bm:query-field name="paid_byother_flag_n" queryExpression="t1.paid_byother_flag = ${@paid_byother_flag}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;CONFIRMING&apos;,&apos;REJECT&apos;)"/>
<bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
<bm:data-filter enforceOperations="query" expression="t1.invoice_apply_id = ${@invoice_apply_id}"/>
</bm:data-filters>
</bm:model>
......@@ -6,112 +6,78 @@
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM (SELECT t1.invoice_hd_id,
t1.document_number,
TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') AS invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
nvl(t1.contract_name,(select contract_name from con_contract
where contract_id =(select cf.contract_id
from con_contract_Cashflow cf,acr_invoice_ln ln
where ln.invoice_hd_id=t1.invoice_hd_id
and cf.cashflow_id=ln.cashflow_id
and rownum=1)
))contract_name, --modify by wuts 2019-1-22
--decode(t1.lease_channel,'01',t1.project_name,'') contract_name2,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.invoice_title,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
TO_CHAR(t1.accounting_date, 'yyyy-mm-dd') AS accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id
FROM acr_invoice_hd_v t1
ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE#
ORDER BY invoice_date DESC, document_number DESC
]]></bm:query-sql>
Select
t.invoice_apply_id,
t.invoice_apply_num,
to_char(t.invoice_apply_date, 'yyyy-mm-dd') invoice_apply_date,
t.invoice_apply_user,
(Select su.description
From sys_user su
Where su.user_id = t.invoice_apply_user) invoice_apply_user_n,
t.wfl_instance_id,
t.wfl_apply_status,
(Select v.code_value_name
From sys_code_values_v v
Where v.code = 'WFL_STATUS'
And v.code_value = t.wfl_apply_status) wfl_apply_status_n,
nvl((Select nvl(Sum(ah.total_amount), 0)
From acr_invoice_hd_wfl ah
Where ah.invoice_apply_id = t.invoice_apply_id),
0) total_amount,
nvl((Select nvl(Sum(ah.tax_amount), 0)
From acr_invoice_hd_wfl ah
Where ah.invoice_apply_id = t.invoice_apply_id),
0) tax_amount,
nvl((Select nvl(Sum(nvl(ah.total_amount, 0) - nvl(ah.tax_amount, 0)),
0)
From acr_invoice_hd_wfl ah
Where ah.invoice_apply_id = t.invoice_apply_id),
0) net_amount,
t.creation_date,
t.created_by,
t.last_update_date,
t.last_updated_by,
t.note,
t.ref_v01,
t.ref_v02,
t.ref_v03,
t.ref_v04,
t.ref_v05,
t.ref_n01,
t.ref_n02,
t.ref_n03,
t.ref_n04,
t.ref_n05,
t.ref_d01,
t.ref_d02,
t.ref_d03,
t.ref_d04,
t.ref_d05
From acr_invoice_apply t #WHERE_CLAUSE#
order by t.invoice_apply_id desc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.delete_invoice(p_invoice_hd_id => ${@invoice_hd_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE
acr_invoice_hd a
SET
a.merge_flag = ${@merge_flag}
WHERE
a.invoice_hd_id = ${@invoice_hd_id};
acr_invoice_pkg.invoice_row_merge(p_invoice_hd_id => ${@invoice_hd_id}, p_user_id => ${/session/@user_id}, p_merge_flag =>${@merge_flag});
END;
]]></bm:update-sql>
begin
acr_invoice_wfl_pkg.acr_invoice_wfl_cancel(p_invoice_apply_id => ${@invoice_apply_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/>
<bm:query-field name="document_number_t" queryExpression="t1.document_number &lt;= ${@document_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &lt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<bm:query-field name="contract_name" queryExpression="t1.contract_name like ${@contract_name}"/>
<bm:query-field name="invoice_bp_name" queryExpression="t1.invoice_bp_name like ${@invoice_bp_name}"/>
<bm:query-field name="invoice_status" queryExpression="t1.invoice_status like ${@invoice_status}"/>
<bm:query-field name="invoice_date_f" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/>
<!--
<bm:query-field name="contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
-->
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
<bm:query-field name="invoice_apply_num" queryExpression="t.invoice_apply_num like &apos;%&apos;||${@invoice_apply_num}||&apos;%&apos;"/>
<bm:query-field name="invoice_apply_date" queryExpression="trunc(t.invoice_apply_date) = to_date(${@invoice_apply_date}, 'yyyy-mm-dd')"/>
<bm:query-field name="invoice_apply_user_n" queryExpression="t.invoice_apply_user = ${@invoice_apply_user}"/>
<bm:query-field name="wfl_apply_status_n" queryExpression="t.wfl_apply_status = ${@wfl_apply_status}"/>
<bm:query-field name="invoice_apply_id" queryExpression="t.invoice_apply_id = ${@invoice_apply_id}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;CONFIRMING&apos;,&apos;REJECT&apos;)"/>
<bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
<bm:data-filter enforceOperations="query" expression="t.wfl_apply_status != 'CANCEL'"/>
</bm:data-filters>
</bm:model>
<?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-insert model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
<a:model-insert model="acr.ACR512N.acr_invoice_update_for_submit" trace="true"/>
<batch-apply sourcePath="/parameter/details">
<a:model-update model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
<a:model-update model="acr.ACR512N.acr_invoice_update_for_submit" trace="true"/>
</batch-apply>
<a:model-execute model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
......@@ -17,16 +17,16 @@
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="acr512_invoice_update_page"
url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_detail.lview"/>
<!-- <a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.screen"/>
-->
<!--<a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.screen"/>-->
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="acr512_submit_id" model="acr.ACR512.acr_invoice_hd_batch" modelaction="update"/>
<a:link id="get_document_number_link" model="acr.ACR512.get_document_number" modelaction="query"/>
<a:link id="acr512_update_for_submit_id" url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_for_submit.lsc"/>
<a:link id="acr_invoice_apply_detail_link" url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_apply_detail.lview"/>
<script><![CDATA[
//提交复核
function acr512_invoice_submit_selected() {
debugger;
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length == 0) {
$L.showInfoMessage('提示', '请至少选择一条数据!');
......@@ -80,11 +80,11 @@
}
function lock_current_window() {
leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
function unlock_current_window() {
leaf.Masker.unmask(Ext.getBody());
Leaf.Masker.unmask(Ext.getBody());
}
function acr512_invoice_query() {
......@@ -242,6 +242,78 @@
});
}
function acr512_invoice_insert() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
}
var datas = {};
var saveData = [];
var invoice_hd_ids = '';
var invoice_kind = records[0].get('invoice_kind');
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
$L.showErrorMessage("提示", '发票状态有误!');
return;
}
if(invoice_kind != records[i].get('invoice_kind')){
$L.showErrorMessage("提示", '普票和专票不能同时勾选!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
records[i].set('_status', 'update');
saveData.push(records[i].data);
}
saveData.sort(function (a, b) {
return a.invoice_hd_id - b.invoice_hd_id;
});
datas['invoice_hd_ids'] = invoice_hd_ids;
datas['details'] = saveData;
Leaf.showConfirm('提示', '<span style="color: #ff0000; ">发票在申请期间将无法进行修改操作!如需要取消发票申请,请点击取消申请!</span>', function () {
lock_current_window();
Leaf.request({
url: $('acr512_update_for_submit_id').getUrl(),
para: datas,
success: function (res) {
Leaf.SideBar.show({
msg: '申请成功',
duration: 3000
});
unlock_current_window();
//$('acr512_invoice_result_ds').query();
var win = new Leaf.Window({
id: 'acr_invoice_apply_detail_link_winid',
params: {
invoice_apply_id: res.result.invoice_apply_id,
winId: 'acr_invoice_apply_detail_link_winid'
},
url: $('acr_invoice_apply_detail_link').getUrl(),
title: '申请明细',
fullScreen: true
});
win.on('close',function(){
$('acr512_invoice_result_ds').query();
});
},
failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
......@@ -321,12 +393,6 @@
<a:dataSet id="acr512_invoice_result_ds" autoPageSize="true" autoQuery="true"
model="acr.ACR512.acr_invoice_update_query" queryDataSet="acr512_invoice_query_ds"
selectable="true"/>
<!-- <a:fields>-->
<!-- <a:field name="compare_date_flag"/>-->
<!-- </a:fields>-->
<!-- <a:events>-->
<!-- <a:event name="load" handler="load_do_info"/>-->
<!-- </a:events>-->
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
......@@ -334,7 +400,8 @@
<a:toolbarButton click="acr512_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>
<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>
<!--<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>-->
<a:toolbarButton click="acr512_invoice_insert" text="新建申请"/>
<!--
<a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/>
-->
......
......@@ -6,476 +6,172 @@
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="acr512_currency_list"/>
<a:model-query fetchAll="true" model="acr.ACR512.acr_invoice_business_type_list"
rootPath="acr512_business_type_list"/>
</a:init-procedure>
<a:view>
<a:link id="acr512_invoice_status_change" model="acr.ACR512.alter_acr_invoice_status" modelaction="execute"/>
<a:link id="acr513_invoice_readonly_page"
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="acr512_invoice_update_page"
url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_detail.lview"/>
<!--<a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.screen"/>-->
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="acr512_submit_id" model="acr.ACR512.acr_invoice_hd_batch" modelaction="update"/>
<a:link id="get_document_number_link" model="acr.ACR512.get_document_number" modelaction="query"/>
<a:link id="acr512_update_for_submit_id" url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_for_submit.lsc"/>
<a:link id="acr_invoice_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="acr610_invoice_detail_link" url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_detail_readonly.lview"/>
<a:link id="acr610_detail_submit_link" model="acr.ACR610.acr_invoice_apply_detail" modelaction="update"/>
<a:link id="attachment_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="attachment_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<script><![CDATA[
//提交复核
function acr512_invoice_submit_selected() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length == 0) {
$L.showInfoMessage('提示', '请至少选择一条数据!');
} else {
var invoice_hd_ids = '';
//判断单据的状态
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
$L.showErrorMessage("提示", '发票状态有误!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
}
var detail_mask = Ext.getBody();
Leaf.showConfirm('提示', "确认执行该操作?", function () {
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('acr512_invoice_status_change').getUrl(),
para: {
invoice_hd_ids: invoice_hd_ids,
want_status: 'CONFIRMING'
},
success: function () {
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('acr512_invoice_result_ds').query();
},
error: function () {
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
},
scope: this
});
}, function () {
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
})
}
}
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
function lock_current_detail_window() {
Leaf.Masker.mask($('${/parameter/@winId}').wrap, '${l:HLS.EXECUTING}');
}
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
function unlock_current_detail_window() {
Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
}
function acr512_invoice_query() {
$('acr512_invoice_result_ds').query();
var records = $('acr512_invoice_result_ds').getAll();
for (var i = 0; i < records.length; i++) {
var record = record[i];
var invoice_hd_id = record.get('invoice_hd_id');
Leaf.request({
url: $('get_document_number_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id
},
success: function (res) {
var document_number = record[i].get('document_number');
if (res.result.record['isreturn'] > 0) {
return '<font color="red">' + document_number + '</font> ';
} else {
return value;
}
}
});
}
$('acr512_invoice_result_ds').query();
function acr610_invoice_detail_exit() {
$('${/parameter/@winId}').close();
}
function acr512_invoice_reset() {
$('acr512_invoice_query_ds').reset();
function acr610_invoice_detail_query() {
$('acr610_invoice_detail_result_ds').query();
}
function acr512_grid_update(reocrd_id, invoice_hd_id, status) {
var maintain_type = 'UPDATE';
var currency_reocrd = $('acr512_invoice_result_ds').findById(reocrd_id);
var param = currency_reocrd.data;
param['function_code'] = 'ACR512';
param['winid'] = 'confirm_invoice_win';
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
if (param['invoice_status'] == 'CONFIRMING') {
param['function_code'] = 'ACR512R';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_result_ds');
} else {
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_result_ds');
}
function acr610_invoice_detail_reset() {
$('acr610_invoice_detail_query_ds').reset();
}
function acr512_document_number_render(value, record, name) {
if (name == 'document_number') {
if (record.get('compare_date_flag') == 'Y') {
return '<a style="color:red" href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
} else {
return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
}
// return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
function acr512_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
}
function acr512_invoice_query_Onupdate(ds, record, name, value, oldVlaue) {
if (name == 'document_number_f') {
if (Leaf.isEmpty(record.get('document_number_t'))) {
record.set('document_number_t', value);
}
} else if (name == 'project_number_f') {
if (Leaf.isEmpty(record.get('project_number_t'))) {
record.set('project_number_t', value);
}
} else if (name == 'invoice_number_f') {
if (Leaf.isEmpty(record.get('invoice_number_t'))) {
record.set('invoice_number_t', value);
}
} else if (name == 'contract_number_f') {
if (Leaf.isEmpty(record.get('contract_number_t'))) {
record.set('contract_number_t', value);
}
} else if (name == 'invoice_bp_code_f') {
if (Leaf.isEmpty(record.get('invoice_bp_code_t'))) {
record.set('invoice_bp_code_t', value);
}
} else if (name == 'total_amount_f') {
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
}
if (Ext.isEmpty(record.get('project_number_f')) && Ext.isEmpty(record.get('project_number_t'))) {
record.set('query_project_number', '');
} else {
record.set('query_project_number', 'Y');
}
if (Ext.isEmpty(record.get('contract_number_f')) && Ext.isEmpty(record.get('contract_number_t'))) {
record.set('query_contract_number', '');
} else {
record.set('query_contract_number', 'Y');
}
}
function acr512_invoice_delete() {
$('acr512_invoice_update_grid_ds').remove();
}
//发票提交
function acr512_invoice_submit() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
}
var datas = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('status') == 'APPROVED' || records[i].get('statsu') == 'APPROVING') {
Leaf.showMessage('${l:HLS.PROMPT}', '该发票正在审批中或已审批通过,不可重复提交');
return;
}
if (i == 0) { //modify by wuts for hl 2018-12-23
var invoice_hd_ids = records[0].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
}
function acr610_invoice_detail_submit() {
Leaf.showConfirm('提示', '您确认提交吗', function () {
lock_current_window();
lock_current_detail_window();
Leaf.request({
url: $('acr512_submit_id').getUrl(),
url: $('acr610_detail_submit_link').getUrl(),
para: {
invoice_hd_ids: invoice_hd_ids
invoice_apply_id: '${/parameter/@invoice_apply_id}'
},
success: function () {
Leaf.SideBar.show({
msg: '提交成功',
duration: 3000
});
unlock_current_window();
$('acr512_invoice_result_ds').query();
unlock_current_detail_window();
acr610_invoice_detail_exit();
},
failure: function () {
unlock_current_window();
unlock_current_detail_window();
},
error: function () {
unlock_current_window();
unlock_current_detail_window();
},
scope: this
});
});
}
function acr512_invoice_insert() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
function acr610_detail_grid_readonly(reocrd_id, invoice_hd_wfl_id) {
var currency_reocrd = $('acr610_invoice_detail_result_ds').findById(reocrd_id);
var param = currency_reocrd.data;
param['winid'] = 'confirm_invoice_detail_win';
param['document_id'] = invoice_hd_wfl_id;
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
param['function_code'] = 'ACR610R';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
hls_doc_get_layout_code('acr_invoice_get_layout_code_link_id', param, 'acr610_invoice_detail_link');
}
function acr610_detail_upload_window(file_id) {
if(file_id){
var url = $('attachment_uploadFile_id').getUrl() + '?table_name=ACR_INVOICE_APPLY&header_id=' + file_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'acr_apply_cdd_attachtment_upload_id',
width: 850,
height: 400
});
}else {
Leaf.showMessage('${l:HLS.PROMPT}', '无法上传,请联系管理员!');
}
var datas = {};
var saveData = [];
var invoice_hd_ids = '';
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
$L.showErrorMessage("提示", '发票状态有误!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
records[i].set('_status', 'update');
saveData.push(records[i].data);
}
function acr610_detail_renderer(value, record, name) {
if (name == 'document_number') {
return '<a href="javascript:acr610_detail_grid_readonly(' + record.id + ',' + record.get('invoice_hd_wfl_id') + ');">' + value + '</a>';
}
datas['invoice_hd_ids'] = invoice_hd_ids;
datas['details'] = saveData;
Leaf.showConfirm('提示', '您确认新建申请吗', function () {
lock_current_window();
Leaf.request({
url: $('acr512_update_for_submit_id').getUrl(),
para: datas,
success: function () {
Leaf.SideBar.show({
msg: '提交成功',
duration: 3000
});
unlock_current_window();
$('acr512_invoice_result_ds').query();
},
failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
});
if(name == 'attachment'){
if(record.get('paid_byother_flag') == 'T'){
return '<a href="javascript:acr610_detail_upload_window(' + record.get('file_id') + ')">附件</a>';
}
}
}
function acr610_detail_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acr512_currency_ds">
<a:datas dataSource="/model/acr512_currency_list"/>
</a:dataSet>
<a:dataSet id="acr512_business_type_ds">
<a:datas dataSource="/model/acr512_business_type_list"/>
<a:dataSet id="acr610_ipaid_byother_flag_ds" lookupCode="PAID_BYOTHER_FLAG"/>
<a:dataSet id="acr610_invoice_apply_basic_ds" autoQuery="true" fetchAll="true" model="acr.ACR610.acr_invoice_apply_query" queryUrl="${/request/@context_path}/autocrud/acr.ACR610.acr_invoice_apply_query/query?invoice_apply_id=${/parameter/@invoice_apply_id}">
<a:fields>
<a:field name="invoice_apply_num"/>
<a:field name="invoice_apply_user_n"/>
<a:field name="invoice_apply_date"/>
</a:fields>
</a:dataSet>
<a:dataSet id="acr512_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>
<a:dataSet id="acr512_invoice_status_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="hls_lease_channel_ds" loadData="true" model="basic.hls_lease_channel_for_lov"/>
<a:dataSet id="acr512_invoice_query_ds">
<a:dataSet id="acr610_invoice_detail_query_ds">
<a:fields>
<a:field name="currency_name" displayField="currency_name" options="acr512_currency_ds"
returnField="currency" valueField="currency_code"/>
<a:field name="invoice_status_n" displayField="code_value_name" options="acr512_invoice_status_ds"
returnField="invoice_status" valueField="code_value"/>
<a:field name="invoice_kind"/>
<a:field name="contract_name"/>
<a:field name="invoice_bp_name"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr512_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>
<a:field name="business_type_desc" displayField="business_type_desc"
options="acr512_business_type_ds" returnField="business_type" valueField="business_type"/>
<a:field name="created_by_name" lovGridHeight="320" lovHeight="500"
lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
<a:mapping>
<a:map from="user_id" to="created_by"/>
<a:map from="description" to="created_by_name"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_f"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_t"/>
</a:mapping>
</a:field>
<a:field name="project_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_f"/>
</a:mapping>
</a:field>
<a:field name="project_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_t"/>
</a:mapping>
</a:field>
<a:field name="contract_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_f"/>
</a:mapping>
</a:field>
<a:field name="contract_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_t"/>
</a:mapping>
</a:field>
<a:field name="lease_channel"/>
<a:field name="lease_channel_desc" displayField="description" options="hls_lease_channel_ds"
returnField="lease_channel" valueField="lease_channel"/>
<a:field name="contract_number"/>
<a:field name="bp_code"/>
<a:field name="journal_month"/>
<a:field name="paid_byother_flag_n" displayField="code_value_name" options="acr610_ipaid_byother_flag_ds"
returnField="paid_byother_flag" valueField="code_value"/>
</a:fields>
<a:events>
<a:event name="update" handler="acr512_invoice_query_Onupdate"/>
</a:events>
</a:dataSet>
<a:dataSet id="acr512_invoice_result_ds" autoPageSize="true" autoQuery="true"
model="acr.ACR512.acr_invoice_update_query" queryDataSet="acr512_invoice_query_ds"
selectable="true"/>
<!-- <a:fields>-->
<!-- <a:field name="compare_date_flag"/>-->
<!-- </a:fields>-->
<!-- <a:events>-->
<!-- <a:event name="load" handler="load_do_info"/>-->
<!-- </a:events>-->
<a:dataSet id="acr610_invoice_detail_result_ds" autoPageSize="true" autoQuery="true" fetchAll="true"
model="acr.ACR610.acr_invoice_apply_detail" queryUrl="${/request/@context_path}/autocrud/acr.ACR610.acr_invoice_apply_detail/query?invoice_apply_id=${/parameter/@invoice_apply_id}" queryDataSet="acr610_invoice_detail_query_ds"
selectable="false"/>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr512_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>
<!--<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>-->
<a:toolbarButton click="acr512_invoice_insert" text="新建申请"/>
<!--
<a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/>
-->
<a:toolbarButton click="acr610_invoice_detail_exit" text="HLS.EXIT"/>
<a:toolbarButton click="acr610_invoice_detail_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr610_invoice_detail_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr610_invoice_detail_submit" text="HLS.SUBMIT"/>
</a:screenTopToolbar>
<a:form marginWidth="200" padding="0" title="应收发票维护">
<a:form marginWidth="200" padding="0" title="查询条件">
<a:hBox labelSeparator=" ">
<a:textField name="document_number_f" bindTarget="acr512_invoice_query_ds"
prompt="HLS.DOCUMENT_NUMBER_FROM" width="135"/>
<!--
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
-->
<a:textField name="document_number_t" bindTarget="acr512_invoice_query_ds" prompt="单据编号到"
width="135"/>
<a:textField name="contract_name" bindTarget="acr512_invoice_query_ds" prompt="合同名称" width="353"/>
<!-- <a:lov name="contract_number_f" bindTarget="acr512_invoice_query_ds" prompt="合同编号从" width="135"/>-->
<!--
<div><![CDATA[${l:HLS.CONTRACT_NUMBER_TO}]]></div>
-->
<!-- <a:lov name="contract_number_t" bindTarget="acr512_invoice_query_ds" prompt="合同编号到" width="135"/>-->
<!-- <a:lov name="project_number_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.PROJECT_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
<a:lov name="project_number_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>-->
<!--
<a:comboBox name="business_type_desc" bindTarget="acr512_invoice_query_ds" prompt="HLS.BUSINESS_TYPE_DESC" width="135"/>
-->
<!--
<a:comboBox name="lease_channel_desc" bindTarget="acr512_invoice_query_ds" prompt="商业模式" width="135"/>
-->
<!-- <a:comboBox name="currency_name" bindTarget="acr512_invoice_query_ds" prompt="HLS.CURRENCY" width="135"/> -->
</a:hBox>
<a:hBox labelSeparator=" ">
<a:datePicker name="accounting_date_f" bindTarget="acr512_invoice_query_ds" prompt="记账日期从"
width="135"/>
<!--
<div><![CDATA[${l:HLS.ACCOUNT_DATE_TO}]]></div>
-->
<a:datePicker name="accounting_date_t" bindTarget="acr512_invoice_query_ds" prompt="记账日期到"
width="135"/>
<a:lov name="created_by_name" bindTarget="acr512_invoice_query_ds" prompt="创建人" width="135"/>
<a:textField name="invoice_title" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_TITLE"
width="135"/>
<a:textField name="contract_number" bindTarget="acr610_invoice_detail_query_ds" prompt="合同编号" width="135"/>
<a:textField name="bp_code" bindTarget="acr610_invoice_detail_query_ds" prompt="客户编号" width="135"/>
<a:textField name="journal_month" bindTarget="acr610_invoice_detail_query_ds" prompt="税款所属期" width="135" emptyText="YYYY-MM"/>
<a:comboBox name="paid_byother_flag_n" bindTarget="acr610_invoice_detail_query_ds" prompt="担保支付" width="135"/>
</a:hBox>
</a:form>
<a:form marginWidth="200" padding="0" title="基本信息">
<a:hBox labelSeparator=" ">
<a:datePicker name="invoice_date_f" bindTarget="acr512_invoice_query_ds" prompt="发票日期从"
width="135"/>
<!--
<div><![CDATA[${l:ACR.INVOICE_DATE_TO}]]></div>
-->
<a:datePicker name="invoice_date_t" bindTarget="acr512_invoice_query_ds" prompt="发票日期到"
width="135"/>
<!-- <a:lov name="invoice_bp_code_f" bindTarget="acr512_invoice_query_ds" prompt="客户编号从" width="135"/>-->
<!--
<div><![CDATA[${l:HLS.CUSTOMER_NUMBER_TO}]]></div>
-->
<!-- <a:lov name="invoice_bp_code_t" bindTarget="acr512_invoice_query_ds" prompt="客户编号到" width="135"/>-->
<a:textField name="invoice_bp_name" bindTarget="acr512_invoice_query_ds" prompt="客户名称" width="135"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_KIND"
width="135"/>
<a:comboBox name="invoice_status_n" bindTarget="acr512_invoice_query_ds" prompt="发票状态" width="135"/>
<a:textField name="invoice_apply_num" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请编号" width="135" readOnly="true"/>
<a:textField name="invoice_apply_user_n" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请人" width="135" readOnly="true"/>
<a:textField name="invoice_apply_date" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请时间" width="135" readOnly="true"/>
</a:hBox>
</a:form>
<a:grid id="acr512_invoice_update_grid_ds" bindTarget="acr512_invoice_result_ds" marginHeight="250"
<a:grid id="acr610_invoice_detail_grid_ds" bindTarget="acr610_invoice_detail_result_ds" marginHeight="250"
marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER"
renderer="acr512_document_number_render" width="120"/>
<a:column name="invoice_bp_name" autoAdjust="false" prompt="HLS.CUSTOMER_NAME" showTitle="true"
width="100"/>
<a:column name="contract_name" autoAdjust="false" prompt="HLS.CONTRACT_NAME" showTitle="true"
width="150"/>
<!--
<a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>
-->
<a:column name="invoice_kind_desc" prompt="ACR.INVOICE_KIND" width="100"/>
<!-- <a:column name="invoice_number" prompt="ACR.INVOICE_NUMBER" width="120"/> -->
<a:column name="invoice_date" prompt="ACR.INVOICE_DATE" width="100"/>
<!-- <a:column name="project_name" autoAdjust="false" prompt="HLS.PROJECT_NAME" showTitle="true" width="150"/> -->
<!-- <a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/> -->
<!-- <a:column name="bp_code" prompt="HLS.CUSTOMER_NUMBER" width="100"/> -->
<a:column name="invoice_title" autoAdjust="false" prompt="ACR.INVOICE_TITLE" showTitle="true"
width="150"/>
<!-- <a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Aurora.formatMoney" width="100"/> -->
<!-- <a:column name="currency" prompt="HLS.CURRENCY" width="80"/> -->
<a:column name="created_by_name" autoAdjust="false" prompt="创建人" showTitle="true" width="150"/>
<a:column name="invoice_status_desc" prompt="ACR.INVOICE_STATUS" width="100"/>
<a:column name="accounting_date" prompt="HLS.ACCOUNT_DATE" width="100"/>
<!-- <a:column name="compare_date_flag" prompt="比较日期" width="100"/> -->
<!-- <a:column name="project_number" prompt="HLS.PROJECT_NUMBER" width="120"/> -->
<a:column name="document_number" lock="true" prompt="单据编号" align="center" renderer="acr610_detail_renderer" width="120"/>
<a:column name="contract_number" prompt="合同编号" align="center" width="100"/>
<a:column name="bp_code" prompt="客户编号" align="center" width="100"/>
<a:column name="bp_name" prompt="客户名称" align="center" width="100"/>
<a:column name="times" prompt="租期" align="center" width="60"/>
<a:column name="journal_month" prompt="税款所属期" align="center" width="120"/>
<a:column name="tax_type_rate" prompt="税率" align="right" width="60"/>
<a:column name="total_amount" prompt="开票金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="net_amount" prompt="不含税金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="tax_amount" prompt="税额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="paid_byother_flag_n" prompt="担保支付" align="center" width="100"/>
<a:column name="bp_bank_account_name" prompt="付款人" align="center" width="100"/>
<a:column name="transaction_amount" prompt="付款金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="write_off_due_amount" prompt="核销金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="transaction_num" prompt="收款业务编号" align="center" width="100"/>
<a:column name="journal_num" prompt="增值税凭证号" align="center" width="100"/>
<a:column name="attachment" prompt="担保代付协议" align="center" width="100" renderer="acr610_detail_renderer"/>
</a:columns>
</a:grid>
</a:screenBody>
......
......@@ -6,27 +6,24 @@
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="acr610_invoice_detail_link" url="${/request/@context_path}/modules/acr/acr610/acr_invoice_detail_update_detail.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="acr610_detail_submit_link" model="acr.acr610.acr_invoice_apply_detail" modelaction="update"/>
<a:link id="acr_invoice_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="acr610_invoice_detail_link" url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_detail_readonly.lview"/>
<a:link id="acr610_detail_submit_link" model="acr.ACR610.acr_invoice_apply_detail" modelaction="update"/>
<a:link id="attachment_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="attachment_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<script><![CDATA[
function lock_current_detail_window() {
Leaf.Masker.mask($('${/parameter/@win_id}').wrap, '${l:HLS.EXECUTING}');
Leaf.Masker.mask($('${/parameter/@winId}').wrap, '${l:HLS.EXECUTING}');
}
function unlock_current_detail_window() {
Leaf.Masker.unmask($('${/parameter/@win_id}').wrap);
Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
}
function acr610_invoice_detail_exit() {
$('${/parameter/@win_id}').close();
$('${/parameter/@winId}').close();
}
function acr610_invoice_detail_query() {
......@@ -69,17 +66,17 @@
var param = currency_reocrd.data;
param['winid'] = 'confirm_invoice_detail_win';
param['document_id'] = invoice_hd_wfl_id;
param['url_title'] = '${l:ACR.INVOICE_DETAIL_DETAIL}';
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
param['function_code'] = 'ACR610R';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr610_invoice_detail_link');
hls_doc_get_layout_code('acr_invoice_get_layout_code_link_id', param, 'acr610_invoice_detail_link');
}
function acr610_detail_upload_window(write_off_id) {
if(write_off_id){
var url = $('attachment_uploadFile_id').getUrl() + '?table_name=ACR_INVOICE_APPLY&header_id=' + record.get('write_off_id');
function acr610_detail_upload_window(file_id) {
if(file_id){
var url = $('attachment_downloadFile_id').getUrl() + '?table_name=ACR_INVOICE_APPLY&header_id=' + file_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
......@@ -94,11 +91,11 @@
function acr610_detail_renderer(value, record, name) {
if (name == 'document_number') {
return '<a href="javascript:acr610_detail_grid_readonly(' + record.id + ',' + record.get('invoice_hd_wfl_id') + '\');">' + value + '</a>';
return '<a href="javascript:acr610_detail_grid_readonly(' + record.id + ',' + record.get('invoice_hd_wfl_id') + ');">' + value + '</a>';
}
if(name == 'attachment'){
if(record.get('paid_byother_flag') == 'T'){
return '<a href="javascript:acr610_detail_upload_window(\'' + record.get('write_off_id') + '\')">附件</a>';
return '<a href="javascript:acr610_detail_upload_window(' + record.get('file_id') + ')">附件</a>';
}
}
......@@ -111,13 +108,13 @@
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<!--<a:dataSet id="acr610_invoice_apply_query_ds">
<a:dataSet id="acr610_invoice_apply_basic_ds" model="acr.ACR610.acr_invoice_apply_query" queryUrl="${/request/@context_path}/autocrud/acr.ACR610.acr_invoice_apply_query/query?invoice_apply_id=${/parameter/@invoice_apply_id}" autoQuery="true">
<a:fields>
<a:field name="invoice_apply_num"/>
<a:field name="invoice_apply_user_n"/>
<a:field name="invoice_apply_date"/>
</a:fields>
</a:dataSet>-->
</a:dataSet>
<a:dataSet id="acr610_ipaid_byother_flag_ds" lookupCode="PAID_BYOTHER_FLAG"/>
<a:dataSet id="acr610_invoice_detail_query_ds">
<a:fields>
......@@ -129,52 +126,62 @@
</a:fields>
</a:dataSet>
<a:dataSet id="acr610_invoice_detail_result_ds" autoPageSize="true" autoQuery="true" fetchAll="true"
model="acr.acr610.acr_invoice_apply_detail" queryUrl="${/request/@context_path}/autocrud/acr.acr610.acr_invoice_apply_detail/query?invoice_apply_id=${/parameter/@invoice_apply_id}" queryDataSet="acr610_invoice_detail_query_ds"
model="acr.ACR610.acr_invoice_apply_detail" queryUrl="${/request/@context_path}/autocrud/acr.ACR610.acr_invoice_apply_detail/query?invoice_apply_id=${/parameter/@invoice_apply_id}" queryDataSet="acr610_invoice_detail_query_ds"
selectable="false"/>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr610_invoice_detail_exit" text="HLS.EXIT"/>
<a:toolbarButton click="acr610_invoice_detail_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr610_invoice_detail_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr610_invoice_detail_submit" text="HLS.SUBMIT"/>
</a:screenTopToolbar>
<a:switch test="/parameter/@button_flag">
<a:case value="YES">
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr610_invoice_detail_exit" text="HLS.EXIT"/>
<a:toolbarButton click="acr610_invoice_detail_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr610_invoice_detail_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
</a:case>
<a:case value="NO">
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr610_invoice_detail_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr610_invoice_detail_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
</a:case>
</a:switch>
<a:form marginWidth="200" padding="0" title="查询条件">
<a:hBox labelSeparator=" ">
<a:textField name="contract_number" bindTarget="acr610_invoice_detail_query_ds" prompt="合同编号" width="135"/>
<a:textField name="bp_code" bindTarget="acr610_invoice_detail_query_ds" prompt="客户编号" width="135"/>
<a:datePicker name="journal_month" bindTarget="acr610_invoice_detail_query_ds" prompt="税款所属期" width="135"/>
<a:textField name="journal_month" bindTarget="acr610_invoice_detail_query_ds" prompt="税款所属期" width="135" emptyText="YYYY-MM"/>
<a:comboBox name="paid_byother_flag_n" bindTarget="acr610_invoice_detail_query_ds" prompt="担保支付" width="135"/>
</a:hBox>
</a:form>
<a:form marginWidth="200" padding="0" title="基本信息">
<a:hBox labelSeparator=" ">
<a:textField name="invoice_apply_num" bindTarget="acr610_invoice_result_ds" prompt="申请编号" width="135" readOnly="true"/>
<a:textField name="invoice_apply_user_n" bindTarget="acr610_invoice_result_ds" prompt="申请人" width="135" readOnly="true"/>
<a:textField name="invoice_apply_date" bindTarget="acr610_invoice_result_ds" prompt="申请时间" width="135" readOnly="true"/>
<a:textField name="invoice_apply_num" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请编号" width="135" readOnly="true"/>
<a:textField name="invoice_apply_user_n" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请人" width="135" readOnly="true"/>
<a:textField name="invoice_apply_date" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请时间" width="135" readOnly="true"/>
</a:hBox>
</a:form>
<a:grid id="acr610_invoice_detail_grid_ds" bindTarget="acr610_invoice_detail_result_ds" marginHeight="250"
marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="单据编号" renderer="acr610_detail_renderer" width="120"/>
<a:column name="contract_number" prompt="合同编号" width="100"/>
<a:column name="bp_code" prompt="客户编号" width="150"/>
<a:column name="bp_name" prompt="客户名称" width="100"/>
<a:column name="times" prompt="租期" width="100"/>
<a:column name="journal_month" prompt="税款所属期" width="150"/>
<a:column name="tax_type_rate" prompt="税率" width="150"/>
<a:column name="total_amount" prompt="开票金额" renderer="acr610_detail_formatMoney" width="150"/>
<a:column name="net_amount" prompt="不含税金额" renderer="acr610_detail_formatMoney" width="100"/>
<a:column name="tax_amount" prompt="税额" renderer="acr610_detail_formatMoney" width="100"/>
<a:column name="paid_byother_flag_n" prompt="担保支付" width="100"/>
<a:column name="bp_bank_account_name" prompt="付款人" width="100"/>
<a:column name="transaction_amount" prompt="付款金额" renderer="acr610_detail_formatMoney" width="100"/>
<a:column name="write_off_due_amount" prompt="核销金额" renderer="acr610_detail_formatMoney" width="100"/>
<a:column name="transaction_num" prompt="收款业务编号" width="100"/>
<a:column name="journal_num" prompt="增值税凭证号" width="100"/>
<a:column name="attachment" prompt="担保代付协议" width="100" renderer="acr610_detail_renderer"/>
<a:column name="document_number" lock="true" prompt="单据编号" align="center" renderer="acr610_detail_renderer" width="120"/>
<a:column name="contract_number" prompt="合同编号" align="center" width="100"/>
<a:column name="bp_code" prompt="客户编号" align="center" width="100"/>
<a:column name="bp_name" prompt="客户名称" align="center" width="100"/>
<a:column name="times" prompt="租期" align="center" width="60"/>
<a:column name="journal_month" prompt="税款所属期" align="center" width="120"/>
<a:column name="tax_type_rate" prompt="税率" align="right" width="60"/>
<a:column name="total_amount" prompt="开票金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="net_amount" prompt="不含税金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="tax_amount" prompt="税额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="paid_byother_flag_n" prompt="担保支付" align="center" width="100"/>
<a:column name="bp_bank_account_name" prompt="付款人" align="center" width="100"/>
<a:column name="transaction_amount" prompt="付款金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="write_off_due_amount" prompt="核销金额" renderer="acr610_detail_formatMoney" align="right" width="100"/>
<a:column name="transaction_num" prompt="收款业务编号" align="center" width="100"/>
<a:column name="journal_num" prompt="增值税凭证号" align="center" width="100"/>
<a:column name="attachment" prompt="担保代付协议" align="center" width="100" renderer="acr610_detail_renderer"/>
</a:columns>
</a:grid>
</a:screenBody>
......
......@@ -6,476 +6,169 @@
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="acr512_currency_list"/>
<a:model-query fetchAll="true" model="acr.ACR512.acr_invoice_business_type_list"
rootPath="acr512_business_type_list"/>
</a:init-procedure>
<a:view>
<a:link id="acr512_invoice_status_change" model="acr.ACR512.alter_acr_invoice_status" modelaction="execute"/>
<a:link id="acr513_invoice_readonly_page"
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="acr512_invoice_update_page"
url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_detail.lview"/>
<!--<a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.screen"/>-->
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="acr512_submit_id" model="acr.ACR512.acr_invoice_hd_batch" modelaction="update"/>
<a:link id="get_document_number_link" model="acr.ACR512.get_document_number" modelaction="query"/>
<a:link id="acr512_update_for_submit_id" url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_for_submit.lsc"/>
<a:link id="acr_invoice_apply_detail_link" url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_apply_detail.lview"/>
<a:link id="acr_invoice_apply_detail_readonly_link" url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_apply_detail_wfl.lview"/>
<a:link id="acr610_invoice_apply_status_change" model="acr.ACR610.acr_invoice_apply_query" modelaction="delete"/>
<a:link id="acr_invoice_finish_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
<script><![CDATA[
//提交复核
function acr512_invoice_submit_selected() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length == 0) {
$L.showInfoMessage('提示', '请至少选择一条数据!');
} else {
var invoice_hd_ids = '';
//判断单据的状态
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
$L.showErrorMessage("提示", '发票状态有误!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
}
var detail_mask = Ext.getBody();
Leaf.showConfirm('提示', "确认执行该操作?", function () {
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('acr512_invoice_status_change').getUrl(),
para: {
invoice_hd_ids: invoice_hd_ids,
want_status: 'CONFIRMING'
},
success: function () {
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('acr512_invoice_result_ds').query();
},
error: function () {
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
},
scope: this
});
}, function () {
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
})
}
}
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
Leaf.Masker.unmask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
function acr512_invoice_query() {
$('acr512_invoice_result_ds').query();
var records = $('acr512_invoice_result_ds').getAll();
for (var i = 0; i < records.length; i++) {
var record = record[i];
var invoice_hd_id = record.get('invoice_hd_id');
Leaf.request({
url: $('get_document_number_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id
},
success: function (res) {
var document_number = record[i].get('document_number');
if (res.result.record['isreturn'] > 0) {
return '<font color="red">' + document_number + '</font> ';
} else {
return value;
}
}
});
}
$('acr512_invoice_result_ds').query();
function acr610_invoice_query() {
$('acr610_invoice_result_ds').query();
}
function acr512_invoice_reset() {
$('acr512_invoice_query_ds').reset();
function acr610_invoice_reset() {
$('acr610_invoice_apply_query_ds').reset();
}
function acr512_grid_update(reocrd_id, invoice_hd_id, status) {
var maintain_type = 'UPDATE';
var currency_reocrd = $('acr512_invoice_result_ds').findById(reocrd_id);
var param = currency_reocrd.data;
param['function_code'] = 'ACR512';
param['winid'] = 'confirm_invoice_win';
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
if (param['invoice_status'] == 'CONFIRMING') {
param['function_code'] = 'ACR512R';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_result_ds');
} else {
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_result_ds');
}
function acr610_grid_update(url) {
var win = new Leaf.Window({
id: 'acr_invoice_apply_detail_link_winid',
params: {
winId: 'acr_invoice_apply_detail_link_winid'
},
url: url,
title: '申请明细',
fullScreen: true
});
win.on('close',function(){
$('acr610_invoice_result_ds').query();
});
}
function acr512_document_number_render(value, record, name) {
if (name == 'document_number') {
if (record.get('compare_date_flag') == 'Y') {
return '<a style="color:red" href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
function acr610_apply_num_render(value, record, name) {
if (name == 'invoice_apply_num') {
if (record.get('wfl_apply_status') == 'NEW') {
url = $('acr_invoice_apply_detail_link').getUrl() + '?invoice_apply_id=' + record.get('invoice_apply_id') + '&invoice_apply_num=' + record.get('invoice_apply_num') + '&invoice_apply_user_n=' + record.get('invoice_apply_user_n') + '&invoice_apply_date=' + record.get('invoice_apply_date') ;
} else {
return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
url = $('acr_invoice_apply_detail_readonly_link').getUrl() + '?invoice_apply_id=' + record.get('invoice_apply_id') + '&invoice_apply_num=' + record.get('invoice_apply_num') + '&invoice_apply_user_n=' + record.get('invoice_apply_user_n') + '&invoice_apply_date=' + record.get('invoice_apply_date') + '&button_flag=YES';
}
return '<a href="javascript:acr610_grid_update(\'' + url + '\');">' + value + '</a>';
}
// return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
function acr512_formatMoney(value, record, name) {
function acr610_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
}
function acr512_invoice_query_Onupdate(ds, record, name, value, oldVlaue) {
if (name == 'document_number_f') {
if (Leaf.isEmpty(record.get('document_number_t'))) {
record.set('document_number_t', value);
}
} else if (name == 'project_number_f') {
if (Leaf.isEmpty(record.get('project_number_t'))) {
record.set('project_number_t', value);
}
} else if (name == 'invoice_number_f') {
if (Leaf.isEmpty(record.get('invoice_number_t'))) {
record.set('invoice_number_t', value);
}
} else if (name == 'contract_number_f') {
if (Leaf.isEmpty(record.get('contract_number_t'))) {
record.set('contract_number_t', value);
}
} else if (name == 'invoice_bp_code_f') {
if (Leaf.isEmpty(record.get('invoice_bp_code_t'))) {
record.set('invoice_bp_code_t', value);
}
} else if (name == 'total_amount_f') {
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
}
if (Ext.isEmpty(record.get('project_number_f')) && Ext.isEmpty(record.get('project_number_t'))) {
record.set('query_project_number', '');
} else {
record.set('query_project_number', 'Y');
}
if (Ext.isEmpty(record.get('contract_number_f')) && Ext.isEmpty(record.get('contract_number_t'))) {
record.set('query_contract_number', '');
} else {
record.set('query_contract_number', 'Y');
function acr610_invoice_cancel() {
var records = $('acr610_invoice_result_ds').getSelected();
if (records.length == 0) {
$L.showInfoMessage('提示', '请至少选择一条数据!');
return;
}
}
function acr512_invoice_delete() {
$('acr512_invoice_update_grid_ds').remove();
}
//发票提交
function acr512_invoice_submit() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
var record = records[0];
if(record.get('wfl_apply_status') != 'NEW'){
$L.showInfoMessage('提示', '仅新建状态的申请单据可以取消!');
return;
}
var datas = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('status') == 'APPROVED' || records[i].get('statsu') == 'APPROVING') {
Leaf.showMessage('${l:HLS.PROMPT}', '该发票正在审批中或已审批通过,不可重复提交');
return;
}
if (i == 0) { //modify by wuts for hl 2018-12-23
var invoice_hd_ids = records[0].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
}
Leaf.showConfirm('提示', '您确认提交吗', function () {
Leaf.showConfirm('提示', "确认执行该操作?", function () {
lock_current_window();
Leaf.request({
url: $('acr512_submit_id').getUrl(),
para: {
invoice_hd_ids: invoice_hd_ids
},
url: $('acr610_invoice_apply_status_change').getUrl(),
para: record.data,
success: function () {
unlock_current_window();
Leaf.SideBar.show({
msg: '提交成功',
duration: 3000
msg: '操作成功',
duration: 2000
});
unlock_current_window();
$('acr512_invoice_result_ds').query();
},
failure: function () {
unlock_current_window();
$('acr610_invoice_result_ds').query();
},
error: function () {
unlock_current_window();
},
scope: this
});
}, function () {
unlock_current_window();
});
}
function acr512_invoice_insert() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
function acr610_invoice_result_select(ds, record, bp_seq) {
if(record.get('wfl_apply_status') != 'NEW'){
document.getElementById("acr610_invoice_cancel_id").style.display = "none";
}else{
document.getElementById("acr610_invoice_cancel_id").style.display = "";
}
var datas = {};
var saveData = [];
var invoice_hd_ids = '';
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
$L.showErrorMessage("提示", '发票状态有误!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
records[i].set('_status', 'update');
saveData.push(records[i].data);
if(record.get('wfl_apply_status') == 'CANCEL'){
document.getElementById("acr610_invoice_print_id").style.display = "none";
}else{
document.getElementById("acr610_invoice_print_id").style.display = "";
}
datas['invoice_hd_ids'] = invoice_hd_ids;
datas['details'] = saveData;
Leaf.showConfirm('提示', '您确认新建申请吗', function () {
lock_current_window();
Leaf.request({
url: $('acr512_update_for_submit_id').getUrl(),
para: datas,
success: function () {
Leaf.SideBar.show({
msg: '提交成功',
duration: 3000
});
unlock_current_window();
$('acr512_invoice_result_ds').query();
},
failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
});
}
function acr610_invoice_print(){
var record = $('acr610_invoice_result_ds').getSelected()[0];
var document_id = record.get('invoice_apply_id');
var url_l = $('acr_invoice_finish_print_link_id').getUrl() + '?document_id=' + document_id + '&document_table=ACR_INVOICE_APPLY&batch_flag=Y&source_type=COMMON';
var OpenWindow = window.open(href = url_l, target = "_blank");
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acr512_currency_ds">
<a:datas dataSource="/model/acr512_currency_list"/>
</a:dataSet>
<a:dataSet id="acr512_business_type_ds">
<a:datas dataSource="/model/acr512_business_type_list"/>
</a:dataSet>
<a:dataSet id="acr512_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>
<a:dataSet id="acr512_invoice_status_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="hls_lease_channel_ds" loadData="true" model="basic.hls_lease_channel_for_lov"/>
<a:dataSet id="acr512_invoice_query_ds">
<a:fields>
<a:field name="currency_name" displayField="currency_name" options="acr512_currency_ds"
returnField="currency" valueField="currency_code"/>
<a:field name="invoice_status_n" displayField="code_value_name" options="acr512_invoice_status_ds"
returnField="invoice_status" valueField="code_value"/>
<a:field name="invoice_kind"/>
<a:field name="contract_name"/>
<a:field name="invoice_bp_name"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr512_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>
<a:field name="business_type_desc" displayField="business_type_desc"
options="acr512_business_type_ds" returnField="business_type" valueField="business_type"/>
<a:field name="created_by_name" lovGridHeight="320" lovHeight="500"
<a:dataSet id="acr610_invoice_apply_status_ds" lookupCode="WFL_STATUS"/>
<a:dataSet id="acr610_invoice_apply_query_ds">
<a:fields>
<a:field name="invoice_apply_num"/>
<a:field name="invoice_apply_date"/>
<a:field name="invoice_apply_user_n" lovGridHeight="320" lovHeight="500"
lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
<a:mapping>
<a:map from="user_id" to="created_by"/>
<a:map from="description" to="created_by_name"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_f"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_t"/>
</a:mapping>
</a:field>
<a:field name="project_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_f"/>
</a:mapping>
</a:field>
<a:field name="project_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_t"/>
</a:mapping>
</a:field>
<a:field name="contract_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_f"/>
</a:mapping>
</a:field>
<a:field name="contract_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_t"/>
<a:map from="user_id" to="invoice_apply_user"/>
<a:map from="description" to="invoice_apply_user_n"/>
</a:mapping>
</a:field>
<a:field name="lease_channel"/>
<a:field name="lease_channel_desc" displayField="description" options="hls_lease_channel_ds"
returnField="lease_channel" valueField="lease_channel"/>
<a:field name="invoice_apply_user"/>
<a:field name="wfl_apply_status_n" displayField="code_value_name" options="acr610_invoice_apply_status_ds"
returnField="wfl_apply_status" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="acr610_invoice_result_ds" autoPageSize="true" autoQuery="true"
model="acr.ACR610.acr_invoice_apply_query" queryDataSet="acr610_invoice_apply_query_ds"
selectable="true" selectionModel="single">
<a:events>
<a:event name="update" handler="acr512_invoice_query_Onupdate"/>
<a:event name="select" handler="acr610_invoice_result_select"/>
</a:events>
</a:dataSet>
<a:dataSet id="acr512_invoice_result_ds" autoPageSize="true" autoQuery="true"
model="acr.ACR512.acr_invoice_update_query" queryDataSet="acr512_invoice_query_ds"
selectable="true"/>
<!-- <a:fields>-->
<!-- <a:field name="compare_date_flag"/>-->
<!-- </a:fields>-->
<!-- <a:events>-->
<!-- <a:event name="load" handler="load_do_info"/>-->
<!-- </a:events>-->
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr512_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>
<!--<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>-->
<a:toolbarButton click="acr512_invoice_insert" text="新建申请"/>
<!--
<a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/>
-->
<a:toolbarButton click="acr610_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr610_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton id="acr610_invoice_print_id" click="acr610_invoice_print" text="HLS.PRINT"/>
<a:toolbarButton id="acr610_invoice_cancel_id" click="acr610_invoice_cancel" text="取消申请"/>
</a:screenTopToolbar>
<a:form marginWidth="200" padding="0" title="应收发票维护">
<a:hBox labelSeparator=" ">
<a:textField name="document_number_f" bindTarget="acr512_invoice_query_ds"
prompt="HLS.DOCUMENT_NUMBER_FROM" width="135"/>
<!--
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
-->
<a:textField name="document_number_t" bindTarget="acr512_invoice_query_ds" prompt="单据编号到"
width="135"/>
<a:textField name="contract_name" bindTarget="acr512_invoice_query_ds" prompt="合同名称" width="353"/>
<!-- <a:lov name="contract_number_f" bindTarget="acr512_invoice_query_ds" prompt="合同编号从" width="135"/>-->
<!--
<div><![CDATA[${l:HLS.CONTRACT_NUMBER_TO}]]></div>
-->
<!-- <a:lov name="contract_number_t" bindTarget="acr512_invoice_query_ds" prompt="合同编号到" width="135"/>-->
<!-- <a:lov name="project_number_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.PROJECT_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
<a:lov name="project_number_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>-->
<!--
<a:comboBox name="business_type_desc" bindTarget="acr512_invoice_query_ds" prompt="HLS.BUSINESS_TYPE_DESC" width="135"/>
-->
<!--
<a:comboBox name="lease_channel_desc" bindTarget="acr512_invoice_query_ds" prompt="商业模式" width="135"/>
-->
<!-- <a:comboBox name="currency_name" bindTarget="acr512_invoice_query_ds" prompt="HLS.CURRENCY" width="135"/> -->
</a:hBox>
<a:hBox labelSeparator=" ">
<a:datePicker name="accounting_date_f" bindTarget="acr512_invoice_query_ds" prompt="记账日期从"
width="135"/>
<!--
<div><![CDATA[${l:HLS.ACCOUNT_DATE_TO}]]></div>
-->
<a:datePicker name="accounting_date_t" bindTarget="acr512_invoice_query_ds" prompt="记账日期到"
width="135"/>
<a:lov name="created_by_name" bindTarget="acr512_invoice_query_ds" prompt="创建人" width="135"/>
<a:textField name="invoice_title" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_TITLE"
width="135"/>
</a:hBox>
<a:form marginWidth="200" padding="0" title="销项发票申请">
<a:hBox labelSeparator=" ">
<a:datePicker name="invoice_date_f" bindTarget="acr512_invoice_query_ds" prompt="发票日期从"
width="135"/>
<!--
<div><![CDATA[${l:ACR.INVOICE_DATE_TO}]]></div>
-->
<a:datePicker name="invoice_date_t" bindTarget="acr512_invoice_query_ds" prompt="发票日期到"
width="135"/>
<!-- <a:lov name="invoice_bp_code_f" bindTarget="acr512_invoice_query_ds" prompt="客户编号从" width="135"/>-->
<!--
<div><![CDATA[${l:HLS.CUSTOMER_NUMBER_TO}]]></div>
-->
<!-- <a:lov name="invoice_bp_code_t" bindTarget="acr512_invoice_query_ds" prompt="客户编号到" width="135"/>-->
<a:textField name="invoice_bp_name" bindTarget="acr512_invoice_query_ds" prompt="客户名称" width="135"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_KIND"
width="135"/>
<a:comboBox name="invoice_status_n" bindTarget="acr512_invoice_query_ds" prompt="发票状态" width="135"/>
<a:textField name="invoice_apply_num" bindTarget="acr610_invoice_apply_query_ds" prompt="申请编号" width="135"/>
<a:datePicker name="invoice_apply_date" bindTarget="acr610_invoice_apply_query_ds" prompt="申请时间" width="135"/>
<a:lov name="invoice_apply_user_n" bindTarget="acr610_invoice_apply_query_ds" prompt="申请人" width="135"/>
<a:comboBox name="wfl_apply_status_n" bindTarget="acr610_invoice_apply_query_ds" prompt="申请状态" width="135"/>
</a:hBox>
</a:form>
<a:grid id="acr512_invoice_update_grid_ds" bindTarget="acr512_invoice_result_ds" marginHeight="250"
marginWidth="30" navBar="true">
<a:grid id="acr610_invoice_update_grid_ds" bindTarget="acr610_invoice_result_ds" marginHeight="250" marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER"
renderer="acr512_document_number_render" width="120"/>
<a:column name="invoice_bp_name" autoAdjust="false" prompt="HLS.CUSTOMER_NAME" showTitle="true"
width="100"/>
<a:column name="contract_name" autoAdjust="false" prompt="HLS.CONTRACT_NAME" showTitle="true"
width="150"/>
<!--
<a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>
-->
<a:column name="invoice_kind_desc" prompt="ACR.INVOICE_KIND" width="100"/>
<!-- <a:column name="invoice_number" prompt="ACR.INVOICE_NUMBER" width="120"/> -->
<a:column name="invoice_date" prompt="ACR.INVOICE_DATE" width="100"/>
<!-- <a:column name="project_name" autoAdjust="false" prompt="HLS.PROJECT_NAME" showTitle="true" width="150"/> -->
<!-- <a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/> -->
<!-- <a:column name="bp_code" prompt="HLS.CUSTOMER_NUMBER" width="100"/> -->
<a:column name="invoice_title" autoAdjust="false" prompt="ACR.INVOICE_TITLE" showTitle="true"
width="150"/>
<!-- <a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Aurora.formatMoney" width="100"/> -->
<!-- <a:column name="currency" prompt="HLS.CURRENCY" width="80"/> -->
<a:column name="created_by_name" autoAdjust="false" prompt="创建人" showTitle="true" width="150"/>
<a:column name="invoice_status_desc" prompt="ACR.INVOICE_STATUS" width="100"/>
<a:column name="accounting_date" prompt="HLS.ACCOUNT_DATE" width="100"/>
<!-- <a:column name="compare_date_flag" prompt="比较日期" width="100"/> -->
<!-- <a:column name="project_number" prompt="HLS.PROJECT_NUMBER" width="120"/> -->
<a:column name="invoice_apply_num" lock="true" prompt="申请编号" renderer="acr610_apply_num_render" align="center" width="150"/>
<a:column name="invoice_apply_date" prompt="申请日期" align="center" width="100"/>
<a:column name="invoice_apply_user_n" prompt="申请人" align="center" width="100"/>
<a:column name="total_amount" prompt="开票总金额" align="right" renderer="acr610_formatMoney" width="100"/>
<a:column name="net_amount" prompt="不含税总金额" align="right" renderer="acr610_formatMoney" width="100"/>
<a:column name="tax_amount" prompt="税额总金额" align="right" renderer="acr610_formatMoney" width="150"/>
<a:column name="wfl_apply_status_n" prompt="申请状态" align="center" width="150"/>
</a:columns>
</a:grid>
</a:screenBody>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:view>
<a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.screen"/>
<a:link id="acr512_invoice_ln_update_1_link" model="acr.ACR512.acr_invoice_update_query" modelaction="update"/>
<!-- <a:link id="acr512_invoice_status_change" model="acr.ACR512.alter_acr_invoice_status" modelaction="update"/>-->
<script><![CDATA[
// var dynamic_document_id = '$c{/parameter/@document_id}';
// if ('$c{/parameter/@document_id}') {
// var detail_mask;
// if ('${/parameter/@winid}') {
// if (parent.$A.CmpManager.get('${/parameter/@winid}')) {
// detail_mask = parent.$('${/parameter/@winid}').wrap;
// parent.Aurora.Masker.mask(detail_mask, '${l:HLS.LOADING}');
// } else {
// detail_mask = $('${/parameter/@winid}').wrap;
// Aurora.Masker.mask(detail_mask, '${l:HLS.LOADING}');
// }
// } else {
// detail_mask = Ext.getBody();
// Aurora.Masker.mask(detail_mask, '${l:HLS.LOADING}');
// }
// }
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record, bp_seq) {
var link_function = '';
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) {
link_function = '${/parameter/@layout_code}_open_bp_detail_window';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'car_detail' && record.get('contract_lease_item_id')) {
link_function = '${/parameter/@layout_code}_open_lease_item_detail_window';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'contract_number' && record.get('contract_id')) {
link_function = '${/parameter/@layout_code}_open_contract_detail_window';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + value + '</a>';
}
};
//发票确认
// window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
// var detail_mask = Ext.getBody();
//
// var record_hd="${/parameter/@invoice_hd_id}";
// //确认发票状态
// var invoice_status='${/parameter/@invoice_status}';
// if(invoice_status!='NEW' &&invoice_status!='REJECT'){
// $L.showErrorMessage("提示",'发票状态有误!');
// return;
// }
// Leaf.showConfirm('提示', "确认执行该操作?", function() {
// Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
// Leaf.request({
// url: $('acr512_invoice_status_change').getUrl(),
// para: {
// invoice_hd_id: record_hd,
// want_status: 'CONFIRMING'
// },
// success: function () {
//
// Leaf.SideBar.show({
// msg: '操作成功',
// duration: 2000
// });
//
// Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
// $('${/parameter/@winid}').close();
//
// //$('${/parameter/@winid}').close();
// },
// error: function () {
// Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
// },
// scope: this
// });
// },function(){
// Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
//
// })
//
//
//
// }
window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function(id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = record.data;
var contract_lease_item_id = record.get('contract_lease_item_id');
new Leaf.Window({
id: 'contract_lease_item_maintain_window',
url: $('contract_lease_item_maintain_link').getUrl(),
params: {
contract_lease_item_id: contract_lease_item_id,
winid: 'contract_lease_item_maintain_window'
},
draggable: true,
fullScreen: true
});
};
window['${/parameter/@layout_code}_open_contract_detail_window'] = function(id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = record.data;
param['function_code'] = 'ACR_CON301'; /* param['function_usage'] = 'QUERY'; */
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', record.ds.id, '${/parameter/@layout_code}');
};
//加载事件
window['${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var acr_invoice_hd_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_hd');
var ds_batch_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_batch_ln');
if(!$(acr_invoice_hd_ds_id).getAt(0).get('merge_flag')){
var acr_invoice_rec = $(acr_invoice_hd_ds_id).getAt(0);
var invoice_hd_id = $(acr_invoice_hd_ds_id).getCurrentRecord().get('invoice_hd_id');
$(acr_invoice_hd_ds_id).getAt(0).set('merge_flag', 'N');
$(acr_invoice_hd_ds_id).getAt(0).set('merge_flag_n', '不合并');
// if (acr_invoice_rec.get('merge_flag') == 'Y') {
Leaf.request({
url: $('acr512_invoice_ln_update_1_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id,
merge_flag: $(acr_invoice_hd_ds_id).getCurrentRecord().get('merge_flag')
},
success: function() {
$(ds_batch_id).query();
//$('${/parameter/@winid}').close();
},
scope: this
});
}
};
window['${/parameter/@layout_code}_open_bp_detail_window'] = function(id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = record.data;
param['function_code'] = 'CON501H';
param['function_usage'] = 'MODIFY';
param['url_title'] = '${l:HLS212.BP_MASTER_MAINTAIN}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con713_hls_bp_master_modify_link', record.ds.id, '${/parameter/@layout_code}');
};
function con500_contract_save(nextStep) {
var root_ds = $('${/model/base_table_path/record/@tab_code}_${/model/base_table_path/record/@base_table}_ds');
if (root_ds.validate()) {
var winid = '${/parameter/@winid}';
if (winid) {
Leaf.Masker.mask($(winid).wrap, '${l:HLS.EXECUTING}');
} else {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
lock_current_window();
var root_record = root_ds.getAt(0);
root_ds.setSubmitParameter('layout_code', '${/parameter/@layout_code}');
on_con_save_dynamic(root_ds, root_record, nextStep, winid);
}
con500_contract_merge();
}
function con500_contract_submit() {
Leaf.SideBar.enable = false;
con500_contract_save(con500_contract_submit_final);
}
function con500_contract_exit() {
if ('${/parameter/@winid}') {
$('${/parameter/@winid}').close();
} else {
window.location.go(-1);
}
}
function con500_contract_save_exit() {
con500_contract_save(con500_contract_exit);
}
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_hd');
var ds_batch_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_batch_ln');
var invoice_hd_id = $(ds_id).getCurrentRecord().get('invoice_hd_id');
var message = '您确认吗';
// if ($(ds_id).getCurrentRecord().get('merge_flag') == 'Y') {
// message = '您确认行合并吗';
// } else {
// message = '您确认行不合并吗';
// }
<script><![CDATA[
// Leaf.showConfirm('提示', message, function() {
Leaf.request({
url: $('acr512_invoice_ln_update_1_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id,
merge_flag: $(ds_id).getCurrentRecord().get('merge_flag')
},
success: function() {
// Leaf.SideBar.show({
// msg: '操作成功',
// duration: 2000
// });
$(ds_batch_id).query();
// $('${/parameter/@winid}').close();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
/* new Aurora.Window({
id: 'contract_invoice_merge_window',
url: $('contract_invoice_merge_link').getUrl(),
params: {
invoice_hd_id: invoice_hd_id,
winid: 'contract_invoice_merge_window'
},
// draggable: true,
fullScreen: true
}); */
},
scope: this
});
// },function(){
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
//
// });
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
......
......@@ -113,7 +113,7 @@
} catch (e) {
raise_app_error(e);
}
if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_A4'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK'||record_data.templet_code == 'REPURCHASE_DEBT_OFFSET'||record_data.templet_code == 'CON_CONTRACT_LEASE_BACK'||record_data.templet_code == 'CON_CONTRACT_MORTGAGE') {
if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_A4'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK'||record_data.templet_code == 'REPURCHASE_DEBT_OFFSET'||record_data.templet_code == 'CON_CONTRACT_LEASE_BACK'||record_data.templet_code == 'CON_CONTRACT_MORTGAGE'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_FIN'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_FIN_A4') {
// word转pdf
var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment