update balancing screen

This commit is contained in:
wvengen 2013-12-18 22:08:02 +01:00
parent 873a1ff108
commit 84fe791078
7 changed files with 18 additions and 10 deletions

View file

@ -15,4 +15,14 @@ module OrdersHelper
options += [[I18n.t('helpers.orders.option_stock'), url_for(action: 'new', supplier_id: 0)]] options += [[I18n.t('helpers.orders.option_stock'), url_for(action: 'new', supplier_id: 0)]]
options_for_select(options) options_for_select(options)
end end
def units_history_line(order_article)
if order_article.order.open?
nil
else
units_info = "#{order_article.units_to_order} ordered"
units_info += ", #{order_article.units_billed} billed" unless order_article.units_billed.nil?
units_info += ", #{order_article.units_received} received" unless order_article.units_received.nil?
end
end
end end

View file

@ -1,8 +1,9 @@
%td.closed %td.closed
= link_to order_article.article.name, '#', 'data-toggle-this' => "#group_order_articles_#{order_article.id}" = link_to order_article.article.name, '#', 'data-toggle-this' => "#group_order_articles_#{order_article.id}"
%td= order_article.article.order_number %td= order_article.article.order_number
%td %td{title: units_history_line(order_article)}
= order_article.units_to_order = order_article.units
%i.package pkg
- 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} × #{order_article.article.unit} %td #{order_article.price.unit_quantity} × #{order_article.article.unit}

View file

@ -19,7 +19,7 @@
%td= show_user(order.updated_by) %td= show_user(order.updated_by)
%td %td
- unless order.closed? - unless order.closed?
= link_to t('.receive'), edit_finance_receive_path(order), class: 'btn btn-mini' = link_to t('orders.index.action_receive'), receive_order_path(order), class: 'btn btn-mini'
= link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini btn-primary' = link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini btn-primary'
= link_to t('.close'), close_direct_finance_order_path(order), = link_to t('.close'), close_direct_finance_order_path(order),
:confirm => t('.confirm'), :method => :put, class: 'btn btn-mini' :confirm => t('.confirm'), :method => :put, class: 'btn btn-mini'

View file

@ -36,11 +36,7 @@
%td= "#{order_article.quantity} + #{order_article.tolerance}" %td= "#{order_article.quantity} + #{order_article.tolerance}"
- else - else
%td= "#{order_article.quantity}" %td= "#{order_article.quantity}"
- unless order.open? %td{title: units_history_line(order_article)}
- units_info = "#{order_article.units_to_order} ordered"
- units_info += ", #{order_article.units_billed} billed" unless order_article.units_billed.nil?
- units_info += ", #{order_article.units_received} received" unless order_article.units_received.nil?
%td{title: units_info}
= units = units
%i.package pkg %i.package pkg
%p %p

View file

@ -54,7 +54,7 @@
%td= truncate(order.note) %td= truncate(order.note)
%td %td
-# TODO btn-success class only if not received before -# TODO btn-success class only if not received before
= link_to t('.receive'), receive_order_path(order), class: 'btn btn-small btn-success' = link_to t('.action_receive'), receive_order_path(order), class: 'btn btn-small btn-success'
%td %td
= link_to t('ui.edit'), '#', class: 'btn btn-small disabled' = link_to t('ui.edit'), '#', class: 'btn btn-small disabled'

View file

@ -33,7 +33,7 @@
confirm: t('.confirm_end', order: @order.name) confirm: t('.confirm_end', order: @order.name)
- elsif not @order.closed? - elsif not @order.closed?
-# TODO btn-success class only if not received before -# TODO btn-success class only if not received before
= link_to t('orders.index.receive'), receive_order_path(@order), class: 'btn btn-success' = link_to t('orders.index.action_receive'), receive_order_path(@order), class: 'btn btn-success'
- unless @order.closed? - unless @order.closed?
= link_to t('ui.delete'), @order, confirm: t('.confirm_delete'), method: :delete, = link_to t('ui.delete'), @order, confirm: t('.confirm_delete'), method: :delete,
class: 'btn btn-danger' class: 'btn btn-danger'

View file

@ -1114,6 +1114,7 @@ en:
title: Article title: Article
index: index:
action_end: Close action_end: Close
action_receive: Receive
confirm_delete: Do you really want to delete the order? confirm_delete: Do you really want to delete the order?
confirm_end: Do you really want to close the order %{order}? There is no going back. confirm_end: Do you really want to close the order %{order}? There is no going back.
closed_orders: Settled orders closed_orders: Settled orders