From 3a84d9684ebef1c299c4d3e0bf176f86c5db1277 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 2 Jan 2014 17:15:25 -0500 Subject: [PATCH] Bug 11471 - Basket groups display 0 0 While testing Bug 9654, I clicked "Edit" on the basket group, and got "0 0" displayed on the "Baskets in this group" text area. It had displayed correctly ("0 USD") when I had clicked "Save". TEST PLAN ========= 1) Log into staff client 2) Acquisitions 3) Click 'Search' in the 'Manage orders' box. 4) Click '+ New basket' beside a vendor name. 5) Type 'Test Basket' into basket name. 6) Click 'Save' 7) Click 'Add to basket' 8) Click 'From an external source' 9) Type 'Green Eggs and Ham' into the Title text box. 10) Click 'Search' 11) Click 'Order' on any one of the results. 12) Click 'Add Item' in the 'Item' box. 13) Select a Fund from the dropdown in the 'Accounting details' box. 14) Click 'Save' 15) Click 'Close this basket' 16) Click 'Yes, close (Y)' without checking the attach to a basket group. 17) Click the 'Basket groups' tab. 18) Click '+ New basket group' 19) Notice the listing in 'Ungrouped baskets' lacks a space between the number and the currency. (e.g. Total: 0USD) 20) Click 'Save' 21) Click 'Edit' 22) Notice it displays incorrectly. (e.g. Total: 00) 23) Apply the patch (git bz apply 11471) 24) Refresh the page. 25) Notice it displays less incorrectly. (e.g. Total: 0USD) NOTE: The space issue is fixed in Bug 9654. This can be applied separately from that bug. 26) Run the Koha QA Tool: (~/qa-test-tools/koha-qa.pl -v 2 -c 1) --- C4/Acquisition.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 99933e4..3568b01 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -815,10 +815,18 @@ Returns a reference to all baskets that belong to basketgroup $basketgroupid. sub GetBasketsByBasketgroup { my $basketgroupid = shift; my $query = qq{ - SELECT *, aqbasket.booksellerid as booksellerid - FROM aqbasket - LEFT JOIN aqcontract USING(contractnumber) WHERE basketgroupid=? - }; + SELECT aqbasket.*, aqcontract.contractnumber, + aqcontract.contractstartdate, + aqcontract.contractenddate, + aqcontract.contractname, + aqcontract.contractdescription, + aqbooksellers.invoiceprice + FROM aqbasket + LEFT JOIN aqbooksellers + ON aqbasket.booksellerid=aqbooksellers.id + LEFT JOIN aqcontract USING(contractnumber) + WHERE basketgroupid=? + }; my $dbh = C4::Context->dbh; my $sth = $dbh->prepare($query); $sth->execute($basketgroupid); -- 1.7.9.5