Display ticket payment type on ticket lister

I’ve created a ticket lister widget to display paid tickets, which I’m intending to use to allow batch updates to be done on tickets. However, I want to show the payment type (or payment types) used to settle a ticket on each row, but can’t work out how. I looked at {REPORT PAYMENTS} and {REPORT PAYMENT DETAILS:X} tags but neither appear to produce anything at ticket level.

Any ideas?

1 Like

As you would do in a normal printed Ticket (ie. a Bill Template), you should be able to use the {PAYMENTS} placeholder and a [PAYMENTS] section something like:

[PAYMENTS]
<J00>{PAYMENT NAME}|[=F('{PAYMENT AMOUNT}')]
1 Like

Yeah that worked, thanks :slight_smile:

Any idea how I can filter the ticket list by some fields, for example by payment type.

From what I read, the Expression is added to the SQL query and the Filter is handled in SambaPOS on the data returned.

I tried Payments.Name = 'Cash', PT.Name = 'Cash' and PT = 'Cash' in both fields but they either do nothing or throw an error (using is instead of = makes no difference). I’m not entirely sure what to add since the payments would be taken from a join to the Payments table.

1 Like

Hi. First of all, with this topic, I was curious and I see it as excellent on your part. I can ask you please if you have any guide to do this. I am using sambapos v 1.4.82. Again, your idea seems bright to me. Thank so much.

Oscar

This is only possible in v5

Thank Jesse,

I get it. In the same way I’m already migrating to version 5. Sambapos is great.
I would appreciate your help to implement this type of widget.

Greetings

Ticket Lister widget displays tickets using the familer ticket template structure. There are many points of reference on the forum for details on ticket template structure.
The one shown above presumeably will be using html over the default POS style giving it’s more graphicaly appealing look.

Thanks so much. Thanks for your asnwer agile.

No it does not use HTML but you can get an idea here.

Hi Markjw, I had been looking for confirmation that a screen like this with “payment type” was possible. I have so far managed to bring ticket exporer to the entity screen and use ticket note column for that. I like the way you have got search options and column headers here. Do you think you can share with me how you have done that, please?

Column headers is just a label aligned above.

The way I did it a few years back it was not responsive. I now know it can be done in a better way that would be responsive but haven’t went back to update it.

The search is a pain and not perfect. It is due to the way I query just filtering by the number of days, so all the buttons and date ranges just return the number of days which is the main part that determines the results. There will be better ways to accomplish this I am sure.

(line breaks added to code for display purposes)

Column Header (Label Widget)

<block 10,0,5,0 #5ffffff left 70>Ticket #</block>
<block 10,0,5,0 #5ffffff left 60>Order #</block>
<block 10,0,5,0 #5ffffff left 130>Date / Time</block>
<block 10,0,5,0 #5ffffff left 280>Customer</block>
<block 10,0,5,0 #5ffffff left 110>Ticket Type</block>
<block 10,0,5,0 #5ffffff left 130>User Name</block>
<block 10,0,5,0 #5ffffff left 100>Payment Type</block>
<block 10,0,5,0 #5ffffff left 60>Total</block>
<block 10,0,0,0 #5ffffff right 45>Select</block>

Ticket Lister

<L>
<block 1,0,0,0 #5ffffff left 70>{TICKET NO}</block>
<block 1,0,0,0 #5ffffff left 60>{TICKET TAG:Order No}</block>
<block 1,0,0,0 #5ffffff left 130>{TICKET DATE} {TICKET TIME}</block>
<block 1,0,0,0 #5ffffff left 280>[='{ENTITY NAME:Customer}' == '' ? '' : '{ENTITY NAME:Customer}'][='{ENTITY DATA:Customer:First Name}{ENTITY DATA:Customer:Last Name}' == '' ? '' : ' - '][='{ENTITY DATA:Customer:First Name}' == '' ? '' : '{ENTITY DATA:Customer:First Name} ']{ENTITY DATA:Customer:Last Name}</block><block 1,0,0,0 #5ffffff left 110>{TICKET TYPE}</block>
<block 1,0,0,0 #5ffffff left 130>{USER NAME}</block>
<block 1,0,0,0 #5ffffff left 100>{PAYMENTS}</block>
<block 1,0,0,0 #5ffffff right 60>£{TICKET TOTAL}</block>
<block 5,0,5,0 #5ffffff right 31>[='{TICKET STATE:SStatus}' == 'Selected' ? '<size 16><color Red><sym></sym></color></size>' : '<size 16><sym></sym></size>']</block>

[PAYMENTS]
<L>{PAYMENT NAME}

The Ticket Lister uses an expression that takes the number of days from a local setting:

image

image

Script to calculate days from 2 dates:

var _MS_PER_DAY = 1000 * 60 * 60 * 24;

// a and b are javascript Date objects
function dateDiffInDays(a, b) {
  // Discard the time and time-zone information.
  var utc1 = new Date(a.substr(6,4), a.substr(3,2)-1, a.substr(0,2));
  var utc2 = new Date(b.substr(6,4), b.substr(3,2)-1, b.substr(0,2));

  return Math.floor((utc2 - utc1) / _MS_PER_DAY);
}

which is called by a rule triggered by an automation command when either of the date fields is changed:

image

Obviously amend to your needs, this is custom to my setup. Hope this gives you something to work with :slight_smile:

4 Likes

Oww! Thanks for your prompt reply. You have been a real help. I will try this out when I get some time this week/

1 Like

Hi Markjw, I have tried the above and managed to get the menu bar for entiry but could not figure out how you have brought the search Menu bar above it? I have been searching and trying different things without any luck. I have also applied the code for the ticket lister but no tickets are showing there, probably because I have not got the search bar up yet?

I created all fields and buttons on the search bar myself, its not a built in feature. So they are Automation Command Buttons, Editor Widgets and Label Widgets. You have to create them yourself.


Thank you

1 Like

Okay I got it thanks. Thank you for your help