@extends("admin.layouts.app") @section("styles") @endsection @section("content")
{!! Form::open(['route'=>"admin.orders.index",'method'=>"get"]) !!} {!! Form::close() !!}
Order Number Customer Name Customer Mobile From To Customer Address Status
{{Form::text("id",Request::get("id",null),['class'=>"form-control form-filter input-sm"])}} {{Form::text("name",Request::get("name",null),['class'=>"form-control form-filter input-sm"])}} {{Form::text("mobile",Request::get("mobile",null),['class'=>"form-control form-filter input-sm"])}} {{Form::date("from",Request::get("from",null),['class'=>"form-control form-filter input-sm"])}} {{Form::date("to",Request::get("to",null),['class'=>"form-control form-filter input-sm"])}} {{Form::select("status[]",$statuses->pluck("title","id")->toArray(),Request::get("status",null),['class'=>"form-control status-id form-filter input-sm",'multiple'=>true])}}
Reset
Customers Orders
@forelse($orders as $order) @empty @endforelse
Track ID Customer Name #Items Total Details Creation Date Status Action
{{$order->track_id}}
@include('admin.orders.select_payment_method') @php $payment = \App\Models\OrderPayment::where("order_id",$order->id)->whereIn("status",["COMPLETED", "Approved"])->first(); @endphp @if($payment && ($order->status->code != "refund" && $order->status->code != "refund-paypal" ))
Paid @endif @if($order->status->code == "refund" || $order->status->code == "refund-paypal" ) Refund @endif @php $show_alert = false; $ordered_items = []; $ordered_accessories = []; $items = $order->order_items()->get(); foreach($items as $item){ if($item->item_color){ if(array_key_exists($item->item_color->id,$ordered_items)){ $ordered_items[$item->item_color->id] = 1 + $ordered_items[$item->item_color->id]; }else{ $ordered_items[$item->item_color->id] = 1; } } if($item->accessory){ if(array_key_exists($item->accessory->id,$ordered_accessories)){ $ordered_accessories[$item->accessory->id] = 1 + $ordered_accessories[$item->accessory->id]; }else{ $ordered_accessories[$item->accessory->id] = 1; } } } foreach($ordered_items as $key=>$value){ $item_color = \App\Models\ItemColor::where("id",$key)->first(); if($item_color && $value >= $item_color->quantity){ $show_alert = true; } } foreach($ordered_accessories as $akey=>$avalue){ $accessory = \App\Models\Accessory::where("id",$akey)->first(); if($accessory && $avalue >= $accessory->quantity){ $show_alert = true; } } @endphp @if($show_alert) Check Stock
@endif @if($order->order_items()->whereNotNull('laser_engraving')->count()) @endif @if($order->order_items()->whereNotNull('gift_wrapping')->count()) order_items()->where('gift_wrapping',"!=","بدون رسالة")->count()) style="color:#4cba36" @endif class="fa fa-gift"> @endif @if($order->customer->notes)
{{$order->customer->notes}}
@endif
@if($order->properties['is_buy_direct']??false) شراء مباشرة
@endif $order->customer->mobile])}}">{{$order->customer->full_name}} @if(!$order->customer()->new()->first()) New @endif @if(!$order->customer->password) Guest @endif
{{$order->customer->mobile}} @if(($orderMobile = $order->properties['mobile']??false) && $orderMobile!=$order->customer->mobile)
Order Mobile:
{{ $orderMobile }}
@endif
{{$order->with_delivery ? ($order->customer_address ? $order->customer_address->customer_address_details :"No Address") : "Pickup from {$order->warehouse->nickname}"}}
{{$order->order_items->count()}} @php $keys = [ 'Before Discount Total' => 'total_before', 'After Discount Total' => 'total_after', 'adjustment_reason' => 'adjustment', 'Gateway Commission' => 'gateway_commission', 'Delivery' => 'delivery' ]; $totalDetails = []; foreach ($keys as $label => $key) { if (! $order->$key) { continue; } if( $order->$label) { $label = $order->$label; } $totalDetails[$label] = $order->$key . ' ₪'; } @endphp @forelse($totalDetails as $label => $totalDetail) @empty - @endforelse @if($order->customer_redeem) @endif @if($order->coupon_id) @endif @if($order->bundle_description) @endif
{{ $label }} : @if($label == 'Before Discount Total') {{ $totalDetail }} @else {{ $totalDetail }} @endif
Points Used: {{number_format($order->customer_redeem->amount)}}₪
Coupon Used: {{$order->coupon_description}}
Bundle Used: {{$order->bundle_discount}}
Total: {{number_format($order->total)}} ₪
{{$order->created_at}} status) style="background-color:{{$order->status->color}}" @endif> @if($order->order_shipment) {{ucfirst($order->order_shipment->provider)}}
{{$order->order_shipment->track_id}} @endif
id)}}" class="btn btn-outline btn-sm blue" title="Details"> Details
{!! $orders->appends(request()->all())->links()!!}
Non-Customers Orders
@forelse($stock_notifications as $stock_notification) @if($stock_notification->item && !$stock_notification->item_id && !$stock_notification->accessory_id) @endif @if($stock_notification->item_id) @endif @if($stock_notification->accessory) @endif @empty @endforelse
Order ID Customer Name Image Item Price Creation Date Status Action
{{$stock_notification->id}} @if($stock_notification->item_id && optional($stock_notification->item_color)->quantity <= 1) Check Stock @elseif($stock_notification->accessory_color && $stock_notification->accessory_color->quantity <= 1) Check Stock @elseif($stock_notification->accessory && $stock_notification->accessory->quantity <=1) Check Stock @endif $stock_notification->mobile])}}">{{$stock_notification->name}}
{{$stock_notification->mobile}}
{{$stock_notification->address}}
- {{$stock_notification->item}} - @if($stock_notification->item_color) item_color->image_default}")}}" alt="" width="100px"> @else Item Color is missing or deleted @endif @if($stock_notification->item_color) {{$stock_notification->item()->first()->nickname}} - {{$stock_notification->item_color->color->name}}

{{$stock_notification->item_color->code}}

@else Item Color is missing or deleted @endif
@if($stock_notification->price) ₪ {{ $stock_notification->price }} @else @php $item_details = $stock_notification->item()->first()->updateDiscount($stock_notification->item()->first(), $stock_notification->item()->first()->category); @endphp @if($item_details->discountState || $item_details->discountPercentage) ₪{{ number_format($item_details->price) }} ₪{{ number_format($item_details->totalPrice) }} @else ₪{{ number_format($item_details->price) }} @endif @endif @if($stock_notification->accessory_color && $defaultImage = $stock_notification->accessory_color->image_default) Image @else Imageaccessory->accessory_images()->where("is_base",1)->first() ? $stock_notification->accessory->accessory_images()->where("is_base",1)->first()->name : 'images/default.jpg')) }}"> @endif {{$stock_notification->accessory->name}} @if($stock_notification->accessory_color) - {{ $stock_notification->accessory_color->color->name }}

{{$stock_notification->accessory_color->code}}

@else

{{$stock_notification->accessory->code}}

@endif
@if($stock_notification->accessory->is_sale) ₪{{ number_format($stock_notification->accessory->price) }} ₪{{ number_format($stock_notification->accessory->discount) }} @else ₪{{ number_format($stock_notification->accessory->price) }} @endif {{$stock_notification->created_at}} status) style="background-color:{{$stock_notification->status->color}}" @endif>
@if($stock_notification->item_id) item_id)}}" class="btn btn-info"> @elseif($stock_notification->accessory_id) accessory_id)}}" class="btn btn-info"> @elseif($stock_notification->used_item_id) used_item_id)}}" class="btn btn-info"> @endif is_notified) disabled @endif href="{{route("admin.stock-notifications.show",$stock_notification->id)}}" class="btn btn-info" onclick="return confirm('Are you sure?')"> @if($stock_notification->notes) @endif
{!! $stock_notifications->appends(request()->all())->links()!!}
@endsection @section("scripts") @include('admin.orders.update_status_payment_method') @endsection