Commit d68aaa1b authored by 王炜's avatar 王炜

回租销项科目调整

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