diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 188ee09952d..d31fc030c14 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1896,11 +1896,6 @@ class Commande extends CommonObject $price = price2num($price); $subprice = price2num($subprice); - - // TODO: utile ? - $LigneOld = new OrderLine($this->db); - $LigneOld->fetch($rowid); - // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."commandedet SET"; $sql.= " description='".addslashes($desc)."'"; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 9a865648e64..71b308ec409 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1709,284 +1709,6 @@ else $commande->printLinesList($lines,1); } } - - - /* - $sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.description, l.price, l.qty, l.tva_tx, '; - $sql.= ' l.fk_remise_except, l.remise_percent, l.subprice, l.info_bits,'; - $sql.= ' l.total_ht, l.total_tva, l.total_ttc,'; - $sql.= ' l.date_start,'; - $sql.= ' l.date_end,'; - $sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, '; - $sql.= ' p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid'; - $sql.= ' WHERE l.fk_commande = '.$commande->id; - $sql.= ' ORDER BY l.rang ASC, l.rowid'; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; $total = 0; - - print '
| '.$langs->trans('Description').' | '; - print ''.$langs->trans('VAT').' | '; - print ''.$langs->trans('PriceUHT').' | '; - print ''.$langs->trans('Qty').' | '; - print ''.$langs->trans('ReductionShort').' | '; - print ''.$langs->trans('TotalHTShort').' | '; - print ''; - print " | |||||||
| ';
- print ''; // ancre pour retourner sur la ligne
-
- // Show product and description
- $product_static->type=$objp->fk_product_type;
- $product_static->id=$objp->fk_product;
- $product_static->ref=$objp->ref;
- $product_static->libelle=$objp->product_label;
- $text=$product_static->getNomUrl(1);
- $text.= ' - '.$objp->product_label;
- $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
- print $html->textwithtooltip($text,$description,3,'','',$i);
-
- // Show range
- print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end));
-
- // Add description in form
- if ($conf->global->PRODUIT_DESC_IN_FORM)
- {
- print ($objp->description && $objp->description!=$objp->product_label)?' '.dol_htmlentitiesbr($objp->description):''; - } - - print ' | ';
- }
- else
- {
- print ''; - print ''; // ancre pour retourner sur la ligne - if (($objp->info_bits & 2) == 2) - { - print ''; - print img_object($langs->trans("ShowReduc"),'reduc').' '.$langs->trans("Discount"); - print ''; - if ($objp->description) - { - if ($objp->description == '(CREDIT_NOTE)') - { - require_once(DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'); - $discount=new DiscountAbsolute($db); - $discount->fetch($objp->fk_remise_except); - print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); - } - else - { - print ' - '.nl2br($objp->description); - } - } - } - else - { - if ($type==1) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - print $text.' '.nl2br($objp->description); - - // Show range - print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end)); - } - print ' | '; - } - - print ''.vatrate($objp->tva_tx,'%',$objp->info_bits).' | '; - print ''.price($objp->subprice).' | '; - print ''; - if (($objp->info_bits & 2) != 2) - { - print $objp->qty; - } - else print ' '; - print ' | '; - - //Remise percent (negative or positive) - if (!empty($objp->remise_percent)) - { - print ''.dol_print_reduction($objp->remise_percent,$langs).' | '; - } - else - { - print ''; - } - - // Montant total HT - print ' | '.price($objp->total_ht).' | '; - - // Icone d'edition et suppression - if ($commande->statut == 0 && $user->rights->commande->creer) - { - print ''; - if (($objp->info_bits & 2) == 2) - { - // Ligne remise predefinie, on ne permet pas modif - } - else - { - print 'id.'&action=editline&rowid='.$objp->rowid.'#'.$objp->rowid.'">'; - print img_edit(); - print ''; - } - print ' | '; - print ''; - print 'id.'&action=ask_deleteline&lineid='.$objp->rowid.'">'; - print img_delete(); - print ' | '; - if ($num > 1) - { - print ''; - if ($i > 0) - { - print 'id.'&action=up&rowid='.$objp->rowid.'">'; - print img_up(); - print ''; - } - if ($i < $num-1) - { - print 'id.'&action=down&rowid='.$objp->rowid.'">'; - print img_down(); - print ''; - } - print ' | '; - } - } - else - { - print ''; - } - print ' | ||