Fix #7123 - getting abra ready to test
[Pman.Xtuple] / VoidSalesAndPurchaseOrders.php
index 02f922c..244ca1f 100644 (file)
@@ -45,9 +45,11 @@ class Pman_Xtuple_VoidSalesAndPurchaseOrders extends Pman_Roo
         $cohead->find();
         
         while ($cohead->fetch()){
-            $this->log("Voiding Sales Order : {$cohead->cohead_number}");
+            $co = clone ($cohead);
             
-            $cohead->clear($this);
+            $this->log("Voiding Sales Order : {$co->cohead_number}");
+            
+            $co->clear($this);
         }
         
         
@@ -55,13 +57,16 @@ class Pman_Xtuple_VoidSalesAndPurchaseOrders extends Pman_Roo
         $pohead->find();
         
         while ($pohead->fetch()){
-            $this->log("Voiding Sales Order : {$pohead->pohead_number}");
+            $po = clone ($pohead);
+            
+            $this->log("Voiding Purchase Order : {$po->pohead_number}");
             
-            $pohead->clear($this);
+            $po->clear($this);
         }
         
         
-        $this->jerr('DONE');
+        $this->jok('DONE');
+        
         exit;
     }