Commit 4a60d3ba authored by liyuan.chen's avatar liyuan.chen

[fix]违约金,业务冲销

parent 287c6201
Pipeline #6697 canceled with stages
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
Select cwo.cashflow_id,
t.transaction_num,
cwo.write_off_id,
(Select v.code_value_name
From sys_code_values_v v
Where v.code = 'RECEIPT_TYPE'
And v.code_value = t.receipt_type) transaction_type,
c.contract_id,
cwo.times,
ccc.cf_item,
(Select h.description
From hls_cashflow_item h
Where h.cf_item = ccc.cf_item) cf_item_n,
--代理店简称
(Select h.extra_nam
From hls_bp_master h
Where h.bp_id = c.bp_id_agent_level1) extra_nam,
--合同编号
c.contract_number,
--机号
(Select ccli.machine_number
From con_contract_lease_item ccli
Where ccli.contract_id = c.contract_id) machine_number,
--承租人编号,名称,身份证号
h.bp_code bp_id_tenant,
h.bp_name,
decode(h.bp_class, 'NP', h.id_card_no, h.social_code) id_card_no,
--合同总额
nvl(c.down_payment, 0) + nvl(c.total_rental, 0) total_amount,
ccc.due_date,
--收款日
t.transaction_date,
-- ccc.due_amount,
(ccc.due_amount - nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date),
0) + cwo.write_off_due_amount) As due_amount,
--t.transaction_num,
cwo.write_off_date,
--实收金额
cwo.write_off_due_amount received_amount,
(ccc.due_amount - nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount
From con_contract_cashflow ccc,
con_contract c,
hls_bp_master h,
csh_write_off cwo,
csh_transaction t
Where cwo.cashflow_id = ccc.cashflow_id
And ccc.contract_id = c.contract_id
And cwo.csh_transaction_id = t.transaction_id
And nvl(cwo.reversed_flag, 'N') = 'N'
And h.bp_id = c.bp_id_tenant
And cwo.write_off_type In ('RECEIPT_CREDIT', 'DEPOSIT_CREDIT')
And ccc.cf_status = 'RELEASE'
And cwo.write_off_due_amount > 0
Order By c.contract_id,
ccc.times,
ccc.cf_item,
t.transaction_date,
cwo.write_off_id ) t
#WHERE_CLAUSE#
order by extra_nam, bp_id_tenant, contract_id,times,cf_item, due_amount desc, transaction_date,write_off_date
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t.contract_number like &apos;%&apos; || ${@contract_number} || &apos;%&apos;"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like &apos;%&apos; || ${@bp_name} || &apos;%&apos;"/>
<bm:query-field name="transaction_date_from" queryExpression="trunc(t.transaction_date) &gt;= trunc(to_date(${@transaction_date_from},'yyyy-mm-dd'))"/>
<bm:query-field name="transaction_date_to" queryExpression="trunc(t.transaction_date) &lt;= trunc(to_date(${@transaction_date_to},'yyyy-mm-dd'))"/>
<bm:query-field name="journal_date_from" queryExpression="trunc(t.write_off_date) &gt;= trunc(to_date(${@journal_date_from},'yyyy-mm-dd'))"/>
<bm:query-field name="journal_date_to" queryExpression="trunc(t.write_off_date) &lt;= trunc(to_date(${@journal_date_to},'yyyy-mm-dd'))"/>
<bm:query-field name="transaction_num" queryExpression="t.transaction_number like &apos;%&apos; || ${@transaction_num} || &apos;%&apos;"/>
<bm:query-field name="cf_item_n" queryExpression="t.cf_item_n like &apos;%&apos; || ${@cf_item_n} || &apos;%&apos;"/>
<bm:query-field name="extra_nam" queryExpression="t.extra_name like &apos;%&apos; || ${@extra_nam} || &apos;%&apos;"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 WHERE a1.trx_category = 'CONTRACT' and a1.trx_id = t.contract_id AND trunc(sysdate) between a1.start_date AND nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id AND a1.trx_category = a2.trx_category AND a2.authorized_user_id = ${/session/@user_id} AND trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate)))"/>
<bm:data-filter enforceOperations="query" expression="( (decode(${/session/@user_id}, 10600, 1, 2) = 1
and exists (select 1 from con_contract c, hls_bp_master hb where c.contract_id = t.contract_id
and hb.bp_id = c.bp_id_agent_level1
and hb.bp_code in ('D00000028','D00000035','D00000016','D00000021','D00000039','D00000025','D00000034','D00000017','D00000018','D00000024','D00000032','D00000009','D00000012','D00000014','D00000015','D00000023')) )
or (decode(${/session/@user_id}, 10600, 1, 2) = 2) )"/>
</bm:data-filters>
</bm:model>
......@@ -36,7 +36,7 @@
<!--<bm:field name="bp_vender" expression="(select bp_name from hls_bp_master where bp_id=t1.bp_id_vender and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>-->
<bm:field name="lease_organization_desc" expression="(select description from hls_lease_organization where lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/>
<!--<bm:field name="owner_user_id_n" expression="(select description from sys_user where user_id = t1.created_by)" forInsert="false" forUpdate="false"/>-->
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos;)) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0)) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id_agent_desc"/>
<bm:field name="business_type_n"/>
<bm:field name="division_n"/>
......
......@@ -67,5 +67,12 @@ var override_queryfields = [
}
];
var add_datafilters = [
{
name : "con_status",
expression : "t1.contract_status in ('INCEPT','NEW') "
}
];
override();
add_datafilter();
\ No newline at end of file
......@@ -23,9 +23,9 @@
}
}
}
};
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
/*window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
......@@ -47,7 +47,17 @@
},
scope: this
});
}
}*/
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
$(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3100N.csh_write_detail_report/query');
$(ds_id).setQueryDataSet($(form_ds_id));
Leaf.Masker.unmask(Ext.getBody());
$(ds_id).query();
};
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'F_WRITE_OFF_LIST', 'con_contract_cashflow');
......
......@@ -299,7 +299,7 @@
<a:column name="bp_name" prompt="HLS.TENANT_NAME" width="150"/>
<a:column name="inception_of_lease" prompt="起租日期" renderer="Leaf.formatDate" width="100"/>
<!-- <a:column name="lease_end_date" prompt="合同预计结束日期" renderer="Leaf.formatDate" width="140"/>-->
<a:column name="is_terminate" prompt="营业应收金额是否结清" width="100"/>
<a:column name="is_terminate" prompt="是否已结清" width="100"/>
<a:column name="residual_value" align="right" prompt="留购价" renderer="Leaf.formatMoney" width="50"/>
<!--<a:column name="signing_user_id_n" prompt="签约人" width="100"/>-->
<!-- <a:column name="signing_date" prompt="签约时间" renderer="Leaf.formatDate" width="100"/>-->
......
......@@ -222,7 +222,7 @@
<a:column name="bp_name" prompt="HLS.TENANT_NAME" width="100"/>
<a:column name="inception_of_lease" prompt="起租日期" renderer="Leaf.formatDate" width="100"/>
<!-- <a:column name="lease_end_date" prompt="合同预计结束日期" renderer="Leaf.formatDate" width="100"/>-->
<a:column name="is_terminate" prompt="租金是否结清" width="100"/>
<a:column name="is_terminate" prompt="是否已结清" width="100"/>
<a:column name="residual_value" align="right" prompt="留购价" renderer="Leaf.formatMoney" width="50"/>
<!--<a:column name="signing_user_id_n" prompt="签约人" width="100"/>-->
<!-- <a:column name="signing_date" prompt="签约时间" renderer="Leaf.formatDate" width="100"/>-->
......
......@@ -28,6 +28,7 @@
Leaf.onReady(function(){
var role_code='${/model/role_code/record/@role_code}';
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_change_req');
var ds_id_n = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var head_record = $(ds_id).getAt(0);
if(head_record){
if(role_code=='0007'){
......@@ -35,20 +36,40 @@
head_record.set('ccr_document_type_n','回款账户变更');
head_record.getField('ccr_document_type').setReadOnly(true);
head_record.getField('ccr_document_type_n').setReadOnly(true);
/*$(ds_id_n).setQueryParameter('contract_status', '');
$(ds_id_n).query();*/
}else if(role_code=='0019'){
head_record.set('ccr_document_type','LEASE_CHAG');
head_record.set('ccr_document_type_n','承租人变更');
head_record.getField('ccr_document_type').setReadOnly(true);
head_record.getField('ccr_document_type_n').setReadOnly(true);
/*$(ds_id_n).setQueryParameter('contract_status', 'INCEPT');
$(ds_id_n).query();*/
}
else if(role_code=='0008'){
head_record.set('ccr_document_type','CUT_CHAG');
head_record.set('ccr_document_type_n','租金计划变更');
head_record.getField('ccr_document_type').setReadOnly(true);
head_record.getField('ccr_document_type_n').setReadOnly(true);
/*$(ds_id_n).setQueryParameter('contract_status', 'INCEPT');
$(ds_id_n).query();*/
}
}
});
// 更新事件
window['${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
if(name == 'ccr_document_type' && value){
if(value != 'ACC_CHAG'){
$(ds_id).setQueryParameter('contract_status', 'INCEPT');
$(ds_id).query();
}
if(value == 'ACC_CHAG'){
$(ds_id).setQueryParameter('contract_status', '');
$(ds_id).query();
}
}
};
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
......
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