Commit 1251a148 authored by lijingjing's avatar lijingjing

销项发票

parents bcad7773 967ff435
Pipeline #3698 canceled with stages
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2014-12-8 上午11:04:41
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:update-sql><![CDATA[
SELECT
hbm.bp_id value_code,
hbm.bp_name value_name,
hbm.bp_code
FROM
hls_bp_master hbm
WHERE
hbm.enabled_flag = 'Y' AND
hbm.bp_category = 'AGENT'
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm"> <bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[select t1.spv_company_id,
SELECT
t1.spv_company_id,
t1.company_id, t1.company_id,
t1.project_id, t1.project_id,
t1.project_number, t1.project_number,
...@@ -17,27 +15,27 @@ ...@@ -17,27 +15,27 @@
t1.contract_status_desc, t1.contract_status_desc,
t1.billing_method, t1.billing_method,
t1.billing_method_desc, t1.billing_method_desc,
DECODE(t2.cf_item,'912',t1.inv_billing_object_id,t1.billing_object_id) billing_object_id, decode(t2.cf_item,'912',t1.inv_billing_object_id,t1.billing_object_id) billing_object_id,
DECODE(t2.cf_item,'912',t1.inv_billing_object_code,t1.billing_object_code) billing_object_code, decode(t2.cf_item,'912',t1.inv_billing_object_code,t1.billing_object_code) billing_object_code,
DECODE(t2.cf_item,'912',t1.inv_billing_object_name,t1.billing_object_name) billing_object_name, decode(t2.cf_item,'912',t1.inv_billing_object_name,t1.billing_object_name) billing_object_name,
DECODE(t2.cf_item,'912',t1.inv_object_taxpayer_type,t1.object_taxpayer_type) object_taxpayer_type, decode(t2.cf_item,'912',t1.inv_object_taxpayer_type,t1.object_taxpayer_type) object_taxpayer_type,
DECODE(t2.cf_item,'912',t1.inv_object_taxpayer_type_desc,t1.object_taxpayer_type_desc) object_taxpayer_type_desc, decode(t2.cf_item,'912',t1.inv_object_taxpayer_type_desc,t1.object_taxpayer_type_desc) object_taxpayer_type_desc,
DECODE(t2.cf_item,'912',t1.inv_object_tax_registry_num,t1.object_tax_registry_num) object_tax_registry_num, decode(t2.cf_item,'912',t1.inv_object_tax_registry_num,t1.object_tax_registry_num) object_tax_registry_num,
DECODE(t2.cf_item,'912',t1.inv_bill_object_bp_class,t1.bill_object_bp_class) bill_object_bp_class, decode(t2.cf_item,'912',t1.inv_bill_object_bp_class,t1.bill_object_bp_class) bill_object_bp_class,
DECODE(t2.cf_item,'912',t1.inv_bill_object_bp_class_desc,t1.bill_object_bp_class_desc) bill_object_bp_class_desc, decode(t2.cf_item,'912',t1.inv_bill_object_bp_class_desc,t1.bill_object_bp_class_desc) bill_object_bp_class_desc,
t1.tax_type_vat, t1.tax_type_vat,
t1.description, t1.description,
DECODE(t2.cf_item,'912',t1.inv_invoice_title,t1.invoice_title) invoice_title, decode(t2.cf_item,'912',t1.inv_invoice_title,t1.invoice_title) invoice_title,
DECODE(t2.cf_item,'912',t1.inv_bp_address_phone_num,t1.invoice_bp_address_phone_num) invoice_bp_address_phone_num, decode(t2.cf_item,'912',t1.inv_bp_address_phone_num,t1.invoice_bp_address_phone_num) invoice_bp_address_phone_num,
DECODE(t2.cf_item,'912',t1.inv_invoice_bp_bank_account,t1.invoice_bp_bank_account) invoice_bp_bank_account, decode(t2.cf_item,'912',t1.inv_invoice_bp_bank_account,t1.invoice_bp_bank_account) invoice_bp_bank_account,
DECODE(t2.cf_item,'912',t1.inv_tax_registry_num,t1.tax_registry_num) tax_registry_num, decode(t2.cf_item,'912',t1.inv_tax_registry_num,t1.tax_registry_num) tax_registry_num,
t1.prj_search_term_1, t1.prj_search_term_1,
t1.prj_search_term_2, t1.prj_search_term_2,
t1.con_search_term_1, t1.con_search_term_1,
t1.con_search_term_2, t1.con_search_term_2,
t1.document_type, t1.document_type,
t1.bp_name, t1.bp_name,
DECODE(t2.cf_item,'912',t1.inv_invoice_type_desc,t1.invoice_type_desc) invoice_type_desc, decode(t2.cf_item,'912',t1.inv_invoice_type_desc,t1.invoice_type_desc) invoice_type_desc,
t2.cashflow_id, t2.cashflow_id,
t2.cf_item, t2.cf_item,
t2.cf_item_desc, t2.cf_item_desc,
...@@ -45,11 +43,11 @@ ...@@ -45,11 +43,11 @@
t2.last_received_date, t2.last_received_date,
t2.due_date, t2.due_date,
t2.due_amount, t2.due_amount,
t2.principal, decode(t1.lease_channel,'01',null,t2.principal) principal,
t2.interest, decode(t1.lease_channel,'01',null,t2.interest) interest,
t2.received_amount, t2.received_amount,
t2.received_principal, decode(t1.lease_channel,'01',null,t2.received_principal) received_principal,
t2.received_interest, decode(t1.lease_channel,'01',null,t2.received_interest) received_interest,
t2.billing_amount, t2.billing_amount,
t2.billing_principal, t2.billing_principal,
t2.billing_interest, t2.billing_interest,
...@@ -68,17 +66,12 @@ ...@@ -68,17 +66,12 @@
t2.exchange_rate_quotation_desc, t2.exchange_rate_quotation_desc,
t2.overdue_status, t2.overdue_status,
t2.overdue_max_days, t2.overdue_max_days,
t1.lease_channel_desc, t1.bp_id_agent_level1,
t1.business_type_desc t1.termination_date,
t1.lease_channel
FROM from acr_invoice_contract_v t1, ACR_INVOICE_CONTRACT_CF_V t2
acr_invoice_contract_v t1, #WHERE_CLAUSE#
ACR_INVOICE_CONTRACT_CF_V t2 #WHERE_CLAUSE# ORDER BY t1.contract_id,t2.times,t2.due_date,t2.cf_item
ORDER BY
t1.contract_id,
t2.times,
t2.due_date,
t2.cf_item
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
...@@ -147,8 +140,9 @@ ...@@ -147,8 +140,9 @@
<bm:field name="exchange_rate_quotation_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_QUOTATION_DESC"/> <bm:field name="exchange_rate_quotation_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_QUOTATION_DESC"/>
<bm:field name="overdue_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OVERDUE_STATUS" required="true"/> <bm:field name="overdue_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OVERDUE_STATUS" required="true"/>
<bm:field name="overdue_max_days" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OVERDUE_MAX_DAYS"/> <bm:field name="overdue_max_days" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OVERDUE_MAX_DAYS"/>
<bm:field name="lease_channel_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL_DESC"/> <bm:field name="bp_id_agent_level1"/>
<bm:field name="business_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_DESC"/> <bm:field name="termination_date"/>
<bm:field name="lease_channel"/>
</bm:fields> </bm:fields>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="cf_item" queryExpression="t2.cf_item = ${@cf_item}"/> <bm:query-field name="cf_item" queryExpression="t2.cf_item = ${@cf_item}"/>
...@@ -175,20 +169,21 @@ ...@@ -175,20 +169,21 @@
<bm:query-field name="con_search_term_2" queryExpression="t1.con_search_term_2=${@con_search_term_2}"/> <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; "/> <bm:query-field name="bp_name" queryExpression="t1.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; "/> <bm:query-field name="project_name" queryExpression="t1.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="contract_name" queryExpression="t1.contract_name like &apos;%&apos;||${@contract_name}||&apos;%&apos; "/>
<bm:query-field name="contract_number" queryExpression="t1.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos; "/>
<bm:query-field name="document_type" queryExpression="t1.document_type=${@document_type}"/> <bm:query-field name="document_type" queryExpression="t1.document_type=${@document_type}"/>
<bm:query-field name="contract_status" queryExpression="t1.contract_status = ${@contract_status}"/> <bm:query-field name="contract_status" queryExpression="t1.contract_status = ${@contract_status}"/>
<bm:query-field name="bp_id_agent_level1" queryExpression="t1.bp_id_agent_level1 = ${@bp_id_agent_level1}"/>
<bm:query-field name="termination_date_from" queryExpression="to_date(t1.termination_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@termination_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="termination_date_to" queryExpression="to_date(t1.termination_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@termination_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel=${@lease_channel}"/>
<bm:query-field name="project_number" queryExpression="t1.project_number like &apos;%&apos;|| ${@project_number}||&apos;%&apos;"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="nvl(t2.billing_amount,0)&lt;t2.received_amount"/> <bm:data-filter enforceOperations="query" expression="nvl(t2.billing_amount,0)&lt;t2.received_amount"/>
<bm:data-filter enforceOperations="query" expression="t1.contract_id = t2.contract_id"/> <bm:data-filter enforceOperations="query" expression="t1.contract_id = t2.contract_id"/>
<bm:data-filter enforceOperations="query" expression="t2.cf_item in(&apos;1&apos;,&apos;8&apos;,&apos;9&apos;,&apos;10&apos;,&apos;12&apos;,&apos;13&apos;,&apos;51&apos;,&apos;200&apos;,&apos;912&apos;,&apos;913&apos;)"/> <bm:data-filter enforceOperations="query" expression="t2.cf_item in(&apos;1&apos;,&apos;8&apos;,&apos;9&apos;,&apos;10&apos;,&apos;12&apos;,&apos;13&apos;,&apos;200&apos;,&apos;912&apos;,&apos;913&apos;,&apos;301&apos;)"/>
<!-- <bm:data-filter enforceOperations="query" expression="trunc(t2.due_date) &lt;= trunc(sysdate)"/> -->
<bm:data-filter enforceOperations="query" expression="t2.write_off_flag != &apos;NOT&apos;"/> <bm:data-filter enforceOperations="query" expression="t2.write_off_flag != &apos;NOT&apos;"/>
<!-- <bm:data-filter enforceOperations="query" expression="t2.cf_status = &apos;RELEASE&apos;"/> --> <bm:data-filter enforceOperations="query" expression="t2.cf_status = &apos;RELEASE&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.billing_status != &apos;FULL&apos; and t2.cf_direction=&apos;INFLOW&apos;"/>
<bm:data-filter enforceOperations="query" expression="t1.contract_status != &apos;CANCEL&apos;"/>
<bm:data-filter enforceOperations="query" expression="(nvl(t2.received_amount,0) - nvl(t2.billing_amount,0)) &gt; 0.17"/>
</bm:data-filters> </bm:data-filters>
</bm:model> </bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: DJ
$Date: 2013-6-19 下午12:44:44
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="code_value"/>
<bm:field name="code_value_name"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select v.code_value, v.code_value_name
from sys_code_values_v v
where v.code = 'ACR510_GROUP_BILLING_METHOD'
and v.code_value_enabled_flag = 'Y'
order by decode(v.code_value,
'GROUP_BY_TIMES',
1,
'GROUP_BY_CONTRACT',
2,
'GROUP_BY_PROJECT',
3,
'GROUP_BY_TENANT',
4,
5)
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
t1.*
FROM
(SELECT
v.code_value,
v.code_value_name,
v.code
FROM
sys_code_values_v v
WHERE
v.code in ('CON500_CONTRACT_STATUS','CON660_CONTRACT_STATUS') AND
v.code_enabled_flag = 'Y' AND
v.code_value_enabled_flag = 'Y'
ORDER BY
v.order_seq
) t1 #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="code" queryExpression="t1.code =decode(${@lease_channel},&apos;00&apos;,&apos;CON500_CONTRACT_STATUS&apos;,&apos;01&apos;,&apos;CON660_CONTRACT_STATUS&apos;,&apos;CON500_CONTRACT_STATUS&apos;)"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="code" expression="t1.code =decode(${@lease_channel},&apos;00&apos;,&apos;CON500_CONTRACT_STATUS&apos;,&apos;01&apos;,&apos;CON660_CONTRACT_STATUS&apos;,&apos;CON500_CONTRACT_STATUS&apos;)"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: DJ
$Date: 2013-5-28 上午10:41:52
$Revision: 1.0
$Purpose:
-->
<ns1:model xmlns:ns1="http://www.leaf-framework.org/schema/bm" alias="t1" extend="hls.HLS005.hls_cashflow_item_v" extendMode="reference">
<ns1:fields>
<ns1:field name="cf_item" forDisplay="false" forQuery="false"/>
<ns1:field name="cf_item_desc" forDisplay="true" forQuery="true"/>
<ns1:field name="enabled_flag"/>
<ns1:field name="cf_type" forDisplay="false" forQuery="false"/>
<ns1:field name="cf_type_desc" forDisplay="true" forQuery="true"/>
<ns1:field name="cf_direction"/>
<ns1:field name="cf_direction_desc" forDisplay="true"/>
</ns1:fields>
<ns1:query-fields>
<ns1:query-field field="cf_item" queryOperator="like"/>
<ns1:query-field field="cf_item_desc" queryOperator="like"/>
<ns1:query-field field="cf_type" queryOperator="like"/>
<ns1:query-field field="cf_type_desc" queryOperator="like"/>
<ns1:query-field field="cf_direction" queryOperator="="/>
</ns1:query-fields>
<ns1:data-filters>
<ns1:data-filter name="enabled_flag" enforceOperations="query" expression="t1.enabled_flag=&apos;Y&apos;"/>
<ns1:data-filter name="cf_item" enforceOperations="query" expression="t1.cf_item in(&apos;1&apos;,&apos;8&apos;,&apos;9&apos;,&apos;10&apos;,&apos;12&apos;,&apos;13&apos;,&apos;200&apos;,&apos;912&apos;,&apos;913&apos;,&apos;301&apos;)"/>
</ns1:data-filters>
</ns1:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 下午06:07:55
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" prompt="HLS_BP_MASTER.BP_ID"/>
<bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="150" forDisplay="true" forQuery="true" physicalName="BP_CODE" prompt="客户编码"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="250" forDisplay="true" forQuery="true" physicalName="BP_NAME" prompt="客户描述"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t.bp_id, t.bp_code, t.bp_name FROM hls_bp_master t #WHERE_CLAUSE# ORDER by bp_code
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="bp_code" queryExpression="t.bp_code like ${@bp_code}"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like ${@bp_name}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="ACR_INVOICE_HD_BATCH">
<bm:fields>
<bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="ACR_INVOICE_HD_BATCH.BATCH_ID"/>
<bm:field name="invoice_hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INVOICE_HD_ID" prompt="ACR_INVOICE_HD_BATCH.INVOICE_HD_ID"/>
<bm:field name="creation_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CREATION_BY" prompt="ACR_INVOICE_HD_BATCH.CREATION_BY"/>
<bm:field name="last_updated_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_UPDATED_DATE" prompt="ACR_INVOICE_HD_BATCH.LAST_UPDATED_DATE"/>
</bm:fields>
<bm:features>
<f:standard-who/>
</bm:features>
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
DECLARE
v_id NUMBER;
r_acr_invoice_hd_batch acr_invoice_hd_batch%rowtype;
BEGIN
SELECT acr_invoice_hd_batch_s.nextval INTO v_id FROM dual;
r_acr_invoice_hd_batch.batch_id :=v_id;
r_acr_invoice_hd_batch.creation_date :=sysdate;
r_acr_invoice_hd_batch.creation_by :=${/session/@user_id};
r_acr_invoice_hd_batch.last_updated_by :=${/session/@user_id};
r_acr_invoice_hd_batch.last_updated_date:=sysdate;
INSERT
INTO
acr_invoice_hd_batch VALUES r_acr_invoice_hd_batch;
FOR rec_invoice IN
(SELECT * FROM acr_invoice_hd t WHERE t.invoice_hd_id IN (${:@invoice_hd_ids}))
LOOP
UPDATE
acr_invoice_hd t
SET
t.batch_id=v_id
WHERE
t.invoice_hd_id=rec_invoice.invoice_hd_id;
END LOOP;
acr_invoice_pkg.acr_invoice_submit(p_batch_id =>v_id, p_user_id=>${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
$Revision: 1.0 $Revision: 1.0
$Purpose: $Purpose:
--> -->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm"> <bm:model xmlns:bm="http://www.aurora-framework.org/schema/bm">
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 下午04:16:32
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
su.user_id,
su.user_name,
su.description,
e.employee_id,
e.employee_code,
e.name,
su.user_name || '-' || su.description user_name_desc
FROM
sys_user su,
exp_employees e
#WHERE_CLAUSE#
order by su.user_name
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USER_ID"/>
<bm:field name="user_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="USER_NAME" prompt="用户编码" queryWidth="100"/>
<bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="DESCRIPTION" prompt="用户名称" queryWidth="100"/>
<bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID"/>
<bm:field name="employee_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="EMPLOYEE_CODE" prompt="员工编码" queryWidth="100"/>
<bm:field name="name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" physicalName="NAME" prompt="员工姓名" queryWidth="100"/>
<bm:field name="user_name_desc"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="employee_code" queryExpression="e.employee_code like ${@employee_code}"/>
<bm:query-field name="user_name" queryExpression="su.user_name like ${@user_name}"/>
<bm:query-field name="description" queryExpression="su.description like ${@description}"/>
<bm:query-field name="name" queryExpression="e.name like ${@name}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="su.employee_id=e.employee_id "/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 上午09:06:33
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.aurora-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM (SELECT t1.invoice_hd_id,
t1.document_number,
TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') AS invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
nvl(t1.contract_name,(select contract_name from con_contract
where contract_id =(select cf.contract_id
from con_contract_Cashflow cf,acr_invoice_ln ln
where ln.invoice_hd_id=t1.invoice_hd_id
and cf.cashflow_id=ln.cashflow_id
and rownum=1)
))contract_name, --modify by wuts 2019-1-22
--decode(t1.lease_channel,'01',t1.project_name,'') contract_name2,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.invoice_title,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
TO_CHAR(t1.accounting_date, 'yyyy-mm-dd') AS accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id
FROM acr_invoice_hd_v t1
ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE#
ORDER BY invoice_date DESC, document_number DESC
]]></bm:query-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.delete_invoice(p_invoice_hd_id => ${@invoice_hd_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE
acr_invoice_hd a
SET
a.merge_flag = ${@merge_flag}
WHERE
a.invoice_hd_id = ${@invoice_hd_id};
acr_invoice_pkg.invoice_row_merge(p_invoice_hd_id => ${@invoice_hd_id}, p_user_id => ${/session/@user_id}, p_merge_flag =>${@merge_flag});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<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="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="invoice_date_f" queryExpression="t1.invoice_date &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="t1.invoice_date &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="t1.accounting_date &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="t1.accounting_date &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_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_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-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status = &apos;NEW&apos;"/>
<bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
</bm:data-filters>
</bm:model>
...@@ -9,13 +9,22 @@ ...@@ -9,13 +9,22 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT t1.invoice_hd_id, SELECT *
FROM (SELECT t1.invoice_hd_id,
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,
t1.contract_id, t1.contract_id,
t1.contract_number, t1.contract_number,
t1.contract_name, nvl(t1.contract_name,(select contract_name from con_contract
where contract_id =(select cf.contract_id
from con_contract_Cashflow cf,acr_invoice_ln ln
where ln.invoice_hd_id=t1.invoice_hd_id
and cf.cashflow_id=ln.cashflow_id
and rownum=1)
))contract_name, --modify by wuts 2019-1-22
--decode(t1.lease_channel,'01',t1.project_name,'') contract_name2,
t1.project_id, t1.project_id,
t1.project_number, t1.project_number,
t1.project_name, t1.project_name,
...@@ -34,7 +43,7 @@ ...@@ -34,7 +43,7 @@
t1.document_type, t1.document_type,
t1.created_by_name, t1.created_by_name,
t1.created_by, t1.created_by,
to_char(t1.accounting_date, 'yyyy-mm-dd') as accounting_date, TO_CHAR(t1.accounting_date, 'yyyy-mm-dd') AS accounting_date,
t1.total_amount, t1.total_amount,
t1.tax_amount, t1.tax_amount,
t1.billing_method, t1.billing_method,
...@@ -42,11 +51,10 @@ ...@@ -42,11 +51,10 @@
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.bp_agent_name
FROM acr_invoice_hd_v t1 FROM acr_invoice_hd_v t1
#WHERE_CLAUSE# ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE#
ORDER BY t1.invoice_date desc , t1.document_number desc ORDER BY invoice_date DESC, document_number DESC
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
<bm:operation name="delete"> <bm:operation name="delete">
...@@ -57,13 +65,23 @@ ...@@ -57,13 +65,23 @@
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE
acr_invoice_hd a
SET
a.merge_flag = ${@merge_flag}
WHERE
a.invoice_hd_id = ${@invoice_hd_id};
acr_invoice_pkg.invoice_row_merge(p_invoice_hd_id => ${@invoice_hd_id}, p_user_id => ${/session/@user_id}, p_merge_flag =>${@merge_flag});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations> </bm:operations>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="bp_agent_name" queryExpression="t1.bp_agent_name like ${@bp_agent_name}"/>
<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}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &gt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/> <bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/> <bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="invoice_date_f" queryExpression="t1.invoice_date &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/> <bm:query-field name="invoice_date_f" queryExpression="t1.invoice_date &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
...@@ -79,9 +97,9 @@ ...@@ -79,9 +97,9 @@
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/> <bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/> <bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/> <bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_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_contract_number" queryExpression="t1.contract_number between nvl(${@contract_number_f}, t1.contract_number) and nvl(${@contract_number_t}, t1.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="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status = &apos;NEW&apos;"/> <bm:data-filter enforceOperations="query" expression="t1.invoice_status = &apos;NEW&apos;"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 上午09:06:33
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.invoice_hd_id,
t1.document_number,
to_char(t1.invoice_date, 'yyyy-mm-dd') as invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
t1.contract_name,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.invoice_title,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
to_char(t1.accounting_date, 'yyyy-mm-dd') as accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id,
t1.bp_agent_name
FROM acr_invoice_hd_v t1
#WHERE_CLAUSE#
ORDER BY t1.invoice_date desc , t1.document_number desc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.delete_invoice(p_invoice_hd_id => ${@invoice_hd_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="bp_agent_name" queryExpression="t1.bp_agent_name like ${@bp_agent_name}"/>
<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="contract_number_f" queryExpression="t1.contract_number &gt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="invoice_date_f" queryExpression="t1.invoice_date &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="t1.invoice_date &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="t1.accounting_date &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="t1.accounting_date &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_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="t1.contract_number between nvl(${@contract_number_f}, t1.contract_number) and nvl(${@contract_number_t}, t1.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-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status = &apos;NEW&apos;"/>
<bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
</bm:data-filters>
</bm:model>
...@@ -48,9 +48,7 @@ ...@@ -48,9 +48,7 @@
t1.confirmed_by_name, t1.confirmed_by_name,
t1.CREATE_JE_FLAG, t1.CREATE_JE_FLAG,
t1.vat_red_notice_num, t1.vat_red_notice_num,
to_char(sysdate,'yyyy-mm-dd') as reverse_date, to_char(sysdate,'yyyy-mm-dd') as reverse_date
t1.contract_number,
t1.bp_agent_name
FROM acr_invoice_hd_v t1 FROM acr_invoice_hd_v t1
#WHERE_CLAUSE# #WHERE_CLAUSE#
ORDER BY t1.invoice_date desc , t1.document_number desc ORDER BY t1.invoice_date desc , t1.document_number desc
...@@ -69,9 +67,6 @@ ...@@ -69,9 +67,6 @@
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="bp_agent_name" queryExpression="t1.bp_agent_name like ${@bp_agent_name}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &gt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<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}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/> <bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
...@@ -94,10 +89,8 @@ ...@@ -94,10 +89,8 @@
<bm:query-field name="received_flag" queryExpression="(nvl(t1.express_status,&apos;UNDELIVERED&apos;) !=&apos;RECEIVED&apos; or ${@received_flag}=&apos;Y&apos;)"/> <bm:query-field name="received_flag" queryExpression="(nvl(t1.express_status,&apos;UNDELIVERED&apos;) !=&apos;RECEIVED&apos; or ${@received_flag}=&apos;Y&apos;)"/>
<bm:query-field name="express_status" queryExpression="t1.express_status = ${@express_status}"/> <bm:query-field name="express_status" queryExpression="t1.express_status = ${@express_status}"/>
<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 con_contract cc where t1.contract_id = cc.contract_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="vat_red_notice_num" queryExpression="t1.vat_red_notice_num = ${@vat_red_notice_num}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.company_id = ${/session/@company_id}"/> <bm:data-filter enforceOperations="query" expression="t1.company_id = ${/session/@company_id}"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-18 上午09:32:02
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.invoice_hd_id,
t1.document_number,
TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') as invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
t1.contract_name,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.vat_interface_status,
t1.vat_interface_status_desc,
t1.invoice_title,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
to_char(t1.accounting_date, 'yyyy-mm-dd') as accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
t1.confirmed_by,
t1.confirmed_by_name,
t1.CREATE_JE_FLAG,
t1.vat_red_notice_num,
to_char(sysdate,'yyyy-mm-dd') as reverse_date,
t1.contract_number,
t1.bp_agent_name
FROM acr_invoice_hd_v t1
#WHERE_CLAUSE#
ORDER BY t1.invoice_date desc , t1.document_number desc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
acr_invoice_pkg.reverse_invoice(p_invoice_hd_id => ${@invoice_hd_id},
p_reverse_date => to_date(${@reverse_date},'yyyy-mm-dd'),
p_vat_red_notice_num => ${@vat_red_notice_num},
p_user_id => ${/session/@user_id},
p_role_id => ${/session/@role_id});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="bp_agent_name" queryExpression="t1.bp_agent_name like ${@bp_agent_name}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &gt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<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="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="invoice_date_f" queryExpression="t1.invoice_date &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="t1.invoice_date &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="t1.accounting_date &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="t1.accounting_date &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="invoice_status" queryExpression="t1.invoice_status = ${@invoice_status}"/>
<bm:query-field name="vat_interface_status" queryExpression="t1.vat_interface_status = ${@vat_interface_status}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/>
<bm:query-field name="received_flag" queryExpression="(nvl(t1.express_status,&apos;UNDELIVERED&apos;) !=&apos;RECEIVED&apos; or ${@received_flag}=&apos;Y&apos;)"/>
<bm:query-field name="express_status" queryExpression="t1.express_status = ${@express_status}"/>
<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_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="vat_red_notice_num" queryExpression="t1.vat_red_notice_num = ${@vat_red_notice_num}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.company_id = ${/session/@company_id}"/>
<bm:data-filter enforceOperations="query" expression="t1.reversed_flag = &apos;N&apos;"/>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status IN (&apos;CONFIRM&apos;, &apos;POST&apos;)"/>
</bm:data-filters>
</bm:model>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/> <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="acr_invoice_account_link" model="acr.ACR310.acr_invoice_account" modelaction="execute"/> <a:link id="acr_invoice_account_link" model="acr.ACR310.acr_invoice_account" modelaction="execute"/>
<script type="text/javascript"><![CDATA[ <script><![CDATA[
function open_document_win(ds_id, record_id) { function open_document_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id); var record = $(ds_id).findById(record_id);
var param = record.data; var param = record.data;
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() { window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var tax_type_rate = $('ACR310_QUERY__ds').getAt(0).get('tax_type_rate'); var tax_type_rate = $('ACR310_QUERY__ds').getAt(0).get('tax_type_rate');
var product_name = $('ACR310_QUERY__ds').getAt(0).get('product_name'); var product_name = $('ACR310_QUERY__ds').getAt(0).get('product_name');
var invoice_kind = $('ACR310_QUERY__ds').getAt(0).get('invoice_kind'); var invoice_kind = $('ACR310_QUERY__ds').getAt(0).get('invoice_kind');
...@@ -68,10 +67,6 @@ ...@@ -68,10 +67,6 @@
scope: this scope: this
}); });
}; };
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) {
//异步打印
ds.setQueryParameter('__async__', 'Y');
};
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view> </a:view>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-17 下午06:22:37
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
<a:view>
<a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="acr_invoice_account_link" model="acr.ACR310.acr_invoice_account" modelaction="execute"/>
<script type="text/javascript"><![CDATA[
function open_document_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'ACR513';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'UPDATE';
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'document_number' && value) {
return '<a href="javascript:open_document_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
return value;
};
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
$('ACR310_RESULT_acr_invoice_hd_layout_grid_id')._export('xls', '应收发票查询');
};
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var tax_type_rate = $('ACR310_QUERY__ds').getAt(0).get('tax_type_rate');
var product_name = $('ACR310_QUERY__ds').getAt(0).get('product_name');
var invoice_kind = $('ACR310_QUERY__ds').getAt(0).get('invoice_kind');
var vat_interface_status = $('ACR310_QUERY__ds').getAt(0).get('vat_interface_status');
var invoice_date_from = $('ACR310_QUERY__ds').getAt(0).get('invoice_date_from');
var invoice_date_to = $('ACR310_QUERY__ds').getAt(0).get('invoice_date_to');
Leaf.request({
url: $('acr_invoice_account_link').getUrl(),
para: {
tax_type_rate: tax_type_rate,
product_name: product_name,
invoice_kind: invoice_kind,
vat_interface_status: vat_interface_status,
invoice_date_from: invoice_date_from,
invoice_date_to: invoice_date_to
},
success: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('ACR310_STAT_acr_invoice_hd_detail_all_ds').query();
$('ACR310_RESULT_acr_invoice_hd_ds').query();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) {
//异步打印
ds.setQueryParameter('__async__', 'Y');
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-delete model="acr.ACR510.acr_invoice_selected_cashflow"/>
<!-- <batch-apply sourcepath="/parameter">
<batch-apply sourcepath="/@current_parameter/line_info">
<a:model-insert model="acr.ACR510.acr_invoice_selected_cashflow"/>
</batch-apply>
</batch-apply> -->
<batch-apply sourcepath="/parameter">
<a:model-insert model="acr.ACR510.acr_invoice_selected_cashflow"/>
</batch-apply>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
...@@ -313,7 +313,9 @@ ...@@ -313,7 +313,9 @@
<!--<a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>--> <!--<a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>-->
<a:column name="billing_way_desc" prompt="开票方式" width="80"/> <a:column name="billing_way_desc" prompt="开票方式" width="80"/>
<a:column name="invoice_kind_desc" prompt="ACR.INVOICE_KIND" width="100"/> <a:column name="invoice_kind_desc" prompt="ACR.INVOICE_KIND" width="100"/>
<!--
<a:column name="invoice_number" prompt="ACR.INVOICE_NUMBER" width="120"/> <a:column name="invoice_number" prompt="ACR.INVOICE_NUMBER" width="120"/>
-->
<a:column name="invoice_date" prompt="ACR.INVOICE_DATE" width="100"/> <a:column name="invoice_date" prompt="ACR.INVOICE_DATE" width="100"/>
<!-- <a:column name="project_name" autoAdjust="false" prompt="HLS.PROJECT_NAME" showTitle="true" width="150"/> --> <!-- <a:column name="project_name" autoAdjust="false" prompt="HLS.PROJECT_NAME" showTitle="true" width="150"/> -->
<!-- <a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/> --> <!-- <a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/> -->
......
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