Bug 21467: Add subscription's info when ordering
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 2 Oct 2018 15:39:38 +0000 (12:39 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 13 Nov 2018 19:31:10 +0000 (19:31 +0000)
When ordering from a subscription, there is now a "hint" to display the
number of issues and the frequency. It will be easier to estimate the
quantity to receive.

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

acqui/neworderempty.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt

index 968ceec..d768bf7 100755 (executable)
@@ -94,6 +94,7 @@ use Koha::MarcSubfieldStructures;
 use Koha::ItemTypes;
 use Koha::Patrons;
 use Koha::RecordProcessor;
+use Koha::Subscriptions;
 
 our $input           = new CGI;
 my $booksellerid    = $input->param('booksellerid');   # FIXME: else ERROR!
@@ -380,7 +381,11 @@ if ( defined $from_subscriptionid ) {
         $basket = GetBasket( $input->param('basketno') );
     }
 
-    $template->param( subscriptionid => $from_subscriptionid );
+    my $subscription = Koha::Subscriptions->find($from_subscriptionid);
+    $template->param(
+        subscriptionid => $from_subscriptionid,
+        subscription   => $subscription,
+    );
 }
 
 # Find the items.barcode subfield for barcode validations
index ab07b1a..30879f3 100644 (file)
                 [% END %]
                 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, useful when receiveing an order -->
                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
+
+                [% IF subscription %]
+                    <br/>
+                    <span class="hint">
+                        Frequency: [% subscription.frequency.description | html %] |
+                        [% IF subscription.numberlength %]Number of issues: [% subscription.numberlength | html %][% END %]
+                        [% IF subscription.weeklength   %]Number of weeks: [% subscription.weeklength | html %][% END %]
+                        [% IF subscription.monthlength  %]Number of months: [% subscription.monthlength | html %][% END %]
+                    </span>
+                [% END %]
             </li>
             <li>
                 [% IF ( close ) %]