From 4bd57ccd0b2d0db9474e612ed64476d70b88aefa Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Mon, 24 May 2021 21:28:54 +0900 Subject: [PATCH] tests --- app/Http/Controllers/Test/TestController.php | 52 -------------------- 1 file changed, 52 deletions(-) diff --git a/app/Http/Controllers/Test/TestController.php b/app/Http/Controllers/Test/TestController.php index 1c2590af6..54b92a443 100644 --- a/app/Http/Controllers/Test/TestController.php +++ b/app/Http/Controllers/Test/TestController.php @@ -150,56 +150,4 @@ class TestController extends Controller return view('test.miningtax.observers')->with('ledgers', $ledgers); } - - public function DebugMiningTaxes($invoiceId) { - $invoice = array(); - $ores = array(); - $totalPrice = 0.00; - $body = null; - $lookup = new LookupHelper; - $config = config('esi'); - - //Set the due date of the invoice - $dateDue = Carbon::now()->addDays(7); - $invoiceDate = Carbon::now(); - //Format the mining tax into a human readable number - $numberMiningTax = number_format(($config['mining_tax'] * 100.00), 2, ".", ","); - //Generate a unique invoice id - $invoiceId = "M" . uniqid(); - - $rows = Ledger::where([ - 'invoice_id' => $invoiceId, - ])->get()->toArray(); - - //Taly up the item composition from each row and multiply by the quantity - if(sizeof($rows) > 0) { - foreach($rows as $row) { - if(!isset($ores[$row['type_id']])) { - $ores[$row['type_id']] = 0; - } - $ores[$row['type_id']] = $ores[$row['type_id']] + $row['quantity']; - - //Add up the total price from the ledger rows for the report later - $totalPrice = $totalPrice + $row['amount']; - } - - //Reduce the total price by the take percentage - $invoiceAmount = $totalPrice * $config['mining_tax']; - $invoiceAmount = round($invoiceAmount, 2); - - //Get the character name from the character id - $charName = $lookup->CharacterIdToName($charId); - - } - - return view('test.miningtax.display')->with('rows', $rows) - ->with('ores', $ores) - ->with('totalPrice', $totalPrice) - ->with('invoiceAmount', $invoiceAmount) - ->with('charName', $charName) - ->with('invoiceId', $invoiceId) - ->with('dateDue' $dateDue) - ->with('invoiceDate', $invoiceDate) - ->with('numberMiningTax', $numberMiningTax); - } }