Skip to content

Commit

Permalink
Fixes #62
Browse files Browse the repository at this point in the history
  • Loading branch information
lentschi committed Apr 27, 2024
1 parent 7d16991 commit 0773a13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/group-order-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class GroupOrderForm {
usedTolerance$.text(round(usedTolerance));
unusedTolerance$.text(round(unusedTolerance));

totalPacks$.text(round(totalPacks));
totalPacks$.text(packSizeDeterminedBySupplierOrderUnit ? round(totalPacks) : round(totalQuantity));

totalPacks$.css('color', this.packCompletedFromTolerance(packSize, totalQuantity, totalTolerance) ? 'grey' : 'auto');

Expand Down
11 changes: 9 additions & 2 deletions app/views/group_orders/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
.article-name= order_article.article_version.name
.pull-right
= t('.units_full') + ':'
%span{id: "units_#{order_article.id}"}= order_article.units_to_order
%span{id: "units_#{order_article.id}"}= order_article.article_version.convert_quantity(order_article.units_to_order, order_article.article_version.supplier_order_unit, order_article.article_version.group_order_unit)
%br/
= t('.units_total') + ':'
%span{id: "q_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] + @ordering_data[:order_articles][order_article.id][:others_quantity]
Expand All @@ -158,7 +158,14 @@
.pull-left
#{heading_helper Article, :manufacturer}: #{order_article.article_version.manufacturer}
%br/
#{heading_helper Article, :units}: #{@order.stockit? ? order_article.article_version.article.quantity_available : format_supplier_order_unit_with_ratios(order_article.article_version)}
#{heading_helper Article, :units}:
- if @order.stockit?
#{order_article.article_version.article.quantity_available}
- elsif order_article.article_version.uses_tolerance?
#{format_supplier_order_unit_with_ratios(order_article.article_version)}
- else
#{format_group_order_unit_with_ratios(order_article.article_version)}

%br/
#{heading_helper Article, :note}: #{order_article.article_version.note}
%br/
Expand Down

0 comments on commit 0773a13

Please sign in to comment.