italia / fatturapa-testsdi

Sistema d'Interscambio di test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dispatch notification to unknown issuer

hmonglee opened this issue · comments

When I add an invalid file, the issuer field of an invoice is not filled.
So when you dispatch the notification, we can't do this because we don't have issuer.

We should check the file name and extract the issuer from the file name (http://www.fatturapa.gov.it/export/fatturazione/it/c-11.htm)

thanks ! you raise a good point

according to Specifiche_tecniche_SdI_v1.6 para 2.2 "NOMENCLATURA DEI FILE DA TRASMETTERE", page 8, the file name for an XML invoice has the structure XX0123456789012345_ABCDE.xml where:

  • XX is uppercase alphabetic "codice paese" in accordance with ISO 3166-1 alpha-2 code
  • 123456789012345 is 11-16 alphanumeric fiscal code or VAT number of issuer
  • ABCDE is 1-5 character case-sensitive alphanumeric "progressivo univoco del file" (~931 millions combinations or ~62 millions if you keep it case insensitive), which has to be unique for the issuer

issuers and recipients are identified by their channel ID (the 7-character alphanumeric code)

we already have a lookup table (channels) to match "codice paese" + fiscal code / VAT number of cedente/prestatore with the channel ID it is using; BTW there is already a RPC endpoint to see the contents of channels table:
https://teamdigitale3.simevo.com/sdi/rpc/channels

to implement what you request we need a lookup table to match "codice paese" + fiscal code / VAT number of issuer with channel ID; this could be the actors table