CREATE TABLE jg_fscl_doc_relations_all (
    DOC_RELATION_ID                   NUMBER(18, 0) ,
    FISCAL_DOC_KEY                    VARCHAR2(256)     NOT NULL,
    FISCAL_DOC_TYPE                   VARCHAR2(120)     NOT NULL,
    DOC_HDR_ID                        NUMBER(18, 0)     NOT NULL,
    APPLICATION_ID                    NUMBER(18, 0)     NOT NULL,
    ENTITY_CODE                       VARCHAR2(120)     NOT NULL,
    EVENT_CLASS_CODE                  VARCHAR2(120)     NOT NULL,
    TRX_ID                            NUMBER(18, 0)     NOT NULL,
    DOC_NUM                           NUMBER(18, 0) ,
    SERIES                            VARCHAR2(40)  ,
    FISCAL_DOC_DATE                   DATE              NOT NULL,
    MODEL                             VARCHAR2(12)  ,
    DELIVERY_NOTE_PRINTING_FORMAT     VARCHAR2(120) ,
    DOC_ISSUE_TYPE                    VARCHAR2(120) ,
    DOC_NATURE                        VARCHAR2(120) ,
    DOC_GEN_PROCESS                   VARCHAR2(120) ,
    CONTINGENCY_DATE                  DATE          ,
    CONTINGENCY_JUSTIFICATION         VARCHAR2(960) ,
    VOID_DATE                         DATE          ,
    STATUS                            VARCHAR2(120) ,
    REJECTION_REASON                  VARCHAR2(960) ,
    REF_DOC_HDR_ID                    NUMBER(18, 0) ,
    REF_DOC_NUM                       NUMBER(18, 0) ,
    REF_FISCAL_DOC_KEY                VARCHAR2(200) ,
    REF_FISCAL_DOC_DATE               DATE          ,
    REF_MODEL                         VARCHAR2(12)  ,
    REF_SERIES                        VARCHAR2(40)  ,
    REF_ISSUER_TAXPAYER_ID            VARCHAR2(120) ,
    REF_RURAL_FLAG                    VARCHAR2(4)   ,
    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) ,
    REQUEST_ID                        NUMBER(18, 0) ,
    OBJECT_VERSION_NUMBER             NUMBER(9, 0)      NOT NULL,
    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) ,
    ATTRIBUTE_CATEGORY                VARCHAR2(120) ,
    ATTRIBUTE_NUMBER1                 NUMBER        ,
    ATTRIBUTE_NUMBER2                 NUMBER        ,
    ATTRIBUTE_NUMBER3                 NUMBER        ,
    ATTRIBUTE_NUMBER4                 NUMBER        ,
    ATTRIBUTE_NUMBER5                 NUMBER        ,
    ATTRIBUTE_DATE1                   DATE          ,
    ATTRIBUTE_DATE2                   DATE          ,
    ATTRIBUTE_DATE3                   DATE          ,
    ATTRIBUTE_DATE4                   DATE          ,
    ATTRIBUTE_DATE5                   DATE          ,
    REFERENCE_RECORD_TYPE             VARCHAR2(120) ,
    JOB_DEFINITION_NAME               VARCHAR2(400) ,
    JOB_DEFINITION_PACKAGE            VARCHAR2(3600),
    GLOBAL_ATTRIBUTE1                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE2                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE3                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE4                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE5                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE6                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE7                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE8                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE9                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE10                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE11                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE12                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE13                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE14                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE15                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE16                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE17                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE18                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE19                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE20                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE_CATEGORY         VARCHAR2(120) ,
    GLOBAL_ATTRIBUTE_NUMBER1          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER2          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER3          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER4          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER5          NUMBER        ,
    GLOBAL_ATTRIBUTE_DATE1            DATE          ,
    GLOBAL_ATTRIBUTE_DATE2            DATE          ,
    GLOBAL_ATTRIBUTE_DATE3            DATE          ,
    GLOBAL_ATTRIBUTE_DATE4            DATE          ,
    GLOBAL_ATTRIBUTE_DATE5            DATE          ,
    RPS_NUMBER                        NUMBER        ,
    SRVC_INVOICE_VERIFICATION_CODE    VARCHAR2(1020),
    VOID_REASON                       VARCHAR2(960) ,
    CANCEL_REASON                     VARCHAR2(960) ,
    CONTINGENCY_TYPE                  VARCHAR2(8)   ,
    DOC_LINE_ID                       NUMBER(18, 0)     NOT NULL,
    PROCESSED_DATE_TIME               TIMESTAMP(6)  ,
    PROTOCOL_NUMBER                   NUMBER(18, 0) ,
    TAX_INVOICE_NUMBER_FLAG           VARCHAR2(4)   ,
    CONTINGENCY_SERIES                NUMBER(18, 0) ,
    SENDING_FILE_NAME                 VARCHAR2(240) ,
    RECEIVED_FILE_NAME                VARCHAR2(240) ,
    REF_DOC_ISSUER_STATE_CODE         VARCHAR2(120) ,
    TAX_AUTH_DOC_NUMBER               NUMBER(18, 0) ,
    TAX_SETTLEMENT_DATE               DATE          ,
    LEGAL_REPORTING_UNIT_ID           NUMBER(18, 0) ,
    PREVIOUS_FISCAL_DOC_KEY1          VARCHAR2(256) ,
    PREVIOUS_FISCAL_DOC_KEY2          VARCHAR2(256) ,
    NATIONAL_SERVICE_FSCL_DOC_KEY     VARCHAR2(320) ,
    CANCEL_REASON_CODE                VARCHAR2(120) ,
    TAX_AUTHORITY_DOC_NUMBER          VARCHAR2(480) ,
    DOC_RELATION_ID                   NUMBER(18, 0) ,
    FISCAL_DOC_KEY                    VARCHAR2(256)     NOT NULL,
    FISCAL_DOC_TYPE                   VARCHAR2(120)     NOT NULL,
    DOC_HDR_ID                        NUMBER(18, 0)     NOT NULL,
    APPLICATION_ID                    NUMBER(18, 0)     NOT NULL,
    ENTITY_CODE                       VARCHAR2(120)     NOT NULL,
    EVENT_CLASS_CODE                  VARCHAR2(120)     NOT NULL,
    TRX_ID                            NUMBER(18, 0)     NOT NULL,
    DOC_NUM                           NUMBER(18, 0) ,
    SERIES                            VARCHAR2(40)  ,
    FISCAL_DOC_DATE                   DATE              NOT NULL,
    MODEL                             VARCHAR2(12)  ,
    DELIVERY_NOTE_PRINTING_FORMAT     VARCHAR2(120) ,
    DOC_ISSUE_TYPE                    VARCHAR2(120) ,
    DOC_NATURE                        VARCHAR2(120) ,
    DOC_GEN_PROCESS                   VARCHAR2(120) ,
    CONTINGENCY_DATE                  DATE          ,
    CONTINGENCY_JUSTIFICATION         VARCHAR2(960) ,
    VOID_DATE                         DATE          ,
    STATUS                            VARCHAR2(120) ,
    REJECTION_REASON                  VARCHAR2(960) ,
    REF_DOC_HDR_ID                    NUMBER(18, 0) ,
    REF_DOC_NUM                       NUMBER(18, 0) ,
    REF_FISCAL_DOC_KEY                VARCHAR2(200) ,
    REF_FISCAL_DOC_DATE               DATE          ,
    REF_MODEL                         VARCHAR2(12)  ,
    REF_SERIES                        VARCHAR2(40)  ,
    REF_ISSUER_TAXPAYER_ID            VARCHAR2(120) ,
    REF_RURAL_FLAG                    VARCHAR2(4)   ,
    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) ,
    REQUEST_ID                        NUMBER(18, 0) ,
    OBJECT_VERSION_NUMBER             NUMBER(9, 0)      NOT NULL,
    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) ,
    ATTRIBUTE_CATEGORY                VARCHAR2(120) ,
    ATTRIBUTE_NUMBER1                 NUMBER        ,
    ATTRIBUTE_NUMBER2                 NUMBER        ,
    ATTRIBUTE_NUMBER3                 NUMBER        ,
    ATTRIBUTE_NUMBER4                 NUMBER        ,
    ATTRIBUTE_NUMBER5                 NUMBER        ,
    ATTRIBUTE_DATE1                   DATE          ,
    ATTRIBUTE_DATE2                   DATE          ,
    ATTRIBUTE_DATE3                   DATE          ,
    ATTRIBUTE_DATE4                   DATE          ,
    ATTRIBUTE_DATE5                   DATE          ,
    REFERENCE_RECORD_TYPE             VARCHAR2(120) ,
    JOB_DEFINITION_NAME               VARCHAR2(400) ,
    JOB_DEFINITION_PACKAGE            VARCHAR2(3600),
    GLOBAL_ATTRIBUTE1                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE2                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE3                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE4                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE5                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE6                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE7                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE8                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE9                 VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE10                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE11                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE12                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE13                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE14                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE15                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE16                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE17                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE18                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE19                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE20                VARCHAR2(600) ,
    GLOBAL_ATTRIBUTE_CATEGORY         VARCHAR2(120) ,
    GLOBAL_ATTRIBUTE_NUMBER1          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER2          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER3          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER4          NUMBER        ,
    GLOBAL_ATTRIBUTE_NUMBER5          NUMBER        ,
    GLOBAL_ATTRIBUTE_DATE1            DATE          ,
    GLOBAL_ATTRIBUTE_DATE2            DATE          ,
    GLOBAL_ATTRIBUTE_DATE3            DATE          ,
    GLOBAL_ATTRIBUTE_DATE4            DATE          ,
    GLOBAL_ATTRIBUTE_DATE5            DATE          ,
    RPS_NUMBER                        NUMBER        ,
    SRVC_INVOICE_VERIFICATION_CODE    VARCHAR2(1020),
    VOID_REASON                       VARCHAR2(960) ,
    CANCEL_REASON                     VARCHAR2(960) ,
    CONTINGENCY_TYPE                  VARCHAR2(8)   ,
    DOC_LINE_ID                       NUMBER(18, 0)     NOT NULL,
    PROCESSED_DATE_TIME               TIMESTAMP(6)  ,
    PROTOCOL_NUMBER                   NUMBER(18, 0) ,
    TAX_INVOICE_NUMBER_FLAG           VARCHAR2(4)   ,
    CONTINGENCY_SERIES                NUMBER(18, 0) ,
    SENDING_FILE_NAME                 VARCHAR2(240) ,
    RECEIVED_FILE_NAME                VARCHAR2(240) ,
    REF_DOC_ISSUER_STATE_CODE         VARCHAR2(120) ,
    TAX_AUTH_DOC_NUMBER               NUMBER(18, 0) ,
    TAX_SETTLEMENT_DATE               DATE          ,
    LEGAL_REPORTING_UNIT_ID           NUMBER(18, 0) ,
    PREVIOUS_FISCAL_DOC_KEY1          VARCHAR2(256) ,
    PREVIOUS_FISCAL_DOC_KEY2          VARCHAR2(256) ,
    NATIONAL_SERVICE_FSCL_DOC_KEY     VARCHAR2(320) ,
    CANCEL_REASON_CODE                VARCHAR2(120) ,
    TAX_AUTHORITY_DOC_NUMBER          VARCHAR2(480) ,
    CONSTRAINT pk_jg_fscl_doc_relations_all PRIMARY KEY (DOC_RELATION_ID, DOC_RELATION_ID)
);
