Commit 02c620a0 authored by 25484's avatar 25484

[fix]进项发票修改

parent 06a6904f
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: feng
$Date: 2013-9-11 下午15:13:20
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql>
<![CDATA[
select c.contract_id, c.contract_number, c.contract_name
from con_contract c
where c.data_class = 'NORMAL'
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="contract_number" forDisplay="true" forQuery="true" prompt="ACR310.CONTRACT_NUMBER"/>
<bm:field name="contract_name" forDisplay="true" forQuery="true" prompt="ACR310.CONTRACT_NAME"/>
<bm:field name="contract_id"/>
</bm:fields>
<!-- <bm:fields>-->
<!-- <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="contract_number" prompt="ACR310.CONTRACT_NUMBER"/>-->
<!-- <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="contract_name" prompt="ACR310.CONTRACT_NAME"/>-->
<!-- <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="contract_id" />-->
<!-- </bm:fields>-->
<bm:query-fields>
<bm:query-field field="contract_number" queryOperator="like"/>
<bm:query-field field="contract_name" queryOperator="like"/>
</bm:query-fields>
</bm:model>
......@@ -9,14 +9,13 @@
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
acp_invoice_import_pkg.acp_invoice_import(p_invoice_type => ${@invoice_type},
p_invoice_code => ${@invoice_code},
p_invoice_number => ${@invoice_number},
p_net_amount => ${@net_amount},
p_invoice_date => ${@invoice_date},
p_last_updated_by => ${/session/@user_id},
p_contract_id => ${@contract_id},
p_invoice_line_id => ${@invoice_line_id});
acp_invoice_import_pkg.acp_invoice_import(p_invoice_type => ${@invoice_type},
p_invoice_code => ${@invoice_code},
p_invoice_number=> ${@invoice_number},
p_net_amount => ${@net_amount},
p_invoice_date => ${@invoice_date},
p_user_id => ${/session/@user_id},
p_contract_id => ${@contract_id});
end;
]]>
</bm:update-sql>
......
......@@ -3,7 +3,11 @@
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
ACP_INVOICE_IMPORT_PKG.ACP_INVOICE_CONFIRM(p_contract_id => ${@contract_id},
p_invoice_line_id => ${@invoice_line_id},
p_user_id => ${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
......
var override_queryfields = [
];
var add_datafilters = [ {
name : 'confirmation_status',
expression : "t1.confirmation_status is null"
} ];
add_datafilter();
override();
var override_queryfields = [
];
var add_datafilters = [ {
name : 'confirmation_status',
expression : "t1.confirmation_status is not null"
} ];
add_datafilter();
override();
......@@ -6,33 +6,44 @@
modelaction="update"/>
<a:link id="ap_invoice_import_detail_link"
url="${/request/@context_path}/modules/acp/ACP522/ap_invoice_import_detail.lview"/>
<a:link id="ap_invoice_import_scanning_link"
url="${/request/@context_path}/modules/acp/ACP522/ap_invoice_import_scanning.lview"/>
<script><![CDATA[
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var url = $('ap_invoice_import_scanning_link').getUrl();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
Leaf.Window({
id: 'ap_invoice_import_scanning',
url: url,
title:'发票导入',
width: 400,
height:140
}).on('close', function() {
$(ds_id).query();
});
};
function ap_invoice_import_detail(){
var param = {};
param['function_code'] = 'ACP522I';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
param['url_title'] = '进项发票导入';
hls_doc_get_layout_code('hn9040_project_get_layout_code_link_id', param, 'ap_invoice_import_detail_link');
}
//超链接渲染
window['${/parameter/@bp_seq}${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) {
var link_function = '';
var invoice_line_id = record.get('invoice_line_id');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment') {
return '<a href="javascript:attachment_window_open(\'' + invoice_line_id + '\',\'' + record.id + '\',\'' + record.ds.id + '\');">' + '上传' + '</a>';
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) {debugger;
if(name == 'contract_number'){
return '<a href="javascript:ap_invoice_import_detail(\'' + invoice_line_id + '\',\'' + record.id + '\',\'' + record.ds.id + '\');">' + value + '</a>';
return '<a href="javascript:ap_invoice_import_detail(\'' + record.id + '\',\'' + record.ds.id + '\');">' + value + '</a>';
}
};
function ap_invoice_import_detail(record_id,ds_id){debugger;
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'MODIFY';
param['function_code'] = 'ACP522I';
param['contract_id'] = record.get('contract_id');
param['url_title'] = '进项发票详情';
hls_doc_get_layout_code('hn9040_project_get_layout_code_link_id', param, 'ap_invoice_import_detail_link', ds_id);
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
......
......@@ -2,31 +2,15 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:view>
<a:link id="ap_invoice_import_scanning_link"
url="${/request/@context_path}/modules/acp/ACP522/ap_invoice_import_scanning.lview"/>
<script><![CDATA[
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var url = $('ap_invoice_import_scanning_link').getUrl();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
var rs = $(ds_id).getSelected();
var contract_id = rs[0].get('contract_id');
var invoice_line_id = rs[0].get('invoice_line_id');
Leaf.Window({
id: 'ap_invoice_import_scanning',
url: url,
params: {
contract_id: contract_id,
invoice_line_id: invoice_line_id
},
title:'${l:HLS.SUPPORTING_DOCUMENT}',
width: 300,
height:100
}).on('close', function() {
$('AP_INVOICE_IMPORT_DETAIL_G_AP_acp_invoice_ln_ds').query();
});
};
Leaf.onReady(function () {
var acp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
if ('${/parameter/@contract_id}') {
$(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(acp_ds_id).query();
}
});
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
......
......@@ -8,39 +8,50 @@
<script><![CDATA[
function invoice_inf_process(dataset, record, name, value, oldvalue) {
debugger;
var test = $('acp522_acp_invoice_import_ds').getAt(0).get('invoice');
var strs = new Array();
strs = test.split(',');
var invoice_type = strs[1];
var invoice_code = strs[2];
var invoice_number = strs[3];
var net_amount = strs[4];
var invoice_date = strs[5];
if (strs.length == 8) {
Leaf.request({
url: $('acp_invoice_inf_import_link').getUrl(),
para: {
invoice_type: invoice_type,
invoice_code: invoice_code,
invoice_number: invoice_number,
net_amount: net_amount,
invoice_date: invoice_date,
contract_id: '${/parameter/@contract_id}',
invoice_line_id: '${/parameter/@invoice_line_id}'
},
success: function (res) {
Leaf.SideBar.show({
msg: '导入成功',
duration: 2000
});
},
scope: this
});
$('ap_invoice_import_scanning').close();
} else {
// $('acp600_acp_invoice_hd_ds').getAt(0).setReadOnly(true);
Leaf.showMessage('提示', '发票信息误!');
if(name == 'invoice') {
record.getField('invoice').setReadOnly(true);
var contract_id = record.get('contract_id');
var strs = value.split(',');
var invoice_type = strs[1];
var invoice_code = strs[2];
var invoice_number = strs[3];
var net_amount = strs[4];
var invoice_date = strs[5];
if (strs.length == 8) {
Leaf.request({
url: $('acp_invoice_inf_import_link').getUrl(),
para: {
invoice_type: invoice_type,
invoice_code: invoice_code,
invoice_number: invoice_number,
net_amount: net_amount,
invoice_date: invoice_date,
contract_id: contract_id
},
success: function () {
Leaf.SideBar.show({
msg: '导入成功',
duration: 2000
},
$('ap_invoice_import_scanning').close()
);
},failure: function() {
record.getField('invoice').setReadOnly(false);
},
error: function() {
record.getField('invoice').setReadOnly(false);
},
scope: this
});
} else {
// $('acp600_acp_invoice_hd_ds').getAt(0).setReadOnly(true);
Leaf.showMessage('提示', '发票信息误!');
record.getField('invoice').setReadOnly(false);
}
}else {
if(value){
record.getField('invoice').setReadOnly(false);
}
}
}
......@@ -48,7 +59,16 @@
<a:dataSets>
<a:dataSet id="acp522_acp_invoice_import_ds">
<a:fields>
<a:field name="invoice" required="true"/>
<a:field name="invoice" required="true" readOnly="true"/>
<a:field name="contract_name" required="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100"
lovService="acp.ACP522.acp_import_contract_lov" lovWidth="520"
title="SELECT_CONTRACT">
<a:mapping>
<a:map from="contract_number" to="contract_number"/>
<a:map from="contract_name" to="contract_name"/>
<a:map from="contract_id" to="contract_id"/>
</a:mapping>
</a:field>
</a:fields>
<a:events>
<a:event name="update" handler="invoice_inf_process"/>
......@@ -57,7 +77,9 @@
</a:dataSets>
<a:screenBody>
<a:form title="请扫描发票二维码">
<a:textField name="invoice" width="270" bindTarget="acp522_acp_invoice_import_ds"/>
<a:lov name="contract_name" bindTarget="acp522_acp_invoice_import_ds" width="270" prompt="SELECT_CONTRACT"/>
<!-- <a:textField name="contract_number" bindTarget="acp522_acp_invoice_import_ds" width="270" prompt="SELECT_CONTRACT"/>-->
<a:textField name="invoice" width="270" bindTarget="acp522_acp_invoice_import_ds" prompt="扫描发票"/>
</a:form>
</a:screenBody>
</a:view>
......
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