diff --git a/htdocs/product/fiche.php3 b/htdocs/product/fiche.php3 index a14f2d7d014..27c5a8c00a5 100644 --- a/htdocs/product/fiche.php3 +++ b/htdocs/product/fiche.php3 @@ -20,6 +20,9 @@ * */ +$types[0] = "produit"; +$types[1] = "service"; + require("./pre.inc.php3"); require("../propal.class.php3"); require("../facture.class.php3"); @@ -33,10 +36,11 @@ if ($action == 'add') { $product = new Product($db); - $product->ref = $HTTP_POST_VARS["ref"]; - $product->libelle = $HTTP_POST_VARS["libelle"]; - $product->price = $HTTP_POST_VARS["price"]; - $product->tva_tx = $HTTP_POST_VARS["tva_tx"]; + $product->ref = $HTTP_POST_VARS["ref"]; + $product->libelle = $HTTP_POST_VARS["libelle"]; + $product->price = $HTTP_POST_VARS["price"]; + $product->tva_tx = $HTTP_POST_VARS["tva_tx"]; + $product->type = $HTTP_POST_VARS["type"]; $product->description = $HTTP_POST_VARS["desc"]; $id = $product->create($user); @@ -51,7 +55,7 @@ if ($action == 'addinpropal') $propal->insert_product($id, $HTTP_POST_VARS["qty"]); $action = ''; - $mesg = 'Produit ajouté à la proposition '; + $mesg = ucfirst($types[$type]) . ' ajouté à la proposition '; $mesg .= ''.$propal->ref.''; } @@ -99,9 +103,9 @@ if ($action == 'update' && $cancel <> 'Annuler') if ($action == 'create') { print "
\n"; - print ""; - - print '
Nouveau produit

'; + print "\n"; + print ''."\n"; + print '
Nouveau '.$types[$type].'

'."\n"; print ''; print ""; @@ -163,6 +167,12 @@ else print ''; print ""; + + if ($product->type == 1) + { + print ''; + } + print "
Taux TVA'.$product->tva_tx.' %
Description".nl2br($product->description)."
Durée'.$product->tva_tx.' %
"; } @@ -198,6 +208,12 @@ else print '"; + + if ($product->type == 1) + { + print 'Durée'; + } + print '  '; print ''; print '';