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