2016-03-23 18:39:41 +01:00
|
|
|
json.array!(@invoices) do |invoice|
|
|
|
|
json.extract! invoice, :id, :created_at, :reference, :invoiced_type, :user_id, :avoir_date
|
|
|
|
json.total (invoice.total / 100.00)
|
2021-04-20 17:22:53 +02:00
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
json.name invoice.user.profile.full_name
|
2019-01-09 16:28:23 +01:00
|
|
|
json.has_avoir invoice.refunded?
|
2016-03-23 18:39:41 +01:00
|
|
|
json.is_avoir invoice.is_a?(Avoir)
|
2019-01-09 16:28:23 +01:00
|
|
|
json.is_subscription_invoice invoice.subscription_invoice?
|
2021-04-20 17:22:53 +02:00
|
|
|
json.stripe invoice.paid_by_card?
|
2016-03-23 18:39:41 +01:00
|
|
|
json.date invoice.is_a?(Avoir) ? invoice.avoir_date : invoice.created_at
|
|
|
|
json.prevent_refund invoice.prevent_refund?
|
|
|
|
end
|