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

(-)a/C4/Serials.pm (-1 / +21 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
        #warn Dumper("dans la boucle", $serialid, $serialids);
1936
        my $serial = Koha::Serials->find($serialid);
1937
        my $serialseq = $serial->serialseq;
1938
        my $publisheddate = $serial->publisheddate;
1939
        my $publisheddatetext = $serial->publisheddatetext;
1940
        my $planneddate = $serial->planneddate;
1941
        my $status = C4::Serials->CLAIMED;
1942
        my $notes = $serial->notes;
1943
1944
        C4::Serials::ModSerialStatus(
1945
            $serialid,
1946
            $serialseq,
1947
            $planneddate,
1948
            $publisheddate,
1949
            $publisheddatetext,
1950
            $status,
1951
            $notes
1952
        );
1953
    }
1934
    my $dbh = C4::Context->dbh;
1954
    my $dbh = C4::Context->dbh;
1935
    return $dbh->do(q|
1955
    return $dbh->do(q|
1936
        UPDATE serial
1956
        UPDATE serial
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-2 / +5 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 70-75 Link Here
70
	    <label for="supplierid">Vendor: </label>
69
	    <label for="supplierid">Vendor: </label>
71
	    <select id="supplierid" name="supplierid">
70
	    <select id="supplierid" name="supplierid">
72
	        [% FOREACH suploo IN suploop %]
71
	        [% FOREACH suploo IN suploop %]
72
            [% USE Dumper %] [% Dumper.dump(suploo) %]
73
	            [% IF ( suploo.selected ) %]
73
	            [% IF ( suploo.selected ) %]
74
	            <option value="[% suploo.id | html %]" selected="selected" >
74
	            <option value="[% suploo.id | html %]" selected="selected" >
75
	            [% ELSE %]
75
	            [% ELSE %]
Lines 122-127 Link Here
122
                        [% FOR field IN additional_fields_for_subscription %]
122
                        [% FOR field IN additional_fields_for_subscription %]
123
                          <th>[% field.name | html %]</th>
123
                          <th>[% field.name | html %]</th>
124
                        [% END %]
124
                        [% END %]
125
                        
126
                            [% Dumper.dump('claimletter', claimletter) %]
127
125
                    </tr>
128
                    </tr>
126
                </thead>
129
                </thead>
127
                <tfoot>
130
                <tfoot>
Lines 212-218 Link Here
212
        </form>
215
        </form>
213
    </fieldset>
216
    </fieldset>
214
[% END %]
217
[% END %]
215
218
[% USE Dumper %] [% Dumper.dump('missingissues', missingissues) %]
216
            </main>
219
            </main>
217
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
220
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
218
221
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt (+2 lines)
Lines 197-202 Link Here
197
          </thead>
197
          </thead>
198
          <tbody>
198
          <tbody>
199
      [% FOREACH serial IN year.serials %]
199
      [% FOREACH serial IN year.serials %]
200
      [% USE Dumper %] [% Dumper.dump(" voici les serial id visibles sur serial collection :", serial.serialid) %]
201
200
        <tr>
202
        <tr>
201
            [% IF ( CAN_user_serials_receive_serials ) %]
203
            [% IF ( CAN_user_serials_receive_serials ) %]
202
                <td>
204
                <td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (+6 lines)
Lines 132-137 $(document).ready(function() { Link Here
132
		<th>Notes</th>
132
		<th>Notes</th>
133
	</tr>
133
	</tr>
134
[% FOREACH serialslis IN serialslist %]
134
[% FOREACH serialslis IN serialslist %]
135
[% USE Dumper %]
136
135
    <tr>
137
    <tr>
136
        <td>
138
        <td>
137
            <input type="hidden" name="serialid" value="[% serialslis.serialid | html %]" />
139
            <input type="hidden" name="serialid" value="[% serialslis.serialid | html %]" />
Lines 295-300 $(document).ready(function() { Link Here
295
[% END %]
297
[% END %]
296
[% FOREACH newserialloo IN newserialloop %]
298
[% FOREACH newserialloo IN newserialloop %]
297
    [% UNLESS ( newserialloo.subscriptionexpired ) %]
299
    [% UNLESS ( newserialloo.subscriptionexpired ) %]
300
[% USE Dumper %] [% Dumper.dump('newserialloo :', newserialloo) %]
301
298
    <tr>
302
    <tr>
299
        <td>
303
        <td>
300
            <input type="hidden" name="serialid" value="NEW" />
304
            <input type="hidden" name="serialid" value="NEW" />
Lines 380-385 $(document).ready(function() { Link Here
380
        </td>
384
        </td>
381
    </tr>
385
    </tr>
382
  [% IF ( newserialloo.serialsadditems ) %]
386
  [% IF ( newserialloo.serialsadditems ) %]
387
  [% Dumper.dump('serialsadditems:', serialsadditems) %]
383
          <tr>
388
          <tr>
384
          <td colspan="6">
389
          <td colspan="6">
385
      <a id="label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]" style="color: grey; font-size: 80%; cursor: pointer;"  onclick="unHideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]', '[% newserialloo.serialid | html %]')">
390
      <a id="label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]" style="color: grey; font-size: 80%; cursor: pointer;"  onclick="unHideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]', '[% newserialloo.serialid | html %]')">
Lines 449-454 $(document).ready(function() { Link Here
449
    <fieldset class="action">
454
    <fieldset class="action">
450
        <div class="btn-group"><input type="submit" value="Save" class="btn btn-default"  accesskey="w" /></div>
455
        <div class="btn-group"><input type="submit" value="Save" class="btn btn-default"  accesskey="w" /></div>
451
        [% UNLESS ( serialsadditems ) %]&nbsp;&nbsp;
456
        [% UNLESS ( serialsadditems ) %]&nbsp;&nbsp;
457
        [% Dumper.dump('serialsadditems', serialsadditems) %]
452
            <div class="btn-group"><a href="#multi_receiving" role="button" class="btn btn-default" data-toggle="modal"><i class="fa fa-plus"></i> Multi receiving</a></div>
458
            <div class="btn-group"><a href="#multi_receiving" role="button" class="btn btn-default" data-toggle="modal"><i class="fa fa-plus"></i> Multi receiving</a></div>
453
        [% END %]
459
        [% END %]
454
460
(-)a/serials/claims.pl (-1 / +8 lines)
Lines 25-39 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
use Data::Dumper;
32
34
35
my $input = CGI->new;
36
#warn Dumper('CGI new :', $input);
33
my $serialid = $input->param('serialid');
37
my $serialid = $input->param('serialid');
34
my $op = $input->param('op');
38
my $op = $input->param('op');
39
#warn Dumper('op :', $op);
35
my $claimletter = $input->param('claimletter');
40
my $claimletter = $input->param('claimletter');
36
my $supplierid = $input->param('supplierid');
41
my $supplierid = $input->param('supplierid');
42
#warn Dumper('claimletter :', $claimletter);
37
my $suppliername = $input->param('suppliername');
43
my $suppliername = $input->param('suppliername');
38
44
39
# open template first (security & userenv set here)
45
# open template first (security & userenv set here)
Lines 64-69 if (@serialnums) { # i.e. they have been flagged to generate claims Link Here
64
            C4::Serials::updateClaim( \@serialnums );
70
            C4::Serials::updateClaim( \@serialnums );
65
        }
71
        }
66
    };
72
    };
73
67
    if ( $@ ) {
74
    if ( $@ ) {
68
        $template->param(error_claim => $@);
75
        $template->param(error_claim => $@);
69
    } elsif ( ref $err and exists $err->{error} ) {
76
    } elsif ( ref $err and exists $err->{error} ) {
(-)a/serials/serials-collection.pl (+10 lines)
Lines 31-36 use Koha::DateUtils qw( dt_from_string ); Link Here
31
31
32
use List::MoreUtils qw( uniq );
32
use List::MoreUtils qw( uniq );
33
33
34
use Data::Dumper;
35
34
36
35
my $query = CGI->new;
37
my $query = CGI->new;
36
my $op = $query->param('op') || q{};
38
my $op = $query->param('op') || q{};
Lines 108-124 if($op eq 'gennext' && @subscriptionid){ Link Here
108
110
109
my $countitems = 0;
111
my $countitems = 0;
110
my @serialsid = $query->multi_param('serialid');
112
my @serialsid = $query->multi_param('serialid');
113
warn Dumper('serial', \@serialsid);
114
111
my $subscriptionid = $subscriptionid[0];
115
my $subscriptionid = $subscriptionid[0];
116
    warn Dumper('subscription', $subscriptionid);
117
112
118
113
if($op eq 'delete_confirm'){
119
if($op eq 'delete_confirm'){
114
    foreach my $serialid (@serialsid){
120
    foreach my $serialid (@serialsid){
115
        $countitems += Koha::Serial::Items->search({serialid => $serialid})->count();
121
        $countitems += Koha::Serial::Items->search({serialid => $serialid})->count();
122
        warn Dumper('serial', \@serialsid);
116
    }
123
    }
117
}elsif($op eq 'delete_confirmed'){
124
}elsif($op eq 'delete_confirmed'){
118
    if($query->param('delitems') eq "Yes"){
125
    if($query->param('delitems') eq "Yes"){
119
        my @itemnumbers;
126
        my @itemnumbers;
120
        foreach my $serialid (@serialsid){
127
        foreach my $serialid (@serialsid){
128
            warn Dumper('serial', \@serialsid);
121
            my @ids = Koha::Serial::Items->search({serialid => $serialid})->get_column('itemnumber');
129
            my @ids = Koha::Serial::Items->search({serialid => $serialid})->get_column('itemnumber');
130
            warn Dumper('serial', \@serialsid);
122
            push(@itemnumbers, @ids);
131
            push(@itemnumbers, @ids);
123
        }
132
        }
124
        my $items = Koha::Items->search({ itemnumber => \@itemnumbers });
133
        my $items = Koha::Items->search({ itemnumber => \@itemnumbers });
Lines 131-136 if($op eq 'delete_confirm'){ Link Here
131
    for my $serialid (@serialsid){
140
    for my $serialid (@serialsid){
132
        my $serial = Koha::Serials->find($serialid);
141
        my $serial = Koha::Serials->find($serialid);
133
        ModSerialStatus($serialid, $serial->serialseq, $serial->planneddate, $serial->publisheddate, $serial->publisheddatetext, 6, "");
142
        ModSerialStatus($serialid, $serial->serialseq, $serial->planneddate, $serial->publisheddate, $serial->publisheddatetext, 6, "");
143
        warn Dumper('serial', \@serialsid);
134
    }
144
    }
135
}
145
}
136
146
(-)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