mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 14:06:21 +02:00
10 lines
319 B
Ruby
10 lines
319 B
Ruby
class DeleteMonthlyInvoicesJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform
|
|
@month = Time.zone.now - 1.month
|
|
invoices = Invoice.where(monthly_invoice: true, issue_date: @month.end_of_month.to_date,
|
|
in_directo: false, e_invoice_sent_at: nil)
|
|
invoices.delete_all
|
|
end
|
|
end
|