Task printer saves wrong ORDER UID

Hello,

To improve how my kitchen display handles voids I need to read some data from the task that includes the order that is being voided.

I use (Id={ORDER UID}) in the task template so that the Id of the task is the same as the ORDER UID. The thing is that in the database, the Identifier of the task (located in ‘Identifier’ column in dbo.Tasks) is different to the OrderUID (located in dbo.Orders).

Here is how the same order saves {ORDER UID} as the tasks Identifier:

…and as OrderUID:
image

I dont understand why the two UID’s are different. I have not found a way how to retrieve the old task from the database. Using {ORDER ID} as an identifier does not work because the ID is created after the task is printed as far as I understand.

I have not found a connection between dbo.Tasks entry and dbo.Orders entry even though it should share the ORDER UID. Saving the UID as an order tag or state might work but I do not want to add unnecessary automation to every single order that is added to a ticket.

Do you have any ideas?

Thank you,
Ondra

(Id={ORDER UID}) is saved in custom Data column, formatted as json

1 Like

I don’t think so. The (Id={ORDER UID}) works differently - it is not saved in the CustomData column as another custom values; it is used as the Identifier instead.

I’ve tested it thoroughly and I’m 100% sure that the ORDER UID saved to the Tasks table is different to the ORDER UID saved to Orders although both entries are made upon ticket closing.

I’m also 99% sure that a year ago it saved the same UID because I used it to retrieve the old task to do some changes on it.

Is it a bug or expected behaviour? What is the easiest way to find a task in the DB in my scenario?

Thank you

So you are not referring to Id column (an Auto incremental field) , you are talking about identifier column.

Is there only a order in the ticket?

Yes, you’re right, I’ve updated the original question.

Is there only a order in the ticket?

I’m afraid I dont understand the question. No matter how many orders in a ticket, each of them has a it’s own row in the database (at least in the Orders and Tasks tables in my case).

You should find the root cause so you need to imagine the possible scenarios that may cause the issue, if there is more than a single item in the ticket check if the UID saved in the task is related to any other order, if yes check your rules and template.

There is no OrderUId specific to tasks. Something in your automation is assigning wrong one to task. Tasks are not orders. They do not have orderuid. That comes from orders and you need to assign it to task using task printer that reads order information. Double check your automation.

Your confusing task identifier. That is different and can only have one. You should create a custom field for what you want and reference that maybe?

Chances are orderuid is not available yet and it’s assigning random one.

I’ve got (Id={ORDER UID}) in my task template so that the UID of the order becomes the Identifier of the task that is representing the order:

I’ve added a show message action to New order adding rule to show me the UID:
image

Upon adding a new order, this is it’s ORDER UID:
image

No entry is made to Orders or Tasks tables yet (which is expexted).

After closing the ticket, both entries are made. This is saved as the Order UID:
image

But this is what becomes the tasks Identifier:
image

…even though the Tasks Identifier comes from the (Id={ORDER UID}) custom field (tested).

I was also thinking that the UID is not available when the task is printed but as you can see, it is not the case - the UID which will be later saved to the Orders table is already known on Order added to ticket. The task is printed later.

What is the results when you use this report tag in a Show Message:

Task: {GET TASK DETAILS:T.Content:T.Identifier="{ORDER UID}"}

You will have to select an order that is has been sent to the task printer first.

Thank you, I’ll try it later. I don’t think it will work though, because the issue here is that the {ORDER UID} and the Task.Identifier are different.

I need these values to be identical. Or any other way how to make a connection between an order and a task.

Ticket table:

Tasks table:
image

It saves the values fine, did you check if the order uid saved in your identifier column is from another item in the ticket?

replace (Id={ORDER UID}) by (Id={NAME}-{ORDER UID}) to see if is saving another order uid that is not desired. Also show your rule where you handle your void flow.

Also, I guess that if you are handling voided items your template should be:

[ORDERS:Void]
++{ENTITY NAME:Table} {ENTITY NAME:Customer}
(Id={ORDER UID})...

Well, thats strange. Could you please show me your task template?

For testing purposes, I’ve also added the {ORDER UID} to Bar Orders printer template and to the body of Task template. Although the actions that fire the printing job are exactly the same for the Task printer and Bar printer (except for printing job obviously) and they are both fired at ticket closing, this is what I’m getting:

ORDER UID in the message shown on order added to ticket:
image

ORDER UID printed on the Bar order:
image

ORDER UID as shown in the task:
image

Entry in the Tasks table:
image

Entry in the Orders table:
image

No matter what I try, the UID saved in the task is different to the actual ORDER UID of the order.

Here are my templates:
Task template:

[LAYOUT]
{ORDERS}

[ORDERS]
++{ENTITY NAME:Table} {ENTITY NAME:Customer}
(Id={NAME}-{ORDER UID})
(Quantity={QUANTITY})
(Table Name=<size 24>{ENTITY NAME:Table} {ENTITY NAME:Customer}</size><size 1><color #FF093367>{ORDER NO}</color></size>)
(Time={DATE:HH\:mm})
{CALL:kitchen.kitchenColor('{ITEM TAG:Kitchen Group}')}<size 21><bold>[=('{QUANTITY}'>1 ? ('{QUANTITY}'+' x ') : '')]{NAME} {ORDER UID}</bold></size></color>
{SORTED ORDER TAGS}

[ORDERS GROUP|PRODUCT TAG:Kitchen Group:Polívky,Hotovky,Sladký,Smažený,Minutky]

[ORDERS:Void]
++{ENTITY NAME:Table} {ENTITY NAME:Customer}
(Id={NAME}-{ORDER UID})
(Quantity={QUANTITY})
(Waiter=<size 34>[=('{QUANTITY}'>1 ? ('{QUANTITY}'+' x ') : '')]{NAME}: <bold>{ENTITY NAME:Table}[=('{ENTITY NAME:Customer}'=='' ? '' : ' {ENTITY NAME:Customer}')]</bold></size>)
(Table Name=<size 24>{ENTITY NAME:Table} {ENTITY NAME:Customer}</size><size 1><color #FF093367>{ORDER NO}</color></size>)
(Time={DATE:HH\:mm})
<color red><size 21><bold>STORNO: {QUANTITY} x {NAME}</bold></size></color>
{SORTED ORDER TAGS}

[SORTED ORDER TAGS]
{CALL:kitchen.kitchenColor('{ORDER TAG NAME}')}<size 19><bold>[=('{ORDER TAG QUANTITY}'>1 ? ' + '+{ORDER TAG QUANTITY} : ' + ')]{ORDER TAG NAME}</bold></size></color>

Bar orders template:

[LAYOUT]

{ORDERS}

<J11>{TIME}|{ENTITY NAME:Table}{ENTITY NAME:Customer}

[ORDERS]
<L11>{QUANTITY}x {NAME} UID: {ORDER UID}
{ORDER TAGS}
<F>-
[ORDER TAGS]
-- Format for order tags
<L11>     * {ORDER TAG NAME}

[ORDERS:Void]
<J11>- {QUANTITY} {NAME}|**STORNO**
{ORDER TAGS}

I’ve replaced (Id={ORDER UID}) with (Id={NAME}-{ORDER UID}) as you can see from the screenshots. The task printer knows what order we’re talking about. If it did not, it would not print the correct order at the first place.

I do not have an issue with voiding items. Voided items are shown correctly on the kitchen display - in red and with ‘STORNO’ at the beginning. What I need to do is to find the original task in the database and mark it so that it does not show up on the waiter screen or to show it with the correct quantity after the void.

Thank you

I did - the UID that is saved as the task identifier does not exist in the Orders table. It does the same no matter how many orders are in the ticket - even with single order on new ticket.

I tried cloning the Print Task action in the ticket closing rule. This is what I’m getting:

Three different UIDs for a single order, none of them is the true UID of the order, which is:
image

Could any of you please test this on your setup? There is no automation that could cause the issue. Printing to a Demo printer or a POS printer works well.

@VehbiEmiroglu Could you please look into it?

Thank you

Was about to give up to accidentally find out that Merge Lines: Merge is what gives you totally random ORDER UID’s. Changed to Don’t Merge and now the tasks have the correct Id that corresponds to the orders UID…

2 Likes

Totally random probably isn’t the correct term, if it’s creating a new order then it’s a new order with new id rather than just changing to random :stuck_out_tongue_closed_eyes:

Using the preview feature of the printing template you’re getting a new uid for each click even though it should be showing the last order in the db. The uid assigned with merge lines:merge does not exist in the db. I would call it random but…

2 Likes

When are you processing the uid?
Kitchen displays etc I imagine should be print/updated on ticket close after any merge has happened?
The uid changing seems like an issue if you are using before ticket closing, however would also be effected by user canceled orders etc too hence why my automation would wait untill ticket closing when ticket has passed point of change and being submitted.