assoft-portugal / SAF-T-AO

Official XSD from the Government of Angola for use in SAF-T AO
https://www.agt.minfin.gov.ao
MIT License
56 stars 63 forks source link

Validador falha de modo diferente se a factura estiver isolada ou no meio de outras facturas #33

Closed pcasqueiro closed 5 years ago

pcasqueiro commented 5 years ago

Num ficheiro completo SAFT-AO tenho erros de validação em 3 Invoices. No caso do Invoice 5, por exemplo, tenho diversos erros:

Falha na validação, AuditFile.SourceDocuments.SalesInvoices.TotalCredit da parte do ficheiro está mal calculado

Falha na validação, porque o TaxPayable do AuditFile.SourceDocuments.SalesInvoices.5Invoice está mal calculado Falha na validação, porque o TaxPayable do AuditFile.SourceDocuments.SalesInvoices.8Invoice está mal calculado Falha na validação, porque o TaxPayable do AuditFile.SourceDocuments.SalesInvoices.12Invoice está mal calculado Formato errado do AuditFile.SourceDocuments.SalesInvoices.5Invoice.1Line.Quantity O AuditFile.SourceDocuments.SalesInvoices.5Invoice.DocumentTotals.1Payment.PaymentMechanism no arquivo não é permitido repetição O AuditFile.SourceDocuments.SalesInvoices.13Invoice.DocumentTotals.1Payment.PaymentMechanism no arquivo não é permitido repetição Formato errado do AuditFile.SourceDocuments.SalesInvoices.5Invoice.DocumentTotals.1Payment.PaymentAmount O AuditFile.SourceDocuments.SalesInvoices.5Invoice.DocumentTotals.1Payment.PaymentAmount no arquivo não é permitido repetição O AuditFile.SourceDocuments.SalesInvoices.13Invoice.DocumentTotals.1Payment.PaymentAmount no arquivo não é permitido repetição O AuditFile.SourceDocuments.SalesInvoices.5Invoice.DocumentTotals.1Payment.PaymentDate no arquivo não é permitido repetição O AuditFile.SourceDocuments.SalesInvoices.13Invoice.DocumentTotals.1Payment.PaymentDate no arquivo não é permitido repetição Formato errado do AuditFile.SourceDocuments.SalesInvoices.5Invoice.1WithholdingTax.WithholdingTaxAmount Falha na validação, AuditFile.SourceDocuments.WorkingDocuments.TotalCredit da parte do ficheiro está mal calculado Formato errado do AuditFile.SourceDocuments.WorkingDocuments.TotalCredit

No entanto, se fizer um ficheiro SAFT-AO onde inclui APENAS esse documento, apenas tenho um erro, que aliás, não consigo compreender porque:

Falha na validação, AuditFile.SourceDocuments.SalesInvoices.TotalCredit da parte do ficheiro está mal calculado

No entanto, o Invoice parece estar bem construido:

1 0 6182.36 FR Z1.2019/5 N 2019-10-23T12:05:24 pcasqueiro P 52624fb6c43babae8b8e94fbd739c3d3d880b5a65e4ec13d0b0f87dcfa5760a843fbc19358ee9cad1b9226e65a3256298fc8250bf665fdbef11ca8f543c21c78 1 10 2019-10-23 FR 0 0 0 pcasqueiro 2019-10-23T12:05:24 12 1 FR Z1.2019/5 2019-10-23 11 Manual L. Portuguesa 6ª 1 UN 919.2 2019-10-23 Manual L. Portuguesa 6ª 919.2 IVA AO ISE 0 Isento IVA Artigo 12 d) M02 2 FR Z1.2019/5 2019-10-23 6 Dossier de 4 furos 1 UN 5263.1579 2019-10-23 Dossier de 4 furos 5263.1579 IVA AO NOR 14 736.84 6182.36 6919.2 CD 6919.2 2019-10-23 736.84
pcasqueiro commented 5 years ago

Anexo os ficheiros XML do ponto anterior

SAFT-AO-Completo.xml.txt SAFT-AO-Apenas FR-5.xml.txt

cryptolopes commented 5 years ago

Olá @pcasqueiro, Antes de irmos aos erros detetados pelo validador da AGT, recomendo que veja primeiros os erros, com origem na estrutura do ficheiro SAF-T:

<?xml version="1.0" encoding="utf-8"?>
<ErrorList>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:ProductID' element is invalid - The value 'phpPOS' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFAOProductID' - The Pattern constraint failed.</Description>
    <Line>26</Line>
    <Column>10</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>26</Line>
    <Column>10</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:StreetName' element is invalid - The value '' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFAOtextTypeMandatoryMax200Car' - The actual length is less than the MinLength value.</Description>
    <Line>62</Line>
    <Column>18</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The actual length is less than the MinLength value.</Description>
    <Line>62</Line>
    <Column>18</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:StreetName' element is invalid - The value '' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFAOtextTypeMandatoryMax200Car' - The actual length is less than the MinLength value.</Description>
    <Line>70</Line>
    <Column>18</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The actual length is less than the MinLength value.</Description>
    <Line>70</Line>
    <Column>18</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>248</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>248</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '9000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>249</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>249</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '10260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>250</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>250</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '10000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>307</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>307</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>362</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>362</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '10000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>363</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>363</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '11400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>364</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>364</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '6580' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>440</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>440</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '47000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>441</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>441</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '53580' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>442</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>442</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:Quantity' element is invalid - The value '-1' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFdecimalType' - The MinInclusive constraint failed.</Description>
    <Line>483</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The MinInclusive constraint failed.</Description>
    <Line>483</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>497</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>497</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '9000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>498</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>498</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '10260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>499</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>499</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The element 'Payment' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'PaymentMechanism' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'.</Description>
    <Line>504</Line>
    <Column>26</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:WithholdingTaxAmount' element is invalid - The value '-1260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFmonetaryType' - The MinInclusive constraint failed.</Description>
    <Line>510</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The MinInclusive constraint failed.</Description>
    <Line>510</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '6919.2' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>582</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>582</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '6919.2' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>662</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>662</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '16.5' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>797</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>797</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '3780' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>853</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>853</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '27000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>854</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>854</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '30780' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>855</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>855</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>910</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>910</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '10000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>911</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>911</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '11400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>912</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>912</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '10501.6' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>996</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>996</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>There is a duplicate key sequence 'FR Z1.2019/1' for the 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:InvoiceNoConstraint' key or unique identity constraint.</Description>
    <Line>928</Line>
    <Column>14</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '2660' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>1073</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>1073</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '19000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>1074</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>1074</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '21660' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed.</Description>
    <Line>1075</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The Pattern constraint failed.</Description>
    <Line>1075</Line>
    <Column>22</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The element 'Payment' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'PaymentMechanism' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'.</Description>
    <Line>1080</Line>
    <Column>26</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>There is a duplicate key sequence 'FR Z1.2019/2' for the 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:InvoiceNoConstraint' key or unique identity constraint.</Description>
    <Line>1008</Line>
    <Column>14</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The element 'WorkDocument' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'SpecialRegimes' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. List of possible elements expected: 'SourceID' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'.</Description>
    <Line>1107</Line>
    <Column>18</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
  <Error>
    <Severity>Error</Severity>
    <Description>The element 'WorkDocument' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'SpecialRegimes' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. List of possible elements expected: 'SourceID' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'.</Description>
    <Line>1185</Line>
    <Column>18</Column>
    <FileName>SAFT-AO-Completo.xml</FileName>
  </Error>
</ErrorList>
pcasqueiro commented 5 years ago

Caro Nelson, Muito obrigado pela chamada de atenção. Já validei o ficheiro contra o XSD e está tudo corrigido. Assim sendo os erros reportados pelo validador são apenas 3 para os quais pedia muito a sua ajuda pois não consigo compreender o que está mal. São dois documentos em que cada um contem duas linhas. Falha na validação, AuditFile.SourceDocuments.SalesInvoices.TotalCredit da parte do ficheiro está mal calculado

Falha na validação, porque o TaxPayable do AuditFile.SourceDocuments.SalesInvoices.8Invoice está mal calculado

Falha na validação, porque o TaxPayable do AuditFile.SourceDocuments.SalesInvoices.12Invoice está mal calculado

Anexo o novo ficheiro XML

Muito obrigado, Pedro

From: Nelson notifications@github.com Sent: 28 de outubro de 2019 13:03 To: assoft-portugal/SAF-T-AO SAF-T-AO@noreply.github.com Cc: Pedro Casqueiro pcasqueiro@leya.com; Mention mention@noreply.github.com Subject: Re: [assoft-portugal/SAF-T-AO] Validador falha de modo diferente se a factura estiver isolada ou no meio de outras facturas (#33)

Olá @pcasqueirohttps://github.com/pcasqueiro, Antes de irmos aos erros detetados pelo validador da AGT, recomendo que veja primeiros os erros, com origem na estrutura do ficheiro SAF-T:

<?xml version="1.0" encoding="utf-8"?>

Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:ProductID' element is invalid - The value 'phpPOS' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFAOProductID' - The Pattern constraint failed. 26 10 SAFT-AO-Completo.xml Error The Pattern constraint failed. 26 10 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:StreetName' element is invalid - The value '' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFAOtextTypeMandatoryMax200Car' - The actual length is less than the MinLength value. 62 18 SAFT-AO-Completo.xml Error The actual length is less than the MinLength value. 62 18 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:StreetName' element is invalid - The value '' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFAOtextTypeMandatoryMax200Car' - The actual length is less than the MinLength value. 70 18 SAFT-AO-Completo.xml Error The actual length is less than the MinLength value. 70 18 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 248 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 248 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '9000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 249 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 249 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '10260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 250 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 250 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '10000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 307 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 307 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 362 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 362 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '10000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 363 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 363 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '11400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 364 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 364 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '6580' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 440 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 440 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '47000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 441 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 441 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '53580' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 442 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 442 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:Quantity' element is invalid - The value '-1' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFdecimalType' - The MinInclusive constraint failed. 483 22 SAFT-AO-Completo.xml Error The MinInclusive constraint failed. 483 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 497 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 497 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '9000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 498 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 498 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '10260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 499 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 499 22 SAFT-AO-Completo.xml Error The element 'Payment' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'PaymentMechanism' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. 504 26 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:WithholdingTaxAmount' element is invalid - The value '-1260' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFmonetaryType' - The MinInclusive constraint failed. 510 22 SAFT-AO-Completo.xml Error The MinInclusive constraint failed. 510 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '6919.2' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 582 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 582 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '6919.2' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 662 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 662 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '16.5' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 797 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 797 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '3780' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 853 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 853 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '27000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 854 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 854 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '30780' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 855 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 855 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '1400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 910 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 910 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '10000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 911 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 911 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '11400' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 912 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 912 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '10501.6' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 996 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 996 22 SAFT-AO-Completo.xml Error There is a duplicate key sequence 'FR Z1.2019/1' for the 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:InvoiceNoConstraint' key or unique identity constraint. 928 14 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:TaxPayable' element is invalid - The value '2660' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 1073 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 1073 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:NetTotal' element is invalid - The value '19000' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 1074 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 1074 22 SAFT-AO-Completo.xml Error The 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:GrossTotal' element is invalid - The value '21660' is invalid according to its datatype 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:SAFMonetaryType2DecimalPlaces' - The Pattern constraint failed. 1075 22 SAFT-AO-Completo.xml Error The Pattern constraint failed. 1075 22 SAFT-AO-Completo.xml Error The element 'Payment' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'PaymentMechanism' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. 1080 26 SAFT-AO-Completo.xml Error There is a duplicate key sequence 'FR Z1.2019/2' for the 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01:InvoiceNoConstraint' key or unique identity constraint. 1008 14 SAFT-AO-Completo.xml Error The element 'WorkDocument' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'SpecialRegimes' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. List of possible elements expected: 'SourceID' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. 1107 18 SAFT-AO-Completo.xml Error The element 'WorkDocument' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01' has invalid child element 'SpecialRegimes' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. List of possible elements expected: 'SourceID' in namespace 'urn:OECD:StandardAuditFile-Tax:AO_1.01_01'. 1185 18 SAFT-AO-Completo.xml

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/assoft-portugal/SAF-T-AO/issues/33?email_source=notifications&email_token=ANTSTOTLZOHVGGUCPHE5K23QQ3IFRA5CNFSM4JFYURQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECMUKFY#issuecomment-546915607, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANTSTOX2RXBCXWI7ZIX7KXTQQ3IFRANCNFSM4JFYURQA. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/assoft-portugal/SAF-T-AO/issues/33?email_source=notifications\u0026email_token=ANTSTOTLZOHVGGUCPHE5K23QQ3IFRA5CNFSM4JFYURQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECMUKFY#issuecomment-546915607", "url": "https://github.com/assoft-portugal/SAF-T-AO/issues/33?email_source=notifications\u0026email_token=ANTSTOTLZOHVGGUCPHE5K23QQ3IFRA5CNFSM4JFYURQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECMUKFY#issuecomment-546915607", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

<?xml version="1.0" encoding="utf-8"?> <AuditFile xmlns="urn:OECD:StandardAuditFile-Tax:AO_1.01_01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

1.01_01 Certidão 1997.998 5403079530 F TEXTO EDITORES (SU) LDA TEXTO EDITORES (SU) LDA Talatona Park, Rua 9, Fracção A12 Talatona Luanda 0000 Luanda AO 2019 2019-10-01 2019-10-31 AOA 2019-10-28 TEXTO EDITORES 5403079530 0 phpPOS/TEXTO EDITORES 17.1 924068760 info@textoeditores.ao www.textoeditores.ao
<MasterFiles>
    <Customer>
        <CustomerID>2</CustomerID>
        <AccountID>Desconhecido</AccountID>
        <CustomerTaxID>9999999999</CustomerTaxID>
        <CompanyName>Luisa Rodrigues (não indicou NIF)</CompanyName>
        <BillingAddress>
            <StreetName>Rua da Esquerda Segunda, 566</StreetName>
            <AddressDetail>Desconhecido</AddressDetail>
            <City>Luanda</City>
            <PostalCode>0000</PostalCode>
            <Province>Desconhecido</Province>
            <Country>AO</Country>
        </BillingAddress>
        <ShipToAddress>
            <StreetName>Rua da Esquerda Segunda, 566</StreetName>
            <AddressDetail>Desconhecido</AddressDetail>
            <City>Luanda</City>
            <PostalCode>0000</PostalCode>
            <Province>Desconhecido</Province>
            <Country>AO</Country>
        </ShipToAddress>
        <SelfBillingIndicator>0</SelfBillingIndicator>
    </Customer>
    <Customer>
        <CustomerID>4</CustomerID>
        <AccountID>Desconhecido</AccountID>
        <CustomerTaxID>9999999999</CustomerTaxID>
        <CompanyName>Cliente Indiferenciado </CompanyName>
        <BillingAddress>
            <StreetName>Desconhecido</StreetName>
            <AddressDetail>Desconhecido</AddressDetail>
            <City>Desconhecido</City>
            <PostalCode>0000</PostalCode>
            <Province>Desconhecido</Province>
            <Country>AO</Country>
        </BillingAddress>
        <ShipToAddress>
            <StreetName>Desconhecido</StreetName>
            <AddressDetail>Desconhecido</AddressDetail>
            <City>Desconhecido</City>
            <PostalCode>0000</PostalCode>
            <Province>Desconhecido</Province>
            <Country>AO</Country>
        </ShipToAddress>
        <SelfBillingIndicator>0</SelfBillingIndicator>
    </Customer>
    <Customer>
        <CustomerID>6</CustomerID>
        <AccountID>Desconhecido</AccountID>
        <CustomerTaxID>9999999999</CustomerTaxID>
        <CompanyName>Monica Vinagre</CompanyName>
        <BillingAddress>
            <StreetName>Largo do Patriota</StreetName>
            <AddressDetail>Casa S/N</AddressDetail>
            <City>Luanda</City>
            <PostalCode>0000</PostalCode>
            <Province>Desconhecido</Province>
            <Country>AO</Country>
        </BillingAddress>
        <ShipToAddress>
            <StreetName>Largo do Patriota</StreetName>
            <AddressDetail>Casa S/N</AddressDetail>
            <City>Luanda</City>
            <PostalCode>0000</PostalCode>
            <Province>Desconhecido</Province>
            <Country>AO</Country>
        </ShipToAddress>
        <SelfBillingIndicator>0</SelfBillingIndicator>
    </Customer>
    <Customer>
        <CustomerID>12</CustomerID>
        <AccountID>Desconhecido</AccountID>
        <CustomerTaxID>1234567890</CustomerTaxID>
        <CompanyName>Soraya Menezes (com NIF)</CompanyName>
        <BillingAddress>
            <StreetName>Rua Direita de Talatona, nº 464</StreetName>
            <AddressDetail>Desconhecido</AddressDetail>
            <City>Talatona</City>
            <PostalCode>0000</PostalCode>
            <Province>Luanda</Province>
            <Country>AO</Country>
        </BillingAddress>
        <ShipToAddress>
            <StreetName>Rua Direita de Talatona, nº 464</StreetName>
            <AddressDetail>Desconhecido</AddressDetail>
            <City>Talatona</City>
            <PostalCode>0000</PostalCode>
            <Province>Luanda</Province>
            <Country>AO</Country>
        </ShipToAddress>
        <SelfBillingIndicator>0</SelfBillingIndicator>
    </Customer>
    <Product>
        <ProductType>P</ProductType>
        <ProductCode>21</ProductCode>
        <ProductGroup>Material de Marketing</ProductGroup>
        <ProductDescription>Cartões de Visita</ProductDescription>
        <ProductNumberCode>21</ProductNumberCode>
    </Product>
    <Product>
        <ProductType>P</ProductType>
        <ProductCode>20</ProductCode>
        <ProductGroup>Sapatos de Menina</ProductGroup>
        <ProductDescription>S Lights Sapato Menina</ProductDescription>
        <ProductNumberCode>20</ProductNumberCode>
    </Product>
    <Product>
        <ProductType>P</ProductType>
        <ProductCode>18</ProductCode>
        <ProductGroup>Sapatos de Menina</ProductGroup>
        <ProductDescription>Go Run 400 Tenis Menina</ProductDescription>
        <ProductNumberCode>18</ProductNumberCode>
    </Product>
    <Product>
        <ProductType>P</ProductType>
        <ProductCode>17</ProductCode>
        <ProductGroup>Sapatos Rapaz</ProductGroup>
        <ProductDescription>SKECH-FLEX 2.0 Tenis Rapaz</ProductDescription>
        <ProductNumberCode>17</ProductNumberCode>
    </Product>
    <Product>
        <ProductType>P</ProductType>
        <ProductCode>6</ProductCode>
        <ProductGroup>Material Escolar</ProductGroup>
        <ProductDescription>Dossier de 4 furos</ProductDescription>
        <ProductNumberCode>6</ProductNumberCode>
    </Product>
    <Product>
        <ProductType>P</ProductType>
        <ProductCode>11</ProductCode>
        <ProductGroup>Livros Escolares</ProductGroup>
        <ProductDescription>Manual L. Portuguesa 6ª</ProductDescription>
        <ProductNumberCode>11</ProductNumberCode>
    </Product>
    <Product>
        <ProductType>S</ProductType>
        <ProductCode>15</ProductCode>
        <ProductGroup>Desconto</ProductGroup>
        <ProductDescription>Desconto</ProductDescription>
        <ProductNumberCode>15</ProductNumberCode>
    </Product>
    <Product>
        <ProductType>S</ProductType>
        <ProductCode>23</ProductCode>
        <ProductGroup>Serviços Profissionais</ProductGroup>
        <ProductDescription>Instalação de Equipamentos</ProductDescription>
        <ProductNumberCode>23</ProductNumberCode>
    </Product>
    <TaxTable>
        <TaxTableEntry>
            <TaxType>IVA</TaxType>
            <TaxCountryRegion>AO</TaxCountryRegion>
            <TaxCode>ISE</TaxCode>
            <Description>Transmissão de bens e serviço não sujeita</Description>
            <TaxExpirationDate>2019-10-31</TaxExpirationDate>
            <TaxPercentage>0</TaxPercentage>
        </TaxTableEntry>
        <TaxTableEntry>
            <TaxType>IVA</TaxType>
            <TaxCountryRegion>AO</TaxCountryRegion>
            <TaxCode>NOR</TaxCode>
            <Description>IVA - Imposto Sobre o Valor Acrescentado (14%)</Description>
            <TaxPercentage>14</TaxPercentage>
        </TaxTableEntry>
    </TaxTable>
</MasterFiles>
<SourceDocuments>
    <SalesInvoices>
        <NumberOfEntries>13</NumberOfEntries>
        <TotalDebit>9000.00</TotalDebit>
        <TotalCredit>148968.07</TotalCredit>
        <Invoice>
            <InvoiceNo>FR Z1.2019/1</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T11:33:56</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>52624fb6c43babae8b8e94fbd739c3d3d880b5a65e4ec13d0b0f87dcfa5760a843fbc19358ee9cad1b9226e65a3256298fc8250bf665fdbef11ca8f543c21c78</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T11:33:56</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/1</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>20</ProductCode>
                <ProductDescription>S Lights Sapato Menina</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>9000.00</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>S Lights Sapato Menina</Description>
                <CreditAmount>9000.00</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>1260.00</TaxPayable>
                <NetTotal>9000.00</NetTotal>
                <GrossTotal>10260.00</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>10260.00</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>1260.00</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>FR Z1.2019/2</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T11:34:43</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>81dc9f0fbfa720de84fc761dabaa10fee2dfc70c14c4cc46407656c780515a9eabaacdd1f3c3946519c58bad7d4c572d59438c14be7616020d1937b0f4628342</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T11:34:43</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/2</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>18</ProductCode>
                <ProductDescription>Go Run 400 Tenis Menina</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>8771.93</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Preço do Produto com IVA incluido</Description>
                <CreditAmount>8771.93</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>1228.07</TaxPayable>
                <NetTotal>8771.93</NetTotal>
                <GrossTotal>10000.00</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>10000.00</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>1228.07</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>FR Z1.2019/3</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>A</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T11:35:49</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>9076261458973b6d25d45166cdd0cf114cc9866bfb4d05f11a010ba2b42d735af47adf5cc412ef853bc596971cbde79e700dbc10c786b611d0ffe63c6e21aba8</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T11:35:49</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/3</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>17</ProductCode>
                <ProductDescription>SKECH-FLEX 2.0 Tenis Rapaz</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>10000.00</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Air-Cooled Memory Foam</Description>
                <CreditAmount>10000.00</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>1400.00</TaxPayable>
                <NetTotal>10000.00</NetTotal>
                <GrossTotal>11400.00</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>11400.00</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>1400.00</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>FR Z1.2019/4</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T11:59:51</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>dc1b3e974b9e17376f33c14c2fee373617bf1c23679f1bd74ccfc9bc46e9bf837bf050c39f6ce6d25cb1be96e938918f2fc9a4cc6958f4babd0ddf71a66cd7c3</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T11:59:51</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FP.2019/1</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>20</ProductCode>
                <ProductDescription>S Lights Sapato Menina</ProductDescription>
                <Quantity>3</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>9000.00</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>S Lights Sapato Menina</Description>
                <CreditAmount>27000.00</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <Line>
                <LineNumber>2</LineNumber>
                <OrderReferences>
                    <OriginatingON>FP.2019/1</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>17</ProductCode>
                <ProductDescription>SKECH-FLEX 2.0 Tenis Rapaz</ProductDescription>
                <Quantity>2</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>10000.00</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Air-Cooled Memory Foam</Description>
                <CreditAmount>20000.00</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>6580.00</TaxPayable>
                <NetTotal>47000.00</NetTotal>
                <GrossTotal>53580.00</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>53580.00</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>6580.00</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>NC E.2019/1</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T11:59:51</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>5602bde61ebf4a7f7b15d20b31d2e4f42f1d0e7be9b1df28265846c10a7b901c98f31557364a9f1b5ba501934225d8078ca85d43d69a8ec1006013fe7a190fc8</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>NC</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T11:59:51</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>Z1.2019/4</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>20</ProductCode>
                <ProductDescription>S Lights Sapato Menina</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>9000.00</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>S Lights Sapato Menina</Description>
                <DebitAmount>9000.00</DebitAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>1260.00</TaxPayable>
                <NetTotal>9000.00</NetTotal>
                <GrossTotal>10260.00</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>10260.00</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>1260.00</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>FR Z1.2019/5</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T12:05:24</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>2872bb6e0cf65d86f6c0c060b3562fefe886f9a5c0da634229844788153e61fc67fc73a1015aeb5181ee0134a6ec84af7a9b7615df9b0ee27daba4cf22f4fe90</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T12:05:24</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/5</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>11</ProductCode>
                <ProductDescription>Manual L. Portuguesa 6ª</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>919.20</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Manual L. Portuguesa 6ª</Description>
                <CreditAmount>919.20</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>ISE</TaxCode>
                    <TaxPercentage>0.00</TaxPercentage>
                </Tax>
                <TaxExemptionReason>Isento IVA Artigo 12 d)</TaxExemptionReason>
                <TaxExemptionCode>M02</TaxExemptionCode>
            </Line>
            <Line>
                <LineNumber>2</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/5</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>6</ProductCode>
                <ProductDescription>Dossier de 4 furos</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>5263.16</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Dossier de 4 furos</Description>
                <CreditAmount>5263.16</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>736.84</TaxPayable>
                <NetTotal>6182.36</NetTotal>
                <GrossTotal>6919.20</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>6919.20</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>736.84</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>FR Z1.2019/6</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T15:11:19</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>98e26a96cb1ddb2bb0c34e913237a4ae9aa104b21ce6d43642f407cfb8c6427992bae1412f38a089ab2994abb6d8906f131ccd3561183f35f4db8595aa12b329</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T15:11:19</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/6</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>11</ProductCode>
                <ProductDescription>Manual L. Portuguesa 6ª</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>919.20</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Manual L. Portuguesa 6ª</Description>
                <CreditAmount>919.20</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>ISE</TaxCode>
                    <TaxPercentage>0.00</TaxPercentage>
                </Tax>
                <TaxExemptionReason>Isento IVA Artigo 12 d)</TaxExemptionReason>
                <TaxExemptionCode>M02</TaxExemptionCode>
            </Line>
            <Line>
                <LineNumber>2</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/6</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>6</ProductCode>
                <ProductDescription>Dossier de 4 furos</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>5263.16</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Dossier de 4 furos</Description>
                <CreditAmount>5263.16</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>736.84</TaxPayable>
                <NetTotal>6182.36</NetTotal>
                <GrossTotal>6919.20</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>6919.20</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>736.84</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>FR Z1.2019/7</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T15:16:38</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>a0bbeac615a85a25370c48f417d84c3124feb22ccfdcd23325a2a5a73c153081732d942358f4eebe455ae5855effcea7c2d35dc5b8fff113224703710725ca93</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T15:16:38</SystemEntryDate>
            <CustomerID>12</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/7</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>21</ProductCode>
                <ProductDescription>Cartões de Visita</ProductDescription>
                <Quantity>100</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>0.55</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Cartões de Visita</Description>
                <CreditAmount>50.16</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
                <SettlementAmount>4.84</SettlementAmount>
            </Line>
            <Line>
                <LineNumber>2</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/7</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>6</ProductCode>
                <ProductDescription>Dossier de 4 furos</ProductDescription>
                <Quantity>1</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>5263.16</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Dossier de 4 furos</Description>
                <CreditAmount>5263.16</CreditAmount>
                <Tax>
                    <TaxType>IVA</TaxType>
                    <TaxCountryRegion>AO</TaxCountryRegion>
                    <TaxCode>NOR</TaxCode>
                    <TaxPercentage>14.00</TaxPercentage>
                </Tax>
            </Line>
            <DocumentTotals>
                <TaxPayable>743.86</TaxPayable>
                <NetTotal>5313.32</NetTotal>
                <GrossTotal>6057.18</GrossTotal>
                <Payment>
                    <PaymentMechanism>CD</PaymentMechanism>
                    <PaymentAmount>6057.18</PaymentAmount>
                    <PaymentDate>2019-10-23</PaymentDate>
                </Payment>
            </DocumentTotals>
            <WithholdingTax>
                <WithholdingTaxAmount>743.86</WithholdingTaxAmount>
            </WithholdingTax>
        </Invoice>
        <Invoice>
            <InvoiceNo>FR Z1.2019/8</InvoiceNo>
            <DocumentStatus>
                <InvoiceStatus>N</InvoiceStatus>
                <InvoiceStatusDate>2019-10-23T09:30:51</InvoiceStatusDate>
                <SourceID>pcasqueiro</SourceID>
                <SourceBilling>P</SourceBilling>
            </DocumentStatus>
            <Hash>e65c4ac7c52a63dcb7b4981eb38c7deeb2c7b2d52d08e125392b4ad05486626e5d2645db1fc67351d713e1fb8a57ecc0c87e8645fa26703561549cea97f17f47</Hash>
            <HashControl>1</HashControl>
            <Period>10</Period>
            <InvoiceDate>2019-10-23</InvoiceDate>
            <InvoiceType>FR</InvoiceType>
            <SpecialRegimes>
                <SelfBillingIndicator>0</SelfBillingIndicator>
                <CashVATSchemeIndicator>0</CashVATSchemeIndicator>
                <ThirdPartiesBillingIndicator>0</ThirdPartiesBillingIndicator>
            </SpecialRegimes>
            <SourceID>pcasqueiro</SourceID>
            <SystemEntryDate>2019-10-23T09:30:51</SystemEntryDate>
            <CustomerID>2</CustomerID>
            <Line>
                <LineNumber>1</LineNumber>
                <OrderReferences>
                    <OriginatingON>FR Z1.2019/8</OriginatingON>
                    <OrderDate>2019-10-23</OrderDate>
                </OrderReferences>
                <ProductCode>21</ProductCode>
                <ProductDescription>Cartões de Visita</ProductDescription>
                <Quantity>30</Quantity>
                <UnitOfMeasure>UN</UnitOfMeasure>
                <UnitPrice>0.55</UnitPrice>
                <TaxPointDate>2019-10-23</TaxPointDate>
                <Description>Cartões de Visita</Description>
                <CreditAmount>16.50</CreditAmount>
                <Tax>
cryptolopes commented 5 years ago

Anexe por favor o ficheiro.

pcasqueiro commented 5 years ago

mySAFT-AO-phpPos.xml.txt este ficheiro passou na integra a validação contra o XSD o que resolveu muitos dos erros apresentados. Neste momento o VALIDADOR apenas alerta em dois documentos do que diz respeito aos totais, mas não consigo compreender onde estão os erros. Ambos os documentos têm duas linhas mas existem outros com duas linhas onde não são reportados erros:

Falha na validação, AuditFile.SourceDocuments.SalesInvoices.TotalCredit da parte do ficheiro está mal calculado

Falha na validação, porque o TaxPayable do AuditFile.SourceDocuments.SalesInvoices.8Invoice está mal calculado Falha na validação, porque o TaxPayable do AuditFile.SourceDocuments.SalesInvoices.12Invoice está mal calculado

cryptolopes commented 5 years ago

Excelente! Não existem erros de estrutura. O Validador da AGT realiza testes de qualidade de informação e também está certo. Há uma diferença no TotalCredite também no NumberOfEntries.

NumberOfEntries TotalDebit TotalCredit  
13 9000 148968.07  
       
ns1:InvoiceNo ns1:InvoiceStatus ns1:DebitAmount ns1:CreditAmount
FR Z1.2019/1 N   9000
FR Z1.2019/2 N   8771.93
FR Z1.2019/3 A   10000
FR Z1.2019/4 N   27000
FR Z1.2019/4 N   20000
NC E.2019/1 N 9000  
FR Z1.2019/5 N   919.2
FR Z1.2019/5 N   5263.16
FR Z1.2019/6 N   919.2
FR Z1.2019/6 N   5263.16
FR Z1.2019/7 N   50.16
FR Z1.2019/7 N   5263.16
FR Z1.2019/8 N   16.5
FR Z1.2019/9 N   27000
FR Z1.2019/10 N   10000
FR A1.2019/1 N   12000
FR A1.2019/1 N   501.6
FR A1.2019/2 N   9000
FR A1.2019/2 N   10000
       
Total 19 9000 150968.07

4.1.1, 4.1.2 e 4.1.3 da Lei