Abiding by Name Convention.
Using Members wherever it should be used.
Borrower is only used for borrower Categories.
+ GetBorrowersWhoHaveNeverBorrowed
and lists like that.
#Get data
push @EXPORT, qw(
- &SearchBorrower
+ &SearchMember
&GetMemberDetails
&GetMember
&GetGuarantees
- &findguarantor
- &GuarantornameSearch
- &GetBorrowerIssuesAndFines
+ &GetMemberIssuesAndFines
&GetPendingIssues
&GetAllIssues
&GetRoadTypes
&GetRoadTypeDetails
- &GetBorrowerAcctRecord
+ &GetMemberAccountRecords
&GetborCatFromCatType
&GetBorrowercategory
&GetBorNotifyAcctRecord
- &GetMembeReregistration
+ &ExtendMemberSubscriptionTo
&GetSortDetails
- &GetBorrowersTitles
+ &GetTitles
&GetBorrowersWhoHaveNotBorrowedSince
&GetBorrowersWhoHaveNeverBorrowed
&GetBorrowersWithIssuesHistoryOlderThan
- &GetBorrowersFromSurname
+ &GetMembersFromSurname
&GetExpiryDate
);
&MoveMemberToDeleted
);
-=item Searchborrower
+=item SearchMember
- ($count, $borrowers) = &SearchBorrower($searchstring, $type,$category_type);
+ ($count, $borrowers) = &SearchMember($searchstring, $type,$category_type);
Looks up patrons (borrowers) by name.
must match the beginning a borrower's surname, first name, or other
name.
-C<&SearchBorrower> returns a two-element list. C<$borrowers> is a
+C<&SearchMember> returns a two-element list. C<$borrowers> is a
reference-to-array; each element is a reference-to-hash, whose keys
are the fields of the C<borrowers> table in the Koha database.
C<$count> is the number of elements in C<$borrowers>.
#'
#used by member enquiries from the intranet
#called by member.pl
-sub SearchBorrower {
+sub SearchMember {
my ($searchstring, $orderby, $type,$category_type ) = @_;
my $dbh = C4::Context->dbh;
my $query = "";
return undef;
}
my $borrower = $sth->fetchrow_hashref;
- my ($amount) = GetBorrowerAcctRecord( $borrowernumber);
+ my ($amount) = GetMemberAccountRecords( $borrowernumber);
$borrower->{'amountoutstanding'} = $amount;
- my $flags = patronflags( $borrower, $dbh );
+ my $flags = patronflags( $borrower);
my $accessflagshash;
$sth = $dbh->prepare("select bit,flag from userflags");
NOTE!: If you change this function, be sure to update the POD for
&GetMemberDetails.
- $flags = &patronflags($patron, $dbh);
+ $flags = &patronflags($patron);
$flags->{CHARGES}
{message} Message showing patron's credit or debt
my %flags;
my ( $patroninformation) = @_;
my $dbh=C4::Context->dbh;
- my ($amount) = GetBorrowerAcctRecord( $patroninformation->{'borrowernumber'});
+ my ($amount) = GetMemberAccountRecords( $patroninformation->{'borrowernumber'});
if ( $amount > 0 ) {
my %flaginfo;
my $noissuescharge = C4::Context->preference("noissuescharge");
}
}
-=item GetBorrowerIssuesAndFines
+=item GetMemberIssuesAndFines
- ($borrowed, $due, $fine) = &GetBorrowerIssuesAndFines($borrowernumber);
+ ($borrowed, $due, $fine) = &GetMemberIssuesAndFines($borrowernumber);
Returns aggregate data about items borrowed by the patron with the
given borrowernumber.
-C<&GetBorrowerIssuesAndFines> returns a three-element array. C<$borrowed> is the
+C<&GetMemberIssuesAndFines> returns a three-element array. C<$borrowed> is the
number of books the patron currently has borrowed. C<$due> is the
number of overdue items the patron currently has borrowed. C<$fine> is
the total fine currently due by the borrower.
=cut
#'
-sub GetBorrowerIssuesAndFines {
+sub GetMemberIssuesAndFines {
my ( $borrowernumber ) = @_;
my $dbh = C4::Context->dbh;
my $query =
}
-=head2 GetBorrowerAcctRecord
+=head2 GetMemberAccountRecords
- ($total, $acctlines, $count) = &GetBorrowerAcctRecord($borrowernumber);
+ ($total, $acctlines, $count) = &GetMemberAccountRecords($borrowernumber);
Looks up accounting data for the patron with the given borrowernumber.
-C<&GetBorrowerAcctRecord> returns a three-element array. C<$acctlines> is a
+C<&GetMemberAccountRecords> returns a three-element array. C<$acctlines> is a
reference-to-array, where each element is a reference-to-hash; the
keys are the fields of the C<accountlines> table in the Koha database.
C<$count> is the number of elements in C<$acctlines>. C<$total> is the
=cut
#'
-sub GetBorrowerAcctRecord {
+sub GetMemberAccountRecords {
my ($borrowernumber,$date) = @_;
my $dbh = C4::Context->dbh;
my @acctlines;
} # sub add_member_orgs
-=head2 GetBorrowersFromSurname
+=head2 GetMembersFromSurname
=over 4
-\@resutlts = GetBorrowersFromSurname($surname)
+\@resutlts = GetMembersFromSurname($surname)
this function get the list of borrower names like $surname.
return :
the table of results in @results
=cut
-sub GetBorrowersFromSurname {
+sub GetMembersFromSurname {
my ($searchstring) = @_;
my $dbh = C4::Context->dbh;
$searchstring =~ s/\'/\\\'/g;
-=head2 GetBorrowersTitles (OUEST-PROVENCE)
+=head2 GetTitles (OUEST-PROVENCE)
- ($borrowertitle)= &GetBorrowersTitles();
+ ($borrowertitle)= &GetTitles();
Looks up the different title . Returns array with all borrowers title
=cut
-sub GetBorrowersTitles {
+sub GetTitles {
my @borrowerTitle = split /,|\|/,C4::Context->preference('BorrowersTitles');
unshift( @borrowerTitle, "" );
return ( \@borrowerTitle);
my $message;
if ($findborrower) {
my ( $count, $borrowers ) =
- SearchBorrower($findborrower, 'cardnumber', 'web' );
+ SearchMember($findborrower, 'cardnumber', 'web' );
my @borrowers = @$borrowers;
if ( $#borrowers == -1 ) {
$query->param( 'findborrower', '' );
if ($borrowernumber) {
$borrower = GetMemberDetails( $borrowernumber, 0 );
- my ( $od, $issue, $fines ) = GetBorrowerIssuesAndFines( $borrowernumber );
+ my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
# Warningdate is the date that the warning starts appearing
my ( $today_year, $today_month, $today_day ) = Today();
}
# FIXME If the issue is confirmed, we launch another time borrdata2, now display the issue count after issue
- my ( $od, $issue, $fines ) = GetBorrowerIssuesAndFines( $borrowernumber );
+ my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
$template->param(
issuecount => $issue,
);
my $data=GetMember($borrowernumber,'borrowernumber');
#get account details
-my ($numaccts,$accts,$total)=GetBorrowerAcctRecord($borrowernumber);
+my ($numaccts,$accts,$total)=GetMemberAccountRecords($borrowernumber);
my $totalcredit;
if($total <= 0){
$totalcredit = 1;
if ($member ne ''){
if(length($member) == 1)
{
- ($count,$results)=SearchBorrower($member,$orderby,"simple",'A');
+ ($count,$results)=SearchMember($member,$orderby,"simple",'A');
}
else
{
- ($count,$results)=SearchBorrower($member,$orderby,"advanced",'A');
+ ($count,$results)=SearchMember($member,$orderby,"advanced",'A');
}
for (my $i=0; $i < $count; $i++){
#find out stats
- my ($od,$issue,$fines)=GetBorrowerIssuesAndFines($results->[$i]{'borrowerid'});
+ my ($od,$issue,$fines)=GetMemberIssuesAndFines($results->[$i]{'borrowerid'});
my $guarantorinfo=uc($results->[$i]{'surname'})." , ".ucfirst($results->[$i]{'firstname'});
my %row = (
background => $background,
if(length($member) == 1)
{
- ($count,$results)=SearchBorrower($member,$orderby,"simple");
+ ($count,$results)=SearchMember($member,$orderby,"simple");
}
else
{
- ($count,$results)=SearchBorrower($member,$orderby,"advanced");
+ ($count,$results)=SearchMember($member,$orderby,"advanced");
}
my $background = 0;
for (my $i=0; $i < $count; $i++){
#find out stats
- my ($od,$issue,$fines)=GetBorrowerIssuesAndFines($results->[$i]{'borrowernumber'});
+ my ($od,$issue,$fines)=GetMemberIssuesAndFines($results->[$i]{'borrowernumber'});
my %row = (
background => $background,
my $default_borrowertitle;
$default_borrowertitle=$data{'title'} ;
- my($borrowertitle)=GetBorrowersTitles();
+ my($borrowertitle)=GetTitles();
my $borrotitlepopup = CGI::popup_menu(-name=>'title',
-id => 'title',
-values=>$borrowertitle,
( ( GetBranchDetail( $data->{'branchcode'} ) )->{'branchname'} );
-my ( $total, $accts, $numaccts) = GetBorrowerAcctRecord( $borrowernumber );
+my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
my $lib1 = &GetSortDetails( "Bsort1", $data->{'sort1'} );
my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} );
( $template->param( lib1 => $lib1 ) ) if ($lib1);
recordpayment( $borrowernumber, $total );
}
- my ( $total, $accts, $numaccts) = GetBorrowerAcctRecord( $borrowernumber );
+ my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
# creation d'une fonction qui va nous retourner le notify_id dans un tableau
$template->param(BOOKDETAILS => \@bookdetails);
my %params;
%params->{'borrowernumber'} = $overdue->{'borrowernumber'};
- my ($total, $acctlines, $count) = &GetBorrowerAcctRecord($overdue->{'borrowernumber'});
+ my ($total, $acctlines, $count) = &GetMemberAccountRecords($overdue->{'borrowernumber'});
$template->param(FINES_TOTAL => $total_fines);
$template->param(OWING => $total);
my $name= "$borrower->{'firstname'} $borrower->{'surname'}";
$template->param( BORROWER_INFO => \@bordat );
#get account details
-my ( $total , $accts, $numaccts) = GetBorrowerAcctRecord( $borrowernumber );
+my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
for ( my $i = 0 ; $i < $numaccts ; $i++ ) {
$accts->[$i]{'date'} = format_date( $accts->[$i]{'date'} );
$issue->{'reserved'} = 1;
}
- my ( $total , $accts, $numaccts) = GetBorrowerAcctRecord( $borrowernumber );
+ my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
my $charges = 0;
foreach my $ac (@$accts) {
if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
if ($findborrower) {
my ( $count, $borrowers ) =
- SearchBorrower($findborrower, 'cardnumber', 'web' );
+ SearchMember($findborrower, 'cardnumber', 'web' );
my @borrowers = @$borrowers;
debug => 1,
});
-my ($count,$results)=GetBorrowersFromSurname($searchfield) if $searchfield;
+my ($count,$results)=GetMembersFromSurname($searchfield) if $searchfield;
my $toggle="0";
my @loop_data =();
for (my $i=0; $i < $count; $i++){
);
if ($searchstring) {
- my ( $count, $members ) = &SearchBorrower( '', $searchstring, "surname" );
+ my ( $count, $members ) = &SearchMember( '', $searchstring, "surname" );
$template->param(
subscriptionid => $subscriptionid,