use CGI qw ( -utf8 );
use C4::Context;
-use C4::Koha; # GetItemTypes
use C4::Acquisition;
use C4::Auth;
use C4::Output;
use C4::Items;
use C4::Biblio;
use C4::Suggestions;
+use C4::Koha;
use Koha::Acquisition::Booksellers;
use Koha::DateUtils qw( dt_from_string );
+use Koha::ItemTypes;
+use Koha::Patrons;
my $input = new CGI;
$descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $fw, kohafield => 'items.materials', authorised_value => $item->{materials} });
$item->{materials} = $descriptions->{lib} // '';
- my $itemtype = getitemtypeinfo($item->{itype});
- $item->{itemtype} = $itemtype->{description};
+ my $itemtype = Koha::ItemTypes->find( $item->{itype} );
+ $item->{itemtype} = $itemtype->description; # FIXME Should not it be translated_description?
push @items, $item;
}
$template->param(items => \@items);
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
my $authorisedby = $order->{authorisedby};
-my $member = GetMember( borrowernumber => $authorisedby );
+my $authorised_patron = Koha::Patrons->find( $authorisedby );
my $budget = GetBudget( $order->{budget_id} );
ecost => $ecost,
unitprice => $unitprice,
tax_rate => $tax_rate,
- memberfirstname => $member->{firstname} || "",
- membersurname => $member->{surname} || "",
+ memberfirstname => $authorised_patron->firstname || "",
+ membersurname => $authorised_patron->surname || "",
invoiceid => $invoice->{invoiceid},
invoice => $invoice->{invoicenumber},
datereceived => $datereceived,
gst_values => \@gst_values,
);
-my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
+my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
my @budget_loop;
my $periods = GetBudgetPeriods( );
foreach my $period (@$periods) {
my $budget_hierarchy = GetBudgetHierarchy( $period->{'budget_period_id'} );
my @funds;
foreach my $r ( @{$budget_hierarchy} ) {
- next unless ( CanUserUseBudget( $borrower, $r, $userflags ) );
+ next unless ( CanUserUseBudget( $patron, $r, $userflags ) );
if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
next;
}