Criar um ficheiro Saf-t para software de facturação com java

Estou desenvolvendo um software para facturação alguém poderia me explicar como posso criar um ficheiro SAF.T usando java

Cara, andei pesquisando sobre isso, e não achei praticamente nenhuma documentação clara sobre. Vi que isso é uma especie de relatório para prestar contas ao estado (não sei se entendi correto tb). Será que não há nenhuma documentação oficial sobre como gerar isso? Se realmente for algo para ser enviado para algum órgão do estado, vc sabe para qual seria?

até onde eu sei e uma ficheiro xml e serve para ser enviada para Autoridade tributaria(Ao estado).

neste link https://github.com/assoft-portugal/SAF-T-AO tem alguma informação mas não consigo perceber muito bem

Encontrei esse link: SAF-T (PT) - Documentação, que vc consegue baixar o XSD. Com o XSD vc consegue ver como o XML deve ser feito.

o problema é que existem campos que não consigo perceber os dados a serem preenchido

Encontrei esse código que consegue gerar o xml a partir do xsd:

import java.io.File;

import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import jlibs.xml.sax.XMLDocument;
import jlibs.xml.xsd.XSInstance;
import jlibs.xml.xsd.XSParser;

public class Main {

	public static void main(String[] args) throws Exception {
		try {
			String filename = "saftpt1.04_01.xsd";
			// instance.

			final Document doc = loadXsdDocument(filename);

			// Find the docs root element and use it to find the targetNamespace
			final Element rootElem = doc.getDocumentElement();
			String targetNamespace = null;
			if (rootElem != null && rootElem.getNodeName().equals("xs:schema")) {
				targetNamespace = rootElem.getAttribute("targetNamespace");
			}

			// Parse the file into an XSModel object
			org.apache.xerces.xs.XSModel xsModel = new XSParser().parse(filename);

			// Define defaults for the XML generation
			XSInstance instance = new XSInstance();
			instance.minimumElementsGenerated = 1;
			instance.maximumElementsGenerated = 1;
			instance.generateDefaultAttributes = true;
			instance.generateOptionalAttributes = true;
			instance.maximumRecursionDepth = 0;
			instance.generateAllChoices = true;
			instance.showContentModel = true;
			instance.generateOptionalElements = true;

			// Build the sample xml doc
			// Replace first param to XMLDoc with a file input stream to write to file
			QName rootElement = new QName(targetNamespace, "Header");
			XMLDocument sampleXml = new XMLDocument(new StreamResult(System.out), true, 4, null);
			instance.generate(xsModel, rootElement, sampleXml);
		} catch (TransformerConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public static Document loadXsdDocument(String inputName) {
		final String filename = inputName;

		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		factory.setValidating(false);
		factory.setIgnoringElementContentWhitespace(true);
		factory.setIgnoringComments(true);
		Document doc = null;

		try {
			final DocumentBuilder builder = factory.newDocumentBuilder();
			final File inputFile = new File(filename);
			doc = builder.parse(inputFile);
		} catch (final Exception e) {
			e.printStackTrace();
			// throw new ContentLoadException(msg);
		}

		return doc;
	}
}

Nessa parte, onde está Header, altere para o nome do xs:element que quiser gerar e o xml será impresso no console:

// Replace first param to XMLDoc with a file input stream to write to file
QName rootElement = new QName(targetNamespace, "Header");

É preciso ter essa dependencia para funcionar:

<dependency>
	<groupId>in.jlibs</groupId>
	<artifactId>jlibs-xsd</artifactId>
	<version>2.1</version>
</dependency>
1 curtida

Muito obrigado vou testar

Para AuditFile, por exemplo, o xml ficou assim:

<!--(ns:Header , ns:MasterFiles , ns:GeneralLedgerEntries? , ns:SourceDocuments?)-->
<ns:AuditFile xmlns:ns="urn:OECD:StandardAuditFile-Tax:PT_1.04_01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <!--(ns:AuditFileVersion , ns:CompanyID , ns:TaxRegistrationNumber , ns:TaxAccountingBasis , ns:CompanyName , ns:BusinessName? , ns:CompanyAddress , ns:FiscalYear , ns:StartDate , ns:EndDate , ns:CurrencyCode , ns:DateCreated , ns:TaxEntity , ns:ProductCompanyTaxID , ns:SoftwareCertificateNumber , ns:ProductID , ns:ProductVersion , ns:HeaderComment? , ns:Telephone? , ns:Fax? , ns:Email? , ns:Website?)-->
   <ns:Header>
        <ns:AuditFileVersion>AuditFileVersion1</ns:AuditFileVersion>
        <ns:CompanyID>CompanyID1</ns:CompanyID>
        <ns:TaxRegistrationNumber>577336106</ns:TaxRegistrationNumber>
        <ns:TaxAccountingBasis>R</ns:TaxAccountingBasis>
        <ns:CompanyName>CompanyName1</ns:CompanyName>
        <ns:BusinessName>BusinessName1</ns:BusinessName>
      <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
      <ns:CompanyAddress>
            <ns:BuildingNumber>BuildingN1</ns:BuildingNumber>
            <ns:StreetName>StreetName1</ns:StreetName>
            <ns:AddressDetail>AddressDetail1</ns:AddressDetail>
            <ns:City>City1</ns:City>
            <ns:PostalCode>PostalCode1</ns:PostalCode>
            <ns:Region>Region1</ns:Region>
            <ns:Country>
                <ns1:anyElement xmlns:ns1="anyNS"/>
                <ns1:anyElement xmlns:ns1="anyNS"/>PT</ns:Country>
        </ns:CompanyAddress>
        <ns:FiscalYear>6435</ns:FiscalYear>
        <ns:StartDate>2022-03-08</ns:StartDate>
        <ns:EndDate>2022-03-08</ns:EndDate>
        <ns:CurrencyCode>
            <ns1:anyElement xmlns:ns1="anyNS"/>
            <ns1:anyElement xmlns:ns1="anyNS"/>EUR</ns:CurrencyCode>
        <ns:DateCreated>2022-03-08</ns:DateCreated>
        <ns:TaxEntity>TaxEntity1</ns:TaxEntity>
        <ns:ProductCompanyTaxID>ProductCompanyTaxID1</ns:ProductCompanyTaxID>
        <ns:SoftwareCertificateNumber>7352008821759153152</ns:SoftwareCertificateNumber>
        <ns:ProductID>ProductID1</ns:ProductID>
        <ns:ProductVersion>ProductVersion1</ns:ProductVersion>
        <ns:HeaderComment>HeaderComment1</ns:HeaderComment>
        <ns:Telephone>Telephone1</ns:Telephone>
        <ns:Fax>Fax1</ns:Fax>
        <ns:Email>Email1</ns:Email>
        <ns:Website>Website1</ns:Website>
    </ns:Header>
   <!--(ns:GeneralLedgerAccounts? , ns:Customer* , ns:Supplier* , ns:Product* , ns:TaxTable?)-->
   <ns:MasterFiles>
      <!--(ns:TaxonomyReference , ns:Account+)-->
      <ns:GeneralLedgerAccounts>
            <ns:TaxonomyReference>N</ns:TaxonomyReference>
            <ns:Account xmlns:ns1="anyNS" ns1:anyAttr="anyValue">
                <ns1:anyElement/>
            </ns:Account>
        </ns:GeneralLedgerAccounts>
      <!--(ns:CustomerID , ns:AccountID , ns:CustomerTaxID , ns:CompanyName , ns:Contact? , ns:BillingAddress , ns:ShipToAddress* , ns:Telephone? , ns:Fax? , ns:Email? , ns:Website? , ns:SelfBillingIndicator)-->
      <ns:Customer>
            <ns:CustomerID>CustomerID1</ns:CustomerID>
            <ns:AccountID>AccountID1</ns:AccountID>
            <ns:CustomerTaxID>CustomerTaxID1</ns:CustomerTaxID>
            <ns:CompanyName>CompanyName2</ns:CompanyName>
            <ns:Contact>Contact1</ns:Contact>
         <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
         <ns:BillingAddress>
                <ns:BuildingNumber>BuildingN2</ns:BuildingNumber>
                <ns:StreetName>StreetName2</ns:StreetName>
                <ns:AddressDetail>AddressDetail2</ns:AddressDetail>
                <ns:City>City2</ns:City>
                <ns:PostalCode>PostalCode2</ns:PostalCode>
                <ns:Region>Region2</ns:Region>
                <ns:Country>Country1</ns:Country>
            </ns:BillingAddress>
         <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
         <ns:ShipToAddress>
                <ns:BuildingNumber>BuildingN3</ns:BuildingNumber>
                <ns:StreetName>StreetName3</ns:StreetName>
                <ns:AddressDetail>AddressDetail3</ns:AddressDetail>
                <ns:City>City3</ns:City>
                <ns:PostalCode>PostalCode3</ns:PostalCode>
                <ns:Region>Region3</ns:Region>
                <ns:Country>Country2</ns:Country>
            </ns:ShipToAddress>
            <ns:Telephone>Telephone2</ns:Telephone>
            <ns:Fax>Fax2</ns:Fax>
            <ns:Email>Email2</ns:Email>
            <ns:Website>Website2</ns:Website>
            <ns:SelfBillingIndicator>0</ns:SelfBillingIndicator>
        </ns:Customer>
      <!--(ns:SupplierID , ns:AccountID , ns:SupplierTaxID , ns:CompanyName , ns:Contact? , ns:BillingAddress , ns:ShipFromAddress* , ns:Telephone? , ns:Fax? , ns:Email? , ns:Website? , ns:SelfBillingIndicator)-->
      <ns:Supplier>
            <ns:SupplierID>SupplierID1</ns:SupplierID>
            <ns:AccountID>AccountID2</ns:AccountID>
            <ns:SupplierTaxID>SupplierTaxID1</ns:SupplierTaxID>
            <ns:CompanyName>CompanyName3</ns:CompanyName>
            <ns:Contact>Contact2</ns:Contact>
         <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
         <ns:BillingAddress>
                <ns:BuildingNumber>BuildingN4</ns:BuildingNumber>
                <ns:StreetName>StreetName4</ns:StreetName>
                <ns:AddressDetail>AddressDetail4</ns:AddressDetail>
                <ns:City>City4</ns:City>
                <ns:PostalCode>PostalCode4</ns:PostalCode>
                <ns:Region>Region4</ns:Region>
                <ns:Country>C3</ns:Country>
            </ns:BillingAddress>
         <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
         <ns:ShipFromAddress>
                <ns:BuildingNumber>BuildingN5</ns:BuildingNumber>
                <ns:StreetName>StreetName5</ns:StreetName>
                <ns:AddressDetail>AddressDetail5</ns:AddressDetail>
                <ns:City>City5</ns:City>
                <ns:PostalCode>PostalCode5</ns:PostalCode>
                <ns:Region>Region5</ns:Region>
                <ns:Country>C4</ns:Country>
            </ns:ShipFromAddress>
            <ns:Telephone>Telephone3</ns:Telephone>
            <ns:Fax>Fax3</ns:Fax>
            <ns:Email>Email3</ns:Email>
            <ns:Website>Website3</ns:Website>
            <ns:SelfBillingIndicator>1</ns:SelfBillingIndicator>
        </ns:Supplier>
      <!--(ns:ProductType , ns:ProductCode , ns:ProductGroup? , ns:ProductDescription , ns:ProductNumberCode , ns:CustomsDetails?)-->
      <ns:Product>
            <ns:ProductType>E</ns:ProductType>
            <ns:ProductCode>ProductCode1</ns:ProductCode>
            <ns:ProductGroup>ProductGroup1</ns:ProductGroup>
            <ns:ProductDescription>ProductDescription1</ns:ProductDescription>
            <ns:ProductNumberCode>ProductNumberCode1</ns:ProductNumberCode>
         <!--(ns:CNCode* , ns:UNNumber*)-->
         <ns:CustomsDetails>
                <ns:CNCode>CNCode_1</ns:CNCode>
                <ns:UNNumber>UNN1</ns:UNNumber>
            </ns:CustomsDetails>
        </ns:Product>
      <!--(ns:TaxTableEntry+)-->
      <ns:TaxTable>
         <!--(ns:TaxType , ns:TaxCountryRegion , ns:TaxCode , ns:Description , ns:TaxExpirationDate? , (ns:TaxPercentage | ns:TaxAmount))-->
         <ns:TaxTableEntry>
                <ns:TaxType>IVA</ns:TaxType>
                <ns:TaxCountryRegion>TaxC1</ns:TaxCountryRegion>
                <ns:TaxCode>TaxCode1</ns:TaxCode>
                <ns:Description>Description1</ns:Description>
                <ns:TaxExpirationDate>2022-03-08</ns:TaxExpirationDate>
                <ns:TaxPercentage>1.640377126313399E308</ns:TaxPercentage>
                <ns:TaxAmount>4.666118627699586E304</ns:TaxAmount>
            </ns:TaxTableEntry>
        </ns:TaxTable>
    </ns:MasterFiles>
   <!--(ns:NumberOfEntries , ns:TotalDebit , ns:TotalCredit , ns:Journal*)-->
   <ns:GeneralLedgerEntries>
        <ns:NumberOfEntries>5635925795392562176</ns:NumberOfEntries>
        <ns:TotalDebit>1.546562363356478E308</ns:TotalDebit>
        <ns:TotalCredit>1.6357615253224843E308</ns:TotalCredit>
      <!--(ns:JournalID , ns:Description , ns:Transaction*)-->
      <ns:Journal>
            <ns:JournalID>JournalID1</ns:JournalID>
            <ns:Description>Description2</ns:Description>
         <!--(ns:TransactionID , ns:Period , ns:TransactionDate , ns:SourceID , ns:Description , ns:DocArchivalNumber , ns:TransactionType , ns:GLPostingDate , (ns:CustomerID? | ns:SupplierID?) , ns:Lines)-->
         <ns:Transaction>
                <ns:TransactionID>TransactionID1</ns:TransactionID>
                <ns:Period>3</ns:Period>
                <ns:TransactionDate>2022-03-08</ns:TransactionDate>
                <ns:SourceID>SourceID1</ns:SourceID>
                <ns:Description>Description3</ns:Description>
                <ns:DocArchivalNumber>DocArchivalNumber1</ns:DocArchivalNumber>
                <ns:TransactionType>J</ns:TransactionType>
                <ns:GLPostingDate>2022-03-08</ns:GLPostingDate>
                <ns:SupplierID>SupplierID2</ns:SupplierID>
                <ns:CustomerID>CustomerID2</ns:CustomerID>
            <!--(ns:DebitLine ; ns:CreditLine)-->
            <ns:Lines>
               <!--(ns:RecordID , ns:AccountID , ns:SourceDocumentID? , ns:SystemEntryDate , ns:Description , ns:DebitAmount)-->
               <ns:DebitLine>
                        <ns:RecordID>RecordID1</ns:RecordID>
                        <ns:AccountID>AccountID3</ns:AccountID>
                        <ns:SourceDocumentID>SourceDocumentID1</ns:SourceDocumentID>
                        <ns:SystemEntryDate>2022-03-08T09:02:14</ns:SystemEntryDate>
                        <ns:Description>Description4</ns:Description>
                        <ns:DebitAmount>1.1479254873726674E308</ns:DebitAmount>
                    </ns:DebitLine>
               <!--(ns:RecordID , ns:AccountID , ns:SourceDocumentID? , ns:SystemEntryDate , ns:Description , ns:CreditAmount)-->
               <ns:CreditLine>
                        <ns:RecordID>RecordID2</ns:RecordID>
                        <ns:AccountID>AccountID4</ns:AccountID>
                        <ns:SourceDocumentID>SourceDocumentID2</ns:SourceDocumentID>
                        <ns:SystemEntryDate>2022-03-08T09:02:14</ns:SystemEntryDate>
                        <ns:Description>Description5</ns:Description>
                        <ns:CreditAmount>7.386428719049406E307</ns:CreditAmount>
                    </ns:CreditLine>
                </ns:Lines>
            </ns:Transaction>
        </ns:Journal>
    </ns:GeneralLedgerEntries>
   <!--(ns:SalesInvoices? , ns:MovementOfGoods? , ns:WorkingDocuments? , ns:Payments?)-->
   <ns:SourceDocuments>
      <!--(ns:NumberOfEntries , ns:TotalDebit , ns:TotalCredit , ns:Invoice*)-->
      <ns:SalesInvoices>
            <ns:NumberOfEntries>5571302900288744448</ns:NumberOfEntries>
            <ns:TotalDebit>6.704622817156598E306</ns:TotalDebit>
            <ns:TotalCredit>1.8959357802200708E307</ns:TotalCredit>
         <!--(ns:InvoiceNo , ns:ATCUD , ns:DocumentStatus , ns:Hash , ns:HashControl , ns:Period? , ns:InvoiceDate , ns:InvoiceType , ns:SpecialRegimes , ns:SourceID , ns:EACCode? , ns:SystemEntryDate , ns:TransactionID? , ns:CustomerID , ns:ShipTo? , ns:ShipFrom? , ns:MovementEndTime? , ns:MovementStartTime? , ns:Line+ , ns:DocumentTotals , ns:WithholdingTax*)-->
         <ns:Invoice>
                <ns:InvoiceNo>InvoiceNo1</ns:InvoiceNo>
                <ns:ATCUD>ATCUD1</ns:ATCUD>
            <!--(ns:InvoiceStatus , ns:InvoiceStatusDate , ns:Reason? , ns:SourceID , ns:SourceBilling)-->
            <ns:DocumentStatus>
                    <ns:InvoiceStatus>F</ns:InvoiceStatus>
                    <ns:InvoiceStatusDate>2022-03-08T09:02:14</ns:InvoiceStatusDate>
                    <ns:Reason>Reason1</ns:Reason>
                    <ns:SourceID>SourceID2</ns:SourceID>
                    <ns:SourceBilling>I</ns:SourceBilling>
                </ns:DocumentStatus>
                <ns:Hash>Hash1</ns:Hash>
                <ns:HashControl>HashControl1</ns:HashControl>
                <ns:Period>1</ns:Period>
                <ns:InvoiceDate>2022-03-08</ns:InvoiceDate>
                <ns:InvoiceType>FT</ns:InvoiceType>
                <ns:SpecialRegimes>
                    <ns:SelfBillingIndicator>0</ns:SelfBillingIndicator>
                    <ns:CashVATSchemeIndicator>1</ns:CashVATSchemeIndicator>
                    <ns:ThirdPartiesBillingIndicator>1</ns:ThirdPartiesBillingIndicator>
                </ns:SpecialRegimes>
                <ns:SourceID>SourceID3</ns:SourceID>
                <ns:EACCode>EACC1</ns:EACCode>
                <ns:SystemEntryDate>2022-03-08T09:02:14</ns:SystemEntryDate>
                <ns:TransactionID>TransactionID2</ns:TransactionID>
                <ns:CustomerID>CustomerID3</ns:CustomerID>
            <!--(ns:DeliveryID* , ns:DeliveryDate? , (ns:WarehouseID? , ns:LocationID?)* , ns:Address?)-->
            <ns:ShipTo>
                    <ns:DeliveryID>DeliveryID1</ns:DeliveryID>
                    <ns:DeliveryDate>2022-03-08</ns:DeliveryDate>
                    <ns:WarehouseID>WarehouseID1</ns:WarehouseID>
                    <ns:LocationID>LocationID1</ns:LocationID>
               <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
               <ns:Address>
                        <ns:BuildingNumber>BuildingN6</ns:BuildingNumber>
                        <ns:StreetName>StreetName6</ns:StreetName>
                        <ns:AddressDetail>AddressDetail6</ns:AddressDetail>
                        <ns:City>City6</ns:City>
                        <ns:PostalCode>PostalCode6</ns:PostalCode>
                        <ns:Region>Region6</ns:Region>
                        <ns:Country>Country5</ns:Country>
                    </ns:Address>
                </ns:ShipTo>
            <!--(ns:DeliveryID* , ns:DeliveryDate? , (ns:WarehouseID? , ns:LocationID?)* , ns:Address?)-->
            <ns:ShipFrom>
                    <ns:DeliveryID>DeliveryID2</ns:DeliveryID>
                    <ns:DeliveryDate>2022-03-08</ns:DeliveryDate>
                    <ns:WarehouseID>WarehouseID2</ns:WarehouseID>
                    <ns:LocationID>LocationID2</ns:LocationID>
               <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
               <ns:Address>
                        <ns:BuildingNumber>BuildingN7</ns:BuildingNumber>
                        <ns:StreetName>StreetName7</ns:StreetName>
                        <ns:AddressDetail>AddressDetail7</ns:AddressDetail>
                        <ns:City>City7</ns:City>
                        <ns:PostalCode>PostalCode7</ns:PostalCode>
                        <ns:Region>Region7</ns:Region>
                        <ns:Country>Country6</ns:Country>
                    </ns:Address>
                </ns:ShipFrom>
                <ns:MovementEndTime>2022-03-08T09:02:14</ns:MovementEndTime>
                <ns:MovementStartTime>2022-03-08T09:02:14</ns:MovementStartTime>
                <ns:Line xmlns:ns1="anyNS" ns1:anyAttr="anyValue">
                    <ns1:anyElement/>
                </ns:Line>
            <!--(ns:TaxPayable , ns:NetTotal , ns:GrossTotal , ns:Currency? , ns:Settlement* , ns:Payment*)-->
            <ns:DocumentTotals>
                    <ns:TaxPayable>1.1394684316856858E308</ns:TaxPayable>
                    <ns:NetTotal>8.658742790741844E306</ns:NetTotal>
                    <ns:GrossTotal>5.45647299129507E307</ns:GrossTotal>
                    <ns:Currency>
                        <ns:CurrencyCode>Cu1</ns:CurrencyCode>
                        <ns:CurrencyAmount>1.2734255408767945E308</ns:CurrencyAmount>
                        <ns:ExchangeRate>1.7051483209275177E308</ns:ExchangeRate>
                    </ns:Currency>
               <!--(ns:SettlementDiscount? , ns:SettlementAmount? , ns:SettlementDate? , ns:PaymentTerms?)-->
               <ns:Settlement>
                        <ns:SettlementDiscount>SettlementDiscount1</ns:SettlementDiscount>
                        <ns:SettlementAmount>2.92683972628594E307</ns:SettlementAmount>
                        <ns:SettlementDate>2022-03-08</ns:SettlementDate>
                        <ns:PaymentTerms>PaymentTerms1</ns:PaymentTerms>
                    </ns:Settlement>
               <!--(ns:PaymentMechanism? , ns:PaymentAmount , ns:PaymentDate)-->
               <ns:Payment>
                        <ns:PaymentMechanism>CI</ns:PaymentMechanism>
                        <ns:PaymentAmount>7.586956971727043E307</ns:PaymentAmount>
                        <ns:PaymentDate>2022-03-08</ns:PaymentDate>
                    </ns:Payment>
                </ns:DocumentTotals>
            <!--(ns:WithholdingTaxType? , ns:WithholdingTaxDescription? , ns:WithholdingTaxAmount)-->
            <ns:WithholdingTax>
                    <ns:WithholdingTaxType>IRS</ns:WithholdingTaxType>
                    <ns:WithholdingTaxDescription>WithholdingTaxDescription1</ns:WithholdingTaxDescription>
                    <ns:WithholdingTaxAmount>1.7336883008507439E308</ns:WithholdingTaxAmount>
                </ns:WithholdingTax>
            </ns:Invoice>
        </ns:SalesInvoices>
      <!--(ns:NumberOfMovementLines , ns:TotalQuantityIssued , ns:StockMovement*)-->
      <ns:MovementOfGoods>
            <ns:NumberOfMovementLines>3837872868428238848</ns:NumberOfMovementLines>
            <ns:TotalQuantityIssued>6.075949959172212E307</ns:TotalQuantityIssued>
         <!--(ns:DocumentNumber , ns:ATCUD , ns:DocumentStatus , ns:Hash , ns:HashControl , ns:Period? , ns:MovementDate , ns:MovementType , ns:SystemEntryDate , ns:TransactionID? , (ns:CustomerID | ns:SupplierID) , ns:SourceID , ns:EACCode? , ns:MovementComments? , ns:ShipTo? , ns:ShipFrom? , ns:MovementEndTime? , ns:MovementStartTime , ns:ATDocCodeID? , ns:Line+ , ns:DocumentTotals)-->
         <ns:StockMovement>
                <ns:DocumentNumber>DocumentNumber1</ns:DocumentNumber>
                <ns:ATCUD>ATCUD2</ns:ATCUD>
            <!--(ns:MovementStatus , ns:MovementStatusDate , ns:Reason? , ns:SourceID , ns:SourceBilling)-->
            <ns:DocumentStatus>
                    <ns:MovementStatus>A</ns:MovementStatus>
                    <ns:MovementStatusDate>2022-03-08T09:02:14</ns:MovementStatusDate>
                    <ns:Reason>Reason2</ns:Reason>
                    <ns:SourceID>SourceID4</ns:SourceID>
                    <ns:SourceBilling>I</ns:SourceBilling>
                </ns:DocumentStatus>
                <ns:Hash>Hash2</ns:Hash>
                <ns:HashControl>HashControl2</ns:HashControl>
                <ns:Period>5</ns:Period>
                <ns:MovementDate>2022-03-08</ns:MovementDate>
                <ns:MovementType>GC</ns:MovementType>
                <ns:SystemEntryDate>2022-03-08T09:02:14</ns:SystemEntryDate>
                <ns:TransactionID>TransactionID3</ns:TransactionID>
                <ns:SupplierID>SupplierID3</ns:SupplierID>
                <ns:CustomerID>CustomerID4</ns:CustomerID>
                <ns:SourceID>SourceID5</ns:SourceID>
                <ns:EACCode>EACC2</ns:EACCode>
                <ns:MovementComments>MovementComments1</ns:MovementComments>
            <!--(ns:DeliveryID* , ns:DeliveryDate? , (ns:WarehouseID? , ns:LocationID?)* , ns:Address?)-->
            <ns:ShipTo>
                    <ns:DeliveryID>DeliveryID3</ns:DeliveryID>
                    <ns:DeliveryDate>2022-03-08</ns:DeliveryDate>
                    <ns:WarehouseID>WarehouseID3</ns:WarehouseID>
                    <ns:LocationID>LocationID3</ns:LocationID>
               <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
               <ns:Address>
                        <ns:BuildingNumber>BuildingN8</ns:BuildingNumber>
                        <ns:StreetName>StreetName8</ns:StreetName>
                        <ns:AddressDetail>AddressDetail8</ns:AddressDetail>
                        <ns:City>City8</ns:City>
                        <ns:PostalCode>PostalCode8</ns:PostalCode>
                        <ns:Region>Region8</ns:Region>
                        <ns:Country>Country7</ns:Country>
                    </ns:Address>
                </ns:ShipTo>
            <!--(ns:DeliveryID* , ns:DeliveryDate? , (ns:WarehouseID? , ns:LocationID?)* , ns:Address?)-->
            <ns:ShipFrom>
                    <ns:DeliveryID>DeliveryID4</ns:DeliveryID>
                    <ns:DeliveryDate>2022-03-08</ns:DeliveryDate>
                    <ns:WarehouseID>WarehouseID4</ns:WarehouseID>
                    <ns:LocationID>LocationID4</ns:LocationID>
               <!--(ns:BuildingNumber? , ns:StreetName? , ns:AddressDetail , ns:City , ns:PostalCode , ns:Region? , ns:Country)-->
               <ns:Address>
                        <ns:BuildingNumber>BuildingN9</ns:BuildingNumber>
                        <ns:StreetName>StreetName9</ns:StreetName>
                        <ns:AddressDetail>AddressDetail9</ns:AddressDetail>
                        <ns:City>City9</ns:City>
                        <ns:PostalCode>PostalCode9</ns:PostalCode>
                        <ns:Region>Region9</ns:Region>
                        <ns:Country>Country8</ns:Country>
                    </ns:Address>
                </ns:ShipFrom>
                <ns:MovementEndTime>2022-03-08T09:02:14</ns:MovementEndTime>
                <ns:MovementStartTime>2022-03-08T09:02:14</ns:MovementStartTime>
                <ns:ATDocCodeID>ATDocCodeID1</ns:ATDocCodeID>
                <ns:Line xmlns:ns1="anyNS" ns1:anyAttr="anyValue">
                    <ns1:anyElement/>
                </ns:Line>
            <!--(ns:TaxPayable , ns:NetTotal , ns:GrossTotal , ns:Currency?)-->
            <ns:DocumentTotals>
                    <ns:TaxPayable>1.550218910587701E308</ns:TaxPayable>
                    <ns:NetTotal>1.17434943957792E308</ns:NetTotal>
                    <ns:GrossTotal>4.20254991603175E305</ns:GrossTotal>
                    <ns:Currency>
                        <ns:CurrencyCode>Cu2</ns:CurrencyCode>
                        <ns:CurrencyAmount>1.3714953918680901E308</ns:CurrencyAmount>
                        <ns:ExchangeRate>1.2437142664629177E308</ns:ExchangeRate>
                    </ns:Currency>
                </ns:DocumentTotals>
            </ns:StockMovement>
        </ns:MovementOfGoods>
      <!--(ns:NumberOfEntries , ns:TotalDebit , ns:TotalCredit , ns:WorkDocument*)-->
      <ns:WorkingDocuments>
            <ns:NumberOfEntries>5923500623461496832</ns:NumberOfEntries>
            <ns:TotalDebit>1.2066083872970882E308</ns:TotalDebit>
            <ns:TotalCredit>8.519161015180097E307</ns:TotalCredit>
         <!--(ns:DocumentNumber , ns:ATCUD , ns:DocumentStatus , ns:Hash , ns:HashControl , ns:Period? , ns:WorkDate , ns:WorkType , ns:SourceID , ns:EACCode? , ns:SystemEntryDate , ns:TransactionID? , ns:CustomerID , ns:Line+ , ns:DocumentTotals)-->
         <ns:WorkDocument>
                <ns:DocumentNumber>DocumentNumber2</ns:DocumentNumber>
                <ns:ATCUD>ATCUD3</ns:ATCUD>
            <!--(ns:WorkStatus , ns:WorkStatusDate , ns:Reason? , ns:SourceID , ns:SourceBilling)-->
            <ns:DocumentStatus>
                    <ns:WorkStatus>F</ns:WorkStatus>
                    <ns:WorkStatusDate>2022-03-08T09:02:14</ns:WorkStatusDate>
                    <ns:Reason>Reason3</ns:Reason>
                    <ns:SourceID>SourceID6</ns:SourceID>
                    <ns:SourceBilling>I</ns:SourceBilling>
                </ns:DocumentStatus>
                <ns:Hash>Hash3</ns:Hash>
                <ns:HashControl>HashControl3</ns:HashControl>
                <ns:Period>11</ns:Period>
                <ns:WorkDate>2022-03-08</ns:WorkDate>
                <ns:WorkType>LD</ns:WorkType>
                <ns:SourceID>SourceID7</ns:SourceID>
                <ns:EACCode>EACC3</ns:EACCode>
                <ns:SystemEntryDate>2022-03-08T09:02:14</ns:SystemEntryDate>
                <ns:TransactionID>TransactionID4</ns:TransactionID>
                <ns:CustomerID>CustomerID5</ns:CustomerID>
                <ns:Line xmlns:ns1="anyNS" ns1:anyAttr="anyValue">
                    <ns1:anyElement/>
                </ns:Line>
            <!--(ns:TaxPayable , ns:NetTotal , ns:GrossTotal , ns:Currency?)-->
            <ns:DocumentTotals>
                    <ns:TaxPayable>5.70715057186541E307</ns:TaxPayable>
                    <ns:NetTotal>4.637436766164591E307</ns:NetTotal>
                    <ns:GrossTotal>5.867604775807993E307</ns:GrossTotal>
                    <ns:Currency>
                        <ns:CurrencyCode>Cu3</ns:CurrencyCode>
                        <ns:CurrencyAmount>1.1055394927060115E308</ns:CurrencyAmount>
                        <ns:ExchangeRate>7.168986995563966E307</ns:ExchangeRate>
                    </ns:Currency>
                </ns:DocumentTotals>
            </ns:WorkDocument>
        </ns:WorkingDocuments>
      <!--(ns:NumberOfEntries , ns:TotalDebit , ns:TotalCredit , ns:Payment*)-->
      <ns:Payments>
            <ns:NumberOfEntries>6994276336045235200</ns:NumberOfEntries>
            <ns:TotalDebit>3.904407861636242E307</ns:TotalDebit>
            <ns:TotalCredit>7.618679418790783E306</ns:TotalCredit>
            <ns:Payment xmlns:ns1="anyNS" ns1:anyAttr="anyValue">
                <ns1:anyElement/>
            </ns:Payment>
        </ns:Payments>
    </ns:SourceDocuments>
</ns:AuditFile>

Agora confesso que não tenho ideia se isso está correto. =D

1 curtida