@if(isset($value->invoice_status) && $value->invoice_status =='credit')
@php continue; @endphp
| {{date('d/m/y', strtotime($value->created_at))}} |
{{$value->client_name}}#{{$value->invoice_number}} |
@if($isVisible == 1){{$value->practitioner->first_name}} {{$value->practitioner->last_name ?? "-"}} | @endif
Credit on file |
- |
{{$value->payment_type}} |
${{number_format($value->amount_paid,2)}} |
- |
@elseif(isset($value->invoice_status) && $value->invoice_status =='owin')
@php continue; @endphp
{{date('d/m/y', strtotime($value->created_at))}} |
{{$value->client_name}}#{{$value->invoice_number}} |
@if($isVisible == 1){{$value->practitioner->first_name}} {{$value->practitioner->last_name ?? "-"}} | @endif
Owing pay on file |
- |
{{$value->payment_type}} |
${{number_format($value->amount_paid,2)}} |
- |
@else
{{date('d/m/y', strtotime($value->created_at))}} |
client_id !== 1) href="{{ URL('/practitioner/clientcard?client_id='.base64_encode($value->client_id))}}" @endif class="hover-client-name">{{$value->client_name}}
#{{$value->invoice_number}}
|
@if($isVisible == 1){{$value->practitioner->first_name}} {{$value->practitioner->last_name ?? "-"}} | @endif
@if($value->invoiceItem)
@foreach($value->invoiceItem as $service)
@if( isset( $service->item_qty ) )
@if($service->is_gst_applicable)*@endif{{$service->service_name}} x {{ $service->item_qty }}
@else
{{$service->service_name}}
@endif
@endforeach
@endif
@if($value->invoice_product)
@foreach($value->invoice_product as $product)
@if($product->is_gst_applicable)*@endif{{$product->product_name}} x {{ $product->deduct_quantity }}
@endforeach
@endif
@if($value->package_item)
@foreach($value->package_item as $package)
@if($package->is_gst_applicable)*@endif{{$package->package_name}}
@endforeach
@endif
@if($value->course_item)
@foreach($value->course_item as $course)
@if($course->is_gst_applicable)*@endif{{$course->course_name}}
@endforeach
@endif
@if($value->payment_plan_item)
@foreach($value->payment_plan_item as $paymentplan)
@if($paymentplan->is_gst_applicable)*@endif{{$paymentplan->plan_name ?? ''}}
@endforeach
@endif
@if($value->discount !='' && $value->discount !='0.00')
@if($value->is_coupon_applied == 1)
Coupon applied
@else
Discount
@endif
@endif
@if( $value->shipping_cost != '' && $value->shipping_cost > 0 )
@if($value->is_shipping_gst_on)
*Shipping
@else
Shipping
@endif
@endif
@if( !$value->invoiceItem && !$value->invoice_product )
@if( $value->is_cancellation_charge == 1 )
Cancellation charge
@endif
@endif
@if($value->gift_voucher_id != 0)
Gift voucher purchased
@endif
{{-- @if(!empty($value->creditNote))
Refund x 1
@endif --}}
{{-- @if($value->course_id != 0)
Course purchased
@endif --}}
|
@if($value->invoiceItem)
@foreach($value->invoiceItem as $service)
${{number_format(preg_replace("/[^0-9.]/", "",$cost),2)}}
@endforeach
@endif
@if($value->invoice_product)
@foreach($value->invoice_product as $product)
@php
if(isset($product->product_discount) && $product->product_discount > 0)
{
$countproductDiscount = 1;
}
$price_subtotal = $product->product_price * $product->deduct_quantity
@endphp
{{--${{number_format($price_subtotal,2)}} --}}
${{number_format($product->product_price_subtotal,2)}}
@endforeach
@endif
@if($value->package_item)
@foreach($value->package_item as $package)
${{number_format(preg_replace("/[^0-9.]/", "",$cost),2)}}
@endforeach
@endif
@if($value->course_item)
@foreach($value->course_item as $course)
${{number_format(preg_replace("/[^0-9.]/", "",$cost),2)}}
@endforeach
@endif
@if($value->payment_plan_item)
@foreach($value->payment_plan_item as $paymentplan)
${{number_format(preg_replace("/[^0-9.]/", "",$cost),2)}}
@endforeach
@endif
@foreach($value->invoice_product as $product)
@endforeach
@foreach($value->invoiceItem as $service)
@php
if(isset($service->item_discount)) {
$service_discount_total = $service->item_discount;
}
@endphp
@if($service->is_gst_applicable)
@php
if(isset($service->item_qty)) {
// $total_gst_new1 = (($service->app_cost * $service->item_qty - ($service->item_discount)) / 11);
if($service->item_discount > 0){
$total_gst_new1 = (($service->app_cost * $service->item_qty) - $service->item_discount) / 11;
$GST_flag = 1;
}else{
if($countproductDiscount != 1 && $countItemDiscount != 1 && $value->discount !='' && $value->discount !='0.00' && $service_discount_total == 0 && $product_discount_total == 0){
$total_cost = $value->total + $value->discount;
$discount_percentage = ($value->discount * 100) / $total_cost;
if($discount_percentage != 0){
$service_discount = (($service->app_cost * $service->item_qty) * $discount_percentage) / 100;
$total_gst_new1 = (($service->app_cost * $service->item_qty) - $service_discount) / 11;
}
}else{
$total_gst_new1 = (($service->app_cost * $service->item_qty) - $service->item_discount) / 11;
}
}
$total_gst_new += $total_gst_new1;
// $total_gst_new += (($service->app_cost * $service->item_qty - ($value->discount)) / 11);
} else {
// $total_gst_new += (($service->app_cost - ($service->item_discount)) / 11);
if(isset($service->item_discount) && $service->item_discount > 0){
$total_gst_new1 = ($service->app_cost - $service->item_discount) / 11;
$GST_flag = 1;
}else{
if($value->discount !='' && $value->discount !='0.00' && $service_discount_total == 0 && $product_discount_total == 0){
$total_cost = $value->total + $value->discount;
$discount_percentage = ($value->discount * 100) / $total_cost;
if($discount_percentage != 0){
$service_discount = ($service->app_cost * $discount_percentage) / 100;
$total_gst_new1 = (($service->app_cost - $service_discount) / 11);
}
}else{
if(isset($service->item_discount)) {
$total_gst_new1 = (($service->app_cost - $service->item_discount) / 11);
} else {
$total_gst_new1 = (($service->app_cost) / 11);
}
}
}
$total_gst_new += $total_gst_new1;
// $total_gst_new += (($service->app_cost - ($value->discount)) / 11);
}
@endphp
@else
{{-- @php
$total_gst_new = 0
@endphp --}}
@endif
@endforeach
@foreach($value->invoice_product as $product)
@if($product->is_gst_applicable)
@php
if($product->product_discount > 0){
$total_gst_new1 = (($product->product_price * $product->deduct_quantity - $product->product_discount) / 11);
$GST_flag = 1;
}else {
if($countItemDiscount != 1 && $countproductDiscount != 1 && $value->discount !='' && $value->discount !='0.00' && $service_discount_total == 0 && $product_discount_total == 0){
$total_cost = $value->total + $value->discount;
$discount_percentage = ($value->discount * 100) / $total_cost;
if($discount_percentage != 0){
$product_discount = (($product->product_price * $product->deduct_quantity) * $discount_percentage) / 100;
$total_gst_new1 = ((($product->product_price * $product->deduct_quantity) - $product_discount) / 11);
}
}else{
$total_gst_new1 = ((($product->product_price * $product->deduct_quantity) - $product->product_discount) / 11);
}
}
$total_gst_new += $total_gst_new1;
@endphp
@endif
@endforeach
@foreach($value->package_item as $package)
@if($package->is_gst_applicable)
@php
if($package->package_discount > 0){
$total_gst_new1 = (($package->package_cost - $package->package_discount ) / 11);
$GST_flag = 1;
}else {
if($countItemDiscount != 1 && $countproductDiscount != 1 && $value->discount !='' && $value->discount !='0.00' && $service_discount_total == 0 && $product_discount_total == 0 && $package_discount_total == 0){
$total_cost = $value->total + $value->discount;
$discount_percentage = ($value->discount * 100) / $total_cost;
if($discount_percentage != 0){
$package_discount = (($package->package_cost) * $discount_percentage) / 100;
$total_gst_new1 = ((($package->package_cost) - $package_discount) / 11);
}
}else{
$total_gst_new1 = ((($package->package_cost) - $package->package_discount) / 11);
}
}
$total_gst_new += $total_gst_new1;
@endphp
@endif
@endforeach
@foreach($value->course_item as $course)
@if($course->is_gst_applicable)
@php
if($course->discount > 0){
$total_gst_new1 = (($course->course_cost - $course->discount ) / 11);
$GST_flag = 1;
}else {
if($countItemDiscount != 1 && $countproductDiscount != 1 && $value->discount !='' && $value->discount !='0.00' && $service_discount_total == 0 && $product_discount_total == 0 && $package_discount_total = 0 && $course_discount_total = 0 ){
$total_cost = $value->total + $value->discount;
$discount_percentage = ($value->discount * 100) / $total_cost;
if($discount_percentage != 0){
$course_discount = (($course->course_cost) * $discount_percentage) / 100;
$total_gst_new1 = ((($course->course_cost) - $course_discount) / 11);
}
}else{
$total_gst_new1 = ((($course->course_cost) - $course->discount) / 11);
}
}
$total_gst_new += $total_gst_new1;
@endphp
@endif
@endforeach
@foreach($value->payment_plan_item as $paymentplan)
@if($paymentplan->is_gst_applicable)
@php
if($paymentplan->discount > 0){
$total_gst_new1 = (($paymentplan->amount_paid - $paymentplan->discount ) / 11);
$GST_flag = 1;
}else {
if($countItemDiscount != 1 && $countproductDiscount != 1 && $value->discount !='' && $value->discount !='0.00' && $service_discount_total == 0 && $product_discount_total == 0 && $package_discount_total = 0 && $course_discount_total = 0 && $payment_plan_discount = 0 ){
$total_cost = $value->total + $value->discount;
$discount_percentage = ($value->discount * 100) / $total_cost;
if($discount_percentage != 0){
$payment_plan_discount = (($paymentplan->amount_paid) * $discount_percentage) / 100;
$total_gst_new1 = ((($paymentplan->amount_paid) - $payment_plan_discount) / 11);
}
}else{
$total_gst_new1 = ((($paymentplan->amount_paid) - $paymentplan->discount) / 11);
}
}
$total_gst_new += $total_gst_new1;
@endphp
@endif
@endforeach
@if( !$value->invoiceItem && !$value->invoice_product )
@if( $value->is_cancellation_charge == 1 )
${{number_format($value->cancellation_charge,2)}}
@endif
@endif
@if($value->discount !='' && $value->discount !='0.00')
@php
$total_discounts += $value->discount;
@endphp
-${{$value->discount}}
@endif
@if( $value->shipping_cost != '' && $value->shipping_cost > 0 )
${{number_format($value->shipping_cost,2)}}
@endif
@if($value->gift_voucher_id != 0)
${{number_format($value->total,2)}}
@if( isset( $value->is_new_takings_gst ) && $value->is_new_takings_gst == 1 )
@endif
@endif
{{-- @if(!empty($value->creditNote))
-${{number_format($value->creditNote->credit_amount,2)}}
@endif --}}
|
@if(isset($value->history) && count($value->history) >=1)
@foreach($value->history as $type)
{{$type->payment_type}}
@endforeach
@else
{{$value->payment_type}}
@endif
|
@php
$gst_calc =0;
$tmp_gst1 = 0;
@endphp
@if(isset($value->history) && count($value->history) >=1)
@foreach($value->history as $type)
${{number_format($type->paid_amount,2)}}
@php
$gst_calc = $gst_calc + $type->paid_amount;
@endphp
@endforeach
@else
${{number_format($value->amount_paid,2)}}
@php
$gst_calc = $gst_calc + $type->paid_amount;
@endphp
@endif
|
{{-- New code 15-11-2024 --}}
{{--
@if( isset( $value->is_new_takings_gst ) && $value->is_new_takings_gst == 1 && isset($value->historyinvoice_gst))
@php
$tmp_gst = $gst_calc * $value->historyinvoice_gst->old_gst;
@endphp
@if($value->total != null && $value->total !='0' && $value->total !='0.00')
@php
$tmp_gst1 = $tmp_gst / $value->total;
@endphp
@else
@php
$tmp_gst1 = 0;
@endphp
@endif
@if($gst_calc !='0.00' && $gst_calc != null && $gst_calc !='0')
${{number_format($tmp_gst1,2)}}
@php
$all_total_gst_new += $tmp_gst1;
@endphp
@endif
@endif
| --}}
{{-- end --}}
{{-- Old code 15-11-2024 --}}
@php $finalGst = 0; $tmp_gst = 0;@endphp
@if( isset( $value->is_new_takings_gst ) && $value->is_new_takings_gst == 1 )
@if($value->is_shipping_gst_on == 1 && $value->gst_on_shipping_cost != NULL )
${{ number_format($total_gst_new + $value->gst_on_shipping_cost,2) }}
@php
$all_total_gst_new += $total_gst_new + $value->gst_on_shipping_cost;
@endphp
@else
@php
$tmp_gst = $gst_calc * $total_gst_new;
@endphp
@if($value->total != null && $value->total !='0' && $value->total !='0.00')
@php
$tmp_gst1 = $tmp_gst / $value->total;
@endphp
@else
@php
$tmp_gst1 = 0;
@endphp
@endif
{{-- ${{ number_format($total_gst_new,2) }} --}}
${{ number_format($tmp_gst1,2) }}
@php
$all_total_gst_new += $tmp_gst1;
@endphp
@endif
@php
$total_gst_new = 0;
@endphp
@else
@if(isset($value->history) && count($value->history) > 1)
@foreach($value->history as $type)
@php $finalGst += $type->old_gst; @endphp
@endforeach
@if($value->is_shipping_gst_on == 1 && $value->gst_on_shipping_cost != NULL)
@php $all_total_gst_new += $finalGst + $value->gst_on_shipping_cost ; @endphp
${{ number_format($finalGst + $value->gst_on_shipping_cost,2) }}
@else
@php $all_total_gst_new += $finalGst; @endphp
${{ number_format($finalGst,2) }}
@endif
@php
// $all_total_gst_new += $finalGst;
$total_gst_new = 0;
@endphp
@else
@if($value->is_shipping_gst_on == 1)
@php $all_total_gst_new += $total_gst_new + $value->gst_on_shipping_cost ; @endphp
${{number_format(($total_gst_new + $value->gst_on_shipping_cost),2)}}
@else
@php $all_total_gst_new += $total_gst_new; @endphp
${{number_format($total_gst_new ,2)}}
@endif
@php
// $all_total_gst_new += $value->gst_applied;
$total_gst_new = 0;
@endphp
@endif
@endif
|
{{-- end --}}
@endif
@endif
@endforeach