Commit a6be8f16 authored by liyuan.chen's avatar liyuan.chen

保证金及违约金调整

parent b9d2f7a8
......@@ -3,98 +3,77 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from
(SELECT
t.contract_id,
t.company_id,
t.business_type,
t.contract_number,
t.contract_name,
t.document_type,
dt.document_type_desc,
t.document_category,
dt.document_category_desc,
t.bp_id_tenant,
t.lease_execution_date,
b.bp_name,
b.bp_code,
--t.license_number,
TO_CHAR(t.lease_start_date, 'yyyy-mm-dd') lease_start_date,
TO_CHAR(t.lease_end_date, 'yyyy-mm-dd') lease_end_date,
(SELECT h.bp_name FROM hls_bp_master h WHERE h.bp_id = t.unit_id
) AS unit_id_n,
t.unit_id,
TO_CHAR(t.inception_of_lease, 'yyyy-mm-dd') inception_of_lease,
t.contract_status,
t.early_termination_profile,
(SELECT
v.code_value_name
FROM
sys_code_values_v v
WHERE
v.code = 'CON500_CONTRACT_STATUS' AND
v.code_value = t.contract_status
) AS contract_status_n,
(SELECT su.description FROM sys_user su WHERE su.user_id = t.owner_user_id
) owner,
t.lease_times,
t.invoice_price,
t.finance_amount,
t.down_payment,
t.deposit,
t.lease_charge,
t.bp_id_agent_level1,
(SELECT
hls.bp_name
FROM
hls_bp_master hls
WHERE
hls.bp_id = t.bp_id_agent_level1
) bp_agent,
t.owner_user_id,
(SELECT
hbt.description
FROM
hls_business_type hbt
WHERE
hbt.enabled_flag = 'Y' AND
hbt.business_type = t.business_type
) business_type_n,
(SELECT
hlc.description
FROM
hls_lease_channel hlc
WHERE
hlc.lease_channel = t.lease_channel AND
hlc.enabled_flag = 'Y'
) lease_channel_n,
t.division,
(SELECT
t2.description
FROM
hls_division t2
WHERE
t2.enabled_flag = 'Y' AND
t2.division = t.division
) division_n
FROM
con_contract t,
hls_bp_master b,
hls_document_type_v dt
WHERE
t.bp_id_tenant = b.bp_id(+) AND
t.contract_status = 'INCEPT' AND
t.data_class = 'NORMAL' AND
dt.document_type(+) = t.document_type
and exists (select 1
from csh_write_off cwo, gld_write_off gwo
where cwo.contract_id = t.contract_id
and cwo.write_off_id = gwo.csh_write_off_id
and cwo.cf_item = 9
and gwo.cf_item = 1)
) t1 #WHERE_CLAUSE# #ORDER_BY_CLAUSE#
select * from
(
Select t.contract_id,
t.company_id,
t.business_type,
t.contract_number,
t.contract_name,
t.document_type,
dt.document_type_desc,
t.document_category,
dt.document_category_desc,
t.bp_id_tenant,
t.lease_execution_date,
b.bp_name,
b.bp_code,
--t.license_number,
TO_CHAR(t.lease_start_date, 'yyyy-mm-dd') lease_start_date,
TO_CHAR(t.lease_end_date, 'yyyy-mm-dd') lease_end_date,
(Select h.bp_name
From hls_bp_master h
Where h.bp_id = t.unit_id) As unit_id_n,
t.unit_id,
TO_CHAR(t.inception_of_lease, 'yyyy-mm-dd') inception_of_lease,
t.contract_status,
t.early_termination_profile,
(Select v.code_value_name
From sys_code_values_v v
Where v.code = 'CON500_CONTRACT_STATUS'
And v.code_value = t.contract_status) As contract_status_n,
(Select su.description
From sys_user su
Where su.user_id = t.owner_user_id) owner,
t.lease_times,
t.invoice_price,
t.finance_amount,
t.down_payment,
t.deposit,
t.lease_charge,
t.bp_id_agent_level1,
(Select hls.bp_name
From hls_bp_master hls
Where hls.bp_id = t.bp_id_agent_level1) bp_agent,
t.owner_user_id,
(Select hbt.description
From hls_business_type hbt
Where hbt.enabled_flag = 'Y'
And hbt.business_type = t.business_type) business_type_n,
(Select hlc.description
From hls_lease_channel hlc
Where hlc.lease_channel = t.lease_channel
And hlc.enabled_flag = 'Y') lease_channel_n,
t.division,
(Select t2.description
From hls_division t2
Where t2.enabled_flag = 'Y'
And t2.division = t.division) division_n
From con_contract t, hls_bp_master b, hls_document_type_v dt
Where t.bp_id_tenant = b.bp_id(+)
And t.contract_status = 'INCEPT'
And t.data_class = 'NORMAL'
And dt.document_type(+) = t.document_type
And Exists
(Select 1
From csh_write_off cwo, gld_write_off gwo
Where cwo.contract_id = t.contract_id
And cwo.write_off_id = gwo.csh_write_off_id
And nvl(cwo.reversed_flag, 'N') = 'N'
And nvl(gwo.reversed_flag, 'N') = 'N'
And cwo.cf_item = 9
And gwo.cf_item = 1) ) t1
#WHERE_CLAUSE# #ORDER_BY_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......
......@@ -50,7 +50,8 @@
From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount
0)) As unreceived_amount,
nvl(cwo.trans_pently_flag, 'N') trans_pently_flag
From con_contract_cashflow ccc,
con_contract c,
hls_bp_master h,
......
......@@ -58,77 +58,20 @@ select t.parent_company_id company_id
<bm:query-field field="dd_bank_account_name" queryOperator="="/>
<!--<bm:query-field name="bp_id"
queryExpression="(t.bp_id_tenant = ${@bp_id} or t.bp_id_agent_level1 = ${@bp_id} or ((select bp_category from hls_bp_master where bp_id = ${@bp_id}) = 'VENDER'))"/>-->
<bm:query-field name="bp_id"
queryExpression="( (t.bp_id_tenant In
decode((Select h.bp_category
From hls_bp_master h
Where h.bp_id = ${@bp_id}),
'TENANT',
decode(decode((Select h.bp_class
From hls_bp_master h
Where h.bp_id = ${@bp_id}),
'NP',
(Select Count(1)
From hls_bp_master hb
Where Trim(hb.bp_name) =
(Select Trim(hbm.bp_name)
From hls_bp_master hbm
Where hbm.bp_id = ${@bp_id})
Group By Trim(hb.bp_name), Trim(hb.id_card_no)),
'ORG',
(Select Count(1)
From hls_bp_master hb
Where Trim(hb.bp_name) =
(Select Trim(hbm.bp_name)
From hls_bp_master hbm
Where hbm.bp_id = ${@bp_id})
Group By Trim(hb.bp_name),
Trim(nvl(hb.social_code, 'N')))),
1,
${@bp_id},
(Select hbm.bp_id
From hls_bp_master hbm
Where hbm.bp_name =
(Select hbm.bp_name
From hls_bp_master hbm
Where hbm.bp_id = ${@bp_id})))))
Or (t.bp_id_agent_level1 In
decode((Select h.bp_category
From hls_bp_master h
Where h.bp_id = ${@bp_id}),
'AGENT',
decode(decode((Select h.bp_class
From hls_bp_master h
Where h.bp_id = ${@bp_id}),
'NP',
(Select Count(1)
From hls_bp_master hb
Where Trim(hb.bp_name) =
(Select Trim(hbm.bp_name)
From hls_bp_master hbm
Where hbm.bp_id = ${@bp_id})
Group By Trim(hb.bp_name), Trim(hb.id_card_no)),
'ORG',
(Select Count(1)
From hls_bp_master hb
Where Trim(hb.bp_name) =
(Select Trim(hbm.bp_name)
From hls_bp_master hbm
Where hbm.bp_id = ${@bp_id})
Group By Trim(hb.bp_name),
Trim(nvl(hb.social_code, 'N')))),
1,
${@bp_id},
(Select hbm.bp_id
From hls_bp_master hbm
Where hbm.bp_name =
(Select hbm.bp_name
From hls_bp_master hbm
Where hbm.bp_id = ${@bp_id})))))
Or ((Select bp_category From hls_bp_master Where bp_id = ${@bp_id}) =
'VENDER') )"/>
<bm:query-field name="bp_id" queryExpression="(Exists (Select 1 From (Select h.bp_id From hls_bp_master h Where h.bp_name = (Select hbm.bp_name From hls_bp_master hbm Where hbm.bp_id = ${@bp_id})) t1 Where t1.bp_id = t.bp_id_tenant) Or Exists
(Select 1
From (Select h.bp_id
From hls_bp_master h
Where h.bp_name =
(Select hbm.bp_name
From hls_bp_master hbm
Where hbm.bp_id = ${@bp_id})) t2
Where t2.bp_id = t.bp_id_agent_level1) Or Exists
(Select 1
From con_contract_lease_item ccli, hls_lease_item hli
Where ccli.lease_item_id = hli.lease_item_id
And hli.vender_id = ${@bp_id}
And t.contract_id = ccli.contract_id))"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like '%' || ${@bp_name} || '%'"/>
</bm:query-fields>
</bm:model>
......@@ -58,7 +58,7 @@
<!-- <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="deposit_flag"
queryExpression="((nvl(${@deposit_flag},'N') = 'Y' and cf_item in (1,8,9,250)) or (nvl(${@deposit_flag},'N') = 'N'))"/>
queryExpression="((nvl(${@deposit_flag},'N') = 'Y' and cf_item in (1,8,9,200,11)) or (nvl(${@deposit_flag},'N') = 'N'))"/>
<bm:query-field name="due_date_from"
queryExpression="due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="due_date_to"
......
......@@ -42,7 +42,6 @@
var hd_record = $(hd_id).getAt(0);
var lease_item_amount=hd_record.get('lease_item_amount');
if($(ds_id).getAll().dirty){
alert(111);
return;
}
......@@ -54,6 +53,8 @@
return;
}
var sum=0;
var sum_tax = 0;
var net_lease_item_amount = hd_record.get('net_lease_item_amount')||0;
for (var i = 0;i < records.length;i++) {
if(records[i].dirty){
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
......@@ -78,11 +79,22 @@
// return;
// }
// }
// 营业外收入或营业外支出科目金额超过0.5,请联系系统管理员!
if (!isNaN(records[i].get('tax_amount')||0)) {
sum_tax=plus((records[i].get('tax_amount')||0),(sum_tax||0));
}
}
if(sum!=lease_item_amount){
Leaf.showMessage('提示', '本次发票明细含税总计不等于该合同设备价!');
return;
}
var diff = ((net_lease_item_amount + sum_tax - lease_item_amount) > 0 ? (net_lease_item_amount + sum_tax - lease_item_amount) : (lease_item_amount - sum_tax - net_lease_item_amount));
if(diff > 0.5){
Leaf.showMessage('提示', '营业外收入或营业外支出科目金额超过0.5,请联系系统管理员!');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '确定提交审批吗?', function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
......
......@@ -67,7 +67,31 @@
Leaf.showMessage('提示', '罚息调整数据不能为空!');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交变更?', function () {
var csh_recordSelected = $('con7000_csh_write_off_ds').getSelected();
var csh_recordAll = $('con7000_csh_write_off_ds').getAll();
var received_amount = 0;
var uns_received_amount = 0;
var count = 0;
var msg = '您好,';
if(csh_recordSelected.length){
csh_recordSelected.forEach(function (v, i) {
received_amount = v.get('received_amount')||0;
csh_recordAll.forEach(function (v1, i1) {
uns_received_amount = v1.get('received_amount')||0;
if(received_amount > 0 && received_amount == uns_received_amount && v1.get(trans_pently_flag) == 'N'){
count = count + 1;
}
});
if(count > 0){
msg = msg + '营业核销' + received_amount + '元的违约金有' + count + '条记录,';
}
count = 0;
});
msg = msg + '您确认修改该笔违约金对应的会计核销记录吗?';
}
Leaf.showConfirm('${l:HLS.PROMPT}', msg, function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('submit_rent_trans_penalty_change_link').getUrl(),
......@@ -114,7 +138,21 @@
});
});
}
function con7000_csh_write_off_ds_load(ds) {
var records = ds.getAll();
if('${/parameter/@function}' == 'CON7001'){
if(records.length){
records.forEach(function(v,i){
if(v.data.trans_pently_flag == 'Y'){
setTimeout(function() {
ds.select(v);
}, 1);
}
});
}
}
}
]]></script>
<a:dataSets>
<a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true"
......@@ -127,7 +165,12 @@
<a:dataSet id="con7000_csh_write_off_ds" fetchAll="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_csh_write_off"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_csh_write_off/query?contract_id=${/parameter/@contract_id}"
selectable="true"/>
selectable="true">
<a:events>
<a:event name="load" handler="con7000_csh_write_off_ds_load"/>
</a:events>
</a:dataSet>
<a:dataSet id="con7000_gld_write_off_ds" fetchAll="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_gld_write_off"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_gld_write_off/query?record_id=${/parameter/@record_id}"/>
......
......@@ -13,7 +13,28 @@
function con7000_back() {
$('${/parameter/@winId}').close();
}
function con7000_csh_write_off_ds_load(ds) {
var records = ds.getAll();
if(records.length){
records.forEach(function(v,i){
if(v.data.trans_pently_flag == 'Y'){
setTimeout(function() {
ds.select(v);
}, 1);
}
});
}
}
function con7000_csh_write_off_ds_beforeselect(ds, record) {
if(record.get('trans_pently_flag') == 'N'){
return false;
}else{
return true;
}
}
function con7000_csh_write_off_ds_unselect(ds, record) {
return false;
}
]]></script>
<a:dataSets>
<a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true"
......@@ -23,7 +44,13 @@
<a:dataSet id="con7000_csh_write_off_ds" autoPageSize="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_csh_write_off"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_csh_write_off/query?contract_id=${/parameter/@contract_id}"
/>
selectable="true" showCheckAll="false">
<a:events>
<a:event name="load" handler="con7000_csh_write_off_ds_load"/>
<a:event name="beforeselect" handler="con7000_csh_write_off_ds_beforeselect"/>
<a:event name="unselect" handler="con7000_csh_write_off_ds_unselect"/>
</a:events>
</a:dataSet>
<a:dataSet id="con7000_gld_write_off_ds" autoPageSize="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_gld_write_off"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_gld_write_off/query?record_id=${/parameter/@record_id}"/>
......
......@@ -172,7 +172,7 @@
<a:field name="bp_id_agent_level1_n"/>
<a:field name="bp_name"/>
<a:field name="bp_id_tenant"/>
<a:field name="deposit_trans_type"/>
<a:field name="deposit_trans_type" defaultValue="${/parameter/@deposit_trans_type}"/>
<a:field name="deposit_amount" required="true"/>
......@@ -188,7 +188,7 @@
</a:mapping>
</a:field>
<a:field name="deposit_trans_type_desc" options="CUS102_DEPOSIT_TRANS_TYPE_DS"
returnField="deposit_trans_type" displayField="code_value_name" valueField="code_value" required="true"/>
returnField="deposit_trans_type" displayField="code_value_name" valueField="code_value" required="true" defaultValue="${/parameter/@deposit_trans_type_desc}" readOnly="true"/>
</a:fields>
<a:events>
<a:event name="update" handler="on_csh_trx_deposit_write_off_update"/>
......
......@@ -54,7 +54,9 @@
params: {
winId: 'csh_transaction_deposit_transfer_link_winid',
contract_id:record.get('contract_id'),
bp_id_agent_level1:record.get('bp_id')
bp_id_agent_level1:record.get('bp_id'),
deposit_trans_type:record.get('deposit_trans_type'),
deposit_trans_type_desc:record.get('deposit_trans_type_n')
},
url: url,
title: '保证金划转',
......
......@@ -342,7 +342,7 @@
</a:toolBar>-->
<a:columns>
<a:column name="transaction_num" prompt="CSH510.CSH_TRANSACTION.CSH_TRANSACTION_NUM" width="110" align="center"/>
<a:column name="bp_name" prompt="代理店" align="center"/>
<a:column name="bp_name" prompt="代理店/厂商" align="center"/>
<a:column name="bp_id_telnet_n" prompt="承租人" align="center"/>
<a:column name="contract_number" prompt="合同编号" align="center"/>
<a:column name="transaction_amount" align="right" prompt="CSH510.CSH_TRANSACTION.RECEIPT_AMOUNT" width="100" renderer="Leaf.formatMoney"/>
......
......@@ -314,7 +314,7 @@
<a:column name="transaction_amount" align="right" prompt="CSH510.CSH_TRANSACTION.RECEIPT_AMOUNT" width="100" renderer="Leaf.formatMoney"/>
<a:column name="transaction_date" renderer="Leaf.formatDate" align="center"/>
<a:column name="unwrite_off_amount" prompt="可退款金额" align="right" renderer="Leaf.formatMoney"/>
<a:column name="bp_name" prompt="代理店" align="center"/>
<a:column name="bp_name" prompt="代理店/厂商" align="center"/>
<a:column name="bp_id_telnet_n" prompt="承租人" align="center"/>
<a:column name="contract_number" prompt="合同编号" align="center"/>
<a:column name="deposit_trans_type_desc" prompt="保证金类型" align="center"/>
......
......@@ -357,7 +357,7 @@
<a:grid id="csh_transaction_receipt_maintain_grid_ds" bindTarget="csh_transaction_receipt_maintain_result_ds" marginHeight="200" marginWidth="80" navBar="true" >
<a:columns>
<a:column name="transaction_num" prompt="CSH510.CSH_TRANSACTION.CSH_TRANSACTION_NUM" renderer="seedetail_transaction_num" width="110" align="center"/>
<a:column name="bp_name" prompt="代理店" align="center"/>
<a:column name="bp_name" prompt="代理店/厂商" align="center"/>
<a:column name="bp_id_telnet_n" prompt="承租人" align="center"/>
<a:column name="contract_number" prompt="合同编号" align="center"/>
<a:column name="transaction_amount" align="right" prompt="CSH510.CSH_TRANSACTION.RECEIPT_AMOUNT" width="100" renderer="Leaf.formatMoney"/>
......
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