Bugzilla – Attachment 170147 Details for
Bug 31632
Add ability to manually link orders to suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31632: Link a suggestion to an existing order
Bug-31632-Link-a-suggestion-to-an-existing-order.patch (text/plain), 7.66 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-08-07 21:20:05 UTC
(
hide
)
Description:
Bug 31632: Link a suggestion to an existing order
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-08-07 21:20:05 UTC
Size:
7.66 KB
patch
obsolete
>From 5e7e1377f43861468ebffabfc6b8abd66e737bf1 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 23 Jul 2024 02:50:29 +0000 >Subject: [PATCH] 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> >--- > acqui/newordersuggestion.pl | 23 +++++++++++++------ > .../prog/en/modules/acqui/basket.tt | 4 ++++ > .../en/modules/acqui/newordersuggestion.tt | 4 +++- > 3 files changed, 23 insertions(+), 8 deletions(-) > >diff --git a/acqui/newordersuggestion.pl b/acqui/newordersuggestion.pl >index 9d35ec48def..fec5a2ef10f 100755 >--- a/acqui/newordersuggestion.pl >+++ b/acqui/newordersuggestion.pl >@@ -103,14 +103,15 @@ my $input = CGI->new; > > # getting the CGI params > my $basketno = $input->param('basketno'); >-my $booksellerid = $input->param('booksellerid'); >+my $booksellerid = $input->param('booksellerid'); > my $author = $input->param('author'); > my $title = $input->param('title'); > my $publishercode = $input->param('publishercode'); > my $op = $input->param('op'); > my $suggestionid = $input->param('suggestionid'); > my $duplicateNumber = $input->param('duplicateNumber'); >-my $uncertainprice = $input->param('uncertainprice'); >+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( > { > ( $author ? ( author => $author ) : () ), >@@ -140,11 +148,12 @@ my $suggestions = [ Koha::Suggestions->search_limited( > > my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid ); > $template->param( >- suggestions => $suggestions, >- basketno => $basketno, >- booksellerid => $booksellerid, >- name => $vendor->name, >- "op_$op" => 1, >+ suggestions => $suggestions, >+ basketno => $basketno, >+ booksellerid => $booksellerid, >+ name => $vendor->name, >+ "op_$op" => 1, >+ link_order => $link_order, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index 651200ac258..c77df94f2fb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -723,6 +723,10 @@ > <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&booksellerid=[% booksellerid | uri %]&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 %]&basketno=[% basketno | uri %]&link_order=[% books_loo.ordernumber | uri %]">Search for suggestion to link</a> > [% END %] > </td> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >index 0a0b968b57a..0b0f09c2772 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >@@ -100,7 +100,9 @@ > [% suggestion.total | $Price %] > </td> > <td class="actions"> >- [% IF ( suggestion.biblionumber ) %] >+ [% IF link_order %] >+ <a href="/cgi-bin/koha/acqui/newordersuggestion.pl?op=link_order&link_order=[% link_order | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&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 %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&biblio=[% suggestion.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> > [% ELSE %] > <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >-- >2.46.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 31632
:
141028
|
141029
|
141030
|
169391
| 170147 |
170148
|
170953