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 56-68
foreach my $accountline (@$accts) {
Link Here
|
56 |
} |
59 |
} |
57 |
|
60 |
|
58 |
my $roadtype = |
61 |
my $roadtype = |
59 |
C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); |
62 |
C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ) // ''; |
60 |
$roadtype = '' if ( ! $roadtype ); |
63 |
$roadtype = '' if ( ! $roadtype ); |
61 |
|
64 |
|
62 |
our $totalprice = 0; |
65 |
our $totalprice = 0; |
63 |
my $total_format = ''; |
66 |
my $total_format = ''; |
64 |
$total_format = sprintf( "%.2f", $total ) if ($total); |
67 |
$total_format = sprintf( "%.2f", $total ) if ($total); |
65 |
|
68 |
|
|
|
69 |
my $holds_rs = Koha::Holds->search( |
70 |
{ borrowernumber => $borrowernumber }, |
71 |
); |
72 |
|
66 |
$template->param( |
73 |
$template->param( |
67 |
%$data, |
74 |
%$data, |
68 |
|
75 |
|
Lines 74-79
$template->param(
Link Here
|
74 |
|
81 |
|
75 |
issues => build_issue_data( GetPendingIssues($borrowernumber) ), |
82 |
issues => build_issue_data( GetPendingIssues($borrowernumber) ), |
76 |
totalprice => $totalprice, |
83 |
totalprice => $totalprice, |
|
|
84 |
|
85 |
reserves => build_reserve_data( $holds_rs ), |
77 |
); |
86 |
); |
78 |
|
87 |
|
79 |
output_html_with_http_headers $input, $cookie, $template->output; |
88 |
output_html_with_http_headers $input, $cookie, $template->output; |
Lines 109-112
sub build_issue_data {
Link Here
|
109 |
@{$return} = sort { $a->{date_due} eq $b->{date_due} } @{$return}; |
118 |
@{$return} = sort { $a->{date_due} eq $b->{date_due} } @{$return}; |
110 |
|
119 |
|
111 |
return $return; |
120 |
return $return; |
|
|
121 |
|
122 |
} |
123 |
|
124 |
sub build_reserve_data { |
125 |
my $reserves = shift; |
126 |
|
127 |
my $return = []; |
128 |
|
129 |
my $today = DateTime->now( time_zone => C4::Context->tz ); |
130 |
$today->truncate( to => 'day' ); |
131 |
|
132 |
while ( my $reserve = $reserves->next() ) { |
133 |
|
134 |
my $row = { |
135 |
title => $reserve->biblio()->title(), |
136 |
author => $reserve->biblio()->author(), |
137 |
reservedate => $reserve->reservedate(), |
138 |
expirationdate => $reserve->expirationdate(), |
139 |
waiting_at => $reserve->branch()->branchname(), |
140 |
}; |
141 |
|
142 |
push( @{$return}, $row ); |
143 |
} |
144 |
|
145 |
@{$return} = sort { $a->{reservedate} <=> $b->{reservedate} } @{$return}; |
146 |
|
147 |
return $return; |
112 |
} |
148 |
} |
113 |
- |
|
|