From 673205eb50ef28472b79f57a64a4f0f9674697ce Mon Sep 17 00:00:00 2001 From: Nicolas Florentin Date: Wed, 14 Aug 2019 14:26:56 +0200 Subject: [PATCH] removes only_invoice scope from regenerate_invoices rake task --- lib/tasks/fablab/maintenance.rake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tasks/fablab/maintenance.rake b/lib/tasks/fablab/maintenance.rake index bd3303063..af2c5c5f7 100644 --- a/lib/tasks/fablab/maintenance.rake +++ b/lib/tasks/fablab/maintenance.rake @@ -3,7 +3,7 @@ # Maintenance tasks namespace :fablab do namespace :maintenance do - desc 'Regenerate the invoices PDF' + desc 'Regenerate the invoices (invoices & avoirs) PDF' task :regenerate_invoices, %i[year month] => :environment do |_task, args| year = args.year || Time.now.year month = args.month || Time.now.month @@ -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'