override balancing helper- fix double match stockit

This commit is contained in:
viehlieb 2023-10-12 15:40:35 +02:00
parent ac8281fd98
commit 6cee5cad1a
5 changed files with 20 additions and 2 deletions

View file

@ -1,6 +1,7 @@
%td.closed.name
= link_to order_article.article.name, '#', 'data-toggle-this' => "#group_order_articles_#{order_article.id}"
%td= order_article.article.order_number
-# :plain => true destroys deface functionality
%td{title: units_history_line(order_article, :plain => true)}
= order_article.units
= pkg_helper order_article.article_price

View file

@ -1,2 +1,3 @@
%section#results
= render 'edit_results_by_articles'

View file

@ -0,0 +1,15 @@
if FoodsoftAutomaticInvoices.enabled?
Finance::BalancingHelper.class_eval do
def balancing_view_partial
view = params[:view] || 'edit_results'
case view
when 'edit_results'
'edit_results_by_articles_override'
when 'groups_overview'
'shared/articles_by/groups'
when 'articles_overview'
'shared/articles_by/articles'
end
end
end
end

View file

@ -1,4 +1,4 @@
/ insert_before 'erb:contains("order.stockit?")'
/ insert_before 'erb:contains("t \'.prices\'")'
- if FoodsoftAutomaticInvoices.enabled?
- if FoodsoftConfig[:group_order_invoices]&.[](:separate_deposits)
%th= t '.deposit'

View file

@ -1,3 +1,4 @@
-# :javascript destroy deface functionality
- content_for :javascript do
:javascript
$(function() {