Lines 24-30
use C4::Auth;
Link Here
|
24 |
use C4::Output; |
24 |
use C4::Output; |
25 |
use CGI qw ( -utf8 ); |
25 |
use CGI qw ( -utf8 ); |
26 |
use C4::Members; |
26 |
use C4::Members; |
27 |
use C4::Members::Attributes qw(GetBorrowerAttributes); |
|
|
28 |
use C4::Accounts; |
27 |
use C4::Accounts; |
29 |
use C4::Koha; |
28 |
use C4::Koha; |
30 |
use Koha::Patrons; |
29 |
use Koha::Patrons; |
Lines 170-176
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
170 |
$total_paid = '0.00'; #TODO not right with pay_individual |
169 |
$total_paid = '0.00'; #TODO not right with pay_individual |
171 |
} |
170 |
} |
172 |
|
171 |
|
173 |
borrower_add_additional_fields($borrower, $template); |
172 |
if ( $patron->is_child ) { |
|
|
173 |
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']} ); |
174 |
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; |
175 |
$template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; |
176 |
} |
174 |
|
177 |
|
175 |
$template->param(%$borrower); |
178 |
$template->param(%$borrower); |
176 |
|
179 |
|
Lines 178-205
$template->param(
Link Here
|
178 |
borrowernumber => $borrowernumber, # some templates require global |
181 |
borrowernumber => $borrowernumber, # some templates require global |
179 |
patron => $patron, |
182 |
patron => $patron, |
180 |
total => $total_due, |
183 |
total => $total_due, |
181 |
ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'), |
|
|
182 |
|
184 |
|
183 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
185 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
184 |
); |
186 |
); |
185 |
|
187 |
|
186 |
output_html_with_http_headers $input, $cookie, $template->output; |
188 |
output_html_with_http_headers $input, $cookie, $template->output; |
187 |
|
189 |
|
188 |
sub borrower_add_additional_fields { |
|
|
189 |
my ( $b_ref, $template ) = @_; |
190 |
|
191 |
# some borrower info is not returned in the standard call despite being assumed |
192 |
# in a number of templates. It should not be the business of this script but in lieu of |
193 |
# a revised api here it is ... |
194 |
if ( $b_ref->{category_type} eq 'C' ) { |
195 |
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); |
196 |
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; |
197 |
$template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; |
198 |
} |
199 |
|
200 |
if (C4::Context->preference('ExtendedPatronAttributes')) { |
201 |
$b_ref->{extendedattributes} = GetBorrowerAttributes($b_ref->{borrowernumber}); |
202 |
} |
203 |
|
204 |
return; |
205 |
} |