Commit d442a026 authored by Spencer Chang's avatar Spencer Chang

Merge branch 'feature/con_change_feature_v2' into develop

parents 970285cd 6a1b4509
...@@ -19,6 +19,9 @@ values ('CONTRACT', 'CON_CONTRACT_REPO_LV', 'VIEW', -1, sysdate, -1, sysdate); ...@@ -19,6 +19,9 @@ values ('CONTRACT', 'CON_CONTRACT_REPO_LV', 'VIEW', -1, sysdate, -1, sysdate);
insert into HLS_DOC_CATEGORY_DB_OBJECT (DOCUMENT_CATEGORY, OBJECT_NAME, OBJECT_TYPE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE) insert into HLS_DOC_CATEGORY_DB_OBJECT (DOCUMENT_CATEGORY, OBJECT_NAME, OBJECT_TYPE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE)
values ('CONTRACT', 'CON_CONTRACT_REPO_MODIFY_LV', 'VIEW', -1, sysdate, -1, sysdate); values ('CONTRACT', 'CON_CONTRACT_REPO_MODIFY_LV', 'VIEW', -1, sysdate, -1, sysdate);
insert into HLS_DOC_CATEGORY_DB_OBJECT (DOCUMENT_CATEGORY, OBJECT_NAME, OBJECT_TYPE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE)
values ('CONTRACT', 'CON_CONTRACT_CCR_Q_LV', 'VIEW', -1, sysdate, -1, sysdate);
end; end;
/ /
commit; commit;
......
...@@ -29,11 +29,18 @@ create or replace package body cus_con_change_req_wfl_pkg is ...@@ -29,11 +29,18 @@ create or replace package body cus_con_change_req_wfl_pkg is
v_bp_name varchar2(300); v_bp_name varchar2(300);
v_workflow_desc varchar2(2000); v_workflow_desc varchar2(2000);
begin begin
select lv.bp_name --承租人已改变,此时con_contract_bp并没有新的承租人信息,会返回no_data_found例外
into v_bp_name if p_layout_code = 'CON_TENANT_CHANGE_MODIFY' then
from con_contract_bp_tenant_lv lv select lv.bp_name
where lv.contract_id = p_change_con_rec.contract_id; into v_bp_name
from con_contract_bp_tenant_lv lv
where lv.contract_id = p_change_req_rec.contract_id;
else
select lv.bp_name
into v_bp_name
from con_contract_bp_tenant_lv lv
where lv.contract_id = p_change_con_rec.contract_id;
end if;
update con_contract_change_req t update con_contract_change_req t
set t.req_status = 'APPROVING', set t.req_status = 'APPROVING',
t.submit_date = sysdate, t.submit_date = sysdate,
......
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
-- Author : Spencer 3893 -- Author : Spencer 3893
-- Created : 9/10/2019 2:21:13 PM -- Created : 9/10/2019 2:21:13 PM
-- Purpose : 合同回购 -- Purpose : 合同回购
function get_contract_repo_number(p_document_type varchar2,
p_document_date date,
p_company_id number,
p_user_id number,
p_contract_id number default null)
return varchar2;
--add by Spencer 3893 20190911 回购申请 --add by Spencer 3893 20190911 回购申请
procedure create_change_req_repo(p_contract_id in number, procedure create_change_req_repo(p_contract_id in number,
p_req_type in varchar2, p_req_type in varchar2,
...@@ -751,28 +756,10 @@ create or replace package body cus_con_contract_repo_pkg is ...@@ -751,28 +756,10 @@ create or replace package body cus_con_contract_repo_pkg is
con_contract_history_pkg.calc_change_history(p_change_req_id => p_change_req_id, con_contract_history_pkg.calc_change_history(p_change_req_id => p_change_req_id,
p_user_id => p_user_id); p_user_id => p_user_id);
select approval_method cus_con_change_req_wfl_pkg.workflow_start(p_change_req_rec => r_change_req_rec,
into v_approval_method p_change_con_rec => r_change_con_rec,
from hls_document_type p_layout_code => p_layout_code,
where document_category = r_change_req_rec.document_category p_user_id => p_user_id);
and document_type = r_change_req_rec.document_type;
if v_approval_method = 'WORK_FLOW' then
con_contract_change_req_wf_pkg.workflow_start(p_change_req_rec => r_change_req_rec,
p_change_con_rec => r_change_con_rec,
p_layout_code => p_layout_code,
p_user_id => p_user_id);
else
update con_contract_change_req t
set t.req_status = 'APPROVING',
t.submit_date = sysdate,
last_updated_by = p_user_id,
last_update_date = sysdate
where t.change_req_id = p_change_req_id;
con_contract_change_req_pkg.change_req_confirm(p_change_req_id => p_change_req_id,
p_user_id => p_user_id);
end if;
exception exception
when e_attachment_error then when e_attachment_error then
......
...@@ -424,28 +424,10 @@ create or replace package body cus_con_et_pkg is ...@@ -424,28 +424,10 @@ create or replace package body cus_con_et_pkg is
con_contract_history_pkg.calc_change_history(p_change_req_id => p_change_req_id, con_contract_history_pkg.calc_change_history(p_change_req_id => p_change_req_id,
p_user_id => p_user_id); p_user_id => p_user_id);
select approval_method con_contract_change_req_wf_pkg.workflow_start(p_change_req_rec => r_change_req_rec,
into v_approval_method p_change_con_rec => r_change_con_rec,
from hls_document_type p_layout_code => p_layout_code,
where document_category = r_change_req_rec.document_category p_user_id => p_user_id);
and document_type = r_change_req_rec.document_type;
if v_approval_method = 'WORK_FLOW' then
con_contract_change_req_wf_pkg.workflow_start(p_change_req_rec => r_change_req_rec,
p_change_con_rec => r_change_con_rec,
p_layout_code => p_layout_code,
p_user_id => p_user_id);
else
update con_contract_change_req t
set t.req_status = 'APPROVING',
t.submit_date = sysdate,
last_updated_by = p_user_id,
last_update_date = sysdate
where t.change_req_id = p_change_req_id;
con_contract_change_req_pkg.change_req_confirm(p_change_req_id => p_change_req_id,
p_user_id => p_user_id);
end if;
end submit_change_req_et; end submit_change_req_et;
end cus_con_et_pkg; end cus_con_et_pkg;
/ /
...@@ -56,4 +56,8 @@ is '是否展期'; ...@@ -56,4 +56,8 @@ is '是否展期';
alter table CON_CONTRACT add deflation_flag varchar2(1); alter table CON_CONTRACT add deflation_flag varchar2(1);
comment on column CON_CONTRACT.deflation_flag comment on column CON_CONTRACT.deflation_flag
is '是否缩期'; is '是否缩期';
\ No newline at end of file
alter table CON_CONTRACT add ccr_lease_date date;
comment on column CON_CONTRACT.ccr_lease_date
is '承租人变更日';
\ No newline at end of file
...@@ -215,10 +215,10 @@ SELECT t1.contract_id, ...@@ -215,10 +215,10 @@ SELECT t1.contract_id,
FROM con_contract_lease_item cli FROM con_contract_lease_item cli
WHERE cli.contract_id = t1.contract_id WHERE cli.contract_id = t1.contract_id
AND cli.equipment_type = 'MAIN') machine_number, --机号 --end AND cli.equipment_type = 'MAIN') machine_number, --机号 --end
t1.ccr_leasse_rental, t1.ccr_lease_rental,
t1.ccr_leasse_interest, t1.ccr_lease_interest,
t1.ccr_leasse_principal, t1.ccr_lease_principal,
t1.ccr_leasse_penalty, t1.ccr_lease_penalty,
t1.ccr_reason, t1.ccr_reason,
t1.ccr_opinion, t1.ccr_opinion,
nvl(t1.hd_user_col_v04, 'DELAY') hd_user_col_v04, --冬雨季延期方式 nvl(t1.hd_user_col_v04, 'DELAY') hd_user_col_v04, --冬雨季延期方式
...@@ -295,7 +295,8 @@ SELECT t1.contract_id, ...@@ -295,7 +295,8 @@ SELECT t1.contract_id,
and v.code='PAY_METHODS') PAY_METHOD_N, --现支付方式 and v.code='PAY_METHODS') PAY_METHOD_N, --现支付方式
t1.BANK_BRANCH_NAME , --现扣款银行 t1.BANK_BRANCH_NAME , --现扣款银行
t1.BANK_ACCOUNT_NAME , --现扣款账户名 t1.BANK_ACCOUNT_NAME , --现扣款账户名
t1.BANK_BRANCH_NUM --现扣款账号 t1.BANK_BRANCH_NUM, --现扣款账号
t1.ccr_lease_date
--回款賬戶變更 end --回款賬戶變更 end
FROM con_contract t1 FROM con_contract t1
; ;
...@@ -56,6 +56,7 @@ select t.change_req_id, ...@@ -56,6 +56,7 @@ select t.change_req_id,
cc.contract_name, cc.contract_name,
cc.bp_id_tenant, cc.bp_id_tenant,
(select m.bp_name from hls_bp_master m where m.bp_id=cc.bp_id_tenant) as bp_id_tenant_n, (select m.bp_name from hls_bp_master m where m.bp_id=cc.bp_id_tenant) as bp_id_tenant_n,
(select m.bp_name from hls_bp_master m,con_contract cct where m.bp_id=cct.bp_id_tenant AND cct.contract_id=t.contract_id) as s_bp_id_tenant_n,
cc.inception_of_lease, cc.inception_of_lease,
nvl(t.et_ins_derate_amount,0) et_ins_derate_amount, nvl(t.et_ins_derate_amount,0) et_ins_derate_amount,
(select sum(cf.principal) - sum(nvl(cf.received_principal, 0)) (select sum(cf.principal) - sum(nvl(cf.received_principal, 0))
......
...@@ -106,38 +106,34 @@ ...@@ -106,38 +106,34 @@
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
var con_contract_change_req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_change_req');
if (ds.id == con_contract_change_req_ds_id) {
// 承租人变更
if ('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY') {
// 承租人变更日計算應繳金額相關信息
if(name == 'ccr_lease_date'){
Leaf.request({
url: $('calc_tenant_amount_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id},
ccr_lease_date: record.get('ccr_lease_date')
},
success: function(res) {
record.set('ccr_lease_rental', res.result.ccr_lease_rental);
record.set('ccr_lease_principal', res.result.ccr_lease_principal);
record.set('ccr_lease_interest', res.result.ccr_lease_interest);
record.set('ccr_lease_penalty', res.result.ccr_lease_penalty);
},
error: function() {
},
failure: function() {
},
sync: true,
scope: this
});
}
}
}
var ds_con_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_QUOTATION_01', 'con_contract'); var ds_con_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_QUOTATION_01', 'con_contract');
if (ds.id == ds_con_id) { if (ds.id == ds_con_id) {
// 承租人变更
if ('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY') {
// 承租人变更日計算應繳金額相關信息
if(name == 'ccr_lease_date'){
Leaf.request({
url: $('calc_tenant_amount_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id},
ccr_lease_date: record.get('ccr_lease_date')
},
success: function(res) {
record.set('ccr_lease_rental', res.result.ccr_lease_rental);
record.set('ccr_lease_principal', res.result.ccr_lease_principal);
record.set('ccr_lease_interest', res.result.ccr_lease_interest);
record.set('ccr_lease_penalty', res.result.ccr_lease_penalty);
},
error: function() {
},
failure: function() {
},
sync: true,
scope: this
});
}
}
// 回款賬戶變更 // 回款賬戶變更
if('${/parameter/@layout_code}' == 'CON_ACCOUNT_CHANGE_MODIFY'){ if('${/parameter/@layout_code}' == 'CON_ACCOUNT_CHANGE_MODIFY'){
if(name == 'BANK_BRANCH_NUM'){ if(name == 'BANK_BRANCH_NUM'){
...@@ -148,6 +144,26 @@ ...@@ -148,6 +144,26 @@
} }
} }
} }
// 租赁计划變更
if('${/parameter/@layout_code}' == 'CON_CHANGE_MODIFY'){debugger
var lease_times = record.get('lease_times')||0;
if(name == 'ccr_start_times'){
var ccr_outstanding_times = record.get('ccr_outstanding_times')||0;
var curr_times = minus(plus(value || 0,ccr_outstanding_times||0),1);
if(curr_times > lease_times){
record.set('extend_flag','Y');
record.set('deflation_flag','N');
}
}
if(name == 'ccr_outstanding_times'){
var ccr_start_times = record.get('ccr_start_times')||0;
var curr_times = minus(plus(value || 0,ccr_start_times||0),1);
if(curr_times < lease_times){
record.set('extend_flag','N');
record.set('deflation_flag','Y');
}
}
}
} }
}; };
......
...@@ -98,10 +98,10 @@ ...@@ -98,10 +98,10 @@
} }
if (record.get('ccr_document_type') == 'CUT_CHAG') { if (record.get('ccr_document_type') == 'CUT_CHAG') {
param['function_code'] = 'CON733CF'; param['function_code'] = 'CON733CF';
param['url_title'] = '变更申请-合同回款账户变更'; param['url_title'] = '变更申请-合同租金计划变更';
} else if (record.get('ccr_document_type') == 'LEASE_CHAG') { } else if (record.get('ccr_document_type') == 'LEASE_CHAG') {
param['function_code'] = 'CON733BPT'; param['function_code'] = 'CON733BPT';
param['url_title'] = '变更申请-合同回款账户变更'; param['url_title'] = '变更申请-合同承租人变更';
} else if (record.get('ccr_document_type') == 'ACC_CHAG') { } else if (record.get('ccr_document_type') == 'ACC_CHAG') {
param['function_code'] = 'CON733BPB'; param['function_code'] = 'CON733BPB';
param['url_title'] = '变更申请-合同回款账户变更'; param['url_title'] = '变更申请-合同回款账户变更';
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<a:init-procedure/> <a:init-procedure/>
<a:view> <a:view>
<a:link id="con_contract_repo_detail_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="con_contract_repo_detail_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="con_et002_submit_link" model="" modelaction="execute"/> <a:link id="con_et002_submit_link" model="cont.CON_ET001.submit_change_req" modelaction="execute"/>
<a:link id="con_et002_cancel_link" model="cont.CON731.cancel_change_req" modelaction="execute"/> <a:link id="con_et002_cancel_link" model="cont.CON731.cancel_change_req" modelaction="execute"/>
<a:link id="con_et001_calc_cashflow_link" model="cont.CON_ET001.calc_cashflow" modelaction="execute"/> <a:link id="con_et001_calc_cashflow_link" model="cont.CON_ET001.calc_cashflow" modelaction="execute"/>
<a:link id="con_et001_calc_et_date_amount_link" model="cont.CON_ET001.calc_et_date_amount" modelaction="execute"/> <a:link id="con_et001_calc_et_date_amount_link" model="cont.CON_ET001.calc_et_date_amount" modelaction="execute"/>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
function contractQueryScreen_reset() { function contractQueryScreen_reset() {
$('contractQueryScreen_paraDs').reset(); $('contractQueryScreen_paraDs').reset();
} }
function open_change_req(value,record,name){debugger function open_change_req(value,record,name){
if(name=='change_req_number'){ if(name=='change_req_number'){
var req_status = record.get('req_status'); var req_status = record.get('req_status');
var change_req_id = record.get('change_req_id'); var change_req_id = record.get('change_req_id');
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
} }
return value; return value;
} }
function open_change_req_detail(change_req_id,contract_id) {debugger function open_change_req_detail(change_req_id,contract_id) {
var param = {}; var param = {};
param['change_req_id'] = change_req_id; param['change_req_id'] = change_req_id;
param['contract_id'] = change_req_id; param['contract_id'] = change_req_id;
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
record.getField('payment_frequency_n').setReadOnly(true); record.getField('payment_frequency_n').setReadOnly(true);
record.getField('payment_period').setReadOnly(true); record.getField('payment_period').setReadOnly(true);
record.set('payment_period', 1); record.set('payment_period', 1);
record.set('payment_frequency', null);
record.set('payment_frequency_n', null);
} }
}; };
// window['${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK'] = function () { // window['${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK'] = function () {
...@@ -83,7 +85,8 @@ ...@@ -83,7 +85,8 @@
record.getField('payment_frequency_n').setReadOnly(true); record.getField('payment_frequency_n').setReadOnly(true);
record.getField('payment_period').setReadOnly(true); record.getField('payment_period').setReadOnly(true);
record.set('payment_period', 1); record.set('payment_period', 1);
record.set('payment_frequency', ''); record.set('payment_frequency', null);
record.set('payment_frequency_n', null);
if (name == 'ccr_due_amount') { if (name == 'ccr_due_amount') {
var due_amount = record.get('due_amount') || 0; var due_amount = record.get('due_amount') || 0;
if (due_amount < value) { if (due_amount < value) {
...@@ -122,7 +125,7 @@ ...@@ -122,7 +125,7 @@
// sum_overdue_amount+ccr_due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost // sum_overdue_amount+ccr_due_amount+sum_unreceived_principal+residual_value+repurchase_service_charges+fund_possession_cost
// 回购价款计算基数 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价 // 回购价款计算基数 = 逾期租金 + 逾期罚息(调整后)+ 剩余本金 + 留购价
// 逾期罚息(调整后) // 逾期罚息(调整后)
if(name == 'payment_period'){debugger if(name == 'payment_period'){
if(value <= 0 || value == NaN || value == undefined){ if(value <= 0 || value == NaN || value == undefined){
Leaf.showMessage('${l:HLS.PROMPT}', '支付期数请填写大于0的整数!'); Leaf.showMessage('${l:HLS.PROMPT}', '支付期数请填写大于0的整数!');
return; return;
...@@ -141,7 +144,7 @@ ...@@ -141,7 +144,7 @@
record.set('repurchase_count_amount', repurchase_count_amount); record.set('repurchase_count_amount', repurchase_count_amount);
} }
// 手续费 // 手续费
if (name == 'repurchase_service_charges') {debugger 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) 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);
...@@ -165,7 +168,7 @@ ...@@ -165,7 +168,7 @@
record.set('repurchase_tatal_amount', repurchase_tatal_amount); record.set('repurchase_tatal_amount', repurchase_tatal_amount);
record.set('repurchase_count_amount', repurchase_count_amount); record.set('repurchase_count_amount', repurchase_count_amount);
} }
if(name == 'sum_unreceived_principal'){debugger if(name == 'sum_unreceived_principal'){
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);
...@@ -180,7 +183,7 @@ ...@@ -180,7 +183,7 @@
contract_id: record.get('contract_id'), contract_id: record.get('contract_id'),
repurchase_date: value repurchase_date: value
}, },
success: function (res) {debugger success: function (res) {
record.set('last_rent_due_date', res.result.last_rent_due_date); record.set('last_rent_due_date', res.result.last_rent_due_date);
record.set('sum_received_rent_amount', res.result.sum_received_rent_amount); record.set('sum_received_rent_amount', res.result.sum_received_rent_amount);
record.set('sum_unreceived_rent_amount', res.result.sum_unreceived_rent_amount); record.set('sum_unreceived_rent_amount', res.result.sum_unreceived_rent_amount);
......
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