|
Lines 27-33
use C4::Overdues qw(UpdateFine);
Link Here
|
| 27 |
use Koha::DateUtils; |
27 |
use Koha::DateUtils; |
| 28 |
use Koha::Database; |
28 |
use Koha::Database; |
| 29 |
|
29 |
|
| 30 |
use Test::More tests => 67; |
30 |
use Test::More tests => 69; |
| 31 |
|
31 |
|
| 32 |
BEGIN { |
32 |
BEGIN { |
| 33 |
use_ok('C4::Circulation'); |
33 |
use_ok('C4::Circulation'); |
|
Lines 685-689
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 685 |
is( $renewokay, 0, 'Bug 14337 - Verify the borrower can not renew with a hold on the record if AllowRenewalIfOtherItemsAvailable is enabled but the only available item is notforloan' ); |
685 |
is( $renewokay, 0, 'Bug 14337 - Verify the borrower can not renew with a hold on the record if AllowRenewalIfOtherItemsAvailable is enabled but the only available item is notforloan' ); |
| 686 |
} |
686 |
} |
| 687 |
|
687 |
|
|
|
688 |
{ |
| 689 |
# Don't allow renewing onsite checkout |
| 690 |
my $barcode = 'R00000XXX'; |
| 691 |
my $branch = 'CPL'; |
| 692 |
|
| 693 |
#Create another record |
| 694 |
my $biblio = MARC::Record->new(); |
| 695 |
$biblio->append_fields( |
| 696 |
MARC::Field->new('100', ' ', ' ', a => 'Anonymous'), |
| 697 |
MARC::Field->new('245', ' ', ' ', a => 'A title'), |
| 698 |
); |
| 699 |
my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); |
| 700 |
|
| 701 |
my (undef, undef, $itemnumber) = AddItem( |
| 702 |
{ |
| 703 |
homebranch => $branch, |
| 704 |
holdingbranch => $branch, |
| 705 |
barcode => $barcode, |
| 706 |
}, |
| 707 |
$biblionumber |
| 708 |
); |
| 709 |
|
| 710 |
my $borrowernumber = AddMember( |
| 711 |
firstname => 'fn', |
| 712 |
surname => 'dn', |
| 713 |
categorycode => 'S', |
| 714 |
branchcode => $branch, |
| 715 |
); |
| 716 |
|
| 717 |
my $borrower = GetMember( borrowernumber => $borrowernumber ); |
| 718 |
my $issue = AddIssue( $borrower, $barcode, undef, undef, undef, undef, { onsite_checkout => 1 } ); |
| 719 |
my ( $renewed, $error ) = CanBookBeRenewed( $borrowernumber, $itemnumber ); |
| 720 |
is( $renewed, 0, 'CanBookBeRenewed should not allow to renew on-site checkout' ); |
| 721 |
is( $error, 'onsite_checkout', 'A correct error code should be returned by CanBookBeRenewed for on-site checkout' ); |
| 722 |
} |
| 723 |
|
| 688 |
$schema->storage->txn_rollback(); |
724 |
$schema->storage->txn_rollback(); |
| 689 |
1; |
725 |
1; |
| 690 |
- |
|
|