@extends('layouts.app') @php $editing = $payment->exists; $received = old('direction', $payment->direction) === 'received'; $title = ($editing ? 'Edit ' : 'New ').($received ? 'payment received' : 'vendor payment'); $formData = [ 'direction' => $received ? 'received' : 'paid', 'isEdit' => $editing, 'originalParty' => $editing ? ($received ? $payment->client_id : $payment->vendor_id) : null, 'originalTarget' => $editing ? ($received ? $payment->order_id : $payment->vendor_bill_id) : null, 'originalKey' => $editing && ! $received ? ($payment->vendor_assignment_item_id ? 'item:'.$payment->vendor_assignment_item_id : ($payment->vendor_assignment_id ? 'assignment:'.$payment->vendor_assignment_id : ($payment->vendor_bill_id ? 'bill:'.$payment->vendor_bill_id : ''))) : '', 'originalAmount' => $editing ? (float) $payment->amount : 0, 'overpayError' => $errors->has('confirm_overpay'), ]; @endphp @section('title', $title) @section('content') @can('payments.delete') @if ($editing)@endif @endcan
@csrf @if ($editing) @method('PUT') @endif @include('partials.error-summary')
@if ($received) @foreach ($clients as $c)@endforeach @foreach ($orders as $o)@endforeach @else @foreach ($vendors as $v)@endforeach @foreach ($assignments as $a)@endforeach @foreach ($bills as $b)@endforeach @endif
@foreach (\App\Models\Payment::METHODS as $key => $label)@endforeach @include('partials.assign-to', ['value' => $payment->assigned_to])
@if ($received) How this works
  • Pick an order to settle it exactly, or leave it on account to reduce the client's overall balance.
  • The amount fills in with what is still due on the order.
  • Paying more than is due needs a confirmation — it is kept as an advance.
@else How this works
  • Pick an assignment (or one of its products) to pay for that order, or a bill. Leave both empty for a general payment that reduces what you owe the vendor overall.
  • A general payment can be allocated to assignments later, from the assignment page or Ledger › Matching.
  • The amount fills in with what is still due on the bill.
  • Paying more than is due needs a confirmation — it is kept as an advance.
@endif
Cancel Unsaved changes
@endsection @push('modals') @include('partials.quick-add', ['type' => $received ? 'client' : 'vendor']) @endpush