Commit 7599ee76 authored by 18083's avatar 18083

手工凭证导入

parent 745dbe07
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[begin
hls_journal_import_pkg.delete_hls_journal_tmp(
p_batch_id => ${/session/@session_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"?>
<!--
$Author: trd
$Date: 2022-12-6 下午2:36:27
$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.journal_header_id,
t1.journal_num,
(select c.company_short_name from fnd_companies_vl c where c.company_id=t1.je_company_id) js_company_short_name,
t1.period_name,
t1.journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
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
FROM hls_journal_header_imp t1 order by t1.journal_header_id desc
]]></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="execute">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id},
p_header_id => ${/session/@session_id},
p_company_id => ${/session/@company_id}
);
END;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter inputPath="/session/@user_id"/>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-11-9 上午10:30:00
$Revision: 1.0
$Purpose: 导入凭证模板修改
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
<a:view>
<a:link id="get_period_name_id" model="csh.CSH511.csh_transaction_get_period_name" modelaction="query"/>
<a:link id="get_new_journal_num_link_id" model="hls.HLS530.get_new_journal_number" modelaction="update"/>
<a:link id="get_document_type_id" model="csh.CSH511.get_document_type" modelaction="update"/>
<script><![CDATA[
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
var journal_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header');
var detail_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_LN', 'hls_journal_detail');
var journal_record = $(journal_ds_id).getAt(0);
var je_records = $(detail_ds_id).getAll();
var sum_dr = 0;
var sum_cr = 0;
for (var i=0;i<je_records.length;i++){
var je_record = je_records[i];
if(!isNaN(je_record.get('amount_dr'))){
sum_dr = (Number(sum_dr) + Number(je_record.get('amount_dr'))).toFixed(2);
}
if(!isNaN(je_record.get('amount_cr'))){
sum_cr = (Number(sum_cr) + Number(je_record.get('amount_cr'))).toFixed(2);
}
}
var check_flag = false;
if((sum_dr != sum_cr)&&(sum_dr != 0)){
Leaf.showMessage('提示','借贷总额必须相等');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}else{
journal_record.set('total_amount_dr', sum_dr);
journal_record.set('total_amount_cr', sum_dr);
journal_record.set('total_amount_fuc_dr', sum_dr);
journal_record.set('total_amount_fuc_cr', sum_dr);
if (journal_record.get('journal_num')) {
return true;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('get_new_journal_num_link_id').getUrl(),
para: {
document_category: '${/parameter/@document_category}',
document_type: record.get('document_type')
},
success: function(res) {
var document_number = res.result.document_number;
journal_record.set('journal_num', document_number);
check_flag = true;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
sync: true,
scope: this
});
return check_flag;
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
var detail1_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_LN_REF1', 'hls_journal_detail');
var header_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_HD', 'hls_journal_header');
$(detail1_ds_id).query();
var header_ds_record = $(header_ds_id).getAt(0);
var document_type = header_ds_record.get('document_type');
var journal_num = header_ds_record.get('journal_num');
if (!header_ds_record.get('post_gl_status')){
header_ds_record.set('post_gl_status', 'N');
}
header_ds_record.set('reversed_flag', 'N');
// if (name = 'document_type') {
// Leaf.request({
// url: $('get_document_type_id').getUrl(),
// para: {
// document_type: document_type,
// //journal_header_id: '${/parameter/@journal_header_id}',
// journal_num: journal_num
// },
// success: periodname,
// scope: this
// });
// }
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
if(name=='journal_date'){
var journal_date = record.get('journal_date');
journal_date = Leaf.formatDate(journal_date);
Leaf.request({
url: $('get_period_name_id').getUrl(),
para: {
p_date: journal_date
},
success: periodname,
scope: this
});
}else if(name=='amount_dr'){
record.set('amount_fuc_dr',value);
}else if(name=='amount_cr'){
record.set('amount_fuc_cr',value);
}
};
function periodname(res) {
var journal_ds_id1 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header');
var journal_record1 = $(journal_ds_id1).getAt(0);
if (res) {
var period_name = res.result.record.period_name;
var period_year = res.result.record.period_year;
var period_num = res.result.record.period_name.substring(5, 7);
var internal_period_num = res.result.record.internal_period_num;
var period_set_code = res.result.record.period_set_code;
journal_record1.set('period_name', period_name);
journal_record1.set('period_year', period_year);
journal_record1.set('period_num', period_num);
journal_record1.set('internal_period_num', internal_period_num);
journal_record1.set('period_set_code', period_set_code);
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var bp_info_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header');
if( Ext.isEmpty(record.get('journal_header_id'))){
record.set('je_company_id', 1);
record.set('je_company_id_n', '宏菱租赁');
record.set('currency_code', 'CNY');
record.set('currency_code_n', '人民币');
// record.set('je_transaction_code', 'MANUAL');
// record.set('je_transaction_code_n', '手工生成');
//record.set('post_gl_status', 'N');
if(!record.get('post_gl_status')){
record.set('post_gl_status', 'N');
}
record.set('exchange_rate', 1);
record.set('reversed_flag', 'N');
record.set('source_table', 'hls_journal_header');
record.set('company_id', 1);
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
<a:model-execute model="hls.HLS536.delete_hls_journal_tmp"/>
<a:import-excel header_id="${/session/@session_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLS_JOURNAL_IMPORT" user_id="${/session/@user_id}" />
<a:model-execute model="hls.HLS536.insert_hls_journal_tmp"/>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_entrance_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_entrance.lview"/>
<script type="text/javascript"><![CDATA[
window.location.href = $('hls_journal_entrance_import_link').getUrl();
]]></script>
</a:view>
</a:screen>
<?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() {
if (!$('template_ds').validate()) {
return;
}
var template_type = $('template_ds').getAt(0);
if (document.getElementById('importFile').value) {
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
fileType = fileType.toLowerCase();
if (fileType != '.xls'&&fileType != '.xlsx') {
alert('请选择正确的导入文件!请使用xls或者xlsx后缀的文件');
} else {
document.getElementById('importForm').submit();
}
}
}
]]></script>
<a:dataSets>
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds"
returnField="template_type" valueField="code_value" required="true"/>
</a:fields>
</a:dataSet>
<a:dataSet id="label_ds" autoCreate="true">
<a:fields>
<a:field name="label2" defaultValue="1、 严格按照导入模板整理数据,检查必输事项是否缺少数据。"/>
<a:field name="label3" defaultValue="2、 关闭Excel文件后,方可进行产品主数据导入。"/>
<a:field name="label4" defaultValue="3、 本导入程序只支持Office Excel。"/>
<a:field name="label5" defaultValue="仔细阅读上述事项,并检查确认无误。"/>
<a:field name="label6" defaultValue="导入完毕后,请在系统内核实数据是否导入成功。"/>
</a:fields>
</a:dataSet>
<a:dataSet id="template_type_desc_ds">
<a:datas>
<a:record code_value="GENERAL_SALARIES" code_value_name="普通工资导入模板"/>
<a:record code_value="BPO_SALARIES" code_value_name="BPO工资导入模板"/>
<a:record code_value="COST_IMPORT" code_value_name="成本导入模板"/>
<a:record code_value="FUND_POOL" code_value_name="资金池导入模板"/>
<a:record code_value="GLOBAL_TEMPLATE" code_value_name="通用模板"/>
</a:datas>
</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">
<a:comboBox name="template_type_desc" bindTarget="template_ds" prompt="模板类型"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="hls_journal_import_trans_upload.lview?session_id=${/parameter/@session_id}&amp;template_type=${/parameter/@template_type}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;type=${/parameter/@type}&amp;_csrf=${/session/@_csrf.token}" 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>
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