reintroducing the limit on itemtype when searching a biblio in subscription add
[koha.git] / serials / subscription-detail.pl
index c1c465d..94242ec 100755 (executable)
@@ -19,7 +19,7 @@ use strict;
 use CGI;
 use C4::Auth;
 use C4::Koha;
-use C4::Dates;
+use C4::Dates qw/format_date/;
 use C4::Serials;
 use C4::Output;
 use C4::Context;
@@ -34,6 +34,7 @@ my $sth;
 my ($template, $loggedinuser, $cookie, $hemisphere);
 my $subscriptionid = $query->param('subscriptionid');
 my $subs = &GetSubscription($subscriptionid);
+
 $subs->{enddate} = GetExpirationDate($subscriptionid);
 
 if ($op eq 'del') {
@@ -74,7 +75,8 @@ for(my $i=$firstday;$i<($firstday+365);$i=$i+7){
             if($wkno > 52){$year++; $wkno=1;}
             if($count>365){$count=$i-365;}
             my ($y,$m,$d) =  Add_Delta_Days($year,1,1, $count - 1);#Date_NthDayOfYear($year,$count);
-            my $output = "$y-$m-$d";
+            # padding Add_Delta_Days;
+            my $output  = sprintf("%04d-%02d-%02d",$y , $m, $d );
             $weekarrayjs .= "'Wk $wkno: ".format_date($output)."',";
             $wkno++;
     }
@@ -86,6 +88,7 @@ $subs->{startdate}      = format_date($subs->{startdate});
 $subs->{firstacquidate} = format_date($subs->{firstacquidate});
 $subs->{histstartdate}  = format_date($subs->{histstartdate});
 $subs->{enddate}        = format_date($subs->{enddate});
+$subs->{histenddate}    = format_date($subs->{histenddate});
 $subs->{abouttoexpire}  = abouttoexpire($subs->{subscriptionid});
 # Done in Serials.pm
 # $subs->{'donotedit'}=(C4::Context->preference('IndependantBranches') && 
@@ -97,6 +100,7 @@ $subs->{abouttoexpire}  = abouttoexpire($subs->{subscriptionid});
 $template->param($subs);
 
 $template->param(
+       subscriptionid => $subscriptionid,
     routing => $routing,
     serialslist => \@serialslist,
     totalissues => $totalissues,