From 6781bfd3e41581f26ce2b4aa4ecad15dab8b360c Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 22 Apr 2019 20:00:37 +0000 Subject: [PATCH] Bug 21364: (follow-up) Check for standing status and uncertain prices Fetch 'uncertainprices' when getting basket info. A side effect is that styling on baskets with uncertain prices is restored by this bug. They will appear in red To test: 1 - Add an order with an uncertainprice to the basket 2 - Return to vendor baskets view 3 - Note the actions now include "Uncertain prices" 4 - Click that, resolve the uncertain prcie 5 - Return to vendor basket view 6 - Note you can now close the basket, but don't 7 - Edit the basket, mark it as standing 8 - Return to vendor basket view 9 - Note you cannot close the basket --- C4/Acquisition.pm | 3 ++- acqui/addorderiso2709.pl | 1 + .../intranet-tmpl/prog/en/modules/acqui/booksellers.tt | 7 +++++-- t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t | 16 +++++++++++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 6a8df0280a..6f0f678aa9 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -684,7 +684,8 @@ sub GetBasketsInfosByBookseller { AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00') , aqorders.quantity , 0) - ) AS expected_items + ) AS expected_items, + SUM( aqorders.uncertainprice ) AS uncertainprices FROM aqbasket LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno WHERE booksellerid = ?}; diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 1921a5af6e..98e5435aca 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -242,6 +242,7 @@ if ($op eq ""){ for (my $i = 0; $i < $count; $i++) { $budget_hash->{$budget_codes[$i]}->{quantity} += 1; $budget_hash->{$budget_codes[$i]}->{price} = $itemprices[$i]; + $budget_hash->{$budget_codes[$i]}->{replacementprice} = $replacementprices[$i]; $budget_hash->{$budget_codes[$i]}->{itemnumbers} //= []; push @{ $budget_hash->{$budget_codes[$i]}->{itemnumbers} }, $itemnumbers[$i]; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt index a1969da27f..2b1271abb7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -150,9 +150,12 @@ View