diff --git a/app/doc/open_api/v1/accounting_doc.rb b/app/doc/open_api/v1/accounting_doc.rb index dbe3da885..093a5f13c 100644 --- a/app/doc/open_api/v1/accounting_doc.rb +++ b/app/doc/open_api/v1/accounting_doc.rb @@ -56,7 +56,7 @@ class OpenAPI::V1::AccountingDoc < OpenAPI::V1::BaseDoc "invoicing_profile_id": 6512, "external_id": "U52-ALC4" }, - "debit": 1400, + "debit": 14.0, "credit": 0 "currency": "EUR", "summary": "Dupont Marcel, 22010009/VL, subscr." @@ -77,7 +77,7 @@ class OpenAPI::V1::AccountingDoc < OpenAPI::V1::BaseDoc }, "user_invoicing_profile_id": 6512, "debit": 0, - "credit": 1167 + "credit": 11.67 "currency": "EUR", "summary": "Dupont Marcel, 22010009/VL, subscr." }, @@ -97,7 +97,7 @@ class OpenAPI::V1::AccountingDoc < OpenAPI::V1::BaseDoc }, "user_invoicing_profile_id": 6512, "debit": 0, - "credit": 233 + "credit": 2.33 "currency": "EUR", "summary": "Dupont Marcel, 22010009/VL, subscr." } diff --git a/app/views/open_api/v1/accounting/index.json.jbuilder b/app/views/open_api/v1/accounting/index.json.jbuilder index 11bd3fc1c..017ba53a8 100644 --- a/app/views/open_api/v1/accounting/index.json.jbuilder +++ b/app/views/open_api/v1/accounting/index.json.jbuilder @@ -1,7 +1,9 @@ # 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 + json.extract! line, :id, :line_type, :journal_code, :date, :account_code, :account_label, :analytical_code, :currency, :summary + json.debit line.debit / 100.00 + json.credit line.credit / 100.00 if line.association(:invoice).loaded? json.invoice do json.extract! line.invoice, :reference, :id