<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp
    $Date: 2014-11-23 下午05:06:15  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:s="leaf.plugin.script" xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        v.*,
                        (SELECT
                            DECODE(l.req_status, 'NEW', '新建', 'REJECT', '拒绝', 'APPROVING', '审批中', 'APPROVED', '审批通过','新建')
                        FROM
                            con_contract_change_req_flt l
                        WHERE
                            l.contract_id   = v.contract_id AND
                            l.change_req_id =
                            (SELECT
                                MAX(change_req_id)
                            FROM
                                con_contract_change_req_flt f
                            WHERE
                                f.contract_id = l.contract_id
                            )
                        ) req_status_desc
                    FROM
                        con_contract_v v
                    WHERE
                        v.company_id       =${/session/@company_id} AND
                        v.int_rate_type    = 'FLOATING' AND
                        v.contract_status IN ('INCEPT', 'SIGN') AND
                        v.contract_id     IN
                        (SELECT
                            t.contract_id
                        FROM
                            csh_write_off t
                        WHERE
                            t.write_off_type          = 'PAYMENT_DEBT' AND
                            NVL(t.reversed_flag, 'N') = 'N' AND
                            t.times                   = 0 AND
                            t.cf_type                 = 0 AND
                            t.cf_item                 = 0
                        ) AND
                        v.data_class      ='NORMAL' AND
                        v.price_list NOT IN ('FREE_CF_CAL_LD')
                    )t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter inputPath="/session/@company_id"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="req_status_desc"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" required="true"/>
        <bm:field name="calc_session_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CALC_SESSION_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" required="true"/>
        <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE" required="true"/>
        <bm:field name="business_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_DESC"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" required="true"/>
        <bm:field name="document_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE_DESC"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" required="true"/>
        <bm:field name="document_category_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY_DESC"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER" required="true"/>
        <bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" required="true"/>
        <bm:field name="pre_incept_date" databaseType="DATE" datatype="java.util.Date" physicalName="PRE_INCEPT_DATE"/>
        <bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION" required="true"/>
        <bm:field name="lease_organization_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION_DESC"/>
        <bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" required="true"/>
        <bm:field name="lease_channel_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL_DESC"/>
        <bm:field name="division" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION" required="true"/>
        <bm:field name="division_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION_DESC"/>
        <bm:field name="bp_id_tenant" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_TENANT" required="true"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME"/>
        <bm:field name="bp_id_agent_level1" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_AGENT_LEVEL1"/>
        <bm:field name="bp_id_agent_level2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_AGENT_LEVEL2"/>
        <bm:field name="bp_id_agent_level3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_AGENT_LEVEL3"/>
        <bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID"/>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID"/>
        <bm:field name="employee_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMPLOYEE_CODE"/>
        <bm:field name="employee_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMPLOYEE_NAME"/>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID"/>
        <bm:field name="unit_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNIT_CODE"/>
        <bm:field name="unit_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNIT_NAME"/>
        <bm:field name="employee_id_of_manager" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID_OF_MANAGER"/>
        <bm:field name="employee_code_of_manager" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMPLOYEE_CODE_OF_MANAGER"/>
        <bm:field name="employee_name_of_manager" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMPLOYEE_NAME_OF_MANAGER"/>
        <bm:field name="factoring_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FACTORING_TYPE"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
        <bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRICE_LIST"/>
        <bm:field name="calc_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CALC_METHOD"/>
        <bm:field name="inception_of_lease" databaseType="DATE" datatype="java.util.Date" physicalName="INCEPTION_OF_LEASE"/>
        <bm:field name="lease_start_date" databaseType="DATE" datatype="java.util.Date" physicalName="LEASE_START_DATE"/>
        <bm:field name="first_pay_date" databaseType="DATE" datatype="java.util.Date" physicalName="FIRST_PAY_DATE"/>
        <bm:field name="last_pay_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_PAY_DATE"/>
        <bm:field name="lease_end_date" databaseType="DATE" datatype="java.util.Date" physicalName="LEASE_END_DATE"/>
        <bm:field name="lease_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_TIMES"/>
        <bm:field name="pay_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAY_TIMES"/>
        <bm:field name="annual_pay_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ANNUAL_PAY_TIMES"/>
        <bm:field name="lease_term" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_TERM"/>
        <bm:field name="pay_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAY_TYPE"/>
        <bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY"/>
        <bm:field name="currency_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_DESC"/>
        <bm:field name="currency_precision" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CURRENCY_PRECISION"/>
        <bm:field name="machinery_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MACHINERY_AMOUNT"/>
        <bm:field name="parts_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PARTS_AMOUNT"/>
        <bm:field name="lease_item_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_ITEM_AMOUNT"/>
        <bm:field name="lease_item_cost" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_ITEM_COST"/>
        <bm:field name="down_payment" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOWN_PAYMENT"/>
        <bm:field name="down_payment_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOWN_PAYMENT_RATIO"/>
        <bm:field name="finance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FINANCE_AMOUNT"/>
        <bm:field name="net_finance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_FINANCE_AMOUNT"/>
        <bm:field name="total_interest" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_INTEREST"/>
        <bm:field name="total_rental" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_RENTAL"/>
        <bm:field name="total_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_FEE"/>
        <bm:field name="contract_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_AMOUNT"/>
        <bm:field name="tax_type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TAX_TYPE_ID"/>
        <bm:field name="tax_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_TYPE_DESC"/>
        <bm:field name="vat_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VAT_FLAG"/>
        <bm:field name="vat_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_RATE"/>
        <bm:field name="vat_input" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_INPUT"/>
        <bm:field name="vat_total_interest" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_TOTAL_INTEREST"/>
        <bm:field name="vat_total_principal" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_TOTAL_PRINCIPAL"/>
        <bm:field name="vat_total_rental" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_TOTAL_RENTAL"/>
        <bm:field name="vat_total_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_TOTAL_FEE"/>
        <bm:field name="net_total_interest" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_TOTAL_INTEREST"/>
        <bm:field name="net_net_total_principal" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_NET_TOTAL_PRINCIPAL"/>
        <bm:field name="net_total_rental" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_TOTAL_RENTAL"/>
        <bm:field name="net_total_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_TOTAL_FEE"/>
        <bm:field name="net_lease_item_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_LEASE_ITEM_AMOUNT"/>
        <bm:field name="lease_charge" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_CHARGE"/>
        <bm:field name="lease_charge_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_CHARGE_RATIO"/>
        <bm:field name="lease_mgt_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_MGT_FEE"/>
        <bm:field name="lease_mgt_fee_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_MGT_FEE_RATIO"/>
        <bm:field name="lease_mgt_fee_rule" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_MGT_FEE_RULE"/>
        <bm:field name="deposit" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DEPOSIT"/>
        <bm:field name="deposit_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DEPOSIT_RATIO"/>
        <bm:field name="deposit_deduction" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEPOSIT_DEDUCTION"/>
        <bm:field name="residual_value" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESIDUAL_VALUE"/>
        <bm:field name="residual_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESIDUAL_RATIO"/>
        <bm:field name="balloon" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BALLOON"/>
        <bm:field name="balloon_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BALLOON_RATIO"/>
        <bm:field name="interim_rent_period" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INTERIM_RENT_PERIOD"/>
        <bm:field name="interim_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERIM_TIMES"/>
        <bm:field name="interim_rental" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERIM_RENTAL"/>
        <bm:field name="insurance_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_FEE"/>
        <bm:field name="insurance_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_RATE"/>
        <bm:field name="commission_payable" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMMISSION_PAYABLE"/>
        <bm:field name="commission_receivable" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMMISSION_RECEIVABLE"/>
        <bm:field name="third_party_deposit" databaseType="NUMBER" datatype="java.lang.Long" physicalName="THIRD_PARTY_DEPOSIT"/>
        <bm:field name="promise_to_pay" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROMISE_TO_PAY"/>
        <bm:field name="other_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_FEE"/>
        <bm:field name="other_payment" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_PAYMENT"/>
        <bm:field name="rounding_object" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ROUNDING_OBJECT"/>
        <bm:field name="rounding_method" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ROUNDING_METHOD"/>
        <bm:field name="int_rate_fixing_way" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INT_RATE_FIXING_WAY"/>
        <bm:field name="int_rate_fixing_range" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INT_RATE_FIXING_RANGE"/>
        <bm:field name="int_rate_display" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INT_RATE_DISPLAY"/>
        <bm:field name="base_rate_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BASE_RATE_TYPE"/>
        <bm:field name="base_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASE_RATE"/>
        <bm:field name="int_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INT_RATE"/>
        <bm:field name="int_rate_implicit" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INT_RATE_IMPLICIT"/>
        <bm:field name="int_rate_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INT_RATE_TYPE"/>
        <bm:field name="flt_rate_profile" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FLT_RATE_PROFILE"/>
        <bm:field name="flt_rate_adj_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FLT_RATE_ADJ_METHOD"/>
        <bm:field name="flt_simulate_step" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FLT_SIMULATE_STEP"/>
        <bm:field name="flt_simulate_range" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FLT_SIMULATE_RANGE"/>
        <bm:field name="flt_unit_adj_amt" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FLT_UNIT_ADJ_AMT"/>
        <bm:field name="flt_execute_times_rule" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FLT_EXECUTE_TIMES_RULE"/>
        <bm:field name="flt_int_rate_adj_date" databaseType="DATE" datatype="java.util.Date" physicalName="FLT_INT_RATE_ADJ_DATE"/>
        <bm:field name="int_rate_precision" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INT_RATE_PRECISION"/>
        <bm:field name="irr" databaseType="NUMBER" datatype="java.lang.Long" physicalName="IRR"/>
        <bm:field name="irr_after_tax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="IRR_AFTER_TAX"/>
        <bm:field name="int_rate_implicit_after_tax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INT_RATE_IMPLICIT_AFTER_TAX"/>
        <bm:field name="irr_reserved1" databaseType="NUMBER" datatype="java.lang.Long" physicalName="IRR_RESERVED1"/>
        <bm:field name="irr_reserved2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="IRR_RESERVED2"/>
        <bm:field name="irr_reserved3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="IRR_RESERVED3"/>
        <bm:field name="pmt" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PMT"/>
        <bm:field name="pmt_first" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PMT_FIRST"/>
        <bm:field name="annual_mean_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ANNUAL_MEAN_RATE"/>
        <bm:field name="total_salestax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_SALESTAX"/>
        <bm:field name="biz_day_convention" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BIZ_DAY_CONVENTION"/>
        <bm:field name="calc_with_residual_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CALC_WITH_RESIDUAL_VALUE"/>
        <bm:field name="exchange_rate_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE"/>
        <bm:field name="exchange_rate_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE_DESC"/>
        <bm:field name="exchange_rate_quotation" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_QUOTATION"/>
        <bm:field name="exchange_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EXCHANGE_RATE"/>
        <bm:field name="penalty_profile" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PENALTY_PROFILE"/>
        <bm:field name="grace_period" databaseType="NUMBER" datatype="java.lang.Long" physicalName="GRACE_PERIOD"/>
        <bm:field name="penalty_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PENALTY_RATE"/>
        <bm:field name="penalty_calc_base" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PENALTY_CALC_BASE"/>
        <bm:field name="penalty_total_base_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PENALTY_TOTAL_BASE_RATIO"/>
        <bm:field name="credit_write_off_order" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CREDIT_WRITE_OFF_ORDER"/>
        <bm:field name="fin_income_recognize_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIN_INCOME_RECOGNIZE_METHOD"/>
        <bm:field name="early_termination_profile" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EARLY_TERMINATION_PROFILE"/>
        <bm:field name="payment_method_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAYMENT_METHOD_ID"/>
        <bm:field name="telex_transfer_bank_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TELEX_TRANSFER_BANK_ID"/>
        <bm:field name="tt_bank_branch_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TT_BANK_BRANCH_NAME"/>
        <bm:field name="tt_bank_account_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TT_BANK_ACCOUNT_NUM"/>
        <bm:field name="tt_bank_account_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TT_BANK_ACCOUNT_NAME"/>
        <bm:field name="tt_remark" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TT_REMARK"/>
        <bm:field name="direct_debit_bank_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DIRECT_DEBIT_BANK_ID"/>
        <bm:field name="dd_bank_branch_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DD_BANK_BRANCH_NAME"/>
        <bm:field name="dd_bank_account_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DD_BANK_ACCOUNT_NUM"/>
        <bm:field name="dd_bank_account_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DD_BANK_ACCOUNT_NAME"/>
        <bm:field name="dd_agreement_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DD_AGREEMENT_NO"/>
        <bm:field name="dd_agreement_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DD_AGREEMENT_STATUS"/>
        <bm:field name="dd_remark" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DD_REMARK"/>
        <bm:field name="purchase_order_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PURCHASE_ORDER_NO"/>
        <bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS" required="true"/>
        <bm:field name="contract_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS_DESC"/>
        <!-- <bm:field name="con_std_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_STD_STATUS" required="true"/>
        <bm:field name="con_std_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_STD_STATUS_DESC"/> -->
        <!-- <bm:field name="con_mdy_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_MDY_STATUS"/>
        <bm:field name="con_mdy_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_MDY_STATUS_DESC"/> -->
        <!-- <bm:field name="con_mdy_decription" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_MDY_DECRIPTION"/> -->
        <!-- <bm:field name="sign_major_matters_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SIGN_MAJOR_MATTERS_FLAG"/> -->
        <!-- <bm:field name="con_sign_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_SIGN_STATUS"/> -->
        <!-- <bm:field name="con_sign_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_SIGN_STATUS_DESC"/> -->
        <bm:field name="incept_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INCEPT_STATUS"/>
        <!-- <bm:field name="incept_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INCEPT_STATUS_DESC"/> -->
        <bm:field name="user_status_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USER_STATUS_1"/>
        <bm:field name="user_status_2" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USER_STATUS_2" required="true"/>
        <bm:field name="user_status_3" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USER_STATUS_3" required="true"/>
        <bm:field name="print_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRINT_STATUS" required="true"/>
        <bm:field name="print_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRINT_TIMES"/>
        <bm:field name="first_print_date" databaseType="DATE" datatype="java.util.Date" physicalName="FIRST_PRINT_DATE"/>
        <bm:field name="first_print_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FIRST_PRINT_BY"/>
        <bm:field name="delivery_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DELIVERY_STATUS" required="true"/>
        <bm:field name="delivery_date" databaseType="DATE" datatype="java.util.Date" physicalName="DELIVERY_DATE"/>
        <bm:field name="billing_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD"/>
        <bm:field name="billing_method_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD_DESC"/>
        <bm:field name="billing_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_STATUS" required="true"/>
        <bm:field name="signing_date" databaseType="DATE" datatype="java.util.Date" physicalName="SIGNING_DATE"/>
        <bm:field name="original_recall_date" databaseType="DATE" datatype="java.util.Date" physicalName="ORIGINAL_RECALL_DATE"/>
        <bm:field name="lease_card_recall_date" databaseType="DATE" datatype="java.util.Date" physicalName="LEASE_CARD_RECALL_DATE"/>
        <bm:field name="early_termination_date" databaseType="DATE" datatype="java.util.Date" physicalName="EARLY_TERMINATION_DATE"/>
        <bm:field name="termination_date" databaseType="DATE" datatype="java.util.Date" physicalName="TERMINATION_DATE"/>
        <bm:field name="assignment_agreement_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ASSIGNMENT_AGREEMENT_NO"/>
        <bm:field name="assignment_date" databaseType="DATE" datatype="java.util.Date" physicalName="ASSIGNMENT_DATE"/>
        <bm:field name="btb_payment_date" databaseType="DATE" datatype="java.util.Date" physicalName="BTB_PAYMENT_DATE"/>
        <bm:field name="btb_int_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_INT_RATE"/>
        <bm:field name="btb_int_rate_implicit" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_INT_RATE_IMPLICIT"/>
        <bm:field name="btb_finance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_FINANCE_AMOUNT"/>
        <bm:field name="btb_net_finance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_NET_FINANCE_AMOUNT"/>
        <bm:field name="btb_total_repayment" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_TOTAL_REPAYMENT"/>
        <bm:field name="btb_total_interest" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_TOTAL_INTEREST"/>
        <bm:field name="btb_total_fee_pv" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_TOTAL_FEE_PV"/>
        <bm:field name="btb_total_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_TOTAL_FEE"/>
        <bm:field name="btb_finance_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_FINANCE_RATIO"/>
        <bm:field name="btb_interest_margin" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_INTEREST_MARGIN"/>
        <bm:field name="btb_vat_interest" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_VAT_INTEREST"/>
        <bm:field name="btb_vat_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_VAT_FEE"/>
        <bm:field name="btb_interest_after_tax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_INTEREST_AFTER_TAX"/>
        <bm:field name="btb_fee_after_tax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BTB_FEE_AFTER_TAX"/>
        <bm:field name="vat_rate_of_interest" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_RATE_OF_INTEREST"/>
        <!-- <bm:field name="hd_user_col_d01" databaseType="DATE" datatype="java.util.Date" physicalName="HD_USER_COL_D01"/>
        <bm:field name="hd_user_col_d02" databaseType="DATE" datatype="java.util.Date" physicalName="HD_USER_COL_D02"/>
        <bm:field name="hd_user_col_d03" databaseType="DATE" datatype="java.util.Date" physicalName="HD_USER_COL_D03"/>
        <bm:field name="hd_user_col_d04" databaseType="DATE" datatype="java.util.Date" physicalName="HD_USER_COL_D04"/>
        <bm:field name="hd_user_col_d05" databaseType="DATE" datatype="java.util.Date" physicalName="HD_USER_COL_D05"/>
        <bm:field name="hd_user_col_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V01"/>
        <bm:field name="hd_user_col_v01_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V01_N"/>
        <bm:field name="hd_user_col_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V02"/>
        <bm:field name="hd_user_col_v02_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V02_N"/>
        <bm:field name="hd_user_col_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V03"/>
        <bm:field name="hd_user_col_v03_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V03_N"/>
        <bm:field name="hd_user_col_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V04"/>
        <bm:field name="hd_user_col_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V05"/>
        <bm:field name="hd_user_col_v05_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V05_N"/>
        <bm:field name="hd_user_col_v06" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V06"/>
        <bm:field name="hd_user_col_v06_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V06_N"/>
        <bm:field name="hd_user_col_v07" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V07"/>
        <bm:field name="hd_user_col_v07_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V07_N"/>
        <bm:field name="hd_user_col_v08" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V08"/>
        <bm:field name="hd_user_col_v09" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V09"/>
        <bm:field name="hd_user_col_v09_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V09_N"/>
        <bm:field name="hd_user_col_v10" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_V10"/>
        <bm:field name="hd_user_col_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N01"/>
        <bm:field name="hd_user_col_n01_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_N01_N"/>
        <bm:field name="hd_user_col_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N02"/>
        <bm:field name="hd_user_col_n02_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_N02_N"/>
        <bm:field name="hd_user_col_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N03"/>
        <bm:field name="hd_user_col_n03_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HD_USER_COL_N03_N"/>
        <bm:field name="hd_user_col_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N04"/>
        <bm:field name="hd_user_col_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N05"/>
        <bm:field name="hd_user_col_n06" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N06"/>
        <bm:field name="hd_user_col_n07" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N07"/>
        <bm:field name="hd_user_col_n08" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N08"/>
        <bm:field name="hd_user_col_n09" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N09"/>
        <bm:field name="hd_user_col_n10" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N10"/>
        <bm:field name="hd_user_col_n11" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N11"/>
        <bm:field name="hd_user_col_n12" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N12"/>
        <bm:field name="hd_user_col_n13" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N13"/>
        <bm:field name="hd_user_col_n14" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N14"/>
        <bm:field name="hd_user_col_n15" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HD_USER_COL_N15"/>
        <bm:field name="created_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CREATED_BY"/> -->
        <bm:field name="creation_date" databaseType="DATE" datatype="java.util.Date" physicalName="CREATION_DATE"/>
        <bm:field name="last_updated_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LAST_UPDATED_BY"/>
        <bm:field name="last_update_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_UPDATE_DATE"/>
        <bm:field name="prj_search_term_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRJ_SEARCH_TERM_1"/>
        <bm:field name="prj_search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRJ_SEARCH_TERM_2"/>
        <bm:field name="con_search_term_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_SEARCH_TERM_1"/>
        <bm:field name="con_search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CON_SEARCH_TERM_2"/>
        <bm:field name="cdd_list_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CDD_LIST_ID"/>
        <bm:field name="data_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DATA_CLASS" required="true"/>
        <!-- <bm:field name="overdue_max_days" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OVERDUE_MAX_DAYS"/> -->
        <!-- <bm:field name="suggest_incept_date" databaseType="DATE" datatype="java.util.Date" physicalName="SUGGEST_INCEPT_DATE"/> -->
        <bm:field name="incept_req_print_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INCEPT_REQ_PRINT_STATUS"/>
        <bm:field name="incept_before_lend" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INCEPT_BEFORE_LEND"/>
        <!-- <bm:field name="lease_rec_condition_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_REC_CONDITION_CODE"/> -->
        <!-- <bm:field name="incept_before_lend_des" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INCEPT_BEFORE_LEND_DES"/> -->
        <!-- <bm:field name="five_class_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIVE_CLASS_CODE"/>
        <bm:field name="five_class_code_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIVE_CLASS_CODE_N"/>
        <bm:field name="lease_rec_condition" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_REC_CONDITION"/>
        <bm:field name="con_sign_status_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_SIGN_STATUS_N"/>
        <bm:field name="first_launch_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIRST_LAUNCH_DATE"/>
        <bm:field name="inception_of_lease1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INCEPTION_OF_LEASE1"/>
        <bm:field name="flt_next_adj_date" databaseType="DATE" datatype="java.util.Date"/> -->
    </bm:fields>
    <bm:features>
        <s:bm-script><![CDATA[
            var cx = Packages.leaf.javascript.Context.getCurrentContext();
            Packages.leaf.plugin.script.engine.ScriptImportor.defineExternScript(cx, this, $ctx.getData(), "aut_authority_bm_validate.js");
        ]]></s:bm-script>
    </bm:features>
    <bm:query-fields>
        <bm:query-field name="update_flag" queryExpression="(t1.contract_status in (&apos;NEW&apos;) and nvl(${@update_flag},&apos;N&apos;)=&apos;Y&apos;)"/>
        <bm:query-field name="contract_ref_content_flag" queryExpression="(t1.contract_status in (&apos;NEW&apos;,&apos;INCEPT&apos;,&apos;SIGN&apos;,&apos;PAID&apos;) and nvl(${@contract_ref_content_flag},&apos;N&apos;)=&apos;Y&apos; )"/>
        <bm:query-field field="bp_id_tenant" queryOperator="="/>
        <bm:query-field field="project_id" queryOperator="="/>
        <bm:query-field field="employee_id" queryOperator="="/>
        <bm:query-field field="employee_id_of_manager" queryOperator="="/>
        <bm:query-field field="unit_id" queryOperator="="/>
        <bm:query-field field="lease_organization" queryOperator="="/>
        <bm:query-field field="division" queryOperator="="/>
        <bm:query-field field="lease_channel" queryOperator="="/>
        <bm:query-field field="document_type" queryOperator="="/>
        <bm:query-field field="document_category" queryOperator="="/>
        <bm:query-field field="contract_status" queryOperator="="/>
        <bm:query-field field="contract_number" queryOperator="like"/>
        <bm:query-field field="business_type" queryOperator="="/>
        <bm:query-field name="inception_of_lease_from" queryExpression="inception_of_lease &gt;= ${@document_date_from}"/>
        <bm:query-field name="inception_of_lease_to" queryExpression="inception_of_lease &lt;= ${@document_date_to}"/>
        <bm:query-field field="contract_id" queryOperator="="/>
        <bm:query-field name="lease_start_date_from" queryExpression="lease_start_date &gt;= to_date(${@lease_start_date_from},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="lease_start_date_to" queryExpression="lease_start_date &lt;= to_date(${@lease_start_date_to},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field field="bp_name" queryOperator="like"/>
        <bm:query-field field="project_number" queryOperator="="/>
        <bm:query-field field="project_name" queryOperator="like"/>
        <bm:query-field field="contract_name" queryOperator="like"/>
        <bm:query-field field="prj_search_term_1" queryOperator="like"/>
        <bm:query-field field="prj_search_term_2" queryOperator="like"/>
        <bm:query-field field="con_search_term_1" queryOperator="like"/>
        <bm:query-field field="con_search_term_2" queryOperator="like"/>
        <!-- <bm:query-field name="content_print" queryExpression="(t1.con_mdy_status not in ('APPROVING') and ${@content_print}='Y')" /> -->
        <bm:query-field name="quotation_change_req_flag" queryExpression="(${@quotation_change_req_flag}=&apos;Y&apos; and t1.contract_status in (&apos;NEW&apos;,&apos;PAID&apos;))"/>
        <bm:query-field name="content_notarize_flag" queryExpression="(${@content_notarize_flag}=&apos;Y&apos; and t1.contract_status in (&apos;NEW&apos;,&apos;PAID&apos;,&apos;SIGN&apos;,&apos;INCEPT&apos;) and t1.print_status=&apos;PRINTED&apos;)"/>
        <bm:query-field name="contract_status_cancel" queryExpression="(t1.contract_status !=${@contract_status_cancel})"/>
    </bm:query-fields>
    <bm:data-filters>
        <!-- <bm:data-filter enforceOperations="query" expression="t1.contract_status not in (&apos;SIGN&apos;)"/> -->
        <bm:data-filter enforceOperations="query" expression=" not exists (select 1 from  con_contract_change_req_flt f where f.contract_id = t1.contract_id and f.req_status = &apos;APPROVING&apos; )"/>
    </bm:data-filters>
</bm:model>