Commit 245182d8 authored by chenzhuo's avatar chenzhuo

发票创建对象修改

parent e3f0ee18
......@@ -4,7 +4,7 @@
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
SELECT *
FROM (select t2.journal_line_id,
t2.journal_header_id,
cc.company_id,
......@@ -97,7 +97,8 @@
(select t.description
FROM hls_document_type t
where t.document_type = t2.ccr_document_type) ccr_document_type_desc,
--add by lihh 20210409
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,
hbm.invoice_method,
......@@ -112,22 +113,26 @@
WHERE v.code = 'DIVISION'
AND v.code_value = cc.division
AND v.code_enabled_flag = 'Y') division_n
from con_contract cc, hls_bp_master hbm, CUS_ACR_INVOICE_V t2
from con_contract cc, hls_bp_master hbm, CUS_ACR_INVOICE_V t2
where cc.contract_id = t2.contract_id
and hbm.bp_wfl_status = 'APPROVED'
and hbm.invoice_wfl_status = 'APPROVED'
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