Commit f9996267 authored by 18083's avatar 18083

提前结清、解约回购保证金抵扣

parent 98411324
......@@ -31,6 +31,7 @@
p_fund_possession_rate=>${@fund_possession_rate},
p_last_rent_due_date=>${@last_rent_due_date},
p_residual_value=>${@residual_value},
p_deposit_deduction=>${@deposit_deduction},
p_user_id => ${/session/@user_id});
END;
]]>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select division from con_contract t1 #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:parameters>
<bm:parameter name="change_req_id" dataType="java.lang.Long" input="false" output="true" outputPath="@change_req_id"/>
......
......@@ -6,6 +6,8 @@
<a:init-procedure>
<a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" fetchAll="true" model="wx.WX100.sys_pilot_run_user" rootPath="pilot_run_user"/>
<a:model-query defaultWhereClause="t1.contract_id=${/parameter/@contract_id}" fetchAll="true" model="cont.CON_ET001.con_get_contract_status" rootPath="get_contract_status"/>
<a:model-query defaultWhereClause="t1.contract_id=${/parameter/@contract_id}" fetchAll="true" model="cont.CON_ET001.create_change_req" rootPath="get_contract_division"/>
</a:init-procedure>
<a:view>
<a:link id="con_contract_repo_detail_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
......@@ -56,34 +58,51 @@
if ('${/model/pilot_run_user/record/@pilot_run_flag}' != 'Y'){
$('${/parameter/@layout_code}_user_button4').hide();
}
//铁甲业务合同展示保证金字段 18083 2023/5/11
if('${/model/get_contract_division/record/@division}' !='70' && '${/model/get_contract_division/record/@division}' != ''){
if(document.getElementById("CON_ET_MODIFY_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_BALANCE")){
document.getElementById("CON_ET_MODIFY_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_BALANCE_prompt").style.display = "none";
document.getElementById("CON_ET_MODIFY_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_BALANCE").style.display = "none";
}
if(document.getElementById("CON_ET_MODIFY_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_DEDUCTION")){
document.getElementById("CON_ET_MODIFY_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_DEDUCTION_prompt").style.display = "none";
document.getElementById("CON_ET_MODIFY_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_DEDUCTION").style.display = "none";
}
}
});
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) {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract_change_req');
if (ds_id == ds.id && ds_id) {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract_change_req');
if (ds_id == ds.id && ds_id) {
if(record.get('bp_class') == 'NP'){
record.getField('signer_n').setReadOnly(true);
record.getField('signer_n').setRequired(false);
record.set('signer_n','');
}
if(record.get('division') == '70'){
record.getField('deposit_deduction').setRequired(true);
}
}
};
var clc_flag = 'N';
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_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract_change_req');
debugger;
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;
......@@ -101,12 +120,44 @@
}, 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));
record.set('et_total_amount',minus(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),record.get('deposit_deduction')||0));
}
//铁甲业务计算保证金抵扣金额 18083 2023/5/12
if('${/model/get_contract_division/record/@division}' =='70' && '${/model/get_contract_division/record/@division}' != ''){
if (name == 'deposit_deduction') {
var et_total_amount=record.get('et_total_amount')||0;
var deposit_balance = record.get('deposit_balance') || 0;
var old_deposit_balance=old_value||0;
if (deposit_balance < value) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的保证金抵扣金额必须小于等于保证金余额!');
setTimeout(function () {
record.set('deposit_balance', 0);
}, 5);
return;
}
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的保证金抵扣金额应大于等于0!');
setTimeout(function () {
record.set('deposit_deduction', 0);
}, 5);
return;
}
//调整后的保证金余额应小于支付总额
if (value > et_total_amount) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的保证金抵扣金额应小于支付总额!');
setTimeout(function () {
record.set('deposit_deduction', 0);
}, 5);
return;
}
record.set('et_total_amount', minus(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),record.get('ccr_penalty')||0),value));
}
}
if (name == 'termination_date'&&value) {
// 根据结清日计算结清相关金额字段
// 根据结清日计算结清相关金额字段
Leaf.request({
url: $('con_et001_calc_et_date_amount_link').getUrl(),
para: {
......@@ -118,11 +169,13 @@
/**提前结清利率**/
et_interest_rate: record.get('et_interest_rate'),
/**留购价**/
residual_value: record.get('ccr_residual_value') //update by xsh35973 20220613
residual_value: record.get('ccr_residual_value'), //update by xsh35973 20220613
/**保证金抵扣金额**/
deposit_deduction: record.get('deposit_deduction')||0 //update by 18083 2023/5/12
},
success: function (res) {
clc_flag = 'Y';
//record.set('et_fee', res.result.et_fee);
clc_flag = 'Y';
//record.set('et_fee', res.result.et_fee);
record.set('et_total_amount', res.result.et_total_amount);
record.set('et_due_amount', res.result.et_due_amount);
record.set('overdue_amount', res.result.overdue_amount||0);
......@@ -166,6 +219,7 @@
});
}
//add by xsh35973 添加修改调整后资源占用费提前结清租金跟随变动
//调整后资金占用费
if(name == 'fund_possession_cost'&& clc_flag =='N'){
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的资金占用费金额应大于等于0!');
......@@ -188,9 +242,10 @@
}, 5);
return;
}
var et_total_amount_result=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), record.get('ccr_penalty'));
var et_total_amount_result=minus(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), record.get('ccr_penalty')),record.get('deposit_deduction') || 0);
record.set('et_total_amount',et_total_amount_result);
}
//提前结清租金
if(name == 'et_due_amount'&& clc_flag =='N'){
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的提前结清租金金额应大于等于0!');
......@@ -199,10 +254,11 @@
}, 5);
return;
}
var et_total_amount_result=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), record.get('ccr_penalty'));
var et_total_amount_result=minus(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), record.get('ccr_penalty')),record.get('deposit_deduction') || 0);
record.set('et_total_amount',et_total_amount_result);
}
}
}
};
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
......
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