array( 'desc' => 'Confirm', 'default' => '', 'short' => 'f', 'min' => 0, 'max' => 1, ) ); function getAuth() { if (HTML_FlexyFramework::get()->cli) { return true; } return false; } function get($v = '', $opts) { if(empty($opts['confirm']) || $opts['confirm'] !== 'I am sure to void all things'){ $this->jerr("If you know what is going to do, try -f 'I am sure to void all things'"); } $this->transObj = DB_DataObject::Factory('cohead'); $this->transObj->query('BEGIN'); PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError')); DB_DataObject::factory('cohead')->lockTables(); $cohead = DB_DataObject::factory('cohead'); $cohead->whereAdd(" cohead_status != 'X' "); $cohead->find(); while ($cohead->fetch()){ $co = clone ($cohead); $this->log("Voiding Sales Order : {$co->cohead_number}"); $co->clear($this); } $pohead = DB_DataObject::factory('pohead'); $pohead->find(); while ($pohead->fetch()){ $po = clone ($pohead); $this->log("Voiding Purchase Order : {$po->pohead_number}"); $po->clear($this); } $this->jok('DONE'); exit; } function log($str) { echo "$str \n"; } }