Last part of order refactoring. Now order_article create/update is possible.

This commit is contained in:
Benjamin Meichsner 2009-02-09 20:12:56 +01:00
parent 4d796b8e73
commit 6202e05841
14 changed files with 161 additions and 97 deletions

View file

@ -16,6 +16,21 @@ class ArticlePrice < ActiveRecord::Base
belongs_to :article
has_many :order_articles
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
def price=(price)
self[:price] = String.delocalized_decimal(price)
end
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
def tax=(tax)
self[:tax] = String.delocalized_decimal(tax)
end
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
def deposit=(deposit)
self[:deposit] = String.delocalized_decimal(deposit)
end
# The financial gross, net plus tax and deposit.
def gross_price