Commit f0981123 authored by 高泉铭's avatar 高泉铭

[refactor] csh_write_off

parent b7fd38f1
CREATE TABLE csh_transaction_plan(
plan_id NUMBER,
transaction_id NUMBER,
write_off_type VARCHAR2(20),
company_id number,
bp_id NUMBER,
write_off_amount NUMBER,
write_off_date DATE,
created_by NUMBER,
creation_date DATE,
last_updated_by NUMBER,
last_update_date DATE
);
ALTER TABLE csh_transaction_plan
ADD CONSTRAINTS csh_transaction_plan_pk PRIMARY KEY (plan_id);
CREATE SEQUENCE csh_transaction_plan_s;
COMMENT ON TABLE csh_transaction_plan IS '保证金、预收款-收款单生成-核销计划';
COMMENT ON COLUMN csh_transaction_plan.plan_id IS 'pk';
COMMENT ON COLUMN csh_transaction_plan.company_id IS '公司ID';
COMMENT ON COLUMN csh_transaction_plan.transaction_id IS 'csh_transaction -- pk';
COMMENT ON COLUMN csh_transaction_plan.write_off_type IS '核销事务类型 (保证金/预收款)';
COMMENT ON COLUMN csh_transaction_plan.bp_id IS '商业伙伴ID -- 代理商(保证金)/商业伙伴(预收款)';
COMMENT ON COLUMN csh_transaction_plan.write_off_amount IS '核销金额';
COMMENT ON COLUMN csh_transaction_plan.write_off_date IS '核销日期';
\ No newline at end of file
......@@ -10,24 +10,15 @@
t1.contract_number,
t1.contract_name,
t1.bp_id_tenant,
t2.cashflow_id,
t2.times,
t2.cf_item,
(select a.cf_item_desc from hls_cashflow_item_v a where a.cf_item = t2.cf_item) as cf_item_desc,
t2.due_amount,
(t2.due_amount-nvl(t2.received_amount,0)) as unreceived_amount,
(t2.due_amount - nvl(t2.received_amount,0)) as left_amount,
(t2.principal - nvl(t2.received_principal,0)) as left_principal,
(t2.interest - nvl(t2.received_interest,0)) as left_interest,
t2.due_date
from con_contract t1,
con_contract_cashflow t2
where t1.contract_id = t2.contract_id and
t1.contract_status in ('INCEPT','SIGN','ET','AGENT_TERMINATE','LOSSSHARE_TERMINATE','VIRTUAL_TERMINATE','TERMINATE')
(select bp_name from hls_bp_master where bp_id = t1.bp_id_tenant) bp_name,
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'CON500_CONTRACT_STATUS'
AND sc.code_value = t1.contract_status) contract_status_desc
from con_contract t1
where
t1.contract_status in ('INCEPT','ET')
and t1.data_class = 'NORMAL'
and t2.cf_status = 'RELEASE'
and t2.cf_direction = 'INFLOW'
and t2.due_amount > nvl(t2.received_amount,0)
and t1.company_id in ((
select company_id
from fnd_companies t
......@@ -39,37 +30,29 @@ select t.parent_company_id company_id
where t.parent_company_id is not null
and (t.company_id = ${/session/@company_id} or t.parent_company_id = ${/session/@company_id})))) t
#WHERE_CLAUSE#
order by t.due_date,t.times,t.cf_item
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="contract_id"/>
<bm:field name="bp_id_tenant"/>
<bm:field name="contract_number"/>
<bm:field name="contract_name"/>
<bm:field name="times"/>
<bm:field name="cf_item"/>
<bm:field name="cf_item_desc"/>
<bm:field name="unreceived_amount"/>
<bm:field name="due_amount"/>
<bm:field name="due_date" datatype="java.util.Date"/>
<bm:field name="cashflow_id"/>
<bm:field name="bp_name"/>
<bm:field name="contract_status_desc"/>
<bm:field name="dd_bank_account_num"/>
<bm:field name="dd_bank_account_name"/>
<bm:field name="left_amount"/>
<bm:field name="left_principal"/>
<bm:field name="left_interest"/>
</bm:fields>
<bm:query-fields>
<bm:query-field field="contract_id" queryOperator="="/>
<bm:query-field field="contract_number" queryOperator="="/>
<bm:query-field field="cf_item_desc" queryOperator="="/>
<bm:query-field name="due_amount_from" queryExpression="due_amount &gt;= ${@due_amount_from}"/>
<bm:query-field name="due_amount_to" queryExpression="due_amount &lt;= ${@due_amount_to}"/>
<bm:query-field name="due_date_from" queryExpression="due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="due_date_to" queryExpression="due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field field="contract_number" queryOperator="like"/>
<bm:query-field name="due_date_from"
queryExpression="due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="due_date_to"
queryExpression="due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field field="dd_bank_account_num" queryOperator="="/>
<bm:query-field field="dd_bank_account_name" queryOperator="="/>
<bm:query-field name="bp_id_tenant" queryExpression="t.bp_id = ${@bp_id}"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like '%' || ${@bp_name} || '%'"/>
</bm:query-fields>
</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 times,
cf_item,
cashflow_id,
(select cf_item_desc from hls_cashflow_item_v where cf_item = t.cf_item and enabled_flag = 'Y' and cf_type = t.cf_type) cf_item_desc,
contract_id,
to_char(due_date,'yyyy-mm-dd') due_date,
due_amount,
principal - nvl(received_principal,0) unreceived_principal,
interest - nvl(received_interest,0) unreceived_interest,
due_amount - nvl(received_amount,0) unreceived_amount,
decode(cf_item,1,due_amount-nvl(received_amount,0)) unreceived_rental
from con_contract_cashflow t
#WHERE_CLAUSE#
order by times, due_date
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="contract_id"/>
<bm:field name="cashflow_id"/>
<bm:field name="times"/>
<bm:field name="cf_item"/>
<bm:field name="cf_item_desc"/>
<bm:field name="due_date"/>
<bm:field name="due_amount"/>
<bm:field name="unreceived_principal"/>
<bm:field name="unreceived_interest"/>
<bm:field name="unreceived_amount"/>
<bm:field name="unreceived_rental"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="contract_id" queryExpression="t.contract_id = ${@contract_id}"/>
<!-- <bm:query-field name="due_date_from" queryExpression="t.due_date between to_date(${@due_date_from},'yyyy-mm-dd') and nvl(to_date(${@due_date_to},'yyyy-mm-dd'),t.due_date)"/>-->
<!-- <bm:query-field name="due_date_to" queryExpression="t.due_date between nvl(to_date(${@due_date_from},'yyyy-mm-dd'),t.due_date) and to_date(${@due_date_to},'yyyy-mm-dd')"/>-->
<bm:query-field name="cf_item" queryExpression="t.cf_item = ${@cf_item}"/>
<bm:query-field name="due_date_from"
queryExpression="due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="due_date_to"
queryExpression="due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" expression="t.cf_status = 'RELEASE' and t.write_off_flag != 'FULL'"/>
</bm:data-filters>
</bm:model>
......@@ -96,6 +96,7 @@ where transaction_id = ${@transaction_id}
<bm:field name="ref_v01"/>
<bm:field name="ref_v05"/>
<bm:field name="purpose"/>
<bm:field name="paid_byother_flag_n" expression="(select code_value_name from sys_code_values_v where code = 'PAID_BYOTHER_FLAG' and code_value = t1.paid_byother_flag)"/>
<bm:field name="contract_number" expression="(select cc.contract_number from con_contract cc where cc.contract_id = t1.ref_contract_id)"/>
<!--add by chenlingfeng-->
<bm:field name="write_off_flag_desc" forInsert="false" forUpdate="false"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: leaf Generator
$Date: Mon Sep 16 09:55:25 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="CSH_TRANSACTION_PLAN">
<bm:fields>
<bm:field name="plan_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PLAN_ID" prompt="CSH_TRANSACTION_PLAN.PLAN_ID"/>
<bm:field name="transaction_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TRANSACTION_ID" prompt="CSH_TRANSACTION_PLAN.TRANSACTION_ID"/>
<bm:field name="write_off_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WRITE_OFF_TYPE" prompt="CSH_TRANSACTION_PLAN.WRITE_OFF_TYPE"/>
<bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" prompt="CSH_TRANSACTION_PLAN.BP_ID"/>
<bm:field name="bp_agent_name" expression="(select bp_name from hls_bp_master where bp_id = t1.bp_id)" prompt="代理店" forInsert="false" forceUpdate="false"/>
<bm:field name="bp_name" expression="(select bp_name from hls_bp_master where bp_id = t1.bp_id)" prompt="商业伙伴" forInsert="false" forceUpdate="false"/>
<bm:field name="write_off_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_AMOUNT" prompt="核销金额"/>
<bm:field name="write_off_date" databaseType="DATE" datatype="java.util.Date" physicalName="WRITE_OFF_DATE" prompt="CSH_TRANSACTION_PLAN.WRITE_OFF_DATE"/>
<bm:field name="company_id" databaseType="NUMBER" databasetype="java.lang.Long" physicalName="COMPANY_ID" prompt="CSH_TRANSACTION_PLAN.COMPANY_ID"/>
</bm:fields>
<bm:primary-key>
<bm:pk-field name="plan_id"/>
</bm:primary-key>
<bm:features>
<o:sequence-pk sequenceName="csh_transaction_plan_s"/>
<f:standard-who xmlns:f="leaf.database.features"/>
</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-filters>
</bm:model>
\ No newline at end of file
......@@ -5,7 +5,7 @@
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CSH_TRANSACTION" defaultOrderBy="t1.transaction_date ,t1.transaction_num desc">
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CSH_TRANSACTION" defaultOrderBy="t1.transaction_date desc,t1.transaction_num desc">
<bm:fields>
<bm:field name="transaction_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TRANSACTION_ID" prompt="CSH511.CSH_TRANSACTION.TRANSACTION_ID"/>
<bm:field name="transaction_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACTION_NUM" prompt="CSH511.CSH_TRANSACTION.TRANSACTION_NUM"/>
......@@ -80,8 +80,10 @@
<bm:field name="returned_flag_desc" forInsert="false" forUpdate="false" prompt="CSH511.CSH_TRANSACTION.RETURNED_FLAG"/>
<bm:field name="unallocate_amount" expression="(nvl(t1.transaction_amount,0)-nvl(t1.write_off_amount,0)-nvl(t1.returned_amount,0)-nvl((select sum(i.write_off_amount) from csh_write_off_interface i where i.trx_interface_id = t1.transaction_id and i.record_type is not null),0))" forInsert="false" forUpdate="false" />
<bm:field name="status" expression="nvl(t1.status,&apos;NEW&apos;)" forInsert="false" forUpdate="false"/>
<bm:field name="status_desc" expression="(select code_value_name from sys_code_values_v where code = 'CSH_WRITE_OFF_STATUS' and code_value = nvl(t1.status,'NEW'))" />
<bm:field name="ref_contract_id"/>
<bm:field name="csh_bp_name"/>
<bm:field name="receipt_type_desc" expression="(select code_value_name from sys_code_values_v where code = 'RECEIPT_TYPE' and code_value = t1.receipt_type)"/>
<bm:field name="contract_number" expression="(select cc.contract_number from con_contract cc where cc.contract_id = t1.ref_contract_id)"/>
<!--add by chenlingfeng-->
<bm:field name="bank_name" expression="(select a.bank_short_name from csh_bank_account_v a where a.bank_account_id=t1.bank_account_id)" forInsert="false" forUpdate="false"/>
......@@ -96,6 +98,8 @@
<!--end-->
<!--add by lisitong-->
<bm:field name="approving_return_amount" datatype="java.lang.Double" expression="(select nvl(sum(ctr.this_return_amount),0) from csh_transaction_return ctr where ctr.transaction_id = t1.transaction_id and ctr.status = 'APPROVING')" forInsert="false" forUpdate="false" prompt="审批中退款金额"/>
<bm:field name="created_user_name" expression="(select description from sys_user where user_id = t1.created_by)" forceUpdate="false" forInsert="false"/>
<bm:field name="confirm_user_name" expression="(select description from sys_user where user_id = t1.confirmed_by)" forceUpdate="false" forInsert="false"/>
<!--end-->
</bm:fields>
<bm:features>
......@@ -144,7 +148,7 @@
<bm:query-field name="reverse_write_off_amount_flag" queryExpression="t1.write_off_amount &gt; 0 and ${@reverse_write_off_amount_flag}=&apos;Y&apos;"/>
<bm:query-field field="bp_id" queryOperator="="/>
<bm:query-field name="status" queryExpression="nvl(t1.status,&apos;NEW&apos;) = ${@status}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_id in (select d.bp_id from hls_bp_master d where d.bp_name like &apos;%&apos;||${@bp_name_from}||&apos;%&apos;)"/>
<!-- <bm:query-field name="bp_name" queryExpression="t1.bp_id in (select d.bp_id from hls_bp_master d where d.bp_name like &apos;%&apos;||${@bp_name_from}||&apos;%&apos;)"/>-->
<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>
<!--add by chenlingfeng-->
<bm:query-field name="full_write_off_flag" queryExpression="(t1.write_off_flag = ${@full_write_off_flag} or t1.write_off_flag = ${@partial_write_off_flag} or t1.write_off_flag = ${@not_write_off_flag})"/>
......@@ -162,6 +166,7 @@
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" expression="(t1.company_id=${/session/@company_id})"/>
<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="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="type" expression="t1.transaction_type in ('ADVANCE_RECEIPT','RECEIPT') and t1.returned_flag != 'FULL' and nvl(t1.deposit_flag,'N')='N' and t1.confirmed_flag = 'APPROVED' "/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
csh_transaction_interface_pkg.delete_write_off_interface(
p_write_off_interface_id=>${@write_off_interface_id},
p_user_id => ${/session/@user_id}
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
-- Call the procedure
csh_transaction_interface_pkg.insert_write_off_interface(p_write_off_interface_id =>
${@write_off_interface_id},
p_record_type => ${@record_type},
p_transaction_id => ${@trx_interface_id},
p_company_id => ${@company_id},
p_contract_number => ${@contract_number},
p_contract_id => ${@contract_id},
p_write_off_type => ${@write_off_type},
p_write_off_date => to_date(${@write_off_date},'yyyy-mm-dd'),
p_write_off_period_name => ${@write_off_period_name},
p_write_off_period_num => ${@write_off_period_num},
p_write_off_amount => ${@write_off_amount},
p_write_off_bp_id => ${@write_off_bp_id},
p_batch_id => ${@batch_id},
p_write_off_cashflow_id => ${@write_off_cashflow_id},
p_write_off_times => ${@write_off_times},
p_write_off_cf_item => ${@write_off_cf_item},
p_write_off_principal => ${@write_off_principal},
p_write_off_interest => ${@write_off_interest},
p_write_off_description => ${@write_off_description},
p_post_flag => ${@post_flag},
p_write_off_classification => ${@write_off_classification},
p_journal_date => to_date(${@journal_date},'yyyy-mm-dd'),
p_user_id => ${/session/@user_id});
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
-- Call the procedure
csh_transaction_interface_pkg.insert_write_off_interface(p_write_off_interface_id =>
${@write_off_interface_id},
p_record_type => ${@record_type},
p_transaction_id => ${@trx_interface_id},
p_company_id => ${@company_id},
p_contract_number => ${@contract_number},
p_contract_id => ${@contract_id},
p_write_off_type => ${@write_off_type},
p_write_off_date => to_date(${@write_off_date},'yyyy-mm-dd'),
p_write_off_period_name => ${@write_off_period_name},
p_write_off_period_num => ${@write_off_period_num},
p_write_off_amount => ${@write_off_amount},
p_write_off_bp_id => ${@write_off_bp_id},
p_batch_id => ${@batch_id},
p_write_off_cashflow_id => ${@write_off_cashflow_id},
p_write_off_times => ${@write_off_times},
p_write_off_cf_item => ${@write_off_cf_item},
p_write_off_principal => ${@write_off_principal},
p_write_off_interest => ${@write_off_interest},
p_write_off_description => ${@write_off_description},
p_post_flag => ${@post_flag},
p_write_off_classification => ${@write_off_classification},
p_journal_date => to_date(${@journal_date},'yyyy-mm-dd'),
p_user_id => ${/session/@user_id});
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
select write_off_id,
(select company_id from csh_transaction where transaction_id = t1.csh_transaction_id) company_id,
t1.csh_transaction_id transaction_id,
(select contract_number from con_contract where contract_id = t1.contract_id) contract_number,
contract_id,
cashflow_id write_off_cashflow_id,
(select a.due_date from con_contract_cashflow a where a.cashflow_id = t1.cashflow_id) due_date,
write_off_date,
write_off_type,
period_name write_off_period_name,
t1.INTERNAL_PERIOD_NUM write_off_period_num,
times write_off_times,
cf_item write_off_cf_item,
(select a.cf_item_desc from hls_cashflow_item_v a where a.cf_item = t1.cf_item) write_off_cf_item_desc,
t1.WRITE_OFF_DUE_AMOUNT write_off_amount,
t1.WRITE_OFF_PRINCIPAL,
t1.WRITE_OFF_INTEREST,
(select bp_name from hls_bp_master where bp_id = t1.bp_id) bp_tenant_name
from csh_write_off t1) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"
prompt="CSH_WRITE_OFF.COMPANY_ID"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="CONTRACT_NUMBER" prompt="合同编号"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"
prompt="CSH_WRITE_OFF.CONTRACT_ID"/>
<bm:field name="write_off_cashflow_id" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="WRITE_OFF_CASHFLOW_ID" prompt="CSH_WRITE_OFF.WRITE_OFF_CASHFLOW_ID"/>
<bm:field name="due_date" datatype="java.util.Date" forInsert="false" forUpdate="false"/>
<bm:field name="write_off_type" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="WRITE_OFF_TYPE" prompt="CSH_WRITE_OFF.WRITE_OFF_TYPE"/>
<bm:field name="write_off_date" databaseType="DATE" datatype="java.util.Date" physicalName="WRITE_OFF_DATE"
prompt="CSH_WRITE_OFF.WRITE_OFF_DATE"/>
<bm:field name="write_off_period_name" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="WRITE_OFF_PERIOD_NAME" prompt="CSH_WRITE_OFF.WRITE_OFF_PERIOD_NAME"/>
<bm:field name="write_off_period_num" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="WRITE_OFF_PERIOD_NUM" prompt="CSH_WRITE_OFF.WRITE_OFF_PERIOD_NUM"/>
<bm:field name="write_off_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_TIMES"
prompt="CSH_WRITE_OFF.WRITE_OFF_TIMES"/>
<bm:field name="write_off_cf_item" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="WRITE_OFF_CF_ITEM" prompt="CSH_WRITE_OFF.WRITE_OFF_CF_ITEM"/>
<bm:field name="write_off_cf_item_desc" forInsert="false" forUpdate="false"/>
<bm:field name="write_off_amount" databaseType="NUMBER" datatype="java.lang.Double"
physicalName="WRITE_OFF_AMOUNT" prompt="核销金额"/>
<!-- <bm:field name="write_off_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_PRINCIPAL" prompt="CSH_WRITE_OFF.WRITE_OFF_PRINCIPAL"/>-->
<!-- <bm:field name="write_off_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_INTEREST" prompt="CSH_WRITE_OFF.WRITE_OFF_INTEREST"/>-->
<!-- <bm:field name="write_off_description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WRITE_OFF_DESCRIPTION" prompt="CSH_WRITE_OFF.WRITE_OFF_DESCRIPTION"/>-->
<bm:field name="write_off_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_ID"
prompt="CSH_WRITE_OFF.WRITE_OFF_ID"/>
<bm:field name="transaction_id"/>
<bm:field name="bp_tenant_name"/>
</bm:fields>
<bm:query-fields>
<bm:query-field field="transaction_id" queryOperator="="/>
</bm:query-fields>
</bm:model>
......@@ -78,7 +78,7 @@ end;
<bm:field name="trx_interface_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TRX_INTERFACE_ID" prompt="CSH_WRITE_OFF_INTERFACE.TRX_INTERFACE_ID"/>
<!-- <bm:field name="trx_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TRX_NUMBER" prompt="CSH_WRITE_OFF_INTERFACE.TRX_NUMBER"/> -->
<bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" prompt="CSH_WRITE_OFF_INTERFACE.COMPANY_ID"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" />
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="合同编号" />
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CSH_WRITE_OFF_INTERFACE.CONTRACT_ID"/>
<bm:field name="write_off_cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_CASHFLOW_ID" prompt="CSH_WRITE_OFF_INTERFACE.WRITE_OFF_CASHFLOW_ID"/>
<bm:field name="due_date" datatype="java.util.Date" expression="(select a.due_date from con_contract_cashflow a where a.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
......@@ -90,7 +90,7 @@ end;
<bm:field name="write_off_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_TIMES" prompt="CSH_WRITE_OFF_INTERFACE.WRITE_OFF_TIMES"/>
<bm:field name="write_off_cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_CF_ITEM" prompt="CSH_WRITE_OFF_INTERFACE.WRITE_OFF_CF_ITEM"/>
<bm:field name="write_off_cf_item_desc" expression="(select a.cf_item_desc from hls_cashflow_item_v a where a.cf_item = t1.write_off_cf_item)" forInsert="false" forUpdate="false"/>
<bm:field name="write_off_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_AMOUNT" prompt="CSH_WRITE_OFF_INTERFACE.WRITE_OFF_AMOUNT"/>
<bm:field name="write_off_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_AMOUNT" prompt="核销金额"/>
<bm:field name="write_off_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_PRINCIPAL" prompt="CSH_WRITE_OFF_INTERFACE.WRITE_OFF_PRINCIPAL"/>
<bm:field name="write_off_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_INTEREST" prompt="CSH_WRITE_OFF_INTERFACE.WRITE_OFF_INTEREST"/>
<bm:field name="write_off_description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WRITE_OFF_DESCRIPTION" prompt="CSH_WRITE_OFF_INTERFACE.WRITE_OFF_DESCRIPTION"/>
......@@ -104,13 +104,16 @@ end;
<bm:field name="csh_bank_slip_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CSH_BANK_SLIP_NUM" prompt="CSH_WRITE_OFF_INTERFACE.CSH_BANK_SLIP_NUM"/>
<bm:field name="error_message" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ERROR_MESSAGE" prompt="CSH_WRITE_OFF_INTERFACE.ERROR_MESSAGE"/>
<bm:field name="trx_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRX_NUMBER" prompt="事务编号"/>
<bm:field name="left_amount" expression="(select ca.due_amount - nvl(ca.received_amount,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="left_amount" expression="(select decode(cf_item,1,ca.due_amount - nvl(ca.received_amount,0)) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="unreceived_amount" expression="(select ca.due_amount - nvl(ca.received_amount,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="left_principal" expression="(select ca.principal - nvl(ca.received_principal,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="left_interest" expression="(select ca.interest - nvl(ca.received_interest,0) from con_contract_cashflow ca where ca.cashflow_id = t1.write_off_cashflow_id)" forInsert="false" forUpdate="false"/>
<bm:field name="unreceived_penalty" expression="(select ca.due_amount - nvl(ca.received_amount,0) from con_contract_cashflow ca where ca.contract_id = t1.contract_id and ca.times = t1.write_off_times and cf_item = 9)" forInsert="false" forUpdate="false"/>
<bm:field name="agent_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<bm:field name="agent_id_desc" expression="(select hbm.bp_name from hls_bp_master hbm where hbm.bp_id = t1.agent_id)" forUpdate="false" forInsert="false"/>
<bm:field name="write_off_classification" lookupField="write_off_classification_desc" lookupCode="DS_CSH_WRITE_OFF_CLASSIFICATION" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="write_off_classification_desc" forInsert="false" forUpdate="false"/>
<bm:field name="bp_tenant_name" expression="(select bp_name from hls_bp_master where bp_id = t1.write_off_bp_id)" forInsert="false" forUpdate="false"/>
<bm:field name="journal_date" databaseType="DATE" datatype="java.util.Date"/>
</bm:fields>
<bm:features>
......
......@@ -8,7 +8,9 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure>
<a:model-query model="csh.CSH531N.csh_batch_status_default" rootPath="batch_status_default"/>
<a:model-query defaultWhereClause="v.code=&apos;CSH511_TRANSACTION_TYPE&apos; and v.code_value in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;)" fetchAll="true" model="basic.sys_code_default_value" rootPath="sys_code_default_value_path"/>
<a:model-query
defaultWhereClause="v.code=&apos;CSH511_TRANSACTION_TYPE&apos; and v.code_value in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;)"
fetchAll="true" model="basic.sys_code_default_value" rootPath="sys_code_default_value_path"/>
</a:init-procedure>
<a:view>
<a:link id="general_import_upload_link"
......@@ -30,10 +32,12 @@
<a:link id="import_upload_link"
url="${/request/@context_path}/modules/csh/CSH531N/csh_pos_input.lview"/>
<a:link id="csh_write_off_detail_link" url="${/request/@context_path}/modules/csh/CSH301/csh_transaction_receipt_write_off_detail_query.lview"/>
<a:link id="csh_write_off_detail_link"
url="${/request/@context_path}/modules/csh/CSH301/csh_transaction_receipt_write_off_detail_query.lview"/>
<a:link id="csh_terminal_manager_link" url="${/request/@context_path}/modules/csh/CSH531N/csh_terminal_manager.lview"/>
<a:link id="csh_terminal_manager_link"
url="${/request/@context_path}/modules/csh/CSH531N/csh_terminal_manager.lview"/>
<script type="text/javascript"><![CDATA[
......@@ -46,7 +50,7 @@
Leaf.Masker.unmask(Ext.getBody());
}
function csh531_reset(){
function csh531_reset() {
$('csh_transaction_receipt_write_off_query_ds').reset();
}
......@@ -326,15 +330,19 @@
}
function csh531n_open_write_off_detail(id) {
function csh531n_open_write_off_detail(id, readOnly) {
var ds = $('csh531n_sap_bankflow_info_result_ds');
var record = ds.findById(id);
var bp_category = record.get('bp_category');
var depositDisplayFlag = 'N';
if(bp_category == 'AGENT'){
depositDisplayFlag = 'Y';
}
var win = new Leaf.Window({
id: 'csh_write_off_upload_window',
params: {
transaction_id: record.get('transaction_id'),
transaction_id: record.get('transaction_id'),
depositDisplayFlag: depositDisplayFlag,
bank_slip_num: record.get('bank_slip_num'),
company_id: record.get('company_id'),
transaction_date: Leaf.formatDate(record.get('transaction_date')),
......@@ -343,6 +351,7 @@
bp_bank_account_num: record.get('bp_bank_account_num'),
bp_bank_account_name: record.get('bp_bank_account_name'),
bp_id: record.get('bp_id'),
readOnly: readOnly,
winid: 'csh_write_off_upload_window'
},
url: $('batch_detail_link').getUrl(),
......@@ -356,12 +365,22 @@
}
function csh531n_detail_renderer(value, record, name) {
return '<a href="Javascript:csh531n_open_write_off_detail(' + record.id + ')">明细</a>';
var text = '';
var status = record.get('status');
var write_off_flag = record.get('write_off_flag');
var readOnly = 'Y';
if ((status == 'NEW' || status == 'RETURN') && write_off_flag == 'NOT') {
readOnly = 'N';
}
if (name == 'csh531n_detail') {
return '<a href="Javascript:csh531n_open_write_off_detail(' + record.id + ',\'' + readOnly + '\')">明细</a>';
} else if (name == 'transaction_num') {
return '<a href="Javascript:csh531n_open_write_off_detail(' + record.id + ',\'' + readOnly + '\')">' + value + '</a>';
}
}
function csh531_post_input(){
function csh531_post_input() {
new Leaf.Window({
id: 'upload_window_winid',
url: $('import_upload_link').getUrl(),
......@@ -371,9 +390,10 @@
height: 300
});
}
function seedetail_write_off(value, record, name) {
var return_value = value||0;
return '<a href="javascript:openWindow_writeoff('+record.id+');">' + Leaf.formatMoney(return_value) + '</a>';
var return_value = value || 0;
return '<a href="javascript:openWindow_writeoff(' + record.id + ');">' + Leaf.formatMoney(return_value) + '</a>';
}
......@@ -394,8 +414,8 @@
}
function csh531_terminal_manager(){
var url = $('csh_terminal_manager_link').getUrl();
function csh531_terminal_manager() {
var url = $('csh_terminal_manager_link').getUrl();
new Leaf.Window({
id: 'csh_terminal_manager_id',
params: {
......@@ -403,71 +423,79 @@
},
url: url,
title: '终端号管理',
width:1100,
height:600
width: 1100,
height: 600
});
}
function csh531n_export() {
$('csh_transaction_receipt_write_off_grid_ds')._export(null,'收款核销流水');
$('csh_transaction_receipt_write_off_grid_ds')._export(null, '收款核销流水');
}
function csh531_new_write_off() {
var record = $('csh531n_sap_bankflow_info_result_ds').getSelected()[0];
if (record) {
var write_off_flag = record.get('write_off_flag');
var readOnly = 'Y';
if (write_off_flag == 'NOT') {
readOnly = 'N';
}
csh531n_open_write_off_detail(record.id,readOnly);
} else {
Leaf.showErrorMessage('提示', '请先选择一条数据');
}
}
function csh531_new_reverse_write_off(){
}
]]></script>
<a:dataSets>
<a:dataSet id="batch_status_ds" lookupCode="CSH531_BATCH_STATUS"/>
<a:dataSet id="csh531n_ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>
<!--<a:dataSet id="csh_trx_batch_query_ds" autoCreate="true">-->
<!--<a:fields>-->
<!--<a:field name="batch_status" defaultValue="NEW"/>-->
<!--<a:field name="batch_status_desc" defaultValue="${/model/batch_status_default/record/@code_value_name}" displayField="code_value_name" options="batch_status_ds" returnField="batch_status" valueField="code_value"/>-->
<!--<a:field name="transaction_date"/>-->
<!--</a:fields>-->
<!--</a:dataSet>-->
<!--<a:dataSet id="csh531n_sap_bankflow_info_result_ds" autoPageSize="true" autoQuery="true" model="csh.CSH531N.csh_trx_batch_interface" queryDataSet="csh_trx_batch_query_ds" selectable="true">-->
<!--<a:fields>-->
<!--<a:field name="batch_status"/>-->
<!--<a:field name="batch_status_desc" displayField="code_value_name" options="batch_status_ds" returnField="batch_status" valueField="code_value"/>-->
<!--</a:fields>-->
<!--</a:dataSet>-->
<a:dataSet id="currency_ds">
<a:datas dataSource="/model/currency"/>
</a:dataSet>
<a:dataSet id="csh_transaction_type_ds">
<a:datas dataSource="/model/sys_code_default_value_path"/>
</a:dataSet>
<a:dataSet id="status_ds" lookupCode="CSH_PAYMENT_REQ_APPROVAL_STATUS"/>
<!-- <a:dataSet id="status_ds" lookupCode="CSH_PAYMENT_REQ_APPROVAL_STATUS"/>-->
<a:dataSet id="status_ds" lookupCode="CSH_WRITE_OFF_STATUS"/>
<a:dataSet id="con_write_off_flag_ds" lookupCode="CON_WRITE_OFF_FLAG"/>
<a:dataSet id="receipt_type_ds" lookupCode="RECEIPT_TYPE"/>
<a:dataSet id="csh_transaction_receipt_write_off_query_ds" autoCreate="true">
<a:fields>
<a:field name="full_write_off_flag" checkedValue="FULL" defaultValue="N" uncheckedValue="N"/>
<a:field name="partial_write_off_flag" defaultValue="PARTIAL" checkedValue="PARTIAL"
uncheckedValue="N"/>
<a:field name="not_write_off_flag" defaultValue="NOT" checkedValue="NOT" uncheckedValue="N"/>
<a:field name="full_review_status" checkedValue="FULL" defaultValue="FULL" uncheckedValue="N"/>
<a:field name="partial_review_status" checkedValue="PARTIAL" defaultValue="PARTIAL"
uncheckedValue="N"/>
<a:field name="not_review_status" checkedValue="NOT" defaultValue="NOT" uncheckedValue="N"/>
<a:field name="posted_flag" defaultValue="Y"/>
<a:field name="reversed_flag" defaultValue="N"/>
<a:field name="label1" defaultValue="核销状态:"/>
<a:field name="label2" defaultValue="分配状态:"/>
<a:field name="collection_classes_desc" options="csh531n_ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<a:field name="transaction_type" defaultValue="RECEIPT" />
<a:field name="transaction_type_desc" options="csh_transaction_type_ds" returnField="transaction_type" valueField="code_value" displayField="code_value_name" defaultValue="收款"/>
<a:field name="write_off_flag" displayField="code_value_name" options="con_write_off_flag_ds"
returnField="write_off_flag" valueField="code_value"/>
<a:field name="status" displayField="code_value_name" options="status_ds"
returnField="status" valueField="code_value"/>
<a:field name="collection_classes_desc" options="csh531n_ds_collection_classes_ds"
displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<a:field name="transaction_type" defaultValue="RECEIPT"/>
<a:field name="transaction_type_desc" options="csh_transaction_type_ds"
returnField="transaction_type" valueField="code_value" displayField="code_value_name"
defaultValue="收款"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="550" lovLabelWidth="50" lovWidth="550"
lovService="basic.hls_bp_master_v_for_lov" 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="receipt_type_desc" options="receipt_type_ds" valueField="code_value"
defaultValue="code_value_name" returnField="receipt_type"/>
</a:fields>
<a:events>
<a:event name="update" handler="csh513_receipt_write_off_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="csh531n_sap_bankflow_info_result_ds" autoPageSize="true" autoQuery="false"
<a:dataSet id="csh531n_sap_bankflow_info_result_ds" autoPageSize="true" autoQuery="true"
model="csh.CSH531N.csh_transaction_query"
queryDataSet="csh_transaction_receipt_write_off_query_ds" selectable="true">
queryDataSet="csh_transaction_receipt_write_off_query_ds" selectable="true"
selectionModel="single">
<a:fields>
<a:field name="auto_filt_penalty" checkedValue="Y" uncheckedValue="N"/>
<a:field name="auto_filt_prinicipal_interest" checkedValue="Y" uncheckedValue="N"/>
......@@ -477,131 +505,107 @@
</a:dataSet>
<a:dataSet id="auto_write_off_ds" autoCreate="true">
<a:fields>
<a:field name="bank_account_num" checkedValue="Y" uncheckedValue="N"/>
<a:field name="bp_bank_account_num" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
<a:field name="bp_bank_account_name" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
<a:field name="trx_amount" checkedValue="Y" uncheckedValue="N"/>
</a:fields>
<!--<a:events>-->
<!--<a:event name="update" handler="csh_para_check"/>-->
<!--</a:events>-->
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<!--<a:gridButton click="csh531_data_confirm" text="CSH531.DATA_VALIDATION"/>-->
<!-- <a:gridButton click="csh531_error_info" text="CSH531.SHOW_ERROR"/> -->
<a:gridButton click="csh531_query" text="HLS.QUERY"/>
<a:gridButton click="csh531_new_write_off" text="新增核销"/>
<a:gridButton click="csh531_new_reverse_write_off" text="新增反冲"/>
<a:gridButton click="csh531_reset" text="重置"/>
<!--<a:gridButton click="csh531_delete" text="HLS.REMOVE"/>chenlingfeng-->
</a:screenTopToolbar>
<a:form bindTarget="csh_transaction_receipt_write_off_query_ds" labelWidth="120" marginWidth="30"
>
<a:hBox>
<a:fieldSet labelWidth="150" title="HLS.QUERY_TITLE">
<a:box column="4">
<a:label name="label1" bindTarget="csh_transaction_receipt_write_off_query_ds" style="margin-left:10px;color: #888;padding-left: 5px; padding-right: 5px;padding-top: 7px;"/>
<!--<a:checkBox name="full_write_off_flag" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="全部核销"/>-->
<a:checkBox name="partial_write_off_flag" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="部分核销"/>
<a:checkBox name="not_write_off_flag" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="未核销"/>
</a:box>
<a:box column="4">
<a:label name="label2" bindTarget="csh_transaction_receipt_write_off_query_ds" style="margin-left:10px;color: #888;padding-left: 5px; padding-right: 5px;padding-top: 7px;"/>
<a:checkBox name="full_review_status" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="完全分配"/>
<a:checkBox name="partial_review_status" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="部分分配"/>
<a:checkBox name="not_review_status" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="未分配"/>
</a:box>
<a:box column="5">
<a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="银行名称"/>
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="银行流水号"/>
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="对方账户"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="对方账号"/>
<a:textField name="description" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="摘要"/>
</a:box>
<a:box column="5">
<a:numberField name="transaction_amount_from" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款金额从"/>
<a:numberField name="transaction_amount_to" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款金额到"/>
<a:datePicker name="transaction_date_from" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款日期从"/>
<a:datePicker name="transaction_date_to" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款日期到"/>
<a:comboBox name="transaction_type_desc" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="事务类型"/>
</a:box>
<a:box column="5">
<a:numberField name="unwrite_off_amount_from" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="可用余额从"/>
<a:numberField name="unwrite_off_amount_to" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="可用余额到"/>
<a:textField name="transaction_num" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="事务编号"/>
<a:comboBox name="collection_classes_desc" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="款项分类"/>
</a:box>
</a:fieldSet>
<a:fieldSet labelWidth="150" column="1" title="CSH531.AUTO_WRITE_OFF_PARA" width="350">
<a:checkBox name="bp_bank_account_name" bindTarget="auto_write_off_ds" prompt="汇款账户名"/>
<a:checkBox name="bp_bank_account_num" bindTarget="auto_write_off_ds" prompt="汇款账户清单"/>
<!--<a:checkBox name="trx_amount" bindTarget="auto_write_off_ds" prompt="CSH531.TRX_AMOUNT"/>-->
</a:fieldSet>
</a:hBox>
<a:form bindTarget="csh_transaction_receipt_write_off_query_ds" style="background:#f7f7f8" labelWidth="250">
<a:fieldSet labelWidth="250" title="HLS.QUERY_TITLE">
<a:box column="4">
<a:datePicker name="transaction_date_from"
bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款日期从"/>
<a:datePicker name="transaction_date_to"
bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款日期到"/>
<a:numberField name="transaction_amount_from"
bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款金额从"/>
<a:numberField name="transaction_amount_to"
bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="收款金额到"/>
</a:box>
<!-- <a:box column="4">-->
<!-- <a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_write_off_query_ds"-->
<!-- prompt="我方账户户名"/>-->
<!-- <a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_write_off_query_ds"-->
<!-- prompt="我方银行名称"/>-->
<!-- <a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_write_off_query_ds"-->
<!-- prompt="我方账户账号"/>-->
<!-- <a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_write_off_query_ds"-->
<!-- prompt="银行流水号"/>-->
<!-- </a:box>-->
<!-- <a:box column="4">-->
<!-- <a:textField name="bp_bank_account_name"-->
<!-- bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="对方账户户名"/>-->
<!-- <a:textField name="bp_bank_account_name"-->
<!-- bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="对方银行名称"/>-->
<!-- <a:textField name="bp_bank_account_num"-->
<!-- bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="对方账户账号"/>-->
<!-- </a:box>-->
<a:box column="4">
<a:lov name="bp_name"
bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="商业伙伴"/>
<!-- <a:comboBox name="status" bindTarget="csh_transaction_receipt_write_off_query_ds"-->
<!-- prompt="单据状态"/>-->
<a:comboBox name="write_off_flag" bindTarget="csh_transaction_receipt_write_off_query_ds"
prompt="核销状态"/>
<a:comboBox name="collection_classes_desc"
bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="款项用途"/>
</a:box>
</a:fieldSet>
</a:form>
<a:grid id="csh_transaction_receipt_write_off_grid_ds"
bindTarget="csh531n_sap_bankflow_info_result_ds" marginHeight="305" marginWidth="30"
navBar="true">
<a:toolBar>
<a:button click="csh531_terminal_manager" text="终端号管理"/>
<a:button click="csh531_post_input" text="POS机导入"/>
<a:button type="excel" text="流水导出"/>
<a:button click="csh_auto_write_off" text="自动分配"/>
<a:button click="csh_import_write_off" text="导入分配"/>
<a:button click="csh531_data_confirm" text="审阅"/>
</a:toolBar>
<!-- <a:toolBar>-->
<!-- <a:button click="csh531_terminal_manager" text="终端号管理"/>-->
<!-- <a:button click="csh531_post_input" text="POS机导入"/>-->
<!-- <a:button type="excel" text="流水导出"/>-->
<!-- <a:button click="csh_auto_write_off" text="自动分配"/>-->
<!-- <a:button click="csh_import_write_off" text="导入分配"/>-->
<!-- <a:button click="csh531_data_confirm" text="审阅"/>-->
<!-- </a:toolBar>-->
<a:columns>
<a:column name="transaction_num" prompt="现金事务编号"/>
<a:column name="transaction_type_desc" prompt="事务类型" width="80"/>
<a:column name="transaction_num" prompt="现金事务编号" lock="true" align="left"
renderer="csh531n_detail_renderer" width="220"/>
<a:column name="receipt_type_desc" prompt="收款类型" align="center" lock="true" width="120"/>
<!--<a:column name="bank_name" prompt="银行名称"/>-->
<a:column name="bank_branch_name" prompt="银行名称"/>
<a:column name="bank_slip_num" prompt="银行流水号"/>
<a:column name="bank_account_num" prompt="收款账号"/>
<a:column name="transaction_amount" align="right" footerRenderer="summary_Renderer"
renderer="Leaf.formatMoney" prompt="收款金额"/>
<a:column name="transaction_date" renderer="Leaf.formatDate" prompt="收款日期" width="80"/>
<!--<a:column name="csh_bp_name" prompt="收款对象"/>-->
<a:column name="bp_bank_account_name" prompt="对方账户"/>
<a:column name="bp_bank_account_num" prompt="对方账号"/>
<a:column name="description_p" prompt="摘要+用途"/>
<a:column name="collection_classes_desc" prompt="款项分类"/>
<a:column name="write_off_amount" align="right" renderer="seedetail_write_off" prompt="已核销金额"/>
<a:column name="unwrite_off_amount" align="right" footerRenderer="summary_Renderer"
renderer="Leaf.formatMoney" prompt="未核销金额"/>
<a:column name="approving_return_amount" align="right" footerRenderer="summary_Renderer" renderer="Leaf.formatMoney" prompt="审批中退款金额"/>
<a:column name="unallocate_amount" align="right" footerRenderer="summary_Renderer"
renderer="Leaf.formatMoney" prompt="未分配金额"/>
<a:column name="write_off_flag_desc" prompt="核销状态" width="100"/>
<a:column name="review_status_desc" prompt="分配状态" width="80"/>
<a:column name="ref_v05" prompt="备注" width="100"/>
<a:column name="csh531n_detail" renderer="csh531n_detail_renderer" prompt="明细" width="50"/>
<!-- <a:column name="bank_branch_name" prompt="银行名称"/>-->
<!-- <a:column name="bank_slip_num" prompt="银行流水号"/>-->
<!-- <a:column name="bank_account_num" prompt="收款账号"/>-->
<a:column name="transaction_amount" align="right" lock="true" footerRenderer="summary_Renderer"
renderer="Leaf.formatMoney" prompt="收款金额" width="180"/>
<a:column name="transaction_date" renderer="Leaf.formatDate" align="center" lock="true"
prompt="收款日期" width="120"/>
<a:column name="collection_classes_desc" prompt="款项用途" lock="true" align="center"/>
<a:column name="bp_name" prompt="商业伙伴" align="left" width="200"/>
<a:column name="csh531n_detail" renderer="csh531n_detail_renderer" prompt="核销明细" align="center"
width="80"/>
<!-- <a:column name="bp_bank_account_name" prompt="对方账户"/>-->
<!-- <a:column name="bp_bank_account_num" prompt="对方账号"/>-->
<!-- <a:column name="description_p" prompt="摘要+用途"/>-->
<!-- <a:column name="write_off_amount" align="right" renderer="seedetail_write_off" prompt="已核销金额"/>-->
<!-- <a:column name="unwrite_off_amount" align="right" footerRenderer="summary_Renderer"-->
<!-- renderer="Leaf.formatMoney" prompt="未核销金额"/>-->
<!-- <a:column name="approving_return_amount" align="right" footerRenderer="summary_Renderer" renderer="Leaf.formatMoney" prompt="审批中退款金额"/>-->
<!-- <a:column name="unallocate_amount" align="right" footerRenderer="summary_Renderer"-->
<!-- renderer="Leaf.formatMoney" prompt="未分配金额"/>-->
<!-- <a:column name="status_desc" prompt="单据状态" width="120" align="center"/>-->
<a:column name="write_off_flag_desc" prompt="核销状态" width="120" align="center"/>
<!-- <a:column name="review_status_desc" prompt="分配状态" width="80"/>-->
<!-- <a:column name="ref_v05" prompt="备注" width="100"/>-->
<a:column name="created_user_name" prompt="制单人" width="120" align="center"/>
<a:column name="confirm_user_name" prompt="确认人" width="120" align="center"/>
</a:columns>
<a:editors>
<a:checkBox id="receipt_write_off_checkbox_id"/>
</a:editors>
</a:grid>
<!--<a:form column="2" title="HLS.QUERY_TITLE">-->
<!--<a:comboBox name="batch_status_desc" bindTarget="csh_trx_batch_query_ds" prompt="HLS.STATUS"/>-->
<!--<a:datePicker name="transaction_date" bindTarget="csh_trx_batch_query_ds" prompt="CSH531.TRANSACTION_DATE"/>-->
<!--</a:form>-->
<!--<a:grid id="csh_transfer_grid" bindTarget="csh531n_sap_bankflow_info_result_ds" marginHeight="180" marginWidth="50" navBar="true">-->
<!--<a:columns>-->
<!--<a:column name="transaction_date" prompt="CSH531.TRANSACTION_DATE" renderer="Leaf.formatDate"/>-->
<!--<a:column name="file_name" prompt="CSH531.FILE_NAME" width="250"/>-->
<!--<a:column name="description" prompt="EXP_EMPLOYEES.NOTES" width="300"/>-->
<!--<a:column name="batch_status_desc" align="center" prompt="HLS.STATUS" width="60"/>-->
<!--<a:column align="center" prompt="HAP_DETAIL" renderer="cshBatchDetail" width="60"/>-->
<!--<a:column align="center" prompt="EDIT" renderer="cshEditFun" width="60"/>-->
<!--<a:column name="created_by_n" align="left" prompt="操作人" width="60"/>-->
<!--</a:columns>-->
<!--</a:grid>-->
</a:screenBody>
</a:view>
</a:screen>
......@@ -5,9 +5,9 @@
<a:model-query fetchAll="true" model="csh.CSH531N.csh_transaction" rootPath="csh_transaction_path"/>
</a:init-procedure>
<a:view>
<a:link id="csh531n_csh_confirm_data_link" model="csh.CSH531N.csh_data_confirm" modelaction="update"/>
<a:link id="transaction_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="transaction_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<script type="text/javascript"><![CDATA[
......@@ -24,19 +24,39 @@
}
function init() {
var batch_status = '${/parameter/@batch_status}';
if (batch_status == 'SUBMIT') {
debugger;
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';
}
if ('${/parameter/@readOnly}' == 'Y') {
$('csh_grid_add_bt').setVisible(false);
$('csh_grid_delete_bt').setVisible(false);
$('csh_grid_save_bt').setVisible(false);
// $('csh_grid_deposit_add_bt').setVisible(false);
// $('csh_grid_deposit_delete_bt').setVisible(false);
// $('csh_grid_advanced_add_bt').setVisible(false);
// $('csh_grid_advanced_delete_bt').setVisible(false);
$('csh_write_off_grid').hideColumn('left_amount');
$('csh_write_off_grid').hideColumn('left_principal');
$('csh_write_off_grid').hideColumn('left_interest');
$('csh_write_off_grid').hideColumn('unreceived_amount');
$('csh_write_off_interface_ds').setQueryUrl('${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off/query?transaction_id=${/parameter/@transaction_id}');
$('csh_write_off_interface_ds').query();
if (record) {
record.getField('ref_v05').setReadOnly(true);
}
} else {
$('csh_grid_add_bt').setVisible(true);
$('csh_grid_delete_bt').setVisible(true);
$('csh_grid_save_bt').setVisible(true);
$('csh511_save_all_id').setVisible(true);
$('csh531n_write_off_btn_id').setVisible(true);
}
}
// function csh_write_off_add(){
......@@ -47,8 +67,9 @@
function csh_edit_function(record, name) {
var batch_status = '${/parameter/@batch_status}';
var readOnly = '${/parameter/@readOnly}';
var write_off_type = record.get('write_off_type');
if (batch_status == 'SUBMIT') {
if (batch_status == 'SUBMIT' || readOnly == 'Y') {
return;
} else {
if (name == 'contract_number') {
......@@ -68,7 +89,7 @@
return 'csh_write_off_grid_lv';
}
}
if (name == 'write_off_amount' || name == 'write_off_principal' || name == 'write_off_interest') {
if (name == 'write_off_amount' || name == 'write_off_principal' || name == 'write_off_interest' || name == 'write_off_penalty') {
return 'csh_write_off_grid_nf';
}
if (name == 'write_off_date' || name == 'journal_date') {
......@@ -125,28 +146,26 @@
var left_interest = record.get('left_interest');
var x_amount;
if (value) {
if (value <= left_interest) {
if (left_interest > 0) {
record.set('write_off_interest', value);
}else{
} else {
record.set('write_off_interest', null);
}
record.set('write_off_principal', null);
} else if (value > left_interest) {
if (left_interest > 0) {
record.set('write_off_interest', left_interest);
}else{
} else {
record.set('write_off_interest', null);
}
x_amount = value - left_interest;
if (left_principal > 0) {
record.set('write_off_principal', x_amount);
}else{
} else {
record.set('write_off_principal', null);
}
}
} else {
record.set('write_off_interest', null);
record.set('write_off_principal', null);
......@@ -248,8 +267,8 @@
return true;
} else {
if (record.get('write_off_type') == 'RECEIPT_CREDIT') {
if (value > record.get('left_amount')) {
return '分配金额不能大于剩余金额';
if (value != record.get('left_amount')) {
return '分配金额与剩余金额不等!';
}
}
}
......@@ -261,28 +280,30 @@
}
function csh531n_write_off() {
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
if (record) {
csh531d_lock_current_window();
var transaction_id = record.get('transaction_id');
Leaf.request({
url: $('csh531n_csh_confirm_data_link').getUrl(),
para: {
transaction_id: '${/parameter/@transaction_id}',
_status: 'update'
},
success: function () {
csh531d_unlock_current_window();
csh531n_detail_win_close();
}, failure: function () {
csh531d_unlock_current_window();
},
error: function () {
csh531d_unlock_current_window();
},
scope: this
});
if (checkAmount('WRITE_OFF')) {
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
if (record) {
csh531d_lock_current_window();
var transaction_id = record.get('transaction_id');
Leaf.request({
url: $('csh531n_csh_confirm_data_link').getUrl(),
para: {
transaction_id: '${/parameter/@transaction_id}',
_status: 'update'
},
success: function () {
csh531d_unlock_current_window();
csh531n_detail_win_close();
}, failure: function () {
csh531d_unlock_current_window();
},
error: function () {
csh531d_unlock_current_window();
},
scope: this
});
}
}
}
......@@ -296,12 +317,9 @@
total = plus(total, records[i].get('write_off_amount'))
}
if (total > unwrite_off_amount) {
Leaf.showMessage('${l:PROMPT}', '分配金额不能超过剩余可核销金额!');
Leaf.showMessage('${l:PROMPT}', '核销金额不能大于可核销金额!');
return false;
}
return true;
}
......@@ -326,7 +344,7 @@
function write_off_date_validator(record, name, value) {
if (name == 'write_off_date') {
if (value) {
var head_record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord()
var head_record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
var start_date = Leaf.formatDate(value);
var end_date = Leaf.formatDate(new Date());//Leaf.formatDate(head_record.get('transaction_date'));
......@@ -347,11 +365,11 @@
// record = ds.getCurrentRecord();
// var header_id = record.get('transaction_id');
var header_id = '${/parameter/@transaction_id}';
var url = $('transaction_uploadFile_id').getUrl() + '?table_name=CSH_TRANSACTION&header_id=' + header_id;
var url = $('transaction_downFile_id').getUrl() + '?table_name=CSH_TRANSACTION&header_id=' + header_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'transaction_uploadFile_winid',
id: 'transaction_downFile_winid',
width: 850,
height: 400
});
......@@ -366,11 +384,58 @@
}
}
function attachment_rendered() {
return '<a href="javascript:attachment_upload()"><span style="color:red;">附件上传</span></a>';
}
function csh531_add_fun(ds, record, index) {
record.getField('contract_number').setRequired(true);
record.getField('write_off_times').setReadOnly(false);
record.getField('write_off_times').setRequired(true);
}
function csh511_save_all() {
if (checkAmount()) {
$('csh_write_off_interface_ds').submit();
$('csh_transaction_deposit_ds').submit();
$('csh_transaction_advanced_ds').submit();
}
}
function checkAmount(type) {
var sum = 0;
var write_off_recs = $('csh_write_off_interface_ds').getAll();
for (var i = 0; i < write_off_recs.length; i++) {
var t = parseFloat(write_off_recs[i].get('write_off_amount'));
if (!isNaN(t)) {
sum += t;
}
}
var deposit_recs = $('csh_transaction_deposit_ds').getAll();
for (var i = 0; i < deposit_recs.length; i++) {
var t = parseFloat(deposit_recs[i].get('write_off_amount'));
if (!isNaN(t)) {
sum += t;
}
}
var advanced_recs = $('csh_transaction_advanced_ds').getAll();
for (var i = 0; i < advanced_recs.length; i++) {
var t = parseFloat(advanced_recs[i].get('write_off_amount'));
if (!isNaN(t)) {
sum += t;
}
}
var header_rec = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
if (sum > header_rec.get('transaction_amount')) {
Leaf.showInfoMessage('提示', '核销总金额不能大于可核销金额');
return false;
}
if (type == 'WRITE_OFF') {
if (sum != header_rec.get('transaction_amount')) {
Leaf.showInfoMessage('提示', '核销总金额不等于可核销金额');
return false;
}
}
return true;
}
]]></script>
......@@ -384,6 +449,7 @@
<a:fields>
<!-- <a:field name="write_off_date" defaultValue="${/model/sys_default_value/record/@now_time}" required="true"/> -->
<a:field name="write_off_date" readOnly="true"/>
<a:field name="paid_byother_flag_n" readOnly="true"/>
<a:field name="ref_contract_num" readOnly="true"/>
<a:field name="bank_slip_num" readOnly="true"/>
<a:field name="bp_code" readOnly="true"/>
......@@ -398,35 +464,44 @@
<a:field name="unwrite_off_amount" readOnly="true"/>
<a:field name="csh_bp_name" readOnly="true"/>
<a:field name="bank_account_name" readOnly="true"/>
<a:fidld name="transaction_date" readOnly="true"/>
<a:field name="transaction_date" readOnly="true"/>
<a:field name="bp_bank_account_name" readOnly="true"/>
<a:field name="bp_bank_account_num" readOnly="true"/>
<a:field name="write_off_flag_desc" readOnly="true"/>
<a:field name="review_status_desc" readOnly="true"/>
<a:field name="bank_account_num" readOnly="true"/>
<a:field name="collection_classes_desc" readOnly="true" options="ds_collection_classes_ds" displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<a:field name="collection_classes_desc" readOnly="true" options="ds_collection_classes_ds"
displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
<a:field name="ref_v01"/>
<a:field name="approving_return_amount" readOnly="true"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_write_off_interface_ds" autoQuery="true" fetchAll="true" model="csh.CSH531N.csh_write_off_interface" queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off_interface/query?trx_interface_id=${/parameter/@transaction_id}" selectable="true">
<a:dataSet id="csh_write_off_interface_ds" autoQuery="true" fetchAll="true"
model="csh.CSH531N.csh_write_off_interface"
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off_interface/query?trx_interface_id=${/parameter/@transaction_id}"
selectable="true">
<a:fields>
<a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
<a:field name="write_off_date" validator="write_off_date_validator" required="true" defaultValue="${/parameter/@transaction_date}"/>
<a:field name="journal_date" required="true" defaultValue="${/model/sys_default_time/record/@now_date}"/>
<a:field name="write_off_date" validator="write_off_date_validator" required="true"
defaultValue="${/parameter/@transaction_date}"/>
<a:field name="journal_date" required="true"
defaultValue="${/model/sys_default_time/record/@now_date}"/>
<a:field name="write_off_period_name" defaultValue="${/parameter/@period_name}"/>
<a:field name="write_off_period_num" defaultValue="${/parameter/@internal_period_num}"/>
<a:field name="check_flag" defaultValue="Y"/>
<a:field name="record_type" defaultValue="MANUAL"/>
<a:field name="write_off_times"/>
<a:field name="write_off_amount" required="true" validator="csh531_wf_amount_validate"/>
<a:field name="write_off_times" readOnly="true"/>
<a:field name="write_off_amount" required="true"/>
<a:field name="due_date"/>
<a:field name="unreceived_amount"/>
<a:field name="write_off_cashflow_id"/>
<a:field name="contract_id"/>
<a:field name="trx_interface_id" defaultValue="${/parameter/@transaction_id}"/>
<a:field name="contract_number" prompt="合同编号" autoComplete="true" lovAutoQuery="true" lovGridHeight="300" lovHeight="480" lovService="csh.CSH531N.csh_con_contract_lov" lovWidth="800" title="合同号选择">
<a:field name="contract_number" prompt="合同编号" autoComplete="true" lovAutoQuery="true"
lovHeight="880"
lovUrl="${/request/@context_path}/modules/csh/CSH531N/csh_write_off_ref_contract.lview"
lovWidth="1350" title="合同号选择">
<a:mapping>
<a:map from="contract_number" to="contract_number"/>
<a:map from="contract_name" to="contract_name"/>
......@@ -436,38 +511,19 @@
<a:map from="contract_status_desc" to="contract_status_desc"/>
</a:mapping>
</a:field>
<a:field name="write_off_times" prompt="期数" lovHeight="780" lovUrl="${/request/@context_path}/modules/csh/CSH531N/csh_write_off_ref_contract.lview" lovWidth="900" title="合同选择">
<a:mapping>
<!--<a:map from="contract_id" to="contract_id"/>-->
<!--<a:map from="contract_number" to="contract_number"/>-->
<!--<a:map from="contract_name" to="contract_name"/>-->
<a:map from="times" to="write_off_times"/>
<a:map from="cf_item" to="write_off_cf_item"/>
<a:map from="cf_item_desc" to="write_off_cf_item_desc"/>
<a:map from="left_amount" to="write_off_amount"/>
<a:map from="due_date" to="due_date"/>
<!-- <a:map from="unreceived_amount" to="unreceived_amount"/> -->
<a:map from="cashflow_id" to="write_off_cashflow_id"/>
<a:map from="left_principal" to="write_off_principal"/>
<a:map from="left_interest" to="write_off_interest"/>
<a:map from="left_amount" to="left_amount"/>
<a:map from="left_principal" to="left_principal"/>
<a:map from="left_interest" to="left_interest"/>
</a:mapping>
</a:field>
<a:field name="batch_id" defaultValue="${/parameter/@batch_id}"/>
<a:field name="write_off_type" defaultValue="RECEIPT_CREDIT"/>
<a:field name="write_off_type_desc" defaultValue="收款核销债权" prompt="核销类型" required="true" displayField="code_value_name" options="write_off_type_ds" returnField="write_off_type" valueField="code_value"/>
<a:field name="write_off_type_desc" defaultValue="收款核销债权" prompt="核销类型" required="true"
displayField="code_value_name" options="write_off_type_ds" returnField="write_off_type"
valueField="code_value"/>
<a:field name="write_off_bp_id"/>
<!--<a:field name="write_off_bp_name" autoComplete="true" autoCompleteField="true" lovAutoQuery="true" lovGridHeight="300" lovHeight="450" lovService="csh.CSH531N.hls_bp_master" lovWidth="500" title="分配对象选择">-->
<!--<a:mapping>-->
<!--<a:map from="bp_id" to="write_off_bp_id"/>-->
<!--<a:map from="bp_name" to="write_off_bp_name"/>-->
<!--</a:mapping>-->
<!--</a:field>-->
<a:field name="write_off_classification_desc" prompt="核销分类" required="true" options="ds_csh_write_off_classification_ds" returnField="write_off_classification" valueField="code_value" displayField="code_value_name"/>
<a:field name="write_off_classification_desc" prompt="核销分类"
options="ds_csh_write_off_classification_ds" returnField="write_off_classification"
valueField="code_value" displayField="code_value_name"/>
<a:field name="write_off_cf_item" readOnly="true"/>
<a:field name="write_off_cf_item_desc" displayField="cf_item_desc" options="write_off_cf_item_ds" returnField="write_off_cf_item" valueField="cf_item"/>
<a:field name="write_off_cf_item_desc" readOnly="true" displayField="cf_item_desc"
options="write_off_cf_item_ds"
returnField="write_off_cf_item" valueField="cf_item"/>
</a:fields>
<a:events>
<a:event name="update" handler="csh531_update_fun"/>
......@@ -477,82 +533,257 @@
<a:event name="add" handler="csh531_add_fun"/>
</a:events>
</a:dataSet>
<a:dataSet id="csh_transaction_deposit_ds" model="csh.CSH531N.csh_transaction_plan_query" fetchAll="true"
autoQuery="true"
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_transaction_plan_query/query?transaction_id=${/parameter/@transaction_id}&amp;write_off_type=RECEIPT_DEPOSIT_POOL"
selectable="true">
<a:fields>
<a:field name="bp_agent_name" lovGridHeight="350" lovHeight="550" lovLabelWidth="50" lovWidth="550"
required="true" readOnly="true" autoComplete="true" autoCompleteField="bp_agent_name"
lovService="basic.hls_bp_master_v_for_lov?bp_category=AGENT&amp;bp_id=${/parameter/@bp_id}"
title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_name" to="bp_agent_name"/>
</a:mapping>
</a:field>
<a:field name="bp_id" defaultValue="${/parameter/@bp_id}"/>
<a:field name="transaction_id" defaultValue="${/parameter/@transaction_id}"/>
<a:field name="write_off_type" defaultValue="RECEIPT_DEPOSIT_POOL"/>
<a:field name="company_id" defaultValue="${/session/@company_id}"/>
<a:field name="write_off_amount" required="true"/>
<a:field name="write_off_date" validator="write_off_date_validator" required="true" readOnly="true"
defaultValue="${/parameter/@transaction_date}"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_transaction_advanced_ds" model="csh.CSH531N.csh_transaction_plan_query" fetchAll="true"
autoQuery="true"
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_transaction_plan_query/query?transaction_id=${/parameter/@transaction_id}&amp;write_off_type=RECEIPT_ADVANCE_RECEIPT"
selectable="true">
<a:fields>
<a:field name="bp_name" readOnly="true" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="50"
lovWidth="550"
required="true"
lovService="basic.hls_bp_master_v_for_lov?bp_id=${/parameter/@bp_id}" 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="bp_id" defaultValue="${/parameter/@bp_id}"/>
<a:field name="transaction_id" defaultValue="${/parameter/@transaction_id}"/>
<a:field name="write_off_type" defaultValue="RECEIPT_ADVANCE_RECEIPT"/>
<a:field name="company_id" defaultValue="${/session/@company_id}"/>
<a:field name="write_off_amount" required="true"/>
<a:field name="write_off_date" validator="write_off_date_validator" required="true" readOnly="true"
defaultValue="${/parameter/@transaction_date}"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton id="csh511_receipt_upload_id" click="attachment_upload" text="附件上传"/>
<a:gridButton id="csh511_save_all_id" click="csh511_save_all" style="margin-left:20px;display:none"
text="暂存"/>
<a:gridButton id="csh531n_write_off_btn_id" click="csh531n_write_off"
style="margin-left:10px;display:none" text="核销"/>
</a:screenTopToolbar>
<a:form title="CSH513.RECEIPT_WRITE_OFF" marginWidth="350">
<a:box column="4" labelWidth="100">
<a:textField name="transaction_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="bank_account_name" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="银行流水号"/>
<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
</a:box>
<a:box column="4" labelWidth="100">
<a:numberField name="transaction_amount" allowFormat="true" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:numberField name="returned_amount" allowFormat="true" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="HLS.RETURNED_AMOUNT"/>
<a:numberField name="write_off_amount" allowFormat="true" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="HLS.WRITEOFF_AMOUNT"/>
<a:numberField name="unwrite_off_amount" allowFormat="true" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="CSH513.REMAINING_WRITEOFF_AMOUNT"/>
</a:box>
<a:box column="4" labelWidth="100">
<a:datePicker name="transaction_date" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="bp_bank_account_name" prompt="对方账户" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="bp_bank_account_num" prompt="对方账号" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="write_off_flag_desc" prompt="核销状态" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
</a:box>
<a:box column="4" labelWidth="100">
<a:textField name="review_status_desc" prompt="分配状态" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="purpose" prompt="用途" readOnly="true" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="description" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="摘要" readOnly="true"/>
<a:numberField name="approving_return_amount" allowFormat="true" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="审批中退款金额"/>
</a:box>
<a:box column="4" labelWidth="100">
<a:comboBox name="collection_classes_desc" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="款项分类"/>
<a:textArea colspan="2" name="ref_v05" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="备注" width="370"/>
<a:gridButton click="csh531n_save" text="HLS.SAVE"/>
</a:box>
<!--<a:box column="2" labelWidth="100">-->
<!--<a:textArea name="description" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="摘要" readOnly="true" width="405"/>-->
<!--</a:box>-->
<a:form style="margin-left:20px;">
<a:fieldSet labelWidth="250" title="收款单详情">
<a:box column="3" labelWidth="100">
<a:datePicker name="transaction_date" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:numberField name="transaction_amount" allowFormat="true"
bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<!-- <a:textField name="transaction_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
<!-- <a:textField name="bank_account_name" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"
prompt="银行流水号"/>
<!-- <a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
</a:box>
<a:box column="3" labelWidth="100">
<a:textField name="paid_byother_flag_n" prompt="代付"
bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="bp_name" prompt="商业伙伴"
bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="collection_classes_desc" prompt="款项用途"
bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<!-- <a:numberField name="returned_amount" allowFormat="true"-->
<!-- bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
<!-- prompt="HLS.RETURNED_AMOUNT"/>-->
<!-- <a:numberField name="write_off_amount" allowFormat="true"-->
<!-- bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
<!-- prompt="HLS.WRITEOFF_AMOUNT"/>-->
<!-- <a:numberField name="unwrite_off_amount" allowFormat="true"-->
<!-- bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
<!-- prompt="CSH513.REMAINING_WRITEOFF_AMOUNT"/>-->
</a:box>
<a:box column="2" labelWidth="100">
<a:textField name="description" bindTarget="csh_transaction_receipt_write_off_detail_ds"
prompt="摘要"
readOnly="true" colspan="2" width="370"/>
</a:box>
<a:box column="2" labelWidth="100">
<a:textField colspan="2" name="ref_v05" bindTarget="csh_transaction_receipt_write_off_detail_ds"
prompt="备注" width="370" readOnly="true"/>
</a:box>
<a:box column="2" labelWidth="100">
<a:label prompt="附件上传" bindTarget="csh_transaction_receipt_write_off_detail_ds"
renderer="attachment_rendered"/>
</a:box>
<!-- <a:box column="4" labelWidth="100">-->
<!-- <a:textField name="review_status_desc" prompt="分配状态"-->
<!-- bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
<!-- <a:textField name="purpose" prompt="用途" readOnly="true"-->
<!-- bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
<!-- <a:numberField name="approving_return_amount" allowFormat="true"-->
<!-- bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="审批中退款金额"/>-->
<!-- </a:box>-->
<!-- <a:box column="4" labelWidth="100">-->
<!-- <a:comboBox name="collection_classes_desc"-->
<!-- bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
<!-- prompt="款项分类"/>-->
<!-- <a:gridButton click="csh531n_save" text="HLS.SAVE"/>-->
<!-- </a:box>-->
<!--<a:box column="2" labelWidth="100">-->
<!--<a:textArea name="description" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="摘要" readOnly="true" width="405"/>-->
<!--</a:box>-->
</a:fieldSet>
<a:fieldSet labelWidth="250" title="账户信息">
<a:box column="2" labelWidth="100">
<a:textField name="bp_bank_account_name" prompt="对方账户"
bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="bp_bank_account_num" prompt="对方账号"
bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
<a:textField name="write_off_flag_desc" prompt="核销状态"
bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
</a:box>
</a:fieldSet>
</a:form>
<a:grid id="csh_write_off_grid" bindTarget="csh_write_off_interface_ds" height="370"
marginWidth="50">
<a:toolBar>
<a:button id="csh_grid_add_bt" type="add"/>
<a:button id="csh_grid_delete_bt" type="delete"/>
<a:button id="csh_grid_save_bt" type="save"/>
<a:button click="csh531n_write_off" text="审阅"/>
</a:toolBar>
<a:columns>
<!--<a:column name="csh_bank_slip_num" footerRenderer="summaryRenderer" prompt="CSH531.BANK_SLIP_NUM" width="120"/>-->
<a:column name="write_off_type_desc" editorFunction="csh_edit_function" prompt="HLS.WRITE_OFF_TYPE" width="100"/>
<a:column name="contract_number" editorFunction="csh_edit_function" prompt="HLS.CONTRACT_NUMBER" width="120"/>
<a:column name="contract_status_desc" editorFunction="csh_edit_function" prompt="合同状态" width="120"/>
<a:column name="write_off_bp_name" editorFunction="csh_edit_function" prompt="CSH531.WRITE_OFF_BP_NAME" width="100"/>
<a:column name="write_off_times" editorFunction="csh_edit_function" prompt="HLS.TIMES" width="80"/>
<a:column name="write_off_cf_item_desc" editorFunction="csh_edit_function" prompt="CSH531.CF_ITEM" width="80"/>
<a:column name="due_date" editorFunction="csh_edit_function" prompt="CSH531.WRITE_OFF_DATE" renderer="Leaf.formatDate" width="80"/>
<a:column name="left_amount" align="right" footerRenderer="summaryRenderer" prompt="剩余金额" renderer="Leaf.formatMoney" width="120"/>
<!--<a:column name="left_principal" align="right" footerRenderer="summaryRenderer" prompt="剩余本金" renderer="Leaf.formatMoney" width="120"/>-->
<!--<a:column name="left_interest" align="right" footerRenderer="summaryRenderer" prompt="剩余利息" renderer="Leaf.formatMoney" width="120"/>-->
<a:column name="write_off_classification_desc" editorFunction="csh_edit_function" prompt="核销分类"/>
<a:column name="write_off_date" align="center" editorFunction="csh_edit_function" renderer="Leaf.formatDate" prompt="核销基准日期" width="120"/>
<a:column name="journal_date" align="center" editorFunction="csh_edit_function" renderer="Leaf.formatDate" prompt="凭证日期" width="120"/>
<a:column name="write_off_amount" align="right" editorFunction="csh_edit_function" footerRenderer="summaryRenderer" prompt="CSH531.AMOUNT" renderer="Leaf.formatMoney" width="120"/>
<a:column name="write_off_principal" align="right" prompt="分配本金" renderer="Leaf.formatMoney" width="120"/>
<a:column name="write_off_interest" align="right" prompt="分配利息" renderer="Leaf.formatMoney" width="120"/>
<!--<a:column name="agent_id_desc" editorFunction="csh_edit_function" prompt="代理商"/>-->
</a:columns>
<a:editors>
<a:textField id="csh_write_off_grid_tf"/>
<a:numberField id="csh_write_off_grid_nf" allowNegative="false"/>
<a:datePicker id="csh_write_off_grid_dp"/>
<a:comboBox id="csh_write_off_grid_cb"/>
<a:lov id="csh_write_off_grid_lv"/>
</a:editors>
</a:grid>
<a:tabPanel height="450" marginWidth="30" style="margin-left:20px;">
<a:tabs>
<a:tab prompt="核销债权" width="120" id="write_off_rental">
<a:grid id="csh_write_off_grid" bindTarget="csh_write_off_interface_ds" height="370"
marginWidth="10" navBar="true">
<a:toolBar>
<a:button id="csh_grid_add_bt" type="add"/>
<a:button id="csh_grid_delete_bt" type="delete"/>
</a:toolBar>
<a:columns>
<!--<a:column name="csh_bank_slip_num" footerRenderer="summaryRenderer" prompt="CSH531.BANK_SLIP_NUM" width="120"/>-->
<!-- <a:column name="write_off_type_desc" editorFunction="csh_edit_function"-->
<!-- prompt="HLS.WRITE_OFF_TYPE"-->
<!-- width="100"/>-->
<a:column name="contract_number" editorFunction="csh_edit_function" align="center"
prompt="HLS.CONTRACT_NUMBER"
width="120"/>
<a:column name="bp_tenant_name" prompt="承租人" width="120"/>
<a:column name="write_off_cf_item_desc" editorFunction="csh_edit_function"
align="center"
prompt="CSH531.CF_ITEM"
width="80"/>
<a:column name="write_off_times" prompt="HLS.TIMES" align="center"
width="80"/>
<a:column prompt="营业">
<a:column name="left_principal" renderer="Leaf.formatMoney" prompt="未收本金"
width="120" align="right"/>
<a:column name="left_interest" renderer="Leaf.formatMoney" prompt="未收利息"
width="120"
align="right"/>
<a:column name="left_amount" renderer="Leaf.formatMoney" prompt="未收租金"
width="120"
align="right"/>
</a:column>
<!-- <a:column name="write_off_bp_name" editorFunction="csh_edit_function"-->
<!-- prompt="CSH531.WRITE_OFF_BP_NAME" width="100"/>-->
<!-- <a:column name="left_amount" align="right" footerRenderer="summaryRenderer"-->
<!-- prompt="剩余金额"-->
<!-- renderer="Leaf.formatMoney" width="120"/>-->
<!--<a:column name="left_principal" align="right" footerRenderer="summaryRenderer" prompt="剩余本金" renderer="Leaf.formatMoney" width="120"/>-->
<!--<a:column name="left_interest" align="right" footerRenderer="summaryRenderer" prompt="剩余利息" renderer="Leaf.formatMoney" width="120"/>-->
<!-- <a:column name="write_off_classification_desc" editorFunction="csh_edit_function"-->
<!-- prompt="核销分类"/>-->
<!-- <a:column name="write_off_date" align="center" editorFunction="csh_edit_function"-->
<!-- renderer="Leaf.formatDate" prompt="核销基准日期" width="120"/>-->
<!-- <a:column name="journal_date" align="center" editorFunction="csh_edit_function"-->
<!-- renderer="Leaf.formatDate" prompt="凭证日期" width="120"/>-->
<a:column name="unreceived_amount" align="right" editorFunction="csh_edit_function"
footerRenderer="summaryRenderer" prompt="未收金额"
renderer="Leaf.formatMoney"
width="120"/>
<a:column name="write_off_amount" align="right" editorFunction="csh_edit_function"
footerRenderer="summaryRenderer" prompt="核销金额"
renderer="Leaf.formatMoney"
width="120"/>
<a:column name="write_off_date"
prompt="核销日期"
renderer="Leaf.formatDate" width="80"/>
<!--<a:column name="agent_id_desc" editorFunction="csh_edit_function" prompt="代理商"/>-->
</a:columns>
<a:editors>
<a:textField id="csh_write_off_grid_tf"/>
<a:numberField id="csh_write_off_grid_nf" allowNegative="false"/>
<a:datePicker id="csh_write_off_grid_dp"/>
<a:comboBox id="csh_write_off_grid_cb"/>
<a:lov id="csh_write_off_grid_lv"/>
</a:editors>
</a:grid>
</a:tab>
<a:tab id="write_off_deposit" tabStyle="display:none" prompt="核销为租金保证金" width="150">
<a:grid id="csh_transaction_deposit_grid" navBar="true"
bindTarget="csh_transaction_deposit_ds"
height="370"
marginWidth="10">
<!-- <a:toolBar>-->
<!-- <a:button id="csh_grid_deposit_add_bt" type="add"/>-->
<!-- <a:button id="csh_grid_deposit_delete_bt" type="delete"/>-->
<!-- </a:toolBar>-->
<a:columns>
<a:column name="bp_agent_name" prompt="代理店" width="180" align="center"
editor="csh_transaction_deposit_grid_lv"/>
<a:column name="write_off_amount" prompt="核销金额" renderer="Leaf.formatMoney"
width="180"
align="right" editor="csh_transaction_deposit_grid_nf"
footerRenderer="summaryRenderer"/>
<a:column name="write_off_date" prompt="核销日期" width="180" align="center"
renderer="Leaf.formatDate" editor="csh_transaction_deposit_grid_dp"/>
</a:columns>
<a:editors>
<a:lov id="csh_transaction_deposit_grid_lv"/>
<a:numberField id="csh_transaction_deposit_grid_nf" allowNegative="false"/>
<a:datePicker id="csh_transaction_deposit_grid_dp"/>
</a:editors>
</a:grid>
</a:tab>
<a:tab id="write_off_advance" prompt="核销为预收款" width="150" >
<a:grid id="csh_transaction_advanced_grid" navBar="true"
bindTarget="csh_transaction_advanced_ds" height="370"
marginWidth="10">
<!-- <a:toolBar>-->
<!-- <a:button id="csh_grid_advanced_add_bt" type="add"/>-->
<!-- <a:button id="csh_grid_advanced_delete_bt" type="delete"/>-->
<!-- </a:toolBar>-->
<a:columns>
<a:column name="bp_name" prompt="商业伙伴" width="180" align="center"
editor="csh_transaction_advanced_grid_lv"/>
<a:column name="write_off_amount" prompt="核销金额" renderer="Leaf.formatMoney"
width="180"
align="right" editor="csh_transaction_advanced_grid_nf"
footerRenderer="summaryRenderer"/>
<a:column name="write_off_date" prompt="核销日期" width="180" align="center"
renderer="Leaf.formatDate" editor="csh_transaction_advanced_grid_dp"/>
</a:columns>
<a:editors>
<a:lov id="csh_transaction_advanced_grid_lv"/>
<a:numberField id="csh_transaction_advanced_grid_nf" allowNegative="false"/>
<a:datePicker id="csh_transaction_advanced_grid_dp"/>
</a:editors>
</a:grid>
</a:tab>
</a:tabs>
</a:tabPanel>
</a:screenBody>
<script type="text/javascript"><![CDATA[
Leaf.onReady(init);
......
......@@ -2,88 +2,163 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:view>
<script type="text/javascript"><![CDATA[
function csh_write_off_query(){
$('csh_write_off_lov_ds').query();
}
function csh_write_off_reset(){
$('csh_lov_query_ds').reset();
}
function griddbclick(grid, record, row, name) {
$('${/parameter/@lovid}').commit(record);
function csh_write_off_query() {
$('csh_lov_con_contract_ds').query();
$('csh_write_off_lov_ds').query();
}
function csh_write_off_reset() {
$('csh_query_con_ds').reset();
$('csh_query_cf_ds').reset();
}
function griddbclick(grid, record, row, name) {
$('${/parameter/@lovid}').commit(record);
}
function csh_write_off_confirmed() {
var ds = $('csh_write_off_interface_ds');
var con_rec = $('csh_lov_con_contract_ds').getCurrentRecord();
var cf_recs = $('csh_write_off_lov_ds').getSelected();
if (cf_recs.length == 0) {
Leaf.showInfoMessage("提示", "请选择要核销的现金流!");
return;
}
function setBankAccount(){
//
var record = $('csh_lov_query_ds').getAll();
var bp_id = "${/parameter/@csh_bp_id}";
var dd_bank_account_num = "${/parameter/@csh_bp_bank_account_num}";
if((bp_id != 'undefined') && (bp_id != '')){
record[0].set('bp_id',bp_id);
}
if((dd_bank_account_num != 'undefined') && (dd_bank_account_num != '')){
record[0].set('dd_bank_account_num',dd_bank_account_num);
}
}
]]></script>
var rec = ds.getCurrentRecord();
rec.set('contract_id', con_rec.get('contract_id'));
rec.set('contract_number', con_rec.get('contract_number'));
rec.set('bp_tenant_name', con_rec.get('bp_name'));
rec.set('write_off_bp_name', con_rec.get('bp_name'));
rec.set('write_off_bp_id', con_rec.get('bp_id_tenant'));
rec.set('bp_id_tenant', con_rec.get('bp_id_tenant'));
rec.set('write_off_cf_item_desc', cf_recs[0].get('cf_item_desc'));
rec.set('write_off_cashflow_id', cf_recs[0].get('cashflow_id'));
rec.set('write_off_cf_item', cf_recs[0].get('cf_item'));
rec.set('write_off_times', cf_recs[0].get('times'));
rec.set('left_principal', cf_recs[0].get('unreceived_principal'));
rec.set('left_interest', cf_recs[0].get('unreceived_interest'));
rec.set('left_amount', cf_recs[0].get('unreceived_rental'));
rec.set('write_off_principal', cf_recs[0].get('unreceived_principal'));
rec.set('write_off_interest', cf_recs[0].get('unreceived_interest'));
rec.set('unreceived_amount', cf_recs[0].get('unreceived_amount'));
rec.set('write_off_amount',cf_recs[0].get('unreceived_amount'));
for (var i = 1; i < cf_recs.length; i++) {
//copy...
debugger;
var newRecord = new Leaf.Record({...rec.data});
newRecord.ds = rec.ds;
newRecord.set('write_off_cf_item_desc', cf_recs[i].get('cf_item_desc'));
newRecord.set('write_off_cf_item', cf_recs[i].get('cf_item'));
newRecord.set('write_off_times', cf_recs[i].get('times'));
newRecord.set('write_off_cashflow_id',cf_recs[i].get('cashflow_id'));
newRecord.set('unreceived_amount', cf_recs[i].get('unreceived_amount'));
newRecord.set('left_principal', cf_recs[i].get('unreceived_principal'));
newRecord.set('left_interest', cf_recs[i].get('unreceived_interest'));
newRecord.set('left_amount', cf_recs[i].get('unreceived_rental'));
newRecord.set('write_off_principal', cf_recs[i].get('unreceived_principal'));
newRecord.set('write_off_interest', cf_recs[i].get('unreceived_interest'));
newRecord.set('write_off_amount',cf_recs[i].get('unreceived_amount'));
ds.add(newRecord);
}
$('${/parameter/@lovid}').win.close();
}
function setBankAccount() {
var record = $('csh_lov_query_ds').getAll();
var bp_id = "${/parameter/@csh_bp_id}";
var dd_bank_account_num = "${/parameter/@csh_bp_bank_account_num}";
if ((bp_id != 'undefined') && (bp_id != '')) {
record[0].set('bp_id', bp_id);
}
if ((dd_bank_account_num != 'undefined') && (dd_bank_account_num != '')) {
record[0].set('dd_bank_account_num', dd_bank_account_num);
}
}
]]></script>
<a:dataSets>
<a:dataSet id="csh_lov_cf_item_ds" autoQuery="true" model="csh.CSH531N.hls_cashflow_item_v"/>
<a:dataSet id="csh_lov_query_ds" autoCreate="true">
<a:dataSet id="csh_query_con_ds" autoCreate="true">
<a:fields>
<a:field name="dd_bank_account_num"/>
<a:field name="dd_bank_account_name"/>
<a:field name="bp_id"/>
<a:field name="contract_id" defaultValue="${/parameter/@contract_id}"/>
<!--<a:field name="contract_number" autoComplete="true" lovAutoQuery="true" lovGridHeight="300" lovHeight="450" lovService="csh.CSH531N.csh_con_contract_lov" lovWidth="450" title="合同号选择">-->
<!--<a:mapping>-->
<!--<a:map from="contract_number" to="contract_number"/>-->
<!--<a:map from="contract_name" to="contract_name"/>-->
<!--</a:mapping>-->
<!--</a:field>-->
<a:field name="cf_item"/>
<a:field name="cf_item_desc" displayField="cf_item_desc" options="csh_lov_cf_item_ds" returnField="cf_item" valueField="cf_item"/>
<a:field name="contract_number"/>
<a:field name="bp_name"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_query_cf_ds" autoCreate="true">
<a:fields>
<a:field name="cf_item_desc" displayField="cf_item_desc" options="csh_lov_cf_item_ds"
returnField="cf_item" valueField="cf_item"/>
<a:field name="due_date_from"/>
<a:field name="due_date_to"/>
</a:fields>
</a:dataSet>
<a:dataSet id="csh_write_off_lov_ds" fetchAll="true" autoQuery="true" model="csh.CSH531N.con_contract" queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.con_contract/query?contract_id=${/parameter/@contract_id}" queryDataSet="csh_lov_query_ds">
<a:dataSet id="csh_lov_con_contract_ds" selectable="true" autoQuery="true" selectionModel="single"
model="csh.CSH531N.con_contract" queryDataSet="csh_query_con_ds"/>
<a:dataSet id="csh_write_off_lov_ds" fetchAll="true" bindTarget="csh_lov_con_contract_ds"
bindName="csh_con_cf" selectable="true" selectionModel="multiple"
model="csh.CSH531N.csh_con_contract_cashflow" queryDataSet="csh_query_cf_ds"
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_con_contract_cashflow/query">
<a:fields>
<a:field name="contract_id"/>
<a:field name="cashflow_id"/>
<a:field name="cf_item"/>
<a:field name="cf_item_desc" displayField="cf_item_desc" options="csh_lov_cf_item_ds" returnField="cf_item" valueField="cf_item"/>
<a:field name="cf_item_desc"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton click="csh_write_off_confirmed" text="确认"/>
<a:gridButton click="csh_write_off_query" text="HLS.QUERY"/>
<a:gridButton click="csh_write_off_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form column="3" width="800" title="HLS.QUERY_TITLE">
<!--<a:lov name="contract_number" bindTarget="csh_lov_query_ds" prompt="HLS.CONTRACT_NUMBER"/>-->
<a:datePicker name="due_date_from" bindTarget="csh_lov_query_ds" prompt="CSH531.DATE_FROM"/>
<a:datePicker name="due_date_to" bindTarget="csh_lov_query_ds" prompt="CSH531.DATE_TO"/>
<a:comboBox name="cf_item_desc" bindTarget="csh_lov_query_ds" prompt="CSH531.CF_ITEM"/>
<a:numberField name="due_amount_from" bindTarget="csh_lov_query_ds" prompt="CSH531.AMOUNT_FROM"/>
<a:numberField name="due_amount_to" bindTarget="csh_lov_query_ds" prompt="CSH531.AMOUNT_TO"/>
<a:form column="5" labelWidth="180" width="1100" title="HLS.QUERY_TITLE">
<a:textField name="contract_number" bindTarget="csh_query_con_ds" prompt="HLS.CONTRACT_NUMBER"/>
<a:textField name="bp_name" bindTarget="csh_query_con_ds" prompt="客户名"/>
<a:datePicker name="due_date_from" bindTarget="csh_query_cf_ds" prompt="CSH531.DATE_FROM"/>
<a:datePicker name="due_date_to" bindTarget="csh_query_cf_ds" prompt="CSH531.DATE_TO"/>
<a:comboBox name="cf_item_desc" bindTarget="csh_query_cf_ds" prompt="CSH531.CF_ITEM"/>
</a:form>
<a:grid bindTarget="csh_write_off_lov_ds" marginHeight="300" width="800" navBar="true">
<a:columns>
<a:column name="contract_number" prompt="HLS.CONTRACT_NUMBER" width="120"/>
<a:column name="contract_name" prompt="CSH531.CONTRACT_NAME" width="150"/>
<a:column name="times" prompt="HLS.TIMES" width="60"/>
<a:column name="cf_item_desc" prompt="HLS.CF_ITEM_DESC" width="80"/>
<a:column name="due_amount" align="right" prompt="CSH531.AMOUNT" width="100"/>
<a:column name="unreceived_amount" align="right" prompt="CSH531.UNRECEIVED_TOTAL_AMOUNT" width="100"/>
<a:column name="due_date" prompt="CSH531.WRITE_OFF_DATE" renderer="Leaf.formatDate" width="80"/>
</a:columns>
<a:events>
<a:event name="dblclick" handler="griddbclick"/>
</a:events>
</a:grid>
<a:hBox>
<a:vBox>
<a:grid bindTarget="csh_lov_con_contract_ds" width="450" id="csh_con_contract_ds" marginHeight="300"
navBar="true">
<a:columns>
<a:column name="contract_number" align="center" prompt="HLS.CONTRACT_NUMBER" width="120"/>
<a:column name="contract_status_desc" prompt="合同状态" align="center" width="100"/>
<a:column name="bp_name" prompt="客户名" width="180"/>
</a:columns>
</a:grid>
</a:vBox>
<a:vBox>
<a:grid bindTarget="csh_write_off_lov_ds" marginHeight="300" id="csh_con_contract_cashflow_ds"
width="800" navBar="true">
<a:columns>
<a:column name="times" prompt="HLS.TIMES" align="center" width="60"/>
<a:column name="cf_item_desc" prompt="HLS.CF_ITEM_DESC" align="center" width="80"/>
<a:column name="due_date" prompt="还款日" renderer="Leaf.formatDate" width="80" align="center"/>
<a:column name="due_amount" align="right" prompt="应还金额" renderer="Leaf.formatMoney"
width="120"/>
<a:column prompt="营业">
<a:column name="unreceived_principal" prompt="未收本金" align="right"
renderer="Leaf.formatMoney" width="120"/>
<a:column name="unreceived_interest" prompt="未收利息" align="right"
renderer="Leaf.formatMoney" width="120"/>
<a:column name="unreceived_rental" prompt="未收租金" align="right"
renderer="Leaf.formatMoney" width="120"/>
</a:column>
</a:columns>
<!-- <a:events>-->
<!-- <a:event name="dblclick" handler="griddbclick"/>-->
<!-- </a:events>-->
</a:grid>
</a:vBox>
</a:hBox>
</a:screenBody>
<script type="text/javascript"><![CDATA[
Leaf.onReady(setBankAccount);
]]></script>
// Leaf.onReady(setBankAccount);
]]></script>
</a:view>
</a:screen>
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