&NewOrder($basket, $biblionumber, $title, $quantity, $listprice,
$booksellerid, $who, $notes, $bookfund, $biblioitemnumber, $rrp,
$ecost, $gst, $budget, $unitprice, $subscription,
- $booksellerinvoicenumber, $purchaseorder);
+ $booksellerinvoicenumber, $purchaseorder, $branchcode);
Adds a new order to the database. Any argument that isn't described
below is the new value of the field with the same name in the aqorders
$listprice, $booksellerid, $authorisedby, $notes,
$bookfund, $bibitemnum, $rrp, $ecost,
$gst, $budget, $cost, $sub,
- $invoice, $sort1, $sort2, $purchaseorder
+ $invoice, $sort1, $sort2, $purchaseorder,
+ $branchcode
)
= @_;
#get ordnum MYSQL dependant, but $dbh->last_insert_id returns null
my $ordnum = $dbh->{'mysql_insertid'};
$query = "
- INSERT INTO aqorderbreakdown (ordernumber,bookfundid)
- VALUES (?,?)
+ INSERT INTO aqorderbreakdown (ordernumber,bookfundid, branchcode)
+ VALUES (?,?,?)
";
$sth = $dbh->prepare($query);
- $sth->execute( $ordnum, $bookfund );
+ $sth->execute( $ordnum, $bookfund, $branchcode );
$sth->finish;
return ( $basketno, $ordnum );
}
$listprice, $booksellerid, $loggedinuser, $notes,
$bookfund, $bibitemnum, $rrp, $ecost,
$gst, $budget, $cost, $sub,
- $invoice, $sort1, $sort2, $purchaseorder
+ $invoice, $sort1, $sort2, $purchaseorder,
+ $branch
);
}
}
my @results = SearchOrder( $search, $supplierid, $biblionumber, $catview );
my $count = scalar @results;
+my $order = GetOrder($search);
my $bookseller = GetBookSellerFromId( $results[0]->{'booksellerid'} );
value => $thisbranch,
description => $branches->{$thisbranch}->{'branchname'},
);
+ $row{'selected'} = 1 if( $thisbranch eq $order->{branchcode}) ;
push @branchloop, \%row;
}
$invoice, # $invoice,
undef, # $sort1,
undef, # $sort2,
- undef, # $purchaseorder
+ undef, # $purchaseorder,
+ undef, # $branchcode
);
ok( $basketno, "my basket number is $basketno" );
ok( $ordnum, "my order number is $ordnum" );
$invoice, # $invoice,
undef, # $sort1,
undef, # $sort2,
- undef, # $purchaseorder
+ undef, # $purchaseorder,
+ undef, # $branchcode
);
ok( $basketno, "my basket number is $basketno" );
ok( $ordnum, "my order number is $ordnum" );