Fix: Si echec creation produit, on perait etat en vente ou pas.
This commit is contained in:
parent
aad475a94d
commit
743f1b65c9
@ -2521,10 +2521,16 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Définition du taux à présélectionner (si defaulttx non forcé et donc vaut -1 ou '')
|
// Définition du taux à présélectionner (si defaulttx non forcé et donc vaut -1 ou '')
|
||||||
if ($defaulttx < 0 || strlen($defaulttx) == 0) $defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$taux_produit);
|
if ($defaulttx < 0 || strlen($defaulttx) == 0)
|
||||||
|
{
|
||||||
|
$defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$taux_produit);
|
||||||
|
}
|
||||||
// Si taux par defaut n'a pu etre déterminé, on prend dernier de la liste.
|
// Si taux par defaut n'a pu etre déterminé, on prend dernier de la liste.
|
||||||
// Comme ils sont triés par ordre croissant, dernier = plus élevé = taux courant
|
// Comme ils sont triés par ordre croissant, dernier = plus élevé = taux courant
|
||||||
if ($defaulttx < 0 || strlen($defaulttx) == 0) $defaulttx = $txtva[sizeof($txtva)-1];
|
if ($defaulttx < 0 || strlen($defaulttx) == 0)
|
||||||
|
{
|
||||||
|
$defaulttx = $txtva[sizeof($txtva)-1];
|
||||||
|
}
|
||||||
|
|
||||||
$nbdetaux = sizeof($txtva);
|
$nbdetaux = sizeof($txtva);
|
||||||
|
|
||||||
@ -2961,7 +2967,7 @@ class Form
|
|||||||
{
|
{
|
||||||
print '<option value="'.($value_as_key?$value:$key).'"';
|
print '<option value="'.($value_as_key?$value:$key).'"';
|
||||||
// Si il faut présélectionner une valeur
|
// Si il faut présélectionner une valeur
|
||||||
if ($id && ($id == $key || $id == $value))
|
if ($id != '' && ($id == $key || $id == $value))
|
||||||
{
|
{
|
||||||
print ' selected="true"';
|
print ' selected="true"';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,6 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -514,6 +513,8 @@ $html = new Form($db);
|
|||||||
* Fiche création du produit
|
* Fiche création du produit
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
||||||
|
{
|
||||||
|
if ($conf->global->PRODUCT_CANVAS_ABILITY)
|
||||||
{
|
{
|
||||||
if (! isset($product))
|
if (! isset($product))
|
||||||
{
|
{
|
||||||
@ -537,12 +538,13 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
|||||||
{
|
{
|
||||||
$product = $e_product;
|
$product = $e_product;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
|
|
||||||
if ($mesg) print "$mesg\n";
|
if ($mesg) print "$mesg\n";
|
||||||
|
|
||||||
if (! $_GET["canvas"])
|
if (! $conf->global->PRODUCT_CANVAS_ABILITY && ! $_GET["canvas"])
|
||||||
{
|
{
|
||||||
print '<form action="fiche.php" method="post">';
|
print '<form action="fiche.php" method="post">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
@ -590,10 +592,8 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print '<select class="flat" name="statut">';
|
$statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell"));
|
||||||
print '<option value="1">'.$langs->trans("OnSell").'</option>';
|
$html->select_array('statut',$statutarray,$_POST["statut"]);
|
||||||
print '<option value="0" selected="true">'.$langs->trans("NotOnSell").'</option>';
|
|
||||||
print '</select>';
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if ($_GET["type"] != 1 && $conf->stock->enabled)
|
if ($_GET["type"] != 1 && $conf->stock->enabled)
|
||||||
@ -641,7 +641,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
|||||||
print '<input name="weight" size="4" value="">';
|
print '<input name="weight" size="4" value="">';
|
||||||
print $html->select_measuring_units("weight_units","weight");
|
print $html->select_measuring_units("weight_units","weight");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("volume").'</td><td>';
|
print '<tr><td>'.$langs->trans("Volume").'</td><td>';
|
||||||
print '<input name="volume" size="4" value="">';
|
print '<input name="volume" size="4" value="">';
|
||||||
print $html->select_measuring_units("volume_units","volume");
|
print $html->select_measuring_units("volume_units","volume");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -652,7 +652,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
|||||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
$doleditor=new DolEditor('note','',200,'dolibarr_notes','',false);
|
$doleditor=new DolEditor('note','',180,'dolibarr_notes','',false);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -700,6 +700,9 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gestion des produits specifiques
|
// Gestion des produits specifiques
|
||||||
|
$product->canvas = '';
|
||||||
|
if ($conf->global->PRODUCT_CANVAS_ABILITY)
|
||||||
|
{
|
||||||
if ($product->canvas <> '' && file_exists('canvas/product.'.$product->canvas.'.class.php') )
|
if ($product->canvas <> '' && file_exists('canvas/product.'.$product->canvas.'.class.php') )
|
||||||
{
|
{
|
||||||
$class = 'Product'.ucfirst($product->canvas);
|
$class = 'Product'.ucfirst($product->canvas);
|
||||||
@ -712,9 +715,6 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
|
|
||||||
$product->assign_smarty_values($smarty,$_GET["action"]);
|
$product->assign_smarty_values($smarty,$_GET["action"]);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$product->canvas = '';
|
|
||||||
}
|
}
|
||||||
// END TODO RODO FINISH THIS PART
|
// END TODO RODO FINISH THIS PART
|
||||||
|
|
||||||
@ -737,7 +737,6 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
print($mesg);
|
print($mesg);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($_GET["action"] <> 'edit' && $product->canvas <> '')
|
if ($_GET["action"] <> 'edit' && $product->canvas <> '')
|
||||||
{
|
{
|
||||||
@ -757,9 +756,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
|
|
||||||
if ($_GET["action"] <> 'edit' && $product->canvas == '')
|
if ($_GET["action"] <> 'edit' && $product->canvas == '')
|
||||||
{
|
{
|
||||||
/*
|
// En mode visu
|
||||||
* En mode visu
|
|
||||||
*/
|
|
||||||
print '<table class="border" width="100%"><tr>';
|
print '<table class="border" width="100%"><tr>';
|
||||||
|
|
||||||
// Reference
|
// Reference
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user