admin dashboard taxes for srp addition
This commit is contained in:
@@ -34,6 +34,8 @@ class AdminController extends Controller
|
|||||||
$permission = array();
|
$permission = array();
|
||||||
$entities = array();
|
$entities = array();
|
||||||
$corpId = 98287666;
|
$corpId = 98287666;
|
||||||
|
$srpActual = array();
|
||||||
|
$srpLoss = array();
|
||||||
|
|
||||||
/** Taxes Pane */
|
/** Taxes Pane */
|
||||||
//Declare classes needed for displaying items on the page
|
//Declare classes needed for displaying items on the page
|
||||||
@@ -42,6 +44,18 @@ class AdminController extends Controller
|
|||||||
$dates = $tHelper->GetTimeFrameInMonths($months);
|
$dates = $tHelper->GetTimeFrameInMonths($months);
|
||||||
//Get the data for the Taxes Pane
|
//Get the data for the Taxes Pane
|
||||||
foreach($dates as $date) {
|
foreach($dates as $date) {
|
||||||
|
//Get the srp actual pay out for the date range
|
||||||
|
$srpActual[] = [
|
||||||
|
'date' => $date['start']->toFormattedDateString(),
|
||||||
|
'gross' => number_format($tHelpeer->GetAllianceSRPActual($date['start'], $date['end']), 2, ".", ","),
|
||||||
|
];
|
||||||
|
|
||||||
|
//Get the srp loss value for the date range
|
||||||
|
$srpLoss[] = [
|
||||||
|
'date' => $date['start']->toFormattedDateString(),
|
||||||
|
'gross' => number_format($tHelpeer->GetAllianceSRPActual($date['start'], $date['end']), 2, ".", ","),
|
||||||
|
];
|
||||||
|
|
||||||
//Get the pi taxes for the date range
|
//Get the pi taxes for the date range
|
||||||
$pis[] = [
|
$pis[] = [
|
||||||
'date' => $date['start']->toFormattedDateString(),
|
'date' => $date['start']->toFormattedDateString(),
|
||||||
@@ -127,7 +141,9 @@ class AdminController extends Controller
|
|||||||
->with('jumpgates', $jumpgates)
|
->with('jumpgates', $jumpgates)
|
||||||
->with('reprocessings', $reprocessings)
|
->with('reprocessings', $reprocessings)
|
||||||
->with('entities', $entities)
|
->with('entities', $entities)
|
||||||
->with('pigross', $pigross);
|
->with('pigross', $pigross)
|
||||||
|
->with('srpActual', $srpActual)
|
||||||
|
->with('srpLoss', $srpLoss);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayModifyUser(Request $request) {
|
public function displayModifyUser(Request $request) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ use App\Models\Finances\JumpBridgeJournal;
|
|||||||
use App\Models\Finances\PISaleJournal;
|
use App\Models\Finances\PISaleJournal;
|
||||||
use App\Models\Finances\AllianceMarketJournal;
|
use App\Models\Finances\AllianceMarketJournal;
|
||||||
use App\Models\Finances\CorpMarketStructure;
|
use App\Models\Finances\CorpMarketStructure;
|
||||||
|
use App\Models\SRP\SrpShips;
|
||||||
|
|
||||||
class TaxesHelper {
|
class TaxesHelper {
|
||||||
|
|
||||||
@@ -33,6 +34,28 @@ class TaxesHelper {
|
|||||||
$this->end = $en;
|
$this->end = $en;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetAllianceSRPActual($start, $end) {
|
||||||
|
$actual = 0.00;
|
||||||
|
|
||||||
|
$actual = SrpShips::where([
|
||||||
|
'approved' => 'Approved',
|
||||||
|
])->whereBetween('created_at', [$start, $end])
|
||||||
|
->sum('paid_value');
|
||||||
|
|
||||||
|
return $actual;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetAllianceSRPLoss($start, $end) {
|
||||||
|
$loss = 0.00;
|
||||||
|
|
||||||
|
$loss = SrpShips::where([
|
||||||
|
'approved' => 'Approved',
|
||||||
|
])->whereBetween('created_at', [$start, $end])
|
||||||
|
->sum('loss_value');
|
||||||
|
|
||||||
|
return $loss;
|
||||||
|
}
|
||||||
|
|
||||||
public function GetAllianceMarketGross($start, $end, $corpId) {
|
public function GetAllianceMarketGross($start, $end, $corpId) {
|
||||||
$revenue = 0.00;
|
$revenue = 0.00;
|
||||||
|
|
||||||
|
|||||||
@@ -300,10 +300,50 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
SRP Actual Paid Out
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<th>Month</th>
|
||||||
|
<th>SRP Actual</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($srpActual as $srp)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $srp['date'] }}</td>
|
||||||
|
<td>{{ $srp['gross'] }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
SRP Loss Values
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<th>Month</th>
|
||||||
|
<th>SRP Loss</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($srpLoss as $srp)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $srp['date'] }}</td>
|
||||||
|
<td>{{ $srp['gross'] }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user