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

(-)a/C4/Circulation.pm (-2 / +2 lines)
Lines 35-41 use C4::Message; Link Here
35
use C4::Debug;
35
use C4::Debug;
36
use C4::Log; # logaction
36
use C4::Log; # logaction
37
use C4::Overdues qw(CalcFine UpdateFine get_chargeable_units);
37
use C4::Overdues qw(CalcFine UpdateFine get_chargeable_units);
38
use C4::RotatingCollections;
39
use Algorithm::CheckDigits;
38
use Algorithm::CheckDigits;
40
39
41
use Data::Dumper;
40
use Data::Dumper;
Lines 54-59 use Koha::Libraries; Link Here
54
use Koha::Holds;
53
use Koha::Holds;
55
use Koha::RefundLostItemFeeRule;
54
use Koha::RefundLostItemFeeRule;
56
use Koha::RefundLostItemFeeRules;
55
use Koha::RefundLostItemFeeRules;
56
use Koha::RotatingCollection::Trackings;
57
use Carp;
57
use Carp;
58
use List::MoreUtils qw( uniq );
58
use List::MoreUtils qw( uniq );
59
use Scalar::Util qw( looks_like_number );
59
use Scalar::Util qw( looks_like_number );
Lines 1964-1970 sub AddReturn { Link Here
1964
    my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} );
1964
    my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} );
1965
1965
1966
    # if we have a transfer to do, we update the line of transfers with the datearrived
1966
    # if we have a transfer to do, we update the line of transfers with the datearrived
1967
    my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->{'itemnumber'} );
1967
    my $is_in_rotating_collection = Koha::RotatingCollection::Trackings->search( { itemnumber => $item->{'itemnumber'} } )->count;
1968
    if ($datesent) {
1968
    if ($datesent) {
1969
        if ( $tobranch eq $branch ) {
1969
        if ( $tobranch eq $branch ) {
1970
            my $sth = C4::Context->dbh->prepare(
1970
            my $sth = C4::Context->dbh->prepare(
(-)a/C4/RotatingCollections.pm (-29 lines)
Lines 51-84 BEGIN { Link Here
51
    );
51
    );
52
}
52
}
53
53
54
=head2 isItemInAnyCollection
55
56
$inCollection = isItemInAnyCollection( $itemnumber );
57
58
=cut
59
60
sub isItemInAnyCollection {
61
    my ($itemnumber) = @_;
62
63
    my $dbh = C4::Context->dbh;
64
65
    my $sth = $dbh->prepare(
66
        "SELECT itemnumber FROM collections_tracking WHERE itemnumber = ?");
67
    $sth->execute($itemnumber) or return (0);
68
69
    my $row = $sth->fetchrow_hashref;
70
71
    $itemnumber = $row->{itemnumber};
72
    if ($itemnumber) {
73
        return 1;
74
    }
75
    else {
76
        return 0;
77
    }
78
}
79
80
1;
81
82
__END__
54
__END__
83
55
84
=head1 AUTHOR
56
=head1 AUTHOR
85
- 

Return to bug 18606