From ccba65fe7401a0d1f9363a09f7529d4946711297 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2016 22:30:50 +0200 Subject: [PATCH] Clean dead code --- htdocs/commande/class/commande.class.php | 19 +-- htdocs/langs/en_US/sendings.lang | 1 + htdocs/livraison/card.php | 208 +---------------------- 3 files changed, 4 insertions(+), 224 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e0c3c00adad..f5ea791a02d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1863,9 +1863,9 @@ class Commande extends CommonOrder /** * Load array this->expeditions of lines of shipments with nb of products sent for each order line - * Note: For a dedicated shipment, the fetch_lines load the qty_asked and qty_shipped. This function return qty_shipped cuulated for order + * Note: For a dedicated shipment, the fetch_lines can be used to load the qty_asked and qty_shipped. This function is use to return qty_shipped cumulated for the order * - * @param int $filtre_statut Filter on status + * @param int $filtre_statut Filter on shipment status * @return int <0 if KO, Nb of lines found if OK */ function loadExpeditions($filtre_statut=-1) @@ -1934,21 +1934,6 @@ class Commande extends CommonOrder else dol_print_error($this->db); } - /** - * Return a array with sendings by line - * - * @param int $filtre_statut Filtre sur statut - * @return int 0 si OK, <0 si KO - * - * TODO deprecate, move to Shipping class - */ - function livraison_array($filtre_statut=self::STATUS_CANCELED) - { - $delivery = new Livraison($this->db); - $deliveryArray = $delivery->livraison_array($filtre_statut); - return $deliveryArray; - } - /** * Return a array with the pending stock by product * diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 1ec229af6c5..c35aa71c8a1 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -72,6 +72,7 @@ ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from opened suppli NoProductToShipFoundIntoStock=No product to ship found into warehouse %s. Correct stock or go back to choose another warehouse. WeightVolShort=Weight/Vol. ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments. +CloseShippeOrdersAutomatically=Classify the order "Delivered" if entirely shipped. # Sending methods SendingMethodCATCH=Catch by customer diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 9ae66ee685e..7b47c17f5c7 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -300,213 +300,7 @@ $formfile = new FormFile($db); if ($action == 'create') // Seems to no be used { - print load_fiche_titre($langs->trans("CreateADeliveryOrder")); - - if ($mesg) - { - print $mesg.'
'; - } - - $commande = new Commande($db); - $commande->livraison_array(); - - if ($commande->fetch(GETPOST("commande_id"))) - { - $soc = new Societe($db); - $soc->fetch($commande->socid); - $author = new User($db); - $author->fetch($commande->user_author_id); - - if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) - { - $entrepot = new Entrepot($db); - } - - /* - * Commande - */ - print '
'; - print ''; - print ''; - print ''; - if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) - { - print ''; - } - print ''; - print ''; - print ''; - - print '"; - - print ""; - print "\n"; - - print '\n"; - - print ''; - - if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) - { - print ''; - print ''; - } - - print "\n"; - - if ($commande->note) - { - print '"; - } - print "
'.$langs->trans("Customer").''.$soc->name.''; - - print "
".$langs->trans("Date")."".dol_print_date($commande->date,'dayhourtext')."'.$langs->trans("Order").''.img_object($langs->trans("ShowOrder"),'order').' '.$commande->ref.''; - print "
'.$langs->trans("Warehouse").''; - $ents = $entrepot->list_array(); - print ''.img_object($langs->trans("ShowWarehouse"),'stock').' '.$ents[$_GET["entrepot_id"]].''; - print '".$langs->trans("Author")."".$author->getFullName($langs)."
Note : '.nl2br($commande->note)."
"; - - /* - * Lignes de commandes - */ - print '
'; - - $commande->fetch_lines(1); - $lines = $commande->lines; - - // Lecture des livraisons deja effectuees - $commande->livraison_array(); - - $num = count($commande->lines); - $i = 0; - - if ($num) - { - print ''; - print ''; - print ''; - print ''; - print ''; - if (! empty($conf->stock->enabled)) - { - print ''; - } - print "\n"; - } - $var=true; - while ($i < $num) - { - $product = new Product($db); - - $line = $commande->lines[$i]; - $var=!$var; - print "\n"; - if ($line->fk_product > 0) - { - $product->fetch($line->fk_product); - $product->load_stock(); - - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) - { - $commande->fetch_thirdparty(); - $outputlangs = $langs; - $newlang=''; - if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if (empty($newlang)) $newlang=$commande->thirdparty->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $label = (! empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $product->label; - } - else - $label = (! empty($line->label)?$line->label:$product->label); - - print ''; - } - else - { - print "\n"; - } - - print ''; - /* - * - */ - print ''; - - $quantite_commandee = $line->qty; - $quantite_a_livrer = $quantite_commandee - $quantite_livree; - - if (! empty($conf->stock->enabled)) - { - $stock = $product->stock_warehouse[$_GET["entrepot_id"]]->real; - $stock+=0; // Convertit en numerique - - // Quantite a livrer - print ''; - - // Stock - if ($stock < $quantite_a_livrer) - { - print ''; - } - else - { - print ''; - } - } - else - { - // Quantite a livrer - print ''; - } - - print "\n"; - - $i++; - $var=!$var; - } - - /* - * - */ - - print ''; - print "
'.$langs->trans("Description").''.$langs->trans("QtyOrdered").''.$langs->trans("QtyReceived").''.$langs->trans("QtyToShip").''.$langs->trans("Stock").'
'; - print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$label; - if ($line->description) print nl2br($line->description); - print '"; - if ($line->fk_product_type==1) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - - if (! empty($line->label)) { - $text.= ' '.$line->label.''; - print $form->textwithtooltip($text,$line->description,3,'','',$i); - } else { - print $text.' '.nl2br($line->description); - } - - print_date_range($lines[$i]->date_start,$lines[$i]->date_end); - print "'.$line->qty.''; - $quantite_livree = $commande->livraisons[$line->id]; - print $quantite_livree; - print ''; - print ''; - print ''; - print ''.$stock.' '.img_warning().''.$stock.''; - print ''; - print ''; - print '

"; - print '
'; - } - else - { - dol_print_error($db); - } + } else /* *************************************************************************** */