Commit 3d4f1e6f authored by gzj34291's avatar gzj34291

违约金减免校验

parent 85b8a2f2
......@@ -38,7 +38,6 @@
$(ds_id2).setQueryParameter('copy_contract_id',record1.get('copy_contract_id'));
$(ds_id2).setQueryParameter('copy_contract_id',record1.get('copy_contract_id'));
$(ds_id2).query();
debugger
var records2 = $(ds_id2).getAll();
if (records2 && records2.length != 0) {
var param_list = [];
......@@ -226,31 +225,34 @@
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
if (value != old_value) {
if (update_falg != 'Y') {
if (name == 'reduce_amount_total') {
// record.set('reduce_amount_total',value>record.get('unreceived_overdue_amount') ?record.get('unreceived_overdue_amount'):value);
if(value>record.get('unreceived_overdue_amount')){
$L.showErrorMessage('提示','减免金额不能大于最大减免金额!');
// record.set('reduce_amount_total',record.get('unreceived_overdue_amount'));
// $(ds).getAt(0).set('reduce_amount_total','');
return;
}
// record.set('reduce_amount_total',value>record.get('unreceived_overdue_amount') ?record.get('unreceived_overdue_amount'):value);
if(value>record.get('unreceived_overdue_amount')){
$L.showErrorMessage('提示','减免金额不能大于最大减免金额!');
// record.set('reduce_amount_total',record.get('unreceived_overdue_amount'));
// $(ds).getAt(0).set('reduce_amount_total','');
return;
}
var ratio = parseFloat(Leaf.formatNumber(div(record.get('reduce_amount_total'), record.get('total_overdue_amount')), 4));
// update_falg = 'Y';
// update_falg = 'Y';
record.set('reduce_amount_total_ratio', ratio);
}
/* if (name == 'reduce_amount_total_ratio') {
var amount = parseFloat(mul(record.get('reduce_amount_total_ratio'), record.get('total_overdue_amount')), 2);
// update_falg = 'Y';
record.set('reduce_amount_total', amount);
/* if (name == 'reduce_amount_total_ratio') {
var amount = parseFloat(mul(record.get('reduce_amount_total_ratio'), record.get('total_overdue_amount')), 2);
// update_falg = 'Y';
record.set('reduce_amount_total', amount);
}*/
}*/
} else {
update_falg = 'N';
}
......@@ -268,9 +270,23 @@
return false;
}
}
var penalty_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_penalty_reduce');
var records_penalty = $(penalty_ds_id).getCurrentRecord();
var reduce_amount_total= records_penalty.get('reduce_amount_total');
var gld_received_amount= records_penalty.get('gld_received_amount');
var remaining_amount =minus(records_penalty.get('total_overdue_amount'), reduce_amount_total);
if(remaining_amount<gld_received_amount){
$L.showErrorMessage('提示','营业确认违约金需要大于等于会计确认的违约金!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
return true;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
//add by lihh 20210323
window['${/parameter/@layout_code}_con500_cdd_attachtment_upload'] = function(id, name, query_only) {
......
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