|
Lines 661-681
sub GetFine {
Link Here
|
| 661 |
|
661 |
|
| 662 |
=head2 GetItemCharges |
662 |
=head2 GetItemCharges |
| 663 |
|
663 |
|
| 664 |
$charges = GetItemCharges( $borrowernumber, $itemnumber ) |
664 |
$charges = GetItemCharges( $itemnumber , $borrowernumber) |
| 665 |
Gets fines and issue charge for item from accountlines. Icluding all outstanding amount for specific item, |
665 |
Gets fines and issue charge for item from accountlines. Icluding all outstanding amount for specific item, |
| 666 |
also from previous issue of this item. |
666 |
also from previous issue of this item. |
| 667 |
|
667 |
|
| 668 |
=cut |
668 |
=cut |
| 669 |
|
669 |
|
| 670 |
sub GetItemCharges { |
670 |
sub GetItemCharges { |
| 671 |
my ( $borrowernumber, $itemnumber ) = @_; |
671 |
my ( $itemnumber, $borrowernumber ) = @_; |
| 672 |
|
|
|
| 673 |
my $dbh = C4::Context->dbh(); |
672 |
my $dbh = C4::Context->dbh(); |
| 674 |
|
673 |
|
| 675 |
my $query = "SELECT SUM(amountoutstanding) FROM accountlines WHERE borrowernumber = ? AND itemnumber = ? "; |
674 |
my $query = "SELECT SUM(amountoutstanding) FROM accountlines WHERE borrowernumber = ? AND itemnumber = ? "; |
| 676 |
my $sth = $dbh->prepare( $query ); |
675 |
my $sth = $dbh->prepare( $query ); |
| 677 |
$sth->execute( $borrowernumber, $itemnumber ); |
676 |
$sth->execute( $borrowernumber, $itemnumber ); |
| 678 |
return $sth->fetchrow_arrayref()->[0]; |
677 |
return $sth->fetchrow_arrayref()->[0] || 0; |
| 679 |
} |
678 |
} |
| 680 |
|
679 |
|
| 681 |
=head2 NumberNotifyId |
680 |
=head2 NumberNotifyId |