From a10625fe9153fb520cff9dff87924155972402e0 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Fri, 29 Jan 2010 20:25:22 +0100 Subject: [PATCH] SIP Patron management Using Flag EXPIRED to notice whether Patron CAN or CANNOT checkout a book Signed-off-by: Henri-Damien LAURENT --- C4/SIP/ILS/Patron.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm index d3f6de8d16..80c81a647b 100644 --- a/C4/SIP/ILS/Patron.pm +++ b/C4/SIP/ILS/Patron.pm @@ -55,6 +55,8 @@ sub new { my $address = $kp->{address} || ''; my $dob = $kp->{dateofbirth}; $dob and $dob =~ s/-//g; # YYYYMMDD + my $dexpiry = $kp->{dateexpiry}; + $dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD $adr .= ($adr && $address) ? " $address" : $address; my $fines_amount = $flags->{CHARGES}->{amount}; $fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0; @@ -66,6 +68,8 @@ sub new { id => $kp->{cardnumber}, # to SIP, the id is the BARCODE, not userid password => $pw, ptype => $kp->{categorycode}, # 'A'dult. Whatever. + dateexpiry => $dexpiry, + dateexpiry_iso => $kp->{dateexpiry}, birthdate => $dob, birthdate_iso => $kp->{dateofbirth}, branchcode => $kp->{branchcode}, @@ -96,7 +100,7 @@ sub new { ); } $debug and warn "patron fines: $ilspatron{fines} ... amountoutstanding: $kp->{amountoutstanding} ... CHARGES->amount: $flags->{CHARGES}->{amount}"; - for (qw(CHARGES CREDITS GNA LOST DBARRED NOTES)) { + for (qw(EXPIRED CHARGES CREDITS GNA LOST DEBARRED NOTES)) { ($flags->{$_}) or next; $ilspatron{screen_msg} .= ($flags->{$_}->{message} || '') ; if ($flags->{$_}->{noissues}) { @@ -129,6 +133,8 @@ my %fields = ( home_phone => 0, birthdate => 0, birthdate_iso => 0, + dateexpiry => 0, + dateexpiry_iso => 0, ptype => 0, charge_ok => 0, # for patron_status[0] (inverted) renew_ok => 0, # for patron_status[1] (inverted) -- 2.39.5