Slowdown With Task Types

So as most of you know I have developed my own credit card integration which has been working great and was an awesome learning experience until official integration comes. With this integration I have went out of my comfort zone significantly with learning SambaPOS features and also currently also noticing some limits slowing the system down.

With the Credit Card Integration, I needed a way to store transaction information for every credit card transaction. I also need to show that information in my printed receipt for the customer. So what I did is I saved transaction information as Tasks and then for ticket printing I call a script inside printer template to insert all credit card transaction information in the printout.

This worked great for 3-4 months of saving a lot of transactions 7 days a week. Now the Issue came up when the client called me saying his credit card receipts are taking over 25 seconds to print. This is a huge issue for them as they get slammed busy and need everything to be snappy fast performance.

I have verified that the printing is taking long because all those scripts querying credit card transaction data are running slow.

So with Task Types I have made the assumption that we can use them to store and query a large amount of data very quickly? Is this a bad assumption to make when working with Task Types?

{PAYMENTS}
<DB>
<L00>Transaction #: {CALL:Task.getTaskInfo("{TICKET ID}","TransactionNo")}
<L00>Ref #: {CALL:Task.getTaskInfo("{TICKET ID}","RefNumber")} {CALL:Task.getTaskInfo("{TICKET ID}","ResultText")}
<L00>identifier: {CALL:Task.getTaskInfo("{TICKET ID}","identifier")}
<L00>{CALL:Task.getTaskInfo("{TICKET ID}","CardType")} {CALL:Task.getTaskInfo("{TICKET ID}","Account")} {CALL:Task.getTaskInfo("{TICKET ID}","Entry")}
<L00>Approved Amount:{CALL:Task.getTaskInfo("{TICKET ID}","Amount")}
<J00>
<J00>

I expect the script will be good to see…

You’re unnecessarily loading same task multiple times on each CALL. You can read Task custom fields with that Custom Report tag.

{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier == "{TICKET ID}"}

or

{REPORT OPEN TASK DETAILS:TSC.RefNumber:Task.Identifier == "{TICKET ID}"}

If you use it like that SambaPOS will perform all task custom data reads from database at once.

I strongly recommend to review Reservation Setup as it heavily works on tasks.

No.

1 Like

Thank You Emre, please bear with me while I learn. :slight_smile:
Just realized that was a new feature… I love it

@VehbiEmiroglu

So whats happening is everything works fine if I manually type in the Ticket ID value but when I use tag it doesn’t work.

Doesnt work:
{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier == “{TICKET ID}”}

Doesnt work:
{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier == {TICKET ID}}

Doesnt work:
{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier = {TICKET ID}}

Doesnt work:
{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier = “{TICKET ID}”}

Works
{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier =7238}

When I put <J00>{TICKET ID} I get 7238. To me this seems like there is an issue with the data types being different thus == being false or something.

Where are you using it at?

In printer templates

The printer template?

Try this:

{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier == "[=TN('{TICKET ID}')]"}

Same original problem. What Emre sent me didnt work :confused: Seems like even tho they look the same… == isnt coming out as true.

Haha Jesse that its literally the next thing I was about to try. Youre the man I think thats going to work.

If that doesnt work then try

{REPORT OPEN TASK DETAILS:TSC.TransactionNo:T.Identifier == "{TICKET ID}"}

This didnt work. Wait is the T.Identifier a mistake? I am saving a custom task value and thats what I want to pull.

You can also remove the quotes around it and try. like this:

{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier == [=TN('{TICKET ID}')]}

No luck :frowning:

If I am understanding this correctly… a single = checks if the number value is equivlent… Double == checks if a string is equivlent? So techincally if we use your ternary expression we shouldnt need quotes and a single = should work? If I manually type in ticket id number for ex. 23424 then it works fine. Techinically speaking 23424 should be equal to [=TN(’{TICKET ID}’)] but it seems in this situation its not lol.

Did you try T.Identifier ?

No I actually am using a different tag that I know works. Look at this it explains it perfectly.

Ok so try this;

<J00>Amount: [{REPORT OPEN TASK DETAILS:TSC.TransactionNo:Task.Identifier == "[{TICKET ID}]"}]

Wait is there a typo here? “[{TICKET ID]”}

I fixed it look again.

template content has invalid bracket syntax error