Displaying 1 result from an estimated 1 matches for "margn".
Did you mean:
margin
2011 Feb 09
4
Modules being shared and model data
Have in a module in ./lib:
module Pricing
def sell_price
(cost.to_f)/((100-(margn.to_f))/100)
end
def sell_price_inc
((product.cost.to_f)/((100-(product.margn.to_f))/100)*1.14)
end
def charge_excl
(sell_price).to_f * quantity
end
end
A model product:
class Product < ActiveRecord::Base
include Pricing
attr_accessible :name, :code, :cost, :company_id, :...