app/models/visma/customer.rb
# Return the correct price for a given article at a given date
Return the correct price for a given article at a given date
Return the correct price for a given article at a given date
def price_for(artno, at = Date.today)
      discounts_for(artno, at).min_by(&:price).price
    rescue NoMethodError
      nil
    end
def price_for ( artno , at = Date . today ) discounts_for ( artno , at ) . min_by ( & :price ) . price rescue NoMethodError nil end
Return the correct price for a given article at a given date
Return the correct price for a given article at a given date
artno
at
today