Commit b7878614 authored by stone's avatar stone

Merge branch 'develop' of https://hel.hand-china.com/hlcm/leaf-hlcm into develop

parents 1aa923aa 11d29ed7
......@@ -13,7 +13,9 @@
select *
from (select c.contract_id, c.contract_number, c.contract_name
from con_contract c
where c.data_class = 'NORMAL') V
where c.data_class = 'NORMAL'
and not exists (select 1 from acp_invoice_ln an where an.contract_id=c.contract_id and an.confirmation_status='APPROVING')
) V
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......
......@@ -20,5 +20,15 @@
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
acp_invoice_import_pkg.submit_wfl( p_contract_id => ${@contract_id},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_id});
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -49,6 +49,10 @@
<bm:field name="document_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE_DESC"/>
<bm:field name="print_date" databaseType="DATE" datatype="java.util.Date" physicalName="PRINT_DATE"/>
<bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS"/>
<bm:field name="sign_contract_status"/>
<bm:field name="sign_contract_status_n"/>
<bm:field name="bp_id_tenant_n"/>
<bm:field name="bp_id_agent_level1_n"/>
</bm:fields>
<bm:primary-key>
<bm:pk-field name="contract_id"/>
......@@ -64,17 +68,13 @@
<bm:query-field name="contract_number" queryExpression="t1.contract_number like ${@contract_number}"/>
<bm:query-field field="project_number" queryExpression="project_number like upper(&apos;%&apos;||${@project_number}||&apos;%&apos;)"/>
<bm:query-field field="bp_id_tenant" queryOperator="="/>
<bm:query-field field="bp_id_agent_level1" queryOperator="="/>
<bm:query-field name="lease_item_amount_from" queryExpression="lease_item_amount &gt;= ${@lease_item_amount_from}"/>
<bm:query-field name="lease_item_amount_to" queryExpression="lease_item_amount &lt;= ${@lease_item_amount_to}"/>
<bm:query-field field="lease_channel" queryOperator="="/>
<bm:query-field field="business_type" queryOperator="="/>
<bm:query-field field="lease_organization" queryOperator="="/>
<bm:query-field field="sign_contract_status" queryOperator="="/>
<bm:query-field field="contract_status" queryOperator="="/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" expression="t1.contract_status in (&apos;NEW&apos;,&apos;SIGN&apos;)"/>
<!-- <bm:data-filter name="query" expression="not EXISTS (SELECT 1 FROM con_contract_cashflow WHERE contract_id = t1.contract_id AND (write_off_flag IN (&apos;PARTIAL&apos;, &apos;FULL&apos;) OR received_amount IS NOT NULL OR received_principal IS NOT NULL OR received_interest IS NOT NULL))"/> -->
<!--<bm:data-filter enforceOperations="query" expression="t1.user_status_1 IN (&apos;APPROVED&apos;)" field="user_status_1"/>-->
<!--<bm:data-filter enforceOperations="query" expression=" NOT EXISTS (SELECT 1 FROM con_contract_cashflow WHERE contract_id = t1.contract_id AND times &gt;= 0 AND (write_off_flag IN (&apos;PARTIAL&apos;, &apos;FULL&apos;) OR received_amount IS NOT NULL OR received_principal IS NOT NULL OR received_interest IS NOT NULL))"/>-->
<!--<bm:data-filter enforceOperations="query" expression="exists (select 1 from con_contract where contract_id = t1.contract_id and created_by = ${/session/@user_id})"/>-->
<bm:data-filter name="query" expression="((t1.sign_contract_status='NEW' and t1.contract_status='NEW') or (t1.sign_contract_status='SIGN_RETURN' and t1.contract_status='NEW') or (t1.sign_contract_status='SIGN_RETURN' and t1.contract_status='INCEPT_RETURN'))"/>
</bm:data-filters>
</bm:model>
......@@ -90,7 +90,20 @@
from con_contract_cashflow ccw
where ccw.contract_id = cc.contract_id
and ccw.overdue_status = 'Y'
and ccw.write_off_flag <> 'FULL')) t1 #WHERE_CLAUSE#
and ccw.write_off_flag <> 'FULL')
AND ('Y' = 'Y' AND EXISTS
(SELECT
1
FROM aut_trx_user_authorize a1, aut_owner_user_authorize a2
WHERE a1.trx_category = 'CONTRACT'
AND a1.trx_id = cc.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))))) t1 #WHERE_CLAUSE#
]]>
</bm:query-sql>
......
......@@ -118,6 +118,7 @@
<bm:query-field field="receipt_type" queryOperator="="/>
<bm:query-field name="confirmed" queryExpression="((${@confirmed} = 'Y' and t1.confirmed_flag in ('ACCAUDITED','ACCAUDITING')) or (${@confirmed} = 'N' and t1.confirmed_flag in ('NEW','CT_REJECTED','ACCAUDITING','ACCAUDITED')))"/>
<bm:query-field field="opposite_band_na" queryOperator="="/>
<bm:query-field name="transaction_num" queryExpression="t1.transaction_num like ${@transaction_num}"/>
<bm:query-field name="transaction_num_from" queryExpression="t1.transaction_num &gt;= ${@transaction_num_from}"/>
<bm:query-field name="transaction_num_to" queryExpression="t1.transaction_num &lt;= ${@transaction_num_to}"/>
<bm:query-field name="bank_slip_num" queryExpression="t1.bank_slip_num like &apos;%&apos;||${@bank_slip_num}||&apos;%&apos;"/>
......
......@@ -49,6 +49,7 @@
t.bp_bank_account_num,
t.bp_bank_account_name,
t.bp_bank_name,
t.bp_category,
t.transaction_amount,
t.collection_classes,
t.bp_id,
......
......@@ -31,6 +31,6 @@
</bm:features>
<bm:data-filters>
<bm:data-filter name="query" expression="(t1.transaction_id=${@transaction_id} and t1.company_id=${/session/@company_id} and t1.write_off_type = ${@write_off_type})"/>
<bm:data-filter name="query" expression="(nvl(t1.create_wf_flag,'N') = 'N')" />
<bm:data-filter name="query" expression="(nvl(t1.create_wf_flag,'N') = DECODE((select write_off_flag from csh_transaction where transaction_id = t1.transaction_id),'FULL','Y','N'))" />
</bm:data-filters>
</bm:model>
\ No newline at end of file
......@@ -173,6 +173,6 @@
<!-- <bm:data-filter name="type" expression="t1.transaction_type in ('ADVANCE_RECEIPT','RECEIPT') and t1.returned_flag != 'FULL' and t1.reversed_flag = 'N' and nvl(t1.deposit_flag,'N')='N' "/>-->
<bm:data-filter name="query" expression="(t1.transaction_type in ('ADVANCE_RECEIPT','RECEIPT',DECODE(${@cw_flag},'Y',NULL,DECODE(t1.source_type,NULL,NULL,'DEPOSIT'))) and t1.confirmed_flag in ('WF_APPROVING','ACCAUDITED','APPROVED','WF_REJECTED')) "/>
<!-- <bm:data-filter name="position_code" expression="(((${@position_code} = '009' and t1.bp_category = 'TENANT' and t1.paid_byother_flag = 'N') or ((${@position_code} = '014' and t1.bp_category != 'TENANT') or (${@position_code} = '014' and t1.paid_byother_flag != 'N')) and t1.confirmed_flag != 'ACCAUDITED') or (${/session/@user_id} = 1))" />-->
<bm:data-filter name="position_code" expression="((${@cw_flag} = 'Y') or (${@position_code} = '009' and (t1.paid_byother_flag = 'F' and t1.confirmed_flag != 'ACCAUDITED') or (${/session/@user_id} = 1)) or (${@position_code} = '014' and ((t1.paid_byother_flag != 'F') and t1.confirmed_flag != 'ACCAUDITED') or (${/session/@user_id} = 1)))"/>
<bm:data-filter name="position_code" expression="(((${@cw_flag} = 'Y') or (${@position_code} = '009' and t1.created_by != ${/session/@user_id} and (t1.paid_byother_flag = 'F' and t1.bp_category = 'TENANT' and t1.confirmed_flag != 'ACCAUDITED') or (${/session/@user_id} = 1)) or (${@position_code} = '014' and t1.created_by != ${/session/@user_id} and ((((t1.paid_byother_flag != 'F' or t1.bp_category != 'TENANT')) or t1.transaction_type = 'DEPOSIT') and t1.confirmed_flag != 'ACCAUDITED' and t1.created_by != ${/session/@user_id}) or (${/session/@user_id} = 1))))"/>
</bm:data-filters>
</bm:model>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: chenlingfeng7543
$Date: 2018/8/13 11:13
$Revision: 1.0
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select hls_bp_master_credit_pkg.get_advanced_amount_byId(p_bp_id=>${@bp_id}) advanced_amount
from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
\ No newline at end of file
......@@ -36,7 +36,8 @@
to_char(rd.credit_date_to,'yyyy-mm-dd')credit_date_to,
rd.enable_flag,
to_char(rd.last_update_date,'yyyy-mm-dd')last_update_date,
(select description from sys_user s where s.user_id= rd.created_by)last_updated_by_desc
(select description from sys_user s where s.user_id= rd.created_by)last_updated_by_desc,
(select description from sys_user s where s.user_id= rd.temp_user)temp_user_desc
from HLS_BP_MASTER_CREDIT_HD hd,
hls_bp_master hbm,
......
......@@ -15,7 +15,9 @@
p_credit_total_amount =>${@credit_total_amount},
p_credit_date_from =>to_date(${@credit_date_from},'yyyy-mm-dd'),
p_credit_date_to =>to_date(${@credit_date_to},'yyyy-mm-dd'),
p_user_id =>${/session/@user_id}
p_user_id =>${/session/@user_id},
p_used_amount=>${@used_amount},
p_bp_id=>${@bp_id}
);
end;
]]></bm:update-sql>
......
......@@ -15,7 +15,8 @@
p_payment_deduction =>${@payment_deduction},
p_secondary_lease =>${@secondary_lease},
p_price_list =>${@price_list},
p_detention => ${@detention}
p_detention => ${@detention},
p_down_payment_rate_new=>${@down_payment_rate_new}
);
end;
]]></bm:update-sql>
......@@ -23,7 +24,7 @@
<bm:parameter name="payment_deduction" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@payment_deduction"/>
<bm:parameter name="secondary_lease" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@secondary_lease"/>
<bm:parameter name="detention" dataType="java.lang.Double" input="false" output="true" outputPath="/parameter/@detention"/>
<bm:parameter name="down_payment_rate_new" dataType="java.lang.Double" input="false" output="true" outputPath="/parameter/@down_payment_rate_new"/>
<bm:parameter name="price_list" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@price_list"/>
</bm:parameters>
</bm:operation>
......
......@@ -14,6 +14,8 @@
<!--<meta name="_csrf_header" content="X-CSRF-TOKEN" />-->
<a:link id="widget_leaf_wfl_pageLink_node_approve_history"
url="${/request/@context_path}/modules/zjwfl/ZJWFL3040/zj_wfl_my_approved_application_history.lview"/>
<a:link id="main_link"
url="${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_to_do_list.lview"/>
<style>
html, body {
width: 1170px;
......@@ -577,7 +579,10 @@
});
win.on('close', function () {
//query_zjwfl5110_toDoDs();
location.reload();
// location.reload();
// location.replace();
window.parent.location.reload();
});
}
......@@ -602,7 +607,8 @@
});
win.on('close', function () {
//query_zjwfl5110_toDoDs();
location.reload();
window.parent.location.reload();
});
}
......
......@@ -6,6 +6,8 @@
modelaction="update"/>
<a:link id="ap_invoice_import_detail_link"
url="${/request/@context_path}/modules/acp/ACP522/ap_invoice_import_detail.lview"/>
<a:link id="ap_invoice_import_detail_wfl_link"
url="${/request/@context_path}/modules/acp/ACP522/ap_invoice_import_detail_wfl.lview"/>
<a:link id="ap_invoice_import_scanning_link"
url="${/request/@context_path}/modules/acp/ACP522/ap_invoice_import_scanning.lview"/>
<script><![CDATA[
......@@ -16,7 +18,7 @@
id: 'ap_invoice_import_scanning',
url: url,
title:'发票导入',
width: 400,
width: 300,
height:140
}).on('close', function() {
$(ds_id).query();
......@@ -31,13 +33,19 @@
};
function ap_invoice_import_detail(record_id,ds_id){
debugger;
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'MODIFY';
param['function_code'] = 'ACP522I';
if(record.get('confirmation_status')=='APPROVING'||record.get('confirmation_status')=='APPROVED'){
param['function_usage'] = 'QUERY';
param['function_code'] = 'ACP522WFL';
}else{
param['function_usage'] = 'MODIFY';
param['function_code'] = 'ACP522I';
}
param['contract_id'] = record.get('contract_id');
param['url_title'] = '进项发票详情';
hls_doc_get_layout_code('hn9040_project_get_layout_code_link_id', param, 'ap_invoice_import_detail_link', ds_id);
hls_doc_get_layout_code('hn9040_project_get_layout_code_link_id', param, 'ap_invoice_import_detail_link', ds_id,'AP_INVOICE_IMPORT_DETAIL');
}
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="basic.sys_session_info" rootPath="user_name_path"/>
</a:init-procedure>
<a:view>
<a:link id="acp_invoice_inf_import_link" model="acp.ACP522.acp_invoice_inf_import" modelaction="update"/>
<a:link id="acp_invoice_inf_import_submit_link" model="acp.ACP522.acp_invoice_inf_import" modelaction="execute"/>
<script><![CDATA[
//移除前事件(grid,attach,gridbox,table)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_brfore_remove'] = function(ds, record, bp_seq) {
return true;
};
Leaf.onReady(function () {
//document.getElementById("ext-gen935").placeholder = "在这输入姓名..";
// document.getElementById("ext-gen124").style.backgroundColor = 'red';
// document.getElementById("ext-gen124").setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。');
//document.getElementById("ext-gen124").style.color = 'red';
//document.getElementById("ext-gen124").style.backgroundColor = '#FF7744';
var first=document.getElementsByClassName("item-input-wrap");
var second=first[2].getElementsByClassName('item-textField');
var third=second[0];
third.setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。');
third.style.backgroundColor = '#FF7744';
});
//新增时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function(ds, record, config_records, bp_seq) {
record.set("created_by_n",'${/model/user_name_path/record/@user_desc}');
record.set("created_by",'${/session/@user_id}');
record.set("update_date",new Date());
};
//提交审批
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
debugger;
var hd_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
var hd_record = $(hd_id).getAt(0);
var lease_item_amount=hd_record.get('lease_item_amount')*1;
if($(ds_id).getAll().dirty){
alert(111);
return;
}
if ($(ds_id).validate()) {
debugger;
var records = $(ds_id).getAll();
if(records.length<1){
Leaf.showMessage('提示', '未查询到发票信息,请添加发票信息!');
return;
}
var sum=0;
for (var i = 0;i < records.length;i++) {
if(records[i].dirty){
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
return;
}
var tempa=records[i].get('total_amount')||0;
var tempb=records[i].get('net_amount')||0+records[i].get('tax_amount')||0;
if(tempa!=tempb){
Leaf.showMessage('提示', '发票明细行存在价税合计不等于不含税金额和税额之和!');
return;
}
var r = records[i];
var d = r.get(name);
var n = records[i].get('total_amount')||0;
if (!isNaN(n)) {
sum = plus(sum, n);
}
for (var j =i+1;j < records.length;j++) {
if(records[i].get('invoice_code')==records[j].get('invoice_code')||records[i].get('invoice_number')==records[j].get('invoice_number')){
Leaf.showMessage('提示', '发票代码和发票号码不能重复!');
return;
}
}
}
if(sum!=lease_item_amount){
Leaf.showMessage('提示', '本次发票明细含税总计不等于该合同设备价!');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '确定提交审批吗?', function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('acp_invoice_inf_import_submit_link').getUrl(),
para: {
contract_id: hd_record.get('contract_id')
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
});
}
};
//更新时调用
window['${/parameter/@bp_seq}${/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');
var acp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
if ('${/parameter/@contract_id}') {
$(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(acp_ds_id).query();
var record = $(ds_id).getAt(0);
if(name == 'invoice'&&value) {
var contract_id = record.get('contract_id');
var strs = value.split(',');
var invoice_type = strs[1];
var invoice_code = strs[2];
var invoice_number = strs[3];
var net_amount = strs[4];
var invoice_date = strs[5];
//检验设备价格需要大于不含税金额
if (strs.length ==9) {
Leaf.request({
url: $('acp_invoice_inf_import_link').getUrl(),
para: {
invoice_type: invoice_type,
invoice_code: invoice_code,
invoice_number: invoice_number,
net_amount: net_amount,
invoice_date: invoice_date,
contract_id: contract_id
},
success: function () {
Leaf.SideBar.show({
msg: '导入成功',
duration: 2000
}
);
setTimeout(function() {
record.set('invoice', '');
}, 50);
$(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(acp_ds_id).query();
},failure: function() {
setTimeout(function() {
record.set('invoice', '');
}, 50);
},
error: function() {
setTimeout(function() {
record.set('invoice', '');
}, 50);
},
scope: this
});
} else {
Leaf.showMessage('提示', '发票信息有错误,请重新扫描!');
setTimeout(function() {
record.set('invoice', '');
}, 50);
}
}
});
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<script><![CDATA[
Leaf.onReady(function () {
var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var acp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
if ('${/parameter/@contract_id}') {
$(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(acp_ds_id).query();
$(con_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(con_ds_id).query();
}
});
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
......@@ -4,11 +4,14 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view>
<a:link id="acp_invoice_inf_import_link" model="acp.ACP522.acp_invoice_inf_import" modelaction="update"/>
<!--<a:link id="acp_invoice_inf_import_link" model="acp.ACP522.acp_invoice_inf_import" modelaction="update"/>-->
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="ap_invoice_import_detail_link1"
url="${/request/@context_path}/modules/acp/ACP522/ap_invoice_import_detail.lview"/>
<script><![CDATA[
function invoice_inf_process(dataset, record, name, value, oldvalue) {
debugger
debugger;
if(name == 'invoice') {
record.getField('invoice').setReadOnly(true);
var contract_id = record.get('contract_id');
......@@ -57,15 +60,36 @@
}
}
}
function acp522_save() {
if($('acp522_acp_invoice_import_detail_ds').validate()){
$('ap_invoice_import_scanning').close();
var record=$('acp522_acp_invoice_import_detail_ds').getCurrentRecord();
var record_id=record.id;
var ds_id=record.ds.id
// var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'MODIFY';
param['function_code'] = 'ACP522I';
param['contract_id'] = record.get('contract_id');
param['url_title'] = '进项发票详情';
param['winId'] = 'aaaaa';
hls_doc_get_layout_code('hn9040_project_get_layout_code_link_id', param, 'ap_invoice_import_detail_link1', ds_id);
}
}
function acp522_back() {
$('ap_invoice_import_scanning').close();
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="acp522_acp_invoice_import_ds">
<a:dataSet id="acp522_acp_invoice_import_detail_ds" autoCreate="true">
<a:fields>
<a:field name="invoice" required="true" readOnly="true"/>
<a:field name="contract_name" required="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100"
<a:field name="contract_number" prompt="合同编号" required="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100"
lovService="acp.ACP522.acp_import_contract_lov" lovWidth="520"
title="SELECT_CONTRACT">
title="SELECT_CONTRACT" autoComplete="true">
<a:mapping>
<a:map from="contract_number" to="contract_number"/>
<a:map from="contract_name" to="contract_name"/>
......@@ -74,16 +98,23 @@
</a:field>
</a:fields>
<a:events>
<a:event name="update" handler="invoice_inf_process"/>
<!--<a:event name="update" handler="invoice_inf_process"/>-->
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:form title="请扫描发票二维码">
<a:lov name="contract_name" bindTarget="acp522_acp_invoice_import_ds" width="270" prompt="SELECT_CONTRACT"/>
<!--<a:form title="请扫描发票二维码">-->
<a:form title="请选择合同">
<a:lov name="contract_number" bindTarget="acp522_acp_invoice_import_detail_ds" width="180" prompt="SELECT_CONTRACT"/>
<!-- <a:textField name="contract_number" bindTarget="acp522_acp_invoice_import_ds" width="270" prompt="SELECT_CONTRACT"/>-->
<a:textField name="invoice" width="270" bindTarget="acp522_acp_invoice_import_ds" prompt="扫描发票"/>
<!--<a:textField name="invoice" width="270" bindTarget="acp522_acp_invoice_import_ds" prompt="扫描发票"/>-->
<a:hBox cellPadding="10">
<a:button click="acp522_save" text="确定"/>
<a:button click="acp522_back" text="取消"/>
</a:hBox>
</a:form>
</a:screenBody>
</a:view>
</a:screen>
......@@ -14,191 +14,191 @@
<a:link id="acr514_invoice_readonly_page" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script><![CDATA[
function acr514_invoice_query() {
$('acr514_invoice_result_ds').query();
}
function acr514_invoice_reset() {
$('acr514_invoice_query_ds').reset();
}
function acr514_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
}
function acr514_invoice_query_Onupdate(ds, record, name, value, oldVlaue) {
if (name == 'document_number_f') {
if (Leaf.isEmpty(record.get('document_number_t'))) {
record.set('document_number_t', value);
}
} else if (name == 'project_number_f') {
if (Leaf.isEmpty(record.get('project_number_t'))) {
record.set('project_number_t', value);
}
} else if (name == 'invoice_number_f') {
if (Leaf.isEmpty(record.get('invoice_number_t'))) {
record.set('invoice_number_t', value);
}
} else if (name == 'contract_number_f') {
if (Leaf.isEmpty(record.get('contract_number_t'))) {
record.set('contract_number_t', value);
}
} else if (name == 'invoice_bp_code_f') {
if (Leaf.isEmpty(record.get('invoice_bp_code_t'))) {
record.set('invoice_bp_code_t', value);
}
} else if (name == 'total_amount_f') {
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
function acr514_invoice_query() {
$('acr514_invoice_result_ds').query();
}
function acr514_invoice_reset() {
$('acr514_invoice_query_ds').reset();
}
function acr514_formatMoney(value, record, name) {
return Leaf.formatNumber(value);
}
function acr514_invoice_query_Onupdate(ds, record, name, value, oldVlaue) {
if (name == 'document_number_f') {
if (Leaf.isEmpty(record.get('document_number_t'))) {
record.set('document_number_t', value);
}
} else if (name == 'project_number_f') {
if (Leaf.isEmpty(record.get('project_number_t'))) {
record.set('project_number_t', value);
}
if (Ext.isEmpty(record.get('project_number_f')) && Ext.isEmpty(record.get('project_number_t'))) {
record.set('query_project_number', '');
} else {
record.set('query_project_number', 'Y');
} else if (name == 'invoice_number_f') {
if (Leaf.isEmpty(record.get('invoice_number_t'))) {
record.set('invoice_number_t', value);
}
if (Ext.isEmpty(record.get('contract_number_f')) && Ext.isEmpty(record.get('contract_number_t'))) {
record.set('query_contract_number', '');
} else {
record.set('query_contract_number', 'Y');
} else if (name == 'contract_number_f') {
if (Leaf.isEmpty(record.get('contract_number_t'))) {
record.set('contract_number_t', value);
}
} else if (name == 'invoice_bp_code_f') {
if (Leaf.isEmpty(record.get('invoice_bp_code_t'))) {
record.set('invoice_bp_code_t', value);
}
} else if (name == 'total_amount_f') {
if (Leaf.isEmpty(record.get('total_amount_t'))) {
record.set('total_amount_t', value);
}
}
function acr514_grid_query(reocrd_id, invoice_hd_id, status) {
var maintain_type = 'READONLY';
var currency_reocrd = $('acr514_invoice_result_ds').findById(reocrd_id);
var param = currency_reocrd.data;
param['function_code'] = 'ACR514';
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'QUERY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr514_invoice_readonly_page', 'acr514_invoice_result_ds');
if (Ext.isEmpty(record.get('project_number_f')) && Ext.isEmpty(record.get('project_number_t'))) {
record.set('query_project_number', '');
} else {
record.set('query_project_number', 'Y');
}
function acr514_document_number_render(value, record, name) {
return '<a href="javascript:acr514_grid_query(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
if (Ext.isEmpty(record.get('contract_number_f')) && Ext.isEmpty(record.get('contract_number_t'))) {
record.set('query_contract_number', '');
} else {
record.set('query_contract_number', 'Y');
}
function acr514_invoice_reverse() {
acr514_invoice_handle('REVERSE');
}
function acr514_grid_query(reocrd_id, invoice_hd_id, status) {
var maintain_type = 'READONLY';
var currency_reocrd = $('acr514_invoice_result_ds').findById(reocrd_id);
var param = currency_reocrd.data;
param['function_code'] = 'ACR514';
param['document_id'] = invoice_hd_id;
param['function_usage'] = 'QUERY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr514_invoice_readonly_page', 'acr514_invoice_result_ds');
}
function acr514_document_number_render(value, record, name) {
return '<a href="javascript:acr514_grid_query(' + record.id + ',' + record.get('invoice_hd_id') + ',\'' + record.get('invoice_status') + '\');">' + value + '</a>';
}
function acr514_invoice_reverse() {
acr514_invoice_handle('REVERSE');
}
function acr514_invoice_invalid() {
acr514_invoice_handle('INVALID');
}
function is_over_month(start_str, end_str) {
var start = Leaf.formatDate(start_str);
var end = Leaf.formatDate(end_str);
var year = Number(end.substr(0, 4)) - Number(start.substr(0, 4));
var month = Number(end.substr(5, 2)) - Number(start.substr(5, 2));
var day = Number(end.substr(8, 2)) - Number(start.substr(8, 2));
if (year == 1 && month == -11 && day <= 0) {
return false;
}
function acr514_invoice_invalid() {
acr514_invoice_handle('INVALID');
if (year == 0 && month == 0) {
return false;
}
function is_over_month(start_str, end_str) {
var start = Leaf.formatDate(start_str);
var end = Leaf.formatDate(end_str);
var year = Number(end.substr(0, 4)) - Number(start.substr(0, 4));
var month = Number(end.substr(5, 2)) - Number(start.substr(5, 2));
var day = Number(end.substr(8, 2)) - Number(start.substr(8, 2));
if (year == 1 && month == -11 && day <= 0) {
return false;
}
if (year == 0 && month == 0) {
return false;
}
if (year == 0 && month == 1 && day <= 0) {
return false;
}
return true;
if (year == 0 && month == 1 && day <= 0) {
return false;
}
function acr514_invoice_handle(type) {
var ds = $('acr514_invoice_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
return;
}
if (type == 'REVERSE') {
for (var i = 0;i < records.length;i++) {
if (records[i].get('invoice_kind') == '0') {
records[i].getField('vat_red_notice_num').setRequired(true);
}
return true;
}
function acr514_invoice_handle(type) {
var ds = $('acr514_invoice_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
return;
}
if (type == 'REVERSE') {
for (var i = 0;i < records.length;i++) {
if (records[i].get('invoice_kind') == '0') {
records[i].getField('vat_red_notice_num').setRequired(true);
}
} else if (type == 'INVALID') {
for (var i = 0;i < records.length;i++) {
if (is_over_month(records[i].get('invoice_date'), records[i].get('reverse_date'))) {
Leaf.showMessage('${l:HLS.PROMPT}', '单据号:' + records[i].get('document_number') + '日期跨月');
return;
}
}
} else if (type == 'INVALID') {
for (var i = 0;i < records.length;i++) {
if (is_over_month(records[i].get('invoice_date'), records[i].get('reverse_date'))) {
Leaf.showMessage('${l:HLS.PROMPT}', '单据号:' + records[i].get('document_number') + '日期跨月');
return;
}
// for (var i = 0;i < records.length;i++) {
// if (records[i].get('vat_interface_status')=='BACK') {
// Leaf.showMessage('${l:HLS.PROMPT}', '单据号:' + records[i].get('document_number') + '金税状态已回写,不可反冲');
// return;
// }
// }
for (var i = 0;i < records.length;i++) {
records[i].getField('vat_red_notice_num').setRequired(false);
}
for (var i = 0;i < records.length;i++) {
if (records[i].get('vat_interface_status')=='BACK') {
Leaf.showMessage('${l:HLS.PROMPT}', '单据号:' + records[i].get('document_number') + '金税状态已回写,不可反冲');
return;
}
} else {
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认?', function() {
ds.submitSelected();
}, function() {
});
}
function acr514_invoice_result_ds_submitsuccess(ds) {
$('acr514_invoice_grid_id').clear();
for (var i = 0;i < records.length;i++) {
records[i].getField('vat_red_notice_num').setRequired(false);
}
} else {
return;
}
function vat_red_notice_num_editorFunction(record, name) {
if (record.get('invoice_kind') == '0') {
if (name == 'vat_red_notice_num') {
return 'invoice_grid_tf';
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认?', function() {
ds.submitSelected();
}, function() {
});
}
function acr514_invoice_result_ds_submitsuccess(ds) {
$('acr514_invoice_grid_id').clear();
}
function vat_red_notice_num_editorFunction(record, name) {
if (record.get('invoice_kind') == '0') {
if (name == 'vat_red_notice_num') {
return 'invoice_grid_tf';
}
return '';
}
function acr514_invoice_update(ds, record, name, value, oldVlaue)
return '';
}
function acr514_invoice_update(ds, record, name, value, oldVlaue)
{
debugger;
var time,year,month,day,string;
var d,d_year_month;
if(name=='reverse_date')
{
debugger;
var time,year,month,day,string;
var d,d_year_month;
if(name=='reverse_date')
{
time = new Date();
year = time.getFullYear();
month = time.getMonth()+1;
if(month<10)
time = new Date();
year = time.getFullYear();
month = time.getMonth()+1;
if(month<10)
string = String(year)+'0'+String(month);
else
else
string = String(year)+String(month);
d= new Date(value);
d_year=d.getFullYear();
d_month=d.getMonth()+1;
if(d_month<10)
d= new Date(value);
d_year=d.getFullYear();
d_month=d.getMonth()+1;
if(d_month<10)
d_year_month = String(d_year)+'0'+String(d_month);
else
else
d_year_month = String(d_year)+String(d_month);
//如果小于系统时间
if( d_year_month<string)
{
record.getField('vat_red_notice_num').setRequired(true);
}
else
{
record.getField('vat_red_notice_num').setRequired(false);
}
record.set(name,value);
}
//如果小于系统时间
if( d_year_month<string)
{
record.getField('vat_red_notice_num').setRequired(true);
}
else
{
record.getField('vat_red_notice_num').setRequired(false);
}
record.set(name,value);
}
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
......@@ -231,20 +231,14 @@
<a:map from="description" to="confirmed_by_name"/>
</a:mapping>
</a:field>
<!--<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">-->
<!--<a:mapping>-->
<!--<a:map from="bp_code" to="invoice_bp_code_f"/>-->
<!--</a:mapping>-->
<!--</a:field>-->
<!--<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">-->
<!--<a:mapping>-->
<!--<a:map from="bp_code" to="invoice_bp_code_t"/>-->
<!--</a:mapping>-->
<!--</a:field>-->
<a:field name="invoice_bp_name" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:field name="invoice_bp_code_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code"/>
<a:map from="bp_name" to="invoice_bp_name"/>
<a:map from="bp_code" to="invoice_bp_code_f"/>
</a:mapping>
</a:field>
<a:field name="invoice_bp_code_t" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_bp_master_list" lovWidth="500" title="客户选择">
<a:mapping>
<a:map from="bp_code" to="invoice_bp_code_t"/>
</a:mapping>
</a:field>
<a:field name="project_number_f" lovGridHeight="320" lovHeight="480" lovService="acr.ACR512.acr_invoice_project_list" lovWidth="500" title="项目选择">
......@@ -290,58 +284,40 @@
<a:screenTitle/>
<a:toolbarButton click="acr514_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr514_invoice_reset" text="HLS.RESET"/>
<!-- <a:toolbarButton click="acr514_invoice_reverse" text="HLS.REVERSE"/>-->
<!-- <a:toolbarButton click="acr514_invoice_reverse" text="HLS.REVERSE"/>-->
<a:toolbarButton click="acr514_invoice_invalid" text="作废"/>
</a:screenTopToolbar>
<a:form marginWidth="30" padding="0" title="应收发票反冲" labelWidth="130">
<a:hBox labelSeparator="" labelWidth="120">
<a:textField name="document_number_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.DOCUMENT_NUMBER_FROM" width="135"/>
<!--<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>-->
<a:textField name="document_number_t" bindTarget="acr514_invoice_query_ds" prompt="单据编号到" width="135"/>
<a:lov name="project_number_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.PROJECT_NUMBER_FROM" width="135"/>
<a:textField name="document_number_t" bindTarget="acr514_invoice_query_ds" prompt="单据号到" width="135"/>
<!-- <a:lov name="project_number_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.PROJECT_NUMBER_FROM" width="135"/>-->
<!-- <a:lov name="project_number_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.PROJECT_NUMBER_FROM" width="135"/>-->
<!--<div><![CDATA[${l:HLS.DOCUMENT_NUMBER_TO}]]></div>-->
<a:lov name="project_number_t" bindTarget="acr514_invoice_query_ds" prompt="申请编号到" width="135"/>
<a:comboBox name="business_type_desc" bindTarget="acr514_invoice_query_ds" prompt="HLS.BUSINESS_TYPE_DESC" width="135"/>
<!-- <a:lov name="project_number_t" bindTarget="acr514_invoice_query_ds" prompt="申请编号到" width="135"/>-->
<!-- <a:comboBox name="business_type_desc" bindTarget="acr514_invoice_query_ds" prompt="HLS.BUSINESS_TYPE_DESC" width="135"/>-->
<!-- <a:lov name="project_number_t" bindTarget="acr514_invoice_query_ds" prompt="申请编号到" width="135"/>-->
<!-- <a:comboBox name="business_type_desc" bindTarget="acr514_invoice_query_ds" prompt="HLS.BUSINESS_TYPE_DESC" width="135"/>-->
<a:comboBox name="currency_name" bindTarget="acr514_invoice_query_ds" prompt="HLS.CURRENCY" width="135"/>-->
<a:textField name="invoice_number_f" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_NUMBER_FROM" width="135"/>
<a:textField name="invoice_number_t" bindTarget="acr514_invoice_query_ds" prompt="发票编号到" width="135"/>
</a:hBox>
<a:hBox labelWidth="100">
<a:textField name="invoice_number_f" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_NUMBER_FROM" width="135"/>
<a:hBox labelSeparator="" labelWidth="120">
<!--<div><![CDATA[${l:ACR.INVOICE_NUMBER_TO}]]></div>-->
<a:lov name="contract_number_f" bindTarget="acr514_invoice_query_ds" prompt="合同编号" width="135"/>
<!--<div><![CDATA[${l:HLS.CONTRACT_NUMBER_TO}]]></div>-->
<!--
<a:lov name="contract_number_t" bindTarget="acr514_invoice_query_ds" prompt="合同编号到" width="135"/>
-->
<!--
<a:lov name="contract_number_t" bindTarget="acr514_invoice_query_ds" prompt="合同编号到" width="135"/>
-->
<a:comboBox name="invoice_kind_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="135"/>
<a:lov name="created_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CREATED_BY_NAME" width="135"/>
<a:datePicker name="invoice_date_f" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_DATE_FROM" width="135"/>
<a:datePicker name="invoice_date_t" bindTarget="acr514_invoice_query_ds" prompt="发票日期到" width="135"/>
</a:hBox>
<a:hBox labelWidth="100">
<a:datePicker name="invoice_date_f" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_DATE_FROM" width="135"/>
<a:hBox labelSeparator="" labelWidth="120">
<!--<div><![CDATA[${l:ACR.INVOICE_DATE_TO}]]></div>-->
<a:datePicker name="invoice_date_t" bindTarget="acr514_invoice_query_ds" prompt="发票日期到" width="135"/>
<!--<a:lov name="invoice_bp_code_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.CUSTOMER_NUMBER_FROM" width="135"/>-->
<!--&lt;!&ndash;<div><![CDATA[${l:HLS.CUSTOMER_NUMBER_TO}]]></div>&ndash;&gt;-->
<!--<a:lov name="invoice_bp_code_t" bindTarget="acr514_invoice_query_ds" prompt="客户编号到" width="135"/>-->
<a:lov name="invoice_bp_name" bindTarget="acr514_invoice_query_ds" prompt="客户编号" width="135"/>
<a:lov name="invoice_bp_code_f" bindTarget="acr514_invoice_query_ds" prompt="客户编号" width="135"/>
<!--<div><![CDATA[${l:HLS.CUSTOMER_NUMBER_TO}]]></div>-->
<!-- <a:lov name="invoice_bp_code_t" bindTarget="acr514_invoice_query_ds" prompt="客户编号到" width="135"/>-->
<!-- <a:lov name="invoice_bp_code_t" bindTarget="acr514_invoice_query_ds" prompt="客户编号到" width="135"/>-->
<a:textField name="invoice_title" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_TITLE" width="135"/>
<a:comboBox name="currency_name" bindTarget="acr514_invoice_query_ds" prompt="HLS.CURRENCY" width="135"/>
</a:hBox>
<a:hBox labelWidth="100">
<a:lov name="confirmed_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CHECKER" width="135"/>
<a:datePicker name="accounting_date_f" bindTarget="acr514_invoice_query_ds" prompt="HLS.ACCOUNT_DATE_FROM" width="135"/>
<a:datePicker name="accounting_date_t" bindTarget="acr514_invoice_query_ds" prompt="记账日期到" width="135"/>
......@@ -351,14 +327,6 @@
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr514_invoice_query_ds" prompt="ACR.TOTAL_AMOUNT_FROM" width="135"/>
<!--<div><![CDATA[${l:ACR.TOTAL_AMOUNT_TO}]]></div>-->
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr514_invoice_query_ds" prompt="发票金额到" width="135"/>
<a:comboBox name="vat_interface_status_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR310.VAT_INTERFACE_STATUS_NAME" width="135"/>
</a:hBox>
<a:hBox labelWidth="100">
<a:lov name="created_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CREATED_BY_NAME" width="135"/>
<a:lov name="confirmed_by_name" bindTarget="acr514_invoice_query_ds" prompt="ACR.CHECKER" width="135"/>
<!--<a:comboBox name="invoice_status_desc" bindTarget="acr514_invoice_query_ds" prompt="发票状态" width="135"/>-->
<a:comboBox name="invoice_status_desc" bindTarget="acr514_invoice_query_ds" prompt="ACR.INVOICE_STATUS" width="135"/>
<a:comboBox name="vat_interface_status_desc" bindTarget="acr514_invoice_query_ds" prompt="金税状态" width="135"/>
</a:hBox>
......
......@@ -28,12 +28,14 @@
url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create.lview"/>
<a:link id="${/parameter/@layout_code}_contract_print_link_id"
url="${/request/@context_path}/modules/cont/CON301N/con_contract_print.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
<script type="text/javascript"><![CDATA[
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_CONTRACT_RESULT', 'con_contract');
Leaf.onReady(function() {
debugger;
if("${/model/role_info/record/@role_code}"!="0018"&&"${/model/role_info/record/@role_code}"!="0019") {
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM_prompt").style.display = "";
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM").style.display = "";
......@@ -50,11 +52,14 @@
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'CON301';
// param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', null);
//hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', null);
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id);
}
function open_project_Window(record_id, ds_id) {
......
......@@ -76,9 +76,13 @@
});
}
win.on('close', function () {
debugger;
if(list_ds=='acp522_acp_invoice_import_detail_ds'){
location.reload();
}else{
if (list_ds) {
$(list_ds).query();
}
}}
});
}
},
......
......@@ -13,7 +13,12 @@
</a:init-procedure>
<a:view>
<!-- <a:link id="con_contract_closed_submit_link_id" model="cont.CON542.con_contract_cancel" modelaction="batch_update"/> -->
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="con_contract_closed_link" model="cont.CON542.con_contract_closed" modelaction="batch_update"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<script type="text/javascript"><![CDATA[
function CON542_con_contract_query() {
$('CON542_contract_result_ds').query();
......@@ -22,36 +27,44 @@
function CON542_con_contract_reset() {
$('CON542_contract_query_ds').reset();
}
// function CON542_con_contract_submit() {
// var records = $('CON542_contract_result_ds').getSelected();
// var cancelData = [];
// records[0].set('_status', 'update');
// var records_reason = $('contract_cancel_ds').getAt(0);
// if (Leaf.isEmpty(records_reason.get('cancel_reason'))) {
// Leaf.showMessage('提示', '请维护合同取消原因!');
// return;
// }
// records[0].set('cancel_reason', records_reason.get('cancel_reason'));
// cancelData.push(records[0].data);
// Leaf.showConfirm('${l:PROMPT}', '您确认要提交合同取消申请?', function() {
// Leaf.request({
// url: $('con_contract_closed_submit_link_id').getUrl(),
// para: cancelData,
// success: function() {
// Leaf.SideBar.show({
// msg: '提交成功',
// duration: 2000
// });
// $('CON542_contract_result_ds').query();
// },
// scope: this
// });
// }, function() {
// return;
// }, null, null);
// }
function seeDetail_num(value, record, name) {
if(value){
if (name=='contract_number') {
return '<a href="javascript:open_contract_win(\'' + record.id + '\',\'' + record.ds.id + '\');">' + value + '</a>';
}else if(name=='project_number'){
return '<a href="javascript:open_project_Window(\'' + record.id + '\',\'' + record.ds.id + '\');">' + value + '</a>';
}}else{
return '';
}
}
function open_contract_win(record_id,ds_id) {
debugger;
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
param['winid'] = 'con_contract_modify_win_id';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id);
}
function open_project_Window(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['company_id'] = record.get('company_id');
param['project_id'] = record.get('project_id');
param['function_usage'] = 'QUERY';
param['function_code'] = 'PRJ501_WFL';
param['bp_class'] = record.get('bp_class');
param['maintain_type'] = 'QUERY';
/* param['window_open_flag'] = 'Y';
param['show_history_flag'] = 'Y'; */
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_special_link', ds_id, '${/parameter/@layout_code}');
}
function summaryRenderer(datas, name) {
var sum = 0;
var sum2 = 0;
......@@ -127,6 +140,24 @@
<a:dataSet id="CON542_lease_channel_name_ds" loadData="true" model="basic.hls_lease_channel_for_lov"/>
<a:dataSet id="CON542_wfl_status_name_ds" lookupCode="CON500_WFL_STATUS"/>
<a:dataSet id="CON542_companies_ds" loadData="true" model="fnd.fnd_companies"/>
<a:dataSet id="CONTRACT_STATUS_DS">
<a:datas>
<a:record code_value="NEW" code_value_name="新建"/>
<a:record code_value="INCEPT" code_value_name="起租"/>
<a:record code_value="INCEPTING" code_value_name="起租中"/>
<a:record code_value="INCEPT_RETURN" code_value_name="起租退回"/>
<a:record code_value="CANCEL" code_value_name="取消"/>
</a:datas>
</a:dataSet>
<a:dataSet id="SIGN_CONTRACT_STATUS_DS">
<a:datas>
<a:record code_value="NEW" code_value_name="新建"/>
<a:record code_value="SIGN" code_value_name="签约"/>
<a:record code_value="SIGNING" code_value_name="签约中"/>
<a:record code_value="SIGN_RETURN" code_value_name="签约退回"/>
<a:record code_value="CANCEL" code_value_name="取消"/>
</a:datas>
</a:dataSet>
<a:dataSet id="CON542_document_type_name_ds">
<a:datas dataSource="/model/CON542_document_type_path"/>
</a:dataSet>
......@@ -135,26 +166,24 @@
</a:dataSet>
<a:dataSet id="CON542_contract_query_ds" autoCreate="true">
<a:fields>
<a:field name="bp_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="cont.CON541.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="520" title="HLS.BP_TITLE">
<a:field name="bp_id_tenant_n" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="cont.CON541.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="520" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_name" to="bp_id_tenant_n"/>
<a:map from="bp_id" to="bp_id_tenant"/>
</a:mapping>
</a:field>
<a:field name="bp_id_tenant"/>
<!-- <a:field name="contract_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON531.con_contract_lov" lovWidth="500" title="HLS.CONTRACT_NUMBER">
<a:mapping>
<a:map from="contract_number" to="contract_number"/>
<a:map from="contract_id" to="contract_id"/>
</a:mapping>
</a:field> -->
<a:field name="lease_channel_desc" displayField="description" options="CON542_lease_channel_name_ds" returnField="lease_channel" valueField="lease_channel"/>
<!-- <a:field name="project_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500" title="HLS.PROJECT_NUMBER">
<a:field name="bp_agent_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="cont.CON541.hls_bp_master_v_for_lov?bp_category=AGENT" lovWidth="520" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="project_number" to="project_number"/>
<a:map from="project_id" to="project_id"/>
<a:map from="bp_name" to="bp_agent_name"/>
<a:map from="bp_id" to="bp_id_agent_level1"/>
</a:mapping>
</a:field> -->
</a:field>
<a:field name="contract_status_n" options="CONTRACT_STATUS_DS"
returnField="contract_status" displayField="code_value_name" valueField="code_value"/>
<a:field name="sign_contract_status_n" options="SIGN_CONTRACT_STATUS_DS"
returnField="sign_contract_status" displayField="code_value_name" valueField="code_value"/>
<a:field name="bp_id_tenant"/>
<a:field name="contract_number" typeCase="Upper"/>
<a:field name="project_number" typeCase="Upper"/>
<a:field name="document_type_desc" displayField="description" options="contract_document_ds" returnField="document_type" valueField="document_type"/>
......@@ -172,37 +201,32 @@
<a:screenTitle/>
<a:gridButton click="CON542_con_contract_query" text="HLS.QUERY"/>
<a:gridButton click="CON542_con_contract_reset" text="HLS.RESET"/>
<!-- <a:gridButton click="CON542_con_contract_submit" text="申请提交"/> -->
<a:gridButton click="CON542_con_contract_closed" text="合同关闭"/>
<a:gridButton click="CON542_con_contract_closed" text="合同取消"/>
</a:screenTopToolbar>
<a:form column="4" labelWidth="100" marginWidth="30" title="CON301.CONTRACT_QUERY">
<a:textField name="contract_number" bindTarget="CON542_contract_query_ds" prompt="HLS.CONTRACT_NUMBER"/>
<a:lov name="bp_name" bindTarget="CON542_contract_query_ds" prompt="HLS.TENANT_CODE"/>
<a:lov name="bp_id_tenant_n" bindTarget="CON542_contract_query_ds" prompt="HLS.TENANT_CODE"/>
<a:lov name="bp_agent_name" bindTarget="CON542_contract_query_ds" prompt="代理店"/>
<a:numberField name="lease_item_amount_from" bindTarget="CON542_contract_query_ds" prompt="租赁物总价从"/>
<a:numberField name="lease_item_amount_to" bindTarget="CON542_contract_query_ds" prompt="租赁物总价到"/>
<a:comboBox name="lease_channel_desc" bindTarget="CON542_contract_query_ds" prompt="HLS.LEASE_CHANNEL_NAME"/>
<a:textField name="project_number" bindTarget="CON542_contract_query_ds" prompt="申请编号"/>
<a:comboBox name="lease_organization_name" bindTarget="CON542_contract_query_ds" prompt="事业部"/>
<a:comboBox name="document_type_desc" bindTarget="CON542_contract_query_ds" prompt="HLS.CONTRACT_TYPE"/>
<a:textField name="project_number" bindTarget="CON542_contract_query_ds" prompt="报单编号"/>
<a:comboBox name="contract_status_n" bindTarget="CON542_contract_query_ds" prompt="合同状态"/>
<a:comboBox name="sign_contract_status_n" bindTarget="CON542_contract_query_ds" prompt="签约状态"/>
</a:form>
<!-- <a:form labelWidth="100" marginWidth="30" title="取消原因">
<a:textArea name="cancel_reason" bindTarget="contract_cancel_ds" height="60" prompt="取消原因" width="800"/>
</a:form>-->
<a:grid id="CON542_con_contract_grid_ds" bindTarget="CON542_contract_result_ds" marginHeight="300" marginWidth="30" navBar="true">
<a:grid id="CON542_con_contract_grid_ds" bindTarget="CON542_contract_result_ds" marginHeight="150" marginWidth="30" navBar="true">
<a:columns>
<a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="150"/>
<a:column name="project_number" prompt="申请编号" width="120"/>
<!--<a:column name="signing_user" prompt="签约人" width="120"/>-->
<a:column name="print_date" prompt="签约时间" renderer="Leaf.formatDate" width="120"/>
<a:column name="document_type_desc" prompt="HLS.CONTRACT_TYPE" width="80"/>
<a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="150" renderer="seeDetail_num"/>
<a:column name="project_number" prompt="报单编号" width="120" renderer="seeDetail_num"/>
<a:column name="bp_id_agent_level1_n" prompt="代理店" width="200"/>
<a:column name="bp_name" prompt="HLS.TENANT_NAME" width="200"/>
<!--<a:column name="bp_vender" align="center" footerRenderer="summaryRenderer" prompt="主供应商名称" width="200"/>-->
<a:column name="lease_item_amount" align="right" footerRenderer="summaryRenderer" prompt="租赁物总价" renderer="Leaf.formatMoney" width="120"/>
<a:column name="down_payment" align="right" footerRenderer="summaryRenderer" prompt="首付款" renderer="Leaf.formatMoney" width="120"/>
<!--<a:column name="owner_user_id_n" prompt="出单人" width="80"/>-->
<a:column name="lease_channel_n" prompt="商业模式" width="70"/>
<a:column name="lease_organization_desc" prompt="事业部"/>
<a:column name="contract_status_n" prompt="合同状态"/>
<!--<a:column name="down_payment" align="right" footerRenderer="summaryRenderer" prompt="首付款" renderer="Leaf.formatMoney" width="120"/>-->
<a:column name="contract_status_n" prompt="合同状态" align="center"/>
<a:column name="sign_contract_status_n" prompt="签约状态" align="center"/>
</a:columns>
</a:grid>
</a:screenBody>
......
......@@ -221,7 +221,7 @@
<a:tabPanel marginHeight="420" marginWidth="30">
<a:tabs>
<a:tab prompt="未收金额" width="110">
<a:grid bindTarget="unreceivedAmountDs" marginHeight="470" marginWidth="55" navBar="true">
<a:grid bindTarget="unreceivedAmountDs" marginHeight="325" marginWidth="55" navBar="true">
<a:columns>
<a:column name="times" prompt="期数"/>
<a:column name="cf_type_dis" prompt="类型"/>
......@@ -238,7 +238,7 @@
</a:grid>
</a:tab>
<a:tab prompt="已收金额" width="110">
<a:grid bindTarget="receivedAmountDs" marginHeight="450" marginWidth="55" navBar="true">
<a:grid bindTarget="receivedAmountDs" marginHeight="325" marginWidth="55" navBar="true">
<a:columns>
<a:column name="times" prompt="期数"/>
<a:column name="cf_type_dis" prompt="类型"/>
......
......@@ -235,16 +235,16 @@
<a:textField name="bp_id_agent_desc" bindTarget="CON620_contract_query_ds" prompt="代理店"/>
<a:comboBox name="business_type_n" bindTarget="CON620_contract_query_ds" prompt="业务类型"/>
<a:comboBox name="division_n" bindTarget="CON620_contract_query_ds" prompt="租赁物"/>
<a:numberField name="account_due_times_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数从"/>
<a:numberField name="account_due_times_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数到"/>
<a:numberField name="account_due_days_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数从"/>
<a:numberField name="account_due_days_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数到"/>
<a:numberField name="account_due_times_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数从" allowDecimals="false"/>
<a:numberField name="account_due_times_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数到" allowDecimals="false"/>
<a:numberField name="account_due_days_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数从" allowDecimals="false"/>
<a:numberField name="account_due_days_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数到" allowDecimals="false"/>
<a:numberField name="account_due_amount_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总金额从"/>
<a:numberField name="account_due_amount_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总金额到"/>
<a:numberField name="business_due_times_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数从"/>
<a:numberField name="business_due_times_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数到"/>
<a:numberField name="business_due_days_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数从"/>
<a:numberField name="business_due_days_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数到"/>
<a:numberField name="business_due_times_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数从" allowDecimals="false"/>
<a:numberField name="business_due_times_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数到" allowDecimals="false"/>
<a:numberField name="business_due_days_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数从" allowDecimals="false"/>
<a:numberField name="business_due_days_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数到" allowDecimals="false"/>
<a:numberField name="business_due_amount_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总金额从"/>
<a:numberField name="business_due_amount_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总金额到"/>
</a:form>
......@@ -259,20 +259,20 @@
align="center"/>
<a:column name="bp_id_agent_desc" align="center" prompt="代理店" width="200"/>
<a:column name="business_type_n" align="center" prompt="业务类型" width="60"/>
<a:column name="division_n" align="center" prompt="租赁物" width="60" footerRenderer="summaryRenderer"/>
<a:column name="division_n" align="center" prompt="租赁物" width="60" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"/>
<a:column name="account_due_times" align="center" prompt="会计逾期总期数"
width="100"/>
<a:column name="account_due_days" align="center" prompt="会计逾期总天数"
width="100"/>
<a:column name="account_due_amount" align="right" prompt="会计逾期总金额" footerRenderer="summaryRenderer"
<a:column name="account_due_amount" align="right" prompt="会计逾期总金额" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"
width="100"/>
<a:column name="business_due_times" align="center" prompt="营业逾期总期数"
width="100"/>
<a:column name="business_due_days" align="center" prompt="营业逾期总天数"
width="100"/>
<a:column name="business_due_amount" align="right" prompt="营业逾期总金额" footerRenderer="summaryRenderer"
<a:column name="business_due_amount" align="right" prompt="营业逾期总金额" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"
width="100"/>
<a:column name="over_due_amount" align="right" prompt="违约金" footerRenderer="summaryRenderer"
<a:column name="over_due_amount" align="right" prompt="违约金" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"
width="100"/>
</a:columns>
</a:grid>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-09-06 上午11:10:33
$Revision: 1.0
$Purpose: design the function of written_off money
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="basic.csh_payment_method_for_lov" rootPath="payment_method_path"/>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="currency"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH511_TRANSACTION_TYPE&apos; and t.code_value in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="transaction_type"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_RETURN_SELECT&apos; and t.code_value not in (&apos;RETURN&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="returned_flag_rp"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_REVERSE_SELECT&apos; and t.code_value not in (&apos;R&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="reversed_flag_rp"/>
</a:init-procedure>
<a:view>
<a:link id="csh_transaction_receipt_link" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt.lview"/>
<a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
<a:link id="csh_transaction_receipt_update_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>
<!-- <a:link id="csh_transaction_receipt_maintain_post_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>-->
<a:link id="csh_transaction_receipt_maintain_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update.lview"/>
<a:link id="csh_transaction_receipt_maintain_readonly_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update_readonly.lview"/>
<a:link id="csh510_csh_transaction_batch_update" model="csh.CSH510.csh_transaction_delete" modelaction="batch_update"/>
<a:link id="csh511_csh_transaction_batch_post_link" model="csh.CSH511.csh_transaction_post" modelaction="batch_update"/>
<!--更新收款单据的状态-->
<a:link id="csh509N_batch_update_confirmed_flag" model="csh.CSH509.query_roles_info" modelaction="batch_update"/>
<a:link id="csh510N_csh_transaction_batch_update_confirmed_flag" model="csh.CSH510.csh_transaction_update" modelaction="batch_update"/>
<!-- <a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_import.lview"/>-->
<a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510N/csh_transaction_import.lview"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
//console.log($('csh_transaction_receipt_maintain_result_ds'));
})
//新增单据的作废
function csh510_csh_trx_bank_drop(){
$('csh510_csh_trx_bank_drop').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if (datas.length == 0) {
$L.showMessage("提示", '请选择要作废的单据');
$('csh510_csh_trx_bank_drop').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag= datas[i].get('confirmed_flag');
//不是新增就报错
if(confirmed_flag!='NEW'&&confirmed_flag!='CT_REJECTED'){
$L.showInfoMessage("提示", '请选择单据为新建或收款退回的数据', null, null);
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
//提交想改变之后的状态
'wanted_confirmed_flag': 'CANCELLED',
'_status': 'update'
});
};
//弹出确认修改的提示框
$L.showConfirm("提示",'确认执行该操作?',function(){
//锁屏
lock_current_window();
//作废单据
Leaf.request({
url: $('csh509N_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '该单据已作废!');
$('csh510_csh_trx_bank_drop').enable();
}, failure: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
error: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
scope: this
});
})
}
//新增申请按钮
function csh510_csh_trx_bank_apply_new() {
$('csh510_csh_trx_bank_apply_new').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
//获得所选择的的未提交的单据,如果有不是未提交的数据,提示重新进行选择
if (datas.length == 0) {
$L.showMessage("提示", '请至少选择一条数据');
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag = datas[i].get('confirmed_flag');
var bp_name=datas[i].get('bp_name');
if(bp_name==''||bp_name==undefined){
$L.showInfoMessage("提示", '商业伙伴为空,不能提交', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//不是新增就报错
if (confirmed_flag != 'NEW' && confirmed_flag != 'CT_REJECTED') {
$L.showInfoMessage("提示", '请选择单据为新建或收款退回的数据', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
'_status': 'update'
});
}
//弹出确认修改的提示框
$L.showConfirm("提示", '确认执行该操作?', function () {
//锁屏
lock_current_window();
//改变未提交单据数据的状态
Leaf.request({
url: $('csh510N_csh_transaction_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '提交成功!');
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
}, failure: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
error: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
scope: this
});
},function(){
$('csh510_csh_trx_bank_apply_new').enable();
});
}
//跳转到收款新增页面
function csh510_csh_trx_bank_hand_add(){
//按钮失效
$('csh510_csh_trx_bank_hand_add').disable();
var url = $('csh_transaction_receipt_link').getUrl();
var win = new Leaf.Window({
title:'${l:CSH510.NEW_MANUAL_RECEIPT}',
url: url,
id: 'csh_trx_receipt_id',
fullScreen: true,
draggable: true
}).on('close', function() {
//按钮启用
$('csh510_csh_trx_bank_hand_add').enable();
$('csh_transaction_receipt_maintain_result_ds').query();
});
}
//锁表
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
//解锁
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
}
function dateValidator(record, name, value) { //日期校验方法
if (name == 'transaction_date_from' || name == 'transaction_date_to') {
var start_date = Leaf.formatDate(record.get('transaction_date_from'));
var end_date = Leaf.formatDate(record.get('transaction_date_to'));
if (!!end_date) { //由于结束日期非必填,只有在结束日期填了才进行比较
if (!compareDate(start_date, end_date)) {
return '${l:CSH510.CSH_RECEIPT_DATE_CHECK}'; //校验不通过返回字符串
}
}
return true; //校验通过返回true
}
}
function compareDate(start, end) {
if (start > end) {
return false;
}
return true;
}
function csh510_receipt_query() {
var record = $('csh_transaction_receipt_maintain_query_ds').getAt(0);
var dirty_flag = 'N';
for (var name in record.data) {
var value = record.get(name);
if (value != 'undefined' && value != null && value != '') {
dirty_flag = 'Y';
}
}
if (dirty_flag == 'N') {
Leaf.showConfirm('${l:PROMPT}', '${l:CSH510.CSH_RECEIPT_QUERY_INFORMATION}', function () {
return;
}, function () {
$('csh_transaction_receipt_maintain_result_ds').query();
}, null, null);
} else {
$('csh_transaction_receipt_maintain_result_ds').query();
}
}
function csh510_receipt_reset() {
$('csh_transaction_receipt_maintain_query_ds').reset();
}
function csh510_receipt_back() {
history.go(-1);
}
function csh510_receipt_forward() {
history.go(1);
}
function csh510_receipt_quit() {
location.href = $('sys_service_welcome_link').getUrl();
parent.shMenu('show');
}
function seedetail_transaction_num(value, record, name) {
/* console.log(record.get('receipt_type'));
console.log( record.get('bp_name'));
console.log( record.get('confirmed_flag'));*/
if (record.get('transaction_id')) {
var url;
/*if (record.get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} /!*else*!/ else if (record.get('posted_flag') == 'Y') {
url = $('csh_transaction_receipt_update_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} else {
return value;
}*/
if(record.get('confirmed_flag')=='NEW' || record.get('confirmed_flag') == 'CT_REJECTED'){
url = $('csh_transaction_receipt_maintain_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=true';
}else{
url = $('csh_transaction_receipt_maintain_readonly_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=false';
}
return '<a href="javascript:openWindow(\'' + url + '\');">' + value + '</a>';
}
}
function openWindow(url) {
var win = new Leaf.Window({
id: 'csh_transaction_receipt_link_winid',
params: {
winId: 'csh_transaction_receipt_link_winid'
},
url: url,
title: '${l:CSH510.CSH_RECEIPT_UPDATE}',
fullScreen: true
});
win.on('close',function(){
$('csh_transaction_receipt_maintain_result_ds').query();
});
}
function construct_from_to() {
var config = ['transaction_num', 'bank_slip_num', 'transaction_amount', 'currency_code', 'bank_account_code'];
var pattern = ['_from', '_to'];
var obj = {};
for (var i = 0,
j = config.length; i < j; i++) {
for (var m = 0,
n = pattern.length; m < n; m++) {
obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
}
}
return obj;
}
function csh510_receipt_maintain_update(ds, record, name, value, oldvalue) {
var from_to = construct_from_to();
var opposite_name = from_to[name];
if (!Ext.isEmpty(opposite_name)) {
var opposite_value = record.get(opposite_name);
if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
record.set(opposite_name, value);
}
}
}
function csh510_receipt_remove() {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (!records.length) {
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.SELECT_RECORD}');
return;
}
var saveData = [];
for (var i = 0; i < records.length; i++) {
if(records[i].get('confirmed_flag') != 'NEW' && records[i].get('confirmed_flag') != 'CT_REJECTED'){
Leaf.showInfoMessage("提示","请选择新建或者收款退回的单据进行收款取消操作!");
return;
}
records[i].set('_status', 'delete');
saveData.push(records[i].data);
}
Leaf.showConfirm('${l:PROMPT}', '${l:HLS.DELETE_CONFIRM}', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.DELETING}');
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH510.csh_transaction_delete/batch_update',
para: saveData,
success: function () {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
csh510_delete_remove(records);
Leaf.Masker.unmask(Ext.getBody());
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, function () {
return;
}, null, null);
}
function csh510_delete_remove(records) {
while (records[0]) {
$('csh_transaction_receipt_maintain_result_ds').removeLocal(records[0]);
}
}
function csh510_receipt() {
Leaf.showConfirm('${l:PROMPT}', '非财务人员请勿操作!', function () {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}', '请选择1条数据!');
return;
}
if (records[0].get('transaction_id')) {
var url;
if (records[0].get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + records[0].get('transaction_id') + '&claim=F';
} else {
Leaf.showMessage('${l:PROMPT}', '该单据已经被认领,无需再次认领!');
return;
}
openWindow(url);
}
});
}
function csh510_batch_update() {
var ds_id = 'csh_transaction_receipt_maintain_result_ds';
var ds = $(ds_id)
var records = ds.getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:PROMPT}', '请至少选择一条要处理的单据');
return;
}
var auto_write_record = $('csh510_collection_classes_batch_update_ds').getAt(0);
var collection_classes = auto_write_record.get('collection_classes');
if (collection_classes) {
lock_current_window();
var post_data = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('write_off_flag') == 'FULL') {
Leaf.showMessage('${l:PROMPT}', '选择数据中包含已完全核销的数据');
return;
}
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'collection_classes': auto_write_record.get('collection_classes'),
'_status': 'update'
});
}
Leaf.request({
url: $('csh510_csh_transaction_batch_update').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
ds.query(ds.currentpage);
Leaf.showMessage('${l:PROMPT}', '修改成功!');
}, failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
}
}
function csh510_csh_transaction_batch_update(){
//
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择一条记录!');
return;
}
var post_data = [];
for (var i = 0; i < records.length; i++) {
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'_status': 'update'
});
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('csh511_csh_transaction_batch_post_link').getUrl(),
para: post_data,
success: function (res) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.SUBMIT_SUCCESS}');
csh510_receipt_query();
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function csh510_csh_trx_bank_import(){
//按钮失效
$('csh510_csh_trx_bank_import').disable();
//只有债权内勤才能
var url_l = $('csh510_csh_transaction_import_link').getUrl();
var win = new Leaf.Window({
id: 'csh510_csh_transaction_import_win',
url: url_l,
params: {
'winid': 'csh510_csh_transaction_import_win',
'session_id': '${/session/@session_id}',
'parent_ds_id': 'csh_transaction_receipt_maintain_result_ds'
},
title: '信息导入',
width: 430,
height: 390
});
win.on('close', function () {
$('csh_transaction_receipt_maintain_result_ds').query();
//按钮启用
$('csh510_csh_trx_bank_import').enable();
});
}
function csh510_export() {
$('csh_transaction_receipt_maintain_grid_ds')._export(null,'收款维护');
}
]]></script>
<a:dataSets>
<a:dataSet id="confirmed_flag_ds">
<a:datas>
<a:record code_value="NEW" code_value_name="新建"/>
<a:record code_value="ACCAUDITING" code_value_name="收款确认中"/>
<a:record code_value="CT_REJECTED" code_value_name="收款退回"/>
<a:record code_value="ACCAUDITED" code_value_name="收款已确认"/>
</a:datas>
</a:dataSet>
<a:dataSet id="bp_category_ds" lookupCode="BP_CATEGORY">
</a:dataSet>
<!-- <a:dataSet id="confirmed_flag_ds" lookupCode="CONFIRMED_FLAG">-->
<!-- </a:dataSet>-->
<a:dataSet id="payment_method_ds">
<a:datas dataSource="/model/payment_method_path"/>
</a:dataSet>
<a:dataSet id="receipt_type_ds" lookupCode="RECEIPT_TYPE"/>
<a:dataSet id="currency_ds">
<a:datas dataSource="/model/currency"/>
</a:dataSet>
<a:dataSet id="transaction_type_ds">
<a:datas dataSource="/model/transaction_type"/>
</a:dataSet>
<!-- <a:dataSet id="transaction_type_ds" lookupCode="CSH511_TRANSACTION_TYPE"/> -->
<a:dataSet id="posted_flag_ds" lookupCode="CSH510_POST_SELECT"/>
<!-- 去掉退款事务 -->
<a:dataSet id="returned_flag_ds">
<a:datas dataSource="/model/returned_flag_rp"/>
</a:dataSet>
<!-- 去掉反冲事务 -->
<a:dataSet id="reversed_flag_ds">
<a:datas dataSource="/model/reversed_flag_rp"/>
</a:dataSet>
<a:dataSet id="ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>
<a:dataSet id="csh510_collection_classes_batch_update_ds">
<a:fields>
<a:field name="collection_classes_desc" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_query_ds" autoCreate="true">
<a:fields>
<a:field name="bank_account_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_branch_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_account_num" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="confirmed_flag_desc" options="confirmed_flag_ds" valueField="code_value" displayField="code_value_name" returnField="confirmed_flag"/>
<a:field name="payment_method_display" displayField="description" options="payment_method_ds" returnField="payment_method_id" valueField="payment_method_id"/>
<a:field name="bp_name_from" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_from"/>
<a:map from="bp_name" to="bp_name_from"/>
</a:mapping>
</a:field>
<a:field name="bp_id_from"/>
<a:field name="bp_name_to" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_to"/>
<a:map from="bp_name" to="bp_name_to"/>
</a:mapping>
</a:field>
<a:field name="bp_id_to"/>
<a:field name="transaction_num_from"/>
<a:field name="transaction_num_to"/>
<a:field name="bank_slip_num_from"/>
<a:field name="bank_slip_num_to"/>
<a:field name="transaction_date_from" validator="dateValidator"/>
<a:field name="transaction_date_to" validator="dateValidator"/>
<a:field name="bank_account_code" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code"/>
</a:mapping>
</a:field>
<a:field name="bank_account_code_from" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_from"/>
</a:mapping>
</a:field>
<a:field name="bank_account_from_id"/>
<a:field name="bank_account_code_to" autoComplete="true" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_to"/>
</a:mapping>
</a:field>
<a:field name="transaction_amount_from"/>
<a:field name="transaction_amount_to"/>
<a:field name="posted_flag_display" displayField="code_value_name" options="posted_flag_ds" returnField="posted_flag" valueField="code_value"/>
<!-- <a:field name="posted_flag" defaultValue="N"/>-->
<a:field name="returned_flag_display" displayField="code_value_name" options="returned_flag_ds" returnField="returned_flag" valueField="code_value"/>
<a:field name="reversed_flag_display" displayField="code_value_name" options="reversed_flag_ds" returnField="reversed_flag" valueField="code_value"/>
<a:field name="period_name" lovGridHeight="300" lovHeight="500" lovService="gld.gld_period_lov" lovWidth="500" title="GLD_PERIODS.PERIOD_NAME">
<a:mapping>
<a:map from="period_name" to="period_name"/>
</a:mapping>
</a:field>
<a:field name="user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="AUT_TRX_USER_AUTHORIZE.USER_ID" title="员工选择">
<a:mapping>
<a:map from="description" to="user_desc"/>
<a:map from="user_id" to="user_id"/>
</a:mapping>
</a:field>
<a:field name="transaction_type_display" displayField="code_value_name" options="transaction_type_ds" returnField="transaction_type" valueField="code_value"/>
<a:field name="currency_name_from_display" displayField="currency_name" options="currency_ds" returnField="currency_code_from" valueField="currency_code"/>
<a:field name="currency_code_from"/>
<a:field name="currency_name_to_display" displayField="currency_name" options="currency_ds" returnField="currency_code_to" valueField="currency_code"/>
<a:field name="currency_code_to"/>
<a:field name="confirmed" defaultValue="N"/>
<!-- <a:field name="transaction_type" defaultValue="RECEIPT"/>-->
<a:field name="transaction_category" defaultValue="BUSINESS"/>
<!-- <a:field name="write_off_flag_desc" displayField="code_value_name" options="write_off_flag_ds" returnField="write_off_flag" valueField="code_value"/>-->
<a:field name="not_reversed_flag_r" defaultValue="NOT"/>
<a:field name="receipt_type"/>
<a:field name="receipt_type_des" displayField="code_value_name" options="receipt_type_ds" returnField="receipt_type" valueField="code_value"/>
<a:field name="description"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
</a:mapping>
</a:field>
<a:field name="collection_classes_n" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<!--对方账户的-->
<a:field name="bp_bank_account_name" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="opposite_band_na" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="bp_bank_account_num" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
</a:fields>
<a:events>
<a:event name="update" handler="csh510_receipt_maintain_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_result_ds" autoPageSize="true" autoQuery="true" model="csh.CSH510.csh_transaction_miantain_query" queryDataSet="csh_transaction_receipt_maintain_query_ds" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<!-- <a:gridButton click="csh510_receipt_back" text="HLS.BACK"/>
<a:gridButton click="csh510_receipt_forward" text="HLS.FORWARD"/> -->
<!-- <a:gridButton click="csh510_receipt_quit" text="HLS.EXIT"/> -->
<a:gridButton click="csh510_receipt_query" text="HLS.QUERY" id="csh510_receipt_query"/>
<a:gridButton click="csh510_csh_trx_bank_import" text="CSH510.CSH_TRANSACTION.RECEIVE_MONEY_IMPORT_BTN" id="csh510_csh_trx_bank_import"/>
<a:gridButton click="csh510_csh_trx_bank_hand_add" text="CSH510.CSH_TRANSACTION.MONEY_HAND_ADD_BTN" id="csh510_csh_trx_bank_hand_add"/>
<a:gridButton click="csh510_receipt_remove" text="收款取消"/>
<a:gridButton click="csh510_csh_trx_bank_apply_new" text="提交复核" id="csh510_csh_trx_bank_apply_new"/>
<!-- <a:gridButton click="csh510_csh_trx_bank_drop" text="CSH510.CSH_TRANSACTION.DROP_BTN" id="csh510_csh_trx_bank_drop"/>-->
<a:gridButton click="csh510_receipt_reset" text="HLS.RESET"/>
<!-- <a:gridButton click="csh510_csh_transaction_batch_update" text="批量过账"/>-->
<!-- <a:gridButton click="csh510_receipt" text="财务认领"/> -->
</a:screenTopToolbar>
<a:form bindTarget="csh_transaction_receipt_write_off_query_ds" labelWidth="120" marginWidth="80"
title="收款核销" style="margin-left:20px">
<a:hBox>
<a:fieldSet column="4" labelWidth="150" title="HLS.QUERY_TITLE">
<a:datePicker name="transaction_date_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_FROM"/>
<a:datePicker name="transaction_date_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_TO"/>
<a:numberField name="transaction_amount_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_FROM" align="right"/>
<a:numberField name="transaction_amount_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_TO" align="right"/>
<!--我方账户户名-->
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME"/>
<a:lov name="bank_branch_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME"/>
<a:lov name="bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME"/>
<!--银行流水号-->
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE"/>
<!--对方账户户名-->
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME"/>
<!--对方银行名称-->
<a:textField name="opposite_band_na" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/>
<!--对方账户账号-->
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>
<a:textField style="display:none"/>
<a:lov name="bp_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER"/>
<a:comboBox name="confirmed_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="单据审批状态"/>
<!-- <a:comboBox name="write_off_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS"/>-->
<a:comboBox name="collection_classes_n" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS"/>
</a:fieldSet>
</a:hBox>
</a:form>
<a:fieldSet labelWidth="150" title="收款单" style="margin-left:20px">
<a:grid id="csh_transaction_receipt_maintain_grid_ds" bindTarget="csh_transaction_receipt_maintain_result_ds" marginHeight="300" marginWidth="80" navBar="true" >
<!--<a:toolBar>
<a:button click="csh510_export" text="导出"/>
</a:toolBar>-->
<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="receipt_type_n" align="center" prompt="CSH510.CSH_TRANSACTION.RECEIPT_TYPE" width="100"/>-->
<a:column name="transaction_type_desc" align="center" prompt="现金事务类型" width="100"/>
<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="returned_amount" prompt="CSH510.CSH_TRANSACTION.RETURN_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="use_money_amount" prompt="CSH510.CSH_TRANSACTION.USEFUL_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="collection_classes_desc" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS" align="center"/>
<a:column name="bp_name" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER" align="center"/>
<a:column name="bank_slip_num" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE" align="center"/>
<a:column name="description" prompt="CSH510.CSH_TRANSACTION.DESCRIPTION" align="center"/>
<a:column name="confirmed_flag_desc" prompt="单据审批状态" align="center"/>
<!-- <a:column name="written_off_flag_desc" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS" align="center"/>-->
<a:column prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="bank_branch_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bank_account_num" align="center"/>
</a:column>
<a:column prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bp_bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="opposite_band_na" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bp_bank_account_num" align="center"/>
</a:column>
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY" align="center"/>
<!-- <a:column name="debt_confirmed_by_desc" prompt="CSH510.CSH_TRANSACTION.DEPT_CONFIRMER" align="center"/>-->
<a:column name="acc_confirmed_by_desc" prompt="确认人" align="center"/>
</a:columns>
<a:editors>
<a:numberField id="number_editor" allowDecimals="true" decimalPrecision="2" editable="false"/>
</a:editors>
</a:grid>
</a:fieldSet>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: sf
$Date: 2019-09-06 上午11:10:33
$Revision: 1.0
$Purpose: design the function of written_off money
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="basic.csh_payment_method_for_lov" rootPath="payment_method_path"/>
<a:model-query fetchAll="true" model="gld.gld_currency_vl" rootPath="currency"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH511_TRANSACTION_TYPE&apos; and t.code_value in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="transaction_type"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_RETURN_SELECT&apos; and t.code_value not in (&apos;RETURN&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="returned_flag_rp"/>
<a:model-query defaultWhereClause="t.code = &apos;CSH510_REVERSE_SELECT&apos; and t.code_value not in (&apos;R&apos;)" fetchAll="true" model="sys.sys_code_values_v" rootPath="reversed_flag_rp"/>
</a:init-procedure>
<a:view>
<a:link id="csh_transaction_receipt_link" url="${/request/@context_path}/modules/csh/CSH511/csh_transaction_receipt.lview"/>
<a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
<a:link id="csh_transaction_receipt_update_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>
<!-- <a:link id="csh_transaction_receipt_maintain_post_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_receipt_update.lview"/>-->
<a:link id="csh_transaction_receipt_maintain_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update.lview"/>
<a:link id="csh_transaction_receipt_maintain_readonly_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_hand_receipt_update_readonly.lview"/>
<a:link id="csh510_csh_transaction_batch_update" model="csh.CSH510.csh_transaction_delete" modelaction="batch_update"/>
<a:link id="csh511_csh_transaction_batch_post_link" model="csh.CSH511.csh_transaction_post" modelaction="batch_update"/>
<!--更新收款单据的状态-->
<a:link id="csh509N_batch_update_confirmed_flag" model="csh.CSH509.query_roles_info" modelaction="batch_update"/>
<a:link id="csh510N_csh_transaction_batch_update_confirmed_flag" model="csh.CSH510.csh_transaction_update" modelaction="batch_update"/>
<!-- <a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510/csh_transaction_import.lview"/>-->
<a:link id="csh510_csh_transaction_import_link" url="${/request/@context_path}/modules/csh/CSH510N/csh_transaction_import.lview"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
//console.log($('csh_transaction_receipt_maintain_result_ds'));
})
//新增单据的作废
function csh510_csh_trx_bank_drop(){
$('csh510_csh_trx_bank_drop').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
if (datas.length == 0) {
$L.showMessage("提示", '请选择要作废的单据');
$('csh510_csh_trx_bank_drop').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag= datas[i].get('confirmed_flag');
//不是新增就报错
if(confirmed_flag!='NEW'&&confirmed_flag!='CT_REJECTED'){
$L.showInfoMessage("提示", '请选择单据为新建或收款退回的数据', null, null);
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
//提交想改变之后的状态
'wanted_confirmed_flag': 'CANCELLED',
'_status': 'update'
});
};
//弹出确认修改的提示框
$L.showConfirm("提示",'确认执行该操作?',function(){
//锁屏
lock_current_window();
//作废单据
Leaf.request({
url: $('csh509N_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '该单据已作废!');
$('csh510_csh_trx_bank_drop').enable();
}, failure: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
error: function () {
unlock_current_window();
$('csh510_csh_trx_bank_drop').enable();
},
scope: this
});
})
}
//新增申请按钮
function csh510_csh_trx_bank_apply_new() {
$('csh510_csh_trx_bank_apply_new').disable();
var datas = $('csh_transaction_receipt_maintain_result_ds').selected;
//获得所选择的的未提交的单据,如果有不是未提交的数据,提示重新进行选择
if (datas.length == 0) {
$L.showMessage("提示", '请至少选择一条数据');
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
var post_data=[];
for(var i=0;i<datas.length;i=i+1) {
var confirmed_flag = datas[i].get('confirmed_flag');
var bp_name=datas[i].get('bp_name');
if(bp_name==''||bp_name==undefined){
$L.showInfoMessage("提示", '商业伙伴为空,不能提交', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//不是新增就报错
if (confirmed_flag != 'NEW' && confirmed_flag != 'CT_REJECTED') {
$L.showInfoMessage("提示", '请选择单据为新建或收款退回的数据', null, null);
$('csh510_csh_trx_bank_apply_new').enable();
return;
}
//将对象封装到json对象数组
post_data.push({
'transaction_id': datas[i].get('transaction_id'),
'_status': 'update'
});
}
//弹出确认修改的提示框
$L.showConfirm("提示", '确认执行该操作?', function () {
//锁屏
lock_current_window();
//改变未提交单据数据的状态
Leaf.request({
url: $('csh510N_csh_transaction_batch_update_confirmed_flag').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
$('csh_transaction_receipt_maintain_result_ds').query();
Leaf.showMessage('${l:PROMPT}', '提交成功!');
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
}, failure: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
error: function () {
//启用按钮
$('csh510_csh_trx_bank_apply_new').enable();
unlock_current_window();
},
scope: this
});
},function(){
$('csh510_csh_trx_bank_apply_new').enable();
});
}
//跳转到收款新增页面
function csh510_csh_trx_bank_hand_add(){
//按钮失效
$('csh510_csh_trx_bank_hand_add').disable();
var url = $('csh_transaction_receipt_link').getUrl();
var win = new Leaf.Window({
title:'${l:CSH510.NEW_MANUAL_RECEIPT}',
url: url,
id: 'csh_trx_receipt_id',
fullScreen: true,
draggable: true
}).on('close', function() {
//按钮启用
$('csh510_csh_trx_bank_hand_add').enable();
$('csh_transaction_receipt_maintain_result_ds').query();
});
}
//锁表
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
//解锁
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
}
function dateValidator(record, name, value) { //日期校验方法
if (name == 'transaction_date_from' || name == 'transaction_date_to') {
var start_date = Leaf.formatDate(record.get('transaction_date_from'));
var end_date = Leaf.formatDate(record.get('transaction_date_to'));
if (!!end_date) { //由于结束日期非必填,只有在结束日期填了才进行比较
if (!compareDate(start_date, end_date)) {
return '${l:CSH510.CSH_RECEIPT_DATE_CHECK}'; //校验不通过返回字符串
}
}
return true; //校验通过返回true
}
}
function compareDate(start, end) {
if (start > end) {
return false;
}
return true;
}
function csh510_receipt_query() {
var record = $('csh_transaction_receipt_maintain_query_ds').getAt(0);
var dirty_flag = 'N';
for (var name in record.data) {
var value = record.get(name);
if (value != 'undefined' && value != null && value != '') {
dirty_flag = 'Y';
}
}
if (dirty_flag == 'N') {
Leaf.showConfirm('${l:PROMPT}', '${l:CSH510.CSH_RECEIPT_QUERY_INFORMATION}', function () {
return;
}, function () {
$('csh_transaction_receipt_maintain_result_ds').query();
}, null, null);
} else {
$('csh_transaction_receipt_maintain_result_ds').query();
}
}
function csh510_receipt_reset() {
$('csh_transaction_receipt_maintain_query_ds').reset();
}
function csh510_receipt_back() {
history.go(-1);
}
function csh510_receipt_forward() {
history.go(1);
}
function csh510_receipt_quit() {
location.href = $('sys_service_welcome_link').getUrl();
parent.shMenu('show');
}
function seedetail_transaction_num(value, record, name) {
/* console.log(record.get('receipt_type'));
console.log( record.get('bp_name'));
console.log( record.get('confirmed_flag'));*/
if (record.get('transaction_id')) {
var url;
/*if (record.get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} /!*else*!/ else if (record.get('posted_flag') == 'Y') {
url = $('csh_transaction_receipt_update_link').getUrl() + '?transaction_id=' + record.get('transaction_id');
} else {
return value;
}*/
if(record.get('confirmed_flag')=='NEW' || record.get('confirmed_flag') == 'CT_REJECTED'){
url = $('csh_transaction_receipt_maintain_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=true';
}else{
url = $('csh_transaction_receipt_maintain_readonly_link').getUrl() + '?transaction_id=' + record.get('transaction_id')+'&update_flag=false';
}
return '<a href="javascript:openWindow(\'' + url + '\');">' + value + '</a>';
}
}
function openWindow(url) {
var win = new Leaf.Window({
id: 'csh_transaction_receipt_link_winid',
params: {
winId: 'csh_transaction_receipt_link_winid'
},
url: url,
title: '${l:CSH510.CSH_RECEIPT_UPDATE}',
fullScreen: true
});
win.on('close',function(){
$('csh_transaction_receipt_maintain_result_ds').query();
});
}
function construct_from_to() {
var config = ['transaction_num', 'bank_slip_num', 'transaction_amount', 'currency_code', 'bank_account_code'];
var pattern = ['_from', '_to'];
var obj = {};
for (var i = 0,
j = config.length; i < j; i++) {
for (var m = 0,
n = pattern.length; m < n; m++) {
obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
}
}
return obj;
}
function csh510_receipt_maintain_update(ds, record, name, value, oldvalue) {
var from_to = construct_from_to();
var opposite_name = from_to[name];
if (!Ext.isEmpty(opposite_name)) {
var opposite_value = record.get(opposite_name);
if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
record.set(opposite_name, value);
}
}
}
function csh510_receipt_remove() {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (!records.length) {
Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.SELECT_RECORD}');
return;
}
var saveData = [];
for (var i = 0; i < records.length; i++) {
if(records[i].get('confirmed_flag') != 'NEW' && records[i].get('confirmed_flag') != 'CT_REJECTED'){
Leaf.showInfoMessage("提示","请选择新建或者收款退回的单据进行收款取消操作!");
return;
}
records[i].set('_status', 'delete');
saveData.push(records[i].data);
}
Leaf.showConfirm('${l:PROMPT}', '${l:HLS.DELETE_CONFIRM}', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.DELETING}');
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH510.csh_transaction_delete/batch_update',
para: saveData,
success: function () {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
csh510_delete_remove(records);
Leaf.Masker.unmask(Ext.getBody());
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, function () {
return;
}, null, null);
}
function csh510_delete_remove(records) {
while (records[0]) {
$('csh_transaction_receipt_maintain_result_ds').removeLocal(records[0]);
}
}
function csh510_receipt() {
Leaf.showConfirm('${l:PROMPT}', '非财务人员请勿操作!', function () {
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}', '请选择1条数据!');
return;
}
if (records[0].get('transaction_id')) {
var url;
if (records[0].get('posted_flag') == 'N') {
url = $('csh_transaction_receipt_maintain_post_link').getUrl() + '?transaction_id=' + records[0].get('transaction_id') + '&claim=F';
} else {
Leaf.showMessage('${l:PROMPT}', '该单据已经被认领,无需再次认领!');
return;
}
openWindow(url);
}
});
}
function csh510_batch_update() {
var ds_id = 'csh_transaction_receipt_maintain_result_ds';
var ds = $(ds_id)
var records = ds.getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:PROMPT}', '请至少选择一条要处理的单据');
return;
}
var auto_write_record = $('csh510_collection_classes_batch_update_ds').getAt(0);
var collection_classes = auto_write_record.get('collection_classes');
if (collection_classes) {
lock_current_window();
var post_data = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('write_off_flag') == 'FULL') {
Leaf.showMessage('${l:PROMPT}', '选择数据中包含已完全核销的数据');
return;
}
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'collection_classes': auto_write_record.get('collection_classes'),
'_status': 'update'
});
}
Leaf.request({
url: $('csh510_csh_transaction_batch_update').getUrl(),
para: post_data,
success: function () {
unlock_current_window();
ds.query(ds.currentpage);
Leaf.showMessage('${l:PROMPT}', '修改成功!');
}, failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
}
}
function csh510_csh_transaction_batch_update(){
//
var records = $('csh_transaction_receipt_maintain_result_ds').getSelected();
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择一条记录!');
return;
}
var post_data = [];
for (var i = 0; i < records.length; i++) {
post_data.push({
'transaction_id': records[i].get('transaction_id'),
'_status': 'update'
});
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('csh511_csh_transaction_batch_post_link').getUrl(),
para: post_data,
success: function (res) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.SUBMIT_SUCCESS}');
csh510_receipt_query();
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function csh510_csh_trx_bank_import(){
//按钮失效
$('csh510_csh_trx_bank_import').disable();
//只有债权内勤才能
var url_l = $('csh510_csh_transaction_import_link').getUrl();
var win = new Leaf.Window({
id: 'csh510_csh_transaction_import_win',
url: url_l,
params: {
'winid': 'csh510_csh_transaction_import_win',
'session_id': '${/session/@session_id}',
'parent_ds_id': 'csh_transaction_receipt_maintain_result_ds'
},
title: '信息导入',
width: 430,
height: 390
});
win.on('close', function () {
$('csh_transaction_receipt_maintain_result_ds').query();
//按钮启用
$('csh510_csh_trx_bank_import').enable();
});
}
function csh510_export() {
$('csh_transaction_receipt_maintain_grid_ds')._export(null,'收款维护');
}
]]></script>
<a:dataSets>
<a:dataSet id="confirmed_flag_ds">
<a:datas>
<a:record code_value="NEW" code_value_name="新建"/>
<a:record code_value="ACCAUDITING" code_value_name="收款确认中"/>
<a:record code_value="CT_REJECTED" code_value_name="收款退回"/>
<a:record code_value="ACCAUDITED" code_value_name="收款已确认"/>
</a:datas>
</a:dataSet>
<a:dataSet id="bp_category_ds" lookupCode="BP_CATEGORY">
</a:dataSet>
<!-- <a:dataSet id="confirmed_flag_ds" lookupCode="CONFIRMED_FLAG">-->
<!-- </a:dataSet>-->
<a:dataSet id="payment_method_ds">
<a:datas dataSource="/model/payment_method_path"/>
</a:dataSet>
<a:dataSet id="receipt_type_ds" lookupCode="RECEIPT_TYPE"/>
<a:dataSet id="currency_ds">
<a:datas dataSource="/model/currency"/>
</a:dataSet>
<a:dataSet id="transaction_type_ds">
<a:datas dataSource="/model/transaction_type"/>
</a:dataSet>
<!-- <a:dataSet id="transaction_type_ds" lookupCode="CSH511_TRANSACTION_TYPE"/> -->
<a:dataSet id="posted_flag_ds" lookupCode="CSH510_POST_SELECT"/>
<!-- 去掉退款事务 -->
<a:dataSet id="returned_flag_ds">
<a:datas dataSource="/model/returned_flag_rp"/>
</a:dataSet>
<!-- 去掉反冲事务 -->
<a:dataSet id="reversed_flag_ds">
<a:datas dataSource="/model/reversed_flag_rp"/>
</a:dataSet>
<a:dataSet id="ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>
<a:dataSet id="csh510_collection_classes_batch_update_ds">
<a:fields>
<a:field name="collection_classes_desc" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_query_ds" autoCreate="true">
<a:fields>
<a:field name="bank_account_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_branch_name" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="bank_account_num" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="850" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="precision" to="precision"/>
<a:map from="zero_amounts_allowed" to="zero_amounts_allowed"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_num" to="bank_account_num"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="currency_code" to="currency_code"/>
<a:map from="currency_name" to="currency_name"/>
<a:map from="bank_account_type" to="bank_account_type"/>
<a:map from="bank_account_type_name" to="bank_account_type_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
</a:mapping>
</a:field>
<a:field name="confirmed_flag_desc" options="confirmed_flag_ds" valueField="code_value" displayField="code_value_name" returnField="confirmed_flag"/>
<a:field name="payment_method_display" displayField="description" options="payment_method_ds" returnField="payment_method_id" valueField="payment_method_id"/>
<a:field name="bp_name_from" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_from"/>
<a:map from="bp_name" to="bp_name_from"/>
</a:mapping>
</a:field>
<a:field name="bp_id_from"/>
<a:field name="bp_name_to" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_to"/>
<a:map from="bp_name" to="bp_name_to"/>
</a:mapping>
</a:field>
<a:field name="bp_id_to"/>
<a:field name="transaction_num_from"/>
<a:field name="transaction_num_to"/>
<a:field name="transaction_num"/>
<a:field name="bank_slip_num_from"/>
<a:field name="bank_slip_num_to"/>
<a:field name="transaction_date_from" validator="dateValidator"/>
<a:field name="transaction_date_to" validator="dateValidator"/>
<a:field name="bank_account_code" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code"/>
</a:mapping>
</a:field>
<a:field name="bank_account_code_from" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_from"/>
</a:mapping>
</a:field>
<a:field name="bank_account_from_id"/>
<a:field name="bank_account_code_to" autoComplete="true" autoCompleteField="bank_account_num" lovGridHeight="350" lovHeight="550" lovLabelWidth="90" lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
<a:mapping>
<a:map from="bank_account_code" to="bank_account_code_to"/>
</a:mapping>
</a:field>
<a:field name="transaction_amount_from"/>
<a:field name="transaction_amount_to"/>
<a:field name="posted_flag_display" displayField="code_value_name" options="posted_flag_ds" returnField="posted_flag" valueField="code_value"/>
<!-- <a:field name="posted_flag" defaultValue="N"/>-->
<a:field name="returned_flag_display" displayField="code_value_name" options="returned_flag_ds" returnField="returned_flag" valueField="code_value"/>
<a:field name="reversed_flag_display" displayField="code_value_name" options="reversed_flag_ds" returnField="reversed_flag" valueField="code_value"/>
<a:field name="period_name" lovGridHeight="300" lovHeight="500" lovService="gld.gld_period_lov" lovWidth="500" title="GLD_PERIODS.PERIOD_NAME">
<a:mapping>
<a:map from="period_name" to="period_name"/>
</a:mapping>
</a:field>
<a:field name="user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="AUT_TRX_USER_AUTHORIZE.USER_ID" title="员工选择">
<a:mapping>
<a:map from="description" to="user_desc"/>
<a:map from="user_id" to="user_id"/>
</a:mapping>
</a:field>
<a:field name="transaction_type_display" displayField="code_value_name" options="transaction_type_ds" returnField="transaction_type" valueField="code_value"/>
<a:field name="currency_name_from_display" displayField="currency_name" options="currency_ds" returnField="currency_code_from" valueField="currency_code"/>
<a:field name="currency_code_from"/>
<a:field name="currency_name_to_display" displayField="currency_name" options="currency_ds" returnField="currency_code_to" valueField="currency_code"/>
<a:field name="currency_code_to"/>
<a:field name="confirmed" defaultValue="N"/>
<!-- <a:field name="transaction_type" defaultValue="RECEIPT"/>-->
<a:field name="transaction_category" defaultValue="BUSINESS"/>
<!-- <a:field name="write_off_flag_desc" displayField="code_value_name" options="write_off_flag_ds" returnField="write_off_flag" valueField="code_value"/>-->
<a:field name="not_reversed_flag_r" defaultValue="NOT"/>
<a:field name="receipt_type"/>
<a:field name="receipt_type_des" displayField="code_value_name" options="receipt_type_ds" returnField="receipt_type" valueField="code_value"/>
<a:field name="description"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_name"/>
</a:mapping>
</a:field>
<a:field name="collection_classes_n" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<!--对方账户的-->
<a:field name="bp_bank_account_name" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="opposite_band_na" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="bp_bank_account_num" lovGridHeight="350" lovHeight="550" lovService="csh.CSH510.csh_transaction_for_lov" lovLabelWidth="90" lovWidth="580" title="对方账户信息">
<a:mapping>
<a:map from="bp_bank_account_name" to="bp_bank_account_name"/>
<a:map from="opposite_band_na" to="opposite_band_na"/>
<a:map from="bp_bank_account_num" to="bp_bank_account_num"/>
</a:mapping>
</a:field>
</a:fields>
<a:events>
<a:event name="update" handler="csh510_receipt_maintain_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="csh_transaction_receipt_maintain_result_ds" autoPageSize="true" autoQuery="true" model="csh.CSH510.csh_transaction_miantain_query" queryDataSet="csh_transaction_receipt_maintain_query_ds" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<!-- <a:gridButton click="csh510_receipt_back" text="HLS.BACK"/>
<a:gridButton click="csh510_receipt_forward" text="HLS.FORWARD"/> -->
<!-- <a:gridButton click="csh510_receipt_quit" text="HLS.EXIT"/> -->
<a:gridButton click="csh510_receipt_query" text="HLS.QUERY" id="csh510_receipt_query"/>
<a:gridButton click="csh510_csh_trx_bank_import" text="CSH510.CSH_TRANSACTION.RECEIVE_MONEY_IMPORT_BTN" id="csh510_csh_trx_bank_import"/>
<a:gridButton click="csh510_csh_trx_bank_hand_add" text="CSH510.CSH_TRANSACTION.MONEY_HAND_ADD_BTN" id="csh510_csh_trx_bank_hand_add"/>
<a:gridButton click="csh510_receipt_remove" text="收款取消"/>
<a:gridButton click="csh510_csh_trx_bank_apply_new" text="提交复核" id="csh510_csh_trx_bank_apply_new"/>
<!-- <a:gridButton click="csh510_csh_trx_bank_drop" text="CSH510.CSH_TRANSACTION.DROP_BTN" id="csh510_csh_trx_bank_drop"/>-->
<a:gridButton click="csh510_receipt_reset" text="HLS.RESET"/>
<!-- <a:gridButton click="csh510_csh_transaction_batch_update" text="批量过账"/>-->
<!-- <a:gridButton click="csh510_receipt" text="财务认领"/> -->
</a:screenTopToolbar>
<a:form bindTarget="csh_transaction_receipt_write_off_query_ds" labelWidth="120" marginWidth="80"
title="收款核销" style="margin-left:20px">
<a:hBox>
<a:fieldSet column="4" labelWidth="150" title="HLS.QUERY_TITLE">
<a:datePicker name="transaction_date_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_FROM"/>
<a:datePicker name="transaction_date_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_DATE_TO"/>
<a:numberField name="transaction_amount_from" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_FROM" align="right"/>
<a:numberField name="transaction_amount_to" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.TRANSACTION_AMOUNT_TO" align="right"/>
<!--我方账户户名-->
<a:lov name="bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME"/>
<a:lov name="bank_branch_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME"/>
<a:lov name="bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME"/>
<!--银行流水号-->
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE"/>
<!--对方账户户名-->
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME"/>
<!--对方银行名称-->
<a:textField name="opposite_band_na" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/>
<!--对方账户账号-->
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>
<a:textField name="transaction_num" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="现金事务编号"/>
<!-- <a:textField style="display:none"/>-->
<a:lov name="bp_name" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER"/>
<a:comboBox name="confirmed_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="单据审批状态"/>
<!-- <a:comboBox name="write_off_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS"/>-->
<a:comboBox name="collection_classes_n" bindTarget="csh_transaction_receipt_maintain_query_ds" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS"/>
</a:fieldSet>
</a:hBox>
</a:form>
<a:fieldSet labelWidth="150" title="收款单" style="margin-left:20px">
<a:grid id="csh_transaction_receipt_maintain_grid_ds" bindTarget="csh_transaction_receipt_maintain_result_ds" marginHeight="300" marginWidth="80" navBar="true" >
<!--<a:toolBar>
<a:button click="csh510_export" text="导出"/>
</a:toolBar>-->
<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="receipt_type_n" align="center" prompt="CSH510.CSH_TRANSACTION.RECEIPT_TYPE" width="100"/>-->
<a:column name="transaction_type_desc" align="center" prompt="现金事务类型" width="100"/>
<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="returned_amount" prompt="CSH510.CSH_TRANSACTION.RETURN_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="use_money_amount" prompt="CSH510.CSH_TRANSACTION.USEFUL_AMOUNT" align="right" renderer="Leaf.formatMoney"/>
<a:column name="collection_classes_desc" prompt="CSH510.CSH_TRANSACTION.PURPOSE_OF_FUNDS" align="center"/>
<a:column name="bp_name" prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER" align="center"/>
<a:column name="bank_slip_num" prompt="CSH510.CSH_TRANSACTION.BANK_CASH_CODE" align="center"/>
<a:column name="description" prompt="CSH510.CSH_TRANSACTION.DESCRIPTION" align="center"/>
<a:column name="confirmed_flag_desc" prompt="单据审批状态" align="center"/>
<!-- <a:column name="written_off_flag_desc" prompt="CSH510.CSH_TRANSACTION.WRITTEN_OFF_STATUS" align="center"/>-->
<a:column prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="bank_branch_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bank_account_num" align="center"/>
</a:column>
<a:column prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT">
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NAME" name="bp_bank_account_name" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_BANK" name="opposite_band_na" align="center"/>
<a:column prompt="CSH510.CSH_TRANSACTION.ACCOUNT_NUM" name="bp_bank_account_num" align="center"/>
</a:column>
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY" align="center"/>
<!-- <a:column name="debt_confirmed_by_desc" prompt="CSH510.CSH_TRANSACTION.DEPT_CONFIRMER" align="center"/>-->
<a:column name="acc_confirmed_by_desc" prompt="确认人" align="center"/>
</a:columns>
<a:editors>
<a:numberField id="number_editor" allowDecimals="true" decimalPrecision="2" editable="false"/>
</a:editors>
</a:grid>
</a:fieldSet>
</a:screenBody>
</a:view>
</a:screen>
......@@ -43,6 +43,10 @@
param['transaction_id'] = '${/parameter/@transaction_id}';
param['bp_id'] = head_record.get('bp_id');
param['bp_category'] = head_record.get('bp_category');
if(deposit_records.length<1){
Leaf.showMessage('提示', '请先新增保证金入账明细!');
return;
}
for (var i = 0; i < deposit_records.length; i++) {
var deposit_record;
deposit_record = deposit_records[i];
......
......@@ -18,7 +18,7 @@
url="${/request/@context_path}/modules/hls/HLS236/hls_bp_master_query_ccx_report.lview"/>
<a:link id="hls_bp_ccx_icinfo_link"
url="${/request/@context_path}/modules/hls/HLS236/hls_bp_master_query_ccx_icinfo.lview"/>
<script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
<!-- <script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>-->
<script type="text/javascript"><![CDATA[
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_BP_RESULT', 'hls_bp_master');
......@@ -125,7 +125,7 @@
}
//异步打印
ds.setQueryParameter('__async__', 'Y');
// ds.setQueryParameter('__async__', 'Y');
};
]]></script>
<a:screen-include
......
......@@ -137,19 +137,6 @@
return false;
}
var social_code=head_record.get('social_code');
var id_card_no_leg=head_record.get('id_card_no_leg');
if(!checkCard(id_card_no_leg)){
$L.showErrorMessage("错误",'请输入合法的身份证号!',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if(!CheckSocialCreditCode(social_code)){
$L.showErrorMessage("错误",'请输入正确的社会信用代码!',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if (head_record.get('bp_code')) {
return true;
}
......@@ -157,16 +144,18 @@
var social_code=head_record.get('social_code');
var id_card_no_leg=head_record.get('id_card_no_leg');
if(id_card_no_leg){
if(!checkCard(id_card_no_leg)){
$L.showErrorMessage("错误",'请输入合法的身份证号!',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}}
if(social_code){
if(!CheckSocialCreditCode(social_code)){
$L.showErrorMessage("错误",'请输入正确的社会信用代码!',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}}
Leaf.request({
......
......@@ -7,8 +7,45 @@
<a:link id="prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="hls303_sap_eai_create_customer_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrCustomer.lsc"/>
<a:link id="hls303_sap_eai_create_vender_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrVender.lsc"/>
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js" type="text/javascript"/>
<script type="text/javascript"><![CDATA[
var flag = 0;
function CheckSocialCreditCode(Code) {
var patrn = /^[0-9A-Z]+$/;
//18位校验及大写校验
if ((Code.length != 18) || (patrn.test(Code) == false)) {
return false;
} else {
var Ancode;//统一社会信用代码的每一个值
var Ancodevalue;//统一社会信用代码每一个值的权重
var total = 0;
var weightedfactors = [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28];//加权因子
var str = '0123456789ABCDEFGHJKLMNPQRTUWXY';
//不用I、O、S、V、Z
for (var i = 0; i < Code.length - 1; i++) {
Ancode = Code.substring(i, i + 1);
Ancodevalue = str.indexOf(Ancode);
total = total + Ancodevalue * weightedfactors[i];
//权重与加权因子相乘之和
}
var logiccheckcode = 31 - total % 31;
if (logiccheckcode == 31) {
logiccheckcode = 0;
}
var Str = "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,T,U,W,X,Y";
var Array_Str = Str.split(',');
logiccheckcode = Array_Str[logiccheckcode];
var checkcode = Code.substring(17, 18);
if (logiccheckcode != checkcode) {
return false;
} else {
return true;
}
}
}
//锁屏
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window'] = function () {
var detail_mask;
......@@ -132,6 +169,20 @@
}else{
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
var social_code=head_record.get('social_code');
var id_card_no_leg=head_record.get('id_card_no_leg');
if(id_card_no_leg){
if(!checkCard(id_card_no_leg)){
$L.showErrorMessage("错误",'请输入合法的身份证号!',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}}
if(social_code){
if(!CheckSocialCreditCode(social_code)){
$L.showErrorMessage("错误",'请输入正确的社会信用代码!',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}}
};
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
......
......@@ -8,7 +8,7 @@ $Purpose: 商业伙伴授信维护
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="basic.get_sys_default_time" rootPath="sys_default_time"/>-->
<a:model-query fetchAll="true" model="basic.get_sys_default_time" rootPath="sys_default_time"/>
</a:init-procedure>
<a:view>
<a:link id="credit_enhance_detail_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
......@@ -21,70 +21,89 @@ $Purpose: 商业伙伴授信维护
$(credit_ds).query();
})
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
var dirty_flag='N';
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
dirty_flag='Y';
};
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var check_flag = true;
var credit_date_from=Leaf.formatDate(record.get('credit_date_from'))
var credit_date_to=Leaf.formatDate(record.get('credit_date_to'));
var total_amount=record.get('credit_total_amount');
var used_credit_amount=record.get('used_amount');
if (record.dirty){
if(total_amount<used_credit_amount){
$L.showErrorMessage("错误",'修改后剩余授信额度小于0',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if(credit_date_from>credit_date_to){
$L.showErrorMessage("错误",'终止日需大于生效日',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if(credit_date_to<Leaf.formatDate(new Date())){
$L.showErrorMessage("错误",'终止日早于当前时间',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
Leaf.request({
url: $('hls361N_update_credit_link_id').getUrl(),
para: {
bp_credit_hd_id : record.get('bp_credit_hd_id'),
credit_total_amount: total_amount,
credit_date_from : credit_date_from,
credit_date_to : credit_date_to
},
success: function () {
var credit_ds = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd');
var record =$(credit_ds).getCurrentRecord();
var credit_date_from=Leaf.formatDate(record.get('credit_date_from'))
var credit_date_to=Leaf.formatDate(record.get('credit_date_to'));
var total_amount=record.get('credit_total_amount');
var used_credit_amount=record.get('used_amount');
if (dirty_flag=='Y'){
if(credit_date_from>credit_date_to){
$L.showErrorMessage("错误",'终止日需大于生效日',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
$('credit_ds').query();
},
error: function() {
return false;
}
if(credit_date_to<Leaf.formatDate(new Date())){
$L.showErrorMessage("错误",'终止日早于当前时间',null,null);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
return false;
}
Leaf.request({
url: $('hls361N_update_credit_link_id').getUrl(),
para: {
bp_credit_hd_id : record.get('bp_credit_hd_id'),
credit_total_amount: total_amount,
credit_date_from : credit_date_from,
credit_date_to : credit_date_to,
used_amount: record.get('used_amount'),
bp_id:record.get('bp_id')
},
success: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
//$('credit_ds').query();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this,
sync:true
});
}else{
if('${/parameter/@credit_status}'=='APPROVED'){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
sync: true,
scope: this
});}else{
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
$('credit_ds').query();
}
return check_flag;
};
$('${/parameter/@winid}').close();
// $('credit_ds').query();
}
else if('${/parameter/@credit_status}'=='REJECT'){
Leaf.request({
url: $('hls361N_update_credit_link_id').getUrl(),
para: {
bp_credit_hd_id : record.get('bp_credit_hd_id'),
credit_total_amount: total_amount,
credit_date_from : credit_date_from,
credit_date_to : credit_date_to,
used_amount: record.get('used_amount'),
bp_id:record.get('bp_id')
},
success: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
}
}
]]></script>
......
......@@ -30,11 +30,9 @@ $Purpose: 商业伙伴授信维护
})
//判断角色是否可以操作
function judgeRoles(position_code){
var datas='${/model/position_code}'.data;
for(var i=0;i<datas.length;i++){
if(datas[i].data.position_code==position_code){
return true;
}
}
......@@ -45,14 +43,12 @@ $Purpose: 商业伙伴授信维护
//console.log(record);
var link_function = '';
window['${/parameter/@bp_seq}${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'bp_code' && value) {
if (record.get('bp_category')=='TENANT'){
link_function = 'on_business_tenant_detail_window';
}else if ( record.get('bp_category')=='AGENT'){
link_function = 'on_business_agent_detail_window';
}
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + value + '</a>';
}
}
......@@ -109,6 +105,7 @@ $Purpose: 商业伙伴授信维护
param['credit_date_from']=datas[0].get('credit_date_from');
param['credit_total_amount']=datas[0].get('credit_total_amount');
param['bp_code']=datas[0].get('bp_code');
param['bp_id']=datas[0].get('bp_id');
param['credit_status']=datas[0].get('credit_status');
param['winid']='hls_bp_credit_winId';
......
......@@ -31,11 +31,11 @@
<a:columns>
<a:column name="bp_code" prompt="代理店编码" align="center" width="120"/>
<a:column name="bp_name" prompt="代理店名称" align="center" width="170"/>
<a:column name="credit_total_amount" prompt="授信总额度" align="center" width="200"/>
<a:column name="credit_total_amount" prompt="授信总额度" align="center" width="200" renderer="Leaf.formatMoney"/>
<a:column name="credit_date_from" prompt="授信日期从" align="center" width="120"/>
<a:column name="credit_date_to" prompt="授信日期到" width="110" align="center"/>
<a:column name="last_updated_by_desclast_update_date" prompt="变更日期" width="110" align="center"/>
<!--<a:column name="" prompt="变更人" width="110" align="center"/>-->
<a:column name="last_update_date" prompt="变更日期" width="110" align="center"/>
<a:column name="temp_user_desc" prompt="变更人" width="110" align="center"/>
</a:columns>
</a:grid>
</a:fieldSet>
......
......@@ -102,8 +102,8 @@ $Purpose: 商业伙伴授信维护
}
//审批冻结判断
var credit_status=datas[0].data.credit_status;
if(credit_status!='FREZZING'){
$L.showInfoMessage("提示",'请选择状态为审批冻结的数据!',null,null)
if(credit_status!='APPROVING'){
$L.showInfoMessage("提示",'请选择状态为审批的数据!',null,null)
return;
}
//角色判断
......@@ -184,7 +184,7 @@ $Purpose: 商业伙伴授信维护
var win = new Leaf.Window({
id: 'hls_bp_credit_record_window',
params: {
bp_credit_hd_id: record.get('bp_credit_hd_id'),
bp_credit_hd_id: record[0].get('bp_credit_hd_id'),
winid: 'hls_bp_credit_record_window'
},
url: $('credit_detail_link').getUrl(),
......
......@@ -82,6 +82,10 @@
function hls_hls500_save(nextStep, source_procedure) {
lock_calc_current_window('${l:HLS.SAVING}');
if (!$('hls_fin_calculator_hd_ds').validate() || !$('hls_fin_calculator_ln_ds').validate()) {
unlock_calc_current_window();
return;
}
if('${/parameter/@document_category}'=='PROJECT'){
Leaf.request({
url: $('prj_check_prj_record_link_id').getUrl(),
......@@ -89,27 +93,67 @@
'project_id': '${/parameter/@document_id}'
},
success: function(res) {
debugger;
var secondary_lease = res.result.secondary_lease;
var payment_deduction = res.result.payment_deduction;
var price_list = res.result.price_list;
/* if((price_list=='HL_PRICR_E'||price_list=='HL_PRICR_TEST'||price_list=='HL_PRICR_NTEST'||price_list=='HL_PRICR_EN') && secondary_lease=='NO'){
var count=0;
var denominator=0;
var down_payment_rate_new=res.result.down_payment_rate_new;
if((price_list=='HL_PRICR_E'||price_list=='HL_PRICR_TEST'||price_list=='HL_PRICR_NTEST'||price_list=='HL_PRICR_EN') && secondary_lease=='NO'){
//比例=(H16+H97)/(H99+H102-H16)
var H16,H97,H99,H102;
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
if(temp_head_records[i].get('column_code')=='H16'||temp_head_records[i].get('column_code')=='H97'){
count=count+temp_head_records[i].get('column_value')||0
}else if(temp_head_records[i].get('column_code')=='H99'||temp_head_records[i].get('column_code')=='H102'){
denominator=denominator+temp_head_records[i].get('column_value')||0
if(temp_head_records[i].get('column_code')=='H16'){
H16=temp_head_records[i].get('column_value')||0
}else if(temp_head_records[i].get('column_code')=='H97'){
H97=temp_head_records[i].get('column_value')||0
}else if(temp_head_records[i].get('column_code')=='H99'){
H99=temp_head_records[i].get('column_value')||0
}else if(temp_head_records[i].get('column_code')=='H102'){
H102=temp_head_records[i].get('column_value')||0
}
}
if((count/denominator)<0.15){
Leaf.showMessage('${l:PROMPT}', '首付款比例+首付款保证金比例之和不能低于15%');
unlock_calc_current_window('${l:HLS.CALCULATING}');
var aa=H16+H97;
var bb=H99+H102-H16;
var cc=div((H16+H97),(H99+H102-H16));
// alert(div((H16+H97), (H99+H102-H16)).toFixed(2) * 1);
var show=down_payment_rate_new*100;
if((div((H16+H97), (H99+H102-H16)).toFixed(2) * 1)<down_payment_rate_new){
unlock_calc_current_window();
Leaf.showMessage('${l:PROMPT}', '首付款比例+首付款保证金比例之和不能低于'+down_payment_rate_new*100+'%');
return false;
}
}*/
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
$('temp_hd_attribute_ds').create(temp_head_records[i].data);
}
}
var all_records = $('temp_hd_attribute_ds').getAll();
var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
headRecord.isNew = false;
headRecord.dirty = true;
create_record_column(all_records, headRecord);
function hls_fin_cal_save_hd_submitsuccess(ds, res) {
if (typeof(nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
Leaf.SideBar.enable = true;
success_sidebar_show();
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
}
if(price_list=='HL_PRICR_E' ||price_list=='HL_PRICR_TEST'||price_list=='HL_PRICR_NTEST'||price_list=='HL_PRICR_EN'){
if(payment_deduction!='TRADE_IN' && payment_deduction!='TRI_AGREEMENT' ){
var record = $('hls_fin_calculator_hd_ds').getAll();
......@@ -129,18 +173,13 @@
if(temp_head_records[i].get('column_code')=='H16'){
H16=temp_head_records[i].get('column_value');
}
if(temp_head_records[i].get('column_code')=='H109') {
temp_head_records[i].set('column_value',H16);
// temp_head_records[i].set('column_value_c',0);
}
}
}
}
},
failure: function() {
unlock_calc_current_window('${l:HLS.SAVING}');
......@@ -154,42 +193,8 @@
});
}
if (!$('hls_fin_calculator_hd_ds').validate() || !$('hls_fin_calculator_ln_ds').validate()) {
unlock_calc_current_window();
return;
}
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
$('temp_hd_attribute_ds').create(temp_head_records[i].data);
}
}
var all_records = $('temp_hd_attribute_ds').getAll();
var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
headRecord.isNew = false;
headRecord.dirty = true;
create_record_column(all_records, headRecord);
function hls_fin_cal_save_hd_submitsuccess(ds, res) {
if (typeof(nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
Leaf.SideBar.enable = true;
success_sidebar_show();
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
}
function on_hls_fin_cal_save_hd_submitfailed(ds, res) {
......
......@@ -598,17 +598,17 @@ function prj501n_contract_number_renderer(id, name, query_only){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
if(name=='pay_method'){
if ( record.get('pay_method') == 'WIRE_TRANSFER') {
record.set('bank_branch_name',null);
record.set('bank_branch_name_n',null);
record.getField('bank_branch_name').setReadOnly(true);
record.getField('bank_branch_name_n').setReadOnly(true);
record.getField('bank_branch_name').setRequired(false);
record.getField('bank_branch_name_n').setRequired(false);
record.set('bank_account_id',null);
record.set('bank_account_id_n',null);
record.getField('bank_account_id').setReadOnly(true);
record.getField('bank_account_id_n').setReadOnly(true);
record.getField('bank_account_id').setRequired(false);
record.getField('bank_account_id_n').setRequired(false);
} else {
record.getField('bank_branch_name').setReadOnly(false);
record.getField('bank_branch_name_n').setReadOnly(false);
record.getField('bank_branch_name').setRequired(true);
record.getField('bank_branch_name_n').setRequired(true);
record.getField('bank_account_id').setReadOnly(false);
record.getField('bank_account_id_n').setReadOnly(false);
record.getField('bank_account_id').setRequired(true);
record.getField('bank_account_id_n').setRequired(true);
}
}
......
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