Rounding and issuing change in multiple currencies

Now set to Round UP or DOWN to nearest 5.

Configuration:


Operation:

1st Sale showing Round Down
2nd Sale showing Round Up.

1 Like

fyi, printer templates should work fine when you decrease ui decimal places.

1 Like

Very nice, thank you again @emre.

I set Visible Decimal Places back to 2 instead of 4.

Print:

------------------------------------------------
11 Donair Wrap.Wrap              12.00    132.00
         SIDE Fries            
================================================
Total:                        (L3,036.00) 132.00
================================================
Subtotal:                     (L2,639.00) 114.74
Tax T1 (15%):                    (L396.00) 17.22
Tax Total:                       (L396.00) 17.22
Round HNL - (1.00):               (L-1.00) -0.04
GRAND TOTAL:                  (L3,035.00) 131.96
TRES MIL TREINTA Y CINCO Lempira
XR:                             (0.043478) 23.00
================================================
PAYMENT TOTAL:                (L3,110.00) 135.22
Cash USD                                   50.00
Cash USD                                   20.00
Cash HNL (L1,000.00)                       43.48
Cash HNL (L500.00)                         21.74
------------------------------------------------
CHANGE TOTAL:                               3.26
Cash HNL (L75.00)                           3.26
================================================

Template:

[LAYOUT]
<J00>{TICKET DATE} {TICKET TIME}|Server: {USER NAME}  #{TICKET NO}
{ENTITIES}
<EB>
[<L00>NOTE: [{NOTE}]]
<DB>
<F>-
{ORDERS}
<F>=
<EB>
<J00>Total:|(L[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL: }'))/TN('{EXCHANGE RATE:HNL}'))]) [=F(TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL: }'))]
<DB>
{DISCOUNTS}
[<J00>Total FREE:|(L-[=F(TN('{ORDER STATE TOTAL:Gift}')/TN('{EXCHANGE RATE:HNL}'))]) -{ORDER STATE TOTAL:Gift}]
[<J00>Discounts:|-[=F(TN('{ORDER TAG TOTAL:Discount}')+(-1*(TN('{ORDER TAG TOTAL:VIP Discount}')+TN('{ORDER TAG TOTAL:HH Discount}'))))]]
<EB>
[<J00>*** TOTAL SAVINGS:|-[=F((TN('{ORDER TAG TOTAL:Discount}')+(-1*(TN('{ORDER TAG TOTAL:VIP Discount}')+TN('{ORDER TAG TOTAL:HH Discount}')))+TN('{ORDER STATE TOTAL:Gift}')+(-1*TN('{CALCULATION TOTAL:Discount}'))))]]
<DB>
<F>=
<EB>
<J00>Subtotal:|(L[=F((TN('{TICKET TOTAL}')-TN('{TAX TOTAL}')-TN('{CALCULATION TOTAL:Round HNL +}'))/TN('{EXCHANGE RATE:HNL}'))]) [=F(TN('{TICKET TOTAL}')-TN('{TAX TOTAL}')-TN('{CALCULATION TOTAL:Round HNL +}'))]
<DB>
{TAXES}
<EB>
<J00>Tax Total:|(L[=F(TN('{TAX TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) [=F('{TAX TOTAL}')]
<DB>
{SERVICES}
<EB>
<J10>GRAND TOTAL:|(L[=F(Math.round(TN('{TICKET TOTAL}')/TN('{EXCHANGE RATE:HNL}')))]) [=F(TN('{TICKET TOTAL}'))]
<DB>
<L00>{CALL:num.numToSpanish('{TICKET TOTAL}','{EXCHANGE RATE:HNL}')} Lempira
<J00>XR:|([=F('{EXCHANGE RATE:HNL}','0.000000')]) [=F(1/TN('{EXCHANGE RATE:HNL}'))]
[<F>=
<J00>PAYMENT TOTAL:|(L[=F(TN('{PAYMENT TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) [=F(TN('{PAYMENT TOTAL}'))]]
{PAYMENTS}
[<L00>CC Info: {TICKET TAG:CCtype} ({TICKET TAG:CCdigits})]
<F>-
[<J00>[=(TN('{PAYMENT TOTAL}')-TN('{TICKET TOTAL}')) > 0 ? 'CHANGE TOTAL:|' + F(TN('{PAYMENT TOTAL}')-TN('{TICKET TOTAL}')) : '']
{CHANGES}
<F>=]
<EB>
<T>Tip/Propina
<C00>Suggested Amounts NOT INCLUDED!
<DB>
<J00>10%:|(L[=F(TN('{TICKET TOTAL}')/{EXCHANGE RATE:HNL} * 0.10)]) [=F(TN('{TICKET TOTAL}') * 0.10)]
<J00>15%:|(L[=F(TN('{TICKET TOTAL}')/{EXCHANGE RATE:HNL} * 0.15)]) [=F(TN('{TICKET TOTAL}') * 0.15)]
<J00>20%:|(L[=F(TN('{TICKET TOTAL}')/{EXCHANGE RATE:HNL} * 0.20)]) [=F(TN('{TICKET TOTAL}') * 0.20)]
<EB>
<C00>ALL TIPS go to our Awesome Staff!
<DB>
[<F>=
<J00>{TICKET TAG:GCN}|Balance: [=F(TN('{TICKET TAG:GCB}'))]]

[DISCOUNTS]
<J00>{CALCULATION NAME} {CALCULATION AMOUNT}:|(L[=F(TN('{CALCULATION TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) {CALCULATION TOTAL}

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

[PAYMENTS:Cash HNL]
<J00>{PAYMENT NAME} (L[=F(TN('{EXCHANGE AMOUNT}'))])|[=F('{PAYMENT AMOUNT}')]

[PAYMENTS:Credit Card HNL]
<J00>{PAYMENT NAME} (L[=F(TN('{EXCHANGE AMOUNT}'))])|{PAYMENT AMOUNT}

[PAYMENTS:Credit Card USD]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

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

[CHANGES:Cash USD]
<J00>{CHANGE PAYMENT NAME}|{CHANGE PAYMENT AMOUNT}

[CHANGES:Cash HNL]
<J00>{CHANGE PAYMENT NAME} (L[=F(Math.round(TN('{EXCHANGE AMOUNT}')))])|[=F('{CHANGE PAYMENT AMOUNT}')]

[ORDERS]
<L00>{CALL:str.pad('{QUANTITY}','right',2," ")} {CALL:str.pad('{NAME}','right',27," ")} {CALL:str.pad('{PRICE}','left',7," ")} {CALL:str.pad('{TOTAL PRICE}','left',9," ")}
{ORDER TAGS}

[ORDERS:Gift]
<L00>{CALL:str.pad('{QUANTITY}','right',2," ")} {CALL:str.pad('{NAME}','right',27," ")} {CALL:str.pad('{PRICE}','left',7," ")} {CALL:str.pad('**FREE**','left',9," ")}
{SORTED ORDER TAGS}

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

[ORDER TAGS:Special Modifiers]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:ExtraAddons]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:SideServings]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:Discount]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:VIP Discount]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:HH Discount]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

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

[ENTITIES:Customer]
<J00>Cust: {ENTITY NAME}|Bal: {ENTITY BALANCE}

[TAXES]
<J00>Tax {TAX NAME} ({TAX RATE}%):|(L[=F(TN('{TAX AMOUNT}')/TN('{EXCHANGE RATE:HNL}'))]) [=F('{TAX AMOUNT}')]

[SERVICES]
<J00>{CALCULATION NAME} ([=F(TN('{CALCULATION AMOUNT}'))]):|(L[=F(TN('{CALCULATION TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) [=F('{CALCULATION TOTAL}')]
1 Like

Very nice, thank you again @emre.

------------------------------------------------
11 Donair Wrap.Wrap              12.00    132.00
         SIDE Fries            
================================================
Total:                        (L3,036.00) 132.00
================================================
Subtotal:                     (L2,639.00) 114.74
Tax T1 (15%):                    (L396.00) 17.22
Tax Total:                       (L396.00) 17.22
Round HNL - (1.00):               (L-1.00) -0.04
GRAND TOTAL:                  (L3,035.00) 131.96
TRES MIL TREINTA Y CINCO Lempira
XR:                             (0.043478) 23.00
================================================
PAYMENT TOTAL:                (L3,110.00) 135.22
Cash USD                                   50.00
Cash USD                                   20.00
Cash HNL (L1,000.00)                       43.48
Cash HNL (L500.00)                         21.74
------------------------------------------------
CHANGE TOTAL:                               3.26
Cash HNL (L75.00)                           3.26
================================================

Template:

[LAYOUT]
<J00>{TICKET DATE} {TICKET TIME}|Server: {USER NAME}  #{TICKET NO}
{ENTITIES}
<EB>
[<L00>NOTE: [{NOTE}]]
<DB>
<F>-
{ORDERS}
<F>=
<EB>
<J00>Total:|(L[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL: }'))/TN('{EXCHANGE RATE:HNL}'))]) [=F(TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL: }'))]
<DB>
{DISCOUNTS}
[<J00>Total FREE:|(L-[=F(TN('{ORDER STATE TOTAL:Gift}')/TN('{EXCHANGE RATE:HNL}'))]) -{ORDER STATE TOTAL:Gift}]
[<J00>Discounts:|-[=F(TN('{ORDER TAG TOTAL:Discount}')+(-1*(TN('{ORDER TAG TOTAL:VIP Discount}')+TN('{ORDER TAG TOTAL:HH Discount}'))))]]
<EB>
[<J00>*** TOTAL SAVINGS:|-[=F((TN('{ORDER TAG TOTAL:Discount}')+(-1*(TN('{ORDER TAG TOTAL:VIP Discount}')+TN('{ORDER TAG TOTAL:HH Discount}')))+TN('{ORDER STATE TOTAL:Gift}')+(-1*TN('{CALCULATION TOTAL:Discount}'))))]]
<DB>
<F>=
<EB>
<J00>Subtotal:|(L[=F((TN('{TICKET TOTAL}')-TN('{TAX TOTAL}')-TN('{CALCULATION TOTAL:Round HNL +}'))/TN('{EXCHANGE RATE:HNL}'))]) [=F(TN('{TICKET TOTAL}')-TN('{TAX TOTAL}')-TN('{CALCULATION TOTAL:Round HNL +}'))]
<DB>
{TAXES}
<EB>
<J00>Tax Total:|(L[=F(TN('{TAX TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) [=F('{TAX TOTAL}')]
<DB>
{SERVICES}
<EB>
<J10>GRAND TOTAL:|(L[=F(Math.round(TN('{TICKET TOTAL}')/TN('{EXCHANGE RATE:HNL}')))]) [=F(TN('{TICKET TOTAL}'))]
<DB>
<L00>{CALL:num.numToSpanish('{TICKET TOTAL}','{EXCHANGE RATE:HNL}')} Lempira
<J00>XR:|([=F('{EXCHANGE RATE:HNL}','0.000000')]) [=F(1/TN('{EXCHANGE RATE:HNL}'))]
[<F>=
<J00>PAYMENT TOTAL:|(L[=F(TN('{PAYMENT TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) [=F(TN('{PAYMENT TOTAL}'))]]
{PAYMENTS}
[<L00>CC Info: {TICKET TAG:CCtype} ({TICKET TAG:CCdigits})]
<F>-
[<J00>[=(TN('{PAYMENT TOTAL}')-TN('{TICKET TOTAL}')) > 0 ? 'CHANGE TOTAL:|' + F(TN('{PAYMENT TOTAL}')-TN('{TICKET TOTAL}')) : '']
{CHANGES}
<F>=]
<EB>
<T>Tip/Propina
<C00>Suggested Amounts NOT INCLUDED!
<DB>
<J00>10%:|(L[=F(TN('{TICKET TOTAL}')/{EXCHANGE RATE:HNL} * 0.10)]) [=F(TN('{TICKET TOTAL}') * 0.10)]
<J00>15%:|(L[=F(TN('{TICKET TOTAL}')/{EXCHANGE RATE:HNL} * 0.15)]) [=F(TN('{TICKET TOTAL}') * 0.15)]
<J00>20%:|(L[=F(TN('{TICKET TOTAL}')/{EXCHANGE RATE:HNL} * 0.20)]) [=F(TN('{TICKET TOTAL}') * 0.20)]
<EB>
<C00>ALL TIPS go to our Awesome Staff!
<DB>
[<F>=
<J00>{TICKET TAG:GCN}|Balance: [=F(TN('{TICKET TAG:GCB}'))]]

[DISCOUNTS]
<J00>{CALCULATION NAME} {CALCULATION AMOUNT}:|(L[=F(TN('{CALCULATION TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) {CALCULATION TOTAL}

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

[PAYMENTS:Cash HNL]
<J00>{PAYMENT NAME} (L[=F(TN('{EXCHANGE AMOUNT}'))])|[=F('{PAYMENT AMOUNT}')]

[PAYMENTS:Credit Card HNL]
<J00>{PAYMENT NAME} (L[=F(TN('{EXCHANGE AMOUNT}'))])|{PAYMENT AMOUNT}

[PAYMENTS:Credit Card USD]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

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

[CHANGES:Cash USD]
<J00>{CHANGE PAYMENT NAME}|{CHANGE PAYMENT AMOUNT}

[CHANGES:Cash HNL]
<J00>{CHANGE PAYMENT NAME} (L[=F(Math.round(TN('{EXCHANGE AMOUNT}')))])|[=F('{CHANGE PAYMENT AMOUNT}')]

[ORDERS]
<L00>{CALL:str.pad('{QUANTITY}','right',2," ")} {CALL:str.pad('{NAME}','right',27," ")} {CALL:str.pad('{PRICE}','left',7," ")} {CALL:str.pad('{TOTAL PRICE}','left',9," ")}
{ORDER TAGS}

[ORDERS:Gift]
<L00>{CALL:str.pad('{QUANTITY}','right',2," ")} {CALL:str.pad('{NAME}','right',27," ")} {CALL:str.pad('{PRICE}','left',7," ")} {CALL:str.pad('**FREE**','left',9," ")}
{SORTED ORDER TAGS}

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

[ORDER TAGS:Special Modifiers]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:ExtraAddons]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:SideServings]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:Discount]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:VIP Discount]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

[ORDER TAGS:HH Discount]
<L00>    [=(TN('{ORDER TAG QUANTITY}') > 1 ? ' {ORDER TAG QUANTITY}x ' : '    ')] {CALL:str.pad('{ORDER TAG NAME}','right',20," ")} [=TN('{ORDER TAG PRICE}')!=0 ? '{CALL:str.pad('{ORDER TAG PRICE}','left',8," ")}' : ''] [=TN('{ORDER TAG PRICE}')!=0 ? ("         "+F((TN('{QUANTITY}')*TN('{ORDER TAG TOTAL PRICE}')),'0.00')).slice(-9) : '']

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

[ENTITIES:Customer]
<J00>Cust: {ENTITY NAME}|Bal: {ENTITY BALANCE}

[TAXES]
<J00>Tax {TAX NAME} ({TAX RATE}%):|(L[=F(TN('{TAX AMOUNT}')/TN('{EXCHANGE RATE:HNL}'))]) [=F('{TAX AMOUNT}')]

[SERVICES]
<J00>{CALCULATION NAME} ([=F(TN('{CALCULATION AMOUNT}'))]):|(L[=F(TN('{CALCULATION TOTAL}')/TN('{EXCHANGE RATE:HNL}'))]) [=F('{CALCULATION TOTAL}')]
1 Like

This is working really great. Now I am trying to get some better formatting for the output.

Regarding Justification, I want to make this look better:

================================================
Total:                        (L3,036.00) 132.00
================================================
Subtotal:                     (L2,640.00) 114.78
Tax T1 (15%):                    (L396.00) 17.22
Tax Total:                      (L396.00)  17.22
GRAND TOTAL:                  (L3,036.00) 132.00
TRES MIL TREINTA Y SEIS Lempira                 
XR:                            (0.043478)  23.00
================================================
PAYMENT TOTAL:                (L3,110.00) 135.22
Cash USD                                   20.00
Cash HNL (L1,000.00)                       43.48
Credit Card HNL (L500.00)                  21.74
Credit Card USD                            50.00
------------------------------------------------
CHANGE TOTAL:                               3.22
Cash USD                                    0.17
Cash HNL (L70.00)                           3.04
================================================

Trying to force justification to always be padded left to 9 characters:

================================================
Total:                      (L3,036.00)   132.00
================================================
Subtotal:                   (L2,640.00)   114.78
Tax T1 (15%):                 (L396.00)    17.22
Tax Total:                    (L396.00)    17.22
GRAND TOTAL:                (L3,036.00)   132.00
TRES MIL TREINTA Y SEIS Lempira                 
XR:                         (0.043478)     23.00
================================================
PAYMENT TOTAL:              (L3,110.00)   135.22
Cash USD                                   20.00
Cash HNL (L1,000.00)                       43.48
Credit Card HNL (L500.00)                  21.74
Credit Card USD                            50.00
------------------------------------------------
CHANGE TOTAL:                               3.22
Cash USD                                    0.17
Cash HNL (L70.00)                           3.04
================================================

This is what I am trying for the SubTotal line, but it does not work. I think the parser is getting confused with the nesting:

<J00>Subtotal:|(L[=F((TN('{TICKET TOTAL}')-TN('{TAX TOTAL}')-TN('{CALCULATION TOTAL:Round HNL +}'))/TN('{EXCHANGE RATE:HNL}'))]) [={CALL:str.pad( (F(TN('{TICKET TOTAL}')-TN('{TAX TOTAL}')-TN('{CALCULATION TOTAL:Round HNL +}'))) ,'left','9'," ")}]

That produces this:

Subtotal:                     (L2,640.00) [=]

@emre, is there are simpler way to do this? Maybe I should switch to HTML Printer and just use <table> tags and be done with it?

I think I made something that will solve all padding related issues. Inspired from report table definitions I implemented W tag that allows defining padding and alignment of columns.

That will be available on next refresh.

2 Likes

@emre, what can we use in the Printer Template to show that the Change Amount was applied as a Credit to a Customer Account?

For example, we have these Change Payment Types, but they are filtered in the Template using the Account Name:

[CHANGES:Cash USD]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|||$|{CHANGE PAYMENT AMOUNT}

[CHANGES:Cash HNL]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|L|[=F(Math.round(TN('{EXCHANGE AMOUNT}')))]|$|[=F('{CHANGE PAYMENT AMOUNT}')]

However, when Templating Change Payment Type using a Customer Account, we don’t know the Account Name because the Customer Account Name is “dynamic”:

[CHANGES:Customer Account]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|L|[=F(Math.round(TN('{EXCHANGE AMOUNT}')))]|$|[=F('{CHANGE PAYMENT AMOUNT}')]

EDIT: this seems to work (the last section). Testing more …

[CHANGES:Cash USD]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|||$|{CHANGE PAYMENT AMOUNT}

[CHANGES:Cash HNL]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|L|[=F(Math.round(TN('{EXCHANGE AMOUNT}')))]|$|[=F('{CHANGE PAYMENT AMOUNT}')]

[CHANGES]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|L|[=F(Math.round(TN('{CHANGE PAYMENT AMOUNT}')/TN('{EXCHANGE RATE:HNL}')))]|$|[=F('{CHANGE PAYMENT AMOUNT}')]

Trying to test above Template by issuing Change as partially Cash (30) and Partially Customer Account Credit (8).

Does not seem to be working, and I cannot figure out what is going on here …


I must be missing something in the Change Transaction Type for Customer Accounts. This is how I have it configured, and it seems to be the only way to get the Customer Account Credit to appear as a Change Payment Type:

I’m surprised!! How you didn’t noticed that haha.

OK j/k. This is needed as we don’t have a default account.

1 Like

The Default Currency is USD so it is not defined. Only the foreign Currency HNL is defined.

@emre, Customer Accounts and Transactions should use the Default Currency, which is not listed there, because it is not defined.

1 Like

Just for testing can you create a backup (lol not for me) and try adding a foreign currency for default currency with Exchange Rate 1 ? You may have better control with that setup.

OK I was dealing with something* so I missed the point. Both change templates are in default currency so that might just be a button paint issue. Did you tried clicking on last 38 button? What it does?

  • the thing I’m dealing with is … when I change my system date to test virtual work periods visual studio seems to ignore changes I did on code and just compile the version before I changed the system date. Changing system date and editing code confuses it. I wasted a lot of time before noticing that.

btw I’m wondering where @mjb2000 is. Matt did you gave up?

I have 4 Change Transactions and 4 Change Templates - 2 are using Default Currency (USD), and 2 are using Foreign Currency (HNL). However, I will probably not use the last Change Template (Credit Customer HNL) so I do not have it mapped right now.


It credits the Customer Account for 38 (USD). It displays “Credit Customer Account: 38.00”, and the Accounts screen reflects the same. But since I type “30” then USD Change button, I expected it to Credit Customer Account only 8 (USD), and have no HNL Change dispensed.

1 Like

OK. There is a problem there. I’m checking it.

Ok, tried that.

I set both Cash USD and Credit Account USD Transaction Types to USD Currency:

It does as expected according to Accounts and Transactions:

P.S. It behaves the same way if I leave Cash USD Transaction set to blank. Only Credit Account needs USD Currency set.


Not too sure on the way it displays the operation (green button indicates about to click). It is the 3rd step in this sequence that is confusing to me by what it displays. Maybe the “30” amounts on the first and last buttons should be (bracketed) to indicate the value has been removed? And to be consistent, the middle button could display in the same format as the first and last button? (I sort of see why it doesn’t but…)

How it looks?

When $2.00 of $3.51 set.

1 Like

Ok? LOL.

I notice there is no currency symbol for Account Credit, so I assume you “fixed” it so we don’t need to set Default Currency and can leave it blank for that Tx Type? Or have you just not defined a format for the currency (ie. $ {0:N})

Total is 6.49 and you Tendered 10?
Type “2” (shown bracketed to indicate change being paid) with remaining amount shown last (1.51)
Now click on middle button - what does it show then? That is the part that confused me.

It shows Change Amount 3.51. This is a silly operation as you (operator lol) starts splitting change amount but selected main currency on all steps.

[quote=“QMcKay, post:138, topic:13051”]
so I assume you “fixed” it so we don’t need to set Default Currency and can leave it blank for that Tx Type?
[/quote]Yes I fixed it.

I’m uploading it… Done!

1 Like

Looks great @emre ! Works very well.

I switched Customer Account Credit Transaction Type back to blank and deleted the USD “default” Currency.


Printing Change Amounts using these Sections - the last one handle Customer Account Credits:

[CHANGES:Cash USD]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|||$|{CHANGE PAYMENT AMOUNT}

[CHANGES:Cash HNL]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|L|[=F(Math.round(TN('{EXCHANGE AMOUNT}')))]|$|[=F('{CHANGE PAYMENT AMOUNT}')]

[CHANGES]
<W00:27, 2, 9, 3, 7>{CHANGE PAYMENT NAME}|L|[=F(Math.round(TN('{CHANGE PAYMENT AMOUNT}')/TN('{EXCHANGE RATE:HNL}')))]|$|[=F('{CHANGE PAYMENT AMOUNT}')]

So when I split the Change Amount between Cash USD and Account Credit, this is produced:


It might seem silly, but my Customers do this frequently. Sometimes they pay and want Change to go on Account as Credit. Sometimes they want all Cash.

But now and then I run into this scenario: their Account is overdrawn (they owe from a previous visit), they pay and want Credit applied to the Account to settle it to 0.00 and receive the rest of the Change in Cash. That way they walk away with a clear Account and the remainder in Cash. Happens quite a bit.

For example, this video shows a Customer Account that owes $5. So they pay the $76 Bill by Tendering $100 giving them $24 Change. They use some of the Change (5) to zero their Account and take the rest of the Change in Cash (19).