migrations, and updates to Admin panel

This commit is contained in:
2018-12-12 19:45:20 -06:00
parent 2bd095d805
commit 181d5188d8
9 changed files with 157 additions and 111 deletions

View File

@@ -23,32 +23,6 @@ class StructureController extends Controller
$this->middleware('permission:structure.operator');
}
public function displayTaxHistory() {
//Make the helper esi class
$helper = new Esi();
//Get the character's corporation from esi
$corpId = $helper->FindCorporationId(Auth::user()->character_id);
//Get the dates we are working with
$dates = $this->GetLongTimeFrame();
//Create the totalTaxes array
$totalTaxes = array();
//Create the array for totalTaxes in order to send in the data to the view
for($i = 0; $i < 12; $i++) {
$totalTaxes[$i] = [
'MarketTax' => number_format($this->GetTaxes($corpId, 'Market', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','),
'MarketRevenue' => number_format($this->GetRevenue($corpId, 'Market', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','),
'RefineryTax' => number_format($this->GetTaxes($corpId, 'Refinery', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','),
'RefineryRevenue' => number_format($this->GetRevenue($corpId, 'Refinery', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','),
'start' => $dates[$i]['start']->toFormattedDateString(),
];
}
return view('structures.taxhistory')->with('totalTaxes', $totalTaxes);
}
public function displayTaxes() {
//Make the helper esi class
$helper = new Esi();
@@ -158,32 +132,6 @@ class StructureController extends Controller
return $cost;
}
private function GetLongTimeFrame() {
$start = Carbon::now()->startOfMonth();
$end = Carbon::now()->endOfMonth();
$end->hour = 23;
$end->minute = 59;
$end->second = 59;
$dates = array();
$dates[0] = [
'start' => $start,
'end' => $end,
];
//Cycle through the for loop and build the array
for($i = 1; $i < 12; $i++) {
$start->subMonth();
$end->subMonth();
$dates[$i] = [
'start' => $start,
'end' => $end,
];
}
return $dates;
}
private function GetTimeFrame() {
$start = Carbon::now()->startOfMonth();
$end = Carbon::now()->endOfMonth();