* Copyright (C) 2008-2009 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/product/stock/fiche-valo.php * \ingroup stock * \brief Page fiche de valorisation du stock dans l'entrepot */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; $langs->load("products"); $langs->load("stocks"); $langs->load("companies"); $mesg = ''; // Security check $result=restrictedArea($user,'stock'); /* * View */ $form=new Form($db); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("",$langs->trans("WarehouseCard"),$help_url); if ($_GET["id"]) { if ($mesg) print $mesg; $entrepot = new Entrepot($db); $result = $entrepot->fetch($_GET["id"]); if ($result < 0) { dol_print_error($db); } $head = stock_prepare_head($entrepot); dol_fiche_head($head, 'value', $langs->trans("Warehouse"), 0, 'stock'); print ''; // Ref print ''; print ''; // Description print ''; print ''; print ''; print ''; print ''; // Statut print ''; $calcproducts=$entrepot->nb_products(); // Nb of products print '"; // Value print '"; print "
'.$langs->trans("Ref").''; print $form->showrefnav($entrepot,'id','',1,'rowid','libelle'); print '
'.$langs->trans("LocationSummary").''.$entrepot->lieu.'
'.$langs->trans("Description").''.nl2br($entrepot->description).'
'.$langs->trans('Address').''; print $entrepot->address; print '
'.$langs->trans('Zip').''.$entrepot->zip.''.$langs->trans('Town').''.$entrepot->town.'
'.$langs->trans('Country').''; print $entrepot->country; print '
'.$langs->trans("Status").''.$entrepot->getLibStatut(4).'
'.$langs->trans("NumberOfProducts").''; print empty($calcproducts['nb'])?'0':$calcproducts['nb']; print "
'.$langs->trans("EstimatedStockValueShort").''; print empty($calcproducts['value'])?'0':$calcproducts['value']; print "
"; print ''; /* ************************************************************************** */ /* */ /* Graph */ /* */ /* ************************************************************************** */ print "
\n"; $year = strftime("%Y",time()); $file=$conf->stock->dir_temp.'/entrepot-'.$entrepot->id.'-'.($year).'.png'; // TODO Build graph in $file from a table called llx_stock_log if (file_exists($file)) { $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_stock&file=entrepot-'.$entrepot->id.'-'.$year.'.png'; print 'Valorisation du stock annee '.($year).''; if (file_exists(DOL_DATA_ROOT.'/entrepot/temp/entrepot-'.$entrepot->id.'-'.($year-1).'.png')) { $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_stock&file=entrepot-'.$entrepot->id.'-'.($year-1).'.png'; print '
Valorisation du stock annee '.($year-1).''; } } else { $langs->load("errors"); print $langs->trans("FeatureNotYetAvailable"); } print "
"; } $db->close(); llxFooter(); ?>