Bugzilla – Attachment 19071 Details for
Bug 10481
No enrollment fee when changing patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10481: FIX No enrollment fee when changing patron category.
Bug-10481-FIX-No-enrollment-fee-when-changing-patr.patch (text/plain), 2.27 KB, created by
Jonathan Druart
on 2013-06-17 13:01:05 UTC
(
hide
)
Description:
Bug 10481: FIX No enrollment fee when changing patron category.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-06-17 13:01:05 UTC
Size:
2.27 KB
patch
obsolete
>From 49490dddbc99b799be6d528eba822068e29a27cc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 17 Jun 2013 14:56:22 +0200 >Subject: [PATCH] Bug 10481: FIX No enrollment fee when changing patron > category. > >When a patron changes to a category with enrollment fee, they >are not generated. > >Test plan: >- Choose a category without fee (e.g. Kid) >- Add an enrollment fee for another category (e.g. Young adult) >- Choose a kid and change his category to "Young adult". >- Note the warning message "Fees & Charges: Patron has Outstanding fees > & charges of XX" on the check out page. >--- > C4/Members.pm | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 3221f53..95f4a85 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -721,6 +721,7 @@ sub ModMember { > $data{password} = md5_base64($data{password}); > } > } >+ my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} ); > my $execute_success=UpdateInTable("borrowers",\%data); > if ($execute_success) { # only proceed if the update was a success > # ok if its an adult (type) it may have borrowers that depend on it as a guarantor >@@ -731,6 +732,24 @@ sub ModMember { > # is adult check guarantees; > UpdateGuarantees(%data); > } >+ >+ # If the patron changes to a category with enrollment fee, we add a fee >+ if ( $data{categorycode} and $data{categorycode} ne $old_categorycode ) { >+ # check for enrollment fee & add it if needed >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare(q{ >+ SELECT enrolmentfee >+ FROM categories >+ WHERE categorycode=? >+ }); >+ $sth->execute( $data{categorycode} ); >+ my ($enrolmentfee) = $sth->fetchrow; >+ if ($enrolmentfee && $enrolmentfee > 0) { >+ # insert fee in patron debts >+ C4::Accounts::manualinvoice($data{borrowernumber}, '', '', 'A', $enrolmentfee); >+ } >+ } >+ > logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if C4::Context->preference("BorrowersLog"); > } > return $execute_success; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10481
:
19071
|
19556
|
19557
|
19694
|
19787
|
19797
|
20406
|
20407