(bug #4084) fix offline circ
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Mon, 1 Feb 2010 11:31:35 +0000 (12:31 +0100)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 29 Sep 2010 22:17:36 +0000 (18:17 -0400)
this add the function C4::Circulation::GetOpenIssue and delete \r chars when processing koc files.

Cherry picked from 3.0.x commit 5af80ab

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

C4/Circulation.pm
offline_circ/process_koc.pl

index 034a8d6..644ab27 100644 (file)
@@ -69,7 +69,6 @@ BEGIN {
                &AddRenewal
                &GetRenewCount
                &GetItemIssue
-                &GetOpenIssue
                &GetItemIssues
                &GetBorrowerIssues
                &GetIssuingCharges
@@ -77,6 +76,7 @@ BEGIN {
         &GetBranchBorrowerCircRule
         &GetBranchItemRule
                &GetBiblioIssues
+               &GetOpenIssue
                &AnonymiseIssueHistory
        );
 
@@ -904,7 +904,6 @@ sub AddIssue {
     my ( $borrower, $barcode, $datedue, $cancelreserve, $issuedate, $sipmode) = @_;
     my $dbh = C4::Context->dbh;
        my $barcodecheck=CheckValidBarcode($barcode);
-
     # $issuedate defaults to today.
     if ( ! defined $issuedate ) {
         $issuedate = strftime( "%Y-%m-%d", localtime );
index a187722..5655f0c 100755 (executable)
@@ -189,7 +189,8 @@ sub parse_header_line {
 sub parse_command_line {
     my $command_line = shift;
     chomp($command_line);
-
+    $command_line =~ s/\r//g;
+    
     my ( $timestamp, $command, @args ) = split( /\t/, $command_line );
     my ( $date,      $time,    $id )   = split( /\s/, $timestamp );
 
@@ -248,11 +249,11 @@ sub kocIssueItem {
   my ( $year, $month, $day ) = split( /-/, $circ->{'date'} );
   ( $year, $month, $day ) = Add_Delta_Days( $year, $month, $day, $issuelength );
   my $date_due = sprintf("%04d-%02d-%02d", $year, $month, $day);
-  
+
   if ( $issue->{ 'date_due' } ) { ## Item is currently checked out to another person.
 #warn "Item Currently Issued.";
     my $issue = GetOpenIssue( $item->{'itemnumber'} );
-
+    
     if ( $issue->{'borrowernumber'} eq $borrower->{'borrowernumber'} ) { ## Issued to this person already, renew it.
 #warn "Item issued to this member already, renewing.";