From 524d9b7c7a921fd577fbece3626a557dac00db1a Mon Sep 17 00:00:00 2001 From: benni Date: Tue, 26 Jun 2012 23:18:55 +0200 Subject: [PATCH 1/6] Fixed rake task to create weekly tasks. --- lib/tasks/foodsoft.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/foodsoft.rake b/lib/tasks/foodsoft.rake index c1444361..446f2ace 100644 --- a/lib/tasks/foodsoft.rake +++ b/lib/tasks/foodsoft.rake @@ -25,7 +25,9 @@ namespace :foodsoft do workgroups = Workgroup.all :conditions => {:weekly_task => true} for workgroup in workgroups puts "Create weekly tasks for #{workgroup.name}" - workgroup.next_weekly_tasks[3..5].each do |date| + # Loop through next tasks weekly tasks method, + # skip the next 3 weeks, to allow manually deleting tasks + workgroup.next_weekly_tasks[3..-1].each do |date| unless workgroup.tasks.exists?({:due_date => date, :weekly => true}) workgroup.tasks.create(workgroup.task_attributes(date)) end From 7b7d50a2353d798b0ff47abd58a7f1e7a9b32e56 Mon Sep 17 00:00:00 2001 From: benni Date: Mon, 28 May 2012 10:41:33 +0200 Subject: [PATCH 2/6] Added database indexes. Performance boost for balance page. Conflicts: db/schema.rb --- db/migrate/20120512211613_add_order_indexes.rb | 11 +++++++++++ db/schema.rb | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 db/migrate/20120512211613_add_order_indexes.rb diff --git a/db/migrate/20120512211613_add_order_indexes.rb b/db/migrate/20120512211613_add_order_indexes.rb new file mode 100644 index 00000000..e2f5eda2 --- /dev/null +++ b/db/migrate/20120512211613_add_order_indexes.rb @@ -0,0 +1,11 @@ +class AddOrderIndexes < ActiveRecord::Migration + def self.up + add_index :group_order_articles, :group_order_id + add_index :group_order_articles, :order_article_id + end + + def self.down + remove_index :group_order_articles, :group_order_id + remove_index :group_order_articles, :order_article_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 603b6564..0e034bbd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -114,6 +114,8 @@ ActiveRecord::Schema.define(:version => 20120622094337) do end add_index "group_order_articles", ["group_order_id", "order_article_id"], :name => "goa_index", :unique => true + add_index "group_order_articles", ["group_order_id"], :name => "index_group_order_articles_on_group_order_id" + add_index "group_order_articles", ["order_article_id"], :name => "index_group_order_articles_on_order_article_id" create_table "group_orders", :force => true do |t| t.integer "ordergroup_id", :default => 0, :null => false From 2c1385c9ce3013dfc9e65a61bf112b17966d962b Mon Sep 17 00:00:00 2001 From: davidrabel Date: Wed, 18 Jul 2012 22:16:08 +0200 Subject: [PATCH 3/6] =?UTF-8?q?Preis=C3=A4nderungen=20beim=20Abrechnen=20k?= =?UTF-8?q?=C3=B6nnen=20auch=20global=20angewandt=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/finance/balancing_controller.rb | 2 +- app/models/order_article.rb | 5 ++++- app/views/finance/balancing/_order_article_form.html.haml | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/finance/balancing_controller.rb b/app/controllers/finance/balancing_controller.rb index b66ed869..73ff59f5 100644 --- a/app/controllers/finance/balancing_controller.rb +++ b/app/controllers/finance/balancing_controller.rb @@ -136,7 +136,7 @@ class Finance::BalancingController < ApplicationController def update_order_article @order_article = OrderArticle.find(params[:id]) begin - @order_article.update_article_and_price!(params[:article], params[:price], params[:order_article]) + @order_article.update_article_and_price!(params[:article], params[:price], params[:order_article], params[:price_global]) render :update do |page| page["edit_box"].hide page["summary"].replace_html :partial => 'summary', :locals => {:order => @order_article.order} diff --git a/app/models/order_article.rb b/app/models/order_article.rb index 1c32b2c0..f64d5ba6 100644 --- a/app/models/order_article.rb +++ b/app/models/order_article.rb @@ -77,10 +77,12 @@ class OrderArticle < ActiveRecord::Base end # Updates order_article and belongings during balancing process - def update_article_and_price!(article_attributes, price_attributes, order_article_attributes) + def update_article_and_price!(article_attributes, price_attributes, order_article_attributes, global_attribute) OrderArticle.transaction do # Updates article article.update_attributes!(article_attributes) + article.update_attributes!(price_attributes) if global_attribute + article_price.attributes = price_attributes if article_price.changed? @@ -92,6 +94,7 @@ class OrderArticle < ActiveRecord::Base # Updates ordergroup values group_order_articles.each { |goa| goa.group_order.update_price! } end + # Updates units_to_order self.attributes = order_article_attributes diff --git a/app/views/finance/balancing/_order_article_form.html.haml b/app/views/finance/balancing/_order_article_form.html.haml index d85e894a..a7257cf0 100644 --- a/app/views/finance/balancing/_order_article_form.html.haml +++ b/app/views/finance/balancing/_order_article_form.html.haml @@ -11,6 +11,8 @@ %th Netto %th MwSt. %th Pfand + %th + %abbr{:title=>"Aendert den Preis auch fuer zukuenftige Bestellungen"} Preisaenderung (Preis/MwSt/Pfand) global anwenden %tr %td= text_field_tag 'article[name]', @order_article.article.name, :size => 20 %td= text_field_tag 'article[order_number]', @order_article.article.order_number, :size => 3 @@ -20,7 +22,8 @@ %td= text_field_tag 'price[price]', @order_article.price.price, :size => 3 %td= text_field_tag 'price[tax]', @order_article.price.tax, :size => 3 %td= text_field_tag 'price[deposit]', @order_article.price.deposit, :size => 3 + %td= check_box_tag 'price_global' %br/ = submit_tag "Speichern" | -= link_to_function 'Abbrechen', "Element.hide('edit_box')" \ No newline at end of file += link_to_function 'Abbrechen', "Element.hide('edit_box')" From cda3c37e204ffa67860b4157d3f8c1949ffb9d82 Mon Sep 17 00:00:00 2001 From: davidrabel Date: Thu, 19 Jul 2012 15:37:17 +0200 Subject: [PATCH 4/6] =?UTF-8?q?Umlaute=20eingef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/finance/balancing/_order_article_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/finance/balancing/_order_article_form.html.haml b/app/views/finance/balancing/_order_article_form.html.haml index a7257cf0..983c74f6 100644 --- a/app/views/finance/balancing/_order_article_form.html.haml +++ b/app/views/finance/balancing/_order_article_form.html.haml @@ -12,7 +12,7 @@ %th MwSt. %th Pfand %th - %abbr{:title=>"Aendert den Preis auch fuer zukuenftige Bestellungen"} Preisaenderung (Preis/MwSt/Pfand) global anwenden + %abbr{:title=>"Ändert den Preis auch für zukünftige Bestellungen"} Preisänderung (Preis/MwSt/Pfand) global anwenden %tr %td= text_field_tag 'article[name]', @order_article.article.name, :size => 20 %td= text_field_tag 'article[order_number]', @order_article.article.order_number, :size => 3 From 7cf0308adb00c49ea1ba9d443033db6d4f2b6c04 Mon Sep 17 00:00:00 2001 From: benni Date: Fri, 20 Jul 2012 14:55:52 +0200 Subject: [PATCH 5/6] Added rbenv version file to change ruby version. --- .gitignore | 1 - .rbenv-version | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .rbenv-version diff --git a/.gitignore b/.gitignore index 13b34ab5..69e73788 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,3 @@ config/initializers/session_store.rb .idea .rvmrc .get-dump.yml -.rbenv-version diff --git a/.rbenv-version b/.rbenv-version new file mode 100644 index 00000000..651f0b9a --- /dev/null +++ b/.rbenv-version @@ -0,0 +1 @@ +1.8.7-p357 From 7c07fa1b5430a5bb6bb57082c99dfd237eec6884 Mon Sep 17 00:00:00 2001 From: benni Date: Fri, 20 Jul 2012 15:03:22 +0200 Subject: [PATCH 6/6] Bumped new version: 3.1.1 --- VERSION | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..94ff29cc --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +3.1.1