Commit 099a0f75 authored by stone's avatar stone

[fix]完成付款申请支付功能

parent e3f43592
......@@ -16,6 +16,7 @@
'NEW' approval_status,
v.invoice_uploaded_flag,
v.invoice_uploaded_flag_n,
v.bp_id_agent_level1,
v.times,
v.cashflow_id,
v.cashflow_id ref_doc_line_id,
......@@ -95,6 +96,7 @@
t.contract_name,
t.document_category,
t.search_term_1,
t.bp_id_agent_level1,
p.project_name,
t.bp_id_tenant tenant_bp_id,
h.description cf_description,
......
......@@ -13,7 +13,12 @@
from (select c.contract_number,
c.contract_name,
hbm.bp_name,
cpr.apply_pay_date,
cpr.bp_bank_account_id,
(select cph.payment_req_number
from csh_payment_req_hd cph
where cpr.payment_req_id = cph.payment_req_id) payment_req_number,
cpr.ref_doc_line_id cashflow_id,
(select times
from con_contract_cashflow ccc
where ccc.cashflow_id = cpr.ref_doc_line_id) times,
......@@ -25,13 +30,17 @@
where hci.cf_item = ccc.cf_item
and hci.cf_type = ccc.cf_type
and ccc.cashflow_id = cpr.ref_doc_line_id) CF_DESCRIPTION,
(select c.transaction_num
/* (select c.transaction_num
from csh_transaction c
where c.source_doc_line_id = cpr.payment_req_ln_id
and c.source_doc_id = cpr.payment_req_id) transaction_num,
(select c.bank_slip_num
from csh_transaction c
where c.source_doc_line_id = cpr.payment_req_ln_id
and c.source_doc_id = cpr.payment_req_id
and c.transaction_type = 'PAYMENT') transaction_num,
and c.transaction_type = 'PAYMENT') bank_slip_num,*/
--bp_id 存的是哪个字段
(select bp_name
from hls_bp_master hbm
where hbm.bp_id = cpr.bp_id) BP_ID_AGENT_N,
......@@ -48,8 +57,8 @@
cpr.amount_agent,
cpr.amount_vender,
--未付金额
(cpr.amount_agent-nvl(cpr.amount_agent_paid,0)) residual_agent_amount,
(cpr.amount_vender-nvl(cpr.amount_vender_paid,0)) residual_vender_amount,
(cpr.amount_agent - nvl(cpr.amount_agent_paid, 0)) residual_agent_amount,
(cpr.amount_vender - nvl(cpr.amount_vender_paid, 0)) residual_vender_amount,
(select bp_name
from hls_bp_master hbm
......
......@@ -155,7 +155,7 @@
hls_bp_master hbm,
con_contract t
WHERE i.contract_id = t.contract_id
AND i.lease_item_id = hli.lease_item_id
AND i.lease_item_id = hli.lease_item_id(+)
AND i.enabled_flag = 'Y'
AND i.equipment_type = 'MAIN'
AND t.contract_id = f.contract_id
......@@ -198,7 +198,7 @@
AND t.contract_status NOT IN
('NEW', 'SIGN', 'CANCEL', 'PENDING', 'CLOSED')
--测试用,cf_itme应当为0
AND f.cf_item <> 0) t1
AND f.cf_item in (0,21)) t1
#WHERE_CLAUSE#
#ORDER_BY_CLAUSE#
......
......@@ -17,7 +17,7 @@
p_payment_req_id=>${@payment_req_id},
p_session_id=>${/session/@session_id},
p_pay_date=>to_date(${@transaction_date},'yyyy-mm-dd'),
p_pay_amount=>${@transaction_amount},
p_pay_amount=>${@amt},
p_company_id=>${/session/@company_id},
p_internal_period_num=>${@internal_period_num},
p_period_name=>${@period_name},
......@@ -35,6 +35,8 @@
p_handling_charge=>nvl(${@handling_charge},0),
p_payment_method_id =>${@payment_method_id},
p_payment_status =>${@payment_status},
p_this_pay_agent_amount=>nvl(${@this_pay_agent_amount},0),
p_this_pay_vender_amount=>nvl(${@this_pay_vender_amount},0),
p_merge_flag =>nvl(${@merge_flag},'N'),
p_due_amount =>nvl(${@due_amount},0));
end;]]></bm:update-sql>
......
......@@ -23,7 +23,7 @@
where cprl.payment_req_id = h.payment_req_id) residual_agent_amount,
--统计所有的未付厂商金额
(select sum(cprl.amount_vender -
nvl(cprl.amount_agent_paid, 0))
nvl(cprl.amount_vender_paid, 0))
from csh_payment_req_ln cprl
where cprl.payment_req_id = h.payment_req_id) residual_vender_amount,
--获取厂商字段
......@@ -130,6 +130,15 @@
-- )
-- )
-- )price,
( select bp_name
from hls_bp_master hbm
where hbm.bp_id = (
select hbmba.bp_id
from csh_payment_req_ln cprl , hls_bp_master_bank_account hbmba
where cprl.bp_bank_account_id=hbmba.bank_account_id
and cprl.payment_req_id=h.payment_req_id
and rownum <= 1
)) bp_id_agent_n,
(select sv.code_value_name
from hls_bpm_interface hi, sys_code_values_v sv
where hi.payment_req_id = h.payment_req_id
......@@ -149,9 +158,8 @@
AND h.company_id IN
(SELECT company_id
FROM fnd_companies
START WITH company_id = ${/session/@company_id}
START WITH company_id = 1
CONNECT BY prior company_id = parent_biz_company_id)) v
#WHERE_CLAUSE#
ORDER BY v.req_date DESC, v.payment_req_number DESC
]]></bm:query-sql>
......
......@@ -285,7 +285,7 @@
var hd_record = $(ds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
var line_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var line_record = $(line_ds_id).getAll()[0];
var line_record = $(line_ds_id).getAt(0);
if (line_record.get('cf_item') == '52' || line_record.get('cf_item') == '509') {
//保证金退还Doodream审批接口 CFL-FE5D96CF-694C-4290-A22E-241FC3F6DEF0
var case_type = 'CFL-FE5D96CF-694C-4290-A22E-241FC3F6DEF0';
......@@ -412,6 +412,14 @@
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () {
Leaf.SideBar.enable = false;
//提交之前必须要保存
/* var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
if(payment_req_id){
$L.showInfoMessage("提示",'请先保存数据!');
return;
}*/
window['${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK'](csh_payment_req_submit_finally);
};
......@@ -603,6 +611,7 @@
line_records = ln_ds.getSelected();
var payment_req_id = hd_record.get('payment_req_id');
if (line_records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择一条单据进行确认!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
......@@ -632,6 +641,7 @@
return;
} */
//支付金额为应付代理店
var this_pay_amount=plus(line_record.get('residual_agent_amount'),line_record.get('residual_vender_amount'));
if (this_pay_amount <=0) {
......@@ -653,14 +663,18 @@
bp_bank_account_code_n = line_record.get('bp_bank_account_code_n');
bp_bank_account_id = line_record.get('bp_bank_account_id');
contract_id = line_record.get('contract_id');
line_record.set('loan_date',hd_record.get('loan_date'))
line_record.set('loan_date',hd_record.get('loan_date'));
line_record.set('hdds_id',hdds_id);
line_record.set('lnds_id',lnds_id);
line_record.set('winid','csh_payment_req_pay_win');
var data=[];
data.push(line_record);
var win = new Leaf.Window({
id: 'csh_payment_req_pay_win',
url: $('csh_payment_req_pay_win_link').getUrl(),
params:
{
params:line_record.data,
/* {
payment_req_id: payment_req_id,
winid: 'csh_payment_req_pay_win',
hdds_id: hdds_id,
......@@ -674,7 +688,7 @@
loan_date: hd_record.get('loan_date')
//first_contract_day: hd_record.get('first_contract_day')
// ,first_repayment_flag: first_repayment_flag
},
},*/
title: '${l:CSH502.CSH_PAYMENT_REQ_PAY}',
fullScreen: true
});
......@@ -710,8 +724,14 @@
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if((amount_agent+amount_vender+other_payment2)!=due_amount){
check_due_amount_flag=false;
console.log(amount_agent);
console.log(amount_vender);
console.log(other_payment2);
console.log(due_amount);
if(plus(plus(amount_agent,amount_vender),other_payment2)!=due_amount){
$L.showErrorMessage("提示",'应付我司金额,委托付款金额和首付款抵充金额之后应等于应付金额!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
//本次申请金额等于委托加我司
var this_apply_amount=plus(amount_agent,amount_vender);
......@@ -1139,9 +1159,10 @@
// };
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) {
/* debugger
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
qpara['payment_req_id'] = hd_record.get('payment_req_id');
var hd_record = $(hdds_id).getAt(0);
qpara['payment_req_id'] = hd_record.get('payment_req_id');*/
/*if (hd_record.get('bp_id_vender_n')) {
qpara['bp_id_vender_n'] = hd_record.get('bp_id_vender_n');
}*/
......
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