public function __construct() { /* Common Voucher info */ $this->id = Randomize::ID(); $this->date = Randomize::ISSUEDATE(); $this->note = Randomize::NOTE(); $this->type = "Egresos"; $this->arrayOfAccounts = XMLManager::listAccounts(); $this->arrayOfParties = XMLManager::listParties(); $index = rand(1, count($this->arrayOfParties)) - 1; $ctxAuxParties = $this->arrayOfParties[$index]; $this->companyCode = $ctxAuxParties->id; $this->companyName = $ctxAuxParties->name; $index = rand(1, count($this->arrayOfParties)) - 1; $ctxAuxParties = $this->arrayOfParties[$index]; $this->thirdCode = $ctxAuxParties->id; $this->thirdName = $ctxAuxParties->name; $this->total = rand(10, 100) * 0.891821 * 10000; $randomItem = rand(1, 10); for ($j = 1; $j <= $randomItem; $j++) { $item = new Item($this->arrayOfAccounts, $this->arrayOfParties); array_push($this->items, $item); } $this->fileName = preg_replace('/\\?/', $this->id, $this->fileName); $this->storage(); // die($this->fileName); //$this->xmlDom = $vectorXML['XMLDOM']; $rnd = Randomize::rndPos($this->arrayOfParties); }
private static function generateParties() { if (isset($_GET['show'])) { if (!is_array($_GET['show'])) { if ($_GET['show'] === 'parties') { $parties = XMLManager::listParties(); foreach ($parties as $val) { echo $val->__toString(); } } } } }