|
Lines 862-869
sub GetNextSeq {
Link Here
|
| 862 |
} |
862 |
} |
| 863 |
} |
863 |
} |
| 864 |
|
864 |
|
| 865 |
my $numberingmethod = $pattern->{numberingmethod}; |
|
|
| 866 |
my $calculated = ""; |
865 |
my $calculated = ""; |
|
|
866 |
my $numberingmethod = ""; |
| 867 |
if ($pattern eq "pubdate"){ |
| 868 |
$calculated = dt_from_string( $planneddate )->strftime( '%Y %B %d' ); |
| 869 |
} else { |
| 870 |
$numberingmethod = $pattern->{numberingmethod}; |
| 871 |
} |
| 867 |
if ($numberingmethod) { |
872 |
if ($numberingmethod) { |
| 868 |
$calculated = $numberingmethod; |
873 |
$calculated = $numberingmethod; |
| 869 |
my $locale = $subscription->{locale}; |
874 |
my $locale = $subscription->{locale}; |
|
Lines 943-948
the sequence in string format
Link Here
|
| 943 |
sub GetSeq { |
948 |
sub GetSeq { |
| 944 |
my ($subscription, $pattern) = @_; |
949 |
my ($subscription, $pattern) = @_; |
| 945 |
|
950 |
|
|
|
951 |
if ($pattern->{numberingmethod} eq ''){ |
| 952 |
return "pubdate"; |
| 953 |
} |
| 954 |
|
| 946 |
return unless ($subscription and $pattern); |
955 |
return unless ($subscription and $pattern); |
| 947 |
|
956 |
|
| 948 |
my $locale = $subscription->{locale}; |
957 |
my $locale = $subscription->{locale}; |
|
Lines 1150-1164
sub ModSerialStatus {
Link Here
|
| 1150 |
my $subscription = GetSubscription($subscriptionid); |
1159 |
my $subscription = GetSubscription($subscriptionid); |
| 1151 |
my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscription->{numberpattern}); |
1160 |
my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscription->{numberpattern}); |
| 1152 |
|
1161 |
|
|
|
1162 |
my $nextpublisheddate = GetNextDate($subscription, $publisheddate, 1); |
| 1163 |
my ( $newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
| 1164 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 ); |
| 1165 |
|
| 1166 |
if (!defined $pattern){ |
| 1167 |
$pattern = "pubdate"; |
| 1168 |
( $newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
| 1169 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 ) = GetNextSeq( $subscription, $pattern, $nextpublisheddate ); |
| 1170 |
} else { |
| 1171 |
( $newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
| 1172 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 ) = GetNextSeq( $subscription, $pattern, $publisheddate ); |
| 1173 |
} |
| 1174 |
|
| 1153 |
# next issue number |
1175 |
# next issue number |
| 1154 |
my ( |
|
|
| 1155 |
$newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
| 1156 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 |
| 1157 |
) |
| 1158 |
= GetNextSeq( $subscription, $pattern, $publisheddate ); |
| 1159 |
|
1176 |
|
| 1160 |
# next date (calculated from actual date & frequency parameters) |
1177 |
# next date (calculated from actual date & frequency parameters) |
| 1161 |
my $nextpublisheddate = GetNextDate($subscription, $publisheddate, 1); |
|
|
| 1162 |
my $nextpubdate = $nextpublisheddate; |
1178 |
my $nextpubdate = $nextpublisheddate; |
| 1163 |
$query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? |
1179 |
$query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? |
| 1164 |
WHERE subscriptionid = ?"; |
1180 |
WHERE subscriptionid = ?"; |
|
Lines 1424-1429
sub NewSubscription {
Link Here
|
| 1424 |
# calculate issue number |
1440 |
# calculate issue number |
| 1425 |
my $serialseq = GetSeq($subscription, $pattern) || q{}; |
1441 |
my $serialseq = GetSeq($subscription, $pattern) || q{}; |
| 1426 |
|
1442 |
|
|
|
1443 |
if ($serialseq eq "pubdate"){ |
| 1444 |
$serialseq = dt_from_string( $firstacquidate )->strftime('%Y %B %d'); |
| 1445 |
} |
| 1446 |
|
| 1427 |
Koha::Serial->new( |
1447 |
Koha::Serial->new( |
| 1428 |
{ |
1448 |
{ |
| 1429 |
serialseq => $serialseq, |
1449 |
serialseq => $serialseq, |