fedoco / apple-slicer Goto Github PK
View Code? Open in Web Editor NEWParses App Store Connect (formerly iTunes Connect) financial reports and splits sales by their legally accountable Apple subsidiaries
License: MIT License
Parses App Store Connect (formerly iTunes Connect) financial reports and splits sales by their legally accountable Apple subsidiaries
License: MIT License
Sales in Philippines (PH)
Quantity Product Amount Exchange Rate Amount in USD
Traceback (most recent call last):
File "/Users/silviu/apple-slicer/./slicer.py", line 286, in <module>
print_sales_by_corporation(sales, currencies, args.no_subtotals, args.only_subtotals, args.selected_corporations)
File "/Users/silviu/apple-slicer/./slicer.py", line 237, in print_sales_by_corporation
exchange_rate, tax_factor = currency_data[country_currency]
KeyError: 'PHP'
🤔
Is the same script available for Android as well?
The slicer checks for incomplete reports by comparing the financial_report header column count with 11. But actually nowadays the reduced column count is 9. At least as I recently witnessed with September 2017. The unusal error message threw me off.
Traceback (most recent call last):
File "./slicer.py", line 218, in <module>
print_sales_by_corporation(sales, currencies)
File "./slicer.py", line 187, in print_sales_by_corporation
exchange_rate, tax_factor = currency_data[country_currency]
KeyError: 'USD - RoW'
In slicer.py
there is
if "_WW." in filename and currency == "USD":
currencies[countrycode] = "USD - RoW"
but in my german localized financial_report.csv
the currency is actually Rest der Welt (USD)
, so slicer.py
fails. When I comment the two lines out, it works for me.
The script doesn’t seem to work for me for currencies other than EUR:
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
U.S.A.
Sales in United States (US)
Quantity Product Amount Exchange Rate Amount in EUR
Traceback (most recent call last):
File "./slicer.py", line 206, in <module>
print_sales_by_corporation(sales, currencies)
File "./slicer.py", line 175, in print_sales_by_corporation
exchange_rate, tax_factor = currency_data[country_currency]
KeyError: 'USD'
What can I do to help?
When you join the Apple Developer program and sign the contracts, you give Apple all the rights to sell your apps. So, technically, you are not selling any apps anywhere and there are no sells to be declared anywhere.
Hello,
Thank you first of all for the very useful script which helps me a lot to prepare correct invoices.
Unfortunately after results verifications I found that for some countries the Sales reports are not match to the Payment reports. These countries are like Albania, Algeria, Kenya, etc - all of them belongs to the so called by Apple "Rest of World" region.
As I found the reason for this issue is that the sales in these countries are made in USD, but the FX Rate which Apple use is not the USD (in the FX Rate table) but "USD - RoW" (Rest of World).
In the python script all FX Rates are read-in correctly, including "USD - RoW", but it is never used later for the calculations as in the sales reports for these countries Apple do not name currency as "USD - RoW", but just as USD.
Please let me know if it is clear what I've tried to explain and thank you in advance!
Hi! Back again with some error:
Traceback (most recent call last): File "/Users/silviu/apple-slicer/./slicer.py", line 283, in <module> print_sales_by_corporation(sales, currencies, args.no_subtotals, args.only_subtotals) File "/Users/silviu/apple-slicer/./slicer.py", line 235, in print_sales_by_corporation exchange_rate, tax_factor = currency_data[country_currency] KeyError: 'HRK'
The report looks like this:
Thanks!
Hey @fedoco, thanks for this awesome tool. We just recently used it to create a free Mac app that uses the App Store Connect api to fetch the reports, parses them with our swift port of this library, and exports invoices as PDFs. One user made us aware that there is an issue with the currency conversion of USD in "Latin America and the Caribbean" (similarly to USD - Rest of the World). This is also an issue with your library.
Not sure if this is an issue, but the total amount from what Apple pays you is slightly different from what apple-slicer calculates in total. So if I create an invoice with the data from apple-slicer, I have a different end value than what Apple actually pays me. Thats not good.
I didn't check all the numbers by hand but I think the issue is that Apple converts the currency for the sales from each region to the destination currency (i.e. everything to Euro) and rounds it to two two decimal places. Then it sums up every result, rounds it again and has the end result that is being payed to the developer. Thats what you can see in financial_report.csv.
apple-slicer however converts the every country with the currency to the destination currency and sums it up. This can lead to an higher or lower sum than what is actually paid by apple.
In my tests, apple-slicer calculated 0,99% more than Apple did for my last payment from them. That seems not much, but its much as soon as the numbers get higher of cause.
Can someone confirm that this is an issue?
Hi, thank you for this tool - using it for some months, but now I have encountered the following error:
Traceback (most recent call last): File "/Users/silviu/apple-slicer/./slicer.py", line 268, in <module> currency_data = parse_currency_data(args.directory + '/' + currency_data_filename) File "/Users/silviu/apple-slicer/./slicer.py", line 143, in parse_currency_data tax_factor = Decimal(1.0) - abs(tax / amount_pre_tax) decimal.DivisionByZero: [<class 'decimal.DivisionByZero'>]
Thank you!
Hi,
The readme says:
the sum paid by Apple Distribution International must be split into revenue made in member states of the European Union and into revenue made in Non-EU countries
However, the script does not distinguish between European Union and Non-EU countries at all. Switzerland, China and others are included, which makes the sum for the Recapitulative Statement wrong. Compare with https://exelerus.com/mobiledev/apple/ when you include Switzerland in your financial reports.
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.