diff --git a/app/Console/Commands/Flex/FlexStructureCommand.php b/app/Console/Commands/Flex/FlexStructureCommand.php
deleted file mode 100644
index cb70a00b9..000000000
--- a/app/Console/Commands/Flex/FlexStructureCommand.php
+++ /dev/null
@@ -1,129 +0,0 @@
-SetStartStatus();
-
- //Create other variables
- $body = null;
- $delay = 5;
-
- //Get today's date
- $today = Carbon::now();
- $today->second = 2;
- $today->minute = 0;
- $today->hour = 0;
-
- //Get the esi configuration
- $config = config('esi');
-
- //Get all of the contacts for the flex structures
- $contacts = FlexStructure::select('requestor_id')->orderBy('requestor_id')->get();
-
- //For each of the contacts, send a reminder mail about the total of the structures they are paying for
- foreach($contacts as $contact) {
- //Get all of the structures for requestor
- $structures = FlexStructure::where([
- 'requestor_id' => $contact->requestor_id,
- ])->get();
-
- //Totalize the total cost of everything
- $totalCost = $this->TotalizeCost($structures);
-
- //Build the body of the mail
- $body = "Flex Structure Overhead Cost is due for the following structures:
";
- foreach($structures as $structure) {
-
- $body .= "System: " . $structure->system . " - " . $structure->structure_type . ": " . $structure->structure_cost . " ISK
";
- }
- $body .= "Total Cost: " . number_format($totalCost, 2,".", ",");
- $body .= "Please remit payment to Spatial Forces by the 3rd of the month.
";
- $body .= "Sincerely,
";
- $body .= "Warped Intentions Leadership
";
-
- //Dispatch the mail job
- $subject = "Warped Intentions Flex Structures Payment Due for " . $today->englishMonth;
- ProcessSendEveMailJob::dispatch($body, (int)$structure->requestor_id, 'character', $subject, $config['primary'])->onQueue('mail')->delay(Carbon::now()->addSeconds($delay));
-
- //Increment the delay for the mail to not hit the rate limits
- $delay += 60;
-
- //After the mail is dispatched, save the sent mail record
- $this->SaveSentRecord($config['primary'], $subject, $body, (int)$structure->requestor_id, 'character');
- }
-
- //Mark the job as finished
- $task->SetStopStatus();
- }
-
- private function TotalizeCost($structures) {
- //Declare the total cost
- $totalCost = 0.00;
-
- foreach($structures as $structure) {
- $totalCost += $structure->structure_cost;
- }
-
- return $totalCost;
- }
-
- private function SaveSentRecord($sender, $subject, $body, $recipient, $recipientType) {
- $sentmail = new SentMail;
- $sentmail->sender = $sender;
- $sentmail->subject = $subject;
- $sentmail->body = $body;
- $sentmail->recipient = $recipient;
- $sentmail->recipient_type = $recipientType;
- $sentmail->save();
- }
-}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 06f99c741..15c5d2b20 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -38,10 +38,6 @@ class Kernel extends ConsoleKernel
*/
Commands\Finances\HoldingFinancesCommand::class,
Commands\Finances\SovBillsCommand::class,
- /**
- * Flex Commands
- */
- Commands\Flex\FlexStructureCommand::class,
/**
* Moon Commands
*/
diff --git a/app/Http/Controllers/Flex/FlexAdminController.php b/app/Http/Controllers/Flex/FlexAdminController.php
deleted file mode 100644
index 9aef2ea4f..000000000
--- a/app/Http/Controllers/Flex/FlexAdminController.php
+++ /dev/null
@@ -1,148 +0,0 @@
-middleware('auth');
- $this->middleware('role:Admin');
- }
-
- /**
- * Function to display all active flex structures and
- * the information regarding the flex structure
- */
- public function displayFlexStructures() {
- //Get the structures from the database
- $structures = FlexStructure::all();
-
- //Return the view with the data
- return view('flex.list')->with('structures', $structures);
- }
-
- /**
- * Function to display form for adding new flex structure
- */
- public function displayAddFlexStructure() {
- return view('flex.add');
- }
-
- /**
- * Function to add new flex structure to the database
- */
- public function addFlexStructure(Request $request) {
- $this->validate($request, [
- 'requestor_name' => 'required',
- 'requestor_corp_name' => 'required',
- 'system' => 'required',
- 'structure_type' => 'required',
- 'structure_cost' => 'required',
- ]);
-
- //Delcare variables and classes
- $lookup = new LookupHelper;
-
- //From the character name find the character id
- $charId = $lookup->CharacterNameToId($request->requestor_name);
-
- //From the corporation name find the corporation id
- $corpId = $lookup->CorporationNameToId($request->requestor_corp_name);
-
- //From the system name find the system id
- $systemId = $lookup->SystemNameToId($request->system);
-
- //Create the database model
- $flex = new FlexStructure;
- $flex->requestor_id = $charId;
- $flex->requestor_name = $request->requestor_name;
- $flex->requestor_corp_id = $corpId;
- $flex->requestor_corp_name = $request->requestor_corp_name;
- $flex->system_id = $systemId;
- $flex->system = $request->system;
- $flex->structure_type = $request->structure_type;
- $flex->structure_cost = $request->structure_cost;
- if(isset($request->paid_until)) {
- $flex->paid_until = $request->paid_until;
- }
- $flex->save();
-
- return redirect('/flex/display')->with('success', 'Flex Structure Added.');
- }
-
- /**
- * Function to update paid until section of the flex structure in the database
- */
- public function updateFlexStructure(Request $request) {
- $this->validate($request, [
- 'paid_until' => 'required',
- 'requestor_id' => 'required',
- 'requestor_corp_id' => 'required',
- 'system_id' => 'required',
- 'structure_type' => 'required',
- ]);
-
- FlexStructure::where([
- 'requestor_id' => $request->requestor_id,
- 'requestor_corp_id' => $request->requestor_corp_id,
- 'system_id' => $request->system_id,
- 'structure_type' => $request->structure_type,
- ])->update([
- 'paid_until' => $request->paid_until,
- ]);
-
- return redirect('/flex/display')->with('success', 'Flex Structure Updated.');
- }
-
- /**
- * Funciton to remove flex structure from the database
- */
- public function removeFlexStructure(Request $request) {
- $this->validate($request, [
- 'requestor_id' => 'required',
- 'requestor_corp_id' => 'required',
- 'system_id' => 'required',
- 'structure_type' => 'required',
- ]);
-
- $count = FlexStructure::where([
- 'requestor_id' => $request->requestor_id,
- 'requestor_corp_id' => $request->requestor_corp_id,
- 'system_id' => $request->system_id,
- 'structure_type' => $request->structure_type,
- ])->count();
-
- if($count > 0) {
- FlexStructure::where([
- 'requestor_id' => $request->requestor_id,
- 'requestor_corp_id' => $request->requestor_corp_id,
- 'system_id' => $request->system_id,
- 'structure_type' => $request->structure_type,
- ])->delete();
-
- return redirect('/flex/display')->with('success', 'Flex Structure Entry Removed.');
- } else {
- return redirect('/flex/display')->with('error', 'Could not find flex structure to delete.');
- }
-
-
-
-
- }
-
-}
diff --git a/resources/views/flex/add.blade.php b/resources/views/flex/add.blade.php
deleted file mode 100644
index 113398799..000000000
--- a/resources/views/flex/add.blade.php
+++ /dev/null
@@ -1,41 +0,0 @@
-@extends('layouts.admin.b4')
-@section('content')
-
| Requestor | -Corp | -System | -Structure Type | -Cost | -Paid Until | -Update | -Remove? | - - - @foreach($structures as $structure) -
|---|---|---|---|---|---|---|---|
| {{ $structure->requestor_name }} | -{{ $structure->requestor_corp_name }} | -{{ $structure->system }} | -{{ $structure->structure_type }} | -{{ number_format($structure->structure_cost, "2", ".", ",") }} | -- {{ $structure->paid_until }} - | -- {!! Form::open(['action' => 'Flex\FlexAdminController@updateFlexStructure', 'method' => 'POST']) !!} - {{ Form::date('paid_until', \Carbon\Carbon::now()->endOfMonth(), ['class' => 'form-control']) }} - {{ Form::hidden('requestor_id', $structure->requestor_id) }} - {{ Form::hidden('requestor_corp_id', $structure->requestor_corp_id) }} - {{ Form::hidden('system_id', $structure->system_id) }} - {{ Form::hidden('structure_type', $structure->structure_type) }} - {{ Form::submit('Update', ['class' => 'btn btn-primary']) }} - {!! Form::close() !!} - | -- {!! Form::open(['action' => 'Flex\FlexAdminController@removeFlexStructure', 'method' => 'POST']) !!} - {{ Form::hidden('structure_type', $structure->structure_type) }} - {{ Form::hidden('requestor_id', $structure->requestor_id) }} - {{ Form::hidden('requestor_corp_id', $structure->requestor_corp_id) }} - {{ Form::hidden('system_id', $structure->system_id) }} - {{ Form::submit('Remove', ['class' => 'btn btn-danger']) }} - {!! Form::close() !!} - | -
- Flex Structures
-
-