[inv 1.5] Inventory Purchase and Control via PHP

If you store it in database all terminals will see same last logged in user. Maybe you can configure a setting name that includes a terminal suffix ?

{:Username} is something else that relates with my latest staff notification :slight_smile:

Ok, I’ll bite. @emre, how do I access the value for Terminal?

EDIT: deleted post and moved to post 3

@QMcKay sorry I think I meant something different. I meant you can create a rule that mapped to the terminal and works when a user logged in. That terminal specific rule will save {:CURRENTUSER} value to a terminal specific setting so you can query which user logged to a terminal through database.

However you’ll need to know which terminal accesses to server right? Maybe using Set Widget Value is easier to implement.

Correct, I need to know which Terminal, and I don’t know how to access that value. I haven’t seen any Terminal-specific parameters that can be used in Rules…

The way I have it working now is that only the Server Terminal will perform Auto-login, based on the HTML Widget having an URL setting of http://localhost. The PHP checks the URL and will only auto-login if the host is localhost, because we should assume that the code is running on the Server Terminal anyway.

It’s not that we can’t access the PHP remotely, but the remote-URL won’t match localhost, so the Auto-login will fail. I’m fine with that; I like it that way.

P.S. localhost could be set to or or whatever (it’s parameterized in the code), so long as it’s the IP of the Server with the DB and the PHP, and the Widget URL matches the directive in the PHP code ($autologinDomain).

I moved 18 posts to a new topic: HTML Widget URL: setting URL value with Set Widget Value Action

Ok, so after all of that discussion on setting the URL value, I’m of the opinion that it’s not going to work very well in my PHP implementation without some rethinking on the Authorization and Auto-Login. I already store the User as a Session variable so we can move within the HTML from REQUEST to PURCHASE without having to GET the URL currentuser. But it complicates things a bit. I prefer it the way I have it now, by storing the Username in the DB upon Login, and letting the PHP look up the user. This saves having to Set Widget Value at all.

However, there is still the point of the Terminal. If I could access the Terminal value upon Login, I could store it along with the User and it would make things much simpler.

I find it hard to believe there is no setting for {:TERMINAL} or [:Terminal]. @emre, is there a reason for this missing setting?

On next version you’ll be able to use {:CURRENTUSER} and {:CURRENTTERMINAL} tags in your widget’s URL setting.

Seems nobody needed it until now :slight_smile:


Newest addition to the system: now you can Add & Update Inventory Items using this interface. Populated pick-lists for GroupCode, Base Unit, Transaction Unit so you can select from existing choices. Available in v1.3.

The II screen: (for Adding and Updating Inventory Items)

(2014-12-01) New version 1.5 updated to work with SambaPOS v4.1.73 or later, with support for Additional Units. Config Files have been relocated to their own folder:


The PHP code for SambaPOS v4.1.73 or later :
inv1.5.zip (99.9 KB)

(2014-10-20) New version 1.4 updated to work with SambaPOS v4.1.70 thru 4.1.72. Earlier versions (4.1.69 or less) will not work with this release. For earlier versions of SambaPOS, you need to use inv1.3.zip

The PHP code for SambaPOS v4.1.70 or later :
inv1.4.zip (83.2 KB)

The PHP code for SambaPOS v4.1.69 or earlier:
inv1.3.zip (83.1 KB)


how can I import these files and DB for PhP My Admin on Xampp?

You should know this will not let you update previous WP purchases either. What he built was a front end for purchases but it is still bound by the same rules.

phpMyAdmin is a tool for managing MySQL using PHP. This does not use MySQL .

my bad luck, I want to also update the previous WP purchases Either
how can I configure update previous WP purchases Either?

You can’t edit previous WP purchases. You have to use the End of Day records. This is how it is designed.

Yes, it was my problem of understanding, sorry about that

In any case always have to replace the old with a new transaction and edit the inventory.

I could understand, in any case I would like to try the php configuration setting

it seems that did everything right, but my screen so it appears

To be honest if you dont have any experience setting up php on the server end then your going to find it very difficult to use. His setup is very advanced and requires knowledge of PHP and how to setup the server.

That screen means you setup the XAMP server and it is running but you have not setup the PHP files contained in this tutorial correctly on the server.

Yes, I believe I need to know more about PHP on the server.
I read and research more about … and I’ll be back for more …

thank you, Kendash

Basically your webroot you should put everything inside the html folder from his zip file. index.html is your main page.

BTW This is a nice solution for v4. But just to let you know v5 is due out soon and it has this capability built in.

You will still not be able to edit previous WP purchases or make purchases outside a WP.

1 Like

Hello, Can be used for Sambapos V3?