Table

FiscalDocument_BR

Fiscal document header

Header record for a fiscal document in Brazil. It holds the document number, series, status and direction (incoming or outgoing), plus the issuer, third party, delivery and carrier details and total amounts. Its key combines fiscal establishment, direction, status, series, number, voucher and third party CNPJ/CPF. It links to source records such as customer invoices and packing slips.

Table name
FiscalDocument_BR
Module
Fiscal books brazil
Table group
Transaction
Table type
Regular
Data per company
Yes
Configuration key
None
Primary index
None
Replacement key
FiscalDocument_BR
Key fields
FiscalEstablishment, Direction, Status, FiscalDocumentSeries, FiscalDocumentNumber, Voucher, ThirdPartyCNPJCPF
Model
FiscalBooks

Fields (102)

Field and descriptionType / EDT / enumMandatoryReferencesIn public entities
FiscalEstablishmentID of the fiscal establishment, pointing to the fiscal establishment record.String
FiscalEstablishmentId_BR
NoFiscalEstablishment_BR.FiscalEstablishmentIdNone
DirectionShows whether the document is incoming or outgoing.Enum
FiscalDocDirection_BR (enum)
NoNone
StatusStatus of the document, such as approved, cancelled, denied or rejected.Enum
FiscalDocumentStatus_BR (enum)
NoNone
FiscalDocumentSeriesSeries of the fiscal document.String (9)
FiscalDocumentSeries_BR
NoNone
FiscalDocumentNumberNumber of the fiscal document.String (20)
FiscalDocumentNumber_BR
NoNone
VoucherVoucher number of the document.String (20)
Voucher
NoNone
ThirdPartyCNPJCPFCNPJ or CPF tax number of the third party.String (20)
CNPJCPFNum_BR
NoNone
AccessKeyAccess key that identifies the fiscal document.String (45)
EFDocAccessKey_BR
NoNone
AccountingDateDate the document was posted.Date
TransDate
YesNone
ApplicationVersionVersion of the application that produced the document.String (20)
EFDocApplicationVersion_BR
NoNone
AuditedByUser who reviewed the document.String
UserId
NoNone
AuditedDateTimeDate and time of the review.UtcDateTime
UTCTimestamp
NoNone
CancelAccessKeyAccess key related to the cancellation.String (45)
EFDocAccessKey_BR
NoNone
CancelAccountingDateAccounting date of the cancellation.Date
AccountingDate
NoNone
CancelInventoryVoucherIdCosting voucher number created by the cancellation.String (20)
Voucher
NoNone
CancelReasonCommentFree-text comment giving the reason for cancellation.String (255)
ReasonComment_BR
NoNone
CancelTaxAuthorityInfoFree-text observations from the tax authority, sent by SAT hardware.String (-1)NoNone
CancelVoucherIdVoucher number created by the cancellation.String (20)
Voucher
NoNone
CFPSIdCFPS code, a four-character code on the document.String (4)
CFPSId_BR
NoNone
CityWhereServicePerformedCity where the service was performed, pointing to a city record.Int64
LogisticsAddressCityRecId
NoLogisticsAddressCity.RecIdNone
ComplementaryTypeType of complementary document: none, price or tax.Enum
InvoiceComplementaryType_BR (enum)
NoNone
ComplementedFiscalDocumentPoints to the fiscal document that this one complements.Int64
RefRecId
NoFiscalDocument_BR.RecIdNone
CorrectionLetterYes/no flag labelled as manual ICMS ST tax amount; the field name suggests a correction letter, so the meaning is unclear.low confidenceEnum
NoYes (enum)
NoNone
CreatedByThe user who created the record. System field.String (20)
CreatedBy
NoNone
CreatedDateTimeThe date and time when the record was created. System field.UtcDateTime
CreatedDateTime
NoNone
DataAreaIdThe company (legal entity) that the record belongs to. System field.String (4)
DataAreaId
NoNone
DebitCreditNoteTypeBusiness type of a debit or credit note, such as return, advance payment or fine and interest.Enum
FiscalDocumentBusinessType_BR (enum)
NoNone
DeliveryCNPJCPFCNPJ or CPF tax number of the delivery party.String (20)
CNPJCPFNum_BR
NoNone
DeliveryIEState registration number (IE) of the delivery party.String (20)
IENum_BR
NoNone
DeliveryLogisticsPostalAddressDelivery postal address, pointing to an address record.Int64
LogisticsPostalAddressRecId
NoLogisticsPostalAddress.RecIdNone
DeliveryModeMode of delivery, pointing to a delivery mode record.String
FiscalDocumentDlvModeId_BR
NoDlvMode.CodeNone
DeliveryTermTerms of delivery, pointing to a delivery terms record.String
FiscalDocumentDlvTermId_BR
NoDlvTerm.CodeNone
FinalUserYes/no flag showing whether the party is the final user.Enum
CustVendFinalUser_BR
NoYes (enum)
NoNone
FiscalDocumentAccountNumCustomer or vendor account number the document relates to.String (20)
FiscalDocumentAccountNumber_BR
NoCustTable.AccountNumVendTable.AccountNumNone
FiscalDocumentAccountTypeType of account: customer, vendor or fiscal establishment.Enum
CustVendType_BR (enum)
YesNone
FiscalDocumentDateDate of the fiscal document.Date
FiscalDocumentDate_BR
NoNone
FiscalDocumentDateTimeDate and time the invoice was posted.UtcDateTime
FiscalDocumentDateTime_BR
NoNone
FiscalDocumentDateTimeOffsetTime offset for the invoice date and time.Int64
FiscalDocumentDateTimeOffset_BR
NoNone
FiscalDocumentFormatPoints to the fiscal document type setup record.Int64
RefRecId
NoFiscalDocumentFormat_BR.RecIdNone
FiscalDocumentIssuerWho issued the document: the fiscal establishment or a third party.Enum
FiscalDocumentIssuer_BR (enum)
NoNone
FiscalEstablishmentCCMNumCCM municipal registration number of the fiscal establishment.String (20)
CCMNum_BR
NoNone
FiscalEstablishmentCNPJCPFCNPJ or CPF tax number of the fiscal establishment.String (20)
CNPJCPFNum_BR
NoNone
FiscalEstablishmentIEState registration number (IE) of the fiscal establishment.String (20)
IENum_BR
NoNone
FiscalEstablishmentNameName of the fiscal establishment.String (140)
FiscalDocumentPartyName_BR
NoNone
FiscalEstablishmentPhoneTelephone number of the fiscal establishment.String (20)
Phone
NoNone
FiscalEstablishmentPostalAddressPostal address of the fiscal establishment, pointing to an address record.Int64
LogisticsPostalAddressRecId
NoLogisticsPostalAddress.RecIdNone
FiscalEstablishmentTribSubstitutionRegTributary substitution registry number of the fiscal establishment.String (20)
TributarySubstitutionRegistry_BR
NoNone
FreightChargeTermsWho pays for freight: prepaid, collect, third party or no freight.Enum
FiscalDocumentFreightTerms_BR (enum)
NoNone
ImportDeclarationPoints to the import declaration linked to the document.Int64
ImportDeclarationRecId_BR
NoPurchImportDeclaration_BR.RecIdNone
InventoryVoucherCosting voucher number of the document.String (20)
Voucher
NoNone
IsServiceLocationForeign_BRYes/no flag showing whether the service location is foreign.Enum
ServiceLocationForeign_BR
NoYes (enum)
NoNone
MissingNIFReasonType_BRReason why no foreigner ID (NIF) was given.Enum
MissingNIFReasonType_BR (enum)
NoNone
ModelDocument model code, pointing to the document model record.String (3)
FiscalDocumentModel_BR
NoFiscalDocModel_BR.ModelNone
ModifiedByThe user who last changed the record. System field.String (20)
ModifiedBy
NoNone
ModifiedDateTimeThe date and time when the record was last changed. System field.UtcDateTime
ModifiedDateTime
NoNone
NumericCodeNumeric code on the document; its exact meaning is not stated in the metadata.low confidenceInteger
Integer
NoNone
OperationDescriptionShort text describing the operation.String (150)
FiscalDocumentOperationDescription_BR
NoNone
PackingBrandBrand shown on the packing.String
DlvTransportBrand_BR
NoNone
PartitionA system field for the data partition. In most environments every record has the same value. System field.Int64
Partition
NoNone
PaymentAmountPayment amount, in transaction currency.Real
AmountCur
NoNone
PaymentMethodMethod of payment, such as money, cheque or credit card.Enum
EFDocPaymentMethod_BR (enum)
NoNone
PresenceTypeHow the buyer was present for the sale, such as in person, internet or telesales.Enum
EFDocPresenceType_BR (enum)
NoNone
PreviousVersionYes/no flag with no label; its purpose is not clear from the metadata.low confidenceEnum
NoYesId
NoYes (enum)
NoNone
PurposePurpose of the document, such as regular, tax complement, return or credit note.Enum
FiscalDocumentPurpose_BR (enum)
NoNone
RecIdA unique number that the system gives to every record. Other tables often use it to point to this record. System field.Int64
RecId
NoNone
RecVersionA system number that changes each time the record is updated. It is used to detect conflicting updates. System field.Integer
RecVersion
NoNone
RefRecIdRecord ID of the source record, such as a customer invoice journal.Int64
RefRecId
NoNone
RefTableIdTable ID of the source record that the document refers to.Integer
RefTableId
NoNone
SalesCarrierPoints to the carrier record.Int64
RefRecId
NoSalesCarrier.RecIdNone
SalesCarrierLogisticsPostalAddressPostal address of the carrier, pointing to an address record.Int64
LogisticsPostalAddressRecId
NoLogisticsPostalAddress.RecIdNone
ServiceLocationDomestic_BRDomestic service location, pointing to a city record.Int64
RefRecId
NoLogisticsAddressCity.RecIdNone
ServiceLocationNonDomestic_BRForeign service location, pointing to a country or region record.String
LogisticsAddressCountryRegionId
NoLogisticsAddressCountryRegion.CountryRegionIdNone
SpecieSpecie (document kind) code: NFF, NF, CTRC or CF.Enum
FiscalDocumentSpecie_BR (enum)
NoNone
SubstitutionAccessKeyAccess key of the document that is a substitution.String (45)
EFDocAccessKey_BR
NoNone
SysRowVersionA system row version number that is used for change tracking. System field.Int64
SysRowVersion
NoNone
TableIdA system number that identifies the table. System field.Integer
TableId
NoNone
ThirdPartyCCMNumCCM municipal registration number of the third party.String (20)
CCMNum_BR
NoNone
ThirdPartyEmailEmail address of the third party.String (255)
LogisticsElectronicAddressLocator
NoNone
ThirdPartyFaxFax number of the third party.String (20)
TeleFax
NoNone
ThirdPartyForeignerIdForeigner ID of the third party.String (20)
EFDocForeignerId_BR
NoNone
ThirdPartyICMSContributorYes/no flag showing whether the third party is an ICMS contributor.Enum
ICMSContributor_BR
NoYes (enum)
NoNone
ThirdPartyIEState registration number (IE) of the third party.String (20)
IENum_BR
NoNone
ThirdPartyNameName of the third party.String (140)
FiscalDocumentPartyName_BR
NoNone
ThirdPartyPhoneTelephone number of the third party.String (20)
Phone
NoNone
ThirdPartyPostalAddressPostal address of the third party, pointing to an address record.Int64
LogisticsPostalAddressRecId
NoLogisticsPostalAddress.RecIdNone
ThirdPartySalesDigitalPlatformYes/no flag showing whether the sale was made through a third-party digital platform or marketplace.Enum
ThirdPartySalesDigitalPlatform_BR
NoYes (enum)
NoNone
ThirdPartySalesDigitalPlatformCNPJCNPJ number of the digital platform or marketplace provider.String (20)
ThirdPartySalesDigitalPlatformCNPJ_BR
NoNone
ThirdPartySalesDigitalPlatformSalesResponsibleName or ID of the person responsible for the sale on the digital platform.String (160)
ThirdPartySalesDigitalPlatformSalesResponsible_BR
NoNone
TotalAmountTotal amount of the document, in accounting currency.Real
AmountMST
NoNone
TotalDiscountAmountTotal discount on the document.Real
FiscalDocumentDiscAmount_BR
NoNone
TotalGoodsAmountTotal amount for products.Real
InvoiceGoodsAmount_BR
NoNone
TotalMarkupFreightAmountFreight charge total.Real
MarkupSumFreight_BR
NoNone
TotalMarkupInsuranceAmountInsurance charge total.Real
MarkupSumInsurance_BR
NoNone
TotalMarkupOtherAmountTotal of other charges.Real
MarkupSumOthers_BR
NoNone
TotalServicesAmountTotal amount for services.Real
InvoiceServicesAmount_BR
NoNone
TotalSuframaDiscountCOFINSAmountTotal SUFRAMA discount applied to COFINS.Real
FiscalDocumentDiscAmount_BR
NoNone
TotalSuframaDiscountICMSAmountTotal SUFRAMA discount applied to ICMS.Real
FiscalDocumentDiscAmount_BR
NoNone
TotalSuframaDiscountPISAmountTotal SUFRAMA discount applied to PIS.Real
FiscalDocumentDiscAmount_BR
NoNone
TypeOfCTeType of CT-e (transport document), such as normal or add-on values.Enum
TypeOfCTe_BR (enum)
NoNone
VehicleLicensePlateNumberLicence plate number of the carrier's vehicle.String
DlvNoOfCarrier_BR
NoNone
VehicleLicensePlateStateState where the vehicle is registered.String
DlvStateRegistered_BR
NoNone
VersionVersion of the document layout: unknown or version 1.Enum
FiscalDocumentVersion_BR (enum)
NoNone

Indexes (10)

Relations (26)

Each relation joins FiscalDocument_BR to another table on the fields shown.

  • CompanyInfo → CompanyInfo

    Join on dataAreaId = CompanyInfo.DataArea

    Many FiscalDocument_BR records → exactly one CompanyInfo record

  • ComplementedFiscalDocument → FiscalDocument_BR

    Join on ComplementedFiscalDocument = FiscalDocument_BR.RecId

    Many FiscalDocument_BR records → zero or one FiscalDocument_BR record

  • DeliveryLogisticsPostalAddress → LogisticsPostalAddress

    Join on DeliveryLogisticsPostalAddress = LogisticsPostalAddress.RecId

    Many FiscalDocument_BR records → zero or one LogisticsPostalAddress record

  • FiscalDocModel_BR → FiscalDocModel_BR

    Join on Model = FiscalDocModel_BR.Model

    Many FiscalDocument_BR records → zero or one FiscalDocModel_BR record

  • FiscalEstablishment → FiscalEstablishment_BR

    Join on FiscalEstablishment = FiscalEstablishment_BR.FiscalEstablishmentId

    Many FiscalDocument_BR records → exactly one FiscalEstablishment_BR record

  • FiscalEstablishmentPostalAddress → LogisticsPostalAddress

    Join on FiscalEstablishmentPostalAddress = LogisticsPostalAddress.RecId

    Many FiscalDocument_BR records → zero or one LogisticsPostalAddress record

  • LogisticsAddresssCity → LogisticsAddressCity

    Join on CityWhereServicePerformed = LogisticsAddressCity.RecId

    Exactly one FiscalDocument_BR record → exactly one LogisticsAddressCity record

  • SalesCarrierLogisticsPostalAddress → LogisticsPostalAddress

    Join on SalesCarrierLogisticsPostalAddress = LogisticsPostalAddress.RecId

    Many FiscalDocument_BR records → zero or one LogisticsPostalAddress record

  • ThirdPartyPostalAddress → LogisticsPostalAddress

    Join on ThirdPartyPostalAddress = LogisticsPostalAddress.RecId

    Many FiscalDocument_BR records → zero or one LogisticsPostalAddress record

  • FiscalDocumentAccountNumCustTable → CustTable

    Join on FiscalDocumentAccountNum = CustTable.AccountNum, FiscalDocumentAccountType = null

    Many FiscalDocument_BR records → zero or one CustTable record

  • FiscalDocumentAccountNumVendTable → VendTable

    Join on FiscalDocumentAccountNum = VendTable.AccountNum, FiscalDocumentAccountType = 1

    Many FiscalDocument_BR records → zero or one VendTable record

  • PurchImportDeclaration_BR → PurchImportDeclaration_BR

    Join on ImportDeclaration = PurchImportDeclaration_BR.RecId

    Many FiscalDocument_BR records → zero or one PurchImportDeclaration_BR record

  • RefCustInvoiceJour → CustInvoiceJour

    Join on RefTableId = CustInvoiceJour.TableId, RefRecId = CustInvoiceJour.RecId

    Zero or one FiscalDocument_BR record → zero or one CustInvoiceJour record

  • RefCustPackingSlipJour → CustPackingSlipJour

    Join on RefTableId = CustPackingSlipJour.TableId, RefRecId = CustPackingSlipJour.RecId

    Zero or one FiscalDocument_BR record → zero or one CustPackingSlipJour record

  • RefInventTransferJour → InventTransferJour

    Join on RefTableId = InventTransferJour.TableId, RefRecId = InventTransferJour.RecId

    Zero or one FiscalDocument_BR record → zero or one InventTransferJour record

  • RefProjInvoiceJour → ProjInvoiceJour

    Join on RefTableId = ProjInvoiceJour.TableId, RefRecId = ProjInvoiceJour.RecId

    Zero or one FiscalDocument_BR record → zero or one ProjInvoiceJour record

  • RefPurchComplementaryInvoice → PurchComplementaryInvoiceHeader

    Join on RefTableId = PurchComplementaryInvoiceHeader.TableId, RefRecId = PurchComplementaryInvoiceHeader.RecId

    Zero or one FiscalDocument_BR record → zero or one PurchComplementaryInvoiceHeader record

  • RefSalesComplementaryInvoice → SalesComplementaryInvoiceHeader

    Join on RefTableId = SalesComplementaryInvoiceHeader.TableId, RefRecId = SalesComplementaryInvoiceHeader.RecId

    Zero or one FiscalDocument_BR record → zero or one SalesComplementaryInvoiceHeader record

  • RefTaxFiscalDocument_BR → TaxFiscalDocument_BR

    Join on RefTableId = TaxFiscalDocument_BR.TableId, RefRecId = TaxFiscalDocument_BR.RecId

    Zero or one FiscalDocument_BR record → zero or one TaxFiscalDocument_BR record

  • RefVendInvoiceJour → VendInvoiceJour

    Join on RefTableId = VendInvoiceJour.TableId, RefRecId = VendInvoiceJour.RecId

    Zero or one FiscalDocument_BR record → zero or one VendInvoiceJour record

  • DeliveryMode → DlvMode

    Join on DeliveryMode = DlvMode.Code

    Many FiscalDocument_BR records → zero or one DlvMode record

  • DeliveryTerms → DlvTerm

    Join on DeliveryTerm = DlvTerm.Code

    Many FiscalDocument_BR records → zero or one DlvTerm record

  • SalesCarrier → SalesCarrier

    Join on SalesCarrier = SalesCarrier.RecId

    Many FiscalDocument_BR records → zero or one SalesCarrier record

  • FiscalDocumentFormat → FiscalDocumentFormat_BR

    Join on FiscalDocumentFormat = FiscalDocumentFormat_BR.RecId

    Many FiscalDocument_BR records → zero or one FiscalDocumentFormat_BR record

  • ServiceLocation_LogisticsAddressCity → LogisticsAddressCity

    Join on ServiceLocationDomestic_BR = LogisticsAddressCity.RecId

    Many FiscalDocument_BR records → exactly one LogisticsAddressCity record

  • ServiceLocation_LogisticsAddressCountryRegion → LogisticsAddressCountryRegion

    Join on ServiceLocationNonDomestic_BR = LogisticsAddressCountryRegion.CountryRegionId

    Many FiscalDocument_BR records → exactly one LogisticsAddressCountryRegion record

Get this data out

No public entity reads from FiscalDocument_BR. Its data is only reachable through the application, a custom entity or a database export.

Need help with FiscalDocument_BR in a report, an integration or a migration? Talk to Dr Dynamics.

Email sales@drdynamics.co.uk