Class: Uomi::OverdueInvoice

Inherits:
Object
  • Object
show all
Defined in:
lib/uomi/overdue_invoice.rb

Class Method Summary collapse

Class Method Details

.allObject



4
5
6
# File 'lib/uomi/overdue_invoice.rb', line 4

def self.all
  Invoice.owing.select{|invoice| invoice.overdue?}
end

.record_late_payments!Object



8
9
10
11
12
13
# File 'lib/uomi/overdue_invoice.rb', line 8

def self.record_late_payments!
  OverdueInvoice.all.each do |invoice|
    invoice.late_payment = LatePayment.new amount: invoice.balance.abs
    invoice.save!
  end
end