Commit 245182d8 authored by chenzhuo's avatar chenzhuo

发票创建对象修改

parent e3f0ee18
......@@ -97,6 +97,7 @@
(select t.description
FROM hls_document_type t
where t.document_type = t2.ccr_document_type) ccr_document_type_desc,
t2.je_transaction_code,
--add by lihh 20210409
hbm.invoice_type,
(select v.code_value_name value_name from sys_code_values_v v where v.code_value = hbm.invoice_type) invoice_type_n,
......@@ -119,15 +120,19 @@
and hbm.bp_id = t2.bill_object_bp_id
and nvl(t2.billing_status, 'NOT') != 'FULL'
--合同状态为结束中(不论是否做过提前结清或解约回购)、提前结清中、提前结清完成、正常结清的合同
and (cc.contract_status in
and ((t2.cf_item = 2 and cc.payment_deduction in ('TRI_AGREEMENT','TRADE_IN')
and ((cc.contract_status in ('TERMINATING', 'ETING','ET','INCEPT', 'TERMINATE','REPURING','REPUR') and hbm.invoice_method = 'BILLING')
or (cc.contract_status in ('TERMINATING', 'ETING', 'ETING', 'TERMINATE') and hbm.invoice_method = 'NO_BILLING'))
)
or (cc.contract_status in
('TERMINATING', 'ETING', 'ETING', 'TERMINATE')
--合同状态为起租做过承租人变更的合同
or
(cc.contract_status = 'INCEPT' and t2.document_type = 'LEASE_CHAG' and
trunc(t2.due_date) < trunc(cc.CCR_LEASE_DATE))
--合同状态为解约回购中、解约回购完成的合同
or (cc.contract_status in ('REPUR', 'REPURING') and
trunc(t2.due_date) < trunc(cc.REPURCHASE_DATE))
or (cc.contract_status in ('REPUR', 'REPURING') and(
trunc(t2.due_date) < trunc(cc.REPURCHASE_DATE) or t2.je_transaction_code='CON_REPURCHASE' ) )
--合同状态为起租→开票对象:非深圳美鹏HCS小规模纳税人(自然人)→暂不开票→按季度展示未开票现金流
or
(cc.contract_status = 'INCEPT' and
......@@ -171,7 +176,7 @@
trunc(t2.due_date) >= trunc(nvl(cc.CCR_LEASE_DATE, t2.due_date)) and
hbm.taxpayer_type = 'SMALL_SCALE_TAXPAYER' and
hbm.invoice_method = 'BILLING' and
trunc(t2.due_date) <= trunc(sysdate)))
trunc(t2.due_date) <= trunc(sysdate))))
--合同状态为起租→开票对象:一般纳税人(法人),小规模纳税人(法人)和深圳美鹏HCS小规模纳税人(自然人)→暂不开票→暂不展示
and not exists
(select 1
......@@ -183,6 +188,10 @@
hbm.bp_class = 'NP' and
t2.inv_billing_object_code = 'D00010001')))
ORDER BY cc.contract_id, t2.due_date
) vv
#WHERE_CLAUSE#
......
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