From 4097abacd58efc76fd91bf7ccb6c364dca167cd5 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 2 Jan 2014 17:15:25 -0500 Subject: [PATCH] [Signed-off] Bug 11471 - Basket groups display 0 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Drag and drop the entry into the 'Baskets in this group' text area. 21) Click 'Save' 22) Click 'Edit' 23) Notice it displays incorrectly. (e.g. Total: 00) 24) Apply the patch (git bz apply 11471) 25) Refresh the page. 26) 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. 27) Run the Koha QA Tool: (~/qa-test-tools/koha-qa.pl -v 2 -c 1) Followed test plan 1-26. Patch behaves as expected. Signed-off-by: Marc VĂ©ron --- C4/Acquisition.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 56c2d7f..5dd3b2a 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.10.4