Commit 1d96f9ba authored by 23459's avatar 23459

I-8072【建机】铁甲二手挖机开发--提前结清和解约回购保证金自动核销

parent 2b25b03d
...@@ -68,6 +68,15 @@ ...@@ -68,6 +68,15 @@
record.getField('signer_n').setRequired(false); record.getField('signer_n').setRequired(false);
record.set('signer_n',''); record.set('signer_n','');
} }
if(record.get('division')=='70'){
record.getField('deposit_deduct').setRequired(true);
}else {
debugger;
document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_DEDUCT_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_DEDUCT').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_LEFT_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_DEPOSIT_LEFT').style.display = 'none';
}
} }
}; };
...@@ -101,10 +110,24 @@ ...@@ -101,10 +110,24 @@
}, 5); }, 5);
return; 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)); var deposit_deduct =record.get('deposit_deduct')||0;
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), value);
record.set('et_total_amount',minus(et_total_amount_result,deposit_deduct));
} }
if(name == 'deposit_deduct'){
var ccr_penalty =record.get('ccr_penalty')||0;
var deposit_left=record.get('deposit_left')||0;
if (value >deposit_left || value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '保证金抵扣金额不能超过保证金余额!');
setTimeout(function () {
record.set('deposit_deduct',0);
}, 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), ccr_penalty);
record.set('et_total_amount',minus(et_total_amount_result,value));
}
if (name == 'termination_date' && value) { if (name == 'termination_date' && value) {
// 根据结清日计算结清相关金额字段 // 根据结清日计算结清相关金额字段
Leaf.request({ Leaf.request({
...@@ -125,7 +148,8 @@ ...@@ -125,7 +148,8 @@
}, },
success: function (res) { success: function (res) {
//record.set('et_fee', res.result.et_fee); //record.set('et_fee', res.result.et_fee);
record.set('et_total_amount', res.result.et_total_amount); var deposit_deduct =record.get('deposit_deduct')||0;
record.set('et_total_amount', minus(res.result.et_total_amount,deposit_deduct));
record.set('et_due_amount', res.result.et_due_amount); record.set('et_due_amount', res.result.et_due_amount);
record.set('overdue_amount', res.result.overdue_amount || 0); record.set('overdue_amount', res.result.overdue_amount || 0);
record.set('penalty', res.result.penalty || 0); record.set('penalty', res.result.penalty || 0);
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<a:link id="con_repo_submit_link" model="cont.CON_REPO001.submit_change_req" modelaction="execute"/> <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_cancel_link" model="cont.CON731.cancel_change_req" 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_one_time_cashflow_link" model="cont.CON_REPO001.calc_cashflow" modelaction="execute"/>
<a:link id="con_repo001_calc_division_tj_cashflow_link" model="cont.CON_REPO001.calc_cashflow_division_tj" 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="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" <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"/> url="${/request/@context_path}/modules/cont/CON_REPO001/hls_fin_calculator_update_n.lview"/>
...@@ -47,6 +48,16 @@ ...@@ -47,6 +48,16 @@
}; };
//新增和加载时调用form //新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
if (ds.id == ds_id) {
if(record.get('division')=='70'){
record.getField('deposit_deduct').setRequired(true);
}else{
document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_DEPOSIT_DEDUCT_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_DEPOSIT_DEDUCT').style.display = 'none';
}
}
if('${/parameter/@function_code}'=='CON_REPO001D') { if('${/parameter/@function_code}'=='CON_REPO001D') {
var repurchase_types = record.get('repurchase_types'); var repurchase_types = record.get('repurchase_types');
...@@ -230,7 +241,8 @@ ...@@ -230,7 +241,8 @@
, record.get('residual_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); 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); repurchase_tatal_amount=plus(repurchase_tatal_amount,value||0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, depoist_remaining_amount)); var deposit_deduct_tatol_amount=plus(depoist_remaining_amount,record.get('deposit_deduct') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, deposit_deduct_tatol_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount)); record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
} }
// 手续费 // 手续费
...@@ -238,7 +250,24 @@ ...@@ -238,7 +250,24 @@
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) 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); , record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, value || 0), record.get('fund_possession_cost') || 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)); var deposit_deduct_tatol_amount=plus(depoist_remaining_amount,record.get('deposit_deduct') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, deposit_deduct_tatol_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
}
//保证金抵扣金额
if(name =='deposit_deduct'&&value>=0){
if (value >deposit_left || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '保证金抵扣金额不能超过保证金余额!');
setTimeout(function () {
record.set('deposit_deduct',old_value);
}, 5);
return;
};
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), record.get('fund_possession_cost') || 0);
var deposit_deduct_tatol_amount=plus(depoist_remaining_amount,record.get('deposit_deduct') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, deposit_deduct_tatol_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount)); record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
} }
// 资金占用费value // 资金占用费value
...@@ -246,7 +275,8 @@ ...@@ -246,7 +275,8 @@
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) 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); , record.get('residual_value') || 0);
var repurchase_tatal_amount = plus(plus(repurchase_count_amount, record.get('repurchase_service_charges') || 0), 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)); var deposit_deduct_tatol_amount=plus(depoist_remaining_amount,record.get('deposit_deduct') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, deposit_deduct_tatol_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount)); record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
} }
//逾期租金 //逾期租金
...@@ -254,7 +284,8 @@ ...@@ -254,7 +284,8 @@
var repurchase_count_amount = plus(plus(plus(value || 0, record.get('ccr_due_amount') || 0), record.get('sum_unreceived_principal') || 0) 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); , 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); 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)); var deposit_deduct_tatol_amount=plus(depoist_remaining_amount,record.get('deposit_deduct') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, deposit_deduct_tatol_amount));
record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount)); record.set('repurchase_count_amount', minus(repurchase_tatal_amount, depoist_remaining_amount));
} }
//剩余本金 //剩余本金
...@@ -262,7 +293,8 @@ ...@@ -262,7 +293,8 @@
var repurchase_count_amount = plus(plus(plus(record.get('sum_overdue_amount') || 0, record.get('ccr_due_amount') || 0), value || 0) 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); , 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); 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)); var deposit_deduct_tatol_amount=plus(depoist_remaining_amount,record.get('deposit_deduct') || 0);
record.set('repurchase_tatal_amount', minus(repurchase_tatal_amount, deposit_deduct_tatol_amount));
record.set('repurchase_count_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) { if (name == 'repurchase_date' && value) {
...@@ -467,7 +499,23 @@ ...@@ -467,7 +499,23 @@
draggable: true draggable: true
}); });
win.on('close', function () { win.on('close', function () {
Leaf.request({
url: $('con_repo001_calc_division_tj_cashflow_link').getUrl(),
para: {
contract_id: record.get('contract_id'),
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
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'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
if(cashflow_ds_id&&ds_id_head){ if(cashflow_ds_id&&ds_id_head){
$(cashflow_ds_id).query(); $(cashflow_ds_id).query();
$(ds_id_head).query();} $(ds_id_head).query();}
......
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