From 2595f571c74ef424add3c3ca687b769f90df3cb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 00:21:09 +0200 Subject: [PATCH] Fix exclude credit note when searching situation invoice to use for next --- htdocs/core/class/html.form.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index acbd15712e5..ec7bfeab7c4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3582,10 +3582,11 @@ class Form $opt = ''; $sql = 'SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc'; - $sql.= ' FROM ' . MAIN_DB_PREFIX . 'facture'; - $sql.= ' WHERE entity IN ('.getEntity('invoice').')'; - $sql.= ' AND situation_counter>=1'; - $sql.= ' ORDER by situation_cycle_ref, situation_counter desc'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture'; + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; + $sql .= ' AND situation_counter>=1'; + $sql .= ' AND type <> 2'; + $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { // Last seen cycle