Bug 2505 - Add commented use warnings where missing in the misc/ directory
[koha.git] / misc / migration_tools / fix_onloan.pl
1 #!/usr/bin/perl
2
3 use strict;
4 #use warnings; FIXME - Bug 2505
5 use  C4::Context;
6 use C4::Items;
7 use C4::Biblio;
8
9 #
10 # the items.onloan field did not exist in koha 2.2
11 # in koha 3.0, it's used to define item availability
12 # this script takes the items.onloan field
13 # and put it in the MARC::Record of the item
14 #
15
16 my $dbh=C4::Context->dbh;
17
18 # if (C4::Context->preference("marcflavour") ne "UNIMARC") {
19 #     print "this script is for UNIMARC only\n";
20 #     exit;
21 # }
22 my $rqbiblios=$dbh->prepare("SELECT biblionumber,itemnumber,onloan FROM items WHERE items.onloan IS NOT NULL");
23 $rqbiblios->execute;
24 $|=1;
25 while (my ($biblionumber,$itemnumber,$onloan)= $rqbiblios->fetchrow){
26     ModItem({onloan => "$onloan"}, $biblionumber, $itemnumber);
27     print "Onloan : $onloan for $biblionumber / $itemnumber\n";
28 }