Correction gestion num commande fournisseur

This commit is contained in:
Laurent Destailleur 2006-11-08 00:13:54 +00:00
parent e478cfae41
commit eda0e96d37
2 changed files with 15 additions and 4 deletions

View File

@ -156,7 +156,7 @@ class Commande extends CommonObject
global $db, $langs, $conf; global $db, $langs, $conf;
$langs->load("order"); $langs->load("order");
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/commande/"; $dir = DOL_DOCUMENT_ROOT . "/includes/modules/commande";
if (defined("COMMANDE_ADDON") && COMMANDE_ADDON) if (defined("COMMANDE_ADDON") && COMMANDE_ADDON)
{ {
@ -164,7 +164,7 @@ class Commande extends CommonObject
// Chargement de la classe de numérotation // Chargement de la classe de numérotation
$classname = $conf->global->COMMANDE_ADDON; $classname = $conf->global->COMMANDE_ADDON;
require_once($dir.$file); require_once($dir.'/'.$file);
$obj = new $classname(); $obj = new $classname();
$numref = ""; $numref = "";

View File

@ -977,8 +977,19 @@ else
*/ */
if ($_GET['action'] == 'valid') if ($_GET['action'] == 'valid')
{ {
//$numfa = commande_get_num($soc); // on vérifie si la facture est en numérotation provisoire
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $langs->trans('ConfirmValidateOrder'), 'confirm_valid'); $ref = substr($commande->ref, 1, 4);
if ($ref == 'PROV')
{
$num = $commande->getNextNumRef($soc);
}
else
{
$num = $commande->ref;
}
$text=$langs->trans('ConfirmValidateOrder',$num);
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid');
print '<br />'; print '<br />';
} }