From 029157a2910b8d7b1d79e380ea4409b546fe3c2f Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 12 Jun 2017 11:51:43 +0200 Subject: [PATCH] Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago Rescued-by: Martin Renvoize --- C4/Letters.pm | 12 +- C4/Serials.pm | 189 +++++++++--------- .../data/mysql/atomicupdate/bug-18783.pl | 23 +++ installer/data/mysql/kohastructure.sql | 1 + .../en/modules/serials/subscription-add.tt | 8 + .../en/modules/serials/subscription-detail.tt | 1 + misc/cronjobs/serialsClaim.pl | 124 ++++++++++++ serials/subscription-add.pl | 122 +++++------ 8 files changed, 324 insertions(+), 156 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug-18783.pl create mode 100755 misc/cronjobs/serialsClaim.pl diff --git a/C4/Letters.pm b/C4/Letters.pm index e070697df4..56a002435a 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -479,7 +479,13 @@ sub SendAlerts { $letter->{content} =~ s/(.*?)<\/order>/$1/gxms; # ... then send mail + my $from; my $library = Koha::Libraries->find( $userenv->{branch} ); + if ($library and $library->branchemail) { + $from = $library->branchemail; + } else { + $from = C4::Context->preference('KohaAdminEmailAddress'); + } my $mail = Koha::Email->create( { to => join( ',', @email ), @@ -493,8 +499,7 @@ sub SendAlerts { ? ( bcc => $userenv->{emailaddress} ) : () ), - from => $library->branchemail - || C4::Context->preference('KohaAdminEmailAddress'), + from => $from, subject => "" . $letter->{title}, } ); @@ -507,7 +512,8 @@ sub SendAlerts { } my $success = try { - $mail->send_or_die({ transport => $library->smtp_server->transport }); + my $smtp_server = $library ? $library->smtp_server : Koha::SMTP::Servers->get_default; + $mail->send_or_die({ transport => $smtp_server->transport }); } catch { # We expect ref($_) eq 'Email::Sender::Failure' diff --git a/C4/Serials.pm b/C4/Serials.pm index b01172dc10..a0b37f460d 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1285,58 +1285,60 @@ 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, - $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, - $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, - $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template + $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, + $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, + $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, + $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template, + $auto_claim_enabled ) = @_; my $subscription = Koha::Subscriptions->find($subscriptionid); $subscription->set( { - librarian => $auser, - branchcode => $branchcode, - aqbooksellerid => $aqbooksellerid, - cost => $cost, - aqbudgetid => $aqbudgetid, - biblionumber => $biblionumber, - startdate => $startdate, - periodicity => $periodicity, - numberlength => $numberlength, - weeklength => $weeklength, - monthlength => $monthlength, - lastvalue1 => $lastvalue1, - innerloop1 => $innerloop1, - lastvalue2 => $lastvalue2, - innerloop2 => $innerloop2, - lastvalue3 => $lastvalue3, - innerloop3 => $innerloop3, - status => $status, - notes => $notes, - letter => $letter, - firstacquidate => $firstacquidate, - irregularity => $irregularity, - numberpattern => $numberpattern, - locale => $locale, - callnumber => $callnumber, - manualhistory => $manualhistory, - internalnotes => $internalnotes, - serialsadditems => $serialsadditems, - staffdisplaycount => $staffdisplaycount, - opacdisplaycount => $opacdisplaycount, - graceperiod => $graceperiod, - location => $location, - enddate => $enddate, - skip_serialseq => $skip_serialseq, - itemtype => $itemtype, - previousitemtype => $previousitemtype, - mana_id => $mana_id, - ccode => $ccode, + librarian => $auser, + branchcode => $branchcode, + aqbooksellerid => $aqbooksellerid, + cost => $cost, + aqbudgetid => $aqbudgetid, + biblionumber => $biblionumber, + startdate => $startdate, + periodicity => $periodicity, + numberlength => $numberlength, + weeklength => $weeklength, + monthlength => $monthlength, + lastvalue1 => $lastvalue1, + innerloop1 => $innerloop1, + lastvalue2 => $lastvalue2, + innerloop2 => $innerloop2, + lastvalue3 => $lastvalue3, + innerloop3 => $innerloop3, + status => $status, + notes => $notes, + letter => $letter, + firstacquidate => $firstacquidate, + irregularity => $irregularity, + numberpattern => $numberpattern, + locale => $locale, + callnumber => $callnumber, + manualhistory => $manualhistory, + internalnotes => $internalnotes, + serialsadditems => $serialsadditems, + staffdisplaycount => $staffdisplaycount, + opacdisplaycount => $opacdisplaycount, + graceperiod => $graceperiod, + location => $location, + enddate => $enddate, + skip_serialseq => $skip_serialseq, + itemtype => $itemtype, + previousitemtype => $previousitemtype, + mana_id => $mana_id, + ccode => $ccode, published_on_template => $published_on_template, + auto_claim_enabled => $auto_claim_enabled // 0, } )->store; # FIXME Must be $subscription->serials @@ -1368,58 +1370,59 @@ 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, + $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, $auto_claim_enabled ) = @_; my $dbh = C4::Context->dbh; my $subscription = Koha::Subscription->new( { - librarian => $auser, - branchcode => $branchcode, - aqbooksellerid => $aqbooksellerid, - cost => $cost, - aqbudgetid => $aqbudgetid, - biblionumber => $biblionumber, - startdate => $startdate, - periodicity => $periodicity, - numberlength => $numberlength, - weeklength => $weeklength, - monthlength => $monthlength, - lastvalue1 => $lastvalue1, - innerloop1 => $innerloop1, - lastvalue2 => $lastvalue2, - innerloop2 => $innerloop2, - lastvalue3 => $lastvalue3, - innerloop3 => $innerloop3, - status => $status, - notes => $notes, - letter => $letter, - firstacquidate => $firstacquidate, - irregularity => $irregularity, - numberpattern => $numberpattern, - locale => $locale, - callnumber => $callnumber, - manualhistory => $manualhistory, - internalnotes => $internalnotes, - serialsadditems => $serialsadditems, - staffdisplaycount => $staffdisplaycount, - opacdisplaycount => $opacdisplaycount, - graceperiod => $graceperiod, - location => $location, - enddate => $enddate, - skip_serialseq => $skip_serialseq, - itemtype => $itemtype, - previousitemtype => $previousitemtype, - mana_id => $mana_id, - ccode => $ccode, + librarian => $auser, + branchcode => $branchcode, + aqbooksellerid => $aqbooksellerid, + cost => $cost, + aqbudgetid => $aqbudgetid, + biblionumber => $biblionumber, + startdate => $startdate, + periodicity => $periodicity, + numberlength => $numberlength, + weeklength => $weeklength, + monthlength => $monthlength, + lastvalue1 => $lastvalue1, + innerloop1 => $innerloop1, + lastvalue2 => $lastvalue2, + innerloop2 => $innerloop2, + lastvalue3 => $lastvalue3, + innerloop3 => $innerloop3, + status => $status, + notes => $notes, + letter => $letter, + firstacquidate => $firstacquidate, + irregularity => $irregularity, + numberpattern => $numberpattern, + locale => $locale, + callnumber => $callnumber, + manualhistory => $manualhistory, + internalnotes => $internalnotes, + serialsadditems => $serialsadditems, + staffdisplaycount => $staffdisplaycount, + opacdisplaycount => $opacdisplaycount, + graceperiod => $graceperiod, + location => $location, + enddate => $enddate, + skip_serialseq => $skip_serialseq, + itemtype => $itemtype, + previousitemtype => $previousitemtype, + mana_id => $mana_id, + ccode => $ccode, published_on_template => $published_on_template, + auto_claim_enabled => $auto_claim_enabled // 0, } )->store; $subscription->discard_changes; @@ -1859,7 +1862,7 @@ sub GetLateOrMissingIssues { if ($supplierid) { $sth = $dbh->prepare( "SELECT - serialid, aqbooksellerid, name, + serialid, serial.aqbooksellerid, name, biblio.title, biblioitems.issn, planneddate, serialseq, serial.status, serial.subscriptionid, claimdate, claims_count, subscription.branchcode, serial.publisheddate diff --git a/installer/data/mysql/atomicupdate/bug-18783.pl b/installer/data/mysql/atomicupdate/bug-18783.pl new file mode 100755 index 0000000000..a54c9de823 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-18783.pl @@ -0,0 +1,23 @@ +use Modern::Perl; + +return { + bug_number => "18783", + description => "Automatic claims for serials", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( column_exists( 'subscription', 'auto_claim_enabled' ) ) { + $dbh->do( + q{ + ALTER TABLE subscription + ADD COLUMN auto_claim_enabled tinyint NOT NULL DEFAULT 0 COMMENT 'enable automatic claiming' AFTER previousitemtype + } + ); + + say $out "Added column subscription.auto_claim_enabled"; + } else { + say $out "Column subscription.auto_claim_enabled already exists"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 21f6ec015c..f74e184262 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -5535,6 +5535,7 @@ CREATE TABLE `subscription` ( `previousitemtype` varchar(10) DEFAULT NULL, `mana_id` int(11) DEFAULT NULL, `ccode` varchar(80) DEFAULT NULL COMMENT 'collection code to assign to serial items', + `auto_claim_enabled` tinyint NOT NULL DEFAULT 0 COMMENT 'enable automatic claiming', `published_on_template` TEXT DEFAULT NULL COMMENT 'Template Toolkit syntax to generate the default "Published on (text)" field when receiving an issue this serial', PRIMARY KEY (`subscriptionid`), KEY `subscription_ibfk_1` (`periodicity`), 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 19d53a1c33..6ae9f65808 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 @@ -237,6 +237,14 @@ fieldset.rows table { clear: none; margin: 0; } day(s) +
  • + + [% IF auto_claim_enabled %] + + [% ELSE %] + + [% END %] +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index 3d3d5a5052..969dc58646 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -126,6 +126,7 @@ [% END %]
  • Grace period: [% graceperiod | html %]
  • +
  • Automatic claims: [% IF auto_claim_enabled %]Enabled[% ELSE %]Disabled[% END %]
  • diff --git a/misc/cronjobs/serialsClaim.pl b/misc/cronjobs/serialsClaim.pl new file mode 100755 index 0000000000..4ae32fbf88 --- /dev/null +++ b/misc/cronjobs/serialsClaim.pl @@ -0,0 +1,124 @@ +#!/usr/bin/perl + +# Copyright 2017 Biblibre +# +# 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 . + +=head1 NAME + +serialsClaims.pl - Send claim notice to suppliers that have late or missing issues + +=head1 SYNOPSIS + +serialsClaims.pl --letter-code LETTER_CODE [--max-claims MAX_CLAIMS] + +Options: + --letter-code LETTER_CODE Mandatory. Use letter LETTER_CODE. + --max-claims MAX_CLAIMS Send up to MAX_CLAIMS notices + +=cut + +use Modern::Perl; + +use Getopt::Long; + +use Koha::Acquisition::Booksellers; +use Koha::DateUtils qw( dt_from_string ); +use Koha::Subscriptions; + +use C4::Context; +use C4::Letters; +use C4::Serials; + +sub usage { + return < \$help, + 'letter-code=s' => \$letter_code, + 'max-claims=i' => \$max_claims, +) or die usage(); + +if ($help) { + say usage(); + exit; +} + +die usage() unless $letter_code; + +my $suppliers = C4::Serials::GetSuppliersWithLateIssues(); +foreach my $supplier (@$suppliers) { + my $bookseller = Koha::Acquisition::Booksellers->find( $supplier->{id} ); + my $supplierinfo = $bookseller->name . ' (' . $bookseller->id . ')'; + + my $deliverytime = $bookseller->deliverytime; + unless ($deliverytime) { + say STDERR + "Warning: There is no delivery time set for supplier $supplierinfo. Automatic claiming is disabled for this supplier."; + next; + } + + my @serials = C4::Serials::GetLateOrMissingIssues( $bookseller->id ); + my @serialids; + foreach my $serial (@serials) { + if ( $max_claims && $serial->{claims_count} >= $max_claims ) { + say "Maximum claims count reached for serial " . $serial->{serialid}; + next; + } + + my $subscription = Koha::Subscriptions->find( $serial->{subscriptionid} ); + next unless $subscription->auto_claim_enabled; + + my $claims_count = $serial->{claims_count}; + my $date = $serial->{claimdate} ? $serial->{claimdate} : $serial->{planneddate}; + my $newclaimdate = dt_from_string($date)->add( days => $deliverytime ); + my $now = dt_from_string; + + if ( $newclaimdate <= $now ) { + push @serialids, $serial->{serialid}; + } + } + + if (@serialids) { + my $err; + eval { + $err = C4::Letters::SendAlerts( 'claimissues', \@serialids, $letter_code ); + if ( not ref $err or not exists $err->{error} ) { + C4::Serials::updateClaim( \@serialids ); + } + }; + if ($@) { + say STDERR "Error: $@ while claiming serials " . join( ',', @serialids ); + } elsif ( ref $err and exists $err->{error} ) { + if ( $err->{error} eq "no_email" ) { + say STDERR "Error: Supplier $supplierinfo has no email"; + } elsif ( $err->{error} =~ m|Bad or missing From address| ) { + say STDERR "Error: Supplier $supplierinfo has no email"; + } else { + say STDERR "Error: " . $err->{error}; + } + } else { + say "Claim sent to $supplierinfo for serials " . join( ',', @serialids ); + } + } +} diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index f8cbc572f2..94cec745e3 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -308,29 +308,30 @@ sub redirect_add_subscription { my $sublength = $query->param('sublength'); my ( $numberlength, $weeklength, $monthlength ) = GetSubscriptionLength( $subtype, $sublength ); - my $add1 = $query->param('add1'); - my $lastvalue1 = $query->param('lastvalue1'); - my $innerloop1 = $query->param('innerloop1'); - my $innerloop2 = $query->param('innerloop2'); - my $lastvalue2 = $query->param('lastvalue2'); - my $lastvalue3 = $query->param('lastvalue3'); - my $innerloop3 = $query->param('innerloop3'); - my $status = 1; - my $biblionumber = $query->param('biblionumber'); - my $callnumber = $query->param('callnumber'); - my $notes = $query->param('notes'); - my $internalnotes = $query->param('internalnotes'); - my $letter = $query->param('letter'); - my $manualhistory = $query->param('manualhist') ? 1 : 0; - my $serialsadditems = $query->param('serialsadditems'); - my $staffdisplaycount = $query->param('staffdisplaycount'); - my $opacdisplaycount = $query->param('opacdisplaycount'); - my $location = $query->param('location'); - my $itemtype = $query->param('itemtype'); - my $previousitemtype = $query->param('previousitemtype'); - my $skip_serialseq = $query->param('skip_serialseq'); - my $ccode = $query->param('ccode'); + my $add1 = $query->param('add1'); + my $lastvalue1 = $query->param('lastvalue1'); + my $innerloop1 = $query->param('innerloop1'); + my $innerloop2 = $query->param('innerloop2'); + my $lastvalue2 = $query->param('lastvalue2'); + my $lastvalue3 = $query->param('lastvalue3'); + my $innerloop3 = $query->param('innerloop3'); + my $status = 1; + my $biblionumber = $query->param('biblionumber'); + my $callnumber = $query->param('callnumber'); + my $notes = $query->param('notes'); + my $internalnotes = $query->param('internalnotes'); + my $letter = $query->param('letter'); + my $manualhistory = $query->param('manualhist') ? 1 : 0; + my $serialsadditems = $query->param('serialsadditems'); + my $staffdisplaycount = $query->param('staffdisplaycount'); + my $opacdisplaycount = $query->param('opacdisplaycount'); + my $location = $query->param('location'); + my $itemtype = $query->param('itemtype'); + my $previousitemtype = $query->param('previousitemtype'); + my $skip_serialseq = $query->param('skip_serialseq'); + my $ccode = $query->param('ccode'); my $published_on_template = $query->param('published_on_template'); + my $auto_claim_enabled = $query->param('auto_claim_enabled'); my $mana_id; if ( $query->param('mana_id') ne "" ) { @@ -350,14 +351,14 @@ sub redirect_add_subscription { } } 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 ), $numberpattern, $locale, $callnumber, + $manualhistory, $internalnotes, $serialsadditems, + $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, + $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template, $auto_claim_enabled ); if ( (C4::Context->preference('Mana') == 1) and ( grep { $_ eq "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){ my $result = Koha::SharedContent::send_entity( $query->param('mana_language') || '', $loggedinuser, $subscriptionid, 'subscription'); @@ -417,29 +418,30 @@ sub redirect_mod_subscription { my $subtype = $query->param('subtype'); my $sublength = $query->param('sublength'); my ($numberlength, $weeklength, $monthlength) = GetSubscriptionLength( $subtype, $sublength ); - my $locale = $query->param('locale'); - my $lastvalue1 = $query->param('lastvalue1'); - my $innerloop1 = $query->param('innerloop1'); - my $lastvalue2 = $query->param('lastvalue2'); - my $innerloop2 = $query->param('innerloop2'); - my $lastvalue3 = $query->param('lastvalue3'); - my $innerloop3 = $query->param('innerloop3'); - my $status = 1; - my $callnumber = $query->param('callnumber'); - my $notes = $query->param('notes'); - my $internalnotes = $query->param('internalnotes'); - my $letter = $query->param('letter'); - my $manualhistory = $query->param('manualhist') ? 1 : 0; - my $serialsadditems = $query->param('serialsadditems'); - my $staffdisplaycount = $query->param('staffdisplaycount'); - my $opacdisplaycount = $query->param('opacdisplaycount'); - my $graceperiod = $query->param('graceperiod') || 0; - my $location = $query->param('location'); - my $itemtype = $query->param('itemtype'); - my $previousitemtype = $query->param('previousitemtype'); - my $skip_serialseq = $query->param('skip_serialseq'); - my $ccode = $query->param('ccode'); + my $locale = $query->param('locale'); + my $lastvalue1 = $query->param('lastvalue1'); + my $innerloop1 = $query->param('innerloop1'); + my $lastvalue2 = $query->param('lastvalue2'); + my $innerloop2 = $query->param('innerloop2'); + my $lastvalue3 = $query->param('lastvalue3'); + my $innerloop3 = $query->param('innerloop3'); + my $status = 1; + my $callnumber = $query->param('callnumber'); + my $notes = $query->param('notes'); + my $internalnotes = $query->param('internalnotes'); + my $letter = $query->param('letter'); + my $manualhistory = $query->param('manualhist') ? 1 : 0; + my $serialsadditems = $query->param('serialsadditems'); + my $staffdisplaycount = $query->param('staffdisplaycount'); + my $opacdisplaycount = $query->param('opacdisplaycount'); + my $graceperiod = $query->param('graceperiod') || 0; + my $location = $query->param('location'); + my $itemtype = $query->param('itemtype'); + my $previousitemtype = $query->param('previousitemtype'); + my $skip_serialseq = $query->param('skip_serialseq'); + my $ccode = $query->param('ccode'); my $published_on_template = $query->param('published_on_template'); + my $auto_claim_enabled = $query->param('auto_claim_enabled'); my $mana_id; if ( $query->param('mana_id') ne "" ) { @@ -468,14 +470,14 @@ sub redirect_mod_subscription { } ModSubscription( - $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, - $periodicity, $firstacquidate, join(";",@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 + $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, + $periodicity, $firstacquidate, join( ";", @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, $auto_claim_enabled ); my @additional_fields; -- 2.41.0