diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index ab3d3cb8d2a..0f3ee6b9381 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -20,18 +20,18 @@ */ /** - \file htdocs/comm/addpropal.php - \ingroup propal - \brief Page d'ajout d'une proposition commmercial - \version $Id$ -*/ + \file htdocs/comm/addpropal.php + \ingroup propal + \brief Page d'ajout d'une proposition commmercial + \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/propal.class.php'); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php'); if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php")) { - require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"); + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"); } if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php'); @@ -67,45 +67,45 @@ if ($_GET["projetid"]) */ if ($_GET["action"] == 'create') { - $soc = new Societe($db); - $result=$soc->fetch($_GET["socid"]); - if ($result < 0) - { - dolibarr_print_error($db,$soc->error); - exit; - } + $soc = new Societe($db); + $result=$soc->fetch($_GET["socid"]); + if ($result < 0) + { + dolibarr_print_error($db,$soc->error); + exit; + } - $propal = new Propal($db); - $propal->date=time(); - - $obj = $conf->global->PROPALE_ADDON; - $modPropale = new $obj; - $numpr = $modPropale->getNextValue($soc,$propal); + $propal = new Propal($db); + $propal->date=time(); + + $obj = $conf->global->PROPALE_ADDON; + $modPropale = new $obj; + $numpr = $modPropale->getNextValue($soc,$propal); // Fix pour modele numerotation qui deconne // Si numero deja pris (ne devrait pas arriver), on incremente par .num+1 - $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."propal WHERE ref like '$numpr%'"; - $resql=$db->query($sql); - if ($resql) - { - $obj=$db->fetch_object($resql); - $num = $obj->nb; - $db->free($resql); - if ($num > 0) - { - $numpr .= "." . ($num + 1); - } - } + $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."propal WHERE ref like '$numpr%'"; + $resql=$db->query($sql); + if ($resql) + { + $obj=$db->fetch_object($resql); + $num = $obj->nb; + $db->free($resql); + if ($num > 0) + { + $numpr .= "." . ($num + 1); + } + } - print "