Files
kulakpos_web/Modules/Business/resources/views/purchases/cart-list.blade.php

70 lines
4.1 KiB
PHP
Raw Normal View History

2026-03-15 17:08:23 +07:00
@foreach($cart_contents as $cart)
@php
$modules = product_setting()->modules ?? [];
@endphp
2026-05-14 11:55:22 +07:00
<tr
data-row_id="{{ $cart->rowId }}"
data-product_id="{{ $cart->id }}"
data-has_serial="{{ $cart->options->has_serial ?? 0 }}"
data-serials='@json($cart->options->serial_numbers ?? [])'
data-update_route="{{ route('business.carts.update', $cart->rowId) }}"
data-destroy_route="{{ route('business.carts.destroy', $cart->rowId) }}">
<td class='text-start'>
2026-03-15 17:08:23 +07:00
<img class="table-img" src="{{ asset($cart->options->product_image ?? 'assets/images/products/box.svg') }}">
</td>
<td class='text-start'>{{ $cart->name }}</td>
<td class='text-start'>{{ $cart->options->product_code }}</td>
<td class='text-start'>{{ $cart->options->product_unit_name }}</td>
@if (is_module_enabled($modules, 'show_product_batch_no'))
<td>
<input type="text" name="batch_no" class="batch_no sales-input" value="{{ $cart->options->batch_no ?? '' }}">
</td>
@endif
@if (is_module_enabled($modules, 'show_product_expire_date'))
<td>
@if (isset($modules['expire_date_type']) && ($modules['expire_date_type'] == 'dmy' || is_null($modules['expire_date_type'])))
<input type="month" name="expire_date" value="{{ date('Y-m', strtotime($cart->options->expire_date ?? '')) }}" class="form-control expire_date">
2026-05-14 11:55:22 +07:00
@else
<input type="date" name="expire_date" value="{{ date('Y-m-d', strtotime($cart->options->expire_date ?? '')) }}" class="form-control expire_date">
2026-03-15 17:08:23 +07:00
@endif
</td>
@endif
@usercan('purchases.price')
<td class='text-center'>
<input type="number" step="any" value="{{ $cart->price }}" class="custom-number-input price" placeholder="{{ __('0') }}">
</td>
@endusercan
2026-05-14 11:55:22 +07:00
@if (moduleCheck('SerialCodeAddon'))
<td class="serial-cell serial-option">
<button type="button" class="serial-cell-button" @if(($cart->options->has_serial ?? 0) != 1) disabled @endif data-bs-toggle="modal" data-bs-target="#serialModal">
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 7H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
<path d="M23 7H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M23 14H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M23 21H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4 14H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
<path d="M4 21H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
</svg>
</button>
</td>
@endif
2026-03-15 17:08:23 +07:00
<td class='text-start'>
<div class="d-flex align-items-center justify-content-center gap-2">
2026-05-14 11:55:22 +07:00
<button class="incre-decre minus-btn" @if(($cart->options->has_serial ?? 0) == 1) disabled @endif>
2026-03-15 17:08:23 +07:00
<i class="fas fa-minus icon"></i>
</button>
2026-05-14 11:55:22 +07:00
<input type="number" step="any" value="{{ $cart->qty }}" class="dynamic-width cart-qty" @if(($cart->options->has_serial ?? 0) == 1) disabled readonly @endif>
<button class="incre-decre plus-btn" @if(($cart->options->has_serial ?? 0) == 1) disabled @endif>
2026-03-15 17:08:23 +07:00
<i class="fas fa-plus icon"></i>
</button>
</div>
</td>
<td class="cart-subtotal">{{ currency_format($cart->subtotal, currency: business_currency()) }}</td>
<td>
<button class='x-btn remove-btn'>
<img src="{{ asset('assets/images/icons/x.svg') }}" alt="">
</button>
</td>
</tr>
@endforeach