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