getitemtypes renamed to GetItemTypes
[koha_fer] / members / moremember.pl
index 3b9cb7c..ab9b544 100755 (executable)
@@ -70,13 +70,11 @@ my ($template, $loggedinuser, $cookie)
                             });
 
 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'});
@@ -90,7 +88,7 @@ $data->{'ethnicity'} = fixEthnicity($data->{'ethnicity'});
 
 $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'};
@@ -101,12 +99,10 @@ if ($data->{'categorycode'} eq 'C'){
        $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
@@ -120,7 +116,7 @@ if ($data->{'category_type'} ne 'C'){
                                        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'}){
@@ -233,10 +229,15 @@ if (-e $htdocs."$picture")
 $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;