Bug 13601: get rid of DateTime::Format::DateParse
[koha.git] / C4 / Members.pm
index 6f95b94..a98d16f 100644 (file)
@@ -36,7 +36,6 @@ use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable);
 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);
@@ -203,7 +202,7 @@ sub _express_member_find {
 }
 
 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;
@@ -237,7 +236,7 @@ sub Search {
         }
     }
 
-    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 ) {
@@ -1195,14 +1194,13 @@ sub GetPendingIssues {
     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;
         }