Commit 0645d5d3 authored by 王炜's avatar 王炜

增值税台账-永久保留历史数据

(cherry picked from commit 81ec953d)
parent 58c539c6
......@@ -57,7 +57,8 @@ SELECT h.period_year,
(select round(ccc.vat_due_amount/ccc.net_due_amount,2) from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) vat_rate,
h.je_transaction_code,
l.cashflow_id
l.cashflow_id,
'N' fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
......@@ -262,7 +263,8 @@ SELECT h.period_year,
con_contract cc,con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id
and cc.contract_id=ccc.contract_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
l.cashflow_id,
'N' fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
......@@ -362,7 +364,8 @@ SELECT h.period_year,
WHERE cc.contract_number = l.reference3
and cc.data_class = 'NORMAL') vat_rate,
h.je_transaction_code,
l.cashflow_id
l.cashflow_id,
'N' fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l, gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
......@@ -464,7 +467,8 @@ SELECT h.period_year,
round(ccc.vat_due_amount/ccc.net_due_amount,2)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
l.cashflow_id,
'N' fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
......@@ -542,7 +546,8 @@ SELECT h.period_year,
round(ccc.vat_due_amount/ccc.net_due_amount,2))
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
l.cashflow_id,
'N' fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
......@@ -636,7 +641,8 @@ SELECT h.period_year,
and rownum=1
) vat_rate,
h.je_transaction_code,
l.cashflow_id
l.cashflow_id,
'N' fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
......@@ -691,7 +697,8 @@ SELECT h.period_year,
l.amount_cr vat_due_amount,
round( l.amount_cr/(l.reference7-l.amount_cr),2) vat_rate,
h.je_transaction_code,
l.cashflow_id
l.cashflow_id,
'N' fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
......@@ -717,14 +724,37 @@ SELECT h.period_year,
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL' )
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.journal_num,
h.contract_number,
h.bp_code,
(select bp.bp_name from hls_bp_master bp where bp.bp_code=h.bp_code) bp_name,
null journal_header_id,
h.invoice_date,
h.amount_tax,
h.times,
h.due_date,
h.due_amount,
h.principal,
h.interest,
h.vat_due_amount,
h.vat_rate,
null je_transaction_code,
null cashflow_id,
'Y' fixed_data_flag
from hl_cm_rpt555_fixed_data h
) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.amount_tax > 0"/>
<bm:data-filter enforceOperations="query" expression="exists(select 1 from con_contract cc where cc.contract_number=t1.contract_number and cc.data_class='NORMAL')"/>
<bm:data-filter enforceOperations="query" expression="(t1.amount_tax > 0 or t1.fixed_data_flag='Y')"/>
<bm:data-filter enforceOperations="query" expression="(exists(select 1 from con_contract cc where cc.contract_number=t1.contract_number and cc.data_class='NORMAL') or t1.fixed_data_flag='Y')"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
......
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