Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-04-17 10:28:11 +02:00
commit 4be802597d

View File

@ -658,6 +658,7 @@ class CommandeFournisseur extends Commande
function approve($user, $idwarehouse=0)
{
global $langs,$conf;
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
$error=0;
@ -667,6 +668,20 @@ class CommandeFournisseur extends Commande
{
$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.= " SET ref='".$this->db->escape($num)."',";
$sql.= " fk_statut = 2,";
@ -1885,4 +1900,4 @@ class CommandeFournisseurLigne extends OrderLine
}
}
?>
?>