Lines 572-578
ok( !C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed()
Link Here
|
572 |
# Tests for bug 14464 |
572 |
# Tests for bug 14464 |
573 |
|
573 |
|
574 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
574 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
575 |
my ( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ); |
575 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
|
|
576 |
my $bz14464_fines = $patron->get_account_lines->get_balance; |
576 |
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' ); |
577 |
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' ); |
577 |
|
578 |
|
578 |
# First, test cancelling a reserve when there's no charge configured. |
579 |
# First, test cancelling a reserve when there's no charge configured. |
Lines 599-605
CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 });
Link Here
|
599 |
my $old_reserve = Koha::Database->new()->schema()->resultset('OldReserve')->find( $bz14464_reserve ); |
600 |
my $old_reserve = Koha::Database->new()->schema()->resultset('OldReserve')->find( $bz14464_reserve ); |
600 |
is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from reserve'); |
601 |
is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from reserve'); |
601 |
|
602 |
|
602 |
( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ); |
603 |
$bz14464_fines = $patron->get_account_lines->get_balance; |
603 |
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' ); |
604 |
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' ); |
604 |
|
605 |
|
605 |
# Then, test cancelling a reserve when there's no charge desired. |
606 |
# Then, test cancelling a reserve when there's no charge desired. |
Lines 623-629
ok( $bz14464_reserve, 'Bug 14464 - 2nd reserve correctly created' );
Link Here
|
623 |
|
624 |
|
624 |
CancelReserve({ reserve_id => $bz14464_reserve }); |
625 |
CancelReserve({ reserve_id => $bz14464_reserve }); |
625 |
|
626 |
|
626 |
( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ); |
627 |
$bz14464_fines = $patron->get_account_lines->get_balance; |
627 |
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' ); |
628 |
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' ); |
628 |
|
629 |
|
629 |
# Finally, test cancelling a reserve when there's a charge desired and configured. |
630 |
# Finally, test cancelling a reserve when there's a charge desired and configured. |
Lines 645-651
ok( $bz14464_reserve, 'Bug 14464 - 1st reserve correctly created' );
Link Here
|
645 |
|
646 |
|
646 |
CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 }); |
647 |
CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 }); |
647 |
|
648 |
|
648 |
( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ); |
649 |
$bz14464_fines = $patron->get_account_lines->get_balance; |
649 |
is( int( $bz14464_fines ), 42, 'Bug 14464 - Fine applied after cancelling reserve with charge desired and configured' ); |
650 |
is( int( $bz14464_fines ), 42, 'Bug 14464 - Fine applied after cancelling reserve with charge desired and configured' ); |
650 |
|
651 |
|
651 |
# tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526) |
652 |
# tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526) |