1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

(bug) api/accounting: amounts expressed in centimes

This commit is contained in:
Sylvain 2022-12-13 12:38:19 +01:00
parent fc49de3530
commit 86756f911b
2 changed files with 6 additions and 4 deletions

View File

@ -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."
}

View File

@ -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