Commit af0bf72c authored by 38823's avatar 38823

销项发票(经租)初版开发

parent 62927ff5
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
hbm.REF_V07 description, hbm.REF_V07 description,
nvl(hbm.invoice_title, hbm.bp_name) invoice_title, nvl(hbm.invoice_title, hbm.bp_name) invoice_title,
(hbm.invoice_bp_address || '' || hbm.invoice_bp_phone_num) invoice_bp_address_phone_num, (hbm.invoice_bp_address || '' || hbm.invoice_bp_phone_num) invoice_bp_address_phone_num,
(hbm.invoice_bp_bank || ' ' || hbm.invoice_bp_bank_account) invoice_bp_bank_account, (hbm.invoice_bp_bank || '' || hbm.invoice_bp_bank_account) invoice_bp_bank_account,
hbm.tax_registry_num tax_registry_num, hbm.tax_registry_num tax_registry_num,
cc.document_type, cc.document_type,
t2.cashflow_id, t2.cashflow_id,
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
when acr_invoice_pkg.check_rl_cf_flag(cc.contract_id,t2.cf_item,t2.times)= 'Y' and when acr_invoice_pkg.check_rl_cf_flag(cc.contract_id,t2.cf_item,t2.times)= 'Y' and
acr_invoice_pkg.check_rl_flag(cc.contract_id) = 'N' acr_invoice_pkg.check_rl_flag(cc.contract_id) = 'N'
then then
'N' 'N'
else else
'' ''
end rl_flag, end rl_flag,
...@@ -131,9 +131,9 @@ ...@@ -131,9 +131,9 @@
WHERE v.code = 'DIVISION' WHERE v.code = 'DIVISION'
AND v.code_value = cc.division AND v.code_value = cc.division
AND v.code_enabled_flag = 'Y') division_n, AND v.code_enabled_flag = 'Y') division_n,
hbm.full_elec_invoice_flag, hbm.full_elec_invoice_flag,
(select v.code_value_name value_name from sys_code_values_v v where v.code = 'YES_NO' and v.code_value = hbm.full_elec_invoice_flag) full_elec_invoice_flag_n (select v.code_value_name value_name from sys_code_values_v v where v.code = 'YES_NO' and v.code_value = hbm.full_elec_invoice_flag) full_elec_invoice_flag_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 where cc.contract_id = t2.contract_id
and hbm.bp_wfl_status = 'APPROVED' and hbm.bp_wfl_status = 'APPROVED'
...@@ -141,15 +141,12 @@ ...@@ -141,15 +141,12 @@
and hbm.bp_id = t2.bill_object_bp_id and hbm.bp_id = t2.bill_object_bp_id
and nvl(t2.billing_status, 'NOT') != 'FULL' and nvl(t2.billing_status, 'NOT') != 'FULL'
--合同状态为结束中(不论是否做过提前结清或解约回购)、提前结清中、提前结清完成、正常结清的合同 --合同状态为结束中(不论是否做过提前结清或解约回购)、提前结清中、提前结清完成、正常结清的合同
and and ((t2.cf_item = 2 and cc.division !='95' and cc.payment_deduction in ('TRI_AGREEMENT','TRADE_IN')
((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') 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') and hbm.invoice_method = 'NO_BILLING'))
) )
or (cc.division !='95' and cc.contract_status in
or ('TERMINATING', 'ETING', 'ETING', 'TERMINATE')
(cc.contract_status in
('TERMINATING', 'ET', 'ETING', 'TERMINATE')
--合同状态为起租做过承租人变更的合同 --合同状态为起租做过承租人变更的合同
or or
(cc.contract_status = 'INCEPT' and t2.document_type = 'LEASE_CHAG' and (cc.contract_status = 'INCEPT' and t2.document_type = 'LEASE_CHAG' and
...@@ -199,12 +196,12 @@ ...@@ -199,12 +196,12 @@
(cc.contract_status = 'INCEPT' and (cc.contract_status = 'INCEPT' and
trunc(t2.due_date) >= trunc(nvl(cc.CCR_LEASE_DATE, t2.due_date)) and trunc(t2.due_date) >= trunc(nvl(cc.CCR_LEASE_DATE, t2.due_date)) and
hbm.taxpayer_type = 'SMALL_SCALE_TAXPAYER' and hbm.taxpayer_type = 'SMALL_SCALE_TAXPAYER' and
hbm.invoice_method = 'BILLING' hbm.invoice_method = 'BILLING' and
and trunc(t2.due_date) <= trunc(sysdate))
nvl(t2.write_off_flag, 'NOT') = 'FULL' --产品线为经营性租赁,并且全部核销
/* and or
trunc(t2.due_date) <= trunc(sysdate)*/ (cc.division = '95' and nvl(t2.write_off_flag,'NOT') = 'FULL')
))) ))
--合同状态为起租→开票对象:一般纳税人(法人),小规模纳税人(法人)和深圳美鹏HCS小规模纳税人(自然人)→暂不开票→暂不展示 --合同状态为起租→开票对象:一般纳税人(法人),小规模纳税人(法人)和深圳美鹏HCS小规模纳税人(自然人)→暂不开票→暂不展示
and not exists and not exists
(select 1 (select 1
...@@ -349,13 +346,15 @@ ...@@ -349,13 +346,15 @@
<!-- <bm:query-field name="inv_object_taxpayer_type" queryExpression="vv.inv_object_taxpayer_type =${@inv_object_taxpayer_type}"/>--> <!-- <bm:query-field name="inv_object_taxpayer_type" queryExpression="vv.inv_object_taxpayer_type =${@inv_object_taxpayer_type}"/>-->
<bm:query-field name="object_taxpayer_type" queryExpression="vv.object_taxpayer_type =${@object_taxpayer_type}"/> <bm:query-field name="object_taxpayer_type" queryExpression="vv.object_taxpayer_type =${@object_taxpayer_type}"/>
<bm:query-field name="ccr_document_type" queryExpression="vv.ccr_document_type =${@ccr_document_type}"/> <bm:query-field name="ccr_document_type" queryExpression="vv.ccr_document_type =${@ccr_document_type}"/>
<bm:query-field name="invoice_method" queryExpression="vv.invoice_method = ${@invoice_method}"/> <bm:query-field name="invoice_method" queryExpression="vv.invoice_method = ${@invoice_method}"/>
<bm:query-field name="division" queryExpression="vv.division = ${@division}"/> <bm:query-field name="division" queryExpression="vv.division = ${@division}"/>
<bm:query-field name="invoice_type" queryExpression="vv.invoice_type = ${@invoice_type}"/> <bm:query-field name="invoice_type" queryExpression="vv.invoice_type = ${@invoice_type}"/>
<bm:query-field name="rl_flag" queryExpression="vv.rl_flag = ${@rl_flag}"/> <bm:query-field name="rl_flag" queryExpression="vv.rl_flag = ${@rl_flag}"/>
<bm:query-field name="billing_status" queryExpression="vv.billing_status = ${@billing_status}"/> <bm:query-field name="billing_status" queryExpression="vv.billing_status = ${@billing_status}"/>
<bm:query-field name="full_elec_invoice_flag" queryExpression="vv.full_elec_invoice_flag = ${@full_elec_invoice_flag}"/> <bm:query-field name="full_elec_invoice_flag" queryExpression="vv.full_elec_invoice_flag = ${@full_elec_invoice_flag}"/>
</bm:query-fields> <bm:query-field name="search_term_1" queryExpression="vv.search_term_1 = ${@search_term_1}"/>
<bm:query-field name="pur_number" queryExpression="vv.pur_number = ${@pur_number}"/>
</bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="vv.contract_status not in ('CANCEL')"/> <bm:data-filter enforceOperations="query" expression="vv.contract_status not in ('CANCEL')"/>
<!--<bm:data-filter enforceOperations="query" expression="t1.contract_id = vv.contract_id"/>--> <!--<bm:data-filter enforceOperations="query" expression="t1.contract_id = vv.contract_id"/>-->
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/> <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
<bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER" prompt="HLS.PROJECT_NUMBER"/> <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER" prompt="HLS.PROJECT_NUMBER"/>
<bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME" prompt="HLS.PROJECT_NAME"/> <bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME" prompt="HLS.PROJECT_NAME"/>
<bm:field name="product_name_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCT_NAME_DESC" forInsert="false" forUpdate="false"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/> <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="HLS.CONTRACT_NUMBER"/> <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="HLS.CONTRACT_NUMBER"/>
<bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME" prompt="HLS.CONTRACT_NAME"/> <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME" prompt="HLS.CONTRACT_NAME"/>
...@@ -36,11 +37,11 @@ ...@@ -36,11 +37,11 @@
<bm:field name="billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String"/> <bm:field name="billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String"/> <bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="cf_status" databaseType="VARCHAR2" datatype="java.lang.String"/> <bm:field name="cf_status" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE"/> <bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE"/>
<bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE_N" prompt="发票种类"/> <bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE_N" prompt="发票种类"/>
<bm:field name="rl_flag"/> <bm:field name="rl_flag"/>
<bm:field name="full_elec_invoice_flag"/> <bm:field name="full_elec_invoice_flag"/>
<bm:field name="full_elec_invoice_flag_n"/> <bm:field name="full_elec_invoice_flag_n"/>
<bm:field name="business_type" /> <bm:field name="business_type" />
<bm:field name="business_type_desc"/> <bm:field name="business_type_desc"/>
<bm:field name="pur_model"/> <bm:field name="pur_model"/>
...@@ -100,7 +101,8 @@ ...@@ -100,7 +101,8 @@
(select i.description (select i.description
from hls_cashflow_item i from hls_cashflow_item i
where i.cf_item = t.cf_item) as cf_item_desc, where i.cf_item = t.cf_item) as cf_item_desc,
decode(con.contract_number,'HLL23120001','租赁费',decode(t.cf_item,250,'设备款','融资租赁费')) as product_name, decode(con.division,95,'*经营租赁*',decode(t.cf_item,250,'融资租赁挖掘机','融资租赁费')) as product_name,
decode(con.division,95,'*经营租赁*',decode(t.cf_item,250,'融资租赁挖掘机','融资租赁费')) as product_name_desc,
con.contract_status contract_status, con.contract_status contract_status,
cf.cf_status cf_status, cf.cf_status cf_status,
t.invoice_kind_type, t.invoice_kind_type,
...@@ -124,8 +126,9 @@ ...@@ -124,8 +126,9 @@
decode(con.division,95,'高空作业平台','') as pur_model, decode(con.division,95,'高空作业平台','') as pur_model,
decode(con.division,95,'台','') as pur_unit, decode(con.division,95,'台','') as pur_unit,
con.business_type, con.business_type,
t.full_elec_invoice_flag, (select v.code_value_name from sys_code_values_v v where v.code = 'BUSINESS_TYPE' and v.code_value = con.business_type) business_type_desc,
(select v.code_value_name value_name from sys_code_values_v v where v.code = 'YES_NO' and v.code_value = t.full_elec_invoice_flag) full_elec_invoice_flag_n t.full_elec_invoice_flag,
(select v.code_value_name value_name from sys_code_values_v v where v.code = 'YES_NO' and v.code_value = t.full_elec_invoice_flag) full_elec_invoice_flag_n
from acr_invoice_create_tmp t, from acr_invoice_create_tmp t,
con_contract_v con, con_contract_v con,
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT * SELECT *
FROM (SELECT t1.invoice_hd_id, FROM (SELECT t1.invoice_hd_id,
t1.description,
t1.document_number, t1.document_number,
TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') AS invoice_date, TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') AS invoice_date,
t1.document_category, t1.document_category,
......
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
t1.lease_channel, t1.lease_channel,
t1.division, t1.division,
t1.company_id, t1.company_id,
t1.spv_company_id, t1.spv_company_id,
t1.invoice_type, t1.invoice_type,
t1.invoice_kind_type, t1.invoice_kind_type,
t1.invoice_kind_type_n, t1.invoice_kind_type_n,
t1.full_elec_invoice_flag, t1.full_elec_invoice_flag,
t1.full_elec_invoice_flag_n t1.full_elec_invoice_flag_n
FROM acr_invoice_hd_v t1 where t1.division != 95 FROM acr_invoice_hd_v t1 where t1.division != 95
ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE# ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE#
ORDER BY invoice_date DESC, document_number DESC ORDER BY invoice_date DESC, document_number DESC
...@@ -116,8 +116,10 @@ ...@@ -116,8 +116,10 @@
--> -->
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/> <bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/> <bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
<bm:query-field name="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/> <bm:query-field name="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/>
<bm:query-field name="full_elec_invoice_flag" queryExpression="t1.full_elec_invoice_flag = ${@full_elec_invoice_flag}"/> <bm:query-field name="full_elec_invoice_flag" queryExpression="t1.full_elec_invoice_flag = ${@full_elec_invoice_flag}"/>
<bm:query-field name="business_type_n" queryExpression="t1.business_type_n = ${@business_type_n}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;REJECT&apos;)"/> <bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;REJECT&apos;)"/>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
$Revision: 1.0 $Revision: 1.0
$Purpose: $Purpose:
--> -->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="acr515_invoice_hd_v" defaultOrderBy=""> <bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="acr515_invoice_hd_op_v" defaultOrderBy="">
<bm:fields> <bm:fields>
<bm:field name="invoice_hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INVOICE_HD_ID"/> <bm:field name="invoice_hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INVOICE_HD_ID"/>
<bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/> <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
......
...@@ -117,8 +117,12 @@ ...@@ -117,8 +117,12 @@
<bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type" prompt="发票种类"/> <bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type" prompt="发票种类"/>
<bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type_n" prompt="发票种类"/> <bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type_n" prompt="发票种类"/>
<bm:field name="full_elec_invoice_flag" databaseType="VARCHAR2" datatype="java.lang.String" /> <bm:field name="full_elec_invoice_flag" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="full_elec_invoice_flag_n" databaseType="VARCHAR2" datatype="java.lang.String"/> <bm:field name="full_elec_invoice_flag_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
</bm:fields> <bm:field name="business_type_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="business_type_n_desc" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="search_term_1" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="pur_number" databaseType="VARCHAR2" datatype="java.lang.String"/>
</bm:fields>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/> <bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/>
<bm:query-field name="document_number_t" queryExpression="t1.document_number &lt;= ${@document_number_t}"/> <bm:query-field name="document_number_t" queryExpression="t1.document_number &lt;= ${@document_number_t}"/>
...@@ -146,7 +150,7 @@ ...@@ -146,7 +150,7 @@
<bm:query-field name="confirmed_by" queryExpression="t1.confirmed_by = ${@confirmed_by}"/> <bm:query-field name="confirmed_by" queryExpression="t1.confirmed_by = ${@confirmed_by}"/>
<bm:query-field name="query_contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/> <bm:query-field name="query_contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/> <bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="invoice_apply_num" queryExpression="(exists(select 1 from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status = 'APPROVED' and ap.apply_mode = 'APPLY' and ap.invoice_apply_id = aw.invoice_apply_id and aw.invoice_hd_id = t1.invoice_hd_id and ap.invoice_apply_num=${@invoice_apply_num}) or exists(select ap.invoice_apply_num from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status = 'APPROVED' and ap.apply_mode = 'REVERSE' and ap.invoice_apply_id = aw.invoice_apply_id and aw.invoice_hd_id = t1.source_invoice_header_id and ap.invoice_apply_num=${@invoice_apply_num}) )"/> <bm:query-field name="invoice_apply_num" queryExpression="( exists(select 1 from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status = 'APPROVED' and ap.apply_mode = 'APPLY' and ap.invoice_apply_id = aw.invoice_apply_id and aw.invoice_hd_id = t1.invoice_hd_id and ap.invoice_apply_num=${@invoice_apply_num}) or exists(select ap.invoice_apply_num from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status = 'APPROVED' and ap.apply_mode = 'REVERSE' and ap.invoice_apply_id = aw.invoice_apply_id and aw.invoice_hd_id = t1.source_invoice_header_id and ap.invoice_apply_num=${@invoice_apply_num}) )"/>
<bm:query-field name="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/> <bm:query-field name="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/>
<bm:query-field name="full_elec_invoice_flag" queryExpression="t1.full_elec_invoice_flag = ${@full_elec_invoice_flag}"/> <bm:query-field name="full_elec_invoice_flag" queryExpression="t1.full_elec_invoice_flag = ${@full_elec_invoice_flag}"/>
<bm:query-field name="search_term_1" queryExpression="t1.search_term_1 = ${@search_term_1}"/> <bm:query-field name="search_term_1" queryExpression="t1.search_term_1 = ${@search_term_1}"/>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
al.cashflow_id, al.cashflow_id,
al.cf_item, al.cf_item,
ah.document_number, ah.document_number,
(Select c.contract_number (Select c.contract_number
From con_contract c From con_contract c
Where c.contract_id = ah.contract_id) contract_number, Where c.contract_id = ah.contract_id) contract_number,
...@@ -56,13 +57,12 @@ ...@@ -56,13 +57,12 @@
From con_contract_cashflow t From con_contract_cashflow t
Where t.cashflow_id = al.cashflow_id)) times, Where t.cashflow_id = al.cashflow_id)) times,
nvl((Select to_char(h.journal_date, 'yyyy-mm') (Select to_char(h.journal_date, 'yyyy-mm')
From hls_journal_header h, hls_journal_detail l From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id Where h.journal_header_id = l.journal_header_id
And ((l.cashflow_id = al.cashflow_id And ((l.cashflow_id = al.cashflow_id
and al.cf_item<>9) or (al.ref_n04=l.journal_line_id and al.cf_item=9)) and al.cf_item<>9) or (al.ref_n04=l.journal_line_id and al.cf_item=9))
And rownum = 1),(select to_char(t.invoice_date, 'yyyymm') And rownum = 1) journal_month,
from acr_invoice_hd t where t.invoice_hd_id=ah.invoice_hd_id)) journal_month,
(Select h.sbo_num (Select h.sbo_num
From hls_journal_header h, hls_journal_detail l From hls_journal_header h, hls_journal_detail l
Where h.journal_header_id = l.journal_header_id Where h.journal_header_id = l.journal_header_id
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
and al.cashflow_id = cw.cashflow_id and al.cashflow_id = cw.cashflow_id
and cw.reversed_flag='N' and cw.reversed_flag='N'
and cw.cf_item<>2 and cw.cf_item<>2
and ctr.paid_byother_flag='T'),0,'F','T')) paid_byother_flag_n, and ctr.paid_byother_flag='T'),0,'F','T')) paid_byother_flag_n,
(case when al.cf_item<>'9' then cwo.received_amount else (case when al.cf_item<>'9' then cwo.received_amount else
al.total_amount end)received_amount, al.total_amount end)received_amount,
ah.invoice_hd_id, ah.invoice_hd_id,
...@@ -122,15 +122,32 @@ ...@@ -122,15 +122,32 @@
and ctr.paid_byother_flag='T' and ctr.paid_byother_flag='T'
and cw.cf_item<>2 and cw.cf_item<>2
and nvl(ctr.guarantor_name_duty,'N')='N')paid_byother_sum_flag, and nvl(ctr.guarantor_name_duty,'N')='N')paid_byother_sum_flag,
(select aw.product_name from acr_invoice_batch_ln_wfl aw
where ah.invoice_hd_wfl_id = aw.invoice_hd_wfl_id
and rownum =1) product_name_n,
(select v.code_value_id from sys_code_values_v v
where
v.code = 'ACR510_PRODUCT_NAME'
And v.code_value = (select aw.product_name from acr_invoice_batch_ln_wfl aw
where ah.invoice_hd_wfl_id = aw.invoice_hd_wfl_id
and rownum =1)
and v.code_enabled_flag = 'Y'
and v.code_value_enabled_flag = 'Y') product_name_order,
null attachment null attachment
From acr_invoice_apply aa, From acr_invoice_apply aa,
acr_invoice_hd_wfl ah, acr_invoice_hd_wfl ah,
acr_invoice_ln_wfl al, acr_invoice_ln_wfl al,
con_contract_cashflow cwo con_contract_cashflow cwo,
sys_code_values_v v
Where aa.invoice_apply_id = ah.invoice_apply_id Where aa.invoice_apply_id = ah.invoice_apply_id
And ah.invoice_hd_wfl_id = al.invoice_hd_wfl_id And ah.invoice_hd_wfl_id = al.invoice_hd_wfl_id
And al.cashflow_id = cwo.cashflow_id(+) And al.cashflow_id = cwo.cashflow_id(+)
order by cwo.contract_id desc, cwo.times asc) t1 #WHERE_CLAUSE# #ORDER_BY_CLAUSE# and v.code = 'ACR510_PRODUCT_NAME'
And v.code_value = al.product_name
and v.code_enabled_flag = 'Y'
and v.code_value_enabled_flag = 'Y'
order by product_name_order asc,cwo.contract_id desc,cwo.times asc) t1 #WHERE_CLAUSE# #ORDER_BY_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
...@@ -146,9 +163,11 @@ ...@@ -146,9 +163,11 @@
</bm:operations> </bm:operations>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/> <bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="pur_contract_number" queryExpression="t1.pur_contract_number = ${@pur_contract_number}"/>
<bm:query-field name="bp_code" queryExpression="t1.bp_code = ${@bp_code}"/> <bm:query-field name="bp_code" queryExpression="t1.bp_code = ${@bp_code}"/>
<bm:query-field name="journal_month" queryExpression="t1.journal_month = ${@journal_month}"/> <bm:query-field name="journal_month" queryExpression="t1.journal_month = ${@journal_month}"/>
<bm:query-field name="paid_byother_flag_n" queryExpression="t1.paid_byother_flag = ${@paid_byother_flag}"/> <bm:query-field name="paid_byother_flag_n" queryExpression="t1.paid_byother_flag = ${@paid_byother_flag}"/>
<bm:query-field name="product_name_n" queryExpression="t1.product_name_n = ${@product_name_n}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_apply_id = ${@invoice_apply_id}"/> <bm:data-filter enforceOperations="query" expression="t1.invoice_apply_id = ${@invoice_apply_id}"/>
......
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
} }
function contractDs_grid_add() { function contractDs_grid_add() {
$('contractDs_grid').showEditorByRecord($('ar510n_cashflow_ds').create()); $('contractDs_grid').showEditorByRecord($('ar510n_cashflow_ds')
.create());
} }
function invoiceHd_close() { function invoiceHd_close() {
...@@ -118,6 +119,7 @@ ...@@ -118,6 +119,7 @@
function invoiceHd_confirm() { function invoiceHd_confirm() {
debugger;
Leaf.Masker.mask(Ext.getBody()); Leaf.Masker.mask(Ext.getBody());
var final_bill_flag = $('allConditionDs').getAt(0).get('final_bill_flag'); var final_bill_flag = $('allConditionDs').getAt(0).get('final_bill_flag');
var cat_ini_flag = $('allConditionDs').getAt(0).get('cat_ini_flag'); var cat_ini_flag = $('allConditionDs').getAt(0).get('cat_ini_flag');
...@@ -282,10 +284,10 @@ ...@@ -282,10 +284,10 @@
<a:record code_value="REPUR" code_value_name="解约回购"/> <a:record code_value="REPUR" code_value_name="解约回购"/>
</a:datas> </a:datas>
</a:dataSet> </a:dataSet>
<a:dataSet id="acr510n_invoice_type_ds"> <a:dataSet id="acr510n_invoice_type_ds">
<a:datas> <a:datas>
<a:record code_value="ECT" code_value_name="电子发票"/> <a:record code_value="ECT" code_value_name="电子发票"/>
<a:record code_value="PAPER" code_value_name="数电纸质发票"/> <a:record code_value="PAPER" code_value_name="纸质发票"/>
</a:datas> </a:datas>
</a:dataSet> </a:dataSet>
<a:dataSet id="acr510n_division_ds"> <a:dataSet id="acr510n_division_ds">
...@@ -295,14 +297,10 @@ ...@@ -295,14 +297,10 @@
<a:record code_value="30" code_value_name="高空作业车"/> <a:record code_value="30" code_value_name="高空作业车"/>
<a:record code_value="40" code_value_name="其它"/> <a:record code_value="40" code_value_name="其它"/>
<a:record code_value="50" code_value_name="星邦高空作业车"/> <a:record code_value="50" code_value_name="星邦高空作业车"/>
<!--<a:record code_value="90" code_value_name="租赁二手机"/>--> <a:record code_value="90" code_value_name="租赁二手机"/>
<a:record code_value="90" code_value_name="租赁二手机(日立)"/>
<a:record code_value="91" code_value_name="神钢建机"/> <a:record code_value="91" code_value_name="神钢建机"/>
<a:record code_value="92" code_value_name="北京心诚"/> <a:record code_value="92" code_value_name="北京心诚"/>
<a:record code_value="99" code_value_name="工程机械"/> <a:record code_value="95" code_value_name="经租设备"/>
<a:record code_value="80" code_value_name="叉车"/>
<!--<a:record code_value="70" code_value_name="铁甲业务"/>-->
<a:record code_value="70" code_value_name="二手机业务"/>
</a:datas> </a:datas>
</a:dataSet> </a:dataSet>
<a:dataSet id="acr510n_invoice_method_ds"> <a:dataSet id="acr510n_invoice_method_ds">
...@@ -313,7 +311,7 @@ ...@@ -313,7 +311,7 @@
</a:dataSet> </a:dataSet>
<a:dataSet id="allConditionDs" autoCreate="true"> <a:dataSet id="allConditionDs" autoCreate="true">
<a:fields> <a:fields>
<a:field name="invoice_method"/> <a:field name="invoice_method"/>
<a:field displayField="code_value_name" name="invoice_method_n" options="acr510n_invoice_method_ds" <a:field displayField="code_value_name" name="invoice_method_n" options="acr510n_invoice_method_ds"
returnField="invoice_method" valueField="code_value"/> returnField="invoice_method" valueField="code_value"/>
<a:field name="division"/> <a:field name="division"/>
...@@ -454,9 +452,9 @@ ...@@ -454,9 +452,9 @@
<a:field name="billing_status"/> <a:field name="billing_status"/>
<a:field name="billing_status_n" displayField="code_value_name" options="billing_status_ds" <a:field name="billing_status_n" displayField="code_value_name" options="billing_status_ds"
returnField="billing_status" valueField="code_value"/> returnField="billing_status" valueField="code_value"/>
<a:field name="full_elec_invoice_flag"/> <a:field name="full_elec_invoice_flag"/>
<a:field name="full_elec_invoice_flag_n" displayField="code_value_name" options="overdue_status_ds" <a:field name="full_elec_invoice_flag_n" displayField="code_value_name" options="overdue_status_ds"
returnField="full_elec_invoice_flag" valueField="code_value"/> returnField="full_elec_invoice_flag" valueField="code_value"/>
</a:fields> </a:fields>
<a:events> <a:events>
<a:event name="update" handler="queryUpdateFunction"/> <a:event name="update" handler="queryUpdateFunction"/>
...@@ -532,7 +530,8 @@ ...@@ -532,7 +530,8 @@
</a:hBox> </a:hBox>
<a:hBox> <a:hBox>
<a:comboBox bindTarget="allConditionDs" name="billing_status_n" prompt="开票状态"/> <a:comboBox bindTarget="allConditionDs" name="billing_status_n" prompt="开票状态"/>
<a:comboBox bindTarget="allConditionDs" name="full_elec_invoice_flag_n" prompt="是否全电发票"/> <a:comboBox bindTarget="allConditionDs" name="full_elec_invoice_flag_n" prompt="是否全电发票"/>
</a:hBox> </a:hBox>
<!-- <a:formBody column="4" labelWidth="400"> <!-- <a:formBody column="4" labelWidth="400">
<a:lov name="contract_number_from" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NUMBER_FROM"/> <a:lov name="contract_number_from" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NUMBER_FROM"/>
...@@ -597,13 +596,13 @@ ...@@ -597,13 +596,13 @@
<a:column name="exchange_rate" align="right" width="80"/> <a:column name="exchange_rate" align="right" width="80"/>
<a:column name="exchange_rate_type_desc" width="100"/> --> <a:column name="exchange_rate_type_desc" width="100"/> -->
<a:column name="bill_object_bp_class_desc" width="100" align="center" prompt="商业伙伴分类" /> <a:column name="bill_object_bp_class_desc" width="100" align="center" prompt="商业伙伴分类" />
<a:column name="invoice_method_n" prompt="开票方式" width="100"/> <a:column name="invoice_method_n" prompt="开票方式" width="100"/>
<a:column name="division_n" prompt="租赁物" width="100"/> <a:column name="division_n" prompt="租赁物" width="100"/>
<a:column name="write_off_flag_desc" width="100" align="center" prompt="核销标记" /> <a:column name="write_off_flag_desc" width="100" align="center" prompt="核销标记" />
<a:column name="rl_flag_n" width="100" align="center" prompt="是否日立为优质客户付租金" /> <a:column name="rl_flag_n" width="100" align="center" prompt="是否日立为优质客户付租金" />
<a:column name="billing_status_n" width="100" align="center" prompt="开票状态" /> <a:column name="billing_status_n" width="100" align="center" prompt="开票状态" />
<a:column name="full_elec_invoice_flag_n" width="100" align="center" prompt="是否全电发票" /> <a:column name="full_elec_invoice_flag_n" width="100" align="center" prompt="是否全电发票" />
</a:columns> </a:columns>
</a:grid> </a:grid>
</a:tab> </a:tab>
<a:tab prompt="抬头信息" width="150"> <a:tab prompt="抬头信息" width="150">
...@@ -614,7 +613,8 @@ ...@@ -614,7 +613,8 @@
<!--<a:column name="object_taxpayer_type_desc" prompt="纳税人类型"/>--> <!--<a:column name="object_taxpayer_type_desc" prompt="纳税人类型"/>-->
<a:column name="contract_number" prompt="合同编号" align="center" width="100"/> <a:column name="contract_number" prompt="合同编号" align="center" width="100"/>
<a:column name="contract_status_desc" prompt="合同状态" align="center" width="80"/> <a:column name="contract_status_desc" prompt="合同状态" align="center" width="80"/>
<a:column name="billing_method_desc" prompt="开票规则" width="155"/> <a:column name="billing_method_desc" prompt="开票规则"
width="155"/>
<a:column name="billing_object_name" autoAdjust="false" <a:column name="billing_object_name" autoAdjust="false"
editor="contractDs_grid_editor_lov" prompt="开票对象名称" editor="contractDs_grid_editor_lov" prompt="开票对象名称"
renderer="render_contractDs_grid" showTitle="true" width="200"/> renderer="render_contractDs_grid" showTitle="true" width="200"/>
...@@ -622,7 +622,7 @@ ...@@ -622,7 +622,7 @@
width="200"/> width="200"/>
<a:column name="object_tax_registry_num" prompt="纳税人识别号" width="150"/> <a:column name="object_tax_registry_num" prompt="纳税人识别号" width="150"/>
<a:column name="object_taxpayer_type_desc" prompt="纳税人类型" align="center" width="150"/> <a:column name="object_taxpayer_type_desc" prompt="纳税人类型" align="center" width="150"/>
<a:column name="invoice_type_n" prompt="开票类型" width="150"/> <a:column name="invoice_type_n" prompt="开票类型" width="150"/>
<a:column name="invoice_bp_address_phone_num" autoAdjust="false" prompt="开票地址电话" <a:column name="invoice_bp_address_phone_num" autoAdjust="false" prompt="开票地址电话"
showTitle="true" width="200"/> showTitle="true" width="200"/>
<a:column name="invoice_bp_bank_account" autoAdjust="false" prompt="开户行及账号" <a:column name="invoice_bp_bank_account" autoAdjust="false" prompt="开户行及账号"
......
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