Lines 24-29
use C4::Output;
Link Here
|
24 |
use C4::Members; |
24 |
use C4::Members; |
25 |
use C4::Koha qw( getitemtypeinfo ); |
25 |
use C4::Koha qw( getitemtypeinfo ); |
26 |
use C4::Circulation qw( GetIssuingCharges ); |
26 |
use C4::Circulation qw( GetIssuingCharges ); |
|
|
27 |
use C4::Reserves; |
28 |
use C4::Items; |
29 |
use Koha::Holds; |
27 |
|
30 |
|
28 |
my $input = CGI->new; |
31 |
my $input = CGI->new; |
29 |
my $borrowernumber = $input->param('borrowernumber'); |
32 |
my $borrowernumber = $input->param('borrowernumber'); |
Lines 55-63
foreach my $accountline (@$accts) {
Link Here
|
55 |
} |
58 |
} |
56 |
|
59 |
|
57 |
my $roadtype = |
60 |
my $roadtype = |
58 |
C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); |
61 |
C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ) // ''; |
59 |
|
62 |
|
60 |
our $totalprice = 0; |
63 |
our $totalprice = 0; |
|
|
64 |
my $holds_rs = Koha::Holds->search( |
65 |
{ borrowernumber => $borrowernumber }, |
66 |
); |
67 |
|
61 |
$template->param( |
68 |
$template->param( |
62 |
%$data, |
69 |
%$data, |
63 |
|
70 |
|
Lines 69-74
$template->param(
Link Here
|
69 |
|
76 |
|
70 |
issues => build_issue_data( GetPendingIssues($borrowernumber) ), |
77 |
issues => build_issue_data( GetPendingIssues($borrowernumber) ), |
71 |
totalprice => $totalprice, |
78 |
totalprice => $totalprice, |
|
|
79 |
|
80 |
reserves => build_reserve_data( $holds_rs ), |
72 |
); |
81 |
); |
73 |
|
82 |
|
74 |
output_html_with_http_headers $input, $cookie, $template->output; |
83 |
output_html_with_http_headers $input, $cookie, $template->output; |
Lines 103-106
sub build_issue_data {
Link Here
|
103 |
@{$return} = sort { $a->{date_due} <=> $b->{date_due} } @{$return}; |
112 |
@{$return} = sort { $a->{date_due} <=> $b->{date_due} } @{$return}; |
104 |
|
113 |
|
105 |
return $return; |
114 |
return $return; |
|
|
115 |
|
116 |
} |
117 |
|
118 |
sub build_reserve_data { |
119 |
my $reserves = shift; |
120 |
|
121 |
my $return = []; |
122 |
|
123 |
my $today = DateTime->now( time_zone => C4::Context->tz ); |
124 |
$today->truncate( to => 'day' ); |
125 |
|
126 |
while ( my $reserve = $reserves->next() ) { |
127 |
|
128 |
my $row = { |
129 |
title => $reserve->biblio()->title(), |
130 |
author => $reserve->biblio()->author(), |
131 |
reservedate => $reserve->reservedate(), |
132 |
expirationdate => $reserve->expirationdate(), |
133 |
waiting_at => $reserve->branch()->branchname(), |
134 |
}; |
135 |
|
136 |
push( @{$return}, $row ); |
137 |
} |
138 |
|
139 |
@{$return} = sort { $a->{reservedate} <=> $b->{reservedate} } @{$return}; |
140 |
|
141 |
return $return; |
106 |
} |
142 |
} |
107 |
- |
|
|