Code Monkey home page Code Monkey logo

apple-slicer's People

Contributors

fedoco avatar germanmarques avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

apple-slicer's Issues

KeyError: 'PHP'

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'

🤔

KeyError: 'USD - RoW' when doing a german report

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.

Currency conversion error

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?

"Your sales" vs "Apple's sales"

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.

USD - RoW FX Rate not used

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!

KeyError: 'HRK'

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'
image

The report looks like this:

image

Thanks!

USD - Latin America and the Caribbean

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.

Rounding issue

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?

[error] decimal.DivisionByZero

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!

No distinction between European Union and Non-EU countries

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

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.