Exemple #1
0
 /**
  * Get the total income from sales
  *
  */
 public function sales()
 {
     $income = 0;
     $sales = Sale::dateRange($this->from, $this->to)->get();
     foreach ($sales as $sale) {
         $income += $sale->total;
     }
     return $income;
 }