diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index f7c173a401d..010fcf191cc 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -214,7 +214,7 @@ class DoliDBPgsql extends DoliDB // nuke unsigned $line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line); - $line=preg_replace('/as signed/i','as integer',$line); + $line=preg_replace('/as signed/i','as integer',$line); // blob -> text $line=preg_replace('/\w*blob/i','text',$line); diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 3e6beaa9eeb..2bd3c757e47 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -802,7 +802,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m if ($counter >= pow(10, dol_strlen($maskcounter))) { $counter='ErrorMaxNumberReachForThisMask'; - } + } if (! empty($maskrefclient_maskcounter)) { diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index 78b0a829fa9..cd21c5164ac 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -123,8 +123,8 @@ class mod_contract_serpis extends ModelNumRefContracts $date=$contract->date_contrat; $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog("mod_contract_serpis::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index e575f5c93af..ceec6107e58 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -123,8 +123,8 @@ class mod_expedition_safor extends ModelNumRefExpedition $date=time(); $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog("mod_expedition_safor::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index 33056364574..e1b749bbf2f 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -135,8 +135,8 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder if (empty($date)) $date=dol_now(); $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog("mod_livraison_jade::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index 4f13c40c970..686fa74dc43 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -131,8 +131,8 @@ class mod_project_simple extends ModeleNumRefProjects //$yymm = strftime("%y%m",time()); $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog("mod_project_simple::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index e0a18711ca6..8d6ea553519 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -131,8 +131,8 @@ class mod_task_simple extends ModeleNumRefTask //$yymm = strftime("%y%m",time()); $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog("mod_task_simple::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 15e06d995d1..5d8b8e169df 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -131,8 +131,8 @@ class mod_propale_marbre extends ModeleNumRefPropales $date = time(); $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog("mod_propale_marbre::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 95f3fa27b2c..4c24f5691a5 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -140,8 +140,8 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode $date = dol_now(); $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); return $prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 19eb47e6a08..e35226b20fd 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -158,8 +158,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices $date=$object->date; // This is invoice date (not creation date) $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); return $prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index c321b408d24..fea7c4f21e0 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -126,8 +126,8 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders if (empty($date)) $date=$object->date; // Creation date is order date for suppliers orders $yymm = strftime("%y%m",$date); - if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); return $this->prefix.$yymm."-".$num; }