Bug 31632: Link a suggestion to an existing order

This enhancement allows library staff to link an order (in an unclosed basket, or a standing order) to an accepted suggestion.

To test:

1) In the staff interface, go to Suggestions and create at least two suggestions.
2) Mark at least two suggestions as Accepted.
3) Go to Acquisitions, create a vendor if you don't have one already.
4) Have or create two baskets - one should be standing, and one not standing (normal).
5) In the normal basket (not standing), add an order from any source but NOT from a suggestion.
6) When you save the order, there should be a new link in the Modify column of the Orders table - "Search for suggestion to link". Click this.
7) Choose one of your suggestions to link to the order.
8) You should be redirected back to the basket. Confirm your order has been correctly linked to the suggestion. Confirm there is no link to "Search for suggestion to link" for this order now that a suggestion has already been linked.
9) Add another order to this basket from any source but NOT from a suggestion.
10) Close the basket. Confirm there is no link to "Search for suggestion to link" because the basket is closed, but you could reopen the basket to link the order if you wanted to.
11) Go to Baskets in the left navigation so you can find your standing basket.
12) Add an order to your standing basket from any source but NOT from a suggestion.
13) Go to the vendor and Receive shipments. Receive your standing order and finish receiving.
14) Go to the standing basket. There should be a new unreceived standing order for the record you just received, with a link to "Search for suggestion to link". Click this.
15) Choose a suggestion to link to the order.
16) You should be redirected back to the basket. Confirm your orders for this record have been correctly linked to the suggestion.

Sponsored-by: Pymble Ladies' College
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7546669920)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Aleisha Amohia 2024-07-23 02:50:29 +00:00 committed by Paul Derscheid
parent fe3f83e492
commit 70477134ac
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
3 changed files with 16 additions and 1 deletions

View File

@ -111,6 +111,7 @@ my $op = $input->param('op');
my $suggestionid = $input->param('suggestionid');
my $duplicateNumber = $input->param('duplicateNumber');
my $uncertainprice = $input->param('uncertainprice');
my $link_order = $input->param('link_order');
$op = 'else' unless $op;
@ -128,6 +129,13 @@ if ( $op eq 'connectDuplicate' ) {
ConnectSuggestionAndBiblio( $suggestionid, $duplicateNumber );
}
if ( $op eq 'link_order' and $link_order ) {
my $order = Koha::Acquisition::Orders->find($link_order);
my $suggestion = Koha::Suggestions->find($suggestionid);
$suggestion->update( { biblionumber => $order->biblionumber } ) if $order->biblionumber;
print $input->redirect( "/cgi-bin/koha/acqui/basket.pl?basketno=" . $basketno );
}
my $suggestions = [
Koha::Suggestions->search_limited(
{
@ -147,6 +155,7 @@ $template->param(
booksellerid => $booksellerid,
name => $vendor->name,
"op_$op" => 1,
link_order => $link_order,
);
output_html_with_http_headers $input, $cookie, $template->output;

View File

@ -812,6 +812,10 @@
<a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
<br />
<a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
<br />
[% END %]
[% UNLESS ( books_loo.suggestionid ) %]
<a href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;link_order=[% books_loo.ordernumber | uri %]">Search for suggestion to link</a>
[% END %]
</td>
[% END %]

View File

@ -89,7 +89,9 @@
</td>
<td> [% suggestion.total | $Price %] </td>
<td class="actions">
[% IF ( suggestion.biblionumber ) %]
[% IF link_order %]
<a href="/cgi-bin/koha/acqui/newordersuggestion.pl?op=link_order&amp;link_order=[% link_order | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;suggestionid=[% suggestion.suggestionid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Link suggestion') | html %]</a>
[% ELSIF ( suggestion.biblionumber ) %]
<a
href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;suggestionid=[% suggestion.suggestionid | uri %]&amp;biblio=[% suggestion.biblionumber | uri %]"
class="btn btn-default btn-xs"