updated srp statistics
This commit is contained in:
@@ -11,14 +11,14 @@ class CorpMarketMail extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'command:name';
|
||||
protected $signature = 'services:MarketMail';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
protected $description = 'Send a mail about a market.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -37,6 +37,13 @@ class CorpMarketMail extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
//Create the command helper container
|
||||
$task = new CommandHelper('CorpMarketMail');
|
||||
|
||||
//Add entry into the table saying the job is starting
|
||||
$task->SetStartStatus();
|
||||
|
||||
//Mark the job as finished
|
||||
$task->SetStopStatus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ class SRPAdminController extends Controller
|
||||
//Create the array
|
||||
$requests = array();
|
||||
|
||||
//Declare variables for use later.
|
||||
$sum_actual = 0.00;
|
||||
$sum_loss = 0.00;
|
||||
|
||||
//Get the ship types from the database
|
||||
$shipTypes = SrpShipType::all();
|
||||
|
||||
@@ -58,6 +62,7 @@ class SRPAdminController extends Controller
|
||||
$temp['fleet_commander_name'] = $r['fleet_commander_name'];
|
||||
$temp['zkillboard'] = $r['zkillboard'];
|
||||
$temp['loss_value'] = $r['loss_value'];
|
||||
$sum_loss += $temp['loss_value'];
|
||||
//Get the ship type
|
||||
foreach($shipTypes as $s) {
|
||||
if($r['ship_type'] == $s->code) {
|
||||
@@ -75,6 +80,7 @@ class SRPAdminController extends Controller
|
||||
if($r['ship_type'] == $p->code) {
|
||||
$temp['actual_srp'] = $r['loss_value'] * ($p->payout / 100.00 );
|
||||
$temp['cost_code'] = $p->payout;
|
||||
$sum_actual += $temp['actual_srp'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +90,9 @@ class SRPAdminController extends Controller
|
||||
}
|
||||
|
||||
//Return the view with the variables
|
||||
return view('srp.admin.process')->with('requests', $requests);
|
||||
return view('srp.admin.process')->with('requests', $requests)
|
||||
->with('sum_actual', $sum_actual)
|
||||
->with('sum_loss', $sum_loss);
|
||||
}
|
||||
|
||||
public function processSRPRequest(Request $request) {
|
||||
|
||||
@@ -71,6 +71,16 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Totals</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
Total Loss Values: {{ $sum_loss }}<br>
|
||||
Total Actual Value: {{ $sum_actual }}<br>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
|
||||
Reference in New Issue
Block a user