Commit 6ceb9f8e authored by stone's avatar stone

[fix]修改付款查询页面,修改付款申请页面

parent fb0dd2f1
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>
......@@ -10,8 +10,17 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.*,(select v.code_value_name from sys_code_values_v v where v.code = 'CON_WRITE_OFF_FLAG' and v.code_value = t1.cf_61_write_off_flag) cf_61_write_off_flag_n
FROM (SELECT t.contract_id,
SELECT t1.*,
(select v.code_value_name
from sys_code_values_v v
where v.code = 'CON_WRITE_OFF_FLAG'
and v.code_value = t1.cf_61_write_off_flag) cf_61_write_off_flag_n,
(select v.code_value_name
from sys_code_values_v v
where v.code = 'VENDER_NAME'
and v.code_value = t1.vender_name) vender_name_n
FROM (SELECT hli.vender_name,
t.contract_id,
t.contract_name,
f.cashflow_id,
t.search_term_1,
......@@ -67,38 +76,6 @@
FROM hls_business_type hbt
WHERE t.business_type = hbt.business_type
AND rownum = 1) con_business_type_n,
/*(SELECT m.taxpayer_type
FROM hls_bp_master_lv m
WHERE m.bp_id = csh_payment_req_pkg.get_bp_id(t.contract_id)) taxpayer_type,
(SELECT v.code_value_name AS value_name
FROM sys_code_values_v v
WHERE v.code = 'HLS211_TAXPAYER_TYPE'
AND v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code_value =
(SELECT m.taxpayer_type
FROM hls_bp_master_lv m
WHERE m.bp_id =
csh_payment_req_pkg.get_bp_id(t.contract_id))) taxpayer_type_n,*/
/* (SELECT v.code_value_name
FROM hls_product_plan_definition hls,
con_contract_lease_item ccl,
con_contract cc,
sys_code_values_v v
WHERE ccl.contract_id = t.contract_id
AND cc.contract_id = ccl.contract_id
AND ccl.product_plan_id = hls.product_plan_id
AND cc.data_class = 'NORMAL'
AND v.code = 'PRODUCT_CATEGORY'
AND v.code_value = hls.product_type) product_type_n,
(SELECT hls.product_name_write
FROM hls_product_plan_definition hls,
con_contract cc,
con_contract_lease_item ccl
WHERE ccl.contract_id = t.contract_id
AND cc.contract_id = ccl.contract_id
AND ccl.product_plan_id = hls.product_plan_id
AND cc.data_class = 'NORMAL') product_name_write,*/
t.cdd_list_id,
t.division,
(SELECT h8.description
......@@ -120,7 +97,9 @@
WHERE ai.contract_id = t.contract_id)) invoice_uploaded_flag_n,
i.pattern,
i.machine_number,
(SELECT to_char(substr(wm_concat(cccr.interface_name), 1, 1000))
(SELECT to_char(substr(wm_concat(cccr.interface_name),
1,
1000))
FROM con_contract_case_record cccr
WHERE cccr.document_id = t.contract_id
AND cccr.document_table = 'CON_CONTRACT') interface_name,
......@@ -130,13 +109,13 @@
AND cccr.document_table = 'CON_CONTRACT') status_n,
i.price,
i.factory_price,
nvl(t.first_delay_flag,'N') first_delay_flag,
nvl(t.first_delay_flag, 'N') first_delay_flag,
(SELECT v.code_value_name AS value_name
FROM sys_code_values_v v
WHERE v.code = 'YES_NO'
AND v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code_value = nvl(t.first_delay_flag,'N')) first_delay_flag_n,
AND v.code_value = nvl(t.first_delay_flag, 'N')) first_delay_flag_n,
t.bp_id_agent_level1,
(SELECT bp.bp_name
FROM hls_bp_master bp
......@@ -144,14 +123,15 @@
(SELECT bp.extra_nam
FROM hls_bp_master bp
WHERE bp.bp_id = t.bp_id_agent_level1) agent_extra_nam,
nvl((select
(case
when sum(ccc.due_amount) = sum(ccc.received_amount) then
nvl((select (case
when sum(ccc.due_amount) =
sum(ccc.received_amount) then
'FULL'
when sum(ccc.received_amount) = 0 then
'NOT'
when sum(ccc.received_amount) > 0 and
sum(ccc.due_amount) > sum(ccc.received_amount) then
sum(ccc.due_amount) >
sum(ccc.received_amount) then
'PARTIAL'
else
'NOT'
......@@ -161,13 +141,21 @@
and ccc.cf_status = 'RELEASE'
and ccc.cf_direction = 'INFLOW'
and ccc.contract_id = t.contract_id
group by ccc.contract_id),'FULL') cf_61_write_off_flag
group by ccc.contract_id),
'FULL') cf_61_write_off_flag,
--add by shen
(select bp_name
from hls_bp_master
where hls_bp_master.bp_id = t.bp_id_agent_level1) bp_id_agent_n
FROM con_contract_cashflow f,
hls_cashflow_item h,
con_contract_lease_item i,
hls_lease_item hli,
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.enabled_flag = 'Y'
AND i.equipment_type = 'MAIN'
AND t.contract_id = f.contract_id
......@@ -207,8 +195,10 @@
),
0)) > 0
AND t.data_class = 'NORMAL'
AND t.contract_status NOT IN ('NEW','SIGN','CANCEL', 'PENDING', 'CLOSED')
AND t.contract_status NOT IN
('NEW', 'SIGN', 'CANCEL', 'PENDING', 'CLOSED')
AND f.cf_item <> 0) t1
#WHERE_CLAUSE#
#ORDER_BY_CLAUSE#
......@@ -251,11 +241,10 @@
<bm:field name="lessor_name"/>
<bm:field name="con_business_type"/>
<bm:field name="con_business_type_n"/>
<!--<bm:field name="taxpayer_type"/>-->
<!--<bm:field name="taxpayer_type_n"/>-->
<!--<bm:field name="product_type_n"/>-->
<!--<bm:field name="product_name_write"/>-->
<bm:field name="cdd_list_id"/>
<bm:field name="bp_id_agent_n"/>
<bm:field name="vender_name"/>
<bm:field name="vender_name_n"/>
<bm:field name="division"/>
<bm:field name="division_n"/>
<bm:field name="first_contract_day"/>
......@@ -272,7 +261,6 @@
<bm:field name="bp_id_agent_level1_n"/>
<bm:field name="agent_extra_nam"/>
<bm:field name="cf_61_write_off_flag"/>
<bm:field name="cf_61_write_off_flag_n"/>
</bm:fields>
<bm:features>
......@@ -281,41 +269,45 @@
Packages.leaf.plugin.script.engine.ScriptImportor.defineExternScript(cx, this, $ctx.getData(), "aut_authority_bm_validate.js");
]]></s:bm-script>
</bm:features>
<!--只查找该代理店-->
<bm:data-filters>
<!-- <bm:data-filter name="enabled_flag" enforceOperations="query" expression="(t1.enabled_flag=&apos;Y&apos;)"/>-->
</bm:data-filters>
<bm:query-fields>
<!--<bm:query-field name="pay_contract_from" datatype="java.lang.String" queryExpression="t1.contract_number&gt;=${@pay_contract_from}"/>-->
<!--<bm:query-field name="pay_contract_to" datatype="java.lang.String" queryExpression="t1.contract_number&lt;=${@pay_contract_to}"/>-->
<bm:query-field name="contract_number" datatype="java.lang.String"
<bm:query-field name="contract_number"
queryExpression="t1.contract_number like ${@contract_number}"/>
<bm:query-field name="due_date_from" datatype="java.lang.String"
queryexpression="t1.due_date &gt;= ${@due_date_from}"/>
<bm:query-field name="due_date_to" datatype="java.lang.String"
queryexpression="((t1.due_date &lt;= ${@due_date_to}) or (${@outflow_id} is not null)) "/>
<bm:query-field name="due_amount_from" datatype="java.lang.String"
<bm:query-field name="due_date_from"
queryExpression="t1.due_date &gt;= ${@due_date_from}"/>
<bm:query-field name="due_date_to"
queryExpression="((t1.due_date &lt;= ${@due_date_to}) or (${@outflow_id} is not null)) "/>
<bm:query-field name="due_amount_from"
queryExpression="t1.due_amount&gt;=${@due_amount_from}"/>
<bm:query-field name="due_amount_to" datatype="java.lang.String"
<bm:query-field name="due_amount_to"
queryExpression="t1.due_amount&lt;=${@due_amount_to}"/>
<bm:query-field name="project_name" datatype="java.lang.String"
<bm:query-field name="project_name"
queryExpression="t1.project_name LIKE ${@project_name}"/>
<bm:query-field name="bp_code_tenant_from" datatype="java.lang.String"
<bm:query-field name="bp_code_tenant_from"
queryExpression="t1.bp_code&gt;=${@bp_code_tenant_from}"/>
<bm:query-field name="bp_code_tenant_to" datatype="java.lang.String"
<bm:query-field name="bp_code_tenant_to"
queryExpression="t1.bp_code&lt;=${@bp_code_tenant_to}"/>
<bm:query-field name="bp_code_tenant" datatype="java.lang.String"
<bm:query-field name="bp_code_tenant"
queryExpression="t1.bp_id_tenant_c= ${@bp_code_tenant}"/>
<bm:query-field name="bp_name_tenant" datatype="java.lang.String"
<bm:query-field name="bp_name_tenant"
queryExpression="t1.bp_id_tenant_n= ${@bp_name_tenant}"/>
<bm:query-field name="bp_id_agent_level1" datatype="java.lang.String"
<bm:query-field name="bp_id_agent_level1"
queryExpression="t1.bp_id_agent_level1= ${@bp_id_agent_level1}"/>
<bm:query-field name="bp_id_agent_level1_n" datatype="java.lang.String"
<bm:query-field name="bp_id_agent_level1_n"
queryExpression="t1.bp_id_agent_level1_n= ${@bp_id_agent_level1_n}"/>
<bm:query-field name="bp_id_tenant" datatype="java.lang.String"
<bm:query-field name="bp_id_tenant"
queryExpression="t1.bp_id_tenant= ${@bp_id_tenant}"/>
<bm:query-field name="currency" datatype="java.lang.String" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="cf_item" datatype="java.lang.String" queryExpression="t1.cf_item = ${@cf_item}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="cf_item" queryExpression="t1.cf_item = ${@cf_item}"/>
<bm:query-field name="serial_number" queryExpression="t1.serial_number like ${@serial_number}"/>
<bm:query-field name="project_number_from" datatype="java.lang.String"
<bm:query-field name="project_number_from"
queryExpression="t1.project_number&gt;=${@project_number_from}"/>
<bm:query-field name="project_number_to" datatype="java.lang.String"
<bm:query-field name="project_number_to"
queryExpression="t1.project_number&lt;=${@project_number_to}"/>
<bm:query-field name="bp_id"
queryExpression="exists(select 1 from con_contract_bp ccb where ccb.contract_id=t1.contract_id and ccb.bp_id=${@bp_id})"/>
......@@ -323,11 +315,12 @@
<bm:query-field name="lessor_name" queryExpression="t1.lessor_name = ${@lessor_name}"/>
<bm:query-field name="division" queryExpression="t1.division = ${@division}"/>
<bm:query-field name="times" queryExpression="t1.times = ${@times}"/>
<bm:query-field name="times_from" datatype="java.lang.String" queryExpression="t1.times&gt;=${@times_from}"/>
<bm:query-field name="times_to" datatype="java.lang.String" queryExpression="t1.times&lt;=${@times_to}"/>
<bm:query-field name="times_from" queryExpression="t1.times&gt;=${@times_from}"/>
<bm:query-field name="times_to" queryExpression="t1.times&lt;=${@times_to}"/>
<bm:query-field name="outflow_id" queryExpression="t1.cashflow_id = ${@outflow_id}"/>
<bm:query-field name="invoice_uploaded_flag_n" queryExpression="t1.invoice_uploaded_flag_n = ${@invoice_uploaded_flag_n}"/>
<bm:query-field name="first_delay_flag_n" queryExpression="t1.first_delay_flag_n = ${@first_delay_flag_n}"/>
<bm:query-field name="cf_61_write_off_flag" queryExpression="t1.cf_61_write_off_flag = ${@cf_61_write_off_flag}"/>
<bm:query-field name="vender_name" queryExpression="t1.vender_name=${@vender_name}"/>
</bm:query-fields>
</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();
......
......@@ -19,6 +19,11 @@
<div/>
<script type="text/javascript"><![CDATA[
Leaf.request(function(){
console.log('${/session}');
})
var cashflow_id = '';
function csh501_payment_return() {
......@@ -28,17 +33,27 @@
function confirmFun() {
var a = $('csh_payment_req_selectedDs').getSelected();
var record = a[0];
var cashflow_id_list = [];
var param = {};
var contract_id_list = [];
if (record == undefined) {
Leaf.showMessage('${l:PROMPT_MESSAGE}', '至少选择一条现金流!', null, 250, 100);
} else {
return;
}
//对是否为同一个厂商进行检查
var vender_name=record.get('vender_name');
var vender_flag=true;
for (i = 0; i < a.length; i++) {
//检验厂商
if(a[i].get('vender_name')!=vender_name){
vender_flag=false;
$L.showErrorMessage("提示",'请选择厂商相同的现金流信息!');
return;
}
cashflow_id = a[i].get('cashflow_id');
var arr = {};
var arrcon = {};
contract_id_list[i] = a[i].get('contract_id');
arr['_status'] = 'insert';
arr['cashflow_id'] = cashflow_id;
......@@ -60,10 +75,9 @@
}
param['details'] = cashflow_id_list;
param['contract_id'] = record.get('contract_id');
// if (max != min) {
// Leaf.showMessage('${l:PROMPT_MESSAGE}', '请选择合同号相同的单据!', null, 250, 100);
// } else {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.SAVING}');
console.log(param);
Leaf.request({
url: $('csh_payment_req_cashflow_id_link').getUrl(),
para: param,
......@@ -90,6 +104,7 @@
param['cdd_list_id'] = record.get('cdd_list_id');
param['division'] = record.get('division');
param['first_contract_day'] = record.get('first_contract_day');
//add by 9188
if (a.length == 1) {
param['contract_number'] = record.get('contract_number');
......@@ -114,7 +129,6 @@
// }
}
}
function csh511_prepayment_create() {
......@@ -186,6 +200,7 @@
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CSH501"/>
<a:dataSets>
<a:dataSet id="vender_name_ds" lookupCode="VENDER_NAME"/>
<a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
<a:dataSet id="vat_flag_ds">
<a:datas>
......@@ -200,7 +215,7 @@
<a:dataSet id="division_ds" loadData="true" model="basic.hls_division_for_lov"/>
<a:dataSet id="csh_payment_req_query_ds" autoCreate="true">
<a:fields>
<a:field name="vender_name_n" returnField="vender_name" displayField="code_value_name" valueField="code_value" options="vender_name_ds"/>
<a:field name="times"/>
<a:field name="due_date_to" defaultValue="${/model/sys_time_default_value_list/record/@now_time}"/>
<a:field name="project_number_from" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500" title="ACR510.FIELD.PROJECT_NUMBER_FROM">
......@@ -289,7 +304,7 @@
<a:form column="4" labelWidth="100" marginWidth="40" title="CSH501.CSH_REQ_CREATE">
<!--<a:textField name="pay_contract_from" bindTarget="csh_payment_req_query_ds" prompt="支付表编号从" width="150"/>-->
<!--<a:textField name="pay_contract_to" bindTarget="csh_payment_req_query_ds" prompt="支付表编号从" width="150"/>-->
<a:textField name="contract_number" bindTarget="csh_payment_req_query_ds" prompt="合同号"/>
<a:textField name="contract_number" bindTarget="csh_payment_req_query_ds" prompt="合同号"/>
<!-- <a:lov name="project_number_from" bindTarget="csh_payment_req_query_ds" prompt="HLS.PROJECT_NUMBER_FROM">
<a:events>
<a:event name="focus" handler="function(object){on_std_focus(object,&apos;PROJECT&apos;)}"/>
......@@ -300,7 +315,7 @@
<a:event name="focus" handler="function(object){on_std_focus(object,&apos;PROJECT&apos;)}"/>
</a:events>
</a:lov> -->
<a:lov name="bp_name_tenant" bindTarget="csh_payment_req_query_ds" prompt="承租人">
<a:lov name="bp_name_tenant" bindTarget="csh_payment_req_query_ds" prompt="商业伙伴名称">
<a:events>
<a:event name="focus" handler="function(object){on_std_focus(object,&apos;BP&apos;)}"/>
</a:events>
......@@ -327,20 +342,21 @@
<!--</a:events>-->
<!--</a:lov>-->
<!--<a:textField name="bp_name" bindTarget="csh_payment_req_query_ds" prompt="付款对象"/>-->
<a:textField name="times_from" bindTarget="csh_payment_req_query_ds" prompt="期次从"/>
<!-- <a:textField name="times_from" bindTarget="csh_payment_req_query_ds" prompt="期次从"/>-->
<a:lov name="cf_item_desc" bindTarget="csh_payment_req_query_ds" prompt="现金流类型"/>
<a:numberField name="due_amount_from" allowDecimals="true" allowFormat="true" bindTarget="csh_payment_req_query_ds" prompt="应付金额从"/>
<a:datePicker name="due_date_from" bindTarget="csh_payment_req_query_ds" prompt="应付日期从"/>
<a:datePicker name="due_date_to" bindTarget="csh_payment_req_query_ds" prompt="应付日期到"/>
<a:comboBox name="vender_name_n" bindTarget="csh_payment_req_query_ds" prompt="厂商"/>
<a:numberField name="due_amount_from" allowDecimals="true" allowFormat="true" bindTarget="csh_payment_req_query_ds" prompt="应付金额从"/>
<a:numberField name="due_amount_to" allowDecimals="true" allowFormat="true" bindTarget="csh_payment_req_query_ds" prompt="应付金额到"/>
<!--<a:comboBox name="currency_name" bindTarget="csh_payment_req_query_ds" prompt="HLS.CURRENCY" width="150"/>-->
<!-- <a:comboBox name="vat_flag" bindTarget="csh_payment_req_query_ds" prompt="增值税标志"/> -->
<!-- <a:comboBox name="vat_flag" bindTarget="csh_payment_req_qu ery_ds" prompt="增值税标志"/> -->
<!--<a:comboBox name="division_n" bindTarget="csh_payment_req_query_ds" prompt="产品线"/>-->
<a:textField name="times_to" bindTarget="csh_payment_req_query_ds" prompt="期次到"/>
<a:comboBox name="invoice_uploaded_flag_n" bindTarget="csh_payment_req_query_ds" prompt="发票上传标志"/>
<a:numberField name="due_amount_to" allowDecimals="true" allowFormat="true" bindTarget="csh_payment_req_query_ds" prompt="应付金额到"/>
<a:datePicker name="due_date_to" bindTarget="csh_payment_req_query_ds" prompt="应付日期到"/>
<!--<a:textField name="times_to" bindTarget="csh_payment_req_query_ds" prompt="期次到"/>-->
<!--<a:comboBox name="invoice_uploaded_flag_n" bindTarget="csh_payment_req_query_ds" prompt="发票上传标志"/>
<a:lov name="bp_id_agent_level1_n" bindTarget="csh_payment_req_query_ds" prompt="代理商名称"/>
<a:comboBox name="first_delay_flag_n" bindTarget="csh_payment_req_query_ds" prompt="是否首付延期"/>
<a:comboBox name="cf_61_write_off_flag_n" bindTarget="csh_payment_req_query_ds" prompt="应收保费付款情况"/>
<a:comboBox name="cf_61_write_off_flag_n" bindTarget="csh_payment_req_query_ds" prompt="应收保费付款情况"/>-->
</a:form>
<a:grid id="csh_payment_req_maintain_grid_ds" bindTarget="csh_payment_req_selectedDs" marginHeight="260" marginWidth="40" navBar="true">
<a:toolBar>
......@@ -350,24 +366,26 @@
<a:column name="contract_number" prompt="合同号" width="120"/>
<a:column name="contract_name" width="150"/>
<!-- <a:column name="search_term_1" prompt="合同号" width="120"/> -->
<a:column name="bp_id_tenant_n" prompt="承租人" width="120"/>
<a:column name="bp_id_agent_level1_n" prompt="代理商" width="120"/>
<a:column name="bp_id_tenant_n" prompt="商业伙伴名称" width="120"/>
<!-- <a:column name="bp_id_agent_level1_n" prompt="代理商" width="120"/>
<a:column name="agent_extra_nam" prompt="代理商简称" width="120"/>
<a:column name="first_delay_flag_n" align="center" prompt="是否首付延期"/>
<a:column name="first_delay_flag_n" align="center" prompt="是否首付延期"/>-->
<a:column name="cf_item_desc" prompt="现金流类型" width="80"/>
<a:column name="times" align="center" prompt="期数" width="40"/>
<a:column name="due_date" prompt="应付日期"/>
<a:column name="due_amount" align="right" prompt="应付金额" renderer="Leaf.formatMoney" width="110"/>
<a:column name="received_amount" align="right" prompt="实际支付金额" renderer="Leaf.formatMoney"/>
<a:column name="due_date" prompt="应付日期"/>
<a:column name="bp_id_agent_n" prompt="代理店"/>
<a:column name="vender_name_n" prompt="厂商"/>
<!-- <a:column name="received_amount" align="right" prompt="实际支付金额" renderer="Leaf.formatMoney"/>
<a:column name="residual_amount" align="right" prompt="剩余未支付金额" renderer="Leaf.formatMoney" width="110"/>
<a:column name="invoice_uploaded_flag_n" align="center" prompt="发票上传标志"/>
<a:column name="interface_name" prompt="企案类型"/>
<a:column name="status_n" prompt="企案结果"/>
<a:column name="pattern" prompt="机型"/>
<a:column name="pattern" prompt="机型"/>-->
<!--<a:column name="price" align="right" renderer="Leaf.formatMoney" prompt="销售价格"/>-->
<!--<a:column name="factory_price" align="right" renderer="Leaf.formatMoney" prompt="设备出厂价"/>-->
<a:column name="machine_number" prompt="机号"/>
<a:column name="cf_61_write_off_flag_n" prompt="应收保费收款情况"/>
<!-- <a:column name="machine_number" prompt="机号"/>
<a:column name="cf_61_write_off_flag_n" prompt="应收保费收款情况"/>-->
<!--<a:column name="applied_pay_amount" align="right" prompt="CSH501.CSH_APPLIED_PAYMENT_AMOUNT" renderer="Leaf.formatMoney" width="110"/>-->
<!-- <a:column name="serial_number" prompt="机编号" width="120"/> -->
<!--<a:column name="division_n" prompt="产品线" width="150"/>-->
......
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