Commit 7f63fe50 authored by Spencer Chang's avatar Spencer Chang

[fix] 会计逾期金额默认营业数据,当会计没核销实际上和营业逾期一致

parent 4069b188
...@@ -218,6 +218,22 @@ create or replace package body cus_con_deposit_pkg is ...@@ -218,6 +218,22 @@ create or replace package body cus_con_deposit_pkg is
values v_deposit_calc_overdue_tmp_rec; values v_deposit_calc_overdue_tmp_rec;
end if; end if;
end if; end if;
--计算penalty
if p_contract_cashflow_rec.write_off_flag <> 'FULL' then
calc_penalty(p_cashflow_rec => p_contract_cashflow_rec,
p_contract_rec => p_contract_rec,
p_calc_date => p_calc_date,
p_total_penalty_amt => v_total_penalty_amt,
p_user_id => p_user_id);
--会计逾期金额默认营业数据,当会计没核销实际上和营业逾期一致
update CUS_DEPOSIT_CALC_OVERDUE_TMP
set OVERDUE_PENALTY_AMT = v_total_penalty_amt,
f_overdue_amount = overdue_amount,
f_overdue_penalty_amt = v_total_penalty_amt
where calc_id = v_deposit_calc_overdue_tmp_rec.calc_id;
end if;
--计算会计逾期数据,取会计核销的最大期与营业现金流数据比较 --计算会计逾期数据,取会计核销的最大期与营业现金流数据比较
for c_f in (select gwo.cf_item, for c_f in (select gwo.cf_item,
gwo.times, gwo.times,
...@@ -225,14 +241,14 @@ create or replace package body cus_con_deposit_pkg is ...@@ -225,14 +241,14 @@ create or replace package body cus_con_deposit_pkg is
gwo.penalty_calc_date gwo.penalty_calc_date
from GLD_WRITE_OFF gwo from GLD_WRITE_OFF gwo
where /*gwo.create_je_flag = 'Y' where /*gwo.create_je_flag = 'Y'
AND */ AND */
gwo.reversed_flag = 'N' gwo.reversed_flag = 'N'
and gwo.contract_id = p_contract_rec.contract_id and gwo.contract_id = p_contract_rec.contract_id
and gwo.times = and gwo.times =
(select max(gwo.times) max_times (select max(gwo.times) max_times
from GLD_WRITE_OFF gwo from GLD_WRITE_OFF gwo
where /*gwo.create_je_flag = 'Y' where /*gwo.create_je_flag = 'Y'
AND */ AND */
gwo.reversed_flag = 'N' gwo.reversed_flag = 'N'
and gwo.contract_id = p_contract_rec.contract_id) and gwo.contract_id = p_contract_rec.contract_id)
group by gwo.cf_item, gwo.times, gwo.penalty_calc_date) loop group by gwo.cf_item, gwo.times, gwo.penalty_calc_date) loop
...@@ -287,18 +303,6 @@ create or replace package body cus_con_deposit_pkg is ...@@ -287,18 +303,6 @@ create or replace package body cus_con_deposit_pkg is
and t.session_id = p_session_id; and t.session_id = p_session_id;
end if; end if;
end loop; end loop;
--计算penalty
if p_contract_cashflow_rec.write_off_flag <> 'FULL' then
calc_penalty(p_cashflow_rec => p_contract_cashflow_rec,
p_contract_rec => p_contract_rec,
p_calc_date => p_calc_date,
p_total_penalty_amt => v_total_penalty_amt,
p_user_id => p_user_id);
update CUS_DEPOSIT_CALC_OVERDUE_TMP
set OVERDUE_PENALTY_AMT = v_total_penalty_amt
where calc_id = v_deposit_calc_overdue_tmp_rec.calc_id;
end if;
end; end;
procedure overdue_dayend(p_contract_id number, procedure overdue_dayend(p_contract_id number,
......
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