@php use App\Models\Setting; use App\Support\AddressFormatter; use App\Support\AmountInWords; $company = [ 'name' => Setting::get('company_name', config('app.name')), 'address' => Setting::get('company_address', ''), 'owner' => Setting::get('company_owner', ''), 'pincode' => Setting::get('company_pincode', ''), 'phone' => Setting::get('company_phone', ''), 'email' => Setting::get('company_email', ''), 'gstin' => Setting::get('company_gstin', ''), 'state' => Setting::get('company_state', ''), 'state_code' => Setting::get('company_state_code', ''), ]; $companyAddress = collect([ $company['owner'] ? "({$company['owner']})" : null, AddressFormatter::flow($company['address']), ])->filter()->implode(', '); if ($company['pincode']) { $companyAddress = trim($companyAddress.' - '.$company['pincode'], ' -'); } $customerAddress = AddressFormatter::flow($saleReturn->customer->address); $sale = $saleReturn->sale; $declaration = Setting::get('credit_note_declaration', 'This credit note is issued against the invoice referenced above and reduces the amount payable by that invoice accordingly.'); $interState = $saleReturn->isInterState(); $summary = $saleReturn->taxSummary(); $cgstTotal = collect($summary)->sum('cgst'); $sgstTotal = collect($summary)->sum('sgst'); $igstTotal = collect($summary)->sum('igst'); @endphp {{ $saleReturn->return_number }} — {{ $company['name'] }} @unless ($forPdf ?? false)
← Back to sale Download PDF
@endunless

CREDIT NOTE

{{ $company['name'] }}
@if ($companyAddress)
{{ $companyAddress }}
@endif
@if ($company['gstin'])GSTIN/UIN: {{ $company['gstin'] }}@endif @if ($company['state'])  |  State: {{ $company['state'] }}@if ($company['state_code']), Code: {{ $company['state_code'] }}@endif @endif @if ($company['phone'])  |  Mob: {{ $company['phone'] }}@endif @if ($company['email'])  |  {{ $company['email'] }}@endif
Buyer
{{ $saleReturn->customer->name }}
@if ($saleReturn->customer->contact_person){{ $saleReturn->customer->contact_person }}
@endif @if ($customerAddress){{ $customerAddress }}
@endif {{ collect([$saleReturn->customer->city, $saleReturn->customer->state, $saleReturn->customer->pincode])->filter()->implode(', ') }}
@if ($saleReturn->customer->gstin)GSTIN/UIN: {{ $saleReturn->customer->gstin }}@endif
Credit Note Details
Credit Note No.: {{ $saleReturn->return_number }}
Dated: {{ $saleReturn->return_date->format('d-M-Y') }}
Against Invoice No.: {{ $sale->invoice_number }}, dated {{ $sale->sale_date->format('d-M-Y') }}
Supply: {{ $interState ? 'Inter-State (IGST)' : 'Intra-State (CGST + SGST)' }}
Returned to: {{ $saleReturn->warehouse->name }}
@foreach ($saleReturn->items as $item) @endforeach @if ($interState) @else @endif
Sl
No.
Description of Goods HSN GST
Rate
Quantity Rate per Amount
{{ $loop->iteration }} {{ $item->product?->name ?? "Deleted product (#{$item->product_id})" }} {{ $item->product?->hsn_code ?: '—' }} {{ rtrim(rtrim(number_format((float) $item->tax_rate, 2), '0'), '.') }} % {{ $item->quantity }} {{ $item->product?->unit ?: 'PCS' }} {{ number_format((float) $item->unit_price, 2) }} {{ $item->product?->unit ?: 'PCS' }} {{ number_format((float) $item->line_total, 2) }}
Total {{ $saleReturn->items->sum('quantity') }} PCS {{ number_format((float) $saleReturn->subtotal, 2) }}
IGST{{ number_format($igstTotal, 2) }}
CGST{{ number_format($cgstTotal, 2) }}
SGST{{ number_format($sgstTotal, 2) }}
Total Credit ₹ {{ number_format((float) $saleReturn->total, 2) }}

Amount (in words): {{ AmountInWords::rupees((float) $saleReturn->total) }} E. & O.E

@if ($interState) @else @endif @foreach ($summary as $bucket) @php $tax = $bucket['cgst'] + $bucket['sgst'] + $bucket['igst']; @endphp @if ($interState) @else @endif @endforeach @if ($interState) @else @endif
GST Rate Taxable ValueIGST RateIGST AmtCGST RateCGST AmtSGST RateSGST AmtTotal Tax
{{ rtrim(rtrim(number_format($bucket['rate'], 2), '0'), '.') }}% {{ number_format($bucket['taxable'], 2) }}{{ rtrim(rtrim(number_format($bucket['rate'], 2), '0'), '.') }}% {{ number_format($bucket['igst'], 2) }}{{ rtrim(rtrim(number_format($bucket['rate'] / 2, 2), '0'), '.') }}% {{ number_format($bucket['cgst'], 2) }} {{ rtrim(rtrim(number_format($bucket['rate'] / 2, 2), '0'), '.') }}% {{ number_format($bucket['sgst'], 2) }}{{ number_format($tax, 2) }}
Total {{ number_format((float) $saleReturn->subtotal, 2) }}{{ number_format($igstTotal, 2) }}{{ number_format($cgstTotal, 2) }} {{ number_format($sgstTotal, 2) }}{{ number_format((float) $saleReturn->tax_total, 2) }}
@if ($saleReturn->notes)

Reason for return: {{ $saleReturn->notes }}

@endif
for {{ $company['name'] }}


Authorised Signatory
Declaration: {{ $declaration }}

This is a Computer Generated Credit Note