public function calculatePendingFees()
 {
     $records = $this->equipmentLogRepository->getFinishedUnbilledRecords();
     foreach ($records as $record) {
         $equipment = $this->equipmentRepository->findBySlug($record->device);
         if ($equipment->hasUsageCharge()) {
             $feePerSecond = $this->costPerSecond($equipment->usageCost);
             //How may seconds was the device in use
             $secondsActive = $record->finished->diffInSeconds($record->started);
             //Charges are for a minimum of 15 minutes
             $secondsActive = $this->roundUpSecondsActive($secondsActive);
             $incurredFee = $this->sessionFee($feePerSecond, $secondsActive);
             //If the reason is empty then its not a special case and should be billed
             if (empty($record->reason)) {
                 //Create a payment against the user
                 $this->paymentRepository->recordPayment('equipment-fee', $record->user_id, 'balance', '', $incurredFee, 'paid', 0, $record->id . ':' . $record->device);
             }
         }
         //Mark this log as being billed and complete
         $record->billed = true;
         $record->save();
     }
 }