1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

removes only_invoice scope from regenerate_invoices rake task

This commit is contained in:
Nicolas Florentin 2019-08-14 14:18:04 +02:00
parent 92d79bc9c7
commit 0c4475acea

View File

@ -11,8 +11,7 @@ namespace :fablab do
end_date = start_date.next_month
puts "-> Start regenerate the invoices PDF between #{I18n.l start_date, format: :long} and " \
"#{I18n.l end_date - 1.minute, format: :long}"
invoices = Invoice.only_invoice
.where('created_at >= :start_date AND created_at < :end_date', start_date: start_date, end_date: end_date)
invoices = Invoice.where('created_at >= :start_date AND created_at < :end_date', start_date: start_date, end_date: end_date)
.order(created_at: :asc)
invoices.each(&:regenerate_invoice_pdf)
puts '-> Done'