Compare commits
2 commits
d648f1bd55
...
043eccf167
| Author | SHA1 | Date | |
|---|---|---|---|
| 043eccf167 | |||
| 683c81bc76 |
2 changed files with 6 additions and 4 deletions
|
|
@ -187,9 +187,11 @@ class GroupOrderInvoicePdf < RenderPdf
|
||||||
index = 0
|
index = 0
|
||||||
supplier_headlines = []
|
supplier_headlines = []
|
||||||
group_order_articles.group_by { |goa| goa.group_order.order.supplier.name }.each do |supplier_name, articles|
|
group_order_articles.group_by { |goa| goa.group_order.order.supplier.name }.each do |supplier_name, articles|
|
||||||
data << [supplier_name, "", "", "", "", ""]
|
if articles.map(&:result).sum > 0
|
||||||
index += 1
|
data << [supplier_name, "", "", "", "", ""]
|
||||||
supplier_headlines << index
|
index += 1
|
||||||
|
supplier_headlines << index
|
||||||
|
end
|
||||||
|
|
||||||
articles.each do |goa|
|
articles.each do |goa|
|
||||||
next if goa.result.to_i == 0
|
next if goa.result.to_i == 0
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class OrdergroupInvoice < ApplicationRecord
|
||||||
#how to define one order?
|
#how to define one order?
|
||||||
|
|
||||||
invoice_data[:pickup] = order.pickup
|
invoice_data[:pickup] = order.pickup
|
||||||
invoice_data[:supplier] = order.supplier&.name
|
invoice_data[:supplier] = FoodsoftConfig[:name]
|
||||||
invoice_data[:ordergroup] = group_orders.first.ordergroup
|
invoice_data[:ordergroup] = group_orders.first.ordergroup
|
||||||
invoice_data[:group_order_ids] = group_orders.pluck(:id)
|
invoice_data[:group_order_ids] = group_orders.pluck(:id)
|
||||||
invoice_data[:invoice_number] = invoice_number
|
invoice_data[:invoice_number] = invoice_number
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue