<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="con_contract_change_req_cf" defaultOrderBy="times,cf_item">
    <bm:fields>
        <bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID" prompt="CON_CONTRACT_CASHFLOW.CASHFLOW_ID"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT_CASHFLOW.CONTRACT_ID"/>
        <bm:field name="cf_direction" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_DIRECTION" prompt="CON_CONTRACT_CASHFLOW.CF_DIRECTION"/>
        <bm:field name="cf_status" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select distinct u.CF_STATUS_N from CON_CONTRACT_CASHFLOW_LV u where u.CF_STATUS = t1.CF_STATUS)" physicalName="CF_STATUS" prompt="CON_CONTRACT_CASHFLOW.CF_STATUS"/>
        <bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES" prompt="CON_CONTRACT_CASHFLOW.TIMES"/>
        <bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalname="CF_ITEM" prompt="CON_CONTRACT_CASHFLOW.CF_ITEM"/>
        <bm:field name="cf_item_n" databasetype="VARCHAR2" datatype="java.lang.String" expression="(select distinct u.CF_ITEM_N from CON_CONTRACT_CASHFLOW_LV u where u.CF_ITEM = t1.CF_ITEM)" prompt="CON_CONTRACT_CASHFLOW.CF_ITEM"/>
        <bm:field name="calc_date_n" databasetype="VARCHAR2" datatype="java.lang.String" expression="(select to_char(t1.calc_date,&apos;yyyy-mm-dd&apos;) from dual)"/>
        <bm:field name="due_date_n" databasetype="VARCHAR2" datatype="java.lang.String" expression="(select to_char(t1.due_date,&apos;yyyy-mm-dd&apos;) from dual)"/>
        <bm:field name="calc_date" databaseType="DATE" datatype="java.util.Date" physicalName="CALC_DATE" prompt="CON_CONTRACT_CASHFLOW.CALC_DATE"/>
        <bm:field name="due_date" databaseType="DATE" datatype="java.util.Date" physicalName="DUE_DATE" prompt="CON_CONTRACT_CASHFLOW.DUE_DATE"/>
        <bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT" prompt="CON_CONTRACT_CASHFLOW.DUE_AMOUNT"/>
        <bm:field name="principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRINCIPAL" prompt="CON_CONTRACT_CASHFLOW.PRINCIPAL"/>
        <bm:field name="interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="INTEREST" prompt="CON_CONTRACT_CASHFLOW.INTEREST"/>
        <bm:field name="outstanding_prin_tax_incld" databaseType="NUMBER" datatype="java.lang.Double" physicalName="OUTSTANDING_PRIN_TAX_INCLD" prompt="CON_CONTRACT_CASHFLOW.OUTSTANDING_PRIN_TAX_INCLD"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="cashflow_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="contract_id" field="contract_id" queryOperator="="/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="change_req_id" expression="t1.change_req_id in (select change_req_id  from con_contract_change_req_flt t where t.contract_id = ${@contract_id}   and t.req_status = &apos;NEW&apos;)"/>
        <bm:data-filter name="cf_item" expression="t1.cf_item =1"/>
        <bm:data-filter name="cf_direction" expression="t1.cf_direction in (&apos;OUTFLOW&apos;,&apos;INFLOW&apos;)"/>
    </bm:data-filters>
</bm:model>
