@php $colspan = ($invoiceSetting->hsn_sac_code_show) ? 5 : 4; @endphp
@if(!is_null($invoice->project) && !is_null($invoice->project->client)) @lang("modules.invoices.billedTo"):
{{ ucwords($invoice->project->client->name) }}
{{ ucwords($invoice->project->client->company_name) }}
@lang('app.address') :
{!! nl2br($invoice->project->clientdetails->address) !!}
@if ($invoice->show_shipping_address === 'yes')
@lang('app.shippingAddress') :
{!! nl2br($invoice->project->clientdetails->shipping_address) !!}
@endif
{{ $invoice->project->client->email }}
@if($invoiceSetting->show_gst == 'yes' && !is_null($invoice->project->client->gst_number))
@lang('app.gstIn'): {{ $invoice->project->client->gst_number }}
@endif @elseif(!is_null($invoice->client_id) && !is_null($invoice->clientdetails)) @lang("modules.invoices.billedTo"):
{{ ucwords($invoice->clientdetails->name) }}
{{ ucwords($invoice->clientdetails->company_name) }}
@lang('app.address') :
{!! nl2br($invoice->clientdetails->address) !!}
@if ($invoice->show_shipping_address === 'yes')
@lang('app.shippingAddress') :
{!! nl2br($invoice->clientdetails->shipping_address) !!}
@endif
{{ $invoice->clientdetails->email }}
@if($invoiceSetting->show_gst == 'yes' && !is_null($invoice->clientdetails->gst_number))
@lang('app.gstIn'): {{ $invoice->clientdetails->gst_number }}
@endif @endif
@lang("modules.invoices.generatedBy"):

{{ ucwords($company->company_name) }}

@if(!is_null($settings))
{!! nl2br($company->address) !!}
{{ $company->company_phone }}
@endif @if($invoiceSetting->show_gst == 'yes' && !is_null($invoiceSetting->gst_number))
@lang('app.gstIn'): {{ $invoiceSetting->gst_number }}
@endif

{{ $invoice->invoice_number }}

@if($creditNote)
@lang('app.credit-note'): {{ $creditNote->cn_number }}
@endif
@lang('app.menu.issues') @lang('app.date'): {{ $invoice->issue_date->format($company->date_format) }}
@if($invoice->status == 'unpaid')
@lang('app.dueDate'): {{ $invoice->due_date->format($company->date_format) }}
@endif
@lang('app.status'): {{ __('app.'.$invoice->status) }}
@if($invoiceSetting->hsn_sac_code_show) @endif @foreach($invoice->items as $item) @if($item->type == 'item') @if($invoiceSetting->hsn_sac_code_show) @endif @if(!is_null($item->item_summary)) @endif @endif @endforeach @if($invoiceSetting->hsn_sac_code_show) @endif @if($discount != 0 && $discount != '') @if($invoiceSetting->hsn_sac_code_show) @endif @endif @foreach($taxes as $key=>$tax) @if($invoiceSetting->hsn_sac_code_show) @endif @endforeach @if ($invoice->credit_notes()->count() > 0) @endif
# @lang("modules.invoices.item") @lang('modules.invoices.hsnSacCode')@lang("modules.invoices.qty") @lang("modules.invoices.unitPrice") ({!! htmlentities($invoice->currency->currency_code) !!}) @lang("modules.invoices.price") ({!! htmlentities($invoice->currency->currency_code) !!})
{{ ++$count }}

{{ ucfirst($item->item_name) }}

{{ $item->hsn_sac_code ?? '--' }}

{{ $item->quantity }}

{{ number_format((float)$item->unit_price, 2, '.', '') }}

{{ number_format((float)$item->amount, 2, '.', '') }}
hsn_sac_code_show) colspan="4" @else colspan="3" @endif> {{ $item->item_summary }}
@lang("modules.invoices.subTotal") {{ number_format((float)$invoice->sub_total, 2, '.', '') }}
@lang("modules.invoices.discount") -{{ number_format((float)$discount, 2, '.', '') }}
{{ strtoupper($key) }} {{ number_format((float)$tax, 2, '.', '') }}
@lang("modules.invoices.total") {{ number_format((float)$invoice->total, 2, '.', '') }}
@lang('modules.invoices.appliedCredits') {{ number_format((float)$invoice->appliedCredits(), 2, '.', '') }}
@lang("modules.invoices.total") @lang("modules.invoices.paid") {{ number_format((float)$invoice->amountPaid(), 2, '.', '') }}
@lang("modules.invoices.total") @lang("modules.invoices.due") {{ number_format((float)$invoice->amountDue(), 2, '.', '') }}


@if(!is_null($invoice->note)) {!! nl2br($invoice->note) !!}
@endif {!! nl2br($invoiceSetting->invoice_terms) !!}

{{--Custom fields data--}} @if(isset($fields) && count($fields) > 0)

@lang('modules.projects.otherInfo')

@foreach($fields as $field) @endforeach
{{ ucfirst($field->label) }}

@if( $field->type == 'text') {{$invoice->custom_fields_data['field_'.$field->id] ?? '-'}} @elseif($field->type == 'password') {{$invoice->custom_fields_data['field_'.$field->id] ?? '-'}} @elseif($field->type == 'number') {{$invoice->custom_fields_data['field_'.$field->id] ?? '-'}} @elseif($field->type == 'textarea') {{$invoice->custom_fields_data['field_'.$field->id] ?? '-'}} @elseif($field->type == 'radio') {{ !is_null($invoice->custom_fields_data['field_'.$field->id]) ? $invoice->custom_fields_data['field_'.$field->id] : '-' }} @elseif($field->type == 'select') {{ (!is_null($invoice->custom_fields_data['field_'.$field->id]) && $invoice->custom_fields_data['field_'.$field->id] != '') ? $field->values[$invoice->custom_fields_data['field_'.$field->id]] : '-' }} @elseif($field->type == 'checkbox') {{ !is_null($invoice->custom_fields_data['field_'.$field->id]) ? $field->values[$invoice->custom_fields_data['field_'.$field->id]] : '-' }} @elseif($field->type == 'date') {{ !is_null($invoice->custom_fields_data['field_'.$field->id]) ? \Carbon\Carbon::parse($invoice->custom_fields_data['field_'.$field->id])->format($global->date_format) : '--'}} @endif

@endif @if(!is_null($payments))

@lang('modules.invoices.recentPayments')

@forelse($payments as $key => $payment) @empty @endforelse
# @lang("modules.payments.amount") @lang("modules.invoices.paymentMethod") @lang("modules.invoices.paidOn")
{{ $key+1 }} {!! currency_position($payment->amount, $invoice->currency->currency_symbol) !!} @php($method = (!is_null($payment->offline_method_id)? $payment->offlineMethod->name : $payment->gateway)) {{ $method }} {{ $payment->paid_on->format($global->date_format) }}
@endif