Bug 18999: Modified SQL query in GetBudgetSpent() in C4/Budgets.pm
authorAlex Buckley <alexbuckley@catalyst.net.nz>
Sat, 22 Jul 2017 19:19:44 +0000 (19:19 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 25 Oct 2017 08:40:27 +0000 (10:40 +0200)
commit19b3041fb8bee95c320a909afd45f57b707ff2c2
tree0bbde89f6bcdcf360cf0c2b39551d85075534198
parent8250e0f69a069ae2a43f52135e0a6d4daf259dfc
Bug 18999: Modified SQL query in GetBudgetSpent() in C4/Budgets.pm

Removed the SQL select condition 'AND closedate IS NOT NULL' because
this was not returning shippingcost values and it does not exist in the
SQL query to return the shipping cost in spent.pl

Also removed the retrieval of shipping cost and the associated addition
of item(s) cost and shipping cost in GetBudgetOrdered() in C4/Budgets.pm
to prevent the shipping costs being subtracted off the fund total twice

Test plan:
1. Go to Acquisition and create a currency, budget (make this value of
100), fund ( make this the value of 50), vendor (if
neccessary)

2. Create a basket and click 'Add to basket'

3. Add 2 items with the vendor price of 10

4. Click 'Receive shipment' and write in the shipment cost of 6

5. Click 'Finish receiving' and go back to Acquisitions

6. Notice the spent column value is 0.00 but if you click on the value then
the spent.pl page is displayed and shows that the shipment cost was 6.00

7. On the acquisition page also notice that the ordered column value is 26.00

8. Click on the name of the fund and notice the spent column value is
0.00 in the fund page table

9. Apply patch

10. Refresh acquisition page and notice that 6.00 is the value in the
Spent column and 20.00 is the value in the ordered column. Both of which
match the subtotal of the full-list tables displayed when you click on these
values

11. Also notice the spent value in the fund page table is 6.00

12 Observe the changes to GetBudgetSpent() and GetBudgetOrdered() C4/Budgets.pm and check they make sense

Sponsored-by: Catalyst IT

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit caef98c7f64e02bba996c4da4f862bb55a86171a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Budgets.pm