From 043eccf16788eab457e1c10eb1eab3028c376c8d Mon Sep 17 00:00:00 2001 From: viehlieb Date: Thu, 22 May 2025 15:22:20 +0200 Subject: [PATCH] another tiny change in pdf --- app/documents/group_order_invoice_pdf.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/documents/group_order_invoice_pdf.rb b/app/documents/group_order_invoice_pdf.rb index 1bf4741b..ccbdb1aa 100644 --- a/app/documents/group_order_invoice_pdf.rb +++ b/app/documents/group_order_invoice_pdf.rb @@ -187,9 +187,11 @@ class GroupOrderInvoicePdf < RenderPdf index = 0 supplier_headlines = [] group_order_articles.group_by { |goa| goa.group_order.order.supplier.name }.each do |supplier_name, articles| - data << [supplier_name, "", "", "", "", ""] - index += 1 - supplier_headlines << index + if articles.map(&:result).sum > 0 + data << [supplier_name, "", "", "", "", ""] + index += 1 + supplier_headlines << index + end articles.each do |goa| next if goa.result.to_i == 0