View | Details | Raw Unified | Return to bug 8125
Collapse All | Expand All

(-)a/C4/SIP/ILS/Patron.pm (-4 / +19 lines)
Lines 53-65 sub new { Link Here
53
        $kp->{opacnote} .= 'PATRON EXPIRED';
53
        $kp->{opacnote} .= 'PATRON EXPIRED';
54
    }
54
    }
55
    my %ilspatron;
55
    my %ilspatron;
56
    my $adr     = $kp->{streetnumber} || '';
56
    my $adr     = _get_address($kp);
57
    my $address = $kp->{address}      || '';
58
    my $dob     = $kp->{dateofbirth};
57
    my $dob     = $kp->{dateofbirth};
59
    $dob and $dob =~ s/-//g;    # YYYYMMDD
58
    $dob and $dob =~ s/-//g;    # YYYYMMDD
60
    my $dexpiry     = $kp->{dateexpiry};
59
    my $dexpiry     = $kp->{dateexpiry};
61
    $dexpiry and $dexpiry =~ s/-//g;    # YYYYMMDD
60
    $dexpiry and $dexpiry =~ s/-//g;    # YYYYMMDD
62
    $adr .= ($adr && $address) ? " $address" : $address;
63
    my $fines_amount = $flags->{CHARGES}->{amount};
61
    my $fines_amount = $flags->{CHARGES}->{amount};
64
    $fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0;
62
    $fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0;
65
    {
63
    {
Lines 349-354 sub charge_denied { Link Here
349
    return "Please contact library staff";
347
    return "Please contact library staff";
350
}
348
}
351
349
350
sub _get_address {
351
    my $patron = shift;
352
353
    my $address = $patron->{streetnumber} || q{};
354
    for my $field (qw( roaddetails address address2 city state zipcode country))
355
    {
356
        next unless $patron->{$field};
357
        if ($address) {
358
            $address .= q{ };
359
            $address .= $patron->{$field};
360
        }
361
        else {
362
            $address .= $patron->{$field};
363
        }
364
    }
365
    return $address;
366
}
367
352
1;
368
1;
353
__END__
369
__END__
354
370
355
- 

Return to bug 8125