Lines 721-726
sub ModMember {
Link Here
|
721 |
$data{password} = md5_base64($data{password}); |
721 |
$data{password} = md5_base64($data{password}); |
722 |
} |
722 |
} |
723 |
} |
723 |
} |
|
|
724 |
my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} ); |
724 |
my $execute_success=UpdateInTable("borrowers",\%data); |
725 |
my $execute_success=UpdateInTable("borrowers",\%data); |
725 |
if ($execute_success) { # only proceed if the update was a success |
726 |
if ($execute_success) { # only proceed if the update was a success |
726 |
# ok if its an adult (type) it may have borrowers that depend on it as a guarantor |
727 |
# ok if its an adult (type) it may have borrowers that depend on it as a guarantor |
Lines 731-736
sub ModMember {
Link Here
|
731 |
# is adult check guarantees; |
732 |
# is adult check guarantees; |
732 |
UpdateGuarantees(%data); |
733 |
UpdateGuarantees(%data); |
733 |
} |
734 |
} |
|
|
735 |
|
736 |
# If the patron changes to a category with enrollment fee, we add a fee |
737 |
if ( $data{categorycode} and $data{categorycode} ne $old_categorycode ) { |
738 |
# check for enrollment fee & add it if needed |
739 |
my $dbh = C4::Context->dbh; |
740 |
my $sth = $dbh->prepare(q{ |
741 |
SELECT enrolmentfee |
742 |
FROM categories |
743 |
WHERE categorycode=? |
744 |
}); |
745 |
$sth->execute( $data{categorycode} ); |
746 |
my ($enrolmentfee) = $sth->fetchrow; |
747 |
if ($enrolmentfee && $enrolmentfee > 0) { |
748 |
# insert fee in patron debts |
749 |
C4::Accounts::manualinvoice($data{borrowernumber}, '', '', 'A', $enrolmentfee); |
750 |
} |
751 |
} |
752 |
|
734 |
logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if C4::Context->preference("BorrowersLog"); |
753 |
logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if C4::Context->preference("BorrowersLog"); |
735 |
} |
754 |
} |
736 |
return $execute_success; |
755 |
return $execute_success; |
737 |
- |
|
|