From 0c01f6e1395b4926817a0bb0e70422a1ead5da3f Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Fri, 20 Jul 2018 15:53:32 +0200 Subject: [PATCH 1/2] Fix situation invoice status --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d5835f96781..3bf70b9fc38 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4730,7 +4730,7 @@ else if ($id > 0 || ! empty($ref)) } // For situation invoice with excess received - if ($object->statut == Facture::STATUS_VALIDATED + if ($object->statut > 0 && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) > 0 && $user->rights->facture->creer && !$objectidnext @@ -4748,7 +4748,7 @@ else if ($id > 0 || ! empty($ref)) } // remove situation from cycle - if ($object->statut == Facture::STATUS_VALIDATED + if ($object->statut > 0 && $object->type == Facture::TYPE_SITUATION && $user->rights->facture->creer && !$objectidnext From 869a97c8d1942a8b570db4225e881af6fc2f96e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Jul 2018 17:49:10 +0200 Subject: [PATCH 2/2] Update card.php --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3bf70b9fc38..45e94d1e5d3 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4730,7 +4730,7 @@ else if ($id > 0 || ! empty($ref)) } // For situation invoice with excess received - if ($object->statut > 0 + if ($object->statut > Facture::STATUS_DRAFT && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) > 0 && $user->rights->facture->creer && !$objectidnext @@ -4748,7 +4748,7 @@ else if ($id > 0 || ! empty($ref)) } // remove situation from cycle - if ($object->statut > 0 + if ($object->statut > Facture::STATUS_DRAFT && $object->type == Facture::TYPE_SITUATION && $user->rights->facture->creer && !$objectidnext