Commit 297b8620 authored by xsh241908's avatar xsh241908

[建机]解约回购提前结清解决方案

parent a9881dd8
......@@ -144,7 +144,7 @@
trunc(t2.due_date) < trunc(cc.CCR_LEASE_DATE))
--合同状态为解约回购中、解约回购完成的合同
or (cc.contract_status in ('REPUR', 'REPURING') and(
trunc(t2.due_date) < trunc(cc.REPURCHASE_DATE) or t2.je_transaction_code='CON_REPURCHASE' ) )
trunc(t2.due_date) < trunc(cc.REPURCHASE_DATE) or t2.je_transaction_code='CON_REPURCHASE') or (t2.document_type = 'REPUR_CHAG'and t2.write_off_flag = 'FULL' ) ) --update by xsh35973 添加解约回购提前结清完全核销数据
--合同状态为起租→开票对象:非深圳美鹏HCS小规模纳税人(自然人)→暂不开票→按季度展示未开票现金流
or
(cc.contract_status = 'INCEPT' and
......
......@@ -150,10 +150,25 @@
WHERE
t.bp_id_tenant = b.bp_id(+) AND
t.contract_status = 'INCEPT' AND
t.contract_status in ('INCEPT','REPURING') AND
t.data_class = 'NORMAL' AND
dt.document_type(+) = t.document_type
and (t.bp_id_agent_level1 = (select t.bp_id from sys_user s, exp_employees e, exp_employee_assigns a, exp_org_position pp,hls_bp_master t
where a.position_id = pp.position_id
and a.employee_id = e.employee_id
and s.employee_id = e.employee_id
and pp.unit_id = t.unit_id
and a.enabled_flag = 'Y'
and e.enabled_flag = 'Y'
and a.primary_position_flag = 'Y'
and pp.enabled_flag = 'Y'
and t.bp_type = 'AGENT'
and s.user_id = ${/session/@user_id}) or not exists (select 1
from sys_user_role_groups g, sys_role r
where g.role_id = r.role_id
and g.user_id = ${/session/@user_id}
and r.role_code in ('0018','0019')
and trunc(sysdate) <= nvl(g.end_date, trunc(sysdate))))
) t1 #WHERE_CLAUSE# #ORDER_BY_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
@Author: xsh 35973
@Date: 2022/6/13 13:59
@Revision: 1.0
@Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:fields>
<bm:field name="contract_status"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select contract_status from con_contract t1 #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
cus_con_et_pkg.check_cashflow_write_off(p_contract_id =>${@contract_id},
p_user_id =>${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
\ No newline at end of file
......@@ -108,7 +108,7 @@ end;
<bm:field name="unreceived_amount" expression="(select ca.due_amount - nvl(ca.received_amount,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="left_principal" expression="(select ca.principal - nvl(ca.received_principal,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="left_interest" expression="(select ca.interest - nvl(ca.received_interest,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="unreceived_penalty" expression="(select ca.due_amount - nvl(ca.received_amount,0) from con_contract_cashflow ca where ca.contract_id = t1.contract_id and ca.times = t1.write_off_times and cf_item = 9)" forInsert="false" forUpdate="false"/>
<bm:field name="unreceived_penalty" expression="(select ca.due_amount - nvl(ca.received_amount,0) from con_contract_cashflow ca where ca.contract_id = t1.contract_id and ca.times = t1.write_off_times and cf_item = 9 and cf_status = 'RELEASE')" forInsert="false" forUpdate="false"/>
<bm:field name="agent_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<bm:field name="agent_id_desc" expression="(select hbm.bp_name from hls_bp_master hbm where hbm.bp_id = t1.agent_id)" forUpdate="false" forInsert="false"/>
<bm:field name="write_off_classification" lookupField="write_off_classification_desc" lookupCode="DS_CSH_WRITE_OFF_CLASSIFICATION" databaseType="VARCHAR2" datatype="java.lang.String" />
......
......@@ -446,7 +446,40 @@
}
}
//add by xsh35973 调整后不为默认值高亮显示
//调整后逾期罚息
debugger;
var ds_id_req = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_change_req');
if (ds_id_req == ds.id && ds_id_req) {
if (record.get('ccr_penalty') != record.get('penalty')) {
var req_change_id_1 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_CCR_PENALTY');
var req_change_input_1 = req_change_id_1.getElementsByTagName('input');
req_change_input_1[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后资金占用费
if (record.get('fund_possession_cost') != record.get('ccr_fund_possession_cost')) {
var req_change_id_2 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_FUND_POSSESSION_COST');
var req_change_input_2 = req_change_id_2.getElementsByTagName('input');
req_change_input_2[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后提前结清手续费
var et_fee = record.get('et_fee');
if (et_fee != 500 && typeof (et_fee) != 'undefined') {
var req_change_id_3 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_ET_FEE');
var req_change_input_3 = req_change_id_3.getElementsByTagName('input');
req_change_input_3[0].style.setProperty('background-color', '#FF9965', 'important');
}
;
//调整后留购价
var residual_value = record.get('residual_value')
if (residual_value != 0 && typeof (residual_value) != 'undefined') {
var req_change_id_4 = document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_CHANGE_REQ_RESIDUAL_VALUE');
var req_change_input_4 = req_change_id_4.getElementsByTagName('input');
req_change_input_4[0].style.setProperty('background-color', '#FF9965', 'important');
};
}
};
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () {
......@@ -630,7 +663,7 @@
Leaf.request({
url: $('con731_cancel_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id}
change_req_id: '${/parameter/@change_req_id}'
},
success: function (res) {
// $('${/parameter/@layout_code}_user_button1').enable();
......
......@@ -5,6 +5,7 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<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:init-procedure>
<a:view>
<a:link id="con_contract_repo_detail_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
......@@ -146,7 +147,7 @@
/**提前结清利率**/
et_interest_rate: record.get('et_interest_rate'),
/**留购价**/
residual_value: record.get('residual_value')
residual_value: record.get('ccr_residual_value') //update by xsh35973 20220613
},
success: function (res) {
//record.set('et_fee', res.result.et_fee);
......@@ -158,6 +159,7 @@
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('ccr_fund_possession_cost', res.result.fund_possession_cost); //add by xsh35973 20220610
record.set('fund_possession_rate', res.result.fund_possession_rate);
record.set('last_rent_due_date', res.result.last_rent_due_date);
record.set('sum_unreceived_principal', res.result.sum_unreceived_principal);
......@@ -191,7 +193,43 @@
scope: this
});
}
//add by xsh35973 添加修改调整后资源占用费提前结清租金跟随变动
if(name == 'fund_possession_cost'){
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的资金占用费金额应大于等于0!');
setTimeout(function () {
record.set('fund_possession_cost', 0);
}, 5);
return;
}
var sum_unreceived_principal = record.get('sum_unreceived_principal') || 0;
if(sum_unreceived_principal !=0) {
var et_due_amount_result = plus(sum_unreceived_principal, value);
record.set('et_due_amount', et_due_amount_result);
}
}
if(name == 'residual_value'){
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的留购金金额应大于等于0!');
setTimeout(function () {
record.set('residual_value', 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), record.get('ccr_penalty'));
record.set('et_total_amount',et_total_amount_result);
}
if(name == 'et_due_amount'){
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '调整后的提前结清租金金额应大于等于0!');
setTimeout(function () {
record.set('et_due_amount', 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), record.get('ccr_penalty'));
record.set('et_total_amount',et_total_amount_result);
}
}
};
......@@ -221,7 +259,28 @@
// $('${/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);
//解约回购合同增加提交审批前是否完全核销校验 add by xsh35973
if('${/model/get_contract_status/record/@contract_status}' =='REPURING'){
Leaf.request({
url: '${/request/@context_path}/autocrud/cont.CON_ET001.con_get_contract_status/execute',
para: {
contract_id: '${/parameter/@contract_id}'
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
con_repo001_submit();
},
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 {
con_repo001_submit();
};
} else {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
......@@ -243,7 +302,7 @@
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: ${/parameter/@change_req_id}
contract_id: '${/parameter/@change_req_id}'
},
scope: this,
success: function (res) {
......@@ -258,7 +317,7 @@
Leaf.request({
url: $('con_et002_submit_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id},
change_req_id: '${/parameter/@change_req_id}',
layout_code: '${/parameter/@layout_code}'
},
success: function(res) {
......@@ -310,7 +369,7 @@
Leaf.request({
url: $('con_et002_submit_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id},
change_req_id: '${/parameter/@change_req_id}',
layout_code: '${/parameter/@layout_code}'
},
success: function(res) {
......@@ -417,7 +476,7 @@
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: ${/parameter/@change_req_id}
contract_id: '${/parameter/@change_req_id}'
},
scope: this,
success: function (res) {
......@@ -429,7 +488,7 @@
Leaf.request({
url: $('con_et002_cancel_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id}
change_req_id: '${/parameter/@change_req_id}'
},
success: function(res) {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
......@@ -473,6 +532,11 @@
Leaf.showMessage('${l:PROMPT}', '只有新建状态的才能发起电子签约');
return;
}*/
//解约回购的合同发起提前结清时,不能发起电子签约 add by xsh35973
if('${/model/get_contract_status/record/@contract_status}' =='REPURING'){
Leaf.showMessage('${l:PROMPT}', '解约回购的合同发起提前结清时,不能发起电子签约');
return;
};
if(bussiness_type == 'LEASEBACK' && bp_tenant_class == 'NP'){
Leaf.showMessage('${l:PROMPT}', '业务类型为售后回租且是个人承租人的合同,不能发起电子签约');
return;
......
......@@ -29,8 +29,14 @@
var records = $('contractQueryScreen_mainDs').getSelected();
var record = records[0],
contract_id = record.get('contract_id');
var ccr_document_type;
Leaf.showConfirm('特别注意', '<span style="color: #ff0000; ">该操作将导致合同在回购期间无法进行后续操作,请谨慎操作!!!如果需要取消提前结清,请一定点击取消按钮!!!</span>', function () {
var ccr_document_type = 'ET_CHAG';
//新增解约回购提前结清单据类型addby xsh35973 20220615
if (record.get('contract_status')=='REPURING'){
ccr_document_type = 'REPUR_CHAG';
}else {
ccr_document_type = 'ET_CHAG';
};
Leaf.Masker.mask(Ext.getBody());
Leaf.request({
url: $('con_et_create_change_link').getUrl(),
......@@ -75,8 +81,14 @@
var records = $('contractQueryScreen_mainDs').getSelected();
var record = records[0],
contract_id = record.get('contract_id');
var ccr_document_type;
Leaf.showConfirm('提示', '<span style="color: #ff0000;font-size: 15px; ">该操作不会对合同还款计划产生变更,仅试算用途;若需提交提前结清申请,请点击主界面【创建】按钮!</span>', function () {
var ccr_document_type = 'ET_CHAG';
//新增解约回购提前结清单据类型addby xsh35973 20220615
if (record.get('contract_status')=='REPURING'){
ccr_document_type = 'REPUR_CHAG';
}else {
ccr_document_type = 'ET_CHAG';
};
Leaf.Masker.mask(Ext.getBody(), '正在创建试算,,,');
Leaf.request({
url: $('con_et_create_change_link').getUrl(),
......
......@@ -47,7 +47,13 @@
return false;
}
var record = records[0];
var ccr_document_type = 'ET';
//update by xsh35973 增加回购提前结清合同文本生成
var ccr_document_type;
if (record.get('contract_status') == 'REPURING'){
ccr_document_type = 'REPUR_CHAG'
}else{
ccr_document_type = 'ET';
};
//var req_status = record.get('req_status');
var contract_id = record.get('change_req_id');
......
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