#!/usr/bin/perl #script to do a borrower enquiery/brin up borrower details etc #written 20/12/99 by chris@katipo.co.nz #Displays all the detailas about a borrower #needs html removed and to use the C4::Output more, but its tricky #last modified 21/1/2000 by chris@katipo.co.nz #modifiecd 31/1/2001 by chris@katipo.co.nz to not allow items on request #to be renewed use strict; use C4::Output; use CGI; use C4::Search; use Date::Manip; use C4::Reserves2; use C4::Circulation::Renewals2; use C4::Circulation::Circ2; my $input = new CGI; my $bornum=$input->param('bornum'); my %env; print $input->header; #start the page and read in includes print startpage(); print startmenu('member'); my $data=borrdata('',$bornum); my @temp=split('-',$data->{'dateenrolled'}); $data->{'dateenrolled'}="$temp[2]/$temp[1]/$temp[0]"; @temp=split('-',$data->{'expiry'}); $data->{'expiry'}="$temp[2]/$temp[1]/$temp[0]"; @temp=split('-',$data->{'dateofbirth'}); $data->{'dateofbirth'}="$temp[2]/$temp[1]/$temp[0]"; if ($data->{'ethnicity'} eq 'maori'){ $data->{'ethnicity'} = 'Maori'; } if ($data->{'ethnicity'}eq 'european'){ $data->{'ethnicity'} = 'European/Pakeha'; } if ($data->{'ethnicity'}eq 'pi'){ $data->{'ethnicity'} = 'Pacific Islander'; } if ($data->{'ethnicity'}eq 'asian'){ $data->{'ethnicity'} = 'Asian'; } print <$data->{'firstname'} $data->{'surname'}

MEMBERSHIP RECORD

{'borrowernumber'}>


$data->{'title'} $data->{'othernames'} $data->{'surname'} ($data->{'firstname'}, $data->{'initials'})

Card Number: $data->{'cardnumber'}
Postal Address: $data->{'streetaddress'}, $data->{'city'}
Home Address: $data->{'physstreet'}, $data->{'streetcity'}
Phone (Home): $data->{'phone'}
Phone (Daytime): $data->{'phoneday'}
Fax: $data->{'faxnumber'}
E-mail: $data->{'emailaddress'}

Membership Number: $data->{'borrowernumber'}
Membership: $data->{'categorycode'}
Area: $data->{'area'}
Fee:$30/year, Paid
Joined: $data->{'dateenrolled'}, Expires: $data->{'expiry'}
Joining Branch: $data->{'homebranch'}

Ethnicity: $data->{'ethnicity'}, $data->{'ethnotes'}
DoB: $data->{'dateofbirth'}
Sex: $data->{'sex'}

Alternative Contact:$data->{'contactname'}
Phone: $data->{'altphone'}
Relationship: $data->{'altrelationship'}
Notes: $data->{'altnotes'}

Guarantees: printend ; my ($count,$guarantees)=findguarantees($data->{'borrowernumber'}); for (my $i=0;$i<$count;$i++){ print "[$i]->{'borrowernumber'}\">$guarantees->[$i]->{'cardnumber'}
"; } print < General Notes: $data->{'borrowernotes'}

printend ; my %bor; $bor{'borrowernumber'}=$bornum; my ($numaccts,$accts,$total)=getboracctrecord('',\%bor); #if ($numaccts > 10){ # $numaccts=10; #} for (my$i=0;$i<$numaccts;$i++){ #if ($accts->[$i]{'accounttype'} ne 'Pay'){ my $amount= $accts->[$i]{'amount'} + 0.00; my $amount2= $accts->[$i]{'amountoutstanding'} + 0.00; if ($amount2 > 0){ print ""; my $item="   "; @temp=split('-',$accts->[$i]{'date'}); $accts->[$i]{'date'}="$temp[2]/$temp[1]/$temp[0]"; if ($accts->[$i]{'accounttype'} ne 'Res'){ #get item data #$item= } print ""; # print ""; print ""; } } print <
FINES & CHARGES
$accts->[$i]{'date'}$accts->[$i]{'accounttype'}"; my $env; if ($accts->[$i]{'accounttype'} ne 'Res'){ my $iteminfo=C4::Circulation::Circ2::getiteminformation($env,$accts->[$i]->{'itemnumber'},''); print "[$i]->{'itemnumber'}&bib=$iteminfo->{'biblionumber'}&bi=$iteminfo->{'biblioitemnumber'}>$accts->[$i]->{'description'} $accts->[$i]{'title'}"; } print " $amount$amount2

printend ; my ($count,$issue)=borrissues($bornum); my $today=ParseDate('today'); for (my $i=0;$i<$count;$i++){ print ""; #find the charge for an item my ($charge,$itemtype)=calc_charges(\%env,$issue->[$i]{'itemnumber'},$bornum); print ""; print ""; # if ($datedue < $today){ # print ""; # } else { # print ""; # } #check item is not reserved my ($rescount,$reserves)=FindReserves($issue->[$i]{'biblionumber'},''); if ($rescount >0){ print ""; } elsif ($issue->[$i]->{'renewals'} > 0) { print ""; } else { print " "; } } print <
ITEMS CURRENTLY ON ISSUE
Title Due Itemtype Charge Renew
"; my $datedue=ParseDate($issue->[$i]{'date_due'}); @temp=split('-',$issue->[$i]{'date_due'}); $issue->[$i]{'date_due'}="$temp[2]/$temp[1]/$temp[0]"; if ($datedue < $today){ print ""; } print "$issue->[$i]{'title'} [$i]->{'itemnumber'}&bib=$issue->[$i]->{'biblionumber'}&bi=$issue->[$i]->{'biblioitemnumber'}> $issue->[$i]{'barcode'} $issue->[$i]{'date_due'}$itemtype$chargeOverdue   [$i]{'biblionumber'}>On Request - no renewals
Previously Renewed - no renewals
"; print "[$i]{'itemnumber'}\" value=y>Y [$i]{'itemnumber'}\" value=n>N

printend ; my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2 for (my $i=0;$i<$rescount;$i++){ @temp=split('-',$reserves->[$i]{'reservedate'}); $reserves->[$i]{'reservedate'}="$temp[2]/$temp[1]/$temp[0]"; print "[$i]{'biblionumber'}> "; } print <
ITEMS REQUESTED
Title Requested Charge Remove
[$i]{'biblionumber'}\">$reserves->[$i]{'title'} $reserves->[$i]{'reservedate'}

printend ; print endmenu('member'); print endpage();