add price_per quantity unit to group order new

This commit is contained in:
viehlieb 2023-02-21 16:50:53 +01:00
parent 7ddb6ec0ef
commit 1106178e38
16 changed files with 40 additions and 8 deletions

View file

@ -1,5 +1,6 @@
= simple_form_for [@supplier, @article], :validate => true, :remote => true do |f|
= f.hidden_field :shared_updated_on
= f.hidden_field :unit_symbol
= f.hidden_field :supplier_id
.modal-header
= close_button :modal

View file

@ -17,14 +17,14 @@
%i
= t '.update.update_msg', count: @updated_article_pairs.size
= t '.update.body'
= render 'sync_table', articles: @updated_article_pairs, field: 'articles', hidden_fields: %w(shared_updated_on)
= render 'sync_table', articles: @updated_article_pairs, field: 'articles', hidden_fields: %w(shared_updated_on unit_symbol)
%hr/
- if @new_articles.any?
%h2= t '.upnew.title'
%p
%i= t '.upnew.body_count', count: @new_articles.length
= render 'sync_table', articles: @new_articles, field: 'new_articles', hidden_fields: %w(shared_updated_on order_number availability)
= render 'sync_table', articles: @new_articles, field: 'new_articles', hidden_fields: %w(shared_updated_on order_number availability unit_symbol)
%hr/
- if ignored_article_count > 0

View file

@ -8,6 +8,7 @@
%th= heading_helper Article, :unit
%th= heading_helper Article, :unit_quantity, short: true
%th= heading_helper Article, :price
%th= heading_helper Article, :price_per
%th= heading_helper Article, :tax
%th= heading_helper Article, :deposit
%th= heading_helper Article, :article_category
@ -23,6 +24,7 @@
%td= article.unit
%td= article.unit_quantity
%td= number_to_currency article.price
%td= number_to_currency article.price_per.round(2)
%td= number_to_percentage article.tax
%td= number_to_currency article.deposit
%td= article.article_category.name if article.article_category
@ -41,6 +43,10 @@
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= form.text_field 'price', class: 'input-mini', style: 'width: 45px'
%td{:style => highlight_new(attrs, :price_per)}
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= form.text_field 'price_per', class: 'input-mini', style: 'width: 45px'
%td{:style => highlight_new(attrs, :tax)}
.input-append
= form.text_field 'tax', class: 'input-mini', style: 'width: 45px'