no-comment / plutus-financial-slicer

A parser and splitter for App Store Connects financial reports
MIT License
3 stars 0 forks source link

Wrong exchange rate used for US sales when "Lateinamerika und Karibik (USD)" is present in currency data file #1

Closed blach closed 5 months ago

blach commented 5 months ago

When there is a row for "Lateinamerika und Karibik (USD)", the wrong exchange rate is used for "Nord- und Südamerika (USD)".

You already handle that USD can appear twice in currency data, but in fact it can occur three times when there were sales in Latin America and the Caribbean.

This code would need to be changed to account for this: https://github.com/no-comment/plutus-financial-slicer/blob/b2eb5a891fdc4e3f42ddac3c59c8331327e83855/Sources/PlutusFinancialReportSlicer/PlutusFinancialReportSlicer.swift#L81-L92

Here are three example lines from a German currency data .csv file:

"Rest der Welt (USD)","3","26.37","26.37","0","0","0","26.37","0.92074","24.28","EUR",
"Lateinamerika und Karibik (USD)","2","19.53","19.53","0","0","0","19.53","0.92063","17.98","EUR",
"Nord- und Südamerika (USD)","253","2381.72","2381.72","0","0","0","2381.72","0.92080","2193.09","EUR",

In this case I had USD sales in Dominican Republic (DO) and Nicaragua (NI).

When importing this file, the exchange rate 0.92063 is used for Apple Inc. sales instead of the 0.92080 exchange rate, resulting in wrong invoice totals for US sales.

Thanks for the great tool!

mikakruschel commented 5 months ago

Thank you so much for reporting this!

fedoco commented 5 months ago

Hi there, please consider reporting issues like this upstream as well :)