@if ($account_type =="customer") @can('show customer train') @livewire('customer-train-component', ['customer_id' => $account->id ,'customer'=>$account ,'component_name'=>"order"]) @endcan @elseif($account_type =="corporate") @can('show corporates') @livewire('corporate-train-component', ['corporate_id' => $account->id ,'corporate'=>$account ,'component_name'=>"order"]) @endcan @else @endif
@if (app()->getLocale()=="en")

{{__('messages.Add Order to')}} {{__('messages.'.$account_type)}} {{$account->name}}

@else

{{__('messages.Add Order to')}} {{$account->name}}

@endif

@if ($account_type =="customer") @php $course_c_e = \App\Models\CourseCustomerExam::where('customer_id',$account->id)->whereNull('score')->latest()->first(); @endphp @if( $course_c_e && $course_c_e->pass_course_level) {{__('messages.Pass Level')}} : {{$course_c_e->pass_course_level->name}} - {{$course_c_e->pass_course_level->product->name}} @elseif($course_c_e && $course_c_e->pass_course_level_id == null) {{__('messages.He did not succeed in any level')}} @else {{__('messages.No placement test yet')}} @endif @endif

@if ($this->customer_pledge)

{{__('messages.Customer Pledge Added to the Order')}}

{{$this->customer_pledge->name}} {{$customer_pledge_id}} delete_customer_pledge mt-1
@else @can('add customer_files') @livewire('customer-file-component', ['customer' => $account ,'title' =>"Add Customer Pledge" ,'file_type_id'=>3]) @endcan @endif
*
currency_id disabled @foreach(\App\Models\Currency::all() as $currency) @endforeach
@livewire('order-product-search-component',["currency_id" =>$currency_id])
# {{__('messages.Name')}} {{-- {{__('messages.Course Level')}} --}} {{__('messages.type')}} {{__('messages.Register to Course')}} {{__('messages.Price')}} {{__('messages.Now')}} {{__('messages.Tax')}} {{__('messages.Tax Amount')}} {{__('messages.Price with Tax')}}   @php $new_key = 0; $lines=0; $is_pack =false; $packages_count = 0; @endphp @forelse ($items as $key => $item) @switch($item["type"]) @case("Products") @php if ($is_pack == true){ $new_key = $key + ($lines - $packages_count); }else{ $new_key = $key; } $item_object = \App\Models\Product::find($item["id"]); // Log::info(json_encode( $item_object)); // Log::info(json_encode( $item_object->product_type)); @endphp #{{$counter++}} {{__('messages.Name')}} {{$item_object->name}} {{-- {{__('messages.Course Level')}} @if ($item_object->course_levels->count()>1)
@endif
--}} {{__('messages.type')}}
@if ($item_object->product_type_id ==1)
@else   @endif
{{__('messages.Register to Course')}}
@if ($item_object->product_type_id ==1) @if ($account_type =="customer")
@endif @else   @endif
{{__('messages.Price')}} {{number_format((float) $price_details[$new_key] ["original"], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Now')}} {{number_format((float) $price_details[$new_key] ["now"], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Tax')}} {{ $price_details[$new_key] ["tax"] *100}} % {{__('messages.Tax Amount')}} {{ number_format((float) $price_details[$new_key] ["taxt_amount"],2) }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Price with Tax')}} {{number_format((float) $price_details[$new_key] ['price_with_tax'], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}} @can("edit product_price in order")
m-0 {{__("messages.Price with Tax")}}{{$price_details[$new_key] ["currency"]}} {{$new_key}}
@endcan
  {{-- {{__("messages.Remove")}} {{$item_object->name}} {{$key}} mt-0 --}}
@php $is_pack =false; @endphp @break @case("Offers") @php $item_object = \App\Models\ProductOffer::find($item["id"]); if ($is_pack == true){ $new_key = $key + ($lines - $packages_count); }else{ $new_key = $key; } @endphp #{{$counter++}} {{__('messages.Name')}} {{$item_object->product->name}} ( {{ $item_object->offer->name}} ) {{-- {{__('messages.Course Level')}} @if ($item_object->product->course_levels->count()>1)
@endif
--}} {{__('messages.type')}}
@if ($item_object->product->product_type_id ==1)
@else   @endif
{{__('messages.Register to Course')}} @if ($item_object->product->product_type_id ==1) @if ($account_type =="customer")
@endif @else   @endif
{{__('messages.Price')}} {{number_format((float) $price_details[$new_key] ["original"], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Now')}} {{number_format((float) $price_details[$new_key] ["now"], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Tax')}} {{ $price_details[$new_key] ["tax"] *100}} % {{__('messages.Tax Amount')}} {{ number_format((float) $price_details[$new_key] ["taxt_amount"],2) }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Price with Tax')}} {{number_format((float) $price_details[$new_key] ['price_with_tax'], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}}   {{-- {{__("messages.Remove")}} {{$item_object->name}} {{$key}} mt-0 --}} @php $is_pack =false; @endphp @break @case("Packages") @php $item_object = \App\Models\Package::find($item["id"]); if ($is_pack == true){ $new_key = $key + ($lines - $packages_count); }else{ $new_key = $key; } $is_pack = true; $packages_count++; $lines += $item_object->package_products->count(); @endphp @foreach ($item_object->package_products as $k=>$pack_item) #{{$counter++}} {{__('messages.Name')}} {{$pack_item->product->name}} ( {{ $item_object->name}} ) {{-- {{__('messages.Course Level')}} @if ($pack_item->product->course_levels->count()>1)
@endif
--}} {{__('messages.type')}}
@if ($pack_item->product->product_type_id ==1)
@else   @endif
{{__('messages.Register to Course')}}
@if ($pack_item->product->product_type_id ==1) @if ($account_type =="customer")
@endif @else   @endif
{{__('messages.Price')}} {{number_format((float) $price_details[$new_key+$k]["original"], 2) ?? '-' }} {{$price_details[$new_key+$k]["currency"]}} {{__('messages.Now')}} {{number_format((float) $price_details[$new_key+$k]["now"], 2) ?? '-' }} {{$price_details[$new_key+$k]["currency"]}} {{__('messages.Tax')}} {{ $price_details[$new_key+$k]["tax"] *100}} % {{__('messages.Tax Amount')}} {{ number_format((float) $price_details[$new_key+$k]["taxt_amount"],2) }} {{$price_details[$new_key+$k]["currency"]}} {{__('messages.Price with Tax')}} {{number_format((float) $price_details[$new_key+$k]['price_with_tax'], 2) ?? '-' }} {{$price_details[$new_key+$k]["currency"]}} @if ($loop->index ==0) {{$item_object->package_products->count()}}   {{-- {{__("messages.Remove")}} {{$item_object->name}} {{json_encode([$key ,$item_object->package_products->count()] )}} mt-0 --}} @endif
@endforeach @break @case("ClubMembership") @php $item_object = \App\Models\ClubMembership::find($item["id"]); if ($is_pack == true){ $new_key = $key + ($lines - $packages_count); }else{ $new_key = $key; } @endphp #{{$counter++}} {{__('messages.Name')}} {{$item_object->name}} {{__('messages.Course Level')}}   {{__('messages.Register to Course')}}
 
{{__('messages.Price')}} {{number_format((float) $price_details[$new_key] ["original"], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Now')}} {{number_format((float) $price_details[$new_key] ["now"], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Tax')}} {{ $price_details[$new_key] ["tax"] *100}} % {{__('messages.Tax Amount')}} {{ number_format((float) $price_details[$new_key] ["taxt_amount"],2) }} {{$price_details[$new_key] ["currency"]}} {{__('messages.Price with Tax')}} {{number_format((float) $price_details[$new_key] ['price_with_tax'], 2) ?? '-' }} {{$price_details[$new_key] ["currency"]}}   {{-- {{__("messages.Remove")}} {{$item_object->name}} {{$key}} mt-0 --}}
@php $is_pack =false; @endphp @break @case("Installment Packages") @php $item_object = \App\Models\InstallmentPackage::find($item["id"]); if ($is_pack == true){ $new_key = $key + ($lines - $packages_count); }else{ $new_key = $key; } $is_pack = true; $packages_count++; $lines += $item_object->installment_package_products->count(); @endphp @foreach ($item_object->installment_package_products as $k=>$pack_item) #{{$counter++}} {{__('messages.Name')}} {{$pack_item->product->name}} ( {{ $item_object->name}} ) {{-- {{__('messages.Course Level')}} @if ($pack_item->product->course_levels->count()>0)
@endif
--}} {{__('messages.type')}}
@if ($pack_item->product->product_type_id ==1)
@else   @endif
{{__('messages.Register to Course')}}
@if ($pack_item->product->product_type_id ==1) @if ($account_type =="customer")
@endif @else   @endif
{{__('messages.Price')}} {{number_format((float) $price_details[$new_key+$k]["original"], 2) ?? '-' }} {{$price_details[$new_key+$k]["currency"]}} {{__('messages.Now')}} {{number_format((float) $price_details[$new_key+$k]["now"], 2) ?? '-' }} {{$price_details[$new_key+$k]["currency"]}} {{__('messages.Tax')}} {{ $price_details[$new_key+$k]["tax"] *100}} % {{__('messages.Tax Amount')}} {{ number_format((float) $price_details[$new_key+$k]["taxt_amount"],2) }} {{$price_details[$new_key+$k]["currency"]}} {{__('messages.Price with Tax')}} {{number_format((float) $price_details[$new_key+$k]['price_with_tax'], 2) ?? '-' }} {{$price_details[$new_key+$k]["currency"]}} @if ($loop->index ==0) {{$item_object->installment_package_products->count()}}   {{-- {{__("messages.Remove")}} {{$item_object->name}} {{json_encode([$key ,$item_object->installment_package_products->count() ,$item_object->id] )}} mt-0 --}} @endif
@endforeach @break @endswitch @empty {{__('messages.Empty Result')}} @endforelse @php $currency =\App\Models\Currency::find($currency_id); @endphp @if ($this->special_offer_amount == null || $this->special_offer_amount ==0)   {{__('messages.Invoice Total')}} @if ($this->invoice_before_discount_total>$this->invoice_total) {{number_format((float) $this->invoice_before_discount_total, 2) }} {{$currency->name}} @else {{number_format((float) $this->invoice_before_discount_total, 2) }} {{$currency->name}} @endif {{number_format((float)$this->invoice_total, 2) }} {{$currency->name}}   {{number_format((float)$this->amount_taxes, 2) }} {{$currency->name}} {{number_format((float)$this->invoice_total_with_taxes, 2) }} {{$currency->name}}   @endif @if ($this->special_offer_amount)   {{__('messages.Prices include Special Discount')}}   {{-- {{ number_format((float) ($this->require_pay_amount), 2) }} {{$currency->name}} --}} {{ number_format((float) ($this->special_offer_amount), 2) }} {{$currency->name}}     {{__('messages.Invoice Total')}} @if ($this->invoice_before_discount_total>$this->invoice_total) {{number_format((float) $this->invoice_before_discount_total, 2) }} {{$currency->name}} @else {{number_format((float) $this->invoice_before_discount_total, 2) }} {{$currency->name}} @endif {{number_format((float) array_sum(array_column($this->price_details,"now")), 2) }} {{$currency->name}}   {{number_format((float) array_sum(array_column($this->price_details,"taxt_amount")), 2) }} {{$currency->name}} {{number_format((float) array_sum(array_column($this->price_details,"price_with_tax")), 2) }} {{$currency->name}}   @endif @if ($this->tax_free)   {{__('messages.Taxes Free')}}   - {{ number_format((float) $this->amount_taxes, 2) }} {{$currency->name}}     {{__('messages.You will Pay')}}   {{-- {{ number_format((float) ($this->require_pay_amount), 2) }} {{$currency->name}} --}} {{ number_format((float) (($this->require_pay_amount-$this->amount_taxes) -$this->special_offer_amount), 2) }} {{$currency->name}}   @else   {{__('messages.You will Pay')}} {{ number_format((float) ( $this->require_pay_amount -$this->special_offer_amount) , 2) }} {{$currency->name}}   @endif @if ($this->remaining>0)   {{__('messages.Remaining Amount')}}   {{number_format((float) $this->remaining, 2) }} {{$currency->name}}   @endif @if (session()->has('message'))
{{ session('message') }}
@endif

{{-- {{__('messages.'.$item_type)}} --}}

{{__('messages.Order Details')}}
@if ($payment_method_id == 4 && $account_type == "customer") {{-- Customer Wallet payment --}} @endif @if ($this->special_offer_amount == null || $this->special_offer_amount ==0) @else @php $total_prices_now = array_sum(array_column($this->price_details,"now")); @endphp @endif @if ($this->special_offer_amount == null || $this->special_offer_amount ==0) @else @php $total_prices_taxt_amount= array_sum(array_column($this->price_details,"taxt_amount")); @endphp @endif @if ($this->invoice_total < $this->invoice_total_with_taxes) @if ($this->special_offer_amount == null || $this->special_offer_amount ==0) @else @php $total_prices_price_with_tax= array_sum(array_column($this->price_details,"price_with_tax")); @endphp @endif @endif @if ($this->tax_free) @endif @if ($this->remaining>0) @foreach ($this->all_installments as $installment_detail) @endforeach @endif @if ($this->tax_free) @else @endif

@if ($this->amount) @if ($this->tax_free) @else @endif @endif
*
payment_branch_id {{__('messages.Select Pay in Branch')}} @foreach(\App\Models\Branch::all() as $branch) @endforeach
*
payment_method_id {{__('messages.Payment Method')}} @foreach(\App\Models\PaymentMethod::whereIn("id" ,[1,2,3,4])->orWhere("id" ,">" ,7)->get() as $payment_method) @endforeach @if ($account_type =="corporate") @can('corporate order deferred') @endcan @else @can('order deferred') @endcan @endif @can('order deferred') @endcan @can('order without receipt') @endcan
@if ($payment_method_id == 2)
*
payment_machine_id {{__('messages.Payment Machine')}} @foreach(\App\Models\PaymentMachine::get() as $payment_machine) @endforeach
@elseif ($payment_method_id == 3)
*
bank_account_id {{__('messages.Bank Account')}} @foreach(\App\Models\BankAccount::get() as $bank_account) @endforeach
@if ($this->bank_transfer_receipt_file)

{{__('messages.Customer Bank Transfer Receipt Added')}}

{{$this->bank_transfer_receipt_file->name}} {{$bank_transfer_receipt}} delete_bank_transfer_receipt mt-1
@else @can('add customer_files') @livewire('customer-file-component', ['customer' => $account ,'title' =>"Add Bank Transfer Receipt" ,'file_type_id'=>4]) @endcan @endif
@endif @can('make_tax_free')
@if ($this->tax_free && $this->amount_taxes>0) {{-- --}} @endif
@endcan @if ($payment_method_id < 6 || $payment_method_id >=7)
*
@can('add order special discount')
@endcan @endif @if ($payment_method_id <= 3 or $payment_method_id >7) @can('add receipt_no')
@endcan @can('add order created_at')
@endcan @endif
comment 4