@includeIf('invoices.pdf.invoice_pdf_css')

@lang('app.credit-note')

@if (!is_null($creditNote->project) && !is_null($creditNote->project->client) && !is_null($creditNote->project->client->clientDetails)) @lang('modules.invoices.billedTo'):

{{ $creditNote->project->client->clientDetails->company_name }}

@lang('app.address') :
{!! nl2br($creditNote->project->clientDetails->address) !!}
@if ($creditNote->show_shipping_address === 'yes')
@lang('app.shippingAddress') :
{!! nl2br($creditNote->project->clientDetails->shipping_address) !!}
@endif @if ($invoiceSetting->show_project == 1 && isset($creditNote->project))

@lang('modules.invoices.projectName'):
{{ $creditNote->project->project_name }} @endif @if ($creditNoteSetting->show_gst == 'yes' && !is_null($creditNote->project->client->clientDetails->gst_number))
@lang('app.gstIn'): {{ $creditNote->project->client->clientDetails->gst_number }}
@endif @elseif(!is_null($creditNote->client_id) && !is_null($creditNote->clientDetails)) @lang('modules.invoices.billedTo'):

{{ $creditNote->clientDetails->company_name }}

@lang('app.address') :
{!! nl2br($creditNote->clientDetails->address) !!}
@if ($creditNote->show_shipping_address === 'yes')
@lang('app.shippingAddress') :
{!! nl2br($creditNote->clientDetails->shipping_address) !!}
@endif @if ($creditNoteSetting->show_gst == 'yes' && !is_null($creditNote->clientDetails->gst_number))
@lang('app.gstIn'): {{ $creditNote->clientDetails->gst_number }}
@endif @endif @if (is_null($creditNote->project) && !is_null($creditNote->estimate) && !is_null($creditNote->estimate->client->clientDetails)) @lang('modules.invoices.billedTo'):

{{ $creditNote->estimate->client->clientDetails->company_name }}

@lang('app.address') :
{!! nl2br($creditNote->estimate->client->clientDetails->address) !!}
@if ($creditNote->show_shipping_address === 'yes')
@lang('app.shippingAddress') :
{!! nl2br($creditNote->estimate->client->clientDetails->shipping_address) !!}
@endif @if ($creditNoteSetting->show_gst == 'yes' && !is_null($creditNote->estimate->client->clientDetails->gst_number))
@lang('app.gstIn'): {{ $creditNote->estimate->client->clientDetails->gst_number }}
@endif @endif
@lang('modules.invoices.generatedBy'):

{{ company()->company_name }}

@if (!is_null($settings))
{!! nl2br(default_address()->address) !!}
{{ company()->company_phone }}
@endif @if ($creditNoteSetting->show_gst == 'yes' && !is_null($creditNoteSetting->gst_number))
@lang('app.gstIn'): {{ $creditNoteSetting->gst_number }}
@endif
@lang('modules.invoices.invoiceNumber'): {{ $creditNote->invoice->invoice_number }}
@if ($creditNote)
@lang('app.credit-note'): {{ $creditNote->cn_number }}
@endif
@lang('modules.invoices.invoiceDate'): {{ $creditNote->issue_date->translatedFormat(company()->date_format) }}
@lang('app.status'): {{ $creditNote->status }}
@if ($invoiceSetting->hsn_sac_code_show) @endif @foreach ($creditNote->items as $item) @if ($item->type == 'item') @if ($invoiceSetting->hsn_sac_code_show) @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
# @lang('modules.invoices.item')@lang('app.hsnSac')@lang('modules.invoices.qty') @lang('modules.invoices.unitPrice') @lang('modules.invoices.tax') @lang('modules.invoices.price') ({!! htmlentities($creditNote->currency->currency_code) !!})
{{ ++$count }}

{{ $item->item_name }}

@if (!is_null($item->item_summary))
{!! nl2br(pdfStripTags($item->item_summary)) !!}
@endif @if ($item->creditNoteItemImage)

@endif

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

{{ $item->quantity }}@if($item->unit)
{{ $item->unit->unit_type }}@endif

{{ currency_format($item->unit_price, $creditNote->currency_id, false) }}

{{ $item->tax_list }} {{ currency_format($item->amount, $creditNote->currency_id, false) }}
        @lang('modules.invoices.subTotal') {{ currency_format($creditNote->sub_total, $creditNote->currency_id, false) }}
        @lang('modules.invoices.discount') {{ currency_format($discount, $creditNote->currency_id, false) }}
        {{ $key }} {{ currency_format($tax, $creditNote->currency_id, false) }}
@lang('modules.credit-notes.total') {{ currency_format($creditNote->total, $creditNote->currency_id, false) }}
@lang('modules.credit-notes.creditAmountUsed') {{ currency_format($creditNote->creditAmountUsed(), $creditNote->currency_id, false) }}
@lang('app.adjustment') @lang('app.amount') {{ currency_format($creditNote->adjustment_amount, $creditNote->currency_id, false) }}
@lang('modules.credit-notes.creditAmountRemaining') {{ currency_format($creditNote->creditAmountRemaining(), $creditNote->currency_id, false) }}

@if (!is_null($creditNote->note)) {!! nl2br($creditNote->note) !!}
@endif {!! nl2br($creditNoteSetting->invoice_terms) !!}