@livewire('corporate-train-component', ['corporate_id' => $corporate->id ,'corporate'=>$corporate ,'component_name'=>"corporate-courses-show"])

@if (app()->getLocale()=="ar") {{ trans_choice('messages.Courses' ,3) }} {{ __('messages.corporate') }} {{$corporate->name}} @else {{ __('messages.corporate') }} {{$corporate->name}} {{ trans_choice('messages.Courses' ,3) }} @endif

{{__('messages.search')}}
status {{__('messages.Status')}}
product_id {{__('messages.Product')}} @foreach(\App\Models\Product::where('active',1)->get() as $product) {{-- @if($product->product_type->name == "Course") --}} {{-- @endif --}} @endforeach
{{--
course_level_id {{__('messages.Course Level')}} @foreach($course_levels as $courseLevel) @if ($product_id) @else @endif @endforeach
--}} {{--
{{__('messages.Branch')}} branch_id @foreach(\App\Models\Branch::all() as $branch) @endforeach
--}}
# {{__('messages.Name')}} {{-- {{__('messages.Course Level')}} --}} {{__('messages.Offer')}} {{__('messages.Order')}} {{__('messages.Payment Details')}} {{-- {{__('messages.Course Branch')}} --}} {{-- {{__('messages.Price')}} {{__('messages.Tax')}} {{__('messages.Tax Amount')}} --}} {{__('messages.Price with Tax')}} {{__('messages.Customer')}} {{__('messages.Status')}} {{__('messages.Close')}}   @forelse ($order_details as $key => $order_detail) @php $order_change_detail = App\Models\OrderChangeDetail::where("to_order_detail_id" ,$order_detail->id)->first(); $from_order_detail_id = ( $order_change_detail )? $order_change_detail->from_order_detail_id : null; $order_change_detail = App\Models\OrderChangeDetail::where("from_order_detail_id" ,$order_detail->id)->first(); $to_order_detail_id = ( $order_change_detail )? $order_change_detail->to_order_detail_id : null; $class_bg = ($from_order_detail_id) ?"bg-yellow-200" :""; if($to_order_detail_id) $class_bg = "bg-yellow-200" ; // $rows_span = ($from_order_detail_id) ? 2 : 1 ; if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->order->account_id != $order_detail->customer_id ) { $class_bg = "bg-purple-200"; }elseif ($order_detail->status =="transfered") { $class_bg = "bg-purple-200"; } @endphp @switch( $order_detail->item_type) @case("App\Models\Product") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->name}} {{-- {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} --}} {{__('messages.Offer')}} - {{__('messages.Order')}} {{$order_detail->order->id}} {{__('messages.Payment Details')}} @if ($order_detail->order->payment_status !="completed") {{__('messages.Remaining')}} ( {{$order_detail->order->total_amount_with_taxes - $order_detail->order->order_payments->sum("amount")}} {{$order_detail->order->currency->name}}) @else {{$order_detail->order->payment_status}} @endif {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} --}} {{-- {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order_detail->order->currency->name}} --}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Customer')}} @if ($order_detail->customer_id) {{ $order_detail->customer->name}} @endif {{__('messages.Status')}} @if ($order_detail->course_customers->count()>0 ) @php $od_rslt = $order_detail->course_customers() ->whereIn("confirmation" ,["Not Yet" ,"Confirmed","Not Sure"])->first(); @endphp @if ($od_rslt) {{__('messages.'.$order_detail->status)}} RS-{{$od_rslt->course_id}} ({{$od_rslt->course->start_date}}) @else {{__('messages.'.$order_detail->status)}} @endif @else {{__('messages.'.$order_detail->status)}} @endif
@if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered from customer')}} ( {{$order_detail->order->account->code}} ) @endif
  @canany(['change order_details', 'transfer to wallet order_details', 'transfer order_details' ,'refund order_details']) @if ($order_detail->status =="waiting") @endif @endcanany @can("close order_details") @if ($order_detail->status =="waiting"|| $order_detail->status =="open" ) {{__("messages.CLose Order Detail")}} {{$order_detail->id}} @endif @endcan
@break @case("App\Models\ProductOffer") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{-- {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} --}} {{__('messages.Offer')}} {{$order_detail->item->offer->name}} {{__('messages.Order')}} {{$order_detail->order->id}} {{__('messages.Payment Details')}} @if ($order_detail->order->payment_status !="completed") {{__('messages.Remaining')}} ( {{$order_detail->order->total_amount_with_taxes - $order_detail->order->order_payments->sum("amount")}} {{$order_detail->order->currency->name}}) @else {{$order_detail->order->payment_status}} @endif {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} --}} {{-- {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order_detail->order->currency->name}} --}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Customer')}} @if ($order_detail->customer_id) {{ $order_detail->customer->name}} @endif {{__('messages.Status')}} @if ($order_detail->course_customers->count()>0 ) @php $od_rslt = $order_detail->course_customers()->whereIn("confirmation" ,["Not Yet" ,"Confirmed","Not Sure"])->first(); @endphp @if ($od_rslt) {{__('messages.'.$order_detail->status)}} RS-{{$od_rslt->course_id}} ({{$od_rslt->course->start_date}}) @else {{__('messages.'.$order_detail->status)}} @endif @else {{__('messages.'.$order_detail->status)}} @endif
@if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered from customer')}} ( {{$order_detail->order->account->code}} ) @endif
  @canany(['change order_details', 'transfer to wallet order_details', 'transfer order_details' ,'refund order_details']) @if ($order_detail->status =="waiting") @endif @endcanany @can("close order_details") @if ($order_detail->status =="waiting"|| $order_detail->status =="open" ) {{__("messages.CLose Order Detail")}} {{$order_detail->id}} @endif @endcan
@break @case("App\Models\PackageProduct") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{-- {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} --}} {{__('messages.Offer')}} {{$order_detail->item->package->name}} {{__('messages.Order')}} {{$order_detail->order->id}} {{__('messages.Payment Details')}} @if ($order_detail->order->payment_status !="completed") {{__('messages.Remaining')}} ( {{$order_detail->order->total_amount_with_taxes - $order_detail->order->order_payments->sum("amount")}} {{$order_detail->order->currency->name}}) @else {{$order_detail->order->payment_status}} @endif {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} --}} {{-- {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order_detail->order->currency->name}} --}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Customer')}} @if ($order_detail->customer_id) {{ $order_detail->customer->name}} @endif {{__('messages.Status')}} @if ($order_detail->course_customers->count()>0 ) @php $od_rslt = $order_detail->course_customers()->whereIn("confirmation" ,["Not Yet" ,"Confirmed","Not Sure"])->first(); @endphp @if ($od_rslt) {{__('messages.'.$order_detail->status)}} RS-{{$od_rslt->course_id}} ({{$od_rslt->course->start_date}}) @else {{__('messages.'.$order_detail->status)}} @endif @else {{__('messages.'.$order_detail->status)}} @endif
@if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered from customer')}} ( {{$order_detail->order->account->code}} ) @endif
  @canany(['change order_details', 'transfer to wallet order_details', 'transfer order_details' ,'refund order_details']) @if ($order_detail->status =="waiting") @endif @endcanany @can("close order_details") @if ($order_detail->status =="waiting"|| $order_detail->status =="open" ) {{__("messages.CLose Order Detail")}} {{$order_detail->id}} @endif @endcan
@break @case("App\Models\ClubMembershipProduct") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{-- {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} --}} {{__('messages.Offer')}} {{$order_detail->item->club_membership->name}} {{__('messages.Order')}} {{$order_detail->order->id}} {{__('messages.Payment Details')}} @if ($order_detail->order->payment_status !="completed") {{__('messages.Remaining')}} ( {{$order_detail->order->total_amount_with_taxes - $order_detail->order->order_payments->sum("amount")}} {{$order_detail->order->currency->name}}) @else {{$order_detail->order->payment_status}} @endif {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} --}} {{-- {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order_detail->order->currency->name}} --}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Customer')}} @if ($order_detail->customer_id) {{ $order_detail->customer->name}} @endif {{__('messages.Status')}} @if ($order_detail->course_customers->count()>0 ) @php $od_rslt = $order_detail->course_customers()->whereIn("confirmation" ,["Not Yet" ,"Confirmed","Not Sure"])->first(); @endphp @if ($od_rslt) {{__('messages.'.$order_detail->status)}} RS-{{$od_rslt->course_id}} ({{$od_rslt->course->start_date}}) @else {{__('messages.'.$order_detail->status)}} @endif @else {{__('messages.'.$order_detail->status)}} @endif
@if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered from customer')}} ( {{$order_detail->order->account->code}} ) @endif
  @canany(['change order_details', 'transfer to wallet order_details', 'transfer order_details' ,'refund order_details']) @if ($order_detail->status =="waiting") @endif @endcanany @can("close order_details") @if ($order_detail->status =="waiting"|| $order_detail->status =="open" ) {{__("messages.CLose Order Detail")}} {{$order_detail->id}} @endif @endcan
@break @case("App\Models\InstallmentPackageProduct") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{-- {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} --}} {{__('messages.Offer')}} {{$order_detail->item->installment_package->name}} {{__('messages.Order')}} {{$order_detail->order->id}} {{__('messages.Payment Details')}} @if ($order_detail->order->payment_status !="completed") {{__('messages.Remaining')}} ( {{$order_detail->order->total_amount_with_taxes - $order_detail->order->order_payments->sum("amount")}} {{$order_detail->order->currency->name}}) @else {{$order_detail->order->payment_status}} @endif {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} --}} {{-- {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order_detail->order->currency->name}} --}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order_detail->order->currency->name}} {{__('messages.Customer')}} @if ($order_detail->customer_id) {{ $order_detail->customer->name}} @endif {{__('messages.Status')}} @if ($order_detail->course_customers->count()>0 ) @php $od_rslt = $order_detail->course_customers()->whereIn("confirmation" ,["Not Yet" ,"Confirmed","Not Sure"])->first(); @endphp @if ($od_rslt) {{__('messages.'.$order_detail->status)}} RS-{{$od_rslt->course_id}} ({{$od_rslt->course->start_date}}) @else {{__('messages.'.$order_detail->status)}} @endif @else {{__('messages.'.$order_detail->status)}} @endif
@if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered from customer')}} ( {{$order_detail->order->account->code}} ) @endif
  @canany(['change order_details', 'transfer to wallet order_details', 'transfer order_details' ,'refund order_details']) @if ($order_detail->status =="waiting") @endif @endcanany @can("close order_details") @if ($order_detail->status =="waiting"|| $order_detail->status =="open" ) {{__("messages.CLose Order Detail")}} {{$order_detail->id}} @endif @endcan
@break @endswitch @empty {{__('messages.Empty Result')}} @endforelse
{{--
@foreach($customer->course_customer as $course_customer)
{{ $course_customer->comment }}
{{ $course_customer->created_at }}
@endforeach
--}}
@if (count($coursesListChangeAble)>0)
@switch($active) {{-- @case("change") @can('change order_details') @livewire('order-change-component', ['customer' => $customer ,'coursesListChangeAble'=>$coursesListChangeAble], key("order-change-component")) @endcan @break --}} @case("wallet") @can('transfer to wallet order_details') @livewire('order-transfer-to-wallet-component', ['account' => $corporate , "account_type"=>"App\Models\Corporate" ,'coursesListChangeAble'=>$coursesListChangeAble], key("order-transfer-to-wallet-component")) @endcan @break {{-- @case("transfer") @can('transfer order_details')
@livewire('order-transfer-component', ['customer' => $customer ,'coursesListChangeAble'=>$coursesListChangeAble] ,key('nested-order-transfer-component'))
@endcan @break --}} @case("refund") @can('refund order_details') @livewire('refund-component', ['account' => $corporate , "account_type"=>"App\Models\Corporate",'coursesListChangeAble'=>$coursesListChangeAble], key("refund-component")) @endcan @break @endswitch
@endif