fix error signed devis auto created contrat

This commit is contained in:
Serreau Jovann
2026-02-19 13:44:27 +01:00
parent c076b6c92d
commit 6b24f7bb0f

View File

@@ -185,21 +185,27 @@ class ContratController extends AbstractController
$type = $contratsPayment->getType(); $type = $contratsPayment->getType();
$state = $contratsPayment->getState(); $state = $contratsPayment->getState();
$amount = $contratsPayment->getAmount(); $amount = $contratsPayment->getAmount();
if ($type == "accompte") {
if ($type !== "caution" && $type !== "solde" && $type !== "solde_partiel") {
// Should match 'accompte' or other types
if ($state == "complete") { if ($state == "complete") {
$soldeRestant -= $amount; $soldeRestant -= $amount;
$paymentList[] = $contratsPayment;
} }
$paymentList[] = $contratsPayment;
} else { } else {
if ($state == "complete") { if ($type !== "caution" && $type !== "solde" && $type !== "solde_partiel") {
if ($type == "caution") { // Should match 'accompte' or other types
$paymentCaution[] = $contratsPayment; if ($state == "complete") {
} elseif ($type == "solde_partiel" || $type == "solde") {
$paymentCtaList[] = $contratsPayment;
$soldeRestant -= $amount; $soldeRestant -= $amount;
} }
$paymentList[] = $contratsPayment;
} else {
if ($state == "complete") {
if ($type == "caution") {
$paymentCaution[] = $contratsPayment;
} elseif ($type == "solde_partiel" || $type == "solde") {
$paymentCtaList[] = $contratsPayment;
$soldeRestant -= $amount;
}
}
} }
} }
} }