Qual: Uniformize code
This commit is contained in:
parent
e2242a4e02
commit
0067d360c4
@ -27,6 +27,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
|
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
@ -123,6 +125,7 @@ if ($_POST["cancel"] == $langs->trans("Cancel"))
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$productstatic=new Product($db);
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("WarehouseCard"));
|
llxHeader("","",$langs->trans("WarehouseCard"));
|
||||||
@ -329,7 +332,7 @@ else
|
|||||||
if ($user->rights->stock->creer) print '<td> </td>';
|
if ($user->rights->stock->creer) print '<td> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit,";
|
$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.= " ps.pmp, ps.reel as value";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p";
|
||||||
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
|
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
|
||||||
@ -378,16 +381,19 @@ else
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
//print '<td>'.dol_print_date($objp->datem).'</td>';
|
//print '<td>'.dol_print_date($objp->datem).'</td>';
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td><a href=\"../fiche.php?id=$objp->rowid\">";
|
print "<td>";
|
||||||
print img_object($langs->trans("ShowProduct"),"product").' '.$objp->ref;
|
$productstatic->id=$objp->rowid;
|
||||||
print "</a></td>";
|
$productstatic->ref=$objp->ref;
|
||||||
|
$productstatic->type=$objp->type;
|
||||||
|
print $productstatic->getNomUrl(1,'',16);
|
||||||
|
print '</td>';
|
||||||
print '<td>'.$objp->produit.'</td>';
|
print '<td>'.$objp->produit.'</td>';
|
||||||
|
|
||||||
print '<td align="right">'.$objp->value.'</td>';
|
print '<td align="right">'.$objp->value.'</td>';
|
||||||
|
|
||||||
print '<td align="center">'.price(price2num($objp->pmp,'MT')).'</td>';
|
print '<td align="center">'.price(price2num($objp->pmp,'MU')).'</td>';
|
||||||
|
|
||||||
print '<td align="center">'.price(price2num($objp->pmp,'MT')*$objp->value).'</td>';
|
print '<td align="center">'.price(price2num($objp->pmp*$objp->value,'MT')).'</td>';
|
||||||
|
|
||||||
if ($user->rights->stock->mouvement->creer)
|
if ($user->rights->stock->mouvement->creer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
|
||||||
|
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|
||||||
@ -49,9 +51,11 @@ if (! $sortorder) $sortorder="DESC";
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$productstatic=new Product($db);
|
||||||
|
$warehousestatic=new Entrepot($db);
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.label as produit,";
|
$sql = "SELECT p.rowid, p.label as produit, p.fk_product_type as type,";
|
||||||
$sql.= " s.label as stock, s.rowid as entrepot_id,";
|
$sql.= " s.label as stock, s.rowid as entrepot_id,";
|
||||||
$sql.= " m.rowid as mid, m.value, m.datem";
|
$sql.= " m.rowid as mid, m.value, m.datem";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as s";
|
||||||
@ -91,7 +95,6 @@ $sql.= " ORDER BY $sortfield $sortorder ";
|
|||||||
$sql.= $db->plimit($conf->liste_limit + 1 ,$offset);
|
$sql.= $db->plimit($conf->liste_limit + 1 ,$offset);
|
||||||
|
|
||||||
$resql = $db->query($sql) ;
|
$resql = $db->query($sql) ;
|
||||||
|
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
@ -218,13 +221,18 @@ if ($resql)
|
|||||||
// Date
|
// Date
|
||||||
print '<td>'.dol_print_date($db->jdate($objp->datem),'dayhour').'</td>';
|
print '<td>'.dol_print_date($db->jdate($objp->datem),'dayhour').'</td>';
|
||||||
// Product
|
// Product
|
||||||
print "<td><a href=\"../fiche.php?id=$objp->rowid\">";
|
print '<td>';
|
||||||
print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit;
|
$productstatic->id=$objp->rowid;
|
||||||
print "</a></td>\n";
|
$productstatic->ref=$objp->produit;
|
||||||
|
$productstatic->type=$objp->type;
|
||||||
|
print $productstatic->getNomUrl(1,'',16);
|
||||||
|
print "</td>\n";
|
||||||
// Warehouse
|
// Warehouse
|
||||||
print '<td><a href="fiche.php?id='.$objp->entrepot_id.'">';
|
print '<td>';
|
||||||
print img_object($langs->trans("ShowWarehouse"),"stock").' '.$objp->stock;
|
$warehousestatic->id=$objp->entrepot_id;
|
||||||
print "</a></td>\n";
|
$warehousestatic->libelle=$objp->stock;
|
||||||
|
print $warehousestatic->getNomUrl(1);
|
||||||
|
print "</td>\n";
|
||||||
// Value
|
// Value
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($objp->value > 0) print '+';
|
if ($objp->value > 0) print '+';
|
||||||
|
|||||||
@ -382,10 +382,10 @@ if ($resql)
|
|||||||
print '<td>'.$entrepotstatic->getNomUrl(1).'</td>';
|
print '<td>'.$entrepotstatic->getNomUrl(1).'</td>';
|
||||||
print '<td align="right">'.$obj->reel.'</td>';
|
print '<td align="right">'.$obj->reel.'</td>';
|
||||||
print '<td align="right">'.price2num($obj->pmp,'MU').'</td>';
|
print '<td align="right">'.price2num($obj->pmp,'MU').'</td>';
|
||||||
print '<td align="right">'.price(price2num($obj->pmp,'MU')*$obj->reel).'</td>';
|
print '<td align="right">'.price(price2num($obj->pmp*$obj->reel,'MT')).'</td>';
|
||||||
print '</tr>'; ;
|
print '</tr>'; ;
|
||||||
$total = $total + $obj->reel;
|
$total = $total + $obj->reel;
|
||||||
$totalvalue = $totalvalue + price2num($obj->pmp,'MU')*$obj->reel;
|
$totalvalue = $totalvalue + price2num($obj->pmp,'MT')*$obj->reel;
|
||||||
$i++;
|
$i++;
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user