removed corp market structures as it's no longer used

This commit is contained in:
2019-12-11 23:25:50 -06:00
parent 89f614fe77
commit e6173a7f17
5 changed files with 2 additions and 197 deletions

View File

@@ -1,78 +0,0 @@
<?php
namespace App\Console\Commands;
//Internal Library
use Illuminate\Console\Command;
use Log;
//User Library
use Commands\Library\CommandHelper;
use App\Library\Finances\Helper\FinanceHelper;
//Models
use App\Models\Finances\CorpMarketJournal;
use App\Models\Finances\CorpMarketStructure;
class CorpFinances extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:CorpFinances';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Get the corporation finances journal to get the market fees from the master wallet';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//Create the command helper container
$task = new CommandHelper('CorpFinances');
//Add entry into the table saying the jobs is starting
$task->SetStartStatus();
//Setup the Finances container
$finance = new FinanceHelper();
//Get the corporations who have registered for structure markets
$structures = CorpMarketStructure::all();
foreach($structures as $structure) {
$pages = $finance->GetJournalPageCount(1, $structure->character_id);
for($i = 1; $i <= $pages; $i++) {
$job = new JobProcessCorpJournal;
$job->division = 1;
$job->charId = $structure->character_id;
$job->corpId = $structure->corporation_id;
$job->page = $i;
ProcessCorpJournalJob::dispatch($job)->onQueue('journal');
}
}
//mark the job as finished
$task->SetStopStatus();
}
}

View File

@@ -1,63 +0,0 @@
<?php
/**
* W4RP Services
* GNU Public License
*/
namespace App\Library\Finances;
use DB;
use App\Library\Esi\Esi;
use App\Models\Finances\CorpMarketJournal;
class CorpMarketTax {
public function InsertCorpMarketTax($journal, $corpId, $division) {
//Create the ESI Helper class
$esiHelper = new Esi;
//Check to see if we can find the entry in the database already.
//If we don't then add it to the database
if(!CorpMarketJournal::where(['id' => $journal['id']])->exists()) {
$entry = new CorpMarketJournal;
$entry->id = $journal['id'];
$entry->corporation_id = $corpId;
$entry->division = $division;
if(isset($journal['amount'])) {
$entry->amount = $journal['amount'];
}
if(isset($journal['balance'])) {
$entry->balance = $journal['balance'];
}
if(isset($journal['context_id'])) {
$entry->context_id = $journal['context_id'];
}
if(isset($journal['context_id_type'])) {
$entry->context_id_type = $journal['context_id_type'];
}
$entry->date = $esiHelper->DecodeDate($journal['date']);
$entry->description = $journal['description'];
if(isset($journal['first_party_id'])) {
$entry->first_party_id = $journal['first_party_id'];
}
if(isset($journal['reason'])) {
$entry->reason = $journal['reason'];
}
$entry->ref_type = $journal['ref_type'];
if(isset($journal['second_party_id'])) {
$entry->second_party_id = $journal['second_party_id'];
}
if(isset($journal['tax'])) {
$entry->tax = $journal['tax'];
}
if(isset($journal['tax_receiver_id'])) {
$entry->tax_receiver_id = $journal['tax_receiver_id'];
}
$entry->save();
}
}
}
?>

View File

@@ -13,11 +13,9 @@ use App\Models\Finances\ReprocessingTaxJournal;
use App\Models\Finances\StructureIndustryTaxJournal;
use App\Models\Finances\PlanetProductionTaxJournal;
use App\Models\Finances\OfficeFeesJournal;
use App\Models\Finances\CorpMarketJournal;
use App\Models\Finances\JumpBridgeJournal;
use App\Models\Finances\PISaleJournal;
use App\Models\Finances\AllianceMarketJournal;
use App\Models\Finances\CorpMarketStructure;
use App\Models\SRP\SRPShip;
class TaxesHelper {
@@ -68,17 +66,6 @@ class TaxesHelper {
return $revenue;
}
public function GetStructureMarketGross($start, $end, $corpId) {
$revenue = 0.00;
$revenue = CorpMarketJournal::where([
'second_party_id' => $corpId,
])->whereBetween('date', [$start, $end])
->sum('amount');
return $revenue;
}
public function GetJumpGateGross($start, $end) {
$revenue = 0.00;

View File

@@ -1,41 +0,0 @@
<?php
namespace App\Models\Finances;
use Illuminate\Database\Eloquent\Model;
class CorpMarketJournal extends Model
{
/**
* Table Name
*/
protected $table = 'corp_market_journal';
/**
* Timestamps
*/
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'id',
'corporation_id',
'division',
'amount',
'balance',
'context_id',
'context_id_type',
'date',
'description',
'first_party_id',
'reason',
'ref_type',
'second_party_id',
'tax',
'tax_receiver_id',
];
}

View File

@@ -279,7 +279,7 @@ class ClassLoader
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@@ -377,7 +377,7 @@ class ClassLoader
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\';
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {