Skip to content

Commit

Permalink
#1445 checking that there is an expiry date
Browse files Browse the repository at this point in the history
if there is none, automatically warn the librarian

Signed-off-by: Chris Cormack <crc@liblime.com>
  • Loading branch information
Paul POULAIN authored and Chris Cormack committed Oct 3, 2007
1 parent 375d2f1 commit f4339f5
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions reserve/request.pl
Original file line number Diff line number Diff line change
Expand Up @@ -103,32 +103,37 @@ =head1 request.pl
$maxreserves = 1;
}

# we check the date expiricy of the borrower
my $warning = (Date_to_Days(split /-/,$date) > Date_to_Days( split /-/,$borrowerinfo->{'dateexpiry'}));

if ( $warning > 0 ) {
# we check the date expiricy of the borrower (only if there is an expiry date, otherwise, set to 1 (warn)
warn "BOR : ".$borrowerinfo->{'dateexpiry'};
if ($borrowerinfo->{'dateexpiry'}) {
my $warning = (Date_to_Days(split /-/,$date) > Date_to_Days( split /-/,$borrowerinfo->{'dateexpiry'}));
if ( $warning > 0 ) {
$expiry = 1;
}
} else {
$expiry = 1;
}


# check if the borrower make the reserv in a different branch
if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) {
$diffbranch = 1;
}

$template->param(
borrowernumber => $borrowerinfo->{'borrowernumber'},
borrowersurname => $borrowerinfo->{'surname'},
borrowerfirstname => $borrowerinfo->{'firstname'},
borrowerstreetaddress => $borrowerinfo->{'address'},
borrowercity => $borrowerinfo->{'city'},
borrowerphone => $borrowerinfo->{'phone'},
borroweremail => $borrowerinfo->{'email'},
borroweremailpro => $borrowerinfo->{'emailpro'},
borrowercategory => $borrowerinfo->{'category'},
borrowerreservs => $count_reserv,
maxreserves => $maxreserves,
expiry => $expiry,
diffbranch => $diffbranch
borrowernumber => $borrowerinfo->{'borrowernumber'},
borrowersurname => $borrowerinfo->{'surname'},
borrowerfirstname => $borrowerinfo->{'firstname'},
borrowerstreetaddress => $borrowerinfo->{'address'},
borrowercity => $borrowerinfo->{'city'},
borrowerphone => $borrowerinfo->{'phone'},
borroweremail => $borrowerinfo->{'email'},
borroweremailpro => $borrowerinfo->{'emailpro'},
borrowercategory => $borrowerinfo->{'category'},
borrowerreservs => $count_reserv,
maxreserves => $maxreserves,
expiry => $expiry,
diffbranch => $diffbranch
);
}

Expand Down

0 comments on commit f4339f5

Please sign in to comment.