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