Skip to content

Commit

Permalink
Bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
lentschi committed Dec 27, 2023
1 parent 6b8c112 commit 380f279
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/views/articles/_edit_all_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
.input-append
= form.input_field :minimum_order_quantity, class: 'input-mini', title: "total minimum order quantity for this article"
.fold-line
= form.input :billing_unit, as: :select, collection: [], input_html: {class: 'input-medium'}, include_blank: false
= form.input :billing_unit, as: :select, collection: [], input_html: {'data-initial-value': article.billing_unit, class: 'input-medium'}, include_blank: false
.fold-line
= form.input :group_order_granularity, label: "Allow orders per", input_html: {class: 'input-mini', title: "steps in which ordergroups can order this article"}
= form.input :group_order_unit, as: :select, collection: [], input_html: {class: 'input-medium'}, label: '×'.html_safe, include_blank: false
= form.input :group_order_unit, as: :select, collection: [], input_html: {'data-initial-value': article.group_order_unit, class: 'input-medium'}, label: '×'.html_safe, include_blank: false
%td
.d-flex.gap-1
.input-prepend
Expand Down
4 changes: 1 addition & 3 deletions app/views/orders/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
%td= truncate article.origin, length: 15, tooltip: true
%td= truncate article.manufacturer, length: 15, tooltip: true
%td
= article.unit
- if article.unit_quantity > 1
%span{style: 'color: grey'} × #{article.unit_quantity}#{pkg_helper_icon}
= format_supplier_order_unit_with_ratios(article)
%td= "#{number_to_currency(article.price)} / #{number_to_currency(article.fc_price)}"
%tr
%td
Expand Down
3 changes: 3 additions & 0 deletions lib/article_units_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def self.get_code_for_translated_name(name)
def self.convert_old_unit(old_compound_unit_str, unit_quantity)
return nil if old_compound_unit_str.nil?

md = old_compound_unit_str.match(/([0-9]*)x(.*)/)
old_compound_unit_str = md[2] if !md.nil? && md[1].to_f == unit_quantity

md = old_compound_unit_str.match(%r{^\s*([0-9][0-9,./]*)?\s*([A-Za-z\u00C0-\u017F.]+)\s*$})
return nil if md.nil?

Expand Down

0 comments on commit 380f279

Please sign in to comment.