From e95ba9080fb7149aed5eb21c45fec213dbaeb8f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Aug 2010 22:55:10 +0000 Subject: [PATCH] Fix: Bad url --- htdocs/livraison/fiche.php | 41 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 0004b81d803..de8eabe972d 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2009 Laurent Destailleur + * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2005-2010 Regis Houssin @@ -28,13 +28,13 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/livraison/livraison.class.php"); +require_once(DOL_DOCUMENT_ROOT."/livraison/class/livraison.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/livraison/modules_livraison.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); -if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/product.class.php"); -if ($conf->expedition_bon->enabled) require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php"); -if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); +if ($conf->product->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +if ($conf->expedition_bon->enabled) require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); +if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php"); if (!$user->rights->expedition->livraison->lire) accessforbidden(); @@ -48,6 +48,7 @@ if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'expedition',$id,'livraison','livraison'); + /* * Actions */ @@ -136,14 +137,7 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && if ($result > 0) { $db->commit(); - if ($conf->expedition_bon->enabled) - { - Header("Location: ".DOL_URL_ROOT.'/expedition/fiche.php?id='.$delivery->origin_id); - } - else - { - Header("Location: liste.php"); - } + Header("Location: ".DOL_URL_ROOT.'/expedition/index.php'); exit; } else @@ -175,6 +169,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } + $result=delivery_order_pdf_create($db, $_REQUEST['id'],$_REQUEST['model'],$outputlangs); if ($result <= 0) { @@ -216,8 +211,7 @@ if ($_GET["action"] == 'create') $soc = new Societe($db); $soc->fetch($commande->socid); $author = new User($db); - $author->id = $commande->user_author_id; - $author->fetch(); + $author->fetch($commande->user_author_id); if (!$conf->expedition_bon->enabled && $conf->stock->enabled) { @@ -260,7 +254,7 @@ if ($_GET["action"] == 'create') print ''; } - print "".$langs->trans("Author")."$author->fullname\n"; + print "".$langs->trans("Author")."".$author->getFullName($langs)."\n"; if ($commande->note) { @@ -298,13 +292,15 @@ if ($_GET["action"] == 'create') $var=true; while ($i < $num) { + $product = new Product($db); + $ligne = $commande->lignes[$i]; $var=!$var; print "\n"; if ($ligne->fk_product > 0) { - $product = new Product($db); $product->fetch($ligne->fk_product); + $product->load_stock(); print ''; print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle; @@ -330,7 +326,7 @@ if ($_GET["action"] == 'create') if ($conf->stock->enabled) { - $stock = $product->stock_entrepot[$_GET["entrepot_id"]]; + $stock = $product->stock_warehouse[$_GET["entrepot_id"]]->real; $stock+=0; // Convertit en numerique // Quantite a livrer @@ -471,12 +467,13 @@ else print ''; // Date - print ''.$langs->trans("Date").''; + print ''.$langs->trans("DateCreation").''; print ''.dol_print_date($delivery->date_creation,'daytext')."\n"; print ''; - // Date delivery planned - print ''.$langs->trans("DateDeliveryPlanned").''; + // Date delivery real / Received + // TODO Can edit this date, even if validated. + print ''.$langs->trans("DateReceived").''; print ''.dol_print_date($delivery->date_delivery,'daytext')."\n"; print '';