Example #1
0
 public function compute()
 {
     $this->total_ht = 0.0;
     $this->total_tax = 0.0;
     $this->total_ttc = 0.0;
     foreach ($this->items as $item) {
         $this->total_ht += $item->total_ht;
         $this->total_tax += $item->total_tax;
         $this->total_ttc += $item->total_ttc;
     }
     $this->user_id = User::get_id_from_account();
 }
Example #2
0
 public function can_be_administrated()
 {
     if (is_admin_logged() || $this->user_id == User::get_id_from_account()) {
         debug("Can administrate.");
         return TRUE;
     }
     debug("Cannot administrate.");
     return FALSE;
 }