//orders
self::fprint("<br>Converting Order data...\n");
$orders=$olddb->select("order","*");
+ $ordertime=array();
+ $orderuser=array();
foreach($orders as $ord){
//process invoiceaddr
$res=$db->select("address","addressid","customerid=".$ord["customerid"]);
unset($ord["deliveryaddress"]);
//create
self::insert("order",$ord);
+ //remember
+ $ordertime[$ord["orderid"]]=$ord["ordertime"];
+ $orderuser[$ord["orderid"]]=$ord["soldby"];
}
//tickets
unset($tick["reservetimeout"]);
//finally insert
self::insert("ticket",$tick);
+ //create audit data
+ $tick["audittime"]=$ordertime[$tick["orderid"]];
+ $tick["audituname"]=$orderuser[$tick["orderid"]];
+ $tick["audittransaction"]="1:create order";
+ $db->insert("ticket_audit",$tick);
}
//vouchers