Commit 906239cb authored by 高泉铭's avatar 高泉铭

[refactor] 划扣导入导出

parent a2ccdde1
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t.attribute_1,
t.attribute_2,
t.attribute_3,
t.attribute_4,
t.attribute_5,
t.attribute_6,
t.attribute_7,
t.attribute_8,
TRIM(REPLACE(SUBSTR(t.attribute_9, 2), ',', '')) attribute_9,
t.attribute_10,
t.attribute_11,
t.attribute_12,
t.attribute_13,
t.attribute_14,
t.attribute_15,
TRIM(REPLACE(SUBSTR(t.attribute_16, 2), ',', '')) attribute_16
FROM
fnd_interface_lines t
WHERE
t.header_id =${@header_id} AND
t.line_number > 5
order by line_number
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
hls_ebank_abc_new_pkg.save_import_data(p_header_id => ${@header_id},
p_batch_id => ${@batch_id},
p_company_id => ${/session/@company_id},
p_user_id => ${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
t.attribute_1,
t.attribute_2,
t.attribute_3,
t.attribute_4,
t.attribute_5,
t.attribute_6,
t.attribute_7,
t.attribute_8,
t.attribute_9,
t.attribute_10,
t.attribute_11,
t.attribute_12,
t.attribute_13,
t.attribute_14,
t.attribute_15
FROM
fnd_interface_lines t
WHERE
t.header_id = ${@header_id} AND
t.line_number > 0
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
hls_ebank_ccb_new_pkg.save_import_data(p_header_id => ${@header_id},
p_batch_id => ${@batch_id},
p_company_id => ${/session/@company_id},
p_user_id => ${/session/@user_id},
p_transaction_date => to_date(${@transaction_date}, 'yyyy-mm-dd'));
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT c.contract_id,
ccc.cashflow_id,
c.contract_number,
to_char(ccc.due_date,'yyyy-mm-dd') due_date,
c.contract_name,
c.bp_id_tenant,
(select bp_id from sys_user where bp_category = 'AGENT' and user_id = c.OWNER_USER_ID) bp_id_agent,
(SELECT bp_name FROM hls_bp_master h WHERE c.bp_id_tenant = h.bp_id) bp_tenant_name,
ccc.times,
ccc.cf_item,
(SELECT description
FROM hls_cashflow_item
WHERE cf_item = ccc.cf_item) cf_item_desc,
c.pay_method,
(ccc.due_amount-nvl(ccc.received_amount,0)) due_amount,
(ccc.due_amount-nvl(ccc.received_amount,0)) manual_amount
FROM con_contract c, con_contract_cashflow ccc
#WHERE_CLAUSE#
order by contract_id,times,cf_item desc
]]>
</bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="pay_method" queryExpression="(c.pay_method = ${@pay_method})"/>
<bm:query-field name="due_date_from" queryExpression="(ccc.due_date &gt;= to_date(${@due_date_from},'yyyy-mm-dd'))"/>
<bm:query-field name="due_date_to" queryExpression="(ccc.due_date &lt;= to_date(${@due_date_to},'yyyy-mm-dd'))"/>
<bm:query-field name="contract_id" queryExpression="(c.contract_id = ${@contract_id})"/>
<bm:query-field name="cf_item" queryExpression="(ccc.cf_item = ${@cf_item})"/>
<bm:query-field name="bp_id_tenant" queryExpression="(bp_id_tenant = ${@bp_id_tenant})"/>
<bm:query-field name="bp_id_agent" queryExpression="(bp_id_agent = ${@bp_id_agent})"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query"
expression="c.contract_id = ccc.contract_id and ccc.due_date &lt;= trunc(sysdate) and c.data_class = 'NORMAL' and ccc.write_off_flag != 'FULL' and c.contract_status in ('SIGN','INCEPT') and ccc.cf_status = 'RELEASE' and ccc.cf_direction = 'INFLOW' and c.pay_method is not null"/>
<bm:data-filter name="query"
expression="not exists(select 1 from hls_ebank_batch_group g,hls_ebank_batch_ln l where g.status in ('NEW','DEAL') and g.group_id = l.group_id and l.cashflow_id = ccc.cashflow_id)"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<ns1:model xmlns:ns1="http://www.leaf-framework.org/schema/bm" alias="t1" extend="cont.CON500.con_contract" extendMode="reference" needAccessControl="false">
<ns1:fields>
<ns1:field name="contract_id" forInsert="true"/>
<ns1:field name="contract_number" displayWidth="218" forDisplay="true" forQuery="true" prompt="合同编号"/>
<ns1:field name="contract_name" displayWidth="218" forDisplay="true" forQuery="true" prompt="合同名称"/>
<ns1:field name="pay_method" forDisplay="false"/>
</ns1:fields>
<ns1:query-fields>
<ns1:query-field field="contract_number" queryOperator="like"/>
<ns1:query-field field="contract_name" queryOperator="like"/>
<ns1:query-field name="pay_method" queryExpression="(t1.pay_method = ${@pay_method})"/>
</ns1:query-fields>
<ns1:data-filters>
<ns1:data-filter name="query" enforceOperations="t1.due_date is not null"/>
</ns1:data-filters>
</ns1:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: hc
$Date: 2015-8-13 上午10:30:25
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fnd_interface_headers_s.nextval header_id from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -16,7 +16,8 @@
cba.bank_account_name,
cb.bank_short_name,
cbb.bank_branch_name,
cba.currency_code
cba.currency_code,
(select code_value_name from sys_code_values_v where code = 'CURRENCY' and code_value = cba.currency_code and CODE_VALUE_ENABLED_FLAG = 'Y') currency_name
FROM csh_bank cb, csh_bank_branch cbb, csh_bank_account cba
WHERE cb.bank_id = cbb.bank_id
AND cba.bank_branch_id = cbb.bank_branch_id
......@@ -34,7 +35,8 @@
<bm:field name="bank_account_num" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="银行账户"/>
<bm:field name="bank_short_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="银行"/>
<bm:field name="bank_branch_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="支行名"/>
<bm:field name="currency_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="币种"/>
<bm:field name="currency_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="false" prompt="币种"/>
<bm:field name="currency_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="币种"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="bank_account_name" queryExpression="t1.bank_account_name like &apos;%&apos; || ${@bank_account_name} || &apos;%&apos; "/>
......
......@@ -30,12 +30,15 @@
(select a.bank_account_num from csh_bank_account a where a.bank_account_id = t1.bank_account_id)bank_account_num,
(select a.bank_account_name from csh_bank_account a where a.bank_account_id = t1.bank_account_id)bank_account_name,
(select a.currency_code from csh_bank_account a where a.bank_account_id = t1.bank_account_id)currency,
(select code_value_name from sys_code_values_v scv,csh_bank_account ca where code = 'CURRENCY' and ca.bank_account_id = t1.BANK_ACCOUNT_ID
and ca.currency_code = scv.code_value) currency_name,
(select v.code_value_name from sys_code_values_v v where v.code ='CCB600_EBANK_STATUS' and v.code_value = t1.status)status_desc,
(select sum(g.real_amount) from hls_ebank_batch_group g where g.batch_id = t1.batch_id and g.status = 'SUCCESS')total_real_amount,
(select count(1) from hls_ebank_batch_group g where g.batch_id = t1.batch_id and g.status = 'SUCCESS')total_success_count,
(select code_value_name from SYS_CODE_VALUES_V where code = 'PAY_METHODS' and code_value = t1.pay_method) pay_method_desc,
(select u.description
from sys_user u
......@@ -45,15 +48,13 @@
order by t.batch_date desc,t.batch_id desc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
hls_ebank_batch_pkg.create_ebank_batch(
hls_ebank_batch_pkg.create_ebank_batch_new(
p_bank_account_id =>${@bank_account_id},
p_merger_rules =>${@merger_rules},
p_pay_method =>${@payment_method},
p_payment_amount_from =>${@payment_amount_from},
p_payment_amount_to =>${@payment_amount_to},
p_pay_method =>${@pay_method},
p_due_date =>to_date(${@due_date},'yyyy-mm-dd'),
p_user_id =>${/session/@user_id},
p_batch_id =>${@batch_id});
......@@ -80,6 +81,7 @@
<bm:field name="due_date" databaseType="DATE" datatype="java.util.Date"/>
<bm:field name="bank_name"/>
<bm:field name="bank_code"/>
<bm:field name="currency_name"/>
<bm:field name="bank_branch_name"/>
<bm:field name="bank_account_id"/>
<bm:field name="bank_account_num"/>
......@@ -93,6 +95,8 @@
<bm:field name="message"/>
<bm:field name="total_real_amount"/>
<bm:field name="total_success_count"/>
<bm:field name="pay_method"/>
<bm:field name="pay_method_desc"/>
<bm:field name="created_by_n"/>
</bm:fields>
<bm:query-fields>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: leaf Generator
$Date: Wed Oct 09 11:00:38 CST 2019
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:e="leaf.service.exception"
xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" alias="t1"
baseTable="HLS_EBANK_BATCH_LN">
<bm:fields>
<bm:field name="ln_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LN_ID"
prompt="HLS_EBANK_BATCH_LN.LN_ID"/>
<bm:field name="hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_ID"
prompt="HLS_EBANK_BATCH_LN.HD_ID"/>
<bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID"
prompt="HLS_EBANK_BATCH_LN.BATCH_ID"/>
<bm:field name="group_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="GROUP_ID"
prompt="HLS_EBANK_BATCH_LN.GROUP_ID"/>
<bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID"
prompt="HLS_EBANK_BATCH_LN.CASHFLOW_ID"/>
<bm:field name="amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT"
prompt="HLS_EBANK_BATCH_LN.AMOUNT"/>
<bm:field name="manual_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MANUAL_AMOUNT"
prompt="HLS_EBANK_BATCH_LN.MANUAL_AMOUNT"/>
<bm:field name="write_off_flag" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="WRITE_OFF_FLAG" prompt="HLS_EBANK_BATCH_LN.WRITE_OFF_FLAG"/>
<bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"
prompt="HLS_EBANK_BATCH_LN.DESCRIPTION"/>
<bm:field name="contract_number" forInsert="false" forceUpdate="false" expression="(select contract_number from con_contract c,con_contract_cashflow cf where c.contract_id = cf.contract_id and cf.cashflow_id = t1.cashflow_id)"/>
<bm:field name="cf_item_desc" forInsert="false" forceUpdate="false" expression="(select description from hls_cashflow_item hi,con_contract_cashflow cc where hi.cf_item = cc.cf_item and cc.cashflow_id = t1.cashflow_id)"/>
<bm:field name="bp_tenant_name" forInsert="false" forceUpdate="false" expression="(select h.bp_name from hls_bp_master h,con_contract c,con_contract_cashflow cf where c.contract_id = cf.contract_id and cf.cashflow_id = t1.cashflow_id and c.bp_id_tenant = h.bp_id)"/>
<bm:field name="times" forceUpdate="false" forInsert="false" expression="(select times from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/>
<bm:field name="due_date" forceUpdate="false" forInsert="false" expression="(select to_char(due_date,'yyyy-mm-dd') from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/>
<bm:field name="due_amount" forceUpdate="false" forInsert="false" expression="(select due_amount - nvl(received_amount,0) from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="batch_id" queryExpression="t1.batch_id = ${@batch_id}"/>
</bm:query-fields>
<bm:primary-key>
<bm:pk-field name="ln_id"/>
</bm:primary-key>
<bm:features>
<f:standard-who xmlns:f="leaf.database.features"/>
<o:sequence-pk sequenceName="hls_ebank_batch_ln_s"/>
</bm:features>
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
hls_ebank_batch_pkg.insert_hls_ebank_batch_ln_new(p_ln_id => hls_ebank_batch_ln_s.nextval,
p_hd_id => '',
p_manual_amount => ${@manual_amount},
p_batch_id => ${../../@batch_id},
p_cashflow_id => ${@cashflow_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="p_ln_id" dataType="java.lang.Long" input="false" output="true"
outputPath="/parameter/@p_ln_id"/>
</bm:parameters>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
hls_ebank_batch_pkg.contract_merge_by_rules(p_batch_id => ${@batch_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="p_ln_id" dataType="java.lang.Long" input="false" output="true"
outputPath="/parameter/@p_ln_id"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: leaf Generator
$Date: Thu Oct 10 13:51:22 CST 2019
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_EBANK_BATCH_GROUP">
<bm:fields>
<bm:field name="group_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="GROUP_ID" prompt="HLS_EBANK_BATCH_GROUP.GROUP_ID"/>
<bm:field name="hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_ID" prompt="HLS_EBANK_BATCH_GROUP.HD_ID"/>
<bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="HLS_EBANK_BATCH_GROUP.BATCH_ID"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="HLS_EBANK_BATCH_GROUP.CONTRACT_ID"/>
<bm:field name="apply_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPLY_AMOUNT" prompt="HLS_EBANK_BATCH_GROUP.APPLY_AMOUNT"/>
<bm:field name="actual_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ACTUAL_AMOUNT" prompt="HLS_EBANK_BATCH_GROUP.ACTUAL_AMOUNT"/>
<bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="HLS_EBANK_BATCH_GROUP.STATUS"/>
<bm:field name="real_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REAL_AMOUNT" prompt="HLS_EBANK_BATCH_GROUP.REAL_AMOUNT"/>
<bm:field name="res_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RES_CODE" prompt="HLS_EBANK_BATCH_GROUP.RES_CODE"/>
<bm:field name="res_msg" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RES_MSG" prompt="HLS_EBANK_BATCH_GROUP.RES_MSG"/>
<bm:field name="interface_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERFACE_ID" prompt="HLS_EBANK_BATCH_GROUP.INTERFACE_ID"/>
<bm:field name="receive_date" databaseType="DATE" datatype="java.util.Date" physicalName="RECEIVE_DATE" prompt="HLS_EBANK_BATCH_GROUP.RECEIVE_DATE"/>
<bm:field name="deal_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEAL_FLAG" prompt="HLS_EBANK_BATCH_GROUP.DEAL_FLAG"/>
<bm:field name="bank_account_num" expression="(select bank_branch_num from con_contract where contract_id = t1.contract_id)" forInsert="false" forceUpdate="false"/>
<bm:field name="bank_account_name" expression="(select bank_account_name from con_contract where contract_id = t1.contract_id)" forInsert="false" forceUpdate="false"/>
<bm:field name="sequence_num" expression="(rownum)" forInsert="false" forceUpdate="false"/>
<bm:field name="abc_sequence_num" expression="(lpad(ROWNUM,'4','0'))" forceUpdate="false" forInsert="false"/>
<bm:field name="csh_bank_account_num" expression="(select bank_account_num from csh_bank_account cba,hls_ebank_batch heb where cba.bank_account_id = heb.bank_account_id and heb.batch_id = t1.batch_id)" forInsert="false" forceUpdate="false"/>
<bm:field name="csh_bank_account_name" expression="(select bank_account_name from csh_bank_account cba,hls_ebank_batch heb where cba.bank_account_id = heb.bank_account_id and heb.batch_id = t1.batch_id)" forInsert="false" forceUpdate="false"/>
<bm:field name="abc_pay_type" expression="7" defaultValue="7"/>
<bm:field name="abc_transaction_type" expression="1" defaultValue="1"/>
<bm:field name="abc_usage" expression="'代收用途'" defaultValue="代收用途"/>
<bm:field name="abc_fen_code" expression="'01'" defaultValue="01"/>
<bm:field name="abc_curr_flag" expression="0" defaultValue="0"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="batch_id" queryExpression="t1.batch_id = ${@batch_id}"/>
</bm:query-fields>
<bm:features>
<f:standard-who xmlns:f="leaf.database.features"/>
</bm:features>
</bm:model>
\ No newline at end of file
......@@ -206,7 +206,10 @@
<bm:field name="collection_classes_desc"
expression="(select v.code_value_name from sys_code_values_v v where v.code = 'DS_COLLECTION_CLASSES' and v.code_value =t1.collection_classes)"
forInsert="false" forUpdate="false"/>
<bm:field name="receipt_type"/>
<bm:field name="paid_byother_flag"/>
<bm:field name="exists_advance_flag" forceUpdate="false" forInsert="false" expression="nvl((select 'Y' from dual where exists(SELECT 1 FROM csh_transaction t WHERE t.source_csh_trx_id = t1.transaction_id AND transaction_type = 'ADVANCE_RECEIPT' AND confirmed_flag != 'CANCELLED')),'N')"/>
<bm:field name="exists_deposit_flag" forceUpdate="false" forInsert="false" expression="nvl((select 'Y' from dual where exists(SELECT 1 FROM csh_transaction t WHERE t.source_csh_trx_id = t1.transaction_id AND transaction_type = 'DEPOSIT' AND confirmed_flag != 'CANCELLED')),'N')"/>
<!--end-->
<!--add by lisitong-->
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-query model="ccb.CCB600.get_import_head_id" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" separator=","
status_field="/parameter/@ImportSuccess" template_code="ABC_MANUAL_IMPORT"
user_id="${/session/@user_id}"/>
<!-- <a:model-query-->
<!-- defaultWhereClause="header_id=${/model/header/record/@header_id} and TEMPLATE_CODE = &apos;ABC_MANUAL_IMPORT&apos;"-->
<!-- model="ccb.CCB503.ccb503_import_get_status" rootPath="status"/>-->
</a:init-procedure>
<a:view>
<a:link id="import_interface_write_off_link" model="ccb.CCB600.abc_import_ln" modelaction="update"/>
<script type="text/javascript"><![CDATA[
function backBtn() {
history.go(-1);
}
var import_flag = 0;
function import_confirm() {
$('import_confirm_id').disable();
var ds = $('abc_import_grid_ds');
record = ds.getAll();
if (import_flag == 0) {
for (i = 0;i < record.length;i++) {
if (record[i].get('status') == 'ERROR') {
Leaf.showMessage('${l:PROMPT}', '导入的数据存在错误,请查看错误信息!');
return;
}
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('import_interface_write_off_link').getUrl(),
para: {
header_number:'${/parameter/@header_number}',
header_id: '${/model/header/record/@header_id}',
batch_id: '${/parameter/@batch_id}'
},
scope: this,
success: function() {
import_flag = import_flag + 1;
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
},
error: function(){
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
}
});
} else {
Leaf.showMessage('${l:PROMPT}', '已导入的数据不能重复导入!');
return;
}
}
]]></script>
<a:dataSets>
<a:dataSet id="abc_import_grid_ds" autoPageSize="true" autoQuery="true" model="ccb.CCB600.abc_import_ln" queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.abc_import_ln/query?header_id=${/model/header/record/@header_id}" selectable="true"/>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="backBtn" text="HLS.EXIT"/>
<a:gridButton id="import_confirm_id" click="import_confirm" text="确认导入"/>
</a:screenTopToolbar>
<a:grid bindTarget="abc_import_grid_ds" marginHeight="230" marginWidth="50" navBar="true">
<a:columns>
<a:column name="attribute_1" prompt="交易日期" renderer="Leaf.formatDate" />
<a:column name="attribute_2" prompt="记账日期" renderer="Leaf.formatDate" />
<a:column name="attribute_3" prompt="收款账号" />
<a:column name="attribute_4" prompt="批号" />
<a:column name="attribute_5" prompt="批量扣款账号" />
<a:column name="attribute_6" prompt="经销商代号" />
<a:column name="attribute_7" prompt="经销商名" />
<a:column name="attribute_8" prompt="户名" />
<a:column name="attribute_9" prompt="批量扣款金额" renderer="Leaf.formatMoney" />
<a:column name="attribute_10" prompt="输入员姓名" />
<a:column name="attribute_11" prompt="审核员姓名" />
<a:column name="attribute_12" prompt="路线结帐中心" />
<a:column name="attribute_13" prompt="备注" />
<a:column name="attribute_14" prompt="状态" />
<a:column name="attribute_15" prompt="错误描述" />
<a:column name="attribute_16" prompt="实际扣款金额" renderer="Leaf.formatMoney" />
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick() {
if (document.getElementById('general_importFile').value) {
var fileName = document.getElementById('general_importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
if (fileType != '.xls' && fileType != '.xlsx' && fileType != '.csv') {
Leaf.showInfoMessage("提示",'请选择正确的导入文件!');
} else {
if ('${/parameter/@bank_type}' == 'ABC') {
$jq('#general_importForm').attr('action',
'${/request/@context_path}/modules/ccb/CCB600/abc_upload.lview?batch_id=${/parameter/@batch_id}&user_id=${/session/@user_id}&_csrf=${/session/@_csrf.token}');
} else if ('${/parameter/@bank_type}' == 'CCB') {
$jq('#general_importForm').attr('action',
'${/request/@context_path}/modules/ccb/CCB600/ccb_upload.lview?batch_id=${/parameter/@batch_id}&user_id=${/session/@user_id}&_csrf=${/session/@_csrf.token}');
}
document.getElementById('general_importForm').submit();
}
}
}
]]></script>
<a:dataSets>
<a:dataSet id="hcl032_label_ds" autoCreate="true">
<a:fields>
<a:field name="label2" defaultValue="1、请严格按照导入模板整理数据,检查必输项是否缺失。"/>
<a:field name="label3" defaultValue="2、目前仅支持 MS Excel。"/>
<a:field name="label4" defaultValue="3、执行导入前,请先关闭Excel文件。"/>
<a:field name="label6" defaultValue="4、导入完毕后,请在系统中核对数据。"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="注意事项" width="400">
<!--<a:label name="label1" bindTarget="label_ds" width="380"/>-->
<a:label name="label2" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label3" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label4" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label6" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="general_importForm"
action="abc_upload.lview?batch_id=${/parameter/@batch_id}&amp;user_id=${/session/@user_id}&amp;_csrf=${/session/@_csrf.token}"
enctype="multipart/form-data" method="post">
<input name="CONTENT" id="general_importFile" style="margin-bottom:4px;width:250px;height:22px;"
type="file"/>
<input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button"
value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<p:switch test="parameter/@_status">
<p:case value="insert">
<a:model-insert model="ccb.CCB600.hls_ebank_batch"/>
</p:case>
</p:switch>
<a:batch-apply sourcepath="/parameter/details">
<p:switch test="@current_parameter/@_status">
<p:case value="insert">
<a:model-insert model="ccb.CCB600.hls_ebank_batch_ln"/>
</p:case>
</p:switch>
</a:batch-apply>
<a:model-execute model="ccb.CCB600.hls_ebank_batch_ln"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
\ No newline at end of file
......@@ -12,32 +12,51 @@
</a:init-procedure>
<a:view>
<a:link id="hls_ebank_create_link" model="ccb.CCB600.hls_ebank_batch" modelaction="execute"/>
<a:link id="hls_ebank_create_lsc_link" url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_create.lsc" modelaction="insert"/>
<a:link id="ebank_detail_link" url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_detail.lview"/>
<script type="text/javascript"><![CDATA[
function create_batch() {
var ds = $('hls_ccb_form_create_ds');
if (ds.validate()) {
var ln_ds = $('hls_ccb_grid_ln_ds');
if(ln_ds.getAll().length == 0){
Leaf.showInfoMessage("提示","请先查询需要扣款的合同");
return;
}
if (ds.validate() && ln_ds.validate()) {
var record = $('hls_ccb_form_create_ds').getAt(0);
var params = {};
params._status = 'insert';
params.bank_account_id = record.get('bank_account_id');
params.merger_rules = record.get('merger_rules');
params.pay_method = record.get('pay_method');
params.due_date = record.get('due_date');
//处理行
var details = [];
var ln_r = ln_ds.getAll();
for(var i=0;i<ln_r.length;i++){
var r = ln_r[i].data;
r._status = 'insert';
details.push(r);
}
params.details = details;
Leaf.Masker.mask(Ext.getBody(), '生成中...'); //锁屏
Leaf.request({
url: $('hls_ebank_create_link').getUrl(),
para: {
bank_account_id: record.get('bank_account_id'),
merger_rules: record.get('merger_rules'),
pay_method: record.get('pay_method'),
payment_amount_from: record.get('payment_amount_from'),
payment_amount_to: record.get('payment_amount_to'),
due_date: record.get('due_date')
},
url: $('hls_ebank_create_lsc_link').getUrl(),
para: params,
success: function (res) {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody()); //解锁
$('hls_ccb_grid_create_ds').setQueryParameter('batch_id', res.result.batch_id);
$('hls_ccb_grid_create_ds').query();
$('create_ebank_link_winId').close();
// $('hls_ccb_grid_create_ds').setQueryParameter('batch_id', res.result.batch_id);
// $('hls_ccb_grid_create_ds').query();
},
failure: function () {
},
......@@ -75,6 +94,51 @@
height: 680
});
}
function ccb_form_update_fun(ds,record,name,value,oldvalue){
if(name == "pay_method"){
if(value){
$('hls_ccb_form_query_ds').getField('contract_number').setLovPara("pay_method",value);
$('hls_ccb_grid_ln_ds').setQueryParameter("pay_method",value);
}
}
}
function hls_ccb_grid_ln_query(){
$('hls_ccb_grid_ln_ds').query();
}
function colum_caculateTotal(data, name) {
var total = 0;
var length = data.length;
var value = 0;
for (var i = 0;i < length;i++) {
if (Ext.isEmpty(data[i].get(name))) {
value = 0;
} else {
value = data[i].get(name);
}
total = plus(total, value);
}
return '<font color=red>' + Leaf.formatMoney(total) + '</font>';
}
function sumAmount(record,name){
if(name == 'cf_item_desc'){
return '<font color=red>合计:</font>';
}
if(name == 'due_amount' || name == 'manual_amount'){
return '<font color=red>' + colum_caculateTotal(record,name) + '</font>';
}
}
function check_manual_amount(record, name, value){
if(value > record.get('due_amount')){
Leaf.showInfoMessage("提示","扣款金额不能大于应付金额");
return false;
}
return true;
}
]]></script>
<a:dataSets>
<a:dataSet id="pay_methods_ds">
......@@ -84,6 +148,46 @@
<a:record code_value="AGRI_TWO" code_value_name="农行扣款(两方)"/>
</a:datas>
</a:dataSet>
<a:dataSet id="hls_ccb_form_query_ds">
<a:fields>
<a:field name="due_date_from" />
<a:field name="due_date_to" />
<a:field name="bp_agent_name" lovGridHeight="350" lovHeight="550" lovLabelWidth="50" lovWidth="550"
autoComplete="true" autoCompleteField="bp_agent_name"
lovService="basic.hls_bp_master_v_for_lov?bp_category=AGENT"
title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_agent"/>
<a:map from="bp_name" to="bp_agent_name"/>
</a:mapping>
</a:field>
<a:field name="bp_tenant_name" lovGridHeight="350" lovHeight="550" lovLabelWidth="50" lovWidth="550"
autoComplete="true" autoCompleteField="bp_agent_name"
lovService="basic.hls_bp_master_v_for_lov?bp_category=TENANT"
title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id_tenant"/>
<a:map from="bp_name" to="bp_tenant_name"/>
</a:mapping>
</a:field>
<a:field name="bp_id_agent" />
<a:field name="bp_id_tenant"/>
<a:field name="contract_number" lovGridHeight="350" lovHeight="500" lovService="ccb.CCB600.con_contract_lov" lovWidth="470" title="合同">
<a:mapping>
<a:map from="contract_id" to="contract_id"/>
<a:map from="contract_number" to="contract_number"/>
</a:mapping>
</a:field>
<a:field name="contract_id"/>
<a:field name="cf_item_desc" lovGridHeight="300" lovHeight="500" lovService="hls.HLS005.hls_cashflow_item_v_lov" lovWidth="850" title="HLS005.HLS_CASHFLOW_ITEM.CF_ITEM">
<a:mapping>
<a:map from="cf_item" to="cf_item"/>
<a:map from="cf_item_desc" to="cf_item_desc"/>
</a:mapping>
</a:field>
<a:field name="cf_item"/>
</a:fields>
</a:dataSet>
<a:dataSet id="hls_ccb_form_create_ds" autoCreate="true">
<a:fields>
<a:field name="bank_account_num" autoComplete="true" lovGridHeight="350" lovHeight="550"
......@@ -95,8 +199,10 @@
<a:map from="bank_short_name" to="bank_name"/>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="currency_code" to="currency"/>
<a:map from="currency_name" to="currency_name"/>
</a:mapping>
</a:field>
<a:field name="currency_name" readOnly="true"/>
<a:field name="pay_method_desc" required="true" prompt="支付方式" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
<a:field name="pay_method"/>
<a:field name="bank_account_name" readOnly="true"/>
......@@ -106,6 +212,9 @@
<a:field name="merger_rules" defaultValue="NONE"/>
<!-- <a:field name="merger_rules" defaultValue="CONTRACT"/>-->
</a:fields>
<a:events>
<a:event name="update" handler="ccb_form_update_fun"/>
</a:events>
</a:dataSet>
<a:dataSet id="hls_ccb_grid_create_ds" model="ccb.CCB600.hls_ebank_batch_hd" pageSize="15"
......@@ -113,9 +222,24 @@
selectable="true">
</a:dataSet>
<a:dataSet id="hls_ccb_grid_ln_ds" fetchAll="true" queryDataSet="hls_ccb_form_query_ds" model="ccb.CCB600.hls_ebank_batch_ln" queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.con_contract_cashflow_query/query">
<a:fields>
<a:field name="cashflow_id"/>
<a:field name="bp_tenant_name" readOnly="true"/>
<a:field name="contract_id"/>
<a:field name="contract_number" readOnly="true"/>
<a:field name="times" readOnly="true"/>
<a:field name="cf_item" readOnly="true"/>
<a:field name="due_amount" readOnly="true"/>
<a:field name="manual_amount" required="true" prompt="扣款金额" validator="check_manual_amount"/>
<a:field name="description"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar height="29">
<a:gridButton click="hls_ccb_grid_ln_query" text="查询"/>
<a:gridButton click="create_batch" text="指令生成"/>
<a:gridButton click="reset_batch" text="重置"/>
<a:gridButton click="return_batch" text="返回"/>
......@@ -126,7 +250,7 @@
<a:textField name="bank_account_name" bindTarget="hls_ccb_form_create_ds" prompt="账户名"/>
<a:textField name="bank_name" bindTarget="hls_ccb_form_create_ds" prompt="银行"/>
<a:comboBox name="pay_method_desc" bindTarget="hls_ccb_form_create_ds" prompt="支付方式"/>
<a:textField name="currency" bindTarget="hls_ccb_form_create_ds" prompt="币种"/>
<a:textField name="currency_name" bindTarget="hls_ccb_form_create_ds" prompt="币种"/>
</a:fieldSet>
<a:fieldSet title="合并规则" column="2">
<a:radio name="merger_rules" bindTarget="hls_ccb_form_create_ds" layout="horizontal" width="600">
......@@ -137,16 +261,38 @@
</a:items>
</a:radio>
</a:fieldSet>
<a:fieldSet title="筛选条件" column="2">
<a:numberField name="payment_amount_from" bindTarget="hls_ccb_form_create_ds" prompt="付款金额从"/>
<a:numberField name="payment_amount_to" bindTarget="hls_ccb_form_create_ds" prompt="付款金额到"/>
<a:fieldSet title="查询条件" column="3">
<a:datePicker name="due_date_from" bindTarget="hls_ccb_form_query_ds" prompt="付款日期从"/>
<a:datePicker name="due_date_to" bindTarget="hls_ccb_form_query_ds" prompt="付款日期到"/>
<a:lov name="bp_agent_name" bindTarget="hls_ccb_form_query_ds" prompt="代理店"/>
<a:lov name="bp_tenant_name" bindTarget="hls_ccb_form_query_ds" prompt="客户名称"/>
<a:lov name="contract_number" bindTarget="hls_ccb_form_query_ds" prompt="合同号"/>
<a:lov name="cf_item_desc" bindTarget="hls_ccb_form_query_ds" prompt="现金流类型"/>
<!-- <a:numberField name="payment_amount_from" bindTarget="hls_ccb_form_create_ds" prompt="付款金额从"/>-->
<!-- <a:numberField name="payment_amount_to" bindTarget="hls_ccb_form_create_ds" prompt="付款金额到"/>-->
</a:fieldSet>
<a:grid id="hls_ccb_create_grid" bindTarget="hls_ccb_grid_create_ds" height="200" width="800" navBar="true">
<!-- <a:grid id="hls_ccb_create_grid" bindTarget="hls_ccb_grid_create_ds" height="300" width="800" navBar="true">-->
<!-- <a:columns>-->
<!-- <a:column name="num" align="left" prompt="序号" width="80"/>-->
<!-- <a:column name="detail" align="center" prompt="明细" renderer="batch_detail_renderer" width="100"/>-->
<!-- </a:columns>-->
<!-- </a:grid>-->
<a:grid id="hls_ccb_ln_grid" bindTarget="hls_ccb_grid_ln_ds" height="300" width="800" navBar="true">
<a:columns>
<a:column name="num" align="left" prompt="序号" width="80"/>
<a:column name="detail" align="center" prompt="明细" renderer="batch_detail_renderer" width="100"/>
<a:column name="bp_tenant_name" prompt="客户名称" align="center" />
<a:column name="contract_number" prompt="合同号" align="center" />
<a:column name="times" prompt="期数" align="center"/>
<a:column name="due_date" prompt="应付日期" align="center" renderer="Leaf.formatDate"/>
<a:column name="cf_item_desc" prompt="现金流类型" align="center" footerRenderer="sumAmount"/>
<a:column name="due_amount" prompt="应收金额" align="right" renderer="Leaf.formatMoney" footerRenderer="sumAmount"/>
<a:column name="manual_amount" prompt="扣款金额" editor="hls_ccb_ln_grid_nf" align="right" renderer="Leaf.formatMoney" footerRenderer="sumAmount"/>
<a:column name="description" prompt="备注" editor="hls_ccb_ln_grid_tf" width="200" />
</a:columns>
<a:editors>
<a:numberField id="hls_ccb_ln_grid_nf"/>
<a:textField id="hls_ccb_ln_grid_tf"/>
</a:editors>
</a:grid>
<a:fieldSet title="应收日期" column="2">
<a:datePicker name="due_date" bindTarget="hls_ccb_form_create_ds" prompt="应收日期"/>
......
......@@ -15,8 +15,10 @@
<a:link id="delete_ebank_link" model="ccb.CCB600.hls_ebank_batch" modelaction="delete"/>
<a:link id="create_abc_ebank_link" model="ccb.CCB600.hls_ebank_batch_hd" modelaction="execute"/>
<a:link id="query_abc_ebank_link" model="ccb.CCB600.hls_ebank_batch_hd" modelaction="update"/>
<a:link id="withhold_ebank_link" url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_withhold_manager.lview"/>
<a:link id="withhold_ebank_link"
url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_withhold_manager.lview"/>
<a:link id="ccb_abc_upload_link"
url="${/request/@context_path}/modules/ccb/CCB600/ccb_abc_import.lview"/>
<script type="text/javascript"><![CDATA[
var header = $jq('meta[name=_csrf_header]').attr('content');
var token = $jq('meta[name=_csrf]').attr('content');
......@@ -111,57 +113,56 @@
var batch_id = record.get("batch_id");
var bank_code = record.get("bank_code");
var status_desc = record.get("status_desc");
if(status_desc == '新建'){
alert('新建状态无法回传!');
$('hls_ccb_batch_result_ds').query();
}
else{
Leaf.Masker.mask(Ext.getBody(), '核销代扣信息中...'); //锁屏
if (bank_code == '008') {
Leaf.request({
url: $('query_abc_ebank_link').getUrl(),
para: {
batch_id: batch_id
},
success: function (res) {
Leaf.SideBar.show({
msg: '查询成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody()); //解锁
$('hls_ccb_batch_result_ds').query();
},
failure: function () {
},
error: function () {
},
scope: this
});
} else if (bank_code == '002') {
$jq.ajax({
url: '${/request/@context_path}/icbc/interface/record/queryorder',
data: {
batchId: batch_id
},
type: 'post',
contentType: 'application/x-www-form-urlencoded;charset=utf8',
success: function (datas) {
if (datas.success) {
if (status_desc == '新建') {
alert('新建状态无法回传!');
$('hls_ccb_batch_result_ds').query();
} else {
Leaf.Masker.mask(Ext.getBody(), '核销代扣信息中...'); //锁屏
if (bank_code == '008') {
Leaf.request({
url: $('query_abc_ebank_link').getUrl(),
para: {
batch_id: batch_id
},
success: function (res) {
Leaf.SideBar.show({
msg: '工行查询成功',
msg: '查询成功',
duration: 2000
});
} else {
Leaf.showErrorMessage('提示', datas.message);
}
Leaf.Masker.unmask(Ext.getBody()); //解锁
$('hls_ccb_batch_result_ds').query();
},
failure: function () {
},
error: function () {
},
scope: this
});
Leaf.Masker.unmask(Ext.getBody()); //解锁
$('hls_ccb_batch_result_ds').query();
} else if (bank_code == '002') {
$jq.ajax({
url: '${/request/@context_path}/icbc/interface/record/queryorder',
data: {
batchId: batch_id
},
type: 'post',
contentType: 'application/x-www-form-urlencoded;charset=utf8',
success: function (datas) {
if (datas.success) {
Leaf.SideBar.show({
msg: '工行查询成功',
duration: 2000
});
} else {
Leaf.showErrorMessage('提示', datas.message);
}
}
});
}
Leaf.Masker.unmask(Ext.getBody()); //解锁
$('hls_ccb_batch_result_ds').query();
}
});
}
}
}
......@@ -234,7 +235,7 @@
}
function withhold_list(){
function withhold_list() {
var win = new Leaf.Window({
id: 'withhold_ebank_link_winId',
url: $('withhold_ebank_link').getUrl(),
......@@ -248,6 +249,55 @@
});
}
function export_batch() {
var r = $('hls_ccb_batch_result_ds').getCurrentRecord();
if (r) {
if (r.get('pay_method') == 'CCB_THREE') {//建行
$('hls_ccb_batch_merge_result_grid')._export();
} else if (r.get('pay_method') == 'AGRI_TWO' || r.get('pay_method') == 'AGRI_THREE') {
$('hls_abc_batch_merge_result_grid')._export();
}
}
}
function ccb_abc_import() {
var record = $('hls_ccb_batch_result_ds').getCurrentRecord();
if (record.get('status') != 'NEW') {
Leaf.showMessage('提示', '该数据不是新建状态,不可操作');
return;
}
var str;
var pay_method = record.get('pay_method');
var bank_type;
if (pay_method == 'CCB_THREE') {
bank_type = 'CCB';
str = '建行';
} else if (pay_method == 'AGRI_TWO' || pay_method == 'AGRI_THREE') {
bank_type = 'ABC';
str = '农行';
} else {
Leaf.showInfoMessage("提示", "未知错误,请联系管理员");
return;
}
Leaf.showConfirm("提示", "该批次为<font color=red>" + str + "</font>划扣批次,是否导入<font color=red>" + str + "</font>回盘文件", function () {
var win = new Leaf.Window({
id: 'ccb_abc_upload_link_winId',
url: $('ccb_abc_upload_link').getUrl() + '?batch_id=' + record.get('batch_id') + '&bank_type=' + bank_type,
params: {
winId: 'ccb_abc_upload_link_winId'
},
title: '回盘文件导入',
width: 420,
height: 275
});
win.on('close', function () {
$('hls_ccb_batch_result_ds').query();
});
});
}
]]></script>
<a:dataSets>
<a:dataSet id="bank_name_combobox_ds">
......@@ -273,6 +323,9 @@
</a:fields>
</a:dataSet>
<a:dataSet id="hls_ccb_batch_merge_result_ds" model="ccb.CCB600.hls_ebank_batch_ln_group"
bindName="merge_result" bindTarget="hls_ccb_batch_result_ds">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar height="29">
......@@ -280,9 +333,11 @@
<a:gridButton click="query_batch" text="查询"/>
<a:gridButton click="open_batch" text="生成代扣指令"/>
<a:gridButton click="delete_batch" text="删除代扣指令"/>
<a:gridButton click="post_batch" text="发送代扣指令"/>
<a:gridButton click="write_off_batch" text="刷新代扣信息"/>
<a:gridButton click="withhold_list" text="手工代扣单"/>
<a:gridButton click="export_batch" text="导出划扣单"/>
<a:gridButton click="ccb_abc_import" text="导入回盘文件"/>
<!-- <a:gridButton click="post_batch" text="发送代扣指令"/>-->
<!-- <a:gridButton click="write_off_batch" text="刷新代扣信息"/>-->
<!-- <a:gridButton click="withhold_list" text="手工代扣单"/>-->
</a:screenTopToolbar>
<a:form column="3">
<a:comboBox name="bank_name" bindTarget="hls_ccb_batch_query_ds" prompt="银行名称"/>
......@@ -293,6 +348,7 @@
navBar="true">
<a:columns>
<a:column name="batch_id" align="left" prompt="序号" width="100"/>
<a:column name="pay_method_desc" align="center" prompt="支付方式" width="120"/>
<a:column name="batch_date" align="center" prompt="创建日期" renderer="Leaf.formatDate" width="150"/>
<a:column name="bank_name" align="left" prompt="银行" width="150"/>
<a:column name="bank_branch_name" align="left" prompt="支行" width="200"/>
......@@ -300,11 +356,45 @@
<a:column name="status_desc" align="center" prompt="状态" width="100"/>
<a:column name="detail" align="center" prompt="明细" renderer="detail_renderer" width="100"/>
<a:column name="created_by_n" align="center" prompt="制单人" width="150"/>
<a:column name="total_real_amount" align="right" prompt="实扣总金额" renderer="Leaf.formatMoney" width="100"/>
<a:column name="total_real_amount" align="right" prompt="实扣总金额" renderer="Leaf.formatMoney"
width="100"/>
<a:column name="total_success_count" align="right" prompt="扣款成功合同" width="100"/>
<a:column name="message" align="right" prompt="错误消息" width="150"/>
</a:columns>
</a:grid>
<a:grid hidden="true" width="1" height="1" id="hls_ccb_batch_merge_result_grid"
bindTarget="hls_ccb_batch_merge_result_ds">
<a:columns>
<a:column name="sequence_num" prompt="序号(必填)"/>
<a:column name="bank_account_num" prompt="账号(必填)"/>
<a:column name="bank_account_name" prompt="户名(必填)"/>
<a:column name="actual_amount" align="right" renderer="Leaf.formatMoney" prompt="金额(必填)"/>
<a:column prompt="跨行标识(选填 建行填0 他行填1)"/>
<a:column prompt="行名(跨行业务与联行行号不能同时为空)"/>
<a:column prompt="联行行号(跨行业务与行名不能同时为空)"/>
<a:column prompt="多方协议号(跨行代收必填)"/>
<a:column prompt="标识号(选填)"/>
<a:column prompt="摘要(选填 显示在收款账户流水明细中)"/>
<a:column prompt="备注(选填)"/>
</a:columns>
</a:grid>
<a:grid hidden="true" width="1" height="1" id="hls_abc_batch_merge_result_grid"
bindTarget="hls_ccb_batch_merge_result_ds">
<a:columns>
<a:column name="abc_sequence_num" prompt="serial-no"/>
<a:column name="abc_pay_type" prompt="pay-type"/>
<a:column name="abc_transaction_type" prompt="transaction-type"/>
<a:column name="csh_bank_account_num" prompt="account-no"/>
<a:column name="csh_bank_account_name" prompt="account-name"/>
<a:column name="bank_account_num" prompt="payee-account-to"/>
<a:column name="bank_account_name" prompt="payee-name"/>
<a:column name="abc_payee_bank" prompt="payee-bank"/>
<a:column name="abc_usage" prompt="usage"/>
<a:column name="abc_fen_code" prompt="fen-code"/>
<a:column name="abc_curr_flag" prompt="curr-flag"/>
<a:column name="actual_amount" align="right" renderer="Leaf.formatMoney" prompt="amount"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
......@@ -8,23 +8,34 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<a:link id="hls_ebank_create_link" model="ccb.CCB600.hls_ebank_batch" modelaction="execute"/>
<a:link id="query_ebank_detail_link" url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_detail_query.lview"/>
<a:link id="modify_ebank_detail_link" url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_detail.lview"/>
<a:link id="query_ebank_detail_link"
url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_detail_query.lview"/>
<a:link id="modify_ebank_detail_link"
url="${/request/@context_path}/modules/ccb/CCB600/ccb_ebank_detail.lview"/>
<script type="text/javascript"><![CDATA[
function return_batch() {
$('${/parameter/@winid}').close();
}
function batch_detail_renderer(value,record,name){
if('${/parameter/@status}' == 'NEW') {
function batch_detail_renderer(value, record, name) {
if ('${/parameter/@status}' == 'NEW') {
return '<a href="javascript:open_batch_detail_modify_window(' + record.get('hd_id') + ')">' + '${l:PROMPT.DETAIL}' + '</a>';
}else{
} else {
return '<a href="javascript:open_batch_detail_query_window(' + record.get('hd_id') + ')">' + '${l:PROMPT.DETAIL}' + '</a>';
}
}
function open_batch_detail_query_window(hd_id){
function hls_ccb_merge_result() {
var hd_id = $('hls_ccb_grid_ln_ds').getAt(0).get('hd_id') || -1;
if ('${/parameter/@status}' == 'NEW') {
open_batch_detail_modify_window(hd_id);
} else {
open_batch_detail_query_window(hd_id);
}
}
function open_batch_detail_query_window(hd_id) {
var win = new Leaf.Window({
id: 'batch_link_query_winId',
url: $('query_ebank_detail_link').getUrl(),
......@@ -40,7 +51,7 @@
}
function open_batch_detail_modify_window(hd_id){
function open_batch_detail_modify_window(hd_id) {
var win = new Leaf.Window({
id: 'batch_modify_link_winId',
url: $('modify_ebank_detail_link').getUrl(),
......@@ -55,13 +66,42 @@
});
}
function colum_caculateTotal(data, name) {
var total = 0;
var length = data.length;
var value = 0;
for (var i = 0; i < length; i++) {
if (Ext.isEmpty(data[i].get(name))) {
value = 0;
} else {
value = data[i].get(name);
}
total = plus(total, value);
}
return '<font color=red>' + Leaf.formatMoney(total) + '</font>';
}
function sumAmount(record, name) {
if (name == 'cf_item_desc') {
return '<font color=red>合计:</font>';
}
if (name == 'due_amount' || name == 'manual_amount') {
return '<font color=red>' + colum_caculateTotal(record, name) + '</font>';
}
}
]]></script>
<a:dataSets>
<a:dataSet id="rates_type_combobox_ds">
<a:datas dataSource="/model/ratesType"/>
</a:dataSet>
<a:dataSet id="pay_methods_ds">
<a:datas>
<a:record code_value="AGRI_THREE" code_value_name="农行扣款(三方)"/>
<a:record code_value="CCB_THREE" code_value_name="建行扣款(三方)"/>
<a:record code_value="AGRI_TWO" code_value_name="农行扣款(两方)"/>
</a:datas>
</a:dataSet>
<a:dataSet id="hls_ccb_form_create_ds" autoQuery="true" model="ccb.CCB600.hls_ebank_batch"
queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.hls_ebank_batch/query?batch_id=${/parameter/@batch_id}">
<a:fields>
......@@ -76,9 +116,11 @@
<a:map from="currency_code" to="currency"/>
</a:mapping>
</a:field>
<a:field name="currency_name" readOnly="true"/>
<a:field name="bank_account_name" readOnly="true"/>
<a:field name="bank_name" readOnly="true"/>
<a:field name="pay_method_desc" readOnly="true" prompt="支付方式" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
<a:field name="pay_method"/>
<a:field name="currency" readOnly="true"/>
<a:field name="due_date" required="true" prompt="应收日期" readOnly="true"/>
<a:field name="merger_rules" defaultValue="NONE" prompt="" readOnly="true"/>
......@@ -97,37 +139,72 @@
</a:dataSet>
</a:dataSets>
<a:dataSet id="hls_ccb_grid_ln_ds" fetchAll="true" autoQuery="true" model="ccb.CCB600.hls_ebank_batch_ln"
queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.hls_ebank_batch_ln/query?batch_id=${/parameter/@batch_id}">
<a:fields>
<a:field name="cashflow_id"/>
<a:field name="bp_tenant_name" readOnly="true"/>
<a:field name="contract_id"/>
<a:field name="contract_number" readOnly="true"/>
<a:field name="times" readOnly="true"/>
<a:field name="cf_item" readOnly="true"/>
<a:field name="due_amount" readOnly="true"/>
<a:field name="manual_amount" required="true" prompt="扣款金额"/>
<a:field name="description"/>
</a:fields>
</a:dataSet>
<a:screenBody>
<a:screenTopToolbar height="29">
<a:gridButton click="return_batch" text="返回"/>
</a:screenTopToolbar>
<a:fieldSet title="本方账户" column="2">
<a:fieldSet title="本方账户" column="3">
<a:lov name="bank_account_num" bindTarget="hls_ccb_form_create_ds" prompt="银行账户"/>
<a:textField name="bank_account_name" bindTarget="hls_ccb_form_create_ds" prompt="账户名"/>
<a:textField name="bank_name" bindTarget="hls_ccb_form_create_ds" prompt="银行"/>
<a:textField name="currency" bindTarget="hls_ccb_form_create_ds" prompt="币种"/>
<a:textField name="currency_name" bindTarget="hls_ccb_form_create_ds" prompt="币种"/>
<a:comboBox name="pay_method_desc" bindTarget="hls_ccb_form_create_ds" prompt="支付方式"/>
</a:fieldSet>
<a:fieldSet title="合并规则" column="2">
<a:radio name="merger_rules" bindTarget="hls_ccb_form_create_ds" layout="horizontal" width="600">
<a:items>
<!--<a:item label="不合并" value="NONE"/>-->
<a:item label="按合同" value="CONTRACT"/>
<a:item label="按期数" value="TIMES"/>
<a:item label="不合并" value="NONE"/>
</a:items>
</a:radio>
</a:fieldSet>
<a:fieldSet title="筛选条件" column="2">
<a:numberField name="payment_amount_from" bindTarget="hls_ccb_form_create_ds" prompt="付款金额从"/>
<a:numberField name="payment_amount_to" bindTarget="hls_ccb_form_create_ds" prompt="付款金额到"/>
</a:fieldSet>
<!-- <a:fieldSet title="筛选条件" column="2">-->
<!-- <a:numberField name="payment_amount_from" bindTarget="hls_ccb_form_create_ds" prompt="付款金额从"/>-->
<!-- <a:numberField name="payment_amount_to" bindTarget="hls_ccb_form_create_ds" prompt="付款金额到"/>-->
<!-- </a:fieldSet>-->
<a:grid id="hls_ccb_create_grid" bindTarget="hls_ccb_grid_create_ds" height="200" width="800" navBar="true">
<!-- <a:grid id="hls_ccb_create_grid" bindTarget="hls_ccb_grid_create_ds" height="200" width="800" navBar="true">-->
<!-- <a:columns>-->
<!-- <a:column name="num" align="left" prompt="序号" width="80"/>-->
<!-- <a:column name="detail" align="center" prompt="明细" renderer="batch_detail_renderer" width="100"/>-->
<!-- </a:columns>-->
<!-- </a:grid>-->
<a:grid id="hls_ccb_ln_grid" bindTarget="hls_ccb_grid_ln_ds" height="300" width="800" navBar="true">
<a:toolBar>
<a:button click="hls_ccb_merge_result" text="合并结果"/>
</a:toolBar>
<a:columns>
<a:column name="num" align="left" prompt="序号" width="80"/>
<a:column name="detail" align="center" prompt="明细" renderer="batch_detail_renderer" width="100"/>
<a:column name="bp_tenant_name" prompt="客户名称" align="center"/>
<a:column name="contract_number" prompt="合同号" align="center"/>
<a:column name="times" prompt="期数" align="center"/>
<a:column name="due_date" prompt="应付日期" align="center" renderer="Leaf.formatDate"/>
<a:column name="cf_item_desc" prompt="现金流类型" align="center" footerRenderer="sumAmount"/>
<a:column name="due_amount" prompt="应收金额" align="right" renderer="Leaf.formatMoney"
footerRenderer="sumAmount"/>
<a:column name="manual_amount" prompt="扣款金额" align="right" renderer="Leaf.formatMoney"
footerRenderer="sumAmount"/>
<a:column name="description" prompt="备注" width="200"/>
</a:columns>
</a:grid>
<a:fieldSet title="应收日期" column="2">
<a:datePicker name="due_date" bindTarget="hls_ccb_form_create_ds" prompt="应收日期"/>
</a:fieldSet>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-query model="ccb.CCB600.get_import_head_id" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" separator=","
status_field="/parameter/@ImportSuccess" template_code="CCB_MANUAL_IMPORT"
user_id="${/session/@user_id}"/>
<!-- <a:model-query-->
<!-- defaultWhereClause="header_id=${/model/header/record/@header_id} and TEMPLATE_CODE = &apos;CCB_MANUAL_IMPORT&apos;"-->
<!-- model="ccb.CCB503.ccb503_import_get_status" rootPath="status"/>-->
</a:init-procedure>
<a:view>
<a:link id="import_interface_write_off_link" model="ccb.CCB600.ccb_import_ln" modelaction="update"/>
<script type="text/javascript"><![CDATA[
function backBtn() {
history.go(-1);
}
var import_flag = 0;
function import_confirm() {
if(!$('ccb_form_ds').validate()){
return;
}
var transaction_date = $('ccb_form_ds').getCurrentRecord().get('transaction_date');
$('import_confirm_id').disable();
var ds = $('ccb_import_grid_ds');
record = ds.getAll();
if (import_flag == 0) {
for (i = 0;i < record.length;i++) {
if (record[i].get('status') == 'ERROR') {
Leaf.showMessage('${l:PROMPT}', '导入的数据存在错误,请查看错误信息!');
return;
}
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('import_interface_write_off_link').getUrl(),
para: {
/*'header_id': '${/parameter/@header_id}'*/
header_id: '${/model/header/record/@header_id}',
batch_id: '${/parameter/@batch_id}',
transaction_date: transaction_date
},
scope: this,
success: function() {
import_flag = import_flag + 1;
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
},
error: function(){
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
}
});
} else {
Leaf.showMessage('${l:PROMPT}', '已导入的数据不能重复导入!');
return;
}
}
]]></script>
<a:dataSets>
<a:dataSet id="ccb_import_grid_ds" autoPageSize="true" autoQuery="true" model="ccb.CCB600.ccb_import_ln" queryUrl="${/request/@context_path}/autocrud/ccb.CCB600.ccb_import_ln/query?header_id=${/model/header/record/@header_id}" selectable="true"/>
</a:dataSets>
<a:dataSets>
<a:dataSet id="ccb_form_ds" autoCreate="true">
<a:fields>
<a:field name="transaction_date" required="true" prompt="建行划扣交易日期"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="backBtn" text="HLS.EXIT"/>
<a:gridButton id="import_confirm_id" click="import_confirm" text="确认导入"/>
</a:screenTopToolbar>
<a:form column="1" labelWidth="120" marginWidth="30">
<a:datePicker name="transaction_date" bindTarget="ccb_form_ds" prompt="建行划扣交易日期"/>
</a:form>
<a:grid bindTarget="ccb_import_grid_ds" marginHeight="230" marginWidth="50" navBar="true">
<a:columns>
<a:column name="attribute_1" prompt="序号" width="80"/>
<a:column name="attribute_2" prompt="账号"/>
<a:column name="attribute_3" prompt="户名" width="150"/>
<a:column name="attribute_4" align="right" prompt="发起金额" renderer="Leaf.formatMoney"/>
<a:column name="attribute_5" align="right" prompt="成功金额" renderer="Leaf.formatMoney"/>
<a:column name="attribute_6" align="center" prompt="跨行标识"/>
<a:column name="attribute_7" align="center" prompt="行名" width="170"/>
<a:column name="attribute_8" align="center" prompt="行号" width="170"/>
<a:column name="attribute_9" align="center" prompt="多方协议号" width="150"/>
<a:column name="attribute_10" align="center" prompt="标识号" width="150"/>
<a:column name="attribute_11" align="center" prompt="摘要" width="150"/>
<a:column name="attribute_12" align="center" prompt="备注" width="150"/>
<a:column name="attribute_13" align="center" prompt="银行卡类型" width="150"/>
<a:column name="attribute_14" align="center" prompt="成功标志" width="150"/>
<a:column name="attribute_15" align="center" prompt="失败原因" width="150"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
......@@ -79,12 +79,9 @@
} else {
var saveData = [];
var receipt_type = '${/parameter/@receipt_tpye}';
var receipt_type = '${/parameter/@receipt_type}';
var paid_byother_flag = '${/parameter/paid_byother_flag}';
var bp_category = '${/parameter/bp_category}';
alert(receipt_type);
alert(paid_byother_flag);
alert(bp_category);
if (receipt_type == 'WITHHOLD') { //划扣
if (all.length != records.length) {
Leaf.showInfoMessage("提示", "该现金事务不支付部分反冲");
......
......@@ -25,12 +25,6 @@
function init() {
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
var deposit_ds = $('csh_transaction_deposit_ds');
var advanced_ds = $('csh_transaction_advanced_ds');
if (advanced_ds.getAll().length == 0) {
}
if ('${/parameter/@depositDisplayFlag}' == 'Y') {
document.getElementById('write_off_deposit').style.display = 'block';
......@@ -325,7 +319,6 @@
function csh531_beforesubmit_fun(ds) {
var records = ds.getAll();
var total = 0;
debugger;
var head_record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
var unwrite_off_amount = head_record.get('unwrite_off_amount');
for (var i = 0; i < records.length; i++) {
......@@ -447,9 +440,20 @@
Leaf.showInfoMessage('提示', '核销总金额不能大于剩余可核销金额');
return false;
}
var receipt_type = header_rec.get('receipt_type');
var bp_category = header_rec.get('bp_category');
var paid_byother_flag = header_rec.get('paid_byother_flag');
if (type == 'WRITE_OFF') {
if (sum != header_rec.get('unwrite_off_amount')) {
Leaf.showInfoMessage('提示', '核销总金额不等于可核销金额');
var check_flag = 'N';
if (receipt_type == 'WITHHOLD') { //划扣
check_flag = 'Y';
} else {
if (paid_byother_flag == 'F' && bp_category == 'TENANT') {
check_flag = 'Y';
}
}
if (check_flag == 'Y' && sum != header_rec.get('unwrite_off_amount')) {
Leaf.showInfoMessage('提示', '核销总金额不等于可核销金额,该现金事务不支持部分核销!');
return false;
}
}
......@@ -471,6 +475,18 @@
return;
} else {
if (name == 'write_off_amount') {
var r = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
var deposit_ds = $('csh_transaction_deposit_ds');
var advanced_ds = $('csh_transaction_advanced_ds');
var current_deposit_r = deposit_ds.getAt(0);
var current_advance_r = advanced_ds.getAt(0);
if(r.get('exists_deposit_flag') == 'Y' && current_deposit_r){
return;
}
if(r.get('exists_advance_flag') == 'Y' && current_advance_r){
return;
}
return 'csh_transaction_advanced_grid_nf';
}
}
......
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