@foreach ($accountingVouchers as $accountingVoucher)

DEBIT NOTE

{{ $company->name }}

{{ $company->address }}


@if ($company->fssai_number) FSSAI LICENSE NO : {{ $company->fssai_number }}
@endif

PH:{{ $company->phone }}

Email:{{ $company->email }}

@if ($company->fssai_no != null)

Fssai No:{{ $company->fssai_no }}

@endif GST:{{ $company->gst }}       State:{{ $company->state }}
Details of Reciever(Billed to)
Name: {{ $accountingVoucher->customer ? $accountingVoucher->customer->name : $accountingVoucher->debitLedger->name }}
Address: {{ $accountingVoucher->customer ? $accountingVoucher->customer->address : $accountingVoucher->debitLedger->address }}
State: {{ $accountingVoucher->customer ? $accountingVoucher->customer->state : $accountingVoucher->debitLedger->state }}
Mobile: {{ $accountingVoucher->customer ? $accountingVoucher->customer->mobile : $accountingVoucher->debitLedger->mobile_no }}
GSTIN No :{{ $accountingVoucher->customer ? '' : $accountingVoucher->debitLedger->gst }}
TAX INVOICE
Invoice No : {{ $accountingVoucher->voucher_number }}
Invoice Date : {{ Carbon\Carbon::parse($accountingVoucher->voucher_date)->format('d-m-Y') }}
Invoice Type : {{ $accountingVoucher->voucherType->name }}
Sales Man : {{ $accountingVoucher->user ? $accountingVoucher->user->name : '' }}
@if ($accountingVoucher->items()->sum('igst') > 0) @else @endif @foreach ($accountingVoucher->items as $key => $item) @php $stockItemUnit = \App\Models\StockItemUnits::where('stock_item_id', $item->stock_item_id) ->where('is_base_unit', 0) ->first(); if ($stockItemUnit) { $unitQty = $stockItemUnit ? $stockItemUnit->unit_qty : 0; $altQty = $item->base_qty / $unitQty; $roundQty = floor($altQty); $remanInQty = $item->base_qty - $unitQty * $roundQty; } @endphp @if ($stockItemUnit) @else @endif @if ($accountingVoucher->items()->sum('igst') > 0) @else @endif @endforeach @if ($PrintSettings->extra_space == 1) @for ($i = $accountingVoucher->items()->count(); $i <= 15; $i++) @if ($accountingVoucher->items()->sum('igst') > 0) @else @endif @endfor @endif @if ($accountingVoucher->items()->sum('igst') > 0) @else @endif
s no HSN MRP Product Qty UOM Alt Unit Rate Disc Taxable Gst
%
IGSTCGST SGSTCESS Total
{{ $key + 1 }} {{ $item->stockItem->hsn_code }} @if ($item->batch_id != null) @php $lastInward = App\Models\StockLedger::where([ 'business_key' => Auth::user()->business_key, 'stock_item_id' => $item->stock_item_id, 'batch_id' => $item->batch_id, ]) ->where(function ($query) { $query->where('batch_mrp', '!=', null); }) ->orderBy('date', 'desc') ->first(); @endphp @if ($lastInward) {{ $lastInward->batch_mrp }} @else {{ $item->stockItem->getMrp($accountingVoucher->voucher_date) }} @endif @else {{ $item->stockItem->getMrp($accountingVoucher->voucher_date) }} @endif {{ $item->stockItem->name }} @if ($accountingVoucher->voucherType->name == 'Service Invoice') @if ($item->remarks != null)
({{ $item->remarks }}) @endif @endif
{{ $item->quantity }} {{ $item->unit->symbol }} {{ $roundQty }}-{{ $stockItemUnit->unit->symbol }} {{ $remanInQty }} - {{ $item->unit->symbol }}{{ number_format($item->price, 2) }} {{ number_format($item->disc_amount, 2) }} {{ number_format($item->taxable_value, 2) }} {{ $item->gst_per }}{{ number_format($item->igst, 2) }}{{ number_format($item->cgst, 2) }} {{ number_format($item->sgst, 2) }}{{ number_format($item->cess, 2) }} {{ number_format($item->total, 2) }}
 
{{ $accountingVoucher->items->sum('quantity') }} {{ number_format($accountingVoucher->items->sum('taxable_value'), 2) }} {{ number_format($accountingVoucher->items->sum('igst'), 2) }}{{ number_format($accountingVoucher->items->sum('cgst'), 2) }} {{ number_format($accountingVoucher->items->sum('sgst'), 2) }}{{ number_format($accountingVoucher->items->sum('cess'), 2) }} {{ number_format($accountingVoucher->items->sum('total'), 2) }}
@php $words = new \NumberFormatter('en', \NumberFormatter::SPELLOUT); $words = $words->format($accountingVoucher->amount); $additionalLedgers = \App\Models\AccountingVoucherLedger::where( 'accounting_voucher_id', $accountingVoucher->id, )->get(); $count = 0; @endphp
({{ $words }})
Sub Total {{ number_format($accountingVoucher->items()->sum('total'), 2) }}
Bill Discount {{ number_format($accountingVoucher->discount, 2) }}
Bill Total {{ $accountingVoucher->amount }}
{{-- --}}
Note:
Certified that the particulars given above are true and correct
@if ($company->bankLedger != null)
Bank Details
Bank Name : {{ $company->bankLedger->name }}
Branch : {{ $company->bankLedger->branch }}
A/C No : {{ $company->bankLedger->account_number }}
IFSC : {{ $company->bankLedger->ifsc_code }}
@if ($qr_code != null) @endif
Gpay Number : {{ $PrintSettings->gpay }}
@endif
For, {{ $company->name }}
@if ($PrintSettings->extra_space == 0) Remarks: {{ $accountingVoucher->remarks }}
GST Summary @php $hsn_codes = $accountingVoucher ->items() ->join('stock_items', 'accounting_voucher_items.stock_item_id', '=', 'stock_items.id') ->select( 'accounting_voucher_items.gst_per', \DB::raw('SUM(accounting_voucher_items.cgst) as cgst'), \DB::raw('SUM(accounting_voucher_items.sgst) as sgst'), \DB::raw('SUM(accounting_voucher_items.igst) as igst'), \DB::raw('SUM(accounting_voucher_items.taxable_value) as taxable_value'), ) ->groupBy('accounting_voucher_items.gst_per') ->get(); // @dd($hsn_codes); @endphp @foreach ($hsn_codes as $hsn_code) @endforeach
GST(%) Taxable Amt. CGST Amt. SGST Amt. Igst
{{ $hsn_code->gst_per }} {{ number_format($hsn_code->taxable_value, 2) }} {{ number_format($hsn_code->cgst) }} {{ number_format($hsn_code->sgst) }} {{ number_format($hsn_code->igst) }}
HSN Summary @php $hsn_codes = $accountingVoucher ->items() ->join('stock_items', 'accounting_voucher_items.stock_item_id', '=', 'stock_items.id') ->select( 'stock_items.hsn_code', 'accounting_voucher_items.gst_per', \DB::raw('SUM(accounting_voucher_items.cgst) as cgst'), \DB::raw('SUM(accounting_voucher_items.sgst) as sgst'), \DB::raw('SUM(accounting_voucher_items.igst) as igst'), \DB::raw('SUM(accounting_voucher_items.taxable_value) as taxable_value'), ) ->groupBy('stock_items.hsn_code', 'accounting_voucher_items.gst_per') ->get(); // @dd($hsn_codes); @endphp @foreach ($hsn_codes as $hsn_code) @endforeach
HSN/SAC Taxable Amt. CGST Amt. SGST Amt. Igst
{{ $hsn_code->hsn_code }} {{ number_format($hsn_code->taxable_value, 2) }} {{ number_format($hsn_code->cgst) }} {{ number_format($hsn_code->sgst) }} {{ number_format($hsn_code->igst) }}
@endif @if ($accountingVouchers->last() != $accountingVoucher)
@endif @endforeach