@extends('layouts.admin') @section('page-title') {{__('Manage Product & Services')}} @endsection @push('script-page') @endpush @section('breadcrumb') @endsection @section('action-btn')
@endsection @section('content')
{{ Form::open(['route' => ['productservice.index'], 'method' => 'GET', 'id' => 'product_service']) }}
{{ Form::label('category', __('Category'),['class'=>'form-label']) }} {{ Form::select('category', $category, isset($_GET['category']) ? $_GET['category'] : null, ['class' => 'form-control select','id'=>'choices-multiple', 'required' => 'required']) }}
{{ Form::close() }}
@foreach ($productServices as $productService) @if($productService->type == 'product') @else @endif @if(Gate::check('edit product & service') || Gate::check('delete product & service')) @endif @endforeach
{{__('Name')}} {{__('Sku')}} {{__('Sale Price')}} {{__('Purchase Price')}} {{__('Tax')}} {{__('Category')}} {{__('Unit')}} {{__('Quantity')}} {{__('Type')}} {{__('Action')}}
{{ $productService->name}} {{ $productService->sku }} {{ \Auth::user()->priceFormat($productService->sale_price) }} {{ \Auth::user()->priceFormat($productService->purchase_price )}} @if (!empty($productService->tax_id)) @php $itemTaxes = []; $getTaxData = Utility::getTaxData(); foreach (explode(',', $productService->tax_id) as $tax) { if (isset($getTaxData[$tax])) { $itemTax['name'] = $getTaxData[$tax]['name']; $itemTax['rate'] = $getTaxData[$tax]['rate'] . '%'; $itemTaxes[] = $itemTax; } else { $itemTax['name'] = 'Unknown Tax'; $itemTax['rate'] = '0%'; $itemTaxes[] = $itemTax; } } $productService->itemTax = $itemTaxes; @endphp @foreach ($productService->itemTax as $tax) {{ $tax['name'] . ' (' . $tax['rate'] . ')' }}
@endforeach @else - @endif
{{ !empty($productService->category)?$productService->category->name:'' }} {{ !empty($productService->unit)?$productService->unit->name:'' }}{{$productService->quantity}}-{{ucwords($productService->type)}} @can('edit product & service') @endcan @can('delete product & service')
{!! Form::open(['method' => 'DELETE', 'route' => ['productservice.destroy', $productService->id],'id'=>'delete-form-'.$productService->id]) !!} {!! Form::close() !!}
@endcan
@endsection