Skip to content

Instantly share code, notes, and snippets.

@jamie
Created March 1, 2011 21:22
Show Gist options
  • Save jamie/849928 to your computer and use it in GitHub Desktop.
Save jamie/849928 to your computer and use it in GitHub Desktop.
def total_price
tp = Money.new(0.0, appropriate_package.base_price_currency)
puts "tp = #{tp.currency} #{tp.inspect}"
addon_packages.each do |pkg|
puts "pkg.base_price = #{pkg.base_price.currency} #{pkg.base_price}"
tax = pkg.tax_price(state_or_province).exchange_to(appropriate_package.base_price_currency)
puts "pkg.tax_price(state_or_province) = #{tax.currency} #{tax}"
tp += pkg.base_price.exchange_to(appropriate_package.base_price_currency) + tax
puts "tp = #{tp.currency} #{tp.inspect}"
end
tp + appropriate_package.billing_price(state_or_province)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment