Beispiel #1
0
 function __construct($x = null)
 {
     parent::__construct($x);
     if (empty($this->_data['date'])) {
         $this->_data['date'] = strftime('%Y-%m-%d');
     }
 }
Beispiel #2
0
 /**
 	Construct a new Work Order
 */
 function __construct($id)
 {
     $this['kind'] = $_ENV['workorder']['kind'];
     $this['status'] = $_ENV['workorder']['status'];
     $this['base_rate'] = $_ENV['workorder']['base_rate'];
     $this['base_unit'] = $_ENV['workorder']['base_unit'];
     $this['date'] = date('Y-m-d');
     parent::__construct($id);
 }
Beispiel #3
0
 /**
 	Create an Invoice
 */
 function __construct($x = null)
 {
     $this->_data['status'] = $_ENV['invoice']['status'];
     $this->_data['net'] = $_ENV['invoice']['term_days'];
     $this->_data['date'] = date('Y-m-d');
     $this->_data['bill_amount'] = 0;
     $this->_data['paid_amount'] = 0;
     $this->_data['sub_total'] = 0;
     $this->_data['tax_total'] = 0;
     $this->_data['bill_address_id'] = null;
     $this->_data['ship_address_id'] = null;
     parent::__construct($x);
     // Now to Stuff with this new Data!
     // @todo Update Properties
     // @todo Update due_diff to the number of days until or after payment is due
     $due_date = strtotime($this->_data['date']);
     if (!empty($this->_data['net'])) {
         $due_date += $this->_data['net'] * 86400;
         // add($this->net,Zend_Date::DAY);
     }
     $now_date = time();
     $this->_date['due_diff'] = floor(($now_date - $due_date) / 86400);
 }