app/models/visma/customer.rb
# Find all discount agreements for given article number at a given date
Find all discount agreements for given article number at a given date
Find all discount agreements for given article number at a given date
def discounts_for(artno, at_date = Date.today)
      discounts = discount_agreements.at(at_date).for(artno)
      discounts += chain.discount_agreements.at(at_date).for(artno) if chain_member?
      discounts.uniq.sort_by(&:price)
    end
def discounts_for ( artno , at_date = Date . today ) discounts = discount_agreements . at ( at_date ) . for ( artno ) discounts += chain . discount_agreements . at ( at_date ) . for ( artno ) if chain_member? discounts . uniq . sort_by ( & :price ) end
Find all discount agreements for given article number at a given date
Find all discount agreements for given article number at a given date
artno
at_date
today