Closed sirnacnud closed 7 years ago
Great work! Thanks for the help!
A few things I noticed, and fixed in the latest commit after merging your pull request:
Sorry for not covering those cases, I only have a single Vendor ID with my ITC account. Out of curiosity, what kind of payment report is neither paid or expected? All of mine are one or the other.
About four years ago, I changed my iTunes Connect details to reflect my company name, rather than my personal name, and as part of that process, a new Vendor ID was created. As a result, I stopped receiving payments under that old Vendor ID, but somehow, a small amount was still associated with it, and it now seems to have gone into limbo, with the Payments Reports showing it as such. Apple still recognizes that I’m owed this $3.25, but it seems to have gotten stuck in that original transition.
You can see the effects of this under reportSummaries
, where "isPaymentExpected": false
and "paidOrExpectingPaymentDate": ""
. In particular, the empty paidOrExpectingPaymentDate
string was throwing off the code. It’s admittedly an edge case, but it was enough to through the app off.
{
"data": {
"vendorName": "Acme Corporation",
"sapVendorNumber": 12345678,
"lastSoldUnit": 0,
"reportDate": "2017-02-01T00:00:00Z",
"updatedDate": "2017-02-01T00:00:00Z",
"isPooled": false,
"reportSummaries": [{
"status": "PENDING_PAYMENT",
"returnMessage": null,
"amount": "3.25",
"currency": "USD",
"bankName": "",
"maskedBankAccount": "",
"isPaymentExpected": false,
"paidOrExpectingPaymentDate": "",
"proceedsByRegion": [{
"regionCurrency": {
"regionCurrencyId": 10004,
"regionId": 10004,
"regionName": "United Kingdom",
"regionNameKey": "ITC.Financial.MZPaymentConsolidation.region.GB",
"currencyCode": "GBP"
},
"unitsSold": 0,
"beginBalance": "0.36",
"earned": "0.00",
"total": "0.36",
"taxesAndFees": "0.00",
"withHoldingTax": "0.00",
"inputTax": "0.00",
"adjustmentAmount": "0.00",
"totalOwed": "0.36",
"exchangeRate": "",
"proceeds": "0.45",
"availableReportTypes": null
}, {
"regionCurrency": {
"regionCurrencyId": 10000,
"regionId": 10000,
"regionName": "Americas",
"regionNameKey": "ITC.Financial.MZPaymentConsolidation.region.US",
"currencyCode": "USD"
},
"unitsSold": 0,
"beginBalance": "2.80",
"earned": "0.00",
"total": "2.80",
"taxesAndFees": "0.00",
"withHoldingTax": "0.00",
"inputTax": "0.00",
"adjustmentAmount": "0.00",
"totalOwed": "2.80",
"exchangeRate": "",
"proceeds": "2.80",
"availableReportTypes": null
}]
}]
},
"messages": {
"warn": null,
"error": null,
"info": null
},
"statusCode": "SUCCESS"
}
All my payments are gone after this update! WTF???
All your payments will need to be redownloaded. Payments are normally downloaded only when there are new reports for the day.
I have payments from 2012. Will they redownload too? I doubt that...
If the reports are available in iTunesConnect they should download.
That's the point! I doubt my old reports are still available in ITC to download. How can I get them back?
@Morpheus2002 Yes, they will all redownload. All of my payments have redownloaded, and they go all the way back to 2010.
@Morpheus2002 Additionally, the payments are still saved in the database (they were never actually deleted). You’ll just need to download the AppSales app container using Xcode.
@Morpheus2002 Just make sure that you allow the app enough time to download all of them (it may take a few minutes).
@nicolasgomollon I got 2 vendor IDs too. Did it work with both of them? Can you tell me where is the counter, so the reports are downloaded once a day? Don't want to wait until tomorrow and need to change this counter, so I can download my reports now.
@Morpheus2002 Yes, it works just as before. Payments from both Vendor IDs were downloaded and aggregated for each month.
You can actually go into the “Sales and Trends” section of the app, long press on the latest report on the graph, and then tap “Delete”. You should now be able to tap on the refresh button for the report to redownload, and the payments to download as well.
I deleted the last report and tapped on the refresh button. The deleted report was redownloaded, but no payments ... Still got a totally empty payments section.
@Morpheus2002 Oh, alright, sorry about that! You can comment out this section from Classes/Report Download/ReportDownloadOperation.m
(lines 289-303), and replace it with the following:
{
[self downloadProgress:0.9f withStatus:NSLocalizedString(@"Loading payments...", nil)];
LoginManager *loginManager = [[LoginManager alloc] initWithAccount:_account];
loginManager.shouldDeleteCookies = [[NSUserDefaults standardUserDefaults] boolForKey:kSettingDeleteCookies];
loginManager.delegate = self;
[loginManager logIn];
}
NOTE: The curly braces are necessary in order to keep Xcode from complaining about redefining the loginManager
variable.
@nicolasgomollon it worked!!! Thank you very much!
I was able to download only one payment for January. No further payment are downloaded.
I did discover an issue with payment reports and with #28, payment reports will be re-downloaded if they contain no payment summaries. Maybe this fixes your issue?
Thanks @sirnacnud! This fixed my issue.
I have made multiple improvements to the payment data that is stored and displayed.
After this change, all payment data will have to be downloaded again, as we store each individual payment report, rather than summing up the payment reports like in the old method.