Bug 11769 - Use validation plugin when creating new MARC framework
[koha_fer] / members / moremember.pl
index adce9d2..d78cc1f 100755 (executable)
@@ -232,6 +232,19 @@ my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} );
 $template->param( lib1 => $lib1 ) if ($lib1);
 $template->param( lib2 => $lib2 ) if ($lib2);
 
+# If printing a page, send the account informations to the template
+if ($print eq "page") {
+    foreach my $accountline (@$accts) {
+        $accountline->{amount} = sprintf '%.2f', $accountline->{amount};
+        $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding};
+
+        if ($accountline->{accounttype} ne 'F' && $accountline->{accounttype} ne 'FU'){
+            $accountline->{printtitle} = 1;
+        }
+    }
+    $template->param( accounts => $accts );
+}
+
 # Show OPAC privacy preference is system preference is set
 if ( C4::Context->preference('OPACPrivacy') ) {
     $template->param( OPACPrivacy => 1);
@@ -246,7 +259,7 @@ my $relissue    = [];
 if ( @borrowernumbers ) {
     $relissue    = GetPendingIssues(@borrowernumbers);
 }
-my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} );
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
 my $today       = DateTime->now( time_zone => C4::Context->tz);
 $today->truncate(to => 'day');
 my @borrowers_with_issues;
@@ -412,7 +425,7 @@ $template->param(
     detailview => 1,
     AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
     CANDELETEUSER    => $candeleteuser,
-    roaddetails     => $roaddetails,
+    roadtype        => $roadtype,
     borrowernumber  => $borrowernumber,
     othernames      => $data->{'othernames'},
     categoryname    => $data->{'description'},
@@ -521,6 +534,14 @@ sub build_issue_data {
         $row{renew_failed}  = $renew_failed{ $issue->{itemnumber} };
         $row{return_failed} = $return_failed{ $issue->{barcode} };
         ($row{'renewcount'},$row{'renewsallowed'},$row{'renewsleft'}) = C4::Circulation::GetRenewCount($issue->{'borrowernumber'},$issue->{'itemnumber'}); #Add renewal count to item data display
+
+        $row{'soonestrenewdate'} = output_pref(
+            C4::Circulation::GetSoonestRenewDate(
+                $issue->{borrowernumber},
+                $issue->{itemnumber}
+            )
+        );
+
         push( @{$localissue}, \%row );
     }
     return $localissue;