Bug 7688: (follow-up) update test cases to reflect change in NewSubscription()
authorGalen Charlton <gmc@esilibrary.com>
Wed, 30 Oct 2013 02:27:20 +0000 (02:27 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 30 Oct 2013 02:27:20 +0000 (02:27 +0000)
This patch also corrects an error in the description of
NewSubscription().

Named parameters for this function cannot come soon enough.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Serials.pm
t/db_dependent/Acquisition/OrderFromSubscription.t
t/db_dependent/Bookseller.t

index c692dda..86f3c0b 100644 (file)
@@ -1459,7 +1459,7 @@ sub ModSubscription {
 =head2 NewSubscription
 
 $subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
-    $startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
+    $startdate,$periodicity,$numberlength,$weeklength,$monthlength,
     $lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3,
     $status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern,
     $callnumber, $hemisphere, $manualhistory, $internalnotes, $serialsadditems,
index 847d497..60b1d3a 100644 (file)
@@ -44,12 +44,12 @@ my $budget_id = AddBudget({
 });
 
 my $subscriptionid = NewSubscription(
-    undef,      "",     undef, undef, $budget_id, $biblionumber, '01-01-2013',undef,
-    undef,      undef,  undef, undef, undef,      undef,         undef,  undef,
-    undef,      undef,  undef, undef, undef,      undef,         undef,  undef,
-    undef,      undef,  undef, undef, undef,      undef,         undef,  1,
-    "notes",    undef,  undef, undef, undef,      undef,         undef,  0,
-    "intnotes", 0,      undef, undef, 0,          undef,         '31-12-2013',
+    undef,      "",     undef, undef, $budget_id, $biblionumber,
+    '01-01-2013',undef, undef, undef,  undef,
+    undef,      undef,  undef, undef, undef, undef,
+    1,          "notes",undef, '01-01-2013', undef, undef,
+    undef,       undef,  0,    "intnotes",  0,
+    undef, undef, 0,          undef,         '31-12-2013', 0
 );
 die unless $subscriptionid;
 
index 4415144..2dc79e3 100644 (file)
@@ -190,38 +190,28 @@ my ($biblionumber, $biblioitemnumber) = AddBiblio($bib, '');
 $bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1);
 is( $bookseller1fromid->{subscriptioncount},
     0, 'Supplier1 has 0 subscription' );
-my $id_subscription1 = C4::Serials::NewSubscription(
-    undef,      "",            $id_supplier1, undef,
-    $id_budget, $biblionumber, '01-01-2013',  undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         1,
-    "subscription notes",    undef,         undef,         undef,
-    undef,      undef,         undef,         0,
-    "intnotes", 0,             undef,         undef,
-    0,          undef,         '31-12-2013',
+
+my $id_subscription1 = NewSubscription(
+    undef,      "",     $id_supplier1, undef, $id_budget, $biblionumber,
+    '01-01-2013',undef, undef, undef,  undef,
+    undef,      undef,  undef, undef, undef, undef,
+    1,          "subscription notes",undef, '01-01-2013', undef, undef,
+    undef,       undef,  0,    "intnotes",  0,
+    undef, undef, 0,          undef,         '31-12-2013', 0
 );
 
 my @subscriptions = SearchSubscriptions({biblionumber => $biblionumber});
 is($subscriptions[0]->{publicnotes}, 'subscription notes', 'subscription search results include public notes (bug 10689)');
 
-my $id_subscription2 = C4::Serials::NewSubscription(
-    undef,      "",            $id_supplier1, undef,
-    $id_budget, $biblionumber, '01-01-2013',  undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         1,
-    "subscription notes",    undef,         undef,         undef,
-    undef,      undef,         undef,         0,
-    "intnotes", 0,             undef,         undef,
-    0,          undef,         '31-12-2013',
+my $id_subscription2 = NewSubscription(
+    undef,      "",     $id_supplier1, undef, $id_budget, $biblionumber,
+    '01-01-2013',undef, undef, undef,  undef,
+    undef,      undef,  undef, undef, undef, undef,
+    1,          "subscription notes",undef, '01-01-2013', undef, undef,
+    undef,       undef,  0,    "intnotes",  0,
+    undef, undef, 0,          undef,         '31-12-2013', 0
 );
+
 $bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1);
 is( $bookseller1fromid->{subscriptioncount},
     2, 'Supplier1 has 2 subscriptions' );
@@ -371,19 +361,13 @@ ModBasket($basket3info);
 ModBasket($basket4info);
 
 #Add 1 subscription
-my $id_subscription3 = C4::Serials::NewSubscription(
-    undef,      "",            $id_supplier3, undef,
-    $id_budget, $biblionumber, '01-01-2013',  undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         undef,
-    undef,      undef,         undef,         1,
-    "notes",    undef,         undef,         undef,
-    undef,      undef,         undef,         0,
-    "intnotes", 0,             undef,         undef,
-    0,          undef,         '31-12-2013',
+my $id_subscription3 = NewSubscription(
+    undef,      "",     $id_supplier1, undef, $id_budget, $biblionumber,
+    '01-01-2013',undef, undef, undef,  undef,
+    undef,      undef,  undef, undef, undef, undef,
+    1,          "subscription notes",undef, '01-01-2013', undef, undef,
+    undef,       undef,  0,    "intnotes",  0,
+    undef, undef, 0,          undef,         '31-12-2013', 0
 );
 
 #Add 4 orders