created simplified mining tax invoice
This commit is contained in:
@@ -86,10 +86,8 @@ class TestController extends Controller
|
|||||||
foreach($mains as $main) {
|
foreach($mains as $main) {
|
||||||
//Declare some variables for each run through the for loop
|
//Declare some variables for each run through the for loop
|
||||||
$ledge = array();
|
$ledge = array();
|
||||||
$ledgers = new Collection;
|
$ledgers = array();
|
||||||
$mainLedgers = new Collection;
|
|
||||||
$mainLedgerCount = 0;
|
$mainLedgerCount = 0;
|
||||||
$altLedgers = new Collection;
|
|
||||||
$alts = new Collection;
|
$alts = new Collection;
|
||||||
|
|
||||||
//Count the ledgers for the main
|
//Count the ledgers for the main
|
||||||
@@ -106,20 +104,14 @@ class TestController extends Controller
|
|||||||
|
|
||||||
//Cycle through the entries, and add them to the ledger to send with the invoice
|
//Cycle through the entries, and add them to the ledger to send with the invoice
|
||||||
foreach($mainLedgers as $row) {
|
foreach($mainLedgers as $row) {
|
||||||
$ledge = [
|
array_push($ledgers, [
|
||||||
'character_id' => $row->character_id,
|
'character_id' => $row->character_id,
|
||||||
'character_name' => $row->character_name,
|
'character_name' => $row->character_name,
|
||||||
'type_id' => $row->type_id,
|
'type_id' => $row->type_id,
|
||||||
'ore_name' => $row->ore_name,
|
'ore_name' => $row->ore_name,
|
||||||
'quantity' => $row->quantity,
|
'quantity' => $row->quantity,
|
||||||
'amount' => $row->amount,
|
'amount' => $row->amount,
|
||||||
];
|
]);
|
||||||
|
|
||||||
if($ledgers->empty()) {
|
|
||||||
$ledgers->collect($ledge);
|
|
||||||
} else {
|
|
||||||
$ledgers->push($ledge);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,18 +126,18 @@ class TestController extends Controller
|
|||||||
//Cycle through the alts, and get the ledgers, and push onto the stack
|
//Cycle through the alts, and get the ledgers, and push onto the stack
|
||||||
foreach($alts as $alt) {
|
foreach($alts as $alt) {
|
||||||
$altLedgerCount = Ledger::where([
|
$altLedgerCount = Ledger::where([
|
||||||
'character_id' => 'No',
|
'character_id' => $alt->character_id,
|
||||||
'invoiced' => 'Yes',
|
'invoiced' => 'Yes',
|
||||||
])->where('last_updated', '>', Carbon::now()->subMonths(3))->count();
|
])->where('last_updated', '>', Carbon::now()->subMonths(3))->count();
|
||||||
|
|
||||||
if($altLedgerCount > 0) {
|
if($altLedgerCount > 0) {
|
||||||
$altLedgers = Ledger::where([
|
$altLedgers = Ledger::where([
|
||||||
'character_id' => 'No',
|
'character_id' => $alt->character_id,
|
||||||
'invoiced' => 'Yes',
|
'invoiced' => 'Yes',
|
||||||
])->where('last_updated', '>', Carbon::now()->subMonths(3))->get();
|
])->where('last_updated', '>', Carbon::now()->subMonths(3))->get();
|
||||||
|
|
||||||
foreach($altLedgers as $row) {
|
foreach($altLedgers as $row) {
|
||||||
$ledgers->push([
|
array_push($ledgers, [
|
||||||
'character_id' => $row->character_id,
|
'character_id' => $row->character_id,
|
||||||
'character_name' => $row->character_name,
|
'character_name' => $row->character_name,
|
||||||
'type_id' => $row->type_id,
|
'type_id' => $row->type_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user