CREATE TABLE ap_payment_history_all (
    PAYMENT_HISTORY_ID             NUMBER(18, 0) ,
    CHECK_ID                       NUMBER(18, 0)     NOT NULL,
    TRANSACTION_DATE               DATE          ,
    TRANSACTION_AMOUNT             NUMBER        ,
    TRANSACTION_TYPE               VARCHAR2(120)     NOT NULL,
    POSTED_FLAG                    VARCHAR2(4)       NOT NULL,
    ERROR_AMOUNT                   NUMBER        ,
    CHARGE_AMOUNT                  NUMBER        ,
    CURRENCY_CODE                  VARCHAR2(60)  ,
    MATCHED_FLAG                   VARCHAR2(4)   ,
    ACCOUNTING_EVENT_ID            NUMBER(18, 0) ,
    ORG_ID                         NUMBER(18, 0)     NOT NULL,
    CREATION_DATE                  TIMESTAMP(6)      NOT NULL,
    CREATED_BY                     VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_DATE               TIMESTAMP(6)      NOT NULL,
    LAST_UPDATED_BY                VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_LOGIN              VARCHAR2(128) ,
    PROGRAM_UPDATE_DATE            DATE          ,
    PROGRAM_APPLICATION_ID         NUMBER(18, 0) ,
    PROGRAM_ID                     NUMBER(18, 0) ,
    REQUEST_ID                     NUMBER(18, 0) ,
    ACCOUNTING_DATE                DATE              NOT NULL,
    MRC_EXCHANGE_RATE              VARCHAR2(4000),
    MRC_EXCHANGE_RATE_DATE         VARCHAR2(4000),
    MRC_EXCHANGE_RATE_TYPE         VARCHAR2(4000),
    REV_PMT_HIST_ID                NUMBER(18, 0) ,
    TRX_BANK_AMOUNT                NUMBER        ,
    ERRORS_BANK_AMOUNT             NUMBER        ,
    CHARGES_BANK_AMOUNT            NUMBER        ,
    TRX_PMT_AMOUNT                 NUMBER            NOT NULL,
    ERRORS_PMT_AMOUNT              NUMBER        ,
    CHARGES_PMT_AMOUNT             NUMBER        ,
    TRX_BASE_AMOUNT                NUMBER        ,
    ERRORS_BASE_AMOUNT             NUMBER        ,
    CHARGES_BASE_AMOUNT            NUMBER        ,
    BANK_CURRENCY_CODE             VARCHAR2(60)  ,
    BANK_TO_BASE_XRATE_TYPE        VARCHAR2(120) ,
    BANK_TO_BASE_XRATE_DATE        DATE          ,
    BANK_TO_BASE_XRATE             NUMBER        ,
    PMT_CURRENCY_CODE              VARCHAR2(60)      NOT NULL,
    PMT_TO_BASE_XRATE_TYPE         VARCHAR2(120) ,
    PMT_TO_BASE_XRATE_DATE         DATE          ,
    PMT_TO_BASE_XRATE              NUMBER        ,
    MRC_PMT_TO_BASE_XRATE_TYPE     VARCHAR2(4000),
    MRC_PMT_TO_BASE_XRATE_DATE     VARCHAR2(4000),
    MRC_PMT_TO_BASE_XRATE          VARCHAR2(4000),
    MRC_BANK_TO_BASE_XRATE_TYPE    VARCHAR2(4000),
    MRC_BANK_TO_BASE_XRATE_DATE    VARCHAR2(4000),
    MRC_BANK_TO_BASE_XRATE         VARCHAR2(4000),
    MRC_TRX_BASE_AMOUNT            VARCHAR2(4000),
    MRC_ERRORS_BASE_AMOUNT         VARCHAR2(4000),
    MRC_CHARGES_BASE_AMOUNT        VARCHAR2(4000),
    RELATED_EVENT_ID               NUMBER(18, 0) ,
    HISTORICAL_FLAG                VARCHAR2(4)   ,
    INVOICE_ADJUSTMENT_EVENT_ID    NUMBER(18, 0) ,
    GAIN_LOSS_INDICATOR            VARCHAR2(4)   ,
    OBJECT_VERSION_NUMBER          NUMBER(9, 0)      NOT NULL,
    JOB_DEFINITION_NAME            VARCHAR2(400) ,
    JOB_DEFINITION_PACKAGE         VARCHAR2(3600),
    PMT_TO_BANK_XRATE_TYPE         VARCHAR2(120) ,
    PMT_TO_BANK_XRATE_DATE         DATE          ,
    PMT_TO_BANK_XRATE              NUMBER        ,
    PAYMENT_HISTORY_ID             NUMBER(18, 0) ,
    CHECK_ID                       NUMBER(18, 0)     NOT NULL,
    TRANSACTION_DATE               DATE          ,
    TRANSACTION_AMOUNT             NUMBER        ,
    TRANSACTION_TYPE               VARCHAR2(120)     NOT NULL,
    POSTED_FLAG                    VARCHAR2(4)       NOT NULL,
    ERROR_AMOUNT                   NUMBER        ,
    CHARGE_AMOUNT                  NUMBER        ,
    CURRENCY_CODE                  VARCHAR2(60)  ,
    MATCHED_FLAG                   VARCHAR2(4)   ,
    ACCOUNTING_EVENT_ID            NUMBER(18, 0) ,
    ORG_ID                         NUMBER(18, 0)     NOT NULL,
    CREATION_DATE                  TIMESTAMP(6)      NOT NULL,
    CREATED_BY                     VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_DATE               TIMESTAMP(6)      NOT NULL,
    LAST_UPDATED_BY                VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_LOGIN              VARCHAR2(128) ,
    PROGRAM_UPDATE_DATE            DATE          ,
    PROGRAM_APPLICATION_ID         NUMBER(18, 0) ,
    PROGRAM_ID                     NUMBER(18, 0) ,
    REQUEST_ID                     NUMBER(18, 0) ,
    ACCOUNTING_DATE                DATE              NOT NULL,
    MRC_EXCHANGE_RATE              VARCHAR2(4000),
    MRC_EXCHANGE_RATE_DATE         VARCHAR2(4000),
    MRC_EXCHANGE_RATE_TYPE         VARCHAR2(4000),
    REV_PMT_HIST_ID                NUMBER(18, 0) ,
    TRX_BANK_AMOUNT                NUMBER        ,
    ERRORS_BANK_AMOUNT             NUMBER        ,
    CHARGES_BANK_AMOUNT            NUMBER        ,
    TRX_PMT_AMOUNT                 NUMBER            NOT NULL,
    ERRORS_PMT_AMOUNT              NUMBER        ,
    CHARGES_PMT_AMOUNT             NUMBER        ,
    TRX_BASE_AMOUNT                NUMBER        ,
    ERRORS_BASE_AMOUNT             NUMBER        ,
    CHARGES_BASE_AMOUNT            NUMBER        ,
    BANK_CURRENCY_CODE             VARCHAR2(60)  ,
    BANK_TO_BASE_XRATE_TYPE        VARCHAR2(120) ,
    BANK_TO_BASE_XRATE_DATE        DATE          ,
    BANK_TO_BASE_XRATE             NUMBER        ,
    PMT_CURRENCY_CODE              VARCHAR2(60)      NOT NULL,
    PMT_TO_BASE_XRATE_TYPE         VARCHAR2(120) ,
    PMT_TO_BASE_XRATE_DATE         DATE          ,
    PMT_TO_BASE_XRATE              NUMBER        ,
    MRC_PMT_TO_BASE_XRATE_TYPE     VARCHAR2(4000),
    MRC_PMT_TO_BASE_XRATE_DATE     VARCHAR2(4000),
    MRC_PMT_TO_BASE_XRATE          VARCHAR2(4000),
    MRC_BANK_TO_BASE_XRATE_TYPE    VARCHAR2(4000),
    MRC_BANK_TO_BASE_XRATE_DATE    VARCHAR2(4000),
    MRC_BANK_TO_BASE_XRATE         VARCHAR2(4000),
    MRC_TRX_BASE_AMOUNT            VARCHAR2(4000),
    MRC_ERRORS_BASE_AMOUNT         VARCHAR2(4000),
    MRC_CHARGES_BASE_AMOUNT        VARCHAR2(4000),
    RELATED_EVENT_ID               NUMBER(18, 0) ,
    HISTORICAL_FLAG                VARCHAR2(4)   ,
    INVOICE_ADJUSTMENT_EVENT_ID    NUMBER(18, 0) ,
    GAIN_LOSS_INDICATOR            VARCHAR2(4)   ,
    OBJECT_VERSION_NUMBER          NUMBER(9, 0)      NOT NULL,
    JOB_DEFINITION_NAME            VARCHAR2(400) ,
    JOB_DEFINITION_PACKAGE         VARCHAR2(3600),
    PMT_TO_BANK_XRATE_TYPE         VARCHAR2(120) ,
    PMT_TO_BANK_XRATE_DATE         DATE          ,
    PMT_TO_BANK_XRATE              NUMBER        ,
    CONSTRAINT pk_ap_payment_history_all PRIMARY KEY (PAYMENT_HISTORY_ID, PAYMENT_HISTORY_ID)
);
