Commit fc3b8f20 authored by stone's avatar stone

[fix] 完成收款功能

parent 1a9f1f96
......@@ -18,6 +18,7 @@ sys_code_pkg.insert_sys_code_value('CONFIRMED_FLAG','MKTAUDITING','营业新增
sys_code_pkg.insert_sys_code_value('CONFIRMED_FLAG','ACCAUDITING','会计新增确认中','ZHS','');
sys_code_pkg.insert_sys_code_value('CONFIRMED_FLAG','CANCELLED','已作废','ZHS','');
sys_code_pkg.insert_sys_code_value('CONFIRMED_FLAG','RETURNED','已退款','ZHS','');
sys_code_pkg.insert_sys_code_value('CONFIRMED_FLAG','DEBTAUDITING','债权新增确认中','ZHS','');
sys_code_pkg.delete_sys_code('PAID_BYOTHER_FLAG');
sys_code_pkg.insert_sys_code('PAID_BYOTHER_FLAG', '代付', '代付', '代付', 'ZHS', '');
......
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool INITIALIZE_SYSCODE_CSH_TRANSACTION.log
set feedback off
set define off
<!--系统代码取值-->
BEGIN
sys_message_pkg.delete_message('E_SAME_RECODER');
sys_message_pkg.insert_message('E_SAME_RECODER',
'错误',
'制单人和确认人不能为同一人!','ZHS');
END;
commit;
set feedback on
set define on
spool off
exit
\ No newline at end of file
......@@ -12,6 +12,8 @@ begin
sys_function_assign_pkg.func_bm_load('CSH510','csh.CSH510N.csh_transaction_list_tmp');
sys_function_assign_pkg.func_bm_load('CSH510','csh.CSH510.csh_transaction_for_lov');
sys_function_assign_pkg.func_bm_load('CSH510','csh.CSH510.csh_transaction_update');
sys_function_assign_pkg.func_bm_load('CSH509','csh.CSH509.query_roles_info');
sys_function_assign_pkg.func_bm_load('CSH510','csh.CSH510.csh_transaction_update_bp_info');
end;
/
......
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool REGISTER_CON_REPO001.log
set feedback off
set define off
begin
--页面注册
sys_function_assign_pkg.service_load('modules/csh/CSH510/csh_transaction_hand_receipt_update.lview','收款维护',1,1,0);
sys_function_assign_pkg.func_service_load('CSH510','modules/csh/CSH510/csh_transaction_hand_receipt_update.lview');
end;
/
commit;
set feedback on
set define on
spool off
exit
......@@ -23,7 +23,6 @@ alter table CSH_TRANSACTION add (PAID_BYOTHER_FLAG varchar2(10));
alter table CON_CONTRACT add (LAST_RENT_DUE_DATE date);
alter table CON_CONTRACT add (REPURCHASE_DATE date);
alter table CON_CONTRACT add (PAYMENGT_DEADLINEDATE date);
comment on column CSH_TRANSACTION.PAID_BYOTHER_FLAG is '代付';
COMMENT ON column CSH_TRANSACTION.CONFIRMED_DATE
IS '确认时间';
......@@ -41,7 +40,6 @@ comment on column CON_CONTRACT.SUBJECT_MATTER_RESCISSIO
is '解约事由';
comment on column CON_CONTRACT.REPURCHASE_TYPES
is '回购类型';
comment on column CON_CONTRACT.LAST_RENT_DUE_DATE is '前期租金支付约定日';
comment on column CON_CONTRACT.REPURCHASE_DATE is '解约回购日';
comment on column CON_CONTRACT.PAYMENGT_DEADLINEDATE is '支付预定期限(第1期)';
......
......@@ -26,6 +26,12 @@ comment on column csh_transaction.ACC_CONFIRMED_DATE is '会计确认时间';
comment on column csh_transaction.MKT_CONFIRMED_BY is '营业确认人';
comment on column csh_transaction.ACC_CONFIRMED_BY is '会计确认人 ';
comment on column CSH_TRANSACTION.PAID_BYOTHER_FLAG is '代付';
--将营业确认人改为债权确认人
ALTER TABLE csh_transaction RENAME COLUMN MKT_CONFIRMED_DATE TO DEBT_CONFIRMED_DATE;
ALTER TABLE csh_transaction RENAME COLUMN MKT_CONFIRMED_BY TO DEBT_CONFIRMED_BY;
comment on column csh_transaction.DEBT_CONFIRMED_DATE is '债权确认时间';
comment on column csh_transaction.DEBT_CONFIRMED_BY is '债权确认人';
COMMENT ON column CSH_TRANSACTION.CONFIRMED_DATE
IS '确认时间';
COMMENT ON column CSH_TRANSACTION.CONFIRMED_FLAG
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$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 *
from exp_emp_assign_e_v t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
csh_transaction_pkg.update_confirmFlag_byCondition(
p_transaction_id =>${@transaction_id},
p_wanted_confirmed_flag =>${@wanted_confirmed_flag},
p_wanted_written_off_flag=>${@wanted_written_off_flag},
p_user_id =>${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="user_id" queryOperator="="/>
</bm:query-fields>
</bm:model>
......@@ -93,6 +93,10 @@
<bm:field name="sus_belnr"/>
<bm:field name="bp_virtual_bank_account"/>
<bm:field name="confirmed_flag" />
<bm:field name="debt_confirmed_by"/>
<bm:field name="debt_confirmed_by_desc" expression="(select description from sys_user where user_id=t1.debt_confirmed_by)" forInsert="false" forUpdate="false"/>
<bm:field name="acc_confirmed_by"/>
<bm:field name="acc_confirmed_by_desc" expression="(select description from sys_user where user_id=t1.acc_confirmed_by)" forInsert="false" forUpdate="false"/>
</bm:fields>
<bm:features>
<f:standard-who/>
......
......@@ -12,8 +12,7 @@
begin
csh_transaction_pkg.update_confirmed_flag(
p_transaction_id =>${@transaction_id},
p_wanted_confirmed_flag =>${@wanted_confirmed_flag},
p_user_id =>${session/@user_id}
p_user_id =>${/session/@user_id}
);
end;
]]></bm:update-sql>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-9-12 下午07:57:46
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
update csh_transaction c
set bp_id=${@bp_id}
where transaction_id=${@transaction_id}
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -69,9 +69,73 @@
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
DS_IMPORT_CORE_PKG.csh_trx_bank_import(
p_header_id =>${/parameter/@header_id},
p_user_id =>${/session/@user_id});
csh_transaction_pkg.save_receipt_import(
p_transaction_id =>${@transaction_id},
p_transaction_num =>${@transaction_num},
p_transaction_category =>'BUSINESS',
p_transaction_type =>'RECEIPT',
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>
......
......@@ -73,7 +73,8 @@
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_ref_v05 =>${@ref_v05},
p_status =>${@status}
);
end;
......
......@@ -308,7 +308,7 @@
<a:event name="update" handler="acr510n_query_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="ar510n_cashflow_ds" autoPageSize="true" autoQuery="true"
<a:dataSet id="ar510n_cashflow_ds" autoPageSize="true" autoQuery="true" fetchAll="false"
model="acr.ACR510N.acr_inovice_cf_v_n" queryDataSet="allConditionDs" selectable="true">
<a:fields>
<a:field name="invoice_title" required="true" prompt="发票抬头"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-09-06 上午11:10:33
$Revision: 1.0
$Purpose: 会计收款确认
-->
<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_post_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_post_query.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="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[
//对函数进行封装
function alert_confirmed_flag(current_confirm_flag,want_confirmed_flag,write_off_flag){
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if (datas.length == 0) {
$L.showMessage("提示", '请选择要作废的单据');
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag= datas[i].get('confirmed_flag');
var current_confirm_flag_n;
//不是新增就报错
switch (current_confirm_flag) {
case 'MKTAUDITING' :
current_confirm_flag_n='营业新增确认中'; break;
case 'NEW' :
current_confirm_flag_n='未提交'; break;
case 'APPROVED' :
current_confirm_flag_n='新增确认'; break;
case 'REJECTED' :
current_confirm_flag_n='新增退回'; break;
case 'CANCELLED' :
current_confirm_flag_n='已作废'; break;
case 'ACCAUDITING' :
current_confirm_flag_n='会计新增确认中'; break;
case 'RETURNED' :
current_confirm_flag_n='已退款'; break;
}
if(confirmed_flag!=current_confirm_flag&&confirmed_flag!=undefined){
$L.showInfoMessage("提示", '请选择单据状态为'+current_confirm_flag_n+'的数据', null, null);
return;
}
//判断核销状态
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
//提交想改变之后的状态
'wanted_confirmed_flag': want_confirmed_flag,
'write_off_flag' : write_off_flag,
'_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}', '修改成功!');
}, failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
})
}
//会计进行新增确认
function csh509_csh_trx_bank_account_confirm(){
var current_confirm_flag='ACCAUDITING';
var want_confirmed_flag='APPROVED';
var write_off_flag='NOT';
alert_confirmed_flag(current_confirm_flag,want_confirmed_flag,write_off_flag);
}
//会计进行驳回操作
function csh509_csh_trx_bank_account_refuse(){
var current_confirm_flag='ACCAUDITING';
var want_confirmed_flag='REJECTED';
var write_off_flag=null;
alert_confirmed_flag(current_confirm_flag,want_confirmed_flag,write_off_flag);
}
//作废单据
function csh509_csh_trx_bank_account_drop(){
var current_confirm_flag='ACCAUDITING';
var want_confirmed_flag='REJECTED';
var write_off_flag=null;
alert_confirmed_flag(current_confirm_flag,want_confirmed_flag,write_off_flag);
}
//锁表
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) {
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;
}
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++) {
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(){
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();
});
}
function csh510_export() {
$('csh_transaction_receipt_maintain_grid_ds')._export(null,'收款维护');
}
]]></script>
<a:dataSets>
<a:dataSet id="write_off_flag_ds" lookupCode="WRITE_OFF_FLAG"/>
<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: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="csh509_csh_trx_bank_account_confirm" text="新增确认"/>
<a:gridButton click="csh509_csh_trx_bank_account_refuse" text="新增驳回"/>
<a:gridButton click="csh509_csh_trx_bank_return" text="退款"/>
<a:gridButton click="csh509_csh_trx_bank_account_drop" text="作废"/>
<a:gridButton click="csh510_receipt_query" text="查询"/>
<!--<a:gridButton click="csh510_receipt_remove" text="HLS.REMOVE"/>-->
<!-- <a:gridButton click="csh510_csh_trx_bank_apply_new" text="CSH510.CSH_TRANSACTION.APPLY_NEW_BTN"/>
<a:gridButton click="csh510_csh_trx_bank_drop" text="CSH510.CSH_TRANSACTION.DROP_BTN"/>-->
<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="CSH510.CSH_TRANSACTION.BILL_STATUS"/>
<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="现金事务编号" renderer="seedetail_transaction_num" width="110"/>
<a:column name="receipt_type" align="center" prompt="收款类型" width="100"/>
<a:column name="transaction_amount" align="center" prompt="收款金额" width="100"/>
<a:column name="transaction_date" renderer="Leaf.formatDate"/>
<a:column name="returned_amount" prompt="退款金额" align="right" />
<a:column name="use_money_amount" prompt="可用金额" align="right"/>
<a:column name="collection_classes_desc" prompt="款项用途"/>
<a:column name="bp_name" prompt="商业伙伴"/>
<a:column name="bank_slip_num" prompt="银行流水号"/>
<a:column name="description" prompt="摘要"/>
<a:column name="confirmed_flag_desc" prompt="单据状态"/>
<a:column name="written_off_flag_desc" prompt="核销状态"/>
<a:column prompt="我方账户">
<a:column prompt="户名" name="bank_account_name"/>
<a:column prompt="银行" name="bank_branch_name"/>
<a:column prompt="账号" name="bank_account_num"/>
</a:column>
<a:column prompt="对方账户">
<a:column prompt="户名" name="bp_bank_account_name"/>
<a:column prompt="银行" name="opposite_band_na"/>
<a:column prompt="账号" name="bp_bank_account_num"/>
</a:column>
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY"/>
<a:column name="mkt_confirmed_by" prompt="营业确认人"/>
<a:column name="acc_confirmed_by" prompt="会计确认人"/>
</a:columns>
</a:grid>
</a:fieldSet>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-09-09 上午11:10:33
$Date: 2019-09-06 上午11:10:33
$Revision: 1.0
$Purpose: 收款确认页面
$Purpose: 根据角色来确定用户是否可以进行操作
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" fetchAll="true" model="csh.CSH509.query_roles_info" rootPath="position_code"/>
<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"/>
......@@ -21,29 +22,182 @@
<!-- <a:link id="csh_transaction_receipt_maintain_post_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_post_query.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="csh510N_csh_transaction_batch_update_confirmed_flag" model="csh.CSH510.csh_transaction_update" modelaction="batch_update"/>
<a:link id="csh509_batch_update_confirmed_flag" model="csh.CSH509.query_roles_info" modelaction="batch_update"/>
<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_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/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[
//跳转到收款新增页面
function csh510_csh_trx_bank_hand_add(){
var url = $('csh_transaction_receipt_link').getUrl();
var win = new Leaf.Window({
url: url,
id: 'csh_trx_receipt_id',
fullScreen: true,
draggable: true
//判断是债权内勤还是会计担当
function judgeRoles(position_code){
var datas=$('position_code_ds').data;
for(var i=0;i<datas.length;i++){
if(datas[i].data.position_code==position_code){
return true;
}
}
return false;
}
//对函数进行封装
function update_confirmed_flag(updateData){
//弹出确认修改的提示框
$L.showConfirm("提示",'确认执行该操作?',function(){
//锁屏
lock_current_window();
//作废单据
Leaf.request({
url: $('csh509_batch_update_confirmed_flag').getUrl(),
para: updateData,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '修改成功!');
}, failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
})
}
//营业人员确认
function csh509_csh_trx_bank_business_confirm(){
console.log('${/session/@user_id}');
//根据身份判断所选择的数据是否可以确认
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
var updateData=[];
for(var i=0;i<datas.length;i++){
var confirmed_flag= datas[i].get('confirmed_flag');
if(confirmed_flag!='ACCAUDITING'&&confirmed_flag!='DEBTAUDITING'){
$L.showInfoMessage("提示",'请选择新增确认中的收款单据');
return;
}
//
if(confirmed_flag=='ACCAUDITING'){
if(!judgeRoles("00321")){
$L.showInfoMessage("提示",'需要会计担当确认单据');
return;
}
}
if(confirmed_flag=='DEBTAUDITING'){
if(!judgeRoles("00217")){
$L.showInfoMessage("提示",'需要债权内勤确认单据');
return;
}
}
//保存要修改的数据
updateData.push({
transaction_id:datas[i].get('transaction_id'),
wanted_confirmed_flag: 'APPROVED',
wanted_written_off_flag: 'NOT',
_status : 'update'
})
}
//更新数据
update_confirmed_flag(updateData);
}
//营业人员驳回单据
function csh509_csh_trx_bank_refuse(){
//驳回收款单
//根据身份判断所选择的数据是否可以确认
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if(datas.length==0){
$L.showInfoMessage("提示",'请先选择数据');
return;
}
var updateData=[];
for(var i=0;i<datas.length;i++){
var confirmed_flag= datas[i].get('confirmed_flag');
if(confirmed_flag!='ACCAUDITING'&&confirmed_flag!='DEBTAUDITING'){
$L.showInfoMessage("提示",'请选择新增确认中的收款单据');
return;
}
//需要债权用户和会计担当才能驳回单据
if(confirmed_flag=='ACCAUDITING'){
if(!judgeRoles("00321")){
$L.showInfoMessage("提示",'需要会计担驳回单据');
return;
}
}
if(confirmed_flag=='DEBTAUDITING'){
if(!judgeRoles("00217")){
$L.showInfoMessage("提示",'需要债权内勤驳回单据');
return;
}
}
//保存要修改的数据
updateData.push({
transaction_id:datas[i].get('transaction_id'),
wanted_confirmed_flag: 'REJECTED',
_status : 'update'
})
}
//更新数据
update_confirmed_flag(updateData);
}
//锁表
//新增单据的作废
function csh509_csh_trx_bank_drop(){
//驳回收款单
//根据身份判断所选择的数据是否可以确认
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if(datas.length==0){
$L.showInfoMessage("提示",'请先选择数据');
return;
}
var updateData=[];
for(var i=0;i<datas.length;i++){
var confirmed_flag= datas[i].get('confirmed_flag');
if(confirmed_flag!='ACCAUDITING'&&confirmed_flag!='DEBTAUDITING'){
$L.showInfoMessage("提示",'请选择新增确认中的收款单据');
return;
}
//需要债权用户和会计担当才能驳回单据
if(confirmed_flag=='ACCAUDITING'){
if(!judgeRoles("00321")){
$L.showInfoMessage("提示",'需要会计担当作废单据');
return;
}
}
if(confirmed_flag=='DEBTAUDITING'){
if(!judgeRoles("00217")){
$L.showInfoMessage("提示",'需要债权内勤作废单据');
return;
}
}
//保存要修改的数据
updateData.push({
transaction_id:datas[i].get('transaction_id'),
wanted_confirmed_flag: 'CANCELLED',
_status : 'update'
})
}
//更新数据
update_confirmed_flag(updateData);
}
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
//解锁
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
}
......@@ -108,15 +262,10 @@
function seedetail_transaction_num(value, record, name) {
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;
url = $('csh_transaction_receipt_maintain_readonly_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
}
return '<a href="javascript:openWindow(\'' + url + '\');">' + value + '</a>';
}
}
function openWindow(url) {
......@@ -334,9 +483,13 @@
function csh510_export() {
$('csh_transaction_receipt_maintain_grid_ds')._export(null,'收款维护');
}
]]></script>
<a:dataSets>
<a:dataSet id="position_code_ds">
<a:datas dataSource="/model/position_code"/>
</a:dataSet>
<a:dataSet id="write_off_flag_ds" lookupCode="WRITE_OFF_FLAG"/>
<a:dataSet id="confirmed_flag_ds" lookupCode="CONFIRMED_FLAG">
</a:dataSet>
<a:dataSet id="payment_method_ds">
......@@ -368,8 +521,52 @@
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_query_ds" autoCreate="true">
<a:fields>
<a:field name="confirmed_flag" options="confirmed_flag_ds" valueField="code_value" displayField="code_value_name" returnField="payment_method_id"/>
<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>
......@@ -431,7 +628,7 @@
<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"/>
<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"/>
......@@ -442,7 +639,29 @@
<a:map from="bp_name" to="bp_name"/>
</a:mapping>
</a:field>
<a:field name="collection_classes_desc" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<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>
......@@ -454,11 +673,19 @@
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="csh510_receipt_query" text="新增确认"/>
<a:gridButton click="csh510_csh_trx_bank_import" text="新增驳回"/>
<a:gridButton click="csh510_csh_trx_bank_hand_add" text="作废"/>
<a:gridButton click="csh510_csh_trx_bank_apply_new" text="查询"/>
<!-- <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="csh509_csh_trx_bank_business_confirm" text="新增确认"/>
<a:gridButton click="csh509_csh_trx_bank_refuse" text="新增驳回"/>
<a:gridButton click="csh509_csh_trx_bank_drop" text="作废"/>
<a:gridButton click="csh510_receipt_query" text="查询"/>
<!--<a:gridButton click="csh510_receipt_remove" text="HLS.REMOVE"/>-->
<!-- <a:gridButton click="csh510_csh_trx_bank_apply_new" text="CSH510.CSH_TRANSACTION.APPLY_NEW_BTN"/>
<a:gridButton click="csh510_csh_trx_bank_drop" text="CSH510.CSH_TRANSACTION.DROP_BTN"/>-->
<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">
......@@ -466,23 +693,25 @@
<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"/>
<a:numberField name="transaction_amount_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_TO"/>
<!--new -->
<a:comboBox name="my_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME"/>
<a:comboBox name="my_bank_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME"/>
<a:comboBox name="my_account_username" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME"/>
<a:textField name="bank_cash_code" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE"/>
<!--other line-->
<a:lov name="your_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME"/>
<a:lov name="your_bank_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/>
<a:lov name="your_account_username" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>
<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"/>
<!--other line-->
<a:lov name="business_partner" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER"/>
<a:comboBox name="confirmed_flag" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BILL_STATUS"/>
<a:comboBox name="written_off_status" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS"/>
<a:comboBox name="purpose_of_funds" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS"/>
<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="CSH510.CSH_TRANSACTION.BILL_STATUS"/>
<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>
......@@ -497,29 +726,29 @@
<a:columns>
<a:column name="transaction_num" prompt="现金事务编号" renderer="seedetail_transaction_num" width="110"/>
<a:column name="receipt_type" align="center" prompt="收款类型" width="100"/>
<a:column name="receipt_money_amount" align="center" prompt="收款金额" width="100"/>
<a:column name="transaction_amount" align="center" prompt="收款金额" width="100"/>
<a:column name="transaction_date" renderer="Leaf.formatDate"/>
<a:column name="back_money_amount" prompt="退款金额" align="right"/>
<a:column name="returned_amount" prompt="退款金额" align="right" />
<a:column name="use_money_amount" prompt="可用金额" align="right"/>
<a:column name="collection_classes" prompt="款项用途"/>
<a:column name="business_partner" prompt="商业伙伴"/>
<a:column name="bank_cash_code" prompt="银行流水号"/>
<a:column name="collection_classes_desc" prompt="款项用途"/>
<a:column name="bp_name" prompt="商业伙伴"/>
<a:column name="bank_slip_num" prompt="银行流水号"/>
<a:column name="description" prompt="摘要"/>
<a:column name="confirmed_flag" prompt="单据状态"/>
<a:column name="written_off_status" prompt="核销状态"/>
<a:column name="confirmed_flag_desc" prompt="单据状态"/>
<a:column name="written_off_flag_desc" prompt="核销状态"/>
<a:column prompt="我方账户">
<a:column prompt="户名" name="my_account_name"/>
<a:column prompt="银行" name="my_bank_name"/>
<a:column prompt="账号" name="my_account_username"/>
<a:column prompt="户名" name="bank_account_name"/>
<a:column prompt="银行" name="bank_branch_name"/>
<a:column prompt="账号" name="bank_account_num"/>
</a:column>
<a:column prompt="对方账户">
<a:column prompt="户名" name="your_account_name"/>
<a:column prompt="银行" name="your_bank_name"/>
<a:column prompt="账号" name="your_account_username"/>
<a:column prompt="户名" name="bp_bank_account_name"/>
<a:column prompt="银行" name="opposite_band_na"/>
<a:column prompt="账号" name="bp_bank_account_num"/>
</a:column>
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY"/>
<a:column name="confirmed_user" prompt="HLS.DOCUMENT_CONFIRMED_BY"/>
<a:column name="debt_confirmed_by_desc" prompt="债权确认人"/>
<a:column name="acc_confirmed_by_desc" prompt="会计确认人"/>
</a:columns>
</a:grid>
</a:fieldSet>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-9-16 下午03:19:57
$Revision: 1.0
$Purpose: 点击合同编号进行维护收款
-->
<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 fetchAll="true" model="gld.gld_exchangerate_type_lov" rootPath="exchangerate_type_path"/>
<a:model-query fetchAll="true" model="csh.CSH511.fnd_financial_option" rootPath="fnd_financial_option_path"/>
<a:model-query fetchAll="true" model="csh.CSH511.csh_transaction_default_exchange_rate_type" rootPath="default_exchange_rate_type_path"/>
</a:init-procedure>
<a:view>
<a:link id="hn2050_upload_win_link" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="csh_receipt_import_link" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt_impiort.lview"/>
<a:link id="csh_transaction_receipt_id" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt.lview"/>
<a:link id="get_exchange_rate_link_id" model="csh.CSH511.csh_transaction_get_exchange_rate" modelaction="query"/>
<a:link id="get_period_name_id" model="csh.CSH511.csh_transaction_get_period_name" modelaction="query"/>
<a:link id="csh510_update_bp_info_link" model="csh.CSH510.csh_transaction_update_bp_info" modelaction="update"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<a:link id="transaction_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<script type="text/javascript"><![CDATA[
//附件上传
function upload_attachment_win() {
/* var record = $(ds_id).findById(record_id);
var mortgage_id = record.get('mortgage_id');*/
var win = new Leaf.Window({
id: 'hn2050_upload_win',
url: $('hn2050_upload_win_link').getUrl(),
params: {
winid: 'hn2050_upload_win',
table_name: 'hn_virtual_con_mortgage',
header_id: 1000
},
width: 900,
hight: 400
}).on('close', function() {
//record.ds.query();
});
}
var transaction_id;
<!--增加重置功能-->
function csh511_receipt_reset(){
$('csh_transaction_receipt_head_ds').reset();
}
function csh511_receipt_import_and_write_off() {
new Leaf.Window({
url: $('csh_receipt_import_link').getUrl(),
params: {
action_type: 'TRANSACTION_AND_WRITE_OFF'
},
title: '收款导入并核销',
id: 'csh_receipt_import_and_write_off_window',
fullScreen: true
});
}
function csh511_receipt_import() {
new Leaf.Window({
url: $('csh_receipt_import_link').getUrl(),
params: {
action_type: 'TRANSACTION'
},
title: '收款导入',
id: 'csh_receipt_import_window',
fullScreen: true
});
}
function csh511_receipt_save() {
var record=$('csh_transaction_receipt_head_ds').getAt(0);
Leaf.Masker.mask(Ext.getBody());
Leaf.request({
url: $('csh510_update_bp_info_link').getUrl(),
para: {
transaction_id: record.get('transaction_id'),
bp_id : record.get('bp_id'),
},
success: function(){
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
$('csh510_update_bp_info_link').query();
},
scope: this
});
}
function csh511_receipt_posted() {
if ($('csh_transaction_receipt_head_ds').validate()) {
Leaf.Masker.mask(Ext.getBody(), '${l:CSH511.SAVE_AND_POST}');
csh511_receipt_save('Y');
}
}
function csh511_receipt_back() {
history.go(-1);
}
function onUpdate_csh511_receipt(ds, record, name, value, oldvalue) {
if (name == 'bp_id') {
if (value != oldvalue) {
record.set('bp_bank_account_id', '');
record.set('bp_bank_account_code', '');
record.set('bp_bank_account_name', '');
record.set('bp_bank_account_num', '');
record.set('opposite_band_na', '');
}
record.getField('bp_bank_account_code').setLovPara('bp_id', value);
} else if (name == 'currency_code') {
if (value != oldvalue) {
record.set('exchange_rate', '');
record.set('exchange_rate_type', '');
record.set('rate_method_code', '');
record.set('exchange_rate_type_display', '');
record.set('exchange_rate_quotation', '');
if (oldvalue != null && oldvalue != '') {
// record.set('transaction_amount', '');
record.set('transaction_functional_amount', '');
}
}
if (value == record.get('functional_currency_code')) {
record.getField('exchange_rate_type_display').setRequired(false);
record.getField('exchange_rate_type').setReadOnly(true);
record.getField('exchange_rate_type_display').setReadOnly(true);
record.getField('exchange_rate').setReadOnly(true);
record.set('exchange_rate', 1);
} else {
record.set('exchange_rate_type', '${/model/fnd_financial_option_path/record/@default_exchange_rate_type}');
record.set('rate_method_code', '${/model/fnd_financial_option_path/record/@rate_method_code}');
record.set('exchange_rate_type_display', '${/model/fnd_financial_option_path/record/@exchange_rate_type_display}');
record.getField('exchange_rate_type_display').setRequired(true);
record.getField('exchange_rate_type_display').setReadOnly(false);
}
} else if (name == 'rate_method_code' || name == 'period_name') {
if (record.get('currency_code') != record.get('functional_currency_code')) {
var rate_method_code = record.get('rate_method_code');
record.set('exchange_rate_quotation', '');
record.set('exchange_rate', '');
if (rate_method_code == 'PERIOD' || rate_method_code == 'DAILY' || rate_method_code == 'FIXED') {
record.getField('exchange_rate').setReadOnly(true);
record.set('exchange_rate', '');
getExchangeRate({
fromCur: record.get('functional_currency_code'),
toCur: record.get('currency_code'),
exchangeRateType: record.get('exchange_rate_type'),
exchangeDate: record.get('transaction_date'),
periodName: record.get('period_name')
});
} else {
record.set('exchange_rate_quotation', 'DIRECT QUOTATION');
record.getField('exchange_rate').setReadOnly(false);
record.set('exchange_rate', '');
}
}
} else if (name == 'exchange_rate') {
if (record.get('exchange_rate') != null && record.get('exchange_rate') != '') {
setfunctionamount(record);
} else {
record.set('transaction_functional_amount', '');
}
} else if (name == 'transaction_amount') {
if (value === 0 && record.get('zero_amounts_allowed') == 'N') {
Leaf.showMessage('${l:PROMPT}', '${l:CSH510.ZERO_AMOUNTS_ALLOWED}');
}
if (record.get('currency_code') == record.get('functional_currency_code')) {
record.set('transaction_functional_amount', value);
} else {
setfunctionamount(record);
}
} else if (name == 'transaction_date') {
showPeriod(record);
} else if (name == 'precision') {
record.getField('transaction_amount').setPropertity('decimalprecision', value);
record.getField('transaction_functional_amount').setPropertity('decimalprecision', value);
if (record.get('transaction_amount') || record.get('transaction_amount') == 0) {
setfunctionamount(record);
}
} else if (name == 'bank_account_id') {
if (record.get('zero_amounts_allowed') == 'N' && record.get('transaction_amount') === 0) {
Leaf.showMessage('${l:PROMPT}', '${l:CSH510.ZERO_AMOUNTS_ALLOWED}');
}
}
}
// function onAdd_csh511_receipt(ds, record) {
// record.set('precision',2);
// record.set('zero_amounts_allowed','N');
// record.set('bank_account_id',1531);
// record.set('bank_account_num','448165800609');
// record.set('bank_account_name','德融国际融资租赁有限公司');
// record.set('bank_account_code','0040101');
// record.set('currency_code','CNY');
// record.set('currency_name','人民币');
// }
function onAdd_csh511_receipt(ds, record) {
record.set('precision', 2);
record.set('zero_amounts_allowed', 'N');
record.set('bank_account_id', 1531);
// record.set('bank_account_num','448165800609');
// record.set('bank_account_name','德融国际融资租赁有限公司');
// record.set('bank_account_code','0040101');
record.set('currency_code', 'CNY');
record.set('currency_name', '人民币');
}
function setfunctionamount(record) {
var quotation = record.get('exchange_rate_quotation');
var a = record.get('transaction_amount');
var b = record.get('exchange_rate');
if (Ext.isDefined(a) && Ext.isDefined(b) && !Ext.isEmpty(a) && !Ext.isEmpty(b)) {
if (quotation == 'DIRECT QUOTATION') {
record.set('transaction_functional_amount', parseFloat(mul(a, b).toFixed(record.get('precision'))));
} else {
record.set('transaction_functional_amount', parseFloat(div(a, b).toFixed(record.get('precision'))));
}
}
}
function showPeriod(record) {
var r_date = record.get('transaction_date');
r_date = Leaf.formatDate(r_date);
Leaf.request({
url: $('get_period_name_id').getUrl(),
para: {
p_date: r_date
},
success: periodname,
scope: this
});
}
function periodname(res) {
var head_record = $('csh_transaction_receipt_head_ds').getAt(0);
if (res) {
var period_name = res.result.record.period_name,
internal_period_num = res.result.record.internal_period_num;
if (period_name) {
head_record.set('period_name', period_name);
head_record.set('internal_period_num', internal_period_num);
} else {
head_record.set('period_name', '');
head_record.set('internal_period_num', '');
if (head_record.get('transaction_date')) {
head_record.set('transaction_date', '');
Leaf.showMessage('${l:PROMPT}', '${l:CSH511.PERIOD_ERROR}');
}
}
}
}
function getExchangeRate(param) {
Leaf.request({
url: $('get_exchange_rate_link_id').getUrl(),
para: {
from_currency: param.fromCur,
to_currency: param.toCur,
exchange_date: param.exchangeDate,
exchange_period_name: param.periodName,
exchange_rate_type: param.exchangeRateType
},
success: setRateAndQuotation,
scope: this
});
}
function setRateAndQuotation(res) {
var record = $('csh_transaction_receipt_head_ds').getAt(0);
if (Ext.isDefined(res.result.record.exchange_rate_quotation)) {
record.set('exchange_rate_quotation', res.result.record.exchange_rate_quotation);
} else {
record.set('exchange_rate_quotation', 'DIRECT QUOTATION');
}
if (Ext.isDefined(res.result.record.exchange_rate)) {
record.set('exchange_rate', res.result.record.exchange_rate);
}
}
function attachment_upload() {
if (transaction_id) {
//
// ds = $('csh_transaction_receipt_head_ds');
// record = ds.getCurrentRecord();
// var header_id = record.get('transaction_id');
var header_id = transaction_id;
var url = $('transaction_uploadFile_id').getUrl() + '?table_name=CSH_TRANSACTION&header_id=' + header_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'transaction_uploadFile_winid',
width: 850,
height: 400
});
win.on('close', function () {
window.location.href = $('csh_transaction_receipt_id').getUrl();
// var url = $('csh_transaction_receipt_id').getUrl();
// Leaf.go(url);
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
return;
}
}
]]></script>
<a:dataSets>
<a:dataSet id="PAID_BYOTHER_FLAG_DS" lookupCode="PAID_BYOTHER_FLAG"/>
<!-- <a:dataSet id="payment_method_ds">
<a:datas dataSource="/model/payment_method_path"/>
</a:dataSet>-->
<!--<a:dataSet id="currency_ds">
<a:datas dataSource="/model/currency"/>
</a:dataSet>-->
<a:dataSet id="exchangerate_type_ds">
<a:datas dataSource="/model/exchangerate_type_path"/>
</a:dataSet>
<!-- <a:dataSet id="ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>-->
<a:dataSet id="csh_transaction_receipt_head_ds" autoCreate="true" loadData="true" model="csh.CSH511.csh_transaction">
<a:fields>
<a:field name="transaction_date" required="true"/>
<!--<a:field name="period_name" lovGridHeight="300" lovHeight="500" lovService="gld.gld_period_lov" lovWidth="500" readOnly="true" required="true" title="GLD_PERIODS.PERIOD_NAME">
<a:mapping>
<a:map from="period_name" to="period_name"/>
</a:mapping>
</a:field>-->
<!--<a:field name="internal_period_num"/>-->
<!--<a:field name="payment_method_display" displayField="description" options="payment_method_ds" returnField="payment_method_id" valueField="payment_method_id"/>-->
<a:field name="currency_name" displayField="currency_name" options="currency_ds" readOnly="true" required="true" returnField="currency_code" valueField="currency_code">
<a:mapping>
<a:map from="precision" to="precision"/>
</a:mapping>
</a:field>
<a:field name="currency_code"/>
<a:field name="precision"/>
<a:field name="functional_currency_code" defaultValue="${/model/default_exchange_rate_type_path/record/@functional_currency_code}"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="500" lovLabelWidth="90" lovService="basic.hls_bp_master_v_for_lov" lovWidth="550" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_name" to="csh_bp_name"/>
<a:map from="bp_category" to="bp_category"/>
<a:map from="bp_category_name" to="bp_category_display"/>
</a:mapping>
</a:field>
<!-- <a:field name="bank_slip_num" lovGridHeight="350" lovHeight="600" lovService="csh.CSH510.csh_transaction_contract_query" lovWidth="1200" title="合同编号">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_category" to="bp_category"/>
<a:map from="bp_category_n" to="bp_category_display"/>
<a:map from="contract_number" to="bank_slip_num"/>
</a:mapping>
</a:field> -->
<a:field name="bp_category_display" readOnly="true"/>
<a:field name="transaction_num" readOnly="true"/>
<a:field name="exchange_rate_type_display" displayField="type_name" options="exchangerate_type_ds" readOnly="true" returnField="exchange_rate_type" valueField="type_code">
<a:mapping>
<a:map from="type_code" to="exchange_rate_type"/>
<a:map from="rate_method_code" to="rate_method_code"/>
</a:mapping>
</a:field>
<a:field name="exchange_rate_type"/>
<a:field name="exchange_rate" readOnly="true" required="true"/>
<a:field name="rate_method_code"/>
<a:field name="transaction_amount" required="true"/>
<a:field name="transaction_functional_amount" readOnly="true"/>
<a:field name="bank_account_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" required="true" 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="zero_amounts_allowed"/>
<a:field name="bp_bank_account_code" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="basic.hls_bp_master_bank_account_v_for_lov?enabled_flag=Y" lovWidth="580" title="CSH511.BP_BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_id" to="bp_bank_account_id"/>
<a:map from="bank_account_num" to="bp_bank_account_num"/>
<a:map from="bank_account_name" to="bp_bank_account_name"/>
<a:map from="bank_account_code" to="bp_bank_account_code"/>
<a:map from="bank_branch_name" to="bp_bank_branch_name"/>
<a:map from="bank_full_name" to="bp_bank_name"/>
</a:mapping>
</a:field>
<!-- <a:field name="ref_contract_number" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH511.csh_con_contract_lov" lovWidth="580" title="CON301.CONTRACT_QUERY">
<a:mapping>
<a:map from="contract_number" to="ref_contract_number"/>
<a:map from="contract_id" to="ref_contract_id"/>
</a:mapping>
</a:field> -->
<a:field name="ref_contract_number" lovGridHeight="320" lovHeight="530" lovService="csh.CSH510.csh_transaction_contract_query" lovWidth="800" title="合同编号">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_category" to="bp_category"/>
<a:map from="bp_category_n" to="bp_category_display"/>
<a:map from="contract_id" to="ref_contract_id"/>
<a:map from="contract_number" to="ref_contract_number"/>
<a:map from="bp_id_agent_level1_n" to="bp_id_agent_level1_n"/>
</a:mapping>
</a:field>
<a:field name="bp_bank_account_num"/>
<a:field name="bp_bank_account_name" required="true"/>
<a:field name="collection_classes_desc" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<a:field name="paid_byother_flag_n" options="PAID_BYOTHER_FLAG_DS" returnField="paid_byother_flag" displayField="code_value_name" valueField="code_value"/>
</a:fields>
<a:events>
<!--<a:event name="update" handler="onUpdate_csh511_receipt"/>
<a:event name="add" handler="onAdd_csh511_receipt"/>
<a:event name="load" handler="onAdd_csh511_receipt"/>-->
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton id="csh511_receipt_save_id" click="csh511_receipt_save" text="HLS.SAVE"/>
<a:gridButton id="csh511_receipt_reset_id" click="csh511_receipt_reset" text="HLS.RESET"/>
<!--<a:gridButton id="csh511_receipt_posted_id" click="csh511_receipt_posted" text="HLS.POST"/>-->
<!--<a:gridButton id="csh511_receipt_upload_id" click="attachment_upload" text="附件上传"/>-->
<!--<a:gridButton id="csh511_receipt_back_id" click="csh511_receipt_back" text="HLS.EXIT"/>-->
</a:screenTopToolbar>
<!--<a:form title="CSH511.CSH_RECEIPT">-->
<!--<a:box column="4">-->
<!--<a:datePicker name="transaction_date" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:lov name="period_name" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:comboBox name="currency_name" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--&lt;!&ndash; <a:comboBox name="exchange_rate_type_display" bindTarget="csh_transaction_receipt_head_ds"/> &ndash;&gt;-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:lov name="ref_contract_num" bindTarget="csh_transaction_receipt_head_ds" prompt="合同编号"/>-->
<!--<a:comboBox name="payment_method_display" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_head_ds" prompt="银行凭证号"/>-->
<!--<a:numberField name="exchange_rate" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds" decimalPrecision="-1"/>-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:numberField name="transaction_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:numberField name="ref_n01" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds" prompt="税额"/>-->
<!--&lt;!&ndash; <a:numberField name="transaction_functional_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds"/> &ndash;&gt;-->
<!---->
<!--<a:lov name="bp_name" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bp_category_display" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:lov name="bank_account_code" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:lov name="bp_bank_account_code" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--</a:box>-->
<!--<a:box column="2">-->
<!--<a:textField name="bank_account_name" bindTarget="csh_transaction_receipt_head_ds" width="383"/>-->
<!--<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_head_ds" width="383"/>-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:textArea name="description" bindTarget="csh_transaction_receipt_head_ds" width="383"/>-->
<!--</a:box>-->
<!--</a:form>-->
<!--#删除表格头,添加fieldSet-->
<!-- <a:form title="收款信息" width="1200">-->
<a:fieldSet title="收款手动新增">
<a:box column="3">
<a:datePicker name="transaction_date" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<a:numberField name="transaction_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<!-- # 新增现金流字段,代付,商业伙伴,摘要字段-->
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE" readOnly="true"/>
<a:comboBox name="paid_byother_flag_n" prompt="代付" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<a:lov name="bp_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER"/>
<a:comboBox name="collection_classes_desc" bindTarget="csh_transaction_receipt_head_ds" prompt="款项分类" readOnly="true"/>
</a:box>
<a:hBox style="width:800px">
<a:textField width="350" name="description" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
</a:hBox>
<!--#添加备注字段-->
<a:hBox style="width:800px">
<a:textField width="350" name="ref_v05" prompt="备注" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
</a:hBox>
</a:fieldSet>
<!--删除下面的字段 currency_name,bank_account_name,banka,bank_branch_name,bank_account_num,bank_account_type_name,exchange_rate_type_display-->
<!-- <a:comboBox name="currency_name" bindTarget="csh_transaction_receipt_head_ds"/>
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_head_ds"/>
&lt;!&ndash;<a:textField name="banka" bindTarget="csh_transaction_receipt_head_ds" prompt="账户类型"/>&ndash;&gt;
<a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_head_ds" readOnly="true" prompt="分行名称"/>
<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<a:textField name="bank_account_type_name" bindTarget="csh_transaction_receipt_head_ds" readOnly="true" prompt="账户类型"/>
&lt;!&ndash; <a:comboBox name="exchange_rate_type_display" bindTarget="csh_transaction_receipt_head_ds"/> &ndash;&gt;
</a:box>-->
<!--删除下面的两个box-->
<!-- <a:box column="4">
<a:textField name="description" bindTarget="csh_transaction_receipt_head_ds"/>
<a:textField name="purpose" bindTarget="csh_transaction_receipt_head_ds" prompt="用途"/>
</a:box>
<a:box column="4">
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_head_ds" prompt="银行流水号"/>
<a:textField name="gsber" bindTarget="csh_transaction_receipt_head_ds" prompt="业务范围"/>
<a:textField name="sus_belnr" bindTarget="csh_transaction_receipt_head_ds" prompt="SAP凭证号"/>
</a:box>-->
<!-- </a:form>-->
<!--添加两方的账户信息和附件-->
<a:fieldSet title="账户信息">
<a:box column="3" labelWidth="100">
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME" readOnly="true"/>
<a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME" readOnly="true"/>
<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME" readOnly="true"/>
<!--对方账户-->
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" readOnly="true"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME" readOnly="true"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" readOnly="true"/>
</a:box>
</a:fieldSet>
<a:fieldSet title="附件">
<a:hBox>
<a>附件上传:</a><a href="javascript:upload_attachment_win()" style="color:red">上传</a>
</a:hBox>
</a:fieldSet>
<!-- <a:form title="对方账户信息" width="1200">
<a:box column="4">
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_head_ds"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_receipt_head_ds" prompt="银行名称"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_head_ds"/>
</a:box>
</a:form>-->
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-9-16 下午03:19:57
$Revision: 1.0
$Purpose: 点击合同编号进行维护收款
-->
<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 fetchAll="true" model="gld.gld_exchangerate_type_lov" rootPath="exchangerate_type_path"/>
<a:model-query fetchAll="true" model="csh.CSH511.fnd_financial_option" rootPath="fnd_financial_option_path"/>
<a:model-query fetchAll="true" model="csh.CSH511.csh_transaction_default_exchange_rate_type" rootPath="default_exchange_rate_type_path"/>
</a:init-procedure>
<a:view>
<a:link id="hn2050_upload_win_link" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="csh_receipt_import_link" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt_impiort.lview"/>
<a:link id="csh_transaction_receipt_id" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt.lview"/>
<a:link id="get_exchange_rate_link_id" model="csh.CSH511.csh_transaction_get_exchange_rate" modelaction="query"/>
<a:link id="get_period_name_id" model="csh.CSH511.csh_transaction_get_period_name" modelaction="query"/>
<a:link id="csh510_update_bp_info_link" model="csh.CSH510.csh_transaction_update_bp_info" modelaction="update"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<a:link id="transaction_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<script type="text/javascript"><![CDATA[
//附件上传
function upload_attachment_win() {
/* var record = $(ds_id).findById(record_id);
var mortgage_id = record.get('mortgage_id');*/
var win = new Leaf.Window({
id: 'hn2050_upload_win',
url: $('hn2050_upload_win_link').getUrl(),
params: {
winid: 'hn2050_upload_win',
table_name: 'hn_virtual_con_mortgage',
header_id: 1000
},
width: 900,
hight: 400
}).on('close', function() {
//record.ds.query();
});
}
var transaction_id;
<!--增加重置功能-->
function csh511_receipt_reset(){
$('csh_transaction_receipt_head_ds').reset();
}
function csh511_receipt_import_and_write_off() {
new Leaf.Window({
url: $('csh_receipt_import_link').getUrl(),
params: {
action_type: 'TRANSACTION_AND_WRITE_OFF'
},
title: '收款导入并核销',
id: 'csh_receipt_import_and_write_off_window',
fullScreen: true
});
}
function csh511_receipt_import() {
new Leaf.Window({
url: $('csh_receipt_import_link').getUrl(),
params: {
action_type: 'TRANSACTION'
},
title: '收款导入',
id: 'csh_receipt_import_window',
fullScreen: true
});
}
function csh511_receipt_save() {
var record=$('csh_transaction_receipt_head_ds').getAt(0);
console.log(record.get('bp_id'));
console.log(record.get('transaction_id'));
Leaf.Masker.mask(Ext.getBody());
Leaf.request({
url: $('csh510_update_bp_info_link').getUrl(),
para: {
transaction_id: record.get('transaction_id'),
bp_id : record.get('bp_id'),
},
success: function(){
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
$('csh510_update_bp_info_link').query();
},
scope: this
});
}
function csh511_receipt_posted() {
if ($('csh_transaction_receipt_head_ds').validate()) {
Leaf.Masker.mask(Ext.getBody(), '${l:CSH511.SAVE_AND_POST}');
csh511_receipt_save('Y');
}
}
function csh511_receipt_back() {
history.go(-1);
}
function onUpdate_csh511_receipt(ds, record, name, value, oldvalue) {
if (name == 'bp_id') {
if (value != oldvalue) {
record.set('bp_bank_account_id', '');
record.set('bp_bank_account_code', '');
record.set('bp_bank_account_name', '');
record.set('bp_bank_account_num', '');
record.set('opposite_band_na', '');
}
record.getField('bp_bank_account_code').setLovPara('bp_id', value);
} else if (name == 'currency_code') {
if (value != oldvalue) {
record.set('exchange_rate', '');
record.set('exchange_rate_type', '');
record.set('rate_method_code', '');
record.set('exchange_rate_type_display', '');
record.set('exchange_rate_quotation', '');
if (oldvalue != null && oldvalue != '') {
//record.set('transaction_amount', '');
record.set('transaction_functional_amount', '');
}
}
if (value == record.get('functional_currency_code')) {
record.getField('exchange_rate_type_display').setRequired(false);
record.getField('exchange_rate_type').setReadOnly(true);
record.getField('exchange_rate_type_display').setReadOnly(true);
record.getField('exchange_rate').setReadOnly(true);
record.set('exchange_rate', 1);
} else {
record.set('exchange_rate_type', '${/model/fnd_financial_option_path/record/@default_exchange_rate_type}');
record.set('rate_method_code', '${/model/fnd_financial_option_path/record/@rate_method_code}');
record.set('exchange_rate_type_display', '${/model/fnd_financial_option_path/record/@exchange_rate_type_display}');
record.getField('exchange_rate_type_display').setRequired(true);
record.getField('exchange_rate_type_display').setReadOnly(false);
}
} else if (name == 'rate_method_code' || name == 'period_name') {
if (record.get('currency_code') != record.get('functional_currency_code')) {
var rate_method_code = record.get('rate_method_code');
record.set('exchange_rate_quotation', '');
record.set('exchange_rate', '');
if (rate_method_code == 'PERIOD' || rate_method_code == 'DAILY' || rate_method_code == 'FIXED') {
record.getField('exchange_rate').setReadOnly(true);
record.set('exchange_rate', '');
getExchangeRate({
fromCur: record.get('functional_currency_code'),
toCur: record.get('currency_code'),
exchangeRateType: record.get('exchange_rate_type'),
exchangeDate: record.get('transaction_date'),
periodName: record.get('period_name')
});
} else {
record.set('exchange_rate_quotation', 'DIRECT QUOTATION');
record.getField('exchange_rate').setReadOnly(false);
record.set('exchange_rate', '');
}
}
} else if (name == 'exchange_rate') {
if (record.get('exchange_rate') != null && record.get('exchange_rate') != '') {
setfunctionamount(record);
} else {
record.set('transaction_functional_amount', '');
}
} else if (name == 'transaction_amount') {
if (value === 0 && record.get('zero_amounts_allowed') == 'N') {
Leaf.showMessage('${l:PROMPT}', '${l:CSH510.ZERO_AMOUNTS_ALLOWED}');
}
if (record.get('currency_code') == record.get('functional_currency_code')) {
record.set('transaction_functional_amount', value);
} else {
setfunctionamount(record);
}
} else if (name == 'transaction_date') {
showPeriod(record);
} else if (name == 'precision') {
record.getField('transaction_amount').setPropertity('decimalprecision', value);
record.getField('transaction_functional_amount').setPropertity('decimalprecision', value);
if (record.get('transaction_amount') || record.get('transaction_amount') == 0) {
setfunctionamount(record);
}
} else if (name == 'bank_account_id') {
if (record.get('zero_amounts_allowed') == 'N' && record.get('transaction_amount') === 0) {
Leaf.showMessage('${l:PROMPT}', '${l:CSH510.ZERO_AMOUNTS_ALLOWED}');
}
}
}
// function onAdd_csh511_receipt(ds, record) {
// record.set('precision',2);
// record.set('zero_amounts_allowed','N');
// record.set('bank_account_id',1531);
// record.set('bank_account_num','448165800609');
// record.set('bank_account_name','德融国际融资租赁有限公司');
// record.set('bank_account_code','0040101');
// record.set('currency_code','CNY');
// record.set('currency_name','人民币');
// }
function onAdd_csh511_receipt(ds, record) {
record.set('precision', 2);
record.set('zero_amounts_allowed', 'N');
record.set('bank_account_id', 1531);
// record.set('bank_account_num','448165800609');
// record.set('bank_account_name','德融国际融资租赁有限公司');
// record.set('bank_account_code','0040101');
record.set('currency_code', 'CNY');
record.set('currency_name', '人民币');
}
function setfunctionamount(record) {
var quotation = record.get('exchange_rate_quotation');
var a = record.get('transaction_amount');
var b = record.get('exchange_rate');
if (Ext.isDefined(a) && Ext.isDefined(b) && !Ext.isEmpty(a) && !Ext.isEmpty(b)) {
if (quotation == 'DIRECT QUOTATION') {
record.set('transaction_functional_amount', parseFloat(mul(a, b).toFixed(record.get('precision'))));
} else {
record.set('transaction_functional_amount', parseFloat(div(a, b).toFixed(record.get('precision'))));
}
}
}
function showPeriod(record) {
var r_date = record.get('transaction_date');
r_date = Leaf.formatDate(r_date);
Leaf.request({
url: $('get_period_name_id').getUrl(),
para: {
p_date: r_date
},
success: periodname,
scope: this
});
}
function periodname(res) {
var head_record = $('csh_transaction_receipt_head_ds').getAt(0);
if (res) {
var period_name = res.result.record.period_name,
internal_period_num = res.result.record.internal_period_num;
if (period_name) {
head_record.set('period_name', period_name);
head_record.set('internal_period_num', internal_period_num);
} else {
head_record.set('period_name', '');
head_record.set('internal_period_num', '');
if (head_record.get('transaction_date')) {
head_record.set('transaction_date', '');
Leaf.showMessage('${l:PROMPT}', '${l:CSH511.PERIOD_ERROR}');
}
}
}
}
function getExchangeRate(param) {
Leaf.request({
url: $('get_exchange_rate_link_id').getUrl(),
para: {
from_currency: param.fromCur,
to_currency: param.toCur,
exchange_date: param.exchangeDate,
exchange_period_name: param.periodName,
exchange_rate_type: param.exchangeRateType
},
success: setRateAndQuotation,
scope: this
});
}
function setRateAndQuotation(res) {
var record = $('csh_transaction_receipt_head_ds').getAt(0);
if (Ext.isDefined(res.result.record.exchange_rate_quotation)) {
record.set('exchange_rate_quotation', res.result.record.exchange_rate_quotation);
} else {
record.set('exchange_rate_quotation', 'DIRECT QUOTATION');
}
if (Ext.isDefined(res.result.record.exchange_rate)) {
record.set('exchange_rate', res.result.record.exchange_rate);
}
}
function attachment_upload() {
if (transaction_id) {
//
// ds = $('csh_transaction_receipt_head_ds');
// record = ds.getCurrentRecord();
// var header_id = record.get('transaction_id');
var header_id = transaction_id;
var url = $('transaction_uploadFile_id').getUrl() + '?table_name=CSH_TRANSACTION&header_id=' + header_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'transaction_uploadFile_winid',
width: 850,
height: 400
});
win.on('close', function () {
window.location.href = $('csh_transaction_receipt_id').getUrl();
// var url = $('csh_transaction_receipt_id').getUrl();
// Leaf.go(url);
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
return;
}
}
]]></script>
<a:dataSets>
<a:dataSet id="PAID_BYOTHER_FLAG_DS" lookupCode="PAID_BYOTHER_FLAG"/>
<!-- <a:dataSet id="payment_method_ds">
<a:datas dataSource="/model/payment_method_path"/>
</a:dataSet>-->
<!--<a:dataSet id="currency_ds">
<a:datas dataSource="/model/currency"/>
</a:dataSet>-->
<a:dataSet id="exchangerate_type_ds">
<a:datas dataSource="/model/exchangerate_type_path"/>
</a:dataSet>
<!-- <a:dataSet id="ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>-->
<a:dataSet id="csh_transaction_receipt_head_ds" autoCreate="true" loadData="true" model="csh.CSH511.csh_transaction">
<a:fields>
<a:field name="transaction_date" required="true"/>
<!--<a:field name="period_name" lovGridHeight="300" lovHeight="500" lovService="gld.gld_period_lov" lovWidth="500" readOnly="true" required="true" title="GLD_PERIODS.PERIOD_NAME">
<a:mapping>
<a:map from="period_name" to="period_name"/>
</a:mapping>
</a:field>-->
<!--<a:field name="internal_period_num"/>-->
<!--<a:field name="payment_method_display" displayField="description" options="payment_method_ds" returnField="payment_method_id" valueField="payment_method_id"/>-->
<a:field name="currency_name" displayField="currency_name" options="currency_ds" readOnly="true" required="true" returnField="currency_code" valueField="currency_code">
<a:mapping>
<a:map from="precision" to="precision"/>
</a:mapping>
</a:field>
<a:field name="currency_code"/>
<a:field name="precision"/>
<a:field name="functional_currency_code" defaultValue="${/model/default_exchange_rate_type_path/record/@functional_currency_code}"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="500" lovLabelWidth="90" lovService="basic.hls_bp_master_v_for_lov" lovWidth="550" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_name" to="csh_bp_name"/>
<a:map from="bp_category" to="bp_category"/>
<a:map from="bp_category_name" to="bp_category_display"/>
</a:mapping>
</a:field>
<!-- <a:field name="bank_slip_num" lovGridHeight="350" lovHeight="600" lovService="csh.CSH510.csh_transaction_contract_query" lovWidth="1200" title="合同编号">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_category" to="bp_category"/>
<a:map from="bp_category_n" to="bp_category_display"/>
<a:map from="contract_number" to="bank_slip_num"/>
</a:mapping>
</a:field> -->
<a:field name="bp_category_display" readOnly="true"/>
<a:field name="transaction_num" readOnly="true"/>
<a:field name="exchange_rate_type_display" displayField="type_name" options="exchangerate_type_ds" readOnly="true" returnField="exchange_rate_type" valueField="type_code">
<a:mapping>
<a:map from="type_code" to="exchange_rate_type"/>
<a:map from="rate_method_code" to="rate_method_code"/>
</a:mapping>
</a:field>
<a:field name="exchange_rate_type"/>
<a:field name="exchange_rate" readOnly="true" required="true"/>
<a:field name="rate_method_code"/>
<a:field name="transaction_amount" required="true"/>
<a:field name="transaction_functional_amount" readOnly="true"/>
<a:field name="bank_account_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" required="true" 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="zero_amounts_allowed"/>
<a:field name="bp_bank_account_code" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="basic.hls_bp_master_bank_account_v_for_lov?enabled_flag=Y" lovWidth="580" title="CSH511.BP_BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_id" to="bp_bank_account_id"/>
<a:map from="bank_account_num" to="bp_bank_account_num"/>
<a:map from="bank_account_name" to="bp_bank_account_name"/>
<a:map from="bank_account_code" to="bp_bank_account_code"/>
<a:map from="bank_branch_name" to="bp_bank_branch_name"/>
<a:map from="bank_full_name" to="bp_bank_name"/>
</a:mapping>
</a:field>
<!-- <a:field name="ref_contract_number" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH511.csh_con_contract_lov" lovWidth="580" title="CON301.CONTRACT_QUERY">
<a:mapping>
<a:map from="contract_number" to="ref_contract_number"/>
<a:map from="contract_id" to="ref_contract_id"/>
</a:mapping>
</a:field> -->
<a:field name="ref_contract_number" lovGridHeight="320" lovHeight="530" lovService="csh.CSH510.csh_transaction_contract_query" lovWidth="800" title="合同编号">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_category" to="bp_category"/>
<a:map from="bp_category_n" to="bp_category_display"/>
<a:map from="contract_id" to="ref_contract_id"/>
<a:map from="contract_number" to="ref_contract_number"/>
<a:map from="bp_id_agent_level1_n" to="bp_id_agent_level1_n"/>
</a:mapping>
</a:field>
<a:field name="bp_bank_account_num"/>
<a:field name="bp_bank_account_name" required="true"/>
<a:field name="collection_classes_desc" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<a:field name="paid_byother_flag_n" options="PAID_BYOTHER_FLAG_DS" returnField="paid_byother_flag" displayField="code_value_name" valueField="code_value"/>
</a:fields>
<a:events>
<!--<a:event name="update" handler="onUpdate_csh511_receipt"/>
<a:event name="add" handler="onAdd_csh511_receipt"/>
<a:event name="load" handler="onAdd_csh511_receipt"/>-->
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<!-- <a:gridButton id="csh511_receipt_save_id" click="csh511_receipt_save" text="HLS.SAVE"/>
<a:gridButton id="csh511_receipt_reset_id" click="csh511_receipt_reset" text="HLS.RESET"/>-->
<!--<a:gridButton id="csh511_receipt_posted_id" click="csh511_receipt_posted" text="HLS.POST"/>-->
<!--<a:gridButton id="csh511_receipt_upload_id" click="attachment_upload" text="附件上传"/>-->
<!--<a:gridButton id="csh511_receipt_back_id" click="csh511_receipt_back" text="HLS.EXIT"/>-->
</a:screenTopToolbar>
<!--<a:form title="CSH511.CSH_RECEIPT">-->
<!--<a:box column="4">-->
<!--<a:datePicker name="transaction_date" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:lov name="period_name" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:comboBox name="currency_name" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--&lt;!&ndash; <a:comboBox name="exchange_rate_type_display" bindTarget="csh_transaction_receipt_head_ds"/> &ndash;&gt;-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:lov name="ref_contract_num" bindTarget="csh_transaction_receipt_head_ds" prompt="合同编号"/>-->
<!--<a:comboBox name="payment_method_display" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_head_ds" prompt="银行凭证号"/>-->
<!--<a:numberField name="exchange_rate" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds" decimalPrecision="-1"/>-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:numberField name="transaction_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:numberField name="ref_n01" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds" prompt="税额"/>-->
<!--&lt;!&ndash; <a:numberField name="transaction_functional_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds"/> &ndash;&gt;-->
<!---->
<!--<a:lov name="bp_name" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bp_category_display" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:lov name="bank_account_code" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:lov name="bp_bank_account_code" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_head_ds"/>-->
<!--</a:box>-->
<!--<a:box column="2">-->
<!--<a:textField name="bank_account_name" bindTarget="csh_transaction_receipt_head_ds" width="383"/>-->
<!--<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_head_ds" width="383"/>-->
<!--</a:box>-->
<!--<a:box column="4">-->
<!--<a:textArea name="description" bindTarget="csh_transaction_receipt_head_ds" width="383"/>-->
<!--</a:box>-->
<!--</a:form>-->
<!--#删除表格头,添加fieldSet-->
<!-- <a:form title="收款信息" width="1200">-->
<a:fieldSet title="收款手动新增">
<a:box column="3">
<a:datePicker name="transaction_date" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<a:numberField name="transaction_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<!-- # 新增现金流字段,代付,商业伙伴,摘要字段-->
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE" readOnly="true"/>
<a:comboBox name="paid_byother_flag_n" prompt="代付" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<a:lov name="bp_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER" readOnly="true"/>
<a:comboBox name="collection_classes_desc" bindTarget="csh_transaction_receipt_head_ds" prompt="款项分类" readOnly="true"/>
</a:box>
<a:hBox style="width:800px">
<a:textField width="350" name="description" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
</a:hBox>
<!--#添加备注字段-->
<a:hBox style="width:800px">
<a:textField width="350" name="ref_v05" prompt="备注" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
</a:hBox>
</a:fieldSet>
<!--删除下面的字段 currency_name,bank_account_name,banka,bank_branch_name,bank_account_num,bank_account_type_name,exchange_rate_type_display-->
<!-- <a:comboBox name="currency_name" bindTarget="csh_transaction_receipt_head_ds"/>
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_head_ds"/>
&lt;!&ndash;<a:textField name="banka" bindTarget="csh_transaction_receipt_head_ds" prompt="账户类型"/>&ndash;&gt;
<a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_head_ds" readOnly="true" prompt="分行名称"/>
<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_head_ds" readOnly="true"/>
<a:textField name="bank_account_type_name" bindTarget="csh_transaction_receipt_head_ds" readOnly="true" prompt="账户类型"/>
&lt;!&ndash; <a:comboBox name="exchange_rate_type_display" bindTarget="csh_transaction_receipt_head_ds"/> &ndash;&gt;
</a:box>-->
<!--删除下面的两个box-->
<!-- <a:box column="4">
<a:textField name="description" bindTarget="csh_transaction_receipt_head_ds"/>
<a:textField name="purpose" bindTarget="csh_transaction_receipt_head_ds" prompt="用途"/>
</a:box>
<a:box column="4">
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_head_ds" prompt="银行流水号"/>
<a:textField name="gsber" bindTarget="csh_transaction_receipt_head_ds" prompt="业务范围"/>
<a:textField name="sus_belnr" bindTarget="csh_transaction_receipt_head_ds" prompt="SAP凭证号"/>
</a:box>-->
<!-- </a:form>-->
<!--添加两方的账户信息和附件-->
<a:fieldSet title="账户信息">
<a:box column="3" labelWidth="100">
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME" readOnly="true"/>
<a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME" readOnly="true"/>
<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME" readOnly="true"/>
<!--对方账户-->
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" readOnly="true"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME" readOnly="true"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_head_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" readOnly="true"/>
</a:box>
</a:fieldSet>
<a:fieldSet title="附件">
<a:hBox>
<a>附件上传:</a><a href="javascript:upload_attachment_win()" style="color:red">上传</a>
</a:hBox>
</a:fieldSet>
<!-- <a:form title="对方账户信息" width="1200">
<a:box column="4">
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_head_ds"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_receipt_head_ds" prompt="银行名称"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_head_ds"/>
</a:box>
</a:form>-->
</a:screenBody>
</a:view>
</a:screen>
......@@ -17,8 +17,10 @@
<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_post_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_post_query.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"/>
<!--更新收款单据的状态-->
......@@ -28,7 +30,53 @@
<a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510N/csh_transaction_import.lview"/>
<script type="text/javascript"><![CDATA[
//新增单据的作废
function csh510_csh_trx_bank_drop(){
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if (datas.length == 0) {
$L.showMessage("提示", '请选择要作废的单据');
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: $('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}', '该单据已作废!');
}, failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
})
}
//新增申请按钮’
function csh510_csh_trx_bank_apply_new() {
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
......@@ -40,27 +88,22 @@
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag= datas[i].get('confirmed_flag');
var confirmed_flag = datas[i].get('confirmed_flag');
//不是新增就报错
if(confirmed_flag!='NEW'&&confirmed_flag!=undefined){
if (confirmed_flag != 'NEW' && confirmed_flag != undefined) {
$L.showInfoMessage("提示", '请选择单据为未提交的数据', null, null);
return;
}
//弹出确认修改的提示框
var execute_flag=$L.showConfirm("提示",'确认执行该操作?')
//用户取消操作
if(flag==false) return ;
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
//提交想改变之后的状态
'wanted_confirmed_flag': 'MKTAUDITING',
'_status': 'update'
});
};
console.log(post_data);
}
//弹出确认修改的提示框
$L.showConfirm("提示", '确认执行该操作?', function () {
//锁屏
lock_current_window();
//改变未提交单据数据的状态
......@@ -79,9 +122,7 @@
},
scope: this
});
});
}
//跳转到收款新增页面
......@@ -166,15 +207,24 @@
}
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') {
/*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') {
} /!*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('receipt_type')=='IMPORT'&&record.get('bp_name')==null&&record.get('confirmed_flag')=='NEW'){
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>';
}
}
......@@ -655,8 +705,8 @@
<a:column prompt="账号" name="bp_bank_account_num"/>
</a:column>
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY"/>
<a:column name="mkt_confirmed_by" prompt="营业确认人"/>
<a:column name="acc_confirmed_by" prompt="会计确认人"/>
<a:column name="debt_confirmed_by_desc" prompt="债权确认人"/>
<a:column name="acc_confirmed_by_desc" prompt="会计确认人"/>
</a:columns>
</a:grid>
</a:fieldSet>
......
......@@ -14,6 +14,7 @@
</a:init-procedure>
<a:view>
<a:link id="import_csh_transaction_receipt_data_link_id" model="csh.CSH510N.csh_transaction_list_tmp" modelaction="execute"/>
<a:link id="save_import_csh_transaction_receipt_data_link_id" model="csh.CSH510N.csh_transaction_list_tmp" modelaction="batch_update"/>
<a:link id="get_period_name_id" model="csh.CSH511.csh_transaction_get_period_name" modelaction="query"/>
<script type="text/javascript"><![CDATA[
......@@ -28,21 +29,29 @@
if(import_flag==0){
for (var i = 0;i < records.length;i++) {
var record=records[i];
if (record.get('status') == 'ERROR') {
/*if (record.get('status') == 'ERROR') {
//错误的行不导入,其他行正常导入,这里不再判断cuo,在插入数据的时候
Leaf.showMessage('${l:PROMPT}', '导入的数据存在错误,请查看错误信息!');
return;
}
//将该条数据从导入的ds中
//return;
}*/
//获得周期时间
var r_date = record.get('attribute_3');
/* var r_date = record.get('attribute_3');
r_date = Leaf.formatDate(r_date);
Leaf.request({
url: $('get_period_name_id').getUrl(),
para: {
p_date: r_date
p_date: r_date,
date : new Date().getMilliseconds()
},
success: function(res){
var period_name = res.result.record.period_name,
internal_period_num = res.result.record.internal_period_num;
record.set('period_name', period_name);
record.set('internal_period_num', internal_period_num);
if (period_name) {
record.set('period_name', period_name);
record.set('internal_period_num', internal_period_num);
......@@ -56,10 +65,11 @@
}
},
scope: this
});
});*/
//否则的话添加必要的字段
record.set('receipt_type','import');
record.set('transaction_date',record.get('attribute_3'));
record.set('receipt_type','IMPORT');
record.set('bank_account_num',record.get('attribute_1'));
record.set('transaction_date', Leaf.formatDate(record.get('attribute_3')));
record.set('bank_slip_num',record.get('attribute_5'));
record.set('currency_code', 'CNY');
record.set('transaction_amount',record.get('attribute_14'));
......@@ -69,35 +79,49 @@
record.set('opposite_band_na',record.get('attribute_10'));
record.set('description',record.get('attribute_23'));
record.set('ref_v05',record.get('attribute_24'));
record.set('paid_byother_flag','F');
record.set('write_off_flag','DISABLED');
record.set('_status','insert');
//根据银行卡号设置我方的银行账号
Leaf.request({
/*Leaf.request({
url: $('import_csh_transaction_receipt_data_link_id').getUrl(),
para: {
bank_account_num:record.get('attribute_1'),
bp_bank_account_num:record.get('attribute_8')
},
success: function(res){
record.set('bank_account_id',res.result.bank_account_id);
//根据对方的银行卡号获取商业伙伴信息
record.set('bp_category',res.result.bp_category);
record.set('bp_id',res.result.bp_id);
record.set('csh_bp_name',res.result.csh_bp_name);
//i. 若能找到唯一值且该商业伙伴类型为承租人,则代付字段为“否”、商业伙伴字段为匹配到的商业伙伴;
// ii. 若能找到唯一值且该商业伙伴类型为代理店,则代付字段为“是”、商业伙伴字段为匹配到的商业伙伴;
//iii. 若无法找到匹配项或匹配到多项,则代付字段为“是”、商业伙伴字段为空;
if(res.result.bp_id!=-1&&res.result.bp_category=='TENANT'){
record.set('paid_byother_flag','F');
record.set('bp_id',res.result.bp_id);
}else if(res.result.bp_id!=-1&&res.result.bp_category=='AGENCY'){
record.set('paid_byother_flag','T');
record.set('bp_id',res.result.bp_id);
}else{
record.set('paid_byother_flag','T');
record.set('bp_id',null);
}
},
scope: this
});
});*/
record.set('_status','insert');
saveData.push(record.data);
}
//开始导入数据
Leaf.showConfirm('提示', '确定要导入信息吗?', function() {
Leaf.showConfirm('提示', '确定要导入信息吗,有错误信息的数据将不会被导入', function() {
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH511.csh_transaction_receipt_save/batch_update',
url: $('save_import_csh_transaction_receipt_data_link_id').getUrl(),
para: saveData,
scope: this,
success: function () {
......
......@@ -14,6 +14,7 @@
<a:model-query fetchAll="true" model="csh.CSH511.csh_transaction_default_exchange_rate_type" rootPath="default_exchange_rate_type_path"/>
</a:init-procedure>
<a:view>
<a:link id="hn2050_upload_win_link" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="csh_receipt_import_link" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt_impiort.lview"/>
<a:link id="csh_transaction_receipt_id" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt.lview"/>
<a:link id="get_exchange_rate_link_id" model="csh.CSH511.csh_transaction_get_exchange_rate" modelaction="query"/>
......@@ -21,6 +22,26 @@
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<a:link id="transaction_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<script type="text/javascript"><![CDATA[
//附件上传
function upload_attachment_win() {
/* var record = $(ds_id).findById(record_id);
var mortgage_id = record.get('mortgage_id');*/
console.log($('csh_transaction_receipt_head_ds').getAt(0).id);
var win = new Leaf.Window({
id: 'hn2050_upload_win',
url: $('hn2050_upload_win_link').getUrl(),
params: {
winid: 'hn2050_upload_win',
table_name: 'csh_transaction',
header_id: $('csh_transaction_receipt_head_ds').getAt(0).id
},
width: 900,
hight: 400
}).on('close', function() {
//record.ds.query();
});
}
var transaction_id;
<!--增加重置功能-->
function csh511_receipt_reset(){
......@@ -107,6 +128,7 @@
record.set('bp_bank_account_code', '');
record.set('bp_bank_account_name', '');
record.set('bp_bank_account_num', '');
record.set('opposite_band_na', '');
}
record.getField('bp_bank_account_code').setLovPara('bp_id', value);
} else if (name == 'currency_code') {
......@@ -117,7 +139,7 @@
record.set('exchange_rate_type_display', '');
record.set('exchange_rate_quotation', '');
if (oldvalue != null && oldvalue != '') {
record.set('transaction_amount', '');
//record.set('transaction_amount', '');
record.set('transaction_functional_amount', '');
}
}
......@@ -522,9 +544,13 @@
</a:box>
</a:fieldSet>
<a:fieldSet title="附件">
<input type="file" name="uploadFile"/>
<input type="button" value="上传"/>
<a:hBox>
<a>附件上传:</a><a href="javascript:upload_attachment_win()" style="color:red">上传</a>
</a:hBox>
</a:fieldSet>
<!-- <a:form title="对方账户信息" width="1200">
<a:box column="4">
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_head_ds"/>
......
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