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"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="welcome_link_id" url="${/request/@context_path}/welcome.lview"/>
<a:link id="hls_journal_con_contract_update_link_id" 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"/>
<a:screen-include screen="modules/hls/hls_common_javascript.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"/>
<script><![CDATA[
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
//退出按钮
function hls536_journal_exit() {
location.href = $('welcome_link_id').getUrl();
parent.shMenu('show');
}
// function lock_current_window(msg) {
// Leaf.Masker.mask(Ext.getBody(), msg);
// }
//function unlock_current_window() {
//Leaf.Masker.unmask(Ext.getBody());
//}
function hls536_journal_import(){
debugger;
new Leaf.Window({
id: 'hls_journal_import_handle_winid',
url: $('hls_journal_import_link').getUrl(),
title: '凭证模板导入',
width: 420,
height: 320
});
}
function hls536_link_dynamic(reocrd_id, journal_header_id) {
var maintain_type = 'UPDATE';
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls301_yes_no_ds" lookupCode="YES_NO"/>
<a:dataSet id="hls_document_type_ds">
<a:datas dataSource="/model/hls_document_type_path"/>
</a:dataSet>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="contract_number"/>
<a:field name="journal_num"/>
<!--<a:field name="category_code_desc" displayField="description" options="hls_document_type_ds" returnField="category_code" valueField="document_type"/>-->
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="period_name"/>
<a:field name="external_journal_num"/>
<a:field name="bp_id_tenant"/>
<a:field name="bp_id_tenant_desc" lovGridHeight="400" lovHeight="550" lovService="hls.HLS301.hls_bp_master_v_for_lov" lovWidth="500">
<a:mapping>
<a:map from="bp_name" to="bp_id_tenant_desc"/>
<a:map from="bp_id" to="bp_id_tenant"/>
</a:mapping>
</a:field>
<a:field name="source_table"/>
<a:field name="reference1"/>
<a:field name="je_transaction_code"/>
<a:field name="je_transaction_desc" lovGridHeight="420" lovHeight="550" lovPageSize="20" lovService="gld.GLD104.gld_je_transaction_for_lov" lovWidth="500">
<a:mapping>
<a:map from="je_transaction_code" to="je_transaction_code"/>
<a:map from="je_transaction_desc" to="je_transaction_desc"/>
</a:mapping>
</a:field>
<a:field name="responsibility_center_name_from" lovHeight="500" lovLabelWidth="100" lovService="fnd.FND2110.fnd_responsibility_centers_lov" lovWidth="550" title="HLS.RESPONSIBILITY_CENTER_NAME">
<a:mapping>
<a:map from="responsibility_center_id" to="responsibility_center_id"/>
<a:map from="responsibility_center_code" to="responsibility_center_code_from"/>
<a:map from="responsibility_center_name" to="responsibility_center_name_from"/>
</a:mapping>
</a:field>
<a:field name="responsibility_center_name_to" lovHeight="500" lovLabelWidth="100" lovService="fnd.FND2110.fnd_responsibility_centers_lov" lovWidth="550" title="HLS.RESPONSIBILITY_CENTER_NAME">
<a:mapping>
<a:map from="responsibility_center_code" to="responsibility_center_code_to"/>
<a:map from="responsibility_center_name" to="responsibility_center_name_to"/>
</a:mapping>
</a:field>
<a:field name="account_code_from" autoComplete="true" lovHeight="500" lovLabelWidth="100" lovService="hls.HLS301.hls_journal_account_for_lov" lovWidth="500" title="HLS530.ACCOUNT_NAME">
<a:mapping>
<a:map from="account_code" to="account_code_from"/>
<a:map from="description" to="account_name_from"/>
</a:mapping>
</a:field>
<a:field name="account_code_to" autoComplete="true" lovHeight="600" lovLabelWidth="100" lovUrl="${/request/@context_path}/modules/hls/HLS530/gld_company_account_tree.lview" lovWidth="550" title="HLS530.ACCOUNT_NAME">
<a:mapping>
<a:map from="account_code" to="account_code_to"/>
<a:map from="description" to="account_name_to"/>
</a:mapping>
</a:field>
<a:field name="company_short_name" lovHeight="500" lovLabelWidth="100" lovService="fnd.fnd_companies_lov" lovWidth="550" title="HLS530.JOURNAL_COMPANY">
<a:mapping>
<a:map from="company_id" to="je_company_id"/>
<a:map from="company_short_name" to="company_short_name"/>
</a:mapping>
</a:field>
<a:field name="currency_code" lovHeight="500" lovLabelWidth="100" lovService="basic.gld_currency_v_lov" lovWidth="550">
<a:mapping>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
</a:mapping>
</a:field>
<a:field name="merge_parent_flag_desc" defaultValue="否" displayField="code_value_name" options="hls301_yes_no_ds" returnField="merge_parent_flag" valueField="code_value"/>
<a:field name="merge_parent_flag" defaultValue="N"/>
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_header" queryDataSet="hls_journal_header_query" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_exit" text="HLS.EXIT"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_import" text="导入凭证模板"/>
<!--<a:toolbarButton click="hls536_journal_send" text="提交审批"/>-->
</a:screenTopToolbar>
<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:comboBox name="merge_parent_flag_desc" bindTarget="hls_journal_header_query" prompt="合并凭证"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:lov name="company_short_name" bindTarget="hls_journal_header_query" prompt="记账公司"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:lov name="je_transaction_desc" bindTarget="hls_journal_header_query" prompt="凭证来源"/>
<!-- <a:lov name="bp_id_tenant_desc" bindTarget="hls_journal_header_query" prompt="商业伙伴"/>
<a:textField name="contract_number" bindTarget="hls_journal_header_query" prompt="合同编号"/>-->
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="je_transaction_desc" prompt="凭证来源" width="150"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>
</a:columns>
</a:grid>
</a:screenBody>
</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