add order that has been paid with voucher to audit data
authorKonrad Rosenbaum <konrad@silmor.de>
Thu, 29 Dec 2011 12:51:42 +0000 (13:51 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Thu, 29 Dec 2011 12:51:42 +0000 (13:51 +0100)
www/inc/wext/voucher.php

index 4e189f8..31c4639 100644 (file)
@@ -9,11 +9,17 @@ class WOVoucher extends WOVoucherAbstract
        ///helper for audit table creation
        public static function getTransactionComment()
        {
+               //get the transaction
                $inst=WobTransaction::getInstance();
                if($inst == null)return null;
+               //check whether it has a comment
                if(method_exists($inst,"getcomment"))
                        return $inst->getcomment();
-               else return null;
+               //for usevoucher return the order id
+               if(is_a($inst,"WTrUseVoucher"))
+                       return "order: ".$inst->getorderid();
+               //fall back
+               return null;
        }
        
        ///implements the GetVoucherAudit transaction