Bugzilla – Attachment 67317 Details for
Bug 18999
Acq: Shipping cost not included in total spent on acq home and funds page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18999- Modified SQL query in GetBudgetSpent() in C4/Budgets.pm
Bug-18999--Modified-SQL-query-in-GetBudgetSpent-in.patch (text/plain), 2.78 KB, created by
Josef Moravec
on 2017-09-22 16:06:49 UTC
(
hide
)
Description:
Bug 18999- Modified SQL query in GetBudgetSpent() in C4/Budgets.pm
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-09-22 16:06:49 UTC
Size:
2.78 KB
patch
obsolete
>From f40f434a79339d476de00f1f91edc8de40e7ca79 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Sat, 22 Jul 2017 19:19:44 +0000 >Subject: [PATCH] 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> >--- > C4/Budgets.pm | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index 1c0c201..10f5147 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -343,8 +343,8 @@ sub GetBudgetSpent { > SELECT SUM(shipmentcost) AS sum > FROM aqinvoices > WHERE shipmentcost_budgetid = ? >- AND closedate IS NOT NULL > |); >+ > $sth->execute($budget_id); > my ($shipmentcost_sum) = $sth->fetchrow_array; > $sum += $shipmentcost_sum; >@@ -365,16 +365,6 @@ sub GetBudgetOrdered { > $sth->execute($budget_id); > my $sum = $sth->fetchrow_array; > >- $sth = $dbh->prepare(qq| >- SELECT SUM(shipmentcost) AS sum >- FROM aqinvoices >- WHERE shipmentcost_budgetid = ? >- AND closedate IS NULL >- |); >- $sth->execute($budget_id); >- my ($shipmentcost_sum) = $sth->fetchrow_array; >- $sum += $shipmentcost_sum; >- > return $sum; > } > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18999
:
65446
|
65626
|
66378
|
66855
|
67173
|
67316
|
67317
|
67318
|
67319
|
67471
|
67472
|
67473
|
67474