@extends('layout.app') @section('title', 'Generate Freight Invoice') @push('header_script') @endpush @section('content')
Back to Selection
{!! Form::open([ 'route' => ['freight-billing.store'], 'class' => 'needs-validation', 'method' => 'post', 'autocomplete' => 'off', 'id' => 'invoiceForm', 'onsubmit' => 'document.getElementById("BtnSubmit").disabled = true', ]) !!}
{{-- ======================================== SECTION 1: INVOICE DETAILS ======================================== --}}
Invoice Details
{{ $errors->first('invoice_date') }}
{{-- ======================================== PARTY DETAILS CARD ======================================== --}}
Party Details
{{ $partyDetail->party_name ?? 'N/A' }}
{{ $partyDetail->gst_no ?? 'N/A' }}
{{ $partyDetail->mobile_no ?? 'N/A' }}
{{ $partyDetail->address ?? 'N/A' }}
{{ $partyDetail->city ?? '' }} - {{ $partyDetail->state->state_name ?? '' }}
{{-- Hidden inputs --}} @if (isset($partyDetail->id)) @endif
{{-- ======================================== BANK DETAILS CARD ======================================== --}}
Bank Details
{!! Form::select( 'client_bank_id', ['' => '--Select Bank Account--'] + $bank, old('client_bank_id', $defaultBankId ?? null), [ 'class' => 'form-control select2', 'id' => 'client_bank_id', 'required', ], ) !!}
Bank Name: -
Account No: -
IFSC Code: -
{{-- ======================================== SECTION 3: SELECTED GR SUMMARY TABLE ======================================== --}}
Selected GR Details
{{-- {{ count($freightDatas) }} Items --}}
@php $rowNum = 1; @endphp @foreach ($freightDatas as $index => $freight) @php $selectedData = $selectedGRs[$freight->id] ?? null; // GROUP QTY BY UNIT $groupedUnits = $freight->items->groupBy('weight_unit'); // USE FREIGHT ENTRY SUB-TOTAL AS BASE $freightSubTotal = floatval($freight->sub_total ?? 0); $halting = floatval($selectedData['halting'] ?? 0); $extra = floatval($selectedData['extra_charge'] ?? 0); $deduction = floatval($selectedData['any_deduction'] ?? 0); $netAmount = $freightSubTotal + $halting + $extra - $deduction; @endphp {{-- FROM TO --}} {{-- QTY MULTI UNIT --}} {{-- RATE MULTI UNIT --}} {{-- SUB TOTAL (AUTO CALCULATED) --}} {{-- HALTING --}} {{-- EXTRA --}} {{-- DEDUCTION --}} {{-- NET --}} @endforeach
# GR No Date Truck No From - To Qty Rate Freight Amount (+) Halting (+) Extra (-) Deduct Net Amount Action
{{ $rowNum++ }} {{ $freight->lr_no }} {{ date('d-M-y', strtotime($freight->date)) }} {{ $freight->vehicle->vehicle_no ?? '-' }}
{{ $freight->from_location }} {{ $freight->to_location }}
@foreach ($groupedUnits as $unit => $rows)
{{ number_format($rows->sum('charge_weight'), 2) }} {{ $unit }}
@endforeach
@foreach ($freight->items as $item)
{{ number_format($item->rate, 2) }} / {{ $item->weight_unit }}
@endforeach
Total 0.00 0.00 0.00 0.00 0.00
Invoice Summary
{{-- Total Amount --}}
Sub Total
{{-- Less Discount --}}
Discount
{{-- Total After Discount --}}
Taxable Amount
{{-- GST Section --}}
@php $taxSettings = \App\Http\Helpers\CommonHelper::checkTaxSetting('enable_gst'); @endphp @if (($taxSettings['enable_gst_type'] ?? '') == 'rcm')
RCM Applied (5%)
@else
{{-- GST Amount --}}
GST Amount
@endif
{{-- Other Amount --}} {{--
Add/Less: Round Off
--}}
{{-- Final Total --}}
Grand Total

₹ 0.00

{{-- Submit Button --}}
{!! Form::close() !!}
@endsection @push('footer_script') @endpush