|
|
@ -3,7 +3,6 @@ |
|
|
@section('content') |
|
|
@section('content') |
|
|
<?php use Facades\App\Cart\CartCollection; ?>
|
|
|
<?php use Facades\App\Cart\CartCollection; ?>
|
|
|
|
|
|
|
|
|
<h3 class="page-header">drafts</h3> |
|
|
|
|
|
@if (! CartCollection::isEmpty()) |
|
|
@if (! CartCollection::isEmpty()) |
|
|
<ul class="nav nav-tabs draft-drafts-list"> |
|
|
<ul class="nav nav-tabs draft-drafts-list"> |
|
|
@foreach(CartCollection::content() as $key => $content) |
|
|
@foreach(CartCollection::content() as $key => $content) |
|
|
@ -21,27 +20,93 @@ |
|
|
</li> |
|
|
</li> |
|
|
@endforeach |
|
|
@endforeach |
|
|
</ul><!-- Tab panes --> |
|
|
</ul><!-- Tab panes --> |
|
|
<br> |
|
|
|
|
|
@endif |
|
|
@endif |
|
|
@if ($draft) |
|
|
@if ($draft) |
|
|
{{ $draft ? $draft->type : '' }} |
|
|
|
|
|
<form method="get" action="{{ route('cart.show', $draft->draftKey) }}"> |
|
|
|
|
|
<input type="text" name="query" value="{{ request('query') }}"> |
|
|
|
|
|
<input type="submit" value="{{ trans('product.search') }}" style="display:none"> |
|
|
|
|
|
</form> |
|
|
|
|
|
@if (isset($queriedProducts)) |
|
|
|
|
|
<ul> |
|
|
|
|
|
@foreach($queriedProducts as $product) |
|
|
|
|
|
<li>{{ $product->name }}</li> |
|
|
|
|
|
<li>{{ $draft->type == 'cash' ? $product->cash_price : $product->credit_price }}</li> |
|
|
|
|
|
<li> |
|
|
|
|
|
<form action="{{ route('cart.add-draft-item', [$draft->draftKey, $product->id]) }}" method="post"> |
|
|
|
|
|
<input type="number" id="qty-{{ $product->id }}" name="qty" value="1"> |
|
|
|
|
|
<input type="submit" id="add-product-{{ $product->id }}"> |
|
|
|
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<form method="get" action="{{ route('cart.show', $draft->draftKey) }}"> |
|
|
|
|
|
<label for="query">{{ trans('cart.product_search') }}</label> |
|
|
|
|
|
<input type="text" id="query" name="query" value="{{ request('query') }}"> |
|
|
|
|
|
<input type="submit" value="{{ trans('cart.product_search') }}" class="btn btn-info btn-sm"> |
|
|
|
|
|
<a href="{{ route('cart.show', $draft->draftKey) }}" class="btn btn-default btn-sm">Refresh</a> |
|
|
</form> |
|
|
</form> |
|
|
</li> |
|
|
|
|
|
@endforeach |
|
|
|
|
|
</ul> |
|
|
|
|
|
@endif |
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
@if ($queriedProducts) |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<table class="table table-condensed"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<th>Produk</th> |
|
|
|
|
|
<th>Harga Satuan ({{ $draft->type }})</th> |
|
|
|
|
|
<th>Action</th> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<tbody> |
|
|
|
|
|
@forelse($queriedProducts as $product) |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>{{ $product->name }}</td> |
|
|
|
|
|
<td>{{ $draft->type == 'cash' ? $product->cash_price : $product->credit_price }}</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<form action="{{ route('cart.add-draft-item', [$draft->draftKey, $product->id]) }}" method="post" style="display:inline"> |
|
|
|
|
|
{{ csrf_field() }} |
|
|
|
|
|
<input type="number" id="qty-{{ $product->id }}" style="width:50px" name="qty" value="1"> |
|
|
|
|
|
<input type="submit" id="add-product-{{ $product->id }}" value="Tambah"> |
|
|
|
|
|
</form> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
@empty |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td colspan="3"> |
|
|
|
|
|
Produk tidak ditemukan dengan keyword : <strong><em>{{ request('query') }}</em></strong> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
@endforelse |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
|
|
|
</div> |
|
|
|
|
|
@endif |
|
|
|
|
|
</div> |
|
|
|
|
|
<table class="table"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<th>#</th>
|
|
|
|
|
|
<th>Nama Item</th> |
|
|
|
|
|
<th>Harga Satuan</th> |
|
|
|
|
|
<th>Qty</th> |
|
|
|
|
|
<th>Diskon</th> |
|
|
|
|
|
<th>Subtotal</th> |
|
|
|
|
|
<th>Action</th> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
@forelse($draft->items() as $key => $item) |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>{{ $key + 1 }}</td> |
|
|
|
|
|
<td>{{ $item->name }}</td> |
|
|
|
|
|
<td>{{ formatRp($item->price) }}</td> |
|
|
|
|
|
<td>{{ $item->qty }}</td> |
|
|
|
|
|
<td>{{ $item->item_discount }}</td> |
|
|
|
|
|
{{-- |
|
|
|
|
|
<form action="{{ route('cart.update-draft-item', $draft->draftKey) }}" method="post"> |
|
|
|
|
|
{{ csrf_field() }} {{ method_field('patch') }} |
|
|
|
|
|
<td><input type="number" style="width:50px" id="qty-{{ $key }}" name="qty" value="{{ $item->qty }}"></td> |
|
|
|
|
|
<td><input type="text" id="item_discount-{{ $key }}" name="item_discount" value="{{ $item->item_discount }}"></td> |
|
|
|
|
|
</form> |
|
|
|
|
|
--}} |
|
|
|
|
|
<td>{{ formatRp($item->subtotal) }}</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<form |
|
|
|
|
|
action="{{ route('cart.remove-draft-item', $draft->draftKey) }}" |
|
|
|
|
|
method="post" |
|
|
|
|
|
onsubmit="return confirm('Yakin ingin menghapus Item ini?')" |
|
|
|
|
|
> |
|
|
|
|
|
{{ csrf_field() }} {{ method_field('delete') }} |
|
|
|
|
|
<input type="hidden" name="item_index" value="{{ $key }}"> |
|
|
|
|
|
<input type="submit" id="remove-item-{{ $key }}" value="x"> |
|
|
|
|
|
</form> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
@empty |
|
|
|
|
|
@endforelse |
|
|
|
|
|
</table> |
|
|
@endif |
|
|
@endif |
|
|
@endsection |
|
|
@endsection |