Bug 10403: Show inactive but unlocked budgets on orderreceive
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Tue, 13 Aug 2013 11:51:57 +0000 (07:51 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 22 Oct 2013 12:57:41 +0000 (12:57 +0000)
I have heard from several libraries that at the end of the budget
year even though a budget is inactive for new acquisitions, an
inactive budget should remain modifiable until the books are
closed and the budget is marked inactive. This patch makes it so
that all budgets that are unlocked are available on the order
receipt page (only).

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
acqui/orderreceive.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt

index fa400a1..2a21c14 100755 (executable)
@@ -230,8 +230,12 @@ $template->param(
 
 my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
 my @budget_loop;
-my $periods = GetBudgetPeriods( { 'budget_period_active' => 1 } );
+my $periods = GetBudgetPeriods( );
 foreach my $period (@$periods) {
+    if ($period->{'budget_period_id'} == $budget->{'budget_period_id'}) {
+        $template->{'VARS'}->{'budget_period_description'} = $period->{'budget_period_description'};
+    }
+    next if $period->{'budget_period_locked'} || !$period->{'budget_period_description'};
     my $budget_hierarchy = GetBudgetHierarchy( $period->{'budget_period_id'} );
     my @funds;
     foreach my $r ( @{$budget_hierarchy} ) {
index 0ffce99..cac2132 100644 (file)
        <ol>
        <li><label for="datereceived">Date received: </label><span> [% datereceived %] </span></li>
        <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
-            <option value="">Keep current ([% bookfund %])</option>
+            <option value="">Keep current ([% budget_period_description %] - [% bookfund %])</option>
             [% FOREACH period IN budget_loop %]
                 <optgroup label="[% period.description %]">
                 [% FOREACH fund IN period.funds %]
                     [% END %]
                 [% END %]
             [% END %]
-       </select> (Current: [% bookfund %])</li>
+       </select></li>
+       <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
        <li><label for="creator">Created by: </label><span> [% IF ( memberfirstname and membersurname ) %][% IF ( memberfirstname ) %][% memberfirstname %][% END %] [% membersurname %][% ELSE %]No name[% END %]</span></li>
        <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
            [% IF ( edit and not subscriptionid) %]