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 ''; - if ($num) - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - } - $var=true; - while ($i < $num) - { - $objp = $db->fetch_object($resql); - $var=!$var; - - // Show product and description - $type=$objp->product_type?$objp->product_type:$objp->fk_product_type; - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (! empty($objp->date_start)) $type=1; - if (! empty($objp->date_end)) $type=1; - - // Ligne en mode visu - if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) - { - print ''; - if ($objp->fk_product > 0) - { - print ''; - } - else - { - print ''; - } - - print ''; - print ''; - print ''; - - //Remise percent (negative or positive) - if (!empty($objp->remise_percent)) - { - print ''; - } - else - { - print ''; - } - - // Montant total HT - print ''; - - // Icone d'edition et suppression - if ($commande->statut == 0 && $user->rights->commande->creer) - { - print ''; - print ''; - if ($num > 1) - { - print ''; - } - } - else - { - print ''; - } - print ''; - } - - // Ligne en mode update - if ($_GET['action'] == 'editline' && $user->rights->commande->creer && $_GET['rowid'] == $objp->rowid) - { - print 'rowid.'" method="post">'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) - // Start and end dates selector - print ''; - print ''; - print ''; - - print ''; - } - - $total = $total + ($objp->qty * $objp->price); - $i++; - } - $db->free($resql); - - $numlines=$num; - } - else - { - dol_print_error($db); - } - */ /* * Form to add new line
'.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('Qty').''.$langs->trans('ReductionShort').''.$langs->trans('TotalHTShort').' 
'; - 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 '
'; - 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 ''.vatrate($objp->tva_tx,'%',$objp->info_bits).''.price($objp->subprice).''; - if (($objp->info_bits & 2) != 2) - { - print $objp->qty; - } - else print ' '; - print ''.dol_print_reduction($objp->remise_percent,$langs).' '.price($objp->total_ht).''; - if (($objp->info_bits & 2) == 2) - { - // Ligne remise predefinie, on ne permet pas modif - } - else - { - print 'rowid.'#'.$objp->rowid.'">'; - print img_edit(); - print ''; - } - print ''; - print 'rowid.'">'; - print img_delete(); - print ''; - if ($i > 0) - { - print 'rowid.'">'; - print img_up(); - print ''; - } - if ($i < $num-1) - { - print 'rowid.'">'; - print img_down(); - print ''; - } - print ' 
'; - print ''; // ancre pour retourner sur la ligne - - - // Show product and description - if ($objp->fk_product > 0) - { - print ''; - $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; - print $text; - print '
'; - } - else - { - print $html->select_type_of_lines($objp->product_type,'type',1); - if ($conf->product->enabled && $conf->service->enabled) print '
'; - } - - // Editor wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('eldesc',$objp->description,140,'dolibarr_details'); - $doleditor->Create(); - } - else - { - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - print ''; - } - print '
'; - if($soc->tva_assuj == "0") - print '0'; - else - print $html->select_tva('tva_tx',$objp->tva_tx,$mysoc,$soc); - print ''; - if (($objp->info_bits & 2) != 2) - { - print ''; - } - else print ' '; - print ''; - if (($objp->info_bits & 2) != 2) - { - print '%'; - } - else print ' '; - print ''; - print '
'.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - print $html->select_date($db->jdate($objp->date_start),'date_start',$usehm,$usehm,$objp->date_start?0:1,"updateligne"); - print ' '.$langs->trans('to').' '; - print $html->select_date($db->jdate($objp->date_end),'date_end',$usehm,$usehm,$objp->date_end?0:1,"updateligne"); - print '