Introduced group_order_article.result to save the result for each group/article.

This commit is contained in:
Benjamin Meichsner 2009-02-04 16:41:01 +01:00
parent 6fd5d825f9
commit 251ced4fa1
27 changed files with 106 additions and 137 deletions

View file

@ -4,7 +4,7 @@
%th{:colspan => '3'} Legende
%tr
%th{:style => 'width:70%'} Bestellgruppe
%th Bestellt
%th Bestellt (Menge + Toleranz)
%th Bekommen
%th Gesamtpreis
@ -19,8 +19,8 @@
- for goa in order_article.group_order_articles
%tr{:class => cycle('even', 'odd', :name => 'groups')}
%td{:style => "width:70%"}=h goa.group_order.ordergroup.name
%td= "#{goa.quantity} (#{goa.tolerance})"
%td= "#{goa.quantity} + #{goa.tolerance}"
%td
%b= "#{goa.quantity_result} + #{goa.tolerance_result}"
%td= number_to_currency(order_article.price.fc_price * goa.quantity)
%b= goa.result
%td= number_to_currency(order_article.price.fc_price * goa.result)
- reset_cycle('groups')

View file

@ -3,7 +3,7 @@
%tr
%th{:style => "width:40%"} Name
%th
%acronym{:title => "zugeteilte Einheiten (davon aus Toleranzmenge)"} Menge
%acronym{:title => "zugeteilte Einheiten"} Menge
%th
%acronym{:title => "Preis incl. MwSt, Pfand und Foodcoop-Aufschlag"} FC-Preis
%th
@ -20,11 +20,11 @@
- total = 0
- for goa in group_order.group_order_articles.ordered.all(:include => :order_article)
- fc_price = goa.order_article.price.fc_price
- subTotal = fc_price * goa.quantity
- subTotal = fc_price * goa.result
- total += subTotal
%tr{:class => cycle('even', 'odd', :name => 'articles')}
%td{:style => "width:40%"}=h goa.order_article.article.name
%td= "#{goa.result[:quantity]} (#{goa.result[:tolerance]})"
%td= goa.result
%td= number_to_currency(fc_price)
%td= goa.order_article.price.unit_quantity
%td= goa.order_article.article.unit