1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/app/views/api/invoices/list.json.jbuilder

26 lines
897 B
Plaintext
Raw Normal View History

# frozen_string_literal: true
max_invoices = @invoices.except(:offset, :limit, :order).count
json.array!(@invoices) do |invoice|
json.maxInvoices max_invoices
2021-05-27 15:58:55 +02:00
json.extract! invoice, :id, :created_at, :reference, :avoir_date
json.user_id invoice.invoicing_profile.user_id
2019-07-29 12:17:57 +02:00
json.total invoice.total / 100.00
json.name invoice.invoicing_profile.full_name
2019-01-09 16:28:23 +01:00
json.has_avoir invoice.refunded?
json.is_avoir invoice.is_a?(Avoir)
2019-01-09 16:28:23 +01:00
json.is_subscription_invoice invoice.subscription_invoice?
json.online_payment invoice.paid_by_card?
json.date invoice.is_a?(Avoir) ? invoice.avoir_date : invoice.created_at
json.prevent_refund invoice.prevent_refund?
2019-02-12 16:00:36 +01:00
json.chained_footprint invoice.check_footprint
if invoice.operator_profile
json.operator do
json.id invoice.operator_profile.user_id
json.extract! invoice.operator_profile, :first_name, :last_name
end
end
2019-01-09 16:28:23 +01:00
end