Call a weblink as action

I have made a wifi ticket system in Python/Django (I wish I had the skills to make it in C#). In this system I can import wifi codes as csv files. When I call a link, a ticket is printed and the printed codes are removed from the database.

So when I call:
http://localhost:8000/ticket/1 a ticket valid for an hour is printed
http://localhost:8000/ticket/2 a ticket valid for a day is printed

Is it possible to call these links directly from Sambapos, after a ticket is sold? Or should I make a .bat file, and call these links from the .bat with a program like Wget?

In case anybody is interested browsing the Django code, just let me know, it is on Github.

You can use URL Printer for that. You can review this tutorial for details.

http://sambapos.org/wiki/doku.php/en/custom_package_delivery_system_part_3

@emre thanks for the update.

I use version 4.1.82 Is it correct that there is no URL printer type?

I can only see “settings printer” and “save to file printer”

(sorry didn’t mention the Sambapos version)

Within SambaPOS, on the Main Menu screen, click Samba Market. Then install the URL Printer module (free). Restart SambaPOS for it to take effect, then look at your Printers section again - you will see the URL printer there.

@emre @QMcKay Thank you for your answers!

I will install and test, and post here how it works.

I have installed the url printer, and everything seems to work perfectly. The only problem till now is that I try to use the product tag as variable. I have these values for the url printer:

http://localhost:8000/ticket/@number@

Token char: @

In my printer template I tried this:
number={ITEM TAG}

This gives me this url: http://localhost:8000/ticket/{ITEM TAG}

Other tags get get translated though. For example:
number = {DATE} gives me an url with the current date

Is it possible to get the Item tag, or a custom tag into the url?

Well from your question I thought you needed ticket numbers. This feature works ticket wide not per order. With V5’s JScript support you’ll have more options for such issues.

@emre it is not a big problem I only have to define an url printer for every wifi ticket type we sell (we have 10 different types)

If such tickets contains only one of these order types you can tag ticket with added order’s tag and use that tag.

Or…

You need to use regular {ORDERS} tag and [ORDERS:X] to access order specific values. You can use order states to filter non-wifi orders. Reviewing this tutorial might give more ideas.

I already started to add a rule for every ticket type, and I could not figure it out with the order tags. The work was a bit tedious, but now everything is settled everything works beautifully (thanks to the great feature of the url printer!)

1 Like

I now installed the Django app, using CherryPy server as a Windows service. In case somebody wants to check the code please have a look here:

I use Pfsense (a Freebsd router distro) as router and captive portal. In Pfsense I can create vouchers (wifi codes) and export these as .csv

Thanks to the excellent feature from Sambapos (urlprinter) I can print tickets directly from our pos. We have 10 different ticket types, from 2 hours to one year. Because I have too little knowledge of the printer template system I created 10 different url printers. I am sure this can be done easier (see the reply of @emre above).

I use action “order added to ticket”, so when the ticket is clicked it is directly printed out.