Commit 25c88e45 authored by 18083's avatar 18083

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

parent a4aa1425
......@@ -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
......
......@@ -105,7 +105,21 @@ end;
<bm:field name="error_message" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ERROR_MESSAGE" prompt="CSH_WRITE_OFF_INTERFACE.ERROR_MESSAGE"/>
<bm:field name="trx_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRX_NUMBER" prompt="事务编号"/>
<bm:field name="left_amount" expression="(select decode(cf_item,1,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 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 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,
'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"/>
<bm:field name="left_principal" expression="(select ca.principal - nvl(ca.received_principal,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="left_interest" expression="(select ca.interest - nvl(ca.received_interest,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="unreceived_penalty" expression="(select ca.due_amount - nvl(ca.received_amount,0) from con_contract_cashflow ca where ca.contract_id = t1.contract_id and ca.times = t1.write_off_times and cf_item = 9 and cf_status = 'RELEASE')" forInsert="false" forUpdate="false"/>
......@@ -119,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)" />
......
......@@ -26,7 +26,9 @@
}
function init() {
if ('${/parameter/@collection_classes}' == 'COMBINED' && '${/parameter/@transaction_type}' !== 'DEPOSIT') {
if ('${/parameter/@collection_classes}' == 'COMBINED' && '${/parameter/@transaction_type}' !== 'DEPOSIT') {
document.getElementById('write_off_deposit').style.display = 'block';
document.getElementById('write_off_operat').style.display = 'block';
}
......@@ -816,8 +818,7 @@
operatRs_date_count = plus(operatRs_date_count, 1);
}
}
//保证金抵扣为债券
//保证金抵扣为债券
if(transaction_type == 'DEPOSIT'){
for(var j=0;j<interfaceRs.length;j++){
var Rs_write_date = Leaf.formatDate(interfaceRs[j].get('write_off_date'));
......@@ -825,7 +826,7 @@
if(!get_period_closed(interfaceRs_date)
&&(Rs_write_date.split('-')[0] !=transaction_date.getFullYear() || Rs_write_date.split('-')[1]!=transaction_date.getMonth()+1)){
interfaceRs_date_count = plus(interfaceRs_date_count, 1);
break;
break;
}
}
}
......@@ -842,6 +843,7 @@
$('csh531n_write_off_submit_btn_id').disable();
csh511_save_all();
});
}
function csh531_add_fun(ds, record, index) {
......@@ -896,7 +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="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"/>
......@@ -923,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"
......@@ -949,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"/>
......
......@@ -164,7 +164,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