Merge branch 'master' of git://github.com/sandoz/foodsoft

This commit is contained in:
Benjamin Meichsner 2009-03-23 10:40:03 +01:00
commit 51f9826ea6
35 changed files with 78 additions and 56 deletions

View file

@ -77,6 +77,16 @@ class OrderArticle < ActiveRecord::Base
units += ((remainder > 0) && (remainder + tolerance >= unit_size) ? 1 : 0) units += ((remainder > 0) && (remainder + tolerance >= unit_size) ? 1 : 0)
end end
# Calculate price for ordered quantity.
def total_price
units_to_order * price.price
end
# Calculate gross price for ordered qunatity.
def total_gross_price
units_to_order * price.gross_price
end
def ordered_quantities_equal_to_group_orders? def ordered_quantities_equal_to_group_orders?
(units_to_order * price.unit_quantity) == group_orders_sum[:quantity] (units_to_order * price.unit_quantity) == group_orders_sum[:quantity]
end end

View file

@ -1,14 +1,14 @@
- title "Administration" - title "Administration"
%p %p
%i Hier kannst Du die Gruppen und Benutzer der Foodsoft verwalten. %i Hier kannst Du die Gruppen und Benutzerinnen der Foodsoft verwalten.
.left_column{:style => "width:48%"} .left_column{:style => "width:48%"}
.box_title .box_title
%h2 Neuste Benutzer %h2 Neuste Benutzerinnen
.column_content .column_content
%table %table
%tr %tr
%th Nick %th Benutzername
%th Name %th Name
%th Erstellt am %th Erstellt am
- for user in @users - for user in @users
@ -27,7 +27,7 @@
.column_content .column_content
%table %table
%tr %tr
%th Name %th Gruppenname
%th Typ %th Typ
%th Mitglieder %th Mitglieder
- for group in @groups - for group in @groups

View file

@ -13,7 +13,7 @@
#change_supplier{:style => "padding:0 0 0.5em 0.7em;"} #change_supplier{:style => "padding:0 0 0.5em 0.7em;"}
%span{:style => "float:left"} %span{:style => "float:left"}
Lieferant wechseln: Lieferantin wechseln:
- form_tag do - form_tag do
= select_tag :switch_supplier, | = select_tag :switch_supplier, |
options_for_select( Supplier.all(:order => 'name').collect {|s| [s.name, url_for(supplier_articles_path(s))] }, | options_for_select( Supplier.all(:order => 'name').collect {|s| [s.name, url_for(supplier_articles_path(s))] }, |

View file

@ -1,7 +1,7 @@
- title "Lieferung bearbeiten" - title "Lieferung bearbeiten"
%p %p
%b Lieferant: %b Lieferantin:
= @supplier.name = @supplier.name
%p %p
%b Rechnungsbetrag: %b Rechnungsbetrag:

View file

@ -1,7 +1,7 @@
- title "Lieferung anzeigen" - title "Lieferung anzeigen"
%p %p
%b Lieferant: %b Lieferantin:
=h @delivery.supplier.name =h @delivery.supplier.name
%p %p
%b Geliefert am: %b Geliefert am:

View file

@ -10,8 +10,8 @@
%th Nr. %th Nr.
%th Menge %th Menge
%th GebGr * Einheit %th GebGr * Einheit
%th netto %th Netto
%th brutto %th Brutto
%th MwSt %th MwSt
%th Pfand %th Pfand
%th{:colspan => "2"} %th{:colspan => "2"}

View file

@ -32,7 +32,7 @@
%tfoot %tfoot
%tr{:class => cycle('even', 'odd', :name => 'results')} %tr{:class => cycle('even', 'odd', :name => 'results')}
%td %td
%td{:style => "width:8em"} Summe %td{:style => "width:8em"} Summe (FC-Preis)
%td{:id => "group_orders_sum_quantity_#{order_article.id}"} %td{:id => "group_orders_sum_quantity_#{order_article.id}"}
= order_article.group_orders_sum[:quantity] = order_article.group_orders_sum[:quantity]
%td{:id => "group_orders_sum_price_#{order_article.id}", :class => "currency"} %td{:id => "group_orders_sum_price_#{order_article.id}", :class => "currency"}

View file

@ -8,8 +8,14 @@
- unless order_article.ordered_quantities_equal_to_group_orders? - unless order_article.ordered_quantities_equal_to_group_orders?
%span{:style => "color:red;font-weight: bold"} ! %span{:style => "color:red;font-weight: bold"} !
%td= order_article.price.unit_quantity.to_s + ' * ' + order_article.article.unit.to_s %td= order_article.price.unit_quantity.to_s + ' * ' + order_article.article.unit.to_s
%td= number_to_currency(order_article.price.price, :unit => "") %td
%td= number_to_currency(order_article.price.gross_price, :unit => "") = number_to_currency(order_article.price.price, :unit => ""), |
"/ ", |
number_to_currency(order_article.total_price, :unit => "") |
%td
= number_to_currency(order_article.price.gross_price, :unit => ""), |
"/ ", |
number_to_currency(order_article.total_gross_price, :unit => "") |
%td= order_article.price.tax %td= order_article.price.tax
%td= order_article.price.deposit %td= order_article.price.deposit
%td %td

View file

@ -8,7 +8,7 @@
%abbr{:title=>"Anzahl gelieferter Gebinde"} Menge %abbr{:title=>"Anzahl gelieferter Gebinde"} Menge
%th Einheit %th Einheit
%th GebGr %th GebGr
%th netto %th Netto
%th MwSt. %th MwSt.
%th Pfand %th Pfand
%tr %tr

View file

@ -9,7 +9,7 @@
%tr %tr
%th Datum %th Datum
%th Betrag %th Betrag
%th Lieferant %th Lieferantin
%th %th
%tbody %tbody
- for invoice in @unpaid_invoices - for invoice in @unpaid_invoices
@ -48,7 +48,7 @@
%table.list %table.list
%thead %thead
%tr %tr
%th Lieferant %th Lieferantin
%th Ende %th Ende
%th Betrag(FC) %th Betrag(FC)
%th %th

View file

@ -8,7 +8,7 @@
- if @invoice.order - if @invoice.order
%p= "Diese Rechnung ist mit einer #{link_to "Bestellung", @invoice.order} verknüpft." %p= "Diese Rechnung ist mit einer #{link_to "Bestellung", @invoice.order} verknüpft."
%p %p
Lieferant Lieferantin
%br/ %br/
= f.select :supplier_id, Supplier.all.collect { |s| [s.name, s.id] } = f.select :supplier_id, Supplier.all.collect { |s| [s.name, s.id] }
%p %p

View file

@ -4,7 +4,7 @@
<thead> <thead>
<tr> <tr>
<th>Nummer</th> <th>Nummer</th>
<th>Lieferant</th> <th>Lieferantin</th>
<th>Datum</th> <th>Datum</th>
<th>Bezahlt am</th> <th>Bezahlt am</th>
<th>Betrag</th> <th>Betrag</th>

View file

@ -1,7 +1,7 @@
- title "Rechnung #{@invoice.number}" - title "Rechnung #{@invoice.number}"
%p %p
%b Lieferant: %b Lieferantin:
=h @invoice.supplier.name =h @invoice.supplier.name
- if @invoice.delivery - if @invoice.delivery
%p %p

View file

@ -10,7 +10,7 @@
%table.list %table.list
%thead %thead
%tr %tr
%th Nick %th Benutzername
%th Name %th Name
%th Email %th Email
%th Telefon %th Telefon

View file

@ -14,7 +14,7 @@
- unless params[:sort_by_ordergroups] - unless params[:sort_by_ordergroups]
#user_filter{:style => "float:left; margin-right:2em;"} #user_filter{:style => "float:left; margin-right:2em;"}
%form{:name=>"sform", :action=>"", :style=>"display:inline;"} %form{:name=>"sform", :action=>"", :style=>"display:inline;"}
%label{:for => 'article_name'} Suche in Name : %label{:for => 'article_name'} Suche nach Name:
= text_field_tag("query", params['query'], :size => 10 ) = text_field_tag("query", params['query'], :size => 10 )
= observe_field 'query', :frequency => 2, | = observe_field 'query', :frequency => 2, |
@ -25,7 +25,7 @@
:with => 'query', | :with => 'query', |
:method => :get | :method => :get |
=_ "Sort by Ordergroups :" =_ "Nach Bestellgruppen sortieren:"
- form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do - form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do
= check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups], :onclick => "submit();" = check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups], :onclick => "submit();"
#users #users

View file

@ -7,8 +7,8 @@
<div class="left_column" style="width: 60%;"> <div class="left_column" style="width: 60%;">
<div class="box_title"> <div class="box_title">
<h2> <h2>
Nickname: <%= h @user.nick %> <%= h @user.nick %>
<small>(Mitglied seit: <%= distance_of_time_in_words(Time.now, @user.created_on) -%>)</small># <small>(Mitglied seit: <%= distance_of_time_in_words(Time.now, @user.created_on) -%>)</small>
</h2> </h2>
</div> </div>
<div class="column_content"> <div class="column_content">
@ -29,8 +29,8 @@
<p> <p>
<%= membership.group.name %> <%= membership.group.name %>
<% if membership.group.type != 'Ordergroup' %> <% if membership.group.type != 'Ordergroup' %>
(<%= link_to _("Cancel membership"), { :action => 'cancel_membership', :membership_id => membership }, (<%= link_to _("Mitgliedschaft beenden"), { :action => 'cancel_membership', :membership_id => membership },
:confirm => _("Are you sure to cancel this membership?"), :method => :post %>) :confirm => _("Bist Du sicher, dass Du Deine Mitgliedschaft beenden willst?"), :method => :post %>)
<% end %> <% end %>
</p> </p>
<% end %> <% end %>

View file

@ -8,7 +8,7 @@
%tr{:valign => "top"} %tr{:valign => "top"}
%td{:width => "60%"} %td{:width => "60%"}
%p %p
%b Lieferant: %b Lieferantin:
=h @order.name =h @order.name
%p %p
%b Ende: %b Ende:

View file

@ -3,7 +3,7 @@
%table.list %table.list
%thead %thead
%tr %tr
%th Lieferant %th Lieferantin
%th Ende %th Ende
%th Summe %th Summe
%tbody %tbody

View file

@ -15,7 +15,7 @@
%tr{:valign => "top"} %tr{:valign => "top"}
%td{:style => "width:50%"} %td{:style => "width:50%"}
%p %p
Lieferant: Lieferantin:
%b=h @order.name %b=h @order.name
- unless @order.note.blank? - unless @order.note.blank?
%p %p

View file

@ -6,7 +6,7 @@
.column_content .column_content
= form.hidden_field :supplier_id = form.hidden_field :supplier_id
%p %p
Lieferant: Lieferantin:
= @order.name = @order.name
%p %p
Notiz Notiz

View file

@ -3,7 +3,7 @@
%thead %thead
%tr %tr
%th[sort_td_class_helper "supplier"] %th[sort_td_class_helper "supplier"]
= sort_link_helper "Lieferant", "supplier" = sort_link_helper "Lieferantin", "supplier"
%th Start %th Start
%th[sort_td_class_helper "ends"] %th[sort_td_class_helper "ends"]
= sort_link_helper "Ende", "ends" = sort_link_helper "Ende", "ends"

View file

@ -5,7 +5,7 @@
- form_tag do - form_tag do
Neue Bestellung anlegen für Neue Bestellung anlegen für
%select{:onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;"} %select{:onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;"}
%option{:selected => 'selected'} Lieferant auswählen... %option{:selected => 'selected'} Lieferantin auswählen...
= options_for_suppliers_to_select = options_for_suppliers_to_select
%br/ %br/
.left_column{:style => "width:55em"} .left_column{:style => "width:55em"}
@ -16,7 +16,7 @@
%table.list %table.list
%thead %thead
%tr %tr
%th Lieferant %th Lieferantin
%th Ende %th Ende
%th Notiz %th Notiz
%th{:colspan => "2"} %th{:colspan => "2"}

View file

@ -15,7 +15,7 @@
%p %p
%b{:style => "color:red"} Bestellung wurde noch nicht abgerechnet. %b{:style => "color:red"} Bestellung wurde noch nicht abgerechnet.
%p %p
Lieferant: Lieferantin:
%b=h @order.name %b=h @order.name
- unless @order.note.empty? - unless @order.note.empty?
%p %p

View file

@ -4,5 +4,5 @@
= link_to h(@current_user.nick), my_profile_path, { :title => _("User Settings") } = link_to h(@current_user.nick), my_profile_path, { :title => _("User Settings") }
- if APP_CONFIG[:homepage] - if APP_CONFIG[:homepage]
%li= link_to APP_CONFIG[:name], APP_CONFIG[:homepage], { :title => _("Go to your FoodCoop-Hompage") } %li= link_to APP_CONFIG[:name], APP_CONFIG[:homepage], { :title => _("Go to your FoodCoop-Hompage") }
%li= link_to _("Help"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku' %li= link_to _("Hilfe"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku'
%li= link_to _("Logout"), :controller => '/login', :action => 'logout' %li= link_to _("Logout"), :controller => '/login', :action => 'logout'

View file

@ -5,7 +5,7 @@
%table.list %table.list
%thead %thead
%tr %tr
%th Lieferant %th Lieferantin
%th Ende %th Ende
%th Wer hat bestellt? %th Wer hat bestellt?
%th Summe %th Summe

View file

@ -2,34 +2,34 @@
<table style="float:left;width:52%;"> <table style="float:left;width:52%;">
<tr> <tr>
<td><%= @form.label :nick %></td> <td><%= @form.label :nick, "Benutzername" %></td>
<td><%= @form.text_field :nick %></td> <td><%= @form.text_field :nick %></td>
</tr> </tr>
<tr> <tr>
<td><%= @form.label :first_name %></td> <td><%= @form.label :first_name, "Vorname" %></td>
<td><%= @form.text_field :first_name %></td> <td><%= @form.text_field :first_name %></td>
</tr> </tr>
<tr> <tr>
<td><%= @form.label :last_name %></td> <td><%= @form.label :last_name, "Nachname" %></td>
<td><%= @form.text_field :last_name %></td> <td><%= @form.text_field :last_name %></td>
</tr> </tr>
<tr> <tr>
<td><%= @form.label :email %></td> <td><%= @form.label :email, "E-Mail" %></td>
<td><%= @form.text_field :email %></td> <td><%= @form.text_field :email %></td>
</tr> </tr>
<tr> <tr>
<td><%= @form.label :phone %></td> <td><%= @form.label :phone, "Telefon" %></td>
<td><%= @form.text_field :phone %></td> <td><%= @form.text_field :phone %></td>
</tr> </tr>
<tr> <tr>
<td/> <td/>
</tr> </tr>
<tr> <tr>
<td><%= @form.label :password, "Password" %></td> <td><%= @form.label :password, "Passwort" %></td>
<td><%= @form.password_field :password %></td> <td><%= @form.password_field :password %></td>
</tr> </tr>
<tr> <tr>
<td><%= @form.label :password_confirmation, "Password confirmation" %></td> <td><%= @form.label :password_confirmation, "Passwort-Wiederholung" %></td>
<td><%= @form.password_field :password_confirmation %></td> <td><%= @form.password_field :password_confirmation %></td>
</tr> </tr>
</table> </table>

View file

@ -1,7 +1,7 @@
- remote_form_for stock_article, :url => add_stock_article_stock_takings_path do |form| - remote_form_for stock_article, :url => add_stock_article_stock_takings_path do |form|
= form.error_messages = form.error_messages
%p %p
Lieferant Lieferantin
%br/ %br/
= form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] } = form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] }
%p %p

View file

@ -11,7 +11,7 @@
%table.list{:style => "width:30em"} %table.list{:style => "width:30em"}
%tr %tr
%th Artikel %th Artikel
%th Lieferant %th Lieferantin
%th Einheit %th Einheit
%th Menge %th Menge
- for stock_change in @stock_taking.stock_changes.all :include => :stock_article - for stock_change in @stock_taking.stock_changes.all :include => :stock_article

View file

@ -1,7 +1,7 @@
- form_for stock_article do |form| - form_for stock_article do |form|
= form.error_messages = form.error_messages
%p %p
Lieferant Lieferantin
%br/ %br/
= form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] } = form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] }
%p %p

View file

@ -30,7 +30,7 @@
%th davon bestellt %th davon bestellt
%th Einheit %th Einheit
%th Preis %th Preis
%th Lieferant %th Lieferantin
%th Kategorie %th Kategorie
%th %th
%tbody %tbody

View file

@ -2,7 +2,7 @@
.left_column{:style => "width:60%"} .left_column{:style => "width:60%"}
.box_title .box_title
%h2 Lieferanten %h2 Lieferantinnen
.column_content .column_content
%p %p
%i %i
@ -10,13 +10,13 @@
= link_to 'neue Lieferantin', new_supplier_path = link_to 'neue Lieferantin', new_supplier_path
oder oder
= link_to 'importiere', shared_suppliers_suppliers_path = link_to 'importiere', shared_suppliers_suppliers_path
aus der externen ArtikelDatenbank. aus der externen Artikeldatenbank.
%table.list %table.list
%thead %thead
%tr %tr
%th Name %th Name
%th Telefon %th Telefon
%th KundenNr %th Kunden-Nr
%th %th
%th %th
%th %th
@ -38,7 +38,7 @@
%tr %tr
%th Datum %th Datum
%th Betrag %th Betrag
%th Lieferant %th Lieferantin
- for delivery in @deliveries - for delivery in @deliveries
%tr %tr
%td= link_to delivery.delivered_on, [delivery.supplier, delivery] %td= link_to delivery.delivered_on, [delivery.supplier, delivery]

View file

@ -6,7 +6,7 @@
.column_content .column_content
- if shared_supplier = @supplier.shared_supplier - if shared_supplier = @supplier.shared_supplier
%p %p
%strong Der Lieferant ist mit der externen ArtikleDatenbank verknüpft. %strong Die Lieferantin ist mit der externen Artikledatenbank verknüpft.
%table{:style => "width:40em"} %table{:style => "width:40em"}
%tr %tr

View file

@ -56,7 +56,8 @@ input, textarea, select {
border: 1px solid #D7D7D7; border: 1px solid #D7D7D7;
font-family: verdana, arial, helvetica, sans-serif; font-family: verdana, arial, helvetica, sans-serif;
font-size: 0.9em; font-size: 0.9em;
padding: .2em; } padding-left: .2em;
padding-right: .2em; }
input:focus, textarea:focus, select:focus { input:focus, textarea:focus, select:focus {
border-color: #000; } border-color: #000; }
@ -67,7 +68,8 @@ input[type="button"], input[type="submit"], input[type="reset"] {
color: #222222; color: #222222;
padding: 0.1em 0.5em; padding: 0.1em 0.5em;
font-size: 1em; font-size: 1em;
font-weight: bold; } font-weight: bold;
min-width: 34px; }
select { select {
max-width: 15em; } max-width: 15em; }

View file

@ -56,7 +56,8 @@ input, textarea, select {
border: 1px solid #D7D7D7; border: 1px solid #D7D7D7;
font-family: verdana, arial, helvetica, sans-serif; font-family: verdana, arial, helvetica, sans-serif;
font-size: 0.9em; font-size: 0.9em;
padding: .2em; } padding-left: .2em;
padding-right: .2em; }
input:focus, textarea:focus, select:focus { input:focus, textarea:focus, select:focus {
border-color: #000; } border-color: #000; }
@ -67,7 +68,8 @@ input[type="button"], input[type="submit"], input[type="reset"] {
color: #222222; color: #222222;
padding: 0.1em 0.5em; padding: 0.1em 0.5em;
font-size: 1em; font-size: 1em;
font-weight: bold; } font-weight: bold;
min-width: 34px; }
select { select {
max-width: 15em; } max-width: 15em; }

View file

@ -66,7 +66,8 @@ input, textarea, select
border: 1px solid #D7D7D7 border: 1px solid #D7D7D7
font-family: verdana, arial, helvetica, sans-serif font-family: verdana, arial, helvetica, sans-serif
font-size: 0.9em font-size: 0.9em
padding: .2em padding-left: .2em
padding-right: .2em
input:focus, textarea:focus, select:focus input:focus, textarea:focus, select:focus
border-color: #000 border-color: #000
@ -78,6 +79,7 @@ input[type="button"], input[type="submit"], input[type="reset"]
padding: 0.1em 0.5em padding: 0.1em 0.5em
font-size: 1em font-size: 1em
font-weight: bold font-weight: bold
min-width: 34px
select select
max-width: 15em max-width: 15em