Customers Display Tickets

Hi, anyone try this customer display tickets in sambapos ? please let me know. thank you

This is possible with the combined use of Entity Screens, Ticket Lister, and Ticket States. You can also use Task Editor instead of Ticket Lister.

1 Like

@Scott Thank you for suggestion, but i dont want to use SambaPOS.
I am using Graphql to get tickets details do you have any other idea ?

You can do that, Qs project before he passed had customer and kitchen display in a web interface.
You should be able to get all the info you need via api, what you do with it and how you dosplay it is up to you :wink:

Hey @arslan are you asking if we specifically use that system? I am a little confused. What system is that?

Or are you asking if anyone uses a Customer Order confirmation screen? Yes we have people using Customer Order confirmation screens. We even have a tutorial on how to build one internally.

I agree the best method is with a skilled developer and Graphql to build a nice webapp powered display. But what exactly are you needing from us? Are you just asking if people use it?

Hi @Jesse, one of my client using SambaPOS and he installed a new LED to display Tickets.
Like , Right Side Preparing Food and Left Side Food Ready but he dont want to use SambaPOS.

I already create a custom app in laravel with graphql and call ajax every 2,.3 sec but i think its not good idea, I want to know if someone create app for display tickets with GraphQL please share how he/she is doing ?

I do not think anybody has developed an app for this yet. It is certainly possible and we will probably support one officially but there is no time frame for it and I can not promise anything atm.

Why not?

EDIT: The best approach would probably be a webapp developed with React.

Alright, i want to know one thing more is there any API where i can check timestamp only for checking any changing in SambaPOS,
Like : TIme : 19:35 then Order State Update and Time API change with 19:36
so i can check if any change then i can recall the gettickets API
Thanks

Please explain what you are needing that for. What application and what would it be doing? Timer for a screen?

Your question is very vague… we have hundreds of timestamps in SambaPOS.

:information_source: For this tutorial you need to run message server service tool and update Server Port as 9000. You also need to update SambaPOS message server port setting as 9000. When you do it SambaPOS will shutdown old message server and enable new implemented message server called signalr. That works like message server but allows subscription requests from external apps.

This is the current state of our application.

<!DOCTYPE html>
<html>

<head>
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js'></script>
    <script src='http://ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-2.2.0.min.js'></script>
    <script src="/signalr/hubs"></script>
    <script>
$.postJSON = function(url, data, callback) {
    return jQuery.ajax({
    'type': 'POST',
    'url': url,
    'contentType': 'application/json',
    'data': JSON.stringify(data),
    'dataType': 'json',
    'success': callback
    });
};
    
$(document).ready(function(){
    $('#header').html('<b>SambaPOS</b> Todo List');
    $('#btnAdd').click(function(){
        var item = $('#todoEdit').val();
        $('#todoList').append('<li>'+item+'</li>');
    });
    updateTasks();
    
    var proxy = $.connection.default;
    proxy.client.update = function (message) {
        updateTasks();
    };
    $.connection.hub.start()
        .done(function(){ console.log('Now connected, connection ID=' + $.connection.hub.id); })
        .fail(function(){ console.log('Could not Connect!'); });
});

function updateTasks(){
    var query = getTaskScript();
    $.postJSON("/api/graphql/", {query: query}, function(response) {
        if (response.errors) {
            // handle errors
        } else {            
            // //es6 syntax
            // response.data.tasks.forEach(task=> {
            //     $('#todoList').append(`<li>${task.content}</li>`);
            // });
            $("#todoList").empty();            
            for (index = 0; index < response.data.tasks.length; ++index) {
                var task = response.data.tasks[index];
                $('#todoList').append('<li>'+task.content+'</li>');
            };
        }
    });
}

function getTaskScript(){
    return '{tasks:getTasks(taskType:"Todo",isCompleted:false){content}}';
}
    </script>
</head>

<body>
    <p id='header'>Tooo List</p>
    <p>
        Todo: <input type='text' id='todoEdit'>
        <button id='btnAdd'>Add</button>
    </p>
    <p>
        <ul id='todoList'>
            <ul>
    </p>
</body>

</html>

I updated scripts section to import needed libs to connect to message server.

    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js'></script>
    <script src='http://ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-2.2.0.min.js'></script>
    <script src="/signalr/hubs"></script>

They should stay in that order. Our server serves a script through /signalr/hubs/ url to allow clients to connect to message server.

    var proxy = $.connection.default;
    proxy.client.update = function (message) {
        updateTasks();
    };
    $.connection.hub.start()
        .done(function(){ console.log('Now connected, connection ID=' + $.connection.hub.id); })
        .fail(function(){ console.log('Could not Connect!'); });

This code starts connection to message server and logs if it successfully connected or not. You’ll notice the function assigned to proxy.client.update works when we receive a message. For now we’ll just update task list on whatever message we receive from SambaPOS.

See how adding tasks from SambaPOS updates our Javascript app automatically without clicking refresh.

Well… it even refreshes before SambaPOS :slight_smile:

2 Likes

You potentially could trigger update from samba itself as part of normal automation?
Using samba scripts to ping you web server with ticket for it to refresh.

I think that might help you. That was a post by Emre in the private beta category I just copied it here so you can see it.

Jessie’s answer is better LOL
I really need to play more with graphql…

1 Like

@Jesse Thank you i think you solve my problem will check in morning.

The key is to notice how adding tasks in SambaPOS auto updated the web javascript app. The principle would be similar for what your wanting to do. Heck the web app updated before SambaPOS did lol. GraphQL is extremely fast.

Hi @Jesse, can you please guide what i am doing wrong ?

192.168.10.5:9000/samba.html

Capture

Thanks

First you need to authorize to your app. That sample I posted was older than the guide. A few things had changed. So check the guide here and use that previous post I made as a reference.

https://forum.sambapos.com/t/integrators-graphql-api-guide/14047

1 Like

@Jesse can you guide what i am doing wrong, i have to refresh every time its not updating on real time

please let me know how this auto refresh, yhank you

Did you install the javascript app into your html? You have the correct libraries linked?