simplify filtering condition to select only invoiceable orders on OrdersReflex

This commit is contained in:
Mohamed ABDELLANI
2023-07-12 11:32:38 +01:00
parent 5ae2545918
commit 7daa4d3a63

View File

@@ -72,7 +72,7 @@ module Admin
def send_invoices(params)
count = 0
editable_orders.where(id: params[:bulk_ids]).find_each do |o|
next unless o.distributor.can_invoice? && (o.resumed? || o.complete?)
next unless o.distributor.can_invoice? && o.invoiceable?
Spree::OrderMailer.invoice_email(o.id).deliver_later
count += 1