[Skip to main content](#vessel-content)

#   Bug with Stock Management?

##

- **[jsent](/forum/user/59522-jsent "View jsent's Profile")**
- [![jsent's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59522-jsent "View jsent's Profile") Topic Author
- [ Offline](/forum/user/59522-jsent)

Less More

- Posts: 3
- Thank you received: 0
-
-

6 years 5 months ago [\#321058](#321058) by [jsent](/forum/user/59522-jsent "View jsent's Profile")  *[Bug with Stock Management?](/forum/35-orders-management/900234-bug-with-stock-management#321058 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.4.6 -- Browser(s) name and version -- : Chrome 83.0.4103.106  Hi  We're setting up a new shop with Hikashop Business, but we're not selling the items but rent them. So all items need to be put back in stock when the order is finished. I've just set up the stock management so items are substracted from stock when the order is created and added again when the order gets a status with &quot;cancelled&quot; (eg &quot;Items returned&quot;, &quot;Order cancelled&quot;, ...). That part actually works fine.  What I got issues is when I played around with the status and didn't follow the regular expected status ordering. So when I (accidentally) set the order to a &quot;cancelled&quot; status and then back to a &quot;non-cancelled&quot; status, or when I go from the &quot;created&quot; to &quot;confirmed&quot; and then back to &quot;created&quot;, the stock management doesn't calculate the amount anymore correctly. I've ended up several times where the items where substraced permanently and I couldn't get them in stock again using the order statuses.  What I would expect is that items are substracted each time I go from a &quot;cancelled&quot; status to &quot;non-cancelled&quot; and added again when going the other way.  Now I'm not sure if I messed up something with the config or if that is a bug in HikaShop stock management or if my expections are wrong. I didn't find much in the docs on how it is supposed to work exactly. So any help is appreciated. I would also be able to write a plugin if that's how it can be done.  Kind regards Thomas")* was created by *[jsent](/forum/user/59522-jsent "View jsent's Profile")*

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.4.6
-- Browser(s) name and version -- : Chrome 83.0.4103.106

Hi

We're setting up a new shop with Hikashop Business, but we're not selling the items but rent them. So all items need to be put back in stock when the order is finished.
I've just set up the stock management so items are substracted from stock when the order is created and added again when the order gets a status with "cancelled" (eg "Items returned", "Order cancelled", ...).
That part actually works fine.

What I got issues is when I played around with the status and didn't follow the regular expected status ordering. So when I (accidentally) set the order to a "cancelled" status and then back to a "non-cancelled" status, or when I go from the "created" to "confirmed" and then back to "created", the stock management doesn't calculate the amount anymore correctly. I've ended up several times where the items where substraced permanently and I couldn't get them in stock again using the order statuses.

What I would expect is that items are substracted each time I go from a "cancelled" status to "non-cancelled" and added again when going the other way.

Now I'm not sure if I messed up something with the config or if that is a bug in HikaShop stock management or if my expections are wrong.
I didn't find much in the docs on how it is supposed to work exactly. So any help is appreciated.
I would also be able to write a plugin if that's how it can be done.

Kind regards
Thomas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMDIzNC1idWctd2l0aC1zdG9jay1tYW5hZ2VtZW50P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

6 years 5 months ago [\#321085](#321085) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Bug with Stock Management?](/forum/35-orders-management/900234-bug-with-stock-management#321085 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.4.6 -- Browser(s) name and version -- : Chrome 83.0.4103.106  Hi  We're setting up a new shop with Hikashop Business, but we're not selling the items but rent them. So all items need to be put back in stock when the order is finished. I've just set up the stock management so items are substracted from stock when the order is created and added again when the order gets a status with &quot;cancelled&quot; (eg &quot;Items returned&quot;, &quot;Order cancelled&quot;, ...). That part actually works fine.  What I got issues is when I played around with the status and didn't follow the regular expected status ordering. So when I (accidentally) set the order to a &quot;cancelled&quot; status and then back to a &quot;non-cancelled&quot; status, or when I go from the &quot;created&quot; to &quot;confirmed&quot; and then back to &quot;created&quot;, the stock management doesn't calculate the amount anymore correctly. I've ended up several times where the items where substraced permanently and I couldn't get them in stock again using the order statuses.  What I would expect is that items are substracted each time I go from a &quot;cancelled&quot; status to &quot;non-cancelled&quot; and added again when going the other way.  Now I'm not sure if I messed up something with the config or if that is a bug in HikaShop stock management or if my expections are wrong. I didn't find much in the docs on how it is supposed to work exactly. So any help is appreciated. I would also be able to write a plugin if that's how it can be done.  Kind regards Thomas")*

Hi,

If you have the setting "Update the product stock on confirmed status" turned off, then the stock will only be decreased when an order is created.
And then, if you change its status to a cancelled status, it will give back the stock.
There is no mechanism in such case to decrease again the stock if you go from a cancelled status to the created status.

With that option turned off, the stock will only be decreased when an order goes from the "created" status to a confirmed status. And it will give it back if you go from a confirmed status to a cancelled status. So in that case, you can do full circles going:
created -&gt; confirmed -&gt; refunded -&gt; created -&gt; confirmed -&gt; refunded -&gt; created ...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMDIzNC1idWctd2l0aC1zdG9jay1tYW5hZ2VtZW50P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jsent](/forum/user/59522-jsent "View jsent's Profile")**
- [![jsent's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59522-jsent "View jsent's Profile") Topic Author
- [ Offline](/forum/user/59522-jsent)

Less More

- Posts: 3
- Thank you received: 0
-
-

6 years 5 months ago [\#321101](#321101) by [jsent](/forum/user/59522-jsent "View jsent's Profile")  Replied by *[jsent](/forum/user/59522-jsent "View jsent's Profile")* on topic *[Bug with Stock Management?](/forum/35-orders-management/900234-bug-with-stock-management#321101 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.4.6 -- Browser(s) name and version -- : Chrome 83.0.4103.106  Hi  We're setting up a new shop with Hikashop Business, but we're not selling the items but rent them. So all items need to be put back in stock when the order is finished. I've just set up the stock management so items are substracted from stock when the order is created and added again when the order gets a status with &quot;cancelled&quot; (eg &quot;Items returned&quot;, &quot;Order cancelled&quot;, ...). That part actually works fine.  What I got issues is when I played around with the status and didn't follow the regular expected status ordering. So when I (accidentally) set the order to a &quot;cancelled&quot; status and then back to a &quot;non-cancelled&quot; status, or when I go from the &quot;created&quot; to &quot;confirmed&quot; and then back to &quot;created&quot;, the stock management doesn't calculate the amount anymore correctly. I've ended up several times where the items where substraced permanently and I couldn't get them in stock again using the order statuses.  What I would expect is that items are substracted each time I go from a &quot;cancelled&quot; status to &quot;non-cancelled&quot; and added again when going the other way.  Now I'm not sure if I messed up something with the config or if that is a bug in HikaShop stock management or if my expections are wrong. I didn't find much in the docs on how it is supposed to work exactly. So any help is appreciated. I would also be able to write a plugin if that's how it can be done.  Kind regards Thomas")*

Thanks for the feedback. That's great!

Do you know what happens if the "created" status also has "confirmed" flag? Does that work as well? I mean does it test specific for "created" -&gt; "confirmed" or doesn't it matter from which status you get to the "confirmed" one (eg does refunded -&gt; confirmed work as well)?

&gt; And it will give it back if you go from a confirmed status to a cancelled status.

Does that mean it will only decrease if I do directly from the "confirmed" status to a "cancelled" one? Or may there be other status used in between which don't have the "confirmed" flag (since that flag can only be set for one status).

I currently have the setting turned off.
From what I understood that should always give back the items once I get to a cancelled status, no matter what statuses are selected in between or afterwards. Which would work fine for us actually.

With this setting I still sometimes got weird results (not always). I'm not yet sure when it happens.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMDIzNC1idWctd2l0aC1zdG9jay1tYW5hZ2VtZW50P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

6 years 5 months ago [\#321112](#321112) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Bug with Stock Management?](/forum/35-orders-management/900234-bug-with-stock-management#321112 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.4.6 -- Browser(s) name and version -- : Chrome 83.0.4103.106  Hi  We're setting up a new shop with Hikashop Business, but we're not selling the items but rent them. So all items need to be put back in stock when the order is finished. I've just set up the stock management so items are substracted from stock when the order is created and added again when the order gets a status with &quot;cancelled&quot; (eg &quot;Items returned&quot;, &quot;Order cancelled&quot;, ...). That part actually works fine.  What I got issues is when I played around with the status and didn't follow the regular expected status ordering. So when I (accidentally) set the order to a &quot;cancelled&quot; status and then back to a &quot;non-cancelled&quot; status, or when I go from the &quot;created&quot; to &quot;confirmed&quot; and then back to &quot;created&quot;, the stock management doesn't calculate the amount anymore correctly. I've ended up several times where the items where substraced permanently and I couldn't get them in stock again using the order statuses.  What I would expect is that items are substracted each time I go from a &quot;cancelled&quot; status to &quot;non-cancelled&quot; and added again when going the other way.  Now I'm not sure if I messed up something with the config or if that is a bug in HikaShop stock management or if my expections are wrong. I didn't find much in the docs on how it is supposed to work exactly. So any help is appreciated. I would also be able to write a plugin if that's how it can be done.  Kind regards Thomas")*

Hi,

It tests that the status is changed from the status selected under the "created" column of the order statuses menu to one of the statuses under the "invoice" column.
So from "refunded" to "confirmed" it won't do anything as it doesn't know what should be done. If you want to make it work, you need to do it in two steps: refunded-&gt;created-&gt;confirmed

If you go from confirmed to cancelled, it won't decrease the stock, it will increase it.
And that's not only that. From any status in the "invoice" column to any status in the "cancelled" column, it will increase (restore) it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMDIzNC1idWctd2l0aC1zdG9jay1tYW5hZ2VtZW50P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jsent](/forum/user/59522-jsent "View jsent's Profile")**
- [![jsent's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59522-jsent "View jsent's Profile") Topic Author
- [ Offline](/forum/user/59522-jsent)

Less More

- Posts: 3
- Thank you received: 0
-
-

6 years 5 months ago [\#321141](#321141) by [jsent](/forum/user/59522-jsent "View jsent's Profile")  Replied by *[jsent](/forum/user/59522-jsent "View jsent's Profile")* on topic *[Bug with Stock Management?](/forum/35-orders-management/900234-bug-with-stock-management#321141 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.4.6 -- Browser(s) name and version -- : Chrome 83.0.4103.106  Hi  We're setting up a new shop with Hikashop Business, but we're not selling the items but rent them. So all items need to be put back in stock when the order is finished. I've just set up the stock management so items are substracted from stock when the order is created and added again when the order gets a status with &quot;cancelled&quot; (eg &quot;Items returned&quot;, &quot;Order cancelled&quot;, ...). That part actually works fine.  What I got issues is when I played around with the status and didn't follow the regular expected status ordering. So when I (accidentally) set the order to a &quot;cancelled&quot; status and then back to a &quot;non-cancelled&quot; status, or when I go from the &quot;created&quot; to &quot;confirmed&quot; and then back to &quot;created&quot;, the stock management doesn't calculate the amount anymore correctly. I've ended up several times where the items where substraced permanently and I couldn't get them in stock again using the order statuses.  What I would expect is that items are substracted each time I go from a &quot;cancelled&quot; status to &quot;non-cancelled&quot; and added again when going the other way.  Now I'm not sure if I messed up something with the config or if that is a bug in HikaShop stock management or if my expections are wrong. I didn't find much in the docs on how it is supposed to work exactly. So any help is appreciated. I would also be able to write a plugin if that's how it can be done.  Kind regards Thomas")*

Ah, that helps a lot. I missed the part that the Invoice column plays a role in stock management as well.
I see that there is a hint in the english tooltip about it, but it's missing in the german one. So that's probably why I didn't see it.

Thanks a lot for the explanations!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMDIzNC1idWctd2l0aC1zdG9jay1tYW5hZ2VtZW50P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.087 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
