enable actions for multi (group) orders and ordergroup invoices

This commit is contained in:
viehlieb 2025-05-19 16:37:05 +02:00
parent f676497e43
commit e902aa0d5a
44 changed files with 550 additions and 324 deletions

View file

@ -1,27 +1,24 @@
- unless @orders.empty? && @multi_orders.empty?
- unless @results.empty?
- if Order.finished.count > 20
= items_per_page
= pagination_links_remote @orders
-# following posed a real problem, multiple submit buttons are within the same form, so only one of them will be submitted
-# convert to javascript
= form_with url: multi_orders_path, method: :post, local: true do |form|
%table.table.table-striped
%thead
%tr
%th=I18n.t('activerecord.attributes.group_order_invoice.links.combine')
%th= t('.name')
%th= t('.end')
%th= t('.state')
%th= heading_helper Order, :updated_by
%th= heading_helper GroupOrderInvoice, :name
%th
%th
%tbody
- @multi_orders.each do |multi_order|
= render partial: 'multi_order_row', locals: { multi_order: multi_order }
- @orders.each do |order|
= render partial: 'order_row', locals: { order: order }
= form.submit "Zusammenführen", class: 'btn btn-primary'
%table.table.table-striped
%thead
%tr
%th=I18n.t('activerecord.attributes.group_order_invoice.links.combine')
%th= t('.name')
%th= t('.end')
%th= t('.state')
%th= heading_helper Order, :updated_by
%th= heading_helper GroupOrderInvoice, :name
%th
%th
%tbody
- @results.each do |result|
- if result.class == Order
= render partial: 'order_row', locals: { order: result }
- else
= render partial: 'multi_order_row', locals: { multi_order: result }
= button_tag 'Zusammenführen', class: 'btn btn-primary merge-orders-btn', type: 'button', data: { url: multi_orders_path }
- else
%i= t('.no_closed_orders')