MT1883 : Serials enddate was not cleanly used

GetExpirationDate should now be used only to get the NEXT expirationdate based on startdate
Perltidying C4/Serials.pm
This commit is contained in:
Henri-Damien LAURENT 2009-11-11 12:00:18 +01:00
parent 813d234191
commit fc1a5ed318
3 changed files with 677 additions and 780 deletions

File diff suppressed because it is too large Load diff

View file

@ -89,7 +89,7 @@ if ($subscription->{'cannotedit'}){
$template->param(
startdate => format_date(
GetExpirationDate($subscriptionid)
$subscription->{enddate}
|| POSIX::strftime( "%Y-%m-%d", localtime )
),
numberlength => $subscription->{numberlength},

View file

@ -9,7 +9,7 @@ use YAML;
use C4::Serials;
use C4::Debug;
use Test::More tests => 4;
use Test::More tests => 5;
BEGIN {
use_ok('C4::Serials');
@ -27,3 +27,16 @@ $debug && warn scalar(@subscriptions);
@subscriptions = GetSubscriptions( undef,undef ,$$subscriptioninformation{bibnum} );
isa_ok( \@subscriptions, 'ARRAY' );
$debug && warn scalar(@subscriptions);
if ($subscriptioninformation->{periodicity} % 16==0){
$subscriptioninformation->{periodicity}=7;
ModSubscription(@$subscriptioninformation{qw(librarian, 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, serialsadditems, staffdisplaycount, opacdisplaycount, graceperiod, location, enddate, subscriptionid
)});
}
my $expirationdate = GetExpirationDate(1) ;
ok( $expirationdate, "not NULL" );
$debug && warn "$expirationdate";