invoice changes
This commit is contained in:
@@ -151,16 +151,22 @@ class MiningTaxesAdminController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function displayInvoice($invoiceId) {
|
public function displayInvoice($invoiceId) {
|
||||||
$ores = array();
|
$ores = array();
|
||||||
|
$moons = array();
|
||||||
$totalPrice = 0.00;
|
$totalPrice = 0.00;
|
||||||
|
$structure = new StructureHelper;
|
||||||
|
$config = config('esi');
|
||||||
|
|
||||||
|
//Get the invoice from the database
|
||||||
$invoice = Invoice::where([
|
$invoice = Invoice::where([
|
||||||
'invoice_id' => $invoiceId,
|
'invoice_id' => $invoiceId,
|
||||||
])->first();
|
])->first();
|
||||||
|
|
||||||
|
//Get the line items for the ledger for the invoice
|
||||||
$items = Ledger::where([
|
$items = Ledger::where([
|
||||||
'invoice_id' => $invoiceId,
|
'invoice_id' => $invoiceId,
|
||||||
])->get();
|
])->get();
|
||||||
|
|
||||||
|
//Build the total ores table for the display page
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
if(!isset($ores[$item['ore_name']])) {
|
if(!isset($ores[$item['ore_name']])) {
|
||||||
$ores[$item['ore_name']] = 0;
|
$ores[$item['ore_name']] = 0;
|
||||||
@@ -170,7 +176,25 @@ class MiningTaxesAdminController extends Controller
|
|||||||
$totalPrice += $item['amount'];
|
$totalPrice += $item['amount'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Print out the lines of the ledger line by line for another table
|
||||||
|
foreach($items as $item) {
|
||||||
|
//Get the structure info from the database or esi
|
||||||
|
$tempObserverInfo = $structure->GetStructureInfo($item['observer_id']);
|
||||||
|
|
||||||
|
//Create the array for the line by line
|
||||||
|
array_push($moons, [
|
||||||
|
'character_name' => $item['character_name'],
|
||||||
|
'observer_name' => $tempObserverInfo->name,
|
||||||
|
'type_id' => $item['type_id'],
|
||||||
|
'ore_name' => $item['ore_name'],
|
||||||
|
'quantity' => $item['quantity'],
|
||||||
|
'amount' => $item['amount'],
|
||||||
|
'tax_amount' => $item['amount'] * $config['public_mining_tax'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
return view('miningtax.admin.display.details.invoice')->with('ores', $ores)
|
return view('miningtax.admin.display.details.invoice')->with('ores', $ores)
|
||||||
|
->with('moons', $moons)
|
||||||
->with('invoice', $invoice)
|
->with('invoice', $invoice)
|
||||||
->with('totalPrice', $totalPrice);
|
->with('totalPrice', $totalPrice);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,5 +28,35 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<br>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2>Ledger Details</h2>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<th>Character Name</th>
|
||||||
|
<th>Observer Name</th>
|
||||||
|
<th>Ore Name</th>
|
||||||
|
<th>Quantity</th>
|
||||||
|
<th>Price</th>
|
||||||
|
<th>Tax Amount</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($moons as $moon)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $moon['character_name'] }}</td>
|
||||||
|
<td>{{ $moon['observer_name'] }}</td>
|
||||||
|
<td>{{ $moon['ore_name'] }}</td>
|
||||||
|
<td>{{ $moon['quantity'] }}</td>
|
||||||
|
<td>{{ $moon['amount'] </td>
|
||||||
|
<td>{{ $moon['tax_amount'] }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
Reference in New Issue
Block a user