New: Add value of stock in movement pages
This commit is contained in:
parent
05ea7a0af9
commit
31a9a9d65f
@ -54,7 +54,7 @@ class Entrepot extends CommonObject
|
||||
|
||||
/*
|
||||
* \brief Constructeur de l'objet entrepot
|
||||
* \param DB Handler d'accès à la base de donnée
|
||||
* \param DB Handler d'acc<EFBFBD>s <EFBFBD> la base de donn<EFBFBD>e
|
||||
*/
|
||||
function Entrepot($DB)
|
||||
{
|
||||
@ -67,7 +67,7 @@ class Entrepot extends CommonObject
|
||||
|
||||
/*
|
||||
* \brief Creation d'un entrepot en base
|
||||
* \param Objet user qui crée l'entrepot
|
||||
* \param Objet user qui cr<EFBFBD>e l'entrepot
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
@ -122,7 +122,7 @@ class Entrepot extends CommonObject
|
||||
|
||||
/*
|
||||
* \brief Mise a jour des information d'un entrepot
|
||||
* \param id id de l'entrepot à modifier
|
||||
* \param id id de l'entrepot <EFBFBD> modifier
|
||||
* \param user
|
||||
*/
|
||||
function update($id, $user)
|
||||
@ -162,8 +162,8 @@ class Entrepot extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Recupéeration de la base d'un entrepot
|
||||
* \param id id de l'entrepot a récupérer
|
||||
* \brief Recup<EFBFBD>eration de la base d'un entrepot
|
||||
* \param id id de l'entrepot a r<EFBFBD>cup<EFBFBD>rer
|
||||
*/
|
||||
function fetch ($id)
|
||||
{
|
||||
@ -262,7 +262,7 @@ class Entrepot extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie la liste des entrepôts ouverts
|
||||
* \brief Renvoie la liste des entrep<EFBFBD>ts ouverts
|
||||
*/
|
||||
function list_array()
|
||||
{
|
||||
@ -290,13 +290,16 @@ class Entrepot extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoie le stock (nombre de produits) de l'entrepot
|
||||
* \brief Renvoie le stock (nombre de produits) et valorisation de l'entrepot
|
||||
* \return Array Array('nb'=>Nb, 'value'=>Value)
|
||||
*/
|
||||
function nb_products()
|
||||
{
|
||||
global $conf,$user;
|
||||
|
||||
$sql = "SELECT sum(ps.reel)";
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * ps.pmp) as value";
|
||||
$sql .= " FROM llx_product_stock as ps";
|
||||
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
|
||||
{
|
||||
@ -309,24 +312,28 @@ class Entrepot extends CommonObject
|
||||
$sql.= ' AND IFNULL(c.visible,1)=1';
|
||||
}
|
||||
|
||||
//print $sql;
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
if ( $result )
|
||||
if ($result)
|
||||
{
|
||||
$row = $this->db->fetch_row(0);
|
||||
return $row[0];
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$ret['nb']=$obj->nb;
|
||||
$ret['value']=$obj->value;
|
||||
|
||||
$this->db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourne le libellé du statut d'un entrepot (ouvert, ferme)
|
||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
|
||||
* \brief Retourne le libell<EFBFBD> du statut d'un entrepot (ouvert, ferme)
|
||||
* \param mode 0=libell<EFBFBD> long, 1=libell<EFBFBD> court, 2=Picto + Libell<EFBFBD> court, 3=Picto, 4=Picto + Libell<EFBFBD> long
|
||||
* \return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
@ -335,10 +342,10 @@ class Entrepot extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libellé d'un statut donné
|
||||
* \brief Renvoi le libell<EFBFBD> d'un statut donn<EFBFBD>
|
||||
* \param statut Id statut
|
||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
|
||||
* \return string Libellé du statut
|
||||
* \param mode 0=libell<EFBFBD> long, 1=libell<EFBFBD> court, 2=Picto + Libell<EFBFBD> court, 3=Picto, 4=Picto + Libell<EFBFBD> long, 5=Libell<EFBFBD> court + Picto
|
||||
* \return string Libell<EFBFBD> du statut
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -112,9 +112,18 @@ if ($_GET["id"])
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
$calcproducts=$entrepot->nb_products();
|
||||
|
||||
// Nb of products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
|
||||
print $entrepot->nb_products();
|
||||
print empty($calcproducts['nb'])?'0':$calcproducts['nb'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Value
|
||||
print '<tr><td valign="top">'.$langs->trans("EstimatedStockValueShort").'</td><td colspan="3">';
|
||||
print empty($calcproducts['value'])?'0':$calcproducts['value'];
|
||||
print "</td></tr>";
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -255,13 +255,16 @@ else
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($entrepot->description).'</td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">';
|
||||
print $entrepot->address;
|
||||
print '</td></tr>';
|
||||
|
||||
// Ville
|
||||
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$entrepot->cp.'</td>';
|
||||
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$entrepot->ville.'</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print $entrepot->pays;
|
||||
print '</td></tr>';
|
||||
@ -269,10 +272,16 @@ else
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
$calcproducts=$entrepot->nb_products();
|
||||
|
||||
// Nb of products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
|
||||
$nb=$entrepot->nb_products();
|
||||
print empty($nb)?'0':$nb;
|
||||
print empty($calcproducts['nb'])?'0':$calcproducts['nb'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Value
|
||||
print '<tr><td valign="top">'.$langs->trans("EstimatedStockValueShort").'</td><td colspan="3">';
|
||||
print empty($calcproducts['value'])?'0':$calcproducts['value'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Last movement
|
||||
@ -326,12 +335,15 @@ else
|
||||
print_liste_field_titre($langs->trans("Product"),"", "p.ref","&id=".$_GET['id'],"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"", "p.label","&id=".$_GET['id'],"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Units"),"", "ps.reel","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AverageUnitPricePMPShort"),"", "ps.pmp","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EstimatedStockValueShort"),"", "","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AverageUnitPricePMPShort"),"", "ps.pmp","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EstimatedStockValueShort"),"", "","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder);
|
||||
if ($user->rights->stock->mouvement->creer) print '<td> </td>';
|
||||
if ($user->rights->stock->creer) print '<td> </td>';
|
||||
print "</tr>";
|
||||
|
||||
$totalunit=0;
|
||||
$totalvalue=0;
|
||||
|
||||
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.fk_product_type as type,";
|
||||
$sql.= " ps.pmp, ps.reel as value";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p";
|
||||
@ -348,7 +360,6 @@ else
|
||||
$sql.= ' AND IFNULL(c.visible,1)=1';
|
||||
}
|
||||
$sql.= " ORDER BY " . $sortfield . " " . $sortorder;
|
||||
|
||||
//$sql .= $db->plimit($limit + 1 ,$offset);
|
||||
|
||||
$resql = $db->query($sql) ;
|
||||
@ -390,10 +401,12 @@ else
|
||||
print '<td>'.$objp->produit.'</td>';
|
||||
|
||||
print '<td align="right">'.$objp->value.'</td>';
|
||||
$totalunit+=$objp->value;
|
||||
|
||||
print '<td align="center">'.price(price2num($objp->pmp,'MU')).'</td>';
|
||||
print '<td align="right">'.price(price2num($objp->pmp,'MU')).'</td>';
|
||||
|
||||
print '<td align="center">'.price(price2num($objp->pmp*$objp->value,'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($objp->pmp*$objp->value,'MT')).'</td>';
|
||||
$totalvalue+=price2num($objp->pmp*$objp->value,'MT');
|
||||
|
||||
if ($user->rights->stock->mouvement->creer)
|
||||
{
|
||||
@ -413,6 +426,15 @@ else
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
print '<tr class="liste_total"><td class="liste_total" colspan="2">'.$langs->trans("Total").'</td>';
|
||||
print '<td class="liste_total" align="right">'.$totalunit.'</td>';
|
||||
print '<td class="liste_total"> </td>';
|
||||
print '<td class="liste_total" align="right">'.$totalvalue.'</td>';
|
||||
print '<td class="liste_total"> </td>';
|
||||
print '<td class="liste_total"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -17,10 +17,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/product/stock/info.php
|
||||
\ingroup facture
|
||||
\brief Page des informations d'un entrepot
|
||||
\version $Id$
|
||||
* \file htdocs/product/stock/info.php
|
||||
* \ingroup stock
|
||||
* \brief Page des informations d'un entrepot
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
@ -166,9 +166,56 @@ if ($resql)
|
||||
|
||||
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($entrepot->description).'</td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">';
|
||||
print $entrepot->address;
|
||||
print '</td></tr>';
|
||||
|
||||
// Ville
|
||||
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$entrepot->cp.'</td>';
|
||||
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$entrepot->ville.'</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print $entrepot->pays;
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
$calcproducts=$entrepot->nb_products();
|
||||
|
||||
// Nb of products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
|
||||
print empty($calcproducts['nb'])?'0':$calcproducts['nb'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Value
|
||||
print '<tr><td valign="top">'.$langs->trans("EstimatedStockValueShort").'</td><td colspan="3">';
|
||||
print empty($calcproducts['value'])?'0':$calcproducts['value'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Last movement
|
||||
$sql = "SELECT max( ".$db->pdate("m.datem").") as datem";
|
||||
$sql .= " FROM llx_stock_mouvement as m";
|
||||
$sql .= " WHERE m.fk_entrepot = '".$entrepot->id."';";
|
||||
$resqlbis = $db->query($sql);
|
||||
if ($resqlbis)
|
||||
{
|
||||
$row = $db->fetch_row($resqlbis);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("LastMovement").'</td><td colspan="3">';
|
||||
print '<a href="mouvement.php?id='.$entrepot->id.'">'.dol_print_date($row[0]).'</a>';
|
||||
print "</td></tr>";
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -20,11 +20,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/product/stock/user.php
|
||||
\ingroup stock
|
||||
\brief Page to link dolibarr users with warehouses
|
||||
\version $Id$
|
||||
*/
|
||||
\file htdocs/product/stock/user.php
|
||||
\ingroup stock
|
||||
\brief Page to link dolibarr users with warehouses
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
@ -49,132 +49,131 @@ $mesg = '';
|
||||
|
||||
|
||||
/*
|
||||
* Affichage fiche en mode création
|
||||
*
|
||||
*/
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader("","",$langs->trans("WarehouseCard"));
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
if ($_GET["id"])
|
||||
{
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
$entrepot = new Entrepot($db);
|
||||
$result = $entrepot->fetch($_GET["id"]);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
/*
|
||||
* Affichage fiche
|
||||
*/
|
||||
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
|
||||
{
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("WarehouseCard");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("StockMovements");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche-valo.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("EnhancedValue");
|
||||
$h++;
|
||||
if ($_GET["id"])
|
||||
{
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("Users");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$h++;
|
||||
$entrepot = new Entrepot($db);
|
||||
$result = $entrepot->fetch($_GET["id"]);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$entrepot->libelle.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($entrepot->description).'</td></tr>';
|
||||
/*
|
||||
* Affichage fiche
|
||||
*/
|
||||
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
|
||||
{
|
||||
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">';
|
||||
print $entrepot->address;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$entrepot->cp.'</td>';
|
||||
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$entrepot->ville.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print $entrepot->pays;
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
print "</div>";
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
$h = 0;
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Affichage des utilisateurs de l'entrepot */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("User"),"", "p.ref","&id=".$_GET['id'],"",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"", "p.label","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Units"),"", "ps.reel","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||
print "</tr>";
|
||||
$sql = "SELECT u.rowid as rowid, u.name, u.firstname, ue.send, ue.consult ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user_entrepot as ue, ".MAIN_DB_PREFIX."user as u ";
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("WarehouseCard");
|
||||
$h++;
|
||||
|
||||
$sql .= " WHERE ue.fk_user = u.rowid ";
|
||||
$sql .= " AND ue.fk_entrepot = ".$entrepot->id;
|
||||
|
||||
//$sql .= " ORDER BY " . $sortfield . " " . $sortorder;
|
||||
//$sql .= $db->plimit($limit + 1 ,$offset);
|
||||
|
||||
$resql = $db->query($sql) ;
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("StockMovements");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche-valo.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("EnhancedValue");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("Users");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$entrepot->libelle.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($entrepot->description).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">';
|
||||
print $entrepot->address;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$entrepot->cp.'</td>';
|
||||
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$entrepot->ville.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print $entrepot->pays;
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
print "</div>";
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Affichage des utilisateurs de l'entrepot */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("User"),"", "p.ref","&id=".$_GET['id'],"",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"", "p.label","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Units"),"", "ps.reel","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||
print "</tr>";
|
||||
$sql = "SELECT u.rowid as rowid, u.name, u.firstname, ue.send, ue.consult ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user_entrepot as ue, ".MAIN_DB_PREFIX."user as u ";
|
||||
|
||||
$sql .= " WHERE ue.fk_user = u.rowid ";
|
||||
$sql .= " AND ue.fk_entrepot = ".$entrepot->id;
|
||||
|
||||
//$sql .= " ORDER BY " . $sortfield . " " . $sortorder;
|
||||
//$sql .= $db->plimit($limit + 1 ,$offset);
|
||||
|
||||
$resql = $db->query($sql) ;
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
@ -185,16 +184,16 @@ $form=new Form($db);
|
||||
print '<td align="center">'.$objp->send.'</td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user