my $samebranch;
if ( C4::Context->preference("IndependentBranches") ) {
my $userenv = C4::Context->userenv;
- unless ( $userenv->{flags} % 2 == 1 ) {
+ if ( C4::Context->IsSuperLibrarian() ) {
+ $samebranch = 1;
+ }
+ else {
$samebranch = ( $data->{'branchcode'} eq $userenv->{branch} );
}
- $samebranch = 1 if ( $userenv->{flags} % 2 == 1 );
-}else{
+}
+else {
$samebranch = 1;
}
my $branchdetail = GetBranchDetail( $data->{'branchcode'});
$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);
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;
my $candeleteuser;
my $userenv = C4::Context->userenv;
-if($userenv->{flags} % 2 == 1){
+if ( C4::Context->IsSuperLibrarian() ) {
$candeleteuser = 1;
-}elsif ( C4::Context->preference("IndependentBranches") ) {
+}
+elsif ( C4::Context->preference("IndependentBranches") ) {
$candeleteuser = ( $data->{'branchcode'} eq $userenv->{branch} );
-}else{
- if( C4::Auth::getuserflags( $userenv->{flags},$userenv->{number})->{borrowers} ) {
+}
+else {
+ if ( C4::Auth::getuserflags( $userenv->{flags}, $userenv->{number} )->{borrowers} ) {
$candeleteuser = 1;
- }else{
+ }
+ else {
$candeleteuser = 0;
}
}
detailview => 1,
AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
CANDELETEUSER => $candeleteuser,
- roaddetails => $roaddetails,
+ roadtype => $roadtype,
borrowernumber => $borrowernumber,
othernames => $data->{'othernames'},
categoryname => $data->{'description'},
$row{"norenew_reason_$renewerror"} = 1 if $renewerror;
$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;