99 lines
4.8 KiB
PHP
99 lines
4.8 KiB
PHP
<div>
|
||
@if (session()->has('message'))
|
||
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||
<div class="alert-body">
|
||
<span>{{ session('message') }}</span>
|
||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
@endif
|
||
<div class="card">
|
||
<div class="card-body">
|
||
<div class="table-responsive-md">
|
||
<table class="table table-bordered mb-0">
|
||
<thead>
|
||
<tr class="align-middle">
|
||
<th class="align-middle">Product Name</th>
|
||
<th class="align-middle">Code</th>
|
||
<th class="align-middle">Batch</th>
|
||
<th class="align-middle">
|
||
Quantity <i class="bi bi-question-circle-fill text-info" data-toggle="tooltip" data-placement="top" title="Max Quantity: {{ $maxQuantity }}"></i>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
@if($product)
|
||
<td class="align-middle">{{ $product['product_name'] }}</td>
|
||
<td class="align-middle">{{ $product['product_code'] }}</td>
|
||
<td class="align-middle">
|
||
<select wire:model.live="selectedBatchId" class="form-control">
|
||
<option value="">Select Batch</option>
|
||
@foreach($batches as $batch)
|
||
<option value="{{ $batch->id }}">
|
||
{{ $batch->batch_code ?? '-' }} | Qty: {{ $batch->qty }}
|
||
</option>
|
||
@endforeach
|
||
</select>
|
||
</td>
|
||
<td class="align-middle text-center" style="width: 200px;">
|
||
<input wire:model.live="quantity" class="form-control" type="number" min="1" max="{{ $maxQuantity }}" value="{{ $quantity }}">
|
||
</td>
|
||
@else
|
||
<td colspan="4" class="text-center">
|
||
<span class="text-danger">Please search & select a product!</span>
|
||
</td>
|
||
@endif
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="mt-3">
|
||
@if($product && $selectedBatchId)
|
||
<button wire:click="generateBarcodes({{ $selectedBatchId }}, {{ $quantity }})" type="button" class="btn btn-primary">
|
||
<i class="bi bi-upc-scan"></i> Generate Barcodes
|
||
</button>
|
||
@endif
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div wire:loading wire:target="generateBarcodes" class="w-100">
|
||
<div class="d-flex justify-content-center">
|
||
<div class="spinner-border text-primary" role="status">
|
||
<span class="sr-only">Loading...</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
@if(!empty($barcodes))
|
||
<div class="text-right mb-3">
|
||
<button wire:click="getPdf" wire:loading.attr="disabled" type="button" class="btn btn-primary">
|
||
<span wire:loading wire:target="getPdf" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||
<i wire:loading.remove wire:target="getPdf" class="bi bi-file-earmark-pdf"></i> Download PDF
|
||
</button>
|
||
</div>
|
||
<div class="card">
|
||
<div class="card-body">
|
||
<div class="row justify-content-center">
|
||
@foreach($barcodes as $barcode)
|
||
<div class="col-lg-3 col-md-4 col-sm-6" style="border: 1px solid #ffffff;border-style: dashed;background-color: #48FCFE;">
|
||
<p class="mt-3 mb-1" style="font-size: 15px;color: #000;">
|
||
{{ $product['product_name'] }}
|
||
</p>
|
||
<div>
|
||
{!! $barcode['barcode'] !!}
|
||
</div>
|
||
<p style="font-size: 15px;color: #000;">
|
||
Price:: {{ format_currency($barcode['price']) }}
|
||
</p>
|
||
</div>
|
||
@endforeach
|
||
</div>
|
||
</div>
|
||
</div>
|
||
@endif
|
||
</div>
|