3 Replies Latest reply: Jul 8, 2016 6:43 AM by Iskander Smagulov RSS

    Product movement from one stock to another

    Iskander Smagulov

      Hi guys!

      I have very important issue, please give an advice how to solve.

       

      For example, I have 5 stocks. And some products in it. This is my table:

      ProductShop1Shop2Shop3Shop4Shop5Stock1
      SalesItem1543201
      Remainder030111

       

      Now I see that Shop1 has 0 of product Item1 but the shop made best sales.

      So, I have to take product from Stock1 (first of all - if there exist products) and put it to Shop1.

      Then I see that Shop2 has >0 remained products, so I skip it.

      Then I see Shop3 has 0 of product. Now I will take it from Shop5, because it had 0 sales.

       

      Finally I must have this table:

       

      ProductShop1Shop2Shop3Shop4Shop5Stock1
      SalesItem1543201
      Remainder030111
      Distributed131100

       

      How to make it?

      Please help