|
Lines 35-41
BEGIN {
Link Here
|
| 35 |
@ISA = qw(Exporter); |
35 |
@ISA = qw(Exporter); |
| 36 |
@EXPORT = qw( |
36 |
@EXPORT = qw( |
| 37 |
&recordpayment &makepayment &manualinvoice |
37 |
&recordpayment &makepayment &manualinvoice |
| 38 |
&getnextacctno &reconcileaccount &getcharges &getcredits |
38 |
&getnextacctno &reconcileaccount &getcharges &ModNote &getcredits |
| 39 |
&getrefunds &chargelostitem |
39 |
&getrefunds &chargelostitem |
| 40 |
&ReversePayment |
40 |
&ReversePayment |
| 41 |
); # removed &fixaccounts |
41 |
); # removed &fixaccounts |
|
Lines 327-333
sub chargelostitem{
Link Here
|
| 327 |
=head2 manualinvoice |
327 |
=head2 manualinvoice |
| 328 |
|
328 |
|
| 329 |
&manualinvoice($borrowernumber, $itemnumber, $description, $type, |
329 |
&manualinvoice($borrowernumber, $itemnumber, $description, $type, |
| 330 |
$amount, $user); |
330 |
$amount, $note); |
| 331 |
|
331 |
|
| 332 |
C<$borrowernumber> is the patron's borrower number. |
332 |
C<$borrowernumber> is the patron's borrower number. |
| 333 |
C<$description> is a description of the transaction. |
333 |
C<$description> is a description of the transaction. |
|
Lines 351-357
should be the empty string.
Link Here
|
| 351 |
# |
351 |
# |
| 352 |
|
352 |
|
| 353 |
sub manualinvoice { |
353 |
sub manualinvoice { |
| 354 |
my ( $borrowernumber, $itemnum, $desc, $type, $amount, $user ) = @_; |
354 |
my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note ) = @_; |
|
|
355 |
my $manager_id = C4::Context->userenv->{'number'}; |
| 355 |
my $dbh = C4::Context->dbh; |
356 |
my $dbh = C4::Context->dbh; |
| 356 |
my $notifyid = 0; |
357 |
my $notifyid = 0; |
| 357 |
my $insert; |
358 |
my $insert; |
|
Lines 403-418
sub manualinvoice {
Link Here
|
| 403 |
$desc .= " " . $itemnum; |
404 |
$desc .= " " . $itemnum; |
| 404 |
my $sth = $dbh->prepare( |
405 |
my $sth = $dbh->prepare( |
| 405 |
"INSERT INTO accountlines |
406 |
"INSERT INTO accountlines |
| 406 |
(borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id) |
407 |
(borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id, note, manager_id) |
| 407 |
VALUES (?, ?, now(), ?,?, ?,?,?,?)"); |
408 |
VALUES (?, ?, now(), ?,?, ?,?,?,?,?,?)"); |
| 408 |
$sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum,$notifyid) || return $sth->errstr; |
409 |
$sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum,$notifyid, $note, $manager_id) || return $sth->errstr; |
| 409 |
} else { |
410 |
} else { |
| 410 |
my $sth=$dbh->prepare("INSERT INTO accountlines |
411 |
my $sth=$dbh->prepare("INSERT INTO accountlines |
| 411 |
(borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding,notify_id) |
412 |
(borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding,notify_id, note, manager_id) |
| 412 |
VALUES (?, ?, now(), ?, ?, ?, ?,?)" |
413 |
VALUES (?, ?, now(), ?, ?, ?, ?,?,?,?)" |
| 413 |
); |
414 |
); |
| 414 |
$sth->execute( $borrowernumber, $accountno, $amount, $desc, $type, |
415 |
$sth->execute( $borrowernumber, $accountno, $amount, $desc, $type, |
| 415 |
$amountleft, $notifyid ); |
416 |
$amountleft, $notifyid, $note, $manager_id ); |
| 416 |
} |
417 |
} |
| 417 |
return 0; |
418 |
return 0; |
| 418 |
} |
419 |
} |
|
Lines 606-611
sub getcharges {
Link Here
|
| 606 |
return (@results); |
607 |
return (@results); |
| 607 |
} |
608 |
} |
| 608 |
|
609 |
|
|
|
610 |
sub ModNote { |
| 611 |
my ( $borrowernumber, $accountno, $note ) = @_; |
| 612 |
my $dbh = C4::Context->dbh; |
| 613 |
my $sth = $dbh->prepare('UPDATE accountlines SET note = ? WHERE borrowernumber = ? AND accountno = ?'); |
| 614 |
$sth->execute( $note, $borrowernumber, $accountno ); |
| 615 |
} |
| 609 |
|
616 |
|
| 610 |
sub getcredits { |
617 |
sub getcredits { |
| 611 |
my ( $date, $date2 ) = @_; |
618 |
my ( $date, $date2 ) = @_; |