adding item-level itypes: based on systempref: item-level_itypes, we use items.ccode...
authorRyan Higgins <rch@liblime.com>
Sun, 4 Nov 2007 22:24:10 +0000 (16:24 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 4 Nov 2007 22:37:53 +0000 (16:37 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Circulation.pm
circ/circulation.pl

index b9ee41b..523eef1 100644 (file)
@@ -376,9 +376,9 @@ sub TooMany {
     my $dbh             = C4::Context->dbh;
 
  my $branch_issuer = C4::Context->userenv->{'branchcode'};
-
+#TODO : specify issuer or borrower for circrule.
   my $type = (C4::Context->preference('item-level_itype')) 
-                       ? $item->{'itype'}         # item-level
+                       ? $item->{'ccode'}         # item-level
                        : $item->{'itemtype'};     # biblio-level
   
   my $sth =
@@ -395,7 +395,7 @@ sub TooMany {
                     AND i.itemnumber = s2.itemnumber 
                     AND s1.biblioitemnumber = s2.biblioitemnumber"
                                . (C4::Context->preference('item-level_itype'))
-                               ? " AND s2.itype=? "
+                               ? " AND s2.ccode=? "
                 : " AND s1.itemtype= ? ";
     my $sth2=  $dbh->prepare($query2);
     my $sth3 =
@@ -1621,7 +1621,7 @@ sub AddRenewal {
         my $borrower = GetMemberDetails( $borrowernumber, 0 );
                my $loanlength = GetLoanLength(
             $borrower->{'categorycode'},
-             (C4::Context->preference('item-level_itypes')) ? $biblio->{'itype'} : $biblio->{'itemtype'} ,
+             (C4::Context->preference('item-level_itypes')) ? $biblio->{'ccode'} : $biblio->{'itemtype'} ,
                        $borrower->{'branchcode'}
         );
                #FIXME --  choose issuer or borrower branch.
index 39f9c18..81ccf69 100755 (executable)
@@ -447,7 +447,7 @@ FROM issuingrules
   LEFT JOIN itemtypes ON (itemtypes.itemtype=issuingrules.itemtype)
   WHERE categorycode=?
 " );
-my @issued_itemtypes_count_loop;  # huh?
+#my @issued_itemtypes_count;  # huh?
 $issueqty_sth->execute("*");
 while ( my $data = $issueqty_sth->fetchrow_hashref() ) {