diff --git a/htdocs/admin/pre.inc.php b/htdocs/admin/pre.inc.php index cfb15422260..ede1790755c 100644 --- a/htdocs/admin/pre.inc.php +++ b/htdocs/admin/pre.inc.php @@ -34,20 +34,7 @@ function llxHeader($head = "", $urlp = "") { $menu->add("index.php", "Configuration"); $menu->add_submenu("modules.php", "Modules"); - if(defined("MAIN_MODULE_FACTURE") && MAIN_MODULE_FACTURE) - { - $menu->add_submenu("facture.php", "Factures"); - } - if(defined("MAIN_MODULE_PROPALE") && MAIN_MODULE_PROPALE) - { - $menu->add_submenu("propale.php", "Propositions commerciales"); - } - - if(defined("MAIN_MODULE_FICHEINTER") && MAIN_MODULE_FICHEINTER) - { - $menu->add_submenu("fichinter.php", "Fiches d'intervention"); - } if(defined("MAIN_MODULE_ADHERENT") && MAIN_MODULE_ADHERENT) { diff --git a/htdocs/boxes.php b/htdocs/boxes.php index 111269bf01d..229aa88fbcb 100644 --- a/htdocs/boxes.php +++ b/htdocs/boxes.php @@ -31,7 +31,7 @@ class infoBox print ''; - print '"; + print '"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { @@ -45,6 +45,10 @@ class infoBox { print ' align="'. $contents[$i][$j]['align'].'"'; } + if (strlen($contents[$i][$j]['width']) > 0) + { + print ' width="'. $contents[$i][$j]['width'].'"'; + } print'>'; if (strlen($contents[$i][$j]['url']) > 0) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 00e5641e141..db799c6bf01 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -363,7 +363,9 @@ if ($propalid) print ''; if ($obj->statut == 0 && $user->rights->propale->creer) { - print ''; + print ''; } else { @@ -482,7 +484,7 @@ if ($propalid) { if ($user->rights->propale->supprimer) { - print ""; + print ""; } else { @@ -493,7 +495,7 @@ if ($propalid) { if ($obj->statut == 1 && $user->rights->propale->cloturer) { - print ""; + print ""; } else { @@ -506,7 +508,7 @@ if ($propalid) */ if ($obj->statut < 2 && $user->rights->propale->creer) { - print '"; + print '"; } else { @@ -524,7 +526,7 @@ if ($propalid) if ($user->rights->propale->envoyer) { print ""; + print "Envoyer la proposition"; } else { @@ -547,7 +549,7 @@ if ($propalid) { if ($user->rights->propale->valider) { - print ""; + print ""; } else { @@ -558,7 +560,7 @@ if ($propalid) { if ($user->rights->propale->creer) { - print ""; + print ""; } else { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index d62c9197f97..7b8ad29cfb3 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -28,8 +28,6 @@ if (!$user->rights->commande->lire) require("../project.class.php"); require("../propal.class.php"); -llxHeader(); - /* * Sécurité accés client */ @@ -59,7 +57,7 @@ if ($HTTP_POST_VARS["action"] == 'add') $commande->soc_id = $HTTP_POST_VARS["soc_id"]; $commande->date_commande = $datecommande; $commande->note = $HTTP_POST_VARS["note"]; - + $commande->source = $HTTP_POST_VARS["source_id"]; $commande->projetid = $HTTP_POST_VARS["projetid"]; $commande->remise_percent = $HTTP_POST_VARS["remise_percent"]; @@ -140,6 +138,13 @@ if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] = $result = $commande->valid($user); } +if ($HTTP_POST_VARS["action"] == 'confirm_cancel' && $HTTP_POST_VARS["confirm"] == yes && $user->rights->commande->valider) +{ + $commande = new Commande($db); + $commande->fetch($_GET["id"]); + $result = $commande->cancel($user); +} + if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) { if ($user->rights->commande->supprimer ) @@ -147,7 +152,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] $commande = new Commande($db); $commande->id = $_GET["id"]; $commande->delete(); - $id = 0 ; + Header("Location: liste.php"); } } @@ -163,6 +168,10 @@ if ($action == 'pdf') commande_pdf_create($db, $_GET["id"]); } +llxHeader(); + + + $html = new Form($db); /********************************************************************* @@ -176,6 +185,8 @@ if ($action == 'create') { print_titre("Créer une commande"); + $new_commande = new Commande($db); + if ($propalid) { $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.remise_percent, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst"; @@ -223,7 +234,10 @@ if ($action == 'create') print ""; print ''; - + print ""; + print "
'.$head[0]['text']."
'.$head[0]['text']."
'.price($objp->subprice).'Supprimer'; + print img_delete(); + print '[Supprimer]Supprimer[Cloturer]Cloturer[Générer]Générer"; - print "[Envoyer la proposition][Valider]Valider[Modifier]Modifier
Numéro :Provisoire
Source :"; + $html->select_array("source_id",$new_commande->sources,2); + print "
Projet :"; $proj = new Project($db); $html->select_array("projetid",$proj->liste_array($socidp),0,1); @@ -394,11 +408,19 @@ else * Confirmation de la validation * */ - if ($action == 'valid') + if ($_GET["action"] == 'valid') { //$numfa = commande_get_num($soc); $html->form_confirm("$PHP_SELF?id=$id","Valider la commande","Etes-vous sûr de vouloir valider cette commande ?","confirm_valid"); } + /* + * Confirmation de l'annulation + * + */ + if ($_GET["action"] == 'annuler') + { + $html->form_confirm("$PHP_SELF?id=$id","Annuler la commande","Etes-vous sûr de vouloir annuler cette commande ?","confirm_cancel"); + } /* * Commande @@ -411,14 +433,28 @@ else print ''; print ""; - print "'; - print ""; + print '"; print ""; - print "\n"; + print "\n"; + print '"; + + print ""; + print '"; - - print ""; - + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; + + print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; if ($commande->note) { print '"; } - print "
Client"; + print ""; print ''.$soc->nom.'Source : " . $commande->sources[0] ."
'; + print $commande->statuts[$commande->statut]; + print "
Date".strftime("%A %d %B %Y",$commande->date)."".strftime("%A %d %B %Y",$commande->date)."Source : ' . $commande->sources[$commande->source] ; + if ($commande->source == 0) + { + /* Propale */ + $propal = new Propal($db); + $propal->fetch($commande->propale_id); + print ' -> '.$propal->ref.''; + } + print "
Auteur$author->fullnameProjet : '; if ($commande->projet_id > 0) { @@ -431,14 +467,14 @@ else print 'Classer la commande'; } print " 
Auteur$author->fullname
Montant'.price($commande->total_ht).''.MAIN_MONNAIE.' HT
'.price($commande->total_ht).''.MAIN_MONNAIE.' HT
Remise'; + print 'Note
Remise globale'; if ($commande->brouillon == 1 && $user->rights->commande->creer) { @@ -451,16 +487,16 @@ else } print '
TVA'.price($commande->total_tva).'
TVA'.price($commande->total_tva).''.MAIN_MONNAIE.'
Total'.price($commande->total_ttc).'
Total'.price($commande->total_ttc).''.MAIN_MONNAIE.' TTC
Note : '.nl2br($commande->note)."

"; + print "
"; if ($commande->brouillon == 1 && $user->rights->commande->creer) { @@ -471,7 +507,7 @@ else * Lignes de commandes * */ - echo ''; + echo '
'; $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice"; $sql .= " FROM llx_commandedet as l WHERE l.fk_commande = $id ORDER BY l.rowid"; @@ -500,7 +536,8 @@ else print ""; if ($objp->fk_product > 0) { - print ''; + print ''; } else { @@ -519,8 +556,12 @@ else print '\n"; if ($commande->statut == 0 && $user->rights->commande->creer) { - print ''; - print ''; + print ''; + print ''; } else { @@ -533,7 +574,7 @@ else print ""; print ''; print ''; - print ""; + print ""; print ''; print ''; print ''; @@ -542,14 +583,10 @@ else print '' . "\n"; print "\n"; } - - $total = $total + ($objp->qty * $objp->price); $i++; $var=!$var; - } - + } $db->free(); - // print "
'.stripslashes(nl2br($objp->description)).''; + print ''.stripslashes(nl2br($objp->description)).''.price($objp->subprice)."deledit'; + print img_edit(); + print ''; + print img_delete(); + print '
 %
"; } else { @@ -625,11 +662,11 @@ else if ($commande->statut == 0 && $user->rights->commande->supprimer) { - print "[Supprimer]"; + print "Supprimer"; } elseif ($commande->statut == 1 && abs($resteapayer) > 0 && $user->rights->commande->envoyer) { - print "[Envoyer]"; + print "Envoyer"; } else { @@ -642,24 +679,24 @@ else print '-'; - + print '-'; if ($commande->statut == 0) { if ($user->rights->commande->valider) { - print "[Valider]"; + print "Valider"; } else { print '-'; } } - elseif ($commande->statut == 1 && $commande->paye == 0) + elseif ($commande->statut == 1) { - if ($user->rights->commande->creer) + if ($user->rights->commande->valider) { - print "Générer la commande"; + print "Annuler la commande"; } else { @@ -671,10 +708,6 @@ else print '-'; } - - print '-'; - - print ""; } print "

\n"; diff --git a/htdocs/commande/pre.inc.php b/htdocs/commande/pre.inc.php index 778b289af2d..834f86aee7c 100644 --- a/htdocs/commande/pre.inc.php +++ b/htdocs/commande/pre.inc.php @@ -35,6 +35,9 @@ function llxHeader($head = "", $urlp = "") $menu = new Menu(); $menu->add(DOL_URL_ROOT."/commande/", "Commandes"); + $menu->add_submenu(DOL_URL_ROOT."/commande/liste.php", "Liste"); + + $menu->add(DOL_URL_ROOT."/commande/stats/", "Statistiques"); left_menu($menu->liste); /* diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 449d081bc18..4882ce77f3c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -871,11 +871,11 @@ else if ($fac->statut == 0 && $user->rights->facture->supprimer) { - print "[Supprimer]"; + print "Supprimer"; } elseif ($fac->statut == 1 && abs($resteapayer) > 0 && $user->rights->facture->envoyer) { - print "[Envoyer]"; + print "Envoyer"; } else { @@ -884,7 +884,7 @@ else if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->paiement) { - print "[Emettre un paiement]"; + print "Emettre un paiement"; } else { @@ -895,7 +895,7 @@ else { if ($user->rights->facture->paiement) { - print "[Classer 'Payée']"; + print "Classer 'Payée'"; } else { @@ -904,7 +904,16 @@ else } elseif ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->envoyer) { - print "[Envoyer une relance]"; + print "Envoyer une relance"; + } + else + { + print '-'; + } + + if ($fac->statut > 0) + { + print 'Récurrente'; } else { @@ -915,7 +924,7 @@ else { if ($user->rights->facture->valider) { - print "[Valider]"; + print "Valider"; } else { @@ -938,17 +947,6 @@ else print '-'; } - if ($fac->statut > 0) - { - //print '-'; - - print 'Récurrente'; - } - else - { - print '-'; - } - print ""; } print "

\n"; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index edc2077c03f..da3c908e52b 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -204,12 +204,12 @@ if ( $db->query($sql) ) print ''; /* - * Propales à facturer + * Commandes à facturer */ if ($user->comm > 0 && $conf->commercial ) { - $sql = "SELECT p.rowid, p.ref, s.nom, s.idp FROM llx_propal as p, llx_societe as s"; - $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = 2"; + $sql = "SELECT p.rowid, p.ref, s.nom, s.idp FROM llx_commande as p, llx_societe as s"; + $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = 1 AND p.facture = 0"; if ($socidp) { $sql .= " AND p.fk_soc = $socidp"; @@ -223,13 +223,13 @@ if ($user->comm > 0 && $conf->commercial ) $i = 0; print ''; print ""; - print ''; + print ''; while ($i < $num) { $var=!$var; $obj = $db->fetch_object($i); - print ""; + print ""; print ''; $i++; } diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 50f732d3d08..cfa04fbab5d 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -267,8 +267,8 @@ class Form { } } - /* - * + /** + * Affiche un select à partir d'un tableau * */ Function select_array($name, $array, $id='', $empty=0) diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php index 3c77a3ca3c4..897dd443b8d 100644 --- a/htdocs/includes/boxes/box_factures.php +++ b/htdocs/includes/boxes/box_factures.php @@ -51,10 +51,12 @@ if ($user->rights->facture->lire) $info_box_contents[$i][0] = array('align' => 'left', 'text' => $objp->facnumber, + 'width' => '30%', 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); $info_box_contents[$i][1] = array('align' => 'left', 'text' => $objp->nom, + 'width' => '70%', 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); $i++; } diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php index cc87723c012..4bb78d89075 100644 --- a/htdocs/includes/boxes/box_factures_imp.php +++ b/htdocs/includes/boxes/box_factures_imp.php @@ -49,10 +49,12 @@ if ($user->rights->facture->lire) $info_box_contents[$i][0] = array('align' => 'left', 'text' => $objp->facnumber, + 'width' => '30%', 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); $info_box_contents[$i][1] = array('align' => 'left', 'text' => $objp->nom, + 'width' => '70%', 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); $i++; diff --git a/htdocs/includes/boxes/box_propales.php b/htdocs/includes/boxes/box_propales.php index a6d78757180..130b60bc026 100644 --- a/htdocs/includes/boxes/box_propales.php +++ b/htdocs/includes/boxes/box_propales.php @@ -50,10 +50,12 @@ if ($user->rights->propale->lire) $info_box_contents[$i][0] = array('align' => 'left', 'text' => $objp->ref, + 'width' => '30%', 'url' => DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->rowid); $info_box_contents[$i][1] = array('align' => 'center', 'text' => $objp->nom, + 'width' => '70%', 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); $i++; } diff --git a/htdocs/index.php b/htdocs/index.php index 948a107a454..132947ca353 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -57,7 +57,7 @@ for ($ii=0, $ni=sizeof($boxes); $ii<$ni; $ii++) print "\n"; } - print '"; diff --git a/htdocs/lib/mysql.lib.php b/htdocs/lib/mysql.lib.php index c412f0d10ec..b4516a832b2 100644 --- a/htdocs/lib/mysql.lib.php +++ b/htdocs/lib/mysql.lib.php @@ -104,10 +104,25 @@ class DoliDb { } Function close() - { - $this->ret = mysql_close($this->db); - return $this->ret; - } + { + $this->ret = mysql_close($this->db); + return $this->ret; + } + + Function begin() + { + return $this->query("BEGIN"); + } + + Function commit() + { + return $this->query("COMMIT"); + } + + Function rollback() + { + return $this->query("ROLLBACK"); + } Function query($query, $limit="", $offset="") { diff --git a/htdocs/product.class.php b/htdocs/product.class.php index cb88deed4ab..b7129d85ecc 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -31,6 +31,7 @@ class Product var $price; var $tva_tx; var $type; + var $seuil_stock_alerte; var $duration_value; var $duration_unit; @@ -184,6 +185,7 @@ class Product $sql .= ",ref = '" . trim($this->ref) ."'"; $sql .= ",tva_tx = " . $this->tva_tx ; $sql .= ",envente = " . $this->envente ; + $sql .= ",seuil_stock_alerte = " . $this->seuil_stock_alerte ; $sql .= ",description = '" . trim($this->description) ."'"; $sql .= ",duration = '" . $this->duration_value . $this->duration_unit ."'"; @@ -211,7 +213,7 @@ class Product */ Function fetch ($id) { - $sql = "SELECT rowid, ref, label, description, price, tva_tx, envente, nbvente, fk_product_type, duration"; + $sql = "SELECT rowid, ref, label, description, price, tva_tx, envente, nbvente, fk_product_type, duration, seuil_stock_alerte"; $sql .= " FROM llx_product WHERE rowid = $id"; $result = $this->db->query($sql) ; @@ -220,22 +222,49 @@ class Product { $result = $this->db->fetch_array(); - $this->id = $result["rowid"]; - $this->ref = $result["ref"]; - $this->libelle = stripslashes($result["label"]); - $this->description = stripslashes($result["description"]); - $this->price = $result["price"]; - $this->tva_tx = $result["tva_tx"]; - $this->type = $result["fk_product_type"]; - $this->nbvente = $result["nbvente"]; - $this->envente = $result["envente"]; - $this->duration = $result["duration"]; - $this->duration_value = substr($result["duration"],0,strlen($result["duration"])-1); - $this->duration_unit = substr($result["duration"],-1); + $this->id = $result["rowid"]; + $this->ref = $result["ref"]; + $this->libelle = stripslashes($result["label"]); + $this->description = stripslashes($result["description"]); + $this->price = $result["price"]; + $this->tva_tx = $result["tva_tx"]; + $this->type = $result["fk_product_type"]; + $this->nbvente = $result["nbvente"]; + $this->envente = $result["envente"]; + $this->duration = $result["duration"]; + $this->duration_value = substr($result["duration"],0,strlen($result["duration"])-1); + $this->duration_unit = substr($result["duration"],-1); + $this->seuil_stock_alerte = $result["seuil_stock_alerte"]; $this->label_url = ''.$this->label.''; $this->db->free(); + + + $sql = "SELECT sum(reel) as reel"; + $sql .= " FROM llx_product_stock WHERE fk_product = $id"; + $result = $this->db->query($sql) ; + if ( $result ) + { + $num = $this->db->num_rows(); + if ($num > 0) + { + $result = $this->db->fetch_array(); + + $this->no_stock = 0; + + $this->stock_reel = $result["reel"]; + $this->stock_proposition = $result["proposition"]; + $this->stock_commande = $result["commande"]; + } + else + { + $this->no_stock = 1; + } + $this->db->free(); + } + + return 1; } else @@ -431,5 +460,108 @@ class Product * * */ + Function create_stock($id_entrepot, $nbpiece) + { + + $sql = "INSERT INTO llx_product_stock "; + $sql .= " (fk_product, fk_entrepot, reel, commande, proposition)"; + $sql .= " VALUES ($this->id, $id_entrepot, $nbpiece, $nbpiece, $nbpiece)"; + + if ($this->db->query($sql) ) + { + return 1; + } + else + { + print $this->db->error() . ' in ' . $sql; + return -1; + } + } + /* + * + * + */ + Function correct_stock($user, $id_entrepot, $nbpiece, $mouvement) + { + + $sql = "SELECT count(*) FROM llx_product_stock "; + $sql .= " WHERE fk_product = $this->id AND fk_entrepot = $id_entrepot"; + + if ($this->db->query($sql) ) + { + $row = $this->db->fetch_row(0); + if ($row[0] > 0) + { + return $this->ajust_stock($user, $id_entrepot, $nbpiece, $mouvement); + } + else + { + return $this->create_stock($id_entrepot, $nbpiece); + } + } + else + { + print $this->db->error() . ' in ' . $sql; + $this->db->rollback(); + return -1; + } + } + /* + * + * + */ + Function ajust_stock($user, $id_entrepot, $nbpiece, $mouvement) + { + /* mouvement = 0 -> ajouter + * mouvement = 1 -> supprimer + */ + $op[0] = "+" . trim($nbpiece); + $op[1] = "-" . trim($nbpiece); + + if ($this->db->begin()) + { + + $sql = "UPDATE llx_product "; + $sql .= " SET stock_commande = stock_commande ".$op[$mouvement].", stock_propale = stock_propale ".$op[$mouvement]; + $sql .= " WHERE rowid = $this->id "; + + if ($this->db->query($sql) ) + { + $sql = "UPDATE llx_product_stock "; + $sql .= " SET reel = reel ".$op[$mouvement]; + $sql .= " WHERE fk_product = $this->id AND fk_entrepot = $id_entrepot"; + + if ($this->db->query($sql) ) + { + $sql = "INSERT INTO llx_stock_mouvement (datem, fk_product, fk_entrepot, value, type_mouvement, fk_user_author)"; + $sql .= " VALUES (now(), $this->id, $id_entrepot, ".$op[$mouvement].", 0, $user->id)"; + + if ($this->db->query($sql) ) + { + $this->db->commit(); + return 1; + } + else + { + print $this->db->error() . ' in ' . $sql; + $this->db->rollback(); + return -2; + } + } + else + { + print $this->db->error() . ' in ' . $sql; + $this->db->rollback(); + return -1; + } + } + else + { + print $this->db->error() . ' in ' . $sql; + $this->db->rollback(); + return -3; + } + } + } } ?> diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index d0ecf7e15cc..84c534ee49d 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -48,6 +48,7 @@ if ($action == 'add') $product->description = $HTTP_POST_VARS["desc"]; $product->duration_value = $HTTP_POST_VARS["duration_value"]; $product->duration_unit = $HTTP_POST_VARS["duration_unit"]; + $product->seuil_stock_alerte = $HTTP_POST_VARS["seuil_stock_alerte"]; $id = $product->create($user); $action = ''; @@ -118,12 +119,13 @@ if ($HTTP_POST_VARS["action"] == 'update' && if ($product->fetch($id)) { - $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->description = $HTTP_POST_VARS["desc"]; - $product->envente = $HTTP_POST_VARS["statut"]; + $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->description = $HTTP_POST_VARS["desc"]; + $product->envente = $HTTP_POST_VARS["statut"]; + $product->seuil_stock_alerte = $HTTP_POST_VARS["seuil_stock_alerte"]; $product->duration_value = $HTTP_POST_VARS["duration_value"]; $product->duration_unit = $HTTP_POST_VARS["duration_unit"]; @@ -192,11 +194,21 @@ if ($action == 'create') print "".''; - print "".''; + if ($_GET["type"] == 0) + { + print "".''; + } + else + { + print ''; + } + print '"; - if ($type == 1) + if ($_GET["type"] == 1) { print "".''; - print "".''; + print ''; + print ''; + if ($product->no_stock) + { + print "'; print ""; if ($product->type == 1) @@ -385,6 +414,16 @@ else print ''; } print ''; + if ($product->type == 0) + { + print "".''; + } + else + { + print ''; + } print "".'
'.translate("Propositions commerciales à facturer").'
'.translate("Commandes à facturer").'
rowid\">$obj->ref
rowid\">$obj->ref'.$obj->nom.'
'; + print ''; include($boxes[$ii]); print "
Taux TVA'; $html = new Form($db); print $html->select_tva("tva_tx"); - print '
Description'; + print '
Seuil stock'; + print ''; + print '
Description'; print '
Durée'; print 'jour '; @@ -279,7 +291,24 @@ else print '
Taux TVA'.$product->tva_tx.' %
Taux TVA'.$product->tva_tx.' %
StockPas de définition de stock pour ce produit"; + } + else + { + if ($product->stock_reel <= $product->seuil_stock_alerte) + { + print ''.$product->stock_reel.' Seuil : '.$product->seuil_stock_alerte; + } + else + { + print "".$product->stock_reel; + } + } + print '
Description".nl2br($product->description)."
Seuil stock'; + print ''; + print '
Description'; print '