Example #1
0
 /**
  * Generates a detailed report for the specified dates using the given 
  * account code. This report consist of all calls using this account.
  * @param  Int $accountcode
  * @param  Array $dates
  * @return Array
  */
 public static function generateAccountCodes($accountcode, $dates)
 {
     $report['callSummary'] = self::getCallSummary($accountcode, $dates);
     $report['callList'] = self::getCallList($accountcode, $dates);
     $totalCost = self::calculateTotalCost($report['callList']);
     $report['reportHeadings'] = ['name' => AccountCode::getName($accountcode), 'totalCalls' => count($report['callList']), 'totalCost' => $totalCost];
     return $report;
 }
 /**
  * Delete the specified account code.
  * @param  Int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     AccountCode::destroy($id);
     return redirect('accountcodes');
 }