Table

RetailFiscalDocument_BR

Retail Fiscal Document

Holds one retail fiscal document for Brazil, created from a retail point-of-sale transaction. It is identified by channel, store, register, transaction number, series and document number. It stores the access key, status, contingency details, tax authority messages and request/response XML. It also holds the issuing establishment, the third party, totals, and SAT device details.

Table name
RetailFiscalDocument_BR
Module
Fiscal books brazil
Table group
Transaction
Table type
Regular
Data per company
Yes
Configuration key
Retail
Primary index
Idx
Replacement key
Idx
Key fields
Channel, store, terminal, transactionId, FiscalDocumentSeries, FiscalDocumentNumber
Model
Foundation

Fields (106)

Field and descriptionType / EDT / enumMandatoryReferencesIn public entities
ChannelRetail channel the document belongs to, by system record ID.Int64
RefRecId
YesRetailChannelTable.RecIdNone
storeNumber of the store where the transaction took place.String
RetailStoreId
YesRetailStoreTable.StoreNumberNone
terminalNumber of the register (POS terminal) used.String
RetailTerminalId
YesRetailTerminalTable.terminalIdNone
transactionIdNumber of the retail transaction the document comes from.String (44)
RetailTransactionId
YesNone
FiscalDocumentSeriesSeries of the fiscal document.String (9)
FiscalDocumentSeries_BR
YesNone
FiscalDocumentNumberNumber of the fiscal document.String (20)
FiscalDocumentNumber_BR
YesNone
AccessKeyAccess key that identifies the fiscal document.String (45)
EFDocAccessKey_BR
NoNone
ApplicationVersionVersion of the application that created the document.String (20)
EFDocApplicationVersion_BR
NoNone
AuthorityCodeState code of the authority.String
LogisticsAddressStateId
NoNone
ChangeAmountChange amount given to the customer, as reported by the SAT device (in accounting currency).Real
AmountMST
NoNone
ConsumerEFDocInquiryUrlWeb address where the consumer can look up the NFC-e document.String (255)
URL
NoNone
ContingencyDateTimeDate and time when contingency mode started.UtcDateTime
ContingencyDateTime
NoNone
ContingencyDateTimeOffsetTime offset that goes with the contingency date and time.Int64
EFDocContingencyOffset_BR
NoNone
ContingencyModeContingency mode in use, such as off, SCAN, SVC-AN, SVC-RS or offline NFC-e.Enum
EFDocContingMode_BR (enum)
NoNone
ContingencyReasonFree-text reason for using contingency mode.String (255)
EFDocContingencyReason_BR
NoNone
DanfePrintFormatPrint format chosen for the DANFE, such as portrait, landscape, simplified or NFC-e.Enum
DanfePrintFormat_BR (enum)
NoNone
DataAreaIdThe company (legal entity) that the record belongs to. System field.String (4)
DataAreaId
NoNone
DirectionShows whether the document is incoming or outgoing.Enum
FiscalDocDirection_BR (enum)
YesNone
EFRRegisterNumberRegister number for CF-e, from 0 to 999, linked to the SAT device.Integer
EFRRegisterNumber_BR
NoNone
EFRSignaturePOS signature used in the XML sent to the SAT device.String (344)
EFRSignature_BR
NoNone
EnvironmentTypeEnvironment the document was sent to: testing or production.Enum
EFDocEnvironment_BR (enum)
NoNone
FEAddressBacenCodeBACEN country code of the establishment address.String (4)
BacenCode_BR
NoNone
FEAddressCityCity of the establishment address.String (60)
LogisticsAddressCityName
NoNone
FEAddressComplementBuilding complement of the establishment address.String (60)
LogisticsAddressBuildingCompliment
NoNone
FEAddressCountryCountry or region of the establishment address.String
LogisticsAddressCountryRegionId
NoNone
FEAddressDistrictDistrict of the establishment address.String (60)
LogisticsAddressDistrictName
NoNone
FEAddressIBGECodeIBGE code of the city in the establishment address.String (7)
CityIBGECode_BR
NoNone
FEAddressStateState of the establishment address.String
LogisticsAddressStateId
NoNone
FEAddressStreetStreet of the establishment address.String (250)
LogisticsAddressStreet
NoNone
FEAddressStreetNumberStreet number of the establishment address.String (20)
LogisticsAddressStreetNumber
NoNone
FEAddressZipCodeZIP or postal code of the establishment address.String
LogisticsAddressZipCodeId
NoNone
FinalUserYes/No flag showing whether the buyer is a final user.Enum
CustVendFinalUser_BR
NoYes (enum)
NoNone
FiscalDocumentAccountNumAccount number of the customer or vendor on the fiscal document.String (20)
FiscalDocumentAccountNumber_BR
NoNone
FiscalDocumentDateTimeDate and time the invoice was posted.UtcDateTime
FiscalDocumentDateTime_BR
NoNone
FiscalDocumentDateTimeOffsetTime offset that goes with the invoice date and time.Int64
FiscalDocumentDateTimeOffset_BR
NoNone
FiscalEstablishmentID of the fiscal establishment that issues the document.String
FiscalEstablishmentId_BR
YesNone
FiscalEstablishmentCCMNumCCM registration number of the establishment.String (20)
CCMNum_BR
NoNone
FiscalEstablishmentCNAECNAE activity code of the establishment.String
CNAE_BR
NoNone
FiscalEstablishmentCNPJCPFCNPJ or CPF tax number of the establishment.String (20)
CNPJCPFNum_BR
NoNone
FiscalEstablishmentIEState registration (IE) number of the establishment.String (20)
IENum_BR
NoNone
FiscalEstablishmentNameName of the establishment.String (140)
FiscalDocumentPartyName_BR
NoNone
FiscalEstablishmentPhoneTelephone number of the establishment.String (20)
Phone
NoNone
FiscalEstablishmentPostalAddressPostal address of the establishment, pointing to a record in the addresses table.Int64
LogisticsPostalAddressRecId
NoLogisticsPostalAddress.RecIdNone
FiscalEstablishmentTradeNameTrade name of the establishment, returned by the SAT device.String (140)
FiscalDocumentPartyName_BR
NoNone
MessageStatusWhere the message to the tax authority stands: waiting to send, sent or processed.Enum
EFDocMessageStatus_BR (enum)
NoNone
MessageTypeType of message sent, such as NF-e, discard, cancel or cancel by substitution.Enum
EFDocMessageType_BR (enum)
NoNone
ModelModel code of the fiscal document.String (3)
FiscalDocumentModel_BR
NoNone
NumericCodeNumeric code of the document.Integer
Integer
NoNone
OperationDescriptionShort description of the operation.String (150)
FiscalDocumentOperationDescription_BR
NoNone
OriginalAccessKeyAccess key of the original document.String (45)
EFDocAccessKey_BR
NoNone
OriginalDiscountAmountCash discount amount on the document.Real
DiscAmount
NoNone
PartitionA system field for the data partition. In most environments every record has the same value. System field.Int64
Partition
NoNone
PresenceTypeHow the buyer was present, such as in person, internet or telesales.Enum
EFDocPresenceType_BR (enum)
NoNone
ProtocolDateDate and time of the tax authority protocol.UtcDateTime
TransDateTime
NoNone
ProtocolNumberProtocol number returned for the document.String (20)
EFDocProtocolNumber_BR
NoNone
PurposePurpose of the document, such as regular, tax complement, adjustment, return, debit note or credit note.Enum
FiscalDocumentPurpose_BR (enum)
NoNone
QrcodeTextText used to build the QR code of the document.String (-1)
QrcodeText
NoNone
ReceiptNumberReceipt number of the document.String (15)
EFDocReceiptNumber_BR
NoNone
ReceiptTypeType of retail receipt, such as normal, card or customer account receipt.Enum
RetailReceipt (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
ReplicationCounterFromOriginCounter used when the record is replicated from its origin.Integer
RetailReplicationCounter
NoNone
ReturnCodeDescriptionDescription of the return code from the tax authority.String (255)
EFDocReturnCodeDescription_BR
NoNone
ReturnCodeRefRecIdPoints to the NF-e rejection code record. The label in the metadata says currency, which does not match the relation.Int64
ReturnCodeId_BR
NoEFDReturnCode_BR.RecIdNone
ReturnMessageMessage returned by SEFAZ, the tax authority.String (200)
EFDocReturnMessage_BR
NoNone
SendByEmailYes/No flag with no label. It probably shows whether the document is sent by email.low confidenceEnum
NoYes (enum)
NoNone
SoftwareHouseCNPJCNPJ of the software house.String (20)
CNPJCPFNum_BR
NoNone
StatusCurrent status of the fiscal document, such as approved, canceled, denied or rejected.Enum
FiscalDocumentStatus_BR (enum)
YesNone
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
TaxAuthorityInfoObservations from the tax authority, sent by the SAT device.String (-1)
EFRTaxAuthorityInfo_BR
NoNone
TechnicalResponsibleCNPJCNPJ of the technical responsible party.String (14)
TechResponsibleCNPJ_BR
NoNone
TechnicalResponsibleContactNameContact name of the technical responsible party.String (60)
TechResponsibleContactName_BR
NoNone
TechnicalResponsibleEmailEmail address of the technical responsible party.String (60)
TechResponsibleEmail_BR
NoNone
TechnicalResponsiblePhonePhone number of the technical responsible party.String (14)
TechResponsiblePhone_BR
NoNone
ThirdPartyAddressBacenCodeBACEN country code of the third party address.String (4)
BacenCode_BR
NoNone
ThirdPartyAddressCityCity of the third party address.String (60)
LogisticsAddressCityName
NoNone
ThirdPartyAddressComplementBuilding complement of the third party address.String (60)
LogisticsAddressBuildingCompliment
NoNone
ThirdPartyAddressCountryCountry or region of the third party address.String
LogisticsAddressCountryRegionId
YesNone
ThirdPartyAddressCountryRegionIdCountry or region ID of the third party address.String
LogisticsAddressCountryRegionId
NoNone
ThirdPartyAddressDistrictDistrict of the third party address.String (60)
LogisticsAddressDistrictName
NoNone
ThirdPartyAddressIBGECodeIBGE code of the city in the third party address.String (7)
CityIBGECode_BR
NoNone
ThirdPartyAddressStateState of the third party address.String
LogisticsAddressStateId
NoNone
ThirdPartyAddressStreetStreet of the third party address.String (250)
LogisticsAddressStreet
NoNone
ThirdPartyAddressStreetNumberStreet number of the third party address.String (20)
LogisticsAddressStreetNumber
NoNone
ThirdPartyAddressZipCodeZIP or postal code of the third party address.String
LogisticsAddressZipCodeId
NoNone
ThirdPartyCNPJCPFCNPJ or CPF tax number of the third party.String (20)
CNPJCPFNum_BR
NoNone
ThirdPartyEmailContact number or email address of the third party.String (255)
LogisticsElectronicAddressLocator
NoNone
ThirdPartyForeignerIdID of the third party when they are a foreigner.String (20)
EFDocForeignerId_BR
NoNone
ThirdPartyFormattedAddressFull third party address as one formatted text.String (250)
Addressing
NoNone
ThirdPartyICMSContributorYes or no flag showing whether the third party is a contributor to ICMS, a Brazilian tax.Enum
ICMSContributor_BR
NoYes (enum)
NoNone
ThirdPartyIEState registration (IE) number of the third party.String (20)
IENum_BR
NoNone
ThirdPartyNameName of the third party, usually the customer.String (140)
FiscalDocumentPartyName_BR
NoNone
ThirdPartyPhoneTelephone number of the third party.String (20)
Phone
NoNone
ThirdPartyPostalAddressPostal address of the third party, pointing to a record in the addresses table.Int64
LogisticsPostalAddressRecId
NoLogisticsPostalAddress.RecIdNone
TotalAmountTotal amount of the document, in accounting currency.Real
AmountMST
NoNone
TotalDiscountAmountTotal discount on the document.Real
DiscAmount
NoNone
TotalGoodsAmountTotal amount of products on the document.Real
InvoiceGoodsAmount_BR
NoNone
TotalMarkupFreightAmountFreight charges on the document.Real
MarkupSumFreight_BR
NoNone
TotalMarkupInsuranceAmountInsurance charges on the document.Real
MarkupSumInsurance_BR
NoNone
TotalMarkupOtherAmountOther charges on the document.Real
MarkupSumOthers_BR
NoNone
TotalServicesAmountTotal amount of services on the document.Real
InvoiceServicesAmount_BR
NoNone
XmlRequestXML request sent to the tax authority.String (-1)
EFDocXML_BR
NoNone
XmlResponseXML response received from the tax authority.String (-1)
EFDocXML_BR
NoNone
XmlReturnRequestXML request sent for the return.String (-1)
EFDocXML_BR
NoNone
XmlReturnResponseXML response received for the return.String (-1)
EFDocXML_BR
NoNone

Indexes (2)

Relations (7)

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

  • EFDReturnCode_BR → EFDReturnCode_BR

    Join on ReturnCodeRefRecId = EFDReturnCode_BR.RecId

    Many RetailFiscalDocument_BR records → zero or one EFDReturnCode_BR record

  • FiscalEstablishmentPostalAddress → LogisticsPostalAddress

    Join on FiscalEstablishmentPostalAddress = LogisticsPostalAddress.RecId

    Many RetailFiscalDocument_BR records → zero or one LogisticsPostalAddress record

  • RetailChannelTable → RetailChannelTable

    Join on Channel = RetailChannelTable.RecId

    Many RetailFiscalDocument_BR records → exactly one RetailChannelTable record

  • RetailStoreTable → RetailStoreTable

    Join on store = RetailStoreTable.StoreNumber

    Many RetailFiscalDocument_BR records → exactly one RetailStoreTable record

  • RetailTerminalTable → RetailTerminalTable

    Join on terminal = RetailTerminalTable.terminalId

    Many RetailFiscalDocument_BR records → exactly one RetailTerminalTable record

  • RetailTransactionTable → RetailTransactionTable

    Join on terminal = RetailTransactionTable.BatchTerminalId, store = RetailTransactionTable.store, transactionId = RetailTransactionTable.transactionId

    Zero or one RetailFiscalDocument_BR record → zero or one RetailTransactionTable record

  • ThirdPartyPostalAddress → LogisticsPostalAddress

    Join on ThirdPartyPostalAddress = LogisticsPostalAddress.RecId

    Many RetailFiscalDocument_BR records → zero or one LogisticsPostalAddress record

Get this data out

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

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

Email sales@drdynamics.co.uk