@extends('layout.app') @section('title', 'Print Purchase Voucher #' . $purchaseVoucher->voucher_no) @push('header_script') @endpush @section('content')
Back
@php $companyStateId = optional($companyDetails)->state_id; $partyStateId = optional($partyDetails)->state_id; $isIntra = $companyStateId == $partyStateId; $isRegular = optional($partyDetails)->register_type === 'Regular'; // Detect if RCM was enabled $hasItemTaxGroups = false; foreach($purchaseVoucher->voucherDetails as $dt) { if($dt->tax_group_id && $dt->taxGroup && $dt->taxGroup->tax_slab !== 'None') { $hasItemTaxGroups = true; } } $isRcm = $isRegular && $hasItemTaxGroups && $purchaseVoucher->final_tax_total == 0; // Check if batch or expiry fields have values to display $hasBatch = $purchaseVoucher->voucherDetails->contains(fn($d) => !empty($d->batch_no)); $hasExpiry = $purchaseVoucher->voucherDetails->contains(fn($d) => !empty($d->expiry_date)); @endphp
{{ $companyDetails->company_name ?? 'Purchase Voucher' }}
{{-- VOUCHER DETAILS --}}
Voucher Details
Voucher No.
{{ $purchaseVoucher->voucher_no }}
Voucher Date
{{ \Carbon\Carbon::parse($purchaseVoucher->voucher_date)->format('d-M-Y') }}
Supplier Invoice No.
{{ $purchaseVoucher->supplier_invoice_no ?: '—' }}
Supplier Invoice Date
{{ $purchaseVoucher->supplier_invoice_date ? \Carbon\Carbon::parse($purchaseVoucher->supplier_invoice_date)->format('d-M-Y') : '—' }}
{{-- PARTY & INFO --}}
Party Details
Party Name{{ $purchaseVoucher->accountLedger->ledger_name ?? '—' }}
GST No.{{ optional($partyDetails)->gst_no ?: 'Not registered' }}
Mobile{{ optional($partyDetails)->mobile_no ?? '—' }}
Address{{ optional($partyDetails)->address ?? '—' }}
State{{ optional(optional($partyDetails)->state)->state_name ?? '—' }}
GST Type{{ optional($partyDetails)->register_type ?? '—' }}
Information Panel
Tax Type{{ $isIntra ? 'Intra-state (CGST+SGST)' : 'Inter-state (IGST)' }}
RCM Status{{ $isRcm ? 'Active' : 'Inactive' }}
Created By{{ $purchaseVoucher->created_by }}
{{-- SELECTED ITEMS --}}
Selected Item Details
@if($hasBatch) @endif @if($hasExpiry) @endif @if($isRegular && !$isRcm) @endif @foreach ($purchaseVoucher->voucherDetails as $detail) @if($hasBatch) @endif @if($hasExpiry) @endif @if($isRegular && !$isRcm) @endif @endforeach
Item Name HSNBatch No.ExpiryQty Rate TaxableGST% Tax AmtTotal
{{ $detail->product->product_name ?? 'N/A' }} {{ $detail->product->hsn_code ?? '—' }}{{ $detail->batch_no ?: '—' }}{{ $detail->expiry_date ? \Carbon\Carbon::parse($detail->expiry_date)->format('d-M-Y') : '—' }}{{ $detail->qty }} ₹{{ number_format($detail->rate, 2) }} ₹{{ number_format($detail->amount, 2) }}{{ $detail->tax }}% ₹{{ number_format($detail->tax_amount, 2) }}₹{{ number_format($detail->total_amount, 2) }}
{{-- OTHER CHARGES --}} @if($purchaseVoucher->voucherExpense->isNotEmpty() || $purchaseVoucher->voucherAfterGstCharge->isNotEmpty())
Other Charges & Discounts
@if($isRegular && !$isRcm) @endif @foreach ($purchaseVoucher->voucherExpense as $expense) @if($isRegular && !$isRcm) @endif @endforeach @foreach ($purchaseVoucher->voucherAfterGstCharge as $afterGst) @if($isRegular && !$isRcm) @endif @endforeach
Description Amount TypeGST Breakdown
{{ $expense->ledger->ledger_name ?? 'Charge' }} ₹{{ number_format($expense->exp_amount, 2) }} Before GST @if($expense->expense_tax_amount > 0) GST ({{ $expense->expense_tax }}%): ₹{{ number_format($expense->expense_tax_amount, 2) }} @else — @endif
{{ $afterGst->ledger->ledger_name ?? 'Charge' }} ₹{{ number_format($afterGst->after_gst_amount, 2) }} After GST— (Exempt)
@endif {{-- REMARK & CALCULATION SUMMARY --}}
Remarks
{{ $purchaseVoucher->remark ?: 'No remarks entered.' }}
@php $total_before_gst = $purchaseVoucher->voucherExpense->sum('exp_amount'); $total_after_gst = $purchaseVoucher->voucherAfterGstCharge->sum('after_gst_amount'); $total_taxable = $purchaseVoucher->total_purchase_amount + $total_before_gst; @endphp
Item Taxable Value₹{{ number_format($purchaseVoucher->total_purchase_amount, 2) }}
Other Charges Taxable₹{{ number_format($total_before_gst, 2) }}
Total Taxable Value₹{{ number_format($total_taxable, 2) }}
@if($isRegular && !$isRcm) @if($isIntra)
CGST₹{{ number_format($purchaseVoucher->final_tax_total / 2, 2) }}
SGST₹{{ number_format($purchaseVoucher->final_tax_total / 2, 2) }}
@else
IGST₹{{ number_format($purchaseVoucher->final_tax_total, 2) }}
@endif @endif
Other Charges (after GST)₹{{ number_format($total_after_gst, 2) }}
Round Off{{ $purchaseVoucher->round_off >= 0 ? '+' : '' }}₹{{ number_format($purchaseVoucher->round_off, 2) }}
Invoice Total₹{{ number_format($purchaseVoucher->net_total, 2) }}
Paid Amount ₹{{ number_format($purchaseVoucher->total_paid, 2) }}
Remaining Balance ₹{{ number_format($purchaseVoucher->balance, 2) }}
@if($isRcm) @php $rcm_payable = 0; foreach ($purchaseVoucher->voucherDetails as $detail) { if ($detail->taxGroup && is_numeric($detail->taxGroup->tax_slab)) { $rcm_payable += ($detail->amount * $detail->taxGroup->tax_slab) / 100; } } foreach ($purchaseVoucher->voucherExpense as $expense) { if ($expense->taxGroup && is_numeric($expense->taxGroup->tax_slab)) { $rcm_payable += ($expense->exp_amount * $expense->taxGroup->tax_slab) / 100; } } @endphp @if($rcm_payable > 0)
RCM Payable to Govt. ₹{{ number_format($rcm_payable, 2) }}
Self-assessed — not part of invoice total
@endif @endif
@endsection