Compare commits
24 commits
demo
...
uxui_group
Author | SHA1 | Date | |
---|---|---|---|
|
362728fd51 | ||
|
376148f8e5 | ||
|
7347bff156 | ||
|
d0147986d9 | ||
|
6cec721d4d | ||
|
dd7beab9bd | ||
|
c3761095e7 | ||
|
9dca57dcef | ||
|
8b86959f13 | ||
|
fead6a1c0d | ||
|
a0d62f7948 | ||
|
657b3e63bc | ||
|
fec94f9683 | ||
|
5e9bd17606 | ||
|
ae09bbaced | ||
|
a847d86121 | ||
|
2530535244 | ||
|
fbe3799c97 | ||
|
3fa8dba5df | ||
|
4150403a33 | ||
86708f6f8d | |||
37743d4586 | |||
91a38bc73b | |||
782194cd08 |
18 changed files with 402 additions and 301 deletions
|
@ -179,17 +179,13 @@ function updateBalance() {
|
||||||
var balance = groupBalance - total;
|
var balance = groupBalance - total;
|
||||||
$('#new_balance').html(I18n.l("currency", balance));
|
$('#new_balance').html(I18n.l("currency", balance));
|
||||||
$('#total_balance').val(I18n.l("currency", balance));
|
$('#total_balance').val(I18n.l("currency", balance));
|
||||||
// determine bgcolor and submit button state according to balance
|
|
||||||
var bgcolor = '';
|
|
||||||
if (balance < minimumBalance) {
|
if (balance < minimumBalance) {
|
||||||
bgcolor = '#FF0000';
|
|
||||||
$('#submit_button').attr('disabled', 'disabled')
|
$('#submit_button').attr('disabled', 'disabled')
|
||||||
|
$('#balance-alert').css('display', 'block')
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#submit_button').removeAttr('disabled')
|
$('#submit_button').removeAttr('disabled')
|
||||||
}
|
$('#balance-alert').css('display', 'none')
|
||||||
// update bgcolor
|
|
||||||
for (i in itemTotal) {
|
|
||||||
$('#td_price_' + i).css('background-color', bgcolor);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ table {
|
||||||
margin: .5em 0;
|
margin: .5em 0;
|
||||||
|
|
||||||
input:disabled {
|
input:disabled {
|
||||||
background-color: red; }
|
background-color: gray; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,6 +241,9 @@ table {
|
||||||
tr.order-article:hover .article-info {
|
tr.order-article:hover .article-info {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
tr.order-article:focus .article-info {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#order-footer {
|
#order-footer {
|
||||||
|
@ -275,10 +278,13 @@ tr.order-article .article-info {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.order-article:hover .article-info {
|
tr.order-article:focus .article-info {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tr.order-article:focus {
|
||||||
|
background-color: #E9E9E9;
|
||||||
|
}
|
||||||
|
|
||||||
// ********* Articles
|
// ********* Articles
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,23 @@
|
||||||
.list .missing-many td, .list .missing-many:hover td {
|
.missing-many td {
|
||||||
background-color: #ebbebe;
|
background-color: #ffc590aa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list .missing-few td, .list .missing-few:hover td {
|
.missing-many:hover td, .missing-many:focus td {
|
||||||
background-color: #ffee75;
|
background-color: #ffc590;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list .missing-none td, .list .missing-none:hover td {
|
.missing-few td {
|
||||||
background-color: #E4EED6;
|
background-color: #fcf488aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.missing-few:hover td, .missing-few:focus td {
|
||||||
|
background-color: #fcf488;
|
||||||
|
}
|
||||||
|
|
||||||
|
.missing-none td {
|
||||||
|
background-color: #d0f6ffaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.missing-none:hover td, .missing-none:focus td {
|
||||||
|
background-color: #d0f6ff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Finance::FinancialTransactionsController < ApplicationController
|
||||||
sort = "created_on DESC"
|
sort = "created_on DESC"
|
||||||
end
|
end
|
||||||
|
|
||||||
@q = FinancialTransaction.search(params[:q])
|
@q = FinancialTransaction.ransack(params[:q])
|
||||||
@financial_transactions_all = @q.result(distinct: true).includes(:user).order(sort)
|
@financial_transactions_all = @q.result(distinct: true).includes(:user).order(sort)
|
||||||
@financial_transactions_all = @financial_transactions_all.visible unless params[:show_hidden]
|
@financial_transactions_all = @financial_transactions_all.visible unless params[:show_hidden]
|
||||||
@financial_transactions_all = @financial_transactions_all.where(ordergroup_id: @ordergroup.id) if @ordergroup
|
@financial_transactions_all = @financial_transactions_all.where(ordergroup_id: @ordergroup.id) if @ordergroup
|
||||||
|
|
|
@ -32,8 +32,8 @@ class GroupOrder < ApplicationRecord
|
||||||
# Generate some data for the javascript methods in ordering view
|
# Generate some data for the javascript methods in ordering view
|
||||||
def load_data
|
def load_data
|
||||||
data = {}
|
data = {}
|
||||||
data[:account_balance] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.account_balance
|
data[:account_balance] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.account_balance
|
||||||
data[:available_funds] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.get_available_funds(self)
|
data[:available_funds] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.get_available_funds(self)
|
||||||
|
|
||||||
# load prices and other stuff....
|
# load prices and other stuff....
|
||||||
data[:order_articles] = {}
|
data[:order_articles] = {}
|
||||||
|
|
15
app/views/group_orders/_explanations.haml
Normal file
15
app/views/group_orders/_explanations.haml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
%h4= t '.title'
|
||||||
|
%hr
|
||||||
|
%table.table-condensed
|
||||||
|
%thead
|
||||||
|
%th= t '.package_fill_level'
|
||||||
|
%tbody
|
||||||
|
%tr{class: "missing-none"}
|
||||||
|
%td= t '.missing_none'
|
||||||
|
%tr{class: "missing-few"}
|
||||||
|
%td= t '.missing_few'
|
||||||
|
%tr{class: "missing-many"}
|
||||||
|
%td= t '.missing_many'
|
||||||
|
%hr
|
||||||
|
%b= t('.tolerance') + ':'
|
||||||
|
= t '.tolerance_explained'
|
|
@ -22,54 +22,41 @@
|
||||||
|
|
||||||
- title t('.title'), false
|
- title t('.title'), false
|
||||||
|
|
||||||
|
.alert.alert-error#balance-alert{style: ('display:none')}
|
||||||
|
=t 'group_orders.errors.balance_alert'
|
||||||
.row-fluid
|
.row-fluid
|
||||||
.well.pull-left
|
.span2
|
||||||
= close_button :alert
|
.well
|
||||||
%h2= @order.name
|
|
||||||
%dl.dl-horizontal
|
|
||||||
- unless @order.note.blank?
|
|
||||||
%dt= heading_helper Order, :note
|
|
||||||
%dd= @order.note
|
|
||||||
%dt= heading_helper Order, :created_by
|
|
||||||
%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
|
|
||||||
%dt= t '.sum_amount'
|
|
||||||
%dd= number_to_currency @order.sum
|
|
||||||
- unless @group_order.new_record?
|
|
||||||
%dt= heading_helper GroupOrder, :updated_by
|
|
||||||
%dd
|
|
||||||
= show_user(@group_order.updated_by)
|
|
||||||
(#{format_time(@group_order.updated_on)})
|
|
||||||
%dt= heading_helper Ordergroup, :account_balance
|
|
||||||
%dd= number_to_currency(@ordering_data[:account_balance])
|
|
||||||
- unless FoodsoftConfig[:charge_members_manually]
|
|
||||||
%dt= heading_helper Ordergroup, :available_funds
|
|
||||||
%dd= number_to_currency(@ordering_data[:available_funds])
|
|
||||||
|
|
||||||
.well.pull-right
|
|
||||||
= close_button :alert
|
|
||||||
= render 'switch_order', current_order: @order
|
= render 'switch_order', current_order: @order
|
||||||
|
.well
|
||||||
.row-fluid
|
= render 'explanations'
|
||||||
.well.clear
|
.well.span9
|
||||||
.form-search
|
%h2.span9= t '.sub_title', order_name: @order.name
|
||||||
|
.span3
|
||||||
|
%table.table-condensed
|
||||||
|
-if @order.ends
|
||||||
|
%tr
|
||||||
|
%td= heading_helper(Order, :ends) + ': '
|
||||||
|
%td= format_time(@order.ends)
|
||||||
|
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
|
||||||
|
%tr
|
||||||
|
%td= heading_helper(Supplier, :min_order_quantity)
|
||||||
|
%td= number_to_currency(@order.supplier.min_order_quantity)
|
||||||
|
%tr
|
||||||
|
%td= t('group_orders.form.sum_amount') + ':'
|
||||||
|
%td= number_to_currency(@order.sum)
|
||||||
|
%hr
|
||||||
|
.form-search.pull-right
|
||||||
.input-append
|
.input-append
|
||||||
= text_field_tag :article, params[:article], placeholder: t('.search_article'), class: 'search-query delayed-search resettable'
|
= text_field_tag :article, params[:article], placeholder: t('.search_article'), class: 'search-query delayed-search resettable'
|
||||||
%button.add-on.btn.reset-search{:type => :button, :title => t('.reset_article_search')}
|
%button.add-on.btn.reset-search{:type => :button, :title => t('.reset_article_search')}
|
||||||
%i.icon.icon-remove
|
%i.icon.icon-remove
|
||||||
|
|
||||||
= form_for @group_order do |f|
|
= form_for @group_order do |f|
|
||||||
= f.hidden_field :lock_version
|
= f.hidden_field :lock_version
|
||||||
= f.hidden_field :order_id
|
= f.hidden_field :order_id
|
||||||
= f.hidden_field :updated_by_user_id
|
= f.hidden_field :updated_by_user_id
|
||||||
= f.hidden_field :ordergroup_id
|
= f.hidden_field :ordergroup_id
|
||||||
%table.table.table-hover
|
%table.table
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th= heading_helper Article, :name
|
%th= heading_helper Article, :name
|
||||||
|
@ -94,7 +81,7 @@
|
||||||
%i.icon-tag
|
%i.icon-tag
|
||||||
%td{colspan: "9"}
|
%td{colspan: "9"}
|
||||||
- order_articles.each do |order_article|
|
- order_articles.each do |order_article|
|
||||||
%tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article #{get_missing_units_css_class(@ordering_data[:order_articles][order_article.id][:missing_units])}", valign: "top"}
|
%tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article #{get_missing_units_css_class(@ordering_data[:order_articles][order_article.id][:missing_units])}", valign: "top", tabindex: "0"}
|
||||||
%td.name= order_article.article.name
|
%td.name= order_article.article.name
|
||||||
- if @order.stockit?
|
- if @order.stockit?
|
||||||
%td= truncate order_article.article.supplier.name, length: 15
|
%td= truncate order_article.article.supplier.name, length: 15
|
||||||
|
@ -108,15 +95,16 @@
|
||||||
%span{id: "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
|
%span{id: "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
|
||||||
|
|
||||||
%td.quantity
|
%td.quantity
|
||||||
|
.outer{style: "diyplay: inline-block; float: left; width: 50px;"}
|
||||||
%input{id: "q_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:quantity], 'data-min' => (@ordering_data[:order_articles][order_article.id][:quantity] if @order.boxfill?), 'data-max' => (@ordering_data[:order_articles][order_article.id][:quantity]+@ordering_data[:order_articles][order_article.id][:missing_units] if @order.boxfill?)}/
|
%input{id: "q_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:quantity], 'data-min' => (@ordering_data[:order_articles][order_article.id][:quantity] if @order.boxfill?), 'data-max' => (@ordering_data[:order_articles][order_article.id][:quantity]+@ordering_data[:order_articles][order_article.id][:missing_units] if @order.boxfill?)}/
|
||||||
%span.used{id: "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity]
|
%span.used{id: "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity]
|
||||||
+
|
+
|
||||||
%span.unused{id: "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity]
|
%span.unused{id: "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity]
|
||||||
.btn-group
|
.btn-group
|
||||||
%a.btn.btn-ordering{'data-increase_quantity' => order_article.id}
|
|
||||||
%i.icon-plus
|
|
||||||
%a.btn.btn-ordering{'data-decrease_quantity' => order_article.id}
|
%a.btn.btn-ordering{'data-decrease_quantity' => order_article.id}
|
||||||
%i.icon-minus
|
%i.icon-minus
|
||||||
|
%a.btn.btn-ordering{'data-increase_quantity' => order_article.id}
|
||||||
|
%i.icon-plus
|
||||||
|
|
||||||
%td.tolerance{style: ('display:none' if @order.stockit?)}
|
%td.tolerance{style: ('display:none' if @order.stockit?)}
|
||||||
%input{id: "t_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:tolerance], 'data-min' => (@ordering_data[:order_articles][order_article.id][:tolerance] if @order.boxfill?)}/
|
%input{id: "t_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:tolerance], 'data-min' => (@ordering_data[:order_articles][order_article.id][:tolerance] if @order.boxfill?)}/
|
||||||
|
@ -125,10 +113,10 @@
|
||||||
+
|
+
|
||||||
%span.unused{id: "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance]
|
%span.unused{id: "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance]
|
||||||
.btn-group
|
.btn-group
|
||||||
%a.btn.btn-ordering{'data-increase_tolerance' => order_article.id}
|
|
||||||
%i.icon-plus
|
|
||||||
%a.btn.btn-ordering{'data-decrease_tolerance' => order_article.id}
|
%a.btn.btn-ordering{'data-decrease_tolerance' => order_article.id}
|
||||||
%i.icon-minus
|
%i.icon-minus
|
||||||
|
%a.btn.btn-ordering{'data-increase_tolerance' => order_article.id}
|
||||||
|
%i.icon-plus
|
||||||
|
|
||||||
%td{id: "td_price_#{order_article.id}", style: "text-align:right; padding-right:10px; width:4em"}
|
%td{id: "td_price_#{order_article.id}", style: "text-align:right; padding-right:10px; width:4em"}
|
||||||
%span{id: "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price])
|
%span{id: "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price])
|
||||||
|
@ -154,25 +142,7 @@
|
||||||
#order-footer
|
#order-footer
|
||||||
#info-box
|
#info-box
|
||||||
#total-sum
|
#total-sum
|
||||||
%table
|
= render 'total_sum'
|
||||||
%tr
|
|
||||||
%td= t('.total_sum_amount') + ':'
|
|
||||||
%td.currency
|
|
||||||
%span#total_price= number_to_currency(@group_order.price)
|
|
||||||
%tr
|
|
||||||
- if FoodsoftConfig[:charge_members_manually]
|
|
||||||
- old_balance = @ordering_data[:account_balance]
|
|
||||||
%td= heading_helper(Ordergroup, :account_balance) + ':'
|
|
||||||
%td.currency= number_to_currency(@ordering_data[:account_balance])
|
|
||||||
- else
|
|
||||||
- old_balance = @ordering_data[:available_funds]
|
|
||||||
%td= heading_helper(Ordergroup, :available_funds) + ':'
|
|
||||||
%td.currency= number_to_currency(@ordering_data[:available_funds])
|
|
||||||
%tr
|
|
||||||
%td= t('.new_funds') + ':'
|
|
||||||
%td.currency
|
|
||||||
%strong
|
|
||||||
%span#new_balance= number_to_currency(old_balance - @group_order.price)
|
|
||||||
#order-button
|
#order-button
|
||||||
= submit_tag( t('.action_save'), id: 'submit_button', class: 'btn btn-primary' )
|
= submit_tag( t('.action_save'), id: 'submit_button', class: 'btn btn-primary' )
|
||||||
#{link_to t('ui.or_cancel'), group_orders_path}
|
#{link_to t('ui.or_cancel'), group_orders_path}
|
||||||
|
|
62
app/views/group_orders/_order_details.haml
Normal file
62
app/views/group_orders/_order_details.haml
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
%dl.dl-horizontal
|
||||||
|
// GENERAL ORDER DETAILS FOR ALL
|
||||||
|
// Name
|
||||||
|
%dt= heading_helper Order, :name
|
||||||
|
%dd= @order.name
|
||||||
|
// Order Ends
|
||||||
|
%dt= heading_helper Order, :ends
|
||||||
|
%dd= format_time(@order.ends)
|
||||||
|
// Pickup
|
||||||
|
- unless @order.pickup.blank?
|
||||||
|
%dt= heading_helper Order, :pickup
|
||||||
|
%dd= format_date(@order.pickup)
|
||||||
|
// Min Order Quantity
|
||||||
|
- 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
|
||||||
|
// Group Order Sum Amount
|
||||||
|
%dt= t 'group_orders.form.sum_amount'
|
||||||
|
%dd= number_to_currency @order.sum
|
||||||
|
// Created By
|
||||||
|
%dt= heading_helper Order, :created_by
|
||||||
|
%dd= show_user_link(@order.created_by)
|
||||||
|
// Updated By
|
||||||
|
- unless @group_order.new_record?
|
||||||
|
%dt= heading_helper GroupOrder, :updated_by
|
||||||
|
%dd
|
||||||
|
= show_user(@group_order.updated_by)
|
||||||
|
(#{format_time(@group_order.updated_on)})
|
||||||
|
// Closed By
|
||||||
|
- if @order.closed?
|
||||||
|
%dt= heading_helper Order, :closed_by
|
||||||
|
%dd= show_user_link @order.updated_by
|
||||||
|
// Note
|
||||||
|
- unless @order.note.blank?
|
||||||
|
%dt= heading_helper Order, :note
|
||||||
|
%dd= @order.note
|
||||||
|
|
||||||
|
-# // YOUR ORDER DETAILS
|
||||||
|
-# // TODO What do users want to see here?
|
||||||
|
-# %dl.dl-horizontal
|
||||||
|
-# // YOUR CREDIT
|
||||||
|
-# - if @ordering_data
|
||||||
|
-# %dt= heading_helper Ordergroup, :account_balance
|
||||||
|
-# %dd= number_to_currency(@ordering_data[:account_balance])
|
||||||
|
-# - unless FoodsoftConfig[:charge_members_manually]
|
||||||
|
-# %dt= heading_helper Ordergroup, :available_funds
|
||||||
|
-# %dd= number_to_currency(@ordering_data[:available_funds])
|
||||||
|
|
||||||
|
-# // Price of this order
|
||||||
|
-# %dt= heading_helper GroupOrder, :price
|
||||||
|
-# %dd
|
||||||
|
-# - if @group_order
|
||||||
|
-# = number_to_currency(@group_order.price)
|
||||||
|
-# - else
|
||||||
|
-# = t '.not_ordered'
|
||||||
|
|
||||||
|
-# // Order Transport Costs
|
||||||
|
-# - if @group_order && @group_order.transport
|
||||||
|
-# %dt= heading_helper GroupOrder, :transport
|
||||||
|
-# %dd= number_to_currency(@group_order.transport)
|
||||||
|
-# %dt= heading_helper GroupOrder, :total
|
||||||
|
-# %dd= number_to_currency(@group_order.total)
|
|
@ -1,9 +1,10 @@
|
||||||
- orders = Order.open.started.reject{ |order| order == current_order }
|
- orders = Order.open.started
|
||||||
- unless orders.empty?
|
- unless orders.empty?
|
||||||
%h2= t '.title'
|
%ul.nav.nav-pills.nav-stacked
|
||||||
%ul.unstyled
|
.nav-header= t '.title'
|
||||||
|
%li= link_to t('ui.overview'), :group_orders
|
||||||
- orders.each do |order|
|
- orders.each do |order|
|
||||||
%li
|
.btn-small.pull-right
|
||||||
= link_to_ordering(order, 'data-confirm_switch_order' => true)
|
=link_to_ordering(order, style: (order == current_order ? 'color: white' : '' ), 'data-confirm_switch_order' => true){ t 'ui.edit' }
|
||||||
- if order.ends
|
%li( class="#{ order == current_order ? 'active' : ''}")
|
||||||
= t '.remaining', remaining: time_ago_in_words(order.ends)
|
=link_to_ordering(order, show: true, 'data-confirm_switch_order' => true)
|
19
app/views/group_orders/_total_sum.haml
Normal file
19
app/views/group_orders/_total_sum.haml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
%table
|
||||||
|
%tr
|
||||||
|
%td= t('group_orders.form.total_sum_amount') + ':'
|
||||||
|
%td.currency
|
||||||
|
%span#total_price= number_to_currency(@group_order.price)
|
||||||
|
%tr
|
||||||
|
- if FoodsoftConfig[:charge_members_manually]
|
||||||
|
- old_balance = @ordering_data[:account_balance]
|
||||||
|
%td= heading_helper(Ordergroup, :account_balance) + ':'
|
||||||
|
%td.currency= number_to_currency(@ordering_data[:account_balance])
|
||||||
|
- else
|
||||||
|
- old_balance = @ordering_data[:available_funds]
|
||||||
|
%td= heading_helper(Ordergroup, :available_funds) + ':'
|
||||||
|
%td.currency= number_to_currency(@ordering_data[:available_funds])
|
||||||
|
%tr
|
||||||
|
%td= t('group_orders.form.new_funds') + ':'
|
||||||
|
%td.currency
|
||||||
|
%strong
|
||||||
|
%span#new_balance= number_to_currency(old_balance - @group_order.price)
|
|
@ -18,10 +18,13 @@
|
||||||
%th= heading_helper Ordergroup, :available_funds
|
%th= heading_helper Ordergroup, :available_funds
|
||||||
%th.numeric= number_to_currency(@ordergroup.get_available_funds)
|
%th.numeric= number_to_currency(@ordergroup.get_available_funds)
|
||||||
|
|
||||||
|
.row-fluid
|
||||||
|
.span9
|
||||||
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
|
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
|
||||||
|
|
||||||
// finished orders
|
// finished orders
|
||||||
- unless @finished_not_closed_orders_including_group_order.empty?
|
- unless @finished_not_closed_orders_including_group_order.empty?
|
||||||
|
.row-fluid
|
||||||
|
.span9
|
||||||
%section
|
%section
|
||||||
%h2= t '.finished_orders.title'
|
%h2= t '.finished_orders.title'
|
||||||
= render partial: 'orders', locals: {orders: @finished_not_closed_orders_including_group_order, pagination: false}
|
= render partial: 'orders', locals: {orders: @finished_not_closed_orders_including_group_order, pagination: false}
|
||||||
|
@ -32,6 +35,8 @@
|
||||||
|
|
||||||
// closed orders
|
// closed orders
|
||||||
- unless @closed_orders_including_group_order.empty?
|
- unless @closed_orders_including_group_order.empty?
|
||||||
|
.row-fluid
|
||||||
|
.span9
|
||||||
%section
|
%section
|
||||||
%h2= t '.closed_orders.title'
|
%h2= t '.closed_orders.title'
|
||||||
= render partial: 'orders', locals: {orders: @closed_orders_including_group_order, pagination: false}
|
= render partial: 'orders', locals: {orders: @closed_orders_including_group_order, pagination: false}
|
||||||
|
|
|
@ -7,44 +7,18 @@
|
||||||
- title t('.title', order: @order.name)
|
- title t('.title', order: @order.name)
|
||||||
|
|
||||||
.row-fluid
|
.row-fluid
|
||||||
.well.pull-left
|
|
||||||
// Order summary
|
|
||||||
%dl.dl-horizontal
|
|
||||||
%dt= heading_helper Order, :name
|
|
||||||
%dd= @order.name
|
|
||||||
%dt= heading_helper Order, :note
|
|
||||||
%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
|
|
||||||
= number_to_currency(@group_order.price)
|
|
||||||
- else
|
|
||||||
= t '.not_ordered'
|
|
||||||
- if @group_order && @group_order.transport
|
|
||||||
%dt= heading_helper GroupOrder, :transport
|
|
||||||
%dd= number_to_currency(@group_order.transport)
|
|
||||||
%dt= heading_helper GroupOrder, :total
|
|
||||||
%dd= number_to_currency(@group_order.total)
|
|
||||||
- if @order.closed?
|
|
||||||
%dt= heading_helper Order, :closed_by
|
|
||||||
%dd= show_user_link @order.updated_by
|
|
||||||
%p= link_to t('.comment'), "#comments"
|
|
||||||
|
|
||||||
.well.pull-right
|
.well.span2
|
||||||
= close_button :alert
|
|
||||||
= render 'switch_order', current_order: @order
|
= render 'switch_order', current_order: @order
|
||||||
|
.well.span9
|
||||||
|
%h2= t '.articles.title'
|
||||||
|
=render 'order_details'
|
||||||
|
|
||||||
// Article box
|
// Article box
|
||||||
%section
|
%section
|
||||||
%h2= t '.articles.title'
|
|
||||||
.column_content#result
|
.column_content#result
|
||||||
- if @group_order
|
- if @group_order
|
||||||
%p.pull-right= link_to t('.articles.show_hide'), '#', 'data-toggle-this' => 'tr.ignored'
|
%p= link_to t('.articles.show_hide'), '#', 'data-toggle-this' => 'tr.ignored'
|
||||||
%p= link_to(t('.articles.edit_order'), edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
|
||||||
%table.table.table-hover
|
%table.table.table-hover
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
|
@ -97,15 +71,15 @@
|
||||||
%th= number_to_currency(@group_order.total)
|
%th= number_to_currency(@group_order.total)
|
||||||
%br/
|
%br/
|
||||||
= link_to_top
|
= link_to_top
|
||||||
|
%p.pull-right= link_to(t('.articles.edit_order'), edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
||||||
- else
|
- else
|
||||||
- if @order.open?
|
- if @order.open?
|
||||||
= t '.articles.not_ordered_msg'
|
= t '.articles.not_ordered_msg'
|
||||||
= link_to t('.articles.order_now'), action: "order", id: @order
|
= link_to t('.articles.order_now'), action: "order", id: @order
|
||||||
- else
|
- else
|
||||||
= t '.articles.order_closed_msg'
|
= t '.articles.order_closed_msg'
|
||||||
|
|
||||||
// Comments box
|
// Comments box
|
||||||
%section
|
%hr
|
||||||
%h2= t '.comments.title'
|
%h2= t '.comments.title'
|
||||||
#comments
|
#comments
|
||||||
= render 'shared/comments', comments: @order.comments
|
= render 'shared/comments', comments: @order.comments
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th= heading_helper Order, :name
|
%th= heading_helper Order, :name
|
||||||
|
%th
|
||||||
%th= heading_helper Order, :pickup
|
%th= heading_helper Order, :pickup
|
||||||
%th= heading_helper Order, :ends
|
%th= heading_helper Order, :ends
|
||||||
%th= t '.who_ordered'
|
%th= t '.who_ordered'
|
||||||
|
@ -17,21 +18,23 @@
|
||||||
- total = 0
|
- total = 0
|
||||||
- orders.each do |order|
|
- orders.each do |order|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to_ordering(order)
|
%td
|
||||||
|
= link_to_ordering(order, show: true)
|
||||||
|
%td
|
||||||
|
.btn-small= link_to_ordering(order){ t 'ui.edit' }
|
||||||
%td= format_date(order.pickup) unless order.pickup.nil?
|
%td= format_date(order.pickup) unless order.pickup.nil?
|
||||||
%td= format_time(order.ends) unless order.ends.nil?
|
%td= format_time(order.ends) unless order.ends.nil?
|
||||||
- if group_order = order.group_order(ordergroup)
|
- if group_order = order.group_order(ordergroup)
|
||||||
- total += group_order.price
|
- total += group_order.price
|
||||||
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
|
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
|
||||||
%td.numeric
|
%td.numeric
|
||||||
= link_to_ordering(order, show: true) do
|
|
||||||
= number_to_currency(group_order.price)
|
= number_to_currency(group_order.price)
|
||||||
- else
|
- else
|
||||||
%td{:colspan => 2}
|
%td{:colspan => 2}
|
||||||
- if total > 0
|
- if total > 0
|
||||||
%tfooter
|
%tfooter
|
||||||
%tr
|
%tr
|
||||||
%th(colspan="3")
|
%th(colspan="4")
|
||||||
%th= t('.total_sum') + ':'
|
%th= t('.total_sum') + ':'
|
||||||
%th.numeric= number_to_currency(total)
|
%th.numeric= number_to_currency(total)
|
||||||
- else
|
- else
|
||||||
|
|
|
@ -3,7 +3,7 @@ class String
|
||||||
# remove comma from decimal inputs
|
# remove comma from decimal inputs
|
||||||
def self.delocalized_decimal(string)
|
def self.delocalized_decimal(string)
|
||||||
if !string.blank? and string.is_a?(String)
|
if !string.blank? and string.is_a?(String)
|
||||||
BigDecimal.new(string.sub(',', '.'))
|
BigDecimal(string.sub(',', '.'))
|
||||||
else
|
else
|
||||||
string
|
string
|
||||||
end
|
end
|
||||||
|
|
|
@ -1045,9 +1045,23 @@ de:
|
||||||
error_stale: In der Zwischenzeit hat jemand anderes auch bestellt, daher konnte die Bestellung nicht aktualisiert werden.
|
error_stale: In der Zwischenzeit hat jemand anderes auch bestellt, daher konnte die Bestellung nicht aktualisiert werden.
|
||||||
notice: Die Bestellung wurde gespeichert.
|
notice: Die Bestellung wurde gespeichert.
|
||||||
errors:
|
errors:
|
||||||
|
balance_alert: Kontostand im Minus
|
||||||
closed: Diese Bestellung ist bereits abgeschlossen.
|
closed: Diese Bestellung ist bereits abgeschlossen.
|
||||||
no_member: Du bist kein Mitglieder einer Bestellgruppe.
|
no_member: Du bist kein Mitglieder einer Bestellgruppe.
|
||||||
notfound: Fehlerhafte URL, das ist nicht Deine Bestellung.
|
notfound: Fehlerhafte URL, das ist nicht Deine Bestellung.
|
||||||
|
explanations:
|
||||||
|
package_fill_level: |
|
||||||
|
Gebindefüllstand
|
||||||
|
missing_none: |
|
||||||
|
Voll
|
||||||
|
missing_few: |
|
||||||
|
Wenig fehlt
|
||||||
|
missing_many: |
|
||||||
|
Viel fehlt
|
||||||
|
title: Erklärungen
|
||||||
|
tolerance_explained: |
|
||||||
|
Zusätzliche Menge die du bestellen würdest, damit das Gebinde voll wird.
|
||||||
|
tolerance: Toleranz
|
||||||
form:
|
form:
|
||||||
action_save: Bestellung speichern
|
action_save: Bestellung speichern
|
||||||
new_funds: Neuer Kontostand
|
new_funds: Neuer Kontostand
|
||||||
|
@ -1056,6 +1070,7 @@ de:
|
||||||
search_article: Artikel suchen...
|
search_article: Artikel suchen...
|
||||||
sum_amount: Gesamtbestellmenge bisher
|
sum_amount: Gesamtbestellmenge bisher
|
||||||
title: Bestellen
|
title: Bestellen
|
||||||
|
sub_title: Bestellung für %{order_name} aufgeben
|
||||||
total_sum_amount: Gesamtbetrag
|
total_sum_amount: Gesamtbetrag
|
||||||
total_tolerance: Gesamt-Toleranz
|
total_tolerance: Gesamt-Toleranz
|
||||||
units: Gebinde
|
units: Gebinde
|
||||||
|
@ -1099,8 +1114,10 @@ de:
|
||||||
sum: Summe
|
sum: Summe
|
||||||
title: Dein Bestellergebnis für %{order}
|
title: Dein Bestellergebnis für %{order}
|
||||||
switch_order:
|
switch_order:
|
||||||
remaining: "noch %{remaining}"
|
remaining: "%{remaining} bis Bestellschluss"
|
||||||
title: Laufende Bestellungen
|
title: Laufende Bestellungen
|
||||||
|
order_details:
|
||||||
|
details: Details anzeigen
|
||||||
update:
|
update:
|
||||||
error_general: Die Bestellung konnte nicht aktualisiert werden, da ein Fehler auftrat.
|
error_general: Die Bestellung konnte nicht aktualisiert werden, da ein Fehler auftrat.
|
||||||
error_stale: In der Zwischenzeit hat jemand anderes auch bestellt, daher konnte die Bestellung nicht aktualisiert werden.
|
error_stale: In der Zwischenzeit hat jemand anderes auch bestellt, daher konnte die Bestellung nicht aktualisiert werden.
|
||||||
|
|
|
@ -1047,9 +1047,23 @@ en:
|
||||||
error_stale: Someone else has ordered in the meantime, couldn't update the order.
|
error_stale: Someone else has ordered in the meantime, couldn't update the order.
|
||||||
notice: The order was saved.
|
notice: The order was saved.
|
||||||
errors:
|
errors:
|
||||||
|
balance_alert: Negative account balance
|
||||||
closed: This order is already closed.
|
closed: This order is already closed.
|
||||||
no_member: You are not a member of an ordergroup.
|
no_member: You are not a member of an ordergroup.
|
||||||
notfound: Incorrect URL, this is not your order.
|
notfound: Incorrect URL, this is not your order.
|
||||||
|
explanations:
|
||||||
|
title: Explanations
|
||||||
|
tolerance: Tolerance
|
||||||
|
package_fill_level: |
|
||||||
|
Package Fill Level
|
||||||
|
missing_none: |
|
||||||
|
No more missing
|
||||||
|
missing_few: |
|
||||||
|
Few missing
|
||||||
|
missing_many: |
|
||||||
|
Many missing
|
||||||
|
tolerance_explained: |
|
||||||
|
Additional amount you would buy to fill a wholesale package
|
||||||
form:
|
form:
|
||||||
action_save: Save order
|
action_save: Save order
|
||||||
new_funds: New account balance
|
new_funds: New account balance
|
||||||
|
@ -1058,6 +1072,7 @@ en:
|
||||||
search_article: Search for articles...
|
search_article: Search for articles...
|
||||||
sum_amount: Current amount
|
sum_amount: Current amount
|
||||||
title: Orders
|
title: Orders
|
||||||
|
sub_title: Place order for %{order_name}
|
||||||
total_sum_amount: Total amount
|
total_sum_amount: Total amount
|
||||||
total_tolerance: Total tolerance
|
total_tolerance: Total tolerance
|
||||||
units: Units
|
units: Units
|
||||||
|
@ -1101,8 +1116,10 @@ en:
|
||||||
sum: Sum
|
sum: Sum
|
||||||
title: Your order result for %{order}
|
title: Your order result for %{order}
|
||||||
switch_order:
|
switch_order:
|
||||||
remaining: "%{remaining} remaining"
|
remaining: "%{remaining} until order closes"
|
||||||
title: Current orders
|
title: Current orders
|
||||||
|
order_details:
|
||||||
|
details: Show Details
|
||||||
update:
|
update:
|
||||||
error_general: The order couldn’t be updated due to a bug.
|
error_general: The order couldn’t be updated due to a bug.
|
||||||
error_stale: Someone else has ordered in the meantime, couldn't update the order.
|
error_stale: Someone else has ordered in the meantime, couldn't update the order.
|
||||||
|
|
|
@ -1017,6 +1017,7 @@ nl:
|
||||||
error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon de bestelling niet bijgewerkt worden.
|
error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon de bestelling niet bijgewerkt worden.
|
||||||
notice: Bestelling opgeslagen.
|
notice: Bestelling opgeslagen.
|
||||||
errors:
|
errors:
|
||||||
|
balance_alert: Accountsaldo in het rood
|
||||||
closed: Deze bestelling is al gesloten.
|
closed: Deze bestelling is al gesloten.
|
||||||
no_member: Je bent geen lid van dit huishouden.
|
no_member: Je bent geen lid van dit huishouden.
|
||||||
notfound: Foute URL, dit is niet jouw bestelling.
|
notfound: Foute URL, dit is niet jouw bestelling.
|
||||||
|
@ -1028,6 +1029,7 @@ nl:
|
||||||
search_article: Artikelen zoeken...
|
search_article: Artikelen zoeken...
|
||||||
sum_amount: Huidig totaalbedrag
|
sum_amount: Huidig totaalbedrag
|
||||||
title: Bestellen
|
title: Bestellen
|
||||||
|
sub_title: Plaats bestelling voor %{order_name}
|
||||||
total_sum_amount: Totalbedrag
|
total_sum_amount: Totalbedrag
|
||||||
total_tolerance: Totale tolerantie
|
total_tolerance: Totale tolerantie
|
||||||
units: Eenheden
|
units: Eenheden
|
||||||
|
@ -1071,8 +1073,10 @@ nl:
|
||||||
sum: Som
|
sum: Som
|
||||||
title: Jouw bestelling voor %{order}
|
title: Jouw bestelling voor %{order}
|
||||||
switch_order:
|
switch_order:
|
||||||
remaining: "nog %{remaining}"
|
remaining: "%{remaining} tot bestelling sluit"
|
||||||
title: Lopende bestellingen
|
title: Lopende bestellingen
|
||||||
|
order_details:
|
||||||
|
details: Bekijk details
|
||||||
update:
|
update:
|
||||||
error_general: Er is een probleem opgetreden, de bestelling kon niet bijgewerkt worden.
|
error_general: Er is een probleem opgetreden, de bestelling kon niet bijgewerkt worden.
|
||||||
error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon je bestelling niet opgeslagen worden. Sorry!
|
error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon je bestelling niet opgeslagen worden. Sorry!
|
||||||
|
|
|
@ -32,7 +32,7 @@ class CurrentOrders::ArticlesController < ApplicationController
|
||||||
else
|
else
|
||||||
@order_articles = OrderArticle.where(order_id: @current_orders.all.map(&:id))
|
@order_articles = OrderArticle.where(order_id: @current_orders.all.map(&:id))
|
||||||
end
|
end
|
||||||
@q = OrderArticle.search(params[:q])
|
@q = OrderArticle.ransack(params[:q])
|
||||||
@order_articles = @order_articles.ordered.merge(@q.result).includes(:article, :article_price)
|
@order_articles = @order_articles.ordered.merge(@q.result).includes(:article, :article_price)
|
||||||
@order_article = @order_articles.where(id: params[:id]).first
|
@order_article = @order_articles.where(id: params[:id]).first
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue