From 6b24f7bb0f4c0a46afc4273bf5b5f8993ee3ab7d Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Thu, 19 Feb 2026 13:44:27 +0100 Subject: [PATCH] fix error signed devis auto created contrat --- src/Controller/ContratController.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/Controller/ContratController.php b/src/Controller/ContratController.php index d72d5ac..ced58b1 100644 --- a/src/Controller/ContratController.php +++ b/src/Controller/ContratController.php @@ -185,21 +185,27 @@ class ContratController extends AbstractController $type = $contratsPayment->getType(); $state = $contratsPayment->getState(); $amount = $contratsPayment->getAmount(); - - if ($type !== "caution" && $type !== "solde" && $type !== "solde_partiel") { - // Should match 'accompte' or other types + if ($type == "accompte") { if ($state == "complete") { $soldeRestant -= $amount; + $paymentList[] = $contratsPayment; } - $paymentList[] = $contratsPayment; } else { - if ($state == "complete") { - if ($type == "caution") { - $paymentCaution[] = $contratsPayment; - } elseif ($type == "solde_partiel" || $type == "solde") { - $paymentCtaList[] = $contratsPayment; + if ($type !== "caution" && $type !== "solde" && $type !== "solde_partiel") { + // Should match 'accompte' or other types + if ($state == "complete") { $soldeRestant -= $amount; } + $paymentList[] = $contratsPayment; + } else { + if ($state == "complete") { + if ($type == "caution") { + $paymentCaution[] = $contratsPayment; + } elseif ($type == "solde_partiel" || $type == "solde") { + $paymentCtaList[] = $contratsPayment; + $soldeRestant -= $amount; + } + } } } }