@if ($order->account_type =="App\Models\Customer") @can('show customer train') @livewire('customer-train-component', ['customer_id' => $order->account_id ,'customer'=>$order->account ,'component_name'=>"order"]) @endcan @else @can('show corporate train') @livewire('corporate-train-component', ['corporate_id' => $order->account_id ,'corporate'=>$order->account ,'component_name'=>"order"]) @endcan @endif

{{__('messages.Order')}} {{ $order->account->name}} {{($order->account->code)?"(".$order->account->code.")":""}}

@if ($order->customer_pledge)

{{__('messages.Customer Pledge')}}

@endif
@if ($order->order_payments->first() && $order->order_payments->first()->receipt_serial_no)
{{__("messages.download contract")}}
@else
@endif
@can('delete orders') {{__("messages.Delete contract")}} delete_order() {{__("messages.Delete contract")}} @endcan @can('delete targets') @if ($order->targets->count()>0) {{__("messages.Delete Targets")}} delete_target() {{__("messages.Delete Targets")}} @endif @endcan
@if ($order->tax_free) @else @endif
{{--
--}}
@if ($order->tax_free) @php $remaining_amount = number_format((float) ( ($order->total_amount_with_taxes - $order->taxes_amount ) - $order->order_payments->sum('amount') ), 2) @endphp @else @php $remaining_amount = number_format((float) ( ($order->total_amount_with_taxes ) - $order->order_payments->sum('amount') ), 2) @endphp @endif
@if ($remaining_amount<=0) @else @endif
@if ($remaining_amount<=0) @else @endif
@can("add club_membership order_details") @php $club_member_detail =$order->order_details()->where("item_type" ,'App\Models\ClubMembership') ->whereIn("status" ,["waiting" ,"open"]) ->where("active" ,1)->where(function($q){ $q->where("remaining_hours" ,">",0); $q->orWhere("remaining_amount" ,">",0); }) ->where(function($q){ $q->whereDate("opend_to_date" ,">",now()); $q->orWhereNull("opend_to_date" ); }) ->first(); // dd( $club_member_details); @endphp @if ( $club_member_detail) @livewire('add-order-details-club-component', ['club_member_detail' => $club_member_detail]) @endif @endcan
# {{__('messages.Name')}} {{__('messages.Offer')}} {{-- {{__('messages.Course Level')}} --}} {{__('messages.type')}} {{-- {{__('messages.Preferred Period')}} --}} {{__('messages.Price')}} {{__('messages.Tax')}} {{__('messages.Tax Amount')}} {{__('messages.Price with Tax')}} {{__('messages.Status')}}   @forelse ($order->order_details()->whereNotIn("status" ,["changed" ,"transfered" ])->get() 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; $class_bg = ($from_order_detail_id) ?"bg-yellow-200" :""; $rows_span = ($from_order_detail_id) ? 2 : 1 ; if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) { $class_bg = "bg-purple-200"; $rows_span = 2 ; }elseif ($order_detail->customer_id && $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}} {{($order_detail->comment ) ? "(". $order_detail->comment .")" : "" }} {{__('messages.Offer')}} - {{__('messages.type')}}
{{$order_detail->type}} @can("edit order_details type") {{-- {{$order_detail->id}} --}} Set Order Detail Type m-0 update_order_details_type() edit_type({{$order_detail->id}})
{{__('messages.type')}} selected_type @can('create repeat order_details') @endcan
@endcan
{{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Price with Tax')}}
{{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} @can("edit order delivery") {{-- {{$order_detail->id}} --}} edit price with tax m-0 update_order_detail_price() edit({{$order_detail->id}})
@endcan
{{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id == null) @can("add customer to corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @elseif($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id ) @can("edit customer corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @endif @can("edit order_details") {{-- {{$order_detail->id}} --}} Set Order Detail m-0 update_product() edit({{$order_detail->id}})
{{__('messages.Main Category')}} selected_main_cat_id @foreach(\App\Models\Category::where("active" , 1)->whereNull("category_id")->pluck("name_en" ,"id") as $s_id => $s_c) @endforeach
{{__('messages.Category')}} selected_cat_id @foreach(\App\Models\Category::where("active" , 1)->where("category_id" , $selected_main_cat_id)->pluck("name_en" ,"id") as $s_sub_id => $s_sub_c) @endforeach
{{__('messages.Product')}} selected_prod_id @foreach(\App\Models\Product::where("category_id" , $selected_cat_id)->get() as $s_prod) @endforeach
@endcan
@if ($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id) @php $order_detail_transfered = App\Models\OrderDetailTransfer:: where("to_order_detail_id" ,$order_detail->id ) ->where("from_customer_id" ,$order_detail->order->account_id ) ->where("to_customer_id" ,$order_detail->customer_id )->first(); ; @endphp @if ( $order_detail_transfered) @php $order_detail =$order_detail_transfered->from_order_detail; @endphp {{__('messages.Name')}} {{$order_detail->item->name}} {{__('messages.Offer')}} - {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @endif @php $order_detail = App\Models\OrderDetail::find($from_order_detail_id ); @endphp @if ($from_order_detail_id ) {{__('messages.Name')}} {{$order_detail->item->name}} {{__('messages.Offer')}} - {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @break @case("App\Models\ProductOffer") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->offer->name}} {{__('messages.type')}}
{{$order_detail->type}} @can("edit order_details type") {{-- {{$order_detail->id}} --}} Set Order Detail Type m-0 update_order_details_type() edit_type({{$order_detail->id}})
{{__('messages.type')}} selected_type @can('create repeat order_details') @endcan
@endcan
{{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} @can("edit order delivery") {{-- {{$order_detail->id}} --}} edit price with tax m-0 update_order_detail_price() edit({{$order_detail->id}})
@endcan
{{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id == null) @can("add customer to corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @elseif($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id ) @can("edit customer corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @endif @can("edit order_details") {{-- {{$order_detail->id}} --}} Set Order Detail m-0 update_offer() edit({{$order_detail->id}})
{{__('messages.Offer')}} selected_offer_id @foreach(\App\Models\Offer::where("activate" , 1)->where("end_date" ,">=" ,now() )->pluck("name" ,"id") as $s_id => $s_offer) @endforeach
{{__('messages.Product')}} s_product_offer_id @foreach(\App\Models\ProductOffer::where("offer_id" , $selected_offer_id)->get() as $s_product_offer) @endforeach
@endcan
@if ($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id) @php $order_detail_transfered = App\Models\OrderDetailTransfer:: where("to_order_detail_id" ,$order_detail->id ) ->where("from_customer_id" ,$order_detail->order->account_id ) ->where("to_customer_id" ,$order_detail->customer_id )->first(); ; @endphp @if ( $order_detail_transfered) @php $order_detail =$order_detail_transfered->from_order_detail; @endphp {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->offer->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @endif @php $order_detail = App\Models\OrderDetail::find($from_order_detail_id ); @endphp @if ($from_order_detail_id ) {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->offer->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @break @case("App\Models\PackageProduct") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->package->name}} {{__('messages.type')}}
{{$order_detail->type}} @can("edit order_details type") {{-- {{$order_detail->id}} --}} Set Order Detail Type m-0 update_order_details_type() edit_type({{$order_detail->id}})
{{__('messages.type')}} selected_type @can('create repeat order_details') @endcan
@endcan
{{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} @can("edit order delivery") {{-- {{$order_detail->id}} --}} edit price with tax m-0 update_order_detail_price() edit({{$order_detail->id}})
@endcan
{{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id == null) @can("add customer to corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @elseif($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id ) @can("edit customer corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @endif @can("edit order_details") {{-- {{$order_detail->id}} --}} Set Order Detail m-0 update_pack() edit({{$order_detail->id}})
{{__('messages.Package')}} selected_package_id @foreach(\App\Models\Package::where("activate" , 1)->where("end_date" ,">=" ,now() )->pluck("name" ,"id") as $s_id => $s_pack) @endforeach
{{__('messages.Product')}} s_pack_product_id @foreach(\App\Models\PackageProduct::where("package_id" , $selected_package_id)->get() as $s_product_pack) @endforeach
@endcan
@if ($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id) @php $order_detail_transfered = App\Models\OrderDetailTransfer:: where("to_order_detail_id" ,$order_detail->id ) ->where("from_customer_id" ,$order_detail->order->account_id ) ->where("to_customer_id" ,$order_detail->customer_id )->first(); ; @endphp @if ( $order_detail_transfered) @php $order_detail =$order_detail_transfered->from_order_detail; @endphp {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->package->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @endif @php $order_detail = App\Models\OrderDetail::find($from_order_detail_id ); @endphp @if ($from_order_detail_id ) {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->package->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @break @case("App\Models\ClubMembership") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->name}} {{__('messages.Offer')}} - {{__('messages.type')}} - {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} @can("edit order delivery") {{-- {{$order_detail->id}} --}} edit price with tax m-0 update_order_detail_price() edit({{$order_detail->id}})
@endcan
{{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id == null) @can("add customer to corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @elseif($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id ) @can("edit customer corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @endif @can("edit order_details") {{-- {{$order_detail->id}} --}} Set Order Detail m-0 update_club() edit({{$order_detail->id}})
{{__('messages.Club MemberShip')}} selected_club_id @foreach(\App\Models\ClubMembership::where("activate" , 1)->where("end_date" ,">=" ,now() )->pluck("name" ,"id") as $s_id => $s_pack) @endforeach
@endcan
@break @case("App\Models\ClubMembershipProduct") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->club_membership->name}} {{__('messages.type')}}
{{$order_detail->type}} @can("edit order_details type") {{-- {{$order_detail->id}} --}} Set Order Detail Type m-0 update_order_details_type() edit_type({{$order_detail->id}})
{{__('messages.type')}} selected_type @can('create repeat order_details') @endcan
@endcan
{{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} @can("edit order delivery") {{-- {{$order_detail->id}} --}} edit price with tax m-0 update_order_detail_price() edit({{$order_detail->id}})
@endcan
{{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id == null) @can("add customer to corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @elseif($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id ) @can("edit customer corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @endif
@can("edit order_details") {{-- {{$order_detail->id}} --}} Set Order Detail m-0 update_club_prod() edit({{$order_detail->id}})
{{__('messages.Club MemberShip')}} selected_club @foreach(\App\Models\ClubMembership::where("activate" , 1)->where("end_date" ,">=" ,now() )->pluck("name" ,"id") as $s_id => $s_pack) @endforeach
{{__('messages.Product')}} s_club_product_id @foreach(\App\Models\ClubMembershipProduct::where("club_membership_id" , $selected_club)->get() as $s_product_pack) @endforeach
@endcan @can("delete club_membership_order_details") @if ($order_detail->status =="waiting") {{$order_detail->id}} m-0 {{__('messages.Course')}} {{$order_detail->item->product->name}} @endif @endcan
@if ($order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id) @php $order_detail_transfered = App\Models\OrderDetailTransfer:: where("to_order_detail_id" ,$order_detail->id ) ->where("from_customer_id" ,$order_detail->order->account_id ) ->where("to_customer_id" ,$order_detail->customer_id )->first(); ; @endphp @if ( $order_detail_transfered) @php $order_detail =$order_detail_transfered->from_order_detail; @endphp {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Club MemberShip')}} {{$order_detail->item->club_membership->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @endif @php $order_detail = App\Models\OrderDetail::find($from_order_detail_id ); @endphp @if ($from_order_detail_id ) {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->club_membership->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @break @case("App\Models\InstallmentPackageProduct") #{{$loop->iteration}} {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->installment_package->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Price')}} {{number_format((float) $order_detail->price, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} @can("edit order delivery") {{-- {{$order_detail->id}} --}} edit price with tax m-0 update_order_detail_price() edit({{$order_detail->id}})
@endcan
{{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id == null) @can("add customer to corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @elseif($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id ) @can("edit customer corporate order_details") @livewire('customer-by-code-name-search-component' ,["corporate_id"=>$order_detail->order->account_id ,"order_detail_id" =>$order_detail->id ] ,key('c_s_c_' . $order_detail->id)) @endcan @endif @can("edit order_details") @endcan
@if ($order_detail->order->account_id != $order_detail->customer_id) @php $order_detail_transfered = App\Models\OrderDetailTransfer:: where("to_order_detail_id" ,$order_detail->id ) ->where("from_customer_id" ,$order_detail->order->account_id ) ->where("to_customer_id" ,$order_detail->customer_id )->first(); ; @endphp @if ( $order_detail_transfered) @php $order_detail =$order_detail_transfered->from_order_detail; @endphp {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->installment_package->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @endif @php $order_detail = App\Models\OrderDetail::find($from_order_detail_id ); @endphp @if ($from_order_detail_id ) {{__('messages.Name')}} {{$order_detail->item->product->name}} {{__('messages.Offer')}} {{$order_detail->item->installment_package->name}} {{__('messages.type')}} {{$order_detail->type}} {{-- {{__('messages.Branch')}} {{($order_detail->branch_id)? $order_detail->branch->name :"not yet"}} {{__('messages.Preferred Period')}} {{($order_detail->period_id)? $order_detail->period->name :"-"}} --}} {{__('messages.Status')}} {{ $order_detail->status }} @if ($order_detail->order->account_type=="App\Models\Corporate" && $order_detail->customer_id) - {{$order_detail->customer->name}} @endif @if($order_detail->order->account_type=="App\Models\Customer" && $order_detail->customer_id && $order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif @endif @break @endswitch @empty {{__('messages.Empty Result')}} @endforelse   {{__('messages.Invoice Total')}} {{number_format((float) $order->total_amount, 2) }} {{($order->currency_id)? $order->currency->name :null}}   {{number_format((float)$order->taxes_amount, 2) }} {{($order->currency_id)? $order->currency->name :null}} {{number_format((float)$order->total_amount_with_taxes, 2) }} {{($order->currency_id)? $order->currency->name :null}}  
@if ($order->order_installments->count()>0)
{{__('messages.No.')}} {{__('messages.Installment Package')}} {{__('messages.Amount')}} {{__('messages.Due At')}} {{__('messages.Paid')}} {{__('messages.Receipt No.')}} {{__('messages.Paid At')}} {{__('messages.User')}} {{--   --}} @forelse ($order->order_installments as $key => $order_installment) {{__('messages.No.')}} {{$order_installment->installment_order}} {{__('messages.Installment Package')}} {{$order_installment->installment_package->name}} {{__('messages.Amount')}} {{number_format((float) $order_installment->amount, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.Due At')}} {{ $order_installment->due_date }} {{__('messages.Paid')}} @if($order_installment->paid == 1) @else @endif {{__('messages.Receipt No.')}} {{($order_installment->order_payment_id)?$order_installment->order_payment->id:"-"}} {{__('messages.Paid At')}} {{ $order_installment->paid_at }} {{__('messages.User')}} {{($order_installment->last_updated_by_user)? $order_installment->last_updated_by_user->name :"-"}} @empty {{__('messages.Empty Result')}} @endforelse
@endif
# {{__('messages.Receipt No.')}} {{__('messages.Payment Branch')}} {{__('messages.Payment Method')}} {{__('messages.Payment Details')}} {{__('messages.Amount')}} {{__('messages.type')}} {{__('messages.Payment Date')}} {{__('messages.comment')}} {{__('messages.User')}} {{__('messages.Receipt')}} @forelse ($order->order_payments as $key => $order_payment) #{{$loop->iteration}} {{__('messages.Receipt No.')}} {{$order_payment->receipt_serial_no}} {{__('messages.Payment Branch')}} {{($order_payment->branch)?$order_payment->branch->name:""}} {{__('messages.Payment Method')}} {{$order_payment->payment_method->name }} {{__('messages.Payment Details')}} @if ($order_payment->payment_method_id == 2 ) {{($order_payment->payment_machine_id)?$order_payment->payment_machine->name:"" }} @elseif ($order_payment->payment_method_id == 3 ) @if ($order_payment->bank_transfer_receipt_file) @endif @else - @endif {{__('messages.Amount')}} {{number_format((float) $order_payment->amount, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.type')}} {{$order_payment->type}} {{__('messages.Payment Date')}} {{ $order_payment->created_at }} {{__('messages.comment')}} {{ $order_payment->comment }} {{__('messages.User')}} {{($order_payment->last_updated_by_user)? $order_payment->last_updated_by_user->name :"-"}} @if(!$loop->first) @if ($order_payment->receipt_serial_no) @endif @endif @if (auth()->user()->can('delete order_payments') || (auth()->user()->can('delete order_payments in same date') && ($order_payment->created_at >= \Carbon\Carbon::now()->subHours(24)->toDateTimeString() )) ) {{__("messages.Delete")}} delete_payment( {{$order_payment->id}}) {{$order_payment->receipt_serial_no}} @endif {{-- delete_payment --}} @empty {{__('messages.Empty Result')}} @endforelse @if ( $order->payment_status != "completed")
@livewire('order-payment-component', ['order' => $order ])
@endif @can("add adjustments")
@livewire('adjustment-component', ['order' => $order ])
@endcan
@can('show deleted order_payments') @if ($order->order_payments()->onlyTrashed()->count()>0)
Trash Order Payments
# {{__('messages.Receipt No.')}} {{__('messages.Payment Branch')}} {{__('messages.Payment Method')}} {{__('messages.Payment Details')}} {{__('messages.Amount')}} {{__('messages.type')}} {{__('messages.Payment Date')}} {{__('messages.User')}} {{__('messages.Receipt')}} @forelse ($order->order_payments()->onlyTrashed()->get() as $key => $order_payment) #{{$loop->iteration}} {{__('messages.Receipt No.')}} {{$order_payment->receipt_serial_no}} {{__('messages.Payment Branch')}} {{($order_payment->branch)?$order_payment->branch->name:""}} {{__('messages.Payment Method')}} {{$order_payment->payment_method->name }} {{__('messages.Payment Details')}} @if ($order_payment->payment_method_id == 2 ) {{($order_payment->payment_machine_id)?$order_payment->payment_machine->name:"" }} @elseif ($order_payment->payment_method_id == 3 ) {{($order_payment->bank_account_id)?$order_payment->bank_account->name:"" }} @if ($order_payment->bank_transfer_receipt_file) @endif @else - @endif {{__('messages.Amount')}} {{number_format((float) $order_payment->amount, 2) ?? '-' }} {{($order->currency_id)? $order->currency->name :null}} {{__('messages.type')}} {{$order_payment->type}} {{__('messages.Payment Date')}} {{ $order_payment->created_at }} {{__('messages.User')}} {{($order_payment->last_updated_by_user)? $order_payment->last_updated_by_user->name :"-"}} @if(!$loop->first) @if ($order_payment->receipt_serial_no) @endif @endif @can('restore order_payment')
{{ __('messages.Restore') }} {{__('messages.Receipt')}} {{ $order_payment->receipt_serial_no}} {{ $order_payment->id }} restore_item({{$order_payment->id}}) mt-0
@endcan @can('hard delete order_payment')
{{__('messages.Receipt')}} {{ $order_payment->receipt_serial_no}} {{__('messages.permanently')}} {{$order_payment->id}} delete_permanently({{$order_payment->id}})
@endcan
@empty {{__('messages.Empty Result')}} @endforelse
@endif @endcan