structure controller reorganziation
This commit is contained in:
@@ -19,53 +19,6 @@ class RegisterStructureController extends Controller
|
||||
$this->middleware('permission:structure.operator');
|
||||
}
|
||||
|
||||
public function displayRegisterTaxRatio() {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
return view('structures.register.taxratio');
|
||||
}
|
||||
|
||||
public function storeTaxRatio(Request $request) {
|
||||
$this->validate($request, [
|
||||
'corpId',
|
||||
'corporation',
|
||||
'type',
|
||||
'ratio',
|
||||
]);
|
||||
|
||||
$ratio = new CorpTaxRatio;
|
||||
$ratio->corporation_id = $request->corpId;
|
||||
$ratio->corporation_name = $request->corporation;
|
||||
$ratio->structure_type = $request->type;
|
||||
$ratio->ratio = $request->ratio;
|
||||
$ratio->save();
|
||||
|
||||
return redirect('structure.admin.dashboard');
|
||||
}
|
||||
|
||||
public function updateTaxRatio(Request $request) {
|
||||
$this->validate($request, [
|
||||
'corporation',
|
||||
'type',
|
||||
'ratio',
|
||||
]);
|
||||
|
||||
CorpTaxRatio::where([
|
||||
'corporation_name' => $request->corporation,
|
||||
'structure_type' => $request->type,
|
||||
])->update([
|
||||
'ratio' => $request->ratio,
|
||||
]);
|
||||
|
||||
return redirect('structure.admin.dashboard')->with('success', 'Tax Ratio updated for structure type: ' . $request->type . ' and corporation: ' . $request->corporation);
|
||||
}
|
||||
|
||||
public function displayTaxRatios() {
|
||||
$taxRatios = CorpTaxRation::all();
|
||||
|
||||
return view('structure.admin.taxratios')->with('structures', $structures);
|
||||
}
|
||||
|
||||
public function displayRegisterStructure() {
|
||||
//Check to see if the user has the read corp journal esi scope before allowing to register a structure
|
||||
if(Auth()->user()->hasEsiScope('esi-wallet.read_corporation_wallets.v1')) {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class StructureAdminController extends Controller
|
||||
{
|
||||
public function storeTaxRatio(Request $request) {
|
||||
$this->validate($request, [
|
||||
'corpId',
|
||||
'corporation',
|
||||
'type',
|
||||
'ratio',
|
||||
]);
|
||||
|
||||
$ratio = new CorpTaxRatio;
|
||||
$ratio->corporation_id = $request->corpId;
|
||||
$ratio->corporation_name = $request->corporation;
|
||||
$ratio->structure_type = $request->type;
|
||||
$ratio->ratio = $request->ratio;
|
||||
$ratio->save();
|
||||
|
||||
return redirect('structure.admin.dashboard');
|
||||
}
|
||||
|
||||
public function updateTaxRatio(Request $request) {
|
||||
$this->validate($request, [
|
||||
'corporation',
|
||||
'type',
|
||||
'ratio',
|
||||
]);
|
||||
|
||||
CorpTaxRatio::where([
|
||||
'corporation_name' => $request->corporation,
|
||||
'structure_type' => $request->type,
|
||||
])->update([
|
||||
'ratio' => $request->ratio,
|
||||
]);
|
||||
|
||||
return redirect('structure.admin.dashboard')->with('success', 'Tax Ratio updated for structure type: ' . $request->type . ' and corporation: ' . $request->corporation);
|
||||
}
|
||||
|
||||
public function displayTaxRatios() {
|
||||
$taxRatios = CorpTaxRation::all();
|
||||
|
||||
return view('structure.admin.taxratios')->with('structures', $structures);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 card">
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
@extends('layouts.b4')
|
||||
@section('content')
|
||||
|
||||
<div class="container">
|
||||
<h2>Services Profile</h2><br>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@@ -48,8 +48,7 @@
|
||||
<a class="dropdown-item" href="/structures/register">Register Structure</a>
|
||||
@if(auth()->user()->hasRole('Admin'))
|
||||
<a class="dropdown-item" href="/structures/admin/taxes/display">Corp Taxes</a>
|
||||
<a class="dropdown-item" href="/structures/admin/taxes/industry">Industry Taxes</a>
|
||||
<a class="dropdown-item" href="/structures/admin/taxes/reprocessing">Reprocessing Taxes</a>
|
||||
<a class="dropdown-item" href="/structures/admin/dashboard">Admin Panel</a>
|
||||
@endif
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
@extends('layouts.b4')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2>Structure Dashboard</h2>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 card">
|
||||
<div class="card-header">
|
||||
Add Tax Ratio for Structure
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{!! Form::open(['action' => 'StructureAdminController@storeTaxRatio', 'method' => 'POST']) !!}
|
||||
<div class="form-group">
|
||||
{{ Form::label('corpId', 'Corporation ID:') }}
|
||||
{{ Form::text('corpId', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('corporation', 'Corporation Name') }}
|
||||
{{ Form::text('corporation', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('type', 'Structure Type') }}
|
||||
{{ Form::select('type', ['Refinery' => 'Refinery', 'Market' => 'Market'], null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('ratio', 'Tax Ratio') }}
|
||||
{{ Form::text('ratio', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-6 card">
|
||||
<div class="card-header">
|
||||
Update Tax Ratio for Structure
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{!! Form::open(['action' => 'StructureAdminController@updateTaxRatio', 'method' => 'POST']) !!}
|
||||
<div class="form-group">
|
||||
{{ Form::label('corporation', 'Corporation Name') }}
|
||||
{{ Form::text('corporation', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('type', 'Structure Type') }}
|
||||
{{ Form::select('type', ['Refinery' => 'Refinery', 'Market' => 'Market'], null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('ratio', 'Tax Ratio') }}
|
||||
{{ Form::text('ratio', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
+4
-2
@@ -50,10 +50,12 @@ Route::group(['middleware' => ['auth']], function(){
|
||||
Route::post('/admin/remove/user', 'AdminController@removeUser');
|
||||
|
||||
//Register Structures Controller display pages
|
||||
Route::get('/structures/dashboard', 'StructureAdminController@displayDashboard');
|
||||
Route::get('/structures/register', 'RegisterStructureController@displayRegisterstructure');
|
||||
Route::post('/structures/register', 'RegisterstructureController@storeStructure');
|
||||
Route::get('/structures/admin/taxratio', 'RegisterStructureController@displayTaxRatioForm');
|
||||
Route::post('/structures/admin/taxratio', 'RegisterStructureController@storeTaxRatio');
|
||||
Route::post('/structures/admin/add/taxratio', 'StructureAdminController@storeTaxRatio');
|
||||
Route::post('/structures/admin/update/taxratio', 'StructureAdminController@updateTaxRatio');
|
||||
|
||||
//Structure Controller display pages
|
||||
Route::get('/structures/taxes/display', 'StructureController@displayTaxes');
|
||||
Route::get('/structures/admin/taxes/display', 'StructureController@chooseCorpTaxes');
|
||||
|
||||
Reference in New Issue
Block a user