Browse Source

Renewing a rental or pay item from the borrowers record screen

Now adds a charge to the borrowers account
3.0.x
rangi 23 years ago
parent
commit
f72283e23f
  1. 17
      C4/Circulation/Renewals2.pm

17
C4/Circulation/Renewals2.pm

@ -12,6 +12,9 @@ require Exporter;
use DBI;
use C4::Database;
use C4::Stats;
use C4::Accounts2;
use C4::Circulation::Circ2;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
@ -129,7 +132,21 @@ sub renewbook {
$sth->execute;
$sth->finish;
UpdateStats($env,$env->{'branchcode'},'renew','','',$itemno);
my ($charge,$type)=calc_charges($env, $itemno, $bornum);
if ($charge > 0){
my $accountno=getnextacctno($env,$bornum,$dbh);
my $item=getiteminformation($env, $itemno);
my $account="Insert into accountlines
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
values
('$bornum','$accountno',now(),$charge,'Renewal of Rental Item $item->{'title'} $item->{'barcode'}','Rent',$charge,'$itemno')";
$sth=$dbh->prepare($account);
$sth->execute;
$sth->finish;
# print $account;
}
$dbh->disconnect;
# return();
}

Loading…
Cancel
Save