Bugzilla – Attachment 67689 Details for
Bug 15685
Allow creation of items (AcqCreateItem) to be customizable per-basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15685: Allow creation of items (AcqCreateItem) to be customizable per-basket
Bug-15685-Allow-creation-of-items-AcqCreateItem-to.patch (text/plain), 30.21 KB, created by
Nick Clemens (kidclamp)
on 2017-10-06 10:56:39 UTC
(
hide
)
Description:
Bug 15685: Allow creation of items (AcqCreateItem) to be customizable per-basket
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-10-06 10:56:39 UTC
Size:
30.21 KB
patch
obsolete
>From d5be2ea63848bb38c48f1f526d06f4854153b8a5 Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <jweaver@bywatersolutions.com> >Date: Thu, 28 Jan 2016 15:01:24 -0700 >Subject: [PATCH] Bug 15685: Allow creation of items (AcqCreateItem) to be > customizable per-basket > >This adds a new basket attribute (create_items) that can optionally be >set to override AcqCreateItem. > >The following have been modified to reflect this (with the value of >create_items that causes them to behave differently in parentheses): > * Cancelling receipt of an order (receiving) > * Creating an order by hand or from MARC (ordering) > * Receiving an order (receiving) > * Showing orders with uncertain price (ordering) > * Showing orders (receiving) > * Showing acquisition details in the OPAC (ordering) > >Test plan: > 1) Create baskets with "Create items when:" set to ordering, > receiving, cataloging and unset. > 2) Test each of the above for each of these baskets, verifying that > the basket-specific attribute overrides AcqCreateItem if set and > falls back to the syspref otherwise. > >NOTE: A check of AcqCreateItem in opac-detail.tt was removed because it >was redundant; the code path in question cannot be triggered unless >create_items/AcqCreateItems is set to the correct value anyway. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Barbara Fondren <bfondren@roundrocktexas.gov> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Acquisition.pm | 24 ++++++---- > Koha/Acquisition/Basket.pm | 54 ++++++++++++++++++++++ > Koha/Acquisition/Baskets.pm | 51 ++++++++++++++++++++ > Koha/Acquisition/Order.pm | 8 +++- > acqui/addorder.pl | 4 +- > acqui/addorderiso2709.pl | 6 ++- > acqui/basket.pl | 1 + > acqui/basketheader.pl | 2 + > acqui/finishreceive.pl | 9 ++-- > acqui/neworderempty.pl | 5 +- > acqui/orderreceive.pl | 3 +- > acqui/parcel.pl | 2 + > acqui/uncertainprice.pl | 3 ++ > .../bug_15685-add_create_items_to_aqbasket.sql | 1 + > installer/data/mysql/kohastructure.sql | 1 + > .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 11 ++++- > .../prog/en/modules/acqui/basketheader.tt | 18 +++++++- > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 2 +- > .../prog/en/modules/acqui/uncertainprice.tt | 2 +- > .../en/modules/admin/preferences/acquisitions.pref | 1 + > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 +- > opac/opac-detail.pl | 8 ++-- > 22 files changed, 189 insertions(+), 31 deletions(-) > create mode 100644 Koha/Acquisition/Basket.pm > create mode 100644 Koha/Acquisition/Baskets.pm > create mode 100644 installer/data/mysql/atomicupdate/bug_15685-add_create_items_to_aqbasket.sql > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 950498e..70dd409 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -190,7 +190,7 @@ sub GetBasket { > =head3 NewBasket > > $basket = &NewBasket( $booksellerid, $authorizedby, $basketname, >- $basketnote, $basketbooksellernote, $basketcontractnumber, $deliveryplace, $billingplace, $is_standing ); >+ $basketnote, $basketbooksellernote, $basketcontractnumber, $deliveryplace, $billingplace, $is_standing, $create_items ); > > Create a new basket in aqbasket table > >@@ -209,7 +209,7 @@ The other parameters are optional, see ModBasketHeader for more info on them. > sub NewBasket { > my ( $booksellerid, $authorisedby, $basketname, $basketnote, > $basketbooksellernote, $basketcontractnumber, $deliveryplace, >- $billingplace, $is_standing ) = @_; >+ $billingplace, $is_standing, $create_items ) = @_; > my $dbh = C4::Context->dbh; > my $query = > 'INSERT INTO aqbasket (creationdate,booksellerid,authorisedby) ' >@@ -221,7 +221,7 @@ sub NewBasket { > $basketnote ||= q{}; > $basketbooksellernote ||= q{}; > ModBasketHeader( $basket, $basketname, $basketnote, $basketbooksellernote, >- $basketcontractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing ); >+ $basketcontractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items ); > return $basket; > } > >@@ -598,21 +598,24 @@ Modifies a basket's header. > > =item C<$is_standing> is the "is_standing" field in the aqbasket table. > >+=item C<$create_items> should be set to 'ordering', 'receiving' or 'cataloguing' (or undef, in which >+case the AcqCreateItem syspref takes precedence). >+ > =back > > =cut > > sub ModBasketHeader { >- my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing) = @_; >+ my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items) = @_; > my $query = qq{ > UPDATE aqbasket >- SET basketname=?, note=?, booksellernote=?, booksellerid=?, deliveryplace=?, billingplace=?, is_standing=? >+ SET basketname=?, note=?, booksellernote=?, booksellerid=?, deliveryplace=?, billingplace=?, is_standing=?, create_items=? > WHERE basketno=? > }; > > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare($query); >- $sth->execute($basketname, $note, $booksellernote, $booksellerid, $deliveryplace, $billingplace, $is_standing, $basketno); >+ $sth->execute($basketname, $note, $booksellernote, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items || undef, $basketno); > > if ( $contractnumber ) { > my $query2 ="UPDATE aqbasket SET contractnumber=? WHERE basketno=?"; >@@ -1587,6 +1590,7 @@ sub CancelReceipt { > my $parent_ordernumber = $order->{'parent_ordernumber'}; > > my @itemnumbers = GetItemnumbersFromOrder( $ordernumber ); >+ my $basket = Koha::Acquisition::Order->find( $order->{ordernumber} )->basket; > > if($parent_ordernumber == $ordernumber || not $parent_ordernumber) { > # The order line has no parent, just mark it as not received >@@ -1647,7 +1651,7 @@ sub CancelReceipt { > WHERE ordernumber = ? > |, undef, $parent_ordernumber); > >- _cancel_items_receipt( $ordernumber, $parent_ordernumber ); >+ _cancel_items_receipt( $basket->effective_create_items, $ordernumber, $parent_ordernumber ); > # Delete order line > $query = qq{ > DELETE FROM aqorders >@@ -1658,7 +1662,7 @@ sub CancelReceipt { > > } > >- if(C4::Context->preference('AcqCreateItem') eq 'ordering') { >+ if( $basket->effective_create_items eq 'ordering' ) { > my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceiptIsCancelled"); > if ( @affects ) { > for my $in ( @itemnumbers ) { >@@ -1681,11 +1685,11 @@ sub CancelReceipt { > } > > sub _cancel_items_receipt { >- my ( $ordernumber, $parent_ordernumber ) = @_; >+ my ( $effective_create_items, $ordernumber, $parent_ordernumber ) = @_; > $parent_ordernumber ||= $ordernumber; > > my @itemnumbers = GetItemnumbersFromOrder($ordernumber); >- if(C4::Context->preference('AcqCreateItem') eq 'receiving') { >+ if ( $effective_create_items eq 'receiving' ) { > # Remove items that were created at receipt > my $query = qq{ > DELETE FROM items, aqorders_items >diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm >new file mode 100644 >index 0000000..1255ff7 >--- /dev/null >+++ b/Koha/Acquisition/Basket.pm >@@ -0,0 +1,54 @@ >+package Koha::Acquisition::Basket; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::Acquisition::Basket - Koha Basket Object class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=head3 effective_create_items >+ >+Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset. >+ >+=cut >+ >+sub effective_create_items { >+ my ( $self ) = @_; >+ >+ return $self->create_items || C4::Context->preference('AcqCreateItem'); >+} >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'Aqbasket'; >+} >+ >+1; >diff --git a/Koha/Acquisition/Baskets.pm b/Koha/Acquisition/Baskets.pm >new file mode 100644 >index 0000000..5bbf795 >--- /dev/null >+++ b/Koha/Acquisition/Baskets.pm >@@ -0,0 +1,51 @@ >+package Koha::Acquisition::Baskets; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use C4::Context; >+use Koha::Database; >+ >+use Koha::Acquisition::Basket; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::Acquisition::Baskets - Koha Basket Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'Aqbasket'; >+} >+ >+sub object_class { >+ return 'Koha::Acquisition::Basket'; >+} >+ >+1; >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index 60324e3..c13f445 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -19,6 +19,7 @@ use Modern::Perl; > > use Carp qw( croak ); > >+use Koha::Acquisition::Baskets; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > >@@ -98,9 +99,14 @@ sub add_item { > $rs->create({ ordernumber => $self->ordernumber, itemnumber => $itemnumber }); > } > >+sub basket { >+ my ( $self ) = @_; >+ return Koha::Acquisition::Baskets->find( $self->{basketno} ); >+} >+ > =head2 Internal methods > >-=head3 _type (internal) >+=head3 _type > > =cut > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index d3d2c9f..8f9d7e4 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -234,6 +234,8 @@ my $basketno=$$orderinfo{basketno}; > my $basket = GetBasket($basketno); > > my $user = $input->remote_user; >+my $basketno=$$orderinfo{basketno}; >+my $basket = Koha::Acquisition::Baskets->find( $basketno ); > > # create, modify or delete biblio > # create if $quantity>0 and $existing='no' >@@ -291,7 +293,7 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { > } > > # now, add items if applicable >- if (C4::Context->preference('AcqCreateItem') eq 'ordering') { >+ if ($basket->effective_create_items eq 'ordering') { > > my @tags = $input->multi_param('tag'); > my @subfields = $input->multi_param('subfield'); >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 1aeaf3c..8e8929c 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -44,6 +44,7 @@ use C4::Members; > > use Koha::Number::Price; > use Koha::Libraries; >+use Koha::Acquisition::Baskets; > use Koha::Acquisition::Currencies; > use Koha::Acquisition::Orders; > use Koha::Acquisition::Booksellers; >@@ -78,6 +79,7 @@ if ($cgiparams->{'import_batch_id'} && $op eq ""){ > if (! $cgiparams->{'basketno'}){ > die "Basketnumber required to order from iso2709 file import"; > } >+my $basket = Koha::Acquisition::Baskets->find( $cgiparams->{basketno} ); > > # > # 1st step = choose the file to import into acquisition >@@ -102,7 +104,7 @@ if ($op eq ""){ > ); > import_biblios_list($template, $cgiparams->{'import_batch_id'}); > my $basket = GetBasket($cgiparams->{basketno}); >- if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$basket->{is_standing} ) { >+ if ( $basket->effective_create_items eq 'ordering' && !$basket->{is_standing} ) { > # prepare empty item form > my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' ); > >@@ -381,7 +383,7 @@ if ($op eq ""){ > # parse the item sent by the form, and create an item just for the import_record_id we are dealing with > # this is not optimised, but it's working ! > my $basket = GetBasket($cgiparams->{basketno}); >- if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$basket->{is_standing} ) { >+ if ( $basket->effective_create_items eq 'ordering' && !$basket->{is_standing} ) { > my @tags = $input->multi_param('tag'); > my @subfields = $input->multi_param('subfield'); > my @field_values = $input->multi_param('field_value'); >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 1f97d18..0e8ac5c 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -390,6 +390,7 @@ if ( $op eq 'list' ) { > } > > $template->param( >+ basket => $basket, > basketno => $basketno, > basket => $basket, > basketname => $basket->{'basketname'}, >diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl >index 0006e33..6de0a4d 100755 >--- a/acqui/basketheader.pl >+++ b/acqui/basketheader.pl >@@ -145,6 +145,7 @@ if ( $op eq 'add_form' ) { > scalar $input->param('deliveryplace'), > scalar $input->param('billingplace'), > scalar $input->param('is_standing') ? 1 : undef, >+ scalar $input->param('create_items') > ); > } else { #New basket > $basketno = NewBasket( >@@ -157,6 +158,7 @@ if ( $op eq 'add_form' ) { > scalar $input->param('deliveryplace'), > scalar $input->param('billingplace'), > scalar $input->param('is_standing') ? 1 : undef, >+ scalar $input->param('create_items') > ); > } > print $input->redirect('basket.pl?basketno='.$basketno); >diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl >index b8854a6..484f562 100755 >--- a/acqui/finishreceive.pl >+++ b/acqui/finishreceive.pl >@@ -60,12 +60,13 @@ my $order = GetOrder($ordernumber); > my $new_ordernumber = $ordernumber; > > $unitprice = Koha::Number::Price->new( $unitprice )->unformat(); >+my $basket = Koha::Acquisition::Orders->find( $ordernumber )->basket; > >-#need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME >+#need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME > if ($quantityrec > $origquantityrec ) { > my @received_items = (); >- if(C4::Context->preference('AcqCreateItem') eq 'ordering') { >- @received_items = $input->multi_param('items_to_receive'); >+ if ($basket->effective_create_items eq 'ordering') { >+ @received_items = $input->param('items_to_receive'); > my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceived"); > if ( @affects ) { > my $frameworkcode = GetFrameworkCode($biblionumber); >@@ -111,7 +112,7 @@ if ($quantityrec > $origquantityrec ) { > } > > # now, add items if applicable >- if (C4::Context->preference('AcqCreateItem') eq 'receiving') { >+ if ($basket->effective_create_items eq 'receiving') { > > my @tags = $input->multi_param('tag'); > my @subfields = $input->multi_param('subfield'); >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 85e0962..ab92985 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -130,6 +130,7 @@ if(!$basketno) { > } > > our $basket = GetBasket($basketno); >+my $basketobj = Koha::Acquisition::Baskets->find( $basketno ); > $booksellerid = $basket->{booksellerid} unless $booksellerid; > my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); > >@@ -243,7 +244,7 @@ if ($close) { > $template->param( sort1 => $data->{'sort1'} ); > $template->param( sort2 => $data->{'sort2'} ); > >-if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) { >+if ($basketobj->effective_create_items eq 'ordering' && !$ordernumber) { > # Check if ACQ framework exists > my $marc = GetMarcStructure(1, 'ACQ', { unsafe => 1 } ); > unless($marc) { >@@ -358,7 +359,7 @@ $template->param( > barcode_subfield => $barcode_subfield, > import_batch_id => $import_batch_id, > subscriptionid => $subscriptionid, >- acqcreate => C4::Context->preference("AcqCreateItem") eq "ordering" ? 1 : "", >+ acqcreate => $basketobj->effective_create_items eq "ordering" ? 1 : "", > users_ids => join(':', @order_user_ids), > users => \@order_users, > (uc(C4::Context->preference("marcflavour"))) => 1 >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index 116277d..4f9d4fd 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -111,6 +111,7 @@ unless ( $results and @$results) { > > # prepare the form for receiving > my $order = $results->[0]; >+my $basket = Koha::Acquisition::Order->fetch({ordernumber => $ordernumber})->basket; > > # Check if ACQ framework exists > my $acq_fw = GetMarcStructure( 1, 'ACQ', { unsafe => 1 } ); >@@ -118,7 +119,7 @@ unless($acq_fw) { > $template->param('NoACQframework' => 1); > } > >-my $AcqCreateItem = C4::Context->preference('AcqCreateItem'); >+my $AcqCreateItem = $basket->effective_create_items; > if ($AcqCreateItem eq 'receiving') { > $template->param( > AcqCreateItemReceiving => 1, >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 5c73d97..c1e0c56 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -66,6 +66,7 @@ use CGI qw ( -utf8 ); > use C4::Output; > use C4::Suggestions; > >+use Koha::Acquisition::Baskets; > use Koha::Acquisition::Bookseller; > use Koha::Biblios; > use Koha::DateUtils; >@@ -264,6 +265,7 @@ unless( defined $invoice->{closedate} ) { > $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds ); > $line{holds} = $holds_count; > $line{holds_on_order} = $itemholds?$itemholds:$holds_count if $line{left_holds_on_order}; >+ $line{basket} = Koha::Acquisition::Baskets->find( $line{basketno} ); > > my $budget_name = GetBudgetName( $line{budget_id} ); > $line{budget_name} = $budget_name; >diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl >index 54668c4..220805e 100755 >--- a/acqui/uncertainprice.pl >+++ b/acqui/uncertainprice.pl >@@ -54,6 +54,7 @@ use C4::Acquisition qw/SearchOrders GetOrder ModOrder/; > use C4::Biblio qw/GetBiblioData/; > > use Koha::Acquisition::Booksellers; >+use Koha::Acquisition::Baskets; > > my $input=new CGI; > >@@ -72,6 +73,8 @@ my $op = $input->param('op'); > my $owner = $input->param('owner') || 0 ; # flag to see only "my" orders, or everyone orders > my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); > >+$template->param( basket => Koha::Acquisition::Baskets->find($basketno) ); >+ > #show all orders that have uncertain price for the bookseller > my $pendingorders = SearchOrders({ > booksellerid => $booksellerid, >diff --git a/installer/data/mysql/atomicupdate/bug_15685-add_create_items_to_aqbasket.sql b/installer/data/mysql/atomicupdate/bug_15685-add_create_items_to_aqbasket.sql >new file mode 100644 >index 0000000..145e6d4 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_15685-add_create_items_to_aqbasket.sql >@@ -0,0 +1 @@ >+ALTER TABLE aqbasket ADD COLUMN create_items ENUM('ordering', 'receiving', 'cataloguing') DEFAULT NULL; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 2edd371..4311c48 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2990,6 +2990,7 @@ CREATE TABLE `aqbasket` ( -- stores data about baskets in acquisitions > `basketgroupid` int(11), -- links this basket to its group (aqbasketgroups.id) > `deliveryplace` varchar(10) default NULL, -- basket delivery place > `billingplace` varchar(10) default NULL, -- basket billing place >+ create_items ENUM('ordering', 'receiving', 'cataloguing') default NULL; -- when items should be created for orders in this basket > branch varchar(10) default NULL, -- basket branch > is_standing TINYINT(1) NOT NULL DEFAULT 0, -- orders in this basket are standing > PRIMARY KEY (`basketno`), >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 eb382ad..e7b2882 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -423,9 +423,18 @@ > [% IF ( creationdate ) %]<li><span class="label">Opened on:</span> [% creationdate | $KohaDates %]</li>[% END %] > [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %] > [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>[% END %] >- [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>[% END %] > <li><span class="label">Orders are standing:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li> > >+ [% IF basket.create_items %] >+ <li> >+ <span class="label">Create items when:</span> >+ [% SWITCH basket.create_items %] >+ [% CASE 'receiving' %]Receiving items >+ [% CASE 'cataloguing' %]Cataloguing items >+ [% CASE %]Placing orders >+ [% END %] >+ </li> >+ [% END %] > > </ol> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >index b3be241..9fc7786 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >@@ -1,4 +1,5 @@ > [% USE Branches %] >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › > [% IF ( add_form ) %] >@@ -42,7 +43,7 @@ > [% IF ( basketno ) %] > <li> > <input type="hidden" name="basketno" value="[% basketno %]" /> >- <input type="hidden" name="is_an_edit" value="1" /> >+ <input type="hidden" name="rs_an_edit" value="1" /> > </li> > [% END %] > <li> >@@ -107,6 +108,21 @@ > [% END %] > <div class="hint">Standing orders do not close when received.</div> > </li> >+ [% UNLESS basketno %] >+ <li> >+ <label for="create_items">Create items when:</label> >+ <select name="create_items" id="create_items"> >+ [% SWITCH Koha.Preference('AcqCreateItem') %] >+ [% CASE 'receiving' %]<option value="">use default (receiving an order).</option> >+ [% CASE 'cataloguing' %]<option value="">use default (cataloging the record).</option> >+ [% CASE %]<option value="">use default (placing an order).</option> >+ [% END %] >+ <option value="ordering">placing an order.</option> >+ <option value="receiving">receiving an order.</option> >+ <option value="cataloguing">cataloging the record.</option> >+ </select> >+ </li> >+ [% END %] > </ol> > </fieldset> > <fieldset class="action"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 1bb2c69..ee4d8d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -441,7 +441,7 @@ > <td>[% order.unitprice | $Price %]</td> > <td>[% order.total | $Price %]</td> > <td> >- [% IF loop_receive.cannot_cancel or ( Koha.Preference("AcqCreateItem") == "receiving" and loop_receive.holds > 0 ) %] >+ [% IF loop_receive.cannot_cancel or ( order.basket.effective_create_items == "receiving" and loop_receive.holds > 0 ) %] > [% IF loop_receive.cannot_cancel %] > [% span_title = BLOCK %] > Cannot cancel receipt of this order line because it >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >index 51d52a3..d916c80 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >@@ -133,7 +133,7 @@ var MSG_INVALIDPRICE = _("ERROR: Price is not a valid number, please check the p > <input class="check_uncertain" data-ordernumber="[% uncertainpriceorder.ordernumber %]" type="text" size="10" name="price[% uncertainpriceorder.ordernumber %]" value="[% uncertainpriceorder.listprice %]" /> > </td> > <td> >- [% IF Koha.Preference('AcqCreateItem') == 'ordering' %] >+ [% IF basket.effective_create_items == 'ordering' %] > [% uncertainpriceorder.quantity %] > <input type="hidden" name="qty[% uncertainpriceorder.ordernumber %]" value="[% uncertainpriceorder.quantity %]" /> > [% ELSE %] >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 41bd29d..dad79f3 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 >@@ -8,6 +8,7 @@ Acquisitions: > ordering: placing an order. > receiving: receiving an order. > cataloguing: cataloging the record. >+ - This is only the default behavior, and can be changed per-basket. > - > - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/items.html' target='blank'>database columns</a> should be unique in an item:" > - pref: UniqueItemFields >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 9d1f2b9..f450d0e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -654,7 +654,7 @@ > <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]&viewallitems=1">Click here to view them all.</a></p> > [% ELSIF ( itemloop.size ) %] > [% INCLUDE items_table items=itemloop tab="holdings" %] >- [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %] >+ [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %] > [% IF acquisition_details.total_quantity == 1 %] > <span>1 item is on order.</span> > [% ELSE %] >@@ -681,7 +681,7 @@ > <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding %]</div> > [% END %] > [% ELSE %] >- [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %] >+ [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %] > [% IF acquisition_details.total_quantity == 1 %] > <span>1 item is on order.</span> > [% ELSE %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 8252e50..f7020a8 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -54,6 +54,7 @@ use Koha::RecordProcessor; > use Koha::AuthorisedValues; > use Koha::Biblios; > use Koha::ItemTypes; >+use Koha::Acquisition::Order; > use Koha::Virtualshelves; > use Koha::Patrons; > use Koha::Ratings; >@@ -639,7 +640,8 @@ if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { > }); > my $total_quantity = 0; > for my $order ( @$orders ) { >- if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) { >+ my $basket = Koha::Acquisition::Order->find( $order->{ordernumber} )->basket; >+ if ( $basket->effective_create_items eq 'ordering' ) { > for my $itemnumber ( C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ) { > push @itemnumbers_on_order, $itemnumber; > } >@@ -700,9 +702,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { > $itm->{transfertto} = $transfertto; > } > >- if ( C4::Context->preference('OPACAcquisitionDetails') >- and C4::Context->preference('AcqCreateItem') eq 'ordering' ) >- { >+ if ( C4::Context->preference('OPACAcquisitionDetails') ) { > $itm->{on_order} = 1 > if grep /^$itm->{itemnumber}$/, @itemnumbers_on_order; > } >-- >2.1.4
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 15685
:
47783
|
55094
|
55096
|
57390
|
57392
|
57395
|
57424
|
57425
|
57426
|
57427
|
64918
|
64919
|
64920
|
64921
|
64922
|
65119
|
65120
|
65121
|
65122
|
65895
|
65896
|
65897
|
65898
|
65899
|
65900
|
66119
|
66120
|
66121
|
66122
|
66123
|
66124
|
67638
|
67639
|
67640
|
67641
|
67642
|
67643
|
67644
|
67645
|
67646
|
67647
|
67689
|
67690
|
67691
|
67692
|
67693
|
67694
|
67695
|
67696
|
67697
|
67698
|
67884
|
67898
|
67899
|
67900
|
67901
|
67902
|
67903
|
67904
|
67905
|
67906
|
67907
|
67908
|
67909
|
67910
|
67911