Compare commits
239 Commits
v0.3
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bdff60aba | ||
| 3c94239da7 | |||
| 7e6c8224a5 | |||
| 8bc1289206 | |||
| 75390f10cd | |||
| 7468e63299 | |||
| 4c88de77a7 | |||
| c7502b853c | |||
| 249ab13004 | |||
| fce67286fd | |||
| f841639ec3 | |||
| c270017111 | |||
| 0ee317b0fc | |||
| f606b9cdd5 | |||
| 412b4d6794 | |||
| c045cabcf7 | |||
| f5adc203f3 | |||
| f3362bab00 | |||
| 268e2fdbee | |||
| 6d38e6fc8c | |||
| 99ff081b05 | |||
| 5b88887f53 | |||
| 669f716112 | |||
| addd34cb82 | |||
| c77a6e7af6 | |||
| 28ca917d5d | |||
| 1196abb0a0 | |||
| 68560e4e35 | |||
| a4eb7b9ad3 | |||
| 35591ab04c | |||
| 339b1063c6 | |||
| 83592117d1 | |||
| ff1e396fbc | |||
| 5471ccfa17 | |||
| c0aa379d37 | |||
| 3da0cec4a1 | |||
| bca5179cc3 | |||
| c075112810 | |||
| 57d01028cf | |||
| bef633434c | |||
| 6afba02675 | |||
| 4ac1ef0e73 | |||
| 0b0faf26d2 | |||
| d49695e7e8 | |||
| 0e96905213 | |||
| 57d9d4b99b | |||
| f77e6874d0 | |||
| daa72ff60c | |||
| 8bd44c10b8 | |||
| f4c77eee00 | |||
| 5b11c5b629 | |||
| 2e1f28c8c5 | |||
| 7bc2b82837 | |||
| f6f73cbb94 | |||
| 411b005dee | |||
| aacf2fc830 | |||
| e498a2b202 | |||
| 3853a81fba | |||
| 7b26a021e1 | |||
| b310799bf0 | |||
| 1a44be502a | |||
| 103a41c0ff | |||
| 9e5e3720b5 | |||
| baf7c2130e | |||
| c889960805 | |||
| 9462aea45f | |||
| f26ba1d75c | |||
| 2d575dd86b | |||
| 5db70758cb | |||
| 8f2036eecc | |||
| 083422047c | |||
| dda65951b3 | |||
| dbd30021f9 | |||
| c69416ee88 | |||
| 03b0c71708 | |||
| d4214ee4bf | |||
| c70999100b | |||
| eceac30f4b | |||
| 736eb6feba | |||
| cd0710c428 | |||
| bd03a983a2 | |||
| 4c3896cbee | |||
| c362de7589 | |||
| c17af03ef3 | |||
| 2fbf72df61 | |||
| 55b0002688 | |||
| 2a3a86f185 | |||
| 82072f18dc | |||
| 7bfc30e50d | |||
| 109d70363d | |||
| 0ef8dca814 | |||
| 9685d7ee8a | |||
| 1dd6b73632 | |||
| 1a591b202c | |||
| ddda064033 | |||
| 48b5955e16 | |||
| a877e28da9 | |||
| f0ec279ea5 | |||
| 254931998c | |||
| 9ad22c03a8 | |||
| 1210c71484 | |||
| bd4b5e8a83 | |||
| 3b02745302 | |||
| 2349f1031c | |||
| 8ea29296bd | |||
| 68ce69ec70 | |||
| 814db0307a | |||
| 0aaddbe9ad | |||
| 5fcca05d2b | |||
| 8f6be2c87e | |||
| 8749ce8848 | |||
| ac0ca03845 | |||
| 568928c98f | |||
| 8fb4b979c3 | |||
| 23739baa7c | |||
| c7ce7a9351 | |||
| 74f4c21244 | |||
| 996ff6e6aa | |||
| 918d9129f4 | |||
| 27f782f659 | |||
| 17b1db88c1 | |||
| 27e05fdfde | |||
| a07151f507 | |||
| 94c4cf760a | |||
| 20cc7f22dc | |||
| 49257e4cf4 | |||
| bc0b3336c5 | |||
| fadf93b425 | |||
| 0815b43797 | |||
| 55185bae5b | |||
| 4030166118 | |||
| f179cbedd7 | |||
| 20bb89f388 | |||
| e4ccf5190b | |||
| 38b0b8f63f | |||
| dedbcc6c84 | |||
| cef0f7632d | |||
| 7af4457c6a | |||
| 9e851e1a10 | |||
| b322f9a8a6 | |||
| 02722c3146 | |||
| 8405913e84 | |||
| 5d5b23b25b | |||
| e3e10952a6 | |||
| 58e2dcdcc9 | |||
| 936fca0667 | |||
| e777d7e816 | |||
| 5472c99b15 | |||
| 2848102b79 | |||
| d3fae0711f | |||
| 0f05abc0ae | |||
| e52071f1f8 | |||
| f65b7380dc | |||
| 96f84d69e2 | |||
| 8f23d0a1b0 | |||
| 1058cf4a9a | |||
| dae26c74ee | |||
| 5a35b3f6a5 | |||
| 79936f7030 | |||
| 734b16d8a6 | |||
| e0940ac9bc | |||
| 843e3806fb | |||
| 13e99bd4a9 | |||
| bce8363a53 | |||
| e536c55439 | |||
| d474c71c88 | |||
| 0df5bc06fe | |||
| d221f9a49f | |||
| 371e4af00f | |||
| 27508e468c | |||
| 20af2287c4 | |||
| 5433bee74d | |||
| 291d7bfeaa | |||
| 1803ea1343 | |||
| 014cdbcf75 | |||
| d91622b6d3 | |||
| 2d96396687 | |||
| 27b16d7595 | |||
| 265923aa84 | |||
| e8bbcfcfad | |||
| 9e963d581e | |||
| 6843f99a1f | |||
| 1c0f4392b2 | |||
| 8d3c122d93 | |||
| e57ab1a0fb | |||
| a0e6fc6157 | |||
| d842e7bc02 | |||
| a3dfb2bbe6 | |||
| 932911a746 | |||
| 3f3c169555 | |||
| 6b8123d650 | |||
| ac885c5e3f | |||
| 8c44bdac05 | |||
| bb65968afe | |||
| 44d3ea2468 | |||
| 3f76dd78cb | |||
| 9c1d94cdc0 | |||
| e322ceb622 | |||
| 1a24d95d31 | |||
| 2e159063b5 | |||
| 1be8be97aa | |||
| 565693d911 | |||
| 87cfcf3dd2 | |||
| 45b1be2b9f | |||
| bb85db9c3b | |||
| f506f9275d | |||
| 973a8a7ebb | |||
| 86534dea29 | |||
| 353d8c5183 | |||
| 3b02dfb1c7 | |||
| f78b9eddb9 | |||
| 30ea561714 | |||
| db557162af | |||
| 76b19c6ff5 | |||
| df5f29566d | |||
| 82d815adbb | |||
| d54b735986 | |||
| fbfb43040c | |||
| b332ac8acf | |||
| 61a6836a67 | |||
| 5a6a1a19c4 | |||
| 120bb5edc9 | |||
| d14bbc1d22 | |||
| 10c5a8c75c | |||
| 51da1dbbc3 | |||
| 89e4110ab0 | |||
| c06beae86f | |||
| bc59b580b0 | |||
| e1ea9fe4f4 | |||
| 5acb0aa92c | |||
| 7c2952899b | |||
| e925c6bed9 | |||
| a715a7c022 | |||
| b94c39923f | |||
| ce5bd50939 | |||
| ecbd6e1c6d | |||
| debe3f8025 | |||
| b1e4edad3b | |||
| 3ad6ed8bfa |
@@ -5,17 +5,13 @@ namespace App\Console\Commands\Data;
|
||||
use Illuminate\Console\Command;
|
||||
use Log;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Models
|
||||
use App\Models\ScheduledTask\ScheduleJob;
|
||||
use App\Jobs\Commands\Eve\SendEveMail;
|
||||
|
||||
//Library
|
||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
use App\Library\Esi\Esi;
|
||||
use Seat\Eseye\Cache\NullCache;
|
||||
use Seat\Eseye\Configuration;
|
||||
use App\Library\Helpers\FinanceHelper;
|
||||
use App\Library\Moons\MoonCalc;
|
||||
use App\Models\MoonRental\AllianceMoon;
|
||||
use App\Models\MoonRental\AllianceMoonOre;
|
||||
|
||||
class Test extends Command
|
||||
{
|
||||
@@ -50,39 +46,25 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$esiHelper = new Esi;
|
||||
$config = config('esi');
|
||||
//Declare variables
|
||||
$lookup = new LookupHelper;
|
||||
$mHelper = new MoonCalc;
|
||||
$months = 3;
|
||||
$rentalTax = 0.25;
|
||||
$worth1;
|
||||
$worth2;
|
||||
|
||||
$refreshToken = $esiHelper->GetRefreshToken($config['primary']);
|
||||
$esi = $esiHelper->SetupEsiAuthentication($refreshToken);
|
||||
$moons = AllianceMoon::all();
|
||||
|
||||
$recipient = $config['primary'];
|
||||
$recipientType = 'character';
|
||||
$subject = "Just A Test for Eseye";
|
||||
$sender = $config['primary'];
|
||||
$body = "F0KlvSA9vrXWYK0IuMhSAbfaOAMmQO5U2CD69Dn0JOk26B8HnSPPkhSG3JzlawHjbBd16HAIbaawbv9304EaoTRctpu5cnZo0GoHINi3R7pNGi0IZTWKG4EArwWbSujwX9KPvMqGNbcSorrIEslw6neXWW1kcDN0GMcvV6SeoM23cSkK33cAbR4DTeqUXZ9ULuFy31UPXfEcaNzKREbqKPlgChYcGdCyHG1J25qrEmPlOTPI1NQQkh71HvHJTVA7bmTgLEJMdFYHbc3ZzGOB9RFLfhdkGEGl2f3OQNyDAJIKW2mNQVlRVGc3Emvm42czpsH8ojn3BX5nuEFxNfjgue8hhdBIZSKm232U2l0xsPGZOzHvQdYs8bLw7ZQX1drV9qOPnbhgzbFLxEvQoGDquhKAdlo7bhkgoCn5IiY3BbQ5qnKVodymb58gj9Pd67GxjJ8K0854c91KkrJNEOCyiVcqKYqNDtKkB7hgjBLZUKRtWUkOf9j1qIRARoGzTGdqK20yvfaVIWetVqjw5UvzQC2pynHkvIw2X3aD49ghY7UOzXUceKJ8taF4ZaMvW34r5OvyTrjVo4PKV9TylIODmzg1U0s4joxz58f1A6BNp2fCs1YzNOObuMaxGjek47jv2gDgyhQnmi5uaREcGn5AAwgMUc55GPY2jevRTHo9scMqm5amaJUBQ3TgXvFSfS33LxD8xJjdKw7KB06stDQzdjyVb52mAdm5WchOOpGy3EXntBSzsfUHc4XEqql7lKTPLgBzeYxt9EagGP96Li4dABg2MaLuU4i1CWdV49ZdPwOt1OjwNU4QtfR02C6Vw7raCFl3mqWBgLke9O5dC8Lh3ojg7FBATstSuur2n41Rn4YwzGaiWJ3qKwTsJGL3k8PaHEsvwvq56w4Qjt8CqJsmAV1nsfKMFZaVlcbK3PFN5oHaDbQwDh4IVdwA8UPPnrn2wSuugi8QlVyUA8z9iVYMW8OdzHFn98zl7a2Bua5M";
|
||||
foreach($moons as $moon) {
|
||||
//Declare the arrays needed
|
||||
$ores = array();
|
||||
|
||||
SendEveMail::dispatch($body, $recipient, $recipientType, $subject, $sender);
|
||||
$ores = AllianceMoonOre::where([
|
||||
'moon_id' => $moon->moon_id,
|
||||
])->get(['ore_type_id', 'quantity'])->toArray();
|
||||
|
||||
/*
|
||||
try {
|
||||
$response = $esi->setBody([
|
||||
'approved_cost' => 100,
|
||||
'body' => "Welcome to this test message.<br>" . $body,
|
||||
'recipients' => [[
|
||||
'recipient_id' => $config['primary'],
|
||||
'recipient_type' => 'character',
|
||||
]],
|
||||
'subject' => 'Just a Test',
|
||||
])->invoke('post', '/characters/{character_id}/mail/', [
|
||||
'character_id' => $config['primary'],
|
||||
]);
|
||||
} catch(RequestFailedException $e) {
|
||||
return null;
|
||||
dd($ores);
|
||||
}
|
||||
|
||||
var_dump($response);
|
||||
dd($response->getErrorCode());
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ use DB;
|
||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||
use App\Library\Esi\Esi;
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
use App\Library\Moons\MoonCalc;
|
||||
|
||||
//Models
|
||||
use App\Models\MoonRental\AllianceMoonOre;
|
||||
@@ -55,19 +56,97 @@ class ImportAllianceMoons extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
///universe/moons/{moon_id}/
|
||||
//Declare variables
|
||||
$lookup = new LookupHelper;
|
||||
$mHelper = new MoonCalc;
|
||||
//Create the collection of lines for the input file.
|
||||
$lines = new Collection;
|
||||
|
||||
///universe/moons/{moon_id}/
|
||||
$moons = new Collection;
|
||||
|
||||
//Create the file handler
|
||||
$data = Storage::get('public/alliance_moons.txt');
|
||||
//Split the string into separate arrays based on the line
|
||||
$data = preg_split("/\n\t/", $data);
|
||||
$lines = preg_split("/\n/", $data);
|
||||
//Take each line and split it again by tabs
|
||||
foreach($lines as $temp) {
|
||||
//Split the lines into separate arrays by tabs
|
||||
$separated = preg_split("/\t/", $temp);
|
||||
//Push the tabbed array into the collection
|
||||
$moons->push($separated);
|
||||
}
|
||||
|
||||
var_dump($data);
|
||||
dd();
|
||||
/**
|
||||
* The first pass through the collection of data is to get all of the ore data
|
||||
* and store it in the database. From the database moon ore, we will create a list
|
||||
* of moons and store those in the database. After the list of moons are created in the
|
||||
* database, the function will then update the value of all the moons.
|
||||
*/
|
||||
|
||||
//Start working our way through all of the moons
|
||||
//and saving the data to the database
|
||||
foreach($moons as $moon) {
|
||||
//If the first array is null then we are dealing with an ore
|
||||
if($moon[0] == null) {
|
||||
$moonInfo = $lookup->GetMoonInfo($moon[6]);
|
||||
$solarName = $lookup->SystemIdToName($moonInfo->system_id);
|
||||
|
||||
$moonType = $mHelper->IsRMoonGoo($moon[1]);
|
||||
|
||||
if(AllianceMoon::where(['moon_id' => $moonInfo->moon_id])->count() == 0) {
|
||||
//Save the moon into the database
|
||||
$newMoon = new AllianceMoon;
|
||||
$newMoon->moon_id = $moonInfo->moon_id;
|
||||
$newMoon->name = $moonInfo->name;
|
||||
$newMoon->system_id = $moonInfo->system_id;
|
||||
$newMoon->system_name = $solarName;
|
||||
$newMoon->moon_type = $moonType;
|
||||
$newMoon->worth_amount = 0.00;
|
||||
$newMoon->rented = 'No';
|
||||
$newMoon->rental_amount = 0.00;
|
||||
$newMoon->save();
|
||||
} else {
|
||||
$current = AllianceMoon::where([
|
||||
'moon_id' => $moonInfo->moon_id,
|
||||
])->first();
|
||||
|
||||
if($current->moon_type == 'R4' && ($moonType == 'R8' || $moonType == 'R16' || $moonType == 'R32' || $moonType == 'R64')) {
|
||||
AllianceMoon::where([
|
||||
'moon_id' => $moonInfo->moon_id,
|
||||
])->update([
|
||||
'moon_type' => $moonType,
|
||||
]);
|
||||
} else if($current->moon_type == 'R8' && ($moonType == 'R16' || $moonType == 'R32' || $moonType == 'R64')) {
|
||||
AllianceMoon::where([
|
||||
'moon_id' => $moonInfo->moon_id,
|
||||
])->update([
|
||||
'moon_type' => $moonType,
|
||||
]);
|
||||
} else if($current->moon_type == 'R16' && ($moonType == 'R32' || $moonType == 'R64')) {
|
||||
AllianceMoon::where([
|
||||
'moon_id' => $moonInfo->moon_id,
|
||||
])->update([
|
||||
'moon_type' => $moonType,
|
||||
]);
|
||||
} else if($current->moon_type == 'R32' && $moonType == 'R64') {
|
||||
AllianceMoon::where([
|
||||
'moon_id' => $moonInfo->moon_id,
|
||||
])->update([
|
||||
'moon_type' => $moonType,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
//Save a new entry into the database
|
||||
$ore = new AllianceMoonOre;
|
||||
$ore->moon_id = $moon[6];
|
||||
$ore->moon_name = $moonInfo->name;
|
||||
$ore->ore_type_id = $moon[3];
|
||||
$ore->ore_name = $moon[1];
|
||||
$ore->quantity = $moon[2];
|
||||
$ore->solar_system_id = $moon[4];
|
||||
$ore->planet_id = $moon[5];
|
||||
$ore->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class ExecuteMiningTaxesLedgersCommand extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
PreFetch::dispatch()->onQueue('miningtaxes');
|
||||
PreFetch::dispatch();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class ExecuteMiningTaxesObserversCommand extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
FetchObservers::dispatch()->onQueue('miningtaxes');
|
||||
FetchObservers::dispatch();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class ExecuteProcesssMiningTaxesPaymentsCommand extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
PMTP::dispatch()->onQueue('miningtaxes');
|
||||
PMTP::dispatch();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Console\Commands\MiningTaxes;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use App\Jobs\Commands\MiningTaxes\SendMiningTaxesInvoices as SendInvoice;
|
||||
use App\Jobs\Commands\MiningTaxes\MiningTaxesWeeklyInvoicing as SendInvoice;
|
||||
|
||||
class ExecuteSendMiningTaxesInvoiceCommand extends Command
|
||||
{
|
||||
@@ -39,7 +39,7 @@ class ExecuteSendMiningTaxesInvoiceCommand extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
SendInvoice::dispatch()->onQueue('miningtaxes');
|
||||
SendInvoice::dispatch();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ExecuteSendMoonRentalInvoices extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'mr:invoice';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Execute command to send moon rental invoices job';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\MoonRental;
|
||||
|
||||
//Application Library
|
||||
use Illuminate\Console\Command;
|
||||
use Log;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Internal Library
|
||||
use App\Library\Moons\MoonCalc;
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\MoonRental\AllianceMoon;
|
||||
use App\Models\MoonRental\AllianceMoonOre;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\MoonRental\UpdateAllianceMoonRentalWorth;
|
||||
|
||||
class ExecuteUpdateAllianceMoonRentalWorth extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'mr:worth';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Update alliance moon rental worth.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
UpdateAllianceMoonRentalWorth::dispatch();
|
||||
|
||||
/*
|
||||
//Declare variables
|
||||
$lookup = new LookupHelper;
|
||||
$mHelper = new MoonCalc;
|
||||
$months = 3;
|
||||
$rentalTax = 0.25;
|
||||
|
||||
$moons = AllianceMoon::all();
|
||||
|
||||
foreach($moons as $moon) {
|
||||
//Declare the arrays needed
|
||||
$ores = array();
|
||||
$worth = 0.00;
|
||||
|
||||
$ores = AllianceMoonOre::where([
|
||||
'moon_id' => $moon->moon_id,
|
||||
])->get(['ore_name', 'quantity'])->toArray();
|
||||
|
||||
if(sizeof($ores) == 1) {
|
||||
$ores[1]["ore_name"] = null;
|
||||
$ores[1]["quantity"] = 0.00;
|
||||
$ores[2]["ore_name"] = null;
|
||||
$ores[2]["quantity"] = 0.00;
|
||||
$ores[3]["ore_name"] = null;
|
||||
$ores[3]["quantity"] = 0.00;
|
||||
} else if(sizeof($ores) == 2) {
|
||||
$ores[2]["ore_name"] = null;
|
||||
$ores[2]["quantity"] = 0.00;
|
||||
$ores[3]["ore_name"] = null;
|
||||
$ores[3]["quantity"] = 0.00;
|
||||
} else if(sizeof($ores) == 3) {
|
||||
$ores[3]["ore_name"] = null;
|
||||
$ores[3]["quantity"] = 0.00;
|
||||
}
|
||||
|
||||
//one of these two ways will work
|
||||
$worth = $mHelper->MoonTotalWorth($ores[0]["ore_name"], $ores[0]["quantity"],
|
||||
$ores[1]["ore_name"], $ores[1]["quantity"],
|
||||
$ores[2]["ore_name"], $ores[2]["quantity"],
|
||||
$ores[3]["ore_name"], $ores[3]["quantity"]);
|
||||
|
||||
$rentalAmount = $worth * $rentalTax * $months;
|
||||
|
||||
AllianceMoon::where([
|
||||
'moon_id' => $moon->moon_id,
|
||||
])->update([
|
||||
'worth_amount' => $worth,
|
||||
'rental_amount' => $rentalAmount,
|
||||
]);
|
||||
}
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
42
app/Console/Commands/TestCommand.php
Normal file
42
app/Console/Commands/TestCommand.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class TestCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'command:name';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,9 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
use App\Jobs\Commands\MiningTaxes\PreFetchMiningTaxesLedgers;
|
||||
use App\Jobs\Commands\MiningTaxes\FetchMiningTaxesObservers;
|
||||
use App\Jobs\Commands\MiningTaxes\ProcessMiningTaxesPayments;
|
||||
use App\Jobs\Commands\MiningTaxes\SendMiningTaxesInvoices;
|
||||
use App\Jobs\Commands\MiningTaxes\UpdateMiningTaxesLateInvoices1st;
|
||||
use App\Jobs\Commands\MiningTaxes\UpdateMiningTaxesLateInvoices15th;
|
||||
use App\Jobs\Commands\MiningTaxes\Invoices\UpdateMiningTaxesLateInvoices1st;
|
||||
use App\Jobs\Commands\MiningTaxes\Invoices\UpdateMiningTaxesLateInvoices15th;
|
||||
use App\Jobs\Commands\MiningTaxes\MiningTaxesWeeklyInvoicing;
|
||||
use App\Jobs\Commands\Finances\UpdateAllianceWalletJournalJob;
|
||||
use App\Jobs\Commands\Finances\UpdateItemPrices as UpdateItemPricesJob;
|
||||
use App\Jobs\Commands\Data\PurgeUsers as PurgeUsersJob;
|
||||
@@ -20,6 +20,7 @@ use App\Jobs\Commands\Structures\FetchAllianceStructures;
|
||||
use App\Jobs\Commands\Structures\PurgeAllianceStructures;
|
||||
use App\Jobs\Commands\Assets\FetchAllianceAssets;
|
||||
use App\Jobs\Commands\Assets\PurgeAllianceAssets;
|
||||
use App\Jobs\Commands\MoonRental\UpdateAllianceMoonRentalWorth as UpdateAMRW;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
@@ -40,6 +41,7 @@ class Kernel extends ConsoleKernel
|
||||
Commands\Structures\ExecuteFetchAllianceStructuresCommand::class,
|
||||
Commands\Structures\ExecuteFetchAllianceAssetsCommand::class,
|
||||
Commands\Files\ImportAllianceMoons::class,
|
||||
Commands\MoonRental\ExecuteUpdateAllianceMoonRentalWorth::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -81,12 +83,12 @@ class Kernel extends ConsoleKernel
|
||||
* Mining Tax Schedule
|
||||
*/
|
||||
$schedule->job(new FetchMiningTaxesObservers)
|
||||
->dailyAt('22:00')
|
||||
->withoutOverlapping();
|
||||
$schedule->job(new PreFetchMiningTaxesLedgers)
|
||||
->dailyAt('20:00')
|
||||
->withoutOverlapping();
|
||||
$schedule->job(new SendMiningTaxesInvoices)
|
||||
$schedule->job(new PreFetchMiningTaxesLedgers)
|
||||
->dailyAt('22:00')
|
||||
->withoutOverlapping();
|
||||
$schedule->job(new MiningTaxesWeeklyInvoicing)
|
||||
->weeklyOn(1, '06:00')
|
||||
->withoutOverlapping();
|
||||
$schedule->job(new ProcessMiningTaxesPayments)
|
||||
@@ -98,6 +100,9 @@ class Kernel extends ConsoleKernel
|
||||
$schedule->job(new UpdateMiningTaxesLateInvoices15th)
|
||||
->monthlyOn(15, '16:00')
|
||||
->withoutOverlapping();
|
||||
$schedule->job(new UpdateAMRW)
|
||||
->dailyAt('13:00')
|
||||
->withoutOverlapping();
|
||||
|
||||
/**
|
||||
* Alliance Structure and Assets Schedule
|
||||
|
||||
@@ -36,7 +36,7 @@ class AfterActionReportsController extends Controller
|
||||
'comments' => 'required',
|
||||
]);
|
||||
|
||||
$report = new Report;
|
||||
$report = new AfterActionReport;
|
||||
$report->fc_id = auth()->user()->getId();
|
||||
$report->fc_name = auth()->user()->getName();
|
||||
$report->formup_time = $request->time;
|
||||
|
||||
@@ -25,7 +25,7 @@ class SupplyChainController extends Controller
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role:Renter');
|
||||
$this->middleware('role:User');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,14 +33,17 @@ class AdminDashboardController extends Controller
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role:Admin');
|
||||
$this->middleware('role:User');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the administration dashboard.
|
||||
*/
|
||||
public function displayAdminDashboard() {
|
||||
if(auth()->user()->hasRole('Admin') || auth()->user()->hasPermission('moon.admin') || auth()->user()->hasPermission('srp.admin') || auth()->user()->hasPermission('contract.admin')) {
|
||||
if(auth()->user()->hasRole('Admin') ||
|
||||
auth()->user()->hasPermission('srp.admin') ||
|
||||
auth()->user()->hasPermission('contract.admin' ||
|
||||
auth()->user()->hasPermission('mining.officer'))) {
|
||||
//Do nothing and continue on
|
||||
} else {
|
||||
redirect('/dashboard');
|
||||
@@ -54,6 +57,8 @@ class AdminDashboardController extends Controller
|
||||
* Display users in a paginated format
|
||||
*/
|
||||
public function displayUsersPaginated() {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Declare array variables
|
||||
$user = array();
|
||||
$permission = array();
|
||||
@@ -91,6 +96,8 @@ class AdminDashboardController extends Controller
|
||||
* Search users for a specific user
|
||||
*/
|
||||
public function searchUsers(Request $request) {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Declare array variables
|
||||
$user = array();
|
||||
$permission = array();
|
||||
@@ -133,6 +140,8 @@ class AdminDashboardController extends Controller
|
||||
* Display the allowed logins
|
||||
*/
|
||||
public function displayAllowedLogins() {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Declare array variables
|
||||
$entities = array();
|
||||
|
||||
@@ -155,8 +164,10 @@ class AdminDashboardController extends Controller
|
||||
*
|
||||
*/
|
||||
public function displayTaxes() {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Declare variables needed for displaying items on the page
|
||||
$months = 3;
|
||||
$months = 6;
|
||||
$pi = array();
|
||||
$industry = array();
|
||||
$reprocessing = array();
|
||||
@@ -228,6 +239,11 @@ class AdminDashboardController extends Controller
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetMoonMiningTaxesLateGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
|
||||
$moonRentalTaxes[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetMoonRentalTaxesGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
}
|
||||
|
||||
return view('admin.dashboards.taxes')->with('pis', $pis)
|
||||
@@ -239,13 +255,16 @@ class AdminDashboardController extends Controller
|
||||
->with('srpActual', $srpActual)
|
||||
->with('srpLoss', $srpLoss)
|
||||
->with('miningTaxes', $miningTaxes)
|
||||
->with('miningTaxesLate', $miningTaxesLate);
|
||||
->with('miningTaxesLate', $miningTaxesLate)
|
||||
->with('moonRentalTaxes', $moonRentalTaxes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the modify user form
|
||||
*/
|
||||
public function displayModifyUser(Request $request) {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
$permissions = array();
|
||||
$roles = array();
|
||||
|
||||
@@ -280,6 +299,8 @@ class AdminDashboardController extends Controller
|
||||
* Modify a user's role
|
||||
*/
|
||||
public function modifyRole(Request $request) {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
$this->validate($request, [
|
||||
'user' => 'required',
|
||||
'role' => 'required',
|
||||
@@ -293,6 +314,8 @@ class AdminDashboardController extends Controller
|
||||
}
|
||||
|
||||
public function addPermission(Request $request) {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Get the user and permission from the form
|
||||
$character = $request->user;
|
||||
$permission = $request->permission;
|
||||
@@ -316,6 +339,8 @@ class AdminDashboardController extends Controller
|
||||
* Delete a user to reset their permissions
|
||||
*/
|
||||
public function removeUser(Request $request) {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Get the user from the form to delete
|
||||
$user = $request->user;
|
||||
|
||||
@@ -341,6 +366,8 @@ class AdminDashboardController extends Controller
|
||||
* Add an entity to the allowed login table
|
||||
*/
|
||||
public function addAllowedLogin(Request $request) {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Set the parameters to validate the form
|
||||
$this->validate($request, [
|
||||
'allowedEntityId' => 'required',
|
||||
@@ -380,6 +407,8 @@ class AdminDashboardController extends Controller
|
||||
* Remove an entity from the allowed login table
|
||||
*/
|
||||
public function removeAllowedLogin(Request $request) {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
//Set the parameters to validate the form
|
||||
$this->validate($request, [
|
||||
'removeAllowedLogin' => 'required',
|
||||
@@ -396,6 +425,8 @@ class AdminDashboardController extends Controller
|
||||
* Show journal entries in a table for admins from alliance wallets
|
||||
*/
|
||||
public function displayJournalEntries() {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
$date = Carbon::now()->subDays(60);
|
||||
|
||||
$journal = AllianceWalletJournal::where('date', '>=', $date)
|
||||
|
||||
@@ -34,7 +34,7 @@ class DashboardController extends Controller
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role:Guest');
|
||||
$this->middleware('role:User');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
322
app/Http/Controllers/Finances/FinanceController.php
Normal file
322
app/Http/Controllers/Finances/FinanceController.php
Normal file
@@ -0,0 +1,322 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Finances;
|
||||
|
||||
//Internal Libraries
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use Log;
|
||||
use Khill\Lavacharts\Lavacharts;
|
||||
|
||||
//Application Library
|
||||
use App\Library\Helpers\TaxesHelper;
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
use App\Library\Helpers\SRPHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\User\User;
|
||||
|
||||
class FinanceController extends Controller
|
||||
{
|
||||
//Construct
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role:User');
|
||||
$this->middleware('permission:ceo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the finances of the alliance with cards like the admin dashboard
|
||||
*/
|
||||
public function displayCards() {
|
||||
$months = 3;
|
||||
|
||||
$pi = array();
|
||||
$industry = array();
|
||||
$reprocessing = array();
|
||||
$office = array();
|
||||
$corpId = 98287666;
|
||||
$srpActual = array();
|
||||
$srpLoss = array();
|
||||
$miningTaxes = array();
|
||||
$miningTaxesLate = array();
|
||||
|
||||
/** Taxes Pane */
|
||||
//Declare classes needed for displaying items on the page
|
||||
$tHelper = new TaxesHelper();
|
||||
$srpHelper = new SRPHelper();
|
||||
//Get the dates for the tab panes
|
||||
$dates = $tHelper->GetTimeFrameInMonths($months);
|
||||
|
||||
//Get the data for the Taxes Pane
|
||||
foreach($dates as $date) {
|
||||
//Get the srp actual pay out for the date range
|
||||
$srpActual[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($srpHelper->GetAllianceSRPActual($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
|
||||
//Get the srp loss value for the date range
|
||||
$srpLoss[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($srpHelper->GetAllianceSRPLoss($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
|
||||
//Get the pi taxes for the date range
|
||||
$pis[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetPIGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
//Get the industry taxes for the date range
|
||||
$industrys[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetIndustryGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
//Get the reprocessing taxes for the date range
|
||||
$reprocessings[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetReprocessingGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
//Get the office taxes for the date range
|
||||
$offices[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetOfficeGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
//Get the market taxes for the date range
|
||||
$markets[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetAllianceMarketGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
//Get the jump gate taxes for the date range
|
||||
$jumpgates[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetJumpGateGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
|
||||
$miningTaxes[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetMoonMiningTaxesGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
|
||||
$miningTaxesLate[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetMoonMiningTaxesLateGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
|
||||
$moonRentalTaxes[] = [
|
||||
'date' => $date['start']->toFormattedDateString(),
|
||||
'gross' => number_format($tHelper->GetMoonRentalTaxesGross($date['start'], $date['end']), 2, ".", ","),
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
return view('finances.display.card')->with('pis', $pis)
|
||||
->with('industrys', $industrys)
|
||||
->with('offices', $offices)
|
||||
->with('markets', $markets)
|
||||
->with('jumpgates', $jumpgates)
|
||||
->with('reprocessings', $reprocessings)
|
||||
->with('srpActual', $srpActual)
|
||||
->with('srpLoss', $srpLoss)
|
||||
->with('miningTaxes', $miningTaxes)
|
||||
->with('miningTaxesLate', $miningTaxesLate)
|
||||
->with('moonRentalTaxes', $moonRentalTaxes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a graph of the financial outlook of the alliance
|
||||
*/
|
||||
public function displayOutlook() {
|
||||
$months = 12;
|
||||
$income = array();
|
||||
$expenses = array();
|
||||
$totalPi = 0.00;
|
||||
$totalIndustry = 0.00;
|
||||
$totalReprocessing = 0.00;
|
||||
$totalOffices = 0.00;
|
||||
$totalMarket = 0.00;
|
||||
$totalJumpGate = 0.00;
|
||||
$totalMiningTaxes = 0.00;
|
||||
$totalMoonRentals = 0.00;
|
||||
$totalSrp = 0.00;
|
||||
$totalCapEx = 0.00;
|
||||
$totalSovExpenses = 0.00;
|
||||
|
||||
/**
|
||||
* Declare classes needed for displaying items on the page
|
||||
*/
|
||||
$tHelper = new TaxesHelper();
|
||||
$srpHelper = new SRPHelper();
|
||||
//Get the dates to process
|
||||
$dates = $tHelper->GetTimeFrameInMonths($months);
|
||||
|
||||
/**
|
||||
* Setup the chart variables
|
||||
*/
|
||||
$lava = new Lavacharts;
|
||||
$finances = $lava->DataTable();
|
||||
$incomeStreams = $lava->DataTable();
|
||||
$expenseStreams = $lava->DataTable();
|
||||
|
||||
$finances->addDateColumn('Month')
|
||||
->addNumberColumn('Income')
|
||||
->addNumberColumn('Expenses')
|
||||
->addNumberColumn('Difference')
|
||||
->setDateTimeFormat('Y');
|
||||
|
||||
/**
|
||||
* Get the income and expenses data for date range
|
||||
*/
|
||||
foreach($dates as $date) {
|
||||
/**
|
||||
* Get the individual expenses.
|
||||
* Will totalize later in the foreach loop
|
||||
*/
|
||||
$srpActual = $srpHelper->GetAllianceSRPActual($date['start'], $date['end']);
|
||||
$capEx = 0.00;
|
||||
$sovExpenses = 3000000000.00;
|
||||
|
||||
/**
|
||||
* Get the individual incomes.
|
||||
* Will totalize later in the foreach loop
|
||||
*/
|
||||
$pi = $tHelper->GetPIGross($date['start'], $date['end']);
|
||||
$industry = $tHelper->GetIndustryGross($date['start'], $date['end']);
|
||||
$reprocessing = $tHelper->GetReprocessingGross($date['start'], $date['end']);
|
||||
$offices = $tHelper->GetOfficeGross($date['start'], $date['end']);
|
||||
$market = $tHelper->GetAllianceMarketGross($date['start'], $date['end']);
|
||||
$jumpgate = $tHelper->GetJumpGateGross($date['start'], $date['end']);
|
||||
$miningTaxes = $tHelper->GetMoonMiningTaxesGross($date['start'], $date['end']) + $tHelper->GetMoonMiningTaxesLateGross($date['start'], $date['end']);
|
||||
$moonRentals = $tHelper->GetMoonRentalTaxesGross($date['start'], $date['end']);
|
||||
|
||||
/**
|
||||
* Totalize the expenses
|
||||
*/
|
||||
$expenses = (($srpActual + $capEx + $sovExpenses) / 1000000.00);
|
||||
|
||||
/**
|
||||
* Totalize the incomes
|
||||
*/
|
||||
$incomes = (($pi +
|
||||
$industry +
|
||||
$reprocessing +
|
||||
$offices +
|
||||
$market +
|
||||
$jumpgate +
|
||||
$miningTaxes +
|
||||
$moonRentals) / 1000000.00);
|
||||
|
||||
/**
|
||||
* Get the difference between income and expenses
|
||||
*/
|
||||
$difference = $incomes - $expenses;
|
||||
|
||||
//Add the rows for the combo column chart
|
||||
$finances->addRow([$date['start'], $incomes, $expenses, $difference]);
|
||||
|
||||
//Add up each of the income streams, then the expenses
|
||||
$totalPi += $pi;
|
||||
$totalIndustry += $industry;
|
||||
$totalReprocessing += $reprocessing;
|
||||
$totalOffices += $offices;
|
||||
$totalMarket += $market;
|
||||
$totalJumpGate += $jumpgate;
|
||||
$totalMiningTaxes += $miningTaxes;
|
||||
$totalMoonRentals += $moonRentals;
|
||||
$totalSrp += $srpActual;
|
||||
$totalCapEx = $capEx;
|
||||
$totalSovExpenses += $sovExpenses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finish setting up the lava chart before passing it to the blade template
|
||||
*/
|
||||
$lava->ComboChart('Finances', $finances, [
|
||||
'title' => 'Alliance Finances',
|
||||
'titleTextStyle' => [
|
||||
'color' => 'rgb(123, 65, 80)',
|
||||
'fontSize' => 16,
|
||||
],
|
||||
'legend' => [
|
||||
'position' => 'in',
|
||||
],
|
||||
'seriesType' => 'bars',
|
||||
'series' => [
|
||||
2 => [
|
||||
'type' => 'line',
|
||||
],
|
||||
],
|
||||
'height' => 360,
|
||||
]);
|
||||
|
||||
/**
|
||||
* Setup the 3d pie chart for income streams
|
||||
*/
|
||||
$incomeStreams->addStringColumn('Incomes')
|
||||
->addNumberColumn('ISK')
|
||||
->addRow(['PI', $totalPi])
|
||||
->addRow(['Industry', $totalIndustry])
|
||||
->addRow(['Reprocessing', $totalReprocessing])
|
||||
->addRow(['Offices', $totalOffices])
|
||||
->addRow(['Market', $totalMarket])
|
||||
->addRow(['Jump Gate', $totalJumpGate])
|
||||
->addRow(['Mining Taxes', $totalMiningTaxes])
|
||||
->addRow(['Moon Rentals', $totalMoonRentals]);
|
||||
|
||||
/**
|
||||
* Setup the 3d pie chart for expense streams
|
||||
*/
|
||||
$expenseStreams->addStringColumn('Expenses')
|
||||
->addNumberColumn('ISK')
|
||||
->addRow(['SRP', $totalSrp])
|
||||
->addRow(['Cap Ex', $totalCapEx])
|
||||
->addRow(['Sov Expenses', $totalSovExpenses]);
|
||||
|
||||
/**
|
||||
* Setup the pie chart data for income streams
|
||||
*/
|
||||
$lava->PieChart('Incomes', $incomeStreams, [
|
||||
'title' => 'Alliance Income Streams',
|
||||
'is3D' => true,
|
||||
'height' => 360,
|
||||
]);
|
||||
|
||||
/**
|
||||
* Setup the pie chart data for expenses
|
||||
*/
|
||||
$lava->PieChart('Expenses', $expenseStreams, [
|
||||
'title' => 'Alliance Expenses',
|
||||
'is3D' => true,
|
||||
'height' => 360,
|
||||
'slices' => [
|
||||
['offset' => 0.15],
|
||||
['offset' => 0.25],
|
||||
],
|
||||
]);
|
||||
|
||||
return view('finances.display.outlook')->with('lava', $lava);
|
||||
}
|
||||
|
||||
/**
|
||||
* Request an amount of ISK to fund a capital project
|
||||
*/
|
||||
public function requestFundingDisplay() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the request for the capital project
|
||||
*/
|
||||
public function storeFundingRequest() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a request for the capital project
|
||||
*/
|
||||
public function deleteFundingRequest() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ use Log;
|
||||
use Carbon\Carbon;
|
||||
use Khill\Lavacharts\Lavacharts;
|
||||
use Auth;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
//Application Library
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
@@ -25,12 +27,100 @@ use App\Models\Moon\ItemComposition;
|
||||
use App\Models\Moon\MineralPrice;
|
||||
use App\Models\Esi\EsiToken;
|
||||
use App\Models\Esi\EsiScope;
|
||||
use App\Models\Structure\Structure;
|
||||
use App\Models\MiningTax\MiningOperation;
|
||||
|
||||
class MiningTaxesAdminController extends Controller
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role:Admin');
|
||||
$this->middleware('role:User');
|
||||
$this->middleware('permission:mining.officer');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the form for mining operations held by the alliance
|
||||
*/
|
||||
public function displayMiningOperationForm() {
|
||||
//Declare variables
|
||||
$config = config('esi');
|
||||
$lookup = new LookupHelper;
|
||||
$sHelper = new StructureHelper($config['primary'], $config['corporation']);
|
||||
$coll = new Collection;
|
||||
$structures = new Collection;
|
||||
|
||||
//Get all of the structures
|
||||
$athanors = $sHelper->GetStructuresByType('Athanor');
|
||||
$tataras = $sHelper->GetStructuresByType('Tatara');
|
||||
|
||||
//Cycle through each athanor and add it to the stack
|
||||
foreach($athanors as $athanor) {
|
||||
$structures->push([
|
||||
$athanor->structure_id => $athanor->structure_name,
|
||||
]);
|
||||
}
|
||||
//Cycle through each tatara and add it to the stack
|
||||
foreach($tataras as $tatara) {
|
||||
$structures->push([
|
||||
$tatara->structure_id => $tatara->structure_name,
|
||||
]);
|
||||
}
|
||||
//Sort all of the structures
|
||||
$structures->sort();
|
||||
|
||||
//Get the current mining operations.
|
||||
$operations = MiningOperation::where([
|
||||
'processed' => 'No',
|
||||
])->get();
|
||||
|
||||
return view('miningtax.admin.display.miningops.form')->with('structures', $structures)
|
||||
->with('operations', $operations);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the results from the mining operations form
|
||||
*/
|
||||
public function storeMiningOperationForm(Request $request) {
|
||||
//Validate the data
|
||||
$this->validate($request, [
|
||||
'name' => 'required',
|
||||
'date' => 'required',
|
||||
'structure' => 'required',
|
||||
]);
|
||||
|
||||
$config = config('esi');
|
||||
$sHelper = new StructureHelper($config['primary'], $config['corporation']);
|
||||
|
||||
//Get the name of the structure from the database
|
||||
$m = $sHelper->GetStructureInfo($request->structure);
|
||||
|
||||
//Save the mining operation into the database
|
||||
$operation = new MiningOperation;
|
||||
$operation->structure_id = $request->structure;
|
||||
$operation->structure_name = $m->structure_name;
|
||||
$operation->authorized_by_id = auth()->user()->getId();
|
||||
$operation->authorized_by_name = auth()->user()->getName();
|
||||
$operation->operation_name = $request->name;
|
||||
$operation->operation_date = $request->date;
|
||||
$operation->processed = 'No';
|
||||
$operation->processed_on = null;
|
||||
$operation->save();
|
||||
|
||||
return redirect('/admin/dashboard')->with('success', 'Operation added successfully.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the page to approve corporation moon rentals
|
||||
*/
|
||||
public function DisplayMoonRentalRequests() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Approve a moon rental from the form
|
||||
*/
|
||||
public function storeApproveMoonRentalRequest() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,6 +144,73 @@ class MiningTaxesAdminController extends Controller
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display an invoice based on it's id
|
||||
*
|
||||
* @var $invoiceId
|
||||
*/
|
||||
public function displayInvoice($invoiceId) {
|
||||
$ores = array();
|
||||
$moons = array();
|
||||
$totalPrice = 0.00;
|
||||
$config = config('esi');
|
||||
$structure = new StructureHelper($config['primary'], $config['corporation']);
|
||||
|
||||
//Get the invoice from the database
|
||||
$invoice = Invoice::where([
|
||||
'invoice_id' => $invoiceId,
|
||||
])->first();
|
||||
|
||||
//Get the line items for the ledger for the invoice
|
||||
$items = Ledger::where([
|
||||
'invoice_id' => $invoiceId,
|
||||
])->get();
|
||||
|
||||
//Build the total ores table for the display page
|
||||
foreach($items as $item) {
|
||||
if(!isset($ores[$item['ore_name']])) {
|
||||
$ores[$item['ore_name']] = 0;
|
||||
}
|
||||
$ores[$item['ore_name']] = $ores[$item['ore_name']] + $item['quantity'];
|
||||
|
||||
$totalPrice += $item['amount'];
|
||||
}
|
||||
|
||||
//Print out the lines of the ledger line by line for another table
|
||||
foreach($items as $item) {
|
||||
//Get the structure info from the database or esi
|
||||
$tempObserverInfo = $structure->GetStructureInfo($item['observer_id']);
|
||||
|
||||
if(isset($tempObserverInfo->name)) {
|
||||
array_push($moons, [
|
||||
'character_name' => $item['character_name'],
|
||||
'observer_name' => $tempObserverInfo->name,
|
||||
'type_id' => $item['type_id'],
|
||||
'ore_name' => $item['ore_name'],
|
||||
'quantity' => $item['quantity'],
|
||||
'amount' => $item['amount'],
|
||||
'tax_amount' => $item['amount'] * $config['public_mining_tax'],
|
||||
]);
|
||||
} else {
|
||||
array_push($moons, [
|
||||
'character_name' => $item['character_name'],
|
||||
'observer_name' => $tempObserverInfo->structure_name,
|
||||
'type_id' => $item['type_id'],
|
||||
'ore_name' => $item['ore_name'],
|
||||
'quantity' => $item['quantity'],
|
||||
'amount' => $item['amount'],
|
||||
'tax_amount' => $item['amount'] * $config['public_mining_tax'],
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return view('miningtax.admin.display.details.invoice')->with('ores', $ores)
|
||||
->with('moons', $moons)
|
||||
->with('invoice', $invoice)
|
||||
->with('totalPrice', $totalPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display current unpaid invoices
|
||||
*/
|
||||
@@ -122,6 +279,8 @@ class MiningTaxesAdminController extends Controller
|
||||
'invoice_id' => $request->invoiceId,
|
||||
])->update([
|
||||
'status' => $request->status,
|
||||
'modified_by_id' => auth()->user()->getId(),
|
||||
'modified_by_name' => auth()->user()->getName(),
|
||||
]);
|
||||
|
||||
return redirect('/miningtax/admin/display/unpaid')->with('success', 'Invoice successfully updated.');
|
||||
|
||||
@@ -10,7 +10,6 @@ use Log;
|
||||
use Carbon\Carbon;
|
||||
use Khill\Lavacharts\Lavacharts;
|
||||
use Auth;
|
||||
//Collection Stuff
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -19,6 +18,7 @@ use App\Library\Helpers\LookupHelper;
|
||||
use App\Library\Helpers\StructureHelper;
|
||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||
use App\Library\Esi\Esi;
|
||||
use App\Library\Moons\MoonCalc;
|
||||
|
||||
//Models
|
||||
use App\Models\Moon\ItemComposition;
|
||||
@@ -29,6 +29,9 @@ use App\Models\MiningTax\Invoice;
|
||||
use App\Models\Esi\EsiToken;
|
||||
use App\Models\Esi\EsiScope;
|
||||
use App\Models\User\User;
|
||||
use App\Models\MoonRental\AllianceMoon;
|
||||
use App\Models\MoonRental\AllianceMoonOre;
|
||||
use App\Models\MoonRental\AllianceMoonRental;
|
||||
|
||||
class MiningTaxesController extends Controller
|
||||
{
|
||||
@@ -40,24 +43,327 @@ class MiningTaxesController extends Controller
|
||||
$this->middleware('role:User');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the moons either the person is renting, or their corp are renting
|
||||
*/
|
||||
public function DisplayRentedMoons() {
|
||||
$moons = array();
|
||||
|
||||
$lookup = new LookupHelper;
|
||||
|
||||
$userId = auth()->user()->getId();
|
||||
$charInfo = $lookup->GetCharacterInfo(auth()->user()->getId());
|
||||
$corpId = $charInfo->corporation_id;
|
||||
|
||||
|
||||
$tempMoons = AllianceMoonRental::where([
|
||||
'entity_id' => $userId,
|
||||
])->orWhere([
|
||||
'entity_id' => $corpId,
|
||||
])->get();
|
||||
|
||||
//Foreach of the moons we got let's build the moon info and the ore data
|
||||
foreach($tempMoons as $tempMoon) {
|
||||
//Get the ores for the moon
|
||||
$ores = AllianceMoonOre::where([
|
||||
'moon_id' => $tempMoon->moon_id,
|
||||
])->get()->toArray();
|
||||
|
||||
$moons->push([
|
||||
'moon_id' => $tempMoon->moon_id,
|
||||
'system' => $tempMoon->system_name,
|
||||
'moon_name' => $tempMoon->name,
|
||||
'ores' => $ores,
|
||||
'worth_amount' => $tempMoon->worth_amount,
|
||||
'rental_amount' => $tempMoon->rental_amount,
|
||||
]);
|
||||
}
|
||||
|
||||
return view('miningtax.user.display.rentedmoons')->with('moons', $moons)
|
||||
->with('ores', $ores);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the page with the moon rental form
|
||||
*/
|
||||
public function DisplayMoonRentalForm(Request $request) {
|
||||
$this->validate($request, [
|
||||
'moon_id' => 'required',
|
||||
'moon_name' => 'required',
|
||||
'worth_amount' => 'required',
|
||||
'rental_amount' => 'required',
|
||||
]);
|
||||
|
||||
$moon = AllianceMoon::where([
|
||||
'moon_id' => $request->moon_id,
|
||||
])->first();
|
||||
|
||||
$ores = AllianceMoonOre::where([
|
||||
'moon_id' => $request->moon_id,
|
||||
])->get();
|
||||
|
||||
return view('miningtax.user.display.moonrentals.form')->with('moon', $moon)
|
||||
->with('ores', $ores);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the information from the moon rental form
|
||||
*/
|
||||
public function storeMoonRentalForm(Request $request) {
|
||||
$this->validate($request, [
|
||||
'moon_id' => 'required',
|
||||
'rental_start' => 'required',
|
||||
'rental_end' => 'required',
|
||||
'entity_name' => 'required',
|
||||
'entity_type' => 'required',
|
||||
]);
|
||||
|
||||
$lookup = new LookupHelper;
|
||||
$entityId = null;
|
||||
|
||||
//From the name and type of the entity get the entity id.
|
||||
if($request->entity_type == 'Character') {
|
||||
$entityId = $lookup->CharacterNameToId($request->entity_name);
|
||||
} else if($request->entity_type == 'Corporation') {
|
||||
$entityId = $lookup->CorporationNameToId($request->entity_name);
|
||||
} else if($request->entity_type == 'Alliance') {
|
||||
$entityId = $lookup->AllianceNameToId($request->entity_name);
|
||||
} else {
|
||||
return redirect('/dashboard')->with('error', 'Moon Rental error. Please contact the site admin.');
|
||||
}
|
||||
|
||||
//Create the next billing date from a Carbon date 3 months from the rental start
|
||||
$nextBillingDate = Carbon::create($request->rental_start)->addMonths(3);
|
||||
|
||||
//Create the uniqid for the billing cycle.
|
||||
$invoiceId = "MR" . uniqid();
|
||||
|
||||
//Get the moon's information from the database so we know how much to make the bill for
|
||||
$moon = AllianceMoon::where([
|
||||
'moon_id' => $request->moon_id,
|
||||
])->first();
|
||||
|
||||
//Update the data on the Alliance Moon
|
||||
AllianceMoon::where([
|
||||
'moon_id' => $request->moon_id,
|
||||
])->update([
|
||||
'rented' => 'Yes',
|
||||
]);
|
||||
|
||||
//Insert a new moon rental into the database
|
||||
AllianceMoonRental::insert([
|
||||
'moon_id' => $moon->moon_id,
|
||||
'moon_name' => $moon->name,
|
||||
'rental_amount' => $moon->rental_amount,
|
||||
'rental_start' => $request->rental_start,
|
||||
'rental_end' => $request->rental_end,
|
||||
'next_billing_date' => $nextBillingDate,
|
||||
'entity_id' => $entityId,
|
||||
'entity_name' => $request->entity_name,
|
||||
'entity_type' => $request->entity_type,
|
||||
]);
|
||||
|
||||
return redirect('/dashboard')->with('success', 'Before placing a structure please send the ISK to the holding corp with the description of ' . $invoiceId);
|
||||
}
|
||||
|
||||
public function displayAvailableMoons() {
|
||||
//Declare variables
|
||||
$moons = new Collection;
|
||||
$mHelper = new MoonCalc;
|
||||
$lookup = new LookupHelper;
|
||||
$system = array();
|
||||
|
||||
/**
|
||||
* Declare our different flavors of moon goo for the blade
|
||||
*/
|
||||
$r4Goo = [
|
||||
'Zeolites',
|
||||
'Sylvite',
|
||||
'Bitumens',
|
||||
'Coesite',
|
||||
];
|
||||
|
||||
$r8Goo = [
|
||||
'Cobaltite',
|
||||
'Euxenite',
|
||||
'Titanite',
|
||||
'Scheelite',
|
||||
];
|
||||
|
||||
$r16Goo = [
|
||||
'Otavite',
|
||||
'Sperrylite',
|
||||
'Vanadinite',
|
||||
'Chromite',
|
||||
];
|
||||
|
||||
$r32Goo = [
|
||||
'Carnotite',
|
||||
'Zircon',
|
||||
'Pollucite',
|
||||
'Cinnabar',
|
||||
];
|
||||
|
||||
$r64Goo = [
|
||||
'Xenotime',
|
||||
'Monazite',
|
||||
'Loparite',
|
||||
'Ytterbite',
|
||||
];
|
||||
|
||||
//Get all of the system names from the database by plucking all the non-rented moon system names
|
||||
$systems = AllianceMoon::where([
|
||||
'rented' => 'No',
|
||||
])->pluck('system_name')->unique()->toArray();
|
||||
|
||||
//Get all of the moons which are not rented
|
||||
$allyMoons = AllianceMoon::where([
|
||||
'rented' => 'No',
|
||||
])->get();
|
||||
|
||||
//Cycle through all of the moons to create arrays of data
|
||||
foreach($allyMoons as $moon) {
|
||||
$ores = AllianceMoonOre::where([
|
||||
'moon_id' => $moon->moon_id,
|
||||
])->get(['ore_name', 'quantity'])->toArray();
|
||||
|
||||
if($moon->moon_type != 'R32' && $moon->moon_type != 'R64') {
|
||||
$moons->push([
|
||||
'system' => $moon->system_name,
|
||||
'moon_name' => $moon->name,
|
||||
'ores' => $ores,
|
||||
'worth_amount' => $moon->worth_amount,
|
||||
'rental_amount' => $moon->rental_amount,
|
||||
'moon_id' => $moon->moon_id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return view('miningtax.user.display.moons.availablemoons')->with('moons', $moons)
|
||||
->with('systems', $systems)
|
||||
->with('r4Goo', $r4Goo)
|
||||
->with('r8Goo', $r8Goo)
|
||||
->with('r16Goo', $r16Goo)
|
||||
->with('r32Goo', $r32Goo)
|
||||
->with('r64Goo', $r64Goo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display all the moons in Warped Intentions Sovreignty
|
||||
*/
|
||||
public function displayAllMoons() {
|
||||
//Declare variables
|
||||
$moons = new Collection;
|
||||
$mHelper = new MoonCalc;
|
||||
$lookup = new LookupHelper;
|
||||
$system = array();
|
||||
|
||||
/**
|
||||
* Declare our different flavors of moon goo for the blade
|
||||
*/
|
||||
$r4Goo = [
|
||||
'Zeolites',
|
||||
'Sylvite',
|
||||
'Bitumens',
|
||||
'Coesite',
|
||||
];
|
||||
|
||||
$r8Goo = [
|
||||
'Cobaltite',
|
||||
'Euxenite',
|
||||
'Titanite',
|
||||
'Scheelite',
|
||||
];
|
||||
|
||||
$r16Goo = [
|
||||
'Otavite',
|
||||
'Sperrylite',
|
||||
'Vanadinite',
|
||||
'Chromite',
|
||||
];
|
||||
|
||||
$r32Goo = [
|
||||
'Carnotite',
|
||||
'Zircon',
|
||||
'Pollucite',
|
||||
'Cinnabar',
|
||||
];
|
||||
|
||||
$r64Goo = [
|
||||
'Xenotime',
|
||||
'Monazite',
|
||||
'Loparite',
|
||||
'Ytterbite',
|
||||
];
|
||||
|
||||
$systems = [
|
||||
'0-NTIS',
|
||||
'1-NJLK',
|
||||
'35-JWD',
|
||||
'8KR9-5',
|
||||
'EIMJ-M',
|
||||
'F-M1FU',
|
||||
'G-C8QO',
|
||||
'I6M-9U',
|
||||
'L5D-ZL',
|
||||
'L-YMYU',
|
||||
'VQE-CN',
|
||||
'VR-YIQ',
|
||||
'XZ-SKZ',
|
||||
'Y-CWQY',
|
||||
];
|
||||
|
||||
//Get all of the moons which are not rented
|
||||
$allyMoons = AllianceMoon::all();
|
||||
|
||||
foreach($allyMoons as $moon) {
|
||||
$ores = AllianceMoonOre::where([
|
||||
'moon_id' => $moon->moon_id,
|
||||
])->get(['ore_name', 'quantity'])->toArray();
|
||||
|
||||
$moons->push([
|
||||
'system' => $moon->system_name,
|
||||
'moon_name' => $moon->name,
|
||||
'ores' => $ores,
|
||||
]);
|
||||
}
|
||||
|
||||
return view('miningtax.user.display.moons.allmoons')->with('moons', $moons)
|
||||
->with('systems', $systems)
|
||||
->with('r4Goo', $r4Goo)
|
||||
->with('r8Goo', $r8Goo)
|
||||
->with('r16Goo', $r16Goo)
|
||||
->with('r32Goo', $r32Goo)
|
||||
->with('r64Goo', $r64Goo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display an invoice based on it's id
|
||||
*
|
||||
* @var $invoiceId
|
||||
*/
|
||||
public function DisplayInvoice($invoiceId) {
|
||||
public function displayInvoice($invoiceId) {
|
||||
$ores = array();
|
||||
$moons = array();
|
||||
$totalPrice = 0.00;
|
||||
$config = config('esi');
|
||||
$structure = new StructureHelper($config['primary'], $config['corporation']);
|
||||
|
||||
$systems = AllianceMoon::where([
|
||||
'rented' => 'No',
|
||||
])->pluck('system_name')->unique()->toArray();
|
||||
|
||||
//Get the invoice from the database
|
||||
$invoice = Invoice::where([
|
||||
'invoice_id' => $invoiceId,
|
||||
])->first();
|
||||
|
||||
//Get the line items for the ledger for the invoice
|
||||
$items = Ledger::where([
|
||||
'character_id' => auth()->user()->getId(),
|
||||
'invoice_id' => $invoice,
|
||||
'invoice_id' => $invoiceId,
|
||||
])->get();
|
||||
|
||||
//Build the total ores table for the display page
|
||||
foreach($items as $item) {
|
||||
if(!isset($ores[$item['ore_name']])) {
|
||||
$ores[$item['ore_name']] = 0;
|
||||
@@ -67,7 +373,25 @@ class MiningTaxesController extends Controller
|
||||
$totalPrice += $item['amount'];
|
||||
}
|
||||
|
||||
//Print out the lines of the ledger line by line for another table
|
||||
foreach($items as $item) {
|
||||
//Get the structure info from the database or esi
|
||||
$tempObserverInfo = $structure->GetStructureInfo($item['observer_id']);
|
||||
|
||||
//Create the array for the line by line
|
||||
array_push($moons, [
|
||||
'character_name' => $item['character_name'],
|
||||
'observer_name' => $tempObserverInfo->structure_name,
|
||||
'type_id' => $item['type_id'],
|
||||
'ore_name' => $item['ore_name'],
|
||||
'quantity' => $item['quantity'],
|
||||
'amount' => $item['amount'],
|
||||
'tax_amount' => $item['amount'] * $config['public_mining_tax'],
|
||||
]);
|
||||
}
|
||||
|
||||
return view('miningtax.user.display.details.invoice')->with('ores', $ores)
|
||||
->with('moons', $moons)
|
||||
->with('invoice', $invoice)
|
||||
->with('totalPrice', $totalPrice);
|
||||
}
|
||||
@@ -114,12 +438,12 @@ class MiningTaxesController extends Controller
|
||||
$paidAmount += $p->invoice_amount;
|
||||
}
|
||||
|
||||
return view('miningtax.user.display.invoices')->with('unpaid', $unpaid)
|
||||
->with('late', $late)
|
||||
->with('deferred', $deferred)
|
||||
->with('paid', $paid)
|
||||
->with('unpaidAmount', $unpaidAmount)
|
||||
->with('paidAmount', $paidAmount);
|
||||
return view('miningtax.user.display.invoices.invoices')->with('unpaid', $unpaid)
|
||||
->with('late', $late)
|
||||
->with('deferred', $deferred)
|
||||
->with('paid', $paid)
|
||||
->with('unpaidAmount', $unpaidAmount)
|
||||
->with('paidAmount', $paidAmount);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,8 +480,9 @@ class MiningTaxesController extends Controller
|
||||
//Basically get the structure info and attach it to the variable set
|
||||
foreach($extractions as $ex) {
|
||||
$sName = $sHelper->GetStructureInfo($ex->structure_id);
|
||||
//Add the information into the structures array to go to the page to be displayed
|
||||
array_push($structures, [
|
||||
'structure_name' => $sName->name,
|
||||
'structure_name' => $sName->structure_name,
|
||||
'start_time' => $esiHelper->DecodeDate($ex->extraction_start_time),
|
||||
'arrival_time' => $esiHelper->DecodeDate($ex->chunk_arrival_time),
|
||||
'decay_time' => $esiHelper->DecodeDate($ex->natural_decay_time),
|
||||
@@ -228,7 +553,7 @@ class MiningTaxesController extends Controller
|
||||
]);
|
||||
|
||||
//Return the view with the extractions variable for html processing
|
||||
return view('miningtax.user.display.upcoming')->with('structures', $structures)
|
||||
return view('miningtax.user.display.pulls.upcoming')->with('structures', $structures)
|
||||
->with('lava', $lava)
|
||||
->with('calendar', $calendar);
|
||||
}
|
||||
@@ -304,7 +629,7 @@ class MiningTaxesController extends Controller
|
||||
}
|
||||
|
||||
//Return the view
|
||||
return view('miningtax.user.display.ledger')->with('miningLedgers', $miningLedgers)
|
||||
return view('miningtax.user.display.details.ledger')->with('miningLedgers', $miningLedgers)
|
||||
->with('structures', $structures);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\MoonRental;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use Log;
|
||||
|
||||
class MoonRentalAdminController extends Controller
|
||||
{
|
||||
//Constructor
|
||||
public function __construct() {
|
||||
$this->middleware('role:Admin');
|
||||
$this->middleware('permission:moon.rental.manager');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display rental requests
|
||||
*/
|
||||
public function displayRentalRequests() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create monthly moon rental
|
||||
*/
|
||||
public function storeRentalRequest() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete / remove monthly moon rental
|
||||
*/
|
||||
public function updateRentalRequest() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display current monthly moon rentals
|
||||
*/
|
||||
public function displayCurrentRentals() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\MoonRental;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use Log;
|
||||
|
||||
class MoonRentalController extends Controller
|
||||
{
|
||||
//Constructor
|
||||
public function __construct() {
|
||||
$this->middleware('role:user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display all of the available moons for rental
|
||||
*/
|
||||
public function displayMoons() {
|
||||
$moons = AllianceMoon::where([
|
||||
'rented' => 'No',
|
||||
])->get();
|
||||
|
||||
return view('moon.rental.available.display')->with('moons', $moons);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display moon rental request form
|
||||
*/
|
||||
public function displayMoonRentalRequestForm() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Store moon rental from the request form
|
||||
*/
|
||||
public function storeMoonRentalRequest() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Request a mail job be added to the mail queue to resend mining bill instantly
|
||||
*/
|
||||
public function requestMoonRentalBill() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,11 @@ use Illuminate\Support\Str;
|
||||
//Application Library
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
use App\Library\Esi\Esi;
|
||||
use App\Library\Moons\MoonCalc;
|
||||
|
||||
//Models
|
||||
use App\Models\MoonRental\AllianceMoon;
|
||||
use App\Models\MoonRental\AllianceMoonOre;
|
||||
use App\Models\MiningTax\Invoice;
|
||||
use App\Models\MiningTax\Ledger;
|
||||
use App\Models\MiningTax\Observer;
|
||||
@@ -34,42 +37,224 @@ class TestController extends Controller
|
||||
}
|
||||
|
||||
public function DebugMiningTaxesInvoices() {
|
||||
$lookup = new LookupHelper;
|
||||
$ledgers = new Collection;
|
||||
$perms = new Collection;
|
||||
//Declare variables
|
||||
$mailDelay = 15;
|
||||
$mains = new Collection;
|
||||
$perms = null;
|
||||
$config = config('esi');
|
||||
$bodies = new Collection;
|
||||
|
||||
/**
|
||||
* This section will determine if users are mains or alts of a main.
|
||||
* If they are mains, we keep the key. If they are alts of a main, then we delete
|
||||
* the key from the collection.
|
||||
*/
|
||||
|
||||
var_dump(auth()->user()->getAlts());
|
||||
dd(auth()->user()->altCount());
|
||||
//Pluck all the users from the database of ledgers to determine if they are mains or alts.
|
||||
$tempMains = Ledger::where([
|
||||
'invoiced' => 'Yes',
|
||||
])->where('last_updated', '>', Carbon::now()->subDays(7))->pluck('character_id');
|
||||
|
||||
//Get all of the users in the database
|
||||
$users = User::all();
|
||||
//Get the unique character ids from the ledgers in the previous statement
|
||||
$tempMains = $tempMains->unique()->values()->all();
|
||||
|
||||
//Get a list of the alts for each character, then process the ledgers and combine them to send one mail out
|
||||
//in this first part
|
||||
foreach($users as $char) {
|
||||
$altCount = $char->altCount();
|
||||
|
||||
if($altCount > 0) {
|
||||
$alts = $char->getAlts();
|
||||
|
||||
foreach($alts as $alt) {
|
||||
$perms->push([
|
||||
'main_id' => $char->character_id,
|
||||
'alt_id' => $alt->character_id,
|
||||
'count' => $altCount,
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$perms->push([
|
||||
'main_id' => $char->character_id,
|
||||
'alt_id' => null,
|
||||
'count' => 0,
|
||||
]);
|
||||
//Cycle through the array of mains, and remove any characters which are in the User Alt table,
|
||||
//as those characters will be grouped with their correct main later.
|
||||
for($i = 0; $i < sizeof($tempMains); $i++) {
|
||||
if(UserAlt::where(['character_id' => $tempMains[$i]])->count() == 0) {
|
||||
$mains->push($tempMains[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
return view('test.miningtax.invoice')->with('perms', $perms);
|
||||
/**
|
||||
* For each of the users, let's determine if there are any ledgers,
|
||||
* then determine if there are any alts and ledgers associated with the alts.
|
||||
*/
|
||||
foreach($mains as $main) {
|
||||
//Declare some variables for each run through the for loop
|
||||
$ledgers = new Collection;
|
||||
|
||||
//Count the ledgers for the main
|
||||
$mainLedgerCount = Ledger::where([
|
||||
'character_id' => $main,
|
||||
'invoiced' => 'Yes',
|
||||
])->where('last_updated', '>', Carbon::now()->subDays(7))->count();
|
||||
|
||||
//If there are ledgers for the main, then let's grab them
|
||||
if($mainLedgerCount > 0) {
|
||||
$mainLedgers = Ledger::where([
|
||||
'character_id' => $main,
|
||||
'invoiced' => 'Yes',
|
||||
])->where('last_updated', '>', Carbon::now()->subDays(7))->get();
|
||||
|
||||
//Cycle through the entries, and add them to the ledger to send with the invoice
|
||||
foreach($mainLedgers as $row) {
|
||||
$ledgers->push([
|
||||
'character_id' => $row->character_id,
|
||||
'character_name' => $row->character_name,
|
||||
'observer_id' => $row->observer_id,
|
||||
'type_id' => $row->type_id,
|
||||
'ore_name' => $row->ore_name,
|
||||
'quantity' => (int)$row->quantity,
|
||||
'amount' => (float)$row->amount,
|
||||
'last_updated' => $row->last_updated,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
//Get the alt count for the main character
|
||||
$altCount = UserAlt::where(['main_id' => $main])->count();
|
||||
//If more than 0 alts, grab all the alts.
|
||||
if($altCount > 0) {
|
||||
$alts = UserAlt::where([
|
||||
'main_id' => $main,
|
||||
])->get();
|
||||
|
||||
//Cycle through the alts, and get the ledgers, and push onto the stack
|
||||
foreach($alts as $alt) {
|
||||
$altLedgerCount = Ledger::where([
|
||||
'character_id' => $alt->character_id,
|
||||
'invoiced' => 'Yes',
|
||||
])->where('last_updated', '>', Carbon::now()->subDays(7))->count();
|
||||
|
||||
if($altLedgerCount > 0) {
|
||||
$altLedgers = Ledger::where([
|
||||
'character_id' => $alt->character_id,
|
||||
'invoiced' => 'Yes',
|
||||
])->where('last_updated', '>', Carbon::now()->subDays(7))->get();
|
||||
|
||||
foreach($altLedgers as $row) {
|
||||
$ledgers->push([
|
||||
'character_id' => $row->character_id,
|
||||
'character_name' => $row->character_name,
|
||||
'observer_id' => $row->observer_id,
|
||||
'type_id' => $row->type_id,
|
||||
'ore_name' => $row->ore_name,
|
||||
'quantity' => (int)$row->quantity,
|
||||
'amount' => (float)$row->amount,
|
||||
'last_updated' => $row->last_updated,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the collected information over to the function to send the actual mail
|
||||
*/
|
||||
if($ledgers->count() > 0) {
|
||||
$body = $this->CreateInvoice($main, $ledgers, $mailDelay);
|
||||
$bodies->push($body);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return view('test.miningtax.invoice')->with('bodies', $bodies);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the invoice to the mail out
|
||||
*
|
||||
* @var charId
|
||||
* @var ledgers
|
||||
* @var mailDelay
|
||||
*/
|
||||
private function CreateInvoice($charId, Collection $ledgers, int &$mailDelay) {
|
||||
$ores = array();
|
||||
$characters = array();
|
||||
$characterIds = array();
|
||||
$totalPrice = 0.00;
|
||||
$body = null;
|
||||
$lookup = new LookupHelper;
|
||||
$config = config('esi');
|
||||
|
||||
//Create an invoice id
|
||||
$invoiceId = "M" . uniqid();
|
||||
|
||||
//Collect the total price of all of the ledgers
|
||||
$totalPrice = round((float)$ledgers->sum('amount'), 2);
|
||||
|
||||
//Get the sum of all the ledgers
|
||||
$invoiceAmount = round(((float)$ledgers->sum('amount') * (float)$config['mining_tax']), 2);
|
||||
|
||||
//Get the character name from the lookup table
|
||||
$charName = $lookup->CharacterIdToName($charId);
|
||||
|
||||
//Create the date due and the invoice date
|
||||
$dateDue = Carbon::now()->addDays(7);
|
||||
$invoiceDate = Carbon::now();
|
||||
|
||||
//Set the mining tax from the config file
|
||||
$numberMiningTax = number_format(((float)$config['mining_tax'] * (float)100.00), 2, ".", ",");
|
||||
|
||||
//Create the list of ores to put in the mail
|
||||
$temp = $ledgers->toArray();
|
||||
foreach($temp as $t) {
|
||||
//If the key isn't set, set it to the default of 0
|
||||
if(!isset($ores[$t['type_id']])) {
|
||||
$ores[$t['type_id']] = (int)0;
|
||||
}
|
||||
|
||||
//Add the quantity into the ores array
|
||||
$ores[$t['type_id']] += (int)$t['quantity'];
|
||||
|
||||
//Create a list of character names
|
||||
if(!isset($characters[$t['character_name']])) {
|
||||
$characters[$t['character_name']] = $t['character_name'];
|
||||
}
|
||||
|
||||
//Create a list of character ids
|
||||
if(!isset($characterIds[$t['character_id']])) {
|
||||
$characterIds[$t['character_id']] = $t['character_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the mail body to send to the main character
|
||||
*/
|
||||
$body .= "Dear " . $charName . ",<br><br>";
|
||||
$body .= "Mining Taxes are due for the following ores mined from alliance moons: <br>";
|
||||
foreach($ores as $ore => $quantity) {
|
||||
$oreName = $lookup->ItemIdToName($ore);
|
||||
$body .= $oreName . ": " . number_format($quantity, 0, ".", ",") . "<br>";
|
||||
}
|
||||
$body .= "Total Value of Ore Mined: " . number_format($totalPrice, 2, ".", ",") . " ISK.";
|
||||
$body .= "<br><br>";
|
||||
$body .= "Please remit " . number_format($invoiceAmount, 2, ".", ",") . " ISK to Spatial Forces by " . $dateDue . "<br>";
|
||||
$body .= "Set the reason for transfer as " . $invoiceId . "<br>";
|
||||
$body .= "The mining taxes are currently set to " . $numberMiningTax . "%.<br>";
|
||||
$body .= "<br><br>";
|
||||
$body .= "You can also send a contract with the following ores in the contract with the reason set as: " . $invoiceId . "<br>";
|
||||
foreach($ores as $ore => $quantity) {
|
||||
$oreName = $lookup->ItemIdToName($ore);
|
||||
$body .= $oreName . ": " . number_format(round($quantity * $config['mining_tax']), 0, ".", ",") . "<br>";
|
||||
}
|
||||
$body .= "<br>";
|
||||
$body .= "Characters Processed: <br>";
|
||||
foreach($characters as $character) {
|
||||
$body .= $character . "<br>";
|
||||
}
|
||||
$body .= "<br>";
|
||||
$body .= "<br>Sincerely,<br>Warped Intentions Leadership<br>";
|
||||
|
||||
//Check if the mail body is greater than 2000 characters. If greater than 2,000 characters, then
|
||||
if(strlen($body) > 2000) {
|
||||
$body = "Dear " . $charName . "<br><br>";
|
||||
$body .= "Total Value of Ore Mined: " . number_format($totalPrice, 2, ".", ",") . " ISK.";
|
||||
$body .= "<br><br>";
|
||||
$body .= "Please remit " . number_format($invoiceAmount, 2, ".", ",") . " ISK to Spatial Forces by " . $dateDue . "<br>";
|
||||
$body .= "Set the reason for transfer as: " . $invoiceId . "<br>";
|
||||
$body .= "The mining taxes are currently set to " . $numberMiningTax . "%.<br>";
|
||||
$body .= "<br>";
|
||||
$body .= "<br>Sincerely,<br>Warped Intentions Leadership<br>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment the mail delay for the next cycle
|
||||
*/
|
||||
$mailDelay += 20;
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
public function DebugMiningObservers() {
|
||||
|
||||
@@ -6,6 +6,7 @@ use Closure;
|
||||
use DB;
|
||||
|
||||
use App\Models\User\UserPermission;
|
||||
use App\Models\User\UserRole;
|
||||
|
||||
class RequirePermission
|
||||
{
|
||||
@@ -18,9 +19,15 @@ class RequirePermission
|
||||
*/
|
||||
public function handle($request, Closure $next, $permission)
|
||||
{
|
||||
$perms = UserPermission::where(['character_id' => auth()->user()->character_id, 'permission'=> $permission])->get(['permission']);
|
||||
$role = UserRole::where([
|
||||
'character_id' => auth()->user()->character_id,
|
||||
])->get(['role']);
|
||||
|
||||
abort_unless(auth()->check() && isset($perms[0]->permission), 403, "You don't have the correct permission to be in this area.");
|
||||
if($role[0]->role != "Admin") {
|
||||
$perms = UserPermission::where(['character_id' => auth()->user()->character_id, 'permission'=> $permission])->get(['permission']);
|
||||
|
||||
abort_unless(auth()->check() && isset($perms[0]->permission), 403, "You don't have the correct permission to be in this area.");
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,11 @@ class FetchAllianceAssets implements ShouldQueue
|
||||
$totalPages = 1;
|
||||
|
||||
do {
|
||||
if($esiHelper->TokenExpired($token)) {
|
||||
$token = $esiHelper->GetRefreshToken($config['primary']);
|
||||
$esi = $esiHelper->SetupAuthenticationToken($token);
|
||||
}
|
||||
|
||||
//Attempt to get the assets
|
||||
$assets = $esi->page($currentPage)
|
||||
->invoke('get', '/corporations/{corporation_id}/assets/', [
|
||||
@@ -114,43 +119,46 @@ class FetchAllianceAssets implements ShouldQueue
|
||||
(is_string($exception->getEsiResponse()) && (stristr($exception->getEsiResponse(), 'Too many errors') || stristr($exception->getEsiResponse(), 'This software has exceeded the error limit for ESI')))) {
|
||||
|
||||
//We have hit the error rate limiter, wait 120 seconds before releasing the job back into the queue.
|
||||
Log::info('FetchMiningTaxesObservers has hit the error rate limiter. Releasing the job back into the wild in 2 minutes.');
|
||||
Log::info('FetchAllianceAssets has hit the error rate limiter. Releasing the job back into the wild in 2 minutes.');
|
||||
$this->release(120);
|
||||
} else {
|
||||
$errorCode = $exception->getEsiResponse()->getErrorCode();
|
||||
|
||||
switch($errorCode) {
|
||||
case 400: //Bad Request
|
||||
Log::critical("Bad request has occurred in FetchMiningTaxesObservers. Job has been discarded");
|
||||
Log::critical("Bad request has occurred in FetchAllianceAssets. Job has been discarded");
|
||||
break;
|
||||
case 401: //Unauthorized Request
|
||||
Log::critical("Unauthorized request has occurred in FetchMiningTaxesObservers at " . Carbon::now()->toDateTimeString() . ".\r\nCancelling the job.");
|
||||
Log::critical("Unauthorized request has occurred in FetchAllianceAssets at " . Carbon::now()->toDateTimeString() . ".\r\nCancelling the job.");
|
||||
$this->delete();
|
||||
break;
|
||||
case 403: //Forbidden
|
||||
Log::critical("FetchMiningTaxesObservers has incurred a forbidden error. Cancelling the job.");
|
||||
Log::critical("FetchAllianceAssets has incurred a forbidden error. Cancelling the job.");
|
||||
$this->delete();
|
||||
break;
|
||||
case 420: //Error Limited
|
||||
Log::warning("Error rate limit occurred in FetchMiningTaxesObservers. Restarting job in 120 seconds.");
|
||||
Log::warning("Error rate limit occurred in FetchAllianceAssets. Restarting job in 120 seconds.");
|
||||
$this->release(120);
|
||||
break;
|
||||
case 500: //Internal Server Error
|
||||
Log::critical("Internal Server Error for ESI in FetchMiningTaxesObservers. Attempting a restart in 120 seconds.");
|
||||
Log::critical("Internal Server Error for ESI in FetchAllianceAssets. Attempting a restart in 120 seconds.");
|
||||
$this->release(120);
|
||||
break;
|
||||
case 503: //Service Unavailable
|
||||
Log::critical("Service Unavailabe for ESI in FetchMiningTaxesObservers. Releasing the job back to the queue in 30 seconds.");
|
||||
Log::critical("Service Unavailabe for ESI in FetchAllianceAssets. Releasing the job back to the queue in 30 seconds.");
|
||||
$this->release(30);
|
||||
break;
|
||||
case 504: //Gateway Timeout
|
||||
Log::critical("Gateway timeout in FetchMiningTaxesObservers. Releasing the job back to the queue in 30 seconds.");
|
||||
Log::critical("Gateway timeout in FetchAllianceAssets. Releasing the job back to the queue in 30 seconds.");
|
||||
$this->release(30);
|
||||
break;
|
||||
case 201: //Good response code
|
||||
case 201:
|
||||
//Good response code
|
||||
$this->delete();
|
||||
break;
|
||||
//If no code is given, then log and break out of switch.
|
||||
default:
|
||||
Log::warning("No response code received from esi call in FetchMiningTaxesObservers.\r\n");
|
||||
Log::warning("No response code received from esi call in FetchAllianceAssets.\r\n");
|
||||
$this->delete();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,6 @@ class PurgeAllianceAssets implements ShouldQueue
|
||||
{
|
||||
Asset::truncate();
|
||||
|
||||
FetchAllianceAssets::dispatch();
|
||||
FetchAllianceAssets::dispatch()->delay(Carbon::now()->addSeconds(30));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,18 +173,20 @@ class PurgeUsers implements ShouldQueue
|
||||
])->delete();
|
||||
}
|
||||
|
||||
//Delete the user from the user table
|
||||
User::where([
|
||||
'character_id' => $user->character_id,
|
||||
])->delete();
|
||||
|
||||
//Delete the user's esi scopes
|
||||
EsiScope::where([
|
||||
'character_id' => $user->character_id,
|
||||
])->delete();
|
||||
|
||||
//Delete the user's esi token
|
||||
EsiToken::where([
|
||||
'character_id' => $user->character_id,
|
||||
])->delete();
|
||||
|
||||
//Delete the user from the user table
|
||||
User::where([
|
||||
'character_id' => $user->character_id,
|
||||
])->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,12 @@ class UpdateAllianceWalletJournalJob implements ShouldQueue
|
||||
|
||||
$pages = $fHelper->GetAllianceWalletJournalPages(1, $config['primary']);
|
||||
|
||||
//If the number of pages received is zero there is an error in the job.
|
||||
if($pages == 0) {
|
||||
Log::critical('Failed to get the number of pages in the job.');
|
||||
$this->delete();
|
||||
}
|
||||
|
||||
for($i = 1; $i <= $pages; $i++) {
|
||||
UpdateAllianceWalletJournalPage::dispatch(1, $config['primary'], $i)->onQueue('journal');
|
||||
}
|
||||
|
||||
@@ -93,17 +93,11 @@ class UpdateAllianceWalletJournalPage implements ShouldQueue
|
||||
* Attempt to get the data from the esi api. If it fails, we skip the page, and go onto the next page, unless
|
||||
* the failed page is the first page.
|
||||
*/
|
||||
try {
|
||||
$journals = $esi->page($this->page)
|
||||
->invoke('get', '/corporations/{corporation_id}/wallets/{division}/journal/', [
|
||||
'corporation_id' => $corpId,
|
||||
'division' => $this->division,
|
||||
]);
|
||||
} catch(RequestFailedException $e) {
|
||||
Log::warning('Failed to get wallet journal page ' . $currentPage . ' for character id: ' . $charId);
|
||||
Log::warning($e);
|
||||
$this->delete();
|
||||
}
|
||||
$journals = $esi->page($this->page)
|
||||
->invoke('get', '/corporations/{corporation_id}/wallets/{division}/journal/', [
|
||||
'corporation_id' => $corpId,
|
||||
'division' => $this->division,
|
||||
]);
|
||||
|
||||
//Decode the json data, and return it as an array
|
||||
$wallet = json_decode($journals->raw, true);
|
||||
@@ -159,6 +153,68 @@ class UpdateAllianceWalletJournalPage implements ShouldQueue
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* The job failed to process
|
||||
* @param Exception $exception
|
||||
* @return void
|
||||
*/
|
||||
public function failed($exception) {
|
||||
if(!exception instanceof RequestFailedException) {
|
||||
//If not a failure due to ESI, then log it. Otherwise,
|
||||
//deduce why the exception occurred.
|
||||
Log::critical($exception);
|
||||
}
|
||||
|
||||
if ((is_object($exception->getEsiResponse()) && (stristr($exception->getEsiResponse()->error, 'Too many errors') || stristr($exception->getEsiResponse()->error, 'This software has exceeded the error limit for ESI'))) ||
|
||||
(is_string($exception->getEsiResponse()) && (stristr($exception->getEsiResponse(), 'Too many errors') || stristr($exception->getEsiResponse(), 'This software has exceeded the error limit for ESI')))) {
|
||||
|
||||
//We have hit the error rate limiter, wait 120 seconds before releasing the job back into the queue.
|
||||
Log::info('UpdateAllianceWalletJournalPage has hit the error rate limiter. Releasing the job back into the wild in 2 minutes.');
|
||||
$this->release(120);
|
||||
} else {
|
||||
$errorCode = $exception->getEsiResponse()->getErrorCode();
|
||||
|
||||
switch($errorCode) {
|
||||
case 400: //Bad Request
|
||||
Log::critical("Bad request has occurred in UpdateAllianceWalletJournalPage. Job has been discarded");
|
||||
break;
|
||||
case 401: //Unauthorized Request
|
||||
Log::critical("Unauthorized request has occurred in UpdateAllianceWalletJournalPage at " . Carbon::now()->toDateTimeString() . ".\r\nCancelling the job.");
|
||||
$this->delete();
|
||||
break;
|
||||
case 403: //Forbidden
|
||||
Log::critical("UpdateAllianceWalletJournalPage has incurred a forbidden error. Cancelling the job.");
|
||||
$this->delete();
|
||||
break;
|
||||
case 420: //Error Limited
|
||||
Log::warning("Error rate limit occurred in UpdateAllianceWalletJournalPage. Restarting job in 120 seconds.");
|
||||
$this->release(120);
|
||||
break;
|
||||
case 500: //Internal Server Error
|
||||
Log::critical("Internal Server Error for ESI in UpdateAllianceWalletJournalPage. Attempting a restart in 120 seconds.");
|
||||
$this->release(120);
|
||||
break;
|
||||
case 503: //Service Unavailable
|
||||
Log::critical("Service Unavailabe for ESI in UpdateAllianceWalletJournalPage. Releasing the job back to the queue in 30 seconds.");
|
||||
$this->release(30);
|
||||
break;
|
||||
case 504: //Gateway Timeout
|
||||
Log::critical("Gateway timeout in UpdateAllianceWalletJournalPage. Releasing the job back to the queue in 30 seconds.");
|
||||
$this->release(30);
|
||||
break;
|
||||
case 201:
|
||||
//Good response code
|
||||
$this->delete();
|
||||
break;
|
||||
//If no code is given, then log and break out of switch.
|
||||
default:
|
||||
Log::warning("No response code received from esi call in UpdateAllianceWalletJournalPage.\r\n");
|
||||
$this->delete();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tags for Horzion
|
||||
*
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MiningTaxes\Invoices;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Carbon\Carbon;
|
||||
use Log;
|
||||
|
||||
//Models
|
||||
use App\Models\MiningTax\MiningOperation;
|
||||
use App\Models\MiningTax\Ledger;
|
||||
|
||||
class ProcessAllianceMiningOperations implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Timeout in seconds
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $timeout = 3600;
|
||||
|
||||
/**
|
||||
* Number of job retries
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $tries = 3;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//Set job parameters
|
||||
$this->connection = 'redis';
|
||||
$this->onQueue('miningtaxes');
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$count = MiningOperation::where([
|
||||
'processed' => 'No',
|
||||
])->where('operation_date', '<=', Carbon::now())
|
||||
->count();
|
||||
|
||||
if($count > 0) {
|
||||
$operations = MiningOperation::where([
|
||||
'processed' => 'No',
|
||||
])->where('operation_date', '<=', Carbon::now())
|
||||
->get();
|
||||
|
||||
foreach($operations as $operation) {
|
||||
$ledgers = Ledger::where([
|
||||
'observer_id' => $operation->structure_id,
|
||||
'invoiced' => 'No',
|
||||
'last_updated' => $operation->operation_date,
|
||||
])->get();
|
||||
|
||||
foreach($ledgers as $ledger) {
|
||||
Ledger::where([
|
||||
'observer_id' => $operation->structure_id,
|
||||
'invoiced' => 'No',
|
||||
'last_updated' => $operation->operation_date,
|
||||
])->update([
|
||||
'invoiced' => 'Yes',
|
||||
'invoice_id' => 'MiningOp' . $operation->id,
|
||||
]);
|
||||
}
|
||||
|
||||
MiningOperation::where([
|
||||
'id' => $operation->id,
|
||||
])->update([
|
||||
'processed' => 'Yes',
|
||||
'processed_on' => Carbon::now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tags for Horzion
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public function tags() {
|
||||
return ['ProcessAllianceMiningOperations', 'MiningTaxes', 'MiningOperations'];
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MiningTaxes;
|
||||
namespace App\Jobs\Commands\MiningTaxes\Invoices;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@@ -187,6 +187,9 @@ class SendMiningTaxesInvoices implements ShouldQueue
|
||||
//Create an invoice id
|
||||
$invoiceId = "M" . uniqid();
|
||||
|
||||
//Collect the total price of all of the ledgers
|
||||
$totalPrice = round((float)$ledgers->sum('amount'), 2);
|
||||
|
||||
//Get the sum of all the ledgers
|
||||
$invoiceAmount = round(((float)$ledgers->sum('amount') * (float)$config['mining_tax']), 2);
|
||||
|
||||
@@ -233,16 +236,16 @@ class SendMiningTaxesInvoices implements ShouldQueue
|
||||
}
|
||||
$body .= "Total Value of Ore Mined: " . number_format($totalPrice, 2, ".", ",") . " ISK.";
|
||||
$body .= "<br><br>";
|
||||
$body .= "Please remit " . number_format($invoiceAmount, 2, ".", ",") . " ISK to Spatial Forces by " . $dateDue . "<br>";
|
||||
$body .= "Set the reason for transfer as " . $invoiceId . "<br>";
|
||||
$body .= "The mining taxes are currently set to " . $numberMiningTax . "%.<br>";
|
||||
$body .= "<br><br>";
|
||||
$body .= "You can also send a contract with the following ores in the contract with the reason set as: " . $invoiceId . "<br>";
|
||||
$body .= "Please remit " . number_format($invoiceAmount, 2, ".", ",") . " ISK to Spatial Forces or contract Spatial Forces the following ores:<br>";
|
||||
foreach($ores as $ore => $quantity) {
|
||||
$oreName = $lookup->ItemIdToName($ore);
|
||||
$body .= $oreName . ": " . number_format(round($quantity * $config['mining_tax']), 0, ".", ",") . "<br>";
|
||||
}
|
||||
$body .= "<br>";
|
||||
$body .= "The due date is " . $dateDue . "<br>";
|
||||
$body .= "Set the reason for transfer as " . $invoiceId . "<br>";
|
||||
$body .= "The mining taxes are currently set to " . $numberMiningTax . "%.<br>";
|
||||
$body .= "<br>";
|
||||
$body .= "Characters Processed: <br>";
|
||||
foreach($characters as $character) {
|
||||
$body .= $character . "<br>";
|
||||
@@ -255,7 +258,8 @@ class SendMiningTaxesInvoices implements ShouldQueue
|
||||
$body = "Dear " . $charName . "<br><br>";
|
||||
$body .= "Total Value of Ore Mined: " . number_format($totalPrice, 2, ".", ",") . " ISK.";
|
||||
$body .= "<br><br>";
|
||||
$body .= "Please remit " . number_format($invoiceAmount, 2, ".", ",") . " ISK to Spatial Forces by " . $dateDue . "<br>";
|
||||
$body .= "Please remit " . number_format($invoiceAmount, 2, ".", ",") . " ISK to Spatial Forces or contract 15% of the ores mined to Spatial Forces.<br>";
|
||||
$body .= "The due date is " . $dateDue . "<br>";
|
||||
$body .= "Set the reason for transfer as: " . $invoiceId . "<br>";
|
||||
$body .= "The mining taxes are currently set to " . $numberMiningTax . "%.<br>";
|
||||
$body .= "<br>";
|
||||
@@ -294,7 +298,7 @@ class SendMiningTaxesInvoices implements ShouldQueue
|
||||
'character_id' => $char,
|
||||
'invoiced' => 'No',
|
||||
])->update([
|
||||
'invoice' => $invoiceId,
|
||||
'invoice_id' => $invoiceId,
|
||||
'invoiced' => 'Yes',
|
||||
]);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MiningTaxes;
|
||||
namespace App\Jobs\Commands\MiningTaxes\Invoices;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@@ -93,6 +93,8 @@ class UpdateMiningTaxesLateInvoices15th implements ShouldQueue
|
||||
|
||||
//Send a reminder to the user through eve mail about the late invoice
|
||||
SendEveMail::dispatch($body, $recipient, $recipientType, $subject, $sender)->delay(Carbon::now()->addSeconds($mailDelay));
|
||||
|
||||
$mailDelay += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MiningTaxes;
|
||||
namespace App\Jobs\Commands\MiningTaxes\Invoices;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@@ -93,6 +93,8 @@ class UpdateMiningTaxesLateInvoices1st implements ShouldQueue
|
||||
|
||||
//Send a reminder to the user through eve mail about the late invoice
|
||||
SendEveMail::dispatch($body, $recipient, $recipientType, $subject, $sender)->delay(Carbon::now()->addSeconds($mailDelay));
|
||||
|
||||
$mailDelay += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MiningTaxes;
|
||||
namespace App\Jobs\Commands\MiningTaxes\Ledgers;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -17,7 +17,7 @@ use App\Library\Helpers\LookupHelper;
|
||||
use App\Library\Moons\MoonCalc;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\MiningTaxes\ProcessMiningTaxesLedgers;
|
||||
use App\Jobs\Commands\MiningTaxes\Ledgers\ProcessMiningTaxesLedgers;
|
||||
|
||||
//App Models
|
||||
use App\Models\MiningTax\Observer;
|
||||
@@ -143,7 +143,7 @@ class FetchMiningTaxesLedgers implements ShouldQueue
|
||||
|
||||
//Dispatch jobs to process each of the mining ledger entries
|
||||
foreach($ledgers as $ledger) {
|
||||
ProcessMiningTaxesLedgers::dispatch($ledger, $this->observerId)->onQueue('miningtaxes');
|
||||
ProcessMiningTaxesLedgers::dispatch($ledger, $this->observerId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MiningTaxes;
|
||||
namespace App\Jobs\Commands\MiningTaxes\Ledgers;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Carbon\Carbon;
|
||||
use Log;
|
||||
|
||||
//App Library
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
@@ -3,22 +3,17 @@
|
||||
namespace App\Jobs\Commands\MiningTaxes;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
|
||||
//Application Library
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
use App\Jobs\Commands\MiningTaxes\Invoices\SendMiningTaxesInvoices;
|
||||
use App\Jobs\Commands\MiningTaxes\Invoices\ProcessAllianceMiningOperations;
|
||||
|
||||
//Models
|
||||
use App\Models\MiningTax\Invoice;
|
||||
|
||||
class CreateMiningTaxesInvoice implements ShouldQueue
|
||||
class MiningTaxesWeeklyInvoicing implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
@@ -34,7 +29,7 @@ class CreateMiningTaxesInvoice implements ShouldQueue
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $tries = 3;
|
||||
public $tries = 1;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
@@ -43,6 +38,7 @@ class CreateMiningTaxesInvoice implements ShouldQueue
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//Set job parameters
|
||||
$this->connection = 'redis';
|
||||
$this->onQueue('miningtaxes');
|
||||
}
|
||||
@@ -54,12 +50,9 @@ class CreateMiningTaxesInvoice implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//Declare variables
|
||||
$lookup = new LookupHelper;
|
||||
$mainAlts = array();
|
||||
$mainIds = new Collection;
|
||||
|
||||
//Get all of the users in the database
|
||||
$characters = User::all();
|
||||
Bus::chain([
|
||||
new ProcessAllianceMiningOperations,
|
||||
new SendMiningTaxesInvoices,
|
||||
])->dispatch();
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ use Carbon\Carbon;
|
||||
use App\Models\MiningTax\Observer;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\MiningTaxes\FetchMiningTaxesLedgers;
|
||||
use App\Jobs\Commands\MiningTaxes\Ledgers\FetchMiningTaxesLedgers;
|
||||
|
||||
class PreFetchMiningTaxesLedgers implements ShouldQueue
|
||||
{
|
||||
@@ -60,7 +60,7 @@ class PreFetchMiningTaxesLedgers implements ShouldQueue
|
||||
//For each of the observers, send a job to fetch the mining ledger
|
||||
foreach($observers as $obs) {
|
||||
//Dispatch the mining taxes ledger jobs
|
||||
FetchMiningTaxesLedgers::dispatch($config['primary'], $config['corporation'], $obs->observer_id)->onQueue('miningtaxes');
|
||||
FetchMiningTaxesLedgers::dispatch($config['primary'], $config['corporation'], $obs->observer_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MoonRental\Invoices;
|
||||
|
||||
//Application Library
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Internal Library
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\MoonRental\AllianceMoon;
|
||||
use App\Models\MoonRental\AllianceMoonOre;
|
||||
use App\Models\MoonRental\AllianceMoonRental;
|
||||
|
||||
class SendMoonRentalInvoices implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->connection = 'redis';
|
||||
$this->onQueue('miningtaxes');
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//Declare variables
|
||||
$lookup = new LookupHelper;
|
||||
$months = 3;
|
||||
$today = Carbon::now();
|
||||
$future = Carbon::now()->addMonths(3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\MoonRental;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Internal Library
|
||||
use App\Library\Moons\MoonCalc;
|
||||
use App\Library\Helpers\LookupHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\MoonRental\AllianceMoon;
|
||||
use App\Models\MoonRental\AllianceMoonOre;
|
||||
|
||||
class UpdateAllianceMoonRentalWorth implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->connection = 'redis';
|
||||
$this->onQueue('default');
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//Declare variables
|
||||
$lookup = new LookupHelper;
|
||||
$mHelper = new MoonCalc;
|
||||
$months = 3;
|
||||
$rentalTax = 0.25;
|
||||
|
||||
$moons = AllianceMoon::all();
|
||||
|
||||
foreach($moons as $moon) {
|
||||
//Declare the arrays needed
|
||||
$ores = array();
|
||||
$worth = 0.00;
|
||||
|
||||
$ores = AllianceMoonOre::where([
|
||||
'moon_id' => $moon->moon_id,
|
||||
])->get(['ore_name', 'quantity'])->toArray();
|
||||
|
||||
if(sizeof($ores) == 1) {
|
||||
$ores[1]["ore_name"] = null;
|
||||
$ores[1]["quantity"] = 0.00;
|
||||
$ores[2]["ore_name"] = null;
|
||||
$ores[2]["quantity"] = 0.00;
|
||||
$ores[3]["ore_name"] = null;
|
||||
$ores[3]["quantity"] = 0.00;
|
||||
} else if(sizeof($ores) == 2) {
|
||||
$ores[2]["ore_name"] = null;
|
||||
$ores[2]["quantity"] = 0.00;
|
||||
$ores[3]["ore_name"] = null;
|
||||
$ores[3]["quantity"] = 0.00;
|
||||
} else if(sizeof($ores) == 3) {
|
||||
$ores[3]["ore_name"] = null;
|
||||
$ores[3]["quantity"] = 0.00;
|
||||
}
|
||||
|
||||
//one of these two ways will work
|
||||
$worth = $mHelper->MoonTotalWorth($ores[0]["ore_name"], $ores[0]["quantity"],
|
||||
$ores[1]["ore_name"], $ores[1]["quantity"],
|
||||
$ores[2]["ore_name"], $ores[2]["quantity"],
|
||||
$ores[3]["ore_name"], $ores[3]["quantity"]);
|
||||
|
||||
$rentalAmount = $worth * $rentalTax * $months;
|
||||
|
||||
AllianceMoon::where([
|
||||
'moon_id' => $moon->moon_id,
|
||||
])->update([
|
||||
'worth_amount' => $worth,
|
||||
'rental_amount' => $rentalAmount,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,35 +125,35 @@ class FetchAllianceStructures implements ShouldQueue
|
||||
(is_string($exception->getEsiResponse()) && (stristr($exception->getEsiResponse(), 'Too many errors') || stristr($exception->getEsiResponse(), 'This software has exceeded the error limit for ESI')))) {
|
||||
|
||||
//We have hit the error rate limiter, wait 120 seconds before releasing the job back into the queue.
|
||||
Log::info('FetchMiningTaxesObservers has hit the error rate limiter. Releasing the job back into the wild in 2 minutes.');
|
||||
Log::info('FetchAllianceStructures has hit the error rate limiter. Releasing the job back into the wild in 2 minutes.');
|
||||
$this->release(120);
|
||||
} else {
|
||||
$errorCode = $exception->getEsiResponse()->getErrorCode();
|
||||
|
||||
switch($errorCode) {
|
||||
case 400: //Bad Request
|
||||
Log::critical("Bad request has occurred in FetchMiningTaxesObservers. Job has been discarded");
|
||||
Log::critical("Bad request has occurred in FetchAllianceStructures. Job has been discarded");
|
||||
break;
|
||||
case 401: //Unauthorized Request
|
||||
Log::critical("Unauthorized request has occurred in FetchMiningTaxesObservers at " . Carbon::now()->toDateTimeString() . ".\r\nCancelling the job.");
|
||||
Log::critical("Unauthorized request has occurred in FetchAllianceStructures at " . Carbon::now()->toDateTimeString() . ".\r\nCancelling the job.");
|
||||
break;
|
||||
case 403: //Forbidden
|
||||
Log::critical("FetchMiningTaxesObservers has incurred a forbidden error. Cancelling the job.");
|
||||
Log::critical("FetchAllianceStructures has incurred a forbidden error. Cancelling the job.");
|
||||
break;
|
||||
case 420: //Error Limited
|
||||
Log::warning("Error rate limit occurred in FetchMiningTaxesObservers. Restarting job in 120 seconds.");
|
||||
Log::warning("Error rate limit occurred in FetchAllianceStructures. Restarting job in 120 seconds.");
|
||||
$this->release(120);
|
||||
break;
|
||||
case 500: //Internal Server Error
|
||||
Log::critical("Internal Server Error for ESI in FetchMiningTaxesObservers. Attempting a restart in 120 seconds.");
|
||||
Log::critical("Internal Server Error for ESI in FetchAllianceStructures. Attempting a restart in 120 seconds.");
|
||||
$this->release(120);
|
||||
break;
|
||||
case 503: //Service Unavailable
|
||||
Log::critical("Service Unavailabe for ESI in FetchMiningTaxesObservers. Releasing the job back to the queue in 30 seconds.");
|
||||
Log::critical("Service Unavailabe for ESI in FetchAllianceStructures. Releasing the job back to the queue in 30 seconds.");
|
||||
$this->release(30);
|
||||
break;
|
||||
case 504: //Gateway Timeout
|
||||
Log::critical("Gateway timeout in FetchMiningTaxesObservers. Releasing the job back to the queue in 30 seconds.");
|
||||
Log::critical("Gateway timeout in FetchAllianceStructures. Releasing the job back to the queue in 30 seconds.");
|
||||
$this->release(30);
|
||||
break;
|
||||
case 201: //Good response code
|
||||
@@ -161,7 +161,7 @@ class FetchAllianceStructures implements ShouldQueue
|
||||
break;
|
||||
//If no code is given, then log and break out of switch.
|
||||
default:
|
||||
Log::warning("No response code received from esi call in FetchMiningTaxesObservers.\r\n");
|
||||
Log::warning("No response code received from esi call in FetchAllianceStructures.\r\n");
|
||||
$this->delete();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\FetchAllianceStructures;
|
||||
use App\Jobs\Commands\Structures\FetchAllianceStructures;
|
||||
|
||||
//Models
|
||||
use App\Models\Structure\Structure;
|
||||
@@ -56,7 +56,7 @@ class PurgeAllianceStructures implements ShouldQueue
|
||||
Structure::truncate();
|
||||
Service::truncate();
|
||||
|
||||
FetchAllianceStructures::dispatch();
|
||||
FetchAllianceStructures::dispatch()->delay(Carbon::now()->addSeconds(30));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
169
app/Jobs/Middleware/EveMailLimiter.php
Normal file
169
app/Jobs/Middleware/EveMailLimiter.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
|
||||
class EveMailLimiter {
|
||||
/** @var bool|\Closure */
|
||||
protected $enabled = true;
|
||||
|
||||
/** @var string */
|
||||
protected $connectionName = 'redis';
|
||||
|
||||
/** @var string */
|
||||
protected $key;
|
||||
|
||||
/** @var int */
|
||||
protected $timeSpanInSeconds = 1;
|
||||
|
||||
/** @var int */
|
||||
protected $allowedNumberOfJobsInTimeSpan = 4;
|
||||
|
||||
/** @var int */
|
||||
protected $releaseInSeconds = 60;
|
||||
|
||||
/** @var array */
|
||||
protected $releaseRandomSeconds = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$calledByClass = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['class'];
|
||||
|
||||
$this->key($calledByClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool|\Closure $enabled
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function enabled($enabled = true)
|
||||
{
|
||||
$this->enabled = $enabled;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function connectionName(string $connectionName = 'redis')
|
||||
{
|
||||
$this->connectionName = $connectionName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function key(string $key)
|
||||
{
|
||||
$this->key = $key;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function timespanInSeconds(int $timespanInSeconds)
|
||||
{
|
||||
$this->timeSpanInSeconds = $timespanInSeconds;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function allow(int $allowedNumberOfJobsInTimeSpan = 4)
|
||||
{
|
||||
$this->allowedNumberOfJobsInTimeSpan = $allowedNumberOfJobsInTimeSpan;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function everySecond(int $timespanInSeconds = 1)
|
||||
{
|
||||
$this->timeSpanInSeconds = $timespanInSeconds;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function everySeconds(int $timespanInSeconds = 60)
|
||||
{
|
||||
return $this->everySecond($timespanInSeconds);
|
||||
}
|
||||
|
||||
public function everyMinute(int $timespanInMinutes = 1)
|
||||
{
|
||||
return $this->everySecond($timespanInMinutes * 60);
|
||||
}
|
||||
|
||||
public function everyMinutes(int $timespanInMinutes)
|
||||
{
|
||||
return $this->everySecond($timespanInMinutes * 60);
|
||||
}
|
||||
|
||||
public function releaseAfterOneSecond()
|
||||
{
|
||||
return $this->releaseAfterSeconds(1);
|
||||
}
|
||||
|
||||
public function releaseAfterSeconds(int $releaseInSeconds)
|
||||
{
|
||||
$this->releaseInSeconds = $releaseInSeconds;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function releaseAfterOneMinute()
|
||||
{
|
||||
return $this->releaseAfterMinutes(1);
|
||||
}
|
||||
|
||||
public function releaseAfterMinutes(int $releaseInMinutes)
|
||||
{
|
||||
return $this->releaseAfterSeconds($releaseInMinutes * 60);
|
||||
}
|
||||
|
||||
public function releaseAfterRandomSeconds(int $min = 1, int $max = 10)
|
||||
{
|
||||
$this->releaseRandomSeconds = [$min, $max];
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function releaseAfterBackoff(int $attemptedCount, int $backoffRate = 2)
|
||||
{
|
||||
$releaseAfterSeconds = 0;
|
||||
$interval = $this->releaseInSeconds;
|
||||
for ($attempt = 0; $attempt <= $attemptedCount; $attempt++) {
|
||||
$releaseAfterSeconds += $interval * pow($backoffRate, $attempt);
|
||||
}
|
||||
|
||||
return $this->releaseAfterSeconds($releaseAfterSeconds);
|
||||
}
|
||||
|
||||
protected function releaseDuration(): int
|
||||
{
|
||||
if (! is_null($this->releaseRandomSeconds)) {
|
||||
return random_int(...$this->releaseRandomSeconds);
|
||||
}
|
||||
|
||||
return $this->releaseInSeconds;
|
||||
}
|
||||
|
||||
public function handle($job, $next)
|
||||
{
|
||||
if ($this->enabled instanceof Closure) {
|
||||
$this->enabled = (bool) $this->enabled();
|
||||
}
|
||||
|
||||
if (! $this->enabled) {
|
||||
return $next($job);
|
||||
}
|
||||
|
||||
Redis::connection($this->connectionName)
|
||||
->throttle($this->key)
|
||||
->block(0)
|
||||
->allow($this->allowedNumberOfJobsInTimeSpan)
|
||||
->every($this->timeSpanInSeconds)
|
||||
->then(function () use ($job, $next) {
|
||||
$next($job);
|
||||
}, function () use ($job) {
|
||||
$job->release($this->releaseDuration());
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ class LookupHelper {
|
||||
*/
|
||||
private function SaveMoonInfo($moon) {
|
||||
$newMoon = new MoonLookup;
|
||||
$newMoon->moon_id = $moon->id;
|
||||
$newMoon->moon_id = $moon->moon_id;
|
||||
$newMoon->name = $moon->name;
|
||||
$newMoon->position_x = $moon->position->x;
|
||||
$newMoon->position_y = $moon->position->y;
|
||||
|
||||
@@ -95,20 +95,31 @@ class StructureHelper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a structure in our own database, otherwise pull it from esi.
|
||||
*/
|
||||
public function GetStructureInfo($structureId) {
|
||||
try {
|
||||
$info = $this->esi->invoke('get', '/universe/structures/{structure_id}/', [
|
||||
'structure_id' => $structureId,
|
||||
]);
|
||||
} catch(RequestFailedException $e) {
|
||||
Log::warning("Failed to get structure information for structure with id " . $structureId);
|
||||
Log::warning($e->getCode());
|
||||
Log::warning($e->getMessage());
|
||||
Log::warning($e->getEsiResponse());
|
||||
$info = null;
|
||||
}
|
||||
$info = Structure::where([
|
||||
'structure_id' => $structureId,
|
||||
])->first();
|
||||
|
||||
return $info;
|
||||
if($info != null) {
|
||||
return $info;
|
||||
} else {
|
||||
try {
|
||||
$info = $this->esi->invoke('get', '/universe/structures/{structure_id}/', [
|
||||
'structure_id' => $structureId,
|
||||
]);
|
||||
} catch(RequestFailedException $e) {
|
||||
Log::warning("Failed to get structure information for structure with id " . $structureId);
|
||||
Log::warning($e->getCode());
|
||||
Log::warning($e->getMessage());
|
||||
Log::warning($e->getEsiResponse());
|
||||
return null;
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
|
||||
private function UpdateExistingStructure($structure, $info) {
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Models\User\UserRole;
|
||||
use App\Models\User\UserPermission;
|
||||
use App\Models\Finances\AllianceWalletJournal;
|
||||
use App\Models\MiningTax\Invoice;
|
||||
use App\Models\MoonRental\AllianceMoonRental;
|
||||
|
||||
class TaxesHelper {
|
||||
|
||||
@@ -26,6 +27,15 @@ class TaxesHelper {
|
||||
$this->end = $en;
|
||||
}
|
||||
|
||||
public function GetMoonRentalTaxesGross($start, $end) {
|
||||
$revenue = 0.00;
|
||||
|
||||
$revenue = AllianceMoonRental::whereBetween('rental_start', [$start, $end])
|
||||
->sum('rental_amount');
|
||||
|
||||
return $revenue;
|
||||
}
|
||||
|
||||
public function GetMoonMiningTaxesGross($start, $end) {
|
||||
$revenue = 0.00;
|
||||
|
||||
|
||||
@@ -43,67 +43,29 @@ class MoonCalc {
|
||||
/**
|
||||
* Calculate the total worth of a moon
|
||||
*/
|
||||
public function SpatialMoonsTotalWorth($firstOre, $firstQuan, $secondOre, $secondQuan, $thirdOre, $thirdQuan, $fourthOre, $fourthQuan) {
|
||||
public function MoonTotalWorth($firstOre = null, $firstQuan = 0.00, $secondOre = null, $secondQuan = 0.00, $thirdOre = null, $thirdQuan = 0.00, $fourthOre = null, $fourthQuan = 0.00) {
|
||||
//Declare variables
|
||||
$totalPriceMined = 0.00;
|
||||
|
||||
//Get the configuration for pricing calculations
|
||||
$config = DB::table('Config')->get();
|
||||
$total = 0.00;
|
||||
|
||||
//Convert the quantities into numbers we want to utilize
|
||||
$this->ConvertPercentages($firstPerc, $firstQuan, $secondPerc, $secondQuan, $thirdPerc, $thirdQuan, $fourthPerc, $fourthQuan);
|
||||
$this->ConvertPercentages($firstQuan, $secondQuan, $thirdQuan, $fourthQuan);
|
||||
|
||||
//Calculate the prices from the ores
|
||||
if($firstOre != 'None') {
|
||||
$totalPriceMined += $this->CalcMoonPrice($firstOre, $firstPerc);
|
||||
if($firstOre != null) {
|
||||
$total += $this->CalcMoonPrice($firstOre, $firstQuan);
|
||||
}
|
||||
if($secondOre != 'None') {
|
||||
$totalPriceMined += $this->CalcMoonPrice($secondOre, $secondPerc);
|
||||
if($secondOre != null) {
|
||||
$total += $this->CalcMoonPrice($secondOre, $secondQuan);
|
||||
}
|
||||
if($thirdOre != 'None') {
|
||||
$totalPriceMined += $this->CalcMoonPrice($thirdOre, $thirdPerc);
|
||||
if($thirdOre != null) {
|
||||
$total += $this->CalcMoonPrice($thirdOre, $thirdQuan);
|
||||
}
|
||||
if($fourthOre != 'None') {
|
||||
$totalPriceMined += $this->CalcMoonPrice($fourthOre, $fourthPerc);
|
||||
if($fourthOre != null) {
|
||||
$total += $this->CalcMoonPrice($fourthOre, $fourthQuan);
|
||||
}
|
||||
|
||||
//Return the rental price to the caller
|
||||
return $totalPriceMined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the rental price
|
||||
*/
|
||||
public function SpatialMoons($firstOre, $firstQuan, $secondOre, $secondQuan, $thirdOre, $thirdQuan, $fourthOre, $fourthQuan) {
|
||||
//Declare variables
|
||||
$totalPrice = 0.00;
|
||||
|
||||
//Get the configuration for pricing calculations
|
||||
$config = DB::table('Config')->get();
|
||||
|
||||
//Convert the quantities into numbers we want to utilize
|
||||
$this->ConvertPercentages($firstPerc, $firstQuan, $secondPerc, $secondQuan, $thirdPerc, $thirdQuan, $fourthPerc, $fourthQuan);
|
||||
|
||||
//Calculate the prices from the ores
|
||||
if($firstOre != 'None') {
|
||||
$totalPrice += $this->CalcRentalPrice($firstOre, $firstPerc);
|
||||
}
|
||||
if($secondOre != 'None') {
|
||||
$totalPrice += $this->CalcRentalPrice($secondOre, $secondPerc);
|
||||
}
|
||||
if($thirdOre != 'None') {
|
||||
$totalPrice += $this->CalcRentalPrice($thirdOre, $thirdPerc);
|
||||
}
|
||||
if($fourthOre != 'None') {
|
||||
$totalPrice += $this->CalcRentalPrice($fourthOre, $fourthPerc);
|
||||
}
|
||||
|
||||
//Calculate the rental price. Refined rate is already included in the price from rental composition
|
||||
$rentalPrice['alliance'] = $totalPrice * ($config[0]->RentalTax / 100.00);
|
||||
$rentalPrice['outofalliance'] = $totalPrice * ($config[0]->AllyRentalTax / 100.00);
|
||||
|
||||
//Return the rental price to the caller
|
||||
return $rentalPrice;
|
||||
return $total;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,7 +442,7 @@ class MoonCalc {
|
||||
/**
|
||||
* Calculate the moon's total price
|
||||
*/
|
||||
private function CalcMoonPrice($ore, $percentage) {
|
||||
public function CalcMoonPrice($ore, $percentage) {
|
||||
//Specify the total pull amount
|
||||
$totalPull = $this->CalculateTotalMoonPull();
|
||||
|
||||
@@ -537,12 +499,12 @@ class MoonCalc {
|
||||
/**
|
||||
* Return the type of ore a particular moon ore is.
|
||||
*/
|
||||
private function IsRMoonGoo($ore) {
|
||||
public function IsRMoonGoo($ore) {
|
||||
$ores = [
|
||||
'Zeolites' => 'Gas',
|
||||
'Sylvite' => 'Gas',
|
||||
'Bitumens' => 'Gas',
|
||||
'Coesite' => 'Gas',
|
||||
'Zeolites' => 'R4',
|
||||
'Sylvite' => 'R4',
|
||||
'Bitumens' => 'R4',
|
||||
'Coesite' => 'R4',
|
||||
'Cobaltite' => 'R8',
|
||||
'Euxenite' => 'R8',
|
||||
'Titanite' => 'R8',
|
||||
@@ -575,12 +537,12 @@ class MoonCalc {
|
||||
* Return true if a moon ore is a moon ore, and false
|
||||
* if the ore is not a moon ore.
|
||||
*/
|
||||
private function IsRMoonOre($ore) {
|
||||
public function IsRMoonOre($ore) {
|
||||
$ores = [
|
||||
'Zeolites' => 'Gas',
|
||||
'Sylvite' => 'Gas',
|
||||
'Bitumens' => 'Gas',
|
||||
'Coesite' => 'Gas',
|
||||
'Zeolites' => 'R4',
|
||||
'Sylvite' => 'R4',
|
||||
'Bitumens' => 'R4',
|
||||
'Coesite' => 'R4',
|
||||
'Cobaltite' => 'R8',
|
||||
'Euxenite' => 'R8',
|
||||
'Titanite' => 'R8',
|
||||
@@ -612,35 +574,25 @@ class MoonCalc {
|
||||
/**
|
||||
* Convert percentages from quantities into a normalized percentage
|
||||
*/
|
||||
private function ConvertPercentages(&$firstPerc, $firstQuan, &$secondPerc, $secondQuan, &$thirdPerc, $thirdQuan, &$fourthPerc, $fourthQuan) {
|
||||
//Set the base percentages for the if statements
|
||||
$firstPerc = 0.00;
|
||||
$secondPerc = 0.00;
|
||||
$thirdPerc = 0.00;
|
||||
$fourthPerc = 0.00;
|
||||
|
||||
public function ConvertPercentages(&$firstPerc, &$secondPerc, &$thirdPerc, &$fourthPerc) {
|
||||
//Convert the quantities into numbers we want to utilize
|
||||
if($firstQuan >= 1.00) {
|
||||
$firstPerc = $this->ConvertToPercentage($firstQuan);
|
||||
} else {
|
||||
$firstPerc = $firstQuan;
|
||||
if($firstPerc >= 1.00) {
|
||||
$firstPerc = $this->ConvertToPercentage($firstPerc);
|
||||
}
|
||||
if($secondQuan >= 1.00) {
|
||||
$secondPerc = $this->ConvertToPercentage($secondQuan);
|
||||
} else {
|
||||
$secondPerc = $secondQuan;
|
||||
|
||||
if($secondPerc >= 1.00) {
|
||||
$secondPerc = $this->ConvertToPercentage($secondPerc);
|
||||
}
|
||||
if($thirdQuan >= 1.00) {
|
||||
$thirdPerc = $this->ConvertToPercentage($thirdQuan);
|
||||
} else {
|
||||
$thirdPerc = $thirdQuan;
|
||||
|
||||
if($thirdPerc >= 1.00) {
|
||||
$thirdPerc = $this->ConvertToPercentage($thirdPerc);
|
||||
}
|
||||
if($fourthQuan >= 1.00) {
|
||||
$fourthPerc = $this->ConvertToPercentage($fourthQuan);
|
||||
} else {
|
||||
$fourthPerc = $fourthQuan;
|
||||
|
||||
if($fourthPerc >= 1.00) {
|
||||
$fourthPerc = $this->ConvertToPercentage($fourthPerc);
|
||||
}
|
||||
|
||||
|
||||
//Add up all the percentages
|
||||
$totalPerc = $firstPerc + $secondPerc + $thirdPerc + $fourthPerc;
|
||||
|
||||
|
||||
34
app/Models/MiningTax/MiningOperation.php
Normal file
34
app/Models/MiningTax/MiningOperation.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\MiningTax;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MiningOperation extends Model
|
||||
{
|
||||
//Table Name
|
||||
protected $table = 'alliance_mining_tax_operations';
|
||||
|
||||
//Primary Key
|
||||
public $primaryKey = 'id';
|
||||
|
||||
//Timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
/**
|
||||
* The array of variables which are mass assignable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'structure_id',
|
||||
'structure_name',
|
||||
'authorized_by_id',
|
||||
'authorized_by_name',
|
||||
'operation_date',
|
||||
'operation_name',
|
||||
'processed',
|
||||
'processed_on',
|
||||
];
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RentalInvoice extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RentalLedger extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RentalPayment extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RentalStructure extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -29,8 +29,9 @@ class AllianceMoon extends Model
|
||||
protected $fillable = [
|
||||
'moon_id',
|
||||
'name',
|
||||
'system_id'
|
||||
'system_id',
|
||||
'system_name',
|
||||
'moon_type',
|
||||
'worth_amount',
|
||||
'rented',
|
||||
'rental_amount',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
namespace App\Models\MoonRental;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -28,8 +28,11 @@ class AllianceMoonOre extends Model
|
||||
*/
|
||||
protected $fillable = [
|
||||
'moon_id',
|
||||
'name',
|
||||
'moon_name',
|
||||
'ore_type_id',
|
||||
'ore_name',
|
||||
'quantity',
|
||||
'solar_system_id',
|
||||
'planet_id',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -15,6 +16,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
Paginator::useBootstrap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,21 +5,21 @@
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"php": "^7.4.0",
|
||||
"ext-redis": "^5.3",
|
||||
"eveseat/eseye": "^2.3",
|
||||
"fideloper/proxy": "^4.0",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"khill/lavacharts": "^3.1.14",
|
||||
"laravel/framework": "^7.0",
|
||||
"laravel/framework": "^8.0",
|
||||
"laravel/helpers": "^1.4",
|
||||
"laravel/horizon": "^4.0",
|
||||
"laravel/horizon": "^5.0",
|
||||
"laravel/socialite": "^5.1",
|
||||
"laravel/ui": "^2.0",
|
||||
"laravel/ui": "^3.0",
|
||||
"laravelcollective/html": "^6.0",
|
||||
"socialiteproviders/manager": "^4.0",
|
||||
"spatie/laravel-rate-limited-job-middleware": "^1.5",
|
||||
"spatie/laravel-schedule-monitor": "2.0.1",
|
||||
"spatie/laravel-schedule-monitor": "2.3.0",
|
||||
"twbs/bootstrap": "^4.5",
|
||||
"web-token/jwt-easy": "^2.2",
|
||||
"web-token/jwt-signature-algorithm-ecdsa": "^2.2",
|
||||
@@ -31,8 +31,8 @@
|
||||
"filp/whoops": "^2.0",
|
||||
"fzaninotto/faker": "^1.4",
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"nunomaduro/collision": "^4.1"
|
||||
"phpunit/phpunit": "^9.0",
|
||||
"nunomaduro/collision": "^5.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
||||
1679
composer.lock
generated
1679
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@
|
||||
'primary' => env('ESI_PRIMARY_CHAR', 93738489),
|
||||
'alliance' => env('ESI_ALLIANCE', 99004116),
|
||||
'corporation' => env('ESI_CORPORATION', 98287666),
|
||||
'public_mining_tax' => env('PUBLIC_MINING_TAX', 0.15),
|
||||
'mining_tax' => env('MINING_TAX', 0.15),
|
||||
'refine_rate' => env('REFINE_RATE', 0.7948248),
|
||||
];
|
||||
|
||||
@@ -17,7 +17,7 @@ class CreateUsersTable extends Migration
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('character_id')->unsigned()->unique();
|
||||
$table->unsignedBigInteger('character_id')->unique();
|
||||
$table->string('avatar');
|
||||
$table->string('access_token')->nullable();
|
||||
$table->string('refresh_token')->nullable();
|
||||
@@ -37,8 +37,8 @@ class CreateUsersTable extends Migration
|
||||
Schema::create('user_alts', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('main_id')->unsigned();
|
||||
$table->integer('character_id')->unsigned()->unique();
|
||||
$table->unsignedBigInteger('main_id');
|
||||
$table->unsignedBigInteger('character_id')->unique();
|
||||
$table->string('avatar');
|
||||
$table->string('access_token')->nullable();
|
||||
$table->string('refresh_token')->nullable();
|
||||
@@ -47,23 +47,32 @@ class CreateUsersTable extends Migration
|
||||
$table->string('owner_hash');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('main_id', 'fk_users_alts_main_id')
|
||||
->references('character_id')
|
||||
->on('users')
|
||||
->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('user_roles')) {
|
||||
Schema::create('user_roles', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('character_id')->unsigned();
|
||||
$table->foreign('character_id')->references('character_id')->on('users');
|
||||
$table->unsignedBigInteger('character_id');
|
||||
$table->string('role')->default('None');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('character_id', 'fk_user_roles_character_id')
|
||||
->references('character_id')
|
||||
->on('users')
|
||||
->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('EsiTokens')) {
|
||||
Schema::create('EsiTokens', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('character_id')->unique();
|
||||
$table->unsignedBigInteger('character_id')->unique();
|
||||
$table->string('access_token');
|
||||
$table->string('refresh_token');
|
||||
$table->integer('expires_in');
|
||||
@@ -74,20 +83,29 @@ class CreateUsersTable extends Migration
|
||||
if(!Schema::hasTable('EsiScopes')) {
|
||||
Schema::create('EsiScopes', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('character_id');
|
||||
$table->foreign('character_id')->references('character_id')->on('EsiTokens');
|
||||
$table->unsignedBigInteger('character_id');
|
||||
$table->string('scope');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('character_id', 'fk_esi_scopes_character_id')
|
||||
->references('character_id')
|
||||
->on('EsiTokens')
|
||||
->cascadeOnDelete();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('user_permissions')) {
|
||||
Schema::create('user_permissions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('character_id')->unsigned();
|
||||
$table->foreign('character_id')->references('character_id')->on('users');
|
||||
$table->unsignedBigInteger('character_id');
|
||||
$table->string('permission');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('character_id', 'fk_user_permissions_character_id')
|
||||
->references('character_id')
|
||||
->on('users')
|
||||
->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateMoonsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('Moons')) {
|
||||
Schema::create('Moons', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('Region');
|
||||
$table->string('System');
|
||||
$table->string('Planet');
|
||||
$table->string('Moon');
|
||||
$table->unsignedBigInteger('StructureId')->nullable();
|
||||
$table->string('StructureName')->default('No Name');
|
||||
$table->string('FirstOre')->default('None');
|
||||
$table->integer('FirstQuantity')->default('0');
|
||||
$table->string('SecondOre')->default('None');
|
||||
$table->integer('SecondQuantity')->default('0');
|
||||
$table->string('ThirdOre')->default('None');
|
||||
$table->integer('ThirdQuantity')->default('0');
|
||||
$table->string('FourthOre')->default('None');
|
||||
$table->integer('FourthQuantity')->default('0');
|
||||
$table->string('RentalCorp')->default('Not Rented');
|
||||
$table->integer('RentalEnd')->default('0');
|
||||
$table->string('Paid')->default('No');
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('moon_rents')) {
|
||||
Schema::create('moon_rents', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('System');
|
||||
$table->string('Planet');
|
||||
$table->string('Moon');
|
||||
$table->unsignedBigInteger('StructureId')->nullable();
|
||||
$table->string('RentalCorp');
|
||||
$table->dateTime('RentalEnd');
|
||||
$table->string('Contact');
|
||||
$table->string('Price');
|
||||
$table->string('Type');
|
||||
$table->string('Paid');
|
||||
$table->string('Paid_Until')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('Moons');
|
||||
Schema::dropIfExists('moon_rents');
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateStructures extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('Structures')) {
|
||||
Schema::create('Structures', function(Blueprint $table) {
|
||||
$table->integer('corporation_id');
|
||||
$table->dateTime('fuel_expires');
|
||||
$table->dateTime('next_reinforce_apply');
|
||||
$table->integer('next_reinforce_hour');
|
||||
$table->integer('next_reinforce_weekday');
|
||||
$table->integer('profile_id');
|
||||
$table->integer('reinforce_hour');
|
||||
$table->integer('reinforce_weekday');
|
||||
$table->dateTime('services');
|
||||
$table->string('state');
|
||||
$table->date('state_timer_end');
|
||||
$table->date('state_timer_start');
|
||||
$table->integer('structure_id')->unique();
|
||||
$table->integer('system_id');
|
||||
$table->integer('type_id');
|
||||
$table->dateTime('unanchors_at');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('CorpStructures')) {
|
||||
Schema::create('CorpStructures', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('character_id');
|
||||
$table->integer('corporation_id');
|
||||
$table->string('corporation_name');
|
||||
$table->string('region');
|
||||
$table->string('system');
|
||||
$table->string('structure_name');
|
||||
$table->decimal('tax', 10, 2);
|
||||
$table->string('structure_type');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('corp_tax_ratios')) {
|
||||
Schema::create('corp_tax_ratios', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('corporation_id');
|
||||
$table->string('corporation_name');
|
||||
$table->string('structure_type');
|
||||
$table->string('ratio');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('alliance_flex_structures')) {
|
||||
Schema::create('alliance_flex_structures', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('requestor_id');
|
||||
$table->string('requestor_name');
|
||||
$table->unsignedBigInteger('requestor_corp_id');
|
||||
$table->string('requestor_corp_name');
|
||||
$table->unsignedBigInteger('system_id');
|
||||
$table->string('system');
|
||||
$table->enum('structure_type', [
|
||||
'Cyno Jammer',
|
||||
'Cyno Beacon',
|
||||
'Jump Bridge',
|
||||
'Super Construction Facilities',
|
||||
'Market',
|
||||
]);
|
||||
$table->double('structure_cost', 20, 2);
|
||||
$table->dateTime('paid_until');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('Structures');
|
||||
Schema::dropIfExists('CorpStructures');
|
||||
Schema::dropIfExists('corp_tax_ratios');
|
||||
Schema::dropIfExists('flex_structures');
|
||||
}
|
||||
}
|
||||
@@ -1,310 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCorpJournal extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('CorpJournals')) {
|
||||
Schema::create('CorpJournals', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->integer('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('HoldingCorpFinancesJournal')) {
|
||||
Schema::create('HoldingCorpFinancesJournal', function(Blueprint $table) {
|
||||
$table->integer('id')->unique();
|
||||
$table->decimal('amount', 20, 2);
|
||||
$table->decimal('balance', 20, 2);
|
||||
$table->integer('context_id');
|
||||
$table->string('context_id_type');
|
||||
$table->dateTime('date');
|
||||
$table->string('description');
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->nullabe();
|
||||
$table->string('ref_type');
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('jump_bridge_journal')) {
|
||||
Schema::create('jump_bridge_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->bigInteger('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('player_donation_journal')) {
|
||||
Schema::create('player_donation_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->bigInteger('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('reprocessing_tax_journal')) {
|
||||
Schema::create('reprocessing_tax_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->integer('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('office_fees_journal')) {
|
||||
Schema::create('office_fees_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->integer('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('structure_industry_tax_journal')) {
|
||||
Schema::create('structure_industry_tax_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->integer('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('planet_production_tax_journal')) {
|
||||
Schema::create('planet_production_tax_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->integer('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('monthly_market_taxes')) {
|
||||
Schema::create('monthly_market_taxes', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('character_id');
|
||||
$table->string('character_name');
|
||||
$table->string('corporation_id');
|
||||
$table->string('corporation_name');
|
||||
$table->decimal('tax_owed', 20, 2);
|
||||
$table->string('month');
|
||||
$table->string('year');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('pi_sale_journal')) {
|
||||
Schema::create('pi_sale_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corp_id');
|
||||
$table->integer('division');
|
||||
$table->integer('client_id');
|
||||
$table->string('date');
|
||||
$table->boolean('is_buy');
|
||||
$table->integer('journal_ref_id');
|
||||
$table->integer('location_id');
|
||||
$table->integer('quantity');
|
||||
$table->integer('transaction_id');
|
||||
$table->integer('type_id');
|
||||
$table->decimal('unit_price');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('alliance_market_journal')) {
|
||||
Schema::create('alliance_market_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->bigInteger('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('corp_market_journal')) {
|
||||
Schema::create('corp_market_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->bigInteger('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('corp_market_structures')) {
|
||||
Schema::create('corp_market_structures', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('character_id');
|
||||
$table->unsignedInteger('corporation_id');
|
||||
$table->decimal('tax', 5, 2);
|
||||
$table->decimal('ratio', 5, 2);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('sov_bill_journal')) {
|
||||
Schema::create('sov_bill_journal', function(Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('corporation_id')->nullabe();
|
||||
$table->integer('division')->default(0);
|
||||
$table->decimal('amount', 20, 2)->nullable();
|
||||
$table->decimal('balance', 20, 2)->nullable();
|
||||
$table->bigInteger('context_id')->nullable();
|
||||
$table->string('context_id_type')->nullable();
|
||||
$table->dateTime('date')->nullabe();
|
||||
$table->string('description')->nullabe();
|
||||
$table->integer('first_party_id')->nullable();
|
||||
$table->string('reason')->default(' ');
|
||||
$table->string('ref_type')->nullabe();
|
||||
$table->integer('second_party_id')->nullable();
|
||||
$table->decimal('tax', 20, 2)->default(0.00);
|
||||
$table->integer('tax_receiver_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('CorpWalletJournals');
|
||||
Schema::dropIfExists('HoldingcorpFinancesJournal');
|
||||
Schema::dropIfExists('jump_bridge_journal');
|
||||
Schema::dropIfExists('player_donation_journal');
|
||||
Schema::dropIfExists('reprocessing_tax_journal');
|
||||
Schema::dropIfExists('office_fees_journal');
|
||||
Schema::dropIfExists('structure_industry_tax');
|
||||
Schema::dropIfExists('planet_production_tax_journal');
|
||||
Schema::dropIfExists('monthly_market_taxes');
|
||||
Schema::dropIfExists('pi_sale_journal');
|
||||
Schema::dropIfExists('alliance_market_journal');
|
||||
Schema::dropIfExists('corp_market_journal');
|
||||
Schema::dropIfExists('corp_market_structures');
|
||||
Schema::dropIfExists('sov_bill_journal');
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateContractsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('contracts')) {
|
||||
Schema::create('contracts', function(Blueprint $table) {
|
||||
$table->increments('contract_id')->unique();
|
||||
$table->string('title');
|
||||
$table->string('type');
|
||||
$table->date('end_date');
|
||||
$table->text('body');
|
||||
$table->boolean('finished')->default(false);
|
||||
$table->decimal('final_cost', 20, 2)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('contract_bids')) {
|
||||
Schema::create('contract_bids', function(Blueprint $table) {
|
||||
$table->increments('id')->unique();
|
||||
$table->integer('contract_id');
|
||||
$table->decimal('bid_amount', 20, 2);
|
||||
$table->string('character_name');
|
||||
$table->string('character_id');
|
||||
$table->string('corporation_name');
|
||||
$table->string('corporation_id');
|
||||
$table->text('notes');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('accepted_bids')) {
|
||||
Schema::create('accepted_bids', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('contract_id');
|
||||
$table->integer('bid_id');
|
||||
$table->decimal('bid_amount', 20, 2);
|
||||
$table->text('notes')->default(null);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('contracts');
|
||||
Schema::dropIfExists('contract_bids');
|
||||
Schema::dropIfExists('accepted_bids');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateJobProcessWalletJournal extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
if(!Schema::hasTable('job_process_wallet_journal')) {
|
||||
Schema::create('job_process_wallet_journal', function(Blueprint $table) {
|
||||
$table->increments('id')->unique();
|
||||
$table->string('charId');
|
||||
$table->string('division');
|
||||
$table->integer('page');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::dropIfExists('job_process_wallet_journal');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAllianceAnchorStructureTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_anchor_structure')) {
|
||||
Schema::create('alliance_anchor_structure', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedInteger('corporation_id');
|
||||
$table->string('corporation_name');
|
||||
$table->string('system');
|
||||
$table->enum('structure_size', [
|
||||
'M',
|
||||
'L',
|
||||
'XL',
|
||||
]);
|
||||
$table->enum('structure_type', [
|
||||
'Flex',
|
||||
'Citadel',
|
||||
'Engineering',
|
||||
'Refinery',
|
||||
]);
|
||||
$table->dateTime('requested_drop_time');
|
||||
$table->unsignedInteger('requester_id');
|
||||
$table->string('requester');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('alliance_anchor_structure');
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAllianceMoonsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_moons')) {
|
||||
Schema::create('alliance_moons', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('id')->unique();
|
||||
$table->string('Region');
|
||||
$table->string('System');
|
||||
$table->string('Planet');
|
||||
$table->string('Moon');
|
||||
$table->string('Corporation');
|
||||
$table->string('StructureName')->default('No Name');
|
||||
$table->string('FirstOre')->default('None');
|
||||
$table->integer('FirstQuantity')->default('0');
|
||||
$table->string('SecondOre')->default('None');
|
||||
$table->integer('SecondQuantity')->default('0');
|
||||
$table->string('ThirdOre')->default('None');
|
||||
$table->integer('ThirdQuantity')->default('0');
|
||||
$table->string('FourthOre')->default('None');
|
||||
$table->integer('FourthQuantity')->default('0');
|
||||
$table->string('MoonType');
|
||||
$table->enum('Availability', [
|
||||
'Available',
|
||||
'Request Pending',
|
||||
'Reserved',
|
||||
'Deployed',
|
||||
])->default('Available');
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('alliance_moon_requests')) {
|
||||
Schema::create('alliance_moon_requests', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('region');
|
||||
$table->string('system');
|
||||
$table->string('planet');
|
||||
$table->string('moon');
|
||||
$table->string('corporation_name');
|
||||
$table->string('corporation_ticker');
|
||||
$table->unsignedBigInteger('corporation_id');
|
||||
$table->string('requestor_name');
|
||||
$table->unsignedBigInteger('requestor_id');
|
||||
$table->string('approver_name')->nullable();
|
||||
$table->unsignedBigInteger('approver_id')->nullable();
|
||||
$table->enum('status', [
|
||||
'Pending',
|
||||
'Approved',
|
||||
'Denied',
|
||||
]);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('alliance_moons');
|
||||
Schema::dropIfExists('alliance_moon_requests');
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateRentalMoonLedgerTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_mining_observers')) {
|
||||
Schema::create('alliance_mining_observers', function(Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('corporation_id');
|
||||
$table->string('corporation_name')->nullable();
|
||||
$table->unsignedBigInteger('observer_id');
|
||||
$table->string('observer_name')->nullable();
|
||||
$table->string('observer_type')->nullable();
|
||||
$table->dateTime('last_updated');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('alliance_rental_moon_ledgers')) {
|
||||
Schema::create('alliance_rental_moon_ledgers', function(Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('corporation_id');
|
||||
$table->string('corporation_name')->nullable();
|
||||
$table->unsignedBigInteger('character_id');
|
||||
$table->string('character_name')->nullable();
|
||||
$table->unsignedBigInteger('observer_id');
|
||||
$table->string('observer_name')->nullable();
|
||||
$table->unsignedBigInteger('type_id');
|
||||
$table->string('ore');
|
||||
$table->unsignedBigInteger('quantity');
|
||||
$table->unsignedBigInteger('recorded_corporation_id');
|
||||
$table->string('record_corporation_name');
|
||||
$table->dateTime('last_updated');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('corp_mining_observers')) {
|
||||
Schema::create('corp_mining_observers', function(Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('corporation_id');
|
||||
$table->string('corporation_name')->nullable();
|
||||
$table->unsignedBigInteger('observer_id');
|
||||
$table->string('observer_name')->nullable();
|
||||
$table->string('observer_type')->nullable();
|
||||
$table->unsignedBigInteger('observer_owner_id');
|
||||
$table->unsignedBigInteger('solar_system_id');
|
||||
$table->unsignedBigInteger('observer_type_id');
|
||||
$table->dateTime('last_updated');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('corp_moon_ledgers')) {
|
||||
Schema::create('corp_moon_ledgers', function(Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('corporation_id');
|
||||
$table->string('corporation_name')->nullable();
|
||||
$table->unsignedBigInteger('character_id');
|
||||
$table->string('character_name')->nullable();
|
||||
$table->unsignedBigInteger('observer_id');
|
||||
$table->string('observer_name')->nullable();
|
||||
$table->unsignedBigInteger('type_id');
|
||||
$table->string('ore');
|
||||
$table->unsignedBigInteger('quantity');
|
||||
$table->unsignedBigInteger('recorded_corporation_id');
|
||||
$table->string('recorded_corporation_name')->nullable();
|
||||
$table->dateTime('last_updated');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('alliance_rental_moon_ledgers');
|
||||
Schema::dropIfExists('corp_moon_ledgers');
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAllianceMoonRentalInvoicesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_moon_rental_invoices')) {
|
||||
Schema::create('alliance_moon_rental_invoices', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('invoice_id')->unique();
|
||||
$table->unsignedBigInteger('character_id');
|
||||
$table->string('character_name');
|
||||
$table->unsignedBigInteger('corporation_id');
|
||||
$table->string('corporation_name');
|
||||
$table->text('rental_moons')->nullalbe();
|
||||
$table->decimal('invoice_amount', 17, 2);
|
||||
$table->dateTime('due_date');
|
||||
$table->enum('paid', ['Yes', 'No'])->default('No');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('alliance_moon_rental_payments')) {
|
||||
Schema::create('alliance_moon_rental_payments', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('invoice_id')->unique();
|
||||
$table->decimal('payment_amount');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('alliance_moon_rental_invoices');
|
||||
Schema::dropIfExists('alliance_moon_rental_payments');
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAllianceMoonRentalsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_rental_moons')) {
|
||||
Schema::create('alliance_rental_moons', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('region');
|
||||
$table->string('system');
|
||||
$table->string('planet');
|
||||
$table->string('moon');
|
||||
$table->unsignedBigInteger('structure_id')->default(0);
|
||||
$table->string('structure_name')->default('No Name');
|
||||
$table->string('first_ore')->default('None');
|
||||
$table->decimal('first_quantity')->default(0.00);
|
||||
$table->string('second_ore')->default('None');
|
||||
$table->decimal('second_quantity')->default(0.00);
|
||||
$table->string('third_ore')->default('None');
|
||||
$table->decimal('third_quantity')->default(0.00);
|
||||
$table->string('fourth_ore')->default('None');
|
||||
$table->decimal('fourth_quantity')->default(0.00);
|
||||
$table->decimal('moon_worth', 17, 2)->default(0.00);
|
||||
$table->decimal('alliance_rental_price', 17,2)->default(0.00);
|
||||
$table->decimal('out_of_alliance_rental_price', 17,2)->default(0.00);
|
||||
$table->enum('rental_type', [
|
||||
'Not Rented',
|
||||
'In Alliance',
|
||||
'Out of Alliance',
|
||||
'Alliance',
|
||||
])->default('Not Rented');
|
||||
$table->dateTime('rental_until')->nullable();
|
||||
$table->unsignedBigInteger('rental_contact_id')->default(0);
|
||||
$table->enum('rental_contact_type', [
|
||||
'Character',
|
||||
'Corporation',
|
||||
'Alliance',
|
||||
'Unknown',
|
||||
'Not Rented',
|
||||
])->default('Not Rented');
|
||||
$table->enum('paid' ,[
|
||||
'Yes',
|
||||
'No',
|
||||
'Not Rented',
|
||||
])->default('Not Rented');
|
||||
$table->dateTime('paid_until')->nullable();
|
||||
$table->dateTime('alliance_use_until')->nullable();
|
||||
$table->dateTime('next_moon_pull')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
//Drop the older tables
|
||||
Schema::dropIfExists('moon_rents');
|
||||
Schema::dropIfExists('RentalMoons');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('alliance_rental_moons');
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateRentalRecordsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_rental_systems')) {
|
||||
Schema::create('alliance_rental_systems', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('contact_id');
|
||||
$table->string('contact_name');
|
||||
$table->unsignedBigInteger('corporation_id');
|
||||
$table->string('corporation_name');
|
||||
$table->unsignedBigInteger('system_id');
|
||||
$table->string('system_name');
|
||||
$table->double('rental_cost', 20, 2);
|
||||
$table->dateTime('paid_until');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('alliance_rental_systems');
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RemoveContractTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('public_contracts');
|
||||
Schema::dropIfExists('public_contract_items');
|
||||
Schema::dropIfExists('market_groups');
|
||||
Schema::dropIfExists('market_prices');
|
||||
Schema::dropIfExists('market_region_orders');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RemoveUnusedTables02142021 extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('wiki_groupnames');
|
||||
Schema::dropIfExists('wiki_member');
|
||||
Schema::dropIfExists('wiki_user');
|
||||
Schema::dropIfExists('PlayerDonationJournals');
|
||||
Schema::dropIfExists('corp_mining_observers');
|
||||
Schema::dropIfExists('corp_moon_ledgers');
|
||||
Schema::dropIfExists('alliance_anchor_structure');
|
||||
Schema::dropIfExists('alliance_rental_moons');
|
||||
Schema::dropIfExists('alliance_moon_rental_invoices');
|
||||
Schema::dropIfExists('alliance_moon_rental_payments');
|
||||
Schema::dropIfExists('alliance_moon_requests');
|
||||
Schema::dropIfExists('alliance_rental_moons');
|
||||
Schema::dropIfExists('alliance_rental_moon_ledgers');
|
||||
Schema::dropIfExists('alliance_rental_systems');
|
||||
Schema::dropIfExists('fleet_activity_tracking');
|
||||
Schema::dropIfExists('Fleets');
|
||||
Schema::dropIfExists('eve_mails');
|
||||
Schema::dropIfExists('bucks_character_wallet_entries');
|
||||
Schema::dropIfExists('bucks_alliance_systems');
|
||||
Schema::dropIfExists('bucks_ratting_daily_pool');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//Do nothing since we are only removing tables
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateScheduleMonitorTables extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('monitored_scheduled_tasks', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
$table->string('name');
|
||||
$table->string('type')->nullable();
|
||||
$table->string('cron_expression');
|
||||
$table->string('timezone')->nullable();
|
||||
$table->string('ping_url')->nullable();
|
||||
|
||||
$table->dateTime('last_started_at')->nullable();
|
||||
$table->dateTime('last_finished_at')->nullable();
|
||||
$table->dateTime('last_failed_at')->nullable();
|
||||
$table->dateTime('last_skipped_at')->nullable();
|
||||
|
||||
$table->dateTime('registered_on_oh_dear_at')->nullable();
|
||||
$table->dateTime('last_pinged_at')->nullable();
|
||||
$table->integer('grace_time_in_minutes');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
|
||||
Schema::create('monitored_scheduled_task_log_items', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
$table->unsignedBigInteger('monitored_scheduled_task_id');
|
||||
$table
|
||||
->foreign('monitored_scheduled_task_id', 'fk_scheduled_task_id')
|
||||
->references('id')
|
||||
->on('monitored_scheduled_tasks')
|
||||
->cascadeOnDelete();
|
||||
|
||||
$table->string('type');
|
||||
|
||||
$table->json('meta')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,6 @@ class CreateNewMoonRentalTables extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('alliance_moons');
|
||||
|
||||
if(!Schema::hasTable('moon_lookup')) {
|
||||
Schema::create('moon_lookup', function (Blueprint $table) {
|
||||
$table->id();
|
||||
@@ -31,26 +29,47 @@ class CreateNewMoonRentalTables extends Migration
|
||||
Schema::create('alliance_moons', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('moon_id');
|
||||
$table->string('name');
|
||||
$table->string('name')->default('Not Assigned');
|
||||
$table->unsignedBigInteger('system_id');
|
||||
$table->string('system_name');
|
||||
$table->decimal('worth_amount');
|
||||
$table->string('system_name')->default('Not Assigned');
|
||||
$table->enum('moon_type', [
|
||||
'R4',
|
||||
'R8',
|
||||
'R16',
|
||||
'R32',
|
||||
'R64',
|
||||
'None',
|
||||
])->default('None');
|
||||
$table->decimal('worth_amount')->default(0.00);
|
||||
$table->enum('rented', [
|
||||
'No',
|
||||
'Yes',
|
||||
]);
|
||||
$table->decimal('rental_amount');
|
||||
])->default('No');
|
||||
$table->decimal('rental_amount')->default(0.00);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('alliance_moon_ores')) {
|
||||
Schema::create('alliance_moons', function (Blueprint $table) {
|
||||
Schema::create('alliance_moon_ores', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('moon_id');
|
||||
$table->string('name');
|
||||
$table->string('moon_name')->default('Not Assigned');
|
||||
$table->unsignedBigInteger('ore_type_id');
|
||||
$table->string('ore_name');
|
||||
$table->float('quantity');
|
||||
$table->unsignedBigInteger('solar_system_id');
|
||||
$table->unsignedBigInteger('planet_id');
|
||||
|
||||
$table->foreign('moon_id', 'fk_moon_id')
|
||||
->references('moon_id')
|
||||
->on('alliance_moons')
|
||||
->cascadeOnDelete();
|
||||
|
||||
$table->foreign('moon_name', 'fk_moon_name')
|
||||
->references('name')
|
||||
->on('alliance_moons')
|
||||
->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,8 +77,8 @@ class CreateNewMoonRentalTables extends Migration
|
||||
Schema::create('alliance_moon_rentals', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('moon_id');
|
||||
$table->string('moon_name');
|
||||
$table->decimal('rental_amount', 20, 2);
|
||||
$table->string('moon_name')->default('Not Assigned');
|
||||
$table->decimal('rental_amount', 20, 2)->default(0.00);
|
||||
$table->date('rental_start')->nullable();
|
||||
$table->date('rental_end')->nullable();
|
||||
$table->date('next_billing_date')->nullable();
|
||||
@@ -84,8 +103,9 @@ class CreateNewMoonRentalTables extends Migration
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('moon_lookup');
|
||||
Schema::dropIfExists('alliance_moons');
|
||||
Schema::dropIfExists('alliance_moon_ores');
|
||||
Schema::dropIfExists('alliance_moon_rentals');
|
||||
Schema::dropIfExists('alliance_moon_ores');
|
||||
Schema::dropIfExists('alliance_moons');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMiningTaxMiningOperationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('alliance_mining_tax_operations')) {
|
||||
Schema::create('alliance_mining_tax_operations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('structure_id');
|
||||
$table->string('structure_name');
|
||||
$table->unsignedBigInteger('authorized_by_id');
|
||||
$table->string('authorized_by_name');
|
||||
$table->date('operation_date');
|
||||
$table->string('operation_name');
|
||||
$table->enum('processed', [
|
||||
'No',
|
||||
'Yes',
|
||||
])->default('No');
|
||||
$table->date('processed_on')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('alliance_mining_tax_invoices')) {
|
||||
Schema::table('alliance_mining_tax_invoices', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('modified_by_id')->nullable();
|
||||
$table->string('modified_by_name')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('alliance_mining_tax_operations');
|
||||
}
|
||||
}
|
||||
560
package-lock.json
generated
560
package-lock.json
generated
@@ -1555,6 +1555,15 @@
|
||||
"integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==",
|
||||
"dev": true
|
||||
},
|
||||
"bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.5.4",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz",
|
||||
@@ -3560,6 +3569,12 @@
|
||||
"integrity": "sha512-9C5qtGR/fNibHC5gzuMmmgnjH3QDDLKMa8lYe9CiZVmAnI4aUaoMh40QyUPzzs0RYo837SOBKh7TYwle4G8E4w==",
|
||||
"dev": true
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"dev": true
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
|
||||
@@ -3803,543 +3818,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"fsevents": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz",
|
||||
"integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
|
||||
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"nan": "^2.9.2",
|
||||
"node-pre-gyp": "^0.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"abbrev": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"are-we-there-yet": {
|
||||
"version": "1.1.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"delegates": "^1.0.0",
|
||||
"readable-stream": "^2.0.6"
|
||||
}
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"chownr": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"delegates": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "1.0.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"fs-minipass": {
|
||||
"version": "1.2.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minipass": "^2.2.1"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"gauge": {
|
||||
"version": "2.7.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"aproba": "^1.0.3",
|
||||
"console-control-strings": "^1.0.0",
|
||||
"has-unicode": "^2.0.0",
|
||||
"object-assign": "^4.1.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"string-width": "^1.0.1",
|
||||
"strip-ansi": "^3.0.1",
|
||||
"wide-align": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
}
|
||||
},
|
||||
"ignore-walk": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.3.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "1.2.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minipass": "^2.2.1"
|
||||
}
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"needle": {
|
||||
"version": "2.2.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"debug": "^2.1.2",
|
||||
"iconv-lite": "^0.4.4",
|
||||
"sax": "^1.2.4"
|
||||
}
|
||||
},
|
||||
"node-pre-gyp": {
|
||||
"version": "0.10.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"detect-libc": "^1.0.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"needle": "^2.2.1",
|
||||
"nopt": "^4.0.1",
|
||||
"npm-packlist": "^1.1.6",
|
||||
"npmlog": "^4.0.2",
|
||||
"rc": "^1.2.7",
|
||||
"rimraf": "^2.6.1",
|
||||
"semver": "^5.3.0",
|
||||
"tar": "^4"
|
||||
}
|
||||
},
|
||||
"nopt": {
|
||||
"version": "4.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"abbrev": "1",
|
||||
"osenv": "^0.1.4"
|
||||
}
|
||||
},
|
||||
"npm-bundled": {
|
||||
"version": "1.0.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"npm-packlist": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ignore-walk": "^3.0.1",
|
||||
"npm-bundled": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"npmlog": {
|
||||
"version": "4.1.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"are-we-there-yet": "~1.1.2",
|
||||
"console-control-strings": "~1.1.0",
|
||||
"gauge": "~2.7.3",
|
||||
"set-blocking": "~2.0.0"
|
||||
}
|
||||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"osenv": {
|
||||
"version": "0.1.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"os-homedir": "^1.0.0",
|
||||
"os-tmpdir": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"rc": {
|
||||
"version": "1.2.8",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"deep-extend": "^0.6.0",
|
||||
"ini": "~1.3.0",
|
||||
"minimist": "^1.2.0",
|
||||
"strip-json-comments": "~2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.6",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"sax": {
|
||||
"version": "1.2.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.6.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
"strip-ansi": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"tar": {
|
||||
"version": "4.4.8",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"chownr": "^1.1.1",
|
||||
"fs-minipass": "^1.2.5",
|
||||
"minipass": "^2.3.4",
|
||||
"minizlib": "^1.1.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"wide-align": {
|
||||
"version": "1.1.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"string-width": "^1.0.2 || 2"
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
}
|
||||
"bindings": "^1.5.0",
|
||||
"nan": "^2.12.1"
|
||||
}
|
||||
},
|
||||
"function-bind": {
|
||||
@@ -5899,8 +5384,7 @@
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
|
||||
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"nanomatch": {
|
||||
"version": "1.2.13",
|
||||
@@ -7219,7 +6703,7 @@
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.6",
|
||||
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
||||
1810
public/alliance_moons.txt
Normal file
1810
public/alliance_moons.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,9 @@
|
||||
*/
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
if(file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
|
||||
require __DIR__.'/../storage/framework/maintenance.php';
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
12
public/vendor/horizon/app-dark.css
vendored
12
public/vendor/horizon/app-dark.css
vendored
File diff suppressed because one or more lines are too long
12
public/vendor/horizon/app.css
vendored
12
public/vendor/horizon/app.css
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/horizon/app.js
vendored
2
public/vendor/horizon/app.js
vendored
File diff suppressed because one or more lines are too long
7
public/vendor/horizon/mix-manifest.json
vendored
7
public/vendor/horizon/mix-manifest.json
vendored
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"/app.js": "/app.js?id=a2e36b7a4f248973b22b",
|
||||
"/app.css": "/app.css?id=9ce01eaaba790566b895",
|
||||
"/app-dark.css": "/app-dark.css?id=821c845f9bf3b7853c33"
|
||||
"/app.js": "/app.js?id=d33e0bb4038cbbc2466e",
|
||||
"/app-dark.css": "/app-dark.css?id=ade35296e4fa0c99a758",
|
||||
"/app.css": "/app.css?id=c14814cc1a7a4f298934",
|
||||
"/img/favicon.png": "/img/favicon.png?id=1542bfe8a0010dcbee71"
|
||||
}
|
||||
|
||||
258
resources/views/finances/display/card.blade.php
Normal file
258
resources/views/finances/display/card.blade.php
Normal file
@@ -0,0 +1,258 @@
|
||||
@extends('layouts.user.dashb4')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<h2>Taxes Dashboard</h2>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
PI Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>PI Taxes</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($pis as $pi)
|
||||
<tr>
|
||||
<td>{{ $pi['date'] }}</td>
|
||||
<td>{{ $pi['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Office Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Office Taxes</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($offices as $office)
|
||||
<tr>
|
||||
<td>{{ $office['date'] }}</td>
|
||||
<td>{{ $office['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Industry Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Industry Taxes</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($industrys as $industry)
|
||||
<tr>
|
||||
<td>{{ $industry['date'] }}</td>
|
||||
<td>{{ $industry['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Reprocessing Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Reprocessing Taxes</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($reprocessings as $reprocessing)
|
||||
<tr>
|
||||
<td>{{ $reprocessing['date'] }}</td>
|
||||
<td>{{ $reprocessing['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Market Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Market Taxes</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($markets as $market)
|
||||
<tr>
|
||||
<td>{{ $market['date'] }}</td>
|
||||
<td>{{ $market['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Jump Gate Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Jump Gate Taxes</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($jumpgates as $jumpgate)
|
||||
<tr>
|
||||
<td>{{ $jumpgate['date'] }}</td>
|
||||
<td>{{ $jumpgate['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Mining Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Mining Taxes Paid</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($miningTaxes as $mining)
|
||||
<tr>
|
||||
<td>{{ $mining['date'] }}</td>
|
||||
<td>{{ $mining['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Mining Taxes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Mining Taxes Paid Late</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($miningTaxesLate as $mining)
|
||||
<tr>
|
||||
<td>{{ $mining['date'] }}</td>
|
||||
<td>{{ $mining['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<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 $actual)
|
||||
<tr>
|
||||
<td>{{ $actual['date'] }}</td>
|
||||
<td>{{ $actual['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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 $loss)
|
||||
<tr>
|
||||
<td>{{ $loss['date'] }}</td>
|
||||
<td>{{ $loss['gross'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
40
resources/views/finances/display/outlook.blade.php
Normal file
40
resources/views/finances/display/outlook.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
@extends('layouts.user.dashb4')
|
||||
@section('content')
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Financial Outlook for the Alliance</h2>
|
||||
All numbers are in millions.
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="finances-div"></div>
|
||||
{!! $lava->render('ComboChart', 'Finances', 'finances-div') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Income Streams</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="income-div"></div>
|
||||
{!! $lava->render('PieChart', 'Incomes', 'income-div') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Expenses</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="expense-div"></div>
|
||||
{!! $lava->render('PieChart', 'Expenses', 'expense-div') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -2,8 +2,16 @@
|
||||
<footer class="main-footer">
|
||||
<!-- To the right -->
|
||||
<div class="float-right d-none d-sm-inline">
|
||||
Anything you want
|
||||
@hasSection('footer-right')
|
||||
@yeild('footer-right')
|
||||
@endif
|
||||
</div>
|
||||
@hasSection('footer-center')
|
||||
@yeild('footer-center')
|
||||
@endif
|
||||
<!-- Default to the left -->
|
||||
<strong>Copyright © 2014-2019 <a href="https://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved.
|
||||
@hasSection('footer-left')
|
||||
@yeild('footer-left')
|
||||
@endif
|
||||
</footer>
|
||||
@@ -25,4 +25,7 @@
|
||||
<link rel="stylesheet" href="/bower_components/admin-lte/dist/css/adminlte.min.css">
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
|
||||
@hasSection('header')
|
||||
@yield('header')
|
||||
@endif
|
||||
</head>
|
||||
@@ -1,34 +1,37 @@
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
||||
<!-- Brand Logo -->
|
||||
<a href="#" class="brand-link">
|
||||
<span class="brand-text font-weight-light">W4RP Admin Dashboard</span>
|
||||
</a>
|
||||
<!-- Brand Logo -->
|
||||
<a href="#" class="brand-link">
|
||||
<span class="brand-text font-weight-light">W4RP Admin Dashboard</span>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user panel (optional) -->
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="info">
|
||||
<a href="#" class="d-block">{{ auth()->user()->getName() }}</a>
|
||||
</div>
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user panel (optional) -->
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="info">
|
||||
<a href="#" class="d-block">{{ auth()->user()->getName() }}</a>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
||||
<!-- General Administrative Stuff -->
|
||||
@include('layouts.admin.sidebarmenu.general')
|
||||
<!-- End General Administrative Stuff -->
|
||||
<!-- SRP Admin -->
|
||||
@include('layouts.admin.sidebarmenu.srp')
|
||||
<!-- End SRP Admin -->
|
||||
<!-- Mining Tax Admin -->
|
||||
@include('layouts.admin.sidebarmenu.miningtax')
|
||||
<!-- End Mining Tax Admin -->
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
||||
<!-- General Administrative Stuff -->
|
||||
@include('layouts.admin.sidebarmenu.general')
|
||||
<!-- End General Administrative Stuff -->
|
||||
<!-- SRP Admin -->
|
||||
@include('layouts.admin.sidebarmenu.srp')
|
||||
<!-- End SRP Admin -->
|
||||
<!-- Mining Tax Admin -->
|
||||
@include('layouts.admin.sidebarmenu.miningtax')
|
||||
<!-- End Mining Tax Admin -->
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
@hasSection('sidebar')
|
||||
@yeild('sidebar')
|
||||
@endif
|
||||
</aside>
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
<a href="/dashboard" class="nav-link">Dashboard</a>
|
||||
</li>
|
||||
</ul>
|
||||
@hasSection('navbar-upper-left')
|
||||
@yeild('navbar-upper-left')
|
||||
@endif
|
||||
|
||||
<!-- Right navbar links -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@@ -27,5 +30,8 @@
|
||||
class="fas fa-th-large"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
@hasSection('navbar-upper-right')
|
||||
@yeild('navbar-upper-right')
|
||||
@endif
|
||||
</nav>
|
||||
<!-- /.navbar -->
|
||||
@@ -6,3 +6,6 @@
|
||||
<script src="/bower_components/admin-lte/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="/bower_components/admin-lte/dist/js/adminlte.min.js"></script>
|
||||
@hasSection('scripts')
|
||||
@yield('scripts')
|
||||
@endif
|
||||
@@ -1,3 +1,4 @@
|
||||
@if(auth()->user()->hasPermission('mining.officer'))
|
||||
<li class="nav-item has-treeview">
|
||||
<a href="#" class="nav-link">
|
||||
<i class="nav-icon fas fa-cubes"></i>
|
||||
@@ -17,5 +18,12 @@
|
||||
<p>Paid Invoices</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/miningtax/admin/display/form/operations" class="nav-link">
|
||||
<i class="far fa-money-bill-alt nav-icon"></i>
|
||||
<p>Mining Operation Form</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@@ -1,9 +1,18 @@
|
||||
<!-- Main Footer -->
|
||||
<footer class="main-footer">
|
||||
<!-- To the right -->
|
||||
<div class="float-right d-none d-sm-inline">
|
||||
|
||||
<div class="float-right d-none d-sm-inline">
|
||||
@hasSection('footer-right')
|
||||
@yield('footer-right')
|
||||
@endif
|
||||
</div>
|
||||
@hasSection('footer-center')
|
||||
@yield('footer-center')
|
||||
@endif
|
||||
<!-- Default to the left -->
|
||||
<strong><a href="https://services.w4rp.space">Warped Intentions</a></strong>
|
||||
@hasSection('footer-left')
|
||||
@yeild('footer-left')
|
||||
@endif
|
||||
</footer>
|
||||
@@ -25,4 +25,7 @@
|
||||
<link rel="stylesheet" href="/bower_components/admin-lte/dist/css/adminlte.min.css">
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
|
||||
@hasSection('header')
|
||||
@yield('header')
|
||||
@endif
|
||||
</head>
|
||||
@@ -1,47 +1,49 @@
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
||||
<!-- Brand Logo -->
|
||||
<a href="#" class="brand-link">
|
||||
<span class="brand-text font-weight-light">W4RP</span>
|
||||
</a>
|
||||
<!-- Brand Logo -->
|
||||
<a href="#" class="brand-link">
|
||||
<span class="brand-text font-weight-light">W4RP</span>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user panel (optional) -->
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="info">
|
||||
<a href="/profile" class="d-block">{{ auth()->user()->getName() }}</a>
|
||||
</div>
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user panel (optional) -->
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="info">
|
||||
<a href="/profile" class="d-block">{{ auth()->user()->getName() }}</a>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
||||
<!-- General Items -->
|
||||
@if(auth()->user()->hasRole('User') || auth()->user()->hasRole('Admin'))
|
||||
@include('layouts.user.sidebarmenu.general')
|
||||
@endif
|
||||
<!-- End General Items -->
|
||||
<!-- Mining Tax Items -->
|
||||
@include('layouts.user.sidebarmenu.miningtax')
|
||||
<!-- End Mining Tax Items -->
|
||||
<!-- After Action Reports -->
|
||||
@if(auth()->user()->hasPermission('fc.team'))
|
||||
@include('layouts.user.sidebarmenu.reports')
|
||||
@endif
|
||||
<!-- End After Action Reports -->
|
||||
<!-- SRP Items -->
|
||||
@include('layouts.user.sidebarmenu.srp')
|
||||
<!-- SRP Items -->
|
||||
<!-- Contracts -->
|
||||
@include('layouts.user.sidebarmenu.contracts')
|
||||
<!-- End Contracts -->
|
||||
<!-- Blacklist -->
|
||||
@include('layouts.user.sidebarmenu.blacklist')
|
||||
<!-- End Blacklist -->
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
||||
<!-- General Items -->
|
||||
@include('layouts.user.sidebarmenu.general')
|
||||
<!-- End General Items -->
|
||||
<!-- Finance Items -->
|
||||
@include('layouts.user.sidebarmenu.finances')
|
||||
<!-- End Finance Items -->
|
||||
<!-- Mining Tax Items -->
|
||||
@include('layouts.user.sidebarmenu.miningtax')
|
||||
<!-- End Mining Tax Items -->
|
||||
<!-- After Action Reports -->
|
||||
@include('layouts.user.sidebarmenu.reports')
|
||||
<!-- End After Action Reports -->
|
||||
<!-- SRP Items -->
|
||||
@include('layouts.user.sidebarmenu.srp')
|
||||
<!-- SRP Items -->
|
||||
<!-- Contracts -->
|
||||
@include('layouts.user.sidebarmenu.contracts')
|
||||
<!-- End Contracts -->
|
||||
<!-- Blacklist -->
|
||||
@include('layouts.user.sidebarmenu.blacklist')
|
||||
<!-- End Blacklist -->
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
@hasSection('sidebar')
|
||||
@yield('sidebar')
|
||||
@endif
|
||||
</aside>
|
||||
|
||||
@@ -8,12 +8,17 @@
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a href="/dashboard" class="nav-link">Dashboard</a>
|
||||
</li>
|
||||
@if(auth()->user()->hasRole('Admin') || auth()->user()->hasPermission('contract.admin') || auth()->user()->hasPermission('moon.admin'))
|
||||
@if(auth()->user()->hasRole('Admin') ||
|
||||
auth()->user()->hasPermission('contract.admin') ||
|
||||
auth()->user()->hasPermission('mining.officer'))
|
||||
<li class="nav-item d-non d-sm-inline-block">
|
||||
<a class="nav-link" href="/admin/dashboard">Admin Dashboard</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
@hasSection('navbar-upper-left')
|
||||
@yield('navbar-upper-left')
|
||||
@endif
|
||||
|
||||
<!-- Right navbar links -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@@ -44,5 +49,8 @@
|
||||
class="fas fa-th-large"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
@hasSection('navbar-upper-right')
|
||||
@yeild('navbar-upper-right')
|
||||
@endif
|
||||
</nav>
|
||||
<!-- /.navbar -->
|
||||
@@ -6,3 +6,6 @@
|
||||
<script src="/bower_components/admin-lte/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="/bower_components/admin-lte/dist/js/adminlte.min.js"></script>
|
||||
@hasSection('scripts')
|
||||
@yeild('scripts')
|
||||
@endif
|
||||
25
resources/views/layouts/user/sidebarmenu/finances.blade.php
Normal file
25
resources/views/layouts/user/sidebarmenu/finances.blade.php
Normal file
@@ -0,0 +1,25 @@
|
||||
@if((auth()->user()->hasRole('User') && auth()->user()->hasPermission('ceo')) ||
|
||||
auth()->user()->hasRole('Admin'))
|
||||
<li class="nav-item has-treeview">
|
||||
<a href="#" class="nav-link">
|
||||
<i class="nav-icon fas fa-file-contract"></i>
|
||||
<p>Finances
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="/finances/card" class="nav-link">
|
||||
<i class="far fa-circle nav-icon"></i>
|
||||
<p>Cards</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/finances" class="nav-link">
|
||||
<i class="far fa-circle nav-icon"></i>
|
||||
<p>Outlook</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@@ -1,3 +1,4 @@
|
||||
@if(auth()->user()->hasRole('User') || auth()->user()->hasRole('Admin'))
|
||||
<li class="nav-item has-treeview">
|
||||
<a href="#" class="nav-link">
|
||||
<i class="nav-icon fas fa-tachometer-alt"></i>
|
||||
@@ -31,4 +32,5 @@
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</li>
|
||||
@endif
|
||||
@@ -24,5 +24,17 @@
|
||||
<p>Ledgers</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/miningtax/display/availablemoons" class="nav-link">
|
||||
<i class="fas fa-cog nav-icon"></i>
|
||||
<p>Available Moons</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/miningtax/display/allmoons" class="nav-link">
|
||||
<i class="fas fa-cog nav-icon"></i>
|
||||
<p>All Moons</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -1,3 +1,4 @@
|
||||
@if(auth()->user()->hasPermission('fc.team'))
|
||||
<li class="nav-item has-treeview">
|
||||
<a href="#" class="nav-link">
|
||||
<i class="nav-icon fas fa-cubes"></i>
|
||||
@@ -20,3 +21,4 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@@ -0,0 +1,62 @@
|
||||
@extends('layouts.admin.b4')
|
||||
@section('content')
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Invoice Details</h2>
|
||||
<h3>Id: {!! $invoice->invoice_id !!}</h3>
|
||||
<h3>Character: {!! $invoice->character_name !!}</h3>
|
||||
<h3>Amount: {!! number_format($totalPrice, 2, ".", ",") !!} ISK</h3>
|
||||
<h3>Invoice Date: {!! $invoice->date_issued !!}</h3>
|
||||
<h3>Invoice Due Date: {!! $invoice->date_due !!}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Ore Name</th>
|
||||
<th>Quantity</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($ores as $name => $quantity)
|
||||
<tr>
|
||||
<td>{{ $name }}</td>
|
||||
<td>{{ $quantity }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Ledger Details</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Character Name</th>
|
||||
<th>Observer Name</th>
|
||||
<th>Ore Name</th>
|
||||
<th>Quantity</th>
|
||||
<th>Price</th>
|
||||
<th>Tax Amount</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($moons as $moon)
|
||||
<tr>
|
||||
<td>{{ $moon['character_name'] }}</td>
|
||||
<td>{{ $moon['observer_name'] }}</td>
|
||||
<td>{{ $moon['ore_name'] }}</td>
|
||||
<td>{{ $moon['quantity'] }}</td>
|
||||
<td>{{ number_format($moon['amount'], 2, ".", ",") }} ISK</td>
|
||||
<td>{{ number_format($moon['tax_amount'], 2, ".", ",") }} ISK</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.admin.b4')
|
||||
@section('content')
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Alliance Mining Operations Form</h2>
|
||||
<h4>Enter in the information, then hit submit.</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{!! Form::open(['action' => 'MiningTaxes\MiningTaxesAdminController@storeMiningOperationForm', 'method' => 'POST']) !!}
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('name', 'Mining Operation Name') }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('date', 'Date') }}
|
||||
{{ Form::date('date', \Carbon\Carbon::now(), ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('structure', 'Mining Structure') }}
|
||||
{{ Form::select('structure', $structures, 'None', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Current Alliance Mining Operations</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<th>Operation Date</th>
|
||||
<th>Operation Name</th>
|
||||
<th>Structure Name</th>
|
||||
<th>Authorized By</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($operations != null)
|
||||
@foreach($operations as $operation)
|
||||
<tr>
|
||||
<td>{{ $operation->operation_date }}</td>
|
||||
<td>{{ $operation->operation_name }}</td>
|
||||
<td>{{ $operation->structure_name }}</td>
|
||||
<td>{{ $operation->authorized_by_name }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,4 @@
|
||||
@extends('layouts.admin.b4')
|
||||
@section('content')
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,4 @@
|
||||
@extends('layouts.admin.b4')
|
||||
@section('content')
|
||||
|
||||
@endsection
|
||||
@@ -39,7 +39,7 @@
|
||||
@foreach($invoices as $invoice)
|
||||
<tr>
|
||||
<td>{{ $invoice->character_name }}</td>
|
||||
<td>{{ $invoice->invoice_id }}</td>
|
||||
<td><a href="/miningtax/admin/display/detail/invoice/{{ $invoice->invoice_id }}">{{ $invoice->invoice_id }}</a></td>
|
||||
<td>{{ number_format($invoice->invoice_amount, 2, ".", ",") }}</td>
|
||||
<td>{{ $invoice->date_issued }}</td>
|
||||
<td>{{ $invoice->date_due }}</td>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user