Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
4be802597d
@ -658,6 +658,7 @@ class CommandeFournisseur extends Commande
|
|||||||
function approve($user, $idwarehouse=0)
|
function approve($user, $idwarehouse=0)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@ -667,6 +668,20 @@ class CommandeFournisseur extends Commande
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
// Definition du nom de modele de numerotation de commande
|
||||||
|
$soc = new Societe($this->db);
|
||||||
|
$soc->fetch($this->fourn_id);
|
||||||
|
|
||||||
|
// Check if object has a temporary ref
|
||||||
|
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||||
|
{
|
||||||
|
$num = $this->getNextNumRef($soc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$num = $this->ref;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
||||||
$sql.= " SET ref='".$this->db->escape($num)."',";
|
$sql.= " SET ref='".$this->db->escape($num)."',";
|
||||||
$sql.= " fk_statut = 2,";
|
$sql.= " fk_statut = 2,";
|
||||||
@ -1885,4 +1900,4 @@ class CommandeFournisseurLigne extends OrderLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user