From e5ffa4db794db471ad4456b00ebc323daa5302f6 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 11 Dec 2007 09:58:54 +0100 Subject: [PATCH] add registration fees on registration renewal if needed Signed-off-by: Joshua Ferraro --- C4/Members.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/C4/Members.pm b/C4/Members.pm index 5224b2e8aa..f1c122839a 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1595,9 +1595,9 @@ returns date sub ExtendMemberSubscriptionTo { my ( $borrowerid,$date) = @_; my $dbh = C4::Context->dbh; + my $borrower = GetMember($borrowerid,'borrowernumber'); unless ($date){ $date=POSIX::strftime("%Y-%m-%d",localtime(time)); - my $borrower = GetMember($borrowerid,'borrowernumber'); $date = GetExpiryDate( $borrower->{'categorycode'}, $date ); } my $sth = $dbh->do(<prepare("SELECT enrolmentfee FROM categories WHERE categorycode=?"); + $sth->execute($borrower->{'categorycode'}); + my ($enrolmentfee) = $sth->fetchrow; + if ($enrolmentfee) { + # insert fee in patron debts + manualinvoice($borrower->{'borrowernumber'}, '', '', 'A', $enrolmentfee); + } return $date if ($sth); return 0; } -- 2.39.5