@php $show = json_decode($invoice_settings->show_column); @endphp {{ $lims_sale_data->customer->name . '_Sale_' . $lims_sale_data->reference_no }} @php $primary_color = isset($show->active_primary_color) && $show->active_primary_color == 1 && !empty($invoice_settings->primary_color) ? $invoice_settings->primary_color : '#014b94'; @endphp @if (preg_match('~[0-9]~', url()->previous())) @php $url = '../../pos'; @endphp @else @php $url = url()->previous(); @endphp @endif
{{ __('db.Back') }}

@if (isset($show->show_warehouse_info) && $show->show_warehouse_info == 1)

{{ gen_setting()->company_name ?? $lims_biller_data->company_name }}

{{ __('db.Address') }}:  {{ $lims_warehouse_data->address }}
{{ __('db.Phone') }}:  {{ $lims_warehouse_data->phone }}
@if (gen_setting()->vat_registration_number && isset($show->show_vat_registration_number) && $show->show_vat_registration_number == 1)
{{ __('db.VAT Number') }}:  {{ gen_setting()->vat_registration_number }}
@endif @endif
@if (gen_setting()->site_logo || $invoice_settings->company_logo) @endif
{{ __('db.reference') }}: {{ $lims_sale_data->reference_no }}
{{ __('db.date') }}: @if (isset($show->active_date_format) && $show->active_date_format == 1) {{ Carbon\Carbon::parse($lims_sale_data->created_at)->format($invoice_settings->invoice_date_format) }} @else {{ $lims_sale_data->created_at }} @endif
@if ($paid_by_info)
{{ __('db.Paid By') }}: {{ $paid_by_info }}
@endif @if (isset($show->show_biller_info) && $show->show_biller_info == 1)
{{ __('db.Served By') }}: {{ $lims_bill_by['name'] }} - ({{ $lims_bill_by['user_name'] }})
@endif
@if (isset($show->show_bill_to_info) && $show->show_bill_to_info == 1) @endif

Bill To

{{ __('db.customer') }}: {{ $lims_customer_data->name }}
{{__('Tax Number')}}:  {{$lims_customer_data->tax_no}}
{{ __('db.Address') }}:   @if ($lims_sale_data->sale_type == 'online') {{ $lims_sale_data->shipping_name }}, {{ $lims_sale_data->shipping_address }}, {{ $lims_sale_data->shipping_city }}, {{ $lims_sale_data->shipping_country }}, {{ $lims_sale_data->shipping_zip }} @else {{ $lims_customer_data->address }} @endif
@if (isset($lims_customer_data->phone_number) || isset($lims_sale_data->shipping_phone))
Phone:   @if ($lims_sale_data->sale_type == 'online') {{ $lims_sale_data->shipping_phone }} @else {{ $lims_customer_data->phone_number }} @endif
@endif
@foreach ($line_items as $key => $item) @endforeach @if (gen_setting()->invoice_format == 'gst' && gen_setting()->state == 1) @elseif(gen_setting()->invoice_format == 'gst' && gen_setting()->state == 2) @else @endif @if (gen_setting()->currency_position == 'prefix') @else @endif @if ($change_amount > 0) @else @endif @if ($totalDue && isset($show->hide_total_due) && $lims_customer_data->type != 'walkin') @if (!$show->hide_total_due) @endif @endif
# {{ __('db.Description') }} {{ __('db.qty') }} {{ __('db.Unit Price') }} {{ __('db.Total') }} {{ __('db.Tax') }} {{ __('db.Subtotal') }}
{{ $key + 1 }} {!! $item->product_name !!} @if (!empty($item->topping_names))
({{ implode(', ', $item->topping_names) }}) @endif @foreach ($item->custom_fields as $fieldName => $fieldValue) @if ($fieldValue)
{{ $fieldName }} {{ ': ' . $fieldValue }} @endif @endforeach @if ($item->imei_number && !str_contains($item->imei_number, 'null'))
IMEI or Serial: {{ $item->imei_number }} @endif @if (isset($item->warranty_duration))
Warranty{{ ': ' . $item->warranty_duration }}
Expire At{{ ': ' . $item->warranty_end }} @endif @if (isset($item->guarantee_duration))
Guarantee{{ ': ' . $item->guarantee_duration }}
Expire At{{ ': ' . $item->guarantee_end }} @endif
{{ $item->qty . ' ' . $item->unit_code . ' ' . $item->variant_name }} {{format_currency($item->net_unit_price, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }} @if (!empty($item->topping_prices))
+ {{ implode(' + ', array_map(fn($price) => number_format($price, gen_setting()->decimal, '.', ','), $item->topping_prices)) }} @endif
{{format_currency($item->line_total, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }} {{format_currency($item->tax, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }} {{format_currency($item->subtotal, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
@if (isset($show->show_payment_note) && $show->show_payment_note == 1 && $lims_sale_data->payment_note)

{{ __('db.Payment Note') }}:{{ $lims_sale_data->payment_note }}

@endif @if (isset($show->show_sale_note) && isset($lims_sale_data->sale_note) && $show->show_sale_note)

{{ __('db.Sale Note') }}:{{ $lims_sale_data->sale_note }}

@endif @if($installment_info)

INSTALMENT SALE

Plan: {{$installment_info->plan->name}}

Duration: {{$installment_info->plan->months}} Months

Additional Amount: {{format_currency($installment_info->plan->additional_amount, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$')}}

Down Payment: {{format_currency($installment_info->plan->down_payment, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$')}}

Instalments Paid: {{$installment_info->paid}}/{{$installment_info->total}}

@if($installment_info->next)

Next Due: {{\Carbon\Carbon::parse($installment_info->next->payment_date)->format('d M Y')}}

@endif
@endif
{{ __('db.Total Before Tax') }} {{ format_currency($lims_sale_data->total_price - ($lims_sale_data->total_tax + $lims_sale_data->order_tax), $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
IGST {{ format_currency($lims_sale_data->total_tax + $lims_sale_data->order_tax, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
SGST @php $total_tax_amount = ($lims_sale_data->total_tax + $lims_sale_data->order_tax) / 2; @endphp {{ format_currency($total_tax_amount, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
CGST @php $total_tax_amount = ($lims_sale_data->total_tax + $lims_sale_data->order_tax) / 2; @endphp {{ format_currency($total_tax_amount, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
{{ __('db.Tax') }} {{ format_currency($lims_sale_data->total_tax + $lims_sale_data->order_tax, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
{{ __('db.Discount') }} {{ format_currency($lims_sale_data->total_discount + $lims_sale_data->order_discount, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
{{ __('db.Shipping Cost') }} {{ format_currency($lims_sale_data->shipping_cost ?? 0, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
{{ __('db.grand total') }} {{ format_currency($lims_sale_data->grand_total, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
@if (isset($show->show_in_words) && $show->show_in_words == 1) {{ __('db.In Words') }}
{{ $currency_code }} {{ str_replace('-', ' ', $numberInWords) }} only @endif
{{ __('db.In Words') }}:
{{ str_replace('-', ' ', $numberInWords) }} {{ $currency_code }} only
{{ __('db.Paid') }} {{ format_currency($lims_sale_data->paid_amount, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
{{ __('db.Change') }} {{ format_currency($change_amount, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }} {{ __('db.Due') }} {{ format_currency($lims_sale_data->grand_total - $lims_sale_data->paid_amount, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}
{{ __('db.Total Due') }} {{ format_currency($totalDue, $lims_sale_data->currency->symbol ?? $lims_sale_data->currency->code ?? '$') }}


@if (isset($show->show_barcode) && $show->show_barcode == 1)