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

(-)a/C4/Serials.pm (-1 / +20 lines)
Lines 1150-1156 sub ModSerialStatus { Link Here
1150
        my $subscription = GetSubscription($subscriptionid);
1150
        my $subscription = GetSubscription($subscriptionid);
1151
        my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscription->{numberpattern});
1151
        my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscription->{numberpattern});
1152
        my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
1152
        my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
1153
1154
        # next issue number
1153
        # next issue number
1155
        my (
1154
        my (
1156
            $newserialseq,  $newlastvalue1, $newlastvalue2, $newlastvalue3,
1155
            $newserialseq,  $newlastvalue1, $newlastvalue2, $newlastvalue3,
Lines 1931-1936 sub updateClaim { Link Here
1931
    unless ( ref $serialids ) {
1930
    unless ( ref $serialids ) {
1932
        $serialids = [ $serialids ];
1931
        $serialids = [ $serialids ];
1933
    }
1932
    }
1933
    foreach my $serialid(@$serialids) {
1934
1935
        my $serial = Koha::Serials->find($serialid);
1936
        my $serialseq = $serial->serialseq;
1937
        my $publisheddate = $serial->publisheddate;
1938
        my $publisheddatetext = $serial->publisheddatetext;
1939
        my $planneddate = $serial->planneddate;
1940
        my $status = C4::Serials->CLAIMED;
1941
        my $notes = $serial->notes;
1942
1943
        C4::Serials::ModSerialStatus(
1944
            $serialid,
1945
            $serialseq,
1946
            $planneddate,
1947
            $publisheddate,
1948
            $publisheddatetext,
1949
            $status,
1950
            $notes
1951
        );
1952
    }
1934
    my $dbh = C4::Context->dbh;
1953
    my $dbh = C4::Context->dbh;
1935
    return $dbh->do(q|
1954
    return $dbh->do(q|
1936
        UPDATE serial
1955
        UPDATE serial
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-2 lines)
Lines 45-51 Link Here
45
            <main>
45
            <main>
46
46
47
    <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
47
    <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
48
49
    [% IF error_claim %]
48
    [% IF error_claim %]
50
        [% IF error_claim == 'no_vendor_email' %]
49
        [% IF error_claim == 'no_vendor_email' %]
51
            <div class="dialog alert">This vendor has no email defined for late issues.</div>
50
            <div class="dialog alert">This vendor has no email defined for late issues.</div>
Lines 212-218 Link Here
212
        </form>
211
        </form>
213
    </fieldset>
212
    </fieldset>
214
[% END %]
213
[% END %]
215
216
            </main>
214
            </main>
217
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
215
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
218
216
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt (+1 lines)
Lines 196-201 Link Here
196
            </tr>
196
            </tr>
197
          </thead>
197
          </thead>
198
          <tbody>
198
          <tbody>
199
          
199
      [% FOREACH serial IN year.serials %]
200
      [% FOREACH serial IN year.serials %]
200
        <tr>
201
        <tr>
201
            [% IF ( CAN_user_serials_receive_serials ) %]
202
            [% IF ( CAN_user_serials_receive_serials ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (+2 lines)
Lines 131-136 $(document).ready(function() { Link Here
131
		<th>Status</th>
131
		<th>Status</th>
132
		<th>Notes</th>
132
		<th>Notes</th>
133
	</tr>
133
	</tr>
134
134
[% FOREACH serialslis IN serialslist %]
135
[% FOREACH serialslis IN serialslist %]
135
    <tr>
136
    <tr>
136
        <td>
137
        <td>
Lines 293-298 $(document).ready(function() { Link Here
293
  [% END %]
294
  [% END %]
294
  [% END %]
295
  [% END %]
295
[% END %]
296
[% END %]
297
296
[% FOREACH newserialloo IN newserialloop %]
298
[% FOREACH newserialloo IN newserialloop %]
297
    [% UNLESS ( newserialloo.subscriptionexpired ) %]
299
    [% UNLESS ( newserialloo.subscriptionexpired ) %]
298
    <tr>
300
    <tr>
(-)a/serials/claims.pl (-1 / +3 lines)
Lines 25-35 use C4::Output qw( output_html_with_http_headers ); Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Letters qw( GetLetters SendAlerts );
26
use C4::Letters qw( GetLetters SendAlerts );
27
27
28
28
use Koha::AdditionalFields;
29
use Koha::AdditionalFields;
29
use Koha::CsvProfiles;
30
use Koha::CsvProfiles;
31
use Koha::Serial;
30
32
31
my $input = CGI->new;
33
my $input = CGI->new;
32
33
my $serialid = $input->param('serialid');
34
my $serialid = $input->param('serialid');
34
my $op = $input->param('op');
35
my $op = $input->param('op');
35
my $claimletter = $input->param('claimletter');
36
my $claimletter = $input->param('claimletter');
Lines 64-69 if (@serialnums) { # i.e. they have been flagged to generate claims Link Here
64
            C4::Serials::updateClaim( \@serialnums );
65
            C4::Serials::updateClaim( \@serialnums );
65
        }
66
        }
66
    };
67
    };
68
67
    if ( $@ ) {
69
    if ( $@ ) {
68
        $template->param(error_claim => $@);
70
        $template->param(error_claim => $@);
69
    } elsif ( ref $err and exists $err->{error} ) {
71
    } elsif ( ref $err and exists $err->{error} ) {
(-)a/serials/serials-collection.pl (-1 lines)
Lines 28-34 use C4::Context; Link Here
28
use Koha::Serial::Items;
28
use Koha::Serial::Items;
29
29
30
use Koha::DateUtils qw( dt_from_string );
30
use Koha::DateUtils qw( dt_from_string );
31
32
use List::MoreUtils qw( uniq );
31
use List::MoreUtils qw( uniq );
33
32
34
33
(-)a/t/db_dependent/Serials/Claims.t (-1 / +2 lines)
Lines 76-82 my $sample_supplier2 = { Link Here
76
};
76
};
77
77
78
my $supplier1 = Koha::Acquisition::Bookseller->new($sample_supplier1)->store;
78
my $supplier1 = Koha::Acquisition::Bookseller->new($sample_supplier1)->store;
79
79
my $supplier2 = Koha::Acquisition::Bookseller->new($sample_supplier2)->store;
80
my $supplier2 = Koha::Acquisition::Bookseller->new($sample_supplier2)->store;
81
80
my $supplier_id1 = $supplier1->id;
82
my $supplier_id1 = $supplier1->id;
81
my $supplier_id2 = $supplier2->id;
83
my $supplier_id2 = $supplier2->id;
82
84
Lines 130-136 is( GetLateOrMissingIssues(), undef, 'GetLateOrMissingIssues should return undef Link Here
130
132
131
my @late_or_missing_issues = GetLateOrMissingIssues( $supplier_id1 );
133
my @late_or_missing_issues = GetLateOrMissingIssues( $supplier_id1 );
132
is( scalar(@late_or_missing_issues), 1, 'supplier 1 should have 1 issue in late' );
134
is( scalar(@late_or_missing_issues), 1, 'supplier 1 should have 1 issue in late' );
133
134
@late_or_missing_issues = GetLateOrMissingIssues( $supplier_id2);
135
@late_or_missing_issues = GetLateOrMissingIssues( $supplier_id2);
135
is( scalar(@late_or_missing_issues), 2, 'supplier 2 should have 2 issues in late' );
136
is( scalar(@late_or_missing_issues), 2, 'supplier 2 should have 2 issues in late' );
136
137
(-)a/t/db_dependent/Serials/updateClaim.t (-1 / +42 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Test::More tests => 3;
3
4
use C4::Serials;
5
use Koha::Database;
6
use Koha::DateUtils qw( dt_from_string output_pref );
7
8
my $schema = Koha::Database->new->schema;
9
$schema->storage->txn_begin;
10
my $dbh = C4::Context->dbh;
11
12
$dbh->do(q|DELETE FROM issues|);
13
$dbh->do(q|DELETE FROM subscription|);
14
15
my $branchcode = 'CPL';
16
my $record = MARC::Record->new();
17
my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio($record, '');
18
19
# Create a new subscription
20
my $subscriptionid_claims = C4::Serials::NewSubscription(
21
undef,      $branchcode,     undef, undef, undef, $biblionumber,
22
'2013-01-01', undef, undef, undef,  undef,
23
undef,      undef,  undef, undef, undef, undef,
24
1,          "notes",undef, '9999-01-01', undef, undef,
25
undef,       undef,  0,    "intnotes",  0,
26
undef, undef, 0,          undef,         '2013-12-31', 0
27
);
28
29
# Verify and get the serial ID of the subscription
30
my ( $totalissues, @serials ) = C4::Serials::GetSerials($subscriptionid_claims, 1);
31
32
C4::Serials::updateClaim( $serials[0]->{serialid} ); # Updating the claim
33
# sort the result to separate the CLAIMED and EXPECTED status
34
@serials = sort { $a->{serialid} <=> $b->{serialid} } @serials;
35
36
# Verify if serial IDs are correctly generated
37
( $totalissues, @serials ) = C4::Serials::GetSerials($subscriptionid_claims);
38
39
is ( scalar(@serials), 2, "le test est terminé" );  # Gives the length of the @serials
40
41
is ( ($serials[0]->{status}), C4::Serials::CLAIMED, "test CLAIMED" );
42
is ( ($serials[1]->{status}), C4::Serials::EXPECTED, "test EXPECTED" );

Return to bug 23775