1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-04 15:24:23 +01:00
fab-manager/app/views/api/invoices/index.json.jbuilder
2021-05-27 15:58:55 +02:00

15 lines
518 B
Ruby

# frozen_string_literal: true
json.array!(@invoices) do |invoice|
json.extract! invoice, :id, :created_at, :reference, :user_id, :avoir_date
json.total invoice.total / 100.00
json.name invoice.user.profile.full_name
json.has_avoir invoice.refunded?
json.is_avoir invoice.is_a?(Avoir)
json.is_subscription_invoice invoice.subscription_invoice?
json.stripe invoice.paid_by_card?
json.date invoice.is_a?(Avoir) ? invoice.avoir_date : invoice.created_at
json.prevent_refund invoice.prevent_refund?
end