Commit 712591f2 authored by 18083's avatar 18083

预收款罚息计算调整逻辑改造

parent 680d3f6b
......@@ -17,7 +17,16 @@
to_char(due_date, 'yyyy-mm-dd') due_date,
decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=>t.cashflow_id,
p_calc_date=>decode(nvl(${@deposit_flag},'N'),'Y',sysdate,to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_calc_date=>decode(nvl(${@deposit_flag},'N'),'Y',sysdate,
decode(${@trx_transaction_type},'ADVANCE_RECEIPT',
(select ct.transaction_date
from csh_transaction ct
where ct.transaction_id =
(select t.source_csh_trx_id
from csh_transaction t
where t.transaction_id = ${@trx_interface_id})),
to_date(${@transaction_date}, 'yyyy-mm-dd'))
),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y')-nvl(t.received_amount,0),
due_amount) due_amount,
......@@ -27,8 +36,16 @@
interest - nvl(received_interest, 0) unreceived_interest,
decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=>t.cashflow_id,
p_calc_date=>decode(nvl(${@deposit_flag},'N'),'Y',sysdate,to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_user_id=>${/session/@user_id},
p_calc_date=>decode(nvl(${@deposit_flag},'N'),'Y',sysdate,
decode(${@trx_transaction_type},'ADVANCE_RECEIPT',
(select ct.transaction_date
from csh_transaction ct
where ct.transaction_id =
(select t.source_csh_trx_id
from csh_transaction t
where t.transaction_id = ${@trx_interface_id})),
to_date(${@transaction_date}, 'yyyy-mm-dd'))),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) -
nvl(received_amount, 0) unreceived_amount
......
......@@ -108,7 +108,15 @@ 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="unreceived_amount" expression="(select decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=> cashflow_id,
p_calc_date=>decode(${@trx_transaction_type},'DEPOSIT',sysdate,to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_calc_date=>decode(${@trx_transaction_type},
'DEPOSIT',sysdate,
'ADVANCE_RECEIPT',(select ct.transaction_date
from csh_transaction ct
where ct.transaction_id =
(select t.source_csh_trx_id
from csh_transaction t
where t.transaction_id = ${@trx_interface_id})),
to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) -nvl(received_amount,0) from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
......@@ -125,7 +133,14 @@ end;
<bm:field name="interest" expression="(select interest from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" />
<bm:field name="due_amount" expression="(select decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=> cashflow_id,
p_calc_date=>decode(${@trx_transaction_type},'DEPOSIT',sysdate,to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_calc_date=>decode(${@trx_transaction_type},'DEPOSIT',sysdate,
'ADVANCE_RECEIPT',(select ct.transaction_date
from csh_transaction ct
where ct.transaction_id =
(select t.source_csh_trx_id
from csh_transaction t
where t.transaction_id = ${@trx_interface_id})),
to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y')-nvl(received_amount,0),
due_amount) from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" />
......
......@@ -709,7 +709,6 @@
//获取月结期间是否关闭
function get_period_closed(date){
debugger;
var csh_confirm_flag;
$L.request({
url: '${/request/@context_path}/autocrud/csh.CSH531N.csh_data_confirm/query',
......@@ -736,14 +735,13 @@
}
function check_transaction(){
debugger;
var transaction_ds = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
var transaction_ds = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
var paid_byother_flag=transaction_ds.get('paid_byother_flag');
var collection_classes=transaction_ds.get('collection_classes');
var guarantor_name_duty=transaction_ds.get('guarantor_name_duty');
var transaction_type=transaction_ds.get('transaction_type');
if(paid_byother_flag=='T' && collection_classes=='COMBINED'
&& Ext.isEmpty(guarantor_name_duty) && transaction_type=='ADVANCE_RECEIPT'){
&& guarantor_name_duty=='NULL' && transaction_type=='ADVANCE_RECEIPT'){
return false;
}
return true;
......@@ -808,14 +806,14 @@
var transaction_type = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord().get('transaction_type');
//核销为融租保证金
for(var j=0;j<depositRs.length;j++){
if(!get_period_closed(transaction_date) &&!check_transaction()
if(!get_period_closed(transaction_date) &&check_transaction()
&&(depositRs[j].get('write_off_date').getFullYear() !=transaction_date.getFullYear()||depositRs[j].get('write_off_date').getMonth()+1 !=transaction_date.getMonth()+1)){
depositRs_date_count = plus(depositRs_date_count, 1);
}
}
//核销为经租保证金
for(var j=0;j<operatRs.length;j++){
if(!get_period_closed(transaction_date) &&!check_transaction()
if(!get_period_closed(transaction_date) &&check_transaction()
&&(operatRs[j].get('write_off_date').getFullYear() !=transaction_date.getFullYear()||operatRs[j].get('write_off_date').getMonth()+1 !=transaction_date.getMonth()+1)){
operatRs_date_count = plus(operatRs_date_count, 1);
}
......@@ -900,8 +898,7 @@
<!-- <a:field name="write_off_date" defaultValue="${/model/sys_default_value/record/@now_time}" required="true"/> -->
<a:field name="write_off_date" readOnly="true"/>
<a:field name="paid_byother_flag_n" readOnly="true"/>
<a:field name="guarantor_name_duty" readOnly="true"/>
<a:field name="ref_contract_num" readOnly="true"/>
<a:field name="ref_contract_num" readOnly="true"/>
<a:field name="bank_slip_num" readOnly="true"/>
<a:field name="bp_code" readOnly="true"/>
<a:field name="bp_category" readOnly="true"/>
......@@ -928,7 +925,7 @@
<a:field name="ref_v01"/>
<a:field name="approving_return_amount" readOnly="true"/>
<a:field name="for_allocate_amount" readOnly="true" />
</a:fields>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_write_off_interface_ds" autoQuery="true" fetchAll="true"
......@@ -954,7 +951,7 @@
<a:field name="trx_interface_id" defaultValue="${/parameter/@transaction_id}"/>
<a:field name="contract_number" prompt="合同编号" autoComplete="true" lovAutoQuery="true"
lovHeight="850" required="true"
lovUrl="${/request/@context_path}/modules/csh/CSH531N/csh_write_off_ref_contract.lview?bp_id=${/model/csh_transaction_path/record/@bp_id}&amp;deposit_flag=${/parameter/@deposit_flag}&amp;transaction_date=${/model/csh_transaction_path/record/@transaction_date}"
lovUrl="${/request/@context_path}/modules/csh/CSH531N/csh_write_off_ref_contract.lview?bp_id=${/model/csh_transaction_path/record/@bp_id}&amp;deposit_flag=${/parameter/@deposit_flag}&amp;transaction_date=${/model/csh_transaction_path/record/@transaction_date}&amp;trx_interface_id=${/model/csh_transaction_path/record/@transaction_id}&amp;trx_transaction_type=${/model/csh_transaction_path/record/@transaction_type}"
lovWidth="1550" title="合同号选择">
<a:mapping>
<a:map from="contract_number" to="contract_number"/>
......
......@@ -244,7 +244,7 @@
<a:dataSet id="csh_write_off_lov_ds" fetchAll="true" bindTarget="csh_lov_con_contract_ds"
bindName="csh_con_cf" selectable="true" selectionModel="multiple"
model="csh.CSH531N.csh_con_contract_cashflow" queryDataSet="csh_query_cf_ds"
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_con_contract_cashflow/query?deposit_flag=${/parameter/@deposit_flag}&amp;transaction_date=${/parameter/@transaction_date}">
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_con_contract_cashflow/query?deposit_flag=${/parameter/@deposit_flag}&amp;transaction_date=${/parameter/@transaction_date}&amp;trx_transaction_type=${/parameter/@trx_transaction_type}&amp;trx_interface_id=${/parameter/@trx_interface_id}">
<a:fields>
<a:field name="contract_id"/>
<a:field name="cashflow_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