@props([ 'expense' => null, 'expenseTypes' => [], 'suppliers' => [], 'hasPayments' => false ]) @php $isEdit = !is_null($expense); $action = $isEdit ? route('provider.expenses.update', $expense->uuid) : route('provider.expenses.store'); $method = $isEdit ? 'PUT' : 'POST'; $title = $isEdit ? 'Modifier l\'achat' : 'Informations de l\'achat'; $submitText = $isEdit ? 'Modifier l\'achat' : 'Enregistrer l\'achat'; $backUrl = $isEdit ? route('provider.expenses.show', $expense->uuid) : route('provider.finances.index', ['tab' => 'achats']); $readonly = $isEdit && $hasPayments; @endphp

{{ $title }}

@if($readonly)

⚠️ Cet achat a des paiements. Seule la note peut être modifiée.

@endif
@csrf @if($isEdit) @method('PUT') @endif
@if(!$readonly) @endif
@if(!$readonly) @endif
Annuler {{ $submitText }}