Introduced StockTaking. TODO: Dry up the stockit/stock_takings/deliveries controllers/views!

This commit is contained in:
Benjamin Meichsner 2009-02-12 18:32:20 +01:00
parent 2bb4cdb9d6
commit 951d19db6a
30 changed files with 436 additions and 55 deletions

View file

@ -0,0 +1,13 @@
class StockTaking < ActiveRecord::Base
has_many :stock_changes, :dependent => :destroy
has_many :stock_articles, :through => :stock_changes
validates_presence_of :date
def stock_change_attributes=(stock_change_attributes)
for attributes in stock_change_attributes
stock_changes.build(attributes) unless attributes[:quantity].to_i == 0
end
end
end