Commit 86e988bc authored by Spencer Chang's avatar Spencer Chang

[feat] 新增保证金-代垫清单功能

parent eaf7429f
This diff is collapsed.
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool REGISTER_CUS_DEPOSIT120.log
set feedback off
set define off
begin
--页面注册
sys_function_assign_pkg.service_load('modules/cus_deposit/CUS_DEPOSIT120/cus_deposit_advance_list.lview','保证金-代垫清单',1,1,0);
sys_function_assign_pkg.service_load('modules/cus_deposit/CUS_DEPOSIT120/cus_deposit_advance_list.lview','保证金-代垫清单',1,1,0);
--功能定义
SYS_LOAD_SYS_FUNCTION_PKG.SYS_FUNCTION_LOAD('CUS_DEPOSIT120','保证金-代垫清单','保证金-代垫清单','120','','','modules/cus_deposit/CUS_DEPOSIT120/cus_deposit_advance_list.lview','ZHS',-1);
SYS_LOAD_SYS_FUNCTION_PKG.SYS_FUNCTION_LOAD('CUS_DEPOSIT120','保证金-代垫清单','保证金-代垫清单','120','','','modules/cus_deposit/CUS_DEPOSIT120/cus_deposit_advance_list.lview','US',-1);
--分配页面
sys_function_assign_pkg.func_service_load('CUS_DEPOSIT120','modules/cus_deposit/CUS_DEPOSIT120/cus_deposit_advance_list.lview');
--分配bm
sys_function_assign_pkg.func_bm_load('CUS_DEPOSIT120','cus_deposit.CUS_DEPOSIT120.cus_deposit_calc_overdue_list_query');
sys_function_assign_pkg.func_bm_load('CUS_DEPOSIT120','cus_deposit.CUS_DEPOSIT120.cus_deposit_calc_overdue_list');
sys_function_assign_pkg.func_bm_load('CUS_DEPOSIT120','basic.hls_bp_master_v_for_lov');
--分配菜单
sys_load_sys_function_grp_pkg.sys_function_group_item_load(p_function_group_code=>'DEPOSIT',p_function_code=>'CUS_DEPOSIT120',p_enabled_flag=>'Y',P_USER_ID=>-1);
end;
/
commit;
set feedback on
set define on
spool off
exit
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool CUS_DEPOSIT_CALC_OVERDUE_TMP_S.log
prompt
prompt Creating sequence CUS_DEPOSIT_CALC_OVERDUE_TMP_S
prompt ====================================
prompt
whenever sqlerror continue
drop sequence CUS_DEPOSIT_CALC_OVERDUE_TMP_S;
whenever sqlerror exit failure rollback
Create sequence CUS_DEPOSIT_CALC_OVERDUE_TMP_S;
spool off
exit
alter table CSH_TRANSACTION add (transfer_amount number);
comment on column CSH_TRANSACTION.transfer_amount is '已划转金额(hlcm保证金)';
alter table CSH_TRANSACTION add (offset_amount number);
comment on column CSH_TRANSACTION.offset_amount is '已冲抵金额(hlcm保证金)';
alter table CSH_TRANSACTION add (return_amount number);
comment on column CSH_TRANSACTION.return_amount is '已退款金额(hlcm保证金)';
alter table CSH_TRANSACTION add (deposit_balance number);
comment on column CSH_TRANSACTION.deposit_balance is '保证金余额(hlcm保证金)';
alter table CSH_TRANSACTION add (deposit_source_tran_id number);
comment on column CSH_TRANSACTION.deposit_source_tran_id is '保证金上级现金事务id(hlcm保证金)';
alter table CSH_WRITE_OFF add (operation_type number);
comment on column CSH_WRITE_OFF.operation_type is '操作类型:入账、划转、冲抵租金、冲抵违约金(hlcm保证金)';
\ No newline at end of file
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool CUS_DEPOSIT_CALC_OVERDUE_TMP.log
PROMPT
PROMPT CREATING TABLE CUS_DEPOSIT_CALC_OVERDUE_TMP
PROMPT ============================
PROMPT
WHENEVER SQLERROR CONTINUE
DROP TABLE CUS_DEPOSIT_CALC_OVERDUE_TMP;
WHENEVER SQLERROR EXIT FAILURE ROLLBACK
-- Create table
create table CUS_DEPOSIT_CALC_OVERDUE_TMP
(
calc_id NUMBER not null,
session_id NUMBER,
calc_date DATE,
due_date DATE,
contract_id NUMBER,
cashflow_id NUMBER,
f_overdue_amount NUMBER,
f_overdue_penalty_amt NUMBER,
overdue_principal NUMBER,
overdue_interest NUMBER,
overdue_amount NUMBER,
overdue_max_days NUMBER,
overdue_penalty_amt NUMBER,
created_by NUMBER,
creation_date DATE
);
-- Add comments to the table
comment on table CUS_DEPOSIT_CALC_OVERDUE_TMP
is '保证金代垫清单-罚息测算';
-- Add comments to the columns
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.calc_id
is 'PK';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.session_id
is 'session_id';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.calc_date
is '计算日';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.due_date
is '到期日';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.contract_id
is '合同id';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.cashflow_id
is '现金流id';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_principal
is '逾期本金';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_interest
is '逾期利息';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_amount
is '逾期租金';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_max_days
is '最大逾期天数';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_penalty_amt
is '逾期违约金';
-- Create/Recreate indexes
create index CUS_DEPT_CALC_OVERDUE_TMP_N1 on CUS_DEPOSIT_CALC_OVERDUE_TMP (SESSION_ID);
create index CUS_DEPT_CALC_OVERDUE_TMP_N2 on CUS_DEPOSIT_CALC_OVERDUE_TMP (CONTRACT_ID);
-- Create/Recreate primary, unique and foreign key constraints
alter table CUS_DEPOSIT_CALC_OVERDUE_TMP
add constraint CUS_DEPT_CALC_OVERDUE_TMP_PK primary key (CALC_ID);
/
SPOOL OFF
EXIT
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
cus_con_deposit_pkg.calc_overdue_dayend(p_calc_date => to_date(${@calc_overdue_date},'yyyy-mm-dd'),
p_session_id => ${/session/@session_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[select * from (
select v1.*,v1.due_rental_deposit-v1.received_rental_deposit undue_rental_deposit from (
select cc.bp_id_agent_level1,
(select hbm.bp_name
from HLS_BP_MASTER HBM
where cc.bp_id_agent_level1 = hbm.bp_id) agent_name,
cc.contract_number,
cc.bp_id_tenant,
(select hbm.bp_name
from HLS_BP_MASTER HBM
where cc.bp_id_tenant = hbm.bp_id) bp_name,
t.session_id,
t.overdue_max_days,
f.times,
to_char(t.calc_date,'yyyy-mm-dd') calc_date,
to_char(f.due_date,'yyyy-mm-dd') due_date,
nvl(t.f_overdue_amount,0) f_overdue_amount,
nvl(t.f_overdue_penalty_amt,0) f_overdue_penalty_amt,
nvl(t.overdue_principal, 0) overdue_principal,
nvl(t.overdue_interest, 0) overdue_interest,
nvl(t.overdue_amount, 0) overdue_amount,
nvl(t.overdue_penalty_amt, 0) overdue_penalty_amt,
nvl(t.f_overdue_amount, 0) due_rental_deposit,
(select nvl(sum(cwo.write_off_due_amount),0)
from csh_transaction ctr, csh_write_off cwo
where cwo.contract_id = t.contract_id
AND cwo.cashflow_id = t.cashflow_id
AND cwo.csh_transaction_id = ctr.transaction_id
and ctr.transaction_type = 'DEPOSIT') received_rental_deposit
from CUS_DEPOSIT_CALC_OVERDUE_TMP t,
CON_CONTRACT CC,
con_contract_cashflow f
where t.cashflow_id = f.cashflow_id
and f.contract_id = cc.contract_id
and t.contract_id = cc.contract_id
and cc.data_class = 'NORMAL')v1
order by v1.contract_number,v1.times)v
#WHERE_CLAUSE#
#ORDER_BY_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="v.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_id_agent_level1" queryExpression="v.bp_id_agent_level1 = ${@bp_id_agent_level1}"/>
<bm:query-field name="bp_id_tenant" queryExpression="v.bp_id_tenant =${@bp_id_tenant}"/>
<bm:query-field name="overdue_max_days_from" queryExpression="v.overdue_max_days &lt;= ${@overdue_max_days_from}"/>
<bm:query-field name="overdue_max_days_to" queryExpression="v.overdue_max_days &gt;= ${@overdue_max_days_to}"/>
<bm:query-field name="due_date_from" queryExpression="v.due_date &lt;= ${@due_date_from}"/>
<bm:query-field name="due_date_to" queryExpression="v.due_date &gt;= ${@due_date_to}"/>
</bm:query-fields>
<!-- <bm:data-filters>-->
<!-- <bm:data-filter name="session_id" expression="${/session/@session_id}"/>-->
<!-- </bm:data-filters>-->
</bm:model>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
function dateValidator(record, name, value) { //日期校验方法
if (name == 'transaction_date_from' || name == 'transaction_date_to') {
var start_date = Leaf.formatDate(record.get('transaction_date_from'));
var end_date = Leaf.formatDate(record.get('transaction_date_to'));
if (!!end_date) { //由于结束日期非必填,只有在结束日期填了才进行比较
if (!compareDate(start_date, end_date)) {
return '${l:CSH510.CSH_RECEIPT_DATE_CHECK}'; //校验不通过返回字符串
}
}
return true; //校验通过返回true
}
}
function compareDate(start, end) {
if (start > end) {
return false;
}
return true;
}
function cus_deposit120_query() {
$('cus_deposit120_result_ds').query();
}
function cus_deposit120_reset() {
$('cus_deposit120_query_ds').reset();
}
function cus_deposit120_calc_overdue() {
$('cus_deposit120_calc_btn').disable();
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
var record = $('cus_deposit120_calc_overdue_date_ds').getAt(0);
var calc_overdue_date = record.get('calc_overdue_date');
if(calc_overdue_date){
Leaf.request({
url:"${/request/@context_path}/autocrud/cus_deposit.CUS_DEPOSIT120.cus_deposit_calc_overdue_list/execute",
para:{calc_overdue_date:calc_overdue_date},
scope:this,
success:function (res) {
$('cus_deposit120_calc_btn').enable();
Leaf.Masker.unmask(Ext.getBody()); //解锁
if (res.success) {
cus_deposit120_query();
}
},
failure: function() {
$('cus_deposit120_calc_btn').enable();
Leaf.Masker.unmask(Ext.getBody()); //解锁
},
error: function() {
$('cus_deposit120_calc_btn').enable();
Leaf.Masker.unmask(Ext.getBody()); //解锁
}
});
}else{
$('cus_deposit120_calc_btn').enable();
Leaf.Masker.unmask(Ext.getBody()); //解锁
Leaf.showMessage('${l:HLS.PROMPT}', '请先维护罚息测算日!');
return;
}
}
]]></script>
<a:dataSets>
<a:dataSet id="cus_deposit120_query_ds">
<a:fields>
<a:field name="agent_name" lovGridHeight="350" lovHeight="500"
lovService="basic.hls_bp_master_v_for_lov?bp_category=AGENT" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_agent_level1"/>
<a:map from="bp_name" to="agent_name"/>
</a:mapping>
</a:field>
<a:field name="bp_id_agent_level1"/>
<a:field name="bp_id_tenant_name" lovGridHeight="350" lovHeight="500"
lovService="basic.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_tenant"/>
<a:map from="bp_name" to="bp_id_tenant_name"/>
</a:mapping>
</a:field>
<a:field name="bp_id_tenant"/>
<a:field name="due_date_from"/>
<a:field name="due_date_to"/>
</a:fields>
</a:dataSet>
<a:dataSet id="cus_deposit120_calc_overdue_date_ds" autoCreate="true">
<a:fields>
<a:field name="calc_overdue_date"/>
</a:fields>
</a:dataSet>
<a:dataSet id="cus_deposit120_result_ds" autoPageSize="true" autoQuery="true"
model="cus_deposit.CUS_DEPOSIT120.cus_deposit_calc_overdue_list_query" queryDataSet="cus_deposit120_query_ds"
selectable="true" selectionModel="single"/>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton id="cus_deposit120_calc_btn" click="cus_deposit120_calc_overdue" text="罚息测算"/>
<a:gridButton click="cus_deposit120_query" text="HLS.QUERY"/>
<a:gridButton click="cus_deposit120_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form bindTarget="cus_deposit120_query_ds" column="4" labelWidth="130" marginWidth="80" title="逾期合同查询">
<a:lov name="agent_name" bindTarget="cus_deposit120_query_ds" prompt="代理店"/>
<a:textField name="contract_number" bindTarget="cus_deposit120_query_ds" prompt="合同编号"/>
<a:lov name="bp_id_tenant_name" bindTarget="cus_deposit120_query_ds" prompt="承租人"/>
<a:numberField name="overdue_max_days_from" allowDecimals="false" allowNegative="false" bindTarget="cus_deposit120_query_ds" prompt="合同逾期天数从"/>
<a:numberField name="overdue_max_days_to" allowDecimals="false" allowNegative="false" bindTarget="cus_deposit120_query_ds" prompt="合同逾期天数到"/>
<a:datePicker name="due_date_from" bindTarget="cus_deposit120_query_ds" prompt="HLS.TRANSACTION_DATE_FROM"/>
<a:datePicker name="due_date_to" bindTarget="cus_deposit120_query_ds" prompt="HLS.TRANSACTION_DATE_TO"/>
</a:form>
<a:fieldSet title="罚息测算">
<a:datePicker name="calc_overdue_date" bindTarget="cus_deposit120_calc_overdue_date_ds" prompt="罚息测算日"/>
</a:fieldSet>
<a:grid id="cus_deposit120_grid_ds" bindTarget="cus_deposit120_result_ds" marginHeight="295" marginWidth="80" navBar="true">
<a:toolBar>
<a:button prompt="PROMPT.EXPORT_EXCEL" type="excel"/>
</a:toolBar>
<a:columns>
<a:column name="agent_name" prompt="代理店" width="120"/>
<a:column name="contract_number" prompt="合同编号" width="100"/>
<a:column name="bp_name" prompt="承租人" width="100"/>
<a:column name="overdue_max_days" prompt="合同逾期天数" width="80"/>
<a:column name="times" prompt="期数" width="40"/>
<a:column name="calc_date" prompt="罚息测算日" width="100" renderer="Leaf.formatDate"/>
<a:column name="due_date" prompt="到期日" width="100" renderer="Leaf.formatDate"/>
<a:column prompt="会计">
<!-- <a:column name="" prompt="逾期本金" align="right" width="100" renderer="Leaf.formatMoney"/>-->
<!-- <a:column name="" prompt="逾期利息" align="right" width="100" renderer="Leaf.formatMoney"/>-->
<a:column name="f_overdue_amount" prompt="逾期租金" align="right" width="100" renderer="Leaf.formatMoney"/>
<a:column name="f_overdue_penalty_amt" prompt="逾期违约金" align="right" width="100" renderer="Leaf.formatMoney"/>
</a:column>
<a:column prompt="营业">
<a:column name="overdue_principal" prompt="逾期本金" align="right" width="100" renderer="Leaf.formatMoney"/>
<a:column name="overdue_interest" prompt="逾期利息" align="right" width="100" renderer="Leaf.formatMoney"/>
<a:column name="overdue_amount" prompt="逾期租金" align="right" width="100" renderer="Leaf.formatMoney"/>
<a:column name="overdue_penalty_amt" prompt="逾期违约金" align="right" width="100" renderer="Leaf.formatMoney"/>
</a:column>
<a:column prompt="租金保证金">
<a:column name="due_rental_deposit" prompt="应垫" align="right" width="100" renderer="Leaf.formatMoney"/>
<a:column name="received_rental_deposit" prompt="已垫" align="right" width="100" renderer="Leaf.formatMoney"/>
<a:column name="undue_rental_deposit" prompt="未垫" align="right" width="100" renderer="Leaf.formatMoney"/>
</a:column>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
\ No newline at end of file
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