melx's avatar
Level 4

stock Items with location(store)

kindly i want a idea how can i do this in MY ACCOUNTS app as per below info.

i want to have an option to create items with store, lets say items 1 has a quantity -200 pcs, so i want to locate 100 pc to store 1 and 100 pc to store 2 in my DB

so i want an idea to relate the stock items table and store table.

keep in mind that i want store can be an option that means you can direct that pc to that store or not

0 likes
2 replies
Tray2's avatar

Not knowing exactly what you have tried but this is how I would do it.

Three tables.

  • stores
  • items
  • item_stores

The item_store table can be used in two different ways.

  1. It could contain one row per store and item with a quantity.
  2. It could contain one row per store item and every piece in the quantity.

Way 1. is the one I would use if the stock isn't transfered between store.

The table would look something like this for 1.

  • id
  • store_id
  • item_id
  • quantity

and for 2.

  • id
  • store_id
  • item_id
melx's avatar
Level 4

@tray2 , i want to archive during create items i need to able to allocate that items quantity either shop store or warehouse

Please or to participate in this conversation.