|
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 => 61; |
30 |
use Test::More tests => 63; |
| 31 |
|
31 |
|
| 32 |
BEGIN { |
32 |
BEGIN { |
| 33 |
use_ok('C4::Circulation'); |
33 |
use_ok('C4::Circulation'); |
|
Lines 594-599
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 594 |
is ( $count, 0, "Calling UpdateFine on non-existant fine with an amount of 0 does not result in an empty fine" ); |
594 |
is ( $count, 0, "Calling UpdateFine on non-existant fine with an amount of 0 does not result in an empty fine" ); |
| 595 |
} |
595 |
} |
| 596 |
|
596 |
|
|
|
597 |
{ |
| 598 |
# Don't allow renewing onsite checkout |
| 599 |
my $barcode = 'R00000XXX'; |
| 600 |
my $branch = 'CPL'; |
| 601 |
|
| 602 |
#Create another record |
| 603 |
my $biblio = MARC::Record->new(); |
| 604 |
$biblio->append_fields( |
| 605 |
MARC::Field->new('100', ' ', ' ', a => 'Anonymous'), |
| 606 |
MARC::Field->new('245', ' ', ' ', a => 'A title'), |
| 607 |
); |
| 608 |
my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); |
| 609 |
|
| 610 |
my (undef, undef, $itemnumber) = AddItem( |
| 611 |
{ |
| 612 |
homebranch => $branch, |
| 613 |
holdingbranch => $branch, |
| 614 |
barcode => $barcode, |
| 615 |
}, |
| 616 |
$biblionumber |
| 617 |
); |
| 618 |
|
| 619 |
my $borrowernumber = AddMember( |
| 620 |
firstname => 'fn', |
| 621 |
surname => 'dn', |
| 622 |
categorycode => 'S', |
| 623 |
branchcode => $branch, |
| 624 |
); |
| 625 |
|
| 626 |
my $borrower = GetMember( borrowernumber => $borrowernumber ); |
| 627 |
my $issue = AddIssue( $borrower, $barcode, undef, undef, undef, undef, { onsite_checkout => 1 } ); |
| 628 |
my ( $renewed, $error ) = CanBookBeRenewed( $borrowernumber, $itemnumber ); |
| 629 |
is( $renewed, 0, 'CanBookBeRenewed should not allow to renew on-site checkout' ); |
| 630 |
is( $error, 'onsite_checkout', 'A correct error code should be returned by CanBookBeRenewed for on-site checkout' ); |
| 631 |
} |
| 632 |
|
| 597 |
$dbh->rollback; |
633 |
$dbh->rollback; |
| 598 |
|
634 |
|
| 599 |
1; |
635 |
1; |
| 600 |
- |
|
|