Commit 7e0f7c4c authored by 李贺贺's avatar 李贺贺

电子发票相关功能开发

parent c20288ae
......@@ -94,7 +94,22 @@
t2.ccr_document_type,
(select t.description
FROM hls_document_type t
where t.document_type = t2.ccr_document_type) ccr_document_type_desc
where t.document_type = t2.ccr_document_type) ccr_document_type_desc,
--add by lihh 20210409
hbm.invoice_type,
(select v.code_value_name value_name from sys_code_values_v v where v.code_value = hbm.invoice_type) invoice_type_n,
hbm.invoice_method,
(SELECT v.code_value_name value_name
FROM sys_code_values_v v
WHERE v.code = 'INVOICE_METHOD'
AND v.code_value = hbm.invoice_method
AND v.code_enabled_flag = 'Y') invoice_method_n,
cc.division,
(SELECT v.code_value_name value_name
FROM sys_code_values_v v
WHERE v.code = 'DIVISION'
AND v.code_value = cc.division
AND v.code_enabled_flag = 'Y') division_n
from con_contract cc, hls_bp_master hbm, CUS_ACR_INVOICE_V t2
where cc.contract_id = t2.contract_id
and hbm.bp_wfl_status = 'APPROVED'
......@@ -299,6 +314,9 @@
<!-- <bm:query-field name="inv_object_taxpayer_type" queryExpression="vv.inv_object_taxpayer_type =${@inv_object_taxpayer_type}"/>-->
<bm:query-field name="object_taxpayer_type" queryExpression="vv.object_taxpayer_type =${@object_taxpayer_type}"/>
<bm:query-field name="ccr_document_type" queryExpression="vv.ccr_document_type =${@ccr_document_type}"/>
<bm:query-field name="invoice_method" queryExpression="vv.invoice_method = ${@invoice_method}"/>
<bm:query-field name="division" queryExpression="vv.division = ${@division}"/>
<bm:query-field name="invoice_type" queryExpression="vv.invoice_type = ${@invoice_type}"/>
</bm:query-fields>
<bm:data-filters>
......
......@@ -36,6 +36,8 @@
<bm:field name="billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="cf_status" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE"/>
<bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE_N" prompt="发票种类"/>
</bm:fields>
<bm:operations>
......@@ -91,7 +93,12 @@
where i.cf_item = t.cf_item) as cf_item_desc,
'融资租赁费' as product_name,
con.contract_status contract_status,
cf.cf_status cf_status
cf.cf_status cf_status,
t.invoice_kind_type,
(select v.code_value_name
from sys_code_values_v v
where v.code = 'ACR512_INVOICE_KIND_TYPE'
and v.code_value = t.invoice_kind_type) invoice_kind_type_n
from acr_invoice_create_tmp t,
con_contract_v con,
con_contract_cashflow_all_v cf,
......@@ -109,6 +116,7 @@
begin
ACR_INVOICE_PKG.invoiceTmp_update(p_record_id => ${@record_id},
p_invoice_kind => ${@invoice_kind},
p_invoice_kind_type => ${@invoice_kind_type},
p_billing_amount => ${@billing_amount},
p_product_name => ${@product_name},
p_user_id => ${/session/@user_id});
......
......@@ -36,6 +36,8 @@
<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="billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE"/>
<bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE_N" prompt="发票种类"/>
</bm:fields>
<bm:operations>
......@@ -86,8 +88,13 @@
t.cf_item,
t.tax_amount,
'违约金' cf_item_desc,
'融资租赁费' AS product_name
FROM acr_invoice_create_tmp t, con_contract_v con,cus_acr_invoice_contract_v t1
'融资租赁费' AS product_name,
t.invoice_kind_type,
(select v.code_value_name
from sys_code_values_v v
where v.code = 'ACR512_INVOICE_KIND_TYPE'
and v.code_value = t.invoice_kind_type) invoice_kind_type_n
FROM acr_invoice_create_tmp t, con_contract_v con,hls_bp_master t1
WHERE t.session_id = ${/session/@session_id}
AND t.contract_id = con.contract_id
and t1.contract_id = t.contract_id
......@@ -100,6 +107,7 @@
begin
ACR_INVOICE_PKG.invoiceTmp_update(p_record_id => ${@record_id},
p_invoice_kind => ${@invoice_kind},
p_invoice_kind_type => ${@invoice_kind_type},
p_tax_amount => ${@tax_amount},
p_billing_amount => ${@billing_amount},
p_product_name => ${@product_name},
......
......@@ -52,7 +52,10 @@
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id
t1.spv_company_id,
t1.invoice_type,
t1.invoice_kind_type,
t1.invoice_kind_type_n
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
......@@ -109,6 +112,8 @@
-->
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
<bm:query-field name="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;REJECT&apos;)"/>
......
......@@ -14,5 +14,18 @@
<bm:parameter inputPath="/session/@user_id"/>
</bm:parameters>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
hls_vat_import_pkg.update_vat_tmp_file_name (
p_session_id => ${/session/@session_id},
p_vat_code =>${@vat_code},
p_vat_number =>${@vat_number},
p_file_name =>${@file_name}
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</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">
<bm:fields>
<bm:field name="base_temp_dir"/>
<bm:field name="year"/>
<bm:field name="month"/>
<bm:field name="base_ele_dir"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select sys_parameter_pkg.value('ELE_ACR_TEMP_DIR') base_temp_dir,
sys_parameter_pkg.value('ELE_ACR_DIR') base_ele_dir,
to_char(sysdate,'yyyy') year,
to_char(sysdate,'mm') month
from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -15,5 +15,16 @@
<bm:parameter inputPath="/session/@user_id"/>
</bm:parameters>
</bm:operation>
<bm:operation name="update" >
<bm:update-sql><![CDATA[
BEGIN
hls_vat_import_pkg.init_acr_atm(p_document_number =>${@document_number},
p_file_path =>${@file_path},
p_file_name =>${@file_name},
p_file_length =>${@file_length},
p_user_id =>${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -44,6 +44,8 @@
<bm:field name="segment33"/>
<bm:field name="segment34"/>
<bm:field name="segment35" datatype="java.lang.Double"/>
<bm:field name="segment36"/>
<bm:field name="ele_unique_file_name"/>
<bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="HLS_VAT_IMPORT_TMP.STATUS"/>
</bm:fields>
<bm:features>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
hls_vat_import_pkg.import_check (
p_vat_doc_number =>${@vat_doc_number},
p_user_id =>${/session/@user_id}
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -131,7 +131,9 @@
vat_interface_status_desc,
invoice_apply_num,
( ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id))csh_transaction_flag,
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc,
invoice_kind_type,
invoice_kind_type_n
FROM acr_invoice_hd_v t) t1
#WHERE_CLAUSE#
......@@ -168,6 +170,7 @@
<bm:query-field name="invoice_date_to" queryExpression=" to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@invoice_date_to},&apos;yyyy-mm-dd&apos;)"/>
<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="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="nvl(t1.reversed_flag ,'N')= &apos;N&apos;"/>
......
......@@ -130,7 +130,9 @@
ref_n02,
invoice_apply_num,
ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id)csh_transaction_flag,
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc,
invoice_kind_type,
invoice_kind_type_n
FROM acr_invoice_hd_v t) t1
#WHERE_CLAUSE#
......@@ -167,6 +169,7 @@
<bm:query-field name="invoice_date_to" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@invoice_date_to},&apos;yyyy-mm-dd&apos;)"/>
<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="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/>
</bm:query-fields>
<bm:data-filters>
<!-- <bm:data-filter enforceOperations="query" expression="t1.contract_id = t2.contract_id"/>-->
......
......@@ -71,7 +71,17 @@
Where v.code = 'ACR515_VAT_INTERFACE_STATUS'
And v.code_value = t.vat_interface_status
and v.code_enabled_flag = 'Y'
and v.code_value_enabled_flag = 'Y') As vat_interface_status_n
and v.code_value_enabled_flag = 'Y') As vat_interface_status_n,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'ACR512_INVOICE_KIND_TYPE'
AND v.code_value =
(SELECT aw.invoice_kind_type
FROM acr_invoice_hd_wfl aw
WHERE aw.invoice_apply_id = t.invoice_apply_id
GROUP BY invoice_kind_type)
AND v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y') invoice_kind_type_n
From acr_invoice_apply t #WHERE_CLAUSE#
order by t.invoice_apply_id desc
]]></bm:query-sql>
......
......@@ -117,6 +117,8 @@
and aw.invoice_hd_id=t1.invoice_hd_id)"/>
<bm:field name="invoice_apply_id" expression="(select ap.invoice_apply_id from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status='APPROVED' and ap.apply_mode='APPLY' and ap.invoice_apply_id=aw.invoice_apply_id
and aw.invoice_hd_id=t1.invoice_hd_id)"/>
<bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type" prompt="发票种类"/>
<bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type_n" prompt="发票种类"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/>
......@@ -147,6 +149,7 @@ and aw.invoice_hd_id=t1.invoice_hd_id)"/>
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="invoice_apply_num" queryExpression="${@invoice_apply_num}=(select ap.invoice_apply_num from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status='APPROVED' and ap.apply_mode='APPLY' and ap.invoice_apply_id=aw.invoice_apply_id
and aw.invoice_hd_id=t1.invoice_hd_id)"/>
<bm:query-field name="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/>
</bm:query-fields>
<bm:data-filters>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT v.code_value AS value_code, v.code_value_name AS value_name
FROM sys_code_values_v v
WHERE v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code = 'ACR512_INVOICE_KIND_TYPE'
AND EXISTS
(SELECT 1
FROM acr_invoice_create_tmp t
WHERE t.record_id = ${/parameter/@record_id}
AND t.invoice_type = 'PAPER'
AND v.code_value IN ('PAPER_GENERAL','PAPER_SPECIAL'))
UNION ALL
SELECT v.code_value AS value_code, v.code_value_name AS value_name
FROM sys_code_values_v v
WHERE v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code = 'ACR512_INVOICE_KIND_TYPE'
AND EXISTS (SELECT 1
FROM acr_invoice_create_tmp t
WHERE t.record_id = ${/parameter/@record_id}
AND t.invoice_type = 'ECT'
AND v.code_value IN ('ELECTRONIC_GENERAL','ELECTRONIC_SPECIAL'))
UNION ALL
SELECT v.code_value AS value_code, v.code_value_name AS value_name
FROM sys_code_values_v v
WHERE v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code = 'ACR512_INVOICE_KIND_TYPE'
AND EXISTS (SELECT 1
FROM acr_invoice_create_tmp t
WHERE t.record_id = ${/parameter/@record_id}
AND t.invoice_type not in('PAPER','ECT')
AND v.code_value IN ('RECEIPT'))
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="value_code" />
<bm:field name="value_name" />
</bm:fields>
</bm:model>
\ No newline at end of file
......@@ -26,6 +26,13 @@
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>';
}else if(name == 'invoice_file_name'){
if(record.get('invoice_file_name')){
var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var url = '<a href=' + link + record.get('attach_id') + '>'+record.get('invoice_file_name')+'</a>';
return url;
}
}
return value;
};
......
......@@ -8,6 +8,7 @@
<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:model-query model="basic.sys_invoice_kind_type_v" rootPath="acr512_invoice_kind_type"/>
</a:init-procedure>
<a:view>
<a:link id="svcLink_create_invoice" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_create.lsc"/>
......@@ -126,6 +127,22 @@
}
}
}
window['acr510_get_object_for_invoice'] = function(object) {
debugger;
var record = object.record;
var name = object.binder.name;
var url = '${/request/@context_path}/autocrud/basic.sys_invoice_kind_type_v/query';
if(name=='invoice_kind_type_n'){
var combobox_ds =$('invoiceKindDs');
combobox_ds.setQueryUrl(url);
combobox_ds.setQueryParameter('record_id', record.get('record_id'));
combobox_ds.query();
}
};
]]></script>
<style><![CDATA[
.item-radio-option {
......@@ -133,7 +150,10 @@
}
]]></style>
<a:dataSets>
<a:dataSet id="invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>
<!--<a:dataSet id="invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>-->
<a:dataSet id="invoiceKindDs">
<a:datas dataSource="/model/acr512_invoice_kind_type"/>
</a:dataSet>
<a:dataSet id="headDs" autoCreate="true">
<a:fields>
<a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
......@@ -147,8 +167,10 @@
<a:fields>
<a:field name="billing_amount" required="true"/>
<a:field name="product_name" 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="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="invoice_kind_type"/>
<a:field name="invoice_kind_type_n" displayField="value_name" options="invoiceKindDs" required="true" returnField="invoice_kind_type" valueField="value_code"/>
<a:field name="billing_object"/>
<a:field name="billing_object_name" prompt="开票对象名称"/>
......@@ -178,7 +200,8 @@
<a:column name="times" align="right" width="40"/>
<a:column name="cf_item_desc"/>
<a:column name="product_name" editor="selectedDs_grid_editor_tf" width="150"/>
<a:column name="invoice_kind_desc" editor="selectedDs_grid_editor_comb"/>
<!--<a:column name="invoice_kind_desc" editor="selectedDs_grid_editor_comb"/>-->
<a:column name="invoice_kind_type_n" editorFunction="" editor="selectedDs_grid_editor_comb" width="150"/>
<a:column name="billing_object_name" width="150"/>
<a:column name="currency_desc" align="center"/>
......@@ -190,7 +213,11 @@
<a:column name="billing_amount" align="right" editor="selectedDs_grid_editor_nf" renderer="Leaf.formatMoney" footerRenderer="sum_foot"/>
</a:columns>
<a:editors>
<a:comboBox id="selectedDs_grid_editor_comb"/>
<a:comboBox id="selectedDs_grid_editor_comb">
<a:events>
<a:event name="focus" handler="window[&apos;acr510_get_object_for_invoice&apos;]"/>
</a:events>
</a:comboBox>
<a:textField id="selectedDs_grid_editor_tf"/>
<a:numberField id="selectedDs_grid_editor_nf"/>
</a:editors>
......
......@@ -8,6 +8,7 @@
<a:init-procedure>
<a:model-query model="basic.sys_session_info" rootPath="default_value_record"/>
<a:model-query model="acr.ACR510.acr_invoice_group_penalty_billing_method" rootPath="group_billing_method_list"/>
<a:model-query model="basic.sys_invoice_kind_type_v" rootPath="acr512_invoice_kind_type"/>
</a:init-procedure>
<a:view>
<a:link id="svcLink_create_invoice" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_penalty_create.lsc"/>
......@@ -119,9 +120,26 @@
}
}
}
window['acr510_get_object_for_invoice'] = function(object) {
debugger;
var record = object.record;
var name = object.binder.name;
var url = '${/request/@context_path}/autocrud/basic.sys_invoice_kind_type_v/query';
if(name=='invoice_kind_type_n'){
var combobox_ds =$('invoiceKindDs');
combobox_ds.setQueryUrl(url);
combobox_ds.setQueryParameter('record_id', record.get('record_id'));
combobox_ds.query();
}
};
]]></script>
<a:dataSets>
<a:dataSet id="invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>
<!--<a:dataSet id="invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>-->
<a:dataSet id="invoiceKindDs">
<a:datas dataSource="/model/acr512_invoice_kind_type"/>
</a:dataSet>
<a:dataSet id="headDs" autoCreate="true">
<a:fields>
<a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
......@@ -135,8 +153,10 @@
<a:fields>
<a:field name="billing_amount" required="true"/>
<a:field name="product_name" 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="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="invoice_kind_type"/>
<a:field name="invoice_kind_type_n" displayField="value_name" options="invoiceKindDs" required="true" returnField="invoice_kind_type" valueField="value_code"/>
<a:field name="billing_object"/>
<a:field name="billing_object_name" prompt="开票对象名称"/>
......@@ -165,7 +185,8 @@
<a:column name="contract_number" width="150"/>
<a:column name="cf_item_desc"/>
<a:column name="product_name" editor="selectedDs_grid_editor_tf" width="150"/>
<a:column name="invoice_kind_desc" editor="selectedDs_grid_editor_comb"/>
<!--<a:column name="invoice_kind_desc" editor="selectedDs_grid_editor_comb"/>-->
<a:column name="invoice_kind_type_n" editorFunction="" editor="selectedDs_grid_editor_comb" width="150"/>
<a:column name="billing_object_name" width="150"/>
<a:column name="currency_desc" align="center"/>
......@@ -175,7 +196,11 @@
<a:column name="billing_amount" align="right" editor="selectedDs_grid_editor_nf" renderer="Leaf.formatMoney" footerRenderer="sum_foot"/>
</a:columns>
<a:editors>
<a:comboBox id="selectedDs_grid_editor_comb"/>
<a:comboBox id="selectedDs_grid_editor_comb">
<a:events>
<a:event name="focus" handler="window[&apos;acr510_get_object_for_invoice&apos;]"/>
</a:events>
</a:comboBox>
<a:textField id="selectedDs_grid_editor_tf"/>
<a:numberField id="selectedDs_grid_editor_nf"/>
</a:editors>
......
......@@ -280,8 +280,38 @@
<a:record code_value="REPUR" code_value_name="解约回购"/>
</a:datas>
</a:dataSet>
<a:dataSet id="acr510n_invoice_type_ds">
<a:datas>
<a:record code_value="ECT" code_value_name="电子发票"/>
<a:record code_value="PAPER" code_value_name="纸质发票"/>
</a:datas>
</a:dataSet>
<a:dataSet id="acr510n_division_ds">
<a:datas>
<a:record code_value="10" code_value_name="国产挖机"/>
<a:record code_value="20" code_value_name="进口挖机"/>
<a:record code_value="30" code_value_name="高空作业车"/>
<a:record code_value="40" code_value_name="其它"/>
<a:record code_value="50" code_value_name="星邦高空作业车"/>
</a:datas>
</a:dataSet>
<a:dataSet id="acr510n_invoice_method_ds">
<a:datas>
<a:record code_value="NO_BILLING" code_value_name="暂不开票"/>
<a:record code_value="BILLING" code_value_name="按期开票"/>
</a:datas>
</a:dataSet>
<a:dataSet id="allConditionDs" autoCreate="true">
<a:fields>
<a:field name="invoice_method"/>
<a:field displayField="code_value_name" name="invoice_method_n" options="acr510n_invoice_method_ds"
returnField="invoice_method" valueField="code_value"/>
<a:field name="division"/>
<a:field displayField="code_value_name" name="division_n" options="acr510n_division_ds"
returnField="division" valueField="code_value"/>
<a:field name="invoice_type"/>
<a:field displayField="code_value_name" name="invoice_type_n" options="acr510n_invoice_type_ds"
returnField="invoice_type" valueField="code_value"/>
<a:field name="business_type"/>
<a:field name="bill_object_bp_class"/>
<a:field name="business_type_desc" displayField="code_value_name" options="business_type_desc_ds"
......@@ -475,8 +505,11 @@
<a:comboBox name="bill_object_bp_class_desc" bindTarget="allConditionDs" prompt="商业伙伴分类"/>
</a:hBox>
<a:hBox>
<a:comboBox name="write_off_flag_desc" bindTarget="allConditionDs" prompt="核销标识"/>
<a:comboBox name="ccr_document_type_desc" bindTarget="allConditionDs" prompt="变更类型"/>
<a:comboBox bindTarget="allConditionDs" name="write_off_flag_desc" prompt="核销标识"/>
<a:comboBox bindTarget="allConditionDs" name="ccr_document_type_desc" prompt="变更类型"/>
<a:comboBox bindTarget="allConditionDs" name="invoice_method_n" prompt="开票方式"/>
<a:comboBox bindTarget="allConditionDs" name="division_n" prompt="租赁物"/>
<a:comboBox bindTarget="allConditionDs" name="invoice_type_n" prompt="开票类型"/>
</a:hBox>
<!-- <a:formBody column="4" labelWidth="400">
<a:lov name="contract_number_from" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NUMBER_FROM"/>
......@@ -541,6 +574,8 @@
<a:column name="exchange_rate" align="right" width="80"/>
<a:column name="exchange_rate_type_desc" width="100"/> -->
<a:column name="bill_object_bp_class_desc" width="100" align="center" prompt="商业伙伴分类" />
<a:column name="invoice_method_n" prompt="开票方式" width="100"/>
<a:column name="division_n" prompt="租赁物" width="100"/>
<a:column name="write_off_flag_desc" width="100" align="center" prompt="核销标记" />
</a:columns>
......@@ -562,6 +597,7 @@
width="200"/>
<a:column name="object_tax_registry_num" prompt="纳税人识别号" width="150"/>
<a:column name="object_taxpayer_type_desc" prompt="纳税人类型" align="center" width="150"/>
<a:column name="invoice_type_n" prompt="开票类型" width="150"/>
<a:column name="invoice_bp_address_phone_num" autoAdjust="false" prompt="开票地址电话"
showTitle="true" width="200"/>
<a:column name="invoice_bp_bank_account" autoAdjust="false" prompt="开户行及账号"
......
......@@ -252,6 +252,7 @@
var saveData = [];
var invoice_hd_ids = '';
var invoice_kind = records[0].get('invoice_kind');
var invoice_type = records[0].get('invoice_type');
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
......@@ -262,6 +263,10 @@
$L.showErrorMessage("提示", '普票和专票不能同时勾选!');
return;
}
if(invoice_type != records[i].get('invoice_type')){
$L.showErrorMessage("提示", '纸质发票与电子发票不能同时勾选!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
......@@ -324,7 +329,8 @@
<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_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>-->
<a:dataSet id="acr512_invoice_kind_type_ds" lookupCode="ACR512_INVOICE_KIND_TYPE"/>
<a:dataSet id="acr512_invoice_status_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="hls_lease_channel_ds" loadData="true" model="basic.hls_lease_channel_for_lov"/>
<a:dataSet id="acr512_invoice_query_ds">
......@@ -333,11 +339,14 @@
returnField="currency" valueField="currency_code"/>
<a:field name="invoice_status_n" displayField="code_value_name" options="acr512_invoice_status_ds"
returnField="invoice_status" valueField="code_value"/>
<a:field name="invoice_kind"/>
<!--<a:field name="invoice_kind"/>-->
<a:field name="invoice_kind_type"/>
<a:field name="contract_name"/>
<a:field name="invoice_bp_name"/>
<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_desc" displayField="code_value_name" options="acr512_invoice_kind_ds"-->
<!--returnField="invoice_kind" valueField="code_value"/>-->
<a:field name="invoice_kind_type_n" displayField="code_value_name" options="acr512_invoice_kind_type_ds"
returnField="invoice_kind_type" 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"
......@@ -462,8 +471,9 @@
-->
<!-- <a:lov name="invoice_bp_code_t" bindTarget="acr512_invoice_query_ds" prompt="客户编号到" width="135"/>-->
<a:textField name="invoice_bp_name" 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:comboBox name="invoice_kind_desc" bindTarget="acr512_invoice_query_ds" prompt="ACR.INVOICE_KIND"-->
<!--width="135"/>-->
<a:comboBox name="invoice_kind_type_n" bindTarget="acr512_invoice_query_ds" prompt="发票种类" width="135"/>
<a:comboBox name="invoice_status_n" bindTarget="acr512_invoice_query_ds" prompt="发票状态" width="135"/>
</a:hBox>
</a:form>
......@@ -479,7 +489,9 @@
<!--
<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_type_n" prompt="开票类型" width="100"/>-->
<!--<a:column name="invoice_kind_desc" prompt="ACR.INVOICE_KIND" width="100"/>-->
<a:column name="invoice_kind_type_n" prompt="发票种类" width="200"/>
<!-- <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"/> -->
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(java.io);
try{
data = $bm('acr.ACR515.ele_system_parameter').queryAsMap().getChildren();
//上传的临时文件夹
var base_temp_dir=data[0].base_temp_dir;
//电子发票附件文件夹
var base_ele_dir=data[0].base_ele_dir;
var year =data[0].year;
var month=data[0].month;
var session_id=$ctx.session.session_id;
//上传临时文件夹
var file_path=base_temp_dir+"\\"+session_id+"\\";
var tranfer_file_path=base_ele_dir+"\\"+year+"\\"+month+"\\";
var tranfer_dir= new File(String(tranfer_file_path));
if(!tranfer_dir.exists()){//如果文件夹不存在,创建年月文件夹
tranfer_dir.mkdirs();//创建文件夹
}
//导入数据,暂时先注释
//$bm('acr.ACR515.hls_vat_confirm').execute();
//验证文件是否存在并把文件转移到附件文件夹
sub_temp_map = $bm('acr.ACR515.hls_vat_import_tmp').queryAsMap({
"ele_file_flag":"Y"
}).getChildren();
for (var j = 0;j < sub_temp_map.length;j++) {
var file_name=file_path+sub_temp_map[j].segment36;
println(file_name);
var filePdf=new File(String(file_name));
if(filePdf.exists()){
// println('Y');
//转移文件至正式文件夹
var input,output;
try{
input = new FileInputStream(filePdf);
output = new FileOutputStream(tranfer_file_path+sub_temp_map[j].ele_unique_file_name);//文件名唯一
var buf = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
var bytesRead;
while ((bytesRead = input.read(buf)) > 0) {
output.write(buf, 0, bytesRead);
}
input.close();
output.close();
var file_length=get_file_length(tranfer_file_path+sub_temp_map[j].ele_unique_file_name);
//插入附件关联关系表,如果数量很多,也可以在文件全部复制完成后,再统一执行,避免多次调用bm
println(sub_temp_map[j].vat_doc_number);
$bm('acr.ACR515.hls_vat_confirm').update({
document_number:sub_temp_map[j].vat_doc_number,
file_path:String(tranfer_file_path+sub_temp_map[j].ele_unique_file_name),
file_name:sub_temp_map[j].segment36,
file_length:file_length
});
}catch(e){
if(input!=null){
input.close();
}
if(output!=null){
output.close();
}
println(e);
raise_app_error('复制至附件目录文件出错,请联系管理员!');
}
}
}
//导入数据,暂时先注释
$bm('acr.ACR515.hls_vat_confirm').execute();
}catch(e){
//报错后清空临时表中数据
$bm('acr.ACR515.delete_vat_tmp').execute();
raise_app_error(e);
}
//-----------------------------------------------------------
//获取文件长度
function get_file_length(path){
var file=new File(String(path));
if (file.exists() && file.isFile()){
//println(f.length());
length=file.length();
return length;
} else{
return 0;
}
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
......@@ -347,7 +347,8 @@
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acr515_invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>
<!--<a:dataSet id="acr515_invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>-->
<a:dataSet id="acr515_invoiceKindDs" lookupCode="ACR512_INVOICE_KIND_TYPE"/>
<a:dataSet id="acr515_invoiceStatusDs" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="acr515_express_status_ds" lookupCode="ACR518_EXPRESS_STATUS"/>
<a:dataSet id="acr515_vat_interface_status_ds" lookupCode="ACR515_VAT_INTERFACE_STATUS"/>
......@@ -362,9 +363,12 @@
<a:fields>
<a:field name="currency_desc" displayField="currency_name" options="acr515_currencyDs"
returnField="currency" valueField="currency_code"/>
<a:field name="invoice_kind"/>
<!--<a:field name="invoice_kind"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr515_invoiceKindDs"
returnField="invoice_kind" valueField="code_value"/>
returnField="invoice_kind" valueField="code_value"/>-->
<a:field name="invoice_kind_type"/>
<a:field name="invoice_kind_type_n" displayField="code_value_name" options="acr515_invoiceKindDs"
returnField="invoice_kind_type" valueField="code_value"/>
<a:field name="invoice_status_desc" displayField="code_value_name" options="acr515_invoiceStatusDs"
returnField="invoice_status" valueField="code_value"/>
<a:field name="vat_interface_status" defaultValue="UNTRANSFERED"/>
......@@ -501,7 +505,8 @@
<div><![CDATA[${l:ACR.TOTAL_AMOUNT_TO}]]></div>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr515_invoiceVatParaDs"
prompt="" width="150"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr515_invoiceVatParaDs" width="150"/>
<!--<a:comboBox name="invoice_kind_desc" bindTarget="acr515_invoiceVatParaDs" width="150"/>-->
<a:comboBox name="invoice_kind_type_n" bindTarget="acr515_invoiceVatParaDs" width="150" prompt="发票种类"/>
<a:lov name="created_by_name" bindTarget="acr515_invoiceVatParaDs" width="150" prompt="创建人"/>
</a:hBox>
<a:hBox labelSeparator=" ">
......@@ -517,8 +522,9 @@
<a:column name="invoice_apply_num" width="120" prompt="申请编号" lock="true"/>
<a:column name="contract_number" width="120"/>
<!-- <a:column name="business_type_desc" width="80"/>-->
<a:column name="billing_way_desc" width="80" prompt="开票方式"/>
<a:column name="invoice_kind_desc" width="100"/>
<!-- <a:column name="billing_way_desc" width="80" prompt="开票方式"/>-->
<!-- <a:column name="invoice_kind_desc" width="100"/>-->
<a:column name="invoice_kind_type_n" width="200" prompt="发票种类"/>
<a:column name="invoice_number" width="120"/>
<a:column name="vat_invoice_code" width="120"/>
<a:column name="invoice_date" renderer="Leaf.formatDate" width="100"/>
......
......@@ -7,6 +7,9 @@
<a:link id="acr515_check_import_link" model="acr.ACR515.check_vat_tmp" modelaction="execute"/>
<a:link id="acr515_confirm_import_link" model="acr.ACR515.hls_vat_confirm" modelaction="execute"/>
<a:link id="hls_acr_vat_exit_link" url="${/request/@context_path}/modules/acr/ACR515/acr_invoice_vat.lview"/>
<a:link id="hls_acr515_zip_file_upload_link" url="${/request/@context_path}/modules/acr/ACR515/hls_acr_vat_import_zip_upload.lview"/>
<a:link id="acr515_confirm_all_import_link" url="${/request/@context_path}/modules/acr/ACR515/acr515_import_data_and_zip_file.lsc"/>
<a:link id="acr515_import_btn_check_link" model="acr.ACR515.import_but_check" modelaction="execute"/>
<script><![CDATA[
//$('submitbtn').disable();
......@@ -35,7 +38,8 @@
var detail_mask = Ext.getBody();
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('acr515_confirm_import_link').getUrl(),
// url: $('acr515_confirm_import_link').getUrl(),
url: $('acr515_confirm_all_import_link').getUrl(),
success: function(args) {
Leaf.showMessage('提示信息', '操作成功', $('import_data_ds').query());
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
......@@ -61,6 +65,34 @@
function exit() {
window.location.href = $('hls_acr_vat_exit_link').getUrl();
}
function importEtc(){
debugger;
var records = $('import_data_ds').getAll();
if(records.length <= 0){
Leaf.showMessage('提示信息','请先导入金税回传文件后再导入电子发票文件!');
return;
}
Leaf.request({
url: $('acr515_import_btn_check_link').getUrl(),
para: {
vat_doc_number : records[0].get('vat_doc_number')
},
success: function(args) {
new Leaf.Window({
id: 'upload_zip_window',
url: $('hls_acr515_zip_file_upload_link').getUrl(),
params: {
winId: 'upload_zip_window'
},
prompt: 'zip文件上传',
width: 420,
height: 280
});
},
scope: this
});
}
]]></script>
<a:dataSets>
<a:dataSet id="import_data_ds" autoQuery="true" fetchAll="true" model="acr.ACR515.hls_vat_import_tmp"/>
......@@ -72,6 +104,7 @@
<a:button id="submitbtn_id" click="submitbtn" text="确定"/>
<a:button click="showerrorbtn" text="显示错误信息"/>
<a:button click="exit" text="退出"/>
<a:button click="importEtc" text="导入电子发票文件"/>
</a:hBox>
<a:grid bindTarget="import_data_ds" height="500" marginWidth="30">
<a:columns>
......@@ -114,6 +147,7 @@
<a:column name="segment33" prompt="享受税收优惠政策内容" width="150"/>
<a:column name="segment34" prompt="零税率标识" width="150"/>
<a:column name="segment35" prompt="扣除额" width="150"/>
<a:column name="segment36" prompt="pdf文件名" width="150"/>
</a:columns>
</a:grid>
</a:screenBody>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick() {
var winId = '${/parameter/@winId}';
if (document.getElementById('importFile').value) {
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
if (fileType != '.zip') {
alert('请选择正确的zip文件!');
} else {
Leaf.Masker.mask($(winId).wrap, '导入中...');
document.getElementById('importForm').submit();
}
}
}
]]></script>
<a:dataSets>
<a:dataSet id="label_ds" autoCreate="true">
<a:fields>
<a:field name="label2" defaultValue="1、 严格按照导入模板数据整理文件,检查文件名对应关系。"/>
<a:field name="label3" defaultValue="2、 所有电子发票附件打包成一个文件,方可进行产文件导入。"/>
<a:field name="label4" defaultValue="3、 本导入程序只支持zip类型文件。"/>
<a:field name="label5" defaultValue="仔细阅读上述事项,并检查确认无误。"/>
<a:field name="label6" defaultValue="导入完毕后,请在系统内核实数据是否导入成功。"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入注意事项" width="400">
<a:label name="label2" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label3" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label4" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label5" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
<a:label name="label6" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="hls_acr_vat_zip_file_upload_handle.lview" enctype="multipart/form-data" method="post">
<label style="margin-left:10px;margin-top:10px;"><![CDATA[请选择文件:]]></label>
<input name="CONTENT" id="importFile" style="margin-bottom:4px;width:160px;height:22px;" type="file"/>
<input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button" value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<p:echo/>
<s:server-script><![CDATA[
importPackage(java.io);
var request = $ctx['_instance.javax.servlet.http.HttpServletRequest'];
var response = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
try{
data = $bm('acr.ACR515.ele_system_parameter').queryAsMap().getChildren();
var base_dir=data[0].base_temp_dir;
println(base_dir);
var factory = new Packages.org.apache.commons.fileupload.disk.DiskFileItemFactory();
//println('factory');
var up = new Packages.org.apache.commons.fileupload.servlet.ServletFileUpload(factory);
var items = up.parseRequest(request);
var i = items.iterator();
while (i.hasNext()) {
var item = i.next();
if (item.isFormField()) {
println("item.getFieldName()"+item.getFieldName() + "=" + item.getString());
} else {
var session_id=$ctx.session.session_id;
var file_name = session_id+'.zip';
var file_path = base_dir+'\\'+session_id+'\\';
try{
//删除主目录下一天前的文件
println(base_dir);
deleteIfExistsBefore1Day(base_dir);
//递归删除同名文件目录不知道为什么主目录没有删除
deleteIfExists(file_path);
var dir=new File(String(file_path));
if(dir.exists()){
dir.delete();
}
println(file_path);
createDir(file_path);
}catch(e){
raise_app_error('清理临时文件夹出错!');
println('清理临时文件夹出错!e' + e);
}
//item.write(new java.io.File(file_path, file_name));
// println(item);
var f = item.getStoreLocation();
//println( f);
var input,output;
var tempFile=new File(String(f));
try{
input = new FileInputStream(tempFile);
output = new FileOutputStream(file_path+file_name);
var buf = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
var bytesRead;
while ((bytesRead = input.read(buf)) > 0) {
output.write(buf, 0, bytesRead);
}
input.close();
output.close();
if(tempFile.exists()){
tempFile.delete();//清理临时文件
}
}catch(e){
println('上传文件出错,请联系管联系管理员理员!e'+e);
if(input!=null){
input.close();
}
if(output!=null){
output.close();
}
if(tempFile.exists()){
tempFile.delete();//清理临时文件
}
raise_app_error('上传文件出错,请联系管理员!');
println('上传文件出错,请联系管理员!e');
}
//----------------------------------------解压文件----------------------------------------------
var fos,is,zf ;
try{
unzip(file_path+file_name, file_path,fos,is,zf);
}catch(e){
if(fos!=null){
fos.close();
}
if(is!=null){
is.close();
}
if(zf!=null){
zf.close();
}
raise_app_error('解压文件夹出错!');
println('解压文件夹出错!e' );
}
//---------------------------------查找文件是否存在如果存在更新临时表文件名字段---------------------------------------------
sub_temp_map = $bm('acr.ACR515.hls_vat_import_tmp').queryAsMap().getChildren();
for (var j = 0;j < sub_temp_map.length;j++) {
//println(sub_temp_map[j].vat_code+'_'+sub_temp_map[j].vat_number);
var filePdf=new File(String(file_path+sub_temp_map[j].vat_code+'_'+sub_temp_map[j].vat_number+'.pdf'));
if(filePdf.exists()){
//存在则更新临时表 对应文件名字段
$bm('acr.ACR515.check_vat_tmp').update({
"vat_code": sub_temp_map[j].vat_code,
"vat_number": sub_temp_map[j].vat_number,
"file_name": String(sub_temp_map[j].vat_code+'_'+sub_temp_map[j].vat_number+'.pdf')
})
}else{
//存在则更新临时表 对应文件名字段
$bm('acr.ACR515.check_vat_tmp').update({
"vat_code": sub_temp_map[j].vat_code,
"vat_number": sub_temp_map[j].vat_number,
"file_name": null
})
}
}
}
}
}catch (e) {
raise_app_error(e);
}
//---------------------------------------------------------
//删除同名session文件夹
function deleteIfExists(dir){
var file=new File(String(dir));
if(file.exists()){
if(file.isFile()){
file.delete();
}else{
var files = file.listFiles();
if (files != null && files.length > 0) {
for (var i = 0;i < files.length;i++){
var temp=files[i];
deleteIfExists(temp);
}
}
file.delete();
}
}
}
//---------------------------------------------------------
//删除n天前的文件
function deleteIfExistsBefore1Day(dir){
var cdweek = new java.util.Calendar.getInstance();
cdweek.add(java.util.Calendar.DATE, -1);
var d = cdweek.getTime();
var file=new File(String(dir));
if(file.exists()){
var time =file.lastModified();
var cd = new java.util.Calendar.getInstance();
cd.setTimeInMillis(time);
//文件的最后一次修改的时间
var fileDate = cd.getTime();
var flag = fileDate.before(d);
if(file.isFile()){
if(flag){
file.delete();
}
}else{
var files = file.listFiles();
if (files != null && files.length > 0) {
for (var i = 0;i < files.length;i++){
var temp=files[i];
deleteIfExistsBefore1Day(temp);
}
}
if(flag){
file.delete();
}
}
}
}
function createDir(dir){
var file=new File(String(dir));
if(!file.exists()){//如果文件夹不存在
file.mkdirs();//创建文件夹
}
}
//---------------------------------------------------------
/**
* 解压缩
* @param fileName
* @param path
*/
function unzip(fileName,path,fos,is,zf)
{
var zipFile=new File(String(fileName));
zf = new java.util.zip.ZipFile(zipFile,java.nio.charset.Charset.forName("GBK"));
var en = zf.entries();
while (en.hasMoreElements())
{
var zn = en.nextElement();
if (!zn.isDirectory())
{
is = zf.getInputStream(zn);
//把所有文件解压到当前目录层级,不使用压缩包中的目录结构
var fileName = zn.getName().substring(zn.getName().lastIndexOf("/")+1);  
          fileName = fileName.substring(fileName.lastIndexOf("\\")+1);  
var f = new File(String(path + fileName));
//println(zn.getName());
// var file = f.getParentFile();
// file.mkdirs();
fos = new FileOutputStream(path + fileName);
var len = 0;
var bufer = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
while (-1 != (len = is.read(bufer)))
{
fos.write(bufer, 0, len);
}
fos.close();
is.close();
}
}
zf.close();
}
]]></s:server-script>
</a:init-procedure>
<a:view>
<a:link id="hls_acr_vat_import_link_to" url="${/request/@context_path}/modules/acr/ACR515/hls_acr_vat_import_data.lview"/>
<script type="text/javascript"> <![CDATA[
window.location.href = $('hls_acr_vat_import_link_to').getUrl();
]]></script>
</a:view>
</a:screen>
......@@ -80,7 +80,8 @@
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acr516_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>
<!--<a:dataSet id="acr516_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>-->
<a:dataSet id="acr516_invoice_kind_ds" lookupCode="ACR512_INVOICE_KIND_TYPE"/>
<a:dataSet id="acr516_invoice_statu_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="acr516_claim_status_ds" lookupCode="CLAIM_STATUS"/>
<a:dataSet id="cf_item_options">
......@@ -98,8 +99,11 @@
<a:dataSet id="acr516_invoice_query_ds" autoCreate="true">
<a:fields>
<a:field name="invoice_apply_num"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr516_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>
<!--<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr516_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>-->
<a:field name="invoice_kind_type"/>
<a:field name="invoice_kind_type_n" displayField="code_value_name" options="acr516_invoice_kind_ds"
returnField="invoice_kind_type" valueField="code_value"/>
<a:field name="invoice_status_desc" displayField="code_value_name" options="acr516_invoice_statu_ds"
returnField="invoice_status" valueField="code_value"/>
<a:field name="total_amount"/>
......@@ -148,7 +152,9 @@
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr516_invoice_query_ds"
prompt="开票金额含税额到" width="120"/>
<a:textField name="invoice_title" bindTarget="acr516_invoice_query_ds" prompt="发票抬头" width="120"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr516_invoice_query_ds" prompt="ACR.INVOICE_KIND"
<!--<a:comboBox name="invoice_kind_desc" bindTarget="acr516_invoice_query_ds" prompt="ACR.INVOICE_KIND"
width="120"/>-->
<a:comboBox name="invoice_kind_type_n" bindTarget="acr516_invoice_query_ds" prompt="发票种类"
width="120"/>
<!-- <a:comboBox name="invoice_status_desc" bindTarget="acr516_invoice_query_ds" prompt="发票状态" width="135"/>-->
<a:textField name="vat_invoice_code" bindTarget="acr516_invoice_query_ds" prompt="发票代码" width="120"/>
......@@ -169,7 +175,8 @@
width="150"/>
<!-- <a:column name="contract_name" width="150" prompt="合同名称"/>-->
<a:column name="bp_agent_name" prompt="代理商" width="100"/>
<a:column name="invoice_kind_desc" prompt="发票种类" width="100"/>
<!-- <a:column name="invoice_kind_desc" prompt="发票种类" width="100"/>-->
<a:column name="invoice_kind_type_n" prompt="发票类型" width="200"/>
<a:column name="invoice_number" width="120" prompt="发票号码"/>
<a:column name="vat_invoice_code" width="120" prompt="发票代码"/>
<a:column name="invoice_date" renderer="Leaf.formatDate" prompt="发票日期" width="100"/>
......
......@@ -134,7 +134,8 @@
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acr517_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>
<!-- <a:dataSet id="acr517_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>-->
<a:dataSet id="acr517_invoice_kind_ds" lookupCode="ACR512_INVOICE_KIND_TYPE"/>
<a:dataSet id="acr517_invoice_statu_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="acr517_claim_status_ds" lookupCode="CLAIM_STATUS"/>
<a:dataSet id="cf_item_options">
......@@ -153,8 +154,11 @@
<a:fields>
<a:field name="document_number"/>
<a:field name="invoice_apply_num"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr517_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>
<!-- <a:field name="invoice_kind_desc" displayField="code_value_name" options="acr517_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>-->
<a:field name="invoice_kind_type"/>
<a:field name="invoice_kind_type_n" displayField="code_value_name" options="acr517_invoice_kind_ds"
returnField="invoice_kind_type" valueField="code_value"/>
<a:field name="invoice_status_desc" displayField="code_value_name" options="acr517_invoice_statu_ds" returnField="invoice_status" valueField="code_value"/>
<a:field name="total_amount"/>
<a:field name="csh_transaction_flag"/>
......@@ -196,7 +200,8 @@
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr517_invoice_query_ds" prompt="开票金额含税额从" width="120"/>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr517_invoice_query_ds" prompt="开票金额含税额到" width="120"/>
<a:textField name="invoice_title" bindTarget="acr517_invoice_query_ds" prompt="发票抬头" width="120"/>
<a:comboBox name="invoice_kind_desc" bindTarget="acr517_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="120"/>
<!-- <a:comboBox name="invoice_kind_desc" bindTarget="acr517_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="120"/>-->
<a:comboBox name="invoice_kind_type_n" bindTarget="acr517_invoice_query_ds" prompt="发票种类" width="120"/>
<!-- <a:comboBox name="invoice_status_desc" bindTarget="acr517_invoice_query_ds" prompt="发票状态" width="135"/>-->
<a:textField name="vat_invoice_code" bindTarget="acr517_invoice_query_ds" prompt="发票代码" width="120"/>
<a:textField name="invoice_number" bindTarget="acr517_invoice_query_ds" prompt="发票号码" width="120"/>
......@@ -213,7 +218,8 @@
<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="bp_agent_name" prompt="代理商" width="100"/>
<a:column name="invoice_kind_desc" prompt="发票种类" width="100"/>
<!-- <a:column name="invoice_kind_desc" prompt="发票种类" width="100"/>-->
<a:column name="invoice_kind_type_n" prompt="发票种类" width="200"/>
<a:column name="invoice_number" width="120" prompt="发票号码"/>
<a:column name="vat_invoice_code" width="120" prompt="发票代码"/>
<a:column name="invoice_date" renderer="Leaf.formatDate" prompt="发票日期" width="100"/>
......
......@@ -183,6 +183,7 @@
<a:column name="net_amount" prompt="不含税总金额" align="right" renderer="acr610_formatMoney"
width="100"/>
<a:column name="tax_amount" prompt="税额总金额" align="right" renderer="acr610_formatMoney" width="150"/>
<a:column name="invoice_kind_type_n" prompt="发票种类" align="center" width="150"/>
<a:column name="wfl_apply_status_n" prompt="申请状态" align="center" width="150"/>
</a:columns>
</a:grid>
......
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