Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Fifo / ProcessPoheadVoids.php
1 <?php
2
3 /**
4  * fill in any fifo basic entries that have not been processed..
5  * -- does not fill in values.. - just qty's
6  *
7  */
8 require_once 'ProcessBase.php';
9  
10 class Pman_Xtuple_Fifo_ProcessPoheadVoids extends Pman_Xtuple_Fifo_ProcessBase
11 {
12      static $cli_desc = "Flag voids for poheads.";
13    
14     static $permitError = false;
15     
16    
17     function get()
18     {
19         // set up the failure code..
20         PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
21         
22         // we have to have a pointer to work out where we left off..
23         // this process can go by invdetail_id ASC..
24         
25         $id = DB_DataObject::Factory('pohead');
26         
27         $locs = $id->fetchAll('pohead_id');
28         $id->free();
29         
30         $tot = count($locs);
31         foreach($locs as $n=>$pohead_id) {
32         
33             $id = DB_DataObject::Factory('invdetail');
34             $id->query("SELECT invfifo_pohead_void_flag_order($pohead_id)");
35             $id->free();
36             if (!($n % 50)) {
37                 echo "$n/$tot\n";
38             }
39             
40         }
41         
42         die("DONE");
43
44          
45    
46     }
47      
48 }