Commit 6a1b4509 authored by Spencer Chang's avatar Spencer Chang

[fix] 承租人变更信息调整使用合同表字段

parent cf4edef5
......@@ -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)
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;
/
commit;
......
......@@ -29,11 +29,18 @@ create or replace package body cus_con_change_req_wfl_pkg is
v_bp_name varchar2(300);
v_workflow_desc varchar2(2000);
begin
--承租人已改变,此时con_contract_bp并没有新的承租人信息,会返回no_data_found例外
if p_layout_code = 'CON_TENANT_CHANGE_MODIFY' then
select lv.bp_name
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
set t.req_status = 'APPROVING',
t.submit_date = sysdate,
......
......@@ -3,7 +3,12 @@
-- Author : Spencer 3893
-- Created : 9/10/2019 2:21:13 PM
-- 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 回购申请
procedure create_change_req_repo(p_contract_id in number,
p_req_type in varchar2,
......@@ -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,
p_user_id => p_user_id);
select approval_method
into v_approval_method
from hls_document_type
where document_category = r_change_req_rec.document_category
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,
cus_con_change_req_wfl_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
when e_attachment_error then
......
......@@ -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,
p_user_id => p_user_id);
select approval_method
into v_approval_method
from hls_document_type
where document_category = r_change_req_rec.document_category
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 cus_con_et_pkg;
/
......@@ -57,3 +57,7 @@ is '是否展期';
alter table CON_CONTRACT add deflation_flag varchar2(1);
comment on column CON_CONTRACT.deflation_flag
is '是否缩期';
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,
FROM con_contract_lease_item cli
WHERE cli.contract_id = t1.contract_id
AND cli.equipment_type = 'MAIN') machine_number, --机号 --end
t1.ccr_leasse_rental,
t1.ccr_leasse_interest,
t1.ccr_leasse_principal,
t1.ccr_leasse_penalty,
t1.ccr_lease_rental,
t1.ccr_lease_interest,
t1.ccr_lease_principal,
t1.ccr_lease_penalty,
t1.ccr_reason,
t1.ccr_opinion,
nvl(t1.hd_user_col_v04, 'DELAY') hd_user_col_v04, --冬雨季延期方式
......@@ -295,7 +295,8 @@ SELECT t1.contract_id,
and v.code='PAY_METHODS') PAY_METHOD_N, --现支付方式
t1.BANK_BRANCH_NAME , --现扣款银行
t1.BANK_ACCOUNT_NAME , --现扣款账户名
t1.BANK_BRANCH_NUM --现扣款账号
t1.BANK_BRANCH_NUM, --现扣款账号
t1.ccr_lease_date
--回款賬戶變更 end
FROM con_contract t1
;
......@@ -56,6 +56,7 @@ select t.change_req_id,
cc.contract_name,
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,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,
nvl(t.et_ins_derate_amount,0) et_ins_derate_amount,
(select sum(cf.principal) - sum(nvl(cf.received_principal, 0))
......
......@@ -106,9 +106,8 @@
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) {
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 ('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY') {
// 承租人变更日計算應繳金額相關信息
......@@ -135,9 +134,6 @@
}
}
}
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('${/parameter/@layout_code}' == 'CON_ACCOUNT_CHANGE_MODIFY'){
if(name == 'BANK_BRANCH_NUM'){
......@@ -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 @@
}
if (record.get('ccr_document_type') == 'CUT_CHAG') {
param['function_code'] = 'CON733CF';
param['url_title'] = '变更申请-合同回款账户变更';
param['url_title'] = '变更申请-合同租金计划变更';
} else if (record.get('ccr_document_type') == 'LEASE_CHAG') {
param['function_code'] = 'CON733BPT';
param['url_title'] = '变更申请-合同回款账户变更';
param['url_title'] = '变更申请-合同承租人变更';
} else if (record.get('ccr_document_type') == 'ACC_CHAG') {
param['function_code'] = 'CON733BPB';
param['url_title'] = '变更申请-合同回款账户变更';
......
......@@ -6,7 +6,7 @@
<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"/>
<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_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"/>
......
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