Commit 223bb6e5 authored by stone's avatar stone

[fix] 修复收款功能

parent 44b8131c
......@@ -3,7 +3,8 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.COMPANY_ID,
select *
from (SELECT t1.COMPANY_ID,
t1.PROJECT_ID,
t1.PROJECT_NUMBER,
t1.PROJECT_NAME,
......@@ -36,7 +37,9 @@
decode(t2.cf_item,
301,
(select v.code_value_name
from hls_bp_master h, con_contract cc, sys_code_values_v v
from hls_bp_master h,
con_contract cc,
sys_code_values_v v
where v.code = 'HLS211_TAXPAYER_TYPE'
AND v.code_value = h.taxpayer_type
and cc.contract_id = t1.contract_id
......@@ -49,8 +52,9 @@
where cc.contract_id = t1.contract_id
and cc.bp_id_agent_level1 = h.bp_id),
t2.tax_registry_num) OBJECT_TAX_REGISTRY_NUM,
nvl(t2.bill_object_bp_class,t1.BILL_OBJECT_BP_CLASS) BILL_OBJECT_BP_CLASS,
nvl(t2.bill_object_bp_class_desc,t1.BILL_OBJECT_BP_CLASS_DESC) BILL_OBJECT_BP_CLASS_DESC,
nvl(t2.bill_object_bp_class, t1.BILL_OBJECT_BP_CLASS) BILL_OBJECT_BP_CLASS,
nvl(t2.bill_object_bp_class_desc,
t1.BILL_OBJECT_BP_CLASS_DESC) BILL_OBJECT_BP_CLASS_DESC,
t1.TAX_TYPE_VAT,
t1.DESCRIPTION,
--t1.INVOICE_TITLE,
......@@ -66,14 +70,16 @@
t2.invoice_title) invoice_title,
decode(t2.cf_item,
301,
(select (h.invoice_bp_address || '' || h.invoice_bp_phone_num)
(select (h.invoice_bp_address || '' ||
h.invoice_bp_phone_num)
from hls_bp_master h, con_contract cc
where cc.contract_id = t1.contract_id
and cc.bp_id_agent_level1 = h.bp_id),
t2.invoice_bp_address_phone_num) invoice_bp_address_phone_num,
decode(t2.cf_item,
301,
(select (h.invoice_bp_bank || '' || h.invoice_bp_bank_account_id)
(select (h.invoice_bp_bank || '' ||
h.invoice_bp_bank_account_id)
from hls_bp_master h, con_contract cc
where cc.contract_id = t1.contract_id
and cc.bp_id_agent_level1 = h.bp_id),
......@@ -137,12 +143,12 @@
t1.inv_billing_object_name,
t1.small_scale_taxpayer
FROM ACR_INVOICE_CONTRACT_V t1, ACR_INVOICE_CONTRACT_CF_V t2
WHERE t2.due_date<sysdate
ORDER BY
t1.contract_id,
t2.times,
t2.due_date,
t2.cf_item
WHERE t2.due_date < sysdate
and rownum <= 10000
ORDER BY t1.contract_id, t2.times, t2.due_date, t2.cf_item) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......@@ -286,92 +292,91 @@
<bm:field name="small_scale_taxpayer"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="inv_billing_object_name" queryExpression="t1.inv_billing_object_name like ${@inv_billing_object_name}"/>
<bm:query-field name="inv_billing_object_name" queryExpression="t.inv_billing_object_name like ${@inv_billing_object_name}"/>
<!-- <bm:query-field name="part_bill_flag"
queryExpression="((${@part_bill_flag} = &apos;N&apos;) or (${@part_bill_flag} = &apos;Y&apos; and (t2.billing_amount!=0 or t2.due_amount &lt; t2.received_amount)))"/>-->
<bm:query-field name="project_number_from" queryExpression="t1.project_number &gt;=${@project_number_from}"/>
<bm:query-field name="project_number_to" queryExpression="t1.project_number &lt;=${@project_number_to}"/>
<bm:query-field name="contract_number_from" queryExpression="t1.contract_number &gt;=${@contract_number_from}"/>
<bm:query-field name="contract_number_to" queryExpression="t1.contract_number &lt;=${@contract_number_to}"/>
<bm:query-field name="project_number_from" queryExpression="t.project_number &gt;=${@project_number_from}"/>
<bm:query-field name="project_number_to" queryExpression="t.project_number &lt;=${@project_number_to}"/>
<bm:query-field name="contract_number_from" queryExpression="t.contract_number &gt;=${@contract_number_from}"/>
<bm:query-field name="contract_number_to" queryExpression="t.contract_number &lt;=${@contract_number_to}"/>
<bm:query-field name="contract_number"
queryExpression="t1.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos; "/>
queryExpression="t.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos; "/>
<bm:query-field name="bp_code_tenant_from"
queryExpression="t1.billing_object_code &gt;=${@bp_code_tenant_from}"/>
<bm:query-field name="bp_code_tenant_to" queryExpression="t1.billing_object_code &lt;=${@bp_code_tenant_to}"/>
queryExpression="t.billing_object_code &gt;=${@bp_code_tenant_from}"/>
<bm:query-field name="bp_code_tenant_to" queryExpression="t.billing_object_code &lt;=${@bp_code_tenant_to}"/>
<bm:query-field name="lease_start_date_from"
queryExpression="t1.lease_start_date &gt;= to_date(${@lease_start_date_from},&apos;yyyy-mm-dd&apos;)"/>
queryExpression="t.lease_start_date &gt;= to_date(${@lease_start_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="lease_start_date_to"
queryExpression="t1.lease_start_date &lt;= to_date(${@lease_start_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="document_type" queryExpression="t1.document_type=${@document_type}"/>
<bm:query-field name="billing_method" queryExpression="t1.billing_method=${@billing_method}"/>
<bm:query-field name="billing_frequency" queryExpression="t1.billing_frequency=${@billing_frequency}"/>
<bm:query-field name="prj_search_term_1" queryExpression="t1.prj_search_term_1=${@prj_search_term_1}"/>
<bm:query-field name="prj_search_term_2" queryExpression="t1.prj_search_term_2=${@prj_search_term_2}"/>
<bm:query-field name="con_search_term_1" queryExpression="t1.con_search_term_1=${@con_search_term_1}"/>
<bm:query-field name="con_search_term_2" queryExpression="t1.con_search_term_2=${@con_search_term_2}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name like &apos;%&apos;||${@bp_name}||&apos;%&apos; "/>
queryExpression="t.lease_start_date &lt;= to_date(${@lease_start_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="document_type" queryExpression="t.document_type=${@document_type}"/>
<bm:query-field name="billing_method" queryExpression="t.billing_method=${@billing_method}"/>
<bm:query-field name="billing_frequency" queryExpression="t.billing_frequency=${@billing_frequency}"/>
<bm:query-field name="prj_search_term_1" queryExpression="t.prj_search_term_1=${@prj_search_term_1}"/>
<bm:query-field name="prj_search_term_2" queryExpression="t.prj_search_term_2=${@prj_search_term_2}"/>
<bm:query-field name="con_search_term_1" queryExpression="t.con_search_term_1=${@con_search_term_1}"/>
<bm:query-field name="con_search_term_2" queryExpression="t.con_search_term_2=${@con_search_term_2}"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like &apos;%&apos;||${@bp_name}||&apos;%&apos; "/>
<bm:query-field name="project_name"
queryExpression="t1.project_name like &apos;%&apos;||${@project_name}||&apos;%&apos; "/>
queryExpression="t.project_name like &apos;%&apos;||${@project_name}||&apos;%&apos; "/>
<bm:query-field name="contract_name"
queryExpression="t1.contract_name like &apos;%&apos;||${@contract_name}||&apos;%&apos; "/>
<bm:query-field name="document_type" queryExpression="t1.document_type=${@document_type}"/>
<bm:query-field name="cf_item" queryExpression="t2.cf_item = ${@cf_item}"/>
queryExpression="t.contract_name like &apos;%&apos;||${@contract_name}||&apos;%&apos; "/>
<bm:query-field name="document_type" queryExpression="t.document_type=${@document_type}"/>
<bm:query-field name="cf_item" queryExpression="t.cf_item = ${@cf_item}"/>
<bm:query-field name="last_received_date_from"
queryExpression="t2.last_received_date &gt;= to_date(${@last_received_date_from},&apos;yyyy-mm-dd&apos;)"/>
queryExpression="t.last_received_date &gt;= to_date(${@last_received_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="last_received_date_to"
queryExpression="t2.last_received_date &lt; to_date(${@last_received_date_to},&apos;yyyy-mm-dd&apos;)+1"/>
queryExpression="t.last_received_date &lt; to_date(${@last_received_date_to},&apos;yyyy-mm-dd&apos;)+1"/>
<!--
<bm:query-field name="final_bill_flag" queryExpression="((${@final_bill_flag}=&apos;N&apos; and (t1.billing_method != &apos;LB_EQUIP_INT&apos; or (t1.billing_method = &apos;LB_EQUIP_INT&apos; and (t2.cf_item=1 and t2.interest &gt;nvl(billing_interest,0)or (t2.cf_item!=1))))) or (${@final_bill_flag}=&apos;Y&apos; and t1.billing_method = &apos;LB_EQUIP_INT&apos; and t2.cf_item=1 and (not exists (select 1 from con_contract_cashflow b where t1.contract_id = b.contract_id and b.cf_item = 1 and b.cf_direction = &apos;INFLOW&apos; and b.write_off_flag in (&apos;NOT&apos;,&apos;PARTIAL&apos;)) or t1.legal_status=&apos;SELL&apos;)))"/>
<bm:query-field name="final_bill_flag" queryExpression="((${@final_bill_flag}=&apos;N&apos; and (t.billing_method != &apos;LB_EQUIP_INT&apos; or (t1.billing_method = &apos;LB_EQUIP_INT&apos; and (t2.cf_item=1 and t2.interest &gt;nvl(billing_interest,0)or (t2.cf_item!=1))))) or (${@final_bill_flag}=&apos;Y&apos; and t1.billing_method = &apos;LB_EQUIP_INT&apos; and t2.cf_item=1 and (not exists (select 1 from con_contract_cashflow b where t1.contract_id = b.contract_id and b.cf_item = 1 and b.cf_direction = &apos;INFLOW&apos; and b.write_off_flag in (&apos;NOT&apos;,&apos;PARTIAL&apos;)) or t1.legal_status=&apos;SELL&apos;)))"/>
-->
<!-- <bm:query-field name="residue_flag"
queryExpression="((${@residue_flag}=&apos;N&apos; and t2.cf_item != 8) or (${@residue_flag}=&apos;Y&apos; and t2.cf_item = 8 and not exists (select 1 from con_contract_cashflow ca where ca.cf_item in (&apos;1&apos;,&apos;9&apos;) and (ca.due_amount -nvl(ca.received_amount,0)) &gt;50 and ca.contract_id=t1.contract_id and ca.write_off_flag!=&apos;FULL&apos;)))"/>-->
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel=${@lease_channel}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type=${@business_type}"/>
<bm:query-field name="division" queryExpression="t1.division=${@division}"/>
<!-- <bm:query-field name="serial_number" queryExpression="t1.serial_number=${@serial_number}"/>-->
<bm:query-field name="lease_channel" queryExpression="t.lease_channel=${@lease_channel}"/>
<bm:query-field name="business_type" queryExpression="t.business_type=${@business_type}"/>
<bm:query-field name="division" queryExpression="t.division=${@division}"/>
<!-- <bm:query-field name="serial_number" queryExpression="t.serial_number=${@serial_number}"/>-->
<bm:query-field name="termination_date_from"
queryExpression="t1.termination_date &gt;= to_date(${@termination_date_from},&apos;yyyy-mm-dd&apos;)"/>
queryExpression="t.termination_date &gt;= to_date(${@termination_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="termination_date_to"
queryExpression="t1.termination_date &lt;= to_date(${@termination_date_to},&apos;yyyy-mm-dd&apos;)"/>
queryExpression="t.termination_date &lt;= to_date(${@termination_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="due_date_from"
queryExpression="t2.due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
queryExpression="t.due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="due_date_to"
queryExpression="t2.due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
queryExpression="t.due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="bill_flag"
queryExpression="(${@bill_flag} = 'Y' and t1.billing_frequency in (${@times_bill_flag},${@mid_bill_flag},${@final_bill_flag},${@et_bill_flag}) )"/>
queryExpression="(${@bill_flag} = 'Y' and t.billing_frequency in (${@times_bill_flag},${@mid_bill_flag},${@final_bill_flag},${@et_bill_flag}) )"/>
<bm:query-field name="all_contract_number"
queryExpression="(t1.contract_number in (Select regexp_substr( replace(replace(replace(${@all_contract_number},chr(32)),chr(10)),chr(13)), '[^,]+', 1, Level) From dual Connect By regexp_substr(replace(replace(replace(${@all_contract_number},chr(32)),chr(10)),chr(13)), '[^,]+', 1, Level) Is Not Null) )"/>
queryExpression="(t.contract_number in (Select regexp_substr( replace(replace(replace(${@all_contract_number},chr(32)),chr(10)),chr(13)), '[^,]+', 1, Level) From dual Connect By regexp_substr(replace(replace(replace(${@all_contract_number},chr(32)),chr(10)),chr(13)), '[^,]+', 1, Level) Is Not Null) )"/>
<bm:query-field name="notreceived_amount_from"
queryExpression="t2.notreceived_amount &gt;=${@notreceived_amount_from}"/>
queryExpression="t.notreceived_amount &gt;=${@notreceived_amount_from}"/>
<bm:query-field name="notreceived_amount_to"
queryExpression="t2.notreceived_amount &lt;=${@notreceived_amount_to}"/>
queryExpression="t.notreceived_amount &lt;=${@notreceived_amount_to}"/>
<bm:query-field name="notbilling_amount_from"
queryExpression="t2.notbilling_amount &gt;=${@notbilling_amount_from}"/>
queryExpression="t.notbilling_amount &gt;=${@notbilling_amount_from}"/>
<bm:query-field name="notbilling_amount_to"
queryExpression="t2.notbilling_amount &lt;=${@notbilling_amount_to}"/>
queryExpression="t.notbilling_amount &lt;=${@notbilling_amount_to}"/>
<bm:query-field name="billing_way"
queryExpression="t1.billing_way = ${@billing_way}"/>
queryExpression="t.billing_way = ${@billing_way}"/>
<bm:query-field name="bill_object_bp_class"
queryExpression="t1.bill_object_bp_class = ${@bill_object_bp_class}"/>
queryExpression="t.bill_object_bp_class = ${@bill_object_bp_class}"/>
<bm:query-field name="contract_status"
queryExpression="t1.contract_status = ${@contract_status}"/>
<!-- <bm:query-field name="" queryExpression="t2.due_date &lt;= sysdate"/>-->
queryExpression="t.contract_status = ${@contract_status}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query"
expression="t2.contract_id = t1.contract_id AND t1.billing_status IN (&apos;NOT&apos;, &apos;PARTIAL&apos;) AND t1.contract_status not in (&apos;CLOSED&apos;,&apos;CANCEL&apos;) AND t2.cf_status = &apos;RELEASE&apos; "/>
<bm:data-filter enforceOperations="query" expression="t2.write_off_flag != &apos;NOT&apos;"/>
<bm:data-filter enforceOperations="query"
expression="t2.billing_status != &apos;FULL&apos; and t2.cf_direction=&apos;INFLOW&apos;"/>
<bm:data-filter enforceOperations="query"
expression="t2.contract_id = t1.contract_id AND t1.billing_status IN (&apos;NOT&apos;, &apos;PARTIAL&apos;) AND t1.contract_status not in (&apos;NEW&apos;,&apos;CANCEL&apos;) AND t2.cf_status = &apos;RELEASE&apos;"/>
<!-- <bm:data-filters>-->
<!-- <bm:data-filter enforceOperations="query"-->
<!-- expression="t.contract_id = t.contract_id AND t.billing_status IN (&apos;NOT&apos;, &apos;PARTIAL&apos;) AND t1.contract_status not in (&apos;CLOSED&apos;,&apos;CANCEL&apos;) AND t.cf_status = &apos;RELEASE&apos; "/>-->
<!-- <bm:data-filter enforceOperations="query" expression="t.write_off_flag != &apos;NOT&apos;"/>-->
<!-- <bm:data-filter enforceOperations="query"-->
<!-- expression="t.billing_status != &apos;FULL&apos; and t.cf_direction=&apos;INFLOW&apos;"/>-->
<!-- <bm:data-filter enforceOperations="query"-->
<!-- expression="t.contract_id = t.contract_id AND t.billing_status IN (&apos;NOT&apos;, &apos;PARTIAL&apos;) AND t1.contract_status not in (&apos;NEW&apos;,&apos;CANCEL&apos;) AND t.cf_status = &apos;RELEASE&apos;"/>-->
<bm:data-filter enforceOperations="query" expression="(t2.times != 0)"/>
<!-- <bm:data-filter enforceOperations="query" expression="(t.times != 0)"/>-->
<bm:data-filter enforceOperations="query"
expression="not (t2.cf_item = 301 and nvl(direct_sales_agent_flag,'N') = 'Y')"/>
</bm:data-filters>
<!-- <bm:data-filter enforceOperations="query"-->
<!-- expression="not (t.cf_item = 301 and nvl(direct_sales_agent_flag,'N') = 'Y')"/>-->
<!-- </bm:data-filters>-->
</bm:model>
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