Skip to content

Commit

Permalink
Merge pull request #27 from assoft-portugal/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
cryptolopes committed Oct 11, 2019
2 parents f69de2f + 7774ee5 commit f3d441f
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 41 deletions.
Binary file added Resources/DP 312.18 SAF-T.pdf
Binary file not shown.
111 changes: 70 additions & 41 deletions XSD/SAFTAO1.01_01.xsd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:doc="urn:schemas-basda-org:schema-extensions:documentation" xmlns:ns="urn:OECD:StandardAuditFile-Tax:AO_1.01_01" xmlns="urn:OECD:StandardAuditFile-Tax:AO_1.01_01" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:OECD:StandardAuditFile-Tax:AO_1.01_01" version="1.01_01" id="SAF-T_AO" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema xmlns:doc="urn:schemas-basda-org:schema-extensions:documentation"
xmlns:ns="urn:OECD:StandardAuditFile-Tax:AO_1.01_01"
xmlns="urn:OECD:StandardAuditFile-Tax:AO_1.01_01" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:OECD:StandardAuditFile-Tax:AO_1.01_01" version="1.01_01" id="SAF-T_AO"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation>
<doc:Title>Standard Audit File - Angola</doc:Title>
Expand All @@ -20,8 +23,9 @@
<doc:Contributor name="Cacimbo Angola" url="https://www.cacimboangola.com/" />
<doc:Contributor name="Infodelivery S.A." url="http://www.infodelivery.pt/" />
<doc:Contributor name="Eticadata Software Lda" url="http://www.eticadata.pt/" />
<doc:Contributor name="SOFTSTORE, S.A." url="http://www.softstore.pt/" />
</doc:Contributors>
<doc:ModificationDate>2017-09-03</doc:ModificationDate>
<doc:ModificationDate>2017-10-11</doc:ModificationDate>
</xs:documentation>
</xs:annotation>
<!-- Estrutura do ficheiro SAFT-AO-->
Expand Down Expand Up @@ -49,6 +53,10 @@
<xs:selector xpath="ns:MasterFiles/ns:GeneralLedgerAccounts" />
<xs:field xpath="ns:AccountID" />
</xs:unique>
<xs:keyref name="GroupingCodeConstraint" refer="AccountIDConstraint">
<xs:selector xpath="ns:MasterFiles/ns:GeneralLedgerAccounts/ns:Account"/>
<xs:field xpath="ns:GroupingCode"/>
</xs:keyref>
<xs:unique name="CustomerIDConstraint">
<xs:selector xpath="ns:MasterFiles/ns:Customer" />
<xs:field xpath="ns:CustomerID" />
Expand All @@ -61,26 +69,34 @@
<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 name="GeneralLedgerEntriesDebitLineAccountIDConstraint" refer="AccountIDConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction/ns:Lines/ns:DebitLine"/>
<xs:field xpath="ns:AccountID"/>
</xs:keyref>
<xs:keyref name="GeneralLedgerEntriesCreditLineAccountIDConstraint" refer="AccountIDConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction/ns:Lines/ns:CreditLine"/>
<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:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction"/>
<xs:field xpath="ns:CustomerID"/>
</xs:keyref>
<xs:unique name="GeneralLedgerEntriesJournalIdConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal" />
<xs:field xpath="ns:JournalID" />
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal"/>
<xs:field xpath="ns:JournalID"/>
</xs:unique>
<xs:keyref name="GeneralLedgerEntriesSupplierIDConstraint" refer="SupplierIDConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction" />
<xs:field xpath="ns:SupplierID" />
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction"/>
<xs:field xpath="ns:SupplierID"/>
</xs:keyref>
<xs:unique name="GeneralLedgerEntriesTransactionIdConstraint">
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction" />
<xs:field xpath="ns:TransactionID" />
<xs:selector xpath="ns:GeneralLedgerEntries/ns:Journal/ns:Transaction"/>
<xs:field xpath="ns:TransactionID"/>
</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:unique name="InvoiceNoConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:SalesInvoices/ns:Invoice" />
<xs:field xpath="ns:InvoiceNo" />
Expand Down Expand Up @@ -129,7 +145,7 @@
<xs:selector xpath="ns:SourceDocuments/ns:Payments/ns:Payment" />
<xs:field xpath="ns:CustomerID" />
</xs:keyref>
<!-- Constraints de Documentos Comerciais de Fornecedores -->
<!-- Constraints de Documentos Comerciais de Fornecedores -->
<xs:unique name="InvoicesNoConstraint">
<xs:selector xpath="ns:SourceDocuments/ns:PurchaseInvoices/ns:Invoices" />
<xs:field xpath="ns:InvoiceNo" />
Expand Down Expand Up @@ -534,7 +550,7 @@
<xs:element ref="UnitPrice" />
<xs:element ref="TaxPointDate" />
<xs:element ref="Description" />
<xs:element name="ProductSerialNumber" type="ProductSerialNumber" minOccurs="0" />
<xs:element name="ProductSerialNumber" type="ProductSerialNumber" minOccurs="0" />
<xs:choice>
<xs:element ref="DebitAmount" />
<xs:element ref="CreditAmount" />
Expand Down Expand Up @@ -676,7 +692,7 @@
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down Expand Up @@ -1108,40 +1124,53 @@
<xs:element name="InvoiceType">
<xs:annotation>
<xs:documentation>
Deve ser preenchido com:

“FT” – Factura;
Deve ser preenchido com:
“FT” – Factura;
“FR” – Factura/recibo;
“VD” – Venda a dinheiro;
“GF” – Factura genérica;
“FG” -Factura global
“AC” – Aviso de cobrança
“ND” – Nota de débito
“NC” – Nota de crédito
“AF” – Factura/recibo (autofacturação)
“TV” – Talão de venda
“VD” – Venda a dinheiro;
“GF” – Factura genérica;
“FG” -Factura global
“AC” – Aviso de cobrança
“AR” – Aviso de cobrança/recibo
“RE” – Recibo
“ND” – Nota de débito
“NC” – Nota de crédito
“GR” – Guia de remessa
“AF” – Factura/recibo (autofacturação)
“TV” – Talão de venda; (a)
“TS” – Talão de serviços prestados;

Para o sector Segurador quando não deva constar da tabela 4.3.
- Documentos de conferência de mercadorias ou de prestação de serviços (WorkingDocuments), pode ainda ser preenchido com:
(a) “TD” – Talão de devolução;
(a) “AA” – Alienação de activos;
(a) “DA” – Devolução de activos.
(a) Para o sector Segurador quando não deva constar da tabela 4.3. -
Documentos de conferência de mercadorias ou de prestação de serviços (WorkingDocuments),
pode ainda ser preenchido com:
“RP” – Prémio ou recibo de prémio;
“RE” – Estorno ou recibo de estorno;
“CS” – Imputação a co-seguradoras;
“LD” – Imputação a co-seguradora líder;
“CS” – Imputação a co-seguradoras;
“LD” – Imputação a co-seguradora líder;
“RA” – Resseguro aceite.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="FT" />
<xs:enumeration value="FR" />
<xs:enumeration value="ND" />
<xs:enumeration value="VD" />
<xs:enumeration value="GF" />
<xs:enumeration value="FG" />
<xs:enumeration value="AC" />
<xs:enumeration value="AR" />
<xs:enumeration value="ND" />
<xs:enumeration value="NC" />
<xs:enumeration value="VD" />
<xs:enumeration value="GR" />
<xs:enumeration value="AF" />
<xs:enumeration value="TV" />
<xs:enumeration value="TS" />
<xs:enumeration value="TD" />
<xs:enumeration value="AA" />
<xs:enumeration value="DA" />
<!-- Para o sector segurador-->
<xs:enumeration value="RP" />
<xs:enumeration value="RE" />
Expand Down Expand Up @@ -1330,7 +1359,7 @@
“S” -Autofacturação.
(a) Deve ser indicado este tipo de programa se este emitir só este tipo de documento.
Caso contrário, deverá ser utilizado o tipo “C”, “F”
</xs:documentation>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
Expand Down Expand Up @@ -1358,7 +1387,7 @@
Código do tipo de imposto (TaxType) = IS, deve ser preenchido com:
O código da verba respectiva; “ISE” – Isenta.
No caso de não aplicabilidade de imposto deve ser preenchido com “NA”.
</xs:documentation>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
Expand Down Expand Up @@ -1414,7 +1443,7 @@
“R” – Regularizações do período de tributação;
“A” – Apuramento de resultados;
“J” – Movimentos de ajustamento.
</xs:documentation>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
Expand All @@ -1431,7 +1460,7 @@
<xs:documentation>
Neste campo deve ser indicado o tipo de imposto retido, preenchendo-o com:
“IRT” – Imposto sobre o rendimento de trabalho; “II” – Imposto sobre o industrial; “IS” – Imposto do selo.
</xs:documentation>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
Expand Down Expand Up @@ -1658,13 +1687,13 @@
<xs:group name="DeductibleTaxes">
<xs:sequence>
<xs:element ref="DeductibleTax" minOccurs="1"/>
<xs:element ref="DeductiblePercentage" minOccurs="1" ></xs:element>
<xs:element ref="DeductiblePercentage" minOccurs="1"></xs:element>
</xs:sequence>
</xs:group>
<xs:simpleType name="SAFTAOPaymentType">
<xs:annotation>
<xs:documentation>
>Deve ser preenchido com:
Deve ser preenchido com:
“RC” – Recibo emitido
“AR” – Aviso de cobrança/recibo
“RG” – Outros recibos emitidos.
Expand Down Expand Up @@ -1841,7 +1870,7 @@
Deve ser indicada a chave única da tabela 3.
Movimentos contabilísticos (GeneralLedgerEntries) da transacção onde foi lançado este documento,
respeitando a regra aí definida para o campo 3.4.3.1 - Chave única do movimento contabilístico (TransactionID).
</xs:documentation>
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[1-9][0-9]{3}-[01][0-9]-[0-3][0-9] [^ ]{1,30} [^ ]{1,20}" />
Expand All @@ -1863,4 +1892,4 @@
<xs:length value="2" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
</xs:schema>

0 comments on commit f3d441f

Please sign in to comment.