Compare commits

...

239 Commits

Author SHA1 Message Date
dependabot[bot]
daebf16044 Bump minimist and mkdirp
Bumps [minimist](https://github.com/minimistjs/minimist) and [mkdirp](https://github.com/isaacs/node-mkdirp). These dependencies needed to be updated together.

Updates `minimist` from 1.2.0 to 1.2.8
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.0...v1.2.8)

Updates `mkdirp` from 0.5.1 to 0.5.6
- [Changelog](https://github.com/isaacs/node-mkdirp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-mkdirp/compare/0.5.1...v0.5.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
- dependency-name: mkdirp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 12:06:36 +00:00
3c94239da7 offset stuff 2021-08-02 02:24:39 -05:00
7e6c8224a5 offset stuff 2021-08-02 02:24:10 -05:00
8bc1289206 offset stuff 2021-08-02 02:23:47 -05:00
75390f10cd offset stuff 2021-08-02 02:21:41 -05:00
7468e63299 offset stuff 2021-08-02 02:19:36 -05:00
4c88de77a7 offset stuff 2021-08-02 02:17:45 -05:00
c7502b853c offset stuff 2021-08-02 02:14:23 -05:00
249ab13004 offset stuff 2021-08-02 02:13:59 -05:00
fce67286fd offset stuff 2021-08-02 02:11:44 -05:00
f841639ec3 offset stuff 2021-08-02 02:10:43 -05:00
c270017111 offset stuff 2021-08-02 02:09:24 -05:00
0ee317b0fc offset stuff 2021-08-02 02:08:53 -05:00
f606b9cdd5 financial outlook update 2021-08-02 02:07:22 -05:00
412b4d6794 adding more cards for more graphs for financial outlook graphing 2021-08-02 01:40:20 -05:00
c045cabcf7 financial outlook display 2021-08-02 01:38:31 -05:00
f5adc203f3 financial outlook display 2021-08-02 01:37:43 -05:00
f3362bab00 financial outlook display 2021-08-02 01:37:09 -05:00
268e2fdbee updated how require permission works 2021-08-02 01:34:33 -05:00
6d38e6fc8c updated how require permission works 2021-08-02 01:31:37 -05:00
99ff081b05 updated how require permission works 2021-08-02 01:31:11 -05:00
5b88887f53 updated how require permission works 2021-08-02 01:30:22 -05:00
669f716112 finances stuff 2021-08-01 23:52:59 -05:00
addd34cb82 finances stuff 2021-08-01 23:48:07 -05:00
c77a6e7af6 invoice changes 2021-08-01 23:44:00 -05:00
28ca917d5d invoice changes 2021-08-01 23:41:57 -05:00
1196abb0a0 invoice changes 2021-08-01 23:40:27 -05:00
68560e4e35 invoice changes 2021-08-01 23:39:30 -05:00
a4eb7b9ad3 invoice changes 2021-08-01 23:38:49 -05:00
35591ab04c invoice changes 2021-08-01 23:37:52 -05:00
339b1063c6 invoice changes 2021-08-01 23:36:03 -05:00
83592117d1 invoice details 2021-08-01 23:14:29 -05:00
ff1e396fbc added sidebar menu items for new controller 2021-07-18 01:45:08 -05:00
5471ccfa17 added new routes for finance pages 2021-07-18 01:37:28 -05:00
c0aa379d37 added financial blade and controller.
need to add routes still
2021-07-18 01:12:07 -05:00
3da0cec4a1 added moon rentals into tax performance metrics 2021-07-18 00:39:02 -05:00
bca5179cc3 added blade for showing rented moons 2021-07-18 00:32:34 -05:00
c075112810 added ability to see own or corp rented moon in the miningtaxescontroller 2021-07-16 23:17:51 -05:00
57d01028cf display rented moons in the controller 2021-07-13 02:22:45 -05:00
bef633434c rental stuff date was wrong 2021-07-12 19:26:58 -05:00
6afba02675 fix structure name 2021-07-10 23:27:10 -05:00
4ac1ef0e73 fix structure name 2021-07-10 23:25:28 -05:00
0b0faf26d2 moon rental form 2021-07-10 22:05:05 -05:00
d49695e7e8 moon rental form 2021-07-10 22:00:06 -05:00
0e96905213 moon rental form 2021-07-10 21:48:36 -05:00
57d9d4b99b moon rental form 2021-07-10 21:48:28 -05:00
f77e6874d0 moon rental form 2021-07-10 21:47:05 -05:00
daa72ff60c moon rental form 2021-07-10 21:21:49 -05:00
8bd44c10b8 moon rental form 2021-07-10 21:17:51 -05:00
f4c77eee00 moon rental form 2021-07-10 20:58:52 -05:00
5b11c5b629 moon rental form 2021-07-10 20:58:39 -05:00
2e1f28c8c5 moon rental form 2021-07-10 20:50:38 -05:00
7bc2b82837 moon rental form 2021-07-10 20:47:01 -05:00
f6f73cbb94 moon rental form 2021-07-09 19:27:22 -05:00
411b005dee moon rental pages 2021-07-09 02:13:51 -05:00
aacf2fc830 moon rental pages 2021-07-09 01:36:12 -05:00
e498a2b202 moon rental pages 2021-07-09 01:31:17 -05:00
3853a81fba moon rental pages 2021-07-09 01:27:31 -05:00
7b26a021e1 moon rental pages 2021-07-09 01:20:34 -05:00
b310799bf0 moon rental pages 2021-07-09 01:06:40 -05:00
1a44be502a working on moon rental worth 2021-07-05 22:01:10 -05:00
103a41c0ff working on moon rental worth 2021-07-05 21:52:31 -05:00
9e5e3720b5 working on moon rental worth 2021-07-05 21:51:57 -05:00
baf7c2130e working on moon rental worth 2021-07-05 21:50:58 -05:00
c889960805 working on moon rental worth 2021-07-05 21:49:55 -05:00
9462aea45f working on moon rental worth 2021-07-05 21:49:23 -05:00
f26ba1d75c working on moon rental worth 2021-07-05 21:42:20 -05:00
2d575dd86b working on moon rental worth 2021-07-05 21:41:33 -05:00
5db70758cb mining op form 2021-06-27 19:41:12 +00:00
8f2036eecc structure helper 2021-06-24 21:26:42 +09:00
083422047c store operations form 2021-06-24 11:42:53 +09:00
dda65951b3 update alliance moon rental worth 2021-06-22 20:59:50 +09:00
dbd30021f9 schedule 2021-06-22 20:53:15 +09:00
c69416ee88 schedule 2021-06-22 20:50:21 +09:00
03b0c71708 fixed send mining taxes invoices 2021-06-22 20:45:54 +09:00
d4214ee4bf command for moon rental worth 2021-06-19 02:31:15 -05:00
c70999100b test command 2021-06-19 07:00:53 +00:00
eceac30f4b modified display invoices to display the whole invoice and not only part of the invoice 2021-06-17 00:25:58 +09:00
736eb6feba mining invoice mail update 2021-06-07 23:46:01 +09:00
cd0710c428 mining operations 2021-06-07 20:06:17 +09:00
bd03a983a2 mining invoices 2021-06-07 20:00:15 +09:00
4c3896cbee invoicing 2021-06-07 19:54:34 +09:00
c362de7589 mining invoices 2021-06-07 19:32:02 +09:00
c17af03ef3 mining invoices 2021-06-07 19:09:10 +09:00
2fbf72df61 job updates and command kernel updates 2021-06-07 03:32:45 +09:00
55b0002688 job updates and command kernel updates 2021-06-07 03:31:51 +09:00
2a3a86f185 job updates and command kernel updates 2021-06-07 03:30:23 +09:00
82072f18dc after action reports 2021-06-06 00:25:07 +09:00
7bfc30e50d fixed delay time on dispatching late invoices job 2021-06-04 20:04:50 +09:00
109d70363d update to some jobs to try to keep them from failing 2021-06-04 20:03:35 +09:00
0ef8dca814 mining operations 2021-06-04 00:34:04 +09:00
9685d7ee8a mining operations 2021-06-04 00:32:52 +09:00
1dd6b73632 mining operations 2021-06-04 00:29:50 +09:00
1a591b202c mining operations 2021-06-04 00:28:12 +09:00
ddda064033 mining operations 2021-06-04 00:27:47 +09:00
48b5955e16 mining operations 2021-06-04 00:26:29 +09:00
a877e28da9 mining operations 2021-06-04 00:24:58 +09:00
f0ec279ea5 mining operations 2021-06-04 00:23:42 +09:00
254931998c mining operations 2021-06-04 00:20:42 +09:00
9ad22c03a8 mining operations 2021-06-04 00:01:23 +09:00
1210c71484 mining operations 2021-06-03 23:59:20 +09:00
bd4b5e8a83 mining operations 2021-06-03 01:28:47 +09:00
3b02745302 mining operations 2021-06-03 01:27:58 +09:00
2349f1031c fixed job issue 2021-06-03 00:52:49 +09:00
8ea29296bd fixed job issue 2021-06-03 00:41:29 +09:00
68ce69ec70 fixed job issue 2021-06-03 00:39:33 +09:00
814db0307a testing new functions 2021-06-03 00:19:22 +09:00
0aaddbe9ad testing new functions 2021-06-03 00:17:58 +09:00
5fcca05d2b testing new functions 2021-06-03 00:16:39 +09:00
8f6be2c87e testing new functions 2021-06-03 00:16:15 +09:00
8749ce8848 testing new functions 2021-06-03 00:15:49 +09:00
ac0ca03845 testing new functions 2021-06-03 00:14:54 +09:00
568928c98f testing new functions 2021-06-03 00:14:10 +09:00
8fb4b979c3 testing new functions 2021-06-03 00:13:05 +09:00
23739baa7c testing new functions 2021-06-03 00:12:13 +09:00
c7ce7a9351 testing new functions 2021-06-03 00:11:42 +09:00
74f4c21244 testing new functions 2021-06-03 00:09:11 +09:00
996ff6e6aa testing new functions 2021-06-03 00:06:50 +09:00
918d9129f4 testing new functions 2021-06-02 23:59:32 +09:00
27f782f659 added a way for mining operations to be recorded.
refactored mining tax invoice jobs with a job chain and new directory structure
added views and forms for mining operations
added navbar button for mining operations
refactored how admin dashboard controller checks for permissions versus roles
2021-06-02 01:49:24 +09:00
17b1db88c1 added yields for extra content in the admin dashboard 2021-06-01 22:12:48 +09:00
27e05fdfde added yields and hasSections 2021-06-01 22:02:38 +09:00
a07151f507 moon displays 2021-06-01 00:05:32 +09:00
94c4cf760a moon displays 2021-06-01 00:04:41 +09:00
20cc7f22dc moon displays 2021-06-01 00:03:31 +09:00
49257e4cf4 moon displays 2021-06-01 00:01:03 +09:00
bc0b3336c5 moon displays 2021-05-31 23:59:32 +09:00
fadf93b425 moon displays 2021-05-31 23:56:32 +09:00
0815b43797 moon displays 2021-05-31 23:55:12 +09:00
55185bae5b moon displays 2021-05-31 23:46:54 +09:00
4030166118 moon displays 2021-05-31 23:42:20 +09:00
f179cbedd7 moon displays 2021-05-31 23:41:30 +09:00
20bb89f388 moon displays 2021-05-31 23:37:30 +09:00
e4ccf5190b moon displays 2021-05-31 23:36:18 +09:00
38b0b8f63f moon displays 2021-05-31 23:34:56 +09:00
dedbcc6c84 moon displays 2021-05-31 23:34:01 +09:00
cef0f7632d moon displays 2021-05-31 23:32:29 +09:00
7af4457c6a moon displays 2021-05-31 23:31:35 +09:00
9e851e1a10 moon displays 2021-05-31 23:29:01 +09:00
b322f9a8a6 moon displays 2021-05-31 23:27:48 +09:00
02722c3146 moon displays 2021-05-31 23:26:25 +09:00
8405913e84 moon displays 2021-05-31 23:24:53 +09:00
5d5b23b25b moon displays 2021-05-31 23:23:54 +09:00
e3e10952a6 moon displays 2021-05-31 23:21:29 +09:00
58e2dcdcc9 moon displays 2021-05-31 23:20:58 +09:00
936fca0667 moon displays 2021-05-31 23:20:00 +09:00
e777d7e816 moon displays 2021-05-31 23:17:57 +09:00
5472c99b15 modification of user invoice detail display 2021-05-31 21:30:38 +09:00
2848102b79 admin invoices for mining tax 2021-05-31 21:29:19 +09:00
d3fae0711f admin invoices for mining tax 2021-05-31 21:28:40 +09:00
0f05abc0ae admin invoices for mining tax 2021-05-31 21:26:27 +09:00
e52071f1f8 admin invoices for mining tax 2021-05-31 21:25:09 +09:00
f65b7380dc admin invoices for mining tax 2021-05-31 21:24:21 +09:00
96f84d69e2 admin invoices for mining tax 2021-05-31 21:20:36 +09:00
8f23d0a1b0 admin invoices for mining tax 2021-05-31 21:19:40 +09:00
1058cf4a9a fixed invoice id controller 2021-05-31 21:16:00 +09:00
dae26c74ee import alliance moons 2021-05-31 21:00:24 +09:00
5a35b3f6a5 import alliance moons 2021-05-31 20:59:57 +09:00
79936f7030 import alliance moons 2021-05-31 20:59:10 +09:00
734b16d8a6 import alliance moons 2021-05-31 20:55:03 +09:00
e0940ac9bc import alliance moons 2021-05-31 20:54:21 +09:00
843e3806fb import alliance moons 2021-05-31 20:47:23 +09:00
13e99bd4a9 find moon ore in importalliancemoons.php 2021-05-31 20:35:31 +09:00
bce8363a53 test stuff 2021-05-31 20:12:23 +09:00
e536c55439 test invoice 2021-05-31 19:57:08 +09:00
d474c71c88 test invoice 2021-05-31 19:51:43 +09:00
0df5bc06fe pi controller 2021-05-31 19:25:08 +09:00
d221f9a49f pi controller 2021-05-31 19:21:45 +09:00
371e4af00f pi controller 2021-05-31 19:19:25 +09:00
27508e468c pi controller 2021-05-31 19:19:17 +09:00
20af2287c4 pi controller 2021-05-31 19:18:14 +09:00
5433bee74d pi controller 2021-05-31 19:17:26 +09:00
291d7bfeaa pi controller 2021-05-31 19:14:20 +09:00
1803ea1343 pi controller 2021-05-31 19:13:17 +09:00
014cdbcf75 pi controller 2021-05-31 19:12:18 +09:00
d91622b6d3 pi controller 2021-05-31 19:10:55 +09:00
2d96396687 added token expiry check in FetchAllianceAssets 2021-05-31 18:26:05 +09:00
27b16d7595 testing invoiceAmount 2021-05-31 18:12:34 +09:00
265923aa84 testing invoiceAmount 2021-05-31 18:11:32 +09:00
e8bbcfcfad testing invoiceAmount 2021-05-31 18:11:16 +09:00
9e963d581e testing invoiceAmount 2021-05-31 18:02:44 +09:00
6843f99a1f testing invoiceAmount 2021-05-31 18:01:12 +09:00
1c0f4392b2 testing invoiceAmount 2021-05-31 17:59:47 +09:00
8d3c122d93 testing invoiceAmount 2021-05-31 17:59:09 +09:00
e57ab1a0fb testing invoiceAmount 2021-05-31 17:58:02 +09:00
a0e6fc6157 testing invoiceAmount 2021-05-31 17:56:14 +09:00
d842e7bc02 fixed issue in ledger 2021-05-31 17:28:47 +09:00
a3dfb2bbe6 changed schedule for observers and ledgers 2021-05-31 17:25:44 +09:00
932911a746 testing moon worth job 2021-05-30 23:55:50 +09:00
3f3c169555 testing moon worth job 2021-05-30 22:47:39 +09:00
6b8123d650 testing moon worth job 2021-05-30 22:47:30 +09:00
ac885c5e3f testing moon worth job 2021-05-30 22:45:12 +09:00
8c44bdac05 testing moon worth job 2021-05-30 22:44:04 +09:00
bb65968afe testing moon worth job 2021-05-30 22:43:34 +09:00
44d3ea2468 testing moon worth job 2021-05-30 22:43:01 +09:00
3f76dd78cb testing moon worth job 2021-05-30 22:42:30 +09:00
9c1d94cdc0 testing moon worth job 2021-05-30 22:42:17 +09:00
e322ceb622 testing moon worth job 2021-05-30 22:38:45 +09:00
1a24d95d31 testing moon worth job 2021-05-30 22:37:16 +09:00
2e159063b5 job updates 2021-05-30 21:59:33 +09:00
1be8be97aa job updates 2021-05-30 21:57:45 +09:00
565693d911 updated jobs with new exception handler for jobs 2021-05-30 21:54:34 +09:00
87cfcf3dd2 foreign keys 2021-05-30 21:32:56 +09:00
45b1be2b9f foreign keys 2021-05-30 21:26:58 +09:00
bb85db9c3b modifying old tables for new formats' 2021-05-30 21:11:06 +09:00
f506f9275d foreign keys 2021-05-30 21:01:56 +09:00
973a8a7ebb foreign keys 2021-05-30 20:53:51 +09:00
86534dea29 migration cleanup and new foreign keys on existing migrations 2021-05-30 20:39:02 +09:00
353d8c5183 foreign keys for alliance moon rental tables 2021-05-30 20:04:24 +09:00
3b02dfb1c7 foreign keys for alliance moon rental tables 2021-05-30 20:03:28 +09:00
f78b9eddb9 foreign keys for alliance moon rental tables 2021-05-30 20:01:38 +09:00
30ea561714 import moons 2021-05-30 19:34:00 +09:00
db557162af import moons 2021-05-30 19:26:40 +09:00
76b19c6ff5 import moons 2021-05-30 19:12:30 +09:00
df5f29566d import moons 2021-05-30 19:07:30 +09:00
82d815adbb import moons 2021-05-30 19:06:58 +09:00
d54b735986 import moons 2021-05-30 19:06:28 +09:00
fbfb43040c import moons 2021-05-30 19:05:48 +09:00
b332ac8acf import moons 2021-05-30 19:05:06 +09:00
61a6836a67 import moons 2021-05-30 19:03:55 +09:00
5a6a1a19c4 import moons 2021-05-30 19:03:09 +09:00
120bb5edc9 import moons 2021-05-30 18:57:38 +09:00
d14bbc1d22 import moons 2021-05-30 18:56:40 +09:00
10c5a8c75c import moons 2021-05-30 18:55:49 +09:00
51da1dbbc3 import moons 2021-05-30 18:54:59 +09:00
89e4110ab0 removed unwanted migrations 2021-05-30 18:45:41 +09:00
c06beae86f alliance moon ores 2021-05-30 18:42:02 +09:00
bc59b580b0 alliance moon ores 2021-05-30 18:39:01 +09:00
e1ea9fe4f4 import moons 2021-05-30 18:11:18 +09:00
5acb0aa92c import moons 2021-05-30 18:10:42 +09:00
7c2952899b import moons 2021-05-30 18:09:41 +09:00
e925c6bed9 import moons 2021-05-30 18:09:20 +09:00
a715a7c022 import moons 2021-05-30 18:08:54 +09:00
b94c39923f import moons 2021-05-30 18:01:27 +09:00
ce5bd50939 import moons 2021-05-30 17:58:03 +09:00
ecbd6e1c6d import moons 2021-05-30 17:56:58 +09:00
debe3f8025 import moons 2021-05-30 17:53:17 +09:00
b1e4edad3b import moons 2021-05-30 17:50:54 +09:00
3ad6ed8bfa upgrade to laravel 8.x 2021-05-30 08:20:41 +00:00
2435 changed files with 117097 additions and 60929 deletions

View File

@@ -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());
*/
}
}

View File

@@ -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();
}
}
}
}

View File

@@ -39,7 +39,7 @@ class ExecuteMiningTaxesLedgersCommand extends Command
*/
public function handle()
{
PreFetch::dispatch()->onQueue('miningtaxes');
PreFetch::dispatch();
return 0;
}

View File

@@ -39,7 +39,7 @@ class ExecuteMiningTaxesObserversCommand extends Command
*/
public function handle()
{
FetchObservers::dispatch()->onQueue('miningtaxes');
FetchObservers::dispatch();
return 0;
}

View File

@@ -39,7 +39,7 @@ class ExecuteProcesssMiningTaxesPaymentsCommand extends Command
*/
public function handle()
{
PMTP::dispatch()->onQueue('miningtaxes');
PMTP::dispatch();
return 0;
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View 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;
}
}

View File

@@ -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

View File

@@ -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;

View File

@@ -25,7 +25,7 @@ class SupplyChainController extends Controller
*/
public function __construct() {
$this->middleware('auth');
$this->middleware('role:Renter');
$this->middleware('role:User');
}
/**

View File

@@ -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)

View File

@@ -34,7 +34,7 @@ class DashboardController extends Controller
public function __construct()
{
$this->middleware('auth');
$this->middleware('role:Guest');
$this->middleware('role:User');
}
/**

View 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() {
}
}

View File

@@ -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.');

View File

@@ -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);
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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.
*/
//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 the unique character ids from the ledgers in the previous statement
$tempMains = $tempMains->unique()->values()->all();
var_dump(auth()->user()->getAlts());
dd(auth()->user()->altCount());
//Get all of the users in the database
$users = User::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() {

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -54,6 +54,6 @@ class PurgeAllianceAssets implements ShouldQueue
{
Asset::truncate();
FetchAllianceAssets::dispatch();
FetchAllianceAssets::dispatch()->delay(Carbon::now()->addSeconds(30));
}
}

View File

@@ -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();
//Delete the user from the user table
User::where([
'character_id' => $user->character_id,
])->delete();
}
}
}

View File

@@ -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');
}

View File

@@ -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
*

View File

@@ -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'];
}
}

View File

@@ -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',
]);
}

View File

@@ -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;
}
}
}

View File

@@ -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;
}
}
}

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -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();
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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,
]);
}
}
}

View File

@@ -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;
}

View File

@@ -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;
@@ -55,8 +55,8 @@ class PurgeAllianceStructures implements ShouldQueue
{
Structure::truncate();
Service::truncate();
FetchAllianceStructures::dispatch();
FetchAllianceStructures::dispatch()->delay(Carbon::now()->addSeconds(30));
}
/**

View 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());
});
}
}

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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,34 +574,24 @@ 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($secondQuan >= 1.00) {
$secondPerc = $this->ConvertToPercentage($secondQuan);
} else {
$secondPerc = $secondQuan;
}
if($thirdQuan >= 1.00) {
$thirdPerc = $this->ConvertToPercentage($thirdQuan);
} else {
$thirdPerc = $thirdQuan;
}
if($fourthQuan >= 1.00) {
$fourthPerc = $this->ConvertToPercentage($fourthQuan);
} else {
$fourthPerc = $fourthQuan;
}
if($firstPerc >= 1.00) {
$firstPerc = $this->ConvertToPercentage($firstPerc);
}
if($secondPerc >= 1.00) {
$secondPerc = $this->ConvertToPercentage($secondPerc);
}
if($thirdPerc >= 1.00) {
$thirdPerc = $this->ConvertToPercentage($thirdPerc);
}
if($fourthPerc >= 1.00) {
$fourthPerc = $this->ConvertToPercentage($fourthPerc);
}
//Add up all the percentages
$totalPerc = $firstPerc + $secondPerc + $thirdPerc + $fourthPerc;

View 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',
];
}

View File

@@ -1,10 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class RentalInvoice extends Model
{
//
}

View File

@@ -1,10 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class RentalLedger extends Model
{
//
}

View File

@@ -1,10 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class RentalPayment extends Model
{
//
}

View File

@@ -1,10 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class RentalStructure extends Model
{
//
}

View File

@@ -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',

View File

@@ -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',
];
}

View File

@@ -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();
}
/**

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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),
];

View File

@@ -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();
});
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}
?>

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

View File

@@ -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()
{
//
}
}

View File

@@ -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
}
}

View File

@@ -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();
});
}
}

View File

@@ -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');
}
}

View File

@@ -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');
}
}

59
package-lock.json generated
View File

@@ -3822,7 +3822,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@@ -4028,15 +4029,11 @@
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -4051,14 +4048,6 @@
"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,
@@ -4197,14 +4186,6 @@
"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": {
@@ -4234,7 +4215,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -4290,6 +4272,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -4333,12 +4316,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -5780,9 +5765,9 @@
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true
},
"mississippi": {
@@ -5843,20 +5828,12 @@
}
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dev": true,
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
"minimist": "^1.2.6"
}
},
"move-concurrently": {
@@ -7219,7 +7196,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

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,9 @@
*/
define('LARAVEL_START', microtime(true));
if(file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
require __DIR__.'/../storage/framework/maintenance.php';
}
/*
|--------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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"
}

View 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

View 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

View File

@@ -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 &copy; 2014-2019 <a href="https://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved.
@hasSection('footer-left')
@yeild('footer-left')
@endif
</footer>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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 -->

View File

@@ -5,4 +5,7 @@
<!-- Bootstrap 4 -->
<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>
<script src="/bower_components/admin-lte/dist/js/adminlte.min.js"></script>
@hasSection('scripts')
@yield('scripts')
@endif

View File

@@ -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>
</li>
@endif

View File

@@ -1,9 +1,18 @@
<!-- Main Footer -->
<footer class="main-footer">
<!-- To the right -->
<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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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 -->

View File

@@ -5,4 +5,7 @@
<!-- Bootstrap 4 -->
<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>
<script src="/bower_components/admin-lte/dist/js/adminlte.min.js"></script>
@hasSection('scripts')
@yeild('scripts')
@endif

View 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

View File

@@ -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

View File

@@ -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>

View File

@@ -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>
@@ -19,4 +20,5 @@
</a>
</li>
</ul>
</li>
</li>
@endif

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,4 @@
@extends('layouts.admin.b4')
@section('content')
@endsection

View File

@@ -0,0 +1,4 @@
@extends('layouts.admin.b4')
@section('content')
@endsection

View File

@@ -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