From 79be7c4111377fd47c12af8d1a362441eb2c4450 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 17 Jan 2009 19:31:44 +0000 Subject: [PATCH] Use of quantity 0 for option lines in commercial proposal is always enabled. --- htdocs/admin/propale.php | 4 ++++ htdocs/comm/propal.php | 2 +- htdocs/propal.class.php | 19 +++++++++---------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index f2b8c9f8ca6..e4f1f009c29 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -118,10 +118,12 @@ if ($_POST["action"] == 'setadddeliveryaddress') dolibarr_set_const($db, "PROPALE_ADD_DELIVERY_ADDRESS",$_POST["value"]); } +/* if ($_POST["action"] == 'setuseoptionline') { dolibarr_set_const($db, "PROPALE_USE_OPTION_LINE",$_POST["value"]); } +*/ if ($_POST["action"] == 'setclassifiedinvoiced') { @@ -476,6 +478,7 @@ print '' print "\n"; print ''; +/* $var=! $var; print '
'; print ''; @@ -487,6 +490,7 @@ print ''; print ''; print "\n"; print '
'; +*/ if ($conf->commande->enabled) { diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 69c59aa418f..d2db0bb2ac1 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2007 Regis Houssin diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 63e94dfdd7f..1ad6dbb0cba 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -277,6 +277,7 @@ class Propal extends CommonObject // Clean parameters $remise_percent=price2num($remise_percent); $qty=price2num($qty); + /* if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) { $qty=0; @@ -285,6 +286,7 @@ class Propal extends CommonObject { $qty=1; } + */ $pu_ht=price2num($pu_ht); $pu_ttc=price2num($pu_ttc); $txtva=price2num($txtva); @@ -335,7 +337,8 @@ class Propal extends CommonObject $ligne->total_ttc=$total_ttc; // Mise en option de la ligne - if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) $ligne->special_code=3; + //if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) $ligne->special_code=3; + if (empty($qty)) $ligne->special_code=3; // \TODO Ne plus utiliser $ligne->price=$price; @@ -395,6 +398,7 @@ class Propal extends CommonObject // Nettoyage param�tres $remise_percent=price2num($remise_percent); $qty=price2num($qty); + /* if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) { $qty=0; @@ -404,6 +408,7 @@ class Propal extends CommonObject { $qty=1; } + */ $pu = price2num($pu); $txtva = price2num($txtva); @@ -435,15 +440,9 @@ class Propal extends CommonObject $sql.= " , total_tva=".price2num($total_tva); $sql.= " , total_ttc=".price2num($total_ttc); $sql.= " , info_bits=".$info_bits; - if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) - { - $sql.= " , special_code=3"; - } - else - { - $sql.= " , special_code=0"; - } - $sql.= " WHERE rowid = '".$rowid."';"; + //if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) + $sql.= " , special_code=".(empty($qty)?"3":"0"); + $sql.= " WHERE rowid = '".$rowid."'"; $result=$this->db->query($sql); if ($result > 0)