diff --git a/app/domain/invoicing/small_invoice/invoice_sync.rb b/app/domain/invoicing/small_invoice/invoice_sync.rb index 2067f778..ca189c0c 100644 --- a/app/domain/invoicing/small_invoice/invoice_sync.rb +++ b/app/domain/invoicing/small_invoice/invoice_sync.rb @@ -38,7 +38,9 @@ def sync_unpaid def unpaid_invoices Invoice .joins(order: :status) - .where.not(status: 'paid', invoicing_key: nil, order_statuses: { closed: true }) + .where.not(status: :paid) + .where.not(invoicing_key: nil) + .where.not(order_statuses: { closed: true }) end def notify_sync_error(error, invoice)