mining tax stuff

This commit is contained in:
2021-05-09 03:57:01 +09:00
parent a83131ba5e
commit bb5df086de
4 changed files with 54 additions and 185 deletions

View File

@@ -40,6 +40,29 @@ class MiningTaxesController extends Controller
$this->middleware('role:User');
}
public function DisplayInvoice($invoice) {
$ores = array();
$totalPrice = 0.00;
$items = Ledger::where([
'character_id' => auth()->user()->getId(),
'invoice_id' => $invoice,
])->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('ore', $ores)
->with('invoice', $invoice)
->with('totalPrice', $totalPrice);
}
/**
* Display the users invoices
*/