diff -ubwr --ignore-matching-lines='$Id:' --ignore-matching-lines='$Revision:' --ignore-matching-lines=Copyright dolibarr.orig/htdocs/fourn/facture/fiche.php dolibarr/htdocs/fourn/facture/fiche.php --- dolibarr.orig/htdocs/fourn/facture/fiche.php 2007-01-26 19:46:49.000000000 +0100 +++ dolibarr/htdocs/fourn/facture/fiche.php 2007-01-24 10:26:26.000000000 +0100 @@ -366,10 +367,10 @@ { if ($_GET['action'] == 'copy') { - $value_label = $fac_ori->lignes[$i-1][0]; - $value_pu = $fac_ori->lignes[$i-1][1]; - $value_tauxtva = $fac_ori->lignes[$i-1][2]; - $value_qty = $fac_ori->lignes[$i-1][3]; + $value_label = $fac_ori->lignes[$i-1]->description; + $value_pu = $fac_ori->lignes[$i-1]->pu_ht; + $value_tauxtva = $fac_ori->lignes[$i-1]->tva_taux; + $value_qty = $fac_ori->lignes[$i-1]->qty; } else { @@ -491,17 +492,17 @@ { $var=!$var; // Ligne en modification - if ($_GET['etat'] == '0' && $_GET['ligne_id'] == $fac->lignes[$i][7]) + if ($_GET['etat'] == '0' && $_GET['ligne_id'] == $fac->lignes[$i]->rowid) { - print '
'; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ' '; - print ''; - print ''; + print ''; + print ''; print ''; - $html->select_tva('tauxtva',$fac->lignes[$i][2],$societe,$mysoc); + $html->select_tva('tauxtva',$fac->lignes[$i]->tva_taux,$societe,$mysoc); print ''; print ''; print ''; @@ -512,22 +513,22 @@ } else // Affichage simple de la ligne { - print ''.$fac->lignes[$i][0].''; - print ''.price($fac->lignes[$i][1]).''; - print ''.price($fac->lignes[$i][1] * (1+($fac->lignes[$i][2]/100))).''; - print ''.$fac->lignes[$i][3].''; - print ''.price($fac->lignes[$i][4]).''; - print ''.$fac->lignes[$i][2].''; - print ''.price($fac->lignes[$i][5]).''; - print ''.price($fac->lignes[$i][6]).''; - print ''.img_edit().''; + print ''.$fac->lignes[$i]->description.''; + print ''.price($fac->lignes[$i]->pu_ht).''; + print ''.price($fac->lignes[$i]->pu_ht * (1+($fac->lignes[$i]->tva_taux/100))).''; + print ''.$fac->lignes[$i]->qty.''; + print ''.price($fac->lignes[$i]->total_ht).''; + print ''.$fac->lignes[$i]->tva_taux.''; + print ''.price($fac->lignes[$i]->tva).''; + print ''.price($fac->lignes[$i]->total_ttc).''; + print ''.img_edit().''; if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) { - print ''.img_delete().''; + print ''.img_delete().''; } else { - print ''.img_delete().''; + print ''.img_delete().''; } print ''; } @@ -750,16 +751,16 @@ print ''; print ''; - //print ''.img_object($langs->trans("ShowProduct"),'product').' '; - print $fac->lignes[$i][0]; - //print ''; + print ''.img_object($langs->trans("ShowProduct"),'product').' '; + print $fac->lignes[$i]->description; + print ''; print ''; - print ''.price($fac->lignes[$i][1]).''; - print ''.$fac->lignes[$i][3].''; - print ''.price($fac->lignes[$i][4]).''; - print ''.$fac->lignes[$i][2].' %'; - print ''.price($fac->lignes[$i][5]).''; - print ''.price($fac->lignes[$i][6]).''; + print ''.price($fac->lignes[$i]->pu_ht).''; + print ''.$fac->lignes[$i]->qty.''; + print ''.price($fac->lignes[$i]->total_ht).''; + print ''.$fac->lignes[$i]->tva_taux.' %'; + print ''.price($fac->lignes[$i]->tva).''; + print ''.price($fac->lignes[$i]->total_ttc).''; print ''; } print ''; diff -ubwr --ignore-matching-lines='$Id:' --ignore-matching-lines='$Revision:' --ignore-matching-lines=Copyright dolibarr.orig/htdocs/fourn/fournisseur.commande.class.php dolibarr/htdocs/fourn/fournisseur.commande.class.php --- dolibarr.orig/htdocs/fourn/fournisseur.commande.class.php 2007-01-06 16:47:53.000000000 +0100 +++ dolibarr/htdocs/fourn/fournisseur.commande.class.php 2007-01-24 10:26:26.000000000 +0100 @@ -113,7 +113,8 @@ $this->lignes = array(); $sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,'; - $sql.= ' p.label, p.description as product_desc, p.ref, p.fk_product_type, p.rowid as prodid'; + #$sql.= ' p.label, p.description as product_desc, p.ref, p.fk_product_type, p.rowid as prodid'; + $sql.= ' p.label, p.description as product_desc, p.ref, p.rowid as prodid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as l'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid'; $sql.= ' WHERE l.fk_commande = '.$this->id; diff -ubwr --ignore-matching-lines='$Id:' --ignore-matching-lines='$Revision:' --ignore-matching-lines=Copyright dolibarr.orig/htdocs/fourn/fournisseur.facture.class.php dolibarr/htdocs/fourn/fournisseur.facture.class.php --- dolibarr.orig/htdocs/fourn/fournisseur.facture.class.php 2006-10-14 19:05:07.000000000 +0200 +++ dolibarr/htdocs/fourn/fournisseur.facture.class.php 2007-01-24 16:39:41.000000000 +0100 @@ -122,10 +123,10 @@ { $idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det'); $this->updateline($idligne, - $this->lignes[$i][0], - $this->lignes[$i][1], - $this->lignes[$i][2], - $this->lignes[$i][3]); + $this->lignes[$i]->description, + $this->lignes[$i]->pu_ht, + $this->lignes[$i]->tva_taux, + $this->lignes[$i]->qty); } } // Mise à jour prix @@ -206,7 +207,7 @@ /* * Lignes */ - $sql = 'SELECT rowid, description, pu_ht, qty, tva_taux, tva, total_ht, total_ttc'; + $sql = 'SELECT rowid, description, pu_ht, qty, tva_taux, tva, total_ht, total_ttc, fk_product'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det'; $sql .= ' WHERE fk_facture_fourn='.$this->id; $resql_rows = $this->db->query($sql); @@ -218,16 +219,7 @@ { while ($i < $num_rows) { - $obj = $this->db->fetch_object($resql_rows); - $this->lignes[$i][0] = $obj->description; - $this->lignes[$i][1] = $obj->pu_ht; - $this->lignes[$i][2] = $obj->tva_taux; - $this->lignes[$i][3] = $obj->qty; - $this->lignes[$i][4] = $obj->total_ht; - $this->lignes[$i][5] = $obj->tva; - $this->lignes[$i][6] = $obj->total_ttc; - $this->lignes[$i][7] = $obj->rowid; - $this->lignes[$i][8] = $obj->total_tva; + $this->lignes[$i] = $this->db->fetch_object($resql_rows); $i++; } } @@ -348,7 +340,7 @@ * \param tauxtva taux de tva * \param qty quantité */ - function addline($desc, $pu, $tauxtva, $qty, $idproduct) + function addline($desc, $pu, $tauxtva, $qty, $idproduct=0) { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)'; $sql .= ' VALUES ('.$this->id.');'; diff -ubwr --ignore-matching-lines='$Id:' --ignore-matching-lines='$Revision:' --ignore-matching-lines=Copyright dolibarr.orig/htdocs/fourn/product/categorie.php dolibarr/htdocs/fourn/product/categorie.php --- dolibarr.orig/htdocs/fourn/product/categorie.php 2005-12-03 13:28:02.000000000 +0100 +++ dolibarr/htdocs/fourn/product/categorie.php 2007-01-24 10:26:26.000000000 +0100 @@ -28,9 +29,6 @@ if (!$user->rights->produit->lire) accessforbidden(); -$types[0] = $langs->trans("Product"); -$types[1] = $langs->trans("Service"); - /* * Creation de l'objet produit correspondant à l'id */ diff -ubwr --ignore-matching-lines='$Id:' --ignore-matching-lines='$Revision:' --ignore-matching-lines=Copyright dolibarr.orig/htdocs/fourn/product/fiche.php dolibarr/htdocs/fourn/product/fiche.php --- dolibarr.orig/htdocs/fourn/product/fiche.php 2006-08-02 01:54:39.000000000 +0200 +++ dolibarr/htdocs/fourn/product/fiche.php 2007-01-24 10:26:26.000000000 +0100 @@ -40,9 +41,6 @@ if (!$user->rights->produit->lire) accessforbidden(); -$types[0] = $langs->trans("Product"); -$types[1] = $langs->trans("Service"); - /* * */ @@ -221,7 +219,7 @@ print ''."\n"; print ''."\n"; - if ($_GET["type"]==0) { $title=$langs->trans("NewProduct"); } + if ($_GET["type"]!=1) { $title=$langs->trans("NewProduct"); } if ($_GET["type"]==1) { $title=$langs->trans("NewService"); } print_fiche_titre($title); @@ -251,7 +249,7 @@ print ''; print ''.$langs->trans("Label").''; - if ($_GET["type"] == 0 && $conf->stock->enabled) + if ($_GET["type"] != 1 && $conf->stock->enabled) { print "".'Seuil stock'; print ''; @@ -308,7 +306,7 @@ $hselected = $h; $h++; - if($product->type == 0) + if($product->isproduct()) { if ($conf->stock->enabled) { @@ -368,8 +366,8 @@ print ''.$langs->trans("SellingPrice").''.price($product->price).''; $nblignefour=2; - if ($product->type == 0 && $conf->stock->enabled) $nblignefour++; - if ($product->type == 1) $nblignefour++; + if ($product->isproduct() && $conf->stock->enabled) $nblignefour++; + if ($product->isservice()) $nblignefour++; print ''; $product->show_photos($conf->produit->dir_output,1,1,0); @@ -379,7 +377,7 @@ print ''.$langs->trans("Description").''.nl2br($product->description).''; // Stock - if ($product->type == 0 && $conf->stock->enabled) + if ($product->isproduct() && $conf->stock->enabled) { print ''.$langs->trans("Stock").''; if ($product->no_stock) @@ -401,7 +399,7 @@ } // Duration - if ($product->type == 1) + if ($product->isservice()) { print ''.$langs->trans("Duration").''.$product->duration_value.' '; @@ -512,7 +510,11 @@ if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && $user->rights->produit->creer) { - print_fiche_titre('Edition de la fiche '.$types[$product->type].' : '.$product->ref, ""); + if ($product->isservice()) { + print_fiche_titre($langs->trans('Edit').' '.$langs->trans('Service').' : '.$product->ref, ""); + } else { + print_fiche_titre($langs->trans('Edit').' '.$langs->trans('Product').' : '.$product->ref, ""); + } if ($mesg) { print '
'.$mesg.'

'; @@ -526,7 +528,7 @@ print ''.$langs->trans("Label").''; - if ($product->type == 0 && $conf->stock->enabled) + if ($product->isproduct() && $conf->stock->enabled) { print "".'Seuil stock'; print ''; @@ -541,7 +543,7 @@ print $product->description; print ""; - if ($product->type == 1) + if ($product->isservice()) { print ''.$langs->trans("Duration").''; print '  '; @@ -580,14 +582,14 @@ print ''.$langs->trans("Edit").''; } - if ($product->type == 0 && $conf->stock->enabled) + if ($product->isproduct() && $conf->stock->enabled) { print ''.$langs->trans("CorrectStock").''; } print ''.$langs->trans("AddSupplier").''; - if ($product->type == 0 && $user->rights->commande->creer) + if ($product->isproduct() && $user->rights->commande->creer) { $langs->load('orders'); print ''; diff -ubwr --ignore-matching-lines='$Id:' --ignore-matching-lines='$Revision:' --ignore-matching-lines=Copyright dolibarr.orig/htdocs/fourn/product/index.php dolibarr/htdocs/fourn/product/index.php --- dolibarr.orig/htdocs/fourn/product/index.php 2007-01-27 16:28:31.000000000 +0100 +++ dolibarr/htdocs/fourn/product/index.php 2007-01-24 10:26:26.000000000 +0100 @@ -96,11 +97,11 @@ /* - * Derniers produits/services en vente + * Derniers produits en vente */ -$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type"; +$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.type"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p "; -$sql .= " WHERE p.fk_product_type=0"; +$sql .= " WHERE p.fk_product_type <> 1"; $sql .= " ORDER BY p.datec DESC "; $sql .= $db->plimit(15 ,0); @@ -112,9 +113,6 @@ $i = 0; - $typeprodser[0]=$langs->trans("Product"); - $typeprodser[1]=$langs->trans("Service"); - if ($num > 0) { print ''; @@ -132,8 +130,10 @@ else print img_object($langs->trans("ShowProduct"),"product"); print "rowid\">$objp->ref\n"; print ""; - print ""; - print "\n"; + print "\n"; $i++; } $db->free($resql); diff -ubwr --ignore-matching-lines='$Id:' --ignore-matching-lines='$Revision:' --ignore-matching-lines=Copyright dolibarr.orig/htdocs/fourn/product/photos.php dolibarr/htdocs/fourn/product/photos.php --- dolibarr.orig/htdocs/fourn/product/photos.php 2006-09-02 22:53:20.000000000 +0200 +++ dolibarr/htdocs/fourn/product/photos.php 2007-01-24 10:26:26.000000000 +0100 @@ -35,9 +36,6 @@ if (!$user->rights->produit->lire) accessforbidden(); -$types[0] = $langs->trans("Product"); -$types[1] = $langs->trans("Service"); - /* * */ @@ -118,7 +116,7 @@ * Ajouter une photo * */ - if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && $product->isproduct && $conf->upload) + if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && $product->isproduct() && $conf->upload) { print_titre($langs->trans("AddPhoto")); @@ -202,7 +200,7 @@ if ($_GET["action"] == '') { - if ( $user->rights->produit->creer && $product->isproduct && $conf->upload) + if ( $user->rights->produit->creer && $product->isproduct() && $conf->upload) { print ''; print $langs->trans("AddPhoto").'';
$objp->label".$typeprodser[$objp->fk_product_type]."
"; + if ($objp->fk_product_type==1) print $langs->trans('ShowService'); + else print $langs->trans('ShowProduct'); + print "