-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reports #259
Reports #259
Conversation
Instead of trying to parse the response as a collection which always ends up blank, it now just returns a single Report model. The report model has an "xml" attribute containing the full response document, similar to has last_xml_response was previously used in the api. Added some tests and did some cleanup
- remove call to remove_xml_namespaces! Use css queries instead. - cache @all_rows - implement find_row using all_rows
XML_NODE = "Reports" | ||
REST_RESOURCE = 'reports' | ||
|
||
REPORT_TYPES = ['BalanceSheet', 'ProfitandLoss', 'ProfitAndLossDetail', 'TrialBalance', 'CashFlow', 'InventoryValuationSummary', 'CustomerSales', 'ItemSales', 'DepartmentSales', 'ClassSales', 'CustomerIncome', 'CustomerBalance', 'CustomerBalanceDetail', 'AgedReceivables', 'AgedReceivableDetail', 'VendorBalance', 'VendorBalanceDetail', 'AgedPayables', 'AgedPayableDetail', 'VendorExpenses', 'GeneralLedgerDetail'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These weren't used and were out of date w/ all the supported reports now, so I removed them
Thanks. Looks good to me, although, I am not using the existing reporting implementation in production so.. |
Hang tight on this. This breaks the previous API so we need to evaluate. |
The api has changed, but as comments in the issue thread indicate people aren't actually using the return value of So basically the old way the api was used - No rush to merge and please confirm the above is true, I was a little confused by its behavior before and was wondering how the Report model ever worked. Looking at the git history, it looked like there was a bad fixture at one point which contained several |
Ok, I am going to take this PR for a spin early next week. |
Sorry, I've been away on vacation so just saw this now - I'll take a look at some point next week, but I'd happily accept having to make a couple of changes to use this, which actually returns an object. Looks good, at a cursory glance. |
This looks great - thank you @ratbeard It sounds like I should merge this and release a Let me know if y'all are ready. Thanks again. |
@ruckus It may be best if you |
Update: Would like to get this evaluated and potentially merged soon. |
Let me know if I can do anything to help. I considered making a Row class to hold values for each row but ended up just using an array e.g: |
Hey, sorry I've not commented back for a while - I gave this a whirl, and it looks good to me. Happy to see this merged in. |
Thanks @Craggar |
Related to discussion in #146. Changes are:
service.last_response_xml
report_with_years.columns.should == ["", "Jul 4 - Dec 31, 2013", "Jan - Dec 2014", "Jan 1 - Jun 21, 2015"]
["Total Expenses", BigDecimal(100), BigDecimal(80)]
report.find_row("Total Expenses")
~Thanks! 🙇