Lines 764-782
SELECT COUNT(*) FROM reserves WHERE biblionumber=? AND borrowernumber<>?
Link Here
|
764 |
my $dbh = C4::Context->dbh; |
764 |
my $dbh = C4::Context->dbh; |
765 |
my ( $fee ) = $dbh->selectrow_array( $borquery, undef, ($borrowernumber) ); |
765 |
my ( $fee ) = $dbh->selectrow_array( $borquery, undef, ($borrowernumber) ); |
766 |
my $hold_fee_mode = C4::Context->preference('HoldFeeMode') || 'not_always'; |
766 |
my $hold_fee_mode = C4::Context->preference('HoldFeeMode') || 'not_always'; |
767 |
if( $fee and $fee > 0 and $hold_fee_mode eq 'not_always' ) { |
767 |
if( $fee and $fee > 0 and ( $hold_fee_mode eq 'not_always' or $hold_fee_mode eq 'issued_or_reserved' ) ) { |
768 |
# This is a reconstruction of the old code: |
768 |
# This is a reconstruction of the old code: |
769 |
# Compare number of items with items issued, and optionally check holds |
769 |
# Compare number of items with items issued, and optionally check holds |
770 |
# If not all items are issued and there are no holds: charge no fee |
770 |
# not_always = If not all items are issued and there are no holds: charge no fee |
|
|
771 |
# issued_or_reserved = If all items are issued, OR there are holds: charge fee |
771 |
# NOTE: Lost, damaged, not-for-loan, etc. are just ignored here |
772 |
# NOTE: Lost, damaged, not-for-loan, etc. are just ignored here |
772 |
my ( $notissued, $reserved ); |
773 |
my ( $notissued, $reserved ); |
773 |
( $notissued ) = $dbh->selectrow_array( $issue_qry, undef, |
774 |
( $notissued ) = $dbh->selectrow_array( $issue_qry, undef, |
774 |
( $biblionumber ) ); |
775 |
( $biblionumber ) ); |
775 |
if( $notissued == 0 ) { |
776 |
if( $notissued == 0 or $hold_fee_mode eq 'issued_or_reserved' ) { |
776 |
# all items are issued |
777 |
# all items are issued |
777 |
( $reserved ) = $dbh->selectrow_array( $holds_qry, undef, |
778 |
( $reserved ) = $dbh->selectrow_array( $holds_qry, undef, |
778 |
( $biblionumber, $borrowernumber ) ); |
779 |
( $biblionumber, $borrowernumber ) ); |
779 |
$fee = 0 if $reserved == 0; |
780 |
if ( $reserved == 0 and $hold_fee_mode eq 'not_always' ) { |
|
|
781 |
# no reserves are placed |
782 |
$fee = 0; |
783 |
} |
780 |
} else { |
784 |
} else { |
781 |
$fee = 0; |
785 |
$fee = 0; |
782 |
} |
786 |
} |