Commit e892e912 authored by 18083's avatar 18083

手工凭证导入-凭证反冲功能

parent 6db78262
...@@ -29,7 +29,10 @@ ...@@ -29,7 +29,10 @@
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count, WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status, t1.wfl_status,
(select v.code_value_name value_name from sys_code_values_v v where v.code = 'HLS536_WFL_STATUS' and v.code_value = t1.wfl_status) wfl_status_n, (select v.code_value_name value_name from sys_code_values_v v where v.code = 'HLS536_WFL_STATUS' and v.code_value = t1.wfl_status) wfl_status_n,
t1.journal_type t1.reverse_wfl_status,
(select v.code_value_name value_name from sys_code_values_v v where v.code = 'HLS536_WFL_STATUS_REVERSE' and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status from hls_journal_header t where t.journal_num=t1.journal_num) post_gl_status
FROM hls_journal_header_imp t1 FROM hls_journal_header_imp t1
#WHERE_CLAUSE# #WHERE_CLAUSE#
order by t1.journal_header_id desc order by t1.journal_header_id desc
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id}, hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id},
p_header_id => ${/session/@session_id}, p_header_id => ${/session/@session_id},
p_company_id => ${/session/@company_id}, p_company_id => ${/session/@company_id},
p_template_type=>${/parameter/@template_type} p_template_type=>${@template_type}
); );
END; END;
]]></bm:update-sql> ]]></bm:update-sql>
...@@ -18,5 +18,16 @@ ...@@ -18,5 +18,16 @@
<bm:parameter inputPath="/session/@template_type"/> <bm:parameter inputPath="/session/@template_type"/>
</bm:parameters> </bm:parameters>
</bm:operation> </bm:operation>
<bm:operation name="update" >
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.init_journal_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:operations>
</bm:model> </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="insert">
<bm:parameters>
<bm:parameter name="journal_submit_batch_id" output="true" outputPath="@journal_submit_batch_id"/>
</bm:parameters>
<bm:update-sql>
<![CDATA[
declare
v_journal_submit_batch_id hls_journal_submit_batch.journal_submit_batch_id%TYPE := hls_journal_submit_batch_s.nextval;
begin
${@journal_submit_batch_id} := v_journal_submit_batch_id;
insert into hls_journal_submit_batch
(journal_submit_batch_id,
instance_id,
wfl_status,
wfl_type,
created_by,
creation_date,
last_updated_by,
last_update_date)
values
(v_journal_submit_batch_id,
null,
'NEW',
${@wfl_type},
${/session/@user_id},
sysdate,
${/session/@user_id},
sysdate
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql>
<![CDATA[
begin
update hls_journal_header_imp hjhi
set hjhi.reverse_wfl_status = 'NEW',
hjhi.reversed_flag = 'R',
hjhi.journal_submit_batch_id = ${/parameter/@journal_submit_batch_id},
hjhi.last_updated_by = ${/session/@user_id},
hjhi.last_update_date = sysdate
where hjhi.journal_header_id = ${@journal_header_id};
end;
]]>
</bm:update-sql>
<!--<bm:parameters>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>-->
</bm:operation>
<bm:operation name="execute">
<bm:update-sql>
<![CDATA[
begin
hls_journal_import_pkg.submit_hls_journal_reverse(
p_journal_submit_batch_id => ${/parameter/@journal_submit_batch_id},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_id}
);
end;
]]>
</bm:update-sql>
<!--<bm:parameters>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>-->
</bm:operation>
</bm:operations>
</bm:model>
<?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>
<p:echo></p:echo>
<a:model-insert model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
<a:batch-apply sourcepath="/parameter/details">
<a:model-update model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
</a:batch-apply>
<a:model-execute model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
...@@ -17,17 +17,18 @@ ...@@ -17,17 +17,18 @@
<!--<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_handle.lview"/>--> <!--<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_handle.lview"/>-->
<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_upload.lview"/> <a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_upload.lview"/>
<a:link id="hls_journal_submit_link_id" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_tmp.lsc"/> <a:link id="hls_journal_submit_link_id" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_tmp.lsc"/>
<a:link id="hls_journal_reverse_link_id" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_reverse.lsc"/>
<a:link id="hls_journal_import_delete_link" model="hls.HLS536.hls_journal_import_delete" <a:link id="hls_journal_import_delete_link" model="hls.HLS536.hls_journal_import_delete"
modelaction="batch_update"/> modelaction="batch_update"/>
<a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<script><![CDATA[ <script><![CDATA[
//查询按钮
//查询按钮
function hls536_journal_query() { function hls536_journal_query() {
$('hls_journal_header_result_ds').query(); $('hls_journal_header_result_ds').query();
} }
//重置按钮
//重置按钮
function hls536_journal_reset() { function hls536_journal_reset() {
$('hls_journal_header_query').reset(); $('hls_journal_header_query').reset();
} }
...@@ -39,13 +40,13 @@ ...@@ -39,13 +40,13 @@
} }
// function lock_current_window(msg) { function lock_current_window(msg) {
// Leaf.Masker.mask(Ext.getBody(), msg); Leaf.Masker.mask(Ext.getBody(), msg);
// } }
//function unlock_current_window() { function unlock_current_window() {
//Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
//} }
function hls536_journal_import(){ function hls536_journal_import(){
new Leaf.Window({ new Leaf.Window({
...@@ -165,7 +166,56 @@ ...@@ -165,7 +166,56 @@
}); });
}, null); }, null);
} }
} }
//反冲
function hls536_journal_reverse(){
debugger;
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
//凭证传输状态不为Y的不能进行反冲
for (var i = 0; i < records.length; i++) {
if (records[i].get('wfl_status') != 'APPROVED' || records[i].get('post_gl_status') != 'Y') {
Leaf.showMessage('提示', '凭证没有审批通过或者凭证没有传输至SBO,请检查!');
return;
}
}
var journal_header_imp_list = [];
for (var i = 0; i < records.length; i++) {
var record = records[i];
record.set('_status','update')
journal_header_imp_list.push(record.data);
}
var param = {};
param['details'] = journal_header_imp_list;
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交审批?', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
//先生成批次表数据,再update这几条数据的状态,最后提交工作流
Leaf.request({
url: $('hls_journal_reverse_link_id').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示', '提交审批成功!');
// 审批成功后查询gird
hls536_journal_query();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, null);
}
function hls536_link_dynamic(reocrd_id, journal_header_id) { function hls536_link_dynamic(reocrd_id, journal_header_id) {
//增加逻辑:审批中、审批通过的只读;新建、审批拒绝的可编辑 //增加逻辑:审批中、审批通过的只读;新建、审批拒绝的可编辑
...@@ -306,7 +356,7 @@ ...@@ -306,7 +356,7 @@
<a:toolbarButton click="hls536_journal_import" text="导入凭证模板"/> <a:toolbarButton click="hls536_journal_import" text="导入凭证模板"/>
<a:toolbarButton click="hls536_journal_delete" text="删除凭证"/> <a:toolbarButton click="hls536_journal_delete" text="删除凭证"/>
<a:toolbarButton click="hls536_journal_send" text="提交审批"/> <a:toolbarButton click="hls536_journal_send" text="提交审批"/>
<a:toolbarButton click="hls536_journal_reverse" text="反冲"/>
</a:screenTopToolbar> </a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE"> <a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/> <a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
...@@ -332,6 +382,7 @@ ...@@ -332,6 +382,7 @@
<a:column name="description" prompt="凭证摘要" width="220"/> <a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/> <a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/> <a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>
<a:column name="reverse_wfl_status_n" prompt="凭证反冲状态" width="100"/>
<a:column name="attachment_file" prompt="附件" width="120" renderer="receipt_attachment_upload" align="center"/>- <a:column name="attachment_file" prompt="附件" width="120" renderer="receipt_attachment_upload" align="center"/>-
</a:columns> </a:columns>
</a:grid> </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