From 5b0595b9a924c4e7826f1279c807035d9ffc0a19 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Sun, 1 Jan 2012 19:04:48 +0100 Subject: [PATCH] create audit date for tickets from old system --- www/inc/db/dbupgrade.php | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/www/inc/db/dbupgrade.php b/www/inc/db/dbupgrade.php index 1747628..7944f77 100644 --- a/www/inc/db/dbupgrade.php +++ b/www/inc/db/dbupgrade.php @@ -285,6 +285,8 @@ class DBUpgrade //orders self::fprint("
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"]); @@ -300,6 +302,9 @@ class DBUpgrade unset($ord["deliveryaddress"]); //create self::insert("order",$ord); + //remember + $ordertime[$ord["orderid"]]=$ord["ordertime"]; + $orderuser[$ord["orderid"]]=$ord["soldby"]; } //tickets @@ -316,6 +321,11 @@ class DBUpgrade 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 -- 1.7.2.5