simplify i18n and fix some small ui issues

This commit is contained in:
wvengen 2013-11-23 17:28:21 +01:00
parent 135e938d3d
commit 652a392b37
7 changed files with 58 additions and 165 deletions

View file

@ -27,22 +27,22 @@
%h2= @order.name
%dl.dl-horizontal
- unless @order.note.blank?
%dt= t '.note'
%dt= heading_helper Order, :note
%dd= @order.note
%dt= t '.created_by'
%dt= heading_helper Order, :created_by
%dd= show_user_link(@order.created_by)
%dt= t '.ending'
%dt= heading_helper Order, :ends
%dd= format_time(@order.ends)
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
%dt= t '.min_quantity'
%dt= heading_helper Supplier, :min_order_quantity, short: true
%dd= @order.supplier.min_order_quantity
%dt= t '.sum_amount'
%dd= number_to_currency @order.sum
%dt= t '.last_update'
%dt= heading_helper GroupOrder, :updated_by
%dd
= show_user(@group_order.updated_by) if @group_order.updated_by
(#{format_time(@group_order.updated_on)})
%dt= t '.funds'
%dt= heading_helper Ordergroup, :available_funds
%dd= number_to_currency(@ordering_data[:available_funds])
.well.pull-right
@ -65,20 +65,20 @@
%table.table.table-hover
%thead
%tr
%th= t '.name'
%th= heading_helper Article, :name
- if @order.stockit?
%th{style: 'width:120px'}= t '.supplier'
%th{style: 'width:120px'}= heading_helper StockArticle, :supplier
%th{style: "width:13px;"}
%th{style: "width:4.5em;"}= t '.price'
%th{style: "width:4.5em;"}= t '.unit'
%th{style: "width:4.5em;"}= heading_helper Article, :unit
- unless @order.stockit?
%th{style: "width:70px;"}= t '.unit_missing'
%th#col_required= t '.amount'
%th#col_tolerance= t '.tolerance'
%th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true
%th#col_required= heading_helper GroupOrderArticle, :quantity
%th#col_tolerance= heading_helper GroupOrderArticle, :tolerance
- else
%th(style="width:20px")= t '.available'
%th#col_required= t '.amount'
%th{style: "width:15px;"}= t '.sum'
%th(style="width:20px")= heading_helper StockArticle, :available
%th#col_required= heading_helper GroupOrderArticle, :quantity
%th{style: "width:15px;"}= heading_helper GroupOrderArticle, :total_price
%tbody.list
- @order.articles_grouped_by_category.each do |category, order_articles|
%tr.list-heading.article-category
@ -132,11 +132,11 @@
%span{id: "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance]
%br/
.pull-left
#{t '.manufacturer'}: #{order_article.article.manufacturer}
#{heading_helper Article, :manufacturer}: #{order_article.article.manufacturer}
%br/
#{t '.units'}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
%br/
#{t '.note'}: #{order_article.article.note}
#{heading_helper Article, :note}: #{order_article.article.note}
%br/
#order-footer
#info-box
@ -147,7 +147,7 @@
%td.currency
%span#total_price= number_to_currency(@group_order.price)
%tr
%td= t('.available_funds') + ':'
%td= heading_helper(Ordergroup, :available_funds) + ':'
%td.currency= number_to_currency(@ordering_data[:available_funds])
%tr
%td= t('.new_funds') + ':'

View file

@ -1,9 +1,9 @@
%table.table.table-striped
%thead
%tr
%th= t '.supplier'
%th= t '.ending'
%th= t '.sum'
%th= heading_helper Order, :name
%th= heading_helper Order, :ends
%th= heading_helper GroupOrder, :price
%tbody
- for order in orders
- group_order = order.group_order(@ordergroup) # Get GroupOrder if possible

View file

@ -6,22 +6,22 @@
%h2= t '.funds.title'
%table.table.table-striped
%tr
%td= t('.funds.account_balance') + ':'
%td= heading_helper Ordergroup, :account_balance
%td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance)
%tr
%td= '- ' + t('.funds.open_orders') + ':'
%td= '- ' + t('.funds.open_orders')
%td.numeric= number_to_currency(@ordergroup.value_of_open_orders)
%tr
%td= '- ' + t('.funds.finished_orders') + ':'
%td= '- ' + t('.funds.finished_orders')
%td.numeric= number_to_currency(@ordergroup.value_of_finished_orders)
%tr
%th= t('.funds.available_funds') + ':'
%th= heading_helper Ordergroup, :available_funds
%th.numeric= number_to_currency(@ordergroup.get_available_funds)
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
// finished orders
- unless Order.finished.empty?
- unless Order.finished_not_closed.empty?
%section
%h2= t '.finished_orders.title'
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}

View file

@ -1,88 +0,0 @@
- content_for :head do
= render 'data'
= render :partial => 'order_head'
- form_tag(:action => 'saveOrder', :id => @order) do
.single_column{:style => "clear:both;margin-bottom:7em;"}
.box_title
%h2= t '.title'
.column_content
%table#order.list
%thead
%tr
%th= t 'group_orders.form.name'
%th{:style => "width:13px;"}
%th{:style => "width:4.5em;"}= t 'group_orders.form.price'
%th{:style => "width:4.5em;"}= t 'group_orders.form.unit'
%th{:style => "width:70px;"}= t 'group_orders.form.unit_missing'
%th#col_required= t 'group_orders.form.amount'
- if not @order.stockit?
%th#col_tolerance= t 'group_orders.form.tolerance'
%th{:style => "width:15px;"}= t 'group_orders.form.sum'
%tbody
- total = 0
- i = 0
- @articles_grouped_by_category.each do |category, order_articles|
%tr{:style => "background-color:#EFEFEF"}
%td{:style => "text-align:left"}
%b= h category
%td{:colspan => "9"}
- order_articles.each do |order_article|
- if FoodsoftConfig[:tolerance_is_costly]
- article_total = @price[i] * (@tolerance[i] + @quantity[i])
- else
- article_total = @price[i] * @quantity[i]
- total += article_total
%tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"}
%td.name= order_article.article.name
%td= h order_article.article.origin
%td= number_to_currency(@price[i])
%td= order_article.article.unit
%td
%span{:id => "missing_units_#{i}"}
- if @order.stockit?
- order_article.article.quantity_available
- else
- missing_units = @unit[i] - (((@quantity[i] + @others_quantity[i]) % @unit[i]) + @tolerance[i] + @others_tolerance[i])
- missing_units < 0 ? 0 : missing_units
%td.quantity
%input{:id => "q_#{i}", :name => "ordered[#{order_article.id}][quantity]", :size => "2", :type => "hidden", :value => @quantity[i]}/
%span.used{:id => "q_used_#{i}"}= @used_quantity[i]
+
%span.unused{:id => "q_unused_#{i}"}= @quantity[i] - @used_quantity[i]
= button_to_function('+', "increaseQuantity(#{i})")
= button_to_function('-', "decreaseQuantity(#{i})")
- unless @order.stockit?
%td.tolerance
%input{:id => "t_#{i}", :name => "ordered[#{order_article.id}][tolerance]", :size => "2", :type => "hidden", :value => @tolerance[i]}/
- if (@unit[i] > 1)
%span.used{:id => "t_used_#{i}"}= @used_tolerance[i]
+
%span.unused{:id => "t_unused_#{i}"}= @tolerance[i] - @used_tolerance[i]
= button_to_function('+', "increaseTolerance(#{i})")
= button_to_function('-', "decreaseTolerance(#{i})")
%td{:id => "td_price_#{i}", :style => "text-align:right; padding-right:10px; width:4em"}
%span{:id => "price_#{i}_display"}= number_to_currency(article_total, :unit => "")
.article-info
%h3= order_article.article.name
.right
= t('group_orders.form.units_full') + ':'
%span{:id => "units_#{i}"}= order_article.units_to_order
%br/
= t('group_orders.form.total_units') + ':'
%span{:id => "q_total_#{i}"}= @quantity[i] + @others_quantity[i]
%br/
= t('group_orders.form.total_tolerance') + ':'
%span{:id => "t_total_#{i}"}= @tolerance[i] + @others_tolerance[i]
%br/
.left
#{t 'group_orders.form.manufacturer'}: #{order_article.article.manufacturer}
%br/
#{t 'group_orders.form.units'}: #{@order.stockit? ? order_article.article.quantity_available : @unit[i]} * #{h order_article.article.unit}
%br/
#{t 'group_orders.form.note'}: #{order_article.article.note}
%br/
- i = i + 1
= render "order_footer", :total => total

View file

@ -9,21 +9,22 @@
.well
// Order summary
%dl.dl-horizontal
%dt= t '.supplier'
%dt= heading_helper Order, :name
%dd= @order.name
%dt= t '.note'
%dt= heading_helper Order, :note
%dd= @order.note
%dt= t '.ending'
%dt= heading_helper Order, :ends
%dd= format_time(@order.ends)
%dt= t '.order_sum'
%dt= heading_helper GroupOrder, :price
%dd
- if @group_order
= number_to_currency(@group_order.price)
- else
= t '.not_ordered'
- if @order.closed?
%p= t '.closed_by', user: show_user(@order.updated_by)
= link_to t('.comment'), "#comments"
%dt= heading_helper Order, :closed_by
%dd= show_user_link @order.updated_by
%p= link_to t('.comment'), "#comments"
// Article box
%section
@ -35,8 +36,8 @@
%table.table.table-hover
%thead
%tr
%th{style: "width:40%"}= t '.articles.name'
%th= t '.articles.units'
%th{style: "width:40%"}= heading_helper Article, :name
%th= heading_helper Article, :units
%th= t '.articles.unit_price'
%th
%abbr{title: t('.articles.ordered_title')}= t '.articles.ordered'
@ -46,7 +47,7 @@
= t '.articles.order_open'
- else
= t '.articles.order_not_open'
%th= t '.articles.total_price'
%th= heading_helper GroupOrderArticle, :total_price
%tbody
- for category_name, order_articles in @order.articles_grouped_by_category
%tr.article-category
@ -61,7 +62,7 @@
%td{style: "width:40%"}
= oa.article.name
- unless oa.article.note.blank?
= image_tag("lamp_grey.png", {alt: "Notiz anzeigen", size: "15x16", border: "0", onmouseover: "$('note_#{oa.id}').show();", onmouseout: "$('note_#{oa.id}').hide();"})
= image_tag("lamp_grey.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#note_#{oa.id}').show();", onmouseout: "$('#note_#{oa.id}').hide();"})
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
%td= number_to_currency(oa.price.fc_price)
%td
@ -73,7 +74,7 @@
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
%td{colspan: "6"}=h oa.article.note
%tr{class: cycle('even', 'odd', name: 'articles')}
%th{colspan: "5"}= t '.articles.sum'
%th{colspan: "5"}= heading_helper GroupOrder, :price
%th= number_to_currency(@group_order.price)
%br/
= link_to_top

View file

@ -7,10 +7,10 @@
%table.table.table-striped
%thead
%tr
%th= t '.supplier'
%th= t '.ending'
%th= heading_helper Order, :name
%th= heading_helper Order, :ends
%th= t '.who_ordered'
%th= t '.total'
%th= heading_helper GroupOrder, :price
%tbody
- total = 0
- Order.open.each do |order|

View file

@ -20,6 +20,7 @@ en:
supplier: Supplier
tax: VAT
unit: Unit
units: Units
unit_quantity: Unit quantity
unit_quantity_short: U.Q.
article_category:
@ -35,9 +36,15 @@ en:
note: Note
ordergroup: Ordergroup
user: Entered by
group_order:
updated_by: Last ordered by
price: Order sum
group_order_article:
ordergroup_id: Ordergroup
result: Amount
quantity: Amount
tolerance: Tolerance
total_price: Sum
invoice:
amount: Amount
date: Billing date
@ -57,6 +64,7 @@ en:
sent_to_all: Send to all members
subject: Subject
order:
closed_by: Settled by
created_by: Created by
ends: Ends at
name: Supplier
@ -64,11 +72,15 @@ en:
starts: Starts at
status: Status
order_article:
missing_units: Missing units
missing_units_short: Missing
units_to_order: Amount of units
update_current_price: Globally update current price
order_comment:
text: Add comment to this order ...
ordergroup:
available_funds: Available credit
account_balance: Account balance
contact_address: Address
contact_person: Contact person
contact_phone: Phone
@ -82,9 +94,9 @@ en:
title: Title
stock_article:
price: Price
quantity: Quantity
available: Available
quantity_available: Available quantity
supplier: Supplier
quantity_available_short: Avail.
stock_taking:
date: Date
note: Note
@ -98,6 +110,7 @@ en:
fax: Fax
is_subscribed: subscribed?
min_order_quantity: Minimum order quantity
min_order_quantity_short: Min. quantity
name: Name
note: Note
order_howto: How to order
@ -707,30 +720,14 @@ en:
notfound: Incorrect URL, this is not your order.
form:
action_save: Save order
amount: Amount
available: Available
available_funds: Available credits
created_by: Created by
ending: End
funds: Credit
last_update: Last ordered
manufacturer: Manufacturer
min_quantity: Minimum quantity
name: Name
new_funds: New account balance
note: Note
price: Price
reset_article_search: Reset search
search_article: Search for article...
sum: Sum
sum_amount: Current amount
supplier: Supplier
title: Orders
tolerance: Tolerance
total_sum_amount: Total amount
total_tolerance: Total tolerance
unit: Unit
unit_missing: Missing units
units: Units
units_full: Filled units
units_total: Total units
@ -742,9 +739,7 @@ en:
title: Unsettled orders
total_sum: Total sum
funds:
account_balance: Account balance
available_funds: Available credit
finished_orders: unsettled orders
finished_orders: Unsettled orders
open_orders: Current orders
title: Credit
title: Orders overview
@ -752,14 +747,9 @@ en:
not_enough_apples: You need at least %{stop_ordering_under} apples to order. Currently your order group has only %{apples} apples.
order:
title: Articles
orders:
ending: End
sum: Sum
supplier: Suppliers
show:
articles:
edit_order: Edit order
name: Name
not_ordered_msg: You didnt place an order yet
order_closed_msg: Sorry, this order is closed.
order_nopen_title: Considering current orders of all groups
@ -769,21 +759,14 @@ en:
ordered: Ordered
ordered_title: Amount + tolerance
show_hide: Show/hide articles not ordered
sum: Sum
show_note: Show note
title: Article overview
total_price: Total price
unit_price: Unit price
units: Units
closed_by: Settled by %{user}
comment: Comment
comments:
title: Comments
ending: End
not_ordered: You didnt order.
note: Note
order_sum: Order sum
sum: Sum
supplier: Suppliers
title: Your order result for %{order}
switch_order:
remaining: ! '%{remaining} remaining'
@ -1345,12 +1328,9 @@ en:
title: Weekly jobs
user_not_found: No user found
open_orders:
ending: Ending
no_open_orders: There are no current orders
not_enough_apples: Attention your order group has too few apple points to place an order!
supplier: Supplier
title: Current orders
total: Sum
total_sum: Total sum
who_ordered: Who ordered?
workgroup_members: