Hi everyone,
I am opening this thread because of a compliance requirement that must be fulfilled for the 1st of January 2018 in France. The purpose it to fight against VAT fraud with POS systems.
As of this date, every organization owing VAT to the Fiscal Administration should use a point of sale or cash register system compliant with the following criterion:
- inalterability
- security
- data retention
- archival
The software should be either accredited by a third party accreditor or the editor/service provider can provide a certificate of compliance.
If these requirements are not fulfilled, companies will be fined 7,500⏠in case of control and the software provider (even outside of France) will be fined 45,000⏠+ 3 years in prison if the certificate is forged/on false grounds.
I will only present the main requirements related strictly to ERPNext and Frappe here, but feel free to contact me, especially Frappe Team, if you have french customers and you want to know more about all the hosting requirements and certification process.
In case they are not fulfilled, the law is quite clear, it will be impossible to use ERPNext in France - or there should be a version without the POS module.
My goal here is to have inputs from the community on how these issues can be technically solved and if anyone else has similar requirements.
I will open separate Github issues or flag the already open issues relevant to this thread.
I know it is specific to France, but given the scope of these requirements, they can be of interest for ERPNext and its community globally and could maybe be considered in the roadmap.
I. Inalterability
Globally, the notion of inalterability means the insurance of absence of integrity loss for all registered data.
Technically, this notion requires:
1.All transactions data should leave a transaction print with an cryptographic hash function.
Best state of the art authorized algorithms are: SHA-2, SHA-3, Whirpool, Blake
Example of state of the art data signature algorithms : RSA-SSA-PSS, ECDSA
For example the âEncryption at Restâ mecanism in MongoDB can be considered as acceptable.
To be noted: Printing an invoice is considered a transaction and each original print should be registered as such.
In short: all transaction data must be chained or sealed with a timestamped signature. This is true for all transactions data and all vouchers (archiving integrity is one of the requirement).
For ERPNext/Frappe, maybe the implementation of âData at Rest Encryptionâ for MariaDB or InnoDB Tablespace encryption + a chaining process should be considered ?
_GITHUB ISSUE: Issues · frappe/erpnext · GitHub
2.If any correction is made to a transaction data it should be only with âplusâ and âminusâ operations and not with a direct modification of registered data.
This is already partly the case in ERPNext since we can only cancel submitted documents and create amended ones. But canceled documents should never be deleted.
There should be no possibility to delete any transaction data, i.e. even the system manager should not be able to delete documents from the âDeleted Documentâ list.
The Administrator may have these rights in case it is strictly reserved to a third party service provider providing the certificate.
But if the Administrator has the rights to delete documents, it should be registered somewhere, maybe visible in the generated chain.
GITHUB ISSUE: To be opened
3.Data integrity
I think there is an issue with the offline POS.
If Iâm correct, LocalStorage is used to store the offline data until it is connected to the network again. It means that anyone can open their browser console and flush the storage, therefore losing the registered invoices.
There should at least be a chaining process or else, allowing to check that some data have been deleted intentionally.
_GITHUB ISSUE: Issues · frappe/erpnext · GitHub
II. Data Retention
1.All POS or cash registers must have a daily and monthly closing voucher generation process.
This closing voucher should register data like: Period Grand Total and Perpetual Total for the Accounting Period
_GITHUB ISSUE: Issues · frappe/erpnext · GitHub
EDIT: I have submitted a first PR for this issue and proposed a solution. All thoughts are welcome !
III. Archiving (12/2018)
1.An archiving mecanism has to exist and its traceability must be ensured
An archive should be maintained inside ou outside the system and the generation of an archive must be registered, chained or with a signature timestamp.
The archive should be read easily by the administration in case of control: formats can be JSON, XML, CSV, flat text,âŠ
It can be encrypted.
In ERPNext, it could be generated and preserved in the system as it would be the simplest way I guess.
GITHUB ISSUE: To be opened
I will complete these points in the following weeks.
Any input/thoughts about how these can be achieved is welcome.