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 @@
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
t1.spv_company_id,
<bm:query-sql><![CDATA[select t1.spv_company_id,
t1.company_id,
t1.project_id,
t1.project_number,
......@@ -17,27 +15,27 @@
t1.contract_status_desc,
t1.billing_method,
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_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_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_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_desc,t1.bill_object_bp_class_desc) bill_object_bp_class_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_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_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_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_desc,t1.bill_object_bp_class_desc) bill_object_bp_class_desc,
t1.tax_type_vat,
t1.description,
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_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_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_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,
t1.prj_search_term_1,
t1.prj_search_term_2,
t1.con_search_term_1,
t1.con_search_term_2,
t1.document_type,
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.cf_item,
t2.cf_item_desc,
......@@ -45,11 +43,11 @@
t2.last_received_date,
t2.due_date,
t2.due_amount,
t2.principal,
t2.interest,
decode(t1.lease_channel,'01',null,t2.principal) principal,
decode(t1.lease_channel,'01',null,t2.interest) interest,
t2.received_amount,
t2.received_principal,
t2.received_interest,
decode(t1.lease_channel,'01',null,t2.received_principal) received_principal,
decode(t1.lease_channel,'01',null,t2.received_interest) received_interest,
t2.billing_amount,
t2.billing_principal,
t2.billing_interest,
......@@ -68,17 +66,12 @@
t2.exchange_rate_quotation_desc,
t2.overdue_status,
t2.overdue_max_days,
t1.lease_channel_desc,
t1.business_type_desc
FROM
acr_invoice_contract_v t1,
ACR_INVOICE_CONTRACT_CF_V t2 #WHERE_CLAUSE#
ORDER BY
t1.contract_id,
t2.times,
t2.due_date,
t2.cf_item
t1.bp_id_agent_level1,
t1.termination_date,
t1.lease_channel
from acr_invoice_contract_v t1, ACR_INVOICE_CONTRACT_CF_V t2
#WHERE_CLAUSE#
ORDER BY t1.contract_id,t2.times,t2.due_date,t2.cf_item
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......@@ -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="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="lease_channel_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL_DESC"/>
<bm:field name="business_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_DESC"/>
<bm:field name="bp_id_agent_level1"/>
<bm:field name="termination_date"/>
<bm:field name="lease_channel"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="cf_item" queryExpression="t2.cf_item = ${@cf_item}"/>
......@@ -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="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="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="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="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:data-filters>
<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="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="trunc(t2.due_date) &lt;= trunc(sysdate)"/> -->
<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="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="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: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.spv_company_id,
t1.company_id,
t1.project_id,
t1.project_number,
t1.project_name,
t1.contract_id,
t1.contract_number,
t1.contract_name,
t1.inception_of_lease,
t1.contract_status,
t1.contract_status_desc,
t1.billing_method,
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_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_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_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_desc,t1.bill_object_bp_class_desc) bill_object_bp_class_desc,
t1.tax_type_vat,
t1.description,
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_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,
t1.prj_search_term_1,
t1.prj_search_term_2,
t1.con_search_term_1,
t1.con_search_term_2,
t1.document_type,
t1.bp_name,
DECODE(t2.cf_item,'912',t1.inv_invoice_type_desc,t1.invoice_type_desc) invoice_type_desc,
t2.cashflow_id,
t2.cf_item,
t2.cf_item_desc,
t2.times,
t2.last_received_date,
t2.due_date,
t2.due_amount,
t2.principal,
t2.interest,
t2.received_amount,
t2.received_principal,
t2.received_interest,
t2.billing_amount,
t2.billing_principal,
t2.billing_interest,
t2.vat_due_amount,
t2.vat_principal,
t2.vat_interest,
t2.net_due_amount,
t2.net_principal,
t2.net_interest,
t2.currency,
t2.currency_desc,
t2.exchange_rate,
t2.exchange_rate_type,
t2.exchange_rate_type_desc,
t2.exchange_rate_quotation,
t2.exchange_rate_quotation_desc,
t2.overdue_status,
t2.overdue_max_days,
t1.lease_channel_desc,
t1.business_type_desc
FROM
acr_invoice_contract_v t1,
ACR_INVOICE_CONTRACT_CF_V t2 #WHERE_CLAUSE#
ORDER BY
t1.contract_id,
t2.times,
t2.due_date,
t2.cf_item
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="spv_company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SPV_COMPANY_ID"/>
<bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" required="true"/>
<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"/>
<bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" required="true"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER"/>
<bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME"/>
<bm:field name="inception_of_lease" databaseType="DATE" datatype="java.util.Date" physicalName="INCEPTION_OF_LEASE"/>
<bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS" required="true"/>
<bm:field name="contract_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS_DESC"/>
<bm:field name="billing_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD"/>
<bm:field name="billing_method_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD_DESC"/>
<bm:field name="billing_object_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BILLING_OBJECT_ID"/>
<bm:field name="billing_object_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_OBJECT_CODE"/>
<bm:field name="billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_OBJECT_NAME"/>
<bm:field name="object_taxpayer_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OBJECT_TAXPAYER_TYPE"/>
<bm:field name="object_taxpayer_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OBJECT_TAXPAYER_TYPE_DESC"/>
<bm:field name="object_tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OBJECT_TAX_REGISTRY_NUM"/>
<bm:field name="bill_object_bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILL_OBJECT_BP_CLASS"/>
<bm:field name="bill_object_bp_class_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILL_OBJECT_BP_CLASS_DESC"/>
<bm:field name="tax_type_vat" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_TYPE_VAT"/>
<bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
<bm:field name="invoice_title" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TITLE"/>
<bm:field name="invoice_bp_address_phone_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_ADDRESS_PHONE_NUM"/>
<bm:field name="invoice_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_BANK_ACCOUNT"/>
<bm:field name="tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_REGISTRY_NUM"/>
<bm:field name="prj_search_term_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRJ_SEARCH_TERM_1"/>
<bm:field name="prj_search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRJ_SEARCH_TERM_2"/>
<bm:field name="con_search_term_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_SEARCH_TERM_1"/>
<bm:field name="con_search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CON_SEARCH_TERM_2"/>
<bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" required="true"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME"/>
<bm:field name="invoice_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TYPE_DESC"/>
<bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID" required="true"/>
<bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" required="true"/>
<bm:field name="cf_item_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_ITEM_DESC"/>
<bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES" required="true"/>
<bm:field name="last_received_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_RECEIVED_DATE"/>
<bm:field name="due_date" databaseType="DATE" datatype="java.util.Date" physicalName="DUE_DATE"/>
<bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT"/>
<bm:field name="principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRINCIPAL"/>
<bm:field name="interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="INTEREST"/>
<bm:field name="received_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_AMOUNT"/>
<bm:field name="received_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_PRINCIPAL"/>
<bm:field name="received_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_INTEREST"/>
<bm:field name="billing_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BILLING_AMOUNT"/>
<bm:field name="billing_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BILLING_PRINCIPAL"/>
<bm:field name="billing_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BILLING_INTEREST"/>
<bm:field name="vat_due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_DUE_AMOUNT"/>
<bm:field name="vat_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_PRINCIPAL"/>
<bm:field name="vat_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_INTEREST"/>
<bm:field name="net_due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_DUE_AMOUNT"/>
<bm:field name="net_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_PRINCIPAL"/>
<bm:field name="net_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_INTEREST"/>
<bm:field name="currency" databaseType="CHAR" datatype="java.lang.String" physicalName="CURRENCY"/>
<bm:field name="currency_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_DESC"/>
<bm:field name="exchange_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EXCHANGE_RATE"/>
<bm:field name="exchange_rate_type" databaseType="CHAR" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE"/>
<bm:field name="exchange_rate_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE_DESC"/>
<bm:field name="exchange_rate_quotation" databaseType="CHAR" datatype="java.lang.String" physicalName="EXCHANGE_RATE_QUOTATION"/>
<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_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="business_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_DESC"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="cf_item" queryExpression="t2.cf_item = ${@cf_item}"/>
<bm:query-field name="due_date_from" queryExpression="t2.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;)"/>
<bm:query-field name="overdue_max_days_from" queryExpression="t2.overdue_max_days &gt;= ${@overdue_max_days_from}"/>
<bm:query-field name="overdue_max_days_to" queryExpression="t2.overdue_max_days &lt;= ${@overdue_max_days_to}"/>
<bm:query-field field="overdue_status" queryExpression="t2.overdue_status=${@overdue_status} and t2.write_off_flag != &apos;FULL&apos;"/>
<bm:query-field field="bill_object_bp_class" queryOperator="="/>
<bm:query-field name="invoice_type_desc" queryExpression="decode(t2.cf_item,&apos;912&apos;,t1.inv_invoice_type_desc,t1.invoice_type_desc) like ${@invoice_type_desc}"/>
<bm:query-field name="invoice_title" queryExpression="decode(t2.cf_item,&apos;912&apos;,t1.inv_invoice_title,t1.invoice_title) like ${@invoice_title}"/>
<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" queryExpression="t1.contract_number like ${@contract_number}"/>
<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}"/>
<bm:query-field name="lease_start_date_from" queryExpression="t1.inception_of_lease &gt;= to_date(${@lease_start_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="lease_start_date_to" queryExpression="t1.inception_of_lease &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="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; "/>
<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_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="contract_status" queryExpression="t1.contract_status = ${@contract_status}"/>
</bm:query-fields>
<bm:data-filters>
<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="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="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.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="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:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: DJ
$Date: 2013-7-4 下午5:06:06
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="record_id"/>
<bm:field name="cashflow_id"/>
<bm:field name="product_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCT_NAME"
prompt="ACR.PRODUCT_NAME"/>
<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_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME"
prompt="HLS.PROJECT_NAME"/>
<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_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME"
prompt="HLS.CONTRACT_NAME"/>
<bm:field name="invoice_kind" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND"/>
<bm:field name="invoice_kind_desc" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="INVOICE_KIND_DESC" prompt="ACR.INVOICE_TYPE"/>
<bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT"
prompt="ACR.DUE_AMOUNT"/>
<bm:field name="cf_billing_amount" databaseType="NUMBER" datatype="java.lang.Double"
physicalName="CF_BILLING_AMOUNT" prompt="ACR.BILLING_AMOUNT"/>
<bm:field name="received_amount" databaseType="NUMBER" datatype="java.lang.Double"
physicalName="RECEIVED_AMOUNT" prompt="ACR.RECEIVED_AMOUNT"/>
<bm:field name="billing_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BILLING_AMOUNT"
prompt="ACR.THIS_BILLING_AMOUNT"/>
<bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES"
prompt="HLS.PERIOD_NUMBER"/>
<bm:field name="last_received_date" databaseType="DATE" datatype="java.util.Date"
physicalName="LAST_RECEIVED_DATE" prompt="ACR.RECEIVED_DATE"/>
<bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM"
prompt="HLS.RECEIVE_PROJECT"/>
<bm:field name="cf_item_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_ITEM_DESC"
prompt="HLS.RECEIVE_PROJECT"/>
<bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY"
prompt="HLS.CURRENCY"/>
<bm:field name="currency_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_DESC"
prompt="HLS.CURRENCY"/>
<bm:field name="exchange_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EXCHANGE_RATE"
prompt="HLS.EXCHANGE_RATE"/>
<bm:field name="exchange_rate_type" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="EXCHANGE_RATE_TYPE" prompt="HLS.EXCHANGE_RATE_TYPE"/>
<bm:field name="exchange_rate_type_desc" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="EXCHANGE_RATE_TYPE_DESC" prompt="HLS.EXCHANGE_RATE_TYPE_DESC"/>
<bm:field name="invoice_bp_tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="billing_method" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="billing_way_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="billing_frequency_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="invoice_title" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="object_taxpayer_type" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="invoice_bp_address_phone_num" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="invoice_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t.cashflow_id,
t.bp_name,--承租人姓名
con.billing_method,--开票规则
con.billing_way_n,--开票方式
con.billing_frequency_n,--开票频率
aic.billing_object_name,--开票对象
t.invoice_title,--发票抬头
aic.object_taxpayer_type,--纳税人类型
t.invoice_bp_address_phone_num,--开票地址电话
t.invoice_bp_bank_account,--开户行及账号
t.record_id,
t.billing_object,
(select c.code_value_name
from sys_code_values_v c
where c.code = 'ACR510_BILL_DETAIL_METHOD'
and c.code_value = t.billing_object) as billing_object_desc,
t.due_amount,
t.billing_amount,
t.cf_billing_amount,
t.received_amount,
t.contract_id,
con.contract_number,
con.contract_name,
con.project_id,
con.project_number,
con.project_name,
t.invoice_kind,
(select v.code_value_name
from sys_code_values_v v
where v.code = 'ACR510_INVOICE_KIND'
and v.code_value = t.invoice_kind) as invoice_kind_desc,
t.currency,
(select c.currency_name
from gld_currency_vl c
where c.currency_code = t.currency) as currency_desc,
1 as exchange_rate,
'MANUAL' as exchange_rate_type,
(select v.rate_type_desc
from gld_exchange_rate_type_v v
where v.rate_type_code = 'MANUAL') as exchange_rate_type_desc,
cf.times,
cf.last_received_date,
t.cf_item,
(select i.description
from hls_cashflow_item i
where i.cf_item = t.cf_item) as cf_item_desc,
CASE
WHEN con.division = '10' THEN
(SELECT ci.oem_type
FROM con_contract_lease_item ci
WHERE ci.contract_id = con.contract_id
AND ci.equipment_type = 'MAIN')|| nvl((SELECT ci.billing_desc
FROM con_contract_cf_item ci
WHERE ci.contract_id = con.contract_id
AND ci.cf_item = t.cf_item),
(SELECT iv.billing_desc
FROM hls_cashflow_item_company_v iv
WHERE iv.cf_item = t.cf_item
AND iv.company_id = con.company_id))
ELSE
CASE
WHEN t.cf_item IN (2,
3,
8,
9,
304,
100,
101) THEN
(SELECT decode(con.division,
'00',
'挖掘机',
'01',
'装载机') || nvl((SELECT ci.billing_desc
FROM con_contract_cf_item ci
WHERE ci.contract_id = con.contract_id
AND ci.cf_item = t.cf_item),
(SELECT iv.billing_desc
FROM hls_cashflow_item_company_v iv
WHERE iv.cf_item = t.cf_item
AND iv.company_id = con.company_id))
FROM dual)
ELSE
nvl((SELECT ci.billing_desc
FROM con_contract_cf_item ci
WHERE ci.contract_id = con.contract_id
AND ci.cf_item = t.cf_item),
(SELECT iv.billing_desc
FROM hls_cashflow_item_company_v iv
WHERE iv.cf_item = t.cf_item
AND iv.company_id = con.company_id))
END
END AS product_name,
t.invoice_bp_tax_registry_num
from acr_invoice_create_tmp t,
con_contract_v con,
con_contract_cashflow_all_v cf,
acr_invoice_contract_v aic
where t.session_id = ${/session/@session_id}
and t.contract_id = con.contract_id
and t.cashflow_id = cf.cashflow_id
and con.contract_id = aic.contract_id
order by con.contract_id,cf.times,t.cf_item
]]>
</bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.invoiceTmp_update(p_record_id => ${@record_id},
p_invoice_kind => ${@invoice_kind},
p_billing_amount => ${@billing_amount},
p_product_name => ${@product_name},
p_user_id => ${/session/@user_id});
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.create_invoice(p_session_id => ${/session/@session_id},
p_company_id => ${@company_id},
p_group_billing_method => ${@group_billing_method},
p_invoice_date => to_date(${@invoice_date},'yyyy-mm-dd'),
p_accounting_date => to_date(${@accounting_date},'yyyy-mm-dd'),
p_user_id => ${/session/@user_id},
p_role_id => ${/session/@role_id});
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
</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 @@
$Revision: 1.0
$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:operation name="query">
<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 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.invoice_hd_id,
SELECT *
FROM (SELECT t1.invoice_hd_id,
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.contract_id,
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_number,
t1.project_name,
......@@ -34,7 +43,7 @@
t1.document_type,
t1.created_by_name,
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.tax_amount,
t1.billing_method,
......@@ -42,11 +51,10 @@
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id,
t1.bp_agent_name
t1.spv_company_id
FROM acr_invoice_hd_v t1
#WHERE_CLAUSE#
ORDER BY t1.invoice_date desc , t1.document_number desc
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">
......@@ -57,13 +65,23 @@
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="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;)"/>
......@@ -79,9 +97,9 @@
<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_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;"/>
......
<?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 @@
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
to_char(sysdate,'yyyy-mm-dd') as reverse_date
FROM acr_invoice_hd_v t1
#WHERE_CLAUSE#
ORDER BY t1.invoice_date desc , t1.document_number desc
......@@ -69,9 +67,6 @@
</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}"/>
......@@ -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="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_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="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}"/>
......
<?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 @@
<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[
<script><![CDATA[
function open_document_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
......@@ -37,7 +37,6 @@
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');
......@@ -68,10 +67,6 @@
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>
......
<?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"?>
<!--
&author:DJ
$date:2013/05/08
$purpose:发票创建
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
<a:model-query model="basic.sys_session_info" rootPath="default_value_record"/>
<!-- <a:model-query model="acr.ACR510.acr_invoice_group_billing_method" rootPath="group_billing_method_list"/>-->
</a:init-procedure>
<a:view>
<a:link id="svcLink_create_invoice" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_create.lsc"/>
<!-- <a:screen-include screen="modules/hls/hls_common_javascript.lview"/>-->
<script type="text/javascript"><![CDATA[
function createScreen_close() {
var win = $('acr_invoice_create_invoice');
win.close();
}
function createScreen_create() {
var win = $('acr_invoice_create_invoice');
winMask(win);
var ds = $('headDs');
if (!ds.validate(true)) {
f_hls.winNoMask(win);
return;
}
debugger
var datas = ds.getJsonData();
winNoMask(win);
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认开票?', function () {
winMask(win);
Leaf.request({
url: $('svcLink_create_invoice').getUrl(),
para: datas,
success: function (res) {
winNoMask(win);
createScreen_close();
contractDs_grid_query();
},
failure: function () {
winNoMask(win);
},
error: function () {
winNoMask(win);
},
scope: this
});
}, function () {
winNoMask(win);
});
}
function unSelect_selectedDs(ds, record) {
record.dirty = false;
}
function onSelect_selectedDs(ds, record) {
record.dirty = true;
}
function onLoad_selectedDs(ds) {
ds.selectAll.defer(5, ds);
var records = ds.getAll();
for (var i = 0; i < records.length; i++) {
if ( records[i].get('cf_item') && records[i].get('cf_item') == '51') {
records[i].set('product_name', '保证金');
records[i].set('invoice_kind', 'RECEIPT');
records[i].set('invoice_kind_desc', '收据');
}
}
}
function winNoMask() {
Leaf.Masker.unmask(Ext.getBody());
}
function winMask() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
]]></script>
<style><![CDATA[
.item-radio-option {
margin-right: 50px;
}
]]></style>
<a:dataSets>
<a:dataSet id="invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>
<a:dataSet id="headDs" autoCreate="true">
<a:fields>
<a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
<a:field name="group_billing_method" defaultValue="GROUP_BY_CONTRACT"/>
<a:field name="accounting_date" defaultValue="${/model/default_value_record/record/@today}"
required="true"/>
<a:field name="invoice_date" defaultValue="${/model/default_value_record/record/@today}"
required="true"/>
</a:fields>
</a:dataSet>
<a:dataSet id="selectedDs" autoQuery="true" bindName="line_info" bindTarget="headDs" fetchAll="true"
model="acr.ACR510.acr_invoice_create" selectable="true">
<a:fields>
<a:field name="product_name" lovGridHeight="360" lovHeight="540" lovService="acr.ACR510.acr_invoice_create_lov" lovWidth="680" required="true" title="货物及应税劳务名称">
<a:mapping>
<a:map from="code_value_name" to="product_name"/>
</a:mapping>
</a:field>
<a:field name="billing_amount" required="true"/>
<a:field name="invoice_kind"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="invoiceKindDs"
required="true" returnField="invoice_kind" valueField="code_value"/>
<a:field name="billing_object"/>
<a:field name="invoice_bp_tax_registry_num" prompt="纳税人识别号"/>
</a:fields>
<a:events>
<a:event name="load" handler="onLoad_selectedDs"/>
<a:event name="select" handler="onSelect_selectedDs"/>
<a:event name="unselect" handler="unSelect_selectedDs"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton click="createScreen_close" text="HLS.CLOSE"/>
<a:gridButton click="createScreen_create" text="HLS.CREATE"/>
</a:screenTopToolbar>
<a:form column="3">
<a:datePicker name="invoice_date" bindTarget="headDs" prompt="ACR.INVOICE_DATE"/>
<a:datePicker name="accounting_date" bindTarget="headDs" prompt="HLS.ACCOUNT_DATE"/>
</a:form>
<a:tabPanel marginHeight="220" marginWidth="30">
<a:tabs>
<a:tab prompt="ACR510.TAB.BILLING_INFO" width="100">
<a:grid id="selectedDs_grid" bindTarget="selectedDs" marginHeight="270" marginWidth="60">
<a:columns>
<a:column name="contract_number" lock="true" width="150" prompt="合同编号" readOnly="true"/>
<a:column name="contract_name" lock="true" width="150" prompt="合同名称" readOnly="true"/>
<a:column name="bp_name" prompt="承租人名称" readOnly="true"/>
<a:column name="times" align="right" lock="true" width="40" prompt="期数" readOnly="true"/>
<a:column name="cf_item_desc" prompt="应收项目" readOnly="true"/>
<a:column name="product_name" width="150" prompt="货物及应税劳务名称" editor="acr_invoice_create_lov"/>
<a:column name="invoice_kind_desc" prompt="发票类型" editor="selectedDs_grid_editor_comb"/>
<a:column name="currency" prompt="币种" readOnly="true"/>
<a:column name="due_amount" align="right" renderer="Leaf.formatMoney" prompt="应收金额" readOnly="true"/>
<a:column name="received_amount" align="right" renderer="Leaf.formatMoney" prompt="已收金额" readOnly="true"/>
<a:column name="cf_billing_amount" align="right" renderer="Leaf.formatMoney" prompt="已开票金额" readOnly="true"/>
<a:column name="billing_amount" align="right" prompt="本次开票金额" renderer="Leaf.formatMoney"
editor="selectedDs_grid_editor_tf"/>
</a:columns>
<a:editors>
<a:comboBox id="selectedDs_grid_editor_comb"/>
<a:textField id="selectedDs_grid_editor_tf"/>
<a:lov id="acr_invoice_create_lov"/>
</a:editors>
</a:grid>
</a:tab>
<a:tab prompt="ACR510.TAB.ASSIST_INFO" width="100">
<a:grid id="selectedDs_grid_2" bindTarget="selectedDs" marginHeight="270" marginWidth="60">
<a:columns>
<a:column name="contract_number" lock="true" width="150" prompt="合同编号" readOnly="true"/>
<a:column name="contract_name" lock="true" width="150" prompt="合同名称" readOnly="true"/>
<a:column name="bp_name" prompt="承租人名称" readOnly="true"/>
<a:column name="times" align="right" lock="true" width="40" prompt="期数" readOnly="true"/>
<a:column name="billing_method" prompt="开票规则" readOnly="true"/>
<a:column name="billing_way_n" prompt="开票方式" width="80" readOnly="true"/>
<a:column name="billing_frequency_n" prompt="开票频率" width="80" readOnly="true"/>
<a:column name="billing_object_name" prompt="开票对象" autoAdjust="false"
showTitle="true" width="200" readOnly="true"/>
<a:column name="invoice_title" prompt="发票抬头" autoAdjust="false" editor=""
showTitle="true" width="200" readOnly="true"/>
<a:column name="object_taxpayer_type" prompt="纳税人类型" readOnly="true"/>
<a:column name="invoice_bp_tax_registry_num" prompt="纳税人识别号" width="150" readOnly="true"/>
<a:column name="invoice_bp_address_phone_num" prompt="开票地址电话" autoAdjust="false"
showTitle="true" width="200" readOnly="true"/>
<a:column name="invoice_bp_bank_account" prompt="开户行及账号" autoAdjust="false"
showTitle="true" width="150" readOnly="true"/>
</a:columns>
</a:grid>
</a:tab>
</a:tabs>
</a:tabPanel>
<!-- <a:fieldSet title="ACR.GROUP_BILLING_METHOD">-->
<!-- <a:radio name="group_billing_method" bindTarget="headDs" labelField="code_value_name"-->
<!-- options="/model/group_billing_method_list" prompt="" radioSeparator="" valueField="code_value"-->
<!-- width="600"/>-->
<!-- </a:fieldSet>-->
</a:screenBody>
</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>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.document_category=&apos;CONTRACT&apos;" fetchAll="true"
model="basic.hls_document_type_for_lov" rootPath="con501_document_type_path"/>
<a:model-query defaultWhereClause="document_category=&apos;CONTRACT&apos;" fetchAll="true"
model="basic.hls_document_type_v_lov" rootPath="contract_type_list"/>
<a:model-query defaultWhereClause="t1.enabled_flag = &apos;Y&apos;" model="prj.PRJ505.con_billing_method"
rootPath="billing_method_list"/>
<a:model-query fetchAll="true" model="basic.hls_lease_channel_for_lov" rootPath="acr510_lease_list"/>
<a:model-query fetchAll="true" defaultWhereClause="t1.business_type in ('LEASE','LEASEBACK')" model="basic.hls_business_type_for_lov" rootPath="acr510_business_list"/>
</a:init-procedure>
<a:view>
<!-- <a:screen-include screen="${/request/@context_path}/modules/hls/hls_common_javascript.lview"/>-->
<a:link id="pageLink_select_cashflow"
url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_select_cashflow.lview"/>
<!-- <a:link id="pageLink_conditionScreen_welcome" url="${/request/@context_path}/welcome.lview"/> -->
<a:link id="pageLink_invoice_create"
url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_create_invoice.lview"/>
<a:link id="svcLink_save_selected"
url="${/request/@context_path}/modules/acr/ACR510N/acr_invoice_save_selected_n.lsc"/>
<script type="text/javascript"><![CDATA[
//校验函数,开票头信息不能为空。
function validate_contractDs(record, name, value) {
if (name == 'object_tax_registry_num' || name == 'invoice_bp_address_phone_num' || name == 'invoice_bp_bank_account' || name == 'invoice_title') {
if (Ext.isEmpty(value)) {
if (record.get('bill_object_bp_class') == 'NP' || record.get('small_scale_taxpayer') != 'Y' || record.get('tax_type_vat') != 'Y') {
if (record.get('bill_object_bp_class') == 'ORG') {
if (name == 'object_tax_registry_num' || name == 'invoice_title')
return '必输字段不能为空!';
}
return true;
} else {
return '必输字段不能为空!';
}
}
return true;
}
return true;
}
function render_contractDs_grid(value, record, name) {
if (name == 'billing_object_name') {
record.getField('billing_object_name').setLovPara('contract_id', record.get('contract_id'));
}
return value;
}
function contractDs_grid_query() {
$('condition_queryForm').close();
$('ar510n_cashflow_ds').query();
}
function contractDs_grid_add() {
$('contractDs_grid').showEditorByRecord($('ar510n_cashflow_ds').create());
}
function invoiceHd_close() {
$('acr_invoice_select_cashflow').close();
}
function contractDs_grid_clear() {
$('contractDs_grid').clear();
}
function allConditionDs_reset() {
$('allConditionDs').reset();
}
function cashflowDs_grid_clear() {
$('cashflowDs_grid').clear();
}
function winOpen_invoice_create() {
var final_bill_flag = $('allConditionDs').getAt(0).get('final_bill_flag');
var group_billing_method;
if (final_bill_flag == 'Y') {
group_billing_method = 'GROUP_BY_CONTRACT';
} else {
group_billing_method = 'GROUP_BY_TIMES';
}
var win = new Leaf.Window({
id: 'acr_invoice_create_invoice',
url: $('pageLink_invoice_create').getUrl(),
params: {
company_id: '${/session/@company_id}',
group_billing_method: group_billing_method
},
title: '${l:ACR510.WIN_TITLE.CREATE}',
fullScreen: true
});
win.on('close', function () {
contractDs_grid_query();
});
}
function invoiceHd_confirm() {
winMask();
var final_bill_flag = $('allConditionDs').getAt(0).get('final_bill_flag');
var cat_ini_flag = $('allConditionDs').getAt(0).get('cat_ini_flag');
var ds = $('ar510n_cashflow_ds');
if (!ds.validate(true)) {
winNoMask();
return;
}
if (ds.getSelected().length == 0) {
winNoMask();
return;
}
var datas = ds.getJsonData(true);
for (var i = 0; i < datas.length; i++) {
datas[i].final_bill_flag = final_bill_flag;
datas[i].cat_ini_flag = cat_ini_flag;
}
Leaf.request({
url: $('svcLink_save_selected').getUrl(),
para: datas,
success: function (res) {
winNoMask();
winOpen_invoice_create();
},
failure: function () {
winNoMask();
},
error: function () {
winNoMask();
},
scope: this
});
}
function acr510n_query_update(ds, record, name, value, oldvalue) {
if (name == 'times_bill_flag' || name == 'mid_bill_flag' || name == 'final_bill_flag' || name == 'et_bill_flag') {
var times_bill_flag = record.get('times_bill_flag');
var mid_bill_flag = record.get('mid_bill_flag');
var final_bill_flag = record.get('final_bill_flag');
var et_bill_flag = record.get('et_bill_flag');
if (times_bill_flag || mid_bill_flag || final_bill_flag || et_bill_flag) {
record.set('bill_flag', 'Y');
} else {
record.set('bill_flag', null);
}
}
if (name == 'times_bill_flag' || name == 'mid_bill_flag' || name == 'final_bill_flag' || name == 'et_bill_flag') {
contractDs_grid_query();
}
}
function acr510n_excel() {
$('contractDs_grid_forexport')._export('xls', 'excel_report');
}
function winNoMask() {
Leaf.Masker.unmask(Ext.getBody());
}
function winMask() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
]]></script>
<a:dataSets>
<a:dataSet id="acr510_document_type_name_ds">
<a:datas dataSource="/model/con501_document_type_path"/>
</a:dataSet>
<a:dataSet id="contractTypeDs">
<a:datas dataSource="/model/contract_type_list"/>
</a:dataSet>
<a:dataSet id="billingMethodDs">
<a:datas dataSource="/model/billing_method_list"/>
</a:dataSet>
<a:dataSet id="acr515_lease_channel_ds">
<a:datas dataSource="/model/acr510_lease_list"/>
</a:dataSet>
<a:dataSet id="acr515_business_type_ds">
<a:datas dataSource="/model/acr510_business_list"/>
</a:dataSet>
<a:dataSet id="division_name_ds" loadData="true" model="basic.hls_division_for_lov"/>
<a:dataSet id="billing_frequency_name_ds" lookupCode="DS_INVOICE_FREQUENCY"/>
<a:dataSet id="billing_way_ds" lookupCode="DS_INVOICE_CATEGORY"/>
<a:dataSet id="bp_class_desc_ds" lookupCode="HLS211_BP_CLASS"/>
<a:dataSet id="con_contract_desc_ds" lookupCode="CON390_CONTRACT_STATUS"/>
<a:dataSet id="allConditionDs" autoCreate="true">
<a:fields>
<a:field name="billing_way_n" displayField="code_value_name" options="billing_way_ds" returnField="billing_way" valueField="code_value"/>
<a:field name="bill_object_bp_class_desc" displayField="code_value_name" options="bp_class_desc_ds" returnField="bill_object_bp_class" valueField="code_value"/>
<a:field name="contract_status_desc" displayField="code_value_name" options="con_contract_desc_ds" returnField="contract_status" valueField="code_value"/>
<a:field name="lease_channel_desc" displayField="description" options="acr515_lease_channel_ds"
returnField="lease_channel" valueField="lease_channel"/>
<a:field name="business_type_desc" displayField="description" options="acr515_business_type_ds"
returnField="business_type" valueField="business_type"/>
<a:field name="residue_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="cat_ini_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="project_number_from" lovGridHeight="300" lovHeight="450"
lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500"
title="ACR510.FIELD.PROJECT_NUMBER_FROM">
<a:mapping>
<a:map from="project_number" to="project_number_from"/>
<a:map from="project_name" to="project_name_from"/>
</a:mapping>
</a:field>
<a:field name="project_number_to" lovGridHeight="300" lovHeight="450"
lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500"
title="ACR510.FIELD.PROJECT_NUMBER_TO">
<a:mapping>
<a:map from="project_number" to="project_number_to"/>
<a:map from="project_name" to="project_name_to"/>
</a:mapping>
</a:field>
<a:field name="project_name_from" readOnly="true"/>
<a:field name="project_name_to" readOnly="true"/>
<a:field name="contract_number_from" lovGridHeight="300" lovHeight="500"
lovService="basic.con_contract_for_lov" lovWidth="800"
title="ACR510.FIELD.CONTRACT_NUMBER_FROM">
<a:mapping>
<a:map from="contract_number" to="contract_number_from"/>
<a:map from="contract_name" to="contract_name_from"/>
</a:mapping>
</a:field>
<a:field name="contract_number" lovGridHeight="300" lovHeight="500"
lovService="basic.con_contract_for_lov" lovWidth="800"
title="ACR510.FIELD.CONTRACT_NUMBER_TO">
<a:mapping>
<a:map from="contract_number" to="contract_number"/>
<a:map from="contract_number" to="contract_number"/>
</a:mapping>
</a:field>
<a:field name="contract_name_from" readOnly="true"/>
<a:field name="contract_name_to" readOnly="true"/>
<a:field name="bp_code_tenant_from" lovGridHeight="300" lovHeight="450" lovLabelWidth="100"
lovService="basic.hls_bp_master_v_for_lov" lovWidth="600"
title="ACR510.FIELD.BP_CODE_TENANT_FROM">
<a:mapping>
<a:map from="bp_code" to="bp_code_tenant_from"/>
<a:map from="bp_name" to="bp_name_tenant_from"/>
</a:mapping>
</a:field>
<a:field name="bp_code_tenant_to" lovGridHeight="300" lovHeight="450" lovLabelWidth="100"
lovService="basic.hls_bp_master_v_for_lov" lovWidth="600"
title="ACR510.FIELD.BP_CODE_TENANT_TO">
<a:mapping>
<a:map from="bp_code" to="bp_code_tenant_to"/>
<a:map from="bp_name" to="bp_name_tenant_to"/>
</a:mapping>
</a:field>
<a:field name="bp_name_tenant_from" readOnly="true"/>
<a:field name="bp_name_tenant_to" readOnly="true"/>
<a:field name="inception_of_lease_from"/>
<a:field name="inception_of_lease_to"/>
<a:field name="last_received_date_from"/>
<a:field name="last_received_date_to"/>
<a:field name="termination_date_from"/>
<a:field name="termination_date_to"/>
<a:field name="document_type"/>
<a:field name="document_type_desc" displayField="document_type_desc" options="contractTypeDs">
<a:mapping>
<a:map from="document_type" to="document_type"/>
<a:map from="document_type_desc" to="document_type_desc"/>
</a:mapping>
</a:field>
<a:field name="cf_item"/>
<a:field name="cf_item_desc" lovGridHeight="300" lovHeight="500"
lovService="hls.HLS005.hls_cashflow_item_v_lov" lovWidth="850"
title="ACR510.ACR_INVOICE_CONTRACT_CF_V.CF_ITEM_DESC">
<a:mapping>
<a:map from="cf_item" to="cf_item"/>
<a:map from="cf_item_desc" to="cf_item_desc"/>
</a:mapping>
</a:field>
<a:field name="billing_method"/>
<a:field name="billing_method_desc" displayField="description" options="billingMethodDs"
returnField="billing_method" valueField="billing_method"/>
<a:field name="document_type_desc"/>
<a:field name="lease_start_date_from"/>
<a:field name="lease_start_date_to"/>
<a:field name="contract_name"/>
<a:field name="project_name"/>
<a:field name="bp_name"/>
<a:field name="prj_search_term_1"/>
<a:field name="con_search_term_1"/>
<a:field name="prj_search_term_2"/>
<a:field name="con_search_term_2"/>
<a:field name="part_bill_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="document_type_desc" displayField="description" options="acr510_document_type_name_ds"
returnField="document_type" valueField="document_type"/>
<a:field name="final_bill_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="division_desc" displayField="description" options="division_name_ds"
returnField="division" valueField="division"/>
<a:field name="billing_frequency"/>
<a:field name="billing_frequency_n" displayField="code_value_name"
options="billing_frequency_name_ds"
returnField="billing_frequency" valueField="code_value"/>
<a:field name="times_bill_flag" checkedValue="10" uncheckedValue=""/>
<a:field name="mid_bill_flag" checkedValue="30" uncheckedValue=""/>
<a:field name="final_bill_flag" checkedValue="40" uncheckedValue=""/>
<a:field name="et_bill_flag" checkedValue="20" uncheckedValue=""/>
<a:field name="notbilling_amount_from" defaultValue="0.01"/>
<a:field name="__async__" defaultValue="Y" prompt="异步导出"/>
</a:fields>
<a:events>
<a:event name="update" handler="acr510n_query_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="ar510n_cashflow_ds" autoPageSize="true" autoQuery="true" fetchAll="false"
model="acr.ACR510N.acr_inovice_cf_v_n" queryDataSet="allConditionDs" selectable="true">
<a:fields>
<a:field name="invoice_title" required="true" prompt="发票抬头"/>
<a:field name="object_tax_registry_num" prompt="纳税人识别号" validator="validate_contractDs"/>
<a:field name="invoice_bp_address_phone_num" prompt="开票地址电话" validator="validate_contractDs"/>
<a:field name="invoice_bp_bank_account" prompt="开户行及账号" validator="validate_contractDs"/>
<a:field name="billing_object_name" lovGridHeight="300" lovHeight="450" lovLabelWidth="100"
lovService="acr.ACR510.acr_invoice_billing_object_lov" lovWidth="650" required="true"
title="ACR510.ACR_INVOICE_CONTRACT_V.BILLING_OBJECT_NAME">
<a:mapping>
<a:map from="bp_id" to="billing_object_id"/>
<a:map from="bp_name" to="billing_object_name"/>
<a:map from="invoice_title" to="invoice_title"/>
<a:map from="invoice_bp_address_phone_num" to="invoice_bp_address_phone_num"/>
<a:map from="invoice_bp_bank_account" to="invoice_bp_bank_account"/>
<a:map from="taxpayer_type" to="object_taxpayer_type"/>
<a:map from="taxpayer_type_desc" to="object_taxpayer_type_desc"/>
<a:map from="tax_registry_num" to="object_tax_registry_num"/>
</a:mapping>
</a:field>
<a:field name="__async__" defaultValue="Y" prompt="异步导出"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="contractDs_grid_query" text="HLS.QUERY"/>
<a:gridButton click="allConditionDs_reset" text="重置"/>
<!-- <a:gridButton click="contractDs_grid_clear" text="ACR510.BUTTON.CLEAR_CONTRACT"/>-->
<a:gridButton click="invoiceHd_confirm" text="继续"/>
<!--<a:gridButton click="acr510n_excel" text="导出"/>-->
</a:screenTopToolbar>
<a:queryForm id="condition_queryForm" bindTarget="allConditionDs" createSearchButton="false"
resultTarget="contractDs">
<a:formToolBar labelWidth="100">
<a:datePicker name="last_received_date_from" bindTarget="allConditionDs"
prompt="ACR.RECEIVED_DATE_FROM"/>
<a:datePicker name="last_received_date_to" bindTarget="allConditionDs"
prompt="ACR.RECEIVED_DATE_TO"/>
<a:checkBox name="times_bill_flag" bindTarget="allConditionDs" prompt="按期开票"/>
<a:checkBox name="mid_bill_flag" bindTarget="allConditionDs" prompt="年中开票"/>
<a:checkBox name="final_bill_flag" bindTarget="allConditionDs" prompt="年末开票"/>
<a:checkBox name="et_bill_flag" bindTarget="allConditionDs" prompt="结清开票"/>
</a:formToolBar>
<a:formBody>
<a:hBox>
<!-- <a:comboBox name="billing_method_desc" bindTarget="allConditionDs" prompt="HLS.BILLING_RULE"/>-->
<a:comboBox name="division_desc" bindTarget="allConditionDs" prompt="产品线"/>
<a:lov name="contract_number" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NUMBER"/>
<a:datePicker name="lease_start_date_from" bindTarget="allConditionDs"
prompt="HLS.LEASE_START_DATE_FROM"/>
<a:datePicker name="lease_start_date_to" bindTarget="allConditionDs"
prompt="HLS.LEASE_START_DATE_TO"/>
<!-- <a:textField name="contract_name" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NAME"/>-->
</a:hBox>
<a:hBox>
<a:comboBox name="lease_channel_desc" bindTarget="allConditionDs" prompt="业务类型"/>
<a:textField name="bp_name" bindTarget="allConditionDs" prompt="HLS.TENANT_NAME"/>
<!--<a:comboBox name="document_type_desc" bindTarget="allConditionDs" prompt="HLS.CONTRACT_TYPE"/>-->
<a:lov name="cf_item_desc" bindTarget="allConditionDs" prompt="HLS.RECEIVE_PROJECT"/>
<a:comboBox name="billing_way_n" bindTarget="allConditionDs" prompt="开票方式"/>
</a:hBox>
<a:hBox>
<a:numberField name="notreceived_amount_from" allowDecimals="true" decimalPrecision="2" bindTarget="allConditionDs" prompt="未收金额从"/>
<a:numberField name="notreceived_amount_to" allowDecimals="true" decimalPrecision="2" bindTarget="allConditionDs"
prompt="未收金额到"/>
<a:numberField name="notbilling_amount_from" allowDecimals="true" decimalPrecision="2" bindTarget="allConditionDs" prompt="未开金额从"/>
<a:numberField name="notbilling_amount_to" allowDecimals="true" decimalPrecision="2" bindTarget="allConditionDs"
prompt="未开金额到"/>
</a:hBox>
<a:hBox>
<a:textField name="inv_billing_object_name" bindTarget="allConditionDs" prompt="代理商"/>
<a:comboBox name="business_type_desc" bindTarget="allConditionDs" prompt="业务类型"/>
<a:datePicker name="due_date_from" bindTarget="allConditionDs"
prompt="到期日从"/>
<a:datePicker name="due_date_to" bindTarget="allConditionDs"
prompt="到期日到"/>
</a:hBox>
<a:hBox>
<a:comboBox name="bill_object_bp_class_desc" bindTarget="allConditionDs" prompt="客户类型"/>
<a:comboBox name="contract_status_desc" bindTarget="allConditionDs" prompt="合同状态"/>
</a:hBox>
<a:hBox>
<a:textArea name="all_contract_number" width="840" bindTarget="allConditionDs" prompt="合同号"/>
</a:hBox>
</a:formBody>
</a:queryForm>
<a:tabPanel id="acr510n_detail_tabpanel_id" marginHeight="140" marginWidth="30">
<a:tabs>
<a:tab prompt="开票信息" width="120">
<a:grid id="contractDs_grid" bindTarget="ar510n_cashflow_ds" marginHeight="210"
marginWidth="70"
navBar="true">
<a:toolBar>
<a:button type="excel"/>
</a:toolBar>
<a:columns>
<a:column name="contract_number" lock="true" width="150" prompt="合同编号"/>
<a:column name="contract_name" lock="true" width="150" prompt="合同名称"/>
<a:column name="inv_billing_object_name" prompt="代理店"/>
<a:column name="business_type_desc" prompt="业务类型"/>
<a:column name="division_desc" prompt="产品线"/>
<a:column name="times" align="right" lock="true" width="40" prompt="期数"/>
<a:column name="cf_item_desc" prompt="应收项目"/>
<a:column name="due_date" renderer="Leaf.formatDate" prompt="到期日"/>
<a:column name="last_received_date" renderer="Leaf.formatDate" prompt="收款日期"/>
<a:column name="due_amount" align="right" renderer="Leaf.formatMoney" prompt="应收金额"/>
<a:column name="principal" align="right" renderer="Leaf.formatMoney" prompt="本金"/>
<a:column name="interest" align="right" renderer="Leaf.formatMoney" prompt="利息"/>
<a:column name="received_amount" align="right" renderer="Leaf.formatMoney" prompt="已收金额"/>
<a:column name="received_principal" align="right" renderer="Leaf.formatMoney" prompt="已收本金"/>
<a:column name="received_interest" align="right" renderer="Leaf.formatMoney" prompt="已收利息"/>
<a:column name="notreceived_amount" align="right" renderer="Leaf.formatMoney" prompt="未收金额"/>
<a:column name="notreceived_principal" align="right" renderer="Leaf.formatMoney" prompt="未收本金"/>
<a:column name="notreceived_interest" align="right" renderer="Leaf.formatMoney" prompt="未收利息"/>
<a:column name="billing_amount" align="right" prompt="已开票金额"
renderer="Leaf.formatMoney"/>
<a:column name="billing_principal" align="right" prompt="已开票本金"
renderer="Leaf.formatMoney"/>
<a:column name="billing_interest" align="right" prompt="已开票利息"
renderer="Leaf.formatMoney"/>
<a:column name="notbilling_amount" align="right" prompt="未开票金额"
renderer="Leaf.formatMoney"/>
<a:column name="notbilling_principal" align="right" prompt="未开票本金"
renderer="Leaf.formatMoney"/>
<a:column name="notbilling_interest" align="right" prompt="未开票利息"
renderer="Leaf.formatMoney"/>
<a:column name="interest" align="right" renderer="Leaf.formatMoney" prompt="利息"/>
</a:columns>
<a:editors>
<a:lov id="contractDs_grid_editor_lov"/>
<a:textField id="contractDs_grid_editor_tf"/>
</a:editors>
</a:grid>
</a:tab>
<a:tab prompt="抬头信息" width="120">
<a:grid id="acr510n_cashflowds_grid" bindTarget="ar510n_cashflow_ds" marginHeight="210"
marginWidth="70" navBar="true">
<a:toolBar>
<a:button type="excel"/>
</a:toolBar>
<a:columns>
<a:column name="contract_number" lock="true" width="150" prompt="合同编号"/>
<a:column name="contract_name" lock="true" width="150" prompt="合同名称"/>
<a:column name="bp_name" prompt="承租人名称"/>
<a:column name="contract_status_desc" width="80" prompt="合同状态"/>
<a:column name="billing_method_desc" prompt="开票规则"/>
<a:column name="billing_way_n" prompt="开票方式" width="80"/>
<a:column name="billing_frequency_n" prompt="开票频率" width="80"/>
<a:column name="billing_object_name" prompt="开票对象" autoAdjust="true"
editor="acr510n_cashflowds_grid_editor_lov" renderer="render_contractDs_grid"
showTitle="true" width="80"/>
<a:column name="invoice_title" prompt="发票抬头" autoAdjust="true" editor="acr510n_cashflowds_grid_editor_tf"
showTitle="true" width="80"/>
<a:column name="object_taxpayer_type" prompt="纳税人类型"/>
<a:column name="object_tax_registry_num" prompt="纳税人识别号" width="150"
editor="acr510n_cashflowds_grid_editor_tf"/>
<a:column name="invoice_bp_address_phone_num" prompt="开票地址电话" autoAdjust="false"
editor="acr510n_cashflowds_grid_editor_tf" showTitle="true" width="200"/>
<a:column name="invoice_bp_bank_account" prompt="开户行及账号" autoAdjust="false"
editor="acr510n_cashflowds_grid_editor_tf" showTitle="true" width="150"/>
<a:column name="description" prompt="备注" autoAdjust="false" editor="acr510n_cashflowds_grid_editor_tf"
showTitle="true" width="200"/>
</a:columns>
<a:editors>
<a:lov id="acr510n_cashflowds_grid_editor_lov"/>
<a:textField id="acr510n_cashflowds_grid_editor_tf"/>
</a:editors>
</a:grid>
</a:tab>
<!--<a:tab prompt="导出" width="100">-->
<!--<a:grid id="contractDs_grid_forexport" bindTarget="ar510n_cashflow_ds" marginHeight="170"-->
<!--marginWidth="70" navBar="true">-->
<!--<a:toolBar>-->
<!--<a:button type="excel"/>-->
<!--</a:toolBar>-->
<!--<a:columns>-->
<!--<a:column name="contract_number" lock="true" prompt="合同编号" width="150"/>-->
<!--&lt;!&ndash; <a:column name="project_name" autoAdjust="false" lock="true" showTitle="true" width="200"/> &ndash;&gt;-->
<!--<a:column name="times" align="right" lock="true" width="40"/>-->
<!--&lt;!&ndash; <a:column name="serial_number" prompt="机编号" width="80"/>&ndash;&gt;-->
<!--<a:column name="cf_item_desc"/>-->
<!--<a:column name="due_amount"/>-->
<!--<a:column name="received_amount" align="right" renderer="Leaf.formatMoney"/>-->
<!--<a:column name="billing_amount" align="right" renderer="Leaf.formatMoney"/>-->
<!--<a:column name="need_bill_amount" align="right" prompt="应开票金额"-->
<!--renderer="Leaf.formatMoney"/>-->
<!--<a:column name="billing_object_name" autoAdjust="false" showTitle="true"-->
<!--width="200"/>-->
<!--<a:column name="invoice_title" autoAdjust="false" showTitle="true" width="200"/>-->
<!--<a:column name="object_tax_registry_num" width="150"/>-->
<!--</a:columns>-->
<!--</a:grid>-->
<!--</a:tab>-->
</a:tabs>
</a:tabPanel>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:view>
<a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.screen"/>
<a:link id="acr512_invoice_ln_update_1_link" model="acr.ACR512.acr_invoice_update_query" modelaction="update"/>
<script><![CDATA[
// var dynamic_document_id = '$c{/parameter/@document_id}';
// if ('$c{/parameter/@document_id}') {
// var detail_mask;
// if ('${/parameter/@winid}') {
// if (parent.$A.CmpManager.get('${/parameter/@winid}')) {
// detail_mask = parent.$('${/parameter/@winid}').wrap;
// parent.Aurora.Masker.mask(detail_mask, '${l:HLS.LOADING}');
// } else {
// detail_mask = $('${/parameter/@winid}').wrap;
// Aurora.Masker.mask(detail_mask, '${l:HLS.LOADING}');
// }
// } else {
// detail_mask = Ext.getBody();
// Aurora.Masker.mask(detail_mask, '${l:HLS.LOADING}');
// }
// }
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record, bp_seq) {
var link_function = '';
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) {
link_function = '${/parameter/@layout_code}_open_bp_detail_window';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'car_detail' && record.get('contract_lease_item_id')) {
link_function = '${/parameter/@layout_code}_open_lease_item_detail_window';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'contract_number' && record.get('contract_id')) {
link_function = '${/parameter/@layout_code}_open_contract_detail_window';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + value + '</a>';
}
};
window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function(id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = record.data;
var contract_lease_item_id = record.get('contract_lease_item_id');
new Leaf.Window({
id: 'contract_lease_item_maintain_window',
url: $('contract_lease_item_maintain_link').getUrl(),
params: {
contract_lease_item_id: contract_lease_item_id,
winid: 'contract_lease_item_maintain_window'
},
draggable: true,
fullScreen: true
});
};
window['${/parameter/@layout_code}_open_contract_detail_window'] = function(id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = record.data;
param['function_code'] = 'ACR_CON301'; /* param['function_usage'] = 'QUERY'; */
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', record.ds.id, '${/parameter/@layout_code}');
};
//加载事件
window['${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var acr_invoice_hd_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_hd');
var ds_batch_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_batch_ln');
$(acr_invoice_hd_ds_id).getAt(0).set('merge_flag', 'Y');
$(acr_invoice_hd_ds_id).getAt(0).set('merge_flag_n', '合并');
var acr_invoice_rec = $(acr_invoice_hd_ds_id).getAt(0);
var invoice_hd_id = $(acr_invoice_hd_ds_id).getCurrentRecord().get('invoice_hd_id');
// if (acr_invoice_rec.get('merge_flag') == 'Y') {
Leaf.request({
url: $('acr512_invoice_ln_update_1_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id,
merge_flag: $(acr_invoice_hd_ds_id).getCurrentRecord().get('merge_flag')
},
success: function() {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$(ds_batch_id).query();
//$('${/parameter/@winid}').close();
},
scope: this
});
};
window['${/parameter/@layout_code}_open_bp_detail_window'] = function(id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = record.data;
param['function_code'] = 'CON501H';
param['function_usage'] = 'MODIFY';
param['url_title'] = '${l:HLS212.BP_MASTER_MAINTAIN}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con713_hls_bp_master_modify_link', record.ds.id, '${/parameter/@layout_code}');
};
function con500_contract_save(nextStep) {
var root_ds = $('${/model/base_table_path/record/@tab_code}_${/model/base_table_path/record/@base_table}_ds');
if (root_ds.validate()) {
var winid = '${/parameter/@winid}';
if (winid) {
Leaf.Masker.mask($(winid).wrap, '${l:HLS.EXECUTING}');
} else {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
lock_current_window();
var root_record = root_ds.getAt(0);
root_ds.setSubmitParameter('layout_code', '${/parameter/@layout_code}');
on_con_save_dynamic(root_ds, root_record, nextStep, winid);
}
con500_contract_merge();
}
function con500_contract_submit() {
Leaf.SideBar.enable = false;
con500_contract_save(con500_contract_submit_final);
}
function con500_contract_exit() {
if ('${/parameter/@winid}') {
$('${/parameter/@winid}').close();
} else {
window.location.go(-1);
}
}
function con500_contract_save_exit() {
con500_contract_save(con500_contract_exit);
}
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_hd');
var ds_batch_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acr_invoice_batch_ln');
var invoice_hd_id = $(ds_id).getCurrentRecord().get('invoice_hd_id');
var message = '';
if ($(ds_id).getCurrentRecord().get('merge_flag') == 'Y') {
message = '您确认行合并吗';
} else {
message = '您确认行不合并吗';
}
Leaf.showConfirm('提示', message, function() {
Leaf.request({
url: $('acr512_invoice_ln_update_1_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id,
merge_flag: $(ds_id).getCurrentRecord().get('merge_flag')
},
success: function() {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$(ds_batch_id).query();
// $('${/parameter/@winid}').close();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
/* new Aurora.Window({
id: 'contract_invoice_merge_window',
url: $('contract_invoice_merge_link').getUrl(),
params: {
invoice_hd_id: invoice_hd_id,
winid: 'contract_invoice_merge_window'
},
// draggable: true,
fullScreen: true
}); */
},
scope: this
});
},function(){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
});
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
......@@ -11,11 +11,43 @@
<a:model-query fetchAll="true" model="acr.ACR512.acr_invoice_business_type_list" rootPath="acr512_business_type_list"/>
</a:init-procedure>
<a:view>
<a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_detail.lview"/>
<!-- <a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.screen"/>
-->
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script type="text/javascript"><![CDATA[
<a:link id="acr512_submit_id" model="acr.ACR512.acr_invoice_hd_batch" modelaction="update"/>
<a:link id="get_document_number_link" model="acr.ACR512.get_document_number" modelaction="query"/>
<script><![CDATA[
function lock_current_window() {
leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
function unlock_current_window() {
leaf.Masker.unmask(Ext.getBody());
}
function acr512_invoice_query() {
$('acr512_invoice_result_ds').query();
var records = $('acr512_invoice_result_ds').getAll();
for (var i = 0;i < records.length;i++) {
var record = record[i];
var invoice_hd_id = record.get('invoice_hd_id');
Leaf.request({
url: $('get_document_number_link').getUrl(),
para: {
invoice_hd_id: invoice_hd_id
},
success: function(res) {
var document_number = record[i].get('document_number');
if (res.result.record['isreturn'] > 0) {
return '<font color="red">' + document_number + '</font> ';
} else {
return value;
}
}
});
}
$('acr512_invoice_result_ds').query();
}
function acr512_invoice_reset() {
......@@ -30,13 +62,21 @@
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '销项发票明细';
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_result_ds');
}
function acr512_document_number_render(value, record, name) {
if (name == 'document_number') {
if (record.get('compare_date_flag') == 'Y') {
return '<a style="color:red" href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
} else {
return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
}
// return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
function acr512_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
......@@ -67,36 +107,68 @@
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
}else if (name == 'invoice_date_f') {
if (Leaf.isEmpty(record.get('invoice_date_t'))) {
record.set('invoice_date_t', value);
}
}else if (name == 'accounting_date_f') {
if (Leaf.isEmpty(record.get('accounting_date_t'))) {
record.set('accounting_date_t', value);
if (Ext.isEmpty(record.get('project_number_f')) && Ext.isEmpty(record.get('project_number_t'))) {
record.set('query_project_number', '');
} else {
record.set('query_project_number', 'Y');
}
if (Ext.isEmpty(record.get('contract_number_f')) && Ext.isEmpty(record.get('contract_number_t'))) {
record.set('query_contract_number', '');
} else {
record.set('query_contract_number', 'Y');
}
}
if(Ext.isEmpty(record.get('project_number_f'))&&Ext.isEmpty(record.get('project_number_t')))
{
record.set('query_project_number','');
function acr512_invoice_delete() {
$('acr512_invoice_update_grid_ds').remove();
}
else
{
record.set('query_project_number','Y');
//发票提交
function acr512_invoice_submit() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
}
if(Ext.isEmpty(record.get('contract_number_f'))&&Ext.isEmpty(record.get('contract_number_t')))
{
record.set('query_contract_number','');
var datas = [];
for (var i = 0;i < records.length;i++) {
if (records[i].get('status') == 'APPROVED' || records[i].get('statsu') == 'APPROVING') {
Leaf.showMessage('${l:HLS.PROMPT}', '该发票正在审批中或已审批通过,不可重复提交');
return;
}
else
{
record.set('query_contract_number','Y');
if (i == 0) { //modify by wuts for hl 2018-12-23
var invoice_hd_ids = records[0].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
}
function acr512_invoice_delete(){
$('acr512_invoice_update_grid_ds').remove();
Leaf.showConfirm('提示', '您确认提交吗', function() {
lock_current_window();
Leaf.request({
url: $('acr512_submit_id').getUrl(),
para: {
invoice_hd_ids: invoice_hd_ids
},
success: function() {
Leaf.SideBar.show({
msg: '提交成功',
duration: 3000
});
unlock_current_window();
$('acr512_invoice_result_ds').query();
},
failure: function() {
unlock_current_window();
},
error: function() {
unlock_current_window();
},
scope: this
});
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
......@@ -108,10 +180,12 @@
<a:datas dataSource="/model/acr512_business_type_list"/>
</a:dataSet>
<a:dataSet id="acr512_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>
<a:dataSet id="hls_lease_channel_ds" loadData="true" model="basic.hls_lease_channel_for_lov"/>
<a:dataSet id="acr512_invoice_query_ds">
<a:fields>
<a:field name="currency_name" displayField="currency_name" options="acr512_currency_ds" returnField="currency" valueField="currency_code"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr512_invoice_kind_ds" returnField="invoice_kind" valueField="code_value"/>
<a:field name="invoice_kind" defaultValue="2"/>
<a:field name="invoice_kind_desc" defaultValue="普通发票" displayField="code_value_name" options="acr512_invoice_kind_ds" returnField="invoice_kind" valueField="code_value"/>
<a:field name="business_type_desc" displayField="business_type_desc" options="acr512_business_type_ds" returnField="business_type" valueField="business_type"/>
<a:field name="created_by_name" lovGridHeight="320" lovHeight="500" lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
<a:mapping>
......@@ -149,60 +223,94 @@
<a:map from="contract_number" to="contract_number_t"/>
</a:mapping>
</a:field>
<a:field name="lease_channel"/>
<a:field name="lease_channel_desc" displayField="description" options="hls_lease_channel_ds" returnField="lease_channel" valueField="lease_channel"/>
</a:fields>
<a:events>
<a:event name="update" handler="acr512_invoice_query_Onupdate"/>
</a:events>
</a:dataSet>
<a:dataSet id="acr512_invoice_result_ds" autoPageSize="true" autoQuery="true" model="acr.ACR512.acr_invoice_update_query" queryDataSet="acr512_invoice_query_ds" selectable="true"/>
<a:fields>
<a:field name="compare_date_flag"/>
</a:fields>
<a:events>
<a:event name="load" handler="load_do_info"/>
</a:events>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr512_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<!-- <a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>-->
<a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>
<!--
<a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/>
-->
</a:screenTopToolbar>
<a:form marginWidth="30" padding="0" title="销项发票维护" column="5">
<a:form marginWidth="200" padding="0" title="应收发票维护">
<a:hBox labelSeparator=" ">
<a:textField name="document_number_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.DOCUMENT_NUMBER_FROM" width="135"/>
<a:textField name="document_number_t" bindTarget="acr512_invoice_query_ds" prompt="单据号到" width="135"/>
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
<a:textField name="document_number_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<a:lov name="project_number_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.PROJECT_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
<a:lov name="project_number_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<!--
<a:comboBox name="business_type_desc" bindTarget="acr512_invoice_query_ds" prompt="HLS.BUSINESS_TYPE_DESC" width="135"/>
-->
<a:comboBox name="lease_channel_desc" bindTarget="acr512_invoice_query_ds" prompt="商业模式" width="135"/>
<!-- <a:comboBox name="currency_name" bindTarget="acr512_invoice_query_ds" prompt="HLS.CURRENCY" width="135"/> -->
</a:hBox>
<a:hBox labelSeparator=" ">
<a:textField name="invoice_number_f" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_NUMBER_FROM" width="135"/>
<a:textField name="invoice_number_t" bindTarget="acr512_invoice_query_ds" prompt="发票号到" width="135"/>
<a:textField name="invoice_title" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_TITLE" width="135"/>
<div><![CDATA[${l:ACR.INVOICE_NUMBER_TO}]]></div>
<a:textField name="invoice_number_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<a:lov name="contract_number_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.CONTRACT_NUMBER_FROM" width="135"/>
<a:lov name="contract_number_t" bindTarget="acr512_invoice_query_ds" prompt="合同编号到" width="135"/>
<div><![CDATA[${l:HLS.CONTRACT_NUMBER_TO}]]></div>
<a:lov name="contract_number_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<a:lov name="created_by_name" bindTarget="acr512_invoice_query_ds" prompt="ACR.CREATED_BY_NAME" width="135"/>
</a:hBox>
<a:hBox labelSeparator=" ">
<a:datePicker name="invoice_date_f" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_DATE_FROM" width="135"/>
<a:datePicker name="invoice_date_t" bindTarget="acr512_invoice_query_ds" prompt="开票日期到" width="135"/>
<div><![CDATA[${l:ACR.INVOICE_DATE_TO}]]></div>
<a:datePicker name="invoice_date_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<a:lov name="invoice_bp_code_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.CUSTOMER_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.CUSTOMER_NUMBER_TO}]]></div>
<a:lov name="invoice_bp_code_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="135"/>
</a:hBox>
<a:hBox labelSeparator=" ">
<a:datePicker name="accounting_date_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.ACCOUNT_DATE_FROM" width="135"/>
<a:datePicker name="accounting_date_t" bindTarget="acr512_invoice_query_ds" prompt="记账日期到" width="135"/>
<div><![CDATA[${l:HLS.ACCOUNT_DATE_TO}]]></div>
<a:datePicker name="accounting_date_t" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr512_invoice_query_ds" prompt="ACR.TOTAL_AMOUNT_FROM" width="135"/>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr512_invoice_query_ds" prompt="发票金额到" width="135"/>
<a:textField name="bp_agent_name" bindTarget="acr512_invoice_query_ds" prompt="代理商" width="135"/>
<div><![CDATA[${l:ACR.TOTAL_AMOUNT_TO}]]></div>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr512_invoice_query_ds" prompt="" width="135"/>
<a:textField name="invoice_title" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_TITLE" width="135"/>
</a:hBox>
</a:form>
<a:grid id="acr512_invoice_update_grid_ds" bindTarget="acr512_invoice_result_ds" marginHeight="225" marginWidth="30" navBar="true">
<a:grid id="acr512_invoice_update_grid_ds" bindTarget="acr512_invoice_result_ds" marginHeight="250" marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER" renderer="acr512_document_number_render" width="120"/>
<a:column name="invoice_bp_name" autoAdjust="false" prompt="HLS.CUSTOMER_NAME" showTitle="true" width="100"/>
<a:column name="contract_number" autoAdjust="false" prompt="HLS.CONTRACT_NUMBER" showTitle="true" width="150"/>
<a:column name="contract_name" width="150" prompt="合同名称"/>
<!-- <a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>-->
<a:column name="bp_agent_name" prompt="代理店" width="100"/>
<a:column name="contract_name" autoAdjust="false" prompt="HLS.CONTRACT_NAME" showTitle="true" width="150"/>
<!--
<a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>
-->
<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="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="bp_code" prompt="HLS.CUSTOMER_NUMBER" width="100"/> -->
<a:column name="invoice_title" autoAdjust="false" prompt="ACR.INVOICE_TITLE" showTitle="true" width="150"/>
<!-- <a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Leaf.formatMoney" width="100"/> -->
<!-- <a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Aurora.formatMoney" width="100"/> -->
<!-- <a:column name="currency" prompt="HLS.CURRENCY" width="80"/> -->
<a:column name="created_by_name" autoAdjust="false" prompt="ACR.CREATED_BY_NAME" showTitle="true" width="150"/>
<a:column name="invoice_status_desc" prompt="ACR.INVOICE_STATUS" width="100"/>
<a:column name="accounting_date" prompt="HLS.ACCOUNT_DATE" width="100"/>
<!-- <a:column name="compare_date_flag" prompt="比较日期" width="100"/> -->
<!-- <a:column name="project_number" prompt="HLS.PROJECT_NUMBER" width="120"/> -->
</a:columns>
</a:grid>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-15 下午04:39:15
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="acr512_currency_list"/>
<a:model-query fetchAll="true" model="acr.ACR512.acr_invoice_business_type_list" rootPath="acr512_business_type_list"/>
</a:init-procedure>
<a:view>
<a:link id="acr512_invoice_update_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script type="text/javascript"><![CDATA[
function acr512_invoice_query() {
$('acr512_invoice_result_ds').query();
}
function acr512_invoice_reset() {
$('acr512_invoice_query_ds').reset();
}
function acr512_grid_update(reocrd_id, invoice_hd_id, status) {
var maintain_type = 'UPDATE';
var currency_reocrd = $('acr512_invoice_result_ds').findById(reocrd_id);
var param = currency_reocrd.data;
param['function_code'] = 'ACR512';
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '销项发票明细';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr512_invoice_update_page', 'acr512_invoice_result_ds');
}
function acr512_document_number_render(value, record, name) {
return '<a href="javascript:acr512_grid_update(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
function acr512_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
}
function acr512_invoice_query_Onupdate(ds, record, name, value, oldVlaue) {
if (name == 'document_number_f') {
if (Leaf.isEmpty(record.get('document_number_t'))) {
record.set('document_number_t', value);
}
} else if (name == 'project_number_f') {
if (Leaf.isEmpty(record.get('project_number_t'))) {
record.set('project_number_t', value);
}
} else if (name == 'invoice_number_f') {
if (Leaf.isEmpty(record.get('invoice_number_t'))) {
record.set('invoice_number_t', value);
}
} else if (name == 'contract_number_f') {
if (Leaf.isEmpty(record.get('contract_number_t'))) {
record.set('contract_number_t', value);
}
} else if (name == 'invoice_bp_code_f') {
if (Leaf.isEmpty(record.get('invoice_bp_code_t'))) {
record.set('invoice_bp_code_t', value);
}
} else if (name == 'total_amount_f') {
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
}else if (name == 'invoice_date_f') {
if (Leaf.isEmpty(record.get('invoice_date_t'))) {
record.set('invoice_date_t', value);
}
}else if (name == 'accounting_date_f') {
if (Leaf.isEmpty(record.get('accounting_date_t'))) {
record.set('accounting_date_t', value);
}
}
if(Ext.isEmpty(record.get('project_number_f'))&&Ext.isEmpty(record.get('project_number_t')))
{
record.set('query_project_number','');
}
else
{
record.set('query_project_number','Y');
}
if(Ext.isEmpty(record.get('contract_number_f'))&&Ext.isEmpty(record.get('contract_number_t')))
{
record.set('query_contract_number','');
}
else
{
record.set('query_contract_number','Y');
}
}
function acr512_invoice_delete(){
$('acr512_invoice_update_grid_ds').remove();
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acr512_currency_ds">
<a:datas dataSource="/model/acr512_currency_list"/>
</a:dataSet>
<a:dataSet id="acr512_business_type_ds">
<a:datas dataSource="/model/acr512_business_type_list"/>
</a:dataSet>
<a:dataSet id="acr512_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>
<a:dataSet id="acr512_invoice_query_ds">
<a:fields>
<a:field name="currency_name" displayField="currency_name" options="acr512_currency_ds" returnField="currency" valueField="currency_code"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr512_invoice_kind_ds" returnField="invoice_kind" valueField="code_value"/>
<a:field name="business_type_desc" displayField="business_type_desc" options="acr512_business_type_ds" returnField="business_type" valueField="business_type"/>
<a:field name="created_by_name" lovGridHeight="320" lovHeight="500" lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
<a:mapping>
<a:map from="user_id" to="created_by"/>
<a:map from="description" to="created_by_name"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_f"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_t"/>
</a:mapping>
</a:field>
<a:field name="project_number_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_f"/>
</a:mapping>
</a:field>
<a:field name="project_number_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_t"/>
</a:mapping>
</a:field>
<a:field name="contract_number_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_f"/>
</a:mapping>
</a:field>
<a:field name="contract_number_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_t"/>
</a:mapping>
</a:field>
</a:fields>
<a:events>
<a:event name="update" handler="acr512_invoice_query_Onupdate"/>
</a:events>
</a:dataSet>
<a:dataSet id="acr512_invoice_result_ds" autoPageSize="true" autoQuery="true" model="acr.ACR512.acr_invoice_update_query" queryDataSet="acr512_invoice_query_ds" selectable="true"/>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr512_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<!-- <a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>-->
</a:screenTopToolbar>
<a:form marginWidth="30" padding="0" title="销项发票维护" column="5">
<a:textField name="document_number_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.DOCUMENT_NUMBER_FROM" width="135"/>
<a:textField name="document_number_t" bindTarget="acr512_invoice_query_ds" prompt="单据号到" width="135"/>
<!-- <a:comboBox name="currency_name" bindTarget="acr512_invoice_query_ds" prompt="HLS.CURRENCY" width="135"/> -->
<a:textField name="invoice_number_f" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_NUMBER_FROM" width="135"/>
<a:textField name="invoice_number_t" bindTarget="acr512_invoice_query_ds" prompt="发票号到" width="135"/>
<a:textField name="invoice_title" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_TITLE" width="135"/>
<a:lov name="contract_number_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.CONTRACT_NUMBER_FROM" width="135"/>
<a:lov name="contract_number_t" bindTarget="acr512_invoice_query_ds" prompt="合同编号到" width="135"/>
<a:lov name="created_by_name" bindTarget="acr512_invoice_query_ds" prompt="ACR.CREATED_BY_NAME" width="135"/>
<a:datePicker name="invoice_date_f" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_DATE_FROM" width="135"/>
<a:datePicker name="invoice_date_t" bindTarget="acr512_invoice_query_ds" prompt="开票日期到" width="135"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="135"/>
<a:datePicker name="accounting_date_f" bindTarget="acr512_invoice_query_ds" prompt="HLS.ACCOUNT_DATE_FROM" width="135"/>
<a:datePicker name="accounting_date_t" bindTarget="acr512_invoice_query_ds" prompt="记账日期到" width="135"/>
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr512_invoice_query_ds" prompt="ACR.TOTAL_AMOUNT_FROM" width="135"/>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr512_invoice_query_ds" prompt="发票金额到" width="135"/>
<a:textField name="bp_agent_name" bindTarget="acr512_invoice_query_ds" prompt="代理商" width="135"/>
</a:form>
<a:grid id="acr512_invoice_update_grid_ds" bindTarget="acr512_invoice_result_ds" marginHeight="225" marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER" renderer="acr512_document_number_render" width="120"/>
<a:column name="invoice_bp_name" autoAdjust="false" prompt="HLS.CUSTOMER_NAME" showTitle="true" width="100"/>
<a:column name="contract_number" autoAdjust="false" prompt="HLS.CONTRACT_NUMBER" showTitle="true" width="150"/>
<a:column name="contract_name" width="150" prompt="合同名称"/>
<!-- <a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>-->
<a:column name="bp_agent_name" prompt="代理店" 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_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="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/> -->
<!-- <a:column name="bp_code" prompt="HLS.CUSTOMER_NUMBER" width="100"/> -->
<a:column name="invoice_title" autoAdjust="false" prompt="ACR.INVOICE_TITLE" showTitle="true" width="150"/>
<!-- <a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Leaf.formatMoney" width="100"/> -->
<!-- <a:column name="currency" prompt="HLS.CURRENCY" width="80"/> -->
<a:column name="created_by_name" autoAdjust="false" prompt="ACR.CREATED_BY_NAME" showTitle="true" width="150"/>
<a:column name="invoice_status_desc" prompt="ACR.INVOICE_STATUS" width="100"/>
<a:column name="accounting_date" prompt="HLS.ACCOUNT_DATE" width="100"/>
<!-- <a:column name="project_number" prompt="HLS.PROJECT_NUMBER" width="120"/> -->
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
......@@ -313,7 +313,9 @@
<!--<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="invoice_kind_desc" prompt="ACR.INVOICE_KIND" width="100"/>
<!--
<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="project_name" autoAdjust="false" prompt="HLS.PROJECT_NAME" showTitle="true" width="150"/> -->
<!-- <a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/> -->
......
......@@ -8,15 +8,12 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="acr514_currency_list"/>
<a:model-query fetchAll="true" model="acr.ACR512.acr_invoice_business_type_list"
rootPath="acr514_business_type_list"/>
<a:model-query fetchAll="true" model="acr.ACR512.acr_invoice_business_type_list" rootPath="acr514_business_type_list"/>
</a:init-procedure>
<a:view>
<a:link id="acr514_invoice_readonly_page"
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<script type="text/javascript"><![CDATA[
<a:link id="acr514_invoice_readonly_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script><![CDATA[
function acr514_invoice_query() {
$('acr514_invoice_result_ds').query();
}
......@@ -54,14 +51,6 @@
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
} else if (name == 'invoice_date_f') {
if (Leaf.isEmpty(record.get('invoice_date_t'))) {
record.set('invoice_date_t', value);
}
} else if (name == 'accounting_date_f') {
if (Leaf.isEmpty(record.get('accounting_date_t'))) {
record.set('accounting_date_t', value);
}
}
if (Ext.isEmpty(record.get('project_number_f')) && Ext.isEmpty(record.get('project_number_t'))) {
......@@ -84,7 +73,7 @@
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'QUERY';
param['maintain_type'] = maintain_type;
param['url_title'] = '销项发票明细';
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr514_invoice_readonly_page', 'acr514_invoice_result_ds');
}
......@@ -128,29 +117,29 @@
}
if (type == 'REVERSE') {
for (var i = 0; i < records.length; i++) {
for (var i = 0;i < records.length;i++) {
if (records[i].get('invoice_kind') == '0') {
records[i].getField('vat_red_notice_num').setRequired(true);
}
}
} else if (type == 'INVALID') {
for (var i = 0; i < records.length; i++) {
for (var i = 0;i < records.length;i++) {
if (is_over_month(records[i].get('invoice_date'), records[i].get('reverse_date'))) {
Leaf.showMessage('${l:HLS.PROMPT}', '单据号:' + records[i].get('document_number') + '日期跨月');
return;
}
}
for (var i = 0; i < records.length; i++) {
for (var i = 0;i < records.length;i++) {
records[i].getField('vat_red_notice_num').setRequired(false);
}
} else {
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认?', function () {
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认?', function() {
ds.submitSelected();
}, function () {
}, function() {
});
......@@ -169,40 +158,41 @@
return '';
}
function acr514_invoice_update(ds, record, name, value, oldVlaue) {
var time, year, month, day, string;
var d, d_year_month;
if (name == 'reverse_date') {
function acr514_invoice_update(ds, record, name, value, oldVlaue)
{
debugger;
var time,year,month,day,string;
var d,d_year_month;
if(name=='reverse_date')
{
time = new Date();
year = time.getFullYear();
month = time.getMonth() + 1;
if (month < 10)
string = String(year) + '0' + String(month);
month = time.getMonth()+1;
if(month<10)
string = String(year)+'0'+String(month);
else
string = String(year) + String(month);
d = new Date(value);
d_year = d.getFullYear();
d_month = d.getMonth() + 1;
if (d_month < 10)
d_year_month = String(d_year) + '0' + String(d_month);
string = String(year)+String(month);
d= new Date(value);
d_year=d.getFullYear();
d_month=d.getMonth()+1;
if(d_month<10)
d_year_month = String(d_year)+'0'+String(d_month);
else
d_year_month = String(d_year) + String(d_month);
d_year_month = String(d_year)+String(d_month);
//如果小于系统时间
if (d_year_month < string) {
//record.getField('vat_red_notice_num').setRequired(true);
//modify by Song 二期的时候 在恢复 暂时这么改 方便杨静
record.getField('vat_red_notice_num').setRequired(false);
if( d_year_month<string)
{
record.getField('vat_red_notice_num').setRequired(true);
}
else {
else
{
record.getField('vat_red_notice_num').setRequired(false);
}
record.set(name, value);
record.set(name,value);
}
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
......@@ -218,77 +208,61 @@
<a:dataSet id="acr514_vat_interface_status_ds" lookupCode="ACR515_VAT_INTERFACE_STATUS"/>
<a:dataSet id="acr514_invoice_query_ds" autoCreate="true">
<a:fields>
<a:field name="currency_name" displayField="currency_name" options="acr514_currency_ds"
returnField="currency" valueField="currency_code"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr514_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>
<a:field name="invoice_status_desc" displayField="code_value_name" options="acr514_invoice_statu_ds"
returnField="invoice_status" valueField="code_value"/>
<a:field name="vat_interface_status_desc" displayField="code_value_name"
options="acr514_vat_interface_status_ds" returnField="vat_interface_status"
valueField="code_value"/>
<a:field name="business_type_desc" displayField="business_type_desc"
options="acr514_business_type_ds" returnField="business_type" valueField="business_type"/>
<a:field name="created_by_name" lovGridHeight="320" lovHeight="500"
lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
<a:field name="currency_name" displayField="currency_name" options="acr514_currency_ds" returnField="currency" valueField="currency_code"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr514_invoice_kind_ds" returnField="invoice_kind" valueField="code_value"/>
<a:field name="invoice_status_desc" displayField="code_value_name" options="acr514_invoice_statu_ds" returnField="invoice_status" valueField="code_value"/>
<a:field name="vat_interface_status_desc" displayField="code_value_name" options="acr514_vat_interface_status_ds" returnField="vat_interface_status" valueField="code_value"/>
<a:field name="business_type_desc" displayField="business_type_desc" options="acr514_business_type_ds" returnField="business_type" valueField="business_type"/>
<a:field name="created_by_name" lovGridHeight="320" lovHeight="500" lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
<a:mapping>
<a:map from="user_id" to="created_by"/>
<a:map from="description" to="created_by_name"/>
</a:mapping>
</a:field>
<a:field name="confirmed_by_name" lovGridHeight="320" lovHeight="500"
lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="复核人选择">
<a:field name="confirmed_by_name" lovGridHeight="320" lovHeight="500" lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="复核人选择">
<a:mapping>
<a:map from="user_id" to="confirmed_by"/>
<a:map from="description" to="confirmed_by_name"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_f"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_t"/>
</a:mapping>
</a:field>
<a:field name="project_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:field name="project_number_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_f"/>
</a:mapping>
</a:field>
<a:field name="project_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:field name="project_number_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_t"/>
</a:mapping>
</a:field>
<a:field name="contract_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:field name="contract_number_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_f"/>
</a:mapping>
</a:field>
<a:field name="contract_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:field name="contract_number_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_t"/>
</a:mapping>
</a:field>
<a:field name="received_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="express_status_name" displayField="code_value_name"
options="acr514_express_status_ds" returnField="express_status" valueField="code_value"/>
<a:field name="express_status_name" displayField="code_value_name" options="acr514_express_status_ds" returnField="express_status" valueField="code_value"/>
</a:fields>
<a:events>
<a:event name="update" handler="acr514_invoice_query_Onupdate"/>
</a:events>
</a:dataSet>
<a:dataSet id="acr514_invoice_result_ds" autoPageSize="true" autoQuery="true"
model="acr.ACR514.acr_invoice_reverse" queryDataSet="acr514_invoice_query_ds" selectable="true">
<a:dataSet id="acr514_invoice_result_ds" autoPageSize="true" model="acr.ACR514.acr_invoice_reverse" queryDataSet="acr514_invoice_query_ds" selectable="true">
<a:fields>
<a:field name="reverse_date" required="true"/>
</a:fields>
......@@ -303,87 +277,73 @@
<a:screenTitle/>
<a:toolbarButton click="acr514_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr514_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr514_invoice_reverse" text="HLS.REVERSE"/>
<a:toolbarButton click="acr514_invoice_invalid" text="取消"/>
<!-- <a:toolbarButton click="acr514_invoice_reverse" text="HLS.REVERSE"/>-->
<a:toolbarButton click="acr514_invoice_invalid" text="作废"/>
</a:screenTopToolbar>
<a:form marginWidth="30" padding="0" title="销项发票反冲" column="6">
<a:textField name="document_number_f" bindTarget="acr514_invoice_query_ds"
prompt="单据编号从" width="135"/>
<a:textField name="document_number_t" bindTarget="acr514_invoice_query_ds" prompt="单据编号到" width="135"/>
<a:textField name="invoice_number_f" bindTarget="acr514_invoice_query_ds"
prompt="发票号码从" width="135"/>
<a:textField name="invoice_number_t" bindTarget="acr514_invoice_query_ds" prompt="发票号码到" width="135"/>
<a:lov name="contract_number_f" bindTarget="acr514_invoice_query_ds" prompt="合同号码从"
width="135"/>
<a:lov name="contract_number_t" bindTarget="acr514_invoice_query_ds" prompt="合同号码到" width="135"/>
<a:datePicker name="invoice_date_f" bindTarget="acr514_invoice_query_ds" prompt="发票日期从"
width="135"/>
<a:datePicker name="invoice_date_t" bindTarget="acr514_invoice_query_ds" prompt="发票日期到" width="135"/>
<!-- <a:lov name="invoice_bp_code_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.CUSTOMER_NUMBER_FROM"
width="135"/>
<a:lov name="invoice_bp_code_t" bindTarget="acr514_invoice_query_ds" prompt="TO" width="135"/>-->
<!-- <a:lov name="confirmed_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CHECKER" width="135"/>-->
<a:datePicker name="accounting_date_f" bindTarget="acr514_invoice_query_ds"
prompt="记账日期从" width="135"/>
<a:datePicker name="accounting_date_t" bindTarget="acr514_invoice_query_ds" prompt="记账日期到" width="135"/>
<a:textField name="invoice_title" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_TITLE"
width="135"/>
<a:lov name="created_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CREATED_BY_NAME"
width="135"/>
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr514_invoice_query_ds"
prompt="发票金额从" width="135"/>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr514_invoice_query_ds" prompt="发票金额到"
width="135"/>
<a:comboBox name="vat_interface_status_desc" bindTarget="acr514_invoice_query_ds"
prompt="金税状态" width="135"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_KIND"
width="135"/>
<a:numberField name="vat_red_notice_num" bindTarget="acr514_invoice_query_ds" prompt="红票通知单"
width="135"/>
<a:textField name="bp_agent_name" bindTarget="acr514_invoice_query_ds" prompt="代理店" width="135"/>
<a:form marginWidth="30" padding="0" title="应收发票反冲">
<a:hBox labelSeparator=" ">
<a:textField name="document_number_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.DOCUMENT_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
<a:textField name="document_number_t" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:lov name="project_number_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.PROJECT_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>
<a:lov name="project_number_t" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:comboBox name="business_type_desc" bindTarget="acr514_invoice_query_ds" prompt="HLS.BUSINESS_TYPE_DESC" width="135"/>
<a:comboBox name="currency_name" bindTarget="acr514_invoice_query_ds" prompt="HLS.CURRENCY" width="135"/>
</a:hBox>
<a:hBox labelSeparator=" ">
<a:textField name="invoice_number_f" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:ACR.INVOICE_NUMBER_TO}]]></div>
<a:textField name="invoice_number_t" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:lov name="contract_number_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.CONTRACT_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.CONTRACT_NUMBER_TO}]]></div>
<a:lov name="contract_number_t" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="135"/>
<a:lov name="created_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CREATED_BY_NAME" width="135"/>
</a:hBox>
<a:hBox labelSeparator=" ">
<a:datePicker name="invoice_date_f" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_DATE_FROM" width="135"/>
<div><![CDATA[${l:ACR.INVOICE_DATE_TO}]]></div>
<a:datePicker name="invoice_date_t" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:lov name="invoice_bp_code_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.CUSTOMER_NUMBER_FROM" width="135"/>
<div><![CDATA[${l:HLS.CUSTOMER_NUMBER_TO}]]></div>
<a:lov name="invoice_bp_code_t" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:textField name="invoice_title" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_TITLE" width="135"/>
<a:lov name="confirmed_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CHECKER" width="135"/>
</a:hBox>
<a:hBox labelSeparator=" ">
<a:datePicker name="accounting_date_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.ACCOUNT_DATE_FROM" width="135"/>
<div><![CDATA[${l:HLS.ACCOUNT_DATE_TO}]]></div>
<a:datePicker name="accounting_date_t" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr514_invoice_query_ds" prompt="ACR.TOTAL_AMOUNT_FROM" width="135"/>
<div><![CDATA[${l:ACR.TOTAL_AMOUNT_TO}]]></div>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr514_invoice_query_ds" prompt="" width="135"/>
<a:comboBox name="invoice_status_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_STATUS" width="135"/>
<a:comboBox name="vat_interface_status_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR310.VAT_INTERFACE_STATUS_NAME" width="135"/>
</a:hBox>
</a:form>
<a:grid id="acr514_invoice_grid_id" bindTarget="acr514_invoice_result_ds" marginHeight="225"
marginWidth="30" navBar="true">
<a:grid id="acr514_invoice_grid_id" bindTarget="acr514_invoice_result_ds" marginHeight="260" marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER"
renderer="acr514_document_number_render" width="120"/>
<a:column name="contract_number" autoAdjust="false" prompt="HLS.CONTRACT_NUMBER" showTitle="true"
width="150"/>
<a:column name="contract_name" width="150" prompt="合同名称"/>
<a:column name="invoice_bp_name" autoAdjust="false" prompt="HLS.CUSTOMER_NAME" showTitle="true"
width="150"/>
<a:column name="bp_agent_name" prompt="代理商" width="100"/>
<!-- <a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>-->
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER" renderer="acr514_document_number_render" width="120"/>
<a:column name="contract_name" autoAdjust="false" prompt="HLS.CONTRACT_NAME" showTitle="true" width="150"/>
<a:column name="invoice_bp_name" autoAdjust="false" prompt="HLS.CUSTOMER_NAME" showTitle="true" width="150"/>
<a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>
<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="reverse_date" editor="invoice_grid_dp" prompt="HLS.REVERSE_DATE"
renderer="Leaf.formatDate" width="100"/>
<!-- <a:column name="vat_red_notice_num" editorFunction="vat_red_notice_num_editorFunction"-->
<!-- prompt="ACR.VAT_RED_NOTICE_NUM" width="120"/>-->
<a:column name="reverse_date" editor="invoice_grid_dp" prompt="HLS.REVERSE_DATE" renderer="Leaf.formatDate" width="100"/>
<!-- <a:column name="vat_red_notice_num" editorFunction="vat_red_notice_num_editorFunction" prompt="ACR.VAT_RED_NOTICE_NUM" width="120"/>-->
<!-- <a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/>
<a:column name="bp_code" prompt="HLS.CUSTOMER_NUMBER" width="100"/> -->
<a:column name="invoice_title" autoAdjust="false" prompt="ACR.INVOICE_TITLE" showTitle="true"
width="150"/>
<a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Leaf.formatMoney"
width="90"/>
<a:column name="invoice_title" autoAdjust="false" prompt="ACR.INVOICE_TITLE" showTitle="true" width="150"/>
<a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Leaf.formatMoney" width="90"/>
<!-- <a:column name="currency" prompt="HLS.CURRENCY" width="80"/> -->
<a:column name="created_by_name" autoAdjust="false" prompt="ACR.CREATED_BY_NAME" showTitle="true"
width="150"/>
<a:column name="confirmed_by_name" align="center" autoAdjust="false" prompt="ACR.CHECKER"
showTitle="true" width="150"/>
<a:column name="created_by_name" autoAdjust="false" prompt="ACR.CREATED_BY_NAME" showTitle="true" width="150"/>
<a:column name="confirmed_by_name" align="center" autoAdjust="false" prompt="ACR.CHECKER" showTitle="true" width="150"/>
<a:column name="invoice_status_desc" prompt="ACR.INVOICE_STATUS" width="100"/>
<!-- <a:column name="vat_interface_status_desc" prompt="ACR.VAT_INTERFACE_STATUS_NAME" width="100"/> -->
<a:column name="vat_interface_status_desc" prompt="ACR.VAT_INTERFACE_STATUS_NAME" width="100"/>
<a:column name="accounting_date" prompt="HLS.ACCOUNT_DATE" width="100"/>
<!-- <a:column name="create_je_flag" align="center" prompt="ACR.CREATE_JE_FLAG" width="60"/>-->
<!--<a:column name="create_je_flag" align="center" prompt="ACR.CREATE_JE_FLAG" width="60"/>-->
<!-- <a:column name="project_number" prompt="HLS.PROJECT_NUMBER" width="120"/>
<a:column name="project_name" autoAdjust="false" prompt="HLS.PROJECT_NAME" showTitle="true" width="150"/> -->
</a:columns>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-18 上午09:34:43
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="acr514_currency_list"/>
<a:model-query fetchAll="true" model="acr.ACR512.acr_invoice_business_type_list"
rootPath="acr514_business_type_list"/>
</a:init-procedure>
<a:view>
<a:link id="acr514_invoice_readonly_page"
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<script type="text/javascript"><![CDATA[
function acr514_invoice_query() {
$('acr514_invoice_result_ds').query();
}
function acr514_invoice_reset() {
$('acr514_invoice_query_ds').reset();
}
function acr514_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
}
function acr514_invoice_query_Onupdate(ds, record, name, value, oldVlaue) {
if (name == 'document_number_f') {
if (Leaf.isEmpty(record.get('document_number_t'))) {
record.set('document_number_t', value);
}
} else if (name == 'project_number_f') {
if (Leaf.isEmpty(record.get('project_number_t'))) {
record.set('project_number_t', value);
}
} else if (name == 'invoice_number_f') {
if (Leaf.isEmpty(record.get('invoice_number_t'))) {
record.set('invoice_number_t', value);
}
} else if (name == 'contract_number_f') {
if (Leaf.isEmpty(record.get('contract_number_t'))) {
record.set('contract_number_t', value);
}
} else if (name == 'invoice_bp_code_f') {
if (Leaf.isEmpty(record.get('invoice_bp_code_t'))) {
record.set('invoice_bp_code_t', value);
}
} else if (name == 'total_amount_f') {
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
} else if (name == 'invoice_date_f') {
if (Leaf.isEmpty(record.get('invoice_date_t'))) {
record.set('invoice_date_t', value);
}
} else if (name == 'accounting_date_f') {
if (Leaf.isEmpty(record.get('accounting_date_t'))) {
record.set('accounting_date_t', value);
}
}
if (Ext.isEmpty(record.get('project_number_f')) && Ext.isEmpty(record.get('project_number_t'))) {
record.set('query_project_number', '');
} else {
record.set('query_project_number', 'Y');
}
if (Ext.isEmpty(record.get('contract_number_f')) && Ext.isEmpty(record.get('contract_number_t'))) {
record.set('query_contract_number', '');
} else {
record.set('query_contract_number', 'Y');
}
}
function acr514_grid_query(reocrd_id, invoice_hd_id, status) {
var maintain_type = 'READONLY';
var currency_reocrd = $('acr514_invoice_result_ds').findById(reocrd_id);
var param = currency_reocrd.data;
param['function_code'] = 'ACR514';
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'QUERY';
param['maintain_type'] = maintain_type;
param['url_title'] = '销项发票明细';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr514_invoice_readonly_page', 'acr514_invoice_result_ds');
}
function acr514_document_number_render(value, record, name) {
return '<a href="javascript:acr514_grid_query(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
function acr514_invoice_reverse() {
acr514_invoice_handle('REVERSE');
}
function acr514_invoice_invalid() {
acr514_invoice_handle('INVALID');
}
function is_over_month(start_str, end_str) {
var start = Leaf.formatDate(start_str);
var end = Leaf.formatDate(end_str);
var year = Number(end.substr(0, 4)) - Number(start.substr(0, 4));
var month = Number(end.substr(5, 2)) - Number(start.substr(5, 2));
var day = Number(end.substr(8, 2)) - Number(start.substr(8, 2));
if (year == 1 && month == -11 && day <= 0) {
return false;
}
if (year == 0 && month == 0) {
return false;
}
if (year == 0 && month == 1 && day <= 0) {
return false;
}
return true;
}
function acr514_invoice_handle(type) {
var ds = $('acr514_invoice_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
return;
}
if (type == 'REVERSE') {
for (var i = 0; i < records.length; i++) {
if (records[i].get('invoice_kind') == '0') {
records[i].getField('vat_red_notice_num').setRequired(true);
}
}
} else if (type == 'INVALID') {
for (var i = 0; i < records.length; i++) {
if (is_over_month(records[i].get('invoice_date'), records[i].get('reverse_date'))) {
Leaf.showMessage('${l:HLS.PROMPT}', '单据号:' + records[i].get('document_number') + '日期跨月');
return;
}
}
for (var i = 0; i < records.length; i++) {
records[i].getField('vat_red_notice_num').setRequired(false);
}
} else {
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认?', function () {
ds.submitSelected();
}, function () {
});
}
function acr514_invoice_result_ds_submitsuccess(ds) {
$('acr514_invoice_grid_id').clear();
}
function vat_red_notice_num_editorFunction(record, name) {
if (record.get('invoice_kind') == '0') {
if (name == 'vat_red_notice_num') {
return 'invoice_grid_tf';
}
}
return '';
}
function acr514_invoice_update(ds, record, name, value, oldVlaue) {
var time, year, month, day, string;
var d, d_year_month;
if (name == 'reverse_date') {
time = new Date();
year = time.getFullYear();
month = time.getMonth() + 1;
if (month < 10)
string = String(year) + '0' + String(month);
else
string = String(year) + String(month);
d = new Date(value);
d_year = d.getFullYear();
d_month = d.getMonth() + 1;
if (d_month < 10)
d_year_month = String(d_year) + '0' + String(d_month);
else
d_year_month = String(d_year) + String(d_month);
//如果小于系统时间
if (d_year_month < string) {
//record.getField('vat_red_notice_num').setRequired(true);
//modify by Song 二期的时候 在恢复 暂时这么改 方便杨静
record.getField('vat_red_notice_num').setRequired(false);
}
else {
record.getField('vat_red_notice_num').setRequired(false);
}
record.set(name, value);
}
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acr514_business_type_ds">
<a:datas dataSource="/model/acr514_business_type_list"/>
</a:dataSet>
<a:dataSet id="acr514_currency_ds">
<a:datas dataSource="/model/acr514_currency_list"/>
</a:dataSet>
<a:dataSet id="acr514_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>
<a:dataSet id="acr514_invoice_statu_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="acr514_express_status_ds" lookupCode="ACR518_EXPRESS_STATUS"/>
<a:dataSet id="acr514_vat_interface_status_ds" lookupCode="ACR515_VAT_INTERFACE_STATUS"/>
<a:dataSet id="acr514_invoice_query_ds" autoCreate="true">
<a:fields>
<a:field name="currency_name" displayField="currency_name" options="acr514_currency_ds"
returnField="currency" valueField="currency_code"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr514_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>
<a:field name="invoice_status_desc" displayField="code_value_name" options="acr514_invoice_statu_ds"
returnField="invoice_status" valueField="code_value"/>
<a:field name="vat_interface_status_desc" displayField="code_value_name"
options="acr514_vat_interface_status_ds" returnField="vat_interface_status"
valueField="code_value"/>
<a:field name="business_type_desc" displayField="business_type_desc"
options="acr514_business_type_ds" returnField="business_type" valueField="business_type"/>
<a:field name="created_by_name" lovGridHeight="320" lovHeight="500"
lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="开票人选择">
<a:mapping>
<a:map from="user_id" to="created_by"/>
<a:map from="description" to="created_by_name"/>
</a:mapping>
</a:field>
<a:field name="confirmed_by_name" lovGridHeight="320" lovHeight="500"
lovService="acr.ACR512.acr_invoice_sys_user_lov" lovWidth="500" title="复核人选择">
<a:mapping>
<a:map from="user_id" to="confirmed_by"/>
<a:map from="description" to="confirmed_by_name"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_f"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_t"/>
</a:mapping>
</a:field>
<a:field name="project_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_f"/>
</a:mapping>
</a:field>
<a:field name="project_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
<a:mapping>
<a:map from="project_number" to="project_number_t"/>
</a:mapping>
</a:field>
<a:field name="contract_number_f" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_f"/>
</a:mapping>
</a:field>
<a:field name="contract_number_t" lovGridHeight="320" lovHeight="480"
lovService="acr.ACR512.acr_invoice_contract_list" lovWidth="500" title="合同选择">
<a:mapping>
<a:map from="contract_number" to="contract_number_t"/>
</a:mapping>
</a:field>
<a:field name="received_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="express_status_name" displayField="code_value_name"
options="acr514_express_status_ds" returnField="express_status" valueField="code_value"/>
</a:fields>
<a:events>
<a:event name="update" handler="acr514_invoice_query_Onupdate"/>
</a:events>
</a:dataSet>
<a:dataSet id="acr514_invoice_result_ds" autoPageSize="true" autoQuery="true"
model="acr.ACR514.acr_invoice_reverse" queryDataSet="acr514_invoice_query_ds" selectable="true">
<a:fields>
<a:field name="reverse_date" required="true"/>
</a:fields>
<a:events>
<a:event name="submitsuccess" handler="acr514_invoice_result_ds_submitsuccess"/>
<a:event name="update" handler="acr514_invoice_update"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr514_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr514_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr514_invoice_reverse" text="HLS.REVERSE"/>
<a:toolbarButton click="acr514_invoice_invalid" text="取消"/>
</a:screenTopToolbar>
<a:form marginWidth="30" padding="0" title="销项发票反冲" column="6">
<a:textField name="document_number_f" bindTarget="acr514_invoice_query_ds"
prompt="单据编号从" width="135"/>
<a:textField name="document_number_t" bindTarget="acr514_invoice_query_ds" prompt="单据编号到" width="135"/>
<a:textField name="invoice_number_f" bindTarget="acr514_invoice_query_ds"
prompt="发票号码从" width="135"/>
<a:textField name="invoice_number_t" bindTarget="acr514_invoice_query_ds" prompt="发票号码到" width="135"/>
<a:lov name="contract_number_f" bindTarget="acr514_invoice_query_ds" prompt="合同号码从"
width="135"/>
<a:lov name="contract_number_t" bindTarget="acr514_invoice_query_ds" prompt="合同号码到" width="135"/>
<a:datePicker name="invoice_date_f" bindTarget="acr514_invoice_query_ds" prompt="发票日期从"
width="135"/>
<a:datePicker name="invoice_date_t" bindTarget="acr514_invoice_query_ds" prompt="发票日期到" width="135"/>
<!-- <a:lov name="invoice_bp_code_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.CUSTOMER_NUMBER_FROM"
width="135"/>
<a:lov name="invoice_bp_code_t" bindTarget="acr514_invoice_query_ds" prompt="TO" width="135"/>-->
<!-- <a:lov name="confirmed_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CHECKER" width="135"/>-->
<a:datePicker name="accounting_date_f" bindTarget="acr514_invoice_query_ds"
prompt="记账日期从" width="135"/>
<a:datePicker name="accounting_date_t" bindTarget="acr514_invoice_query_ds" prompt="记账日期到" width="135"/>
<a:textField name="invoice_title" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_TITLE"
width="135"/>
<a:lov name="created_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CREATED_BY_NAME"
width="135"/>
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr514_invoice_query_ds"
prompt="发票金额从" width="135"/>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr514_invoice_query_ds" prompt="发票金额到"
width="135"/>
<a:comboBox name="vat_interface_status_desc" bindTarget="acr514_invoice_query_ds"
prompt="金税状态" width="135"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_KIND"
width="135"/>
<a:numberField name="vat_red_notice_num" bindTarget="acr514_invoice_query_ds" prompt="红票通知单"
width="135"/>
<a:textField name="bp_agent_name" bindTarget="acr514_invoice_query_ds" prompt="代理店" width="135"/>
</a:form>
<a:grid id="acr514_invoice_grid_id" bindTarget="acr514_invoice_result_ds" marginHeight="225"
marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER"
renderer="acr514_document_number_render" width="120"/>
<a:column name="contract_number" autoAdjust="false" prompt="HLS.CONTRACT_NUMBER" showTitle="true"
width="150"/>
<a:column name="contract_name" width="150" prompt="合同名称"/>
<a:column name="invoice_bp_name" autoAdjust="false" prompt="HLS.CUSTOMER_NAME" showTitle="true"
width="150"/>
<a:column name="bp_agent_name" prompt="代理商" width="100"/>
<!-- <a:column name="business_type_desc" prompt="HLS.BUSINESS_TYPE_DESC" width="80"/>-->
<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_date" prompt="ACR.INVOICE_DATE" width="100"/>
<a:column name="reverse_date" editor="invoice_grid_dp" prompt="HLS.REVERSE_DATE"
renderer="Leaf.formatDate" width="100"/>
<!-- <a:column name="vat_red_notice_num" editorFunction="vat_red_notice_num_editorFunction"-->
<!-- prompt="ACR.VAT_RED_NOTICE_NUM" width="120"/>-->
<!-- <a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/>
<a:column name="bp_code" prompt="HLS.CUSTOMER_NUMBER" width="100"/> -->
<a:column name="invoice_title" autoAdjust="false" prompt="ACR.INVOICE_TITLE" showTitle="true"
width="150"/>
<a:column name="total_amount" align="right" prompt="ACR.TOTAL_AMOUNT" renderer="Leaf.formatMoney"
width="90"/>
<!-- <a:column name="currency" prompt="HLS.CURRENCY" width="80"/> -->
<a:column name="created_by_name" autoAdjust="false" prompt="ACR.CREATED_BY_NAME" showTitle="true"
width="150"/>
<a:column name="confirmed_by_name" align="center" autoAdjust="false" prompt="ACR.CHECKER"
showTitle="true" width="150"/>
<a:column name="invoice_status_desc" prompt="ACR.INVOICE_STATUS" width="100"/>
<!-- <a:column name="vat_interface_status_desc" prompt="ACR.VAT_INTERFACE_STATUS_NAME" width="100"/> -->
<a:column name="accounting_date" prompt="HLS.ACCOUNT_DATE" width="100"/>
<!-- <a:column name="create_je_flag" align="center" prompt="ACR.CREATE_JE_FLAG" width="60"/>-->
<!-- <a:column name="project_number" prompt="HLS.PROJECT_NUMBER" width="120"/>
<a:column name="project_name" autoAdjust="false" prompt="HLS.PROJECT_NAME" showTitle="true" width="150"/> -->
</a:columns>
<a:editors>
<a:datePicker id="invoice_grid_dp"/>
<a:textField id="invoice_grid_tf"/>
</a:editors>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
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