add base price to group order form
This commit is contained in:
parent
80031c9e20
commit
43a41062e9
7 changed files with 15 additions and 0 deletions
|
@ -53,4 +53,12 @@ module GroupOrdersHelper
|
|||
return 'missing-many'
|
||||
end
|
||||
end
|
||||
|
||||
def price_per_base_unit(article:, price:)
|
||||
quantity_unit = QuantityUnit.parse(article.unit)
|
||||
return nil unless quantity_unit.present?
|
||||
|
||||
scaled_price, base_unit = quantity_unit.scale_price_to_base_unit(price)
|
||||
"#{number_to_currency(scaled_price)}/#{base_unit}"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
%th{style: 'width:120px'}= heading_helper StockArticle, :supplier
|
||||
%th{style: "width:13px;"}
|
||||
%th{style: "width:4.5em;"}= t '.price'
|
||||
%th{style: "width:4.5em;"}= t '.price_per_base_unit'
|
||||
%th{style: "width:4.5em;"}= heading_helper Article, :unit
|
||||
- unless @order.stockit?
|
||||
%th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true
|
||||
|
@ -100,6 +101,7 @@
|
|||
%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= price_per_base_unit(article: order_article.article, price: @ordering_data[:order_articles][order_article.id][:price])
|
||||
%td= order_article.article.unit
|
||||
%td
|
||||
- if @order.stockit?
|
||||
|
|
|
@ -1052,6 +1052,7 @@ de:
|
|||
action_save: Bestellung speichern
|
||||
new_funds: Neuer Kontostand
|
||||
price: Preis
|
||||
price_per_base_unit: Grundpreis
|
||||
reset_article_search: Suche zurücksetzen
|
||||
search_article: Artikel suchen...
|
||||
sum_amount: Gesamtbestellmenge bisher
|
||||
|
|
|
@ -1054,6 +1054,7 @@ en:
|
|||
action_save: Save order
|
||||
new_funds: New account balance
|
||||
price: Price
|
||||
price_per_base_unit: Base price
|
||||
reset_article_search: Reset search
|
||||
search_article: Search for articles...
|
||||
sum_amount: Current amount
|
||||
|
|
|
@ -929,6 +929,7 @@ es:
|
|||
action_save: Guardar pedido
|
||||
new_funds: Nuevo balance de cuenta
|
||||
price: Precio
|
||||
price_per_base_unit: Precio de base
|
||||
reset_article_search: Reinicia la búsqueda
|
||||
search_article: Busca artículos...
|
||||
sum_amount: Cantidad actual
|
||||
|
|
|
@ -678,6 +678,7 @@ fr:
|
|||
action_save: Enregistrer ta commande
|
||||
new_funds: Nouveau solde
|
||||
price: Prix
|
||||
price_per_base_unit: Prix de base
|
||||
reset_article_search: Réinitialiser la recherche
|
||||
search_article: Rechercher des produits...
|
||||
sum_amount: Quantité déjà commandée
|
||||
|
|
|
@ -1024,6 +1024,7 @@ nl:
|
|||
action_save: Bestelling opslaan
|
||||
new_funds: Nieuw tegoed
|
||||
price: Prijs
|
||||
price_per_base_unit: Basisprjis
|
||||
reset_article_search: Alles tonen
|
||||
search_article: Artikelen zoeken...
|
||||
sum_amount: Huidig totaalbedrag
|
||||
|
|
Loading…
Reference in a new issue