From f91fe7da2cf6ead81efcff49fbc7361229b99e6d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Nov 2016 08:02:38 +0000 Subject: [PATCH] Bug 17569: Remove C4::Members::GetUpcomingMembershipExpires Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- C4/Members.pm | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 896f810699..dfe4cbd753 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -76,8 +76,6 @@ BEGIN { &GetBorrowersWhoHaveNeverBorrowed &GetBorrowersWithIssuesHistoryOlderThan - &GetUpcomingMembershipExpires - &IssueSlip GetBorrowersWithEmail @@ -1059,53 +1057,6 @@ sub GetNoticeEmailAddress { return $data->{'primaryemail'} || ''; } -=head2 GetUpcomingMembershipExpires - - my $expires = GetUpcomingMembershipExpires({ - branch => $branch, before => $before, after => $after, - }); - - $branch is an optional branch code. - $before/$after is an optional number of days before/after the date that - is set by the preference MembershipExpiryDaysNotice. - If the pref would be 14, before 2 and after 3, you will get all expires - from 12 to 17 days. - -=cut - -sub GetUpcomingMembershipExpires { - my ( $params ) = @_; - my $before = $params->{before} || 0; - my $after = $params->{after} || 0; - my $branch = $params->{branch}; - - my $dbh = C4::Context->dbh; - my $days = C4::Context->preference("MembershipExpiryDaysNotice") || 0; - my $date1 = dt_from_string->add( days => $days - $before ); - my $date2 = dt_from_string->add( days => $days + $after ); - $date1= output_pref({ dt => $date1, dateformat => 'iso', dateonly => 1 }); - $date2= output_pref({ dt => $date2, dateformat => 'iso', dateonly => 1 }); - - my $query = q| - SELECT borrowers.*, categories.description, - branches.branchname, branches.branchemail FROM borrowers - LEFT JOIN branches USING (branchcode) - LEFT JOIN categories USING (categorycode) - |; - if( $branch ) { - $query.= 'WHERE branchcode=? AND dateexpiry BETWEEN ? AND ?'; - } else { - $query.= 'WHERE dateexpiry BETWEEN ? AND ?'; - } - - my $sth = $dbh->prepare( $query ); - my @pars = $branch? ( $branch ): (); - push @pars, $date1, $date2; - $sth->execute( @pars ); - my $results = $sth->fetchall_arrayref( {} ); - return $results; -} - =head2 GetBorrowersToExpunge $borrowers = &GetBorrowersToExpunge( -- 2.39.5