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 description | Type / EDT / enum | Mandatory | References | In public entities |
|---|---|---|---|---|
ChannelRetail channel the document belongs to, by system record ID. | Int64RefRecId | Yes | RetailChannelTable.RecId | None |
storeNumber of the store where the transaction took place. | StringRetailStoreId | Yes | RetailStoreTable.StoreNumber | None |
terminalNumber of the register (POS terminal) used. | StringRetailTerminalId | Yes | RetailTerminalTable.terminalId | None |
transactionIdNumber of the retail transaction the document comes from. | String (44)RetailTransactionId | Yes | None | |
FiscalDocumentSeriesSeries of the fiscal document. | String (9)FiscalDocumentSeries_BR | Yes | None | |
FiscalDocumentNumberNumber of the fiscal document. | String (20)FiscalDocumentNumber_BR | Yes | None | |
AccessKeyAccess key that identifies the fiscal document. | String (45)EFDocAccessKey_BR | No | None | |
ApplicationVersionVersion of the application that created the document. | String (20)EFDocApplicationVersion_BR | No | None | |
AuthorityCodeState code of the authority. | StringLogisticsAddressStateId | No | None | |
ChangeAmountChange amount given to the customer, as reported by the SAT device (in accounting currency). | RealAmountMST | No | None | |
ConsumerEFDocInquiryUrlWeb address where the consumer can look up the NFC-e document. | String (255)URL | No | None | |
ContingencyDateTimeDate and time when contingency mode started. | UtcDateTimeContingencyDateTime | No | None | |
ContingencyDateTimeOffsetTime offset that goes with the contingency date and time. | Int64EFDocContingencyOffset_BR | No | None | |
ContingencyModeContingency mode in use, such as off, SCAN, SVC-AN, SVC-RS or offline NFC-e. | EnumEFDocContingMode_BR (enum) | No | None | |
ContingencyReasonFree-text reason for using contingency mode. | String (255)EFDocContingencyReason_BR | No | None | |
DanfePrintFormatPrint format chosen for the DANFE, such as portrait, landscape, simplified or NFC-e. | EnumDanfePrintFormat_BR (enum) | No | None | |
DataAreaIdThe company (legal entity) that the record belongs to. System field. | String (4)DataAreaId | No | None | |
DirectionShows whether the document is incoming or outgoing. | EnumFiscalDocDirection_BR (enum) | Yes | None | |
EFRRegisterNumberRegister number for CF-e, from 0 to 999, linked to the SAT device. | IntegerEFRRegisterNumber_BR | No | None | |
EFRSignaturePOS signature used in the XML sent to the SAT device. | String (344)EFRSignature_BR | No | None | |
EnvironmentTypeEnvironment the document was sent to: testing or production. | EnumEFDocEnvironment_BR (enum) | No | None | |
FEAddressBacenCodeBACEN country code of the establishment address. | String (4)BacenCode_BR | No | None | |
FEAddressCityCity of the establishment address. | String (60)LogisticsAddressCityName | No | None | |
FEAddressComplementBuilding complement of the establishment address. | String (60)LogisticsAddressBuildingCompliment | No | None | |
FEAddressCountryCountry or region of the establishment address. | StringLogisticsAddressCountryRegionId | No | None | |
FEAddressDistrictDistrict of the establishment address. | String (60)LogisticsAddressDistrictName | No | None | |
FEAddressIBGECodeIBGE code of the city in the establishment address. | String (7)CityIBGECode_BR | No | None | |
FEAddressStateState of the establishment address. | StringLogisticsAddressStateId | No | None | |
FEAddressStreetStreet of the establishment address. | String (250)LogisticsAddressStreet | No | None | |
FEAddressStreetNumberStreet number of the establishment address. | String (20)LogisticsAddressStreetNumber | No | None | |
FEAddressZipCodeZIP or postal code of the establishment address. | StringLogisticsAddressZipCodeId | No | None | |
FinalUserYes/No flag showing whether the buyer is a final user. | EnumCustVendFinalUser_BRNoYes (enum) | No | None | |
FiscalDocumentAccountNumAccount number of the customer or vendor on the fiscal document. | String (20)FiscalDocumentAccountNumber_BR | No | None | |
FiscalDocumentDateTimeDate and time the invoice was posted. | UtcDateTimeFiscalDocumentDateTime_BR | No | None | |
FiscalDocumentDateTimeOffsetTime offset that goes with the invoice date and time. | Int64FiscalDocumentDateTimeOffset_BR | No | None | |
FiscalEstablishmentID of the fiscal establishment that issues the document. | StringFiscalEstablishmentId_BR | Yes | None | |
FiscalEstablishmentCCMNumCCM registration number of the establishment. | String (20)CCMNum_BR | No | None | |
FiscalEstablishmentCNAECNAE activity code of the establishment. | StringCNAE_BR | No | None | |
FiscalEstablishmentCNPJCPFCNPJ or CPF tax number of the establishment. | String (20)CNPJCPFNum_BR | No | None | |
FiscalEstablishmentIEState registration (IE) number of the establishment. | String (20)IENum_BR | No | None | |
FiscalEstablishmentNameName of the establishment. | String (140)FiscalDocumentPartyName_BR | No | None | |
FiscalEstablishmentPhoneTelephone number of the establishment. | String (20)Phone | No | None | |
FiscalEstablishmentPostalAddressPostal address of the establishment, pointing to a record in the addresses table. | Int64LogisticsPostalAddressRecId | No | LogisticsPostalAddress.RecId | None |
FiscalEstablishmentTradeNameTrade name of the establishment, returned by the SAT device. | String (140)FiscalDocumentPartyName_BR | No | None | |
MessageStatusWhere the message to the tax authority stands: waiting to send, sent or processed. | EnumEFDocMessageStatus_BR (enum) | No | None | |
MessageTypeType of message sent, such as NF-e, discard, cancel or cancel by substitution. | EnumEFDocMessageType_BR (enum) | No | None | |
ModelModel code of the fiscal document. | String (3)FiscalDocumentModel_BR | No | None | |
NumericCodeNumeric code of the document. | IntegerInteger | No | None | |
OperationDescriptionShort description of the operation. | String (150)FiscalDocumentOperationDescription_BR | No | None | |
OriginalAccessKeyAccess key of the original document. | String (45)EFDocAccessKey_BR | No | None | |
OriginalDiscountAmountCash discount amount on the document. | RealDiscAmount | No | None | |
PartitionA system field for the data partition. In most environments every record has the same value. System field. | Int64Partition | No | None | |
PresenceTypeHow the buyer was present, such as in person, internet or telesales. | EnumEFDocPresenceType_BR (enum) | No | None | |
ProtocolDateDate and time of the tax authority protocol. | UtcDateTimeTransDateTime | No | None | |
ProtocolNumberProtocol number returned for the document. | String (20)EFDocProtocolNumber_BR | No | None | |
PurposePurpose of the document, such as regular, tax complement, adjustment, return, debit note or credit note. | EnumFiscalDocumentPurpose_BR (enum) | No | None | |
QrcodeTextText used to build the QR code of the document. | String (-1)QrcodeText | No | None | |
ReceiptNumberReceipt number of the document. | String (15)EFDocReceiptNumber_BR | No | None | |
ReceiptTypeType of retail receipt, such as normal, card or customer account receipt. | EnumRetailReceipt (enum) | No | None | |
RecIdA unique number that the system gives to every record. Other tables often use it to point to this record. System field. | Int64RecId | No | None | |
RecVersionA system number that changes each time the record is updated. It is used to detect conflicting updates. System field. | IntegerRecVersion | No | None | |
ReplicationCounterFromOriginCounter used when the record is replicated from its origin. | IntegerRetailReplicationCounter | No | None | |
ReturnCodeDescriptionDescription of the return code from the tax authority. | String (255)EFDocReturnCodeDescription_BR | No | None | |
ReturnCodeRefRecIdPoints to the NF-e rejection code record. The label in the metadata says currency, which does not match the relation. | Int64ReturnCodeId_BR | No | EFDReturnCode_BR.RecId | None |
ReturnMessageMessage returned by SEFAZ, the tax authority. | String (200)EFDocReturnMessage_BR | No | None | |
SendByEmailYes/No flag with no label. It probably shows whether the document is sent by email.low confidence | EnumNoYes (enum) | No | None | |
SoftwareHouseCNPJCNPJ of the software house. | String (20)CNPJCPFNum_BR | No | None | |
StatusCurrent status of the fiscal document, such as approved, canceled, denied or rejected. | EnumFiscalDocumentStatus_BR (enum) | Yes | None | |
SysRowVersionA system row version number that is used for change tracking. System field. | Int64SysRowVersion | No | None | |
TableIdA system number that identifies the table. System field. | IntegerTableId | No | None | |
TaxAuthorityInfoObservations from the tax authority, sent by the SAT device. | String (-1)EFRTaxAuthorityInfo_BR | No | None | |
TechnicalResponsibleCNPJCNPJ of the technical responsible party. | String (14)TechResponsibleCNPJ_BR | No | None | |
TechnicalResponsibleContactNameContact name of the technical responsible party. | String (60)TechResponsibleContactName_BR | No | None | |
TechnicalResponsibleEmailEmail address of the technical responsible party. | String (60)TechResponsibleEmail_BR | No | None | |
TechnicalResponsiblePhonePhone number of the technical responsible party. | String (14)TechResponsiblePhone_BR | No | None | |
ThirdPartyAddressBacenCodeBACEN country code of the third party address. | String (4)BacenCode_BR | No | None | |
ThirdPartyAddressCityCity of the third party address. | String (60)LogisticsAddressCityName | No | None | |
ThirdPartyAddressComplementBuilding complement of the third party address. | String (60)LogisticsAddressBuildingCompliment | No | None | |
ThirdPartyAddressCountryCountry or region of the third party address. | StringLogisticsAddressCountryRegionId | Yes | None | |
ThirdPartyAddressCountryRegionIdCountry or region ID of the third party address. | StringLogisticsAddressCountryRegionId | No | None | |
ThirdPartyAddressDistrictDistrict of the third party address. | String (60)LogisticsAddressDistrictName | No | None | |
ThirdPartyAddressIBGECodeIBGE code of the city in the third party address. | String (7)CityIBGECode_BR | No | None | |
ThirdPartyAddressStateState of the third party address. | StringLogisticsAddressStateId | No | None | |
ThirdPartyAddressStreetStreet of the third party address. | String (250)LogisticsAddressStreet | No | None | |
ThirdPartyAddressStreetNumberStreet number of the third party address. | String (20)LogisticsAddressStreetNumber | No | None | |
ThirdPartyAddressZipCodeZIP or postal code of the third party address. | StringLogisticsAddressZipCodeId | No | None | |
ThirdPartyCNPJCPFCNPJ or CPF tax number of the third party. | String (20)CNPJCPFNum_BR | No | None | |
ThirdPartyEmailContact number or email address of the third party. | String (255)LogisticsElectronicAddressLocator | No | None | |
ThirdPartyForeignerIdID of the third party when they are a foreigner. | String (20)EFDocForeignerId_BR | No | None | |
ThirdPartyFormattedAddressFull third party address as one formatted text. | String (250)Addressing | No | None | |
ThirdPartyICMSContributorYes or no flag showing whether the third party is a contributor to ICMS, a Brazilian tax. | EnumICMSContributor_BRNoYes (enum) | No | None | |
ThirdPartyIEState registration (IE) number of the third party. | String (20)IENum_BR | No | None | |
ThirdPartyNameName of the third party, usually the customer. | String (140)FiscalDocumentPartyName_BR | No | None | |
ThirdPartyPhoneTelephone number of the third party. | String (20)Phone | No | None | |
ThirdPartyPostalAddressPostal address of the third party, pointing to a record in the addresses table. | Int64LogisticsPostalAddressRecId | No | LogisticsPostalAddress.RecId | None |
TotalAmountTotal amount of the document, in accounting currency. | RealAmountMST | No | None | |
TotalDiscountAmountTotal discount on the document. | RealDiscAmount | No | None | |
TotalGoodsAmountTotal amount of products on the document. | RealInvoiceGoodsAmount_BR | No | None | |
TotalMarkupFreightAmountFreight charges on the document. | RealMarkupSumFreight_BR | No | None | |
TotalMarkupInsuranceAmountInsurance charges on the document. | RealMarkupSumInsurance_BR | No | None | |
TotalMarkupOtherAmountOther charges on the document. | RealMarkupSumOthers_BR | No | None | |
TotalServicesAmountTotal amount of services on the document. | RealInvoiceServicesAmount_BR | No | None | |
XmlRequestXML request sent to the tax authority. | String (-1)EFDocXML_BR | No | None | |
XmlResponseXML response received from the tax authority. | String (-1)EFDocXML_BR | No | None | |
XmlReturnRequestXML request sent for the return. | String (-1)EFDocXML_BR | No | None | |
XmlReturnResponseXML response received for the return. | String (-1)EFDocXML_BR | No | None |
Indexes (2)
IdxPrimary indexReplacement keyChannel,store,terminal,transactionId,FiscalDocumentSeries,FiscalDocumentNumberUnique, alternate key.
AccessKeyIdxNot unique.
Relations (7)
Each relation joins RetailFiscalDocument_BR to another table on the fields shown.
EFDReturnCode_BR→EFDReturnCode_BRJoin on
ReturnCodeRefRecId = EFDReturnCode_BR.RecIdMany RetailFiscalDocument_BR records → zero or one EFDReturnCode_BR record
FiscalEstablishmentPostalAddress→LogisticsPostalAddressJoin on
FiscalEstablishmentPostalAddress = LogisticsPostalAddress.RecIdMany RetailFiscalDocument_BR records → zero or one LogisticsPostalAddress record
RetailChannelTable→RetailChannelTableJoin on
Channel = RetailChannelTable.RecIdMany RetailFiscalDocument_BR records → exactly one RetailChannelTable record
RetailStoreTable→RetailStoreTableJoin on
store = RetailStoreTable.StoreNumberMany RetailFiscalDocument_BR records → exactly one RetailStoreTable record
RetailTerminalTable→RetailTerminalTableJoin on
terminal = RetailTerminalTable.terminalIdMany RetailFiscalDocument_BR records → exactly one RetailTerminalTable record
RetailTransactionTable→RetailTransactionTableJoin on
terminal = RetailTransactionTable.BatchTerminalId,store = RetailTransactionTable.store,transactionId = RetailTransactionTable.transactionIdZero or one RetailFiscalDocument_BR record → zero or one RetailTransactionTable record
ThirdPartyPostalAddress→LogisticsPostalAddressJoin on
ThirdPartyPostalAddress = LogisticsPostalAddress.RecIdMany 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.