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

(-)a/Koha/Patron.pm (+12 lines)
Lines 1131-1136 sub old_holds { Link Here
1131
    return Koha::Old::Holds->_new_from_dbic($old_holds_rs);
1131
    return Koha::Old::Holds->_new_from_dbic($old_holds_rs);
1132
}
1132
}
1133
1133
1134
=head3 return_claims
1135
1136
my $return_claims = $patron->return_claims
1137
1138
=cut
1139
1140
sub return_claims {
1141
    my ($self) = @_;
1142
    my $return_claims = $self->_result->return_claims_borrowernumbers;
1143
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $return_claims );
1144
}
1145
1134
=head3 notice_email_address
1146
=head3 notice_email_address
1135
1147
1136
  my $email = $patron->notice_email_address;
1148
  my $email = $patron->notice_email_address;
(-)a/t/db_dependent/Circulation/ReturnClaims.t (-2 / +41 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 1;
20
use Test::More tests => 2;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 93-96 subtest 'Test Koha::Checkout::claim_returned' => sub { Link Here
93
    ok( $claim->created_on, "Claim created_on is set" );
93
    ok( $claim->created_on, "Claim created_on is set" );
94
};
94
};
95
95
96
subtest 'Test Koha::Patronn::return_claims' => sub {
97
    plan tests => 7;
98
99
    t::lib::Mocks::mock_preference( 'ClaimReturnedLostValue', 1 );
100
    my $biblio = $builder->build_object( { class => 'Koha::Biblios' } );
101
    my $item   = $builder->build_object(
102
        {
103
            class => 'Koha::Items',
104
            value => {
105
                biblionumber => $biblio->biblionumber,
106
                notforloan   => 0,
107
                itemlost     => 0,
108
                withdrawn    => 0,
109
            }
110
        }
111
    );
112
    my $patron   = $builder->build_object( { class => 'Koha::Patrons' } );
113
    my $checkout = AddIssue( $patron->unblessed, $item->barcode );
114
115
    $checkout->claim_returned(
116
        {
117
            created_by => $patron->id,
118
            notes      => "Test note",
119
        }
120
    );
121
122
    my $claims = $patron->return_claims;
123
124
    is( $claims->count, 1, "Got back correct number of claims" );
125
126
    my $claim = $claims->next;
127
128
    is( $claim->issue_id, $checkout->id, "Claim issue id matches" );
129
    is( $claim->itemnumber, $item->id, "Claim itemnumber matches" );
130
    is( $claim->borrowernumber, $patron->id, "Claim borrowernumber matches" );
131
    is( $claim->notes, "Test note", "Claim notes match" );
132
    is( $claim->created_by, $patron->id, "Claim created_by matches" );
133
    ok( $claim->created_on, "Claim created_on is set" );
134
};
135
96
$schema->storage->txn_rollback;
136
$schema->storage->txn_rollback;
97
- 

Return to bug 14697