feat: add sous-devis generation from commandes
From a commande, users can now create one or more sub-quotes (sous-devis) to ventilate purchases across communes for approval. - Add parent_devis_id and commande_id FKs on devis table - Order model: sousDevis() hasMany relation - Devis model: commande() and parent() relations - DevisController: createFromCommande / storeFromCommande methods - OrderController: load and pass sous_devis on show - Commandes/Show: "Créer un sous-devis" button + ventilation panel - Devis/CreateFromCommande: form pre-loaded with commande context - Devis/Index: badge "Sous-devis · CMD-XXXX" on linked quotes - Devis/Show: back-link to originating commande Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
7312c7640b
commit
8d51f4de3e
@@ -45,6 +45,11 @@ class Order extends Model
|
||||
return $this->hasMany(Attachment::class);
|
||||
}
|
||||
|
||||
public function sousDevis()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Devis::class, 'commande_id')->latest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope par statut(s).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user