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

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

@if ($order->customer_pledge)

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

@endif
{{__("messages.download contract")}}
@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->special_offer_amount - $order->taxes_amount ) - $order->order_payments->sum('amount') ), 2) @endphp @else @php $remaining_amount = number_format((float) ( ($order->total_amount_with_taxes -$order->special_offer_amount) - $order->order_payments->sum('amount') ), 2) @endphp @endif
@if ($remaining_amount<=0) @else @endif
@if ($remaining_amount<=0) @else @endif
# {{__('messages.Name')}} {{__('messages.Offer')}} {{__('messages.Course Level')}} {{__('messages.Course Branch')}} {{__('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_id != $order_detail->customer_id ) { $class_bg = "bg-purple-200"; $rows_span = 2 ; }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.Offer')}} - {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"-"}} {{__('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->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Status')}} {{ $order_detail->status }}
@if($order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@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->name}} {{__('messages.Offer')}} - {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Status')}} {{ $order_detail->status }}
@if($order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@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->offer->name}} {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Status')}} {{ $order_detail->status }}
@if($order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@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->package->name}} {{__('messages.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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->name}} {{__('messages.Tax')}} {{($order_detail->tax)? ($order_detail->tax *100) .' %' : "-"}} {{__('messages.Tax Amount')}} {{number_format((float) $order_detail->price * $order_detail->tax , 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Price with Tax')}} {{number_format((float) $order_detail->price_with_tax, 2) ?? '-' }} {{$order->currency->name}} {{__('messages.Status')}} {{ $order_detail->status }}
@if($order_detail->order->account_id != $order_detail->customer_id ) {{__('messages.transfered to customer')}} ( {{$order_detail->customer->code}}) @endif
@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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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.Course Level')}} {{($order_detail->course_level_id)? $order_detail->course_level->name :"not yet"}} {{__('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_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->name}}   {{number_format((float)$order->taxes_amount, 2) }} {{$order->currency->name}} {{number_format((float)$order->total_amount_with_taxes, 2) }} {{$order->currency->name}}  
@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->name}} {{__('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->receipt_serial_no:"-"}} {{__('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.Payment Date')}} {{__('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->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->name}} {{__('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) @endif @empty {{__('messages.Empty Result')}} @endforelse @if ( $order->payment_status != "completed")
@livewire('order-payment-component', ['order' => $order ])
@endif