Bugzilla – Attachment 170695 Details for
Bug 27063
Allow changing which record an order is linked to
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27063: Syspref KeepInvoiceOnOrderRelink and implement
Bug-27063-Syspref-KeepInvoiceOnOrderRelink-and-imp.patch (text/plain), 15.09 KB, created by
Aleisha Amohia
on 2024-08-26 03:52:24 UTC
(
hide
)
Description:
Bug 27063: Syspref KeepInvoiceOnOrderRelink and implement
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-08-26 03:52:24 UTC
Size:
15.09 KB
patch
obsolete
>From 5885dc660f6be90dbc5821b55ba454950247eb6a Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleisha@catalyst.net.nz> >Date: Wed, 7 Aug 2024 03:25:55 +0000 >Subject: [PATCH] Bug 27063: Syspref KeepInvoiceOnOrderRelink and implement > >This follow-up patch adds a new system preference KeepInvoiceOnOrderRelink. > >When enabled, relinking a received order will keep the invoice ID of the original order. > >This is useful for standing orders where the record has been deleted and linked to a new record/order. > >To test: > >1. Enable the system preference KeepInvoiceOnOrderRelink >2. Add an order to a standing basket >3. Receive the order >4. Once received, go to the record and view the Acquisitions details tab. Notice the invoice is linked. >5. Go back to the basket >6. Relink the received order to a different record >7. Go to the record and view the Acquisitions details tab. Notice the invoice has been kept. >8. Repeat the test plan with the system preference KeepInvoiceOnOrderRelink disabled. Notice the invoice is nullified after the order is relinked. > >Sponsored-by: Auckland University of Technology >--- > acqui/neworderempty.pl | 1 + > ...g_27063_-_KeepInvoiceOnOrderRelink_syspref.pl | 16 ++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/modules/acqui/neworderempty.tt | 3 +++ > .../en/modules/acqui/newordersubscription.tt | 2 +- > .../prog/en/modules/acqui/newordersuggestion.tt | 4 ++-- > .../prog/en/modules/acqui/z3950_search.tt | 2 +- > .../modules/admin/preferences/acquisitions.pref | 7 +++++++ > .../prog/en/modules/catalogue/results.tt | 2 +- > 9 files changed, 33 insertions(+), 5 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_27063_-_KeepInvoiceOnOrderRelink_syspref.pl > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 9c93addacca..221cc0d0b11 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -539,6 +539,7 @@ $template->param( > users => \@order_users, > ( uc( C4::Context->preference("marcflavour") ) ) => 1, > estimated_delivery_date => $data->{estimated_delivery_date}, >+ relink_invoiceid => ( C4::Context->preference('KeepInvoiceOnOrderRelink') and $input->param("relink") ) ? $data->{invoiceid} : undef, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/installer/data/mysql/atomicupdate/bug_27063_-_KeepInvoiceOnOrderRelink_syspref.pl b/installer/data/mysql/atomicupdate/bug_27063_-_KeepInvoiceOnOrderRelink_syspref.pl >new file mode 100755 >index 00000000000..0c8ee26ec83 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27063_-_KeepInvoiceOnOrderRelink_syspref.pl >@@ -0,0 +1,16 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "27063", >+ description => "Allow changing which record an order is linked to", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('KeepInvoiceOnOrderRelink', '0', NULL, 'Keep or empty the invoice when an order is relinked in Acquisitions', 'YesNo') } >+ ); >+ >+ say $out "Added system preference 'KeepInvoiceOnOrderRelink'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 1a7cd033e90..1fd56638ea5 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -358,6 +358,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('itemBarcodeInputFilter','','whitespace|T-prefix|cuecat|libsuite8|EAN13','If set, allows specification of a item barcode input filter','Choice'), > ('itemcallnumber','',NULL,'The MARC field/subfield that is used to calculate the itemcallnumber (Dewey would be 082ab or 092ab; LOC would be 050ab or 090ab) could be 852hi from an item record','free'), > ('ItemsDeniedRenewal','','','This syspref allows to define custom rules for denying renewal of specific items.','Textarea'), >+('KeepInvoiceOnOrderRelink', '0', NULL, 'Keep or empty the invoice when an order is relinked in Acquisitions', 'YesNo'), > ('KohaAdminEmailAddress','root@localhost','','Define the email address where patron modification requests are sent','free'), > ('KohaManualBaseURL','https://koha-community.org/manual/','','Where is the Koha manual/documentation located?','Free'), > ('KohaManualLanguage','en','en|ar|cs|de|es|fr|it|pt_BR|tr|zh_TW','What is the language of the online manual you want to use?','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index 72433c41ef6..8fe52acf47d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -357,6 +357,9 @@ > <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst | html %]" /> > <input type="hidden" name="suggestionid" value="[% suggestionid | html %]" /> > <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" /> >+ [% IF relink_invoiceid %] >+ <input type="hidden" name="invoiceid" id="invoiceid" value="[% relink_invoiceid | html %]" /> >+ [% END %] > > [% FOREACH c IN currencies %] > <input type="hidden" id="currency_rate_[% c.currency | html %]" name="[% c.currency | html %]" value="[% c.rate | html %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >index e367c99492f..f21b6d60bce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >@@ -92,7 +92,7 @@ > [% END %] > [% IF not sub.aqbooksellerid || booksellerid == sub.aqbooksellerid %] > [% IF ordernumber %] >- <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&biblionumber=[% sub.biblionumber | uri %]&from_subscriptionid=[% sub.subscriptionid | uri %]&ordernumber=[% ordernumber | uri %]" title="Order this one" class="btn btn-default btn-xs"> >+ <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&biblionumber=[% sub.biblionumber | uri %]&from_subscriptionid=[% sub.subscriptionid | uri %]&ordernumber=[% ordernumber | uri %]&relink=1" title="Order this one" class="btn btn-default btn-xs"> > [% ELSE %] > <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&biblionumber=[% sub.biblionumber | uri %]&from_subscriptionid=[% sub.subscriptionid | uri %]" title="Order this one" class="btn btn-default btn-xs"> > [% 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 913c273fdb1..eca2229ef1b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >@@ -102,13 +102,13 @@ > <td class="actions"> > [% IF ( suggestion.biblionumber ) %] > [% IF ordernumber %] >- <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&biblio=[% suggestion.biblionumber | uri %]&ordernumber=[% ordernumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&biblio=[% suggestion.biblionumber | uri %]&ordernumber=[% ordernumber | uri %]&relink=1" 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 %]&biblio=[% suggestion.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> > [% END %] > [% ELSE %] > [% IF ordernumber %] >- <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&ordernumber=[% ordernumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a> >+ <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&suggestionid=[% suggestion.suggestionid | uri %]&ordernumber=[% ordernumber | uri %]&relink=1" 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> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >index cc8d996fc43..a6f95c0bc48 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >@@ -225,7 +225,7 @@ tr.selected td { > <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | uri %]" title="MARC" class="previewData dropdown-item" data-action="show_marc"><i class="fa-solid fa-eye"></i> MARC</a></li> > <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid | uri %]" title="Card" class="previewData dropdown-item" data-action="show_card"><i class="fa-solid fa-eye"></i> Card</a></li> > [% IF ordernumber %] >- <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&breedingid=[% breeding_loo.breedingid | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&ordernumber=[% ordernumber | uri %]" class="chosen dropdown-item" title="[% tp('verb', 'Order') | html %]" data-action="order"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a></li> >+ <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&breedingid=[% breeding_loo.breedingid | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&ordernumber=[% ordernumber | uri %]&relink=1" class="chosen dropdown-item" title="[% tp('verb', 'Order') | html %]" data-action="order"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a></li> > [% ELSE %] > <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&breedingid=[% breeding_loo.breedingid | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]" class="chosen dropdown-item" title="[% tp('verb', 'Order') | html %]" data-action="order"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a></li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >index 3584d9d59d5..29cfece8ada 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >@@ -138,6 +138,13 @@ Acquisitions: > class: email > - 'when sending acquisitions order and claim notices.' > - '<br>If left empty, it will fall back to the first defined address in the following list: library reply-to, library email, <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReplytoDefault">ReplytoDefault</a>, <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=KohaAdminEmailAddress">KohaAdminEmailAddress</a>.' >+ - >+ - pref: KeepInvoiceOnOrderRelink >+ default: no >+ choices: >+ 1: "Keep" >+ 0: "Do not keep" >+ - " a link to the invoice when an order is relinked." > Printing: > - > - Use the >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 4766b946486..f3f2bc80951 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -592,7 +592,7 @@ > [% IF ( CAN_user_acquisition_order_manage ) %] > [% IF ( searchtoorder_basketno && searchtoorder_vendorid ) %] > [% IF searchtoorder_ordernumber %] >- | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&basketno=[% searchtoorder_basketno | uri %]&biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&ordernumber=[% searchtoorder_ordernumber | uri %]">Relink to order</a> >+ | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&basketno=[% searchtoorder_basketno | uri %]&biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&ordernumber=[% searchtoorder_ordernumber | uri %]&relink=1">Relink to order</a> > [% ELSE %] > | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&basketno=[% searchtoorder_basketno | uri %]&biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Add order</a> > [% END %] >-- >2.39.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 27063
:
167619
|
167678
|
167679
|
167783
|
167784
|
167818
|
167819
|
168049
|
168050
|
168571
|
168572
|
170123
|
170166
|
170487
|
170488
|
170692
|
170693
|
170694
|
170695
|
170696
|
174648
|
174649