Transaction Total Price changes after saving

Dear @Emre, this is the first time I see this behaviour:

I enter my transaction as usual…

After that I close all trasnsaction screens… when I go back and do open the very same trasnsaction that I just added I realize that the Total changed… and I did NOT change it…

Is this correct? Why? Samba changed automatically my REAL purchase price.



What we store in database is Unit Price and as 8/12 is a infinite number (0.66666…) it rounds unit price while saving to database. Total always displays Quantity x Unit Price.

(20/6), (19/12) all too fractional… Hmm. Even we store 4 digits after decimal we won’t be able to calculate exact prices back…

I wondered doesn’t your supplier use a computer program to create the invoice? How unit prices appears on the invoice?

Hi @Emre… usually we dont buy by the unit, my supplier, and exactly that is why i found this, sells me a whole pack, 12 cans of coke at a price of 20… or 12 units of Itaipava at a price of 19… If I would buy only one or two units, the price changes… Thats why I found odd total price changing, when it never changed before.

this is realted to my other post: The one with inventory (I am on the phone and cannot copy past urls)



Before you were not defining default cost… you more than likely entered your total price and it filled in the rest… now that you defined default cost it is going to multiply units x unit price… it will not let you enter your own total because 1.58*12 does not =20 it = 18.96

Few versions ago it would crash if you entered wrong total… looks like @emre fixed that by making it fix itself.

I am usign transaction since day one…
when you enter unit price and not total it calculated total cost, when you entered something in total it calculated unit price.

now its working this way, just that after saving when you open the same transaction again, it does only one caclulation as if you would entered only unit price and does not take in account that i entered total price.

I dont know if you could follow my explanation… today I am not so good with words…


Its because you set the default cost




In your other post. You said so yourself. Maybe I am confused. You said This relates to your other post?

if you see my DEFAULT COST fields, they are empty…

what I did every time I made a transaction is either enter unit price or total price…
and SAMBA never changed either one…

that is what is struggling my mind… LOL!!!


Before if you entered both and one was wrong it would allow it but if you opened the report again it would crash. Now it just corrects it as it calculates total=unit price*units there was a long discussion about the crash.

I never had that crash problem… I, non intentionally never entered both… LOL!!!

If I only knew, jajajajajajajajajaj


OK. On next version I’ll round and update total immediately so you’ll notice the change. However this is a tricky issue because Unit Price can be 0,66 or 0,67. Both does not make 8 when multiplied by 12. It will be 7,92 or 8.04.

That will be an issue when we start saving transactions to supplier accounts. While implementing it I’ll allow manual correction of grand total.

Can you make this a toggle? I do not want it rounded. I pay exact prices to my suppliers.

I should round that while saving to database. Otherwise unit price becomes 0.666666666666666666 and I don’t know how much decimals I should store to be able to calculate exact price.

Maybe I am confused… what exactly are you changing?

He bought 12 items for $8.00. I’m trying to calculate 1 item price.

I understand that but I am having hard time understanding the change. When I type 12 items at 8.00 it comes back with .67… it is already rounding it isnt it?

OOOOOOHHHH I see it now… ok what was causing that if you don’t mind me asking? It is not updating database? It is just showing it with its own calculation?

EDIT: Sorry @gerlandog I was misunderstanding you.

1 Like

It would be better to know wich of the two values the user entered, so you save that one, and the other still would be a calculation…

in my case, at this time I did enter the total…

i bought 1 pack, or 6 units at a total price of 19…

tracking what the user entered would be a lot more work but 100% accurate…


I agree the calculation it uses should be based off the two manually entered values. So if you entered Total it should round Unit price… if you enter unit price it should round total…

1 Like

you do realize that this is the first time we agree at first sight??? LOL!!!
again, i just had a BIG caipirinha, and i am a little bit fuzzy… or, better, just HAPPPPPPYYYYYYYYYYYYYYYYYYYYYYYYYYYYY…