From f5e8df8e4b60ab70ab524c6dab2ec4c7d55539f8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Feb 2014 15:07:38 +0100 Subject: [PATCH] Bug 11471: Display the currency for baskets in a basketgroup On editing a basketgroup, the currency for baskets in a basketgroup is always '0'. With this patch, the currency is correctly displayed. TEST PLAN ========= 1) Log into staff client 2) Acquisitions 3) Click 'Search' in the 'Manage orders' box 4) Click '+ New basket' because 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 the basket' 16) Click 'Yes, close (Y)' without checking attach to a basket group 17) Click the 'Basket groups' tab 18) Click '+ New basket group' 19) Notice the listing in the 'Ungrouped baskets'. 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: 0 0) 24) Apply the patch (git bz apply 11471) 25) Refresh the page 26) Notice it displays the currency correctly. (e.g. Total: 0 USD) NOTE: If there is a space issue, see 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) Signed-off-by: Mark Tompsett Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton (cherry picked from commit 7a2dec05eddc979b5a957a651e393838c13560c4) Signed-off-by: Fridolin Somers Conflicts: acqui/basketgroup.pl --- acqui/basketgroup.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 6fe4db2a1f..ea7fa66ceb 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -298,6 +298,7 @@ my $booksellerid = $input->param('booksellerid'); $template->param(booksellerid => $booksellerid); if ( $op eq "add" ) { + my $bookseller = &GetBookSellerFromId($booksellerid); if(! $booksellerid){ $template->param( ungroupedlist => 1); my @booksellers = GetBookSeller(''); @@ -322,8 +323,8 @@ if ( $op eq "add" ) { if ( $basketgroupid ) { # Get the selected baskets in the basketgroup to display them my $selecteds = GetBasketsByBasketgroup($basketgroupid); - foreach (@{$selecteds}){ - $_->{total} = BasketTotal($_->{basketno}, $_); + foreach my $basket(@{$selecteds}){ + $basket->{total} = BasketTotal($basket->{basketno}, $bookseller); } $template->param(basketgroupid => $basketgroupid, selectedbaskets => $selecteds); @@ -354,7 +355,6 @@ if ( $op eq "add" ) { } $template->param(grouping => 1); my $basketgroups = &GetBasketgroups($booksellerid); - my $bookseller = &GetBookSellerFromId($booksellerid); my $baskets = &GetBasketsByBookseller($booksellerid); displaybasketgroups($basketgroups, $bookseller, $baskets); -- 2.39.5