admin invoices for mining tax

This commit is contained in:
2021-05-31 21:19:40 +09:00
parent 1058cf4a9a
commit 8f23d0a1b0
4 changed files with 35 additions and 2 deletions

View File

@@ -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
*/

View File

@@ -45,7 +45,7 @@ class MiningTaxesController extends Controller
*
* @var $invoiceId
*/
public function DisplayInvoice($invoiceId) {
public function displayInvoice($invoiceId) {
$ores = array();
$totalPrice = 0.00;