use C4::Members::Attributes qw(SearchIdMatchingAttribute UpdateBorrowerAttribute);
use C4::NewsChannels; #get slip news
use DateTime;
-use DateTime::Format::DateParse;
use Koha::Database;
use Koha::DateUtils;
use Koha::Borrower::Debarments qw(IsDebarred);
}
sub Search {
- my ( $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ) = @_;
+ my ( $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype, $not_attributes ) = @_;
my $search_string;
my $found_borrower;
}
}
- if ( !$found_borrower && C4::Context->preference('ExtendedPatronAttributes') && $search_string ) {
+ if ( !$found_borrower && C4::Context->preference('ExtendedPatronAttributes') && $search_string && !$not_attributes ) {
my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($search_string);
if(scalar(@$matching_records)>0) {
if ( my $fr = ref $filter ) {
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@borrowernumbers);
my $data = $sth->fetchall_arrayref({});
- my $tz = C4::Context->tz();
- my $today = DateTime->now( time_zone => $tz);
+ my $today = dt_from_string;
foreach (@{$data}) {
if ($_->{issuedate}) {
$_->{issuedate} = dt_from_string($_->{issuedate}, 'sql');
}
$_->{date_due} or next;
- $_->{date_due} = DateTime::Format::DateParse->parse_datetime($_->{date_due}, $tz->name());
+ $_->{date_due} = dt_from_string($_->{date_due}, 'sql');
if ( DateTime->compare($_->{date_due}, $today) == -1 ) {
$_->{overdue} = 1;
}