Commit 435f2849 authored by niminmin's avatar niminmin

Merge branch 'feature/解约回购开发' into develop

parents c3f0d324 c45ffb9f
Pipeline #6650 canceled with stages
......@@ -113,7 +113,8 @@
(SELECT to_char(MIN(ccc.due_date),'yyyy-mm-dd')
FROM con_contract_cashflow ccc
WHERE ccc.contract_id = cc.contract_id
AND ccc.overdue_status = 'Y'
--AND ccc.overdue_status = 'Y'
AND ccc.due_date <=sysdate
AND ccc.cf_item = 1
AND ccc.write_off_flag <> 'FULL') min_overdue_date,
--营业已收租金
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
con_change_single_calc_pkg.calc_repo_cashflows(p_contract_id=>${@contract_id},
cus_con_contract_repo_pkg.calc_one_time_repo_cashflow(p_contract_id=>${@contract_id},
p_user_id=>${/session/@user_id});
END;
]]>
......
......@@ -10,6 +10,7 @@
<bm:parameter name="sum_unreceived_principal" dataType="java.lang.Double" input="false" output="true" outputPath="@sum_unreceived_principal"/>
<bm:parameter name="due_amount" dataType="java.lang.Double" input="false" output="true" outputPath="@due_amount"/>
<bm:parameter name="penalty" dataType="java.lang.Double" input="false" output="true" outputPath="@penalty"/>
<bm:parameter name="fund_possession_cost" dataType="java.lang.Double" input="false" output="true" outputPath="@fund_possession_cost"/>
</bm:parameters>
<bm:update-sql><![CDATA[
BEGIN
......@@ -22,6 +23,7 @@
p_sum_unreceived_principal => ${@sum_unreceived_principal},
p_due_amount => ${@due_amount},
p_penalty => ${@penalty},
p_fund_possession_cost =>${@fund_possession_cost},
p_user_id => ${/session/@user_id});
END;
]]>
......
......@@ -15,7 +15,8 @@
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'CON500_CONTRACT_STATUS'
AND sc.code_value = t1.contract_status) contract_status_desc
AND sc.code_value = t1.contract_status) contract_status_desc,
t1.payment_deduction
from con_contract t1
where
t1.contract_status in ('INCEPT','NEW','ETING','REPURSING')
......@@ -44,6 +45,7 @@ select t.parent_company_id company_id
<bm:field name="contract_status_desc"/>
<bm:field name="dd_bank_account_num"/>
<bm:field name="dd_bank_account_name"/>
<bm:field name="payment_deduction"/>
</bm:fields>
<bm:query-fields>
<bm:query-field field="contract_id" queryOperator="="/>
......
......@@ -123,6 +123,7 @@ end;
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" />
<bm:field name="payment_deduction" expression="(select payment_deduction from con_contract c where c.contract_id = t1.contract_id)" forInsert="false" forUpdate="false"/>
</bm:fields>
<bm:features>
<f:standard-who/>
......
......@@ -53,7 +53,14 @@
t1.action_type,
t1.action_type_desc,
t1.record_type,
t1.comment_text,
decode(t1.workflow_code,'PROJECT_WFL', decode(t1.action_type,'1',
(case when
${/session/@role_id} in(2318,2319) then
'同意'
elsemodules/cont/CON620/con_contract_rent_dun_query.lview
t1.comment_text
end ),t1.comment_text),t1.comment_text) comment_text,
-- t1.comment_text,
t1.comment_text_out,
t1.record_id,
t1.seq_number,
......@@ -95,7 +102,14 @@
t1.action_type,
t1.action_type_desc,
t1.record_type,
t1.comment_text,
decode(t1.workflow_code,'PROJECT_WFL', decode(t1.action_type,'1',
(case when
${/session/@role_id} in(2318,2319) then
'同意'
else
t1.comment_text
end ),t1.comment_text),t1.comment_text) comment_text,
-- t1.comment_text,
t1.comment_text_out,
t1.record_id,
t1.seq_number,
......
......@@ -1463,7 +1463,7 @@
var userName;
if (res.success) {
var userImg = res.result.record.avatar;
userName = res.result.record.description;
userName = res.result.record.user_name;
document.getElementById('userName').innerHTML = userName;
if (!!userImg) jQuery('.user-avatar').attr('src', userImg);
document.getElementById('row-user-name-id').innerHTML = userName;
......
......@@ -162,6 +162,7 @@
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) { //查询权限
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
if (ds == $(ds_id)) {
//aut_authority_list_validate_query(ds, qpara);
var role_code='${/model/role_info/record/@role_code}';
......
......@@ -35,13 +35,13 @@
head_record.set('ccr_document_type_n','回款账户变更');
head_record.getField('ccr_document_type').setReadOnly(true);
head_record.getField('ccr_document_type_n').setReadOnly(true);
}else if(role_code=='0008'){
}else if(role_code=='0019'){
head_record.set('ccr_document_type','LEASE_CHAG');
head_record.set('ccr_document_type_n','承租人变更');
head_record.getField('ccr_document_type').setReadOnly(true);
head_record.getField('ccr_document_type_n').setReadOnly(true);
}
else if(role_code=='0019'){
else if(role_code=='0008'){
head_record.set('ccr_document_type','CUT_CHAG');
head_record.set('ccr_document_type_n','租金计划变更');
head_record.getField('ccr_document_type').setReadOnly(true);
......@@ -136,14 +136,14 @@
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
// if (ds == $(ds_id)) {
// aut_authority_list_validate_query(ds, qpara);
//
// }
if (ds == $(ds_id)) {
aut_authority_list_validate_query(ds, qpara);
}
};
]]></script>
<a:screen-include
screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON501"/>
screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON733"/>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
......@@ -27,7 +27,7 @@
$(ds_con_id).query();
}
});
var calc_flag='Y';
var calc_flag='N';
//新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
......@@ -35,16 +35,37 @@
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
debugger;
if(value!=old_value){
calc_flag='N';
}
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract_change_req');
if (ds == $(ds_id)) {
if(value!=old_value){
calc_flag='N';
record.set('calc_flag','N');
}
if (name == 'et_fee') {
var et_total_amount=record.get('et_total_amount')||0;
var old_et_fee=old_value||0;
record.set('et_total_amount', plus(minus(et_total_amount,old_et_fee),value||0));
}
if (name == 'ccr_penalty') {
var et_total_amount=record.get('et_total_amount')||0;
var due_amount = record.get('penalty') || 0;
if (due_amount < value) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息必须小于等于逾期罚息!');
setTimeout(function () {
record.set('ccr_penalty', 0);
}, 5);
return;
}
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息金额应大于等于0!');
setTimeout(function () {
record.set('ccr_penalty', 0);
}, 5);
return;
}
record.set('et_total_amount', plus(plus(plus(plus(record.get('et_due_amount')||0,record.get('et_fee')||0),record.get('residual_value')||0),record.get('overdue_amount')||0),value));
}
if (name == 'termination_date'&&value) {
// 根据结清日计算结清相关金额字段
......@@ -64,6 +85,7 @@
record.set('et_due_amount', res.result.et_due_amount);
record.set('overdue_amount', res.result.overdue_amount||0);
record.set('penalty', res.result.penalty||0);
record.set('ccr_penalty', res.result.penalty||0);
record.set('fund_possession_time', res.result.fund_possession_time);
record.set('fund_possession_cost', res.result.fund_possession_cost);
record.set('fund_possession_rate', res.result.fund_possession_rate);
......@@ -76,6 +98,7 @@
record.set('et_due_amount','');
record.set('overdue_amount', '');
record.set('penalty', '');
record.set('ccr_penalty', '');
record.set('fund_possession_time','');
record.set('fund_possession_cost','');
//record.set('fund_possession_rate','');
......@@ -88,6 +111,7 @@
record.set('et_due_amount','');
record.set('overdue_amount', '');
record.set('penalty', '');
record.set('ccr_penalty', '');
record.set('fund_possession_time','');
record.set('fund_possession_cost','');
//record.set('fund_possession_rate','');
......@@ -108,7 +132,7 @@
var case_type = '';
var document_type = '${/parameter/@document_type}';
var calc_session_id = req_record.get('calc_session_id');
calc_flag=req_record.get('calc_flag');
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
if ($(req_ds_id).validate($('${/parameter/@layout_code}_submit_approval').enable())) {
if (req_record.dirty) {
......@@ -221,8 +245,10 @@
calc_flag='Y';
//con_record.getField('ccr_start_times').setReadOnly(true);
var ca_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_QUOTATION_02', 'con_contract_cashflow');
if (ca_ds_id) {
var con_contract_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract_change_req');
if (ca_ds_id&&con_contract_ds_id) {
$(ca_ds_id).query();
$(con_contract_ds_id).query();
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_user_button1').enable(); //按钮启用
......
......@@ -7,7 +7,7 @@
<a:view>
<a:link id="con_repo_submit_link" model="cont.CON_REPO001.submit_change_req" modelaction="execute"/>
<a:link id="con_repo001_cancel_link" model="cont.CON731.cancel_change_req" modelaction="execute"/>
<a:link id="con_repo001_calc_cashflow_link" model="cont.CON_REPO001.calc_cashflow" modelaction="execute"/>
<a:link id="con_repo001_calc_one_time_cashflow_link" model="cont.CON_REPO001.calc_cashflow" modelaction="execute"/>
<a:link id="con_repo001_calc_repo_date_amount_link" model="cont.CON_REPO001.calc_repo_date_amount" modelaction="execute"/>
<a:link id="${/parameter/@layout_code}${/parameter/@tree_code}_hls_fin_calculator_update_link_id"
url="${/request/@context_path}/modules/cont/CON_REPO001/hls_fin_calculator_update_n.lview"/>
......@@ -19,15 +19,14 @@
url="${/request/@context_path}/downloadFile.lview"/>
<script type="text/javascript"><![CDATA[
var calc_flag = false;
var maunal_calc_flag = false;
Leaf.onReady(function() {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract');
if ($(ds_id)) {
$(ds_id).setQueryParameter('contract_id',${/parameter/@contract_id});
$(ds_id).query();
}
});
var calc_flag = false ,manual_calc_flag = false;
// Leaf.onReady(function() {
// var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract');
// if ($(ds_id)) {
// $(ds_id).setQueryParameter('contract_id',${/parameter/@contract_id});
// $(ds_id).query();
// }
// });
/* function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
......@@ -38,258 +37,292 @@
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
}*/
// //保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
//window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
// alert(11111);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
//新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var repurchase_types = record.get('repurchase_types');
if (repurchase_types == 'ONE_TIME_REPURCHASE') {
/* record.getField('payment_frequency_n').setRequired(false);
record.getField('payment_frequency').setRequired(false);*/
record.getField('payment_period').setRequired(false);
/* record.getField('payment_frequency_n').setReadOnly(true);*/
record.getField('payment_period').setReadOnly(true);
record.set('payment_period', 1);
// record.set('payment_frequency', 'MONTH');
// record.set('payment_frequency_n', '按月');
if('${/parameter/@layout_code}'=='CON_REPO001D') {
var repurchase_types = record.get('repurchase_types');
if (repurchase_types == 'ONE_TIME_REPURCHASE') {
record.set('payment_period', 1);
record.getField('price_list').setReadOnly(true);
record.getField('price_list_n').setReadOnly(true);
} else {
record.getField('payment_period').setReadOnly(false);
record.getField('price_list').setReadOnly(false);
record.getField('price_list_n').setReadOnly(false);
}
// if (record.get('depoist_offset_flag')) {
// if (record.get('depoist_offset_flag') == 'Y') {
// record.getField('depoist_remaining_amount').setReadOnly(false);
// } else if (record.get('depoist_offset_flag') == 'N') {
// record.getField('depoist_remaining_amount').setReadOnly(true);
// }
// }
}
else{
record.getField('payment_period').setReadOnly(false);
};
function compareDate(start, end) {
if (start > end) {
return false;
}
record.set('payment_frequency', 'MONTH');
record.set('payment_frequency_n', '按月');
return true;
};
// window['${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK'] = function () {
// $('${/parameter/@layout_code}_save').disable(); //按钮不可用
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
// if (calc_flag) {
// maunal_calc_flag = true;
// }else{
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// Leaf.showMessage('${l:HLS.PROMPT}', '请先计算,再保存!');
// $('${/parameter/@layout_code}_save').enable(); //按钮可用
// return;
// }
// };
/*保存前调用*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'con_contract');
var req_record = $(req_ds_id).getAt(0);
var repurchase_date = Leaf.formatDate(req_record.get('repurchase_date'));
var paymengt_deadlinedate = Leaf.formatDate(req_record.get('paymengt_deadlinedate'));
var repurchase_types = record.get('repurchase_types');
var payment_period = record.get('payment_period');
//支付预定日需要大于解约回购日
if (!compareDate(repurchase_date, paymengt_deadlinedate)) {
Leaf.showMessage('${l:HLS.PROMPT}', '支付预定日需要大于等于解约回购日!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if (repurchase_types == 'STAGE_REPURCHASE') {
if (payment_period<2) {
Leaf.showMessage('${l:HLS.PROMPT}', '回购类型为分期回购时,支付期数需大于1期');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
//return true;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
debugger;
if(value!=old_value){
record.set('offset_flag', 'N');
}
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
// var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract');
var head_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract');
var ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_QUOTATION_02', 'con_contract');
var ds_id3 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_QUOTATION_01', 'con_contract');
// 回购价款总额 = 逾期租金 + 逾期罚息+ 剩余本金 + 留购价 + 手续费 + 资金占用费-保证金余额(抵扣情况下)
// sum_overdue_amount+due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 回购价款总额
if (ds == $(ds_id)) {
var repurchase_types = record.get('repurchase_types');
if (name != 'repurchase_types_n' && name != 'payment_frequency' && name != 'payment_frequency_n') {
if (repurchase_types == null || repurchase_types == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '请先维护基本信息中的回购类型!');
return;
}
}
var depoist_remaining_amount;
if (record.get('depoist_offset_flag') == 'Y') {
depoist_remaining_amount = record.get('depoist_remaining_amount') || 0;
} else {
depoist_remaining_amount = 0 * 1;
}
// 回购价款总额 = 逾期租金 + 逾期罚息+ 剩余本金 + 留购价 + 手续费 + 资金占用费-保证金余额(抵扣情况下)
// sum_overdue_amount+due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 回购价款总额
// 逾期罚息(调整后)
if (name == 'payment_period') {
if (value <= 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '支付期数请填写大于0的整数!');
return;
}
// if (name != 'repurchase_types_n' && name != 'payment_frequency' && name != 'payment_frequency_n') {
// if (repurchase_types == null || repurchase_types == undefined) {
// Leaf.showMessage('${l:HLS.PROMPT}', '请先维护基本信息中的回购类型!');
// return;
// }
// }
if (name =='repurchase_types'&&value == 'ONE_TIME_REPURCHASE') {
record.getField('payment_period').setReadOnly(true);
record.set('payment_period', 1);
record.getField('price_list').setReadOnly(true);
record.getField('price_list_n').setReadOnly(true);
// 分期回购
} else if (name =='repurchase_types'&&value == 'STAGE_REPURCHASE') {
record.getField('payment_period').setReadOnly(false);
record.getField('price_list').setReadOnly(false);
record.getField('price_list_n').setReadOnly(false);
}
if (name == 'ccr_due_amount' && value) {
var depoist_remaining_amount=0;
// if (record.get('depoist_offset_flag') == 'Y') {
// depoist_remaining_amount = record.get('depoist_remaining_amount') || 0;
// } else {
// depoist_remaining_amount = 0 * 1;
// }
// if (name == 'depoist_offset_flag' && value) {
// var repurchase_tatal_amount=record.get('repurchase_tatal_amount') || 0;
// var temp_amount= record.get('depoist_remaining_amount') || 0;
// if(value=='Y'){
// record.getField('depoist_remaining_amount').setReadOnly(false);
// record.set('depoist_remaining_amount', 0);
// record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount,temp_amount));
// record.set('repurchase_count_amount', minus(repurchase_tatal_amount,temp_amount));
// }else{
// record.getField('depoist_remaining_amount').setReadOnly(true);
// record.set('depoist_remaining_amount', 0);
// record.set('repurchase_tatal_amount', minus(plus(repurchase_tatal_amount,temp_amount),0));
// record.set('repurchase_count_amount', minus(plus(repurchase_tatal_amount,temp_amount),0));
// }
// }
// //保证金余额(抵扣情况下)
// if (name == 'depoist_remaining_amount') {
//
//
// if (value < 0 || value == NaN || value == undefined) {
// Leaf.showMessage('${l:HLS.PROMPT}', '保证金抵扣金额应大于等于0!');
// setTimeout(function () {
// record.set('depoist_remaining_amount', 0);
// }, 5);
// return;
// }
// var repurchase_tatal_amount=record.get('repurchase_tatal_amount') || 0;
// var deposit_left= record.get('deposit_left') || 0;
// if(record.get('depoist_offset_flag')=='Y'){
// if (value>deposit_left){
// Leaf.showMessage('${l:HLS.PROMPT}', '保证金抵扣金额不能大于合同剩余保证金余额!');
// setTimeout(function () {
// record.set('depoist_remaining_amount', 0);
// }, 5);
// return;
// }else{
// record.set('repurchase_tatal_amount', minus(plus(repurchase_tatal_amount,old_value||0),value));
// record.set('repurchase_count_amount', minus(plus(repurchase_tatal_amount,old_value||0),value));
// }
//
// }
// else if(record.get('depoist_offset_flag')=='N'){
// null;
// }
// else{
// Leaf.showMessage('${l:HLS.PROMPT}', '请先选择保证金是否抵扣!');
// setTimeout(function () {
// record.set('depoist_remaining_amount', 0);
// }, 5);
// return;
// }
// }
//逾期罚息
if (name == 'ccr_due_amount') {
var due_amount = record.get('due_amount') || 0;
if (due_amount < value) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息必须小于等于逾期罚息!');
setTimeout(function () {
record.set('ccr_due_amount', 0);
}, 500);
}, 5);
return;
}
// if ( value == NaN || value == undefined) {
// Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息金额应大于等于0!');
// setTimeout(function () {
// record.set('ccr_due_amount', 0);
// }, 5);
// return;
// }
//var new_ccr_due_amount=minus(value,old_value||0);
// var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, new_ccr_due_amount || 0), record.get('sum_unreceived_principal') || 0)
// , record.get('residual_value') || 0);
var repurchase_count_amount = plus(plus(record.get('sum_overdue_amount') , record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
repurchase_tatal_amount=plus(repurchase_tatal_amount,value||0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 一次性回购
if (repurchase_types == 'ONE_TIME_REPURCHASE') {
// 回购价款总额 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价 + 手续费 + 资金占用费
// sum_overdue_amount+ccr_due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价
// 逾期罚息(调整后)
record.getField('payment_frequency_n').setRequired(false);
record.getField('payment_frequency').setRequired(false);
record.getField('payment_period').setRequired(false);
record.getField('payment_frequency_n').setReadOnly(true);
record.getField('payment_period').setReadOnly(true);
record.set('payment_period', 1);
// record.set('payment_frequency', 'MONTH');
if (name == 'ccr_due_amount') {
var due_amount = record.get('due_amount') || 0;
if (due_amount < value) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息必须小于等于逾期罚息!');
}
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, value || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', repurchase_tatal_amount);
record.set('repurchase_count_amount', repurchase_count_amount);
}
// 手续费
if (name == 'repurchase_service_charges') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, value || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', repurchase_tatal_amount);
record.set('repurchase_count_amount', repurchase_count_amount);
}
// 资金占用费value
if (name == 'fund_possession_cost') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), value || 0);
record.set('repurchase_tatal_amount', repurchase_tatal_amount);
record.set('repurchase_count_amount', repurchase_count_amount);
}
// 分期回购
} else if (repurchase_types == 'STAGE_REPURCHASE') {
//record.set('payment_period', '');
record.getField('payment_frequency_n').setRequired(true);
record.getField('payment_frequency').setRequired(true);
record.getField('payment_period').setRequired(true);
record.getField('payment_period').setReadOnly(false);
record.getField('payment_frequency_n').setReadOnly(false);
record.getField('payment_frequency').setReadOnly(true);
// 回购价款总额 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价 + 手续费 + 资金占用费
// sum_overdue_amount+ccr_due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价
// 逾期罚息(调整后)
if (name == 'payment_period') {
if (value <= 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '支付期数请填写大于0的整数!');
return;
}
}
if (name == 'ccr_due_amount') {
var due_amount = record.get('due_amount') || 0;
if (due_amount < value) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息必须小于等于逾期罚息!');
return;
}
}
if (name == 'due_amount' && value) {
var due_amount = record.get('due_amount') || 0;
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, value || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 手续费
if (name == 'repurchase_service_charges') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, value || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 资金占用费value
if (name == 'fund_possession_cost') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), value || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'sum_overdue_amount') {
var repurchase_count_amount = plus(plus(plus(value || 0, record.get('due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'sum_unreceived_principal') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('due_amount') || 0), value || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'repurchase_date' && value) {
debugger;
// last_rent_due_date 前期租金支付约定日:自动带出原合同报价现金流中,回购解约日上一期应收租金的日期。
Leaf.request({
url: $('con_repo001_calc_repo_date_amount_link').getUrl(),
para: {
contract_id: record.get('contract_id'),
repurchase_date: value
},
success: function (res) {
record.set('last_rent_due_date', res.result.last_rent_due_date);
record.set('sum_received_rent_amount', res.result.sum_received_rent_amount || 0);
record.set('sum_unreceived_rent_amount', res.result.sum_unreceived_rent_amount || 0);
record.set('sum_overdue_amount', res.result.sum_overdue_amount || 0);
record.set('sum_unreceived_principal', res.result.sum_unreceived_principal || 0);
record.set('due_amount', res.result.due_amount || 0);
record.set('ccr_due_amount', res.result.due_amount || 0);
},
failure: function () {
record.set('last_rent_due_date', '');
record.set('repurchase_date', '');
record.set('sum_received_rent_amount', '');
record.set('sum_unreceived_rent_amount', '');
record.set('sum_overdue_amount', '');
record.set('sum_unreceived_principal', '');
record.set('due_amount', '');
record.set('ccr_due_amount', '');
},
error: function () {
record.set('repurchase_date', '');
record.set('last_rent_due_date', '');
record.set('sum_received_rent_amount', '');
record.set('sum_unreceived_rent_amount', '');
record.set('sum_overdue_amount', '');
record.set('sum_unreceived_principal', '');
record.set('due_amount', '');
record.set('ccr_due_amount', '');
},
scope: this
});
}
// 手续费
if (name == 'repurchase_service_charges'&&value) {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, value || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 资金占用费value
if (name == 'fund_possession_cost'&&value) {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), value || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
//逾期租金
if (name == 'sum_overdue_amount'&&value) {
var repurchase_count_amount = plus(plus(plus(value || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
//剩余本金
if (name == 'sum_unreceived_principal'&&value) {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), value || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'repurchase_date' && value) {
debugger;
Leaf.request({
url: $('con_repo001_calc_repo_date_amount_link').getUrl(),
para: {
contract_id: record.get('contract_id'),
repurchase_date: value
},
success: function (res) {
record.set('last_rent_due_date', res.result.last_rent_due_date);
record.set('sum_received_rent_amount', res.result.sum_received_rent_amount || 0);
record.set('sum_unreceived_rent_amount', res.result.sum_unreceived_rent_amount || 0);
record.set('sum_overdue_amount', res.result.sum_overdue_amount || 0);
record.set('sum_unreceived_principal', res.result.sum_unreceived_principal || 0);
record.set('due_amount', res.result.due_amount || 0);
record.set('ccr_due_amount', res.result.due_amount || 0);
record.set('offset_flag', 'N');
record.set('fund_possession_cost', res.result.fund_possession_cost || 0);
},
failure: function () {
record.set('last_rent_due_date', '');
record.set('repurchase_date', '');
record.set('sum_received_rent_amount', '');
record.set('sum_unreceived_rent_amount', '');
record.set('sum_overdue_amount', '');
record.set('sum_unreceived_principal', '');
record.set('due_amount', '');
record.set('ccr_due_amount', '');
record.set('fund_possession_cost', 0);
},
error: function () {
record.set('repurchase_date', '');
record.set('last_rent_due_date', '');
record.set('sum_received_rent_amount', '');
record.set('sum_unreceived_rent_amount', '');
record.set('sum_overdue_amount', '');
record.set('sum_unreceived_principal', '');
record.set('due_amount', '');
record.set('ccr_due_amount', '');
record.set('fund_possession_cost', 0);
},
scope: this
});
}
}
};
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
// $('${/parameter/@layout_code}_submit_approval').disable();
var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract');
var req_record = $(req_ds_id).getAt(0);
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
debugger;
// var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract');
var req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'con_contract');
var req_record = $(req_ds_id).getCurrentRecord();
var case_type = '';
var document_type = '${/parameter/@document_type}';
var calc_session_id = req_record.get('calc_session_id');
//计算标志
var offset_flag=req_record.get('offset_flag');
if (req_record.dirty == true) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
// $('${/parameter/@layout_code}_submit_approval').enable();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if (offset_flag!=='Y') {
Leaf.showMessage('${l:HLS.PROMPT}', '请先成功计算报价!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if ($(req_ds_id).validate($('${/parameter/@layout_code}_submit_approval').enable())) {
// if (req_record.dirty) {
// Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// return;
// }
// $('${/parameter/@layout_code}_submit_approval').disable();
// $('${/parameter/@layout_code}_save').disable();
// $('${/parameter/@layout_code}_user_button1').disable();
// $('${/parameter/@layout_code}_user_button3').disable();
// setTimeout(window['${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK'](con_repo001_submit), 2000);
// window['${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK'](con_repo001_submit);
con_repo001_submit();
} else {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
......@@ -297,6 +330,7 @@
};
function con_repo001_submit() {
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交审批?', function () {
var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract');
var req_record = $(req_ds_id).getAt(0);
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
......@@ -330,6 +364,7 @@
},
scope: this
});
});
}
//报价计算
......@@ -351,7 +386,7 @@
if($(ds_id_head).validate()){
if(record.get('repurchase_types') == 'ONE_TIME_REPURCHASE'){
Leaf.request({
url: $('con_repo001_calc_cashflow_link').getUrl(),
url: $('con_repo001_calc_one_time_cashflow_link').getUrl(),
para: {
contract_id: record.get('contract_id'),
},
......@@ -360,9 +395,11 @@
Leaf.SideBar.enable = true;
Leaf.SideBar.show({msg: '计算成功!',duration: 2000});
var ca_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_QUOTATION_04', 'con_contract_cashflow');
if (ca_ds_id) {
$(ca_ds_id).query();
}
// if (ca_ds_id) {
// $(ca_ds_id).query();
// }
$(cashflow_ds_id).query();
$(ds_id_head).query();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_user_button1').enable();
},
......@@ -402,8 +439,8 @@
global_flag: 'Y',
id_num: 1,
calc_type: calc_type,
recreate_H_formula: 'Y',
recreate_L_formula: 'Y'
recreate_H_formula: 'N',
recreate_L_formula: 'N'
},
url: $('${/parameter/@layout_code}${/parameter/@tree_code}_hls_fin_calculator_update_link_id').getUrl(),
fullScreen: true,
......@@ -534,10 +571,11 @@
var file_name = temp[0].toUpperCase();
var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase();
if (file_name.indexOf('.PDF') >= 0) {
url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ',';
} //else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
else if (file_name.indexOf('.BMP') >= 0 || file_name.indexOf('.JPG') >= 0 || file_name.indexOf('.JPEG') >= 0 || file_name.indexOf('.PNG') >= 0 || file_name.indexOf('.GIF') >= 0) {
// if (file_name.indexOf('.PDF') >= 0) {
// url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ',';
// } //else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
if (file_name.indexOf('.BMP') >= 0 || file_name.indexOf('.JPG') >= 0 || file_name.indexOf('.JPEG') >= 0 || file_name.indexOf('.PNG') >= 0 || file_name.indexOf('.GIF') >= 0) {
url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ',';
} else {
url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
2019-9-6 Spencer 3893 合同回购申请创建明细
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure/>
<a:view>
<a:link id="con_repo_submit_link" model="cont.CON_REPO001.submit_change_req" modelaction="execute"/>
<a:link id="con_repo001_cancel_link" model="cont.CON731.cancel_change_req" modelaction="execute"/>
<a:link id="con_repo001_calc_cashflow_link" model="cont.CON_REPO001.calc_cashflow" modelaction="execute"/>
<a:link id="con_repo001_calc_repo_date_amount_link" model="cont.CON_REPO001.calc_repo_date_amount" modelaction="execute"/>
<a:link id="${/parameter/@layout_code}${/parameter/@tree_code}_hls_fin_calculator_update_link_id"
url="${/request/@context_path}/modules/cont/CON_REPO001/hls_fin_calculator_update_n.lview"/>
<a:link id="con_update_record_link_id" model="cont.CON_REPO001.save_calc_from_con" modelaction="execute"/>
<a:link id="con_update_record_link1_id" model="cont.CON_REPO001.con_change_calc_from_con" modelaction="execute"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id"
url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id"
url="${/request/@context_path}/downloadFile.lview"/>
<script type="text/javascript"><![CDATA[
var calc_flag = false ,manual_calc_flag = false;
Leaf.onReady(function() {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract');
if ($(ds_id)) {
$(ds_id).setQueryParameter('contract_id',${/parameter/@contract_id});
$(ds_id).query();
}
});
/* function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
param['download'] = 'Y';
param['maintain_type'] = 'UPDATE';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
}*/
//新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var repurchase_types = record.get('repurchase_types');
if (repurchase_types == 'ONE_TIME_REPURCHASE') {
record.set('payment_period', 1);
}
else{
record.getField('payment_period').setReadOnly(false);
}
if(record.get('depoist_offset_flag')){
if (record.get('depoist_offset_flag')=='Y'){
record.getField('depoist_remaining_amount').setReadOnly(false);
}else if(record.get('depoist_offset_flag')=='N'){
record.getField('depoist_remaining_amount').setReadOnly(true);
}
}
};
function compareDate(start, end) {
if (start > end) {
return false;
}
return true;
};
/*保存前调用*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'con_contract');
var req_record = $(req_ds_id).getAt(0);
var repurchase_date = Leaf.formatDate(req_record.get('repurchase_date'));
var paymengt_deadlinedate = Leaf.formatDate(req_record.get('paymengt_deadlinedate'));
var repurchase_types = record.get('repurchase_types');
var payment_period = record.get('payment_period');
//支付预定日需要大于解约回购日
if (!compareDate(repurchase_date, paymengt_deadlinedate)) {
Leaf.showMessage('${l:HLS.PROMPT}', '支付预定日需要大于解约回购日!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if (repurchase_types == 'STAGE_REPURCHASE') {
if (payment_period<2) {
Leaf.showMessage('${l:HLS.PROMPT}', '回购类型为分期回购时,支付期数需大于1期');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
// var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract');
var ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_QUOTATION_02', 'con_contract');
var ds_id3 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_QUOTATION_01', 'con_contract');
if (ds == $(ds_id)) {
var repurchase_types = record.get('repurchase_types');
if (name != 'repurchase_types_n' && name != 'payment_frequency' && name != 'payment_frequency_n') {
if (repurchase_types == null || repurchase_types == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '请先维护基本信息中的回购类型!');
return;
}
}
var depoist_remaining_amount;
if (record.get('depoist_offset_flag') == 'Y') {
depoist_remaining_amount = record.get('depoist_remaining_amount') || 0;
} else {
depoist_remaining_amount = 0 * 1;
}
// 回购价款总额 = 逾期租金 + 逾期罚息+ 剩余本金 + 留购价 + 手续费 + 资金占用费-保证金余额(抵扣情况下)
// sum_overdue_amount+due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 回购价款总额
// 逾期罚息(调整后)
// if (name == 'payment_period') {
// if (value <= 0 || value == NaN || value == undefined) {
// Leaf.showMessage('${l:HLS.PROMPT}', '支付期数请填写大于0的整数!');
// setTimeout(function () {
// record.set('payment_period', null);
// }, 500);
// return;
// }
// }
// if (name == 'ccr_due_amount' && value) {
// var due_amount = record.get('due_amount') || 0;
// if (due_amount < value) {
// Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息必须小于等于逾期罚息!');
// setTimeout(function () {
// record.set('ccr_due_amount', 0);
// }, 500);
// return;
// }
// if (value <= 0 || value == NaN || value == undefined) {
// Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息金额格式不正确!');
// setTimeout(function () {
// record.set('ccr_due_amount', 0);
// }, 500);
// return;
// }
// }
if (name == 'depoist_offset_flag' && value) {
var repurchase_tatal_amount=record.get('repurchase_tatal_amount') || 0;
var temp_amount= record.get('depoist_remaining_amount') || 0;
if(value=='Y'){
record.getField('depoist_remaining_amount').setReadOnly(false);
record.set('depoist_remaining_amount', null);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount,temp_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount,temp_amount));
}else{
record.getField('depoist_remaining_amount').setReadOnly(true);
record.set('depoist_remaining_amount', 0);
record.set('repurchase_tatal_amount', minus(plus(repurchase_tatal_amount,temp_amount),0));
record.set('repurchase_count_amount', minus(plus(repurchase_tatal_amount,temp_amount),0));
}
}
if (name == 'depoist_remaining_amount' && value) {
var repurchase_tatal_amount=record.get('repurchase_tatal_amount') || 0;
var deposit_left= record.get('deposit_left') || 0;
if(record.get('depoist_offset_flag')=='Y'){
if (value>deposit_left){
Leaf.showMessage('${l:HLS.PROMPT}', '保证金抵扣金额不能大于合同剩余保证金余额!');
setTimeout(function () {
record.set('depoist_remaining_amount', 0);
}, 5);
return;
}else{
record.set('repurchase_tatal_amount', minus(plus(repurchase_tatal_amount,old_value||0),value));
record.set('repurchase_count_amount', minus(plus(repurchase_tatal_amount,old_value||0),value));
}
}else if(record.get('depoist_offset_flag')=='N'){
null;
// record.set('repurchase_tatal_amount', minus(plus(repurchase_tatal_amount,temp_amount),0));
// record.set('repurchase_count_amount', minus(plus(repurchase_tatal_amount,temp_amount),0));
}else{
Leaf.showMessage('${l:HLS.PROMPT}', '请先选择保证金是否抵扣!');
setTimeout(function () {
record.set('depoist_remaining_amount', 0);
}, 5);
return;
}
}
// 一次性回购
if (repurchase_types == 'ONE_TIME_REPURCHASE') {
// 回购价款总额 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价 + 手续费 + 资金占用费
// sum_overdue_amount+ccr_due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价
// // 逾期罚息(调整后)
// record.getField('payment_frequency_n').setRequired(false);
// record.getField('payment_frequency').setRequired(false);
// record.getField('payment_period').setRequired(false);
// record.getField('payment_frequency_n').setReadOnly(true);
record.getField('payment_period').setReadOnly(true);
record.set('payment_period', 1);
// record.set('payment_frequency', 'MONTH');
if (name == 'ccr_due_amount') {
var due_amount = record.get('due_amount') || 0;
if (due_amount < value) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息必须小于等于逾期罚息!');
setTimeout(function () {
record.set('ccr_due_amount', 0);
}, 5);
return;
}
if (value <= 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息金额格式不正确!');
setTimeout(function () {
record.set('ccr_due_amount', 0);
}, 5);
return;
}
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, value || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 手续费
if (name == 'repurchase_service_charges') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, value || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 资金占用费value
if (name == 'fund_possession_cost') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), value || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 分期回购
} else if (repurchase_types == 'STAGE_REPURCHASE') {
//record.set('payment_period', '');
// record.getField('payment_frequency_n').setRequired(true);
// record.getField('payment_frequency').setRequired(true);
// record.getField('payment_period').setRequired(true);
record.getField('payment_period').setReadOnly(false);
// record.getField('payment_frequency_n').setReadOnly(false);
// record.getField('payment_frequency').setReadOnly(true);
// 回购价款总额 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价 + 手续费 + 资金占用费
// sum_overdue_amount+ccr_due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价
// 逾期罚息(调整后)
// if (name == 'payment_period') {
// if (value <= 1 || value == NaN || value == undefined) {
// Leaf.showMessage('${l:HLS.PROMPT}', '支付期数请填写大于1的整数!');
// return;
// }
// }
if (name == 'ccr_due_amount') {
var due_amount = record.get('due_amount') || 0;
if (due_amount < value) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息必须小于等于逾期罚息!');
setTimeout(function () {
record.set('ccr_due_amount', 0);
}, 5);
return;
}
if (value <= 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的罚息金额格式不正确!');
setTimeout(function () {
record.set('ccr_due_amount', 0);
}, 5);
return;
}
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'due_amount' && value) {
var due_amount = record.get('due_amount') || 0;
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, value || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 手续费
if (name == 'repurchase_service_charges') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, value || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
// 资金占用费value
if (name == 'fund_possession_cost') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), value || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'sum_overdue_amount') {
var repurchase_count_amount = plus(plus(plus(value || 0, record.get('due_amount') || 0), record.get('sum_unreceived_principal') || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'sum_unreceived_principal') {
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('due_amount') || 0), value || 0)
, record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), record.get('fund_possession_cost') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
if (name == 'repurchase_date' && value) {
debugger;
Leaf.request({
url: $('con_repo001_calc_repo_date_amount_link').getUrl(),
para: {
contract_id: record.get('contract_id'),
repurchase_date: value
},
success: function (res) {
record.set('last_rent_due_date', res.result.last_rent_due_date);
record.set('sum_received_rent_amount', res.result.sum_received_rent_amount || 0);
record.set('sum_unreceived_rent_amount', res.result.sum_unreceived_rent_amount || 0);
record.set('sum_overdue_amount', res.result.sum_overdue_amount || 0);
record.set('sum_unreceived_principal', res.result.sum_unreceived_principal || 0);
record.set('due_amount', res.result.due_amount || 0);
record.set('ccr_due_amount', res.result.due_amount || 0);
record.set('fund_possession_cost', res.result.fund_possession_cost || 0);
},
failure: function () {
record.set('last_rent_due_date', '');
record.set('repurchase_date', '');
record.set('sum_received_rent_amount', '');
record.set('sum_unreceived_rent_amount', '');
record.set('sum_overdue_amount', '');
record.set('sum_unreceived_principal', '');
record.set('due_amount', '');
record.set('ccr_due_amount', '');
record.set('fund_possession_cost', 0);
},
error: function () {
record.set('repurchase_date', '');
record.set('last_rent_due_date', '');
record.set('sum_received_rent_amount', '');
record.set('sum_unreceived_rent_amount', '');
record.set('sum_overdue_amount', '');
record.set('sum_unreceived_principal', '');
record.set('due_amount', '');
record.set('ccr_due_amount', '');
record.set('fund_possession_cost', 0);
},
scope: this
});
}
}
}
};
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract');
var req_record = $(req_ds_id).getAt(0);
var case_type = '';
var document_type = '${/parameter/@document_type}';
var calc_session_id = req_record.get('calc_session_id');
var ref_v07=req_record.get('ref_v07');
if (req_record.dirty == true) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if (ref_v07!=='Y') {
Leaf.showMessage('${l:HLS.PROMPT}', '请先成功计算报价!');
return;
}
if ($(req_ds_id).validate($('${/parameter/@layout_code}_submit_approval').enable())) {
con_repo001_submit();
} else {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
};
function con_repo001_submit() {
var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract');
var req_record = $(req_ds_id).getAt(0);
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('con_repo_submit_link').getUrl(),
para: {
change_req_id:' ${/parameter/@change_req_id}',
layout_code: '${/parameter/@layout_code}'
},
success: function(res) {
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
$('${/parameter/@winid}').close();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
//报价计算
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
debugger;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id_head = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'con_contract');
var cashflow_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
var record = $(ds_id_head).getCurrentRecord();
var price_list = record.get('price_list');
var calc_session_id = record.get('calc_session_id');
var parent_pk_value = record.get('contract_id');
var calc_type = '${/parameter/@calc_type}' || 'CLASSIC_CALCULATOR';
if (record.dirty == true) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if($(ds_id_head).validate()){
if(record.get('repurchase_types') == 'ONE_TIME_REPURCHASE'){
Leaf.request({
url: $('con_repo001_calc_cashflow_link').getUrl(),
para: {
contract_id: record.get('contract_id'),
},
success: function(res) {
calc_flag = true;
Leaf.SideBar.enable = true;
Leaf.SideBar.show({msg: '计算成功!',duration: 2000});
var ca_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_QUOTATION_04', 'con_contract_cashflow');
if (ca_ds_id) {
$(ca_ds_id).query();
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_user_button1').enable();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_user_button1').enable();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_user_button1').enable();
},
scope: this
});
}else {
Leaf.request({
url: $('con_update_record_link1_id').getUrl(),
para: {
'contract_id': record.get('contract_id')
},
success: function(res) {
debugger;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
if (calc_session_id) {
//直接进入报价页面
var win = new Leaf.Window({
id: 'hls_fin_calc_quotation_update_link_winid',
params: {
document_id: parent_pk_value,
price_list: price_list,
document_category: 'CONTRACT',
contract_status:record.get('contract_status'),
maintain_type: 'MODIFY',
calc_session_id: record.get('calc_session_id'),
quotation_id: record.get('quotation_id'),
dsId: cashflow_ds_id,
winId: 'hls_fin_calc_quotation_update_link_winid',
global_flag: 'Y',
id_num: 1,
calc_type: calc_type,
recreate_H_formula: 'N',
recreate_L_formula: 'N'
},
url: $('${/parameter/@layout_code}${/parameter/@tree_code}_hls_fin_calculator_update_link_id').getUrl(),
fullScreen: true,
draggable: true
});
win.on('close', function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
if(cashflow_ds_id&&ds_id_head){
$(cashflow_ds_id).query();
$(ds_id_head).query();}
});
}
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
}else{
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
};
//取消变更
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
// $('${/parameter/@layout_code}_user_button3').disable(); //按钮不可用
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消变更?', function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('con_repo001_cancel_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id}
},
success: function(res) {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function() {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
});
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, qpara, bp_seq) {
};
//图片渲染
window['${/parameter/@bp_seq}${/parameter/@layout_code}_dynamic_pic_renderer'] = function(record, name, bp_seq) {
var result = name.match(/(.*)_pic$/);
if (result) {
var pic_value = record.get(result[1]);
if (pic_value == 'OUTFLOW') {
return '<img src="${/request/@context_path}/images/outflow.png" style="margin-top:4px"/>';
} else if (pic_value == 'INFLOW') {
return '<img src="${/request/@context_path}/images/inflow.png" style="margin-top:4px"/>';
} else if (pic_value == 'NONCASH') {
return '<img src="${/request/@context_path}/images/noncash.png" style="margin-top:4px"/>';
} else if (pic_value == 'CASH') {
return '<img src="${/request/@context_path}/images/cash.png" style="margin-top:4px"/>';
}
}
};
//查询时调用(grid,table,gridBox)
/* window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
var ds_us_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_03', 'hls_document_use_seal');
if (ds == $(ds_us_id)) {
ds.setQueryParameter('document_table','CON_CONTRACT_CHANGE_REQ');
ds.setQueryParameter('change_req_id','${/parameter/@change_req_id}');
ds.query();
}
};*/
//add by lijingjing
function con_repo001_upload_file(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('check_id')) {
var url;
if (query_only == 'Y' || '${/parameter/@function_usage}' == 'QUERY') {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
} else {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'prj500_cdd_uploadFile_screen_id',
width: 850,
height: 400
});
win.on('close', function () {
record.ds.query();
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
}
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
var link_function = '';
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment') {
link_function = 'con_repo001_upload_file';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'attach_file_name') {
if (value != null ) {
var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var str = value.split(';;');
var url = '';
for (var i = 0;i < str.length;i++) {
//
var temp = str[i].split('--');
if (!Leaf.isEmpty(temp[0])) {
var file_name = temp[0].toUpperCase();
var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase();
// if (file_name.indexOf('.PDF') >= 0) {
// url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ',';
// } //else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
if (file_name.indexOf('.BMP') >= 0 || file_name.indexOf('.JPG') >= 0 || file_name.indexOf('.JPEG') >= 0 || file_name.indexOf('.PNG') >= 0 || file_name.indexOf('.GIF') >= 0) {
url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ',';
} else {
url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
}
}
}
return url;
}
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
......@@ -39,6 +39,7 @@
<a:link id="hls_fin_calc_single_variable_calc_link_id" model="hls.HLS500.hls_fin_calc_single_variable_calc" modelaction="update"/>
<!--<a:link id="hls_fin_calc_single_variable_manual_link_id" model="cont.CON_REPO001.con_change_calc_single_variable_calc" modelaction="execute"/>-->
<a:link id="hls_fin_calc_single_variable_manual_link_id" model="cont.CON_REPO001.con_change_calc_single_variable_calc" modelaction="execute"/>
<a:link id="con_check_con_record_link_id" model="hls.HLS500N.check_con_record" modelaction="execute"/>
<style><![CDATA[
.finGrid td[dataindex=percent]{
border-right-color:#FFF;
......@@ -334,7 +335,9 @@
var field = record.getField(name),
ds = $('hls_fin_calculator_hd_ds'),
input_mode = record.get('input_mode');
set_field_input_mode(record, field, name, input_mode);
//modify 报价头全部置为只读
//set_field_input_mode(record, field, name, input_mode);
field.setReadOnly(true);
special_editor_function(ds, record, name);
if (record.get('alignment')) {
Ext.each($('hls_fin_calculator_hd_grid_id').columns, function(c) {
......@@ -554,6 +557,15 @@
if (Ext.isEmpty(ln_calc_orign_value[name])) {
ln_calc_orign_value[name] = old_value;
}
if(name=='principal_eq_pymt_adj'&&value){
if(value*1<0){
Leaf.showMessage('${l:PROMPT}', '调整租金不能小于零!');
setTimeout(function () {
record.set(name, null);
}, 5);
return false;
}
}
var formula_record = $('ln_formula_ds').find('calc_line_id', record.get('calc_line_id'));
if (formula_record) {
if (Ext.isEmpty(ln_calc_formula_orign_value[name])) {
......@@ -707,21 +719,13 @@
}
onEditor_load_fire(ds, each_record, each_record.get('column_name'), value, null);
}
function onEditorHdload(ds) {
debugger;
var headRecords = ds.getAll();
for (var i = 0;i < headRecords.length;i++) {
headRecords[i].set('input_mode','READONLY');
headRecords[i].set('readonly_input_mode','TRUE');
headRecords[i].getField('column_value').setReadOnly(true);
headRecords[i].getField('column_value_c').setReadOnly(true);
}
if (headRecords[0].get('show_column_code') == 'N') {
if (headRecords.length>0&&headRecords[0].get('show_column_code') == 'N') {
$('hls_fin_calculator_hd_grid_id').hideColumn('column_code');
$('hls_fin_calculator_export_grid_id').hideColumn('column_code');
} else {
}else {
var hd_formula_record = $('hd_formula_ds').getAt(0);
for (var i = 0;i < headRecords.length;i++) {
var column_name = headRecords[i].get('column_name');
......@@ -1015,6 +1019,11 @@
Ext.fly('hls_fin_calculator_export_grid_id_wrap').setStyle({
display: 'none'
});
if('${/parameter/@document_category}' == 'PROJECT' || '${/parameter/@document_category}' == 'CONTRACT' ){
Ext.fly('hls_hls500_user_button3_col_id').setStyle({
display: 'none'
});
}
});
function hls_hls500_import() {
......@@ -1116,7 +1125,7 @@
}
//不均等
function hls_hls500_NJD() {
debugger;
hls_hls500_save_new(calc_execute_NJD_new, 'CALC');
......@@ -1201,6 +1210,7 @@ debugger;
get_warning_message();
if('${/parameter/@document_category}'=='CONTRACT'){
$('CON_BUYBACK_02_G_QUOTATION_04_con_contract_cashflow_ds').query();
$('CON_BUYBACK_02_F_BASE_01_con_contract_ds').query();
}
open_after_save_execute();
},
......@@ -1254,7 +1264,7 @@ debugger;
});
}
function calc_execute_NJD_new(source_procedure) {
debugger;
var final_recreate_H_formula, final_recreate_L_formula;
if (source_procedure == 'RE_CALC') {
final_recreate_H_formula = 'Y';
......@@ -1291,6 +1301,9 @@ debugger;
});
}
function hls_hls500_3JD() {
}
]]></script>
<a:dataSets>
......@@ -1341,7 +1354,7 @@ debugger;
<a:field name="column_value_c"/>
</a:fields>
<a:events>
<a:event name="update" handler="do_hls500_head_update"/>
<!-- <a:event name="update" handler="do_hls500_head_update"/>-->
<a:event name="load" handler="onEditorHdload"/>
</a:events>
</a:dataSet>
......@@ -1349,7 +1362,7 @@ debugger;
<a:events>
<a:event name="load" handler="do_hls500_line_load"/>
<a:event name="update" handler="do_hls500_line_update"/>
<a:event name="remove" handler="do_hls500_line_remove"/>
<!-- <a:event name="remove" handler="do_hls500_line_remove"/>-->
</a:events>
</a:dataSet>
<a:dataSet id="hls_fin_calculator_export_ds" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/hls.HLS500.hls_fin_calculator_export/query?calc_session_id=${/parameter/@calc_session_id}"/>
......@@ -1368,26 +1381,26 @@ debugger;
<a:column name="column_value" autoAdjust="false" editorFunction="parameter_function" prompt="HLS500.PROMPT_VALUE" renderer="seedetail_column_hd" showtitle="${/model/calc_config_hd_path/record/@sys_grid_show_title}" width="110"/>
<a:column name="percent" autoAdjust="false" width="19"/>
</a:columns>
<a:editors>
<a:numberField id="hls500_hd_numberfield_id"/>
<a:lov id="hls500_hd_lov_id">
<a:events>
<a:event name="beforecommit" handler="on_object_hd_calc_beforecommit"/>
<a:event name="focus" handler="on_object_hd_calc_focus"/>
</a:events>
</a:lov>
<a:textField id="hls500_hd_textfield_id"/>
<a:datePicker id="hls500_hd_datepicker_id"/>
<a:checkBox id="hls500_hd_checkbox_id"/>
<a:comboBox id="hls500_hd_combobox_id">
<a:events>
<a:event name="focus" handler="on_object_hd_calc_focus"/>
</a:events>
</a:comboBox>
</a:editors>
<a:events>
<a:event name="cellclick" handler="hls500_hd_cellcick"/>
</a:events>
<!-- <a:editors>-->
<!-- <a:numberField id="hls500_hd_numberfield_id"/>-->
<!-- <a:lov id="hls500_hd_lov_id">-->
<!-- <a:events>-->
<!-- <a:event name="beforecommit" handler="on_object_hd_calc_beforecommit"/>-->
<!-- <a:event name="focus" handler="on_object_hd_calc_focus"/>-->
<!-- </a:events>-->
<!-- </a:lov>-->
<!-- <a:textField id="hls500_hd_textfield_id"/>-->
<!-- <a:datePicker id="hls500_hd_datepicker_id"/>-->
<!-- <a:checkBox id="hls500_hd_checkbox_id"/>-->
<!-- <a:comboBox id="hls500_hd_combobox_id">-->
<!-- <a:events>-->
<!-- <a:event name="focus" handler="on_object_hd_calc_focus"/>-->
<!-- </a:events>-->
<!-- </a:comboBox>-->
<!-- </a:editors>-->
<!-- <a:events>-->
<!-- <a:event name="cellclick" handler="hls500_hd_cellcick"/>-->
<!-- </a:events>-->
</a:grid>
<a:grid id="hls_fin_calculator_ln_grid_id" bindTarget="hls_fin_calculator_ln_ds" marginHeight="140" marginWidth="${/model/calc_config_hd_path/record/@grid_margin_width}">
<a:columns>
......@@ -1411,6 +1424,7 @@ debugger;
</a:grid>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
debugger;
var records=$('line_field_ds').getAll();
if(records.length){
for(var i=0;i<records.length;i++){
......@@ -1421,6 +1435,16 @@ debugger;
}
}
}
var hd_records=$('hls_fin_calculator_hd_ds').getAll();
var hd1_records=$('hd_formula_ds').getAll();
for (var i = 0;i < hd_records.length;i++) {
//headRecords[i].set('input_mode','READONLY');
//headRecords[i].set('readonly_input_mode','TRUE');
headRecords[i].getField('column_value').setReadOnly(true);
headRecords[i].getField('column_code').setReadOnly(true);
headRecords[i].getField('column_value_c').setReadOnly(true);
}
});
]]></script>
</a:hBox>
......@@ -1532,6 +1556,11 @@ debugger;
<a:gridButton id="hls_hls500_user_button2_col_id" click="hls_hls500_NJD" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="USER_BUTTON3">
<c:process-config>
<a:gridButton id="hls_hls500_user_button3_col_id" click="hls_hls500_3JD" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="*">
<c:process-config>
<a:gridButton id="hls500_${@button_code}" click="hls500_define_button" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
......
......@@ -594,7 +594,6 @@
}
}
}
function csh_advance_edit_function(record, name) {
if ('${/parameter/@readOnly}' == 'Y') {
return;
......@@ -651,6 +650,17 @@
Leaf.showInfoMessage('提示', '请先分配核销金额再进行提交操作');
return;
}
// 以旧换新与三方协议合同的首付款不可进行电汇核销
var cf_item_2_count=0;
for (var i = 0; i < interfaceRs.length; i++) {
if ((interfaceRs[i].get('payment_deduction')=='TRADE_IN'||interfaceRs[i].get('payment_deduction')=='TRI_AGREEMENT')&&interfaceRs[i].get('write_off_cf_item')=='2') {
cf_item_2_count = plus(cf_item_2_count,1);
}
}
if (cf_item_2_count>0) {
Leaf.showInfoMessage('提示', ' 首付款抵扣为“无”以外的合同,不可进行首付款电汇核销!');
return;
}
Leaf.showConfirm('提示', '确认提交复核吗', function () {
$('csh531n_write_off_submit_btn_id').disable();
......@@ -772,6 +782,7 @@
<a:map from="bp_id_tenant" to="write_off_bp_id"/>
<a:map from="bp_id_tenant_name" to="write_off_bp_name"/>
<a:map from="contract_status_desc" to="contract_status_desc"/>
<a:map from="payment_deduction" to="payment_deduction"/>
</a:mapping>
</a:field>
<a:field name="batch_id" defaultValue="${/parameter/@batch_id}"/>
......@@ -780,6 +791,7 @@
displayField="code_value_name" options="write_off_type_ds" returnField="write_off_type"
valueField="code_value"/>
<a:field name="write_off_bp_id"/>
<a:field name="payment_deduction"/>
<a:field name="write_off_classification_desc" prompt="核销分类"
options="ds_csh_write_off_classification_ds" returnField="write_off_classification"
valueField="code_value" displayField="code_value_name"/>
......
......@@ -36,6 +36,7 @@
rec.set('write_off_principal', record.get('unreceived_principal'));
rec.set('write_off_interest', record.get('unreceived_interest'));
rec.set('unreceived_amount', record.get('unreceived_amount'));
rec.set('payment_deduction', con_rec.get('payment_deduction'));
$('${/parameter/@lovid}').win.close();
}
......@@ -70,6 +71,7 @@
rec.set('unreceived_amount', cf_recs[0].get('unreceived_amount'));
rec.set('write_off_date',new Date().format('yyyy-mm-dd'));
rec.set('journal_date',new Date().format('yyyy-mm-dd'));
rec.set('payment_deduction', con_rec.get('payment_deduction'));
// rec.set('write_off_amount', cf_recs[0].get('unreceived_amount'));
for (var i = 1; i < cf_recs.length; i++) {
......
......@@ -385,7 +385,7 @@
return t2;
}
function onEditorupdate(ds, record, name, value, old_value, fromLoad) {
debugger;
if (record.get('lov_return_vcode') == 'N' && (record.get('validation_type') == 'COMBOBOX' || record.get('validation_type') == 'LOV') && name == 'column_value') {
return;
}
......
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