- my $histenddate = format_date_in_iso($query->param('histenddate'));
- my $histstartdate = format_date_in_iso($query->param('histstartdate'));
- my $recievedlist = $query->param('recievedlist');
- my $missinglist = $query->param('missinglist');
- my $opacnote = $query->param('opacnote');
- my $librariannote = $query->param('librariannote');
- my $subscriptionid = NewSubscription($auser,$branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
- $startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
- $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
- $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
- $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
- $numberingmethod, $status, $notes,$letter,$firstacquidate,join(",",@irregularity),
- $numberpattern, $callnumber, $hemisphere,($manualhistory?$manualhistory:0),$internalnotes,
- $serialsadditems,$staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate
- );
- ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote);
+ if(!defined $enddate || $enddate eq '') {
+ if($subtype eq "issues") {
+ $enddate = _guess_enddate($firstacquidate, $periodicity, $numberlength, $weeklength, $monthlength);
+ } else {
+ $enddate = _guess_enddate($startdate, $periodicity, $numberlength, $weeklength, $monthlength);
+ }
+ }
+
+ 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
+ );