@php
$header_discount = 0;
@endphp
@if($eii)
@foreach($eii as $tid)
@php
$header_discount += $tid->item_discount;
@endphp
@endforeach
@endif
@if($eiP)
@foreach($eiP as $prod)
@php
$header_discount += $prod->product_discount;
@endphp
@endforeach
@endif
@if($packagesData)
@foreach( $packagesData as $package )
@php
$header_discount += $package->package_discount;
@endphp
@endforeach
@endif
@if($courseData)
@php
$header_discount += $courseData->discount;
@endphp
@endif
| Description |
Item # |
Cost |
@if($header_discount > 0)
Discount |
@endif
GST |
Price |
@php
$total=0;
$maintotal=0;
$totalgst = 0;
$totalgst1 = 0;
$totalgst2 = 0;
$totalgstItem = 0;
$totalgst1Item = 0;
$appPrice=0;
$productPrice=0;
$total_discount = 0;
$gst = 0;
$item_discount = 0;
@endphp
@isset($existinvoice)
@if($eiP)
@foreach($eiP as $prod)
@if($prod->product_iteams)
@if($prod->product_iteams->is_gst == 'on')
| * {{$prod->deduct_quantity}} {{"x"}} {{$prod->product_iteams->product_name}} |
{{-- GST FOR MULTIPLE QTY --}}
@for ($i=1;$i<= $prod->deduct_quantity;$i++)
@php
$total2 = $prod->deduct_quantity * $prod->product_cost;
$total2 = $total2 - $prod->product_discount;
$item_discount += $prod->product_discount;
$totalgst1Item = ($prod->deduct_quantity * $prod->product_cost) - $prod->product_discount;
$GST_Text = "10%";
@endphp
@endfor
@else
{{$prod->deduct_quantity}} {{"x"}} {{$prod->product_iteams->product_name}} |
@php
$GST_Text = "FREE";
$item_discount += $prod->product_discount;
@endphp
@endif
{{$prod->product_iteams->product_code}} |
${{number_format($prod->product_cost,2)}} |
@if($prod->product_discount > 0)
${{number_format($prod->product_discount,2)}} |
@else
@if($header_discount > 0)
|
@endif
@endif
{{ $GST_Text }} |
{{-- ${{$totalgst1Item}} | --}}
${{number_format($prod->deduct_quantity * $prod->product_cost - $prod->product_discount,2)}} |
@endif
@php
$totalgst1 += $totalgst1Item;
$total_discount += $prod->product_discount;
@endphp
@endforeach
@endif
@if($eii)
@foreach($eii as $tid)
@if($tid->appointment_type)
@php
$total += preg_replace("/[^0-9.]/", "",$tid->app_cost);
@endphp
@if($tid->appointment_type->is_gst == 'on')
| * {{$tid->appointment_type->appointment_type ?? ""}} |
{{-- GST FOR MULTIPLE QTY --}}
@if($tid->item_qty==1)
@php
$appPrice= preg_replace("/[^0-9.]/", "", $tid->app_cost ?? 0.00);
@endphp
@else
@php
$quantity = isset($tid->item_qty) ? $tid->item_qty : 1;
$appPrice= preg_replace("/[^0-9.]/", "", $tid->app_cost ?? 0.00 )/$quantity;
@endphp
@endif
@php
$totalgstItem = (($tid->app_cost * $tid->item_qty) - $tid->item_discount);
$item_discount += $tid->item_discount;
$GST_Text = "10%";
@endphp
@else
{{$tid->item_qty}} {{"x"}} {{$tid->appointment_type->appointment_type ?? ""}} |
@php
$GST_Text = "FREE";
$item_discount += $tid->item_discount;
@endphp
@endif
{{$tid->appointment_type->code}} |
${{number_format($tid->app_cost,2)}} |
@if($tid->item_discount > 0)
${{number_format($tid->item_discount,2)}} |
@else
@if($header_discount > 0)
|
@endif
@endif
{{ $GST_Text }} |
{{-- ${{number_format($totalgstItem,2)}} | --}}
${{number_format( preg_replace("/[^0-9.]/", "", ($tid->app_cost * $tid->item_qty) - $tid->item_discount ?? 0.00),2) ?? "0.00"}} |
@endif
@php
$totalgst2 += $totalgstItem;
$total_discount += $tid->item_discount;
@endphp
@endforeach
@endif
@if($packagesData)
@foreach($packagesData as $tid)
@if($tid->package_id)
@php
$total += $tid->package_cost * $tid->package_quantity;
@endphp
@if(isset($tid->is_gst) && $tid->is_gst == 'on')
| * {{$tid->package->package_name ?? ""}} |
@if($tid->package_quantity==1)
@php
$appPrice= preg_replace("/[^0-9.]/", "", $tid->package_cost ?? 0.00);
@endphp
@else
@php
$quantity = isset($tid->package_quantity) ? $tid->package_quantity : 1;
$appPrice= preg_replace("/[^0-9.]/", "", $tid->package_cost * $quantity ?? 0.00 ) - $tid->package_discount;
@endphp
@endif
@php
$totalgstItem += ($tid->package_cost * $tid->package_quantity) - $tid->package_discount;
$item_discount += $tid->package_discount;
$GST_Text = "10%";
@endphp
@else
@php
$totalgstItem += 0;
$item_discount += $tid->package_discount;
$GST_Text = "FREE";
@endphp
{{$tid->package->package_name ?? ""}} {{"x"}} {{$tid->package_quantity}} |
@endif
|
${{number_format($tid->package_cost,2)}} |
@if($tid->package_discount > 0)
${{number_format($tid->package_discount,2)}} |
@else
@if($header_discount > 0)
|
@endif
@endif
@php
$totalgst += $totalgstItem;
$total_discount += $tid->package_discount;
@endphp
{{ $GST_Text }} |
${{number_format(($tid->package_cost * $tid->package_quantity) - $tid->package_discount,2)}} |
@endif
@endforeach
@endif
@if( $courseData )
@if( $courseData->course_id )
@php
$total += $courseData->course_cost;
@endphp
@if(isset($courseData->is_new_takings_gst) && $courseData->is_new_takings_gst == 1)
| * {{$courseData->course->course_name ?? ""}} |
@php
$appPrice= preg_replace("/[^0-9.]/", "", $courseData->course_cost ?? 0.00);
@endphp
@php
$totalgstItem += $courseData->course_cost - $courseData->discount;
$item_discount += $courseData->discount;
$GST_Text = "10%";
@endphp
@else
@php
$totalgstItem += 0;
$item_discount += $courseData->discount;
$GST_Text = "FREE";
@endphp
{{$courseData->course->course_name ?? ""}} |
@endif
|
${{number_format($courseData->course_cost,2)}} |
@if( $courseData->discount > 0)
${{number_format($courseData->discount,2)}} |
@else
@if($header_discount > 0)
|
@endif
@endif
@php
$totalgst += $totalgstItem;
$total_discount += $courseData->discount;
@endphp
{{ $GST_Text }} |
${{number_format(($courseData->course_cost) - $courseData->discount,2)}} |
@endif
@endif
@endisset