Fix: Bug 17703

This commit is contained in:
Laurent Destailleur 2006-09-11 22:26:58 +00:00
parent 3631e5b405
commit 97f3c176ce
4 changed files with 199 additions and 189 deletions

View File

@ -82,8 +82,8 @@ if ($_GET["action"] == 'create')
$modPropale = new $obj; $modPropale = new $obj;
$numpr = $modPropale->getNextValue($soc); $numpr = $modPropale->getNextValue($soc);
// Si numero deja pris (ne devrait pas arriver) // Fix pour modele numerotation qui deconne
// on incremente par .num+1 // 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%'"; $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."propal WHERE ref like '$numpr%'";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)

View File

@ -165,6 +165,7 @@ if ($_POST['action'] == 'set_ref_client' && $user->rights->propale->creer)
if ($_POST['action'] == 'add') if ($_POST['action'] == 'add')
{ {
$propal = new Propal($db, $_POST['socidp']); $propal = new Propal($db, $_POST['socidp']);
$propal->fetch_client();
$db->begin(); $db->begin();
@ -559,6 +560,7 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
else else
{ {
Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'#builddoc'); Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'#builddoc');
exit;
} }
} }
@ -657,6 +659,7 @@ if ($_GET['action'] == 'down' && $user->rights->propale->creer)
} }
propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs);
Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET["propalid"].'#'.$_GET['rowid']); Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET["propalid"].'#'.$_GET['rowid']);
exit;
} }

View File

@ -757,9 +757,6 @@ class Product
return -2; return -2;
} }
} }
} }

View File

@ -145,6 +145,16 @@ class Propal extends CommonObject
$prod=new Product($this->db); $prod=new Product($this->db);
$prod->fetch($idproduct); $prod->fetch($idproduct);
// on ajoute la description du produit si l'option est active
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
{
$productdesc = $prod->description;
}
else
{
$productdesc = '';
}
$tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx); $tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx);
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES == 1) if($conf->global->PRODUIT_MULTIPRICES == 1)
@ -159,7 +169,7 @@ class Propal extends CommonObject
$line = new PropaleLigne($this->db); $line = new PropaleLigne($this->db);
$line->fk_product=$idproduct; $line->fk_product=$idproduct;
$line->desc=$prod->description; $line->desc=$productdesc;
$line->qty=$qty; $line->qty=$qty;
$line->subprice=$price; $line->subprice=$price;
$line->remise_percent=$remise_percent; $line->remise_percent=$remise_percent;