Merge remote-tracking branch 'bennibu/rails3' into rails3
Conflicts: app/controllers/admin/ordergroups_controller.rb app/controllers/finance/balancing_controller.rb app/controllers/suppliers_controller.rb app/views/articles/_article.html.haml app/views/finance/balancing/_summary.haml app/views/finance/balancing/new.html.haml app/views/group_orders/_form.html.haml app/views/home/_apple_bar.html.haml app/views/suppliers/index.haml
This commit is contained in:
commit
7af796c09c
47 changed files with 325 additions and 240 deletions
|
|
@ -1,4 +1,4 @@
|
|||
%tr{class: row_classes(article)}
|
||||
%tr{class: row_classes(article)}[article]
|
||||
%td= check_box_tag 'selected_articles[]', article.id.to_s, false, {:id => "checkbox_#{article.id}", 'data-ignore-onchange' => true}
|
||||
%td{'data-check-this' => "#checkbox_#{article.id}", :class => 'click-me'}= article.name
|
||||
%td= article.origin
|
||||
|
|
@ -15,5 +15,3 @@
|
|||
:remote => true, class: 'btn btn-mini'
|
||||
%td= link_to t('ui.delete'), [@supplier, article],
|
||||
:method => :delete, :confirm => t('.confirm_delete'), :remote => true, class: 'btn btn-mini btn-danger'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
%td= article.unit_quantity
|
||||
%td
|
||||
- logger.debug "[debug] #{article.attributes.inspect}"
|
||||
- if @supplier.articles.where(order_number: article.number).exists?
|
||||
- if @supplier.articles.undeleted.where(order_number: article.number).exists?
|
||||
%i.icon-ok
|
||||
schon importiert
|
||||
- else
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
- title "Artikel von #{@supplier.name} (#{@supplier.articles.count})"
|
||||
- title "Artikel von #{@supplier.name} (#{@supplier.articles.undeleted.count})"
|
||||
|
||||
.well.well-small
|
||||
.btn-toolbar
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
Lieferant wechseln ..
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- Supplier.where('id != ?', @supplier.id).order('name ASC').each do |supplier|
|
||||
- Supplier.undeleted.where('id != ?', @supplier.id).order('suppliers.name ASC').each do |supplier|
|
||||
%li= link_to supplier.name, supplier_articles_path(supplier), tabindex: -1
|
||||
|
||||
- unless @supplier.shared_supplier.nil?
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
%h1 Artikel mit externer Datenbank synchronisieren
|
||||
- title 'Artikel mit externer Datenbank synchronisieren'
|
||||
|
||||
- form_tag update_all_supplier_articles_path(@supplier, :sync => "1") do
|
||||
= form_tag update_all_supplier_articles_path(@supplier, :sync => "1") do
|
||||
%h2 Auslisten ...
|
||||
%p
|
||||
- unless @outlisted_articles.empty?
|
||||
|
|
@ -25,47 +25,49 @@
|
|||
Werten vorausgefüllt.
|
||||
%br/
|
||||
Abweichungen zu den alten Artikeln sind gelb markiert.
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Notiz
|
||||
%th Hersteller
|
||||
%th Herkunft
|
||||
%th Einheit
|
||||
%th GebGr
|
||||
%th Preis
|
||||
%th MwSt.
|
||||
%th Pfand
|
||||
%th Kategorie
|
||||
- @updated_articles.each do |@article, unequal_attributes|
|
||||
- article = Article.find(@article.id)
|
||||
%tr{:style => 'color:grey'}
|
||||
%td= article.name
|
||||
%td= article.note
|
||||
%td= article.manufacturer
|
||||
%td= article.origin
|
||||
%td= article.unit
|
||||
%td= article.unit_quantity
|
||||
%td= article.price
|
||||
%td= article.tax
|
||||
%td= article.deposit
|
||||
%td= article.article_category.name if article.article_category
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
- fields_for 'articles[]', @article do |form|
|
||||
%td{:style => highlight_new(unequal_attributes, :name)}
|
||||
= form.text_field 'name', :size => 0
|
||||
= form.hidden_field 'shared_updated_on'
|
||||
%td{:style => highlight_new(unequal_attributes, :note)}= form.text_field 'note', :size => 15
|
||||
%td{:style => highlight_new(unequal_attributes, :manufacturer)}= form.text_field 'manufacturer', :size => 10
|
||||
%td{:style => highlight_new(unequal_attributes, :origin)}= form.text_field 'origin', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :unit)}= form.text_field 'unit', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :unit_quantity)}= form.text_field 'unit_quantity', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :price)}= form.text_field 'price', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :tax)}= form.text_field 'tax', :size => 4
|
||||
%td{:style => highlight_new(unequal_attributes, :deposit)}= form.text_field 'deposit', :size => 4
|
||||
%td= select 'article[]', 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] }, { :include_blank => true }
|
||||
%th Name
|
||||
%th Notiz
|
||||
%th Hersteller
|
||||
%th Herkunft
|
||||
%th Einheit
|
||||
%th GebGr
|
||||
%th Preis
|
||||
%th MwSt.
|
||||
%th Pfand
|
||||
%th Kategorie
|
||||
%tbody
|
||||
- @updated_articles.each do |updated_article, attrs|
|
||||
- article = Article.find(updated_article.id)
|
||||
%tr{:style => 'color:grey'}
|
||||
%td= article.name
|
||||
%td= article.note
|
||||
%td= article.manufacturer
|
||||
%td= article.origin
|
||||
%td= article.unit
|
||||
%td= article.unit_quantity
|
||||
%td= article.price
|
||||
%td= article.tax
|
||||
%td= article.deposit
|
||||
%td= article.article_category.name if article.article_category
|
||||
%tr
|
||||
= fields_for 'articles[]', updated_article do |form|
|
||||
%td{:style => highlight_new(attrs, :name)}
|
||||
= form.text_field 'name', :size => 0
|
||||
= form.hidden_field 'shared_updated_on'
|
||||
%td{:style => highlight_new(attrs, :note)}= form.text_field 'note', class: 'input-small'
|
||||
%td{:style => highlight_new(attrs, :manufacturer)}= form.text_field 'manufacturer', class: 'input-small'
|
||||
%td{:style => highlight_new(attrs, :origin)}= form.text_field 'origin', class: 'input-mini'
|
||||
%td{:style => highlight_new(attrs, :unit)}= form.text_field 'unit', class: 'input-mini'
|
||||
%td{:style => highlight_new(attrs, :unit_quantity)}= form.text_field 'unit_quantity', class: 'input-mini'
|
||||
%td{:style => highlight_new(attrs, :price)}= form.text_field 'price', class: 'input-mini'
|
||||
%td{:style => highlight_new(attrs, :tax)}= form.text_field 'tax', class: 'input-mini'
|
||||
%td{:style => highlight_new(attrs, :deposit)}= form.text_field 'deposit', class: 'input-mini'
|
||||
%td= form.select :article_category_id, ArticleCategory.all.map {|a| [ a.name, a.id ] },
|
||||
{include_blank: true}, class: 'input-small'
|
||||
%hr/
|
||||
= hidden_field 'supplier', 'id'
|
||||
= submit_tag 'Alle löschen/aktualisieren'
|
||||
|
|
||||
= link_to 'Abbrechen', supplier_articles_path(@supplier)
|
||||
= submit_tag 'Alle löschen/aktualisieren', class: 'btn btn-primary'
|
||||
= link_to 'oder abbrechen', supplier_articles_path(@supplier)
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
= link_to t('.add_group'), new_finance_group_order_article_path(order_article_id: order_article.id),
|
||||
remote: true, class: 'btn btn-mini'
|
||||
%tbody
|
||||
- for group_order_article in order_article.group_order_articles.ordered.all(:include => [:group_order])
|
||||
- for group_order_article in order_article.group_order_articles.select { |goa| goa.result > 0 }
|
||||
%tr[group_order_article]
|
||||
%td
|
||||
%td{:style=>"width:50%"}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,8 @@
|
|||
%td
|
||||
= t('.fc_profit')
|
||||
%small= t('.with_extra_charge')
|
||||
%td#order_profit.numeric= number_to_currency(order.profit)
|
||||
%td#order_profit.numeric= number_to_currency(order.profit)
|
||||
#summaryChangedWarning.alert(style="display:none;")
|
||||
%strong= t '.changed'
|
||||
%br/
|
||||
= link_to t('.reload'), update_summary_finance_order_path(order), remote: true
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
.well.well-small
|
||||
%h3= t('.comments')
|
||||
#comments= render :partial => 'shared/comments', locals: {comments: @order.comments}
|
||||
#comments= render :partial => 'shared/comments', locals: {comments: @order.comments.includes(:user)}
|
||||
|
||||
- content_for :actionbar do
|
||||
.btn-group
|
||||
|
|
@ -44,4 +44,4 @@
|
|||
|
||||
%section#results
|
||||
= render 'edit_results_by_articles'
|
||||
%p= link_to_top
|
||||
%p= link_to_top
|
||||
|
|
|
|||
1
app/views/finance/balancing/update_summary.js.haml
Normal file
1
app/views/finance/balancing/update_summary.js.haml
Normal file
|
|
@ -0,0 +1 @@
|
|||
$('#summary').html('#{j(render('finance/balancing/summary', order: @order))}');
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
$('#modalContainer').modal('hide');
|
||||
$('#order_article_#{@order_article.id}').html('#{j(render('finance/balancing/order_article', order_article: @order_article))}');
|
||||
$('#group_order_articles_#{@order_article.id}').html('#{j(render('finance/balancing/group_order_articles', order_article: @order_article))}');
|
||||
$('#summary').html('#{j(render('finance/balancing/summary', order: @order_article.order))}');
|
||||
$('#summaryChangedWarning').show();
|
||||
|
|
@ -5,18 +5,20 @@
|
|||
.modal-body
|
||||
= form.input :units_to_order
|
||||
|
||||
= simple_fields_for @order_article.article do |f|
|
||||
= simple_fields_for :article, @order_article.article do |f|
|
||||
= f.input :name
|
||||
= f.input :order_number
|
||||
= f.input :unit
|
||||
= simple_fields_for @order_article.article_price do |f|
|
||||
= f.input :unit_quantity
|
||||
= f.input :price
|
||||
= f.input :tax
|
||||
= f.input :deposit
|
||||
|
||||
= form.input :update_current_price, as: :boolean
|
||||
|
||||
- if @order_article.article.is_a?(StockArticle)
|
||||
%div.alert Preise von Lagerartikeln können nicht geändert werden!
|
||||
- else
|
||||
= simple_fields_for :article_price, @order_article.article_price do |f|
|
||||
= f.input :unit_quantity
|
||||
= f.input :price
|
||||
= f.input :tax
|
||||
= f.input :deposit
|
||||
= form.input :update_current_price, as: :boolean
|
||||
.modal-footer
|
||||
= button_tag t('ui.close'), class: 'btn', data: {dismiss: 'modal'}
|
||||
= form.submit class: 'btn btn-primary'
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
%thead
|
||||
%tr
|
||||
%th= t '.name'
|
||||
- if @order.stockit?
|
||||
%th{style: 'width:120px'}= t '.supplier'
|
||||
%th{style: "width:13px;"}
|
||||
%th{style: "width:4.5em;"}= t '.price'
|
||||
%th{style: "width:4.5em;"}= t '.unit'
|
||||
|
|
@ -66,6 +68,8 @@
|
|||
- order_articles.each do |order_article|
|
||||
%tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article", valign: "top"}
|
||||
%td.name= order_article.article.name
|
||||
- if @order.stockit?
|
||||
%td= truncate order_article.article.supplier.name, length: 15
|
||||
%td= h order_article.article.origin
|
||||
%td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price])
|
||||
%td= order_article.article.unit
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
%span.description
|
||||
= t '.desc', amount: number_to_currency(apple_bar.mean_order_amount_per_job, :precision=>0)
|
||||
- if FoodsoftConfig[:stop_ordering_under].present?
|
||||
%strong= t '.warning', threshold: FoodsoftConfig[:stop_ordering_under]
|
||||
%strong= t('.warning', threshold: FoodsoftConfig[:stop_ordering_under])
|
||||
= link_to t('.more_info'), FoodsoftConfig[:applepear_url], target: '_blank'
|
||||
|
|
|
|||
1
app/views/messages/index.js.haml
Normal file
1
app/views/messages/index.js.haml
Normal file
|
|
@ -0,0 +1 @@
|
|||
$('#messages').html('#{j(render('messages', messages: @messages, pagination: true))}');
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#recipients
|
||||
= f.input :recipient_tokens, :input_html => { 'data-pre' => User.find_all_by_id(@message.recipients_ids).map { |u| u.token_attributes }.to_json }
|
||||
= f.input :group_id, :as => :select, :collection => Group.order('type DESC, name ASC').all.reject { |g| g.memberships.empty? }
|
||||
= f.input :group_id, :as => :select, :collection => Group.undeleted.order('type DESC, name ASC').all.reject { |g| g.memberships.empty? }
|
||||
= f.input :private
|
||||
= f.input :subject, input_html: {class: 'input-xxlarge'}
|
||||
= f.input :body, input_html: {class: 'input-xxlarge'}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
= t '.new_order'
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- Supplier.all.each do |supplier|
|
||||
- Supplier.undeleted.order('suppliers.name ASC').each do |supplier|
|
||||
%li= link_to supplier.name, new_order_path(supplier_id: supplier.id), tabindex: -1
|
||||
|
||||
.well
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@
|
|||
= render :partial => 'page_list_item', :locals => {:page => homepage, :level => 0, :siteMap => 1}
|
||||
%tbody
|
||||
- for page in @pages
|
||||
- if page.id != homepage.id
|
||||
- if page.id != homepage.try(:id)
|
||||
= render :partial => 'page_list_item', :locals => {:page => page, :level => 0, :siteMap => 1}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
= form.hidden_field :stock_article_id
|
||||
= "Menge (#{stock_change.stock_article.quantity_available})"
|
||||
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
|
||||
%b=h truncate(stock_change.stock_article.name)
|
||||
%b= stock_change.stock_article.name
|
||||
= "(#{number_to_currency(stock_change.stock_article.price)} / #{stock_change.stock_article.unit})"
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
%td= link_to h(supplier.name) , supplier
|
||||
%td= supplier.phone
|
||||
%td= supplier.customer_number
|
||||
%td= link_to t('.articles', count: supplier.articles.count), supplier_articles_path(supplier)
|
||||
%td= link_to t('.stock', count: supplier.stock_articles.count), stock_articles_path
|
||||
%td= link_to t('.articles', count: supplier.articles.undeleted.count), supplier_articles_path(supplier)
|
||||
%td= link_to t('.stock', count: supplier.stock_articles.undeleted.count), stock_articles_path
|
||||
%td= link_to t('.deliveries', count: supplier.deliveries.count), supplier_deliveries_path(supplier)
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_supplier_path(supplier), class: 'btn btn-mini'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue