I had this as a request from one of my clients, and the most sensible way of doing was to actually modify the code. But considering it, it feels that this should be the right approach within Ubercart as well.
It makes sense that CSV reports are to be used with spreadsheets software, and figures are likely to be added/used in formulas, for which it would be extremely useful to have them as plain numbers, and not formatted by any means.
I know this can eventually be achieve by using formulas to strip the formatting out of the column, but maybe is something that might be considered.
Attached is a patched that removes all uc_price() calls from within the csv figures.
a.=
Comment | File | Size | Author |
---|---|---|---|
#10 | 630058_tax_reports_csv.patch | 1.55 KB | Island Usurper |
#2 | 630058-csv-uc_reports-just-figures.patch | 6.08 KB | hanoii |
#2 | 630058-csv-uc_tax_report-just-figures.patch | 1.99 KB | hanoii |
uc_reports_csv_just_figures.patch | 4.41 KB | hanoii | |
Comments
Comment #1
hanoiiApplies to 2.2 as well
Comment #2
hanoiiAttach better patch using proper $context_csv and the use of uc_price() where it was used before.
And also tax report patch following this same behavior.
Comment #3
hanoiiBumping this one up, any comments/ideas?
Comment #4
jkopel CreditAttribution: jkopel commentedI just wrote this same patch for the tax report.
My only comment would be to use 'formatted-original' in the $context_csv array to add the uc_price formatting (but not the theming).
jak
Comment #5
hanoiiFormatted would add the currency, and I think it's not really useful for a CSV report.
Comment #6
longwaveMakes sense. Patches in #2 work for me except one chunk no longer applies but is easily fixed.
Applying this would also mean #603524: CSV report downloads are missing the UTF-8 byte order mark can be closed.
Comment #7
Island Usurper CreditAttribution: Island Usurper commentedIf the context format is going to be "original" anyway, there really isn't any reason to use uc_price(). "original" just makes it do a bunch of calculations and then throw away the results.
I would commit the first patch, but it's a good idea to get the tax reports changed the same way.
Comment #8
iamjon CreditAttribution: iamjon commentedis there any reason that the first patch hasn't been committed?
Comment #9
Island Usurper CreditAttribution: Island Usurper commentedNo, I suppose not. So I've done that, and now I'm working on changing the tax reports patch to not use uc_price() for no reason.
Comment #10
Island Usurper CreditAttribution: Island Usurper commentedWell, that was quick. Committed to 6.x-2.x.
Comment #11
longwaveLooks like this needs forward porting to 7.x.
Comment #12
iamjon CreditAttribution: iamjon commentedThat's awesome!!! You guys rock. :)
Comment #13
Island Usurper CreditAttribution: Island Usurper commentedPorted to 7.x-3.x.