Account Document Type Exchange Rate / Template ... what is it?

@emre, what is Exchange Rate parameter for in Account Document Types? Does it do anything?

I notice the field in the DB is nvarchar so it wouldn’t be used for any calculations, unless maybe it tries to match the characters entered here to a Currency Template Name to get an Exchange Rate and then it does something?

I guess I am more curious to know if it will have any affect on values in the Document, or if it is arbitrary and has no real use?

That is probably a lost feature. From what I can see from source code that overrides configured exchange rate for main account but I don’t remember for what case I’ve implemented it. Probably coming from V3.

I could make use of that field in my PHP Inventory as an indicator that the Document contains a Tx Type in a Foreign Currency, so I am curious to know if I set the field to “HNL” whether or not it will have any adverse affect on the system as it pertains to internal workings of SambaPOS?

As far as I can tell, for my purpose, it does not seem to do anything?

It does if a foreign currency assigned for selected supplier account. It uses typed exchange rate instead of the exchange rate taken from currency. I don’t know what the hell I was thinking while setting it up as a nvarchar? Hmm… Surprisingly code also expects a string value and converts it to decimal. It is probably to solve a very specific issue but I really don’t remember what was it.

1 Like

So if I put “HNL” in that field which cannot be converted to a number, does the code catch that and convert that to 0.00? Or to avoid possible divide-by-zero error, would it maybe convert it to 1.00?

It looks like if I have HNL in that parameter, then it ignores it entirely (no error occurs) because it cannot convert it… and that is fine for my use.

1 Like

It is OK if it works fine :slight_smile:

1 Like