Ir para conteúdo


* * * * * 9 votos

SAFT-PT: debate de dúvidas e ideias


  • Por favor inicie sessão para responder
4456 respostas a este tópico

#261 Cr4zyKingLi0n

Cr4zyKingLi0n

    Boolean User

  • Membro
  • PipPipPip
  • 107 mensagens

Publicado 17 de Abril de 2013 - 16:17

Ver Mensagemossadas, em 17 de Abril de 2013 - 15:56, disse:

Boas,

Ao clicar no botão validar e submeter o ficheiro saft de transporte emite um alerta de sucesso e com breve comentário de nºs de docs.

Contudo vou verificar o ficheiro resposta e contém a informação:
"<Error>
  <ErrorMessage> 'customerAddress.postalCode'must match "([0-9]{4}-[0-9]{3})?"</ErrorMessage>
  <LineNumber>7143</LineNumber>
   </Error>
<Error>
<ErrorMessage> 'addressTo.postalCode'must match "([0-9]{4}-[0-9]{3})?"</ErrorMessage>
<LineNumber>7265</LineNumber>
</Error>"

Nem imaginam os pensamentos que me ocorreram...

Penso que a resposta comprova que só é permitido para clientes nacionais e destino nacionais.
Outro facto que para mim é deveras imprudente, quase impraticável... Obriga os clientes guardarem a sete chaves os ficheiros enviados para depois serem analisados em função aos ficheiros de resposta...

O pessoal da AT tem a mínima noção de que uns 80% dos clientes tem alguma dificuldade em lidar com o material/software informático?!


O pessoal confirma que a comunicação é somente para clientes e destinos nacionais?

Outra dificuldade que tive. Alterei os códigos postais e tentei submeter, mas dá o alerta de erro.

Sugestões?


Cmps
Sim a comunicacao é só para clientes nacionais.

#262 precla

precla

    null

  • Membro
  • Pip
  • 14 mensagens

Publicado 17 de Abril de 2013 - 16:58

Ver MensagemCr4zyKingLi0n, em 17 de Abril de 2013 - 16:17, disse:

Sim a comunicacao é só para clientes nacionais.

Penso que é para clientes e fornecedores nacionais, para o estrangeiro penso que tem que ir sempre acompanhado da factura....

#263 ARP

ARP

    null

  • Membro
  • Pip
  • 24 mensagens

Publicado 17 de Abril de 2013 - 17:02

Ver MensagemAlways, em 17 de Abril de 2013 - 16:52, disse:

fonte não official do novo SAF-T PT (retirado a partir do .jar da submissão dos documentos de transporte)
já dá para ir adiantando umas coisinhas...
Código :
<?xml version="1.0" encoding="Windows-1252"?>
<!--Created with Liquid XML Studio - FREE Community Edition 7.1.6.1440 (http://www.liquid-technologies.com)-->
<xs:schema xmlns:doc="urn:schemas-basda-org:schema-extensions:documentation" xmlns:ns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01" xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:OECD:StandardAuditFile-Tax:PT_1.02_01" version="1.02_01" id="SAF-T_PT" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation>
<doc:Title>Standard Audit File - Portuguese Version</doc:Title>
<doc:Subject>Standard Audit File - Portuguese Version</doc:Subject>
<doc:Copyright>Copyright OECD</doc:Copyright>
<doc:Version>
<doc:Number>1.02_01</doc:Number>
<doc:Status>Production</doc:Status>
</doc:Version>
<doc:Author>Autoridade Tributária e Aduaneira</doc:Author>
<doc:ModificationDate>2013-03-08</doc:ModificationDate>
</xs:documentation>
</xs:annotation>
<!-- Estrutura do ficheiro SAFT-PT-->
<xs:element name="AuditFile">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" ref="Header" />
<xs:element name="MasterFiles">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="GeneralLedger" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Customer" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Supplier" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Product" />
<xs:element minOccurs="0" ref="TaxTable" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" ref="GeneralLedgerEntries" />
<xs:element minOccurs="0" ref="SourceDocuments" />
</xs:sequence>
</xs:complexType>
<!-- Constraint-->
<!--
<xs:unique name="AccountIDConstraint">
<xs:selector xpath="ns:MasterFiles/ns:GeneralLedger" />
<xs:field xpath="ns:AccountID" />
</xs:unique>
<xs:unique name="CustomerIDConstraint">
<xs:selector xpath="ns:MasterFiles/ns:Customer" />
<xs:field xpath="ns:CustomerID" />
</xs:unique>
<xs:unique name="SupplierIDConstraint">
<xs:selector xpath="ns:MasterFiles/ns:Supplier" />
<xs:field xpath="ns:SupplierID" />
</xs:unique>
<xs:unique name="ProductCodeConstraint">
<xs:selector xpath="ns:MasterFiles/ns:Product" />
<xs:field xpath="ns:ProductCode" />
</xs:unique>
<xs:keyref name="GeneralLedgerEntriesAccountIDConstraint" refer="AccountIDConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction/ns:Line" />
<xs:field xpath="ns:AccountID" />
</xs:keyref>
<xs:keyref name="GeneralLedgerEntriesCustomerIDConstraint" refer="CustomerIDConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction" />
<xs:field xpath="ns:CustomerID" />
</xs:keyref>
<xs:keyref name="GeneralLedgerEntriesSupplierIDConstraint" refer="SupplierIDConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction" />
<xs:field xpath="ns:SupplierID" />
</xs:keyref>
<xs:unique name="InvoiceNoConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:SalesInvoices/ns:Invoice" />
<xs:field xpath="ns:InvoiceNo" />
</xs:unique>
<xs:keyref name="InvoiceCustomerIDConstraint" refer="CustomerIDConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:SalesInvoices/ns:Invoice" />
<xs:field xpath="ns:CustomerID" />
</xs:keyref>
<xs:keyref name="InvoiceProductCodeConstraint" refer="ProductCodeConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:SalesInvoices/ns:Invoice/ns:Line" />
<xs:field xpath="ns:ProductCode" />
</xs:keyref>
<xs:unique name="DocumentNumberConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:MovementOfGoods/ns:StockMovement" />
<xs:field xpath="ns:DocumentNumber" />
</xs:unique>
<xs:keyref name="StockMovementCustomerIDConstraint" refer="CustomerIDConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:MovementOfGoods/ns:StockMovement" />
<xs:field xpath="ns:CustomerID" />
</xs:keyref>
<xs:keyref name="StockMovementSupplierIDConstraint" refer="SupplierIDConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:MovementOfGoods/ns:StockMovement" />
<xs:field xpath="ns:SupplierID" />
</xs:keyref>
<xs:keyref name="StockMovementProductCodeConstraint" refer="ProductCodeConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:MovementOfGoods/ns:StockMovement/ns:Line" />
<xs:field xpath="ns:ProductCode" />
</xs:keyref>
<xs:unique name="WorkDocumentDocumentNumberConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:WorkingDocuments/ns:WorkDocument" />
<xs:field xpath="ns:DocumentNumber" />
</xs:unique>
<xs:keyref name="WorkDocumentDocumentCustomerIDConstraint" refer="CustomerIDConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:WorkingDocuments/ns:WorkDocument" />
<xs:field xpath="ns:CustomerID" />
</xs:keyref>
<xs:keyref name="WorkDocumentDocumentProductCodeConstraint" refer="ProductCodeConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:WorkingDocuments/ns:WorkDocument/ns:Line" />
<xs:field xpath="ns:ProductCode" />
</xs:keyref>
-->
</xs:element>
<!-- Estrutura de cabeçalho (AuditFile.Header) -->
<xs:element name="Header">
<xs:complexType>
<xs:sequence>
<xs:element ref="AuditFileVersion" />
<xs:element ref="CompanyID" />
<xs:element name="TaxRegistrationNumber" type="SAFPTPortugueseVatNumber" />
<xs:element ref="TaxAccountingBasis" />
<xs:element ref="CompanyName" />
<xs:element minOccurs="0" ref="BusinessName" />
<xs:element ref="CompanyAddress" />
<xs:element ref="FiscalYear" />
<xs:element ref="StartDate" />
<xs:element ref="EndDate" />
<xs:element fixed="EUR" name="CurrencyCode" />
<xs:element ref="DateCreated" />
<xs:element ref="TaxEntity" />
<xs:element ref="ProductCompanyTaxID" />
<xs:element ref="SoftwareCertificateNumber" />
<xs:element ref="ProductID" />
<xs:element ref="ProductVersion" />
<xs:element minOccurs="0" ref="HeaderComment" />
<xs:element minOccurs="0" ref="Telephone" />
<xs:element minOccurs="0" ref="Fax" />
<xs:element minOccurs="0" ref="Email" />
<xs:element minOccurs="0" ref="Website" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Ficheiros Mestre (AuditFile.MasterFiles) -->
<!-- Estrutura do Plano de Contas (AuditFile.MasterFiles.GeneralLedger)-->
<xs:element name="GeneralLedger">
<xs:complexType>
<xs:sequence>
<xs:element name="AccountID" type="SAFPTGLAccountID" />
<xs:element ref="AccountDescription" />
<xs:element ref="OpeningDebitBalance" />
<xs:element ref="OpeningCreditBalance" />
<xs:element ref="ClosingDebitBalance" />
<xs:element ref="ClosingCreditBalance" />
<xs:element ref="GroupingCategory" />
<xs:element minOccurs="0" name="GroupingCode" type="SAFPTGLAccountID" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Cliente (AuditFile.MasterFiles.Customer) -->
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element ref="CustomerID" />
<xs:element ref="AccountID" />
<xs:element ref="CustomerTaxID" />
<xs:element ref="CompanyName" />
<xs:element minOccurs="0" ref="Contact" />
<xs:element ref="BillingAddress" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ShipToAddress" />
<xs:element minOccurs="0" ref="Telephone" />
<xs:element minOccurs="0" ref="Fax" />
<xs:element minOccurs="0" ref="Email" />
<xs:element minOccurs="0" ref="Website" />
<xs:element ref="SelfBillingIndicator" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Fornecedor (AuditFile.MasterFiles.Supplier) -->
<xs:element name="Supplier">
<xs:complexType>
<xs:sequence>
<xs:element ref="SupplierID" />
<xs:element ref="AccountID" />
<xs:element ref="SupplierTaxID" />
<xs:element ref="CompanyName" />
<xs:element minOccurs="0" ref="Contact" />
<xs:element name="BillingAddress" type="SupplierAddressStructure" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="ShipFromAddress" type="SupplierAddressStructure" />
<xs:element minOccurs="0" ref="Telephone" />
<xs:element minOccurs="0" ref="Fax" />
<xs:element minOccurs="0" ref="Email" />
<xs:element minOccurs="0" ref="Website" />
<xs:element ref="SelfBillingIndicator" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de produto (AuditFile.MasterFiles.Product)-->
<xs:element name="Product">
<xs:complexType>
<xs:sequence>
<xs:element ref="ProductType" />
<xs:element ref="ProductCode" />
<xs:element minOccurs="0" ref="ProductGroup" />
<xs:element ref="ProductDescription" />
<xs:element ref="ProductNumberCode" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Impostos (AuditFile.MasterFiles.TaxTable) -->
<xs:element name="TaxTable">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="TaxTableEntry" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Imposto -->
<xs:element name="TaxTableEntry">
<xs:complexType>
<xs:sequence>
<xs:element ref="TaxType" />
<xs:element ref="TaxCountryRegion" />
<xs:element ref="TaxCode" />
<xs:element name="Description" type="SAFPTtextTypeMandatoryMax255Car" />
<xs:element minOccurs="0" ref="TaxExpirationDate" />
<xs:choice>
<xs:element ref="TaxPercentage" />
<xs:element ref="TaxAmount" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Movimentos Contabilisticos (AuditFile.GeneralLedgerEntries)-->
<xs:element name="GeneralLedgerEntries">
<xs:complexType>
<xs:sequence>
<xs:element ref="NumberOfEntries" />
<xs:element ref="TotalDebit" />
<xs:element ref="TotalCredit" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="Journal">
<xs:complexType>
<xs:sequence>
<xs:element ref="JournalID" />
<xs:element ref="Description" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="Transaction">
<xs:complexType>
<xs:sequence>
<xs:element ref="TransactionID" />
<xs:element name="Period" type="SAFPTAccountingPeriod" />
<xs:element ref="TransactionDate" />
<xs:element ref="SourceID" />
<xs:element ref="Description" />
<xs:element ref="DocArchivalNumber" />
<xs:element ref="TransactionType" />
<xs:element ref="GLPostingDate" />
<xs:choice>
<xs:element minOccurs="0" ref="CustomerID" />
<xs:element minOccurs="0" ref="SupplierID" />
</xs:choice>
<xs:element minOccurs="2" maxOccurs="unbounded" name="Line">
<xs:complexType>
<xs:sequence>
<xs:element ref="RecordID" />
<xs:element name="AccountID" type="SAFPTGLAccountID" />
<xs:element minOccurs="0" ref="SourceDocumentID" />
<xs:element ref="SystemEntryDate" />
<xs:element ref="Description" />
<xs:choice maxOccurs="1">
<xs:element ref="DebitAmount" />
<xs:element ref="CreditAmount" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="JournalIdConstraint">
<xs:selector xpath="ns:Journal" />
<xs:field xpath="ns:JournalID" />
</xs:unique>
<xs:unique name="TransactionIdConstraint">
<xs:selector xpath="ns:Journal/ns:Transaction" />
<xs:field xpath="ns:TransactionID" />
</xs:unique>
</xs:element>
<!-- Estrutura de Documentos Comerciais (AuditFile.SourceDocuments)-->
<xs:element name="SourceDocuments">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="SalesInvoices">
<xs:complexType>
<xs:sequence>
<xs:element ref="NumberOfEntries" />
<xs:element ref="TotalDebit" />
<xs:element ref="TotalCredit" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="Invoice">
<xs:complexType>
<xs:sequence>
<xs:element ref="InvoiceNo" />
<!-- Estrutura da situação do documento -->
<xs:element name="DocumentStatus">
<xs:complexType>
<xs:sequence>
<xs:element ref="InvoiceStatus" />
<!-- Na exportação de dados relativos a exercícios anteriores em que esta informação seja desconhecida, este campo deverá ser preenchido com a data do documento e hora como 00:00:00 -->
<xs:element ref="InvoiceStatusDate" />
<xs:element minOccurs="0" ref="Reason" />
<xs:element ref="SourceID" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="SourceBilling" />
<xs:element ref="Hash" />
<xs:element minOccurs="0" ref="HashControl" />
<xs:element minOccurs="0" ref="Period" />
<xs:element ref="InvoiceDate" />
<xs:element ref="InvoiceType" />
<xs:element ref="SelfBillingIndicator" />
<xs:element ref="SourceID" />
<xs:element minOccurs="0" ref="EACCode" />
<xs:element ref="SystemEntryDate" />
<xs:element minOccurs="0" ref="TransactionID" />
<xs:element ref="CustomerID" />
<xs:element minOccurs="0" maxOccurs="1" ref="ShipTo" />
<xs:element minOccurs="0" maxOccurs="1" ref="ShipFrom" />
<xs:element minOccurs="0" maxOccurs="1" ref="MovementEndTime" />
<xs:element minOccurs="0" maxOccurs="1" ref="MovementStartTime" />
<xs:element maxOccurs="unbounded" name="Line">
<xs:complexType>
<xs:sequence>
<xs:element ref="LineNumber" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="OrderReferences" />
<xs:element ref="ProductCode" />
<xs:element ref="ProductDescription" />
<xs:element ref="Quantity" />
<xs:element ref="UnitOfMeasure" />
<xs:element ref="UnitPrice" />
<xs:element ref="TaxPointDate" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="References" />
<xs:element ref="Description" />
<xs:choice>
<xs:element ref="DebitAmount" />
<xs:element ref="CreditAmount" />
</xs:choice>
<xs:element ref="Tax" />
<xs:element minOccurs="0" ref="TaxExemptionReason" />
<xs:element minOccurs="0" ref="SettlementAmount" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DocumentTotals">
<xs:complexType>
<xs:sequence>
<xs:element ref="TaxPayable" />
<xs:element ref="NetTotal" />
<xs:element ref="GrossTotal" />
<xs:element minOccurs="0" ref="Currency" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Settlement" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Payment" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" ref="WithholdingTax" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="MovementOfGoods">
<xs:complexType>
<xs:sequence>
<xs:element ref="NumberOfMovementLines" />
<xs:element ref="TotalQuantityIssued" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="StockMovement">
<xs:complexType>
<xs:sequence>
<xs:element ref="DocumentNumber" />
<!-- Estrutura da situação do documento -->
<xs:element name="DocumentStatus">
<xs:complexType>
<xs:sequence>
<xs:element ref="MovementStatus" />
<!-- Na exportação de dados relativos a exercícios anteriores em que esta informação seja desconhecida, este campo deverá ser preenchido com a data do documento e hora como 00:00:00 -->
<xs:element ref="MovementStatusDate" />
<xs:element minOccurs="0" ref="Reason" />
<xs:element ref="SourceID" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="SourceBilling" />
<xs:element ref="Hash" />
<xs:element minOccurs="0" ref="HashControl" />
<xs:element minOccurs="0" ref="Period" />
<xs:element ref="MovementDate" />
<xs:element ref="MovementType" />
<xs:element ref="SystemEntryDate" />
<xs:element minOccurs="0" ref="TransactionID" />
<xs:choice>
<xs:element ref="CustomerID" />
<xs:element ref="SupplierID" />
</xs:choice>
<xs:element ref="SourceID" />
<xs:element minOccurs="0" ref="EACCode" />
<xs:element minOccurs="0" ref="MovementComments" />
<xs:element minOccurs="0" maxOccurs="1" ref="ShipTo" />
<xs:element minOccurs="0" maxOccurs="1" ref="ShipFrom" />
<xs:element minOccurs="0" maxOccurs="1" ref="MovementEndTime" />
<xs:element maxOccurs="1" ref="MovementStartTime" />
<!-- Nos documentos resumo (MovementStatus "R"), na ausência de informação concreta, a hora de inicio de transporte (MovementStartTime) pode ser indicada com a concatenação da data constante no campo MovementDate com a hora 00:00:00-->
<xs:element minOccurs="0" maxOccurs="1" ref="ATDocCodeID" />
<xs:element maxOccurs="unbounded" name="Line">
<xs:complexType>
<xs:sequence>
<xs:element ref="LineNumber" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="OrderReferences" />
<xs:element ref="ProductCode" />
<xs:element ref="ProductDescription" />
<xs:element ref="Quantity" />
<xs:element ref="UnitOfMeasure" />
<xs:element ref="UnitPrice" />
<xs:element ref="Description" />
<xs:choice>
<xs:element ref="DebitAmount" />
<xs:element ref="CreditAmount" />
</xs:choice>
<xs:element minOccurs="0" name="Tax" type="MovementTax" />
<xs:element minOccurs="0" ref="TaxExemptionReason" />
<xs:element minOccurs="0" ref="SettlementAmount" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DocumentTotals">
<xs:complexType>
<xs:sequence>
<xs:element ref="TaxPayable" />
<xs:element ref="NetTotal" />
<xs:element ref="GrossTotal" />
<xs:element minOccurs="0" ref="Currency" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="WorkingDocuments">
<xs:complexType>
<xs:sequence>
<xs:element ref="NumberOfEntries" />
<xs:element ref="TotalDebit" />
<xs:element ref="TotalCredit" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="WorkDocument">
<xs:complexType>
<xs:sequence>
<xs:element ref="DocumentNumber" />
<!-- Estrutura da situação do documento -->
<xs:element name="DocumentStatus">
<xs:complexType>
<xs:sequence>
<xs:element ref="WorkStatus" />
<!-- Na exportação de dados relativos a exercícios anteriores em que esta informação seja desconhecida, este campo deverá ser preenchido com a data do documento e hora como 00:00:00 -->
<xs:element ref="WorkStatusDate" />
<xs:element minOccurs="0" ref="Reason" />
<xs:element ref="SourceID" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="Hash" />
<xs:element minOccurs="0" ref="HashControl" />
<xs:element minOccurs="0" ref="Period" />
<xs:element ref="WorkDate" />
<xs:element ref="WorkType" />
<xs:element ref="SourceID" />
<xs:element minOccurs="0" ref="EACCode" />
<xs:element ref="SystemEntryDate" />
<xs:element ref="CustomerID" />
<xs:element maxOccurs="unbounded" name="Line">
<xs:complexType>
<xs:sequence>
<xs:element ref="LineNumber" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="OrderReferences" />
<xs:element ref="ProductCode" />
<xs:element ref="ProductDescription" />
<xs:element ref="Quantity" />
<xs:element ref="UnitOfMeasure" />
<xs:element ref="UnitPrice" />
<xs:element ref="TaxPointDate" />
<xs:element ref="Description" />
<xs:choice>
<xs:element ref="DebitAmount" />
<xs:element ref="CreditAmount" />
</xs:choice>
<xs:element minOccurs="0" ref="Tax" />
<xs:element minOccurs="0" ref="TaxExemptionReason" />
<xs:element minOccurs="0" ref="SettlementAmount" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DocumentTotals">
<xs:complexType>
<xs:sequence>
<xs:element ref="TaxPayable" />
<xs:element ref="NetTotal" />
<xs:element ref="GrossTotal" />
<xs:element minOccurs="0" ref="Currency" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- ESTRUTURAS DE SUPORTE -->
<!-- Estrutura de Moradas -->
<xs:complexType name="AddressStructure">
<xs:sequence>
<xs:element minOccurs="0" ref="BuildingNumber" />
<xs:element minOccurs="0" ref="StreetName" />
<xs:element ref="AddressDetail" />
<xs:element ref="City" />
<xs:element ref="PostalCode" />
<xs:element minOccurs="0" ref="Region" />
<xs:element ref="Country" />
</xs:sequence>
</xs:complexType>
<!-- Estrutura de Moradas para Portugal-->
<xs:complexType name="AddressStructurePT">
<xs:sequence>
<xs:element minOccurs="0" ref="BuildingNumber" />
<xs:element minOccurs="0" ref="StreetName" />
<xs:element ref="AddressDetail" />
<xs:element ref="City" />
<xs:element name="PostalCode" type="PostalCodePT" />
<xs:element minOccurs="0" ref="Region" />
<xs:element fixed="PT" name="Country" />
</xs:sequence>
</xs:complexType>
<!-- Estrutura de valor monetário -->
<!-- Este elemento apenas deve ser gerado quando a moeda original do documento for diferente de euro -->
<xs:element name="Currency">
<xs:complexType>
<xs:sequence>
<xs:element ref="CurrencyCode" />
<xs:element ref="CurrencyAmount" />
<xs:element minOccurs="0" ref="ExchangeRate" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Taxa de documentos de movimentação de mercadorias-->
<xs:complexType name="MovementTax">
<xs:sequence>
<xs:element name="TaxType" type="SAFTPTMovementTaxType" />
<xs:element ref="TaxCountryRegion" />
<xs:element name="TaxCode" type="SAFTPTMovementTaxCode" />
<xs:element ref="TaxPercentage" />
</xs:sequence>
</xs:complexType>
<!-- Estrutura de Referências ao documento de origem-->
<xs:element name="OrderReferences">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="OriginatingON" />
<xs:element minOccurs="0" ref="OrderDate" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de pagamentos-->
<xs:element name="Payment">
<xs:complexType>
<xs:sequence>
<xs:element ref="PaymentMechanism" />
<xs:element name="PaymentAmount" type="SAFmonetaryType" />
<xs:element name="PaymentDate" type="SAFdateType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de referências a outros documentos em documentos retificativos de faturas-->
<xs:element name="References">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="Reference" />
<xs:element minOccurs="0" ref="Reason" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Acordos entre cliente e fornecedor-->
<xs:element name="Settlement">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="SettlementDiscount" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element minOccurs="0" name="SettlementAmount" type="SAFmonetaryType" />
<xs:element minOccurs="0" name="SettlementDate" type="SAFdateType" />
<xs:element minOccurs="0" name="PaymentTerms" type="SAFPTtextTypeMandatoryMax100Car" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de entregas de produtos -->
<xs:complexType name="ShippingPointStructure">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="DeliveryID" />
<xs:element minOccurs="0" ref="DeliveryDate" />
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element minOccurs="0" ref="WarehouseID" />
<xs:element minOccurs="0" ref="LocationID" />
</xs:sequence>
<xs:element minOccurs="0" ref="Address" />
</xs:sequence>
</xs:complexType>
<!-- Estrutura de Moradas para Fornecedores-->
<xs:complexType name="SupplierAddressStructure">
<xs:sequence>
<xs:element minOccurs="0" ref="BuildingNumber" />
<xs:element minOccurs="0" ref="StreetName" />
<xs:element ref="AddressDetail" />
<xs:element ref="City" />
<xs:element ref="PostalCode" />
<xs:element minOccurs="0" ref="Region" />
<xs:element name="Country" type="SupplierCountry" />
</xs:sequence>
</xs:complexType>
<!-- Estrutura de Taxa -->
<xs:element name="Tax">
<xs:complexType>
<xs:sequence>
<xs:element ref="TaxType" />
<xs:element ref="TaxCountryRegion" />
<xs:element ref="TaxCode" />
<xs:choice>
<xs:element ref="TaxPercentage" />
<xs:element ref="TaxAmount" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Estrutura de Retenção na fonte-->
<xs:element name="WithholdingTax">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="WithholdingTaxType" />
<xs:element minOccurs="0" name="WithholdingTaxDescription" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="WithholdingTaxAmount" type="SAFmonetaryType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- ELEMENTOS SIMPLES -->
<xs:element name="AccountDescription" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="Address" type="AddressStructure" />
<xs:element name="AddressDetail" type="SAFPTtextTypeMandatoryMax100Car" />
<xs:element name="ATDocCodeID" type="SAFPTtextTypeMandatoryMax200Car" />
<xs:element name="BillingAddress" type="AddressStructure" />
<xs:element name="BuildingNumber" type="SAFPTtextTypeMandatoryMax10Car" />
<xs:element name="BusinessName" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="City" type="SAFPTtextTypeMandatoryMax50Car" />
<xs:element name="ClosingCreditBalance" type="SAFmonetaryType" />
<xs:element name="ClosingDebitBalance" type="SAFmonetaryType" />
<xs:element name="CompanyAddress" type="AddressStructurePT" />
<xs:element name="CompanyName" type="SAFPTtextTypeMandatoryMax100Car" />
<xs:element name="Contact" type="SAFPTtextTypeMandatoryMax50Car" />
<xs:element name="CreditAmount" type="SAFmonetaryType" />
<xs:element name="CurrencyAmount" type="SAFmonetaryType" />
<xs:element name="CustomerID" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="CustomerTaxID" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="DateCreated" type="SAFPTDateSpan" />
<xs:element name="DebitAmount" type="SAFmonetaryType" />
<xs:element name="DeliveryDate" type="SAFdateType" />
<xs:element name="DeliveryID" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="Description" type="SAFPTtextTypeMandatoryMax200Car" />
<xs:element name="DocArchivalNumber" type="SAFTPTDocArchivalNumber" />
<xs:element name="Email" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="EndDate" type="SAFPTDateSpan" />
<xs:element name="ExchangeRate" type="SAFdecimalType" />
<xs:element name="Fax" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="GLPostingDate" type="SAFdateTimeType" />
<xs:element name="GrossTotal" type="SAFmonetaryType" />
<xs:element name="Hash" type="SAFPTtextTypeMandatoryMax172Car" />
<xs:element name="HashControl" type="SAFPTtextTypeMandatoryMax40Car" />
<xs:element name="HeaderComment" type="SAFPTtextTypeMandatoryMax255Car" />
<xs:element name="InvoiceDate" type="SAFdateType" />
<xs:element name="InvoiceStatusDate" type="SAFdateTimeType" />
<xs:element name="JournalID" type="SAFPTJournalID" />
<xs:element name="LineNumber" type="xs:nonNegativeInteger" />
<xs:element name="LocationID" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="MovementComments" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="MovementDate" type="SAFdateType" />
<xs:element name="MovementEndTime" type="SAFdateTimeType" />
<xs:element name="MovementStartTime" type="SAFdateTimeType" />
<xs:element name="MovementStatusDate" type="SAFdateTimeType" />
<xs:element name="NetTotal" type="SAFmonetaryType" />
<xs:element name="NumberOfEntries" type="xs:nonNegativeInteger" />
<xs:element name="NumberOfMovementLines" type="xs:nonNegativeInteger" />
<xs:element name="OpeningCreditBalance" type="SAFmonetaryType" />
<xs:element name="OpeningDebitBalance" type="SAFmonetaryType" />
<xs:element name="OrderDate" type="SAFdateType" />
<xs:element name="OriginatingON" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="PostalCode" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="ProductCode" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="ProductCompanyTaxID" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="ProductDescription" type="SAFPTtextTypeMandatoryMax200Car" />
<xs:element name="ProductGroup" type="SAFPTtextTypeMandatoryMax50Car" />
<xs:element name="ProductID" type="SAFPTProductID" />
<xs:element name="ProductNumberCode" type="SAFPTtextTypeMandatoryMax50Car" />
<xs:element name="ProductVersion" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="Quantity" type="SAFdecimalType" />
<xs:element name="Reason" type="SAFPTtextTypeMandatoryMax50Car" />
<xs:element name="RecordID" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="Reference" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="Region" type="SAFPTtextTypeMandatoryMax50Car" />
<xs:element name="SettlementAmount" type="SAFmonetaryType" />
<xs:element name="ShipFrom" type="ShippingPointStructure" />
<xs:element name="ShipFromAddress" type="AddressStructure" />
<xs:element name="ShipTo" type="ShippingPointStructure" />
<xs:element name="ShipToAddress" type="AddressStructure" />
<xs:element name="SoftwareCertificateNumber" type="xs:nonNegativeInteger" />
<xs:element name="SourceDocumentID" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="SourceID" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="StartDate" type="SAFPTDateSpan" />
<xs:element name="StreetName" type="SAFPTtextTypeMandatoryMax90Car" />
<xs:element name="SupplierID" type="SAFPTtextTypeMandatoryMax30Car" />
<xs:element name="SupplierTaxID" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="SystemEntryDate" type="SAFdateTimeType" />
<xs:element name="TaxAmount" type="SAFmonetaryType" />
<xs:element name="TaxEntity" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="TaxExemptionReason" type="SAFPTPortugueseTaxExemption" />
<xs:element name="TaxExpirationDate" type="SAFdateType" />
<xs:element name="TaxPayable" type="SAFmonetaryType" />
<xs:element name="TaxPercentage" type="SAFdecimalType" />
<xs:element name="TaxPointDate" type="SAFdateType" />
<xs:element name="TaxVerificationDate" type="SAFdateType" />
<xs:element name="Telephone" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="TotalCredit" type="SAFmonetaryType" />
<xs:element name="TotalDebit" type="SAFmonetaryType" />
<xs:element name="TotalQuantityIssued" type="SAFdecimalType" />
<xs:element name="TransactionDate" type="SAFdateType" />
<xs:element name="TransactionID" type="SAFPTTransactionID" />
<xs:element name="UnitOfMeasure" type="SAFPTtextTypeMandatoryMax20Car" />
<xs:element name="UnitPrice" type="SAFmonetaryType" />
<xs:element name="WarehouseID" type="SAFPTtextTypeMandatoryMax50Car" />
<xs:element name="Website" type="SAFPTtextTypeMandatoryMax60Car" />
<xs:element name="WorkDate" type="SAFdateType" />
<xs:element name="WorkStatusDate" type="SAFdateTimeType" />
<!-- ELEMENTOS SIMPLES COM RESTRIÇÕES ADICIONAIS-->
<!-- Código da Conta -->
<xs:element name="AccountID">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(([0-9a-zA-Z\-/._+*]*)|Desconhecido)" />
<xs:minLength value="1" />
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AuditFileVersion">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="1.02_01" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Identificação da empresa que exportou o SAFT-->
<xs:element name="CompanyID">
<xs:annotation>
<xs:documentation>Obtém-se pela concatenação da Conservatória do Registo Comercial com o número do registo comercial separados pelo carácter espaço. Nos casos em que não existe o registo comercial, deve ser indicado o NIF.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="([0-9]{9})+|([a-zA-Z0-9\-/_ãõÃÕéÉàáÀÁóÓçÇíÍ ]+ [0-9]+)" />
<xs:minLength value="1" />
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Código do país (ISO 3166 1-alpha-2) -->
<xs:element name="Country">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="AD|AE|AF|AG|AI|AL|AM|AO|AQ|AR|AS|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BL|BM|BN|BO|BQ|BR|BS|BT|BV|BW|BY|BZ|CA|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|CR|CU|CV|CW|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|EH|ER|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|IN|IO|IQ|IR|IS|IT|JE|JM|JO|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MF|MG|MH|MK|ML|MM|MN|MO|MP|MQ|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|SS|ST|SV|SX|SY|SZ|TC|TD|TF|TG|TH|TJ|TK|TL|TM|TN|TO|TR|TT|TV|TW|TZ|UA|UG|UM|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|XK|YE|YT|ZA|ZM|ZW|Desconhecido|" />
<xs:minLength value="2" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Código da moeda (ISO 4217) -->
<xs:element name="CurrencyCode">
<!-- Não consta o EUR por não existirem situações que requeiram este código de moeda -->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYR|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LTL|LVL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRO|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLL|SOS|SRD|SSP|STD|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|USS|UYI|UYU|UZS|VEF|VND|VUV|WST|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XDR|XFU|XOF|XPD|XPF|XPT|XSU|XUA|YER|ZAR|ZMW|ZWL|EEK|SKK|TMM|ZMK|ZWD|ZWR|" />
<xs:length value="3" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Código único do documento de movimentação de mercadorias e de conferência-->
<xs:element name="DocumentNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[^ ]+ [^/^ ]+/[0-9]+" />
<xs:minLength value="1" />
<xs:maxLength value="60" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Código CAE -->
<xs:element name="EACCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(([0-9]*))" />
<xs:length value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Ano Fiscal -->
<xs:element name="FiscalYear">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="2000" />
<xs:maxInclusive value="9999" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Categoria da conta -->
<xs:element name="GroupingCategory">
<xs:annotation>
<xs:documentation>GR para conta de 1º grau da contabilidade geral, GA para conta agregadora ou integradora da contabilidade geral, GM para conta de movimento da contabilidade geral, AR para conta de 1º grau da contabilidade analítica, AA para conta agregadora ou integradora da contabilidade analítica, AM para conta de movimento da contabilidade analítica </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="GR" />
<xs:enumeration value="GA" />
<xs:enumeration value="GM" />
<xs:enumeration value="AR" />
<xs:enumeration value="AA" />
<xs:enumeration value="AM" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Código único do documento de venda -->
<xs:element name="InvoiceNo">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[^ ]+ [^/^ ]+/[0-9]+" />
<xs:minLength value="1" />
<xs:maxLength value="60" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Estado do documento SalesInvoices -->
<xs:element name="InvoiceStatus">
<xs:annotation>
<xs:documentation>N para Normal, S para autofaturação, A para anulado, R para documento de resumo doutros documentos criados noutras aplicações e gerado nesta aplicação, F para faturado </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="N" />
<xs:enumeration value="S" />
<xs:enumeration value="A" />
<xs:enumeration value="R" />
<xs:enumeration value="F" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipo de documento de venda-->
<xs:element name="InvoiceType">
<xs:annotation>
<xs:documentation>
Restrição: FT-Fatura nos termos do art.º 36º do CIVA, FS-Fatura simplificada nos termos do art.º 40º do CIVA, FR-Fatura-Recibo, ND-Nota de débito, NC-Nota de Crédito,VD-Venda a dinheiro (a), TV-Talão de Venda (a), TD-Talão de devolução (a), AA-Alienação Activos (a),DA-Devolução Activos (a), RP-Prémio ou Recibo Prémio, RE-Estorno ou Recibo de Estorno, CS-Imputação a Co-Seguradoras, LD-Imputação a Co-Seguradora Líder, RA-Resseguro Aceite. (a) Para dados até 2012-12-31
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="FT" />
<xs:enumeration value="FS" />
<xs:enumeration value="FR" />
<xs:enumeration value="ND" />
<xs:enumeration value="NC" />
<xs:enumeration value="VD" />
<xs:enumeration value="TV" />
<xs:enumeration value="TD" />
<xs:enumeration value="AA" />
<xs:enumeration value="DA" />
<!-- Menções para o sector segurador-->
<xs:enumeration value="RP" />
<xs:enumeration value="RE" />
<xs:enumeration value="CS" />
<xs:enumeration value="LD" />
<xs:enumeration value="RA" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Estado do documento MovementOfGoods -->
<xs:element name="MovementStatus">
<xs:annotation>
<xs:documentation>N para Normal, T por conta de terceiros, A para Anulado, R para documento de resumo doutros documentos criados noutras aplicações e gerado nesta aplicação. </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="N" />
<xs:enumeration value="T" />
<xs:enumeration value="A" />
<xs:enumeration value="R" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipo de documento de movimentação de mercadorias-->
<xs:element name="MovementType">
<xs:annotation>
<xs:documentation>
Restrição: Tipos de Documento (GR para Guia de remessa, GT para Guia de transporte, GA para Guia de movimentação de ativos próprios, GC para Guia de consignação, GD para Guia ou nota de devolução)
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="GR" />
<xs:enumeration value="GT" />
<xs:enumeration value="GA" />
<xs:enumeration value="GC" />
<xs:enumeration value="GD" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Meio de pagamento-->
<xs:element name="PaymentMechanism">
<xs:annotation>
<xs:documentation>
Restrição: Meio de pagamento (CC para Cartão de Crédito, CD para Cartão de Débito, CH para Cheque, CS para Compensação de saldos em conta corrente, LC para Letra comercial, MB para Multibanco, NU para Numerário, PR para Permuta, TB para Transferência Bancária, TR para Ticket Restaurante)
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="CC" />
<xs:enumeration value="CD" />
<xs:enumeration value="CH" />
<xs:enumeration value="CS" />
<xs:enumeration value="LC" />
<xs:enumeration value="MB" />
<xs:enumeration value="NU" />
<xs:enumeration value="PR" />
<xs:enumeration value="TB" />
<xs:enumeration value="TR" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Periodo contabilistico do documento -->
<xs:element name="Period">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="12" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipos de produto -->
<xs:element name="ProductType">
<xs:annotation>
<xs:documentation>Restrição: Tipo de produto: P - Produtos, S - Serviços, O - Outros, I - Impostos, taxas e encargos parafiscais excepto IVA e IS uma vez que se encontram reflectidos na tabela de impostos</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="P" />
<xs:enumeration value="S" />
<xs:enumeration value="O" />
<xs:enumeration value="I" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Identificador de Autofaturação -->
<xs:element name="SelfBillingIndicator">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
<xs:maxInclusive value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Origem do documento -->
<xs:element name="SourceBilling">
<xs:annotation>
<xs:documentation>P para documento produzido na aplicação, I para documento integrado e produzido noutra aplicação, M para documento proveniente de recuperação de emissão manual </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="P" />
<xs:enumeration value="I" />
<xs:enumeration value="M" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipo de sistema que exportou o SAFT -->
<xs:element name="TaxAccountingBasis">
<xs:annotation>
<xs:documentation>C para Contabilidade, F para Faturação incluindo os documentos de transporte, I para Contabilidade-Faturação incluindo os documentos de transporte, S para Autofaturação, E – Faturação, incluindo documentos de transporte, emitida por terceiros, P para Faturação parcial incluindo os documentos de transporte</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="C" />
<xs:enumeration value="F" />
<xs:enumeration value="I" />
<xs:enumeration value="S" />
<xs:enumeration value="E" />
<xs:enumeration value="P" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="TaxCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="RED|INT|NOR|ISE|OUT|([0-9.])*|NS" />
<xs:minLength value="1" />
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Código de Imposto -->
<xs:element name="TaxCountryRegion">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="AD|AE|AF|AG|AI|AL|AM|AO|AQ|AR|AS|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BL|BM|BN|BO|BQ|BR|BS|BT|BV|BW|BY|BZ|CA|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|CR|CU|CV|CW|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|EH|ER|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|IN|IO|IQ|IR|IS|IT|JE|JM|JO|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MF|MG|MH|MK|ML|MM|MN|MO|MP|MQ|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|SS|ST|SV|SX|SY|SZ|TC|TD|TF|TG|TH|TJ|TK|TL|TM|TN|TO|TR|TT|TV|TW|TZ|UA|UG|UM|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|XK|YE|YT|ZA|ZM|ZW|PT-AC|PT-MA" />
<xs:minLength value="2" />
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipo de Imposto -->
<xs:element name="TaxType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="IVA" />
<xs:enumeration value="IS" />
<xs:enumeration value="NS" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipos de Movimento Contabilistico -->
<xs:element name="TransactionType">
<xs:annotation>
<xs:documentation>Restrição: Tipificação dos movimentos contabilísticos - N - Normal, R - Regularizações do período de tributação, A - Apuramento de resultados, J - Movimentos de Ajustamento </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="N" />
<xs:enumeration value="R" />
<xs:enumeration value="A" />
<xs:enumeration value="J" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Código do tipo de imposto retido -->
<xs:element name="WithholdingTaxType">
<xs:annotation>
<xs:documentation>Restrição: IRS para Imposto Sobre o Rendimento das Pessoas Singulares, IRC para Imposto Sobre o Rendimento das Pessoas colectivas, IS para Imposto de selo </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="IRS" />
<xs:enumeration value="IRC" />
<xs:enumeration value="IS" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Estado do documento WorkingDocuments -->
<xs:element name="WorkStatus">
<xs:annotation>
<xs:documentation>N para Normal, A para Anulado, F para faturado (quando para este documento também existe na tabela 4.1. o correspondente do tipo fatura ou fatura simplificada) </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="N" />
<xs:enumeration value="A" />
<xs:enumeration value="F" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipo de documento de conferência de entrega de mercadorias ou da prestação de serviços -->
<xs:element name="WorkType">
<xs:annotation>
<xs:documentation>
Restrição: DC para documentos suscetíveis de apresentação ao cliente para conferência de entrega de mercadorias ou da prestação de serviços
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="DC" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- TIPOS DE DADOS BASE SAFT OCDE-->
<xs:simpleType name="SAFdateTimeType">
<xs:restriction base="xs:dateTime" />
</xs:simpleType>
<xs:simpleType name="SAFdateType">
<xs:restriction base="xs:date" />
</xs:simpleType>
<xs:simpleType name="SAFdecimalType">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0.00" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFmonetaryType">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0.00" />
</xs:restriction>
</xs:simpleType>
<!-- TIPOS DE DADOS BASE SAFT Portugal -->
<!-- Código Postal Português -->
<xs:simpleType name="PostalCodePT">
<xs:restriction base="xs:string">
<xs:pattern value="([0-9]{4}-[0-9]{3})" />
</xs:restriction>
</xs:simpleType>
<!-- Periodo do movimento contabilístico -->
<xs:simpleType name="SAFPTAccountingPeriod">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="16" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTDateSpan">
<xs:restriction base="xs:date">
<xs:minInclusive value="2000-01-01" />
<xs:maxInclusive value="9999-12-31" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFTPTDocArchivalNumber">
<xs:restriction base="xs:string">
<xs:pattern value="[^ ]{1,20}" />
<xs:minLength value="1" />
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTGLAccountID">
<xs:restriction base="xs:string">
<xs:pattern value="(([0-9a-zA-Z\-/._+*]*))" />
<xs:minLength value="1" />
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTJournalID">
<xs:restriction base="xs:string">
<xs:pattern value="[^ ]{1,30}" />
<xs:minLength value="1" />
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFTPTMovementTaxCode">
<xs:restriction base="xs:string">
<xs:pattern value="RED|INT|NOR|ISE|OUT|NS" />
<xs:minLength value="1" />
<xs:maxLength value="3" />
</xs:restriction>
</xs:simpleType>
<!-- Tipo de Imposto da Tabela MovementOfGoods-->
<xs:simpleType name="SAFTPTMovementTaxType">
<xs:restriction base="xs:string">
<xs:enumeration value="IVA" />
<xs:enumeration value="NS" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTPortugueseTaxExemption">
<xs:restriction base="xs:string">
<xs:minLength value="6" />
<xs:maxLength value="60" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTPortugueseVatNumber">
<xs:restriction base="xs:integer">
<xs:minInclusive value="100000000" />
<xs:maxInclusive value="999999999" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTProductID">
<xs:restriction base="xs:string">
<xs:pattern value="[^/]+/[^/]+" />
<xs:minLength value="3" />
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax3Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="3" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax10Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax20Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax30Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax40Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="40" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax50Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax60Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="60" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax70Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="70" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax90Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="90" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax100Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax172Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="172" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax200Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="200" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMandatoryMax255Car">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTtextTypeMax40Car">
<xs:restriction base="xs:string">
<xs:minLength value="0" />
<xs:maxLength value="40" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SAFPTTransactionID">
<xs:restriction base="xs:string">
<xs:pattern value="[1-9][0-9]{3}-[01][0-9]-[0-3][0-9] [^ ]{1,30} [^ ]{1,20}" />
<xs:minLength value="1" />
<xs:maxLength value="70" />
</xs:restriction>
</xs:simpleType>
<!-- Código do país (ISO 3166 1-alpha-2) -->
<xs:simpleType name="SupplierCountry">
<xs:restriction base="xs:string">
<xs:pattern value="AD|AE|AF|AG|AI|AL|AM|AO|AQ|AR|AS|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BL|BM|BN|BO|BQ|BR|BS|BT|BV|BW|BY|BZ|CA|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|CR|CU|CV|CW|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|EH|ER|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|IN|IO|IQ|IR|IS|IT|JE|JM|JO|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MF|MG|MH|MK|ML|MM|MN|MO|MP|MQ|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|SS|ST|SV|SX|SY|SZ|TC|TD|TF|TG|TH|TJ|TK|TL|TM|TN|TO|TR|TT|TV|TW|TZ|UA|UG|UM|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|XK|YE|YT|ZA|ZM|ZW|" />
<xs:length value="2" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
fonte...
https://faturas.portaldasfinancas.gov.pt/DocTransporte/sgdtpf_static/java/SGDTUP-1.0.1.0014.jar

Com base neste .xsd:

Código (XML):
<!-- Origem do documento -->
<xs:element name="SourceBilling">
<xs:annotation>
<xs:documentation>P para documento produzido na aplicação, I para documento integrado e produzido noutra aplicação, M para documento proveniente de recuperação de emissão manual </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="P" />
<xs:enumeration value="I" />
<xs:enumeration value="M" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipo de sistema que exportou o SAFT -->


#264 Cr4zyKingLi0n

Cr4zyKingLi0n

    Boolean User

  • Membro
  • PipPipPip
  • 107 mensagens

Publicado 17 de Abril de 2013 - 17:44

Ver MensagemARP, em 17 de Abril de 2013 - 17:02, disse:

Com base neste .xsd:

Código (XML):
<!-- Origem do documento -->
<xs:element name="SourceBilling">
<xs:annotation>
<xs:documentation>P para documento produzido na aplicação, I para documento integrado e produzido noutra aplicação, M para documento proveniente de recuperação de emissão manual </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="P" />
<xs:enumeration value="I" />
<xs:enumeration value="M" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Tipo de sistema que exportou o SAFT -->
Entao já temos uma resposta para o elemento SourceBilling. Obrigado

#265 pv2013

pv2013

    null

  • Novo Membro
  • Pip
  • 10 mensagens

Publicado 17 de Abril de 2013 - 18:23

Segundo consigo perceber, o XSD que deve ser utilizado a partir de maio é:

http://info.portaldasfinancas.gov.pt/apps/saft-pt01/SAFTPT.xsd

Verifico que há algumas alterações em relação à versão anterior, como por exemplo o tipo de documento FS (e também FR, apesar de o FR não estar referido na portaria...)

No entanto, este XSD mantém o mesmo número de versão: 1.01_01

Já vi neste tópico referências à versão 1.02_01.

Onde está essa tal versão 1.02_01?
Esse versão 1.02_01 aplica-se apenas aos transportes?

Obrigado.

#266 samuquinha

samuquinha

    void

  • Membro
  • PipPip
  • 40 mensagens

Publicado 17 de Abril de 2013 - 18:36

Boa tarde a todos.

Uma empresa envia material por navio para um porto dentro da comunidade. Este material vai ser faturado ao abrigo do Artº 14 do RITI.
É necessário comunicar as guias de transporte do armazem central para o cais de embarque?

Obrigado

#267 ARP

ARP

    null

  • Membro
  • Pip
  • 24 mensagens

Publicado 17 de Abril de 2013 - 18:37

Ver Mensagempv2013, em 17 de Abril de 2013 - 18:23, disse:

Segundo consigo perceber, o XSD que deve ser utilizado a partir de maio é:

http://info.portaldasfinancas.gov.pt/apps/saft-pt01/SAFTPT.xsd

Verifico que há algumas alterações em relação à versão anterior, como por exemplo o tipo de documento FS (e também FR, apesar de o FR não estar referido na portaria...)

No entanto, este XSD mantém o mesmo número de versão: 1.01_01

Já vi neste tópico referências à versão 1.02_01.

Onde está essa tal versão 1.02_01?
Esse versão 1.02_01 aplica-se apenas aos transportes?

Obrigado.


Esse é o link da versão actual de produção...

Ainda não existe o .xsd 'oficial' da versão 1.02_01, mas vê o topico #943 Utilizar Webservices da AT (Facturas, SAFT-PT)

#268 Cr4zyKingLi0n

Cr4zyKingLi0n

    Boolean User

  • Membro
  • PipPipPip
  • 107 mensagens

Publicado 17 de Abril de 2013 - 18:56

Após vários testes estou a ter um problema, ao enviar documentos de transporte efectuados de forma manual. São na prática guias de transporte já passadas há 2 ou 3 dias, mas que foram lançadas hoje. Ao exportar o ficheiro vai como documento manual, no entanto após enviar no ficheiro de validação retorna documento não aceite porque data de inicio de transporte é inferior á data actual. Como fazer pôr uma data de inicio de transporte igual á actual?

#269 Jorge Silva

Jorge Silva

    null

  • Novo Membro
  • Pip
  • 6 mensagens

Publicado 17 de Abril de 2013 - 19:44

Boa tarde a todos,

Já alguém conseguiu submeter o ficheiro se Saft com os documentos de transporte no site do e-faturas?
Estou cansado de tentar e dá-me sempre erro de servidor!

E obtiveram o ficheiro de resposta com os códigos? Precisava de um ficheiro para testar o meu programa.

Obrigado!

#270 heldermsa

heldermsa

    null

  • Novo Membro
  • Pip
  • 1 mensagens

Publicado 18 de Abril de 2013 - 10:54

Bom dia,

Ficheiro de Teste - enviado há 5 minutos:
Basta substituir o <TaxRegistrationNumber>XXXXX</TaxRegistrationNumber> pelo NIF respetivo e o <ProductCompanyTaxID>XXXXX</ProductCompanyTaxID>


Código (XML):
<?xml version="1.0" encoding="windows-1252"?>
<AuditFile xsi:schemaLocation="urn:OECD:StandardAuditFile-Tax:PT_1.02_01 SAF-T-PT.XSD" xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<AuditFileVersion>1.02_01</AuditFileVersion>
<CompanyID>123456789</CompanyID>
<TaxRegistrationNumber>XXXXX</TaxRegistrationNumber>
<TaxAccountingBasis>P</TaxAccountingBasis>
<CompanyName>DEMO3 DEMONSTRAÇÂO</CompanyName>
<CompanyAddress>
<AddressDetail>LUGAR</AddressDetail>
<City>Terra local</City>
<PostalCode>1000-100</PostalCode>
<Country>PT</Country>
</CompanyAddress>
<FiscalYear>2013</FiscalYear>
<StartDate>2013-01-01</StartDate>
<EndDate>2013-03-27</EndDate>
<CurrencyCode>EUR</CurrencyCode>
<DateCreated>2013-03-27</DateCreated>
<TaxEntity>Global</TaxEntity>
<ProductCompanyTaxID>XXXXX</ProductCompanyTaxID>
<SoftwareCertificateNumber>0</SoftwareCertificateNumber>
<ProductID>Gin/APR</ProductID>
<ProductVersion>3.6.5</ProductVersion>
</Header>
<MasterFiles>
<Customer>
<CustomerID>PM0001</CustomerID>
<AccountID>2111M0001</AccountID>
<CustomerTaxID>509796370</CustomerTaxID>
<CompanyName>Cliente PM0001</CompanyName>
<BillingAddress>
<StreetName>Desconhecido</StreetName>
<AddressDetail>Morada Cliente PM0001</AddressDetail>
<City>Sem código postal</City>
<PostalCode>4400-000</PostalCode>
<Country>PT</Country>
</BillingAddress>
<SelfBillingIndicator>0</SelfBillingIndicator>
</Customer>
</MasterFiles>
<SourceDocuments>
<MovementOfGoods>
<NumberOfMovementLines>1</NumberOfMovementLines>
<TotalQuantityIssued>1</TotalQuantityIssued>
<StockMovement>
<DocumentNumber>GR5 1/650</DocumentNumber>
<DocumentStatus>
<MovementStatus>N</MovementStatus>
<MovementStatusDate>2013-01-16T19:15:32</MovementStatusDate>
<SourceID>HA</SourceID>
</DocumentStatus>
<SourceBilling>P</SourceBilling>
<Hash>Pyk72dcT7e5v2Q6D6QxJ5S/i0qM5zYEPVVWKkwuNdGFTQntoQRwg+DqKhPW1H5Nq6cw6BHEtOTfgYappraWr/VnMiwsytNz/WwAb+Y8+4mxEHp8OKmZQ3K8YvVoGWJd+JPQOhWbH+CSw2LnLef1hWCuddCCYngB0RxL7Ed9Lpoo=</Hash>
<HashControl>1</HashControl>
<Period>1</Period>
<MovementDate>2013-01-16</MovementDate>
<MovementType>GR</MovementType>
<SystemEntryDate>2013-01-16T19:15:32</SystemEntryDate>
<CustomerID>PM0001</CustomerID>
<SourceID>PM</SourceID>
<ShipFrom>
<Address>
<AddressDetail>Morada A</AddressDetail>
<City>ABADE DE VERMOIM</City>
<PostalCode>4770-011</PostalCode>
<Country>PT</Country>
</Address>
</ShipFrom>
<MovementStartTime>2013-04-19T15:57:20</MovementStartTime>
<Line>
<LineNumber>1</LineNumber>
<ProductCode>04220202</ProductCode>
<ProductDescription>COMPR SH H50CS SBA050 - R22</ProductDescription>
<Quantity>1</Quantity>
<UnitOfMeasure>UN</UnitOfMeasure>
<UnitPrice>75</UnitPrice>
<Description>COMPR SH H50CS SBA050 - R22</Description>
<CreditAmount>75</CreditAmount>
<Tax>
<TaxType>IVA</TaxType>
<TaxCountryRegion>PT</TaxCountryRegion>
<TaxCode>NOR</TaxCode>
<TaxPercentage>23</TaxPercentage>
</Tax>
</Line>
<DocumentTotals>
<TaxPayable>17.25</TaxPayable>
<NetTotal>75</NetTotal>
<GrossTotal>92.25</GrossTotal>
</DocumentTotals>
</StockMovement>
</MovementOfGoods>
</SourceDocuments>
</AuditFile>

Resposta obtida:


Código (XML):
<?xml version="1.0" encoding="ISO-8859-1"?>
<FileProcResult xmlns="https://servicos.portaldasfinancas.gov.pt/sgdtpf/fileProcessingResult/">
   <DocumentInfo>
          <DocumentNumber>GR5 1/650</DocumentNumber>
          <ATDocCodeID>000382132</ATDocCodeID>
   </DocumentInfo>
</FileProcResult>


Exemplo de resposta para ficheiro com 4 documentos, 2 OK, 2 com erro:


Código (XML):
<?xml version="1.0" encoding="ISO-8859-1"?>
<FileProcResult xmlns="https://servicos.portaldasfinancas.gov.pt/sgdtpf/fileProcessingResult/">
   <DocumentInfo>
          <DocumentNumber>GR5 1/614</DocumentNumber>
          <ATDocCodeID>000181420</ATDocCodeID>
   </DocumentInfo>
   <DocumentInfo>
          <DocumentNumber>GR5 1/613</DocumentNumber>
          <ATDocCodeID>000181439</ATDocCodeID>
   </DocumentInfo>
   <Error>
          <ErrorMessage>Já foi inserido um Documento de Transporte com o número fornecido.</ErrorMessage>
          <LineNumber>191</LineNumber>
   </Error>
   <Error>
          <ErrorMessage> 'addressFrom.postalCode'must match "([0-9]{4}-[0-9]{3})?"</ErrorMessage>
          <LineNumber>238</LineNumber>
   </Error>
</FileProcResult>

Editado por Rui Carlos, 18 de Abril de 2013 - 16:35.
Formatação do código.


#271 Diogo_Marcelo

Diogo_Marcelo

    null

  • Membro
  • Pip
  • 15 mensagens

Publicado 18 de Abril de 2013 - 11:15

Bom dia Pessoal,

Venho alertar que aquele saft "não oficial" que está a correr pela internet (retirado do JAR), é o mesmo que a AT se está a basear no e-fatura circulação.

Digo isto porque já gerei um ficheiro válido com aquele saft e consegui submeter as guias via saft.

Imagem Colocada


Schema Saft 1.02_01   (Existe a possibilidade que ainda façam alterações)



Cumprimentos
Diogo Marcelo

#272 Pedro Silva Conceicao

Pedro Silva Conceicao

    null

  • Novo Membro
  • Pip
  • 5 mensagens

Publicado 18 de Abril de 2013 - 12:08

Ver MensagemDiogo_Marcelo, em 18 de Abril de 2013 - 11:15, disse:

Bom dia Pessoal,

Venho alertar que aquele saft "não oficial" que está a correr pela internet (retirado do JAR), é o mesmo que a AT se está a basear no e-fatura circulação.

Digo isto porque já gerei um ficheiro válido com aquele saft e consegui submeter as guias via saft.

Imagem Colocada


Schema Saft 1.02_01   (Existe a possibilidade que ainda façam alterações)



Cumprimentos
Diogo Marcelo

Bom dia,

Sabe a razão pelo qual o seu ficheiro (conforme resulta da imagem)foi integrado parcialmente e dos 6 documentos submetidos, 6 apresentam erros???

Não deveria antes ser considerado rejeitado!? Parece-me que o ficheiro que submeteu bateu todo no teto! Estarei errado?

Cumprimentos

Pedro

#273 r.m.m.c

r.m.m.c

    null

  • Novo Membro
  • Pip
  • 7 mensagens

Publicado 18 de Abril de 2013 - 12:42

Boas,

usando o jar: https://faturas.portaldasfinancas.gov.pt/DocTransporte/sgdtpf_static/java/SGDTUP-1.0.1.0014.jar  consegui validar o ficheiro saft da nova estrutura.

Mas indo ao efatura ou usando o JAR FACTEMICLI-2.0.1.0039-cmdClient que é o que esta presente no portal efatura, nao consigo de forma nenhuma validar o ficheiro. Obtenho sempre como resposta que a versao 1.02_01 nao e valida..

Alguem ja conseguiu indo ao efatura ou usando o jar que esta no efatura validar e receber a resposta ao saft dos docs transportes?


Obrigadissimo pela ajuda,
Ricardo

#274 Jorge Silva

Jorge Silva

    null

  • Novo Membro
  • Pip
  • 6 mensagens

Publicado 18 de Abril de 2013 - 12:45

Bom dia Pessoal,

Mais uma vez obrigado.
Até parece que estou numa sala cheia de programadores. Quando há uma duvida, é rapidamente esclarecida.

Jorge Silva

#275 bhenriques

bhenriques

    void

  • Membro
  • PipPip
  • 39 mensagens

Publicado 18 de Abril de 2013 - 12:46

Bem segundo ouvi hoje, foi dito numa formação a TOCs que a entrada em vigor das novra regras poderá ser adiada.
Tendo em conta que ainda não há XSD até que fazia sentido.

#276 Jorge Silva

Jorge Silva

    null

  • Novo Membro
  • Pip
  • 6 mensagens

Publicado 18 de Abril de 2013 - 13:21

Ver Mensagemr.m.m.c, em 18 de Abril de 2013 - 12:42, disse:

Boas,

usando o jar: https://faturas.portaldasfinancas.gov.pt/DocTransporte/sgdtpf_static/java/SGDTUP-1.0.1.0014.jar  consegui validar o ficheiro saft da nova estrutura.

Mas indo ao efatura ou usando o JAR FACTEMICLI-2.0.1.0039-cmdClient que é o que esta presente no portal efatura, nao consigo de forma nenhuma validar o ficheiro. Obtenho sempre como resposta que a versao 1.02_01 nao e valida..

Alguem ja conseguiu indo ao efatura ou usando o jar que esta no efatura validar e receber a resposta ao saft dos docs transportes?


Obrigadissimo pela ajuda,
Ricardo

Pelo que sei, o FACTEMICLI-2.0.1.0039-cmdClient é só para as faturas

Ver Mensagembhenriques, em 18 de Abril de 2013 - 12:46, disse:

Bem segundo ouvi hoje, foi dito numa formação a TOCs que a entrada em vigor das novra regras poderá ser adiada.
Tendo em conta que ainda não há XSD até que fazia sentido.

Era bom que assim fosse. Vamos ver que no dia 30 é que eles vão dizer o adiamento

#277 intoleravel

intoleravel

    null

  • Membro
  • Pip
  • 14 mensagens

Publicado 18 de Abril de 2013 - 13:42

Boa tarde,

Desculpem, mas ainda tenho umas dúvidas que gostaria de colocar:
1 - não tenho claro o termo "anulado".O que significa e como se anula um documento? No programa basta "mudar" o estado do documento ou é necessário outro documento para o anular?
2 - se o cliente tiver um SW CERTIFICADO, este SW é obrigado a ter o envio das guias? Isto é, por Webservice ou ciração do ficheiro SAFT?
3 - pode o cliente com um SW CERTIFICADO introduzir manualmente a informação no site? e manualmente significa linha a linha ou envio de SAFT?
4 - Segundo entendo, o telefonema só poderá ser efetuado em último caso? Só se falharem as comunicações e se for o pre-impresso?

Afinal ainda no dia 15 saiu outro documento de envido documentos:

15-04-2013
 Adição de novos códigos de erro.
 Alteraçã WSDL: endereçs.
Obrigado.

#278 Diogo_Marcelo

Diogo_Marcelo

    null

  • Membro
  • Pip
  • 15 mensagens

Publicado 18 de Abril de 2013 - 14:14

Ver MensagemPedro Silva Conceicao, em 18 de Abril de 2013 - 12:08, disse:

Bom dia,

Sabe a razão pelo qual o seu ficheiro (conforme resulta da imagem)foi integrado parcialmente e dos 6 documentos submetidos, 6 apresentam erros???

Não deveria antes ser considerado rejeitado!? Parece-me que o ficheiro que submeteu bateu todo no teto! Estarei errado?

Cumprimentos

Pedro



Pedro,

Esse foi o primeiro teste. As datas de inicio de transporte estavam erradas, assim como acontece quando se tenta enviar por webservice.

Após ajustar as datas de inicio de transporte:

Imagem Colocada



O ficheiro de reposta contêm:

Código :
<?xml version="1.0" encoding="ISO-8859-1"?>
<FileProcResult xmlns="https://servicos.portaldasfinancas.gov.pt/sgdtpf/fileProcessingResult/">
<DocumentInfo>
         <DocumentNumber>GT 01/39</DocumentNumber>
         <ATDocCodeID>000382...</ATDocCodeID>
</DocumentInfo>
<DocumentInfo>
         <DocumentNumber>GT 01/40</DocumentNumber>
         <ATDocCodeID>000382...</ATDocCodeID>
</DocumentInfo>
<DocumentInfo>
         <DocumentNumber>GT 01/41</DocumentNumber>
         <ATDocCodeID>000382...</ATDocCodeID>
</DocumentInfo>
<DocumentInfo>
         <DocumentNumber>GT 01/42</DocumentNumber>
         <ATDocCodeID>000439...</ATDocCodeID>
</DocumentInfo>
<DocumentInfo>
         <DocumentNumber>GT 01/43</DocumentNumber>
         <ATDocCodeID>000439...</ATDocCodeID>
</DocumentInfo>
<DocumentInfo>
         <DocumentNumber>GT 01/44</DocumentNumber>
         <ATDocCodeID>000439...</ATDocCodeID>
</DocumentInfo>
<Error>
         <ErrorMessage>Já foi inserido um Documento de Transporte com o número fornecido.</ErrorMessage>
         <LineNumber>2</LineNumber>
</Error>
</FileProcResult>



Mesmo assim a AT, por burrice, dás nos um problema que é:

Tudo bem em retornar o erro, mas não nos diz a qual dos documentos enviados se refere o erro. Neste caso, é simples perceber que o erro pertence a unico documento não aceite, mas no caso de ter mais que um. Não sei como os distinguir. Enfim..

Apenas poderei dizer ao utilizador, quais os documentos integrados e os rejeitados. Não posso indicar qual o motivo de rejeição.

Editado por Diogo_Marcelo, 18 de Abril de 2013 - 14:25.


#279 ossadas

ossadas

    void

  • Membro
  • PipPip
  • 67 mensagens

Publicado 18 de Abril de 2013 - 15:53

Boas,

Espantoso como os responsáveis da AT permitem que se chegue a está situação!!!
É de uma tremenda incompetência, irresponsabilidade... ou simplesmente de uma leviendade.
Atrevo-me a escrever: de uma leviandade nunca antes visto por pessoas que não tem consideração nenhuma.
Tudo baseado no "custe o que custar". As pessoas tem de sujeitar-se a tamanha imposição e trapalhada...

Peço imensas desculpas, mas enerva e cansa...

Graças a vocês tenho conseguido pôr a funcionar a comunicação de transporte por via SAFT.

Já constatei que dá erro se enviar o mesmo nome do ficheiro, tenho de andar a renomear... Por um lado faz sentido porque depois é necessário para comparar com os possíveis erros, mas muito imprudente...
Como vou comparar?
Escrevem linha número tal e vou a tal linha e não corresponde ao erro especificado!!!
Como fazem a leitura ou compõem a informação interna de forma a apurarem o erro?
Mas porque não associam o documento?!

Como estão a contornam esta questão?


Obrigado.

#280 r.m.m.c

r.m.m.c

    null

  • Novo Membro
  • Pip
  • 7 mensagens

Publicado 18 de Abril de 2013 - 16:48

Ver MensagemJorge Silva, em 18 de Abril de 2013 - 13:21, disse:

Pelo que sei, o FACTEMICLI-2.0.1.0039-cmdClient é só para as faturas



Era bom que assim fosse. Vamos ver que no dia 30 é que eles vão dizer o adiamento


Isso quer dizer que ainda nao existe o ficheiro JAR para submissão automatica do SAFT relativo a documentos de transporte....? :(