Bugzilla – Attachment 88982 Details for
Bug 21364
Allow closing basket from vendor search/view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21364: (follow-up) Check for standing status and uncertain prices
Bug-21364-follow-up-Check-for-standing-status-and-.patch (text/plain), 5.62 KB, created by
Katrin Fischer
on 2019-04-27 13:58:39 UTC
(
hide
)
Description:
Bug 21364: (follow-up) Check for standing status and uncertain prices
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-04-27 13:58:39 UTC
Size:
5.62 KB
patch
obsolete
>From fed4091f67f4328ba0b18011c91a00d67ddafef5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >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 > >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Acquisition.pm | 3 ++- > .../intranet-tmpl/prog/en/modules/acqui/booksellers.tt | 6 ++++-- > t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t | 16 +++++++++++++++- > 3 files changed, 21 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/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >index a1969da27f..024c95ffe2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >@@ -150,8 +150,10 @@ > <a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | html %]"><i class="fa fa-eye"></i> View</a><a class="btn btn-default btn-xs dropdown-toggle" id="basketactions[% basket.basknetno | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a> > <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="basketactions[% basketn.basketno | html %]"> > <li><a id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></li> >- [% IF basket.total_items %] >- <li><a href="/cgi-bin/koha/acqui/basket.pl?op=close&basketno=[% basket.basketno | html %]&booksellerid=[% supplier.id | html %]"><i class="fa fa-times-circle"></i> Close this basket</a></li> >+ [% IF basket.uncertainprices %] >+ <li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% basket.booksellerid | html %]&owner=1"><i class="fa fa-usd"></i> Uncertain prices</a></li> >+ [% ELSIF basket.total_items && !basket.is_standing %] >+ <li><a href="/cgi-bin/koha/acqui/basket.pl?op=close&basketno=[% basket.basketno | html %]&booksellerid=[% basket.booksellerid | html %]"><i class="fa fa-times-circle"></i> Close this basket</a></li> > [% END %] > </ul> > <!-- Modal --> >diff --git a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t b/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t >index b932828186..267ff107c6 100644 >--- a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t >+++ b/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 40; >+use Test::More tests => 43; > use Data::Dumper; > > use C4::Acquisition qw( NewBasket GetBasketsInfosByBookseller ); >@@ -72,6 +72,20 @@ is( $basket->{total_items_cancelled}, 0, 'Start with 0 item cancelled' ); > is( $basket->{expected_items}, 6, 'Start with 6 items expected' ); > is( $basket->{total_biblios_cancelled}, 0, 'Start with 0 biblio cancelled' ); > >+$order1->uncertainprice(1)->store; >+$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid ); >+$basket = $baskets->[0]; >+is( $basket->{uncertainprices}, 1, "Uncertain prcies returns number of uncertain items"); >+$order2->uncertainprice(1)->store; >+$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid ); >+$basket = $baskets->[0]; >+is( $basket->{uncertainprices}, 2, "Uncertain prcies returns number of uncertain items"); >+$order1->uncertainprice(0)->store; >+$order2->uncertainprice(0)->store; >+$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid ); >+$basket = $baskets->[0]; >+is( $basket->{uncertainprices}, 0, "Uncertain prcies returns number of uncertain items"); >+ > C4::Acquisition::DelOrder( $biblionumber2, $ordernumber2 ); > $baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid ); > is( scalar(@$baskets), 1, 'Order2 deleted, still 1 basket' ); >-- >2.11.0
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 21364
:
79015
|
79019
|
79069
|
79106
|
79121
|
79470
|
88393
|
88787
|
88788
|
88847
|
88848
| 88982 |
88983