misc cleanup
This commit is contained in:
@@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class FinancesController extends Controller
|
|
||||||
{
|
|
||||||
public function __construct() {
|
|
||||||
$this->middleware('auth');
|
|
||||||
$this->middleware('role:Admin');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function displayFinances() {
|
|
||||||
$months = 1;
|
|
||||||
$income = 0.00;
|
|
||||||
$expenses = 0.00;
|
|
||||||
$corpId = 98287666;
|
|
||||||
$finances = array();
|
|
||||||
$total = array();
|
|
||||||
|
|
||||||
$sHelper = new StructureTaxHelper();
|
|
||||||
|
|
||||||
$date = $sHelper->GetTimeFrameInMonths($months);
|
|
||||||
|
|
||||||
|
|
||||||
$revenue = [
|
|
||||||
'date' => $date['start']->toFormattedDateString(),
|
|
||||||
'industry' => StructureIndustryTaxJournal::select('amount')->whereBetween('date', [$date['start'], $date['end']])->sum('amount'),
|
|
||||||
'reprocessing' => $sHelper->GetRevenue($corpId, 'Refinery', $date['start'], $date['end']),
|
|
||||||
'offices' => OfficeFeesJournal::select('amount')->whereBetween('date', [$date['start'], $date['end']])->sum('amount'),
|
|
||||||
'market' => $sHelper->GetRevenue($corpId, 'Market', $date['start'], $date['end']),
|
|
||||||
'rentals' => 9500000000000,
|
|
||||||
'pi' => PlanetProductionTaxJournal::select('amount')->whereBetween('date', [$date['start'], $date['end']])->sum('amount'),
|
|
||||||
];
|
|
||||||
|
|
||||||
$expenditures = [
|
|
||||||
'fuel' => 9187200000,
|
|
||||||
'sov' => 8666870000,
|
|
||||||
'srp' => 1000000000,
|
|
||||||
];
|
|
||||||
|
|
||||||
$income = $revenue['industry'] + $revenue['reprocessing'] + $revenue['offices'] + $revenue['market'] + $revenue['rentals'] + $revenue['pi'];
|
|
||||||
$expenses = $expenditures['fuel'] + $expenditures['sov'] + $expenditures['srp'];
|
|
||||||
|
|
||||||
$total[] = [
|
|
||||||
'income' => $income,
|
|
||||||
'expenses' => $expenses,
|
|
||||||
];
|
|
||||||
|
|
||||||
$chart = app()->chartjs
|
|
||||||
->name('Income & Expenditure Chart')
|
|
||||||
->type('pie')
|
|
||||||
->size(['width' => 400, 'height' => 200])
|
|
||||||
->labels(['Income', 'Expenses'])
|
|
||||||
->datasets([
|
|
||||||
[
|
|
||||||
'backgroundColor' => ['#FF6384', '#36A2EB'],
|
|
||||||
'hoverBackgroundColor' => ['#FF6384', '#36A2EB'],
|
|
||||||
'data' => [$total['income'], $total['expenses']]
|
|
||||||
]
|
|
||||||
])
|
|
||||||
->options([]);
|
|
||||||
|
|
||||||
|
|
||||||
return view('finances.holding')->with('chart', $chart);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,47 +8,5 @@ use App\Library\Finances\JumpBridgeTax;
|
|||||||
|
|
||||||
class JumpBridgeController extends Controller
|
class JumpBridgeController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
//
|
||||||
* Displays all statistics on one page
|
|
||||||
*/
|
|
||||||
public function displayAll() {
|
|
||||||
//Create a helper class variable
|
|
||||||
$jbHelper30 = new JumpBridgeTax(30);
|
|
||||||
$jbHelper60 = new JumpBridgeTax(60);
|
|
||||||
$jbHelper90 = new JumpBridgeTax(90);
|
|
||||||
|
|
||||||
$data = [
|
|
||||||
'30days' => number_format($jbHelper30->OverallTax(), 2, '.', ','),
|
|
||||||
'60days' => number_format($jbHelper60->OverallTax(), 2, '.', ','),
|
|
||||||
'90days' => number_format($jbHelper90->OverallTax(), 2, '.', ','),
|
|
||||||
];
|
|
||||||
|
|
||||||
return view('jumpbridges.all')->with('data', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays overall jump bridge usage based corporation data
|
|
||||||
*/
|
|
||||||
public function displayCorpUsage() {
|
|
||||||
return view('jumpbridges.corp.select');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function ajaxCorpUsage() {
|
|
||||||
//Get the statistics for overall usage by corps and send back to webpage via ajax
|
|
||||||
|
|
||||||
return response()->json(array('data' => $data), 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays jump bridge usage based on structure
|
|
||||||
*/
|
|
||||||
public function displayStructureUsage() {
|
|
||||||
return view('jumpbridges.structure.select');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function ajaxStructureUsage() {
|
|
||||||
//Get the statistics for overall usage by structure and send back to the webpage via ajax
|
|
||||||
|
|
||||||
return response()->json(array('data' => $data), 200);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
class LogisticsController extends Controller
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
@@ -40,7 +40,7 @@ class StructureTaxHelper {
|
|||||||
|
|
||||||
//Calculate the tax ratio to later be divided against the tax to find the
|
//Calculate the tax ratio to later be divided against the tax to find the
|
||||||
//actual tax owed to the alliance. Revenue will be a separate function
|
//actual tax owed to the alliance. Revenue will be a separate function
|
||||||
$ratio = $this->CalculateTaxRatio($tax, $refType, $start, $end);
|
$ratio = $this->CalculateTaxRatio($corpId, $tax, $refType);
|
||||||
|
|
||||||
//Get the total taxes produced by the structure(s) over a given set of dates
|
//Get the total taxes produced by the structure(s) over a given set of dates
|
||||||
$revenue = $this->GetRevenue($corpId, $refType, $start, $end);
|
$revenue = $this->GetRevenue($corpId, $refType, $start, $end);
|
||||||
@@ -93,7 +93,10 @@ class StructureTaxHelper {
|
|||||||
return (float)$revenue;
|
return (float)$revenue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function CalculateTaxRatio($overallTax, $type) {
|
private function CalculateTaxRatio($corpId, $overallTax, $type) {
|
||||||
|
//Get the ratio based on what was decided upon for the ratio of taxes.
|
||||||
|
//Default rate is 2.5 ratio.
|
||||||
|
|
||||||
//The alliance will get a ratio of the tax.
|
//The alliance will get a ratio of the tax.
|
||||||
//We need to calculate the correct ratio based on structure tax,
|
//We need to calculate the correct ratio based on structure tax,
|
||||||
//Then figure out what is owed to the alliance
|
//Then figure out what is owed to the alliance
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ Route::group(['middleware' => ['auth']], function(){
|
|||||||
Route::post('/wiki/changepassword', 'WikiController@changePassword');
|
Route::post('/wiki/changepassword', 'WikiController@changePassword');
|
||||||
|
|
||||||
//Fleet Controller display pages
|
//Fleet Controller display pages
|
||||||
Route::get('/fleets/display', 'FleetsController@displayFleets');
|
//Route::get('/fleets/display', 'FleetsController@displayFleets');
|
||||||
Route::get('/fleets/register', 'FleetsController@displayRegisterFleet');
|
//Route::get('/fleets/register', 'FleetsController@displayRegisterFleet');
|
||||||
Route::post('/fleets/register', 'Fleetscontroller@registerFleet');
|
//Route::post('/fleets/register', 'Fleetscontroller@registerFleet');
|
||||||
Route::get('/fleets/{fleet_id}/addpilot/{id}', 'FleetsController@addPilot')->name('addpilot');
|
//Route::get('/fleets/{fleet_id}/addpilot/{id}', 'FleetsController@addPilot')->name('addpilot');
|
||||||
Route::get('/fleets/{fleet_id}/addpilot/{name}', 'Fleetscontroller@addPilotName');
|
//Route::get('/fleets/{fleet_id}/addpilot/{name}', 'Fleetscontroller@addPilotName');
|
||||||
Route::get('/fleets/{fleet_id}/delete', 'FleetsController@deleteFleet')->name('deletefleet');
|
//Route::get('/fleets/{fleet_id}/delete', 'FleetsController@deleteFleet')->name('deletefleet');
|
||||||
|
|
||||||
//Admin Controller display pages
|
//Admin Controller display pages
|
||||||
Route::get('/admin/dashboard', 'AdminController@displayDashboard');
|
Route::get('/admin/dashboard', 'AdminController@displayDashboard');
|
||||||
@@ -71,20 +71,12 @@ Route::group(['middleware' => ['auth']], function(){
|
|||||||
Route::post('redirectToProvider', 'EsiScopeController@redirectToProvider');
|
Route::post('redirectToProvider', 'EsiScopeController@redirectToProvider');
|
||||||
|
|
||||||
//Jump Bridge Controller display pages
|
//Jump Bridge Controller display pages
|
||||||
Route::get('/jumpbridges/overall', 'JumpBridgeController@displayAll');
|
|
||||||
Route::get('/jumpbridges/corps', 'JumpBridgeController@displayCorpUsage');
|
|
||||||
Route::post('/jumpbridges/getcorps', 'JumpBridgeController@ajaxCorpUsage');
|
|
||||||
Route::get('/jumpbridges/structures', 'JumpBridgeController@displayStructureUsage');
|
|
||||||
Route::get('/jumpbridges/getstructures', 'JumpBridgeController@ajaxStructureUsage');
|
|
||||||
|
|
||||||
//Help Desk Controller display pages
|
//Help Desk Controller display pages
|
||||||
Route::get('/helpdesk/tickets', 'HelpDeskController@displayMyTickets');
|
//Route::get('/helpdesk/tickets', 'HelpDeskController@displayMyTickets');
|
||||||
Route::get('/helpdesk/tickets/edit', 'HelpDeskController@editTicket');
|
//Route::get('/helpdesk/tickets/edit', 'HelpDeskController@editTicket');
|
||||||
Route::get('/helpdesk/tickets/new', 'HelpDeskController@displayNewTicket');
|
//Route::get('/helpdesk/tickets/new', 'HelpDeskController@displayNewTicket');
|
||||||
Route::post('/helpdesk/tickets/new', 'HelpDeskController@storeTicket');
|
//Route::post('/helpdesk/tickets/new', 'HelpDeskController@storeTicket');
|
||||||
|
|
||||||
//Finances Controller display pages
|
|
||||||
Route::get('/finances/admin', 'FinancesController@displayFinances');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Login display pages
|
//Login display pages
|
||||||
|
|||||||
Reference in New Issue
Block a user