CREATE TABLE iby_payments_h (
    PAYMENT_HISTORY_ID                NUMBER(18, 0) ,
    PAYMENT_HISTORY_DATE              DATE              NOT NULL,
    PAYMENT_INSTRUCTION_HISTORY_ID    NUMBER(18, 0)     NOT NULL,
    PAYMENT_ID                        NUMBER(18, 0)     NOT NULL,
    PROCESSING_TYPE                   VARCHAR2(120)     NOT NULL,
    BILL_PAYABLE_FLAG                 VARCHAR2(4)       NOT NULL,
    EXCLUSIVE_PAYMENT_FLAG            VARCHAR2(4)       NOT NULL,
    PAYMENTS_COMPLETE_FLAG            VARCHAR2(4)       NOT NULL,
    STOP_CONFIRMED_FLAG               VARCHAR2(4)       NOT NULL,
    STOP_RELEASED_FLAG                VARCHAR2(4)       NOT NULL,
    STOP_REQUEST_PLACED_FLAG          VARCHAR2(4)       NOT NULL,
    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,
    OBJECT_VERSION_NUMBER             NUMBER(9, 0)      NOT NULL,
    LAST_UPDATE_LOGIN                 VARCHAR2(128) ,
    DECLARATION_OPTION                VARCHAR2(120) ,
    DCL_ONLY_FOREIGN_CURR_PMT_FLAG    VARCHAR2(4)   ,
    DECLARATION_REPORT_FORMAT_CODE    VARCHAR2(120) ,
    DECLARATION_CURR_FX_RATE_TYPE     VARCHAR2(1020),
    DECLARATION_CURRENCY_CODE         VARCHAR2(40)  ,
    DECLARATION_THRESHOLD_AMOUNT      NUMBER        ,
    PAYMENT_DETAILS_FORMULA           VARCHAR2(960) ,
    BANK_INSTRUCTION1_CODE            VARCHAR2(120)     NOT NULL,
    BANK_INSTRUCTION2_CODE            VARCHAR2(120)     NOT NULL,
    BANK_INSTRUCTION_DETAILS          VARCHAR2(1020),
    PAYMENT_TEXT_MESSAGE1             VARCHAR2(600) ,
    PAYMENT_TEXT_MESSAGE2             VARCHAR2(600) ,
    PAYMENT_SERVICE_REQUEST_ID        NUMBER(18, 0)     NOT NULL,
    PROCESS_TYPE                      VARCHAR2(120)     NOT NULL,
    PAYMENT_INSTRUCTION_ID            NUMBER(18, 0)     NOT NULL,
    PAYMENT_STATUS                    VARCHAR2(120)     NOT NULL,
    PAYMENT_FUNCTION                  VARCHAR2(120)     NOT NULL,
    PAYMENT_REASON_CODE               VARCHAR2(120)     NOT NULL,
    PAYMENT_REASON_COMMENTS           VARCHAR2(960)     NOT NULL,
    PAYMENT_DATE                      DATE          ,
    ANTICIPATED_VALUE_DATE            DATE          ,
    PAYMENT_AMOUNT                    NUMBER            NOT NULL,
    PAYMENT_CURRENCY_CODE             VARCHAR2(40)      NOT NULL,
    MATURITY_DATE                     DATE          ,
    PAYMENT_DUE_DATE                  DATE          ,
    DECLARE_PAYMENT_FLAG              VARCHAR2(4)   ,
    DECLARATION_AMOUNT                NUMBER        ,
    DISCOUNT_AMOUNT_TAKEN             NUMBER        ,
    PAYMENT_DETAILS                   VARCHAR2(960) ,
    BANK_CHARGE_BEARER                VARCHAR2(120) ,
    BANK_CHARGE_AMOUNT                NUMBER        ,
    DELIVERY_FORMAT_VALUE             VARCHAR2(320)     NOT NULL,
    SETTLEMENT_PRIORITY               VARCHAR2(120) ,
    REMITTANCE_MESSAGE1               VARCHAR2(600) ,
    REMITTANCE_MESSAGE2               VARCHAR2(600) ,
    REMITTANCE_MESSAGE3               VARCHAR2(600) ,
    PAPER_DOCUMENT_NUMBER             NUMBER(18, 0) ,
    BANK_ASSIGNED_REF_CODE            VARCHAR2(120) ,
    INT_BANK_ACCOUNT_NUMBER           VARCHAR2(120) ,
    INT_BANK_ACCOUNT_ROUTING_NUM      VARCHAR2(120) ,
    INT_BANK_ACCOUNT_IBAN_NUMBER      VARCHAR2(200) ,
    EXT_BANK_ACCOUNT_NUMBER           VARCHAR2(120) ,
    EXT_BANK_ACCOUNT_ROUTING_NUM      VARCHAR2(120) ,
    EXT_BANK_ACCOUNT_BANK_NAME        VARCHAR2(1440),
    EXT_BANK_ACCOUNT_BRANCH_NAME      VARCHAR2(1440),
    EXT_BANK_ACCOUNT_BRANCH_NUMBER    VARCHAR2(120) ,
    EXT_BANK_ACCOUNT_IBAN_NUMBER      VARCHAR2(200) ,
    EXT_BANK_ACCOUNT_SWIFT_CODE       VARCHAR2(120) ,
    EXT_PAYEE_ID                      NUMBER(18, 0) ,
    PAYEE_PARTY_ID                    NUMBER(18, 0) ,
    PARTY_SITE_ID                     NUMBER(18, 0) ,
    SUPPLIER_SITE_ID                  NUMBER(18, 0) ,
    BENEFICIARY_PARTY                 NUMBER(18, 0) ,
    ORG_ID                            NUMBER(18, 0)     NOT NULL,
    ORG_TYPE                          VARCHAR2(120) ,
    ORG_NAME                          VARCHAR2(960)     NOT NULL,
    LEGAL_ENTITY_ID                   NUMBER(18, 0)     NOT NULL,
    PARTY_NAME                        VARCHAR2(1440),
    COUNTRY                           VARCHAR2(240)     NOT NULL,
    ADDRESS1                          VARCHAR2(960) ,
    ADDRESS2                          VARCHAR2(960) ,
    ADDRESS3                          VARCHAR2(960) ,
    ADDRESS4                          VARCHAR2(960) ,
    CITY                              VARCHAR2(240) ,
    POSTAL_CODE                       VARCHAR2(240) ,
    POSTAL_PLUS4_CODE                 VARCHAR2(40)  ,
    STATE                             VARCHAR2(240) ,
    PROVINCE                          VARCHAR2(240) ,
    COUNTY                            VARCHAR2(240) ,
    UNIQUE_REMITTANCE_IDENTIFIER      VARCHAR2(1024),
    URI_CHECK_DIGIT                   VARCHAR2(8)   ,
    DOCUMENT_CATEGORY_CODE            VARCHAR2(120) ,
    DOCUMENT_SEQUENCE_ID              NUMBER        ,
    DOCUMENT_SEQUENCE_VALUE           NUMBER        ,
    STOP_CONFIRMED_BY                 NUMBER(18, 0) ,
    STOP_CONFIRM_DATE                 DATE          ,
    STOP_CONFIRM_REASON               VARCHAR2(960) ,
    STOP_CONFIRM_REFERENCE            VARCHAR2(400) ,
    STOP_RELEASED_BY                  NUMBER(18, 0) ,
    STOP_RELEASE_DATE                 DATE          ,
    STOP_RELEASE_REASON               VARCHAR2(960) ,
    STOP_RELEASE_REFERENCE            VARCHAR2(400) ,
    STOP_REQUEST_DATE                 DATE          ,
    STOP_REQUEST_PLACED_BY            NUMBER(18, 0) ,
    STOP_REQUEST_REASON               VARCHAR2(960) ,
    STOP_REQUEST_REFERENCE            VARCHAR2(400) ,
    VOIDED_BY                         NUMBER(18, 0) ,
    VOID_DATE                         DATE          ,
    VOID_REASON                       VARCHAR2(960) ,
    ATTRIBUTE_CATEGORY                VARCHAR2(600) ,
    ATTRIBUTE1                        VARCHAR2(600) ,
    ATTRIBUTE2                        VARCHAR2(600) ,
    ATTRIBUTE3                        VARCHAR2(600) ,
    ATTRIBUTE4                        VARCHAR2(600) ,
    ATTRIBUTE5                        VARCHAR2(600) ,
    ATTRIBUTE6                        VARCHAR2(600) ,
    ATTRIBUTE7                        VARCHAR2(600) ,
    ATTRIBUTE8                        VARCHAR2(600) ,
    ATTRIBUTE9                        VARCHAR2(600) ,
    ATTRIBUTE10                       VARCHAR2(600) ,
    ATTRIBUTE11                       VARCHAR2(600) ,
    ATTRIBUTE12                       VARCHAR2(600) ,
    ATTRIBUTE13                       VARCHAR2(600) ,
    ATTRIBUTE14                       VARCHAR2(600) ,
    ATTRIBUTE15                       VARCHAR2(600) ,
    INVOICING_ORG_ID                  NUMBER(18, 0) ,
    INVOICING_ORG_TYPE                VARCHAR2(120) ,
    INV_EXT_PAYEE_ID                  NUMBER(18, 0) ,
    INV_PAYEE_PARTY_ID                NUMBER(18, 0) ,
    INV_PARTY_SITE_ID                 NUMBER(18, 0) ,
    INV_SUPPLIER_SITE_ID              NUMBER(18, 0) ,
    INV_PAYEE_PARTY_NUMBER            VARCHAR2(120) ,
    INV_PAYEE_SUPPLIER_ID             NUMBER(18, 0) ,
    INV_PAYEE_SUPPLIER_NUMBER         VARCHAR2(120) ,
    INV_PAYEE_PARTY_NAME              VARCHAR2(1440),
    INV_PAYEE_ALTERNATE_NAME          VARCHAR2(1440),
    INV_PAYEE_SITE_ALT_NAME           VARCHAR2(1440),
    INV_PAYEE_SUPPLIER_SITE_NAME      VARCHAR2(960) ,
    INV_PAYEE_SPPLR_SITE_ALT_NAME     VARCHAR2(1440),
    INV_PAYEE_ADDRESS1                VARCHAR2(960) ,
    INV_PAYEE_ADDRESS2                VARCHAR2(960) ,
    INV_PAYEE_ADDRESS3                VARCHAR2(960) ,
    INV_PAYEE_ADDRESS4                VARCHAR2(960) ,
    INV_PAYEE_CITY                    VARCHAR2(240) ,
    INV_PAYEE_POSTAL_CODE             VARCHAR2(240) ,
    INV_PAYEE_STATE                   VARCHAR2(240) ,
    INV_PAYEE_PROVINCE                VARCHAR2(480) ,
    INV_PAYEE_COUNTY                  VARCHAR2(480) ,
    INV_PAYEE_COUNTRY                 VARCHAR2(240) ,
    INV_PAYEE_ADDRESS_CONCAT          VARCHAR2(4000),
    INV_PAYEE_LE_REG_NUM              VARCHAR2(200) ,
    INV_PAYEE_TAX_REG_NUM             VARCHAR2(200) ,
    INV_PAYEE_FIRST_PARTY_REF         VARCHAR2(120) ,
    PAYMENT_HISTORY_ID                NUMBER(18, 0) ,
    PAYMENT_HISTORY_DATE              DATE              NOT NULL,
    PAYMENT_INSTRUCTION_HISTORY_ID    NUMBER(18, 0)     NOT NULL,
    PAYMENT_ID                        NUMBER(18, 0)     NOT NULL,
    PROCESSING_TYPE                   VARCHAR2(120)     NOT NULL,
    BILL_PAYABLE_FLAG                 VARCHAR2(4)       NOT NULL,
    EXCLUSIVE_PAYMENT_FLAG            VARCHAR2(4)       NOT NULL,
    PAYMENTS_COMPLETE_FLAG            VARCHAR2(4)       NOT NULL,
    STOP_CONFIRMED_FLAG               VARCHAR2(4)       NOT NULL,
    STOP_RELEASED_FLAG                VARCHAR2(4)       NOT NULL,
    STOP_REQUEST_PLACED_FLAG          VARCHAR2(4)       NOT NULL,
    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,
    OBJECT_VERSION_NUMBER             NUMBER(9, 0)      NOT NULL,
    LAST_UPDATE_LOGIN                 VARCHAR2(128) ,
    DECLARATION_OPTION                VARCHAR2(120) ,
    DCL_ONLY_FOREIGN_CURR_PMT_FLAG    VARCHAR2(4)   ,
    DECLARATION_REPORT_FORMAT_CODE    VARCHAR2(120) ,
    DECLARATION_CURR_FX_RATE_TYPE     VARCHAR2(1020),
    DECLARATION_CURRENCY_CODE         VARCHAR2(40)  ,
    DECLARATION_THRESHOLD_AMOUNT      NUMBER        ,
    PAYMENT_DETAILS_FORMULA           VARCHAR2(960) ,
    BANK_INSTRUCTION1_CODE            VARCHAR2(120)     NOT NULL,
    BANK_INSTRUCTION2_CODE            VARCHAR2(120)     NOT NULL,
    BANK_INSTRUCTION_DETAILS          VARCHAR2(1020),
    PAYMENT_TEXT_MESSAGE1             VARCHAR2(600) ,
    PAYMENT_TEXT_MESSAGE2             VARCHAR2(600) ,
    PAYMENT_SERVICE_REQUEST_ID        NUMBER(18, 0)     NOT NULL,
    PROCESS_TYPE                      VARCHAR2(120)     NOT NULL,
    PAYMENT_INSTRUCTION_ID            NUMBER(18, 0)     NOT NULL,
    PAYMENT_STATUS                    VARCHAR2(120)     NOT NULL,
    PAYMENT_FUNCTION                  VARCHAR2(120)     NOT NULL,
    PAYMENT_REASON_CODE               VARCHAR2(120)     NOT NULL,
    PAYMENT_REASON_COMMENTS           VARCHAR2(960)     NOT NULL,
    PAYMENT_DATE                      DATE          ,
    ANTICIPATED_VALUE_DATE            DATE          ,
    PAYMENT_AMOUNT                    NUMBER            NOT NULL,
    PAYMENT_CURRENCY_CODE             VARCHAR2(40)      NOT NULL,
    MATURITY_DATE                     DATE          ,
    PAYMENT_DUE_DATE                  DATE          ,
    DECLARE_PAYMENT_FLAG              VARCHAR2(4)   ,
    DECLARATION_AMOUNT                NUMBER        ,
    DISCOUNT_AMOUNT_TAKEN             NUMBER        ,
    PAYMENT_DETAILS                   VARCHAR2(960) ,
    BANK_CHARGE_BEARER                VARCHAR2(120) ,
    BANK_CHARGE_AMOUNT                NUMBER        ,
    DELIVERY_FORMAT_VALUE             VARCHAR2(320)     NOT NULL,
    SETTLEMENT_PRIORITY               VARCHAR2(120) ,
    REMITTANCE_MESSAGE1               VARCHAR2(600) ,
    REMITTANCE_MESSAGE2               VARCHAR2(600) ,
    REMITTANCE_MESSAGE3               VARCHAR2(600) ,
    PAPER_DOCUMENT_NUMBER             NUMBER(18, 0) ,
    BANK_ASSIGNED_REF_CODE            VARCHAR2(120) ,
    INT_BANK_ACCOUNT_NUMBER           VARCHAR2(120) ,
    INT_BANK_ACCOUNT_ROUTING_NUM      VARCHAR2(120) ,
    INT_BANK_ACCOUNT_IBAN_NUMBER      VARCHAR2(200) ,
    EXT_BANK_ACCOUNT_NUMBER           VARCHAR2(120) ,
    EXT_BANK_ACCOUNT_ROUTING_NUM      VARCHAR2(120) ,
    EXT_BANK_ACCOUNT_BANK_NAME        VARCHAR2(1440),
    EXT_BANK_ACCOUNT_BRANCH_NAME      VARCHAR2(1440),
    EXT_BANK_ACCOUNT_BRANCH_NUMBER    VARCHAR2(120) ,
    EXT_BANK_ACCOUNT_IBAN_NUMBER      VARCHAR2(200) ,
    EXT_BANK_ACCOUNT_SWIFT_CODE       VARCHAR2(120) ,
    EXT_PAYEE_ID                      NUMBER(18, 0) ,
    PAYEE_PARTY_ID                    NUMBER(18, 0) ,
    PARTY_SITE_ID                     NUMBER(18, 0) ,
    SUPPLIER_SITE_ID                  NUMBER(18, 0) ,
    BENEFICIARY_PARTY                 NUMBER(18, 0) ,
    ORG_ID                            NUMBER(18, 0)     NOT NULL,
    ORG_TYPE                          VARCHAR2(120) ,
    ORG_NAME                          VARCHAR2(960)     NOT NULL,
    LEGAL_ENTITY_ID                   NUMBER(18, 0)     NOT NULL,
    PARTY_NAME                        VARCHAR2(1440),
    COUNTRY                           VARCHAR2(240)     NOT NULL,
    ADDRESS1                          VARCHAR2(960) ,
    ADDRESS2                          VARCHAR2(960) ,
    ADDRESS3                          VARCHAR2(960) ,
    ADDRESS4                          VARCHAR2(960) ,
    CITY                              VARCHAR2(240) ,
    POSTAL_CODE                       VARCHAR2(240) ,
    POSTAL_PLUS4_CODE                 VARCHAR2(40)  ,
    STATE                             VARCHAR2(240) ,
    PROVINCE                          VARCHAR2(240) ,
    COUNTY                            VARCHAR2(240) ,
    UNIQUE_REMITTANCE_IDENTIFIER      VARCHAR2(1024),
    URI_CHECK_DIGIT                   VARCHAR2(8)   ,
    DOCUMENT_CATEGORY_CODE            VARCHAR2(120) ,
    DOCUMENT_SEQUENCE_ID              NUMBER        ,
    DOCUMENT_SEQUENCE_VALUE           NUMBER        ,
    STOP_CONFIRMED_BY                 NUMBER(18, 0) ,
    STOP_CONFIRM_DATE                 DATE          ,
    STOP_CONFIRM_REASON               VARCHAR2(960) ,
    STOP_CONFIRM_REFERENCE            VARCHAR2(400) ,
    STOP_RELEASED_BY                  NUMBER(18, 0) ,
    STOP_RELEASE_DATE                 DATE          ,
    STOP_RELEASE_REASON               VARCHAR2(960) ,
    STOP_RELEASE_REFERENCE            VARCHAR2(400) ,
    STOP_REQUEST_DATE                 DATE          ,
    STOP_REQUEST_PLACED_BY            NUMBER(18, 0) ,
    STOP_REQUEST_REASON               VARCHAR2(960) ,
    STOP_REQUEST_REFERENCE            VARCHAR2(400) ,
    VOIDED_BY                         NUMBER(18, 0) ,
    VOID_DATE                         DATE          ,
    VOID_REASON                       VARCHAR2(960) ,
    ATTRIBUTE_CATEGORY                VARCHAR2(600) ,
    ATTRIBUTE1                        VARCHAR2(600) ,
    ATTRIBUTE2                        VARCHAR2(600) ,
    ATTRIBUTE3                        VARCHAR2(600) ,
    ATTRIBUTE4                        VARCHAR2(600) ,
    ATTRIBUTE5                        VARCHAR2(600) ,
    ATTRIBUTE6                        VARCHAR2(600) ,
    ATTRIBUTE7                        VARCHAR2(600) ,
    ATTRIBUTE8                        VARCHAR2(600) ,
    ATTRIBUTE9                        VARCHAR2(600) ,
    ATTRIBUTE10                       VARCHAR2(600) ,
    ATTRIBUTE11                       VARCHAR2(600) ,
    ATTRIBUTE12                       VARCHAR2(600) ,
    ATTRIBUTE13                       VARCHAR2(600) ,
    ATTRIBUTE14                       VARCHAR2(600) ,
    ATTRIBUTE15                       VARCHAR2(600) ,
    INVOICING_ORG_ID                  NUMBER(18, 0) ,
    INVOICING_ORG_TYPE                VARCHAR2(120) ,
    INV_EXT_PAYEE_ID                  NUMBER(18, 0) ,
    INV_PAYEE_PARTY_ID                NUMBER(18, 0) ,
    INV_PARTY_SITE_ID                 NUMBER(18, 0) ,
    INV_SUPPLIER_SITE_ID              NUMBER(18, 0) ,
    INV_PAYEE_PARTY_NUMBER            VARCHAR2(120) ,
    INV_PAYEE_SUPPLIER_ID             NUMBER(18, 0) ,
    INV_PAYEE_SUPPLIER_NUMBER         VARCHAR2(120) ,
    INV_PAYEE_PARTY_NAME              VARCHAR2(1440),
    INV_PAYEE_ALTERNATE_NAME          VARCHAR2(1440),
    INV_PAYEE_SITE_ALT_NAME           VARCHAR2(1440),
    INV_PAYEE_SUPPLIER_SITE_NAME      VARCHAR2(960) ,
    INV_PAYEE_SPPLR_SITE_ALT_NAME     VARCHAR2(1440),
    INV_PAYEE_ADDRESS1                VARCHAR2(960) ,
    INV_PAYEE_ADDRESS2                VARCHAR2(960) ,
    INV_PAYEE_ADDRESS3                VARCHAR2(960) ,
    INV_PAYEE_ADDRESS4                VARCHAR2(960) ,
    INV_PAYEE_CITY                    VARCHAR2(240) ,
    INV_PAYEE_POSTAL_CODE             VARCHAR2(240) ,
    INV_PAYEE_STATE                   VARCHAR2(240) ,
    INV_PAYEE_PROVINCE                VARCHAR2(480) ,
    INV_PAYEE_COUNTY                  VARCHAR2(480) ,
    INV_PAYEE_COUNTRY                 VARCHAR2(240) ,
    INV_PAYEE_ADDRESS_CONCAT          VARCHAR2(4000),
    INV_PAYEE_LE_REG_NUM              VARCHAR2(200) ,
    INV_PAYEE_TAX_REG_NUM             VARCHAR2(200) ,
    INV_PAYEE_FIRST_PARTY_REF         VARCHAR2(120) ,
    CONSTRAINT pk_iby_payments_h PRIMARY KEY (PAYMENT_HISTORY_ID, PAYMENT_HISTORY_ID)
);
