Clean dead code
This commit is contained in:
parent
758f5897d3
commit
ccba65fe74
@ -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
|
* 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
|
* @return int <0 if KO, Nb of lines found if OK
|
||||||
*/
|
*/
|
||||||
function loadExpeditions($filtre_statut=-1)
|
function loadExpeditions($filtre_statut=-1)
|
||||||
@ -1934,21 +1934,6 @@ class Commande extends CommonOrder
|
|||||||
else dol_print_error($this->db);
|
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
|
* Return a array with the pending stock by product
|
||||||
*
|
*
|
||||||
|
|||||||
@ -72,6 +72,7 @@ ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from opened suppli
|
|||||||
NoProductToShipFoundIntoStock=No product to ship found into warehouse <b>%s</b>. Correct stock or go back to choose another warehouse.
|
NoProductToShipFoundIntoStock=No product to ship found into warehouse <b>%s</b>. Correct stock or go back to choose another warehouse.
|
||||||
WeightVolShort=Weight/Vol.
|
WeightVolShort=Weight/Vol.
|
||||||
ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments.
|
ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments.
|
||||||
|
CloseShippeOrdersAutomatically=Classify the order "Delivered" if entirely shipped.
|
||||||
|
|
||||||
# Sending methods
|
# Sending methods
|
||||||
SendingMethodCATCH=Catch by customer
|
SendingMethodCATCH=Catch by customer
|
||||||
|
|||||||
@ -300,213 +300,7 @@ $formfile = new FormFile($db);
|
|||||||
if ($action == 'create') // Seems to no be used
|
if ($action == 'create') // Seems to no be used
|
||||||
{
|
{
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("CreateADeliveryOrder"));
|
|
||||||
|
|
||||||
if ($mesg)
|
|
||||||
{
|
|
||||||
print $mesg.'<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$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 '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
|
||||||
print '<input type="hidden" name="commande_id" value="'.$commande->id.'">';
|
|
||||||
if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled))
|
|
||||||
{
|
|
||||||
print '<input type="hidden" name="entrepot_id" value="'.$_GET["entrepot_id"].'">';
|
|
||||||
}
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
|
|
||||||
print '<td width="30%"><b><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->name.'</a></b></td>';
|
|
||||||
|
|
||||||
print '<td width="50%" colspan="2">';
|
|
||||||
|
|
||||||
print "</td></tr>";
|
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("Date")."</td>";
|
|
||||||
print "<td>".dol_print_date($commande->date,'dayhourtext')."</td>\n";
|
|
||||||
|
|
||||||
print '<td>'.$langs->trans("Order").'</td><td><a href="'.DOL_URL_ROOT.'/commande/card.php?id='.$commande->id.'">'.img_object($langs->trans("ShowOrder"),'order').' '.$commande->ref.'</a>';
|
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
|
|
||||||
if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled))
|
|
||||||
{
|
|
||||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
$ents = $entrepot->list_array();
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/product/stock/card.php?id='.$_GET["entrepot_id"].'">'.img_object($langs->trans("ShowWarehouse"),'stock').' '.$ents[$_GET["entrepot_id"]].'</a>';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<td>".$langs->trans("Author")."</td><td>".$author->getFullName($langs)."</td>\n";
|
|
||||||
|
|
||||||
if ($commande->note)
|
|
||||||
{
|
|
||||||
print '<tr><td colspan="3">Note : '.nl2br($commande->note)."</td></tr>";
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Lignes de commandes
|
|
||||||
*/
|
|
||||||
print '<br><table class="noborder" width="100%">';
|
|
||||||
|
|
||||||
$commande->fetch_lines(1);
|
|
||||||
$lines = $commande->lines;
|
|
||||||
|
|
||||||
// Lecture des livraisons deja effectuees
|
|
||||||
$commande->livraison_array();
|
|
||||||
|
|
||||||
$num = count($commande->lines);
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td width="54%">'.$langs->trans("Description").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("QtyReceived").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("QtyToShip").'</td>';
|
|
||||||
if (! empty($conf->stock->enabled))
|
|
||||||
{
|
|
||||||
print '<td width="12%" align="center">'.$langs->trans("Stock").'</td>';
|
|
||||||
}
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
$var=true;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$product = new Product($db);
|
|
||||||
|
|
||||||
$line = $commande->lines[$i];
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr ".$bc[$var].">\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 '<td>';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$line->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.$label;
|
|
||||||
if ($line->description) print nl2br($line->description);
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<td>";
|
|
||||||
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.= ' <strong>'.$line->label.'</strong>';
|
|
||||||
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 "</td>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<td align="center">'.$line->qty.'</td>';
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print '<td align="center">';
|
|
||||||
$quantite_livree = $commande->livraisons[$line->id];
|
|
||||||
print $quantite_livree;
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
$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 '<td align="center">';
|
|
||||||
print '<input name="idl'.$i.'" type="hidden" value="'.$line->id.'">';
|
|
||||||
print '<input name="qtyl'.$i.'" type="text" size="6" value="'.min($quantite_a_livrer, $stock).'">';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Stock
|
|
||||||
if ($stock < $quantite_a_livrer)
|
|
||||||
{
|
|
||||||
print '<td align="center">'.$stock.' '.img_warning().'</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td align="center">'.$stock.'</td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Quantite a livrer
|
|
||||||
print '<td align="center">';
|
|
||||||
print '<input name="idl'.$i.'" type="hidden" value="'.$line->id.'">';
|
|
||||||
print '<input name="qtyl'.$i.'" type="text" size="6" value="'.$quantite_a_livrer.'">';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
$var=!$var;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
print '<tr><td align="center" colspan="4"><br><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
|
||||||
print "</table>";
|
|
||||||
print '</form>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user