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

(-)a/C4/Serials.pm (-8 / +14 lines)
Lines 1133-1150 sub ModSerialStatus { Link Here
1133
            $sth   = $dbh->prepare($query);
1133
            $sth   = $dbh->prepare($query);
1134
            $sth->execute($subscriptionid);
1134
            $sth->execute($subscriptionid);
1135
            my ( $missinglist, $recievedlist ) = $sth->fetchrow;
1135
            my ( $missinglist, $recievedlist ) = $sth->fetchrow;
1136
            if ( $status == 2 ) {
1136
1137
            #Arrived: add to received list, remove from missing
1138
            if($status==2) {
1137
                $recievedlist .= "; $serialseq"
1139
                $recievedlist .= "; $serialseq"
1138
                    if $recievedlist!~/(^|;)\s*$serialseq(?=;|$)/;
1140
                    if $recievedlist!~/(^|;)\s*$serialseq(?=;|$)/;
1141
                $missinglist=~ s/(^|;)\s*$serialseq(?=;|$)//g;
1139
            }
1142
            }
1140
            # in case serial has been previously marked as missing
1143
            #Expected,late,claimed: remove optionally from received+missing
1141
            if (grep /$status/, (1,2,3,7)) {
1144
            if (grep /$status/, (1,3,7)) {
1145
                $recievedlist=~ s/(^|;)\s*$serialseq(?=;|$)//g;
1142
                $missinglist=~ s/(^|;)\s*$serialseq(?=;|$)//g;
1146
                $missinglist=~ s/(^|;)\s*$serialseq(?=;|$)//g;
1143
            }
1147
            }
1144
            $missinglist .= "; $serialseq"
1148
            #Missing, not available: add to missing, remove from received
1145
                if $status==4 && $missinglist!~/(^|;)\s*$serialseq(?=;|$)/;
1149
            #No longer putting additional text into missing field
1146
            $missinglist .= "; not issued $serialseq"
1150
            if($status==4 || $status==5) {
1147
                if $status==5 && $missinglist!~/(^|;)\s*$serialseq(?=;|$)/;
1151
                $missinglist .= "; $serialseq"
1152
                    if $missinglist!~/(^|;)\s*$serialseq(?=;|$)/;
1153
                $recievedlist=~ s/(^|;)\s*$serialseq(?=;|$)//g;
1154
            }
1148
1155
1149
            $query = "UPDATE subscriptionhistory SET recievedlist=?, missinglist=? WHERE  subscriptionid=?";
1156
            $query = "UPDATE subscriptionhistory SET recievedlist=?, missinglist=? WHERE  subscriptionid=?";
1150
            $sth   = $dbh->prepare($query);
1157
            $sth   = $dbh->prepare($query);
1151
- 

Return to bug 10092