2020-10-27 16:02:41 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Represents a due date and the associated amount for a PaymentSchedule
|
2020-12-22 09:53:41 +01:00
|
|
|
class PaymentScheduleItem < Footprintable
|
2020-10-27 16:02:41 +01:00
|
|
|
belongs_to :payment_schedule
|
2020-11-12 16:44:55 +01:00
|
|
|
belongs_to :invoice
|
2020-12-16 18:33:43 +01:00
|
|
|
after_create :chain_record
|
|
|
|
|
2021-01-25 13:05:27 +01:00
|
|
|
def first?
|
|
|
|
payment_schedule.ordered_items.first == self
|
|
|
|
end
|
|
|
|
|
2020-12-21 17:37:58 +01:00
|
|
|
def self.columns_out_of_footprint
|
2021-01-26 17:31:11 +01:00
|
|
|
%w[invoice_id stp_invoice_id state payment_method]
|
2020-12-21 17:37:58 +01:00
|
|
|
end
|
2020-10-27 16:02:41 +01:00
|
|
|
end
|