View | Details | Raw Unified | Return to bug 13841
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-2 / +37 lines)
Lines 23-32 use C4::Branch; Link Here
23
use C4::Items;
23
use C4::Items;
24
use C4::Members;
24
use C4::Members;
25
use C4::Reserves;
25
use C4::Reserves;
26
use C4::Overdues qw(UpdateFine);
26
use Koha::DateUtils;
27
use Koha::DateUtils;
27
use Koha::Database;
28
use Koha::Database;
28
29
29
use Test::More tests => 59;
30
use Test::More tests => 60;
30
31
31
BEGIN {
32
BEGIN {
32
    use_ok('C4::Circulation');
33
    use_ok('C4::Circulation');
Lines 539-544 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
539
540
540
}
541
}
541
542
543
{
544
    my $barcode  = '1234567890';
545
    my $branch   = 'MPL';
546
547
    my $biblio = MARC::Record->new();
548
    my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, '');
549
550
    #Create third item
551
    my ( undef, undef, $itemnumber ) = AddItem(
552
        {
553
            homebranch       => $branch,
554
            holdingbranch    => $branch,
555
            barcode          => $barcode
556
        },
557
        $biblionumber
558
    );
559
560
    # Create a borrower
561
    my %a_borrower_data = (
562
        firstname =>  'Kyle',
563
        surname => 'Hall',
564
        categorycode => 'S',
565
        branchcode => $branch,
566
    );
567
568
    my $borrowernumber = AddMember(%a_borrower_data);
569
570
    UpdateFine( $itemnumber, $borrowernumber, 0 );
571
572
    my $hr = $dbh->selectrow_hashref(q{SELECT COUNT(*) AS count FROM accountlines WHERE borrowernumber = ? AND itemnumber = ?}, undef, $borrowernumber, $itemnumber );
573
    my $count = $hr->{count};
574
575
    is ( $count, 0, "Calling UpdateFine on non-existant fine with an amount of 0 does not result in an empty fine" );
576
}
577
542
$dbh->rollback;
578
$dbh->rollback;
543
579
544
1;
580
1;
545
- 

Return to bug 13841