Commit 05d9f8f2 authored by stone's avatar stone

Merge branch 'feature/payment_feature' into develop

parents e0469d5c 6ceb9f8e
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool CON_CONTRACT.log
PROMPT
PROMPT CREATING TABLE TRAIN_CONFIG
PROMPT ============================
PROMPT
WHENEVER SQLERROR CONTINUE
DROP TABLE CON_CONTRACT;
WHENEVER SQLERROR EXIT FAILURE ROLLBACK
BEGIN
alter table csh_payment_req_ln add (amount_vender number);
alter table csh_payment_req_ln add (amount_agent number);
alter table csh_payment_req_ln add (down_payment_rushoff number);
comment on column csh_payment_req_ln.amount_vender is '应付厂商金额';
comment on column csh_payment_req_ln.amount_agent is '应付代理店金额';
comment on column csh_payment_req_ln.down_payment_rushoff is '首付款抵冲金额';
end;
SPOOL OFF
EXIT
\ No newline at end of file
......@@ -11,6 +11,11 @@
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT v.contract_id,
v.vender_name,
v.vender_bank_account_id,
v.vender_bank_account_number,
v.other_payment2,
'NEW' approval_status,
v.invoice_uploaded_flag,
v.invoice_uploaded_flag_n,
v.times,
......@@ -35,7 +40,8 @@
v.bp_name,
v.bp_code,
v.applied_pay_amount,
v.residual_amount AS amount,
--v.residual_amount AS amount,
0.00 AS amount,
--v.due_amount- NVL(v.applied_pay_amount,0) AS amount,
v.bp_category_desc,
v.search_term_1,
......@@ -192,11 +198,9 @@
WHERE gc.currency_code = t.currency) currency_name,
TO_CHAR(f.due_date, 'yyyy-mm-dd') due_date,
NVL(f.due_amount, 0) - NVL(f.received_amount, 0) residual_amount,
DECODE(f.cf_item,
'62',
NULL,
NVL(${@payment_bp_id},
csh_payment_req_pkg.get_bp_id(t.contract_id))) bp_id,
(select c.bp_id_tenant
from con_contract c
where c.contract_id=t.contract_id ) bp_id,
DECODE(f.cf_item,
'62',
NULL,
......@@ -266,6 +270,46 @@
-- )price
i.price,
i.factory_price,
--获得厂商的相关信息
(select bp_name
from hls_bp_master hbm
where hbm.bp_id =
(select hli.vender_id
from hls_lease_item hli
where hli.lease_item_id =
(select lease_item_id
from con_contract_lease_item c
where c.contract_id = t.contract_id))) vender_name,
(select bp_name
from hls_bp_master hbm
where hbm.bp_id =
(select hli.vender_id
from hls_lease_item hli
where hli.lease_item_id =
(select lease_item_id
from con_contract_lease_item c
where c.contract_id = t.contract_id))) vender_bank_account_id,
(select hbba.bank_account_num
from hls_bp_master_bank_account hbba
where hbba.bp_id =
(select hli.vender_id
from hls_lease_item hli
where hli.lease_item_id =
(select lease_item_id
from con_contract_lease_item c
where c.contract_id = t.contract_id)))vender_bank_account_number,
--首付款抵充金
(select nvl(hd.other_payment2,0)
from hls_fin_calculator_hd hd
where hd.calc_session_id =
(select PQ.CALC_SESSION_ID
from prj_quotation pq
where pq.document_id = (select cc.project_id
from con_contract cc
where cc.contract_id =f.contract_id)
and pq.document_category = 'PROJECT')) other_payment2,
DECODE(t.division, '10', 'CNYA', '00', 'CNYA', '01', 'CNYB') sap_bvtyp,
(SELECT v.code_value_name
FROM sys_code_values_v v
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: qwm
$Date: 2013-5-24 下午03:50:31
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1"
baseTable="CSH_PAYMENT_REQ_LN" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select *
from (select c.contract_number,
c.contract_name,
hbm.bp_name,
(select times
from con_contract_cashflow ccc
where ccc.cashflow_id = cpr.ref_doc_line_id) times,
(select ccc.due_amount
from con_contract_cashflow ccc
where ccc.cashflow_id = cpr.ref_doc_line_id) due_amount,
(select description
from hls_cashflow_item hci, con_contract_cashflow ccc
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 bp_name
from hls_bp_master hbm
where hbm.bp_id = c.bp_id_agent_level1) BP_ID_AGENT_N,
(select hbm.bank_account_name
from hls_bp_master_bank_account hbm
where hbm.bp_id = c.bp_id_agent_level1) BP_BANK_ACCOUNT_ID,
(select hbm.bank_account_num
from hls_bp_master_bank_account hbm
where hbm.bp_id = c.bp_id_agent_level1) BP_BANK_ACCOUNT_NUM,
--应付我司金额
cpr.amount_agent,
cpr.amount_vender,
(select bp_name
from hls_bp_master hbm
where hbm.bp_id =
(select ccli.vender_id
from con_contract_lease_item ccli,
hls_lease_item hli
where ccli.lease_item_id = hli.lease_item_id
and ccli.contract_id = c.contract_id)) vender_name,
(select hbm.bank_account_name
from hls_bp_master_bank_account hbm
where hbm.bp_id =
(select ccli.vender_id
from con_contract_lease_item ccli,
hls_lease_item hli
where ccli.lease_item_id = hli.lease_item_id
and ccli.contract_id = c.contract_id)) VENDER_BANK_ACCOUNT_ID,
(select hbm.bank_account_num
from hls_bp_master_bank_account hbm
where hbm.bp_id =
(select ccli.vender_id
from con_contract_lease_item ccli,
hls_lease_item hli
where ccli.lease_item_id = hli.lease_item_id
and ccli.contract_id = c.contract_id)) VENDER_BANK_ACCOUNT_number,
cpr.amount,
--首付款抵充金额
(select nvl(hd.other_payment2, 0)
from hls_fin_calculator_hd hd
where hd.calc_session_id =
(select PQ.CALC_SESSION_ID
from prj_quotation pq
where pq.document_id =
(select cc.project_id
from con_contract cc
where cc.contract_id = c.contract_id)
and pq.document_category = 'PROJECT')) other_payment2,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = cpr.currency_code) currency_name,
cpr.payment_req_ln_id,
cpr.payment_req_id,
cpr.payment_req_ln_type,
cpr.ref_doc_id,
cpr.ref_doc_line_id,
cpr.ref_doc_category
from csh_payment_req_ln cpr, con_contract c, hls_bp_master hbm
where cpr.ref_doc_category = 'CONTRACT'
and c.contract_id = cpr.ref_doc_id
and hbm.bp_id = c.bp_id_tenant )v
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: qwm
$Date: 2013-5-24 上午11:25:41
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select
distinct vender_name
from hls_lease_item
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="vender_name" databaseType="varchar" datatype="java.lang.String" physicalName="vender_name" forDisplay="true" forQuery="true" prompt="厂商名称"/>
</bm:fields>
<bm:query-fields>
<bm:query-field field="vender_name" queryOperator="like"/>
</bm:query-fields>
</bm:model>
......@@ -54,6 +54,7 @@
modelaction="update"/>
<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id"
url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id"
......@@ -82,6 +83,7 @@
var dirty_flag = 'N';
window['${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
var dirty_flag = 'Y';
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
......@@ -662,42 +664,93 @@
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var check_flag = false;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var ds_line_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var total_amount_agent=0;
var total_amount_vender=0;
var total_apply_amount=0;
//检验输入的数据是否符合要求
var check_due_amount_flag=true;
var line_datas=$(ds_line_id).data;
for(var i=0;i<line_datas.length;i++){
var line_data=line_datas[i];
//应付我司金额
var amount_agent=line_data.get('amount_agent');
var amount_vender= line_data.get('amount_vender');
var due_amount= line_data.get('due_amount');
//首付款抵充金额
var other_payment2=line_data.get('other_payment2');
if(amount_agent<0||amount_vender<0){
$L.showErrorMessage("提示",'应付我司金额和首付款抵充金额不能为负数!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if((amount_agent+amount_vender+other_payment2)!=due_amount){
check_due_amount_flag=false;
}
//本次申请金额等于委托加我司
var this_apply_amount=plus(amount_agent,amount_vender);
total_apply_amount=plus(total_apply_amount,this_apply_amount);
line_data.set('amount',this_apply_amount);
total_amount_agent=plus(total_amount_agent,amount_agent);
total_amount_vender=plus(total_amount_vender,amount_vender);
}
if(!check_due_amount_flag){
$L.showInfoMessage("提示",'应付金额应等于应付我司金额,委托付款金额和首付款抵充金额之和!');
}
//给头表赋值
$(ds_id).getAt(0).set('amount_agent_total',total_amount_agent);
$(ds_id).getAt(0).set('amount_vender_total',total_amount_vender);
$(ds_id).getAt(0).set('amount',total_apply_amount);
$(ds_id).getAt(0).set('company_id','${/session/@company_id}');
$(ds_id).getAt(0).set('transaction_category','BUSINESS');
$(ds_id).getAt(0).set('submitted_flag','N');
$(ds_id).getAt(0).set('printed_flag','N');
$(ds_id).getAt(0).set('document_category','PAYMENT_REQ');
//确认保存
var hd_record = $(ds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
console.log( $(ds_id));
console.log( $(ds_line_id));
if(payment_req_id){
if (payment_req_id) {
Leaf.request({
url: $('${/parameter/@layout_code}csh511_csh_payment_req_hd_query').getUrl(),
para: {
payment_req_id: payment_req_id,
},
success: function(res) {
success: function (res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
if (res.result.record.submitted_flag =='Y'){
if (res.result.record.submitted_flag == 'Y') {
Leaf.showMessage('${l:PROMPT}', '该单据已经提交');
check_flag = false;
}else{
} else {
check_flag = true;
}
},
error: function() {
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
check_flag = false;
},
failure: function() {
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
check_flag = false;
},
sync: true,
scope: this
});
}else{
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
} else {
check_flag = true;
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return check_flag;
return check_flag||false;
};
//调用合同后督
......@@ -848,20 +901,30 @@
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
dirty_flag = 'N';
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');
//获得相应的行信息
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
$(lnds_id).setQueryUrl('${/request/@context_path}/autocrud/csh.CSH501.csh_payment_req_ln_query_after_save/query?payment_req_id=' + payment_req_id);
var contract_id = '${/parameter/@contract_id}';
if (payment_req_id) {
$(hdds_id).setQueryParameter('payment_req_id', payment_req_id);
$(hdds_id).query();
$(lnds_id).query();
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存数据');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
function csh504_prepayment_dk_link(record_id, name) {
......@@ -1061,6 +1124,7 @@
function on_csh_payment_req_temp_ln_ds_query(ds, qpara) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
qpara['payment_bp_id'] = '${/parameter/@payment_bp_id}';
}
......@@ -1087,6 +1151,7 @@
window['${/parameter/@layout_code}_on_layout_dynamic_grid_unselect'] = function (ds, record, bp_seq) {
record.set('pay_amount', '');
};
// window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function() {
// Leaf.showConfirm('${l:HLS.PROMPT}', '是否确定提起银行付款', function() {
// var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
......@@ -1113,6 +1178,8 @@
// };
window['${/parameter/@layout_code}_upload_layout_dynamic_click'] = function () {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
......
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