StructureTaxHelper
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Requests;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use DB;
|
|
||||||
use App\Library\Fleets\FleetHelper;
|
|
||||||
|
|
||||||
use App\Models\Fleet\Fleet;
|
|
||||||
|
|
||||||
class AjaxController extends Controller {
|
|
||||||
|
|
||||||
public function index() {
|
|
||||||
$msg = "This is a simple message.";
|
|
||||||
return response()->json(array('msg'=> $msg), 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -2,20 +2,32 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Auth;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Models\HelpDesk\HelpDeskTicket;
|
||||||
|
use App\Models\HelpDesk\HelpDeskTicketResponse;
|
||||||
|
|
||||||
class HelpDeskController extends Controller
|
class HelpDeskController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display form to submit a new ticket
|
* Display form to submit a new ticket
|
||||||
*/
|
*/
|
||||||
public function displayNewTicket() {
|
public function displayNewTicket() {
|
||||||
|
return view('helpdesk.newticket');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeTicket() {
|
public function storeTicket(Request $request) {
|
||||||
|
//Using the request populate the ticket and save to the database
|
||||||
|
$ticket = new HelpDeskTicket;
|
||||||
|
$ticket->user_id = Auth()-user()->character_id;
|
||||||
|
$ticket->department = $request->department;
|
||||||
|
$ticket->subject = $request->subject;
|
||||||
|
$ticket->body = $request->body;
|
||||||
|
$ticket->save();
|
||||||
|
|
||||||
|
return redirect('/dashboard')->with('success', 'Ticket submitted.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -58,14 +58,17 @@ class StructureTaxHelper {
|
|||||||
public function GetRevenue($corpId, $refType, $start, $end) {
|
public function GetRevenue($corpId, $refType, $start, $end) {
|
||||||
$revenue = 0.00;
|
$revenue = 0.00;
|
||||||
if($refType == 'Market') {
|
if($refType == 'Market') {
|
||||||
$revenue = CorpMarketJournal::where(['ref_type' => 'brokers_fee', 'corporation_id' => $corpId])
|
//Get the revenue from the corp_market_journals table and add it up.
|
||||||
|
$revenue = CorpMarketJournal::where(['ref_type' => 'brokers_fee', 'corporation_id' => $corpId, 'second_party_id' => $corpId])
|
||||||
->whereBetween('date', [$start, $end])
|
->whereBetween('date', [$start, $end])
|
||||||
->sum('amount');
|
->sum('amount');
|
||||||
} else if($refType == 'Refinery'){
|
} else if($refType == 'Refinery'){
|
||||||
$revenue = ReprocessingTaxJournal::where(['ref_type' => 'reprocessing_tax', 'corporation_id' => $corpId])
|
//Get the revenue from the reprocessing_tax_journal table and add it up.
|
||||||
|
$revenue = ReprocessingTaxJournal::where(['ref_type' => 'reprocessing_tax', 'corporation_id' => $corpId, 'second_party_id' => $corpId])
|
||||||
->whereBetween('date', [$start, $end])
|
->whereBetween('date', [$start, $end])
|
||||||
->sum('amount');
|
->sum('amount');
|
||||||
} else {
|
} else {
|
||||||
|
//If it's not from one of the above tables, then it doesn't mean anything, so return nothing.
|
||||||
$revenue = 0.00;
|
$revenue = 0.00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ class User extends Authenticatable
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function tickets() {
|
||||||
|
return $this->hasMany('App\Models\HelpDesk\HelpDeskTicket', 'character_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasEsiScope($scope) {
|
public function hasEsiScope($scope) {
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ class CreateHelpDeskTicketsTable extends Migration
|
|||||||
{
|
{
|
||||||
if(!Schema::hasTable('help_desk_tickets')) {
|
if(!Schema::hasTable('help_desk_tickets')) {
|
||||||
Schema::create('help_desk_tickets', function(Blueprint $table) {
|
Schema::create('help_desk_tickets', function(Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('ticket_id');
|
||||||
$table->integer('ticket_id');
|
|
||||||
$table->string('user_id');
|
$table->string('user_id');
|
||||||
$table->string('assigned_id');
|
$table->string('assigned_id');
|
||||||
$table->string('department');
|
$table->string('department');
|
||||||
|
|||||||
Reference in New Issue
Block a user