process mining taxes ledgers update to disregard updating previously saved ledgers to prevent future errors
This commit is contained in:
@@ -92,20 +92,7 @@ class ProcessMiningTaxesLedgers implements ShouldQueue
|
||||
'last_updated' => $this->ledger->last_updated,
|
||||
])->count();
|
||||
|
||||
if($found > 0) {
|
||||
Ledger::where([
|
||||
'character_id' => $this->ledger->character_id,
|
||||
'character_name' => $charName,
|
||||
'observer_id' => $this->observerId,
|
||||
'type_id' => $this->ledger->type_id,
|
||||
'quantity' => $this->ledger->quantity,
|
||||
'last_updated' => $this->ledger->last_updated,
|
||||
])->update([
|
||||
'last_updated' => $this->ledger->last_updated,
|
||||
'quantity' => $this->ledger->quantity,
|
||||
'amount' => $amount,
|
||||
]);
|
||||
} else {
|
||||
if($found == 0) {
|
||||
$ledg = new Ledger;
|
||||
$ledg->character_id = $this->ledger->character_id;
|
||||
$ledg->character_name = $charName;
|
||||
|
||||
@@ -14,8 +14,9 @@ use App\Library\Helpers\LookupHelper;
|
||||
//Models
|
||||
use App\Models\MiningTax\Invoice;
|
||||
use App\Models\MiningTax\Ledger;
|
||||
use App\Models\User\User;
|
||||
use App\Models\User\UserAlt;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\Eve\SendEveMail;
|
||||
|
||||
class MiningTaxHelper {
|
||||
/**
|
||||
@@ -30,12 +31,12 @@ class MiningTaxHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the main character ledgers and send back as a collection
|
||||
* Get the ledgers for a certain character and send back as a collection
|
||||
*
|
||||
* @var $charId
|
||||
* @return collection $ledgers
|
||||
*/
|
||||
public function GetMainLedgers($charId) {
|
||||
public function GetLedgers(int $charId) {
|
||||
$ledgers = new Collection;
|
||||
|
||||
$rowCount = Ledger::where([
|
||||
@@ -43,12 +44,12 @@ class MiningTaxHelper {
|
||||
'invoiced' => 'No',
|
||||
])->count();
|
||||
|
||||
if($rowCount > 0) {
|
||||
$rows = Ledger::where([
|
||||
'character_id' => $charId,
|
||||
'invoiced' => 'No',
|
||||
])->get()->toArry();
|
||||
])->get()->toArray();
|
||||
|
||||
if($rowCount > 0) {
|
||||
foreach($rows as $row) {
|
||||
$ledgers->push($row);
|
||||
}
|
||||
@@ -58,16 +59,14 @@ class MiningTaxHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the alt characters ledgers and send back as a collection
|
||||
* Create the invoice and mail it
|
||||
*
|
||||
* @var int $charId
|
||||
* @var collection $ledgers
|
||||
* @var int $mailDelay
|
||||
*
|
||||
* @var array $alts
|
||||
* @return collection ledgers
|
||||
*/
|
||||
public function GetAltLedgers($alts) {
|
||||
$ledgers = new Collection;
|
||||
|
||||
public function MailMiningInvoice(int $charId, collection $ledgers, int &$mailDelay) {
|
||||
|
||||
}
|
||||
|
||||
public function
|
||||
}
|
||||
Reference in New Issue
Block a user