my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE accountlines_id=?");
$sth->execute( $accountlines_id );
my $data = $sth->fetchrow_hashref;
- $sth->finish;
my $payment;
if ( $data->{'accounttype'} eq "Pay" ){
"
);
$udp->execute($accountlines_id);
- $udp->finish;
}else{
my $udp =
$dbh->prepare(
"
);
$udp->execute($accountlines_id);
- $udp->finish;
# create new line
my $payment = 0 - $amount;
VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?, ?)"
);
$ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note);
- $ins->finish;
}
if ( C4::Context->preference("FinesLog") ) {
my $sthr = $dbh->prepare("SELECT max(accountlines_id) AS lastinsertid FROM accountlines");
$sthr->execute();
my $datalastinsertid = $sthr->fetchrow_hashref;
- $sthr->finish;
return $datalastinsertid->{'lastinsertid'};
}
VALUES (?,?,now(),?,?,'L',?,?,?)");
$sth2->execute($borrowernumber,$accountno,$amount,
$description,$amount,$itemnumber,$manager_id);
- $sth2->finish;
if ( C4::Context->preference("FinesLog") ) {
logaction("FINES", 'CREATE', $borrowernumber, Dumper({
my $sth = $dbh->prepare($query);
$sth->execute( $borrowernumber, $item->{'itemnumber'} );
$accdata = $sth->fetchrow_hashref;
- $sth->finish;
if ( $accdata->{'amountoutstanding'} < $amountleft ) {
$newamtos = 0;
$amountleft -= $accdata->{'amountoutstanding'};
WHERE (accountlines_id = ?)"
);
$usth->execute( $newamtos, $thisacct );
- $usth->finish;
$usth = $dbh->prepare(
"INSERT INTO accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
);
$usth->execute( $borrowernumber, $accdata->{'accountno'},
$nextaccntno, $newamtos );
- $usth->finish;
}
# begin transaction
WHERE (accountlines_id = ?)"
);
$usth->execute( $newamtos, $thisacct );
- $usth->finish;
$usth = $dbh->prepare(
"INSERT INTO accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
);
$usth->execute( $borrowernumber, $accdata->{'accountno'},
$nextaccntno, $newamtos );
- $usth->finish;
}
- $sth->finish;
$type = "Credit " . $type;
UpdateStats( $user, $type, $data, $user, '', '', $borrowernumber );
$amountleft *= -1;
WHERE (accountlines_id = ?)"
);
$usth->execute( $newamtos, $thisacct );
- $usth->finish;
$usth = $dbh->prepare(
"INSERT INTO accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
);
$usth->execute( $borrowernumber, $accdata->{'accountno'},
$nextaccntno, $newamtos );
- $usth->finish;
}
- $sth->finish;
return ($amountleft);
}