use C4::Auth;
use C4::Output;
use C4::Members;
-use C4::Koha qw( getitemtypeinfo );
use C4::Circulation qw( GetIssuingCharges );
use C4::Reserves;
use C4::Items;
use Koha::Holds;
+use Koha::ItemTypes;
+use Koha::Patrons;
my $input = CGI->new;
my $borrowernumber = $input->param('borrowernumber');
}
);
-my $data = GetMember( 'borrowernumber' => $borrowernumber );
+my $patron = Koha::Patrons->find( $borrowernumber );
+unless ( $patron ) {
+ print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
+ exit;
+}
+my $category = $patron->category;
+my $data = $patron->unblessed;
+$data->{description} = $category->description;
+$data->{category_type} = $category->category_type;
my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
foreach my $accountline (@$accts) {
accounts => $accts,
totaldue => $total,
- issues => build_issue_data( GetPendingIssues($borrowernumber) ),
+ issues => build_issue_data( $borrowernumber ),
totalprice => $totalprice,
reserves => build_reserve_data( $holds_rs ),
output_html_with_http_headers $input, $cookie, $template->output;
sub build_issue_data {
- my $issues = shift;
+ my ( $borrowernumber ) = @_;
+ my $issues = GetPendingIssues( $borrowernumber );
my $return = [];
my ( $charge, $itemtype ) =
GetIssuingCharges( $issue->{itemnumber}, $borrowernumber );
- my $itemtypeinfo = getitemtypeinfo($itemtype);
- $row{'itemtype_description'} = $itemtypeinfo->{description};
+ $itemtype = Koha::ItemTypes->find( $itemtype );
+ $row{'itemtype_description'} = $itemtype->description; #FIXME Should not it be translated_description
$row{'charge'} = sprintf( "%.2f", $charge );