lib/edi/repositories/ps_out_repo.rb
# Until the question of when pallets are in stock is properly defined, exclude pallets
# from stock for Kromco that are in certain locations.
Until the question of when pallets are in stock is properly defined, exclude pallets
from stock for Kromco that are in certain locations.
Until the question of when pallets are in stock is properly defined exclude pallets from stock for Kromco that are in certain locations .
def temporary_load_kr_exclusions
      long_codes = %w[RA_10 PACKHSE REWORKS BAGGING_REWORKS BAGGING_REWORKS35]
      exclude_top_level_ids = DB[:locations].where(location_long_code: long_codes).select_map(:id)
      qry = <<~SQL
        SELECT l.location_long_code
        FROM tree_locations t
        JOIN locations l ON l.id = t.descendant_location_id
        WHERE t.ancestor_location_id IN ?
      SQL
      DB[qry, exclude_top_level_ids].select_map
    end
def temporary_load_kr_exclusions long_codes = %w[ RA_10 PACKHSE REWORKS BAGGING_REWORKS BAGGING_REWORKS35 ] exclude_top_level_ids = DB [ :locations ] . where ( location_long_code : long_codes ) . select_map ( :id ) qry = <<~SQL 
        SELECT l.location_long_code
        FROM tree_locations t
        JOIN locations l ON l.id = t.descendant_location_id
        WHERE t.ancestor_location_id IN ?
       SQL DB [ qry , exclude_top_level_ids ] . select_map end
Until the question of when pallets are in stock is properly defined, exclude pallets
from stock for Kromco that are in certain locations.
Until the question of when pallets are in stock is properly defined exclude pallets from stock for Kromco that are in certain locations .