Moved User.address-info into Ordergroup.contact_... attributes. Updated model-fixtures for testing.

This commit is contained in:
Benjamin Meichsner 2009-02-02 16:35:43 +01:00
parent aa47a24fda
commit 0a2a79237a
60 changed files with 466 additions and 443 deletions

View File

@ -10,10 +10,8 @@ class Finance::TransactionsController < ApplicationController
if params["sort"] if params["sort"]
sort = case params["sort"] sort = case params["sort"]
when "name" then "name" when "name" then "name"
when "size" then "actual_size"
when "account_balance" then "account_balance" when "account_balance" then "account_balance"
when "name_reverse" then "name DESC" when "name_reverse" then "name DESC"
when "size_reverse" then "actual_size DESC"
when "account_balance_reverse" then "account_balance DESC" when "account_balance_reverse" then "account_balance DESC"
end end
else else

View File

@ -39,7 +39,7 @@ class HomeController < ApplicationController
@user = @current_user @user = @current_user
@ordergroup = @user.ordergroup @ordergroup = @user.ordergroup
@ordergroup_column_names = ["Description", "Actual Size", "Balance", "Updated"] @ordergroup_column_names = ["Description", "Actual Size", "Balance", "Updated"]
@ordergroup_columns = ["description", "actual_size", "account_balance", "account_updated"] @ordergroup_columns = ["description", "account_balance", "account_updated"]
#listing the financial transactions with ajax... #listing the financial transactions with ajax...

View File

@ -117,4 +117,20 @@ module ApplicationHelper
remote_options = {:before => "Element.show('loader')", :success => "Element.hide('loader')"} remote_options = {:before => "Element.show('loader')", :success => "Element.hide('loader')"}
link_to_remote(text, remote_options.merge(options)) link_to_remote(text, remote_options.merge(options))
end end
def format_roles(record)
roles = []
roles << 'Admin' if record.role_admin?
roles << 'Finanzen' if record.role_finance?
roles << 'Lieferanten' if record.role_suppliers?
roles << 'Artikel' if record.role_article_meta?
roles << 'Bestellung' if record.role_orders?
roles.join(', ')
end
def link_to_gmaps(address)
link_to h(address), "http://maps.google.de/?q=#{h(address)}", :title => "Show it on google maps",
:target => "_blank"
end
end end

View File

@ -3,24 +3,24 @@
# #
# Table name: articles # Table name: articles
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# name :string(255) default(""), not null # name :string(255) default(""), not null
# supplier_id :integer(4) default(0), not null # supplier_id :integer default(0), not null
# article_category_id :integer(4) default(0), not null # article_category_id :integer default(0), not null
# unit :string(255) default(""), not null # unit :string(255) default(""), not null
# note :string(255) # note :string(255)
# availability :boolean(1) default(TRUE), not null # availability :boolean default(TRUE), not null
# manufacturer :string(255) # manufacturer :string(255)
# origin :string(255) # origin :string(255)
# shared_updated_on :datetime # shared_updated_on :datetime
# price :decimal(8, 2) # price :decimal(, )
# tax :float # tax :float
# deposit :decimal(8, 2) default(0.0) # deposit :decimal(, ) default(0.0)
# unit_quantity :integer(4) default(1), not null # unit_quantity :integer default(1), not null
# order_number :string(255) # order_number :string(255)
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# quantity :decimal(6, 2) default(0.0) # quantity :decimal(, ) default(0.0)
# deleted_at :datetime # deleted_at :datetime
# #

View File

@ -1,9 +1,9 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: article_categories # Table name: article_categories
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# #

View File

@ -1,14 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: article_prices # Table name: article_prices
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# article_id :integer(4) # article_id :integer
# price :decimal(8, 2) default(0.0), not null # price :decimal(8, 2) default(0.0), not null
# tax :decimal(8, 2) default(0.0), not null # tax :decimal(8, 2) default(0.0), not null
# deposit :decimal(8, 2) default(0.0), not null # deposit :decimal(8, 2) default(0.0), not null
# unit_quantity :integer(4) # unit_quantity :integer
# created_at :datetime # created_at :datetime
# #

View File

@ -1,12 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: assignments # Table name: assignments
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# user_id :integer(4) default(0), not null # user_id :integer default(0), not null
# task_id :integer(4) default(0), not null # task_id :integer default(0), not null
# accepted :boolean(1) # accepted :boolean
# #
class Assignment < ActiveRecord::Base class Assignment < ActiveRecord::Base

View File

@ -1,10 +1,10 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: deliveries # Table name: deliveries
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# supplier_id :integer(4) # supplier_id :integer
# delivered_on :date # delivered_on :date
# created_at :datetime # created_at :datetime
# #

View File

@ -1,13 +1,13 @@
# == Schema Information # == Schema Information
# Schema version: 20090114101610 # Schema version: 20090119155930
# #
# Table name: financial_transactions # Table name: financial_transactions
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# ordergroup_id :integer(4) default(0), not null # ordergroup_id :integer default(0), not null
# amount :decimal(8, 2) default(0.0), not null # amount :decimal(8, 2) default(0.0), not null
# note :text default(""), not null # note :text not null
# user_id :integer(4) default(0), not null # user_id :integer default(0), not null
# created_on :datetime not null # created_on :datetime not null
# #

View File

@ -3,25 +3,27 @@
# #
# Table name: groups # Table name: groups
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# type :string(255) default(""), not null # type :string(255) default(""), not null
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# actual_size :integer(4) # account_balance :decimal(, ) default(0.0), not null
# account_balance :decimal(8, 2) default(0.0), not null
# account_updated :datetime # account_updated :datetime
# created_on :datetime not null # created_on :datetime not null
# role_admin :boolean(1) not null # role_admin :boolean not null
# role_suppliers :boolean(1) not null # role_suppliers :boolean not null
# role_article_meta :boolean(1) not null # role_article_meta :boolean not null
# role_finance :boolean(1) not null # role_finance :boolean not null
# role_orders :boolean(1) not null # role_orders :boolean not null
# weekly_task :boolean(1) # weekly_task :boolean
# weekday :integer(4) # weekday :integer
# task_name :string(255) # task_name :string(255)
# task_description :string(255) # task_description :string(255)
# task_required_users :integer(4) default(1) # task_required_users :integer default(1)
# deleted_at :datetime # deleted_at :datetime
# contact_person :string(255)
# contact_phone :string(255)
# contact_address :string(255)
# #
# Groups organize the User. # Groups organize the User.

View File

@ -1,15 +1,15 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: group_orders # Table name: group_orders
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# ordergroup_id :integer(4) default(0), not null # ordergroup_id :integer default(0), not null
# order_id :integer(4) default(0), not null # order_id :integer default(0), not null
# price :decimal(8, 2) default(0.0), not null # price :decimal(8, 2) default(0.0), not null
# lock_version :integer(4) default(0), not null # lock_version :integer default(0), not null
# updated_on :datetime not null # updated_on :datetime not null
# updated_by_user_id :integer(4) # updated_by_user_id :integer
# #
# A GroupOrder represents an Order placed by an Ordergroup. # A GroupOrder represents an Order placed by an Ordergroup.

View File

@ -1,13 +1,13 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: group_order_articles # Table name: group_order_articles
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# group_order_id :integer(4) default(0), not null # group_order_id :integer default(0), not null
# order_article_id :integer(4) default(0), not null # order_article_id :integer default(0), not null
# quantity :integer(4) default(0), not null # quantity :integer default(0), not null
# tolerance :integer(4) default(0), not null # tolerance :integer default(0), not null
# updated_on :datetime not null # updated_on :datetime not null
# #

View File

@ -1,12 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: group_order_article_quantities # Table name: group_order_article_quantities
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# group_order_article_id :integer(4) default(0), not null # group_order_article_id :integer default(0), not null
# quantity :integer(4) default(0) # quantity :integer default(0)
# tolerance :integer(4) default(0) # tolerance :integer default(0)
# created_on :datetime not null # created_on :datetime not null
# #

View File

@ -1,13 +1,13 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: invites # Table name: invites
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# token :string(255) default(""), not null # token :string(255) default(""), not null
# expires_at :datetime not null # expires_at :datetime not null
# group_id :integer(4) default(0), not null # group_id :integer default(0), not null
# user_id :integer(4) default(0), not null # user_id :integer default(0), not null
# email :string(255) default(""), not null # email :string(255) default(""), not null
# #

View File

@ -1,11 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: invoices # Table name: invoices
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# supplier_id :integer(4) # supplier_id :integer
# delivery_id :integer(4) # delivery_id :integer
# number :string(255) # number :string(255)
# date :date # date :date
# paid_on :date # paid_on :date
@ -13,7 +13,7 @@
# amount :decimal(8, 2) default(0.0), not null # amount :decimal(8, 2) default(0.0), not null
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# order_id :integer(4) # order_id :integer
# deposit :decimal(8, 2) default(0.0), not null # deposit :decimal(8, 2) default(0.0), not null
# deposit_credit :decimal(8, 2) default(0.0), not null # deposit_credit :decimal(8, 2) default(0.0), not null
# #

View File

@ -1,11 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: memberships # Table name: memberships
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# group_id :integer(4) default(0), not null # group_id :integer default(0), not null
# user_id :integer(4) default(0), not null # user_id :integer default(0), not null
# #
class Membership < ActiveRecord::Base class Membership < ActiveRecord::Base

View File

@ -1,15 +1,15 @@
# == Schema Information # == Schema Information
# Schema version: 20090115232435 # Schema version: 20090119155930
# #
# Table name: messages # Table name: messages
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# sender_id :integer(4) # sender_id :integer
# recipients_ids :text # recipients_ids :text
# subject :string(255) not null # subject :string(255) not null
# body :text # body :text
# email_state :integer(4) default(0), not null # email_state :integer default(0), not null
# private :boolean(1) # private :boolean
# created_at :datetime # created_at :datetime
# #

View File

@ -1,16 +1,16 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: orders # Table name: orders
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# supplier_id :integer(4) # supplier_id :integer
# note :text # note :text
# starts :datetime # starts :datetime
# ends :datetime # ends :datetime
# state :string(255) default("open") # state :string(255) default("open")
# lock_version :integer(4) default(0), not null # lock_version :integer default(0), not null
# updated_by_user_id :integer(4) # updated_by_user_id :integer
# #
class Order < ActiveRecord::Base class Order < ActiveRecord::Base

View File

@ -1,16 +1,16 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: order_articles # Table name: order_articles
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# order_id :integer(4) default(0), not null # order_id :integer default(0), not null
# article_id :integer(4) default(0), not null # article_id :integer default(0), not null
# quantity :integer(4) default(0), not null # quantity :integer default(0), not null
# tolerance :integer(4) default(0), not null # tolerance :integer default(0), not null
# units_to_order :integer(4) default(0), not null # units_to_order :integer default(0), not null
# lock_version :integer(4) default(0), not null # lock_version :integer default(0), not null
# article_price_id :integer(4) # article_price_id :integer
# #
# An OrderArticle represents a single Article that is part of an Order. # An OrderArticle represents a single Article that is part of an Order.

View File

@ -1,11 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: order_comments # Table name: order_comments
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# order_id :integer(4) # order_id :integer
# user_id :integer(4) # user_id :integer
# text :text # text :text
# created_at :datetime # created_at :datetime
# #

View File

@ -3,25 +3,27 @@
# #
# Table name: groups # Table name: groups
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# type :string(255) default(""), not null # type :string(255) default(""), not null
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# actual_size :integer(4) # account_balance :decimal(, ) default(0.0), not null
# account_balance :decimal(8, 2) default(0.0), not null
# account_updated :datetime # account_updated :datetime
# created_on :datetime not null # created_on :datetime not null
# role_admin :boolean(1) not null # role_admin :boolean not null
# role_suppliers :boolean(1) not null # role_suppliers :boolean not null
# role_article_meta :boolean(1) not null # role_article_meta :boolean not null
# role_finance :boolean(1) not null # role_finance :boolean not null
# role_orders :boolean(1) not null # role_orders :boolean not null
# weekly_task :boolean(1) # weekly_task :boolean
# weekday :integer(4) # weekday :integer
# task_name :string(255) # task_name :string(255)
# task_description :string(255) # task_description :string(255)
# task_required_users :integer(4) default(1) # task_required_users :integer default(1)
# deleted_at :datetime # deleted_at :datetime
# contact_person :string(255)
# contact_phone :string(255)
# contact_address :string(255)
# #
# Ordergroups can order, they are "children" of the class Group # Ordergroups can order, they are "children" of the class Group
@ -29,7 +31,6 @@
# Ordergroup have the following attributes, in addition to Group # Ordergroup have the following attributes, in addition to Group
# * account_balance (decimal) # * account_balance (decimal)
# * account_updated (datetime) # * account_updated (datetime)
# * actual_size (int) : how many persons are ordering through the Ordergroup
class Ordergroup < Group class Ordergroup < Group
acts_as_paranoid # Avoid deleting the ordergroup for consistency of order-results acts_as_paranoid # Avoid deleting the ordergroup for consistency of order-results
extend ActiveSupport::Memoizable # Ability to cache method results. Use memoize :expensive_method extend ActiveSupport::Memoizable # Ability to cache method results. Use memoize :expensive_method
@ -38,9 +39,11 @@ class Ordergroup < Group
has_many :group_orders has_many :group_orders
has_many :orders, :through => :group_orders has_many :orders, :through => :group_orders
validates_inclusion_of :actual_size, :in => 1..99
validates_numericality_of :account_balance, :message => 'ist keine gültige Zahl' validates_numericality_of :account_balance, :message => 'ist keine gültige Zahl'
def contact
"#{contact_phone} (#{contact_person})"
end
def non_members def non_members
User.all(:order => 'nick').reject { |u| (users.include?(u) || u.ordergroup) } User.all(:order => 'nick').reject { |u| (users.include?(u) || u.ordergroup) }
end end

View File

@ -1,12 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090115232435 # Schema version: 20090119155930
# #
# Table name: stock_changes # Table name: stock_changes
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# delivery_id :integer(4) # delivery_id :integer
# order_id :integer(4) # order_id :integer
# article_id :integer(4) # article_id :integer
# quantity :decimal(6, 2) default(0.0) # quantity :decimal(6, 2) default(0.0)
# created_at :datetime # created_at :datetime
# #

View File

@ -3,7 +3,7 @@
# #
# Table name: suppliers # Table name: suppliers
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# name :string(255) default(""), not null # name :string(255) default(""), not null
# address :string(255) default(""), not null # address :string(255) default(""), not null
# phone :string(255) default(""), not null # phone :string(255) default(""), not null
@ -16,7 +16,7 @@
# delivery_days :string(255) # delivery_days :string(255)
# order_howto :string(255) # order_howto :string(255)
# note :string(255) # note :string(255)
# shared_supplier_id :integer(4) # shared_supplier_id :integer
# min_order_quantity :string(255) # min_order_quantity :string(255)
# deleted_at :datetime # deleted_at :datetime
# #

View File

@ -1,18 +1,18 @@
# == Schema Information # == Schema Information
# Schema version: 20090114101610 # Schema version: 20090119155930
# #
# Table name: tasks # Table name: tasks
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# due_date :date # due_date :date
# done :boolean(1) # done :boolean
# workgroup_id :integer(4) # workgroup_id :integer
# assigned :boolean(1) # assigned :boolean
# created_on :datetime not null # created_on :datetime not null
# updated_on :datetime not null # updated_on :datetime not null
# required_users :integer(4) default(1) # required_users :integer default(1)
# #
class Task < ActiveRecord::Base class Task < ActiveRecord::Base

View File

@ -1,9 +1,9 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090120184410
# #
# Table name: users # Table name: users
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# nick :string(255) default(""), not null # nick :string(255) default(""), not null
# password_hash :string(255) default(""), not null # password_hash :string(255) default(""), not null
# password_salt :string(255) default(""), not null # password_salt :string(255) default(""), not null
@ -11,7 +11,6 @@
# last_name :string(255) default(""), not null # last_name :string(255) default(""), not null
# email :string(255) default(""), not null # email :string(255) default(""), not null
# phone :string(255) # phone :string(255)
# address :string(255)
# created_on :datetime not null # created_on :datetime not null
# reset_password_token :string(255) # reset_password_token :string(255)
# reset_password_expires :datetime # reset_password_expires :datetime
@ -80,6 +79,13 @@ class User < ActiveRecord::Base
end end
end end
def name
[first_name, last_name].join(" ")
end
def ordergroup_name
ordergroup.name if ordergroup
end
# Sets the user's password. It will be stored encrypted along with a random salt. # Sets the user's password. It will be stored encrypted along with a random salt.
def set_password def set_password
@ -94,22 +100,6 @@ class User < ActiveRecord::Base
Digest::SHA1.hexdigest(password + self.password_salt) == self.password_hash Digest::SHA1.hexdigest(password + self.password_salt) == self.password_hash
end end
# # Sets the passwort, and if fails it returns error-messages (see above)
# def set_password(options = {:required => false}, password = nil, confirmation = nil)
# required = options[:required]
# if required && (password.nil? || password.empty?)
# self.errors.add_to_base 'Password is required'
# elsif !password.nil? && !password.empty?
# if password != confirmation
# self.errors.add_to_base "Passwords doesn't match"
# elsif password.length < 5 || password.length > 25
# self.errors.add_to_base 'Password-length has to be between 5 and 25 characters'
# else
# self.password = password
# end
# end
# end
# Returns a random password. # Returns a random password.
def new_random_password(size = 3) def new_random_password(size = 3)
c = %w(b c d f g h j k l m n p qu r s t v w x z ch cr fr nd ng nk nt ph pr rd sh sl sp st th tr) c = %w(b c d f g h j k l m n p qu r s t v w x z ch cr fr nd ng nk nt ph pr rd sh sl sp st th tr)

View File

@ -3,25 +3,27 @@
# #
# Table name: groups # Table name: groups
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# type :string(255) default(""), not null # type :string(255) default(""), not null
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# actual_size :integer(4) # account_balance :decimal(, ) default(0.0), not null
# account_balance :decimal(8, 2) default(0.0), not null
# account_updated :datetime # account_updated :datetime
# created_on :datetime not null # created_on :datetime not null
# role_admin :boolean(1) not null # role_admin :boolean not null
# role_suppliers :boolean(1) not null # role_suppliers :boolean not null
# role_article_meta :boolean(1) not null # role_article_meta :boolean not null
# role_finance :boolean(1) not null # role_finance :boolean not null
# role_orders :boolean(1) not null # role_orders :boolean not null
# weekly_task :boolean(1) # weekly_task :boolean
# weekday :integer(4) # weekday :integer
# task_name :string(255) # task_name :string(255)
# task_description :string(255) # task_description :string(255)
# task_required_users :integer(4) default(1) # task_required_users :integer default(1)
# deleted_at :datetime # deleted_at :datetime
# contact_person :string(255)
# contact_phone :string(255)
# contact_address :string(255)
# #
class Workgroup < Group class Workgroup < Group

View File

@ -14,7 +14,7 @@
- for user in @users - for user in @users
%tr{:class => cycle('even','odd', :name => 'users')} %tr{:class => cycle('even','odd', :name => 'users')}
%td= link_to user.nick, [:admin, user] %td= link_to user.nick, [:admin, user]
%td= [user.first_name, user.last_name].join(", ") %td=h user.name
%td= format_date(user.created_on) %td= format_date(user.created_on)
%br/ %br/
= link_to 'Alle Benutzerinnen', admin_users_path = link_to 'Alle Benutzerinnen', admin_users_path

View File

@ -1,11 +1,18 @@
- form_for [:admin, @ordergroup] do |@form| - form_for [:admin, @ordergroup] do |@form|
= render :partial => 'shared/group_form' - render :layout => 'shared/group_form' do
%div{:style => "float:right;width:40%"}
%div{:style => "float:left;width:55%;"} %p
%p = @form.label :contact_person
= @form.label :actual_size, "Aktuelle Gruppengröße" %br/
%br/ = @form.text_field :contact_person, :size => 20
= @form.text_field :actual_size, :size => 3 %p
= @form.label :contact_phone
%br/
= @form.text_field :contact_phone, :size => 20
%p
= @form.label :contact_address
%br/
= @form.text_field :contact_address
%br{ :style => "clear:both" } %br{ :style => "clear:both" }
= submit_tag "Speichern" = submit_tag "Speichern"

View File

@ -10,12 +10,16 @@
%thead %thead
%tr %tr
%th Name %th Name
%th Kontakt
%th Adresse
%th Mitglieder %th Mitglieder
%th %th
%tbody %tbody
- for ordergroup in @ordergroups - for ordergroup in @ordergroups
%tr{:class => cycle('even','odd', :name => 'groups')} %tr{:class => cycle('even','odd', :name => 'groups')}
%td= link_to ordergroup.name, [:admin, ordergroup] %td= link_to ordergroup.name, [:admin, ordergroup]
%td= ordergroup.contact
%td= link_to_gmaps ordergroup.contact_address
%td= ordergroup.users.size %td= ordergroup.users.size
%td %td
= link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), memberships_admin_ordergroup_path(ordergroup) = link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), memberships_admin_ordergroup_path(ordergroup)

View File

@ -9,30 +9,23 @@
%table.list %table.list
%thead %thead
%tr %tr
%th= _('Username') %th Login
%th= _('First name') %th Name
%th= _('Last name') %th Email
%th= _('Email') %th Zugriff auf
%th= _('Roles') %th Letzter login
%th= _('Last Login')
%th{:style => "width:3em"} %th{:style => "width:3em"}
%tbody %tbody
- for user in @users - for user in @users
- roles = Array.new
- roles << 'Admin' if user.role_admin?
- roles << 'Finanzen' if user.role_finance?
- roles << 'Lieferanten' if user.role_suppliers?
- roles << 'Artikel' if user.role_article_meta?
- roles << 'Bestellung' if user.role_orders?
%tr{:class => cycle('even','odd', :name => 'users')} %tr{:class => cycle('even','odd', :name => 'users')}
%td= link_to user.nick, [:admin, user] %td= link_to user.nick, [:admin, user]
%td=h user.first_name %td=h user.name
%td=h user.last_name
%td=h user.email %td=h user.email
%td=h roles.join(', ') %td=h format_roles(user)
%td=h format_time(user.last_login) %td=h format_time(user.last_login)
%td %td
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), edit_admin_user_path(user)) = link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), edit_admin_user_path(user))
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), | = link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), |
[:admin, user], | [:admin, user], |
:confirm => 'Willst du ' + user.first_name + ' wirklich löschen?', :method => :delete) | :confirm => 'Willst du ' + user.name + ' wirklich löschen?', :method => :delete) |

View File

@ -10,10 +10,9 @@
<div style="float:left;margin:5px; margin-right:10px;" class="box"> <div style="float:left;margin:5px; margin-right:10px;" class="box">
<p><b>Person</b></p> <p><b>Person</b></p>
<p><b>Nick:</b> <%=h @user.nick %></p> <p><b>Nick:</b> <%=h @user.nick %></p>
<p><b>Name:</b> <%=h @user.first_name + ' ' + @user.last_name %></p> <p><b>Name:</b> <%=h @user.name %></p>
<p><b>Email:</b> <%=h @user.email %></p> <p><b>Email:</b> <%=h @user.email %></p>
<p><b>Telefon:</b> <%=h @user.phone %></p> <p><b>Telefon:</b> <%=h @user.phone %></p>
<p><b>Adresse:</b> <%=h @user.address %></p>
</div> </div>
<div style="float:left; margin:5px;" class="box"> <div style="float:left; margin:5px;" class="box">
<p> <p>
@ -32,14 +31,8 @@
<p> <p>
<b>Benutzer_in hat Zugriff auf:</b> <b>Benutzer_in hat Zugriff auf:</b>
</p> </p>
<% roles = Array.new
roles << 'Admin' if @user.role_admin?
roles << 'Finanzen' if @user.role_finance?
roles << 'Lieferanten' if @user.role_suppliers?
roles << 'Artikel' if @user.role_article_meta?
roles << 'Bestellung' if @user.role_orders? %>
<p> <p>
<%=h roles.join(', ') %> <%=h format_roles(@user) %>
</p> </p>
</div> </div>
<p style="clear:both"> <p style="clear:both">

View File

@ -11,14 +11,16 @@
%tr %tr
%th Name %th Name
%th Mitglieder %th Mitglieder
%th Zugriff auf
%th %th
%tbody %tbody
- for workgroup in @workgroups - for workgroup in @workgroups
%tr{:class => cycle('even','odd', :name => 'groups')} %tr{:class => cycle('even','odd', :name => 'groups')}
%td= link_to workgroup.name, [:admin, workgroup] %td= link_to workgroup.name, [:admin, workgroup]
%td= workgroup.users.size %td= workgroup.users.size
%td= format_roles(workgroup)
%td %td
= link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), memberships_admin_workgroup_path(workgroup) = link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), memberships_admin_workgroup_path(workgroup)
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Gruppe bearbeiten'), edit_admin_workgroup_path(workgroup)) = link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Gruppe bearbeiten'), edit_admin_workgroup_path(workgroup))
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Gruppe löschen'), [:admin, workgroup], | = link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Gruppe löschen'), [:admin, workgroup], |
:confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?', :method => :delete) | :confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?', :method => :delete) |

View File

@ -13,14 +13,14 @@
%thead %thead
%tr %tr
%th= sort_link_helper _("Name"), "name", @per_page %th= sort_link_helper _("Name"), "name", @per_page
%th= sort_link_helper _("Size of group"), "size", @per_page %th Kontakt
%th= sort_link_helper _("Account balance"), "account_balance", @per_page %th= sort_link_helper _("Account balance"), "account_balance", @per_page
%th %th
%tbody %tbody
- for group in @groups - for group in @groups
%tr{:class => cycle('even','odd', :name => 'groups')} %tr{:class => cycle('even','odd', :name => 'groups')}
%td= group.name %td= group.name
%td= group.actual_size %td= group.contact
%td{:class => "currency", :style => "width:5em"}= number_to_currency(group.account_balance) %td{:class => "currency", :style => "width:5em"}= number_to_currency(group.account_balance)
%td{:class => "actions"} %td{:class => "actions"}
= link_to image_tag("euro_new.png", :size => "16x16", :alt => _("New transaction"), :border => "0"), {:action => 'new', :id => group}, {:title => _("New transaction")} = link_to image_tag("euro_new.png", :size => "16x16", :alt => _("New transaction"), :border => "0"), {:action => 'new', :id => group}, {:title => _("New transaction")}

View File

@ -23,4 +23,4 @@
= render :partial => "ordergroups" = render :partial => "ordergroups"
%br/ %br/
- if @current_user.role_admin? - if @current_user.role_admin?
= link_to _("New ordergroup"), :controller => 'admin', :action => 'newOrdergroup' = link_to "Neue Bestellgruppe anlegen", new_admin_ordergroup_path

View File

@ -11,8 +11,7 @@
%thead %thead
%tr %tr
%th Nick %th Nick
%th Vorname %th Name
%th Nachname
%th Email %th Email
%th Telefon %th Telefon
%th Bestellgruppe %th Bestellgruppe
@ -20,14 +19,10 @@
%tbody %tbody
- for user in @users - for user in @users
%tr{:class => cycle('even','odd', :name => 'users')} %tr{:class => cycle('even','odd', :name => 'users')}
- groups = user.groups
- ordergroup = groups.detect { |group| group.is_a?(Ordergroup) }
- workgroups = groups.select { |group| !group.is_a?(Ordergroup) }.collect(&:name)
%td= link_to user.nick, {:controller => "messages", :action => "user", :id => user}, :title => _('Send user an email') %td= link_to user.nick, {:controller => "messages", :action => "user", :id => user}, :title => _('Send user an email')
%td=h user.first_name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1' %td=h user.name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
%td=h user.last_name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
%td=h user.email if @current_user.role_admin? || user.settings["profile.emailIsPublic"] == '1' %td=h user.email if @current_user.role_admin? || user.settings["profile.emailIsPublic"] == '1'
%td=h user.phone if @current_user.role_admin? || user.settings["profile.phoneIsPublic"] == '1' %td=h user.phone if @current_user.role_admin? || user.settings["profile.phoneIsPublic"] == '1'
%td=h ordergroup.name if ordergroup %td=h user.ordergroup_name
%td=h workgroups.join(', ') %td=h groups.select { |group| !group.is_a?(Ordergroup) }.collect(&:name).join(', ')

View File

@ -5,7 +5,6 @@
<p><b>Beschreibung:</b> <%=h @ordergroup.description %> <p><b>Beschreibung:</b> <%=h @ordergroup.description %>
<%= link_to '(ändern)', :controller => 'foodcoop', :action => 'edit_group', :id => @ordergroup %> <%= link_to '(ändern)', :controller => 'foodcoop', :action => 'edit_group', :id => @ordergroup %>
</p> </p>
<p><b>Gruppengröße:</b> <%=h @ordergroup.actual_size %></p>
<p><b>Kontostand:</b> <%= number_to_currency(@ordergroup.account_balance) %></p> <p><b>Kontostand:</b> <%= number_to_currency(@ordergroup.account_balance) %></p>
<h2>Personen</h2> <h2>Personen</h2>
<ul style="list-style-type:decimal;"> <ul style="list-style-type:decimal;">

View File

@ -31,10 +31,6 @@
Telefon Telefon
%br/ %br/
= form.text_field :phone = form.text_field :phone
%p
Adresse
%br/
= form.text_field :address
%p %p
Passwort Passwort
%br/ %br/

View File

@ -2,16 +2,16 @@
%tr %tr
%td Beschreibung: %td Beschreibung:
%td=h group.description %td=h group.description
- if @current_user.role_admin? or @current_user.role_finance?
%tr
%td Kontakt:
%td=h group.contact
%tr
%td Adresse:
%td= link_to_gmaps group.contact_address
%tr %tr
%td Gruppe hat Zugriff auf: %td Gruppe hat Zugriff auf:
%td %td= format_roles(group)
- roles = Array.new
- roles << 'Administration' if group.role_admin?
- roles << 'Finanzen' if group.role_finance?
- roles << 'Lieferanten' if group.role_suppliers?
- roles << 'Artikel' if group.role_article_meta?
- roles << 'Bestellungsverwaltung' if group.role_orders?
= roles.join(', ')
%tr %tr
%td Mitglieder: %td Mitglieder:
%td %td

View File

@ -21,10 +21,6 @@
<td><%= @form.label :phone %></td> <td><%= @form.label :phone %></td>
<td><%= @form.text_field :phone %></td> <td><%= @form.text_field :phone %></td>
</tr> </tr>
<tr>
<td><%= @form.label :address %></td>
<td><%= @form.text_field :address %></td>
</tr>
<tr> <tr>
<td/> <td/>
</tr> </tr>

View File

@ -67,6 +67,7 @@ Rails::Initializer.run do |config|
# library for parsing/writing files from/to csv-file # library for parsing/writing files from/to csv-file
config.gem "fastercsv" config.gem "fastercsv"
config.gem "prawn" config.gem "prawn"
config.gem "haml", :version => '>=2.0.6'
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths. # The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
# All files from config/locales/*.rb,yml are added automatically. # All files from config/locales/*.rb,yml are added automatically.

View File

@ -0,0 +1,28 @@
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_view.debug_rjs = true
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Configure an SMTP server for email sending in development mode:
# (cf. http://rails.rubyonrails.com/classes/ActionMailer/Base.html for info on options)
config.action_mailer.smtp_settings = {
:address => "smtp.gmx.net",
:port => 25,
:domain => "gmx.net",
:authentication => :login,
:user_name => "benjamin.meichsner@gmx.de",
:password => "ben234go"
}

View File

@ -2,12 +2,28 @@ class RefactorOrderLogic < ActiveRecord::Migration
def self.up def self.up
# TODO: Combine migrations since foodsoft3-development into one file # TODO: Combine migrations since foodsoft3-development into one file
# and try to build a migration path from old data. # and try to build a migration path from old data.
# # articles # == Ordergroups
add_column :groups, :deleted_at, :datetime # acts_as_paranoid
remove_column :groups, :actual_size # Useless, desposits are better stored within a transaction.note
# move contact-infos from users to ordergroups
add_column :groups, :contact_person, :string
add_column :groups, :contact_phone, :string
add_column :groups, :contact_address, :string
Ordergroup.all.each do |ordergroup|
contact = ordergroup.users.first
if contact
ordergroup.update_attributes :contact_person => contact.name,
:contact_phone => contact.phone, :contact_address => contact.address
end
end
remove_column :users, :address
#
# # == Article
# rename_column :articles, :net_price, :price # rename_column :articles, :net_price, :price
# remove_column :articles, :gross_price # remove_column :articles, :gross_price
# #
# # orders # # == Order
# drop_table :orders # drop_table :orders
# drop_table :group_order_results # drop_table :group_order_results
# drop_table :order_article_results # drop_table :order_article_results
@ -24,12 +40,12 @@ class RefactorOrderLogic < ActiveRecord::Migration
# t.integer :updated_by_user_id # t.integer :updated_by_user_id
# end # end
# #
# # invoices # # == Invoice
# add_column :invoices, :order_id, :integer # add_column :invoices, :order_id, :integer
# add_column :invoices, :deposit, :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false # add_column :invoices, :deposit, :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false
# add_column :invoices, :deposit_credit, :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false # add_column :invoices, :deposit_credit, :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false
# #
# # comments # # == Comment
# drop_table :comments # drop_table :comments
# create_table :order_comments do |t| # create_table :order_comments do |t|
# t.references :order # t.references :order
@ -38,7 +54,7 @@ class RefactorOrderLogic < ActiveRecord::Migration
# t.datetime :created_at # t.datetime :created_at
# end # end
# #
# # article_prices # # == ArticlePrice
# create_table :article_prices do |t| # create_table :article_prices do |t|
# t.references :article # t.references :article
# t.decimal :price, :precision => 8, :scale => 2, :default => 0.0, :null => false # t.decimal :price, :precision => 8, :scale => 2, :default => 0.0, :null => false
@ -59,11 +75,8 @@ class RefactorOrderLogic < ActiveRecord::Migration
# # order-articles # # order-articles
# add_column :order_articles, :article_price_id, :integer # add_column :order_articles, :article_price_id, :integer
# #
# # ordergroups # # == GroupOrder
# add_column :groups, :deleted_at, :datetime # change_column :group_orders, :updated_by_user_id, :integer, :default => nil, :null => true
# GroupOrders
change_column :group_orders, :updated_by_user_id, :integer, :default => nil, :null => true
end end
def self.down def self.down

View File

@ -9,7 +9,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20090119155930) do ActiveRecord::Schema.define(:version => 20090120184410) do
create_table "article_categories", :force => true do |t| create_table "article_categories", :force => true do |t|
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
@ -28,23 +28,23 @@ ActiveRecord::Schema.define(:version => 20090119155930) do
end end
create_table "articles", :force => true do |t| create_table "articles", :force => true do |t|
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
t.integer "supplier_id", :default => 0, :null => false t.integer "supplier_id", :default => 0, :null => false
t.integer "article_category_id", :default => 0, :null => false t.integer "article_category_id", :default => 0, :null => false
t.string "unit", :default => "", :null => false t.string "unit", :default => "", :null => false
t.string "note" t.string "note"
t.boolean "availability", :default => true, :null => false t.boolean "availability", :default => true, :null => false
t.string "manufacturer" t.string "manufacturer"
t.string "origin" t.string "origin"
t.datetime "shared_updated_on" t.datetime "shared_updated_on"
t.decimal "price", :precision => 8, :scale => 2 t.decimal "price"
t.float "tax" t.float "tax"
t.decimal "deposit", :precision => 8, :scale => 2, :default => 0.0 t.decimal "deposit", :default => 0.0
t.integer "unit_quantity", :default => 1, :null => false t.integer "unit_quantity", :default => 1, :null => false
t.string "order_number" t.string "order_number"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.decimal "quantity", :precision => 6, :scale => 2, :default => 0.0 t.decimal "quantity", :default => 0.0
t.datetime "deleted_at" t.datetime "deleted_at"
end end
@ -113,24 +113,26 @@ ActiveRecord::Schema.define(:version => 20090119155930) do
add_index "group_orders", ["ordergroup_id", "order_id"], :name => "index_group_orders_on_ordergroup_id_and_order_id", :unique => true add_index "group_orders", ["ordergroup_id", "order_id"], :name => "index_group_orders_on_ordergroup_id_and_order_id", :unique => true
create_table "groups", :force => true do |t| create_table "groups", :force => true do |t|
t.string "type", :default => "", :null => false t.string "type", :default => "", :null => false
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
t.string "description" t.string "description"
t.integer "actual_size" t.decimal "account_balance", :default => 0.0, :null => false
t.decimal "account_balance", :precision => 8, :scale => 2, :default => 0.0, :null => false
t.datetime "account_updated" t.datetime "account_updated"
t.datetime "created_on", :null => false t.datetime "created_on", :null => false
t.boolean "role_admin", :default => false, :null => false t.boolean "role_admin", :default => false, :null => false
t.boolean "role_suppliers", :default => false, :null => false t.boolean "role_suppliers", :default => false, :null => false
t.boolean "role_article_meta", :default => false, :null => false t.boolean "role_article_meta", :default => false, :null => false
t.boolean "role_finance", :default => false, :null => false t.boolean "role_finance", :default => false, :null => false
t.boolean "role_orders", :default => false, :null => false t.boolean "role_orders", :default => false, :null => false
t.boolean "weekly_task", :default => false t.boolean "weekly_task", :default => false
t.integer "weekday" t.integer "weekday"
t.string "task_name" t.string "task_name"
t.string "task_description" t.string "task_description"
t.integer "task_required_users", :default => 1 t.integer "task_required_users", :default => 1
t.datetime "deleted_at" t.datetime "deleted_at"
t.string "contact_person"
t.string "contact_phone"
t.string "contact_address"
end end
add_index "groups", ["name"], :name => "index_groups_on_name", :unique => true add_index "groups", ["name"], :name => "index_groups_on_name", :unique => true
@ -257,7 +259,6 @@ ActiveRecord::Schema.define(:version => 20090119155930) do
t.string "last_name", :default => "", :null => false t.string "last_name", :default => "", :null => false
t.string "email", :default => "", :null => false t.string "email", :default => "", :null => false
t.string "phone" t.string "phone"
t.string "address"
t.datetime "created_on", :null => false t.datetime "created_on", :null => false
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_expires" t.datetime "reset_password_expires"

View File

@ -1,14 +1,16 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: article_categories # Table name: article_categories
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
fruits: fruits:
id: 1 name: Fruits
description: fruits and only fruits description: fruits and only fruits
vegi:
name: Vegetables

View File

@ -1,27 +1,39 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: article_prices # Table name: article_prices
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# article_id :integer(4) # article_id :integer
# price :decimal(8, 2) default(0.0), not null # price :decimal(8, 2) default(0.0), not null
# tax :decimal(8, 2) default(0.0), not null # tax :decimal(8, 2) default(0.0), not null
# deposit :decimal(8, 2) default(0.0), not null # deposit :decimal(8, 2) default(0.0), not null
# unit_quantity :integer(4) # unit_quantity :integer
# created_at :datetime # created_at :datetime
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one: banana1:
price: 9.99 article: banana
tax: 9.99 price: 1.45
deposit: 9.99 tax: 7.0
unit_quantity: 1 unit_quantity: 18
two: banana2:
price: 9.99 article: banana
tax: 9.99 price: 1.35
deposit: 9.99 tax: 7.0
unit_quantity: 1 unit_quantity: 18
kiwi1:
article: kiwi
price: 1.11
tax: 7.0
unit_quantity: 10
potatoe1:
article: potatoe
price: 1.33
tax: 7.0
unit_quantity: 25

View File

@ -3,53 +3,59 @@
# #
# Table name: articles # Table name: articles
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# name :string(255) default(""), not null # name :string(255) default(""), not null
# supplier_id :integer(4) default(0), not null # supplier_id :integer default(0), not null
# article_category_id :integer(4) default(0), not null # article_category_id :integer default(0), not null
# unit :string(255) default(""), not null # unit :string(255) default(""), not null
# note :string(255) # note :string(255)
# availability :boolean(1) default(TRUE), not null # availability :boolean default(TRUE), not null
# manufacturer :string(255) # manufacturer :string(255)
# origin :string(255) # origin :string(255)
# shared_updated_on :datetime # shared_updated_on :datetime
# price :decimal(8, 2) # price :decimal(, )
# tax :float # tax :float
# deposit :decimal(8, 2) default(0.0) # deposit :decimal(, ) default(0.0)
# unit_quantity :integer(4) default(1), not null # unit_quantity :integer default(1), not null
# order_number :string(255) # order_number :string(255)
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# quantity :decimal(6, 2) default(0.0) # quantity :decimal(, ) default(0.0)
# deleted_at :datetime # deleted_at :datetime
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
banana: banana:
id: 1 supplier: terra
name: banana name: Banana
current_price_id: 1 article_category: fruits
unit: 500g unit: KG
availability: 1 availability: true
note: delicious note: delicious
supplier_id: 1 origin: EC
article_category_id: 1 price: 1.45
tax: 7.0
unit_quantity: 18
order_number: 123456
kiwi: kiwi:
id: 2 supplier: terra
name: kiwi name: Kiwi
current_price_id: 2 article_category: fruits
unit: 500g unit: 500g
availability: 1 availability: true
note: delicious origin: IT
supplier_id: 1 price: 1.11
article_category_id: 1 tax: 7.0
apple: unit_quantity: 10
id: 3 order_number: 123457
name: apple potatoe:
current_price_id: 3 supplier: terra
name: Potatoe
article_category: vegi
unit: 500g unit: 500g
availability: 0 availability: true
note: delicious origin: REG
supplier_id: 1 price: 1.33
article_category_id: 1 tax: 7.0
unit_quantity: 25
order_number: 123458

View File

@ -1,16 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: assignments # Table name: assignments
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# user_id :integer(4) default(0), not null # user_id :integer default(0), not null
# task_id :integer(4) default(0), not null # task_id :integer default(0), not null
# accepted :boolean(1) # accepted :boolean
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
id: 1
two:
id: 2

View File

@ -1,18 +1,26 @@
# == Schema Information # == Schema Information
# Schema version: 20090114101610 # Schema version: 20090119155930
# #
# Table name: financial_transactions # Table name: financial_transactions
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# ordergroup_id :integer(4) default(0), not null # ordergroup_id :integer default(0), not null
# amount :decimal(8, 2) default(0.0), not null # amount :decimal(8, 2) default(0.0), not null
# note :text default(""), not null # note :text not null
# user_id :integer(4) default(0), not null # user_id :integer default(0), not null
# created_on :datetime not null # created_on :datetime not null
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first: bananas1:
id: 1 ordergroup: bananas
another: amount: 0.00
id: 2 note: "Deposit for 3 people: 15,-€"
user: admin
created_on: <%= 2.weeks.ago.strftime("%d.%m.%Y") %>
bananas2:
ordergroup: bananas
amount: 100.00
note: Paying in from <%= 1.weeks.ago.strftime("%d.%m.%Y") %>
created_on: <%= 1.weeks.ago.strftime("%d.%m.%Y") %>

View File

@ -1,17 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: group_order_article_quantities # Table name: group_order_article_quantities
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# group_order_article_id :integer(4) default(0), not null # group_order_article_id :integer default(0), not null
# quantity :integer(4) default(0) # quantity :integer default(0)
# tolerance :integer(4) default(0) # tolerance :integer default(0)
# created_on :datetime not null # created_on :datetime not null
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first:
id: 1
another:
id: 2

View File

@ -3,37 +3,44 @@
# #
# Table name: groups # Table name: groups
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# type :string(255) default(""), not null # type :string(255) default(""), not null
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# actual_size :integer(4) # account_balance :decimal(, ) default(0.0), not null
# account_balance :decimal(8, 2) default(0.0), not null
# account_updated :datetime # account_updated :datetime
# created_on :datetime not null # created_on :datetime not null
# role_admin :boolean(1) not null # role_admin :boolean not null
# role_suppliers :boolean(1) not null # role_suppliers :boolean not null
# role_article_meta :boolean(1) not null # role_article_meta :boolean not null
# role_finance :boolean(1) not null # role_finance :boolean not null
# role_orders :boolean(1) not null # role_orders :boolean not null
# weekly_task :boolean(1) # weekly_task :boolean
# weekday :integer(4) # weekday :integer
# task_name :string(255) # task_name :string(255)
# task_description :string(255) # task_description :string(255)
# task_required_users :integer(4) default(1) # task_required_users :integer default(1)
# deleted_at :datetime # deleted_at :datetime
# contact_person :string(255)
# contact_phone :string(255)
# contact_address :string(255)
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first:
id: 1
name: Order Group 1
type: Ordergroup
another:
id: 2
name: Order Group 2
type: Ordergroup
admins: admins:
id: 3 type: Workgroup
name: Administrators name: Administrators
role_admin: true description: System administrators.
role_admin: true
role_suppliers: true
role_article_meta: true
role_finance: true
role_orders: true
bananas:
type: Ordergroup
name: Banangroup
account_balance: 100.00
account_updated: <%= 1.weeks.ago.strftime("%d.%m.%Y") %>
contact_person: Tim
contact_phone: 030 123132456
contact_address: Waldermarstrasse 43, 10988 Berlin

View File

@ -1,20 +1,18 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090119155930
# #
# Table name: memberships # Table name: memberships
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# group_id :integer(4) default(0), not null # group_id :integer default(0), not null
# user_id :integer(4) default(0), not null # user_id :integer default(0), not null
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first: first:
id: 1 group: admins
group_id: 3 user: admin
user_id: 1 second:
another: group: bananas
id: 2 user: test
group_id: 1
user_id: 2

View File

@ -1,20 +1,17 @@
# == Schema Information # == Schema Information
# Schema version: 20090115232435 # Schema version: 20090119155930
# #
# Table name: messages # Table name: messages
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# sender_id :integer(4) # sender_id :integer
# recipients_ids :text # recipients_ids :text
# subject :string(255) not null # subject :string(255) not null
# body :text # body :text
# email_state :integer(4) default(0), not null # email_state :integer default(0), not null
# private :boolean(1) # private :boolean
# created_at :datetime # created_at :datetime
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
id: 1
two:
id: 2

View File

@ -1,19 +1,13 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: order_comments # Table name: order_comments
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# order_id :integer(4) # order_id :integer
# user_id :integer(4) # user_id :integer
# text :text # text :text
# created_at :datetime # created_at :datetime
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
# one:
# column: value
#
# two:
# column: value

View File

@ -1,20 +1,16 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410 # Schema version: 20090119155930
# #
# Table name: orders # Table name: orders
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# supplier_id :integer(4) # supplier_id :integer
# note :text # note :text
# starts :datetime # starts :datetime
# ends :datetime # ends :datetime
# state :string(255) default("open") # state :string(255) default("open")
# lock_version :integer(4) default(0), not null # lock_version :integer default(0), not null
# updated_by_user_id :integer(4) # updated_by_user_id :integer
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first:
id: 1
another:
id: 2

View File

@ -1,5 +0,0 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first:
id: 1
another:
id: 2

View File

@ -1,28 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090115232435 # Schema version: 20090119155930
# #
# Table name: stock_changes # Table name: stock_changes
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# delivery_id :integer(4) # delivery_id :integer
# order_id :integer(4) # order_id :integer
# article_id :integer(4) # article_id :integer
# quantity :decimal(6, 2) default(0.0) # quantity :decimal(6, 2) default(0.0)
# created_at :datetime # created_at :datetime
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
delivery:
order:
article:
quantity: 1
created_at: 2009-01-16 00:24:35
two:
delivery:
order:
article:
quantity: 1
created_at: 2009-01-16 00:24:35

View File

@ -19,17 +19,20 @@
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first: terra:
id: 1
name: Terra name: Terra
delivery_days: tuesday
contact_person: thomas terra
url: www.terra-natur.de
note:
fax: 01324-343444
phone: 0123-555555
order_howto:
phone2: 01234-7878787
address: berlin bio address: berlin bio
customer_number: 123478 phone: 0123-555555
phone2: 01234-7878787
fax: 01324-343444
email: terra@terra.com email: terra@terra.com
url: www.terra-natur.de
contact_person: Harry
customer_number: 123478
delivery_days: tuesday
order_howto: call or send email/fax
note:
Terra possibly delivers also on other days than tuesday. Don't
hesitate to ask for it.
min_order_quantity: 80,-€ (gross)

View File

@ -1,22 +1,18 @@
# == Schema Information # == Schema Information
# Schema version: 20090114101610 # Schema version: 20090119155930
# #
# Table name: tasks # Table name: tasks
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# name :string(255) default(""), not null # name :string(255) default(""), not null
# description :string(255) # description :string(255)
# due_date :date # due_date :date
# done :boolean(1) # done :boolean
# workgroup_id :integer(4) # workgroup_id :integer
# assigned :boolean(1) # assigned :boolean
# created_on :datetime not null # created_on :datetime not null
# updated_on :datetime not null # updated_on :datetime not null
# required_users :integer(4) default(1) # required_users :integer default(1)
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
id: 1
two:
id: 2

View File

@ -1,9 +1,9 @@
# == Schema Information # == Schema Information
# Schema version: 20090102171850 # Schema version: 20090120184410
# #
# Table name: users # Table name: users
# #
# id :integer(4) not null, primary key # id :integer not null, primary key
# nick :string(255) default(""), not null # nick :string(255) default(""), not null
# password_hash :string(255) default(""), not null # password_hash :string(255) default(""), not null
# password_salt :string(255) default(""), not null # password_salt :string(255) default(""), not null
@ -11,7 +11,6 @@
# last_name :string(255) default(""), not null # last_name :string(255) default(""), not null
# email :string(255) default(""), not null # email :string(255) default(""), not null
# phone :string(255) # phone :string(255)
# address :string(255)
# created_on :datetime not null # created_on :datetime not null
# reset_password_token :string(255) # reset_password_token :string(255)
# reset_password_expires :datetime # reset_password_expires :datetime
@ -20,17 +19,16 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
admin: admin:
id: 1
nick: admin nick: admin
first_name: Anton first_name: Anton
last_name: Admininistrator last_name: Admininistrator
email: admin@foo.test email: admin@foo.test
#TODO: password can't loaded directyl to the database password_hash: a3c77e64311ad37161e582b28737d1e420962538
#password_hash: password_salt: LNpP/lca
#password_salt:
test: test:
id: 2
nick: test nick: test
first_name: Tim first_name: Tim
last_name: Tester last_name: Tester
email: test@foo.test email: test@foo.test
password_hash: 5549cd54032a72435037893b02d95ebef13cdc57
password_salt: DxnbIF1h

View File

@ -1,7 +0,0 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
# one:
# column: value
#
# two:
# column: value