$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
- $numberingmethod, $status, $notes, $serialsadditems)
+ $numberingmethod, $status, $notes, $serialsadditems, graceperiod)
Create a new subscription with value given on input args.
$lastvalue3, $innerloop3, $numberingmethod, $status,
$notes, $letter, $firstacquidate, $irregularity,
$numberpattern, $callnumber, $hemisphere, $manualhistory,
- $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount
+ $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
+ $graceperiod
) = @_;
my $dbh = C4::Context->dbh;
add2,every2,whenmorethan2,setto2,lastvalue2,innerloop2,
add3,every3,whenmorethan3,setto3,lastvalue3,innerloop3,
numberingmethod, status, notes, letter,firstacquidate,irregularity,
- numberpattern, callnumber, hemisphere,manualhistory,internalnotes,serialsadditems,staffdisplaycount,opacdisplaycount)
- VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
+ numberpattern, callnumber, hemisphere,manualhistory,internalnotes,serialsadditems,
+ staffdisplaycount,opacdisplaycount,graceperiod)
+ VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
|;
my $sth = $dbh->prepare($query);
$sth->execute(
$numberpattern, $callnumber,
$hemisphere, $manualhistory,
$internalnotes, $serialsadditems,
- $staffdisplaycount, $opacdisplaycount
+ $staffdisplaycount, $opacdisplaycount,
+ $graceperiod,
);
#then create the 1st waited number
$sth->execute($subscriptionid);
my ($res) = $sth->fetchrow ;
# warn "date expiration : ".$expirationdate." date courante ".$res;
- my @res=split /-/,$res;
+ my @res=split (/-/,$res);
@res=Date::Calc::Today if ($res[0]*$res[1]==0);
- my @endofsubscriptiondate=split/-/,$expirationdate;
+ my @endofsubscriptiondate=split(/-/,$expirationdate);
my $x;
if ( $per == 1 ) {$x=7;}
if ( $per == 2 ) {$x=7; }
);
if ($op eq 'addsubscription') {
- 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 $startdate = $query->param('startdate');
- my $firstacquidate = $query->param('firstacquidate');
- my $periodicity = $query->param('periodicity');
- my $dow = $query->param('dow');
- my @irregularity = $query->param('irregularity_select');
- my $numberlength = 0;
- my $weeklength = 0;
- my $monthlength = 0;
- my $numberpattern = $query->param('numbering_pattern');
- my $sublength = $query->param('sublength');
- my $subtype = $query->param('subtype');
+ 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 $startdate = $query->param('startdate');
+ my $firstacquidate = $query->param('firstacquidate');
+ my $periodicity = $query->param('periodicity');
+ my $dow = $query->param('dow');
+ my @irregularity = $query->param('irregularity_select');
+ my $numberlength = 0;
+ my $weeklength = 0;
+ my $monthlength = 0;
+ my $numberpattern = $query->param('numbering_pattern');
+ my $sublength = $query->param('sublength');
+ my $subtype = $query->param('subtype');
+ my $graceperiod = $query->param('graceperiod') || 0;
+
if ($subtype eq 'months'){
$monthlength = $sublength;
} elsif ($subtype eq 'weeks'){
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
$numberingmethod, $status, $notes,$letter,$firstacquidate,join(",",@irregularity),
$numberpattern, $callnumber, $hemisphere,($manualhistory?$manualhistory:0),$internalnotes,
- $serialsadditems,$staffdisplaycount,$opacdisplaycount
+ $serialsadditems,$staffdisplaycount,$opacdisplaycount,$graceperiod
);
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");