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

(-)a/C4/Serials.pm (-24 lines)
Lines 87-93 BEGIN { Link Here
87
      HasItems
87
      HasItems
88
      &GetSubscriptionsFromBorrower
88
      &GetSubscriptionsFromBorrower
89
      &subscriptionCurrentlyOnOrder
89
      &subscriptionCurrentlyOnOrder
90
      &GetSerialItemsInformations
91
90
92
    );
91
    );
93
}
92
}
Lines 2722-2750 sub _can_do_on_subscription { Link Here
2722
    return 0;
2721
    return 0;
2723
}
2722
}
2724
2723
2725
=head1 GetSerialItemsInformations
2726
2727
    @serialsitemsinformations = GetSerialItemsInformations (@serialid)
2728
2729
    return an array of specifique information of serials and serialitem a given array of serialid
2730
2731
=cut
2732
2733
sub GetSerialItemsInformations{
2734
    my (@serialid)=@_;
2735
    my @serialitemsinformation;
2736
    my $dbh = C4::Context->dbh;
2737
    foreach my $sid(@serialid){
2738
        my $sth = $dbh->prepare("select count(i.itemnumber) as countitems,s.itemnumber as itemnumber  from items i  natural join  serialitems s where s.serialid=?");
2739
        $sth->execute($sid);
2740
        my $line   = $sth->fetchrow_hashref;
2741
        if($line->{'countitems'}){
2742
            push @serialitemsinformation,$line;
2743
        }
2744
    }
2745
    return @serialitemsinformation;
2746
}
2747
2748
=head2 findSerialsByStatus
2724
=head2 findSerialsByStatus
2749
2725
2750
    @serials = findSerialsByStatus($status, $subscriptionid);
2726
    @serials = findSerialsByStatus($status, $subscriptionid);
(-)a/Koha/Serials.pm (+33 lines)
Lines 27-32 use Koha::Serial; Link Here
27
27
28
use base qw(Koha::Objects);
28
use base qw(Koha::Objects);
29
29
30
31
use vars qw(@ISA @EXPORT);
32
33
BEGIN {
34
    require Exporter;
35
    @ISA    = qw(Exporter);
36
    @EXPORT = qw(
37
        &GetSerialItemsInformations
38
    );
39
}
40
30
=head1 NAME
41
=head1 NAME
31
42
32
Koha::Serial - Koha Serial Object class
43
Koha::Serial - Koha Serial Object class
Lines 49-54 sub object_class { Link Here
49
    return 'Koha::Serial';
60
    return 'Koha::Serial';
50
}
61
}
51
62
63
=head1 GetSerialItemsInformations
64
65
    @serialsitemsinformations = GetSerialItemsInformations (@serialid)
66
67
    return an array of specifique information of serials and serialitem a given array of serialid
68
69
=cut
70
71
sub GetSerialItemsInformations{
72
    my (@serialid)=@_;
73
    my @serialitemsinformation;
74
    my $dbh = C4::Context->dbh;
75
    foreach my $sid(@serialid){
76
        my $sth = $dbh->prepare("select count(i.itemnumber) as countitems,s.itemnumber as itemnumber  from items i natural join serialitems s where s.serialid=?");
77
        $sth->execute($sid);
78
        my $line   = $sth->fetchrow_hashref;
79
        if($line->{'countitems'}){
80
            push @serialitemsinformation,$line;
81
        }
82
    }
83
    return @serialitemsinformation;
84
}
52
=head1 AUTHOR
85
=head1 AUTHOR
53
86
54
Kyle M Hall <kyle@bywatersolutions.com>
87
Kyle M Hall <kyle@bywatersolutions.com>
(-)a/serials/serials-collection.pl (+1 lines)
Lines 29-34 use C4::Items; Link Here
29
use C4::Letters;
29
use C4::Letters;
30
use C4::Output;
30
use C4::Output;
31
use C4::Context;
31
use C4::Context;
32
use Koha::Serials;
32
33
33
use List::MoreUtils qw/uniq/;
34
use List::MoreUtils qw/uniq/;
34
35
(-)a/t/db_dependent/Serials.t (-1 / +1 lines)
Lines 16-21 use C4::Budgets; Link Here
16
use C4::Items;
16
use C4::Items;
17
use Koha::DateUtils;
17
use Koha::DateUtils;
18
use Koha::Acquisition::Booksellers;
18
use Koha::Acquisition::Booksellers;
19
use Koha::Serials;
19
use t::lib::Mocks;
20
use t::lib::Mocks;
20
use t::lib::TestBuilder;
21
use t::lib::TestBuilder;
21
use Test::More tests => 50;
22
use Test::More tests => 50;
22
- 

Return to bug 17674