Commit 270de4b9 authored by lizhe's avatar lizhe

database中回租本金都改成0

parent 3524fa8b
...@@ -878,35 +878,89 @@ SELECT h.period_year, ...@@ -878,35 +878,89 @@ SELECT h.period_year,
#WHERE_CLAUSE# #WHERE_CLAUSE#
) )
select * from ( select * from (
select '合计' tax_month, select '合计' tax_month,
sum(sale_amount) sale_amount, sum(sale_amount) sale_amount,
1 order_seq, 1 order_seq,
null period_year, null period_year,
null period_num, null period_num,
null internal_period_num, null internal_period_num,
null journal_date, null journal_date,
null journal_num, null journal_num,
null reference2, null reference2,
null line_description, null line_description,
null journal_number, null journal_number,
null contract_number, null contract_number,
null bp_code, null bp_code,
null bp_name, null bp_name,
null journal_header_id, null journal_header_id,
null invoice_date, null invoice_date,
sum(amount_tax) amount_tax, sum(amount_tax) amount_tax,
null times, null times,
null due_date, null due_date,
sum(due_amount) due_amount, sum(decode((select cc.business_type
sum(principal) principal, from con_contract_cashflow ca, con_contract cc
sum(interest) interest, where ca.cashflow_id = t.cashflow_id
sum(vat_due_amount) vat_due_amount, and ca.contract_id = cc.contract_id),
null vat_rate, 'LEASEBACK',
null je_transaction_code, due_amount -nvl(t.principal,0),
null cashflow_id, t.due_amount)) due_amount,
null fixed_data_flag from temp sum(decode((select cc.business_type
from con_contract_cashflow ca, con_contract cc
where ca.cashflow_id = t.cashflow_id
and ca.contract_id = cc.contract_id),
'LEASEBACK',
0,
t.principal)) principal,
sum(interest) interest,
sum(vat_due_amount) vat_due_amount,
null vat_rate,
null je_transaction_code,
null cashflow_id,
null fixed_data_flag
from temp t
union union
select * from temp) data order by data.order_seq select tax_month,
sale_amount,
order_seq,
period_year,
period_num,
internal_period_num,
journal_date,
journal_num,
reference2,
line_description,
journal_number,
contract_number,
bp_code,
bp_name,
journal_header_id,
invoice_date,
amount_tax,
times,
due_date,
decode((select cc.business_type
from con_contract_cashflow ca, con_contract cc
where ca.cashflow_id = t.cashflow_id
and ca.contract_id = cc.contract_id),
'LEASEBACK',
due_amount -nvl(t.principal,0),
t.due_amount) due_amount,
decode((select cc.business_type
from con_contract_cashflow ca, con_contract cc
where ca.cashflow_id = t.cashflow_id
and ca.contract_id = cc.contract_id),
'LEASEBACK',
0,
t.principal) principal,
interest,
vat_due_amount,
vat_rate,
je_transaction_code,
cashflow_id,
fixed_data_flag
from temp t
) data order by data.order_seq
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
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