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

(-)a/C4/SIP/ILS/Item.pm (-6 / +10 lines)
Lines 15-34 use Template; Link Here
15
15
16
use C4::SIP::ILS::Transaction;
16
use C4::SIP::ILS::Transaction;
17
17
18
use C4::Debug;
19
use C4::Context;
20
use C4::Biblio;
18
use C4::Biblio;
21
use C4::Items;
22
use C4::Circulation;
19
use C4::Circulation;
20
use C4::Context;
21
use C4::Debug;
22
use C4::Items;
23
use C4::Members;
23
use C4::Members;
24
use C4::Reserves;
24
use C4::Reserves;
25
use Koha::Database;
26
use Koha::Biblios;
25
use Koha::Biblios;
26
use Koha::Checkouts::ReturnClaims;
27
use Koha::Checkouts;
27
use Koha::Checkouts;
28
use Koha::Database;
28
use Koha::DateUtils;
29
use Koha::DateUtils;
29
use Koha::Patrons;
30
use Koha::Items;
31
use Koha::Holds;
30
use Koha::Holds;
31
use Koha::Items;
32
use Koha::Patrons;
32
33
33
=encoding UTF-8
34
=encoding UTF-8
34
35
Lines 258-263 sub sip_circulation_status { Link Here
258
    if ( $self->{_object}->get_transfer ) {
259
    if ( $self->{_object}->get_transfer ) {
259
        return '10'; # in transit between libraries
260
        return '10'; # in transit between libraries
260
    }
261
    }
262
    elsif ( Koha::Checkouts::ReturnClaims->search({ itemnumber => $self->{_object}->id, resolution => undef })->count ) {
263
        return '11';    # claimed returned
264
    }
261
    elsif ( $self->{patron} ) {
265
    elsif ( $self->{patron} ) {
262
        return '04';    # charged
266
        return '04';    # charged
263
    }
267
    }
(-)a/t/db_dependent/SIP/Transaction.t (-2 / +15 lines)
Lines 397-403 subtest checkin_withdrawn => sub { Link Here
397
};
397
};
398
398
399
subtest item_circulation_status => sub {
399
subtest item_circulation_status => sub {
400
    plan tests => 2;
400
    plan tests => 3;
401
401
402
    my $library  = $builder->build_object( { class => 'Koha::Libraries' } );
402
    my $library  = $builder->build_object( { class => 'Koha::Libraries' } );
403
    my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
403
    my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
Lines 434-438 subtest item_circulation_status => sub { Link Here
434
    $sip_item = C4::SIP::ILS::Item->new( $item->barcode );
434
    $sip_item = C4::SIP::ILS::Item->new( $item->barcode );
435
    $status = $sip_item->sip_circulation_status;
435
    $status = $sip_item->sip_circulation_status;
436
    is( $status, '10', "Item circulation status is in transit" );
436
    is( $status, '10', "Item circulation status is in transit" );
437
438
    $transfer->delete;
439
440
    my $claim = Koha::Checkouts::ReturnClaim->new({
441
        itemnumber     => $item->id,
442
        borrowernumber => $patron->id,
443
        created_by     => $patron->id,
444
    })->store();
445
446
    $sip_item = C4::SIP::ILS::Item->new( $item->barcode );
447
    $status = $sip_item->sip_circulation_status;
448
    is( $status, '11', "Item circulation status is claimed returned" );
449
450
    $claim->delete;
437
};
451
};
438
$schema->storage->txn_rollback;
452
$schema->storage->txn_rollback;
439
- 

Return to bug 25347