KSeF Module for Dolibarr

Greetings,

E-invoices are quite the talk of the board, between GIFF - Facture Electronique - Autres modules natifs - Forum Dolibarr france and Implement FacturX/XRechnung/ZUGFeRD for upcoming obligation to issue and receive electronic invoices · Issue #30078 · Dolibarr/dolibarr · GitHub and many others there are quite a few people discussing these things.

I would love to simply use FakturX or the Peppol module, but Poland has created an entirely different method of e-Invoicing for KSeF (Krajowy System e-Faktur) just to keep things fresh and interesting for developers.

I think the Polish community of Dolibarr users is relatively small, but since I have now 2 and soon 3 businesses that will all be required to use it, I believe that the ‘easiest’ method is to fork FakturX and develop an alternative that uses is GPL licensed bones are a baseline to start from and build a new module upon this.

Is this the way forwards, or is there already work been done on this front? “KSeF Dolibarr” returns me no results in any popular search engines, and KSeF gives me no results on Doilbarr’s portal (not to mention there is no Polish language forum!).

Otherwise, hopefully I can get something working here!

Well I haven’t heard anything yet, so I figure the audience is small. I at least managed to convert over the settings menu and get buttons to show up on invoices for now as well as put together a reasonable design document today to help keep things in order.

I think I will be working on this for some time yet to get it into a somewhat workable version, but when I have a workable version I will update it on GitHub - TheRealBeef/Dolibarr-KSEF: Fork of https://inligit.fr/cap-rel/dolibarr/plugin-facturx Dolibarr module to support KSeF - I have no interest in making it paid because I benefit enough from the Dolibarr community and software here already. Dolibarr works well enough so I can make money at my real businesses instead.

Hello @IAmTheRealBeef,

as far as i kno nothing is done in that sense in the dolibarr community and it is nice to see your involvement in the project :wink:

Concernint the time to get an answer please rememeber that everybody in the forums are volunteers. Therefore we all do what we can and our part to respond and make this project move forward ! Good job on being part of the team :wink: let us know when your development is going. If need be for more technical support you might want to try the discord of dolibarr where you can have more technical questions.

regards

I guess I worded it poorly - on a forum it’s not normal to get a response <8 hours anyways but nobody had dissuaded me from the adventure in the meantime. I started work on it immediately after the first post.

As of this morning I’ve gotten all the Dolibarr side to a min working version. I originally was going to use triggers on PDF generation but I’ve commented them out for now and added another action button on the invoice page for non-validated and validated invoices to either validate & upload to KSeF or on an already validated invoice to upload to KSeF.

I also have a rudimentary table that keeps track of what submissions have been made so an overview of current invoices and what has/hasn’t been uploaded, as well as an option to prevent it providing these buttons for certain clients (e.g. Generic POS customer or Generic Retail Customer or however you name it) since B2C transactions don’t require this.

I now I’ve only to figure out what should be the simple part - the REST API side - but somehow seems the hardest as even with curl requests for testing it manually I can’t get anything working. I know it’s not entirely my fault as there are other people complaining about issues, but anyways I will complete this in the near future.

As they say though, 80% of the progress takes 20% of the time and the last 20% takes the other 80% of the time.

If you develop a module specifoc for ksef polish, you can then add it on dolistore.com (if you want to sell it) or you can also submit a pr on repo GitHub - Dolibarr/dolibarr-community-modules: The repository for community some official modules that can't be embedded into the core if you prefer to have it a community project.

You decide…

Thanks for the information - I’ll submit a PR to this repository once I’ve got something working.

As of today I’ve got authentication working so big win - now just getting invoice XMLs generated in the correct format so that the system will accept them and I think I’ll be at something min-viable.

Does anyone know of an open source module that creates and manages its own table in a way that’s non-intrusive? I have created an llx_ksef_submissions.sql according to the idea from Building Your Own Dolibarr Modules: A Developer’s Guide | Dolibarr MarketPlace

But I guess I should be careful to make it in such a way that it can be upgraded without breaking things in the future, since it could end up adding extra slop into this table if it’s run multiple times with different fields in it in future versions, correct? My SQL skills are pretty low-tier

If there is,a unique key in table, you don have to manage anything. It will guarantee there is no duplicate.