Bugzilla – Attachment 192985 Details for
Bug 17656
Irregularities in serial prediction pattern are planned only for current subscription
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17656: Keep irregularities during subscription renewals
Bug-17656-Keep-irregularities-during-subscription-.patch (text/plain), 67.86 KB, created by
Arthur Suzuki
on 2026-02-11 15:12:15 UTC
(
hide
)
Description:
Bug 17656: Keep irregularities during subscription renewals
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2026-02-11 15:12:15 UTC
Size:
67.86 KB
patch
obsolete
>From 6b982e3c26dc331582bd14a35307921d1cf6fe6d Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 18 Oct 2017 14:52:34 +0000 >Subject: [PATCH] Bug 17656: Keep irregularities during subscription renewals > >When renewing a subscription, irregularities are lost. This patch >allows to keep them for daily, weekly and monthly serials (1 unit >per issue only). > >Test plan: > - Apply this patch, > - Launch installer/data/mysql/updatedatabase.pl > - Launch misc/devel/update_dbix_class_files.pl > > - Create a daily subscription. i.e: > - From: 2017-10-09, To: 2017-10-15, > - Frequency: 1/day, > - 7 issues, > - test prediction pattern > - check Wednesday and Thursday as irregularity, > - save > - Edit subscription, > - Check that Wednesday and Thursday are still checked > - Renew subscription from 2017-10-16 > - Edit subscription, > - Make sure that Wednesday and Thursday are still checked > with corresponding serials > > - Do the same for a monthly and weekly subscription > >Rebased - 2017-12-15 - Alex Arnaud <alex.arnaud@biblibre.com> > >Signed-off-by: David Nind <david@davidnind.com> > >Rebased - 2021-03-04 - Alex Arnaud <alex.arnaud@biblibre.com> >Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >Signed-off-by: David Nind <david@davidnind.com> > >Rebased - 2026-02-11 - Arthur Suzuki <arthur.suzuki@biblibre.com> >Sponsored-by BibLibre >--- > C4/Serials.pm | 89 ++++---- > Koha/Subscription.pm | 145 ++++++++++++- > ...ug_17656-add-permanent-irregularities.perl | 25 +++ > installer/data/mysql/kohastructure.sql | 1 + > .../prog/en/includes/calendar.inc | 1 + > .../serials/subscription_daily_choice.inc | 35 +++ > .../serials/subscription_monthly_choice.inc | 45 ++++ > .../serials/subscription_weekly_choice.inc | 30 +++ > .../modules/serials/showpredictionpattern.tt | 32 ++- > .../en/modules/serials/subscription-add.tt | 3 +- > .../en/modules/serials/subscription-renew.tt | 55 ++++- > .../prog/js/showpredictionpattern.js | 21 +- > .../intranet-tmpl/prog/js/subscription-add.js | 4 +- > .../intranet-tmpl/prog/js/subscription.js | 99 +++++++++ > serials/showpredictionpattern.pl | 28 ++- > serials/subscription-add.pl | 114 ++++------ > serials/subscription-renew.pl | 58 ++++- > t/Serials/IssueNumber.t | 49 +++++ > t/db_dependent/Koha/Subscription.t | 45 +++- > .../Koha/Subscription/GuessEnddate.t | 173 +++++++++++++++ > .../Koha/Subscription/Irregularities.t | 201 ++++++++++++++++++ > .../Serials/SubscriptionIrregularity.t | 37 ++++ > 22 files changed, 1131 insertions(+), 159 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/Bug_17656-add-permanent-irregularities.perl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_daily_choice.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_monthly_choice.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_weekly_choice.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/subscription.js > create mode 100755 t/Serials/IssueNumber.t > create mode 100755 t/db_dependent/Koha/Subscription/GuessEnddate.t > create mode 100755 t/db_dependent/Koha/Subscription/Irregularities.t > create mode 100755 t/db_dependent/Serials/SubscriptionIrregularity.t > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 0e9d0341da2..d9b77a764b2 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -51,6 +51,8 @@ BEGIN { > HasItems > > findSerialsByStatus >+ &subscriptionCurrentlyOnOrder >+ &issue_number > > ); > } >@@ -1307,37 +1309,6 @@ sub ModNextExpected { > > } > >-=head2 GetSubscriptionIrregularities >- >-=over 4 >- >-=item @irreg = &GetSubscriptionIrregularities($subscriptionid); >-get the list of irregularities for a subscription >- >-=back >- >-=cut >- >-sub GetSubscriptionIrregularities { >- my $subscriptionid = shift; >- >- return unless $subscriptionid; >- >- my $dbh = C4::Context->dbh; >- my $query = qq{ >- SELECT irregularity >- FROM subscription >- WHERE subscriptionid = ? >- }; >- my $sth = $dbh->prepare($query); >- $sth->execute($subscriptionid); >- >- my ($result) = $sth->fetchrow_array; >- my @irreg = split /;/, $result; >- >- return @irreg; >-} >- > =head2 ModSubscription > > this function modifies a subscription. Put all new values on input args. >@@ -1347,11 +1318,11 @@ returns the number of rows affected > > sub ModSubscription { > my ( >- $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, >- $periodicity, $firstacquidate, $irregularity, $numberpattern, $locale, >- $numberlength, $weeklength, $monthlength, $lastvalue1, $innerloop1, >- $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, >- $biblionumber, $callnumber, $notes, $letter, $manualhistory, >+ $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, >+ $periodicity, $firstacquidate, $irregularity, $permanent_irregularity, $numberpattern, $locale, >+ $numberlength, $weeklength, $monthlength, $lastvalue1, $innerloop1, >+ $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, >+ $biblionumber, $callnumber, $notes, $letter, $manualhistory, > $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, > $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, > $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template, $preselect_issues_in_collections_table >@@ -1382,6 +1353,7 @@ sub ModSubscription { > letter => $letter, > firstacquidate => $firstacquidate, > irregularity => $irregularity, >+ permanent_irregularity => $permanent_irregularity, > numberpattern => $numberpattern, > locale => $locale, > callnumber => $callnumber, >@@ -1432,14 +1404,14 @@ the id of this new subscription > > sub NewSubscription { > my ( >- $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $biblionumber, >- $startdate, $periodicity, $numberlength, $weeklength, $monthlength, >- $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, >- $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, >- $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, >- $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, >- $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, >- $published_on_template, $preselect_issues_in_collections_table >+ $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $biblionumber, >+ $startdate, $periodicity, $numberlength, $weeklength, $monthlength, >+ $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, >+ $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, >+ $permanent_irregularity, $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, >+ $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, >+ $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, >+ $published_on_template, $preselect_issues_in_collections_table > ) = @_; > my $dbh = C4::Context->dbh; > >@@ -1467,6 +1439,7 @@ sub NewSubscription { > letter => $letter, > firstacquidate => $firstacquidate, > irregularity => $irregularity, >+ permanent_irregularity => $permanent_irregularity, > numberpattern => $numberpattern, > locale => $locale, > callnumber => $callnumber, >@@ -2830,6 +2803,34 @@ sub findSerialsByStatus { > return @$serials; > } > >+=head2 issue_number >+ >+ my $week_number = issue_number($dt, 'week'); >+ >+=cut >+ >+sub issue_number { >+ my ( $date, $issue_type ) = @_; >+ >+ unless ( ref($date) eq 'DateTime' ) { >+ Koha::Exceptions::WrongParameter->throw("Date passed to issue_number is not a valid DateTime object"); >+ } >+ >+ if ( $issue_type eq 'day' ) { >+ return $date->dow; >+ } >+ >+ if ( $issue_type eq 'week' ) { >+ return $date->week_number; >+ } >+ >+ if ( $issue_type eq 'month' ) { >+ return $date->month; >+ } >+ >+ return 0; >+} >+ > 1; > __END__ > >diff --git a/Koha/Subscription.pm b/Koha/Subscription.pm >index 6477470b5b4..ab53cd8d755 100644 >--- a/Koha/Subscription.pm >+++ b/Koha/Subscription.pm >@@ -19,6 +19,8 @@ package Koha::Subscription; > > use Modern::Perl; > >+use C4::Serials::Frequency; >+ > use Koha::Database; > use Koha::Biblios; > use Koha::Acquisition::Booksellers; >@@ -26,6 +28,9 @@ use Koha::Biblioitems; > use Koha::Subscriptions; > use Koha::Subscription::Frequencies; > use Koha::Subscription::Numberpatterns; >+use Koha::DateUtils qw( dt_from_string ); >+use JSON; >+use Date::Calc qw( Delta_Days Add_Delta_Days Add_Delta_YM ); > > use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); > >@@ -74,9 +79,7 @@ sub subscribers { > my ($self) = @_; > my $schema = Koha::Database->new->schema; > my @borrowernumbers = >- $schema->resultset('Alert') >- ->search( { externalid => $self->subscriptionid } ) >- ->get_column('borrowernumber') >+ $schema->resultset('Alert')->search( { externalid => $self->subscriptionid } )->get_column('borrowernumber') > ->all; > return Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } } ); > } >@@ -193,7 +196,141 @@ sub get_sharable_info { > return $sub_mana_info; > } > >-=head3 _type >+=head2 irregularities >+ >+Returns an array containing irregularities >+ >+=cut >+ >+sub irregularities { >+ my ($self) = @_; >+ >+ return split( ';', $self->irregularity ); >+} >+ >+=head2 permanent_irregularities >+ >+Returns an array containing permanent irregularities >+ >+=cut >+ >+sub permanent_irregularities { >+ my ($self) = @_; >+ >+ return split( ';', $self->permanent_irregularity ); >+} >+ >+=head3 lengthtype >+ >+Return the length type (issues, weeks, months) >+ >+=cut >+ >+sub lengthtype { >+ my ($self) = @_; >+ >+ if ( $self->numberlength ) { >+ return 'issues'; >+ } >+ >+ if ( $self->weeklength ) { >+ return 'weeks'; >+ } >+ >+ if ( $self->monthlength ) { >+ return 'months'; >+ } >+} >+ >+=head3 guess_irregularities >+ >+my @irregularities = $subscription->guess_irregularities >+ >+=cut >+ >+sub guess_irregularities { >+ my ($self) = @_; >+ >+ my @irregularities; >+ my %permanent_irregularities = map { $_ => 1 } $self->permanent_irregularities; >+ >+ my $frequency = $self->frequency; >+ my $enddate = $self->enddate; >+ my $nextexpected = C4::Serials::GetNextExpected( $self->id ); >+ my $date = $nextexpected->{planneddate}; >+ >+ my ($issuenumber) = C4::Serials::GetFictiveIssueNumber( $self->unblessed, $date, $frequency->unblessed ); >+ my $dow = C4::Serials::issue_number( dt_from_string($date), $frequency->unit ); >+ >+ if ( defined( $permanent_irregularities{$dow} ) ) { >+ push @irregularities, $issuenumber; >+ } >+ >+ while ( $date && Delta_Days( split( /-/, $date ), split( /-/, $enddate ) ) >= 0 ) { >+ $issuenumber++; >+ $date = C4::Serials::GetNextDate( $self->unblessed, $date, $frequency->unblessed ); >+ $dow = C4::Serials::issue_number( dt_from_string($date), $frequency->unit ); >+ >+ if ( defined( $permanent_irregularities{$dow} ) ) { >+ push @irregularities, $issuenumber; >+ } >+ } >+ >+ return @irregularities; >+} >+ >+=head2 guess_enddate >+ >+my $enddate = $subscription->guess_enddate; >+ >+=cut >+ >+sub guess_enddate { >+ my ($self) = @_; >+ >+ my ( $year, $month, $day, $enddate ); >+ my $startdate = $self->startdate; >+ my $numberlength = $self->numberlength; >+ my $weeklength = $self->weeklength; >+ my $monthlength = $self->monthlength; >+ >+ if ( $numberlength != 0 ) { >+ my $frequency = GetSubscriptionFrequency( $self->periodicity ); >+ if ( $frequency->{'unit'} eq 'day' ) { >+ ( $year, $month, $day ) = Add_Delta_Days( >+ split( /-/, $startdate ), >+ $numberlength * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'} >+ ); >+ } elsif ( $frequency->{'unit'} eq 'week' ) { >+ ( $year, $month, $day ) = Add_Delta_Days( >+ split( /-/, $startdate ), >+ $numberlength * 7 * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'} >+ ); >+ } elsif ( $frequency->{'unit'} eq 'month' ) { >+ ( $year, $month, $day ) = Add_Delta_YM( >+ split( /-/, $startdate ), 0, >+ $numberlength * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'} >+ ); >+ } elsif ( $frequency->{'unit'} eq 'year' ) { >+ ( $year, $month, $day ) = Add_Delta_YM( >+ split( /-/, $startdate ), >+ $numberlength * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'}, 0 >+ ); >+ } >+ } elsif ( $weeklength != 0 ) { >+ ( $year, $month, $day ) = Add_Delta_Days( split( /-/, $startdate ), $weeklength * 7 ); >+ } elsif ( $monthlength != 0 ) { >+ ( $year, $month, $day ) = Add_Delta_YM( split( /-/, $startdate ), 0, $monthlength ); >+ } >+ if ( defined $year ) { >+ $enddate = sprintf( "%04d-%02d-%02d", $year, $month, $day ); >+ } else { >+ undef $enddate; >+ } >+ return $enddate; >+} >+ >+=head3 type > > =cut > >diff --git a/installer/data/mysql/atomicupdate/Bug_17656-add-permanent-irregularities.perl b/installer/data/mysql/atomicupdate/Bug_17656-add-permanent-irregularities.perl >new file mode 100644 >index 00000000000..0f7ca0a0fec >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/Bug_17656-add-permanent-irregularities.perl >@@ -0,0 +1,25 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "17656", >+ description => "Store permanent_irregularity for serials in the subscription table", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ if ( !column_exists( 'subscription', 'permanent_irregularity' ) ) { >+ >+ $dbh->do(q{ >+ ALTER TABLE `subscription` >+ ADD permanent_irregularity MEDIUMTEXT >+ AFTER irregularity >+ }); >+ >+ say_success( $out, "Added column 'subscription.permanent_irregularity'" ); >+ >+ } else { >+ say_info( $out, "Column 'subscription.permanent_irregularity' already exists!" ); >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 1222ef6387c..9630f86cb3f 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -6491,6 +6491,7 @@ CREATE TABLE `subscription` ( > `firstacquidate` date DEFAULT NULL COMMENT 'first issue received date', > `manualhistory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes or no to managing the history manually', > `irregularity` mediumtext DEFAULT NULL COMMENT 'any irregularities in the subscription', >+ `permanent_irregularity` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'permanent irregularities for renewal', > `skip_serialseq` tinyint(1) NOT NULL DEFAULT 0, > `letter` varchar(20) DEFAULT NULL, > `numberpattern` int(11) DEFAULT NULL COMMENT 'the numbering pattern used links to subscription_numberpatterns.id', >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 607d72d929b..9ca9d868f2f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -213,6 +213,7 @@ > let refresh_max_date = 0; > let disable_buttons = []; > >+ options['defaultDate'] = $(input).val(); > if( $(input).data("flatpickr-futureinclusive") === true > || $(input).data("flatpickr-futuredate") === true ) { > let original_date = $(input).val(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_daily_choice.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_daily_choice.inc >new file mode 100644 >index 00000000000..3e49f952f84 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_daily_choice.inc >@@ -0,0 +1,35 @@ >+[% daily_choice = [ {name => 'monday', value => 1}, {name => 'tuesday', value => 2}, {name => 'wednesday', value => 3}, {name => 'thursday', value => 4}, {name => 'friday', value => 5}, {name => 'saturday', value => 6}, {name => 'sunday', value => 7} ] %] >+ >+[% BLOCK days %] >+ [% SWITCH d %] >+ [% CASE 'monday' %] >+ Monday >+ [% CASE 'tuesday' %] >+ Tuesday >+ [% CASE 'wednesday' %] >+ Wednesday >+ [% CASE 'thursday' %] >+ Thursday >+ [% CASE 'friday' %] >+ Friday >+ [% CASE 'saturday' %] >+ Saturday >+ [% CASE 'sunday' %] >+ Sunday >+ [% END %] >+[% END %] >+ >+[% FOREACH day IN daily_choice %] >+ [% IF permanent_irreg.grep( day.value ).0 == day.value %] >+ <input type="checkbox" name="permanent_irregularity" id="[% day.name | html %]" data-dow="[% day.value | html %]" value="[% day.value | html %]" class="skip" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="permanent_irregularity" id="[% day.name | html %]" data-dow="[% day.value | html %]" value="[% day.value | html %]" class="skip" /> >+ [% END %] >+ <label for="[% day.name | html %]" class="inline">[% PROCESS days d=day.name %]</label> >+[% END %] >+<p> >+ <em>Check days in the above list in order to keep them unpublished throughout upcoming renewals (permanent irregularities).</em> >+</p> >+<p> >+ <em>Or check days in the "Not published" column below to set unpublished days for this subscription only.</em> >+</p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_monthly_choice.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_monthly_choice.inc >new file mode 100644 >index 00000000000..ad68360dab5 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_monthly_choice.inc >@@ -0,0 +1,45 @@ >+[% monthly_choice = [ {name => 'january', value => 1}, {name => 'february', value => 2}, {name => 'march', value => 3}, {name => 'april', value => 4}, {name => 'may', value => 5}, {name => 'june', value => 6}, {name => 'july', value => 7}, {name => 'august', value => 8}, {name => 'september', value => 9}, {name => 'october', value => 10}, {name => 'november', value => 11}, {name => 'december', value =>12} ] %] >+ >+[% BLOCK months %] >+ [% SWITCH m %] >+ [% CASE 'january' %] >+ January >+ [% CASE 'february' %] >+ February >+ [% CASE 'march' %] >+ March >+ [% CASE 'april' %] >+ April >+ [% CASE 'may' %] >+ May >+ [% CASE 'june' %] >+ June >+ [% CASE 'july' %] >+ July >+ [% CASE 'august' %] >+ August >+ [% CASE 'september' %] >+ September >+ [% CASE 'october' %] >+ October >+ [% CASE 'november' %] >+ November >+ [% CASE 'december' %] >+ December >+ [% END %] >+[% END %] >+ >+[% FOREACH month IN monthly_choice %] >+ [% IF permanent_irreg.grep( month.value ).0 == month.value %] >+ <input type="checkbox" name="permanent_irregularity" id="[% month.name | html %]" data-dow="[% month.value | html %]" value="[% month.value | html %]" class="skip" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="permanent_irregularity" id="[% month.name | html %]" data-dow="[% month.value | html %]" value="[% month.value | html %]" class="skip" /> >+ [% END %] >+ <label for="[% month.name | html %]" class="inline">[% PROCESS months m=month.name %]</label> >+[% END %] >+<p> >+ <em>Check months in the above list in order to keep them unpublished throughout upcoming renewals (permanent irregularities).</em> >+</p> >+<p> >+ <em>Or check months in the "Not published" column below to set unpublished months for this subscription only.</em> >+</p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_weekly_choice.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_weekly_choice.inc >new file mode 100644 >index 00000000000..af552e9cc4e >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials/subscription_weekly_choice.inc >@@ -0,0 +1,30 @@ >+<div class="row select-weeks"> >+ <div class="col-lg-12"> >+ <div class="button-group"> >+ <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> >+ Week(s) not published >+ <span class="caret"></span> >+ </button> >+ <ul class="dropdown-menu week-columns"> >+ [% FOREACH p IN predictions_loop %] >+ <li> >+ <a class="small" href="JavaScript:Void(0);"> >+ [% IF permanent_irreg.grep( p.dow ).0 == p.dow %] >+ <input type="checkbox" name="permanent_irregularity" value="[% p.dow | html %]" data-dow="[% p.dow | html %]" class="skip" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="permanent_irregularity" value="[% p.dow | html %]" data-dow="[% p.dow | html %]" class="skip" /> >+ [% END %] >+ Week <b>#[% p.dow | html %]</b> ([% p.publicationdate | $KohaDates %]) >+ </a> >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ </div> >+</div> >+<p> >+ <em>Check weeks in the above list in order to keep them unpublished throughout upcoming renewals (permanent irregularities).</em> >+</p> >+<p> >+ <em>Or check weeks in the "Not published" column below to set unpublished weeks for this subscription only.</em> >+</p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt >index 7522a9d7fcc..6d8b00d6597 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt >@@ -4,23 +4,21 @@ > <p><em>End date is not consistent with subscription length.</em></p> > [% END %] > [% IF (ask_for_irregularities) %] >- <p><em>Please check issues that are NOT published (irregularities)</em></p> >- [% IF (daily_options) %] >- <p><em> If there is a day (or more) in the week where issues are never published, you can check corresponding boxes below. </em></p> >- <input type="checkbox" id="monday" data-dow="1" class="skipday" /> >- <label for="monday">Monday</label> >- <input type="checkbox" id="tuesday" data-dow="2" class="skipday" /> >- <label for="tuesday">Tuesday</label> >- <input type="checkbox" id="wednesday" data-dow="3" class="skipday" /> >- <label for="wednesday">Wednesday</label> >- <input type="checkbox" id="thursday" data-dow="4" class="skipday" /> >- <label for="thursday">Thursday</label> >- <input type="checkbox" id="friday" data-dow="5" class="skipday" /> >- <label for="friday">Friday</label> >- <input type="checkbox" id="saturday" data-dow="6" class="skipday" /> >- <label for="saturday">Saturday</label> >- <input type="checkbox" id="sunday" data-dow="7" class="skipday" /> >- <label for="sunday">Sunday</label> >+ [% IF (show_irregularity_options) %] >+ <script> >+ //<![CDATA[ >+ $(document).ready(function () { >+ Check_permanent_irregularities(); >+ }); >+ //]]> >+ </script> >+ [% IF (show_irregularity_options == 'day') %] >+ [% INCLUDE 'serials/subscription_daily_choice.inc' %] >+ [% ELSIF (show_irregularity_options == 'month') %] >+ [% INCLUDE 'serials/subscription_monthly_choice.inc' %] >+ [% ELSIF (show_irregularity_options == 'week') %] >+ [% INCLUDE 'serials/subscription_weekly_choice.inc' %] >+ [% END %] > [% END %] > [% END %] > [% IF (predictions_loop) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index b1f3b46b63c..e768ad60e5a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -390,7 +390,7 @@ > <select name="numbering_pattern" id="numberpattern" class="required" required="required"> > <option value="">-- please choose --</option> > [% FOREACH numberpattern IN numberpatterns %] >- <option value="[% numberpattern.id | html %]" [% IF numberpattern.selected %]selected="selected"[% END %]> [% numberpattern.label | html %] </option> >+ <option value="[% numberpattern.id | html %]" [% IF numberpattern.selected %]selected="selected"[% END %]>[% numberpattern.label | html %]</option> > [% END %] > </select> > <span class="required">Required</span> >@@ -613,6 +613,7 @@ > [%- END -%] > var BOOKSELLER_IDS = [% To.json( bookseller_ids ) || '[]' | html %]; > </script> >+ [% Asset.js("js/subscription.js") | $raw %] > [% Asset.js("js/subscription-add.js") | $raw %] > [% Asset.js("js/showpredictionpattern.js") | $raw %] > [% Asset.js("js/additional-fields-entry.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt >index df8b47a6469..ac1bb8ac14f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt >@@ -2,6 +2,8 @@ > [% USE Koha %] > [% USE Branches %] > [% PROCESS 'i18n.inc' %] >+[% USE raw %] >+[% USE Asset %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title >@@ -60,12 +62,42 @@ > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-renew" /> > <input type="hidden" name="subscriptionid" value="[% subscription.subscriptionid | html %]" /> >+ <input type="hidden" id="frequency" value="[% subscription.periodicity | html %]" /> >+ <input type="hidden" id="acqui_date" value="[% subscription.firstacquidate | html %]" /> >+ <input type="hidden" id="nextacquidate" value="[% nextacquidate | html %]" /> >+ >+ <input type="hidden" id="to" value="[% enddate | html %]" /> >+ <input type="hidden" id="subtype" value="[% lengthtype | html %]" /> >+ <input type="hidden" id="sublength" value="[% sublength | html %]" /> >+ <input type="hidden" id="numberingmethod" value="[% numberpattern.numberingmethod | html %]" /> >+ <input type="hidden" id="lastvalue1" value="[% subscription.lastvalue1 | html %]" /> >+ <input type="hidden" id="lastvalue2" value="[% subscription.lastvalue2 | html %]" /> >+ <input type="hidden" id="lastvalue3" value="[% subscription.lastvalue3 | html %]" /> >+ <input type="hidden" id="add1" value="[% numberpattern.add1 | html %]" /> >+ <input type="hidden" id="add2" value="[% numberpattern.add2 | html %]" /> >+ <input type="hidden" id="add3" value="[% numberpattern.add3 | html %]" /> >+ <input type="hidden" id="every1" value="[% numberpattern.every1 | html %]" /> >+ <input type="hidden" id="every2" value="[% numberpattern.every2 | html %]" /> >+ <input type="hidden" id="every3" value="[% numberpattern.every3 | html %]" /> >+ <input type="hidden" id="innerloop1" value="[% subscription.innerloop1 | html %]" /> >+ <input type="hidden" id="innerloop2" value="[% subscription.innerloop2 | html %]" /> >+ <input type="hidden" id="innerloop3" value="[% subscription.innerloop3 | html %]" /> >+ <input type="hidden" id="setto1" value="[% numberpattern.setto1 | html %]" /> >+ <input type="hidden" id="setto2" value="[% numberpattern.setto2 | html %]" /> >+ <input type="hidden" id="setto3" value="[% numberpattern.setto3 | html %]" /> >+ <input type="hidden" id="numbering1" value="[% numberpattern.numbering1 | html %]" /> >+ <input type="hidden" id="numbering2" value="[% numberpattern.numbering2 | html %]" /> >+ <input type="hidden" id="numbering3" value="[% numberpattern.numbering3 | html %]" /> >+ <input type="hidden" id="whenmorethan1" value="[% numberpattern.whenmorethan1 | html %]" /> >+ <input type="hidden" id="whenmorethan2" value="[% numberpattern.whenmorethan2 | html %]" /> >+ <input type="hidden" id="whenmorethan3" value="[% numberpattern.whenmorethan3 | html %]" /> >+ <input type="hidden" id="locale" value="[% subscription.locale | html %]" /> > <fieldset class="rows" > ><legend>Subscription renewal for [% subscription.bibliotitle | html %]</legend> > <ol> > <li> > <label for="startdate">Start date: </label> >- <input type="text" size="10" id="startdate" name="startdate" value="[% startdate | html %]" class="flatpickr" /> >+ <input type="text" size="10" id="startdate" name="startdate" class="flatpickr" value="[% startdate | html %]" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li> >@@ -74,7 +106,12 @@ > [% FOREACH st IN [['numberlength', 'issues'], ['weeklength', 'weeks'], ['monthlength', 'months']] %] > [% SET subtype = st.0 %] > [% SET value = st.1 %] >- <option value="[% value | html %]" [% IF subscription.$subtype %]selected="selected"[% END %]> >+ <option >+ value="[% value | html %]" >+ [% IF subscription.$subtype %] >+ selected="selected" >+ [% END %] >+ > > [% SWITCH subtype %] > [% CASE 'numberlength' %] > <span>issues</span> >@@ -109,6 +146,8 @@ > <textarea name="note" id="note" rows="5" cols="50"></textarea> > </li> > [% END %] >+ >+ <li id="displayexample"></li> > </ol> > </fieldset> > <nav class="navbar navbar-default fixed-bottom"> >@@ -125,14 +164,22 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] > <script> >- $(document).ready(function () { >- $(".close").on("click", function (e) { >+ var subscriptionid = "[% subscription.subscriptionid | html %]"; >+ var irregularity = "[% subscription.irregularity | html %]"; >+ var more_than_one_serial = "[% more_than_one_serial | html %]"; >+ $(document).ready(function(){ >+ if (subscriptionid) { >+ testPredictionPattern(); >+ } >+ $(".close").on("click", function(e){ > e.preventDefault(); > window.opener.location.reload(false); > self.close(); > }); > }); > </script> >+ [% Asset.js("js/subscription.js") | $raw %] >+ [% Asset.js("js/showpredictionpattern.js") | $raw %] > [% END %] > </div> > [% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/showpredictionpattern.js b/koha-tmpl/intranet-tmpl/prog/js/showpredictionpattern.js >index 0b92ec67431..bd656b10e96 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/showpredictionpattern.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/showpredictionpattern.js >@@ -8,9 +8,28 @@ function Check_boxes(dow) { > $(this).prop("checked", false); > }); > } >+ return false; >+} >+function Check_permanent_irregularities() { >+ nothing_checked = 1; >+ $("input[name='irregularity']").each(function () { >+ if ($(this).is(":checked")) { >+ nothing_checked = 0; >+ } >+ }); >+ >+ // No day/month/week are checked, could be after a renewal. >+ // So check them according to permanent irregularity >+ if (nothing_checked) { >+ $(".skip").each(function () { >+ if ($(this).is(":checked")) { >+ Check_boxes($(this).data("dow")); >+ } >+ }); >+ } > } > $(document).ready(function () { >- $("#displayexample").on("change", ".skipday", function () { >+ $("#displayexample").on("change", ".skip", function (e) { > Check_boxes($(this).data("dow")); > }); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >index 1a7b10774ba..3e537cc2ee4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >@@ -689,7 +689,7 @@ function showPredictionPatternTest(data) { > $("#page_2 > div").attr("class", "col-sm-6"); > } > >-function hidePredcitionPatternTest() { >+function hidePredictionPatternTest() { > $("#displayexample").hide(); > $("#page_2 > div").attr( > "class", >@@ -858,7 +858,7 @@ $(document).ready(function () { > > $("#displayexample").on("click", "#hidepredictionpattern", function (e) { > e.preventDefault(); >- hidePredcitionPatternTest(); >+ hidePredictionPatternTest(); > }); > > $("#biblionumber").on("change", function () { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription.js b/koha-tmpl/intranet-tmpl/prog/js/subscription.js >new file mode 100644 >index 00000000000..3022ba8d5ad >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/subscription.js >@@ -0,0 +1,99 @@ >+var advancedpatternlocked; >+ >+function testPredictionPattern() { >+ var frequencyid = $("#frequency").val(); >+ var acquidate; >+ var error = 0; >+ var error_msg = ""; >+ if (frequencyid == undefined || frequencyid == "") { >+ error_msg += "- " + MSG_FREQUENCY_UNDEFINED + "\n"; >+ error++; >+ } >+ acquidate = $("#acqui_date").val(); >+ if (acquidate == undefined || acquidate == "") { >+ error_msg += "-" + MSG_PUB_DATE_UNDEFINED + "\n"; >+ error++; >+ } >+ if (more_than_one_serial !== "") { >+ var nextacquidate = $("#nextacquidate").val(); >+ if (nextacquidate == undefined || nextacquidate == "") { >+ error_msg += "-" + MSG_NEXT_ISSUE_UNDEFINED + "\n"; >+ error++; >+ } >+ } >+ >+ if (error) { >+ alert(MSG_PATTERN_TEST_FAILED.format(error_msg)); >+ return false; >+ } >+ >+ var custompattern = 0; >+ if (advancedpatternlocked == 0) { >+ custompattern = 1; >+ } >+ >+ var ajaxData = { >+ custompattern: custompattern, >+ firstacquidate: acquidate, >+ }; >+ >+ if (subscriptionid !== "") { >+ ajaxData.subscriptionid = subscriptionid; >+ } >+ if (more_than_one_serial !== "") { >+ ajaxData.nextacquidate = nextacquidate; >+ } >+ >+ var ajaxParams = [ >+ "to", >+ "subtype", >+ "sublength", >+ "frequency", >+ "numberingmethod", >+ "lastvalue1", >+ "lastvalue2", >+ "lastvalue3", >+ "add1", >+ "add2", >+ "add3", >+ "every1", >+ "every2", >+ "every3", >+ "innerloop1", >+ "innerloop2", >+ "innerloop3", >+ "setto1", >+ "setto2", >+ "setto3", >+ "numbering1", >+ "numbering2", >+ "numbering3", >+ "whenmorethan1", >+ "whenmorethan2", >+ "whenmorethan3", >+ "locale", >+ "sfdescription", >+ "unitsperissue", >+ "issuesperunit", >+ "unit", >+ ]; >+ for (i in ajaxParams) { >+ var param = ajaxParams[i]; >+ var value = $("#" + param).val(); >+ if (value && value.length > 0) ajaxData[param] = value; >+ } >+ >+ $.ajax({ >+ url: "/cgi-bin/koha/serials/showpredictionpattern.pl", >+ data: ajaxData, >+ success: function (data) { >+ showPredictionPatternTest(data); >+ patternneedtobetested = 0; >+ }, >+ }); >+} >+ >+function showPredictionPatternTest(data) { >+ $("#displayexample").html(data).show(); >+ $("#page_2 > div").attr("class", "col-xs-6"); >+} >diff --git a/serials/showpredictionpattern.pl b/serials/showpredictionpattern.pl >index 3a53b871a43..8e38e4b0b94 100755 >--- a/serials/showpredictionpattern.pl >+++ b/serials/showpredictionpattern.pl >@@ -30,11 +30,12 @@ publication date, based on frequency and first publication date. > > use Modern::Perl; > >-use CGI qw ( -utf8 ); >-use Date::Calc qw( Add_Delta_Days Add_Delta_YM Day_of_Week Delta_Days ); >-use C4::Auth qw( get_template_and_user ); >-use C4::Output qw( output_html_with_http_headers ); >-use C4::Serials qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq ); >+use CGI qw ( -utf8 ); >+use Date::Calc qw( Add_Delta_Days Add_Delta_YM Day_of_Week Delta_Days ); >+use C4::Auth qw( get_template_and_user ); >+use C4::Output qw( output_html_with_http_headers ); >+use C4::Serials >+ qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq ); > use C4::Serials::Frequency; > use Koha::DateUtils qw( dt_from_string ); > >@@ -119,15 +120,19 @@ if ( defined $subscriptionid ) { > > my @predictions_loop; > my ($calculated) = GetSeq( \%subscription, \%pattern ); >+my $dow = C4::Serials::issue_number( dt_from_string($date), $frequency->{unit} ); > push @predictions_loop, { > number => $calculated, > publicationdate => $date, > issuenumber => $issuenumber, >- dow => Day_of_Week( split /-/, $date ), >+ dow => $dow, > }; >-my @irreg = (); >+my @irreg = (); >+my @permanent_irreg = (); > if ( defined $subscriptionid ) { >- @irreg = C4::Serials::GetSubscriptionIrregularities($subscriptionid); >+ my $subscription_o = Koha::Subscriptions->find($subscriptionid); >+ @irreg = $subscription_o->irregularities; >+ @permanent_irreg = $subscription_o->permanent_irregularities; > while ( @irreg && $issuenumber > $irreg[0] ) { > shift @irreg; > } >@@ -146,7 +151,7 @@ while ( $i < 1000 ) { > } > if ( defined $date ) { > $line{'publicationdate'} = $date; >- $line{'dow'} = Day_of_Week( split /-/, $date ); >+ $line{dow} = C4::Serials::issue_number( dt_from_string($date), $frequency->{unit} ); > } > > # Check if we don't have exceed end date >@@ -193,8 +198,9 @@ $template->param( > > if ( $frequency->{unit} and not $custompattern ) { > $template->param( ask_for_irregularities => 1 ); >- if ( $frequency->{unit} eq 'day' and $frequency->{unitsperissue} == 1 ) { >- $template->param( daily_options => 1 ); >+ if ( $frequency->{unit} =~ /^(day|month|week)$/ and $frequency->{unitsperissue} == 1 ) { >+ $template->param( show_irregularity_options => $frequency->{unit} ); >+ $template->param( permanent_irreg => \@permanent_irreg ); > } > } > >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 16a6630fd52..1ba534f9209 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -259,46 +259,6 @@ sub get_letter_loop { > ]; > } > >-sub _guess_enddate { >- my ( $startdate_iso, $frequencyid, $numberlength, $weeklength, $monthlength ) = @_; >- my ( $year, $month, $day ); >- my $enddate; >- if ( $numberlength != 0 ) { >- my $frequency = GetSubscriptionFrequency($frequencyid); >- if ( $frequency->{'unit'} eq 'day' ) { >- ( $year, $month, $day ) = Add_Delta_Days( >- split( /-/, $startdate_iso ), >- $numberlength * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'} >- ); >- } elsif ( $frequency->{'unit'} eq 'week' ) { >- ( $year, $month, $day ) = Add_Delta_Days( >- split( /-/, $startdate_iso ), >- $numberlength * 7 * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'} >- ); >- } elsif ( $frequency->{'unit'} eq 'month' ) { >- ( $year, $month, $day ) = Add_Delta_YM( >- split( /-/, $startdate_iso ), 0, >- $numberlength * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'} >- ); >- } elsif ( $frequency->{'unit'} eq 'year' ) { >- ( $year, $month, $day ) = Add_Delta_YM( >- split( /-/, $startdate_iso ), >- $numberlength * $frequency->{'unitsperissue'} / $frequency->{'issuesperunit'}, 0 >- ); >- } >- } elsif ( $weeklength != 0 ) { >- ( $year, $month, $day ) = Add_Delta_Days( split( /-/, $startdate_iso ), $weeklength * 7 ); >- } elsif ( $monthlength != 0 ) { >- ( $year, $month, $day ) = Add_Delta_YM( split( /-/, $startdate_iso ), 0, $monthlength ); >- } >- if ( defined $year ) { >- $enddate = sprintf( "%04d-%02d-%02d", $year, $month, $day ); >- } else { >- undef $enddate; >- } >- return $enddate; >-} >- > sub redirect_add_subscription { > my $periodicity = $query->param('frequency'); > if ( $periodicity eq 'mana' ) { >@@ -314,14 +274,15 @@ sub redirect_add_subscription { > } > my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing( { $query->Vars } ); > >- my $auser = $query->param('user'); >- my $branchcode = $query->param('branchcode'); >- my $aqbooksellerid = $query->param('aqbooksellerid'); >- my $cost = $query->param('cost'); >- my $aqbudgetid = $query->param('aqbudgetid'); >- my @irregularity = $query->multi_param('irregularity'); >- my $locale = $query->param('locale'); >- my $graceperiod = $query->param('graceperiod') || 0; >+ my $auser = $query->param('user'); >+ my $branchcode = $query->param('branchcode'); >+ my $aqbooksellerid = $query->param('aqbooksellerid'); >+ my $cost = $query->param('cost'); >+ my $aqbudgetid = $query->param('aqbudgetid'); >+ my @irregularity = $query->multi_param('irregularity'); >+ my @permanent_irregularity = $query->multi_param('permanent_irregularity'); >+ my $locale = $query->param('locale'); >+ my $graceperiod = $query->param('graceperiod') || 0; > > my $subtype = $query->param('subtype'); > my $sublength = $query->param('sublength'); >@@ -363,21 +324,30 @@ sub redirect_add_subscription { > output_pref( { str => scalar $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } ); > > if ( !defined $enddate || $enddate eq '' ) { >+ my $subscription = Koha::Subscription->new( >+ { >+ startdate => $startdate, >+ periodicity => $periodicity, >+ weeklength => $weeklength, >+ monthlength => $monthlength, >+ numberlength => $numberlength >+ } >+ ); >+ > if ( $subtype eq "issues" ) { >- $enddate = _guess_enddate( $firstacquidate, $periodicity, $numberlength, $weeklength, $monthlength ); >- } else { >- $enddate = _guess_enddate( $startdate, $periodicity, $numberlength, $weeklength, $monthlength ); >+ $subscription->startdate($firstacquidate); > } >+ $enddate = $subscription->guess_enddate; > } > my $subscriptionid = NewSubscription( >- $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $biblionumber, >- $startdate, $periodicity, $numberlength, $weeklength, >- $monthlength, $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, >- $lastvalue3, $innerloop3, $status, $notes, $letter, $firstacquidate, >- join( ";", @irregularity ), $numberpattern, $locale, $callnumber, >- $manualhistory, $internalnotes, $serialsadditems, >- $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, >- $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template, >+ $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $biblionumber, >+ $startdate, $periodicity, $numberlength, $weeklength, >+ $monthlength, $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, >+ $lastvalue3, $innerloop3, $status, $notes, $letter, $firstacquidate, >+ join( ";", @irregularity ), join( ';', @permanent_irregularity ), $numberpattern, $locale, $callnumber, >+ $manualhistory, $internalnotes, $serialsadditems, >+ $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, >+ $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template, > $preselect_issues_in_collections_table > ); > if ( ( C4::Context->preference('Mana') == 1 ) >@@ -399,9 +369,10 @@ sub redirect_add_subscription { > } > > sub redirect_mod_subscription { >- my $subscriptionid = $query->param('subscriptionid'); >- my @irregularity = $query->multi_param('irregularity'); >- my $auser = $query->param('user'); >+ my $subscriptionid = $query->param('subscriptionid'); >+ my @irregularity = $query->multi_param('irregularity'); >+ my @permanent_irregularity = $query->multi_param('permanent_irregularity'); >+ my $auser = $query->param('user'); > my $librarian => scalar $query->param('librarian'), > my $branchcode = $query->param('branchcode'); > my $cost = $query->param('cost'); >@@ -472,11 +443,20 @@ sub redirect_mod_subscription { > > # Guess end date > if ( !defined $enddate || $enddate eq '' ) { >+ my $subscription = Koha::Subscription->new( >+ { >+ startdate => $startdate, >+ periodicity => $periodicity, >+ weeklength => $weeklength, >+ monthlength => $monthlength, >+ numberlength => $numberlength >+ } >+ ); >+ > if ( $subtype eq "issues" ) { >- $enddate = _guess_enddate( $nextacquidate, $periodicity, $numberlength, $weeklength, $monthlength ); >- } else { >- $enddate = _guess_enddate( $startdate, $periodicity, $numberlength, $weeklength, $monthlength ); >+ $subscription->startdate($nextacquidate); > } >+ $enddate = $subscription->guess_enddate; > } > > my $nextexpected = GetNextExpected($subscriptionid); >@@ -490,8 +470,8 @@ sub redirect_mod_subscription { > } > > ModSubscription( >- $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, >- $periodicity, $firstacquidate, join( ";", @irregularity ), >+ $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, >+ $periodicity, $firstacquidate, join( ";", @irregularity ), join( ';', @permanent_irregularity ), > $numberpattern, $locale, $numberlength, $weeklength, $monthlength, $lastvalue1, > $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, > $status, $biblionumber, $callnumber, $notes, $letter, >diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl >index 18c158e77d0..f01b3128181 100755 >--- a/serials/subscription-renew.pl >+++ b/serials/subscription-renew.pl >@@ -49,10 +49,13 @@ use Carp qw( carp ); > use C4::Koha; > use C4::Auth qw( get_template_and_user ); > use C4::Context; >-use C4::Auth qw( get_template_and_user ); >-use C4::Output qw( output_and_exit output_html_with_http_headers ); >-use C4::Serials qw( GetSubscription GetSubscriptionLength NewSubscription ReNewSubscription ); >+use C4::Auth qw( get_template_and_user ); >+use C4::Output qw( output_and_exit output_html_with_http_headers ); >+use C4::Serials qw( GetSubscription GetSubscriptionLength NewSubscription ReNewSubscription GetSerials GetNextExpected); >+use C4::Serials::Frequency; >+use C4::Serials::Numberpattern; > use Koha::DateUtils qw( dt_from_string output_pref ); >+use Date::Calc qw(Today Day_of_Year Week_of_Year Add_Delta_Days Add_Delta_YM); > > my $query = CGI->new; > my $dbh = C4::Context->dbh; >@@ -86,6 +89,7 @@ if ( $op eq "cud-renew" ) { > print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); > } > >+ my @irregularities = $query->param('irregularity'); > my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } ); > ( $numberlength, $weeklength, $monthlength ) = GetSubscriptionLength( $subtype, $sublength ); > ReNewSubscription( >@@ -115,6 +119,13 @@ if ( $op eq "cud-renew" ) { > monthlength => $subscription->{monthlength}, > } > ); >+ >+ $subscription = Koha::Subscriptions->find($subscriptionid); >+ my @irregularities = $subscription->guess_irregularities; >+ my @permanent_irregularities = $query->param('permanent_irregularity'); >+ $subscription->permanent_irregularity( join( ';', @permanent_irregularities ) ); >+ $subscription->irregularity( join( ';', @irregularities ) ); >+ $subscription->store; > } > } elsif ( $op eq 'multi_renew' ) { > my @subscriptions; >@@ -137,12 +148,45 @@ if ( $op eq "cud-renew" ) { > print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); > } > >- my $newstartdate = output_pref( { str => $subscription->{enddate}, dateonly => 1 } ) >- or output_pref( { dt => dt_from_string, dateonly => 1 } ); >+ my $newstartdate = output_pref( { str => $subscription->{enddate}, dateonly => 1, dateformat => 'iso' } ) >+ or output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ); >+ my ($serials_number) = GetSerials($subscriptionid); >+ if ( $serials_number > 1 ) { >+ $template->param( more_than_one_serial => 1 ); >+ } >+ >+ my $subscription_o = Koha::Subscriptions->find( $subscription->{subscriptionid} ); >+ my $lengthtype = $subscription_o->lengthtype; >+ my $nextexpected = GetNextExpected($subscriptionid); >+ $subscription_o->update( >+ { >+ startdate => $subscription->{enddate}, >+ periodicity => $subscription->{periodicity}, >+ weeklength => $subscription->{weeklength}, >+ monthlength => $subscription->{monthlength}, >+ numberlength => $subscription->{numberlength} >+ } >+ ); >+ my $enddate = $subscription_o->guess_enddate; >+ >+ my $sub_length; >+ foreach my $length_unit (qw(numberlength weeklength monthlength)) { >+ if ( $subscription->{$length_unit} ) { >+ $sub_length = $subscription->{$length_unit}; >+ last; >+ } >+ } >+ >+ my $numberpattern = GetSubscriptionNumberpattern( $subscription->{numberpattern} ); > > $template->param( >- startdate => $newstartdate, >- subscription => $subscription, >+ subscription => $subscription, >+ numberpattern => $numberpattern, >+ startdate => $newstartdate, >+ nextacquidate => $nextexpected->{planneddate}, >+ enddate => $enddate, >+ lengthtype => $lengthtype, >+ sublength => $sub_length, > ); > } > >diff --git a/t/Serials/IssueNumber.t b/t/Serials/IssueNumber.t >new file mode 100755 >index 00000000000..19997789e9b >--- /dev/null >+++ b/t/Serials/IssueNumber.t >@@ -0,0 +1,49 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <https://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 10; >+use Test::Warn; >+use Test::NoWarnings; >+use Test::Exception; >+ >+BEGIN { >+ use_ok('C4::Serials'); >+} >+ >+my $dt = DateTime->new( year => 2017, month => 1, day => 1 ); >+ >+throws_ok { C4::Serials::issue_number( '2017', 'day' ) } >+'Koha::Exceptions::WrongParameter', >+ 'Date passed to issue_number is not a valid DateTime object'; >+ >+is( C4::Serials::issue_number( $dt, 'day' ), 7, '2017-01-01 is the seventh day of week' ); >+ >+is( C4::Serials::issue_number( $dt, 'week' ), 52, '2017-01-01 is the week #52 of the year' ); >+ >+is( C4::Serials::issue_number( $dt, 'month' ), 1, '2017-01-01 is the first month of the year' ); >+ >+$dt = DateTime->new( year => 2022, month => 9, day => 17 ); >+ >+is( C4::Serials::issue_number( $dt, 'day' ), 6, '2022-09-17 is the sixth day of week' ); >+ >+is( C4::Serials::issue_number( $dt, 'week' ), 37, '2022-09-17 is the week #37 of the year' ); >+ >+is( C4::Serials::issue_number( $dt, 'month' ), 9, '2022-09-17 is the ninth month of the year' ); >+ >+is( C4::Serials::issue_number( $dt, 'foo' ), 0, 'issue_number return 0 for others issue type' ); >diff --git a/t/db_dependent/Koha/Subscription.t b/t/db_dependent/Koha/Subscription.t >index 9033e863b2f..062daa61269 100755 >--- a/t/db_dependent/Koha/Subscription.t >+++ b/t/db_dependent/Koha/Subscription.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 11; >+use Test::More tests => 12; > > use Koha::Database; > use Koha::Subscription; >@@ -126,6 +126,49 @@ subtest 'Koha::Subscription->frequency' => sub { > ); > }; > >+subtest 'Koha::Subscription::lengthtype' => sub { >+ plan tests => 3; >+ >+ my $subs = $builder->build( >+ { >+ source => 'Subscription', >+ value => { >+ numberlength => 7, >+ weeklength => 0, >+ monthlength => 0, >+ } >+ } >+ ); >+ my $subscription = Koha::Subscriptions->find( $subs->{subscriptionid} ); >+ is( $subscription->lengthtype, 'issues', 'Subscription with numberlength has issues type' ); >+ >+ my $subs2 = $builder->build( >+ { >+ source => 'Subscription', >+ value => { >+ numberlength => 0, >+ weeklength => 52, >+ monthlength => 0, >+ } >+ } >+ ); >+ my $subscription2 = Koha::Subscriptions->find( $subs2->{subscriptionid} ); >+ is( $subscription2->lengthtype, 'weeks', 'Subscription with weeklength has weeks type' ); >+ >+ my $subs3 = $builder->build( >+ { >+ source => 'Subscription', >+ value => { >+ numberlength => 0, >+ weeklength => 0, >+ monthlength => 12, >+ } >+ } >+ ); >+ my $subscription3 = Koha::Subscriptions->find( $subs3->{subscriptionid} ); >+ is( $subscription3->lengthtype, 'months', 'Subscription with monthlength has months type' ); >+}; >+ > my $nb_of_subs = Koha::Subscriptions->search->count; > my $biblio_1 = $builder->build_sample_biblio; > my $bi_1 = $biblio_1->biblioitem; >diff --git a/t/db_dependent/Koha/Subscription/GuessEnddate.t b/t/db_dependent/Koha/Subscription/GuessEnddate.t >new file mode 100755 >index 00000000000..8ac4a46f568 >--- /dev/null >+++ b/t/db_dependent/Koha/Subscription/GuessEnddate.t >@@ -0,0 +1,173 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <https://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 16; >+use Test::NoWarnings; >+use t::lib::TestBuilder; >+ >+use Koha::Database; >+use Koha::Subscriptions; >+ >+BEGIN { >+ use_ok('Koha::Subscriptions'); >+} >+ >+my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; >+ >+$schema->storage->txn_begin; >+ >+my $frequency = $builder->build( >+ { >+ source => 'SubscriptionFrequency', >+ value => { >+ unit => 'day', >+ unitsperissue => 1, >+ issuesperunit => 1 >+ } >+ } >+); >+ >+my $subscription = $builder->build( >+ { >+ source => 'Subscription', >+ value => { >+ startdate => '2018-01-01', >+ weeklength => 0, >+ monthlength => 0, >+ numberlength => 7, >+ periodicity => $frequency->{id}, >+ } >+ } >+); >+ >+$subscription = Koha::Subscriptions->find( $subscription->{subscriptionid} ); >+$frequency = $schema->resultset('SubscriptionFrequency')->find( $frequency->{id} ); >+is( $subscription->guess_enddate, '2018-01-08' ); >+ >+$frequency->update( >+ { >+ unit => 'day', >+ unitsperissue => 2, >+ issuesperunit => 1 >+ } >+); >+is( $subscription->guess_enddate, '2018-01-15' ); >+ >+$frequency->update( >+ { >+ unit => 'day', >+ unitsperissue => 1, >+ issuesperunit => 2 >+ } >+); >+is( $subscription->guess_enddate, '2018-01-04' ); >+ >+$frequency->update( >+ { >+ unit => 'week', >+ unitsperissue => 1, >+ issuesperunit => 1 >+ } >+); >+is( $subscription->guess_enddate, '2018-02-19' ); >+ >+$frequency->update( >+ { >+ unit => 'week', >+ unitsperissue => 2, >+ issuesperunit => 1 >+ } >+); >+is( $subscription->guess_enddate, '2018-04-09' ); >+ >+$frequency->update( >+ { >+ unit => 'week', >+ unitsperissue => 1, >+ issuesperunit => 2 >+ } >+); >+is( $subscription->guess_enddate, '2018-01-25' ); >+ >+$frequency->update( >+ { >+ unit => 'month', >+ unitsperissue => 1, >+ issuesperunit => 1 >+ } >+); >+is( $subscription->guess_enddate, '2018-08-01' ); >+ >+$frequency->update( >+ { >+ unit => 'month', >+ unitsperissue => 2, >+ issuesperunit => 1 >+ } >+); >+is( $subscription->guess_enddate, '2019-03-01' ); >+ >+$frequency->update( >+ { >+ unit => 'month', >+ unitsperissue => 1, >+ issuesperunit => 2 >+ } >+); >+is( $subscription->guess_enddate, '2018-04-01' ); >+ >+$frequency->update( >+ { >+ unit => 'year', >+ unitsperissue => 1, >+ issuesperunit => 1 >+ } >+); >+is( $subscription->guess_enddate, '2025-01-01' ); >+ >+$frequency->update( >+ { >+ unit => 'year', >+ unitsperissue => 2, >+ issuesperunit => 1 >+ } >+); >+is( $subscription->guess_enddate, '2032-01-01' ); >+ >+$frequency->update( >+ { >+ unit => 'year', >+ unitsperissue => 1, >+ issuesperunit => 2 >+ } >+); >+is( $subscription->guess_enddate, '2021-01-01' ); >+ >+$subscription->numberlength(0); >+$subscription->weeklength(2); >+$subscription->store; >+is( $subscription->guess_enddate, '2018-01-15' ); >+ >+$subscription->weeklength(0); >+$subscription->monthlength(1); >+$subscription->store; >+is( $subscription->guess_enddate, '2018-02-01' ); >+ >+$schema->storage->txn_rollback; >diff --git a/t/db_dependent/Koha/Subscription/Irregularities.t b/t/db_dependent/Koha/Subscription/Irregularities.t >new file mode 100755 >index 00000000000..055ed2284f4 >--- /dev/null >+++ b/t/db_dependent/Koha/Subscription/Irregularities.t >@@ -0,0 +1,201 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <https://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 3; >+use Test::NoWarnings; >+use t::lib::TestBuilder; >+ >+use C4::Serials; >+ >+use Koha::Database; >+use Koha::Subscriptions; >+ >+BEGIN { >+ use_ok('Koha::Subscriptions'); >+} >+ >+my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; >+ >+$schema->storage->txn_begin; >+ >+my $biblio = $builder->build( >+ { >+ source => 'Biblio', >+ } >+); >+ >+my $frequency = $builder->build( >+ { >+ source => 'SubscriptionFrequency', >+ value => { >+ unit => 'day', >+ unitsperissue => 1, >+ issuesperunit => 1 >+ } >+ } >+); >+ >+my $number_pattern = $builder->build( >+ { >+ source => 'SubscriptionNumberpattern', >+ value => { >+ numberingmethod => 'No.{X}', >+ add1 => 1, >+ every1 => 1, >+ whenmorethan1 => 99999, >+ setto1 => 1 >+ } >+ } >+); >+ >+my $subscription = $builder->build( >+ { >+ source => 'Subscription', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ startdate => '2018-05-07', >+ weeklength => 0, >+ monthlength => 0, >+ numberlength => 7, >+ periodicity => $frequency->{id}, >+ countissuesperunit => 1, >+ status => 1, >+ lastvalue1 => 5, >+ lastvalue2 => 0, >+ innerloop1 => 0, >+ innerloop2 => 0, >+ innerloop3 => 0, >+ lastvalue3 => 0, >+ firstacquidate => '2018-05-07', >+ irregularity => '3;4', >+ permanent_irregularity => '3;4', >+ numberpattern => $number_pattern->{id}, >+ enddate => '2018-05-13', >+ closed => 0 >+ } >+ } >+); >+ >+$builder->build( >+ { >+ source => 'Serial', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ subscriptionid => $subscription->{subscriptionid}, >+ serialseq => 'No.1', >+ serialseq_x => 1, >+ status => 2, >+ planneddate => '2018-05-07', >+ publisheddate => '2018-05-07', >+ } >+ } >+); >+ >+$builder->build( >+ { >+ source => 'Serial', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ subscriptionid => $subscription->{subscriptionid}, >+ serialseq => 'No.2', >+ serialseq_x => 2, >+ status => 2, >+ planneddate => '2018-05-08', >+ publisheddate => '2018-05-08', >+ } >+ } >+); >+ >+$builder->build( >+ { >+ source => 'Serial', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ subscriptionid => $subscription->{subscriptionid}, >+ serialseq => 'No.3', >+ serialseq_x => 3, >+ status => 2, >+ planneddate => '2018-05-11', >+ publisheddate => '2018-05-11', >+ } >+ } >+); >+ >+$builder->build( >+ { >+ source => 'Serial', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ subscriptionid => $subscription->{subscriptionid}, >+ serialseq => 'No.4', >+ serialseq_x => 4, >+ status => 2, >+ planneddate => '2018-05-12', >+ publisheddate => '2018-05-12', >+ } >+ } >+); >+ >+$builder->build( >+ { >+ source => 'Serial', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ subscriptionid => $subscription->{subscriptionid}, >+ serialseq => 'No.5', >+ serialseq_x => 5, >+ status => 2, >+ planneddate => '2018-05-13', >+ publisheddate => '2018-05-13', >+ } >+ } >+); >+ >+$builder->build( >+ { >+ source => 'Serial', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ subscriptionid => $subscription->{subscriptionid}, >+ serialseq => 'No.6', >+ serialseq_x => 6, >+ status => 1, >+ planneddate => '2018-05-14', >+ publisheddate => '2018-05-14', >+ } >+ } >+); >+ >+C4::Serials::ReNewSubscription( >+ { >+ subscriptionid => $subscription->{subscriptionid}, >+ user => undef, >+ startdate => $subscription->{enddate}, >+ numberlength => $subscription->{numberlength}, >+ weeklength => $subscription->{weeklength}, >+ monthlength => $subscription->{monthlength}, >+ } >+); >+ >+my $s = Koha::Subscriptions->find( $subscription->{subscriptionid} ); >+my $irregularities = join( ';', $s->guess_irregularities ); >+is( $irregularities, '10;11', 'Irregularities have been updated' ); >+ >+$schema->storage->txn_rollback; >diff --git a/t/db_dependent/Serials/SubscriptionIrregularity.t b/t/db_dependent/Serials/SubscriptionIrregularity.t >new file mode 100755 >index 00000000000..ef83f3be2c3 >--- /dev/null >+++ b/t/db_dependent/Serials/SubscriptionIrregularity.t >@@ -0,0 +1,37 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use t::lib::TestBuilder; >+use Test::More tests => 7; >+use Test::NoWarnings; >+use Koha::Database; >+ >+use_ok('Koha::Subscription'); >+ >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; >+ >+my $builder = t::lib::TestBuilder->new(); >+ >+my $subscription = $builder->build( >+ { >+ source => 'Subscription', >+ value => { >+ irregularity => '2;4;7', >+ permanent_irregularity => '1;2' >+ }, >+ } >+); >+ >+my $subscription_o = Koha::Subscriptions->find( $subscription->{subscriptionid} ); >+my @irreg = $subscription_o->irregularities; >+is( $irreg[0], 2, 'First element of irregularities is 2' ); >+is( $irreg[1], 4, 'Second element of irregularities is 4' ); >+is( $irreg[2], 7, 'Third element of irregularities is 7' ); >+ >+my @permanent_irreg = $subscription_o->permanent_irregularities; >+is( $permanent_irreg[0], 1, 'First element of permanent_irregularities is 1' ); >+is( $permanent_irreg[1], 2, 'Second element of permanent_irregularities is 2' ); >+ >+$schema->storage->txn_rollback; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17656
:
68259
|
68261
|
68607
|
68608
|
68665
|
69124
|
69207
|
69279
|
69553
|
69814
|
69820
|
69915
|
70335
|
70336
|
70430
|
70619
|
75403
|
75404
|
75405
|
75406
|
75407
|
75408
|
75721
|
75722
|
75723
|
75724
|
75725
|
75726
|
75953
|
102724
|
102725
|
102726
|
102727
|
102728
|
102729
|
102730
|
102860
|
102861
|
102862
|
102863
|
102864
|
102865
|
102866
|
102867
|
102960
|
102961
|
102962
|
102963
|
102964
|
102965
|
102966
|
102967
|
102968
|
103623
|
103624
|
103625
|
103626
|
103627
|
103628
|
103629
|
103630
|
103631
|
103657
|
103658
|
103659
|
103660
|
103661
|
103662
|
103663
|
103664
|
103665
|
103667
|
117789
|
117790
|
117791
|
117792
|
117846
|
117851
|
117852
|
118856
|
119106
|
120863
|
121082
|
121083
|
121084
|
121085
|
121086
|
121087
|
121088
|
121192
|
121193
|
121194
|
121195
|
121196
|
121197
|
121198
|
121296
|
121297
|
121298
|
121299
|
121300
|
121301
|
121302
|
128489
|
128491
|
128492
|
128493
|
128494
|
128495
|
128496
|
128498
|
128499
|
128500
|
128501
|
128502
|
128503
|
128504
|
132412
|
132413
|
132415
|
132416
|
132417
|
132418
|
132447
|
132448
|
132692
|
132779
|
177497
|
177498
|
177499
|
177500
|
177501
|
177502
|
177503
|
177504
|
177505
|
177663
|
177664
|
177665
|
177666
|
177667
|
177668
|
177669
|
177670
|
177671
|
177831
|
177832
|
177833
|
177834
|
177835
|
177836
|
177837
|
177838
|
177839
|
178142
|
185196
|
185197
|
185198
|
185199
|
185200
|
185201
|
185202
|
185203
|
185204
|
185205
|
185206
|
185207
|
185208
|
190714
|
190715
|
190716
|
190717
|
190718
|
190719
|
190720
|
190721
|
190722
|
190723
|
190724
|
190725
|
190726
|
192974
|
192975
| 192985 |
192986