Commit d68aaa1b authored by 王炜's avatar 王炜

回租销项科目调整

parent 50b17b51
......@@ -69,7 +69,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
AND (h.je_transaction_code= 'LEASE_INCEPT')
......@@ -270,7 +270,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
And (h.je_transaction_code ='HL_SALES_TAX_ACT_NEW' )
......@@ -313,6 +313,7 @@ SELECT h.period_year,
(select d.amount_cr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -320,9 +321,10 @@ SELECT h.period_year,
and g.account_code in ('6041001000'))
and rownum = 1)
else
(select d.amount_dr
(select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -335,6 +337,7 @@ SELECT h.period_year,
(select d.amount_cr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -342,9 +345,10 @@ SELECT h.period_year,
and g.account_code in ('6041001000'))
and rownum = 1)
else
(select d.amount_dr
(select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -376,7 +380,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr != 0
and ga.account_id = l.account_id
and ga.account_code in ('2221001020', '2221001023')
and ga.account_code in ('2221001020', '2221001023','2221001024')
and h.reversed_flag = 'N'
and h.internal_period_num = to_number(${@base_period})
And (h.je_transaction_code =
......@@ -472,7 +476,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
And exists (selEct 1
......@@ -537,7 +541,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
AND not EXISTS (SELECT 1
......@@ -640,7 +644,7 @@ SELECT h.period_year,
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and l.line_description like '%留购金%'
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
And exists (selEct 1
......@@ -740,7 +744,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num = to_number(${@base_period})
and exists(select 1 from gld_je_template_hds hd
......
......@@ -70,7 +70,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
AND (h.je_transaction_code= 'LEASE_INCEPT')
......@@ -279,7 +279,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
AND (h.je_transaction_code= 'HL_SALES_TAX_ACT_NEW')
......@@ -341,6 +341,7 @@ SELECT h.period_year,
(select d.amount_cr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -348,9 +349,10 @@ SELECT h.period_year,
and g.account_code in ('6041001000'))
and rownum = 1)
else
(select d.amount_dr
(select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -363,6 +365,7 @@ SELECT h.period_year,
(select d.amount_cr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -370,9 +373,10 @@ SELECT h.period_year,
and g.account_code in ('6041001000'))
and rownum = 1)
else
(select d.amount_dr
(select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and d.reference3=l.reference3
and exists
(select 1
from gld_accounts g
......@@ -405,7 +409,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr != 0
and ga.account_id = l.account_id
and ga.account_code in ('2221001020', '2221001023')
and ga.account_code in ('2221001020', '2221001023','2221001024')
and h.reversed_flag = 'N'
and h.internal_period_num < to_number(${@base_period})
And (h.je_transaction_code =
......@@ -507,7 +511,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
And exists (selEct 1
......@@ -591,7 +595,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
And exists (selEct 1
......@@ -696,7 +700,7 @@ SELECT h.period_year,
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and l.line_description like '%留购金%'
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
And exists (selEct 1
......@@ -819,7 +823,7 @@ SELECT h.period_year,
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and ga.account_code in('2221001020','2221001023','2221001024')
and h.reversed_flag='N'
and h.internal_period_num <to_number(${@base_period})
and exists(select 1 from gld_je_template_hds hd
......
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