Summary: | Acquisitions: GST not calculating correctly. | ||
---|---|---|---|
Product: | Koha | Reporter: | Joann Ransom <jransom> |
Component: | Acquisitions | Assignee: | Chris Hall <chrish> |
Status: | CLOSED INVALID | QA Contact: | |
Severity: | major | ||
Priority: | P3 | CC: | chris, chrish, colin.campbell, jonathan.druart, jransom, koha, nengard |
Version: | Main | ||
Hardware: | PC | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Test scenarios for adding orders
And again not as an excel spreadsheet Makes corrections to acq.js and parcel.pl regarding gst and discount calculations parcel table : needs value of tax not tax rate Corrected errors in previous patch corrects errors in acquisitions calculations |
Description
Chris Cormack
2010-05-21 00:57:20 UTC
Created attachment 7911 [details] [review] Makes corrections to acq.js and parcel.pl regarding gst and discount calculations Attached patch makes the following corrections: acqui/parcel.pl which was incorrectly displaying and calculating gst (if gst was 0.15 it would display as 0.1500 whereas everything else is to 2dp, and it would add gst as price + gst thus adding 0.15 rather than 0.15%) acq.js which had some small logic errors dealing with GST calculations and discount calculations. RRP should take vendor discount into account always, and should include the vendor tax rate if the list price doesn't already include it. I hope my solution is suitable for all and that it is suitable to attach this patch here. Results in the basket table are corrects whatever you choose List prices=Include tax or List prices=Don't include tax. Results in the parcel table are ok if you choose List prices=Don't include tax but not if you choose List prices=Include tax (Tax is added at the prices including already the tax). In parcel table, it will be nice to have the sum of the tax but not only the tax rate. (cf. attachement) Created attachment 8375 [details]
parcel table : needs value of tax not tax rate
Created attachment 8460 [details] [review] Corrected errors in previous patch After speaking with the client I have revised the patch, please ignore any comments on my first submission, this patch makes the previous obsolete. Replacement price is RRP and this is gst inclusive and does not take the discount into account (if list price is gst inclusive, then rrp and list price will be the same, otherwise rrp = listprice + gst). Budgeted cost (ecost in the code) is gst exclusive and takes the discount into account BEFORE gst. Regarding the comment about parcel.pl displaying the gst amount rather than the gst rate: I only fixed the error in parcel.pl, I haven't changed the information it was displaying (or trying to display). I have corrected the errors in my acq.js logic and the errors in the parcel.pl table regarding gst calculations. Cheers for pointing out the error in parcel.pl regarding it re-adding st back on if the list price is gst exclusive, this will be fixed shortly. >Budgeted cost (ecost in the code) is gst exclusive and takes the discount into >account BEFORE gst.
Hi Chris,
I am not sure I understand this correctly, so please ignore me if I don't ;)
I think budgeted cost needs to be inclusive GST, because libraries in Germany have to pay that. So they need it to be in the budgeted cost. I am not sure if there are differences between different types of libraries and countries, but if that is the case we perhaps need a switch or something. (What is tax registered in the vendor supposed to do? Perhaps that? I always wondered.)
Created attachment 9212 [details] [review] corrects errors in acquisitions calculations Attached patch that meets clients specs, not ready to be up streamed yet. Hey Katrin You understood correctly, it assumes budgeted cost is GST exclusive so this can't be pushed to master yet. Just for documentation purposes, here is what I used the various variables to mean: list price = may or may not include gst depending on vendor settings, if there if a discount then this price hasnt been adjusted to reflect the discounted price. unit price = actual cost, user supplied, not used in calculations rrp = gst exclusive, also doesnt reflect discounted price ecost = budgeted cost = list price minus any discount and excluding gst gstrate = rate of gst as a percentage gst = rrp * gstrate The previous code used gst to refer to both the rate and the actual amount in different places, I have corrected this where I came across it. Work to be done: Setting for whether or not the budgeted cost is gst inclusive/exclusive. This is the previous issue Katrin pointed out still exists, see line 323 or acqui/parcel.pl, I have labeled this with a FIXME as this assumes tototal is gst exclusive and will always add it back in. This one is too old. |