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

(-)a/C4/Serials.pm (-5 / +29 lines)
Lines 34-39 use C4::Serials::Numberpattern; Link Here
34
34
35
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
35
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
36
36
37
# Define statuses
38
use constant {
39
    EXPECTED               => 1,
40
    ARRIVED                => 2,
41
    LATE                   => 3,
42
    MISSING                => 4,
43
    MISSING_NEVER_RECIEVED => 41,
44
    MISSING_SOLD_OUT       => 42,
45
    MISSING_DAMAGED        => 43,
46
    MISSING_LOST           => 44,
47
    NOT_ISSUED             => 5,
48
    DELETED                => 6,
49
    CLAIMED                => 7,
50
    STOPPED                => 8,
51
};
52
53
use constant MISSING_STATUSES => (
54
    MISSING,          MISSING_NEVER_RECIEVED,
55
    MISSING_SOLD_OUT, MISSING_DAMAGED,
56
    MISSING_LOST
57
);
58
59
37
BEGIN {
60
BEGIN {
38
    $VERSION = 3.07.00.049;    # set version for version checking
61
    $VERSION = 3.07.00.049;    # set version for version checking
39
    require Exporter;
62
    require Exporter;
Lines 95-100 the array is in name order Link Here
95
118
96
sub GetSuppliersWithLateIssues {
119
sub GetSuppliersWithLateIssues {
97
    my $dbh   = C4::Context->dbh;
120
    my $dbh   = C4::Context->dbh;
121
    my $statuses = join(',', ( LATE, MISSING_STATUSES, CLAIMED ) );
98
    my $query = qq|
122
    my $query = qq|
99
    SELECT DISTINCT id, name
123
    SELECT DISTINCT id, name
100
    FROM            subscription
124
    FROM            subscription
Lines 103-109 sub GetSuppliersWithLateIssues { Link Here
103
    WHERE id > 0
127
    WHERE id > 0
104
        AND (
128
        AND (
105
            (planneddate < now() AND serial.status=1)
129
            (planneddate < now() AND serial.status=1)
106
            OR serial.STATUS IN (3, 4, 41, 42, 43, 44, 7)
130
            OR serial.STATUS IN ( $statuses )
107
        )
131
        )
108
        AND subscription.closed = 0
132
        AND subscription.closed = 0
109
    ORDER BY name|;
133
    ORDER BY name|;
Lines 430-436 sub PrepareSerialsData { Link Here
430
            }
454
            }
431
        }
455
        }
432
        $subs->{ "status" . $subs->{'status'} } = 1;
456
        $subs->{ "status" . $subs->{'status'} } = 1;
433
        if ( grep { $_ == $subs->{status} } qw( 1 3 4 41 42 43 44 7 ) ) {
457
        if ( grep { $_ == $subs->{status} } ( EXPECTED, LATE, MISSING_STATUSES, CLAIMED ) ) {
434
            $subs->{"checked"} = 1;
458
            $subs->{"checked"} = 1;
435
        }
459
        }
436
460
Lines 772-780 sub GetSerials { Link Here
772
    my $counter = 0;
796
    my $counter = 0;
773
    $count = 5 unless ($count);
797
    $count = 5 unless ($count);
774
    my @serials;
798
    my @serials;
799
    my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES, NOT_ISSUED ) );
775
    my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes
800
    my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes
776
                        FROM   serial
801
                        FROM   serial
777
                        WHERE  subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5)
802
                        WHERE  subscriptionid = ? AND status NOT IN ( $statuses )
778
                        ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC";
803
                        ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC";
779
    my $sth = $dbh->prepare($query);
804
    my $sth = $dbh->prepare($query);
780
    $sth->execute($subscriptionid);
805
    $sth->execute($subscriptionid);
Lines 795-801 sub GetSerials { Link Here
795
    $query = "SELECT   serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes
820
    $query = "SELECT   serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes
796
       FROM     serial
821
       FROM     serial
797
       WHERE    subscriptionid = ?
822
       WHERE    subscriptionid = ?
798
       AND      (status in (2, 4, 41, 42, 43, 44, 5))
823
       AND      status IN ( $statuses )
799
       ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC
824
       ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC
800
      ";
825
      ";
801
    $sth = $dbh->prepare($query);
826
    $sth = $dbh->prepare($query);
802
- 

Return to bug 11814