Git Product home page Git Product logo

plutus-financial-slicer's Introduction

Plutus Financial Report Slicer

Note

This package was inspired by fedoco's apple-slicer and is basically a modified version of it written in Swift instead of Python.

What does this do?

This package parses App Store Connect's Financial Reports and splits all sales by their responsible Apple Subsidiaries. This can then be used to easily create invoices like in our app Plutus.

Disclaimer

There is absolutely no warranty. While we believe everything is calculated correctly and have tested everything with some reports, there can always be exceptions because Apple's reports aren't fully documented or could change. In such cases, the calculations should fail rather than provide false information.

Please verify for yourself that the numbers this package computes are reasonable.

If you encounter a bug in the calculation, please let us know on by opening an issue.

plutus-financial-slicer's People

Contributors

cameronshemilt avatar mikakruschel avatar

Stargazers

fedoco avatar Manuel Kehl avatar Simon Nickel avatar

Watchers

fedoco avatar  avatar

plutus-financial-slicer's Issues

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

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:

// USD can occur twice in the file: We must take special care to distinguish between USD (and their corresponding
// exchange rate) for purchases made in "Americas" and in "Rest of World", as Apple calls it. Unfortunately, Apple
// decided to localize the aforementioned strings so they need to be looked up in a translation table. Luckily,
// localized report files currently seem to be generated only for French, German, Italian and Spanish locale settings.
let localizationsRoW = ["of World", "du monde", "der Welt", "del mondo", "del mundo"]
if currency == "USD" {
for localization in localizationsRoW {
if currencyCol.lowercased().contains(localization.lowercased()) {
currency = "USD - RoW"
}
}
}

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.