- &ModSubscription(
- $auser, $branchcode, $aqbooksellerid, $cost,
- $aqbudgetid, $startdate, $periodicity, $firstacquidate,
- $dow, $irregularity, $numberpattern, $numberlength,
- $weeklength, $monthlength, $add1, $every1,
- $whenmorethan1, $setto1, $lastvalue1, $innerloop1,
- $add2, $every2, $whenmorethan2, $setto2,
- $lastvalue2, $innerloop2, $add3, $every3,
- $whenmorethan3, $setto3, $lastvalue3, $innerloop3,
- $numberingmethod, $status, $biblionumber, $callnumber,
- $notes, $letter, $hemisphere, $manualhistory,$internalnotes,
- $subscriptionid);
-
- ModSubscriptionHistory ($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
+ my $history_only = $query->param('history_only');
+ # If it's a mod, we need to check the current 'expected' issue, and mod it in the serials table if necessary.
+ if ( $nextacquidate ne $nextexpected->{planneddate}->output('iso') ) {
+ ModNextExpected($subscriptionid,C4::Dates->new($nextacquidate,'iso'));
+ # if we have not received any issues yet, then we also must change the firstacquidate for the subs.
+ $firstissuedate = $nextacquidate if($nextexpected->{isfirstissue});
+ }
+
+ if ($history_only) {
+ ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote);
+ } else {
+ &ModSubscription(
+ $auser, $branchcode, $aqbooksellerid, $cost,
+ $aqbudgetid, $startdate, $periodicity, $firstissuedate,
+ $dow, join(",",@irregularity), $numberpattern, $numberlength,
+ $weeklength, $monthlength, $add1, $every1,
+ $whenmorethan1, $setto1, $lastvalue1, $innerloop1,
+ $add2, $every2, $whenmorethan2, $setto2,
+ $lastvalue2, $innerloop2, $add3, $every3,
+ $whenmorethan3, $setto3, $lastvalue3, $innerloop3,
+ $numberingmethod, $status, $biblionumber, $callnumber,
+ $notes, $letter, $hemisphere, $manualhistory,$internalnotes,
+ $serialsadditems, $subscriptionid,
+ );
+ }