Merge branch 'master' of /usr/local/git/koha_base.git/
authorJoshua Ferraro <jmf@liblime.com>
Wed, 8 Aug 2007 12:27:26 +0000 (07:27 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 8 Aug 2007 12:27:26 +0000 (07:27 -0500)
1  2 
C4/Accounts.pm
C4/Auth.pm
installer/kohastructure.sql
opac/opac-rss.pl

diff --cc C4/Accounts.pm
@@@ -303,76 -270,57 +303,70 @@@ should be the empty string
  
  #'
  # FIXME - Okay, so what does this function do, really?
 -sub manualinvoice{
 -  my ($borrowernumber,$itemnum,$desc,$type,$amount,$user)=@_;
 -  my $dbh = C4::Context->dbh;
 -  my $notifyid=0;
 -  my $insert;
 -  $itemnum=~ s/ //g;
 -  my $accountno=getnextacctno($borrowernumber);
 -  my $amountleft=$amount;
 -
 -  if ($type eq 'CS' || $type eq 'CB' || $type eq 'CW'
 -  || $type eq 'CF' || $type eq 'CL'){
 -    my $amount2=$amount*-1;     # FIXME - $amount2 = -$amount
 -    $amountleft=fixcredit($borrowernumber,$amount2,$itemnum,$type,$user);
 -  }
 -  if ($type eq 'N'){
 -    $desc.="New Card";
 -  }
 -  if ($type eq 'F'){
 -    $desc.="Fine";
 -  }
 -  if ($type eq 'A'){
 -    $desc.="Account Management fee";
 -  }
 -  if ($type eq 'M'){
 -    $desc.="Sundry";
 -  }     
 -        
 -  if ($type eq 'L' && $desc eq ''){
 -    
 -    $desc="Lost Item";
 -  }
 -  if ($type eq 'REF'){
 -    $desc.="Cash Refund";    
 -    $amountleft=refund('',$borrowernumber,$amount);
 -  }
 -  if(($type eq 'L') or ($type eq 'F') or ($type eq 'A') or ($type eq 'N') or ($type eq 'M') ){
 -  $notifyid=1;  
 -  }
 -    
 -  if ($itemnum ne ''){
 -    $desc.=" ".$itemnum;
 -    my $sth=$dbh->prepare("INSERT INTO  accountlines
 +sub manualinvoice {
 +    my ( $borrowernumber, $itemnum, $desc, $type, $amount, $user ) = @_;
 +    my $dbh      = C4::Context->dbh;
 +    my $notifyid = 0;
 +    my $insert;
 +    $itemnum =~ s/ //g;
 +    my $accountno  = getnextacctno($borrowernumber);
 +    my $amountleft = $amount;
 +
 +    if (   $type eq 'CS'
 +        || $type eq 'CB'
 +        || $type eq 'CW'
 +        || $type eq 'CF'
 +        || $type eq 'CL' )
 +    {
 +        my $amount2 = $amount * -1;    # FIXME - $amount2 = -$amount
 +        $amountleft =
 +          fixcredit( $borrowernumber, $amount2, $itemnum, $type, $user );
 +    }
 +    if ( $type eq 'N' ) {
 +        $desc .= "New Card";
 +    }
 +    if ( $type eq 'F' ) {
 +        $desc .= "Fine";
 +    }
 +    if ( $type eq 'A' ) {
 +        $desc .= "Account Management fee";
 +    }
 +    if ( $type eq 'M' ) {
 +        $desc .= "Sundry";
 +    }
 +
 +    if ( $type eq 'L' && $desc eq '' ) {
 +
 +        $desc = "Lost Item";
 +    }
 +    if ( $type eq 'REF' ) {
 +        $desc .= "Cash Refund";
 +        $amountleft = refund( '', $borrowernumber, $amount );
 +    }
 +    if (   ( $type eq 'L' )
 +        or ( $type eq 'F' )
 +        or ( $type eq 'A' )
 +        or ( $type eq 'N' )
 +        or ( $type eq 'M' ) )
 +    {
 +        $notifyid = 1;
 +    }
 +
 +    if ( $itemnum ne '' ) {
 +        $desc .= " " . $itemnum;
 +        my $sth = $dbh->prepare(
 +            "INSERT INTO  accountlines
                          (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id)
-         VALUES (?, ?, now(), ?,?, ?,?,?,?)"
-         );
- #     $sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $data->{'itemnumber'});
-         $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type,
-             $amountleft, $itemnum, $notifyid );
-     }
-     else {
-         my $sth = $dbh->prepare(
-             "INSERT INTO  accountlines
+         VALUES (?, ?, now(), ?,?, ?,?,?,?)");
+      $sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum,$notifyid) || return $sth->errstr;
+   } else {
+     my $sth=$dbh->prepare("INSERT INTO  accountlines
              (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding,notify_id)
 -            VALUES (?, ?, now(), ?, ?, ?, ?,?)");
 -    $sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft,$notifyid);
 -  }
 +            VALUES (?, ?, now(), ?, ?, ?, ?,?)"
 +        );
 +        $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type,
 +            $amountleft, $notifyid );
 +    }
  }
  
  =head2 fixcredit
diff --cc C4/Auth.pm
Simple merge
Simple merge
@@@ -154,9 -154,6 +154,5 @@@ if ($RDF_update_needed) 
      # save the rss feed.
      $rss->save("rss/$filename");
  }
- else {
--
-     #     warn "RDF CACHE used"
- }
  print $cgi->header( -type => "application/rss+xml" );
  print $rss->as_string;