@extends('master.app') @section('title', 'customer') @section('body')
{{-- Page Header / Actions --}}

Edit Invoice

Invoice # {{ $bill->invoice_number }} Date: {{ $bill->invoice_date }} Customer: {{ $bill->customer->name ?? '' }}
{{-- Optional: show previous balance if you pass it from controller --}} @isset($previous_balance)
Previous Balance: {{ number_format($previous_balance, 2) }}
@endisset
Back
{{-- Main Content --}}
{{-- Bill Type Header + Items --}} @if ($bill->type_id == 1) @include('sale.bills.next-header-from')
@include('sale.bills.next-item-table') @endif @if ($bill->type_id == 2) @include('sale.bills.row-bills.next-header-form')
@include('sale.bills.row-bills.next-item-table') @endif {{-- Invoice Statement --}}

Invoice Statement

Update the invoice details and checkout
@include('general.valert')
@method('put') @csrf
{{-- Type --}}
{{-- Customer --}}
{{-- Invoice Number --}}
{{-- Title --}}
{{-- Date --}}
@if ($bdate == 1) @else @endif
{{-- File --}}
{{-- Currency --}}
{{-- Exchange Rate --}}
{{-- Totals Summary --}} @php $items_total = $bill_items->sum('total'); $total = $items_total == 0 ? $bill->grand_total : $items_total; $r_amount = $bill->received ?? 0; $d_amount = $bill->discount ?? 0; $balance_now = $total - ($r_amount + $d_amount); // Optional previous balance $prevBal = isset($previous_balance) ? (float) $previous_balance : 0; $newTotalDue = $prevBal + $balance_now; @endphp
Totals Summary
Current Balance: {{ number_format($balance_now, 2) }}
@isset($previous_balance)
Previous Balance: {{ number_format($previous_balance, 2) }} New Total Due: {{ number_format($newTotalDue, 2) }}
@endisset
{{-- Payment Info --}}
{{-- Submit --}}
{{-- Hidden Print Template --}}
@endsection @section('pageCSS') @endsection @section('pageJs') {{-- Barcode --}} @if ($bill->type_id == 1) @if ($bsload == 1) @include('sale.bills.script') @else @include('sale.bills.stock_load2.script') @endif @else @include('sale.bills.scriptrow') @endif @endsection