Lines 28-39
use C4::Letters;
Link Here
|
28 |
use C4::Output; |
28 |
use C4::Output; |
29 |
use C4::Context; |
29 |
use C4::Context; |
30 |
|
30 |
|
|
|
31 |
use Koha::DateUtils qw( dt_from_string ); |
32 |
|
31 |
use List::MoreUtils qw/uniq/; |
33 |
use List::MoreUtils qw/uniq/; |
32 |
|
34 |
|
33 |
|
35 |
|
34 |
my $query = new CGI; |
36 |
my $query = new CGI; |
35 |
my $op = $query->param('op') || q{}; |
37 |
my $op = $query->param('op') || q{}; |
36 |
my $nbissues=$query->param('nbissues'); |
38 |
my $nbissues=$query->param('nbissues'); |
|
|
39 |
my $date_received_today = $query->param('date_received_today') || 0; |
37 |
my $dbh = C4::Context->dbh; |
40 |
my $dbh = C4::Context->dbh; |
38 |
|
41 |
|
39 |
my ($template, $loggedinuser, $cookie) |
42 |
my ($template, $loggedinuser, $cookie) |
Lines 66-73
if($op eq 'gennext' && @subscriptionid){
Link Here
|
66 |
$sth->execute($subscriptionid); |
69 |
$sth->execute($subscriptionid); |
67 |
# modify actual expected issue, to generate the next |
70 |
# modify actual expected issue, to generate the next |
68 |
if ( my $issue = $sth->fetchrow_hashref ) { |
71 |
if ( my $issue = $sth->fetchrow_hashref ) { |
|
|
72 |
my $planneddate = $date_received_today ? dt_from_string : $issue->{planneddate}; |
69 |
ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, |
73 |
ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, |
70 |
$issue->{planneddate}, $issue->{publisheddate}, |
74 |
$planneddate, $issue->{publisheddate}, |
71 |
$issue->{publisheddatetext}, $status, "" ); |
75 |
$issue->{publisheddatetext}, $status, "" ); |
72 |
} else { |
76 |
} else { |
73 |
require C4::Serials::Numberpattern; |
77 |
require C4::Serials::Numberpattern; |
Lines 81-89
if($op eq 'gennext' && @subscriptionid){
Link Here
|
81 |
|
85 |
|
82 |
## We generate the next publication date |
86 |
## We generate the next publication date |
83 |
my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, 1); |
87 |
my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, 1); |
|
|
88 |
my $planneddate = $date_received_today ? dt_from_string : $nextpublisheddate; |
84 |
## Creating the new issue |
89 |
## Creating the new issue |
85 |
NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, |
90 |
NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, |
86 |
1, $nextpublisheddate, $nextpublisheddate ); |
91 |
1, $planneddate, $nextpublisheddate ); |
87 |
|
92 |
|
88 |
## Updating the subscription seq status |
93 |
## Updating the subscription seq status |
89 |
my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? |
94 |
my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? |
90 |
- |
|
|