# Deposit not counted?

**URL:** <https://forum.foodcoops.net/t/deposit-not-counted/667>\
**Category:** Foodsoft Help\
**Created:** [May 9, 2024, 7:57pm UTC](https://forum.foodcoops.net/t/deposit-not-counted/667 "2024-05-09T19:57:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamaryns](https://forum.foodcoops.net/user_avatar/forum.foodcoops.net/hamaryns/32/85_2.png) [@hamaryns](https://forum.foodcoops.net/u/hamaryns)\
**Post date:** [May 9, 2024, 7:57pm UTC](https://forum.foodcoops.net/t/deposit-not-counted/667/1 "2024-05-09T19:57:11Z")

</div>

HI all,  
It seems like deposit is not counted when finishing an order. A product, say, Kombucha has a deposit of €0,25, but when I look at what is booked from a member’s account when I settle the order, I cannot see the deposit being subtracted.  
Am I doing something wrong, or is this a bug?  
Cheers, H.

---

<div class="post-metadata">

**Author:** ![twothreenine](https://forum.foodcoops.net/user_avatar/forum.foodcoops.net/twothreenine/32/36_2.png) [@twothreenine](https://forum.foodcoops.net/u/twothreenine)\
**Post date:** [May 12, 2024, 5:08pm UTC](https://forum.foodcoops.net/t/deposit-not-counted/667/2 "2024-05-12T17:08:54Z")

</div>

Hi and welcome to the Foodsoft community!

- Which Foodsoft version / deployment are you using? The global ([foodcoops.net](http://foodcoops.net)) hosting?

- How does the accounting menu look like for the respective order? In the _deposit_ column, you should see the deposit. Is this empty in your case?

---

<div class="post-metadata">

**Author:** ![hamaryns](https://forum.foodcoops.net/user_avatar/forum.foodcoops.net/hamaryns/32/85_2.png) [@hamaryns](https://forum.foodcoops.net/u/hamaryns)\
**Post date:** [May 23, 2024, 8:50am UTC](https://forum.foodcoops.net/t/deposit-not-counted/667/3 "2024-05-23T08:50:13Z")

</div>

- [app.foodcoops.net](http://app.foodcoops.net) indeed
- (Accounting = balans in Dutch?) When I sort on kombucha, I see almost the same as your example and indeed a deposit is listed.  
I do not know whether it has been set to 0 previously. Maybe the article was created without deposit and it was set later.

I have been counting around and it seems like the deposit is counted, but I cannot understand how the prices are calculated:  
net price: 2,35  
Gross: 2,83  
VAT: 9%  
deposit: 0,25  
our margin: 3,5%  
Price paid for one bottle: 2,93  
What I would find the logical way to calculate the price:  
2,35x1,035= 2,43 (add margin)  
2,43x1,09 = 2,65 (add VAT)  
2,65+0,25 = 2,90 (add deposit, deposit has not VAT and no margin)  
It seems like a margin is counted on the deposit as well, since then I get to 2,93:  
(2,35+,25)x1,09x1,035=2,93

So after all it seems to me this is a bug/feature and we have counted _too much_ for the deposit to our members (only a few cents, so no big deal, but still).

---

<div class="post-metadata">

**Author:** ![wvengen](https://forum.foodcoops.net/user_avatar/forum.foodcoops.net/wvengen/32/4_2.png) [@wvengen](https://forum.foodcoops.net/u/wvengen)\
**Post date:** [May 23, 2024, 9:25am UTC](https://forum.foodcoops.net/t/deposit-not-counted/667/4 "2024-05-23T09:25:12Z")

</div>

I vaguely remember that we did some things related to tax, margin an deposit in the fcadam fork. Maybe this commit is still of use - [allow to configure pricing models (also closes foodcoop-adam#140) · foodcoop-adam/foodsoft@bad67e0 · GitHub](https://github.com/foodcoop-adam/foodsoft/commit/bad67e0cd7bbcaf13dde6efb8b105541f2640067) and the [`ArticlePrice` model](https://github.com/foodcoop-adam/foodsoft/blob/beta/app/models/article_price.rb) with some documentation. Note that foodcoops/foodsoft has a fixed computation model (I think with VAT over deposit and margin, but please check).

(and yes, _accounting_ is translated as _balans_ in Dutch, afaik)

---

<div class="post-metadata">

**Author:** ![twothreenine](https://forum.foodcoops.net/user_avatar/forum.foodcoops.net/twothreenine/32/36_2.png) [@twothreenine](https://forum.foodcoops.net/u/twothreenine)\
**Post date:** [May 28, 2024, 4:48pm UTC](https://forum.foodcoops.net/t/deposit-not-counted/667/5 "2024-05-28T16:48:47Z")

</div>

The price calculation ([code](https://github.com/foodcoops/foodsoft/blob/ad05870669af3fc634209ac4c540ab6883174a11/app/models/concerns/price_calculation.rb)) formula is:

**`gross price = (net price + deposit) * 1.xx`**  
**`fc price = (net price + deposit) * 1.xx * 1.yy`**  
_`xx = VAT in %, yy = markup/margin in %`_

> [@hamaryns](#):
>
> deposit has not VAT and no margin

I guess tax laws may vary from country to country, but we have a German supplier who charges VAT on deposit (B2B net prices). Edit: I just noticed that supplier charges a different tax rate on deposit (full VAT) that on the article itself (reduced VAT) but Foodsoft only allows one VAT rate for both and I always used the reduced rate. 😅  
Most suppliers send us gross prices anyway, so we usually set VAT to 0.

> [@wvengen](#):
>
> [allow to configure pricing models](https://github.com/foodcoop-adam/foodsoft/commit/bad67e0cd7bbcaf13dde6efb8b105541f2640067)

Something like that would be awesome, but I think we should wait until the article unit fork is merged.
