Commit 311737ad authored by stone's avatar stone

Merge branch 'develop' of https://hel.hand-china.com/hlcm/leaf-hlcm into develop

parents acd8bbe3 dd63640b
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
AND sc.code_value = t1.contract_status) contract_status_desc AND sc.code_value = t1.contract_status) contract_status_desc
from con_contract t1 from con_contract t1
where where
t1.contract_status in ('INCEPT','ET','NEW','ETING','REPURSING') t1.contract_status in ('INCEPT','NEW','ETING','REPURSING')
and t1.data_class = 'NORMAL' and t1.data_class = 'NORMAL'
and t1.company_id in (( and t1.company_id in ((
select company_id select company_id
......
...@@ -3,22 +3,39 @@ ...@@ -3,22 +3,39 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
select times, select *
cf_item, from (
cashflow_id, select times,
(select cf_item_desc from hls_cashflow_item_v where cf_item = t.cf_item and enabled_flag = 'Y' and cf_type = t.cf_type) cf_item_desc, cf_item,
contract_id, cashflow_id,
to_char(due_date,'yyyy-mm-dd') due_date, (select cf_item_desc
due_amount, from hls_cashflow_item_v
principal, where cf_item = t.cf_item
interest, and enabled_flag = 'Y'
principal - nvl(received_principal,0) unreceived_principal, and cf_type = t.cf_type) cf_item_desc,
interest - nvl(received_interest,0) unreceived_interest, contract_id,
due_amount - nvl(received_amount,0) unreceived_amount to_char(due_date, 'yyyy-mm-dd') due_date,
from con_contract_cashflow t decode(cf_item, 9,
#WHERE_CLAUSE# CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=>t.cashflow_id,
order by times, due_date p_calc_date=>to_date(${@transaction_date}, 'yyyy-mm-dd'),
]]></bm:query-sql> p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) due_amount,
principal,
interest,
principal - nvl(received_principal, 0) unreceived_principal,
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=>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
from con_contract_cashflow t #WHERE_CLAUSE#
order by times, due_date) t1
where unreceived_amount > 0
]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
<bm:fields> <bm:fields>
...@@ -37,16 +54,18 @@ ...@@ -37,16 +54,18 @@
</bm:fields> </bm:fields>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="contract_id" queryExpression="t.contract_id = ${@contract_id}"/> <bm:query-field name="contract_id" queryExpression="t.contract_id = ${@contract_id}"/>
<!-- <bm:query-field name="due_date_from" queryExpression="t.due_date between to_date(${@due_date_from},'yyyy-mm-dd') and nvl(to_date(${@due_date_to},'yyyy-mm-dd'),t.due_date)"/>--> <!-- <bm:query-field name="due_date_from" queryExpression="t.due_date between to_date(${@due_date_from},'yyyy-mm-dd') and nvl(to_date(${@due_date_to},'yyyy-mm-dd'),t.due_date)"/>-->
<!-- <bm:query-field name="due_date_to" queryExpression="t.due_date between nvl(to_date(${@due_date_from},'yyyy-mm-dd'),t.due_date) and to_date(${@due_date_to},'yyyy-mm-dd')"/>--> <!-- <bm:query-field name="due_date_to" queryExpression="t.due_date between nvl(to_date(${@due_date_from},'yyyy-mm-dd'),t.due_date) and to_date(${@due_date_to},'yyyy-mm-dd')"/>-->
<bm:query-field name="cf_item" queryExpression="t.cf_item = ${@cf_item}"/> <bm:query-field name="cf_item" queryExpression="t.cf_item = ${@cf_item}"/>
<bm:query-field name="deposit_flag" queryExpression="((nvl(${@deposit_flag},'N') = 'Y' and cf_item in (1,9,250)) or (nvl(${@deposit_flag},'N') = 'N'))"/> <bm:query-field name="deposit_flag"
queryExpression="((nvl(${@deposit_flag},'N') = 'Y' and cf_item in (1,9,250)) or (nvl(${@deposit_flag},'N') = 'N'))"/>
<bm:query-field name="due_date_from" <bm:query-field name="due_date_from"
queryExpression="due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/> queryExpression="due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="due_date_to" <bm:query-field name="due_date_to"
queryExpression="due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/> queryExpression="due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter name="query" expression="t.cf_status = 'RELEASE' and t.write_off_flag != 'FULL' and t.cf_direction = 'INFLOW'"/> <bm:data-filter name="query"
expression="t.cf_status = 'RELEASE' and t.write_off_flag != 'FULL' and t.cf_direction = 'INFLOW'"/>
</bm:data-filters> </bm:data-filters>
</bm:model> </bm:model>
...@@ -98,7 +98,12 @@ ...@@ -98,7 +98,12 @@
t1.WRITE_OFF_INTEREST, t1.WRITE_OFF_INTEREST,
(select principal from con_contract_cashflow where cashflow_id = t1.cashflow_id) principal, (select principal from con_contract_cashflow where cashflow_id = t1.cashflow_id) principal,
(select interest from con_contract_cashflow where cashflow_id = t1.cashflow_id) interest, (select interest from con_contract_cashflow where cashflow_id = t1.cashflow_id) interest,
(select due_amount from con_contract_cashflow where cashflow_id = t1.cashflow_id) due_amount, (select decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=>t1.cashflow_id,
p_calc_date=>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) from con_contract_cashflow where cashflow_id = t1.cashflow_id) due_amount,
(select bp_name from hls_bp_master h,con_contract c where h.bp_id = c.bp_id_tenant and c.contract_id = t1.contract_id) bp_tenant_name (select bp_name from hls_bp_master h,con_contract c where h.bp_id = c.bp_id_tenant and c.contract_id = t1.contract_id) bp_tenant_name
from csh_write_off t1) t from csh_write_off t1) t
#WHERE_CLAUSE# #WHERE_CLAUSE#
......
...@@ -117,7 +117,12 @@ end; ...@@ -117,7 +117,12 @@ end;
<bm:field name="journal_date" databaseType="DATE" datatype="java.util.Date"/> <bm:field name="journal_date" databaseType="DATE" datatype="java.util.Date"/>
<bm:field name="principal" expression="(select principal from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" /> <bm:field name="principal" expression="(select principal from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" />
<bm:field name="interest" expression="(select interest from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" /> <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 due_amount 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=>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) from con_contract_cashflow where cashflow_id = t1.write_off_cashflow_id)" />
</bm:fields> </bm:fields>
<bm:features> <bm:features>
<f:standard-who/> <f:standard-who/>
......
...@@ -18,6 +18,47 @@ ...@@ -18,6 +18,47 @@
fst.parent_line_id) tree_parent_field, fst.parent_line_id) tree_parent_field,
fsd.target_value, fsd.target_value,
CASE CASE
when fst.score_target_code = 'HL_CM_24' then
(SELECT DECODE(sign(t.EXCAVATOR_QUANTITY), 1, t.EXCAVATOR_QUANTITY || '台挖掘机;', null) ||
DECODE(sign(t.LOADER_QUANTITY), 1, t.LOADER_QUANTITY || '台装载机;', null) ||
DECODE(sign(t.OTHER_OTHER), 1, t.OTHER_OTHER || '台其他机器;', null) target_value
FROM (SELECT SUM(DECODE(item_type, 'EXCAVATOR', 1, 0) * nvl(quantity, 1)) EXCAVATOR_QUANTITY,
SUM(DECODE(item_type, 'LOADER', 1, 0) * nvl(quantity, 1)) LOADER_QUANTITY,
SUM(DECODE(item_type, 'OTHER', 1, 0) * nvl(quantity, 1)) OTHER_OTHER
FROM bp_tenant_rate_item_device_lv t
WHERE project_id = (select project_id
from fnd_sc_score fs,
fnd_sc_score_result sr
where fs.SC_SCORE_ID = sr.SC_SCORE_ID
and sr.RESULT_ID = ${@result_id})) t)
when fst.score_target_code = 'HL_CM_25' then
(SELECT CASE
WHEN count_3 > 0 THEN
'存在机器债务情况:偿还中,有延期'
ELSE
CASE
WHEN count_2 > 0 THEN
'存在机器债务情况:偿还中,无延期'
ELSE
CASE
WHEN count_1 > 0 THEN
'机器债务情况均已偿还'
ELSE
'无工程机械设备'
END
END
END target_value
FROM (SELECT SUM(DECODE(loans_status, 'REPAID', 1, 0)) * 3 count_1,
SUM(DECODE(loans_status, 'REPAYING_NO_DELAY', 1, 0)) count_2,
SUM(DECODE(loans_status, 'REPAYING_DELAY', 1, 0)) count_3
FROM bp_tenant_rate_item_device_lv t
WHERE project_id =
(SELECT project_id
FROM fnd_sc_score fs,
fnd_sc_score_result sr
WHERE fs.SC_SCORE_ID = sr.SC_SCORE_ID
AND sr.RESULT_ID = ${@result_id})) t
)
WHEN fst.target_value_type = 'CHAR' THEN WHEN fst.target_value_type = 'CHAR' THEN
(SELECT t.description (SELECT t.description
FROM fnd_score_target_values t FROM fnd_score_target_values t
......
...@@ -21,4 +21,7 @@ ...@@ -21,4 +21,7 @@
<bm:data-filters> <bm:data-filters>
<bm:data-filter name="query" expression="(rownum = 1)" /> <bm:data-filter name="query" expression="(rownum = 1)" />
</bm:data-filters> </bm:data-filters>
<bm:query-fields>
<bm:query-field name="bp_id" queryExpression="bp_id = ${@bp_id}"/>
</bm:query-fields>
</bm:model> </bm:model>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
$('csh_write_off_grid').hideColumn('left_interest'); $('csh_write_off_grid').hideColumn('left_interest');
$('csh_write_off_grid').hideColumn('unreceived_amount'); $('csh_write_off_grid').hideColumn('unreceived_amount');
if ('${/parameter/@interfaceQueryFlag}' == 'N') { if ('${/parameter/@interfaceQueryFlag}' == 'N') {
$('csh_write_off_interface_ds').setQueryUrl('${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off/query?transaction_id=${/parameter/@transaction_id}'); $('csh_write_off_interface_ds').setQueryUrl('${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off/query?transaction_id=${/parameter/@transaction_id}&transaction_date=${/parameter/@transaction_date}');
$('csh_write_off_interface_ds').query(); $('csh_write_off_interface_ds').query();
} }
if ('${/parameter/@approval_flag}' == 'Y') { if ('${/parameter/@approval_flag}' == 'Y') {
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
return 'csh_write_off_grid_nf'; return 'csh_write_off_grid_nf';
} }
if (name == 'write_off_date' || name == 'journal_date') { if (name == 'write_off_date' || name == 'journal_date') {
if (write_off_type == 'RECEIPT_CREDIT') { if (write_off_type == 'RECEIPT_CREDIT' || write_off_type == 'DEPOSIT_CREDIT') {
return 'csh_write_off_grid_dp'; return 'csh_write_off_grid_dp';
} }
if (write_off_type == 'RECEIPT_ADVANCE_RECEIPT') { if (write_off_type == 'RECEIPT_ADVANCE_RECEIPT') {
...@@ -275,6 +275,9 @@ ...@@ -275,6 +275,9 @@
record.set('left_principal', ''); record.set('left_principal', '');
record.set('left_interest', ''); record.set('left_interest', '');
} }
if (name == 'wirte_off_date'){
record.set('journal_date',value);
}
} }
function csh531_wf_amount_validate(record, name, value) { function csh531_wf_amount_validate(record, name, value) {
...@@ -739,11 +742,11 @@ ...@@ -739,11 +742,11 @@
</a:dataSet> </a:dataSet>
<a:dataSet id="csh_write_off_interface_ds" autoQuery="true" fetchAll="true" <a:dataSet id="csh_write_off_interface_ds" autoQuery="true" fetchAll="true"
model="csh.CSH531N.csh_write_off_interface" model="csh.CSH531N.csh_write_off_interface"
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off_interface/query?trx_interface_id=${/parameter/@transaction_id}" queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off_interface/query?trx_interface_id=${/parameter/@transaction_id}&amp;transaction_date=${/parameter/@transaction_date}"
selectable="true"> selectable="true">
<a:fields> <a:fields>
<a:field name="company_id" defaultValue="${/parameter/@company_id}"/> <a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
<a:field name="write_off_date" validator="write_off_date_validator" required="true" <a:field name="write_off_date" datatype="java.util.Date" validator="write_off_date_validator" required="true"
defaultValue="${/model/sys_default_time/record/@now_date}"/> defaultValue="${/model/sys_default_time/record/@now_date}"/>
<a:field name="journal_date" required="true" <a:field name="journal_date" required="true"
defaultValue="${/model/sys_default_time/record/@now_date}"/> defaultValue="${/model/sys_default_time/record/@now_date}"/>
...@@ -760,7 +763,7 @@ ...@@ -760,7 +763,7 @@
<a:field name="trx_interface_id" defaultValue="${/parameter/@transaction_id}"/> <a:field name="trx_interface_id" defaultValue="${/parameter/@transaction_id}"/>
<a:field name="contract_number" prompt="合同编号" autoComplete="true" lovAutoQuery="true" <a:field name="contract_number" prompt="合同编号" autoComplete="true" lovAutoQuery="true"
lovHeight="850" required="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}" 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}"
lovWidth="1350" title="合同号选择"> lovWidth="1350" title="合同号选择">
<a:mapping> <a:mapping>
<a:map from="contract_number" to="contract_number"/> <a:map from="contract_number" to="contract_number"/>
......
...@@ -68,11 +68,17 @@ ...@@ -68,11 +68,17 @@
rec.set('write_off_principal', cf_recs[0].get('unreceived_principal')); rec.set('write_off_principal', cf_recs[0].get('unreceived_principal'));
rec.set('write_off_interest', cf_recs[0].get('unreceived_interest')); rec.set('write_off_interest', cf_recs[0].get('unreceived_interest'));
rec.set('unreceived_amount', cf_recs[0].get('unreceived_amount')); rec.set('unreceived_amount', cf_recs[0].get('unreceived_amount'));
rec.set('write_off_date',new Date().format('yyyy-mm-dd'));
rec.set('journal_date',new Date().format('yyyy-mm-dd'));
// rec.set('write_off_amount', cf_recs[0].get('unreceived_amount')); // rec.set('write_off_amount', cf_recs[0].get('unreceived_amount'));
for (var i = 1; i < cf_recs.length; i++) { for (var i = 1; i < cf_recs.length; i++) {
//copy... //copy...
var newRecord = new Leaf.Record({...rec.data}); // var newRecord = new Leaf.Record({...rec.data});
//IE不支持ES6扩展
var obj = JSON.parse(JSON.stringify(rec.data));
var newRecord = new Leaf.Record(obj);
newRecord.ds = rec.ds; newRecord.ds = rec.ds;
newRecord.set('write_off_cf_item_desc', cf_recs[i].get('cf_item_desc')); newRecord.set('write_off_cf_item_desc', cf_recs[i].get('cf_item_desc'));
newRecord.set('write_off_cf_item', cf_recs[i].get('cf_item')); newRecord.set('write_off_cf_item', cf_recs[i].get('cf_item'));
...@@ -88,6 +94,8 @@ ...@@ -88,6 +94,8 @@
newRecord.set('left_amount', cf_recs[i].get('unreceived_amount')); newRecord.set('left_amount', cf_recs[i].get('unreceived_amount'));
newRecord.set('write_off_principal', cf_recs[i].get('unreceived_principal')); newRecord.set('write_off_principal', cf_recs[i].get('unreceived_principal'));
newRecord.set('write_off_interest', cf_recs[i].get('unreceived_interest')); newRecord.set('write_off_interest', cf_recs[i].get('unreceived_interest'));
newRecord.set('write_off_date',new Date().format('yyyy-mm-dd'));
newRecord.set('journal_date',new Date().format('yyyy-mm-dd'));
// newRecord.set('write_off_amount', cf_recs[i].get('unreceived_amount')); // newRecord.set('write_off_amount', cf_recs[i].get('unreceived_amount'));
ds.add(newRecord); ds.add(newRecord);
...@@ -137,7 +145,7 @@ ...@@ -137,7 +145,7 @@
<a:dataSet id="csh_write_off_lov_ds" fetchAll="true" bindTarget="csh_lov_con_contract_ds" <a:dataSet id="csh_write_off_lov_ds" fetchAll="true" bindTarget="csh_lov_con_contract_ds"
bindName="csh_con_cf" selectable="true" selectionModel="multiple" bindName="csh_con_cf" selectable="true" selectionModel="multiple"
model="csh.CSH531N.csh_con_contract_cashflow" queryDataSet="csh_query_cf_ds" 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}"> queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_con_contract_cashflow/query?deposit_flag=${/parameter/@deposit_flag}&amp;transaction_date=${/parameter/@transaction_date}">
<a:fields> <a:fields>
<a:field name="contract_id"/> <a:field name="contract_id"/>
<a:field name="cashflow_id"/> <a:field name="cashflow_id"/>
......
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
<a:columns> <a:columns>
<a:column name="score_target_name" prompt="FND714.SCORE_TARGET_NAME" width="250"/> <a:column name="score_target_name" prompt="FND714.SCORE_TARGET_NAME" width="250"/>
<!-- <a:column name="target_value" prompt="指标值" width="150"/> --> <!-- <a:column name="target_value" prompt="指标值" width="150"/> -->
<a:column name="target_value_name" prompt="指标值" width="250"/> <a:column name="target_value_desc" prompt="指标值" width="250"/>
<!-- <a:column name="score_value" prompt="权重" renderer="fnd714_sc_score_result_dtl_render_score_value" width="80"/> --> <!-- <a:column name="score_value" prompt="权重" renderer="fnd714_sc_score_result_dtl_render_score_value" width="80"/> -->
<!-- <a:column name="target_score" editorFunction="fnd714_sc_score_result_dtl_grid_editorFunc" prompt="FND714.TARGET_SCORE" renderer="fnd714_sc_score_result_dtl_render_target_score"/> --> <!-- <a:column name="target_score" editorFunction="fnd714_sc_score_result_dtl_grid_editorFunc" prompt="FND714.TARGET_SCORE" renderer="fnd714_sc_score_result_dtl_render_target_score"/> -->
<a:column name="target_score" prompt="得分" align="right" renderer="fnd714_sc_score_result_dtl_render_target_score" width="80"/> <a:column name="target_score" prompt="得分" align="right" renderer="fnd714_sc_score_result_dtl_render_target_score" width="80"/>
......
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