Commit c909673e authored by Darming's avatar Darming

[refactor]bug调整

parent 8431cb75
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: chenlingfeng
$Date: 2019-01-14 16:29:48
$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.*
FROM (SELECT li.line_id,
li.error_message,
li.status,
li.header_id,
li.line_number,
hd.created_by,
li.source_table,
li.attribute_1,
li.attribute_2,
li.attribute_3,
li.attribute_4,
li.attribute_5,
li.attribute_6,
li.attribute_7,
li.attribute_8,
li.attribute_9,
li.attribute_10,
li.attribute_11,
li.attribute_12,
li.attribute_13,
li.attribute_14,
li.attribute_15,
li.attribute_16,
li.attribute_17,
li.attribute_18,
li.attribute_19,
li.attribute_20,
li.attribute_21,
li.attribute_22,
li.attribute_23,
li.attribute_24,
li.attribute_25,
li.attribute_26,
t.csh_bank_account_num,
t.transaction_date,
t.bank_slip_num,
t.bp_bank_account_num,
t.bp_bank_account_name,
t.bp_bank_name,
t.transaction_amount,
t.collection_classes,
t.bp_id,
t.paid_byother_flag,
t.csh_bank_account_id bank_account_id,
FROM fnd_interface_headers hd,
fnd_interface_lines li,
csh_transaction_import_temp t
WHERE hd.header_id = li.header_id and li.line_id = t.line_id and hd.header_id = t.header_id
AND hd.template_code = 'CSH_TRX_BANK'
AND li.line_number >0
AND HD.CREATED_BY = ${/session/@user_id}
) t1
#WHERE_CLAUSE#
order by t1.line_number
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
csh_transaction_pkg.csh_transaction_import_check(
p_header_id => ${/model/header/record/@header_id},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
delete from csh_transaction_import_temp where header_id = ${@header_id};
csh_transaction_pkg.save_receipt_import(
p_transaction_id =>${@transaction_id},
p_transaction_num =>${@transaction_num},
p_transaction_category =>'BUSINESS',
p_transaction_type =>${@transaction_type},
p_transaction_date =>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_penalty_calc_date =>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_bank_slip_num =>${@bank_slip_num},
p_company_id =>${/session/@company_id},
p_internal_period_num =>${@internal_period_num},
p_period_name =>${@period_name},
p_payment_method_id =>${@payment_method_id},
p_distribution_set_id =>${@distribution_set_id},
p_cashflow_amount =>${@transaction_amount},
p_currency_code =>${@currency_code},
p_transaction_amount =>${@transaction_amount},
p_exchange_rate_type =>${@exchange_rate_type},
p_exchange_rate_quotation =>${@exchange_rate_quotation},
p_exchange_rate =>${@exchange_rate},
p_bank_account_id =>${@bank_account_id},
p_bp_category =>${@bp_category},
p_bp_id =>${@bp_id},
p_bp_bank_account_id =>${@bp_bank_account_id},
p_bp_bank_account_num =>${@bp_bank_account_num},
p_description =>${@description},
p_handling_charge =>${@handling_charge},
p_posted_flag =>nvl(${@posted_flag}, 'N'),
p_reversed_flag =>nvl(${@reversed_flag}, 'N'),
p_reversed_date =>to_date(${@reversed_date}, 'yyyy-mm-dd 24hh:mi:ss'),
p_returned_flag =>nvl(${@returned_flag}, 'NOT'),
p_returned_amount =>${@returned_amount},
p_write_off_flag =>nvl(${@write_off_flag}, 'NOT'),
p_write_off_amount =>${@write_off_amount},
p_full_write_off_date =>to_date(${@full_write_off_date}, 'yyyy-mm-dd 24hh:mi:ss'),
p_twin_csh_trx_id =>${@twin_csh_trx_id},
p_return_from_csh_trx_id =>${@return_from_csh_trx_id},
p_reversed_csh_trx_id =>${@reversed_csh_trx_id},
p_source_csh_trx_type =>${@source_csh_trx_type},
p_source_csh_trx_id =>${@source_csh_trx_id},
p_source_doc_category =>${@source_doc_category},
p_source_doc_type =>${@source_doc_type},
p_source_doc_id =>${@source_doc_id},
p_source_doc_line_id =>${@source_doc_line_id},
p_create_je_mothed =>${@create_je_mothed},
p_create_je_flag =>nvl(${@create_je_flag}, 'N'),
p_gld_interface_flag =>nvl(${@gld_interface_flag}, 'N'),
p_user_id =>${/session/@user_id},
p_ref_contract_id => ${@ref_contract_id},
p_receipt_type => ${@receipt_type},
p_csh_bp_name => ${@csh_bp_name},
p_ref_n01 =>${@ref_n01},
p_bp_bank_name =>${@bp_bank_name},
p_bp_bank_branch_name =>${@bp_bank_branch_name},
p_collection_classes =>${@collection_classes},
p_bp_bank_account_name =>${@bp_bank_account_name},
p_opposite_band_na =>${@opposite_band_na},
p_banka =>${@banka},
p_purpose =>${@purpose},
p_gsber =>${@gsber},
p_sus_belnr =>${@sus_belnr},
p_bp_virtual_bank_account =>${@bp_virtual_bank_account},
p_zuonr =>${@bank_slip_num},
p_paid_byother_flag =>${@paid_byother_flag},
p_ref_v05 =>${@ref_v05},
p_status =>${@status},
p_bank_account_num =>${@bank_account_num}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
csh_transaction_pkg.get_bank_account_id(p_bank_account_num =>${@bank_account_num},
p_bp_bank_account_num =>${@bp_bank_account_num},
p_bank_account_id =>${@bank_account_id},
p_bp_category =>${@bp_category},
p_bp_id =>${@bp_id},
p_csh_bp_name =>${@csh_bp_name},
p_user_id =>${session/@user_id}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="bank_account_id" dataType="java.lang.Long" output="true"
outputPath="@bank_account_id"/>
<bm:parameter name="bp_category" dataType="java.lang.String" output="true" outputPath="@bp_category"/>
<bm:parameter name="bp_id" dataType="java.lang.Long" output="true" outputPath="@bp_id"/>
<bm:parameter name="csh_bp_name" dataType="java.lang.String" output="true" outputPath="@csh_bp_name"/>
</bm:parameters>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="header_id" queryExpression="t1.header_id=${@header_id}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: chenlingfeng
$Date: 2019-01-14 16:29:48
$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.*
FROM (SELECT li.line_id,
li.error_message,
li.status,
li.header_id,
li.line_number,
hd.created_by,
li.source_table,
li.attribute_1,
li.attribute_2,
li.attribute_3,
li.attribute_4,
li.attribute_5,
li.attribute_6,
li.attribute_7,
li.attribute_8,
li.attribute_9,
li.attribute_10,
li.attribute_11,
li.attribute_12,
li.attribute_13,
li.attribute_14,
li.attribute_15,
li.attribute_16,
li.attribute_17,
li.attribute_18,
li.attribute_19,
li.attribute_20,
li.attribute_21,
li.attribute_22,
li.attribute_23,
li.attribute_24,
li.attribute_25,
li.attribute_26,
t.csh_bank_account_num,
t.transaction_date,
t.bank_slip_num,
t.bp_bank_account_num,
t.bp_bank_account_name,
t.bp_bank_name,
t.transaction_amount,
t.collection_classes,
t.bp_id,
t.paid_byother_flag,
t.csh_bank_account_id bank_account_id
FROM fnd_interface_headers hd,
fnd_interface_lines li,
csh_transaction_import_temp t
WHERE hd.header_id = li.header_id and li.line_id = t.line_id and hd.header_id = t.header_id
AND hd.template_code = 'CSH_TRX_BANK'
AND li.line_number >0
AND HD.CREATED_BY = ${/session/@user_id}
) t1
#WHERE_CLAUSE#
order by t1.line_number
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
csh_transaction_pkg.csh_transaction_import_check(
p_header_id => ${/model/header/record/@header_id},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
delete from csh_transaction_import_temp where header_id = ${@header_id};
csh_transaction_pkg.save_receipt_import(
p_transaction_id =>${@transaction_id},
p_transaction_num =>${@transaction_num},
p_transaction_category =>'BUSINESS',
p_transaction_type =>${@transaction_type},
p_transaction_date =>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_penalty_calc_date =>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_bank_slip_num =>${@bank_slip_num},
p_company_id =>${/session/@company_id},
p_internal_period_num =>${@internal_period_num},
p_period_name =>${@period_name},
p_payment_method_id =>${@payment_method_id},
p_distribution_set_id =>${@distribution_set_id},
p_cashflow_amount =>${@transaction_amount},
p_currency_code =>${@currency_code},
p_transaction_amount =>${@transaction_amount},
p_exchange_rate_type =>${@exchange_rate_type},
p_exchange_rate_quotation =>${@exchange_rate_quotation},
p_exchange_rate =>${@exchange_rate},
p_bank_account_id =>${@bank_account_id},
p_bp_category =>${@bp_category},
p_bp_id =>${@bp_id},
p_bp_bank_account_id =>${@bp_bank_account_id},
p_bp_bank_account_num =>${@bp_bank_account_num},
p_description =>${@description},
p_handling_charge =>${@handling_charge},
p_posted_flag =>nvl(${@posted_flag}, 'N'),
p_reversed_flag =>nvl(${@reversed_flag}, 'N'),
p_reversed_date =>to_date(${@reversed_date}, 'yyyy-mm-dd 24hh:mi:ss'),
p_returned_flag =>nvl(${@returned_flag}, 'NOT'),
p_returned_amount =>${@returned_amount},
p_write_off_flag =>nvl(${@write_off_flag}, 'NOT'),
p_write_off_amount =>${@write_off_amount},
p_full_write_off_date =>to_date(${@full_write_off_date}, 'yyyy-mm-dd 24hh:mi:ss'),
p_twin_csh_trx_id =>${@twin_csh_trx_id},
p_return_from_csh_trx_id =>${@return_from_csh_trx_id},
p_reversed_csh_trx_id =>${@reversed_csh_trx_id},
p_source_csh_trx_type =>${@source_csh_trx_type},
p_source_csh_trx_id =>${@source_csh_trx_id},
p_source_doc_category =>${@source_doc_category},
p_source_doc_type =>${@source_doc_type},
p_source_doc_id =>${@source_doc_id},
p_source_doc_line_id =>${@source_doc_line_id},
p_create_je_mothed =>${@create_je_mothed},
p_create_je_flag =>nvl(${@create_je_flag}, 'N'),
p_gld_interface_flag =>nvl(${@gld_interface_flag}, 'N'),
p_user_id =>${/session/@user_id},
p_ref_contract_id => ${@ref_contract_id},
p_receipt_type => ${@receipt_type},
p_csh_bp_name => ${@csh_bp_name},
p_ref_n01 =>${@ref_n01},
p_bp_bank_name =>${@bp_bank_name},
p_bp_bank_branch_name =>${@bp_bank_branch_name},
p_collection_classes =>${@collection_classes},
p_bp_bank_account_name =>${@bp_bank_account_name},
p_opposite_band_na =>${@opposite_band_na},
p_banka =>${@banka},
p_purpose =>${@purpose},
p_gsber =>${@gsber},
p_sus_belnr =>${@sus_belnr},
p_bp_virtual_bank_account =>${@bp_virtual_bank_account},
p_zuonr =>${@bank_slip_num},
p_paid_byother_flag =>${@paid_byother_flag},
p_ref_v05 =>${@ref_v05},
p_status =>${@status},
p_bank_account_num =>${@bank_account_num}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
csh_transaction_pkg.get_bank_account_id(p_bank_account_num =>${@bank_account_num},
p_bp_bank_account_num =>${@bp_bank_account_num},
p_bank_account_id =>${@bank_account_id},
p_bp_category =>${@bp_category},
p_bp_id =>${@bp_id},
p_csh_bp_name =>${@csh_bp_name},
p_user_id =>${session/@user_id}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="bank_account_id" dataType="java.lang.Long" output="true"
outputPath="@bank_account_id"/>
<bm:parameter name="bp_category" dataType="java.lang.String" output="true" outputPath="@bp_category"/>
<bm:parameter name="bp_id" dataType="java.lang.Long" output="true" outputPath="@bp_id"/>
<bm:parameter name="csh_bp_name" dataType="java.lang.String" output="true" outputPath="@csh_bp_name"/>
</bm:parameters>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="header_id" queryExpression="t1.header_id=${@header_id}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-09-06 上午11:10:33
$Revision: 1.0
$Purpose: design the function of written_off money
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="basic.csh_payment_method_for_lov" rootPath="payment_method_path"/>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="currency"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH511_TRANSACTION_TYPE&apos; and t.code_value in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="transaction_type"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_RETURN_SELECT&apos; and t.code_value not in (&apos;RETURN&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="returned_flag_rp"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_REVERSE_SELECT&apos; and t.code_value not in (&apos;R&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="reversed_flag_rp"/>
</a:init-procedure>
<a:view>
<a:link id="csh_transaction_receipt_link" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt.lview"/>
<a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
<a:link id="csh_transaction_receipt_update_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>
<!-- <a:link id="csh_transaction_receipt_maintain_post_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>-->
<a:link id="csh_transaction_receipt_maintain_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update.lview"/>
<a:link id="csh_transaction_receipt_maintain_readonly_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update_readonly.lview"/>
<a:link id="csh510_csh_transaction_batch_update" model="csh.CSH510.csh_transaction_delete" modelaction="batch_update"/>
<a:link id="csh511_csh_transaction_batch_post_link" model="csh.CSH511.csh_transaction_post" modelaction="batch_update"/>
<!--更新收款单据的状态-->
<a:link id="csh509N_batch_update_confirmed_flag" model="csh.CSH509.query_roles_info" modelaction="batch_update"/>
<a:link id="csh510N_csh_transaction_batch_update_confirmed_flag" model="csh.CSH510.csh_transaction_update" modelaction="batch_update"/>
<!-- <a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_import.lview"/>-->
<a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510N/csh_transaction_import.lview"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
//console.log($('csh_transaction_receipt_maintain_result_ds'));
})
//新增单据的作废
function csh510_csh_trx_bank_drop(){
$('csh510_csh_trx_bank_drop').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if (datas.length == 0) {
$L.showMessage("提示", '请选择要作废的单据');
$('csh510_csh_trx_bank_drop').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag= datas[i].get('confirmed_flag');
//不是新增就报错
if(confirmed_flag!='NEW'&&confirmed_flag!=undefined){
$L.showInfoMessage("提示", '请选择单据为未提交的数据', null, null);
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
//提交想改变之后的状态
'wanted_confirmed_flag': 'CANCELLED',
'_status': 'update'
});
};
//弹出确认修改的提示框
$L.showConfirm("提示",'确认执行该操作?',function(){
//锁屏
lock_current_window();
//作废单据
Leaf.request({
url: $('csh509N_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '该单据已作废!');
$('csh510_csh_trx_bank_drop').enable();
}, failure: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
error: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
scope: this
});
})
}
//新增申请按钮
function csh510_csh_trx_bank_apply_new() {
$('csh510_csh_trx_bank_apply_new').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
//获得所选择的的未提交的单据,如果有不是未提交的数据,提示重新进行选择
if (datas.length == 0) {
$L.showMessage("提示", '请至少选择一条数据');
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag = datas[i].get('confirmed_flag');
var bp_name=datas[i].get('bp_name');
if(bp_name==''||bp_name==undefined){
$L.showInfoMessage("提示", '商业伙伴为空,不能提交', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//不是新增就报错
if (confirmed_flag != 'NEW' && confirmed_flag != undefined) {
$L.showInfoMessage("提示", '请选择单据为未提交的数据', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
'_status': 'update'
});
}
//弹出确认修改的提示框
$L.showConfirm("提示", '确认执行该操作?', function () {
//锁屏
lock_current_window();
//改变未提交单据数据的状态
Leaf.request({
url: $('csh510N_csh_transaction_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '修改成功!');
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
}, failure: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
error: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
scope: this
});
},function(){
$('csh510_csh_trx_bank_apply_new').enable();
});
}
//跳转到收款新增页面
function csh510_csh_trx_bank_hand_add(){
//按钮失效
$('csh510_csh_trx_bank_hand_add').disable();
var url = $('csh_transaction_receipt_link').getUrl();
var win = new Leaf.Window({
title:'${l:CSH510.NEW_MANUAL_RECEIPT}',
url: url,
id: 'csh_trx_receipt_id',
fullScreen: true,
draggable: true
}).on('close', function() {
//按钮启用
$('csh510_csh_trx_bank_hand_add').enable();
});
}
//锁表
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
//解锁
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
}
function dateValidator(record, name, value) { //日期校验方法
if (name == 'transaction_date_from' || name == 'transaction_date_to') {
var start_date = Leaf.formatDate(record.get('transaction_date_from'));
var end_date = Leaf.formatDate(record.get('transaction_date_to'));
if (!!end_date) { //由于结束日期非必填,只有在结束日期填了才进行比较
if (!compareDate(start_date, end_date)) {
return '${l:CSH510.CSH_RECEIPT_DATE_CHECK}'; //校验不通过返回字符串
}
}
return true; //校验通过返回true
}
}
function compareDate(start, end) {
if (start > end) {
return false;
}
return true;
}
function csh510_receipt_query() {
var record = $('csh_transaction_receipt_maintain_query_ds').getAt(0);
var dirty_flag = 'N';
for (var name in record.data) {
var value = record.get(name);
if (value != 'undefined' && value != null && value != '') {
dirty_flag = 'Y';
}
}
if (dirty_flag == 'N') {
Leaf.showConfirm('${l:PROMPT}', '${l:CSH510.CSH_RECEIPT_QUERY_INFORMATION}', function () {
return;
}, function () {
$('csh_transaction_receipt_maintain_result_ds').query();
}, null, null);
} else {
$('csh_transaction_receipt_maintain_result_ds').query();
}
}
function csh510_receipt_reset() {
$('csh_transaction_receipt_maintain_query_ds').reset();
}
function csh510_receipt_back() {
history.go(-1);
}
function csh510_receipt_forward() {
history.go(1);
}
function csh510_receipt_quit() {
location.href = $('sys_service_welcome_link').getUrl();
parent.shMenu('show');
}
function seedetail_transaction_num(value, record, name) {
/* console.log(record.get('receipt_type'));
console.log( record.get('bp_name'));
console.log( record.get('confirmed_flag'));*/
if (record.get('transaction_id')) {
var url;
/*if (record.get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} /!*else*!/ else if (record.get('posted_flag') == 'Y') {
url = $('csh_transaction_receipt_update_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} else {
return value;
}*/
if(record.get('confirmed_flag')=='NEW' || record.get('confirmed_flag') == 'CT_REJECTED'){
url = $('csh_transaction_receipt_maintain_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=true';
}else{
url = $('csh_transaction_receipt_maintain_readonly_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=false';
}
return '<a href="javascript:openWindow(\'' + url + '\');">' + value + '</a>';
}
}
function openWindow(url) {
new Leaf.Window({
id: 'csh_transaction_receipt_link_winid',
params: {
winId: 'csh_transaction_receipt_link_winid'
},
url: url,
title: '${l:CSH510.CSH_RECEIPT_UPDATE}',
fullScreen: true
});
}
function construct_from_to() {
var config = ['transaction_num', 'bank_slip_num', 'transaction_amount', 'currency_code', 'bank_account_code'];
var pattern = ['_from', '_to'];
var obj = {};
for (var i = 0,
j = config.length; i < j; i++) {
for (var m = 0,
n = pattern.length; m < n; m++) {
obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
}
}
return obj;
}
function csh510_receipt_maintain_update(ds, record, name, value, oldvalue) {
var from_to = construct_from_to();
var opposite_name = from_to[name];
if (!Ext.isEmpty(opposite_name)) {
var opposite_value = record.get(opposite_name);
if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
record.set(opposite_name, value);
}
}
}
function csh510_receipt_remove() {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (!records.length) {
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.SELECT_RECORD}');
return;
}
var saveData = [];
for (var i = 0; i < records.length; i++) {
if(records[i].get('confirmed_flag') != 'NEW' && records[i].get('confirmed_flag') != 'CT_REJECTED'){
Leaf.showInfoMessage("提示","请选择新建或者收款退回的单据进行收款取消操作!");
return;
}
records[i].set('_status', 'delete');
saveData.push(records[i].data);
}
Leaf.showConfirm('${l:PROMPT}', '${l:HLS.DELETE_CONFIRM}', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.DELETING}');
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH510.csh_transaction_delete/batch_update',
para: saveData,
success: function () {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
csh510_delete_remove(records);
Leaf.Masker.unmask(Ext.getBody());
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, function () {
return;
}, null, null);
}
function csh510_delete_remove(records) {
while (records[0]) {
$('csh_transaction_receipt_maintain_result_ds').removeLocal(records[0]);
}
}
function csh510_receipt() {
Leaf.showConfirm('${l:PROMPT}', '非财务人员请勿操作!', function () {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}', '请选择1条数据!');
return;
}
if (records[0].get('transaction_id')) {
var url;
if (records[0].get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + records[0].get('transaction_id') + '&claim=F';
} else {
Leaf.showMessage('${l:PROMPT}', '该单据已经被认领,无需再次认领!');
return;
}
openWindow(url);
}
});
}
function csh510_batch_update() {
var ds_id = 'csh_transaction_receipt_maintain_result_ds';
var ds = $(ds_id)
var records = ds.getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:PROMPT}', '请至少选择一条要处理的单据');
return;
}
var auto_write_record = $('csh510_collection_classes_batch_update_ds').getAt(0);
var collection_classes = auto_write_record.get('collection_classes');
if (collection_classes) {
lock_current_window();
var post_data = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('write_off_flag') == 'FULL') {
Leaf.showMessage('${l:PROMPT}', '选择数据中包含已完全核销的数据');
return;
}
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'collection_classes': auto_write_record.get('collection_classes'),
'_status': 'update'
});
}
Leaf.request({
url: $('csh510_csh_transaction_batch_update').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
ds.query(ds.currentpage);
Leaf.showMessage('${l:PROMPT}', '修改成功!');
}, failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
}
}
function csh510_csh_transaction_batch_update(){
//
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择一条记录!');
return;
}
var post_data = [];
for (var i = 0; i < records.length; i++) {
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'_status': 'update'
});
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('csh511_csh_transaction_batch_post_link').getUrl(),
para: post_data,
success: function (res) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.SUBMIT_SUCCESS}');
csh510_receipt_query();
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function csh510_csh_trx_bank_import(){
//按钮失效
$('csh510_csh_trx_bank_import').disable();
//只有债权内勤才能
var url_l = $('csh510_csh_transaction_import_link').getUrl();
var win = new Leaf.Window({
id: 'csh510_csh_transaction_import_win',
url: url_l,
params: {
'winid': 'csh510_csh_transaction_import_win',
'session_id': '${/session/@session_id}',
'parent_ds_id': 'csh_transaction_receipt_maintain_result_ds'
},
title: '信息导入',
width: 430,
height: 390
});
win.on('close', function () {
$('csh_transaction_receipt_maintain_result_ds').query();
//按钮启用
$('csh510_csh_trx_bank_import').enable();
});
}
function csh510_export() {
$('csh_transaction_receipt_maintain_grid_ds')._export(null,'收款维护');
}
]]></script>
<a:dataSets>
<a:dataSet id="confirmed_flag_ds">
<a:datas>
<a:record code_value="NEW" code_value_name="新建"/>
<a:record code_value="ACCAUDITING" code_value_name="收款确认中"/>
<a:record code_value="CT_REJECTED" code_value_name="收款退回"/>
<a:record code_value="ACCAUDITED" code_value_name="收款已确认"/>
</a:datas>
</a:dataSet>
<a:dataSet id="bp_category_ds" lookupCode="BP_CATEGORY">
</a:dataSet>
<!-- <a:dataSet id="confirmed_flag_ds" lookupCode="CONFIRMED_FLAG">-->
<!-- </a:dataSet>-->
<a:dataSet id="payment_method_ds">
<a:datas dataSource="/model/payment_method_path"/>
</a:dataSet>
<a:dataSet id="receipt_type_ds" lookupCode="RECEIPT_TYPE"/>
<a:dataSet id="currency_ds">
<a:datas dataSource="/model/currency"/>
</a:dataSet>
<a:dataSet id="transaction_type_ds">
<a:datas dataSource="/model/transaction_type"/>
</a:dataSet>
<!-- <a:dataSet id="transaction_type_ds" lookupCode="CSH511_TRANSACTION_TYPE"/> -->
<a:dataSet id="posted_flag_ds" lookupCode="CSH510_POST_SELECT"/>
<!-- 去掉退款事务 -->
<a:dataSet id="returned_flag_ds">
<a:datas dataSource="/model/returned_flag_rp"/>
</a:dataSet>
<!-- 去掉反冲事务 -->
<a:dataSet id="reversed_flag_ds">
<a:datas dataSource="/model/reversed_flag_rp"/>
</a:dataSet>
<a:dataSet id="ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>
<a:dataSet id="csh510_collection_classes_batch_update_ds">
<a:fields>
<a:field name="collection_classes_desc" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_query_ds" autoCreate="true">
<a:fields>
<a:field name="bank_account_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_branch_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_account_num" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="confirmed_flag_desc" options="confirmed_flag_ds" valueField="code_value" displayField="code_value_name" returnField="confirmed_flag"/>
<a:field name="payment_method_display" displayField="description" options="payment_method_ds" returnField="payment_method_id" valueField="payment_method_id"/>
<a:field name="bp_name_from" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_from"/>
<a:map from="bp_name" to="bp_name_from"/>
</a:mapping>
</a:field>
<a:field name="bp_id_from"/>
<a:field name="bp_name_to" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_to"/>
<a:map from="bp_name" to="bp_name_to"/>
</a:mapping>
</a:field>
<a:field name="bp_id_to"/>
<a:field name="transaction_num_from"/>
<a:field name="transaction_num_to"/>
<a:field name="bank_slip_num_from"/>
<a:field name="bank_slip_num_to"/>
<a:field name="transaction_date_from" validator="dateValidator"/>
<a:field name="transaction_date_to" validator="dateValidator"/>
<a:field name="bank_account_code" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code"/>
</a:mapping>
</a:field>
<a:field name="bank_account_code_from" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_from"/>
</a:mapping>
</a:field>
<a:field name="bank_account_from_id"/>
<a:field name="bank_account_code_to" autoComplete="true" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_to"/>
</a:mapping>
</a:field>
<a:field name="transaction_amount_from"/>
<a:field name="transaction_amount_to"/>
<a:field name="posted_flag_display" displayField="code_value_name" options="posted_flag_ds" returnField="posted_flag" valueField="code_value"/>
<a:field name="posted_flag" defaultValue="N"/>
<a:field name="returned_flag_display" displayField="code_value_name" options="returned_flag_ds" returnField="returned_flag" valueField="code_value"/>
<a:field name="reversed_flag_display" displayField="code_value_name" options="reversed_flag_ds" returnField="reversed_flag" valueField="code_value"/>
<a:field name="period_name" lovGridHeight="300" lovHeight="500" lovService="gld.gld_period_lov" lovWidth="500" title="GLD_PERIODS.PERIOD_NAME">
<a:mapping>
<a:map from="period_name" to="period_name"/>
</a:mapping>
</a:field>
<a:field name="user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="AUT_TRX_USER_AUTHORIZE.USER_ID" title="员工选择">
<a:mapping>
<a:map from="description" to="user_desc"/>
<a:map from="user_id" to="user_id"/>
</a:mapping>
</a:field>
<a:field name="transaction_type_display" displayField="code_value_name" options="transaction_type_ds" returnField="transaction_type" valueField="code_value"/>
<a:field name="currency_name_from_display" displayField="currency_name" options="currency_ds" returnField="currency_code_from" valueField="currency_code"/>
<a:field name="currency_code_from"/>
<a:field name="currency_name_to_display" displayField="currency_name" options="currency_ds" returnField="currency_code_to" valueField="currency_code"/>
<a:field name="currency_code_to"/>
<a:field name="transaction_type" defaultValue="RECEIPT"/>
<a:field name="transaction_category" defaultValue="BUSINESS"/>
<a:field name="write_off_flag_desc" displayField="code_value_name" options="write_off_flag_ds" returnField="write_off_flag" valueField="code_value"/>
<a:field name="not_reversed_flag_r" defaultValue="NOT"/>
<a:field name="receipt_type"/>
<a:field name="receipt_type_des" displayField="code_value_name" options="receipt_type_ds" returnField="receipt_type" valueField="code_value"/>
<a:field name="description"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
</a:mapping>
</a:field>
<a:field name="collection_classes_n" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<!--对方账户的-->
<a:field name="bp_bank_account_name" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="opposite_band_na" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="bp_bank_account_num" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
</a:fields>
<a:events>
<a:event name="update" handler="csh510_receipt_maintain_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_result_ds" autoPageSize="true" autoQuery="true" model="csh.CSH510.csh_transaction_miantain_query" queryDataSet="csh_transaction_receipt_maintain_query_ds" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<!-- <a:gridButton click="csh510_receipt_back" text="HLS.BACK"/>
<a:gridButton click="csh510_receipt_forward" text="HLS.FORWARD"/> -->
<!-- <a:gridButton click="csh510_receipt_quit" text="HLS.EXIT"/> -->
<a:gridButton click="csh510_receipt_query" text="HLS.QUERY" id="csh510_receipt_query"/>
<a:gridButton click="csh510_csh_trx_bank_import" text="CSH510.CSH_TRANSACTION.RECEIVE_MONEY_IMPORT_BTN" id="csh510_csh_trx_bank_import"/>
<a:gridButton click="csh510_csh_trx_bank_hand_add" text="CSH510.CSH_TRANSACTION.MONEY_HAND_ADD_BTN" id="csh510_csh_trx_bank_hand_add"/>
<a:gridButton click="csh510_receipt_remove" text="收款取消"/>
<!-- <a:gridButton click="csh510_csh_trx_bank_apply_new" text="提交复核" id="csh510_csh_trx_bank_apply_new"/>-->
<!-- <a:gridButton click="csh510_csh_trx_bank_drop" text="CSH510.CSH_TRANSACTION.DROP_BTN" id="csh510_csh_trx_bank_drop"/>-->
<a:gridButton click="csh510_receipt_reset" text="HLS.RESET"/>
<!-- <a:gridButton click="csh510_csh_transaction_batch_update" text="批量过账"/>-->
<!-- <a:gridButton click="csh510_receipt" text="财务认领"/> -->
</a:screenTopToolbar>
<a:form bindTarget="csh_transaction_receipt_write_off_query_ds" labelWidth="120" marginWidth="80"
title="收款核销" style="margin-left:20px">
<a:hBox>
<a:fieldSet column="4" labelWidth="150" title="HLS.QUERY_TITLE">
<a:datePicker name="transaction_date_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_FROM"/>
<a:datePicker name="transaction_date_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_TO"/>
<a:numberField name="transaction_amount_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_FROM" align="right"/>
<a:numberField name="transaction_amount_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_TO" align="right"/>
<!--我方账户户名-->
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME"/>
<a:lov name="bank_branch_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME"/>
<a:lov name="bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME"/>
<!--银行流水号-->
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE"/>
<!--对方账户户名-->
<a:lov name="bp_bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME"/>
<!--对方银行名称-->
<a:lov name="opposite_band_na" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/>
<!--对方账户账号-->
<a:lov name="bp_bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>
<a:textField style="display:none"/>
<a:lov name="bp_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER"/>
<a:comboBox name="confirmed_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="单据审批状态"/>
<!-- <a:comboBox name="write_off_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS"/>-->
<a:comboBox name="collection_classes_n" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS"/>
</a:fieldSet>
</a:hBox>
</a:form>
<a:fieldSet labelWidth="150" title="收款单" style="margin-left:20px">
<a:grid id="csh_transaction_receipt_maintain_grid_ds" bindTarget="csh_transaction_receipt_maintain_result_ds" marginHeight="300" marginWidth="80" navBar="true" >
<!--<a:toolBar>
<a:button click="csh510_export" text="导出"/>
</a:toolBar>-->
<a:columns>
<a:column name="transaction_num" prompt="CSH510.CSH_TRANSACTION.CSH_TRANSACTION_NUM" renderer="seedetail_transaction_num" width="110" align="center"/>
<a:column name="receipt_type_n" align="center" prompt="CSH510.CSH_TRANSACTION.RECEIPT_TYPE" width="100"/>
<a:column name="transaction_amount" align="right" prompt="CSH510.CSH_TRANSACTION.RECEIPT_AMOUNT" width="100" renderer="Leaf.formatMoney"/>
<a:column name="transaction_date" renderer="Leaf.formatDate" align="center"/>
<a:column name="returned_amount" prompt="CSH510.CSH_TRANSACTION.RETURN_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="use_money_amount" prompt="CSH510.CSH_TRANSACTION.USEFUL_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="collection_classes_desc" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS" align="center"/>
<a:column name="bp_name" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER" align="center"/>
<a:column name="bank_slip_num" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE" align="center"/>
<a:column name="description" prompt="CSH510.CSH_TRANSACTION.DESCRIPTION" align="center"/>
<a:column name="confirmed_flag_desc" prompt="单据审批状态" align="center"/>
<!-- <a:column name="written_off_flag_desc" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS" align="center"/>-->
<a:column prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="bank_branch_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bank_account_num" align="center"/>
</a:column>
<a:column prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bp_bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="opposite_band_na" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bp_bank_account_num" align="center"/>
</a:column>
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY" align="center"/>
<!-- <a:column name="debt_confirmed_by_desc" prompt="CSH510.CSH_TRANSACTION.DEPT_CONFIRMER" align="center"/>-->
<a:column name="acc_confirmed_by_desc" prompt="确认人" align="center"/>
</a:columns>
<a:editors>
<a:numberField id="number_editor" allowDecimals="true" decimalPrecision="2" editable="false"/>
</a:editors>
</a:grid>
</a:fieldSet>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-09-06 上午11:10:33
$Revision: 1.0
$Purpose: design the function of written_off money
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="basic.csh_payment_method_for_lov" rootPath="payment_method_path"/>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="currency"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH511_TRANSACTION_TYPE&apos; and t.code_value in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="transaction_type"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_RETURN_SELECT&apos; and t.code_value not in (&apos;RETURN&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="returned_flag_rp"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_REVERSE_SELECT&apos; and t.code_value not in (&apos;R&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="reversed_flag_rp"/>
</a:init-procedure>
<a:view>
<a:link id="csh_transaction_receipt_link" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt.lview"/>
<a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
<a:link id="csh_transaction_receipt_update_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>
<!-- <a:link id="csh_transaction_receipt_maintain_post_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>-->
<a:link id="csh_transaction_receipt_maintain_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update.lview"/>
<a:link id="csh_transaction_receipt_maintain_readonly_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update_readonly.lview"/>
<a:link id="csh510_csh_transaction_batch_update" model="csh.CSH510.csh_transaction_delete" modelaction="batch_update"/>
<a:link id="csh511_csh_transaction_batch_post_link" model="csh.CSH511.csh_transaction_post" modelaction="batch_update"/>
<!--更新收款单据的状态-->
<a:link id="csh509N_batch_update_confirmed_flag" model="csh.CSH509.query_roles_info" modelaction="batch_update"/>
<a:link id="csh510N_csh_transaction_batch_update_confirmed_flag" model="csh.CSH510.csh_transaction_update" modelaction="batch_update"/>
<!-- <a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_import.lview"/>-->
<a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510N/csh_transaction_import.lview"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
//console.log($('csh_transaction_receipt_maintain_result_ds'));
})
//新增单据的作废
function csh510_csh_trx_bank_drop(){
$('csh510_csh_trx_bank_drop').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if (datas.length == 0) {
$L.showMessage("提示", '请选择要作废的单据');
$('csh510_csh_trx_bank_drop').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag= datas[i].get('confirmed_flag');
//不是新增就报错
if(confirmed_flag!='NEW'&&confirmed_flag!=undefined){
$L.showInfoMessage("提示", '请选择单据为未提交的数据', null, null);
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
//提交想改变之后的状态
'wanted_confirmed_flag': 'CANCELLED',
'_status': 'update'
});
};
//弹出确认修改的提示框
$L.showConfirm("提示",'确认执行该操作?',function(){
//锁屏
lock_current_window();
//作废单据
Leaf.request({
url: $('csh509N_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '该单据已作废!');
$('csh510_csh_trx_bank_drop').enable();
}, failure: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
error: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
scope: this
});
})
}
//新增申请按钮
function csh510_csh_trx_bank_apply_new() {
$('csh510_csh_trx_bank_apply_new').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
//获得所选择的的未提交的单据,如果有不是未提交的数据,提示重新进行选择
if (datas.length == 0) {
$L.showMessage("提示", '请至少选择一条数据');
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag = datas[i].get('confirmed_flag');
var bp_name=datas[i].get('bp_name');
if(bp_name==''||bp_name==undefined){
$L.showInfoMessage("提示", '商业伙伴为空,不能提交', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//不是新增就报错
if (confirmed_flag != 'NEW' && confirmed_flag != undefined) {
$L.showInfoMessage("提示", '请选择单据为未提交的数据', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
'_status': 'update'
});
}
//弹出确认修改的提示框
$L.showConfirm("提示", '确认执行该操作?', function () {
//锁屏
lock_current_window();
//改变未提交单据数据的状态
Leaf.request({
url: $('csh510N_csh_transaction_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '修改成功!');
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
}, failure: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
error: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
scope: this
});
},function(){
$('csh510_csh_trx_bank_apply_new').enable();
});
}
//跳转到收款新增页面
function csh510_csh_trx_bank_hand_add(){
//按钮失效
$('csh510_csh_trx_bank_hand_add').disable();
var url = $('csh_transaction_receipt_link').getUrl();
var win = new Leaf.Window({
title:'${l:CSH510.NEW_MANUAL_RECEIPT}',
url: url,
id: 'csh_trx_receipt_id',
fullScreen: true,
draggable: true
}).on('close', function() {
//按钮启用
$('csh510_csh_trx_bank_hand_add').enable();
});
}
//锁表
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
//解锁
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
}
function dateValidator(record, name, value) { //日期校验方法
if (name == 'transaction_date_from' || name == 'transaction_date_to') {
var start_date = Leaf.formatDate(record.get('transaction_date_from'));
var end_date = Leaf.formatDate(record.get('transaction_date_to'));
if (!!end_date) { //由于结束日期非必填,只有在结束日期填了才进行比较
if (!compareDate(start_date, end_date)) {
return '${l:CSH510.CSH_RECEIPT_DATE_CHECK}'; //校验不通过返回字符串
}
}
return true; //校验通过返回true
}
}
function compareDate(start, end) {
if (start > end) {
return false;
}
return true;
}
function csh510_receipt_query() {
var record = $('csh_transaction_receipt_maintain_query_ds').getAt(0);
var dirty_flag = 'N';
for (var name in record.data) {
var value = record.get(name);
if (value != 'undefined' && value != null && value != '') {
dirty_flag = 'Y';
}
}
if (dirty_flag == 'N') {
Leaf.showConfirm('${l:PROMPT}', '${l:CSH510.CSH_RECEIPT_QUERY_INFORMATION}', function () {
return;
}, function () {
$('csh_transaction_receipt_maintain_result_ds').query();
}, null, null);
} else {
$('csh_transaction_receipt_maintain_result_ds').query();
}
}
function csh510_receipt_reset() {
$('csh_transaction_receipt_maintain_query_ds').reset();
}
function csh510_receipt_back() {
history.go(-1);
}
function csh510_receipt_forward() {
history.go(1);
}
function csh510_receipt_quit() {
location.href = $('sys_service_welcome_link').getUrl();
parent.shMenu('show');
}
function seedetail_transaction_num(value, record, name) {
/* console.log(record.get('receipt_type'));
console.log( record.get('bp_name'));
console.log( record.get('confirmed_flag'));*/
if (record.get('transaction_id')) {
var url;
/*if (record.get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} /!*else*!/ else if (record.get('posted_flag') == 'Y') {
url = $('csh_transaction_receipt_update_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} else {
return value;
}*/
if(record.get('confirmed_flag')=='NEW' || record.get('confirmed_flag') == 'CT_REJECTED'){
url = $('csh_transaction_receipt_maintain_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=true';
}else{
url = $('csh_transaction_receipt_maintain_readonly_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=false';
}
return '<a href="javascript:openWindow(\'' + url + '\');">' + value + '</a>';
}
}
function openWindow(url) {
new Leaf.Window({
id: 'csh_transaction_receipt_link_winid',
params: {
winId: 'csh_transaction_receipt_link_winid'
},
url: url,
title: '${l:CSH510.CSH_RECEIPT_UPDATE}',
fullScreen: true
});
}
function construct_from_to() {
var config = ['transaction_num', 'bank_slip_num', 'transaction_amount', 'currency_code', 'bank_account_code'];
var pattern = ['_from', '_to'];
var obj = {};
for (var i = 0,
j = config.length; i < j; i++) {
for (var m = 0,
n = pattern.length; m < n; m++) {
obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
}
}
return obj;
}
function csh510_receipt_maintain_update(ds, record, name, value, oldvalue) {
var from_to = construct_from_to();
var opposite_name = from_to[name];
if (!Ext.isEmpty(opposite_name)) {
var opposite_value = record.get(opposite_name);
if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
record.set(opposite_name, value);
}
}
}
function csh510_receipt_remove() {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (!records.length) {
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.SELECT_RECORD}');
return;
}
var saveData = [];
for (var i = 0; i < records.length; i++) {
if(records[i].get('confirmed_flag') != 'NEW' && records[i].get('confirmed_flag') != 'CT_REJECTED'){
Leaf.showInfoMessage("提示","请选择新建或者收款退回的单据进行收款取消操作!");
return;
}
records[i].set('_status', 'delete');
saveData.push(records[i].data);
}
Leaf.showConfirm('${l:PROMPT}', '${l:HLS.DELETE_CONFIRM}', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.DELETING}');
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH510.csh_transaction_delete/batch_update',
para: saveData,
success: function () {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
csh510_delete_remove(records);
Leaf.Masker.unmask(Ext.getBody());
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, function () {
return;
}, null, null);
}
function csh510_delete_remove(records) {
while (records[0]) {
$('csh_transaction_receipt_maintain_result_ds').removeLocal(records[0]);
}
}
function csh510_receipt() {
Leaf.showConfirm('${l:PROMPT}', '非财务人员请勿操作!', function () {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}', '请选择1条数据!');
return;
}
if (records[0].get('transaction_id')) {
var url;
if (records[0].get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + records[0].get('transaction_id') + '&claim=F';
} else {
Leaf.showMessage('${l:PROMPT}', '该单据已经被认领,无需再次认领!');
return;
}
openWindow(url);
}
});
}
function csh510_batch_update() {
var ds_id = 'csh_transaction_receipt_maintain_result_ds';
var ds = $(ds_id)
var records = ds.getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:PROMPT}', '请至少选择一条要处理的单据');
return;
}
var auto_write_record = $('csh510_collection_classes_batch_update_ds').getAt(0);
var collection_classes = auto_write_record.get('collection_classes');
if (collection_classes) {
lock_current_window();
var post_data = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('write_off_flag') == 'FULL') {
Leaf.showMessage('${l:PROMPT}', '选择数据中包含已完全核销的数据');
return;
}
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'collection_classes': auto_write_record.get('collection_classes'),
'_status': 'update'
});
}
Leaf.request({
url: $('csh510_csh_transaction_batch_update').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
ds.query(ds.currentpage);
Leaf.showMessage('${l:PROMPT}', '修改成功!');
}, failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
}
}
function csh510_csh_transaction_batch_update(){
//
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择一条记录!');
return;
}
var post_data = [];
for (var i = 0; i < records.length; i++) {
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'_status': 'update'
});
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('csh511_csh_transaction_batch_post_link').getUrl(),
para: post_data,
success: function (res) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.SUBMIT_SUCCESS}');
csh510_receipt_query();
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function csh510_csh_trx_bank_import(){
//按钮失效
$('csh510_csh_trx_bank_import').disable();
//只有债权内勤才能
var url_l = $('csh510_csh_transaction_import_link').getUrl();
var win = new Leaf.Window({
id: 'csh510_csh_transaction_import_win',
url: url_l,
params: {
'winid': 'csh510_csh_transaction_import_win',
'session_id': '${/session/@session_id}',
'parent_ds_id': 'csh_transaction_receipt_maintain_result_ds'
},
title: '信息导入',
width: 430,
height: 390
});
win.on('close', function () {
$('csh_transaction_receipt_maintain_result_ds').query();
//按钮启用
$('csh510_csh_trx_bank_import').enable();
});
}
function csh510_export() {
$('csh_transaction_receipt_maintain_grid_ds')._export(null,'收款维护');
}
]]></script>
<a:dataSets>
<a:dataSet id="confirmed_flag_ds">
<a:datas>
<a:record code_value="NEW" code_value_name="新建"/>
<a:record code_value="ACCAUDITING" code_value_name="收款确认中"/>
<a:record code_value="CT_REJECTED" code_value_name="收款退回"/>
<a:record code_value="ACCAUDITED" code_value_name="收款已确认"/>
</a:datas>
</a:dataSet>
<a:dataSet id="bp_category_ds" lookupCode="BP_CATEGORY">
</a:dataSet>
<!-- <a:dataSet id="confirmed_flag_ds" lookupCode="CONFIRMED_FLAG">-->
<!-- </a:dataSet>-->
<a:dataSet id="payment_method_ds">
<a:datas dataSource="/model/payment_method_path"/>
</a:dataSet>
<a:dataSet id="receipt_type_ds" lookupCode="RECEIPT_TYPE"/>
<a:dataSet id="currency_ds">
<a:datas dataSource="/model/currency"/>
</a:dataSet>
<a:dataSet id="transaction_type_ds">
<a:datas dataSource="/model/transaction_type"/>
</a:dataSet>
<!-- <a:dataSet id="transaction_type_ds" lookupCode="CSH511_TRANSACTION_TYPE"/> -->
<a:dataSet id="posted_flag_ds" lookupCode="CSH510_POST_SELECT"/>
<!-- 去掉退款事务 -->
<a:dataSet id="returned_flag_ds">
<a:datas dataSource="/model/returned_flag_rp"/>
</a:dataSet>
<!-- 去掉反冲事务 -->
<a:dataSet id="reversed_flag_ds">
<a:datas dataSource="/model/reversed_flag_rp"/>
</a:dataSet>
<a:dataSet id="ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>
<a:dataSet id="csh510_collection_classes_batch_update_ds">
<a:fields>
<a:field name="collection_classes_desc" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_query_ds" autoCreate="true">
<a:fields>
<a:field name="bank_account_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_branch_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_account_num" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="confirmed_flag_desc" options="confirmed_flag_ds" valueField="code_value" displayField="code_value_name" returnField="confirmed_flag"/>
<a:field name="payment_method_display" displayField="description" options="payment_method_ds" returnField="payment_method_id" valueField="payment_method_id"/>
<a:field name="bp_name_from" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_from"/>
<a:map from="bp_name" to="bp_name_from"/>
</a:mapping>
</a:field>
<a:field name="bp_id_from"/>
<a:field name="bp_name_to" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_to"/>
<a:map from="bp_name" to="bp_name_to"/>
</a:mapping>
</a:field>
<a:field name="bp_id_to"/>
<a:field name="transaction_num_from"/>
<a:field name="transaction_num_to"/>
<a:field name="bank_slip_num_from"/>
<a:field name="bank_slip_num_to"/>
<a:field name="transaction_date_from" validator="dateValidator"/>
<a:field name="transaction_date_to" validator="dateValidator"/>
<a:field name="bank_account_code" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code"/>
</a:mapping>
</a:field>
<a:field name="bank_account_code_from" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_from"/>
</a:mapping>
</a:field>
<a:field name="bank_account_from_id"/>
<a:field name="bank_account_code_to" autoComplete="true" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_to"/>
</a:mapping>
</a:field>
<a:field name="transaction_amount_from"/>
<a:field name="transaction_amount_to"/>
<a:field name="posted_flag_display" displayField="code_value_name" options="posted_flag_ds" returnField="posted_flag" valueField="code_value"/>
<a:field name="posted_flag" defaultValue="N"/>
<a:field name="returned_flag_display" displayField="code_value_name" options="returned_flag_ds" returnField="returned_flag" valueField="code_value"/>
<a:field name="reversed_flag_display" displayField="code_value_name" options="reversed_flag_ds" returnField="reversed_flag" valueField="code_value"/>
<a:field name="period_name" lovGridHeight="300" lovHeight="500" lovService="gld.gld_period_lov" lovWidth="500" title="GLD_PERIODS.PERIOD_NAME">
<a:mapping>
<a:map from="period_name" to="period_name"/>
</a:mapping>
</a:field>
<a:field name="user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="AUT_TRX_USER_AUTHORIZE.USER_ID" title="员工选择">
<a:mapping>
<a:map from="description" to="user_desc"/>
<a:map from="user_id" to="user_id"/>
</a:mapping>
</a:field>
<a:field name="transaction_type_display" displayField="code_value_name" options="transaction_type_ds" returnField="transaction_type" valueField="code_value"/>
<a:field name="currency_name_from_display" displayField="currency_name" options="currency_ds" returnField="currency_code_from" valueField="currency_code"/>
<a:field name="currency_code_from"/>
<a:field name="currency_name_to_display" displayField="currency_name" options="currency_ds" returnField="currency_code_to" valueField="currency_code"/>
<a:field name="currency_code_to"/>
<a:field name="transaction_type" defaultValue="RECEIPT"/>
<a:field name="transaction_category" defaultValue="BUSINESS"/>
<!-- <a:field name="write_off_flag_desc" displayField="code_value_name" options="write_off_flag_ds" returnField="write_off_flag" valueField="code_value"/>-->
<a:field name="not_reversed_flag_r" defaultValue="NOT"/>
<a:field name="receipt_type"/>
<a:field name="receipt_type_des" displayField="code_value_name" options="receipt_type_ds" returnField="receipt_type" valueField="code_value"/>
<a:field name="description"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
</a:mapping>
</a:field>
<a:field name="collection_classes_n" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<!--对方账户的-->
<a:field name="bp_bank_account_name" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="opposite_band_na" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="bp_bank_account_num" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
</a:fields>
<a:events>
<a:event name="update" handler="csh510_receipt_maintain_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_result_ds" autoPageSize="true" autoQuery="true" model="csh.CSH510.csh_transaction_miantain_query" queryDataSet="csh_transaction_receipt_maintain_query_ds" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<!-- <a:gridButton click="csh510_receipt_back" text="HLS.BACK"/>
<a:gridButton click="csh510_receipt_forward" text="HLS.FORWARD"/> -->
<!-- <a:gridButton click="csh510_receipt_quit" text="HLS.EXIT"/> -->
<a:gridButton click="csh510_receipt_query" text="HLS.QUERY" id="csh510_receipt_query"/>
<a:gridButton click="csh510_csh_trx_bank_import" text="CSH510.CSH_TRANSACTION.RECEIVE_MONEY_IMPORT_BTN" id="csh510_csh_trx_bank_import"/>
<a:gridButton click="csh510_csh_trx_bank_hand_add" text="CSH510.CSH_TRANSACTION.MONEY_HAND_ADD_BTN" id="csh510_csh_trx_bank_hand_add"/>
<a:gridButton click="csh510_receipt_remove" text="收款取消"/>
<!-- <a:gridButton click="csh510_csh_trx_bank_apply_new" text="提交复核" id="csh510_csh_trx_bank_apply_new"/>-->
<!-- <a:gridButton click="csh510_csh_trx_bank_drop" text="CSH510.CSH_TRANSACTION.DROP_BTN" id="csh510_csh_trx_bank_drop"/>-->
<a:gridButton click="csh510_receipt_reset" text="HLS.RESET"/>
<!-- <a:gridButton click="csh510_csh_transaction_batch_update" text="批量过账"/>-->
<!-- <a:gridButton click="csh510_receipt" text="财务认领"/> -->
</a:screenTopToolbar>
<a:form bindTarget="csh_transaction_receipt_write_off_query_ds" labelWidth="120" marginWidth="80"
title="收款核销" style="margin-left:20px">
<a:hBox>
<a:fieldSet column="4" labelWidth="150" title="HLS.QUERY_TITLE">
<a:datePicker name="transaction_date_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_FROM"/>
<a:datePicker name="transaction_date_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_TO"/>
<a:numberField name="transaction_amount_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_FROM" align="right"/>
<a:numberField name="transaction_amount_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_TO" align="right"/>
<!--我方账户户名-->
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME"/>
<a:lov name="bank_branch_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME"/>
<a:lov name="bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME"/>
<!--银行流水号-->
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE"/>
<!--对方账户户名-->
<a:lov name="bp_bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME"/>
<!--对方银行名称-->
<a:lov name="opposite_band_na" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/>
<!--对方账户账号-->
<a:lov name="bp_bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>
<a:textField style="display:none"/>
<a:lov name="bp_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER"/>
<a:comboBox name="confirmed_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="单据审批状态"/>
<!-- <a:comboBox name="write_off_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS"/>-->
<a:comboBox name="collection_classes_n" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS"/>
</a:fieldSet>
</a:hBox>
</a:form>
<a:fieldSet labelWidth="150" title="收款单" style="margin-left:20px">
<a:grid id="csh_transaction_receipt_maintain_grid_ds" bindTarget="csh_transaction_receipt_maintain_result_ds" marginHeight="300" marginWidth="80" navBar="true" >
<!--<a:toolBar>
<a:button click="csh510_export" text="导出"/>
</a:toolBar>-->
<a:columns>
<a:column name="transaction_num" prompt="CSH510.CSH_TRANSACTION.CSH_TRANSACTION_NUM" renderer="seedetail_transaction_num" width="110" align="center"/>
<a:column name="receipt_type_n" align="center" prompt="CSH510.CSH_TRANSACTION.RECEIPT_TYPE" width="100"/>
<a:column name="transaction_amount" align="right" prompt="CSH510.CSH_TRANSACTION.RECEIPT_AMOUNT" width="100" renderer="Leaf.formatMoney"/>
<a:column name="transaction_date" renderer="Leaf.formatDate" align="center"/>
<a:column name="returned_amount" prompt="CSH510.CSH_TRANSACTION.RETURN_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="use_money_amount" prompt="CSH510.CSH_TRANSACTION.USEFUL_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="collection_classes_desc" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS" align="center"/>
<a:column name="bp_name" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER" align="center"/>
<a:column name="bank_slip_num" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE" align="center"/>
<a:column name="description" prompt="CSH510.CSH_TRANSACTION.DESCRIPTION" align="center"/>
<a:column name="confirmed_flag_desc" prompt="单据审批状态" align="center"/>
<!-- <a:column name="written_off_flag_desc" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS" align="center"/>-->
<a:column prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="bank_branch_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bank_account_num" align="center"/>
</a:column>
<a:column prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bp_bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="opposite_band_na" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bp_bank_account_num" align="center"/>
</a:column>
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY" align="center"/>
<!-- <a:column name="debt_confirmed_by_desc" prompt="CSH510.CSH_TRANSACTION.DEPT_CONFIRMER" align="center"/>-->
<a:column name="acc_confirmed_by_desc" prompt="确认人" align="center"/>
</a:columns>
<a:editors>
<a:numberField id="number_editor" allowDecimals="true" decimalPrecision="2" editable="false"/>
</a:editors>
</a:grid>
</a:fieldSet>
</a:screenBody>
</a:view>
</a:screen>
......@@ -7,8 +7,8 @@
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
<!-- <a:model-query fetchAll="true" model="hls.HLS530.get_batch_id" rootPath="batch_id_path"/> -->
<a:model-query defaultWhereClause="t1.document_category = &apos;JE&apos;" fetchAll="true" model="basic.hls_document_type_for_lov" queryOrderBy="document_type desc" rootPath="hls_document_type_path"/>
<a:model-query fetchAll="true" model="hls.HLS301.get_sbo_limit" rootPath="get_limit"/>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_manual_create_link_id" url="${/request/@context_path}/modules/hls/HLS530/manual_journal_create.lview"/>
......@@ -19,122 +19,169 @@
<a:link id="hls_journal_post_to_gld_link" model="hls.HLS301.hls_journal_post_to_gld" modelaction="batch_update"/>
<a:link id="hls_journal_unpost_to_gld_link" model="hls.HLS301.hls_journal_unpost_to_gld" modelaction="batch_update"/>
<a:link id="check_link" url="${/request/@context_path}/modules/hls/HLS530/hls_journal_check.lsc"/>
<a:link id="test_link" url="${/request/@context_path}/test.lsc"/>
<a:link id="transfer_ref_link" url="${/request/@context_path}/transfer_ref.lsc"/>
<!-- <a:link id="transfer_voucher_link" url="${/request/@context_path}/transfer_voucher.lsc"/> -->
<a:link id="transfer_voucher_link" url="${/request/@context_path}/modules/interface/INTERFACE_KINGDEE/kingdee_importvoucher_interface.lsc"/>
<a:link id="kingdee_interface_logs_id" url="${/request/@context_path}/modules/hls/HLS530/kingdee_interface_logs.lview"/>
<a:link id="hls_journal_close_link" model="hls.HLS530.hls_journal_close" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
function render_line(record, rowIndex) {
if (record.get('kingdee_head_flag') == 'N' || record.get('kingdee_line_assist_flag') == 'N') {
return 'background-color:#FFC0CB';
<a:link id="transfer_voucher_link" url="${/request/@context_path}/transfer_voucher.lsc"/>
<a:link id="hls301_send_data" url="${/request/@context_path}/modules/hls/HLS301/hls_journal_send.lsc"/>
<a:link id="hls301_send_bp_to_sbo" model="hls.HLS301.hls_bp_post_to_sbo" modelaction="update"/>
<script><![CDATA[
//查询按钮
function hls301_journal_query() {
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls301_journal_reset() {
$('hls_journal_header_query').reset();
}
//退出按钮
function hls301_journal_exit() {
location.href = $('welcome_link_id').getUrl();
parent.shMenu('show');
}
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
function lock_current_window2(msg) {
Leaf.Masker.mask(Ext.getBody(), msg);
}
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
}
function construct_from_to() {
var config = ['responsibility_center_code', 'responsibility_center_name', 'account_code', 'account_name'];
var pattern = ['_from', '_to'];
var obj = {};
for (var i = 0,
j = config.length;i < j;i++) {
for (var m = 0,
n = pattern.length;m < n;m++) {
obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
}
}
//查询按钮
function hls301_journal_query() {
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls301_journal_reset() {
$('hls_journal_header_query').reset();
}
//退出按钮
function hls301_journal_exit() {
location.href = $('welcome_link_id').getUrl();
parent.shMenu('show');
}
function construct_from_to() {
var config = ['responsibility_center_code', 'responsibility_center_name', 'account_code', 'account_name'];
var pattern = ['_from', '_to'];
var obj = {};
for (var i = 0,
j = config.length;i < j;i++) {
for (var m = 0,
n = pattern.length;m < n;m++) {
obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
}
}
return obj;
}
function onUpdate_para_journalQueryDs(ds, record, name, value, oldvalue) {
var from_to = construct_from_to();
var opposite_name = from_to[name];
if (!Ext.isEmpty(opposite_name)) {
var opposite_value = record.get(opposite_name);
if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
record.set(opposite_name, value);
}
return obj;
}
function onUpdate_para_journalQueryDs(ds, record, name, value, oldvalue) {
var from_to = construct_from_to();
var opposite_name = from_to[name];
if (!Ext.isEmpty(opposite_name)) {
var opposite_value = record.get(opposite_name);
if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
record.set(opposite_name, value);
}
}
function hls301_journal_new() {
var param = new Object();
param['function_code'] = 'HLS530';
param['document_category'] = 'JE';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
param['manual_flag'] = 'Y';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_manual_create_link_id');
}
function hls301_link_dynamic(reocrd_id, journal_header_id) {
var maintain_type = 'UPDATE';
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
if (record.get('post_gl_status') == 'Y') {
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS530.JOURNAL_POST_GL_STATUS_IS_Y}');
return false;
}
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS530';
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}';
param['manual_flag'] = 'N';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_manual_create_link_id');
}
function hls301_journal_new() {
var param = new Object();
param['function_code'] = 'HLS530';
param['document_category'] = 'JE';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_manual_create_link_id');
}
function hls301_link_dynamic(reocrd_id, journal_header_id) {
var maintain_type = 'UPDATE';
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
if (record.get('post_gl_status') == 'Y') {
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS530.JOURNAL_POST_GL_STATUS_IS_Y}');
return false;
}
function hls301_journal_num_render(value, record, name) {
return '<a href="javascript:hls301_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS530';
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_manual_create_link_id');
}
function hls301_journal_num_render(value, record, name) {
return '<a href="javascript:hls301_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
function journal_submit(datas) {
Leaf.request({
url: $('hls_journal_post_to_gld_link').getUrl(),
para: datas,
success: function(res) {
f_hls.winNoMask();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
$('hls_journal_header_result_ds').query();
},
failure: function() {
f_hls.winNoMask();
},
error: function() {
f_hls.winNoMask();
},
scope: this
});
}
var transfer_ref_flag = 'N';
function hls301_journal_post_ref() {
f_hls.winMask();
var ds = $('hls_journal_header_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
f_hls.winNoMask();
return;
}
function journal_submit(datas) {
Leaf.request({
url: $('hls_journal_post_to_gld_link').getUrl(),
para: datas,
success: function(res) {
f_hls.winNoMask();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
$('hls_journal_header_result_ds').query();
},
failure: function() {
f_hls.winNoMask();
},
error: function() {
f_hls.winNoMask();
},
scope: this
});
var datas = [];
for (var i = 0;i < records.length;i++) {
var obj = {};
obj['journal_id'] = records[i].get('journal_header_id');
obj['_status'] = 'update';
datas[i] = obj;
}
var transfer_ref_flag = 'N';
function hls301_journal_post_ref() {
Leaf.request({
url: $('transfer_ref_link').getUrl(),
para: datas,
success: function(res) {
f_hls.winNoMask();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
transfer_ref_flag = 'Y';
//hls301_journal_query();
},
failure: function() {
f_hls.winNoMask();
},
error: function() {
f_hls.winNoMask();
},
scope: this
});
}
function hls301_journal_post() {
debugger;
var url = $('test_link').getUrl();
if (0) {
Leaf.showMessage('${l:HLS.PROMPT}', '请先传递凭证辅助段');
} else {
f_hls.winMask();
var ds = $('hls_journal_header_result_ds');
var records = ds.getSelected();
......@@ -148,158 +195,33 @@
obj['journal_id'] = records[i].get('journal_header_id');
obj['_status'] = 'update';
datas[i] = obj;
if (records[i].get('je_transaction_code') == 'FIN_INCOME_RECOGNITION') {
// if(transfer_ref_flag == 'N'){
// Leaf.showMessage('${l:HLS.PROMPT}', '收入确认凭证请先传递凭证辅助段');
// f_hls.winNoMask();
// return;
// }
url = $('transfer_voucher_link').getUrl();
}
}
Leaf.request({
url: $('transfer_ref_link').getUrl(),
url: $('check_link').getUrl(),
para: datas,
success: function(res) {
f_hls.winNoMask();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
transfer_ref_flag = 'Y';
//hls301_journal_query();
},
failure: function() {
f_hls.winNoMask();
},
error: function() {
f_hls.winNoMask();
},
scope: this
});
}
// function hls301_journal_post() {
// var url=$('test_link').getUrl();
// if(0){
// Leaf.showMessage('${l:HLS.PROMPT}', '请先传递凭证辅助段');
// }else{
// f_hls.winMask();
// var ds = $('hls_journal_header_result_ds');
// var records = ds.getSelected();
// if (records.length == 0) {
// f_hls.winNoMask();
// return;
// }
// var datas = [];
// for (var i = 0;i < records.length;i++) {
// var obj = {};
// obj['journal_id'] = records[i].get('journal_header_id');
// obj['_status'] = 'update';
// datas[i] = obj;
// if(records[i].get('je_transaction_code')=='FIN_INCOME_RECOGNITION'){
// // if(transfer_ref_flag == 'N'){
// // Leaf.showMessage('${l:HLS.PROMPT}', '收入确认凭证请先传递凭证辅助段');
// // f_hls.winNoMask();
// // return;
// // }
// url =$('transfer_voucher_link').getUrl();
// }
// }
// Leaf.request({
// url: $('check_link').getUrl(),
// para: datas,
// success: function(res) {
// Leaf.request({
// url: url,
// para: datas,
// success: function(res) {
// f_hls.winNoMask();
// Leaf.SideBar.show({
// msg: '${l:HLS.SUBMIT_SUCCESS}',
// duration: 2000
// });
// hls301_journal_query();
// },
// failure: function() {
// f_hls.winNoMask();
// },
// error: function() {
// f_hls.winNoMask();
// },
// scope: this
// });
// },
// failure: function() {
// f_hls.winNoMask();
// },
// error: function() {
// f_hls.winNoMask();
// },
// scope: this
// });
// }}
function hls_journal_post_kingdee() {
var url = $('transfer_voucher_link').getUrl();
if (0) {
Leaf.showMessage('${l:HLS.PROMPT}', '请先传递凭证辅助段');
} else {
f_hls.winMask();
var ds = $('hls_journal_header_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
f_hls.winNoMask();
Leaf.showMessage('${l:HLS.PROMPT}', '请选择一条数据');
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
//Check
if (records[i].get('kingdee_line_assist_flag') == 'N') {
f_hls.winNoMask();
Leaf.showMessage('${l:HLS.PROMPT}', '辅助账信息有误或缺失,请检查数据!');
return;
}
if (records[i].get('post_gl_status') == 'CLOSE') {
f_hls.winNoMask();
Leaf.showMessage('${l:HLS.PROMPT}', '所选凭证已经关闭,请重新选择!');
return;
}
var obj = {};
obj['journal_id'] = records[i].get('journal_header_id');
obj['_status'] = 'update';
datas[i] = obj;
}
Leaf.showConfirm('提示', '确定导入凭证到金蝶吗?', function() {
Leaf.request({
url: $('check_link').getUrl(),
url: url,
para: datas,
success: function(res) {
Leaf.request({
url: url,
para: datas,
success: function(res) {
f_hls.winNoMask();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
var kingdee_url = $('kingdee_interface_logs_id').getUrl() + '?batch_id=' + res.result.batch_id_path.record[0].batch_id;
var win = new Leaf.Window({
url: kingdee_url,
title: '金蝶导入日志',
id: 'kingdee_interface_logs_winid',
width: 850,
height: 400
});
win.on('close', function() {
hls301_journal_query();
});
},
failure: function() {
f_hls.winNoMask();
},
error: function() {
f_hls.winNoMask();
},
scope: this
f_hls.winNoMask();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
hls301_journal_query();
},
failure: function() {
f_hls.winNoMask();
......@@ -309,105 +231,203 @@
},
scope: this
});
}, function() {
},
failure: function() {
f_hls.winNoMask();
});
}
},
error: function() {
f_hls.winNoMask();
},
scope: this
});
}
//凭证关闭
function hls_journal_close() {
f_hls.winMask();
var ds = $('hls_journal_header_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
}
function journal_submit_unpost(datas) {
Leaf.request({
url: $('hls_journal_unpost_to_gld_link').getUrl(),
para: datas,
success: function(res) {
f_hls.winNoMask();
Leaf.showMessage('${l:HLS.PROMPT}', '请选择一条数据');
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
if (records[i].get('post_gl_status') == 'Y') {
f_hls.winNoMask();
Leaf.showMessage('${l:HLS.PROMPT}', '已过账凭证无法关闭,请重新选择!');
return;
}
if (records[i].get('post_gl_status') == 'CLOSE') {
f_hls.winNoMask();
Leaf.showMessage('${l:HLS.PROMPT}', '所选凭证已经关闭,无需重复操作!');
return;
}
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'update';
datas[i] = obj;
}
Leaf.showConfirm('提示', '确定关闭所选凭证吗?', function() {
Leaf.request({
url: $('hls_journal_close_link').getUrl(),
para: datas,
success: function(res) {
f_hls.winNoMask();
hls301_journal_query();
},
failure: function() {
f_hls.winNoMask();
},
error: function() {
f_hls.winNoMask();
},
scope: this
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
}, function() {
$('hls_journal_header_result_ds').query();
},
failure: function() {
f_hls.winNoMask();
});
},
error: function() {
f_hls.winNoMask();
},
scope: this
});
}
function hls301_journal_unpost() {
f_hls.winMask();
var ds = $('hls_journal_header_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
f_hls.winNoMask();
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'execute';
datas[i] = obj;
}
function journal_submit_unpost(datas) {
journal_submit_unpost(datas);
}
function on_loan_journal_header_query(ds, qpara) {
qpara['gld_flag'] = 'N';
}
function hls301_bp_send() {
Leaf.showConfirm('提示', '商业伙伴(项目已创建合同)同步至SBO,(上限400)您确定继续吗?', function() {
lock_current_window();
Leaf.request({
url: $('hls_journal_unpost_to_gld_link').getUrl(),
para: datas,
success: function(res) {
f_hls.winNoMask();
url: $('hls301_send_bp_to_sbo').getUrl(),
success: function() {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
msg: '提交成功',
duration: 3000
});
$('hls_journal_header_result_ds').query();
unlock_current_window();
//$('hls_journal_header_result_ds').query();
},
failure: function() {
f_hls.winNoMask();
unlock_current_window();
},
error: function() {
f_hls.winNoMask();
unlock_current_window();
},
scope: this
});
});
}
//手动传输凭证
function hls301_journal_send() {
var je_detail_count = 0;
var count = 0;
var batch_flag;
var records = $('hls_journal_header_result_ds').getSelected();
var limit = '${get_limit/record/@sbo_limit}';
var sbo_detail_limit = '${get_limit/record/@sbo_detail_limit}';
if (isNaN(limit)){
Leaf.showMessage('${l:HLS.PROMPT}', '传输上限获取失败,请联系管理员!');
return;
}
function hls301_journal_unpost() {
f_hls.winMask();
var ds = $('hls_journal_header_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
f_hls.winNoMask();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择至少一条数据');
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
if (records[i].get('post_gl_status') == 'Y' || records[i].get('post_gl_status') == 'PROCESSING') {
Leaf.showMessage('${l:HLS.PROMPT}', '该凭证已传输至SBO系统');
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'execute';
datas[i] = obj;
}
journal_submit_unpost(datas);
je_detail_count = Number(records[i].get('je_detail_count'));
count = je_detail_count + Number(count);
var data = {
journal_header_id: records[i].get('journal_header_id')
};
datas.push(data);
}
function on_loan_journal_header_query(ds, qpara) {
qpara['gld_flag'] = 'N';
/* if (count > limit) {
batch_flag = 'Y';
} else {
batch_flag = 'N';
} */
if (count > sbo_detail_limit) {
Leaf.showMessage('${l:HLS.PROMPT}', '选择的凭证总行数超过了能够传输的最大的数量' + sbo_detail_limit + '条,')
return;
}
batch_flag = 'Y'; // 全部修改为异步传输
var queryParams = new Object();
queryParams['details'] = datas;
queryParams['batch_flag'] = batch_flag;
/* if (count > limit) {
Leaf.showConfirm('提示', '由于凭证行数超过'+limit+'行,传输至SBO后不能立即得到返回结果,您确定继续吗?', function() { */
lock_current_window2('正在传送,请勿离开当前界面。。。');
Leaf.request({
url: $('hls301_send_data').getUrl(),
para: queryParams,
success: function() {
Leaf.SideBar.show({
msg: '已提交请求',
duration: 3000
});
unlock_current_window();
$('hls_journal_header_result_ds').query();
},
failure: function() {
unlock_current_window();
},
error: function() {
unlock_current_window();
},
scope: this
});
/* });
} else {
lock_current_window2('正在传送,请勿离开当前界面。。。');
Leaf.request({
url: $('hls301_send_data').getUrl(),
para: queryParams,
success: function() {
Leaf.SideBar.show({
msg: '已提交请求',
duration: 3000
});
unlock_current_window();
$('hls_journal_header_result_ds').query();
},
failure: function() {
unlock_current_window();
},
error: function() {
unlock_current_window();
},
scope: this
});
} */
}
function hls_journal_header_result_func(record, name) {
if (name == 'post_gl_log') {
return 'hls_journal_headers_grid_textArea_id';
}
return '';
}
function select_check_box(record) {
if (record.get('post_gl_status') == 'Y' || record.get('post_gl_status') == 'PROCESSING') {
return false;
} else if (record.get('post_gl_status') == 'FAILURE') {
return true;
}
if (record.get('je_transaction_code') == 'HL_PAYMENT_FEE_1') {
return true;
} else if (record.get('je_transaction_code') == 'HL_PAYMENT_FEE') {
return true;
} else {
return true;
}
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
......@@ -428,7 +448,7 @@
<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="350" lovHeight="550" lovService="basic.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="500">
<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"/>
......@@ -489,7 +509,7 @@
<a:event name="update" handler="onUpdate_para_journalQueryDs"/>
</a:events>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS301.hls_journal_header_v" queryDataSet="hls_journal_header_query" selectable="true">
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS301.hls_journal_header_v" queryDataSet="hls_journal_header_query" selectFunction="select_check_box" selectable="true">
<a:fields>
<a:field name="post_gl_log" readOnly="true"/>
</a:fields>
......@@ -501,17 +521,17 @@
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<!-- <a:toolbarButton click="hls301_journal_exit" text="HLS.EXIT"/> -->
<a:toolbarButton click="hls301_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls301_journal_exit" text="HLS.EXIT"/>
<a:toolbarButton click="hls301_journal_reset" text="HLS.RESET"/>
<a:toolbarButton click="hls301_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls301_journal_new" text="手工创建"/>
<a:toolbarButton id="hls301_journal_post_ref_id" click="hls_journal_post_kingdee" text="凭证传输"/>
<a:toolbarButton id="hls301_journal_close_id" click="hls_journal_close" text="凭证关闭"/>
<a:toolbarButton click="hls301_journal_send" text="凭证传输"/>
<a:toolbarButton click="hls301_bp_send" text="商业伙伴传输"/>
<!-- <a:toolbarButton id="hls301_journal_post_ref_id" click="hls301_journal_post_ref" text="传辅助段"/> -->
<!-- <a:toolbarButton click="hls301_journal_post" text="HLS530.JOURNAL_POST_GL"/> -->
<!-- <a:toolbarButton click="hls301_journal_unpost" text="HLS530.JOURNAL_UNPOST_GL"/> -->
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="80" 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="HLS530.JOURNAL_NUM"/>
<a:comboBox name="merge_parent_flag_desc" bindTarget="hls_journal_header_query" prompt="合并凭证"/>
<!-- <a:lov name="account_code_from" bindTarget="hls_journal_header_query" prompt="HLS530.ACCOUNT_NAME_FROM"/>
......@@ -522,13 +542,13 @@
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="HLS530.TOTAL_AMOUNT_DR_FROM"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="HLS530.TOTAL_AMOUNT_DR_TO"/>
<a:lov name="je_transaction_desc" bindTarget="hls_journal_header_query" prompt="HLS530.JE_TRANSACTION"/>
<a:lov name="bp_id_tenant_desc" bindTarget="hls_journal_header_query" prompt="HLS.TENANT_CODE"/>
<a:lov name="bp_id_tenant_desc" bindTarget="hls_journal_header_query" prompt="商业伙伴"/>
<a:comboBox name="post_gl_status_desc" bindTarget="hls_journal_header_query" prompt="HLS530.IS_POSTED"/>
<a:textField name="contract_number" bindTarget="hls_journal_header_query" prompt="合同编号"/>
<!-- <a:textField name="external_journal_num" bindTarget="hls_journal_header_query" prompt="HLS530.EXTERNAL_JOURNAL_NUM"/> -->
<!-- <a:textField name="reference1" bindTarget="hls_journal_header_query" prompt="HLS530.REFERENCE1"/> -->
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="280" marginWidth="80" navBar="true" >
<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="HLS530.JOURNAL_NUM" renderer="hls301_journal_num_render" width="120"/>
<a:column name="js_company_short_name" prompt="HLS530.JOURNAL_COMPANY" width="90"/>
......@@ -540,7 +560,10 @@
<a:column name="je_transaction_desc" prompt="HLS530.JE_TRANSACTION" width="150"/>
<a:column name="description" prompt="HLS530.JOURNAL_DESCRIPTION" width="220"/>
<a:column name="post_gl_status_desc" align="center" prompt="HLS.STATUS" width="100"/>
<!-- <a:column name="external_journal_num" align="center" prompt="NC凭证号" width="100"/> -->
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="sbo_num" align="center" prompt="SBO凭证号" width="100"/>
<a:column name="post_gl_log" editorFunction="hls_journal_header_result_func" prompt="传输信息" width="150"/>
<a:column name="sbo_req_number" align="center" prompt="SBO请求批次号" width="130"/>
<!--<a:column name="post_gl_log" editor="hls530_textArea_id" prompt="金蝶日志" width="200"/> -->
</a:columns>
<a:editors>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zengyuxuan
$Date: 2016-11-16 上午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_kingdee_line_flag" model="hls.HLS301.get_kingdee_line_flag" modelaction="update"/>
<script src="${/request/@context_path}/javascripts/jquery-1.6.4.min.js" type="text/javascript"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<style type="text/css"><![CDATA[
.SelectBG{
background-color:#FFC0CB;
}
]]></style>
<script type="text/javascript"><![CDATA[
jQuery.noConflict();
var isLoaded = 'N';
// set单元格颜色 load事件无法实现效果
var check_isload = setInterval(function() {
//
if (isLoaded == 'N') {
var ids = $('${/parameter/@layout_code}_JE_LN_hls_journal_detail_ds');
var ref_ids = $('${/parameter/@layout_code}_JE_LN_REF1_hls_journal_detail_ds');
var idsRecord = ids.getAll();
var ref_idsRecord = ref_ids.getAll();
for (var i = 0;i < idsRecord.length;i++) {
var rowData = idsRecord[i];
var ids_rowData = idsRecord[i];
var kingdee_line_flag = ids_rowData.get('kingdee_line_flag');
//kingdee_line_flag为C代表金蝶支付表编号不为空,为B代表金蝶客户编号不为空
if (kingdee_line_flag == 'N' || kingdee_line_flag == 'C' || kingdee_line_flag == 'B') {
tr_id = '#${/parameter/@layout_code}_JE_LN_hls_journal_detail_layout_grid_id-u-' + rowData.id;
jQuery(tr_id).removeClass("row-selected").addClass('SelectBG');
}
}
for (var j = 0;j < ref_idsRecord.length;j++) {
var ref_rowData = ref_idsRecord[j];
kingdee_line_flag = ref_rowData.get('kingdee_line_flag');
//kingdee_line_flag为C代表金蝶支付表编号不为空,为B代表金蝶客户编号不为空
if (kingdee_line_flag == 'N') {
tr_ref_id = '#${/parameter/@layout_code}_JE_LN_REF1_hls_journal_detail_layout_grid_id_reference1_' + ref_rowData.id;
jQuery(tr_ref_id).removeClass("row-selected").addClass('SelectBG');
tr_ref_id_2 = '#${/parameter/@layout_code}_JE_LN_REF1_hls_journal_detail_layout_grid_id_reference3_' + ref_rowData.id;
jQuery(tr_ref_id_2).removeClass("row-selected").addClass('SelectBG');
} else if (kingdee_line_flag == 'C') {
tr_ref_id = '#${/parameter/@layout_code}_JE_LN_REF1_hls_journal_detail_layout_grid_id_reference3_' + ref_rowData.id;
jQuery(tr_ref_id).removeClass("row-selected").addClass('SelectBG');
} else if (kingdee_line_flag == 'B') {
tr_ref_id = '#${/parameter/@layout_code}_JE_LN_REF1_hls_journal_detail_layout_grid_id_reference1_' + ref_rowData.id;
jQuery(tr_ref_id).removeClass("row-selected").addClass('SelectBG');
}
}
} else {
clearInterval(check_isload);
}
}, 1000);
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 = plus(sum_dr, je_record.get('amount_dr'));
}
if (!isNaN(je_record.get('amount_cr'))) {
sum_cr = plus(sum_cr, je_record.get('amount_cr'));
}
}
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 {
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');
$(detail1_ds_id).query();
};
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_num;
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');
var manual_flag = '${/parameter/@manual_flag}';
if (manual_flag == 'Y') {
record.set('je_company_id', 1);
record.set('je_company_id_n', '宏菱融资租赁(上海)有限公司');
record.set('je_transaction_code', 'MANUAL');
record.set('je_transaction_code_n', '手工生成');
record.set('post_gl_status', 'N');
record.set('currency_code', 'CNY');
record.set('currency_code_n', '人民币')
record.set('exchange_rate', 1);
record.set('reversed_flag', 'N');
record.set('source_table', 'HLS_JOURNAL_HEADER');
record.set('company_id', 1);
}
};
//导出
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = '${/parameter/@layout_code}_JE_LN_hls_journal_detail_ds';
var ref_ds_id = '${/parameter/@layout_code}_JE_LN_REF1_hls_journal_detail_ds';
var grid_id = ds_id.replace('ds', 'layout_grid_id');
var ref_grid_id = ref_ds_id.replace('ds', 'layout_grid_id');
$(grid_id)._export();
$(ref_grid_id)._export();
};
]]></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: zengyuxuan
$Date: 2016-11-16 上午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{
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');
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>
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