Skip to content

Commit

Permalink
Inactive item and discarded storage location to have 0 inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
lit-poks committed Oct 11, 2024
1 parent 05996bf commit 1d4acc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def random_record_for_org(org, klass)
#
# Define all the InventoryItem for each of the StorageLocation
#
StorageLocation.all.each do |sl|
StorageLocation.active_locations.each do |sl|
sl.organization.items.active.each do |item|
InventoryItem.create!(
storage_location: sl,
Expand Down Expand Up @@ -606,7 +606,7 @@ def seed_quantity(item_name, organization, storage_location, quantity)
20.times.each do
issued_at = dates_generator.next

storage_location = random_record_for_org(pdx_org, StorageLocation)
storage_location = StorageLocation.active_locations.sample
stored_inventory_items_sample = inventory.storage_locations[storage_location.id].items.values.sample(20)
delivery_method = Distribution.delivery_methods.keys.sample
shipping_cost = delivery_method == "shipped" ? (rand(20.0..100.0)).round(2).to_s : nil
Expand Down Expand Up @@ -700,7 +700,7 @@ def seed_quantity(item_name, organization, storage_location, quantity)

25.times do
purchase_date = dates_generator.next
storage_location = random_record_for_org(pdx_org, StorageLocation)
storage_location = StorageLocation.active_locations.sample
vendor = random_record_for_org(pdx_org, Vendor)
purchase = Purchase.new(
purchased_from: suppliers.sample,
Expand Down

0 comments on commit 1d4acc6

Please sign in to comment.