GQL Modules - GraphQL Modules for Remote Client Browsers

Got it beat …

You can see the “All Tables” Entity Screen (Entity Type “Tables”) selector button here …

New directive in config_modules.js for listing Entity Screen Names …


Just one more thing I want to handle better regarding Ticket Entities that has been bothering be for a long time, and then I can probably update the repo.

1 Like

What’s wrong with ticket entities

Beautiful! Works great. I am working on an alternate theme for this too, light material based, it’s done. Everything else seems to be going pretty good so far – this is proving extra useful for me. I have been able to implement payment processing and multiple other very cool functions.

Yes, the custom command buttons to switch between “fast menus”. I used the fast menu tutorial on the forums – Switch Menus with FAST MENU

I was just doing something silly by trimming the last character off the Entity Type (ie. Customers would become Customer), which is a bold bad assumption, and completely unnecessary.

Nice! Show some screenshots!

Glad you like it. I use the system a LOT, every day.

How did you manage Payment? What other functions?

Yeah, thanks for reminding me. I need to at least put in a check for null products.

I put in a check for null product. Unfortunately, getMenu does not return properties for Automation Command Name or Value, so we cannot support Custom Commands … might as well omit adding them to the Menu Screen.

            {
              "id": 154,
              "name": "Custom Command",
              "color": "#FF0000",
              "foreground": "White",
              "image": null,
              "header": "Custom<br/>Command",
              "caption": "Custom<br/>Command",
              "categoryId": 1,
              "productId": 0,
              "portion": null,
              "quantity": 1,
              "defaultOrderTags": null,
              "groupTags": null,
              "autoSelect": false,
              "product": null
            }

… deleted double post …

… deleted triple post …

@Shivan, the repo is updated.

We could support them in a sneaky way, using certain identifiable “marker” syntax in the Name field, for example something like:

CCN_<commandName>~CCV_<commandValue>

Example:
CCN_TestCommand~CCV_TestValue


Then we can parse the item.name and look for the markers CCN_, ~, CCV_ and split it to derive:

AutomationCommandName : TestCommand
AutomationCommandValue: TestValue

If anyone is interested in that idea, let me know. Not sure it would help with something like Menu Switching, but it may be possible.

Just download the update,

New version required new Special Report ie GQLM User Module Permissions (I found it here) and GQLM Departments which I couldn’t find it and don’t know what next :wink:

Maybe you need to update Database Import Tool for Special Reports

@QMcKay - For the payment processing what I have done right now is we use square to process CC and cash. So I made a quick check to see if the app is running in a browser on iOS or Android (those platforms support square only and have API) –

If they are then it uses Squares API calls to fire square on the device, run the transaction and then square returns a callback. The callback is the tricky part – the device can’t receive it because I am running browser based so either the main POS can receive it or a third party server. We just used a third party server as middleware since we already had one .

On the third party server I have a script set to capture the callback. Then the SambaPOS GraphQL POS waits and calls the remote server to verify the payment was ok and gets back the payment ID. If it fails it lets the user know or retries – it works well and is pretty instant.

An alternative could also be a 2 second script on the main samba server (local, where GraphQL runs) with Node.js which just does the same thing – it would really be fine. In my case I didnt want to worry about port forwarding on routers, etc so it made sense to use a third party.

Square doesnt allow direct hardware access or else i’d of done that. They also have a web commerce API to do this in Samba for real BUT – it charges a higher rate so my solution is easier, better and complies with their standards and eliminates the need for PCI Compliance stuff.

End Result for my staff: They can use any android or ios tablet or phone with a browser to load a responsive POS that (to them) seamless integrates square to process credit/debit cards.

Updated GQLM Special Reports DB Tools Import:

!GQLM_SpecialReports.zip (2.8 KB)

@QMcKay I just downloaded the latest repo
then I realized it needed a few new reports in sambapos for it to function.
Specifically

  • GQLM Departments<-- Found this
    -GQLM Ticket Tag Groups<-- Found this
    -GQLM Ticket Tags<-- Found this
    and
    -GQLM Order Tag Groups<— Could not find this.
    It’s this missing Report that is causing POS and ticket viewing to not work at this stage.
    .
    I looked for it through the thread but could not find it.
    When did you update the order tags section?
    EDIT
    Scratch that lol. I just updated it just before I posted this haha!

I just posted an updated ZIP for DB Tools Special Reports before your last post.

First Post in Topic also has new ZIP for download.

1 Like

Ok now Im getting a strange issue


I searched in config_modules and

// POS
var menuName        = 'Menu';
var departmentName  = 'Restaurant';
var ticketTypeName  = 'Ticket';
var ticketCreationMethod   = 'Create Ticket';

The menu name matches what I have in SambaPOS. Hmmm.

EDIT
Ok now I’m also seeing this error message too.
XMLHttpRequest cannot load http://gqlm.pastmidnight.com/?vfy. The 'Access-Control-Allow-Origin' header has a value 'http://asusbook:84' that is not equal to the supplied origin. Origin 'http://192.168.1.16:9000' is therefore not allowed access.
its also saying this

Uncaught TypeError: Cannot read property 'length' of undefined
at POS_getCategories (pos.js:581)
at m (pos.js:2508)
at eval (pos.js:2751)
at Object.error (gqlqueries.js:55)
at i (jquery.min.js:2)
at Object.fireWith [as rejectWith] (jquery.min.js:2)
at y (jquery.min.js:4)
at XMLHttpRequest.c (jquery.min.js:4)

You can ignore that error. It will not affect anything. It will go away.


If the getMenu fails, then it is reasonable that get getCategories will also break.

The Department code might be changing that variable. Try this:

  • click on the top bar where Terminal, Department, Name is at
  • on the blue screen, click on the Terminal (Server), and click on the Department (Restaurant), which fill force a re-register of the Terminal

If that does not help, restart the SambaPOS MessageServer Service, and do a hard-reload of GQLM.

This worked fine.

As soon as I pressed ‘Restaurant’ I get the same error message

I restarted Message server,
And did a hard reload of GQLM.
and

… deleted …

Scratch that. Check your Department configuration in SambaPOS to see if the Menu is configured or blank … let me know if yours is blank, because it will cause a problem in terminals.js. I will make a fix for that …

You mean in SambaPOS–> Department?