Add pickup date

This additional date helps users to find the correct order if the time
between end and pickup varies a lot.
This commit is contained in:
Patrick Gansterer 2016-04-29 15:28:05 +02:00
parent 97f81d9826
commit f286dd6053
15 changed files with 59 additions and 9 deletions

View file

@ -33,6 +33,8 @@
%dd= show_user_link(@order.created_by)
%dt= heading_helper Order, :ends
%dd= format_time(@order.ends)
%dt= heading_helper Order, :pickup
%dd= format_date(@order.pickup)
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
%dt= heading_helper Supplier, :min_order_quantity, short: true
%dd= @order.supplier.min_order_quantity

View file

@ -2,6 +2,7 @@
%thead
%tr
%th= heading_helper Order, :name
%th= heading_helper Order, :pickup
%th= heading_helper Order, :ends
%th= heading_helper GroupOrder, :price
%tbody
@ -10,6 +11,7 @@
- order_class = group_order ? "" : "color:grey"
%tr{:class=> cycle('even', 'odd', :name => 'orders'), :style => order_class}
%td= group_order.present? ? link_to(order.name, group_order_path(group_order)) : order.name
%td= format_date(order.pickup)
%td= format_time(order.ends)
%td.numeric= group_order ? number_to_currency(group_order.price) : "--"
- if pagination

View file

@ -15,6 +15,8 @@
%dd= @order.note
%dt= heading_helper Order, :ends
%dd= format_time(@order.ends)
%dt= heading_helper Order, :pickup
%dd= format_date(@order.pickup)
%dt= heading_helper GroupOrder, :price
%dd
- if @group_order

View file

@ -4,6 +4,7 @@
= f.input :starts, as: :date_picker_time
= f.input :boxfill, as: :date_picker_time if @order.is_boxfill_useful?
= f.input :ends, as: :date_picker_time
= f.input :pickup, as: :date_picker, input_html: {class: 'input-small'}
= f.input :note, input_html: {rows: 2, class: 'input-xxlarge'}
%h2= t '.title'

View file

@ -3,6 +3,7 @@
%thead
%tr
%th= sort_link_helper heading_helper(Order, :supplier), "supplier"
%th= sort_link_helper heading_helper(Order, :pickup), "pickup"
%th= heading_helper Order, :starts
%th= sort_link_helper heading_helper(Order, :ends), "ends"
%th= heading_helper Order, :status
@ -11,6 +12,7 @@
- @orders.each do |order|
%tr
%td= order.name
%td= format_date(order.pickup)
%td= format_time(order.starts)
%td= format_time(order.ends)
%td= t(order.state, scope: 'orders.state')

View file

@ -21,6 +21,7 @@
%thead
%tr
%th= heading_helper Order, :name
%th= heading_helper Order, :pickup
%th= heading_helper Order, :ends
%th= heading_helper Order, :note
%th{colspan: "2"}
@ -30,6 +31,7 @@
- tr_class = " active" if order.expired?
%tr{class: tr_class}
%td= order.name
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends) unless order.ends.nil?
%td= truncate(order.note)
%td= link_to t('.action_end'), finish_order_path(order),
@ -50,6 +52,7 @@
- for order in @finished_orders
%tr
%td= order.name
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends)
%td= truncate(order.note)
%td

View file

@ -11,12 +11,23 @@
.well
= close_button :alert
%p
= raw t '.description1',
- description1 = raw t '.description1_order',
state: t("orders.state.#{@order.state}").capitalize,
supplier: supplier_link(@order),
who: show_user_link(@order.created_by),
starts: format_time(@order.starts),
ends: format_time(@order.ends)
who: show_user_link(@order.created_by)
- description1 += ' '
- if @order.ends
- description1 += raw t '.description1_period.starts_ends',
starts: format_time(@order.starts),
ends: format_time(@order.ends)
- else
- description1 += raw t '.description1_period.starts',
starts: format_time(@order.starts)
- if @order.pickup
- description1 += ' '
- description1 += raw t '.description1_period.pickup',
pickup: format_date(@order.pickup)
= description1 + '.'
%br
= raw t '.description2',
ordergroups: ordergroup_count(@order),

View file

@ -8,6 +8,7 @@
%thead
%tr
%th= heading_helper Order, :name
%th= heading_helper Order, :pickup
%th= heading_helper Order, :ends
%th= t '.who_ordered'
%th.numeric= heading_helper GroupOrder, :price
@ -16,6 +17,7 @@
- Order.open.each do |order|
%tr
%td= link_to_ordering(order)
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends) unless order.ends.nil?
- if group_order = order.group_order(ordergroup)
- total += group_order.price
@ -28,7 +30,7 @@
- if total > 0
%tfooter
%tr
%th(colspan="2")
%th(colspan="3")
%th= t('.total_sum') + ':'
%th.numeric= number_to_currency(total)
- else