Complete refactoring of orders-workflow.
OrderResult tables are removed. Data consistency is now possible through new article.price-history (ArticlePrice). Balancing-workflow needs to be updated.
This commit is contained in:
parent
80287aeea4
commit
9eb2125f15
98 changed files with 1121 additions and 1717 deletions
|
|
@ -1,24 +1,28 @@
|
|||
# == Schema Information
|
||||
# Schema version: 20090113111624
|
||||
# Schema version: 20090120184410
|
||||
#
|
||||
# Table name: invoices
|
||||
#
|
||||
# id :integer(4) not null, primary key
|
||||
# supplier_id :integer(4)
|
||||
# delivery_id :integer(4)
|
||||
# number :string(255)
|
||||
# date :date
|
||||
# paid_on :date
|
||||
# note :text
|
||||
# amount :decimal(8, 2) default(0.0), not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# id :integer(4) not null, primary key
|
||||
# supplier_id :integer(4)
|
||||
# delivery_id :integer(4)
|
||||
# number :string(255)
|
||||
# date :date
|
||||
# paid_on :date
|
||||
# note :text
|
||||
# amount :decimal(8, 2) default(0.0), not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# order_id :integer(4)
|
||||
# deposit :decimal(8, 2) default(0.0), not null
|
||||
# deposit_credit :decimal(8, 2) default(0.0), not null
|
||||
#
|
||||
|
||||
class Invoice < ActiveRecord::Base
|
||||
|
||||
belongs_to :supplier
|
||||
belongs_to :delivery
|
||||
belongs_to :order
|
||||
|
||||
validates_presence_of :supplier_id
|
||||
validates_uniqueness_of :date, :scope => [:supplier_id]
|
||||
|
|
@ -29,4 +33,14 @@ class Invoice < ActiveRecord::Base
|
|||
def amount=(amount)
|
||||
self[:amount] = String.delocalized_decimal(amount)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def deposit=(deposit)
|
||||
self[:deposit] = String.delocalized_decimal(deposit)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def deposit_credit=(deposit)
|
||||
self[:deposit_credit] = String.delocalized_decimal(deposit)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue