Module: InventoryExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/inventory_extensions.rb
Instance Method Summary collapse
-
#mesonic_price(customer_id: nil) ⇒ Object
— Instance Methods — #.
Instance Method Details
#mesonic_price(customer_id: nil) ⇒ Object
— Instance Methods — #
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/models/inventory_extensions.rb', line 12 def mesonic_price(customer_id: nil ) customer = User.find(customer_id) return nil unless customer && customer.erp_account_nr customer_prices = self.mesonic_prices.by_customer(customer.erp_account_nr) return customer_prices.first.price if customer_prices.any? # HAS 20140407 Was not active in Opensteam! # group_prices = self.mesonic_prices.by_group_through_customer(customer.erp_account_nr) # return group_prices.first.price if customer_prices.any? end |