CREATE TABLE cmr_ap_invoice_dtls (
    CMR_AP_INVOICE_DIST_ID            NUMBER(18, 0)     NOT NULL,
    INVOICE_ID                        NUMBER(18, 0)     NOT NULL,
    INVOICE_NUMBER                    VARCHAR2(200) ,
    CMR_AP_INVOICE_LINE_ID            NUMBER(18, 0) ,
    INVOICING_BUSINESS_UNIT_ID        NUMBER(18, 0)     NOT NULL,
    PROCUREMENT_BUSINESS_UNIT_ID      NUMBER(18, 0) ,
    INVOICE_LINE_NUMBER               VARCHAR2(160) ,
    INVOICE_AMT                       NUMBER        ,
    INVOICE_BASE_AMOUNT               NUMBER        ,
    DIST_CODE_COMBINATION_ID          NUMBER(18, 0) ,
    INVOICE_TYPE                      VARCHAR2(100) ,
    INVOICE_LINE_TYPE                 VARCHAR2(120) ,
    INVOICE_QTY                       NUMBER        ,
    UNIT_OF_MEASURE                   VARCHAR2(100) ,
    INVOICE_QTY_IN_PRIMARY_UOM        NUMBER        ,
    DISTRIBUTION_MATCH_TYPE           VARCHAR2(100) ,
    TAX_CODE_ID                       NUMBER(18, 0) ,
    CHARGE_APPLICABLE_TO_DIST_ID      NUMBER(18, 0) ,
    LCM_ENABLED_FLAG                  VARCHAR2(4)   ,
    LINE_CANCELLED_FLAG               VARCHAR2(4)   ,
    VENDOR_ID                         NUMBER(18, 0) ,
    VENDOR_SITE_ID                    NUMBER(18, 0) ,
    INVOICE_DISTRIBUTION_TYPE         VARCHAR2(100)     NOT NULL,
    CMR_PO_DISTRIBUTION_ID            NUMBER(18, 0) ,
    PO_DISTRIBUTION_ID                NUMBER(18, 0) ,
    CMR_RCV_TRANSACTION_ID            NUMBER(18, 0) ,
    RCV_TRANSACTION_ID                NUMBER(18, 0) ,
    FINAL_MATCH_FLAG                  VARCHAR2(4)   ,
    ACCOUNTING_DATE                   TIMESTAMP(6)      NOT NULL,
    EXPENDITURE_ITEM_DATE             TIMESTAMP(6)  ,
    INVOICE_CREATION_DATE             TIMESTAMP(6)  ,
    CORRECTED_INVOICE_DIST_ID         NUMBER(18, 0) ,
    INVOICE_SOURCE                    VARCHAR2(100) ,
    RELATED_DISTRIBUTION_ID           NUMBER(18, 0) ,
    CURRENCY_CODE                     VARCHAR2(60)  ,
    CURRENCY_CONVERSION_TYPE          VARCHAR2(120) ,
    CURRENCY_CONVERSION_DATE          TIMESTAMP(6)  ,
    CURRENCY_CONVERSION_RATE          NUMBER        ,
    REVERSAL_FLAG                     VARCHAR2(4)   ,
    SELF_ASSESSED_FLAG                VARCHAR2(4)   ,
    FISCAL_DOC_HEADER_ID              NUMBER(18, 0) ,
    FISCAL_DOC_LINE_ID                NUMBER(18, 0) ,
    FISCAL_CHARGE_TYPE                VARCHAR2(120) ,
    PARENT_REVERSAL_ID                NUMBER(18, 0) ,
    EXTERNAL_SYSTEM_REFERENCE         VARCHAR2(240) ,
    EXTERNAL_SYSTEM_REF_ID            VARCHAR2(120) ,
    INVOICING_BU_FUNC_CURR_CODE       VARCHAR2(60)  ,
    PROCESSED_BY_CA_FLAG              VARCHAR2(20)  ,
    PROCESSED_BY_RA_FLAG              VARCHAR2(20)  ,
    LCM_ASSOCIATION_PROCESSED_FLAG    VARCHAR2(4)   ,
    LCM_ASSOCIATION_REQUEST_ID        NUMBER(18, 0) ,
    INVOICE_QTY_IN_PO_UOM             NUMBER        ,
    CONSUMPTION_ADVICE_HEADER_ID      NUMBER(18, 0) ,
    CONSUMPTION_ADVICE_LINE_ID        NUMBER(18, 0) ,
    CREATED_BY                        VARCHAR2(256)     NOT NULL,
    CREATION_DATE                     TIMESTAMP(6)      NOT NULL,
    LAST_UPDATED_BY                   VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_DATE                  TIMESTAMP(6)      NOT NULL,
    LAST_UPDATE_LOGIN                 VARCHAR2(128) ,
    REQUEST_ID                        NUMBER(18, 0) ,
    JOB_DEFINITION_NAME               VARCHAR2(400) ,
    JOB_DEFINITION_PACKAGE            VARCHAR2(3600),
    ONLINE_ASSOC_PROCESS_ID           NUMBER(18, 0) ,
    LE_TIMEZONE_CODE                  VARCHAR2(200) ,
    INCLUSIVE_FLAG                    VARCHAR2(4)   ,
    TAX_POINT_BASIS                   VARCHAR2(120) ,
    PROCESSED_BY_CMF_FLAG             VARCHAR2(16)  ,
    PO_LINE_LOCATION_ID               NUMBER(18, 0) ,
    CMR_AP_INVOICE_DIST_ID            NUMBER(18, 0)     NOT NULL,
    INVOICE_ID                        NUMBER(18, 0)     NOT NULL,
    INVOICE_NUMBER                    VARCHAR2(200) ,
    INVOICING_BUSINESS_UNIT_ID        NUMBER(18, 0)     NOT NULL,
    INVOICE_LINE_NUMBER               VARCHAR2(160) ,
    INVOICE_AMT                       NUMBER        ,
    INVOICE_BASE_AMOUNT               NUMBER        ,
    DIST_CODE_COMBINATION_ID          NUMBER(18, 0) ,
    INVOICE_TYPE                      VARCHAR2(100) ,
    INVOICE_QTY                       NUMBER        ,
    UNIT_OF_MEASURE                   VARCHAR2(100) ,
    DISTRIBUTION_MATCH_TYPE           VARCHAR2(100) ,
    INVOICE_DISTRIBUTION_TYPE         VARCHAR2(100)     NOT NULL,
    CMR_PO_DISTRIBUTION_ID            NUMBER(18, 0) ,
    PO_DISTRIBUTION_ID                NUMBER(18, 0) ,
    CMR_RCV_TRANSACTION_ID            NUMBER(18, 0) ,
    RCV_TRANSACTION_ID                NUMBER(18, 0) ,
    FINAL_MATCH_FLAG                  VARCHAR2(4)   ,
    ACCOUNTING_DATE                   TIMESTAMP(6)      NOT NULL,
    EXPENDITURE_ITEM_DATE             TIMESTAMP(6)  ,
    INVOICE_CREATION_DATE             TIMESTAMP(6)  ,
    CORRECTED_INVOICE_DIST_ID         NUMBER(18, 0) ,
    INVOICE_SOURCE                    VARCHAR2(100) ,
    RELATED_DISTRIBUTION_ID           NUMBER(18, 0) ,
    CURRENCY_CODE                     VARCHAR2(60)  ,
    CURRENCY_CONVERSION_TYPE          VARCHAR2(120) ,
    CURRENCY_CONVERSION_DATE          TIMESTAMP(6)  ,
    CURRENCY_CONVERSION_RATE          NUMBER        ,
    REVERSAL_FLAG                     VARCHAR2(4)   ,
    PARENT_REVERSAL_ID                NUMBER(18, 0) ,
    EXTERNAL_SYSTEM_REFERENCE         VARCHAR2(240) ,
    EXTERNAL_SYSTEM_REF_ID            VARCHAR2(120) ,
    INVOICING_BU_FUNC_CURR_CODE       VARCHAR2(60)  ,
    PROCESSED_BY_CA_FLAG              VARCHAR2(20)  ,
    PROCESSED_BY_RA_FLAG              VARCHAR2(20)  ,
    INVOICE_QTY_IN_PO_UOM             NUMBER        ,
    CREATED_BY                        VARCHAR2(256)     NOT NULL,
    CREATION_DATE                     TIMESTAMP(6)      NOT NULL,
    LAST_UPDATED_BY                   VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_DATE                  TIMESTAMP(6)      NOT NULL,
    LAST_UPDATE_LOGIN                 VARCHAR2(128) ,
    REQUEST_ID                        NUMBER(18, 0) ,
    JOB_DEFINITION_NAME               VARCHAR2(400) ,
    JOB_DEFINITION_PACKAGE            VARCHAR2(3600),
    CMR_AP_INVOICE_LINE_ID            NUMBER(18, 0) ,
    PROCUREMENT_BUSINESS_UNIT_ID      NUMBER(18, 0) ,
    INVOICE_LINE_TYPE                 VARCHAR2(120) ,
    INVOICE_QTY_IN_PRIMARY_UOM        NUMBER        ,
    TAX_CODE_ID                       NUMBER(18, 0) ,
    CHARGE_APPLICABLE_TO_DIST_ID      NUMBER(18, 0) ,
    LCM_ENABLED_FLAG                  VARCHAR2(4)   ,
    LINE_CANCELLED_FLAG               VARCHAR2(4)   ,
    VENDOR_ID                         NUMBER(18, 0) ,
    VENDOR_SITE_ID                    NUMBER(18, 0) ,
    SELF_ASSESSED_FLAG                VARCHAR2(4)   ,
    LCM_ASSOCIATION_PROCESSED_FLAG    VARCHAR2(4)   ,
    LCM_ASSOCIATION_REQUEST_ID        NUMBER(18, 0) ,
    CONSUMPTION_ADVICE_HEADER_ID      NUMBER(18, 0) ,
    CONSUMPTION_ADVICE_LINE_ID        NUMBER(18, 0) ,
    ONLINE_ASSOC_PROCESS_ID           NUMBER(18, 0) ,
    FISCAL_DOC_HEADER_ID              NUMBER(18, 0) ,
    FISCAL_DOC_LINE_ID                NUMBER(18, 0) ,
    FISCAL_CHARGE_TYPE                VARCHAR2(120) ,
    LE_TIMEZONE_CODE                  VARCHAR2(200) ,
    INCLUSIVE_FLAG                    VARCHAR2(4)   ,
    TAX_POINT_BASIS                   VARCHAR2(120) ,
    PROCESSED_BY_CMF_FLAG             VARCHAR2(16)  ,
    PO_LINE_LOCATION_ID               NUMBER(18, 0) ,
    CONSTRAINT pk_cmr_ap_invoice_dtls PRIMARY KEY (EXTERNAL_SYSTEM_REFERENCE, EXTERNAL_SYSTEM_REF_ID, EXTERNAL_SYSTEM_REFERENCE, EXTERNAL_SYSTEM_REF_ID)
);
