From 4c0dc21ca02614b4dc97464c787c86c7783c01ee Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 18 Jan 2018 14:07:32 +0100 Subject: [PATCH] Fix validate contrat was not using force_number parameter --- htdocs/contrat/class/contrat.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 375c98c3c0b..86a57b1c144 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -322,7 +322,11 @@ class Contrat extends CommonObject $result=$this->thirdparty->set_as_client(); // Define new ref - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life + if ($force_number) + { + $num = $force_number; + } + else if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($this->thirdparty); }