#!/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 use strict; use C4::Output; use CGI; use C4::Search; use Date::Manip; use C4::Reserves2; use C4::Circulation::Renewals2; 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->{'othernames'} $data->{'surname'}

MEMBERSHIP RECORD


$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:

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; 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'}$accts->[$i]{'description'} $accts->[$i]{'title'} $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=calc_charges(\%env,$issue->[$i]{'itemnumber'},$bornum); print ""; if ($datedue < $today){ print ""; } else { print ""; } #check item is not reserved my ($rescount,$reserves)=FindReserves($issue->[$i]{'biblionumber'},''); if ($rescount >0){ print " "; } print <
ITEMS CURRENTLY ON ISSUE
Title Due Charge Status 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'} $issue->[$i]{'date_due'}$chargeOverdue   On Request"; } else { print ""; } 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();