Commit 3889d68e authored by lizhe's avatar lizhe

database中回租本金都改成0

parent bd5ba7e9
......@@ -897,16 +897,70 @@ select '合计' tax_month,
sum(amount_tax) amount_tax,
null times,
null due_date,
sum(due_amount) due_amount,
sum(principal) principal,
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',
due_amount -nvl(t.principal,0),
t.due_amount)) due_amount,
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
null fixed_data_flag
from temp t
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:operation>
</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