bug: 1953. cleaning up Acquisition::NewOrder just a little bit.
authorAndrew Moore <andrew.moore@liblime.com>
Thu, 20 Mar 2008 22:32:13 +0000 (17:32 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Sat, 22 Mar 2008 02:45:19 +0000 (21:45 -0500)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Acquisition.pm

index 62c89c0..bedde62 100644 (file)
@@ -382,6 +382,8 @@ entry to the aqorderbreakdown table, with the order number just found,
 and the book fund ID of the newly-added order.
 
 C<$budget> is effectively ignored.
+  If it's undef (anything false) or the string 'now', the current day is used.
+  Else, the upcoming July 1st is used.
 
 C<$subscription> may be either "yes", or anything else for "no".
 
@@ -432,16 +434,19 @@ sub NewOrder {
     my $dbh = C4::Context->dbh;
     my $query = "
         INSERT INTO aqorders
-           ( biblionumber,title,basketno,quantity,listprice,notes,
-           biblioitemnumber,rrp,ecost,gst,unitprice,subscription,sort1,sort2,budgetdate,entrydate,purchaseordernumber)
-        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,COALESCE(?,NOW()),NOW(),? )
+           ( biblionumber, title,            basketno, quantity, listprice,
+             notes,        biblioitemnumber, rrp,      ecost,    gst,
+             unitprice,    subscription,     sort1,    sort2,    budgetdate,
+             entrydate,    purchaseordernumber)
+        VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,COALESCE(?,NOW()),NOW(),? )
     ";
     my $sth = $dbh->prepare($query);
 
     $sth->execute(
         $bibnum, $title,      $basketno, $quantity, $listprice,
         $notes,  $bibitemnum, $rrp,      $ecost,    $gst,
-        $cost,   $sub,        $sort1,    $sort2,    $budget,    $purchaseorder
+        $cost,   $sub,        $sort1,    $sort2,    $budget,
+                 $purchaseorder
     );
     $sth->finish;