-
-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3609 updated inventory in out queries to fetch data from KitAllocation (
#3737) * updated inventory in logic to save line_items instead of only kits * data migration added to fix kit_allocation inventory in * invetory out queries updated to include kit_allocations inventory_out * Inventory in queries updated to include kit_allocations inventory_in * in_items and out_items scopes added for items_in and items_out queries
- Loading branch information
1 parent
46ec021
commit 1a38904
Showing
17 changed files
with
135 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class LevelUpInvetoryIn < ActiveRecord::Migration[7.0] | ||
def change | ||
Rake::Task["kit_allocation:inventory_in"].invoke | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace :kit_allocation do | ||
desc "Level up inventory in to inventory out in kit_allocations" | ||
task inventory_in: :environment do |task| | ||
KitAllocation.where(kit_allocation_type: "inventory_in").destroy_all | ||
out_kit_allocations = KitAllocation.where(kit_allocation_type: "inventory_out") | ||
out_kit_allocations.each do |out_kit_allocation| | ||
in_kit_allocation = KitAllocation.create!(storage_location_id: out_kit_allocation.storage_location_id, | ||
organization_id: out_kit_allocation.organization_id, | ||
kit_id: out_kit_allocation.kit_id, | ||
kit_allocation_type: "inventory_in") | ||
out_kit_allocation.line_items.each do |line_item| | ||
in_kit_allocation.line_items.create!(item_id: line_item.item_id, quantity: line_item.quantity * -1) | ||
end | ||
end | ||
puts "Done..." | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.