From c445e449c30b75097dfdaa783d3b5b22a509d577 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Thu, 20 Mar 2008 17:32:13 -0500 Subject: [PATCH] bug: 1953. cleaning up Acquisition::NewOrder just a little bit. Signed-off-by: Galen Charlton Signed-off-by: Joshua Ferraro --- C4/Acquisition.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 62c89c0503..bedde62025 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -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; -- 2.39.5