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)
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?
(units_to_order * price.unit_quantity) == group_orders_sum[:quantity]
end

View File

@ -1,14 +1,14 @@
- title "Administration"
%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%"}
.box_title
%h2 Neuste Benutzer
%h2 Neuste Benutzerinnen
.column_content
%table
%tr
%th Nick
%th Benutzername
%th Name
%th Erstellt am
- for user in @users
@ -27,7 +27,7 @@
.column_content
%table
%tr
%th Name
%th Gruppenname
%th Typ
%th Mitglieder
- for group in @groups

View File

@ -13,7 +13,7 @@
#change_supplier{:style => "padding:0 0 0.5em 0.7em;"}
%span{:style => "float:left"}
Lieferant wechseln:
Lieferantin wechseln:
- form_tag do
= select_tag :switch_supplier, |
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"
%p
%b Lieferant:
%b Lieferantin:
= @supplier.name
%p
%b Rechnungsbetrag:

View File

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

View File

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

View File

@ -32,7 +32,7 @@
%tfoot
%tr{:class => cycle('even', 'odd', :name => 'results')}
%td
%td{:style => "width:8em"} Summe
%td{:style => "width:8em"} Summe (FC-Preis)
%td{:id => "group_orders_sum_quantity_#{order_article.id}"}
= order_article.group_orders_sum[:quantity]
%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?
%span{:style => "color:red;font-weight: bold"} !
%td= order_article.price.unit_quantity.to_s + ' * ' + order_article.article.unit.to_s
%td= number_to_currency(order_article.price.price, :unit => "")
%td= number_to_currency(order_article.price.gross_price, :unit => "")
%td
= 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.deposit
%td

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@
- unless params[:sort_by_ordergroups]
#user_filter{:style => "float:left; margin-right:2em;"}
%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 )
= observe_field 'query', :frequency => 2, |
@ -25,7 +25,7 @@
:with => 'query', |
:method => :get |
=_ "Sort by Ordergroups :"
=_ "Nach Bestellgruppen sortieren:"
- form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do
= check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups], :onclick => "submit();"
#users

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
- form_tag do
Neue Bestellung anlegen für
%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
%br/
.left_column{:style => "width:55em"}
@ -16,7 +16,7 @@
%table.list
%thead
%tr
%th Lieferant
%th Lieferantin
%th Ende
%th Notiz
%th{:colspan => "2"}

View File

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

View File

@ -4,5 +4,5 @@
= link_to h(@current_user.nick), my_profile_path, { :title => _("User Settings") }
- if APP_CONFIG[:homepage]
%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'

View File

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

View File

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

View File

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

View File

@ -11,7 +11,7 @@
%table.list{:style => "width:30em"}
%tr
%th Artikel
%th Lieferant
%th Lieferantin
%th Einheit
%th Menge
- 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.error_messages
%p
Lieferant
Lieferantin
%br/
= form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] }
%p

View File

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

View File

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

View File

@ -6,7 +6,7 @@
.column_content
- if shared_supplier = @supplier.shared_supplier
%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"}
%tr

View File

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

View File

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

View File

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