Items pricing based on exchange rate

Hello guys,

Now we have the items pricing in our currency ( lebanese pound ) and the price of the lebanese pound keeps changing against the us dollars everyday! So everyday we change the price of all the items and it takes a lot of time, so is there a way to price our items in us dollars ( cz it will stay the same in us dollars ) and multiply all the prices by the exchange rate everyday? This way everyday we update the exchange rate instead of changing all the items prices.
Thank you

Hi @Comfnmb,

there are few moving parts in your request. Overall, you will need an integration with an exchange rate service to update your POS daily (or you can manually do this).

Some additional things you’d need:

  • tagging invoice with that days XE
  • templates that would multiply USD price with that days XE

@Posflow thank you for your reply, yeah we can update the exchange rate manually everyday, but where would i put the formula of multiplying the price with the exchange rate? Is it using actions and rules?

In Ticket Closing rule just put Update Ticket Tag action with your XE.

You would put the formula in your Ticket Template.

Would it not also be possible to make your main pricing in USD and instead add the Lebanese currency as a foreign currency which is calculated on the Settlement page? or do you need the customer’s bill to always show the individual pricing?

We have this same problem in Sri Lanka but we show the customer the USD price on our menus/bill as this assures them that we are staying regular in the reference currency. Our local currency is essentially just an option for payment calculated at the end

@Malcolm_Skinner yeah i need the customer’s bill to always show the individual pricing.

So this is what i did:
I added the Update Order action to the New Order Adding Rule

usd-prices

with Price: [=Order.Price*90000]
90000 is the current exchange rate.

And it worked really well except for the rounding issue.
For example, if i have an item priced at 4.25 usd, 4.25*90000 = 382,500
so the item is priced 382,500 and i want to round it to either 382,000 either 383,000
Any ideas?
Thank you guys

@Comfnmb

try this if you want to floor it at that nearest lower 1000.

[=Math.floor(Order.Price * XERate / 1000) * 1000]

[=Math.floor(Order.Price * 90000 / 1000) * 1000]

try this if you want to round it to nearest 1000

[=Math.round(Order.Price * XERate / 1000) * 1000]

[=Math.round(Order.Price * 90000 / 1000) * 1000]

It worked perfectly! Thanks a lot!
It worked with a restaurant with sambapos v5 i have another restaurant still using sambapos v4 so id/t didnt work there, any idea why?

I wouldn’t know exactly why, as I havent used V4 in over 5 years - but my best guess is that objects and their attributes, such as

Order.Price

were made available in v5 for Scripting engine.

Or something along the line of that.

Well no Order.Price works perfectly in V4 so i think the problem is with math.round

Math.round() is a function from ClearScript library which was added to add JScript capabilities in V5.

1 Like