Lines 813-819
sub GetPreviousSerialid {
Link Here
|
813 |
my ( |
813 |
my ( |
814 |
$nextseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
814 |
$nextseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
815 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 |
815 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 |
816 |
) = GetNextSeq( $subscription, $pattern, $frequency, $planneddate, $count_forward ); |
816 |
) = GetNextSeq( $subscription, $pattern, $frequency, $planneddate, $nextpublisheddate, $count_forward ); |
817 |
|
817 |
|
818 |
$subscription is a hashref containing all the attributes of the table |
818 |
$subscription is a hashref containing all the attributes of the table |
819 |
'subscription'. |
819 |
'subscription'. |
Lines 821-833
$pattern is a hashref containing all the attributes of the table
Link Here
|
821 |
'subscription_numberpatterns'. |
821 |
'subscription_numberpatterns'. |
822 |
$frequency is a hashref containing all the attributes of the table 'subscription_frequencies' |
822 |
$frequency is a hashref containing all the attributes of the table 'subscription_frequencies' |
823 |
$planneddate is a date string in iso format. |
823 |
$planneddate is a date string in iso format. |
|
|
824 |
$nextpublishedddate is a date string in iso format. |
824 |
$count_forward is the number of issues to count forward, defaults to 1 if omitted |
825 |
$count_forward is the number of issues to count forward, defaults to 1 if omitted |
825 |
This function get the next issue for the subscription given on input arg |
826 |
This function get the next issue for the subscription given on input arg |
826 |
|
827 |
|
827 |
=cut |
828 |
=cut |
828 |
|
829 |
|
829 |
sub GetNextSeq { |
830 |
sub GetNextSeq { |
830 |
my ( $subscription, $pattern, $frequency, $planneddate, $count_forward ) = @_; |
831 |
my ( $subscription, $pattern, $frequency, $planneddate, $nextpublisheddate, $count_forward ) = @_; |
831 |
|
832 |
|
832 |
return unless ( $subscription and $pattern ); |
833 |
return unless ( $subscription and $pattern ); |
833 |
|
834 |
|
Lines 918-924
sub GetNextSeq {
Link Here
|
918 |
$calculated =~ s/\{Z\}/$newlastvalue3string/g; |
919 |
$calculated =~ s/\{Z\}/$newlastvalue3string/g; |
919 |
} |
920 |
} |
920 |
|
921 |
|
921 |
my $dt = dt_from_string($planneddate); |
922 |
my $dt = dt_from_string($nextpublisheddate); |
922 |
$calculated =~ s/\{Month\}/$dt->month/eg; |
923 |
$calculated =~ s/\{Month\}/$dt->month/eg; |
923 |
$calculated =~ s/\{MonthName\}/$dt->month_name/eg; |
924 |
$calculated =~ s/\{MonthName\}/$dt->month_name/eg; |
924 |
$calculated =~ s/\{Year\}/$dt->year/eg; |
925 |
$calculated =~ s/\{Year\}/$dt->year/eg; |
Lines 1170-1184
sub ModSerialStatus {
Link Here
|
1170 |
my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern( $subscription->{numberpattern} ); |
1171 |
my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern( $subscription->{numberpattern} ); |
1171 |
my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency( $subscription->{periodicity} ); |
1172 |
my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency( $subscription->{periodicity} ); |
1172 |
|
1173 |
|
|
|
1174 |
# next date (calculated from actual date & frequency parameters) |
1175 |
my $nextpublisheddate = GetNextDate( $subscription, $publisheddate, $frequency, 1 ); |
1176 |
my $nextpubdate = $nextpublisheddate; |
1177 |
|
1173 |
# next issue number |
1178 |
# next issue number |
1174 |
my ( |
1179 |
my ( |
1175 |
$newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
1180 |
$newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, |
1176 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 |
1181 |
$newinnerloop1, $newinnerloop2, $newinnerloop3 |
1177 |
) = GetNextSeq( $subscription, $pattern, $frequency, $publisheddate, $count ); |
1182 |
) = GetNextSeq( $subscription, $pattern, $frequency, $publisheddate, $nextpublisheddate, $count ); |
1178 |
|
1183 |
|
1179 |
# next date (calculated from actual date & frequency parameters) |
|
|
1180 |
my $nextpublisheddate = GetNextDate( $subscription, $publisheddate, $frequency, 1 ); |
1181 |
my $nextpubdate = $nextpublisheddate; |
1182 |
$query = |
1184 |
$query = |
1183 |
"UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? |
1185 |
"UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? |
1184 |
WHERE subscriptionid = ?"; |
1186 |
WHERE subscriptionid = ?"; |