Jump to content

Recommended Posts

Posted (edited)

Titulo do Projecto: Visual SAFT-PT

Última Versão: 4.0.0.3

Site Oficial: http://saftpt.codeplex.com/

Licença: Ms-PL

Líder do Projecto: regateiro

Membros Actuais do Projecto: regateiro

Screenshots:

http://saftpt.codeplex.com/documentation

Descrição do Projecto:

Como trabalho com a geração do saft, pensei em criar um programa que me ajudasse na validação do mesmo, e recentemente decidi colocar o projecto como open source.

Existem algumas funcionalidades, que penso não existirem em mais nenhum programa do género, como ferramentas de calculo da Hash de cada documento, para ver como funcionam podem ver a documentação na página do projecto.

Quem quiser usar e deixar comentários é bem vindo.

Permite ainda ver e validar o ficheiro de existências.

Download executável:

Está disponível uma versão clickOnce em: https://saftpt.codeplex.com/releases/view/611199

Edited by kalin
  • Vote 2
  • 1 month later...
Posted

Boas,

Desde que foi publicado este projecto já teve bastantes actualizações/correcções.

É possível verificar campos incorrectos, valores nos documentos incoerentes e as assinaturas dos mesmos, e exportar todas as tabelas para excel.

Foi adicionado também a possibilidade de gerar relatórios dos documentos de faturação.

Alguém utilizou este analisador?

O que mais gostaram e o que mudariam?

  • 3 months later...
Posted

Boas.

Estou a usar o teu analisador, ja me ajudou bastante para perceber melhor os meandros do SAF-T. Tenho no entanto as seguintes duvidas:

1. Quando não é preenchido a tag "BusinessName", temos o erro "designação comercial incorrecta", pelo que li esta tag nao é obrigatória.

2. A mesma coisa acontece com a tag "Period" (na zona dos "Invoice"). Esta tag também nao é obrigatoria.

Posted

jmabb,

Tens razão esses campos não são obrigatórios e a aplicação avisa como erro caso não estejam preenchidos.

Como projecto de tempos livres só com 1 programador, não existe tempo para validar tudo ao pormenor e estes erros podem passar.

Vou actualizar e publicar a correcção.

Qualquer, dúvida/erro/melhoria é bem vinda.

Obrigado.

Posted

Boas,

Ok. Obrigadao. Como projeto de tempo livre, acho o q o analisador está muito bom... Vou so deixar uma sugestão: procurei mas não encontrei um sitio onde posso ver o resumo do IVA, ou seja, ter um sitio que indica para cada iva (ISENTO, RED, INT, NORMAL) o valor monetário deste ultimo e a sua incidência (é claro com um pouco de trabalho, tipo usar o xls, consigo obter estes dados através do tab "Resumo" q implementaste; mas a ideia seria resumir isso tudo, ou seja, alem daquela informação q é exibida, acrescentar mais um nivel de resumo que agrega tudo por cada iva e q soma as faturas e desconta as notas de credito)

O que achas?

Posted

Boas,

Acho que é informação bastante útil para quem está a analisar o ficheiro e vou implementar esta alteração.

Existe uma outra maneira de obter informação que não está na aplicação. Existe uma ferramenta que permite guardar o ficheiro numa bd, permitindo assim correr comandos sobre os dados e recolher a informação pretendida.

É uma ferramenta que já tenho usado algum tempo, mas só a coloquei na última versão, estou a pensar colocar algumas Sp's na bd, que permitam retirar informação, como por exemplo, o resumo do iva.

Obrigado pela sugestão.

Posted

Boas,

É o chato outra vez... mas como disseste que gostavas de obter algum feedback, vou aproveitar 🙂

- Não consigo encontrar, no analisador, o montante do desconto (deveria ser exibido, nao?)

- Penso q no tab "Impostos", deveríamos ver o conteúdo da tag "TaxTable", certo? se sim, nao me está aparecer nada, e não tenho erros q me possa indicar que a tag está mal preenchida.

Obrigado.

Posted

Boas,

É através dos "chatos" que os projectos crescem e evoluem, por isso continua a ser "chato".

Quando eu iniciei este projecto tentei mostrar só a informação mais relevante, e na altura o desconto ficou para futuras versões, no entanto tem ficado esquecido. Trata-se de informação importante e vou incluir este campo na próxima versão.

Em relação aos impostos, já verifiquei que se trata de um bug da versão 2, acontece ao abrir documentos da versão 1.01_01. Como bug terá lugar certo na próxima versão.

Obrigado e vai dando sugestões.

Posted

Ola,

Quando arranco o FR.SAFTAnalyser, tenho sempre o seguinte erro:

--- Excepção Interna ---

System.Net.WebException

- Não é possível estabelecer ligação com o servidor remoto

- origem: System

- Rastreio da pilha:

em System.Net.HttpWebRequest.GetResponse()

em System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

--- Excepção Interna ---

System.Net.Sockets.SocketException

- Uma tentativa de ligação falhou porque o componente ligado não respondeu

correctamente após um período de tempo, ou a ligação estabelecida falhou

porque o anfitrião ligado não respondeu 65.52.103.72:443

E realmente este endereço por telnet, nao responde...

Obrigado.

Posted

Estranho, isto começou a acontecer depois de eu ter actualizado a aplicação?

Tens que passar por algum proxy, ou a firewall possa estar a bloquear o pedido?

Neste momento já tenho 21 downloads desta nova versão, 2 são meus, se o update não funcionar tenta desinstalar e instalar novamente.

Os pormenores da ligação são geridos pelo codeplex e parece-me que estão a funcionar correctamente.

Posted

Boas,

So agora estou a proceder as alterações para a versão 2(PT_1.02_01) do SAF-T. E para testar as coisas, estou a usar a tua aplicação. Por enquanto tem corrido bem. So tenho um erro ou aviso, que é o seguinte:

CurrencyCode, System.Xml.XmlNode[] - Código moeda incorrecto. (estamos a falar do campo 1.11)

Este campo está preenchido com a string "EUR". Penso q deveria ser este o valor, certo?

Obrigado.

Posted

Este campo foi alterado no novo xsd, passou de string para objecto. Penso que seja isso que te de o erro neste campo.

Só obtens erro neste campo e não no campo Country 1.7.7? O tipo deste campo também é object.

Nos ficheiros que eu crio, a tag fica:

<CurrencyCode xsi:type="xsd:string">EUR</CurrencyCode>

onde xsi é o namespace:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Posted

Bom dia,

Estive a rever e não tive qualquer problema com os ficheiros gerados como te indiquei.

Podes enviar-me um ficheiro exemplo com o erro que descreves, um que dê erro no meu programa e outro que dê erro no validador.

Obrigado

Posted (edited)

Bom dia,

Usando o exemplo do Nunopicado, aqui temos erro no validador, mas nao na tua aplicação

<?xml version="1.0" encoding="windows-1252"?>
<AuditFile xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:OECD:StandardAuditFile-Tax:PT_1.02_01 SAF-T-PT.XSD" xmlns:doc="urn:schemas-basda-org:schema-extensions:documentation">
 <Header>
   <AuditFileVersion>1.02_01</AuditFileVersion>
   <CompanyID>555555550</CompanyID>
   <TaxRegistrationNumber>555555550</TaxRegistrationNumber>
   <TaxAccountingBasis>F</TaxAccountingBasis>
   <CompanyName>Empresa</CompanyName>
   <BusinessName>Empresa</BusinessName>
   <CompanyAddress>
     <AddressDetail>Onde Judas Perdeu as Botas</AddressDetail>
     <City>Agueda</City>
     <PostalCode>3750-144</PostalCode>
     <Region>Aveiro</Region>
     <Country>PT</Country>
   </CompanyAddress>
   <FiscalYear>2013</FiscalYear>
   <StartDate>2013-07-17</StartDate>
   <EndDate>2013-07-17</EndDate>
   <CurrencyCode xsi:type="xsd:string">EUR</CurrencyCode>
   <DateCreated>2013-07-16</DateCreated>
   <TaxEntity>Loja</TaxEntity>
   <ProductCompanyTaxID>555555550</ProductCompanyTaxID>
   <SoftwareCertificateNumber>0</SoftwareCertificateNumber>
   <ProductID>Coiso/Coisa</ProductID>
   <ProductVersion>2013.7</ProductVersion>
 </Header>
 <MasterFiles>
   <Customer>
     <CustomerID>1</CustomerID>
     <AccountID>Desconhecido</AccountID>
     <CustomerTaxID>999999990</CustomerTaxID>
     <CompanyName>Consumidor Final</CompanyName>
     <BillingAddress>
       <AddressDetail>Desconhecido</AddressDetail>
       <City>Desconhecido</City>
       <PostalCode>0000-000</PostalCode>
       <Country>PT</Country>
     </BillingAddress>
     <SelfBillingIndicator>0</SelfBillingIndicator>
   </Customer>
   <Customer>
     <CustomerID>18</CustomerID>
     <AccountID>Desconhecido</AccountID>
     <CustomerTaxID>214830128</CustomerTaxID>
     <CompanyName>Ana Martins</CompanyName>
     <BillingAddress>
       <AddressDetail>Vouzela</AddressDetail>
       <City>Vouzela</City>
       <PostalCode>3670-000</PostalCode>
       <Country>PT</Country>
     </BillingAddress>
     <SelfBillingIndicator>0</SelfBillingIndicator>
   </Customer>
<Product>
  <ProductType>P</ProductType>
  <ProductCode>15</ProductCode>
  <ProductGroup>Revistas</ProductGroup>
  <ProductDescription>Expresso</ProductDescription>
  <ProductNumberCode>R15</ProductNumberCode>
</Product>
<Product>
  <ProductType>P</ProductType>
  <ProductCode>19</ProductCode>
  <ProductGroup>Revistas</ProductGroup>
  <ProductDescription>Maria</ProductDescription>
  <ProductNumberCode>R19</ProductNumberCode>
</Product>
<Product>
  <ProductType>P</ProductType>
  <ProductCode>14</ProductCode>
  <ProductGroup>Revistas</ProductGroup>
  <ProductDescription>Visão</ProductDescription>
  <ProductNumberCode>R14</ProductNumberCode>
</Product>   
   <TaxTable>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>ISE</TaxCode>
       <Description>Isenta Decreto-Lei n.º 346/85</Description>
       <TaxPercentage>0</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>ISE</TaxCode>
       <Description>Isenta Artigo 9.º do CIVA</Description>
       <TaxPercentage>0</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>RED</TaxCode>
       <Description>Reduzida </Description>
       <TaxPercentage>6</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>INT</TaxCode>
       <Description>Intermédia </Description>
       <TaxPercentage>13</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>NOR</TaxCode>
       <Description>Normal </Description>
       <TaxPercentage>23</TaxPercentage>
     </TaxTableEntry>
   </TaxTable>
 </MasterFiles>
 <SourceDocuments>
   <SalesInvoices>
     <NumberOfEntries>4</NumberOfEntries>
     <TotalDebit>0.61</TotalDebit>
     <TotalCredit>3.44</TotalCredit>
     <Invoice>
       <InvoiceNo>FT 001/4667</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>N</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:35:28</InvoiceStatusDate>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>JTWhQwwBr087aTZUR+gufZTOJpD1IexKUXBDg9jD4UWpSOsgQvFytBF23aK8P927uKIQ9rdAxe2QAnLa71PiILTJpdD3ZVaf8FMtig/fdvSh85UGbshJIdHfZ/a3Nukv6t1ji6kHEnf3pzuht+5SXJPRVIP8U9LLNqcF6YRyjs0=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>FT</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:35:28</SystemEntryDate>
       <CustomerID>1</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>15</ProductCode>
         <ProductDescription>Expresso</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>2.83</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <Description>Expresso</Description>
         <CreditAmount>2.83</CreditAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.17</TaxPayable>
         <NetTotal>2.83</NetTotal>
         <GrossTotal>3.00</GrossTotal>
       </DocumentTotals>
     </Invoice>
     <Invoice>
       <InvoiceNo>FT 001/4668</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>N</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:35:37</InvoiceStatusDate>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>NPc6OYm0F4NFlipi1EVSBA4/JWQcEMKIqg2JQkDfk0al65iSSmDinLDQH75ZWzzeUgYymhGlk9BxHbQFzF+Tls50NimYakU1DCGmmtMwEB4LJwAgi48eusHjEBhFhBFLxafliuh3NVMaCRLSWRwoJA0UHI24FEZ3b8xGpju0Yto=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>FT</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:35:37</SystemEntryDate>
       <CustomerID>18</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>19</ProductCode>
         <ProductDescription>Maria</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>0.61</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <Description>Maria</Description>
         <CreditAmount>0.61</CreditAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.04</TaxPayable>
         <NetTotal>0.61</NetTotal>
         <GrossTotal>0.65</GrossTotal>
       </DocumentTotals>
     </Invoice>
     <Invoice>
       <InvoiceNo>FT 001/4669</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>A</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:36:03</InvoiceStatusDate>
         <Reason>engano</Reason>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>l82lh9YyVvzEEb6q3ediH+IJw3hDmUNg3SKA9OjKjMKK3F2AQi6DFggdO+WwiUryQ45XFru2CUNXrPZoyLeQdam31FVkLTyjDoR4d1cwlaVXekJtwQ5JJlERvREIrwYswUfu4HoZs5e5nBu2Kr5XtDfQWeXy7v5b6N/XsZtahvU=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>FT</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:35:50</SystemEntryDate>
       <CustomerID>1</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>14</ProductCode>
         <ProductDescription>Visão</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>2.83</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <Description>Visão</Description>
         <CreditAmount>2.83</CreditAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.17</TaxPayable>
         <NetTotal>2.83</NetTotal>
         <GrossTotal>3.00</GrossTotal>
       </DocumentTotals>
     </Invoice>
     <Invoice>
       <InvoiceNo>NC 001/2</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>N</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:36:33</InvoiceStatusDate>
         <Reason>Devolvido</Reason>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>YrzDd/iGmx9UDtck7JhqdAZhY5flfansY4VcCmngoqUOeRc7SaJhYQz25xmj62aL5/JZy5Kz6FcQaaSHhCy5BDicQjSR3v5hVqtBEXHPZWr0Iqjt+DP20KZTF3LyCEYgX+nY/OSEDG6m+UjI+jsOU3HUNUmOgBG3NyfEnG0BHTk=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>NC</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:36:33</SystemEntryDate>
       <CustomerID>18</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>19</ProductCode>
         <ProductDescription>Maria</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>0.61</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <References>
           <Reference>FT 001/4668</Reference>
           <Reason>Devolvido</Reason>
         </References>
         <Description>Maria</Description>
         <DebitAmount>0.61</DebitAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.04</TaxPayable>
         <NetTotal>0.61</NetTotal>
         <GrossTotal>0.65</GrossTotal>
       </DocumentTotals>
     </Invoice>
   </SalesInvoices>
 </SourceDocuments>
</AuditFile>

Aqui nao temos erro no validador, mas temos na tua aplicacao

<?xml version="1.0" encoding="windows-1252"?>
<AuditFile xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:OECD:StandardAuditFile-Tax:PT_1.02_01 SAF-T-PT.XSD" xmlns:doc="urn:schemas-basda-org:schema-extensions:documentation">
 <Header>
   <AuditFileVersion>1.02_01</AuditFileVersion>
   <CompanyID>555555550</CompanyID>
   <TaxRegistrationNumber>555555550</TaxRegistrationNumber>
   <TaxAccountingBasis>F</TaxAccountingBasis>
   <CompanyName>Empresa</CompanyName>
   <BusinessName>Empresa</BusinessName>
   <CompanyAddress>
     <AddressDetail>Onde Judas Perdeu as Botas</AddressDetail>
     <City>Agueda</City>
     <PostalCode>3750-144</PostalCode>
     <Region>Aveiro</Region>
     <Country>PT</Country>
   </CompanyAddress>
   <FiscalYear>2013</FiscalYear>
   <StartDate>2013-07-17</StartDate>
   <EndDate>2013-07-17</EndDate>
   <CurrencyCode>EUR</CurrencyCode>
   <DateCreated>2013-07-16</DateCreated>
   <TaxEntity>Loja</TaxEntity>
   <ProductCompanyTaxID>555555550</ProductCompanyTaxID>
   <SoftwareCertificateNumber>0</SoftwareCertificateNumber>
   <ProductID>Coiso/Coisa</ProductID>
   <ProductVersion>2013.7</ProductVersion>
 </Header>
 <MasterFiles>
   <Customer>
     <CustomerID>1</CustomerID>
     <AccountID>Desconhecido</AccountID>
     <CustomerTaxID>999999990</CustomerTaxID>
     <CompanyName>Consumidor Final</CompanyName>
     <BillingAddress>
       <AddressDetail>Desconhecido</AddressDetail>
       <City>Desconhecido</City>
       <PostalCode>0000-000</PostalCode>
       <Country>PT</Country>
     </BillingAddress>
     <SelfBillingIndicator>0</SelfBillingIndicator>
   </Customer>
   <Customer>
     <CustomerID>18</CustomerID>
     <AccountID>Desconhecido</AccountID>
     <CustomerTaxID>214830128</CustomerTaxID>
     <CompanyName>Ana Martins</CompanyName>
     <BillingAddress>
       <AddressDetail>Vouzela</AddressDetail>
       <City>Vouzela</City>
       <PostalCode>3670-000</PostalCode>
       <Country>PT</Country>
     </BillingAddress>
     <SelfBillingIndicator>0</SelfBillingIndicator>
   </Customer>
<Product>
  <ProductType>P</ProductType>
  <ProductCode>15</ProductCode>
  <ProductGroup>Revistas</ProductGroup>
  <ProductDescription>Expresso</ProductDescription>
  <ProductNumberCode>R15</ProductNumberCode>
</Product>
<Product>
  <ProductType>P</ProductType>
  <ProductCode>19</ProductCode>
  <ProductGroup>Revistas</ProductGroup>
  <ProductDescription>Maria</ProductDescription>
  <ProductNumberCode>R19</ProductNumberCode>
</Product>
<Product>
  <ProductType>P</ProductType>
  <ProductCode>14</ProductCode>
  <ProductGroup>Revistas</ProductGroup>
  <ProductDescription>Visão</ProductDescription>
  <ProductNumberCode>R14</ProductNumberCode>
</Product>   
   <TaxTable>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>ISE</TaxCode>
       <Description>Isenta Decreto-Lei n.º 346/85</Description>
       <TaxPercentage>0</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>ISE</TaxCode>
       <Description>Isenta Artigo 9.º do CIVA</Description>
       <TaxPercentage>0</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>RED</TaxCode>
       <Description>Reduzida </Description>
       <TaxPercentage>6</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>INT</TaxCode>
       <Description>Intermédia </Description>
       <TaxPercentage>13</TaxPercentage>
     </TaxTableEntry>
     <TaxTableEntry>
       <TaxType>IVA</TaxType>
       <TaxCountryRegion>PT</TaxCountryRegion>
       <TaxCode>NOR</TaxCode>
       <Description>Normal </Description>
       <TaxPercentage>23</TaxPercentage>
     </TaxTableEntry>
   </TaxTable>
 </MasterFiles>
 <SourceDocuments>
   <SalesInvoices>
     <NumberOfEntries>4</NumberOfEntries>
     <TotalDebit>0.61</TotalDebit>
     <TotalCredit>3.44</TotalCredit>
     <Invoice>
       <InvoiceNo>FT 001/4667</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>N</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:35:28</InvoiceStatusDate>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>JTWhQwwBr087aTZUR+gufZTOJpD1IexKUXBDg9jD4UWpSOsgQvFytBF23aK8P927uKIQ9rdAxe2QAnLa71PiILTJpdD3ZVaf8FMtig/fdvSh85UGbshJIdHfZ/a3Nukv6t1ji6kHEnf3pzuht+5SXJPRVIP8U9LLNqcF6YRyjs0=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>FT</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:35:28</SystemEntryDate>
       <CustomerID>1</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>15</ProductCode>
         <ProductDescription>Expresso</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>2.83</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <Description>Expresso</Description>
         <CreditAmount>2.83</CreditAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.17</TaxPayable>
         <NetTotal>2.83</NetTotal>
         <GrossTotal>3.00</GrossTotal>
       </DocumentTotals>
     </Invoice>
     <Invoice>
       <InvoiceNo>FT 001/4668</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>N</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:35:37</InvoiceStatusDate>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>NPc6OYm0F4NFlipi1EVSBA4/JWQcEMKIqg2JQkDfk0al65iSSmDinLDQH75ZWzzeUgYymhGlk9BxHbQFzF+Tls50NimYakU1DCGmmtMwEB4LJwAgi48eusHjEBhFhBFLxafliuh3NVMaCRLSWRwoJA0UHI24FEZ3b8xGpju0Yto=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>FT</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:35:37</SystemEntryDate>
       <CustomerID>18</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>19</ProductCode>
         <ProductDescription>Maria</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>0.61</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <Description>Maria</Description>
         <CreditAmount>0.61</CreditAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.04</TaxPayable>
         <NetTotal>0.61</NetTotal>
         <GrossTotal>0.65</GrossTotal>
       </DocumentTotals>
     </Invoice>
     <Invoice>
       <InvoiceNo>FT 001/4669</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>A</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:36:03</InvoiceStatusDate>
         <Reason>engano</Reason>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>l82lh9YyVvzEEb6q3ediH+IJw3hDmUNg3SKA9OjKjMKK3F2AQi6DFggdO+WwiUryQ45XFru2CUNXrPZoyLeQdam31FVkLTyjDoR4d1cwlaVXekJtwQ5JJlERvREIrwYswUfu4HoZs5e5nBu2Kr5XtDfQWeXy7v5b6N/XsZtahvU=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>FT</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:35:50</SystemEntryDate>
       <CustomerID>1</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>14</ProductCode>
         <ProductDescription>Visão</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>2.83</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <Description>Visão</Description>
         <CreditAmount>2.83</CreditAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.17</TaxPayable>
         <NetTotal>2.83</NetTotal>
         <GrossTotal>3.00</GrossTotal>
       </DocumentTotals>
     </Invoice>
     <Invoice>
       <InvoiceNo>NC 001/2</InvoiceNo>
       <DocumentStatus>
         <InvoiceStatus>N</InvoiceStatus>
         <InvoiceStatusDate>2013-07-17T23:36:33</InvoiceStatusDate>
         <Reason>Devolvido</Reason>
         <SourceID>Admin</SourceID>
         <SourceBilling>P</SourceBilling>
       </DocumentStatus>
       <Hash>YrzDd/iGmx9UDtck7JhqdAZhY5flfansY4VcCmngoqUOeRc7SaJhYQz25xmj62aL5/JZy5Kz6FcQaaSHhCy5BDicQjSR3v5hVqtBEXHPZWr0Iqjt+DP20KZTF3LyCEYgX+nY/OSEDG6m+UjI+jsOU3HUNUmOgBG3NyfEnG0BHTk=</Hash>
       <HashControl>0.1</HashControl>
       <Period>07</Period>
       <InvoiceDate>2013-07-17</InvoiceDate>
       <InvoiceType>NC</InvoiceType>
       <SelfBillingIndicator>0</SelfBillingIndicator>
       <SourceID>Admin</SourceID>
       <SystemEntryDate>2013-07-16T23:36:33</SystemEntryDate>
       <CustomerID>18</CustomerID>
       <Line>
         <LineNumber>1</LineNumber>
         <ProductCode>19</ProductCode>
         <ProductDescription>Maria</ProductDescription>
         <Quantity>1</Quantity>
         <UnitOfMeasure>Un</UnitOfMeasure>
         <UnitPrice>0.61</UnitPrice>
         <TaxPointDate>2013-07-17</TaxPointDate>
         <References>
           <Reference>FT 001/4668</Reference>
           <Reason>Devolvido</Reason>
         </References>
         <Description>Maria</Description>
         <DebitAmount>0.61</DebitAmount>
         <Tax>
           <TaxType>IVA</TaxType>
           <TaxCountryRegion>PT</TaxCountryRegion>
           <TaxCode>RED</TaxCode>
           <TaxPercentage>6</TaxPercentage>
         </Tax>
       </Line>
       <DocumentTotals>
         <TaxPayable>0.04</TaxPayable>
         <NetTotal>0.61</NetTotal>
         <GrossTotal>0.65</GrossTotal>
       </DocumentTotals>
     </Invoice>
   </SalesInvoices>
 </SourceDocuments>
</AuditFile>

Obrigado.

Edited by thoga31
GeSHi
Posted (edited)

Boas,

Obrigado pelos exemplos, já consegui perceber o que se passa. Tanto num exemplo como noutro os namespaces são diferentes do exemplo que ti dei, um exemplo retirado de um ficheiro gerado por mim é:

<AuditFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01">
 <Header>
   <AuditFileVersion>1.02_01</AuditFileVersion>
   <CompanyAddress>
     <Country xsi:type="xsd:string">PT</Country>
   </CompanyAddress>
   <CurrencyCode xsi:type="xsd:string">EUR</CurrencyCode>
 </Header>

Vendo isto, actualizei o programa para dar suporte a estes casos.

Obrigado, mais uma vez e vai dando feedback.

Edited by thoga31
GeSHi
  • 2 months later...
Posted

Boas,

O novo visualizador está com muito bom aspecto. No entanto, tenho tido sempre erro no campo no InvoiceStatusDate e tenho passado esta string "2013-10-16T15:27:06" (por exemplo). Outro erro que tenho tido é no SourceID, neste caso os nossos utilizadores são numéricos e temos passando, por exemplo, a string "1". É normal?

Obrigado.

Posted

Boas,

Os campos das datas tem pelo menos 2 validações, se a data é inferior a data guardada nas configurações (podes ver no menu SAF-T -> Opções -> Data mínima dos documentos), ou se a data é superior a data atual.

O erro que descreves no SourceID é mais estranho, o valor 1 é válido e deveria passar nas validações, se poderes envia um exemplo.

Obrigado.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.