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

(-)a/Koha/Account/Line.pm (+1 lines)
Lines 26-31 use Koha::Account::Offsets; Link Here
26
use Koha::Database;
26
use Koha::Database;
27
use Koha::Exceptions::Account;
27
use Koha::Exceptions::Account;
28
use Koha::Items;
28
use Koha::Items;
29
use Koha::Checkouts;
29
30
30
use base qw(Koha::Object);
31
use base qw(Koha::Object);
31
32
(-)a/Koha/Old/Checkout.pm (-1 / +1 lines)
Lines 19-25 use Modern::Perl; Link Here
19
19
20
use Koha::Database;
20
use Koha::Database;
21
21
22
use base qw(Koha::Object);
22
use base qw(Koha::Checkout);
23
23
24
=head1 NAME
24
=head1 NAME
25
25
(-)a/Koha/Old/Checkouts.pm (-1 / +1 lines)
Lines 20-26 use Modern::Perl; Link Here
20
use Koha::Database;
20
use Koha::Database;
21
use Koha::Old::Checkout;
21
use Koha::Old::Checkout;
22
22
23
use base qw(Koha::Objects);
23
use base qw(Koha::Checkouts);
24
24
25
sub _type {
25
sub _type {
26
    return 'OldIssue';
26
    return 'OldIssue';
(-)a/Koha/Schema/Result/OldIssue.pm (+10 lines)
Lines 233-238 __PACKAGE__->belongs_to( Link Here
233
  },
233
  },
234
);
234
);
235
235
236
__PACKAGE__->belongs_to(
237
  "branch",
238
  "Koha::Schema::Result::Branch",
239
  { branchcode => "branchcode" },
240
  {
241
    is_deferrable => 1,
242
    join_type     => "LEFT",
243
  },
244
);
245
236
246
237
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-10 19:55:44
247
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-10 19:55:44
238
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E2N2paWcCHg916100ry+2A
248
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E2N2paWcCHg916100ry+2A
(-)a/t/db_dependent/Koha/Account/Lines.t (-2 / +45 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 8;
22
use Test::More tests => 9;
23
use Test::Exception;
23
use Test::Exception;
24
24
25
use C4::Circulation qw/AddIssue AddReturn/;
25
use C4::Circulation qw/AddIssue AddReturn/;
Lines 561-564 subtest "void() tests" => sub { Link Here
561
    $schema->storage->txn_rollback;
561
    $schema->storage->txn_rollback;
562
};
562
};
563
563
564
subtest 'checkout' => sub {
565
    plan tests => 1;
566
567
    $schema->storage->txn_begin;
568
569
    my $library    = $builder->build( { source => 'Branch' } );
570
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
571
    my $patron     = $builder->build( { source => 'Borrower' } );
572
    my $item       = Koha::Item->new(
573
        {
574
            biblionumber     => $biblioitem->{biblionumber},
575
            biblioitemnumber => $biblioitem->{biblioitemnumber},
576
            homebranch       => $library->{branchcode},
577
            holdingbranch    => $library->{branchcode},
578
            barcode          => 'some_barcode_13',
579
            itype            => 'BK',
580
        }
581
    )->store;
582
583
    my $checkout = Koha::Checkout->new(
584
        {
585
            borrowernumber => $patron->{borrowernumber},
586
            itemnumber     => $item->itemnumber,
587
            branchcode     => $library->{branchcode},
588
        }
589
    )->store;
590
591
    my $line = Koha::Account::Line->new(
592
        {
593
            borrowernumber => $patron->{borrowernumber},
594
            itemnumber     => $item->itemnumber,
595
            issue_id       => $checkout->id,
596
            accounttype    => "F",
597
            amount         => 10,
598
            interface      => 'commandline',
599
        }
600
    )->store;
601
602
    is( $line->checkout->id, $checkout->id,
603
        'Koha::Account::Line->checkout should return the correct checkout' );
604
605
    $schema->storage->txn_rollback;
606
};
607
564
1;
608
1;
565
- 

Return to bug 15985