Workflow to generate invoices and stock movements based on external POS

I’m running a restaurant and using Dolibarr as our ERP. It has been phenomenal so far in helping us manage our stock and inventory.

I would really like to use TakePOS but unfortunately in Taiwan we basically require the various integrations with government tax stuff that comes with local POS systems.

At the end of every day (or whenever really) I can spit out all sorts of CSVs from that POS system, so I’ve been experimenting with semi-automating ERP movements from those CSVs. Right now I can successfully generate invoices per purchase, and then invoice line items per actual item in a purchase (say, one customer getting a sandwich, fries, and a drink). I’m now at a stage where I’d like to auto generate stock movements for things. However, if I click a bunch of invoices and try to mass-validate them, of course I get the error that to do so is impossible because I need to determine from which warehouse a stock movement should happen.

I thought maybe I can use the import assistant to somehow link invoices to some “stocks” module warehouse movements using another spreadsheet, but it doesn’t seem to be an option. Even if I didn’t want to attach invoices to stock movements and just create them from a CSV, I don’t see such an import available (I will check the store later).

I could, perhaps, use the import tool to create manufacturing orders after the fact based on a day’s sales, and that would generate stock movements (I need to do so anyway because I need manufacturing orders in order to reduce the raw materials that go into making certain meals, and those wouldn’t be reduced by an invoice because they aren’t sold :stuck_out_tongue: ), however then I miss out on an invoice being linked. Not a big deal I suppose.

I’m wondering if anyone else has been in my shoes, running a restaurant or shop with external POS and managing stock movements, invoices, manufacturing orders etc with imports. If so, what did you do?

[quote=calebjay, post:1, topic:24594]
I’m running a restaurant and using Dolibarr as our ERP. It has been phenomenal so far in helping us manage our stock and inventory.

I would really like to use TakePOS but unfortunately in Taiwan we basically require the various integrations with government tax stuff that comes with local POS systems.[/quote]

I am neither using TakePOS nor do I run a restaurant

[quote=calebjay, post:1, topic:24594]
At the end of every day (or whenever really) I can spit out all sorts of CSVs from that POS system, so I’ve been experimenting with semi-automating ERP movements from those CSVs. [/quote]

I think that if I could not pull the data from the local POS system using an API, then I would make a setup such that all I would have to do was to save the file, and then some automatic system would detect that, process the data and feed it into Dolibarr. I would probably use Jenkins or a similar system to either get triggered by a new file or to check regularly. Then run a Jenkins job that would process the CSV and push the data into Dolibarr using the Dolibarr API system. Jenkins from jenkins.io is also an Open Source system and you can use many many programming languages to parse the CSV. I’d use Python - which I already use to put dance class registrations into Dolibarr.

[quote=“calebjay, post:1, topic:24594”]
Right now I can successfully generate invoices per purchase, and then invoice line items per actual item in a purchase (say, one customer getting a sandwich, fries, and a drink). I’m now at a stage where I’d like to auto generate stock movements for things. However, if I click a bunch of invoices and try to mass-validate them, of course I get the error that to do so is impossible because I need to determine from which warehouse a stock movement should happen.[/quote]

In my 18.0.3 Dolibarr when creating a new product I can select a “Default warehouse”. Have you done that? My thought is that if your products have that, then I’d expect mass validation would work. Another option could be to have some code that would fetch all draft invoices through the API and then Validate them one by one using the API. Once again I’d run this job in Jenkins.

[quote=“calebjay, post:1, topic:24594”]
I thought maybe I can use the import assistant to somehow link invoices to some “stocks” module warehouse movements using another spreadsheet, but it doesn’t seem to be an option. Even if I didn’t want to attach invoices to stock movements and just create them from a CSV, I don’t see such an import available (I will check the store later).

I could, perhaps, use the import tool to create manufacturing orders after the fact based on a day’s sales, and that would generate stock movements (I need to do so anyway because I need manufacturing orders in order to reduce the raw materials that go into making certain meals, and those wouldn’t be reduced by an invoice because they aren’t sold :stuck_out_tongue: ), however then I miss out on an invoice being linked. Not a big deal I suppose.[/quote]

I wonder if you through the API could create a manufactoring order, have the stock movement done, and even link the invoice.

I wonder what is possible with the “MODULE BUILDER” module? I haven’t had time to play with it yet, but I’m going to do that at some point.

1 Like

I can not get it to quote nicely :frowning:

Good idea about the default warehouse, though on the invoice I’m testing on, the products in both line items do have default warehouses set :frowning: