From 09ba059c2198c0c59dcaa305283793fba3ae0de0 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 31 Jan 2019 11:03:06 +0100 Subject: [PATCH 1/2] FIX : need an order by in case we found other invoice with same number but not same date --- htdocs/core/modules/facture/mod_facture_mars.php | 1 + htdocs/core/modules/facture/mod_facture_terre.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 831dce5d3e4..08edc1b6b90 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -178,6 +178,7 @@ class mod_facture_mars extends ModeleNumRefFactures $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; $sql.= " AND entity IN (".getEntity('invoicenumber').")"; + $sql.= " ORDER BY ref DESC"; dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 174d8314784..61a2f04c891 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -194,6 +194,7 @@ class mod_facture_terre extends ModeleNumRefFactures $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; $sql.= " AND entity IN (".getEntity('invoicenumber').")"; + $sql.= " ORDER BY ref DESC"; dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); From caa937660d4b26b7e6e04407e92610da34095c50 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 31 Jan 2019 12:43:39 +0100 Subject: [PATCH 2/2] FIX : wrong test enabled --- htdocs/supplier_proposal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 8c2bfb8090a..7a56d73afff 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1725,7 +1725,7 @@ if ($action == 'create') } // Create an order - if (! empty($conf->commande->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { + if (! empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { if ($user->rights->fournisseur->commande->creer) { print ''; }