Bugzilla – Attachment 159766 Details for
Bug 28844
Suggestion from existing title can alert patron in error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28844: Adjust other calls
Bug-28844-Adjust-other-calls.patch (text/plain), 3.92 KB, created by
Nick Clemens (kidclamp)
on 2023-12-12 18:27:56 UTC
(
hide
)
Description:
Bug 28844: Adjust other calls
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-12-12 18:27:56 UTC
Size:
3.92 KB
patch
obsolete
>From 9c93f30c49d12de8df5a0384942a37d6525482dd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Nov 2023 14:56:06 +0100 >Subject: [PATCH] Bug 28844: Adjust other calls > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Acquisition/Order.pm | 4 ++-- > Koha/EDI.pm | 13 +++++-------- > acqui/addorder.pl | 25 ++++++++++++++----------- > 3 files changed, 21 insertions(+), 21 deletions(-) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index eee73ce0533..d9b55d7a158 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -146,8 +146,8 @@ sub cancel { > } > > # If ordered from a suggestion, revert the suggestion status to ACCEPTED >- my $suggestion = Koha::Suggestions->find({ biblionumber => $self->biblionumber, status => "ORDERED" }); >- if ( $suggestion and $suggestion->id ) { >+ my $suggestion = $self->suggestion; >+ if ( $suggestion && $suggestion->STATUS eq "ORDERED" ) { > ModSuggestion( > { > suggestionid => $suggestion->id, >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index ceb9a2ccd41..f6b994877be 100644 >--- a/Koha/EDI.pm >+++ b/Koha/EDI.pm >@@ -45,6 +45,7 @@ use Koha::Plugins; # Adds plugin dirs to @INC > use Koha::Plugins::Handler; > use Koha::Acquisition::Baskets; > use Koha::Acquisition::Booksellers; >+use Koha::Acquisition::Orders; > > our $VERSION = 1.1; > >@@ -330,16 +331,12 @@ sub process_invoice { > # ModReceiveOrder does not validate that $ordernumber exists validate here > if ($order) { > >- # check suggestions >- my $s = $schema->resultset('Suggestion')->search( >- { >- biblionumber => $order->biblionumber->biblionumber, >- } >- )->single; >- if ($s) { >+ my $order_koha_object = Koha::Acquisition::Orders->find($ordernumber); >+ my $suggestion = $order_koha_object->suggestion; >+ if ($suggestion) { > ModSuggestion( > { >- suggestionid => $s->suggestionid, >+ suggestionid => $suggestion->suggestionid, > STATUS => 'AVAILABLE', > } > ); >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index de8d3648f89..01bfabc8eaf 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -330,17 +330,6 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { > $orderinfo->{biblionumber}=$biblionumber; > } > >- # change suggestion status if applicable >- if ( my $suggestionid = $input->param('suggestionid') ) { >- ModSuggestion( >- { >- suggestionid => $suggestionid, >- biblionumber => $orderinfo->{biblionumber}, >- STATUS => 'ORDERED', >- } >- ); >- } >- > $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq ''; > > my $order; >@@ -357,6 +346,20 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { > $order->populate_with_prices_for_ordering(); > $order->store; > >+ # change suggestion status if applicable >+ if ( my $suggestionid = $input->param('suggestionid') ) { >+ # Double checking we are going to edit the correct suggestion >+ if ( $suggestionid == $order->suggestion->suggestion ) { >+ ModSuggestion( >+ { >+ suggestionid => $suggestionid, >+ biblionumber => $orderinfo->{biblionumber}, >+ STATUS => 'ORDERED', >+ } >+ ); >+ } >+ } >+ > # Log the order creation > if (C4::Context->preference("AcquisitionLog")) { > my $infos = {}; >-- >2.30.2
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 28844
:
151001
|
151002
|
151003
|
151004
|
151005
|
151006
|
151007
|
153157
|
153158
|
153159
|
153160
|
153161
|
153162
|
153163
|
153174
|
153175
|
153176
|
158982
|
158983
|
158984
|
158985
|
158986
|
158987
|
158988
|
158989
|
158990
|
159759
|
159760
|
159761
|
159762
|
159763
|
159764
|
159765
| 159766 |
159767
|
159768