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>
......
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