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:
Benjamin Meichsner 2009-01-29 01:57:51 +01:00
parent 80287aeea4
commit 9eb2125f15
98 changed files with 1121 additions and 1717 deletions

27
test/fixtures/article_prices.yml vendored Normal file
View file

@ -0,0 +1,27 @@
# == Schema Information
# Schema version: 20090120184410
#
# Table name: article_prices
#
# id :integer(4) not null, primary key
# article_id :integer(4)
# price :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
# unit_quantity :integer(4)
# created_at :datetime
#
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
price: 9.99
tax: 9.99
deposit: 9.99
unit_quantity: 1
two:
price: 9.99
tax: 9.99
deposit: 9.99
unit_quantity: 1

View file

@ -1,25 +1,27 @@
# == Schema Information
# Schema version: 20090119155930
# Schema version: 20090120184410
#
# Table name: articles
#
# id :integer(4) not null, primary key
# name :string(255) not null
# supplier_id :integer(4) not null
# number :string(255)
# note :string(255)
# manufacturer :string(255)
# origin :string(255)
# unit :string(255)
# price :decimal(8, 2) default(0.0), not null
# tax :decimal(3, 1) default(7.0), not null
# deposit :decimal(8, 2) default(0.0), not null
# unit_quantity :decimal(4, 1) default(1.0), not null
# scale_quantity :decimal(4, 2)
# scale_price :decimal(8, 2)
# created_on :datetime
# updated_on :datetime
# list :string(255)
# id :integer(4) not null, primary key
# name :string(255) default(""), not null
# supplier_id :integer(4) default(0), not null
# article_category_id :integer(4) default(0), not null
# unit :string(255) default(""), not null
# note :string(255)
# availability :boolean(1) default(TRUE), not null
# manufacturer :string(255)
# origin :string(255)
# shared_updated_on :datetime
# price :decimal(8, 2)
# tax :float
# deposit :decimal(8, 2) default(0.0)
# unit_quantity :integer(4) default(1), not null
# order_number :string(255)
# created_at :datetime
# updated_at :datetime
# quantity :decimal(6, 2) default(0.0)
# deleted_at :datetime
#
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -1,17 +0,0 @@
# == Schema Information
# Schema version: 20090102171850
#
# Table name: group_order_article_results
#
# id :integer(4) not null, primary key
# order_article_result_id :integer(4) default(0), not null
# group_order_result_id :integer(4) default(0), not null
# quantity :decimal(6, 3) default(0.0)
# tolerance :integer(4)
#
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first:
id: 1
another:
id: 2

View file

@ -1,23 +0,0 @@
# == Schema Information
# Schema version: 20090102171850
#
# Table name: group_order_results
#
# id :integer(4) not null, primary key
# order_id :integer(4) default(0), not null
# group_name :string(255) default(""), not null
# price :decimal(8, 2) default(0.0), not null
#
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
id: 1
order_id: 1
group_name: Order Group 1
price: 99.95
two:
id: 2
order_id: 1
group_name: Order Group 2
price: 99.95

View file

@ -1,25 +0,0 @@
# == Schema Information
# Schema version: 20090102171850
#
# Table name: order_article_results
#
# id :integer(4) not null, primary key
# order_id :integer(4) default(0), not null
# name :string(255) default(""), not null
# unit :string(255) default(""), not null
# note :string(255)
# net_price :decimal(8, 2) default(0.0)
# gross_price :decimal(8, 2) default(0.0), not null
# tax :float default(0.0), not null
# deposit :decimal(8, 2) default(0.0)
# fc_markup :float default(0.0), not null
# order_number :string(255)
# unit_quantity :integer(4) default(0), not null
# units_to_order :decimal(6, 3) default(0.0), not null
#
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first:
id: 1
another:
id: 2

19
test/fixtures/order_comments.yml vendored Normal file
View file

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

View file

@ -1,23 +1,16 @@
# == Schema Information
# Schema version: 20090102171850
# Schema version: 20090120184410
#
# Table name: orders
#
# id :integer(4) not null, primary key
# name :string(255) default(""), not null
# supplier_id :integer(4) default(0), not null
# starts :datetime not null
# supplier_id :integer(4)
# note :text
# starts :datetime
# ends :datetime
# note :string(255)
# finished :boolean(1) not null
# booked :boolean(1) not null
# state :string(255) default("open")
# lock_version :integer(4) default(0), not null
# updated_by_user_id :integer(4)
# invoice_amount :decimal(8, 2) default(0.0), not null
# deposit :decimal(8, 2) default(0.0)
# deposit_credit :decimal(8, 2) default(0.0)
# invoice_number :string(255)
# invoice_date :string(255)
#
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -1,24 +1,21 @@
# == Schema Information
# Schema version: 20090119155930
# Schema version: 20090120184410
#
# Table name: suppliers
#
# id :integer(4) not null, primary key
# name :string(255) default(""), not null
# address :string(255) default(""), not null
# phone :string(255) default(""), not null
# phone2 :string(255)
# fax :string(255)
# email :string(255)
# url :string(255)
# contact_person :string(255)
# customer_number :string(255)
# delivery_days :string(255)
# order_howto :string(255)
# note :string(255)
# shared_supplier_id :integer(4)
# min_order_quantity :string(255)
# deleted_at :datetime
# id :integer(4) not null, primary key
# name :string(255) not null
# address :string(255) not null
# phone :string(255) not null
# phone2 :string(255)
# fax :string(255)
# email :string(255)
# url :string(255)
# delivery_days :string(255)
# note :string(255)
# created_on :datetime
# updated_on :datetime
# lists :string(255)
#
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -0,0 +1,8 @@
require 'test_helper'
class ArticlePriceTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View file

@ -1,10 +0,0 @@
require File.dirname(__FILE__) + '/../test_helper'
class GroupOrderArticleResultTest < Test::Unit::TestCase
fixtures :group_order_article_results
# Replace this with your real tests.
def test_truth
assert true
end
end

View file

@ -1,10 +0,0 @@
require File.dirname(__FILE__) + '/../test_helper'
class GroupOrderResultTest < Test::Unit::TestCase
fixtures :group_order_results
# Replace this with your real tests.
def test_truth
assert true
end
end

View file

@ -1,10 +0,0 @@
require File.dirname(__FILE__) + '/../test_helper'
class OrderArticleResultTest < Test::Unit::TestCase
fixtures :order_article_results
# Replace this with your real tests.
def test_truth
assert true
end
end

View file

@ -0,0 +1,8 @@
require 'test_helper'
class OrderCommentTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end