2022-11-23 17:35:39 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
json.lines @lines do |line|
|
|
|
|
json.extract! line, :id, :line_type, :journal_code, :date, :account_code, :account_label, :analytical_code, :debit, :credit, :currency, :summary
|
2022-12-09 11:09:39 +01:00
|
|
|
if line.association(:invoice).loaded?
|
|
|
|
json.invoice do
|
|
|
|
json.extract! line.invoice, :reference, :id
|
|
|
|
json.label Invoices::LabelService.build(line.invoice)
|
|
|
|
json.url download_open_api_v1_invoice_path(line.invoice)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if line.association(:invoicing_profile).loaded?
|
|
|
|
json.user do
|
|
|
|
json.invoicing_profile_id line.invoicing_profile_id
|
|
|
|
json.external_id line.invoicing_profile.external_id
|
|
|
|
end
|
2022-11-23 17:35:39 +01:00
|
|
|
end
|
|
|
|
end
|
2022-12-08 16:14:59 +01:00
|
|
|
json.status Accounting::AccountingService.status
|