Error Printing Barcode

I get an error message when printing with barcode. If I remove <BAR>{TICKET ID} it will print. If I add it back in it will print maybe one and same error again.

 <T>Ticket
<L00>Date:{TICKET DATE}
<L00>Time:{TIME}
{ENTITIES}
<L00>Ticket No:{TICKET NO}
<L00> Ticket ID:{TICKET ID}
<F>-
{ORDERS}

<F>=
<EB>
{DISCOUNTS}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
{SERVICES}
<J10>Total:|{TICKET TOTAL}
{PAYMENTS}
<DB>
<F>=
<C10>T H A N K   Y O U
<BAR>{TICKET ID}



[DISCOUNTS]
<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[SERVICES]
<J00>{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

[ORDERS]
-- Default format for orders
<J00>- {QUANTITY} {NAME}|{TOTAL PRICE}

{ORDER TAGS}

[ORDERS:Gift]
-- Format for gifted orders
<J00>- {QUANTITY} {NAME}|**GIFT**
{ORDER TAGS}

[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[ENTITIES:Customer]
-- Customer entity format
<J00>Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

Printer is a Maxtex MT-150

When are you printing? After ticket has closed? What rule holds your print command?

Ticket Id is not generated until ticket is closed and orders submitted
Since it says value can not be null I’m suspicious that your printing before its generated.

I think you want to print a barcode on ticket to be able to open ticket later by using that barcode.

As @Jesse mentioned {TICKET ID} returns an empty value for new created tickets.

You have two options.

  1. Use Save Ticket action to force saving ticket before printing so {TICKET ID} will work properly.
  2. While creating a new ticket generate a unique number with {RANDOM} tag and store it as a ticket tag or ticket state. Open Ticket action supports opening tickets by tag or state instead of ticket id.
1 Like

Great point Emre in fact I forgot about save ticket action. I could use that myself.

Our next tutorial should be “exploring deep SambaPOS” lol.

1 Like

I agree totally. This is the reason its nearly impossible to write any kind of documentation that would actually help people. I mean we could list all functions etc… but that wont help anyone. The best resource is tutorials where you find similar implementation you learn it then adapt it to yours.

1 Like

Thanks got it working by using the save ticket action.

1 Like

I had a similar problem
I just changed the sort of action in the rule Print bill

Does print job action work after ticket close?!?

Yes, it works

I, too, at first thought that will not print :grinning: , but all is well

most likely due to the fact that the unloading ticket takes place after the end of all the action in the rule, and not after “close ticket”

I tried that also and it wouldn’t work either. I have printer set to print after every transaction. I created a save action and added it below

You must have another rule somewhere interfering with the workflow as im pretty sure print bill should work on a an unsubmitted ticket.
Also I have a very similar rule on my standard V4 setup (exc mine also has constraint for payment type is card so forces print on card payment) and works fine…

This is working for me. That was the only way I could get it to work.

1 Like

@JTRTech print bill already works. It just does not prints ticket id tag as ticket not saved at the moment he prints the bill.

1 Like