@extends('layouts.app') @section('page_title',$customer->exists?'Edit Customer':'New Customer') @section('content')<form method="POST" action="{{ $customer->exists ? route('customers.update',$customer) : route('customers.store') }}">@csrf @if($customer->exists) @method('PUT') @endif <div class="card top-card"><div class="card-body"><div class="row g-3"><div class="col-md-6"><label>Name</label><input name="name" value="{{ old('name',$customer->name) }}" class="form-control" required></div><div class="col-md-6"><label>Company</label><input name="company_name" value="{{ old('company_name',$customer->company_name) }}" class="form-control"></div><div class="col-md-6"><label>Phone</label><input name="phone" value="{{ old('phone',$customer->phone) }}" class="form-control"></div><div class="col-md-6"><label>Currency</label><select name="currency_id" class="form-select"><option value="">None</option>@foreach($currencies as $c)<option value="{{ $c->id }}" @selected(old('currency_id',$customer->currency_id)==$c->id)>{{ $c->code }}</option>@endforeach</select></div><div class="col-md-6"><label>Credit Limit</label><input type="number" step="0.01" name="credit_limit" value="{{ old('credit_limit',$customer->credit_limit) }}" class="form-control"></div><div class="col-md-6"><label>Opening Balance</label><input type="number" step="0.01" name="opening_balance" value="{{ old('opening_balance',$customer->opening_balance) }}" class="form-control"></div><div class="col-12"><label>Address</label><textarea name="address" class="form-control">{{ old('address',$customer->address) }}</textarea></div><div class="col-12"><label><input type="checkbox" name="is_active" value="1" @checked(old('is_active',$customer->is_active ?? true))> Active</label></div><div class="col-12 text-end"><button class="btn btn-success">Save</button></div></div></div></div></form>@endsection
