admin invoices for mining tax
This commit is contained in:
@@ -54,6 +54,38 @@ class MiningTaxesAdminController extends Controller
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display an invoice based on it's id
|
||||
*
|
||||
* @var $invoiceId
|
||||
*/
|
||||
public function displayInvoice($invoiceId) {
|
||||
$ores = array();
|
||||
$totalPrice = 0.00;
|
||||
|
||||
$invoice = Invoice::where([
|
||||
'invoice_id' => $invoiceId,
|
||||
])->first();
|
||||
|
||||
$items = Ledger::where([
|
||||
'character_id' => auth()->user()->getId(),
|
||||
'invoice_id' => $invoiceId,
|
||||
])->get();
|
||||
|
||||
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'];
|
||||
}
|
||||
|
||||
return view('miningtax.user.display.details.invoice')->with('ores', $ores)
|
||||
->with('invoice', $invoice)
|
||||
->with('totalPrice', $totalPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display current unpaid invoices
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ class MiningTaxesController extends Controller
|
||||
*
|
||||
* @var $invoiceId
|
||||
*/
|
||||
public function DisplayInvoice($invoiceId) {
|
||||
public function displayInvoice($invoiceId) {
|
||||
$ores = array();
|
||||
$totalPrice = 0.00;
|
||||
|
||||
|
||||
@@ -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/invoices/{{ $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>
|
||||
|
||||
@@ -85,6 +85,7 @@ Route::group(['middleware' => ['auth']], function(){
|
||||
* Mining Moon Tax display pages
|
||||
*/
|
||||
Route::get('/miningtax/display/detail/invoice/{invoice}', 'MiningTaxes\MiningTaxesController@displayInvoice');
|
||||
Route::get('/miningtax/admin/display/detail/invoice/{invoice}', 'MiningTaxes\MiningTaxesAdminController@displayInvoice');
|
||||
Route::get('/miningtax/display/invoices', 'MiningTaxes\MiningTaxesController@DisplayInvoices');
|
||||
Route::get('/miningtax/display/extractions', 'MiningTaxes\MiningTaxesController@DisplayUpcomingExtractions');
|
||||
Route::get('/miningtax/display/ledgers', 'MiningTaxes\MiningTaxesController@DisplayMoonLedgers');
|
||||
|
||||
Reference in New Issue
Block a user