@php $appName = \App\Models\Setting::get_value('app_name'); if($appName == "" || $appName == null){ $appName = "eGrocer"; } $supportEmail = \App\Models\Setting::get_value('support_email'); if($supportEmail == "" || $supportEmail == null){ $supportEmail = ""; } $supportNumber = \App\Models\Setting::get_value('support_number'); if($supportNumber == "" || $supportNumber == null){ $supportNumber = ""; } $logo = \App\Models\Setting::get_value('logo'); $currency = \App\Models\Setting::get_value('currency') ?? '$'; @endphp @if(\Request::route()->getName() == "customerInvoice") Invoice Order - {{ $appName }} @endif

From
{{ $appName }}
Email: {{ $supportEmail }}
Customer Care : {{ $supportNumber }}
Delivery By: {{ $order->delivery_boy_name ?? "" }}
Shipping Address
{{ $order->user_name ?? "" }}
{{ $order->order_address ?? "" }}
{{ $order->order_mobile }} / {{ $order->alternate_mobile }}
{{ $order->user_email }}
Retail Invoice
No : #{{ $order->order_item_id }}
Date: {{ \Carbon\Carbon::parse($order->orders_created_at)->format('d-m-y h:i A') }}

Item : {{ count($order_items) }}

Sold By

{{ $order->store_name }}

Name: {{ $order->seller_name }}

Email: {{ $order->seller_email }}

Mobile No. : {{ $order->seller_mobile }}

Pan Number : {{ $order->pan_number }}

{{ $order->tax_name }} : {{ $order->tax_number }}

@if($order->delivery_boy_name)

Delivery By : {{ $order->delivery_boy_name ?? "" }}

@else

Delivery By : Not Assigned

@endif

Product Details:

@php $total_tax_amount = 0; $total_quantity = 0; $total_sub_total = 0; @endphp @foreach($order_items as $index => $item) @php // Use regex to extract the number and the word preg_match('/(\d+)\s*(\w+)/', $item->variant_name, $matches); // Get the number (10 in this case) $number = isset($matches[1]) ? (int)$matches[1] : 0; // Get the word (e.g., Gatta) $word = isset($matches[2]) ? $matches[2] : ''; // Multiply with the quantity $new_quantity = $item->quantity * $number; // Create the new string $string_quantity = $new_quantity . ' ' . $word; @endphp @php $total_tax_amount = $total_tax_amount + $item->tax_amount; $total_sub_total = $total_sub_total + $item->sub_total; @endphp @php $new_quantity = $item->quantity * $number; $total_quantity = $total_quantity + $new_quantity; $new_total_quantity = $total_quantity . ' ' . $word; @endphp @endforeach
Sr No. Name Unit Price Tax {{ $currency }} (%) Qty SubTotal ( {{ $currency }} )
{{ $index+1 }}
{{ $item->product_name }}
{{ $item->variant_name }}
{{ ($item->discounted_price != 0 && $item->discounted_price != "") ? $item->discounted_price : $item->price }} {{ $item->tax_amount. " (" .$item->tax_percentage."%)" }}
{{ $string_quantity }}
{{ $item->sub_total }}
Total {{ $total_tax_amount }}
{{ $new_total_quantity }}
{{ $total_sub_total }}

Payment Method : {{ strtoupper($order->payment_method) }}

@php $discount_in_rupees = 0; if ( $order->discount > 0) { $discounted_amount = $order->total * $order->discount / 100; $final_total = $order->total - $discounted_amount; $discount_in_rupees = $order->total - $final_total; } @endphp
Total Order Price ({{ $currency }}) {{ $order->total }}
Delivery Charge ({{ $currency }}) {{ $order->delivery_charge }}
Discount {{ $currency }} (%){{ '- ' . $discount_in_rupees . ' (' . $order->discount . '%)'}}
Promo ({{ $order->promo_code }}) Discount ({{ $currency }}) {{ '- ' . $order->promo_discount }}
Wallet Used ({{ $currency }}) {{ '- ' . $order->wallet_balance }}
Final Total ({{ $currency }}) {{ '= ' . $order->final_total}}
@if(\Request::route()->getName() == "customerInvoice") @endif