From f351deed4d8e1bf1202899b3083268c268da73a5 Mon Sep 17 00:00:00 2001 From: Florian Lentsch Date: Fri, 16 Feb 2024 16:16:32 +0100 Subject: [PATCH] Some more fixes for #44 --- app/assets/javascripts/application.js | 3 ++- app/views/shared/articles_by/_group_single_goa.html.haml | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 73c363c5..c07a73f9 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -113,7 +113,8 @@ $(function() { clearTimeout(input.data('submit-timeout-id')); input.data('submit-timeout-id', setTimeout(function() { if (input.data('multiply-before-submit')) { - input.parents('form').append(``); + input.parents('form').find(`input[type="hidden"][name="${input.attr('name')}"]`).remove(); + input.parents('form').append(``); } if (input.val() != input.data('old-value')) input.parents('form').submit(); input.removeData('submit-timeout-id'); diff --git a/app/views/shared/articles_by/_group_single_goa.html.haml b/app/views/shared/articles_by/_group_single_goa.html.haml index 31af690c..4b663bfd 100644 --- a/app/views/shared/articles_by/_group_single_goa.html.haml +++ b/app/views/shared/articles_by/_group_single_goa.html.haml @@ -1,10 +1,11 @@ %tr{class: [cycle('even', 'odd', :name => 'articles'), if goa.result == 0 then 'unavailable' end], id: "goa_#{goa.id}"} + - article_version = goa.order_article.article_version %td.name= goa.order_article.article_version.name - %td= format_group_order_unit_with_ratios(goa.order_article.article_version) - %td.center= "#{goa.quantity} + #{goa.tolerance}" + %td= format_billing_unit_with_ratios(article_version) + %td.center= "#{article_version.convert_quantity(goa.quantity, article_version.group_order_unit, article_version.billing_unit)} + #{article_version.convert_quantity(goa.tolerance, article_version.group_order_unit, article_version.billing_unit)}" %td.center.input-delta= group_order_article_edit_result(goa) %td.symbol × - %td= number_to_currency(goa.order_article.article_version.fc_price) + %td= number_to_currency(article_version.convert_quantity(article_version.fc_price, article_version.billing_unit, article_version.group_order_unit)) %td.symbol = %td.price{data: {value: goa.total_price}}= number_to_currency(goa.total_price) %td= pkg_helper goa.order_article.price