Skip to content

Commit

Permalink
Some more fixes for #44
Browse files Browse the repository at this point in the history
lentschi committed Feb 18, 2024
1 parent 34b6a51 commit f351dee
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -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 type="hidden" name="${input.attr('name')}" value="${input.val() * input.data('multiply-before-submit')}" />`);
input.parents('form').find(`input[type="hidden"][name="${input.attr('name')}"]`).remove();
input.parents('form').append(`<input type="hidden" name="${input.attr('name')}" value="${Big(input.val()).mul(input.data('multiply-before-submit')).round(8)}" />`);
}
if (input.val() != input.data('old-value')) input.parents('form').submit();
input.removeData('submit-timeout-id');
7 changes: 4 additions & 3 deletions app/views/shared/articles_by/_group_single_goa.html.haml
Original file line number Diff line number Diff line change
@@ -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 &times;
%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

0 comments on commit f351dee

Please sign in to comment.