Foreign Currency in Ticket... problem

Continuing the discussion from Add foreign currnecy total to receipt template:

Hi… first at all congratulation for wonderfull softeare Emre!!
I try to follow the first tutorial to add foreign currency and no problem, I add all botton and procedure to recive payment in foreign currency (Dollar and Euro in my case, with Mexican Peso as principal Currency), but I can’t add total in foreign currency in the billl… simply don’t work… this is my ticket template:

[LAYOUT]

– General layout

C:\logo.bmp

Bill

Date:{TICKET DATE}

Time:{TIME}

{ENTITIES}

Ticket No:{TICKET NO}

-

{ORDERS}

=

{DISCOUNTS}

[Total Gift:|{ORDER STATE TOTAL:Gift}]

{SERVICES}

Total:|{TICKET TOTAL}

{PAYMENTS}

=

T H A N K Y O U

[DISCOUNTS]

{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[SERVICES]

{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]

{PAYMENT NAME}|[=FF(’{PAYMENT AMOUNT}’,’#,##0.##’)]

{PAYMENT NAME}|$[=FF(’{PAYMENT AMOUNT}/{EXCHANGE RATE:US Dollar}’,’#,##0.##’)]

[ORDERS]

– Default format for orders

- {QUANTITY} {NAME}|{LINE AMOUNT}

{ORDER TAGS}

[ORDERS:Gift]

– Format for gifted orders

- {QUANTITY} {NAME}|GIFT

{ORDER TAGS}

[ORDERS:Void]

– Nothing will print for void lines

[ORDER TAGS]

– Format for order tags

* {ORDER TAG NAME} |

[ENTITIES:Table]

– Table entity format

Table: {ENTITY NAME}

[ENTITIES:Customer]

– Customer entity format

Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

Something wrong??
thank you so much…

I haven’t used multiple curancies so can’t help with that part but when showing your Pinter template - after paying it in select it and click the < / > button on the toolbar as the forum will strip some of the code.
Sometimes the stripped code won’t matter in identifying the problem but often it will and best thing to do.

Although I haven’t use curancies your conversion formula is different from the one in emres comment.
He uses TN and has different layout.

Your expression is wrong. Look at the one Emre showed then look at yours. Spot the difference?

Yes I try both combination, first the Emre expression and after the expression suggest by slabos in the same post.
But nothing change.
No error, no crash but the ticket remain with one total in Pesos.

Thanks for suggestion JRTech, i try to paste the code with < / > button:

[LAYOUT]

-- General layout

<BMP>C:\logo.bmp

<T>Bill

<L00>Date:{TICKET DATE}

<L00>Time:{TIME}

{ENTITIES}

<L00>Ticket No:{TICKET NO}

<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



[DISCOUNTS]

<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}



[SERVICES]

<J00>{CALCULATION NAME}|{CALCULATION TOTAL}



[PAYMENTS]

<J00>{PAYMENT NAME}|[=FF('{PAYMENT AMOUNT}','#,##0.##')]

<J00>{PAYMENT NAME}|$[=FF('{PAYMENT AMOUNT}/{EXCHANGE RATE:US Dollar}','#,##0.##')]



[ORDERS]

-- Default format for orders

<J00>- {QUANTITY} {NAME}|{LINE AMOUNT}

{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} |



[ENTITIES:Table]

-- Table entity format

<L00>Table: {ENTITY NAME}



[ENTITIES:Customer]

-- Customer entity format

<J00>Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

its a button…

Highlight the template and press that button. Do not type anything at start and end.

PS: i fixed it for you.

1 Like

@Alessandro slabos didn’t suggested it. He said it is not working… So not working for you too.

Try this one.

[=F(TN('{PAYMENT AMOUNT}')/TN('{EXCHANGE RATE:USD}'),'#,##0.##')]

Of course you should change USD part with your currency name.

So first try displaying Exchange rate on ticket with {EXCHANGE RATE:<currency>} tag. When it displays fine add expression that calculates USD amount.

Y try to pt in the code only the Exchange rate tag but nothing change Emre.

Need I to restart sambapos, close and re-open work period, or open new ticket after change template ticket?
I ask this to avoid some stupid error… :slight_smile:

You’ve configured something wrong.

That’s all I can say for that feedback. Maybe you can give more details about how you’ve configured currencies, final template that is not working etc… so we can have more idea about what might be wrong.

The printer configuration as Demo Printer can be a problem??

Playnig around finally I solve…

Maybe it’s not an elegant solution but work perfectly for me. this is the code:

[LAYOUT]

-- General layout

<BMP>C:\logo.bmp

<T>Bill

<L00>Date:{TICKET DATE}

<L00>Time:{TIME}

{ENTITIES}

<L00>Ticket No:{TICKET NO}

<F>-

{ORDERS}

<F>=

<EB>

{DISCOUNTS}

[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]

{SERVICES}

<J10>Total MXN:|{TICKET TOTAL}

<J10>Total USD:|[=F(TN('{TICKET TOTAL}')/TN('{EXCHANGE RATE:USD}'),'#,##0.##')]

<J10>Total Euro:|[=F(TN('{TICKET TOTAL}')/TN('{EXCHANGE RATE:Euro}'),'#,##0.##')]

{PAYMENTS}

<DB>

<F>=

<C10>T H A N K   Y O U



[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}|{LINE AMOUNT}

{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} |



[ENTITIES:Table]

-- Table entity format

<L00>Table: {ENTITY NAME}



[ENTITIES:Customer]

-- Customer entity format

<J00>Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

:slight_smile: What was the preferred solution you’re trying to achieve? I think I missed something here.

No Emre, I think the problem here it’s my poor actitude with english language…hahahahha…

in any case this is the result I’ve reach and it’s exactly what I need… :wink:

C:\logo.bmp

░░░░░░░░░░░░░░░░░ B i l l ░░░░░░░░░░░░░░░░
Date:14/10/2015
Time:06:35 p.m.
Table: 5
Ticket No:83

  • 1 Piña Colada 55.00
  • 1 Cuba libre 50.00

Total MXN: 105.00
Total USD: 6.56
Total Euro: 5.83

        T H A N K   Y O U             

Thanx for help… :slight_smile:

1 Like