diff --git a/C4/Serials.pm b/C4/Serials.pm
index dccfa6c155..ce1b22f502 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -815,7 +815,7 @@ sub GetPreviousSerialid {
my (
$nextseq, $newlastvalue1, $newlastvalue2, $newlastvalue3,
$newinnerloop1, $newinnerloop2, $newinnerloop3
- ) = GetNextSeq( $subscription, $pattern, $frequency, $planneddate );
+ ) = GetNextSeq( $subscription, $pattern, $frequency, $planneddate, $count_forward );
$subscription is a hashref containing all the attributes of the table
'subscription'.
@@ -823,18 +823,19 @@ $pattern is a hashref containing all the attributes of the table
'subscription_numberpatterns'.
$frequency is a hashref containing all the attributes of the table 'subscription_frequencies'
$planneddate is a date string in iso format.
+$count_forward is the number of issues to count forward, defaults to 1 if omitted
This function get the next issue for the subscription given on input arg
=cut
sub GetNextSeq {
- my ($subscription, $pattern, $frequency, $planneddate) = @_;
+ my ($subscription, $pattern, $frequency, $planneddate, $count_forward) = @_;
return unless ($subscription and $pattern);
my ( $newlastvalue1, $newlastvalue2, $newlastvalue3,
$newinnerloop1, $newinnerloop2, $newinnerloop3 );
- my $count = 1;
+ my $count = $count_forward ? $count_forward : 1;
if ($subscription->{'skip_serialseq'}) {
my @irreg = split /;/, $subscription->{'irregularity'};
@@ -1074,7 +1075,7 @@ sub ModSubscriptionHistory {
=head2 ModSerialStatus
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate,
- $publisheddatetext, $status, $notes);
+ $publisheddatetext, $status, $notes, $count_forward);
This function modify the serial status. Serial status is a number.(eg 2 is "arrived")
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry
@@ -1083,10 +1084,12 @@ Note : if we change from "waited" to something else,then we will have to create
sub ModSerialStatus {
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext,
- $status, $notes) = @_;
+ $status, $notes, $count_forward) = @_;
return unless ($serialid);
+ my $count = $count_forward ? $count_forward : 1;
+
#It is a usual serial
# 1st, get previous status :
my $dbh = C4::Context->dbh;
@@ -1155,7 +1158,7 @@ sub ModSerialStatus {
$newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3,
$newinnerloop1, $newinnerloop2, $newinnerloop3
)
- = GetNextSeq( $subscription, $pattern, $frequency, $publisheddate );
+ = GetNextSeq( $subscription, $pattern, $frequency, $publisheddate, $count );
# next date (calculated from actual date & frequency parameters)
my $nextpublisheddate = GetNextDate($subscription, $publisheddate, $frequency, 1);
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/serials_skip_issues.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/serials_skip_issues.inc
new file mode 100644
index 0000000000..86700511a8
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/serials_skip_issues.inc
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
index ea9775f66a..d28b403f60 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
@@ -37,6 +37,8 @@
[% INCLUDE 'modals/serials_multi_receiving.inc' %]
+ [% INCLUDE 'modals/serials_skip_issues.inc' %]
+
[% UNLESS ( popup ) %]
[% INCLUDE 'serials-toolbar.inc' %]
@@ -182,6 +184,9 @@
+
+
+
[% IF ( subscriptions.size == 1 and !serialsadditems ) %]
[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
index b20db8cba4..5b25284910 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
@@ -12,6 +12,26 @@
$('#multi_receiving').on('show', function () {
$(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
});
+
+ $("form").on("submit", function(){
+ let issues = $('input[name="skip_issues"]').val() ? $('input[name="skip_issues"]').val() : '';
+ let too_many = _("Choose a value between 0-10 in issues to skip!");
+ let no_number = _("Not a number in skip issues!");
+
+ if ( issues == '' || ( issues.match(/^\d+$/) && issues <= 10 ) ) {
+ return true;
+ }
+ else if ( issues.match(/^\d+$/) && issues > 10 ) {
+ alert(too_many);
+ return false;
+ } else if ( !issues.match(/^\d+$/) ) {
+ alert(no_number);
+ return false;
+ }
+ else {
+ return false;
+ }
+ });
});
function popup(subscriptionid) {
@@ -62,6 +82,14 @@ $(document).ready(function() {
}
return true;
});
+
+ $("#toggle_skip_issues").on("change", function() {
+ if (this.checked) {
+ $("#skip_issues").removeClass("collapse").prop("disabled", false);
+ } else {
+ $("#skip_issues").addClass("collapse").prop("disabled", true);
+ }
+ });
});
//]]>
@@ -327,6 +355,9 @@ $(document).ready(function() {
[% END %]
[% END %]
[% END %]
+