#
# 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 2 of the License, or (at your option) any later
-# version.
+# 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.
+# 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.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use C4::Auth qw/get_user_subpermissions/;
use C4::Branch; # GetBranches
-use C4::Dates qw/format_date format_date_in_iso/;
use C4::Auth;
use C4::Acquisition;
use C4::Budgets;
# see if the user want to see all budgets or only owned ones by default
my $show_mine = $input->param('show_mine') // 0;
-# IF USER DOESNT HAVE PERM FOR AN 'ADD', THEN REDIRECT TO THE DEFAULT VIEW...
+# IF USER DOESN'T HAVE PERM FOR AN 'ADD', THEN REDIRECT TO THE DEFAULT VIEW...
if (not defined $template->{VARS}->{'CAN_user_acquisition_budget_add_del'}
and $op eq 'add_form')
{
# ------- get periods stuff ------------------
# USED FOR PERMISSION COMPARISON LATER
-my $borrower_id = $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'};
-my $user = GetMemberDetails($borrower_id);
+my $borrower_id = $template->{VARS}->{'USER_INFO'}->{'borrowernumber'};
+my $user = C4::Members::GetMember( borrowernumber => $borrower_id );
my $user_branchcode = $user->{'branchcode'};
$template->param(
$budget->{'budget_lock'} = 1;
}
- # if a budget search doesnt match, next
+ # if a budget search doesn't match, next
if ($filter_budgetname) {
next
unless $budget->{budget_code} =~ m/$filter_budgetname/i
$available_total += $budget->{total_remaining};
}
-# if amount == 0 dont display...
+# if amount == 0 don't display...
delete $budget->{'budget_unalloc_sublevel'}
if (!defined $budget->{'budget_unalloc_sublevel'}
or $budget->{'budget_unalloc_sublevel'} == 0);