setup SeatHelper class

This commit is contained in:
2018-11-21 01:03:03 -06:00
parent 5bc01d1a90
commit ccdfa1ab89
2 changed files with 33 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ class Finances {
$monthWanted = $month;
$untaxed = 0.00;
//Get the journal entries from the database
$entries = DB::table('CorpJournals')->where(['corporation_id' => $corpId, 'created_at' => $monthWanted, 'ref_type' => 127])->get();
$entries = DB::table('CorpJournals')->where(['corporation_id' => $corpId, 'created_at' => $monthWanted, 'ref_type' => 'reprocessing_tax'])->get();
foreach($entries as $entry) {
$untaxed += $entry->tax;
}
@@ -50,7 +50,7 @@ class Finances {
$monthWanted = $month;
$untaxed = 0.00;
//Get the journal entries from the database
$entries = DB::table('CorpJournals')->where(['corporation_id' => $corpId, 'created_at' => $monthWanted, 'ref_type' => 46])->get();
$entries = DB::table('CorpJournals')->where(['corporation_id' => $corpId, 'created_at' => $monthWanted, 'ref_type' => 'brokers_fee'])->get();
foreach($entries as $entry) {
$untaxed += $entry->tax;
}
@@ -100,7 +100,7 @@ class Finances {
$journals = json_decode($journal->raw, true);
//For each journal array, attempt to store in the database
foreach($journals as $entry) {
if($entry['ref_type'] == 46 || $entry['ref_type'] == 127) {
if($entry['ref_type'] == 'brokers_fee' || $entry['ref_type'] == 'reprocessing_tax') {
$this->PutWalletJournal($entry, $corpId, $divison);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Library;
use DB;
use App\Models\CorpJournal;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
use GuzzleHttp\RequestOptions;
class SeatHelper {
public function GetCorpJournal($corporationId) {
//Setup the guzzle client
$guzzle = new GuzzleHttp\Client([
'headers' => [
'X-Token' => 'tTa59bxP4VzBAfZ3s1JJ2BkEj8mFixD0',
],
]);
$data = $guzzle->request('GET', 'https://seat.warpedintentions.com/api/v2/corporation/wallet-journal/{corporation_id}', [
'corporation_id' => $corporationId,
]);
dd($data);
}
}
?>