diff --git a/CHANGELOG.md b/CHANGELOG.md index cee1a7843..11277b0b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - improvement: add loader for create/delete availability slot - Fix a bug: unable to update a space with a deleted machine +- Fix a bug: unable to get invoice payment details if the account code is same for card/transfer payment method ## v6.3.16 2024 March 11 diff --git a/app/views/open_api/v1/accounting/index.json.jbuilder b/app/views/open_api/v1/accounting/index.json.jbuilder index 44b161f0b..fca21c588 100644 --- a/app/views/open_api/v1/accounting/index.json.jbuilder +++ b/app/views/open_api/v1/accounting/index.json.jbuilder @@ -11,7 +11,7 @@ json.lines @lines do |line| json.url download_open_api_v1_invoice_path(line.invoice) json.payment_method line.invoice_payment_method if @codes.values.include?(line.account_code) # if this is a 'payment' line - mean = @codes.select { |_key, value| value == line.account_code } + mean = @codes.select { |_key, value| value == line.account_code && _key == line.invoice_payment_method.to_sym } json.payment_details line.invoice.payment_details(mean.keys[0]) end end