});
my $bornum=$input->param('bornum');
-
#start the page and read in includes
-
my $data=borrdata('',$bornum);
+my (undef,undef,undef,$category_type)=getborrowercategory($data->{'categorycode'});
$template->param($data->{'categorycode'} => 1); # in template <TMPL_IF name="I"> => instutitional (A for Adult & C for children)
-
$data->{'dateenrolled'} = format_date($data->{'dateenrolled'});
$data->{'dateexpiry'} = format_date($data->{'dateexpiry'});
$data->{'dateofbirth'} = format_date($data->{'dateofbirth'});
$data->{&expand_sex_into_predicate($data->{'sex'})} = 1;
-if ($data->{'categorycode'} eq 'C'){
+if ($category_type eq 'C' and $data->{'guarantorid'} ne '0' ){
my $data2=borrdata('',$data->{'guarantorid'});
$data->{'address'}=$data2->{'address'};
$data->{'city'}=$data2->{'city'};
$data->{'zipcode'} = $data2->{'zipcode'};
}
-
if ($data->{'ethnicity'} || $data->{'ethnotes'}) {
$template->param(printethnicityline => 1);
}
-
-if ($data->{'category_type'} ne 'C'){
+if ($category_type ne 'C'){
$template->param(isguarantee => 1);
# FIXME
# It looks like the $i is only being returned to handle walking through
name => $guarantees->[$i]->{'firstname'} . " " . $guarantees->[$i]->{'surname'}});
}
$template->param(guaranteeloop => \@guaranteedata);
-
+ ($template->param(adultborrower=>1)) if ($category_type eq 'A');
} else {
my ($guarantorid)=findguarantor($data->{guarantorid});
if ($guarantorid->{'borrowernumber'}){
$template->param($data);
$template->param(
bornum => $bornum,
- totalprice =>$totalprice,
- totaldue =>$total,
+ totalprice =>sprintf("%.2f",$totalprice),
+ totaldue => sprintf("%.2f",$total),
issueloop => \@issuedata,
unvalidlibrarian => $unvalidlibrarian,
- reserveloop => \@reservedata);
+ reserveloop => \@reservedata,
+ intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
+ intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+ IntranetNav => C4::Context->preference("IntranetNav"),
+ patronimages => C4::Context->preference("patronimages"),
+ );
output_html_with_http_headers $input, $cookie, $template->output;