HUGE COMMIT : code cleaning circulation.
[koha.git] / tools / inventory.pl
index 94983f6..b2120d8 100755 (executable)
@@ -23,7 +23,7 @@ use C4::Auth;
 use C4::Context;
 use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Circulation::Circ2;
+use C4::Biblio;
 use C4::Date;
 use C4::Koha;
 use C4::Branch; # GetBranches
@@ -61,9 +61,9 @@ for my $branch_hash (keys %$branches) {
                           branchname => $branches->{$branch_hash}->{'branchname'}, 
                           selected => ($branch_hash eq $branchcode?1:0)};      
 }
-$template->param(branchloop => \@branch_loop,);
-
-$template->param(minlocation => $minlocation,
+$template->param(branchloop => \@branch_loop,
+                DHTMLcalendar_dateformat => get_date_format_string_for_DHTMLcalendar(),
+                minlocation => $minlocation,
                 maxlocation => $maxlocation,
                 offset => $offset,
                 pagesize => $pagesize,
@@ -98,7 +98,7 @@ if ($uploadbarcodes && length($uploadbarcodes)>0){
                 $qonloan->execute($barcode);
                 if ($qonloan->rows){
                     my $data = $qonloan->fetchrow_hashref;
-                    my ($doreturn, $messages, $iteminformation, $borrower) =returnbook($barcode, $data->{homebranch});
+                    my ($doreturn, $messages, $iteminformation, $borrower) =AddReturn($barcode, $data->{homebranch});
                     if ($doreturn){push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_RET'=>1}}
                     else {push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_NOT_RET'=>1}}
                 }
@@ -117,12 +117,12 @@ if ($uploadbarcodes && length($uploadbarcodes)>0){
     if ($markseen) {
         foreach my $field ($input->param) {
             if ($field =~ /SEEN-(.*)/) {
-                &itemseen($1);
+                &ModDateLastSeen($1);
             }
         }
     }
     if ($op) {
-        my $res = C4::Circulation::Circ2::GetItemsForInventory($minlocation,$maxlocation,$datelastseen,$branchcode,$offset,$pagesize);
+        my $res = GetItemsForInventory($minlocation,$maxlocation,$datelastseen,$branchcode,$offset,$pagesize);
         $template->param(loop =>$res,
                         nextoffset => ($offset+$pagesize),
                         prevoffset => ($offset?$offset-$pagesize:0),