sub AddMember {
my (%data) = @_;
my $dbh = C4::Context->dbh;
- $data{'userid'} = '' unless $data{'password'};
+
$data{'password'} = md5_base64( $data{'password'} ) if $data{'password'};
+ $data{'password'} = '!' if (not $data{'password'} and $data{'userid'});
# WE SHOULD NEVER PASS THIS SUBROUTINE ANYTHING OTHER THAN ISO DATES
# IF YOU UNCOMMENT THESE LINES YOU BETTER HAVE A DARN COMPELLING REASON
=cut
sub GetBorrowersWhoHaveNotBorrowedSince {
-### TODO : It could be dangerous to delete Borrowers who have just been entered and who have not yet borrowed any book. May be good to add a dateexpiry or dateenrolled filter.
-
- my $filterdate = shift||POSIX::strftime("%Y-%m-%d",localtime());
+ my $filterdate = shift||POSIX::strftime("%Y-%m-%d",localtime());
+ my $filterexpiry = shift;
my $filterbranch = shift ||
((C4::Context->preference('IndependantBranches')
&& C4::Context->userenv
if ($filterbranch && $filterbranch ne ""){
$query.=" AND borrowers.branchcode= ?";
push @query_params,$filterbranch;
- }
+ }
+ if($filterexpiry){
+ $query .= " AND dateexpiry < NOW() ";
+ }
$query.=" GROUP BY borrowers.borrowernumber";
if ($filterdate){
$query.=" HAVING latestissue <? OR latestissue IS NULL";