honor SIP return date as the circ backdate
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 26 Sep 2010 23:20:12 +0000 (23:20 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 26 Sep 2010 23:20:12 +0000 (23:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18017 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkin.pm

index 66b09c6..fc7f450 100644 (file)
@@ -71,6 +71,13 @@ sub do_checkin {
 
     my $args = {barcode => $self->{item}->id};
 
+    if($return_date) {
+        # SIP date format is YYYYMMDD.  Translate to ISO8601
+        $return_date =~ s/(\d{4})(\d{2})(\d{2}).*/$1-$2-$3/;
+        syslog('LOG_INFO', "Checking in with backdate $return_date");
+        $args->{backdate} = $return_date;
+    }
+
     if($current_loc) { # SIP client specified a physical location
 
         my $org_id = (defined $org_sn_cache{$current_loc}) ?