Enhancements on datawarehouse management
This commit is contained in:
parent
51160ac2e0
commit
f2238b6885
@ -105,7 +105,7 @@ if ($_POST["action"] == 'update_price' && ! $_POST["cancel"] && $user->rights->p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'delete' && $user->rights->produit->creer)
|
if ($_GET["action"] == 'delete' && $user->rights->produit->supprimer)
|
||||||
{
|
{
|
||||||
$productstatic = new Product($db);
|
$productstatic = new Product($db);
|
||||||
$result=$productstatic->log_price_delete($user,$_GET["lineid"]);
|
$result=$productstatic->log_price_delete($user,$_GET["lineid"]);
|
||||||
@ -406,7 +406,7 @@ if ($result)
|
|||||||
print '<td align="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</td>';
|
print '<td align="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("MinPrice").' '.$langs->trans("TTC").'</td>';
|
print '<td align="right">'.$langs->trans("MinPrice").' '.$langs->trans("TTC").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("ChangedBy").'</td>';
|
print '<td align="right">'.$langs->trans("ChangedBy").'</td>';
|
||||||
if ($user->rights->produit->creer) print '<td align="right"> </td>';
|
if ($user->rights->produit->supprimer) print '<td align="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -436,7 +436,7 @@ if ($result)
|
|||||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$objp->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$objp->login.'</a></td>';
|
print '<td align="right"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$objp->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$objp->login.'</a></td>';
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
if ($user->rights->produit->creer)
|
if ($user->rights->produit->supprimer)
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($i > 0)
|
if ($i > 0)
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
\ingroup stock
|
\ingroup stock
|
||||||
\brief Page fiche entrepot
|
\brief Page fiche entrepot
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ if ($_POST["action"] == 'add')
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mesg="<div class='error'>".$langs->trans("ErrorWarehouseRefRequired")."</div>";
|
$mesg="<div class='error'>".$langs->trans("ErrorWarehouseRefRequired")."</div>";
|
||||||
$_GET["action"]="create"; // Force retour sur page création
|
$_GET["action"]="create"; // Force retour sur page cr<EFBFBD>ation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,20 +94,20 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
|||||||
{
|
{
|
||||||
$_GET["action"] = '';
|
$_GET["action"] = '';
|
||||||
$_GET["id"] = $_POST["id"];
|
$_GET["id"] = $_POST["id"];
|
||||||
//$mesg = '<div class="ok">Fiche mise à jour</div>';
|
//$mesg = '<div class="ok">Fiche mise <20> jour</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$_GET["action"] = 'edit';
|
$_GET["action"] = 'edit';
|
||||||
$_GET["id"] = $_POST["id"];
|
$_GET["id"] = $_POST["id"];
|
||||||
$mesg = '<div class="error">Fiche non mise à jour !' . "<br>" . $entrepot->error.'</div>';
|
$mesg = '<div class="error">Fiche non mise <20> jour !' . "<br>" . $entrepot->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$_GET["action"] = 'edit';
|
$_GET["action"] = 'edit';
|
||||||
$_GET["id"] = $_POST["id"];
|
$_GET["id"] = $_POST["id"];
|
||||||
$mesg = '<div class="error">Fiche non mise à jour !' . "<br>" . $entrepot->error.'</div>';
|
$mesg = '<div class="error">Fiche non mise <20> jour !' . "<br>" . $entrepot->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,8 +120,8 @@ if ($_POST["cancel"] == $langs->trans("Cancel"))
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("WarehouseCard"));
|
llxHeader("","",$langs->trans("WarehouseCard"));
|
||||||
|
|
||||||
@ -313,12 +313,13 @@ else
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
|
|
||||||
print_liste_field_titre($langs->trans("Product"),"", "p.ref","&id=".$_GET['id'],"","",$sortfield,$sortorder);
|
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("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("Units"),"", "ps.reel","&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>";
|
print "</tr>";
|
||||||
|
|
||||||
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, ps.reel as value ";
|
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, 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)
|
||||||
@ -371,9 +372,21 @@ else
|
|||||||
print "</a></td>";
|
print "</a></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><a href=\"fiche.php?id=$objp->entrepot_id\">";
|
|
||||||
//print img_object($langs->trans("ShowWarehous"),"stock").' '.$objp->stock;
|
if ($user->rights->stock->mouvement->creer)
|
||||||
//print "</a></td>\n";
|
{
|
||||||
|
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$entrepot->id.'&id='.$objp->rowid.'&action=transfert">';
|
||||||
|
print $langs->trans("StockMovement");
|
||||||
|
print "</a></td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->rights->stock->creer)
|
||||||
|
{
|
||||||
|
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$entrepot->id.'&id='.$objp->rowid.'&action=correction">';
|
||||||
|
print $langs->trans("StockCorrection");
|
||||||
|
print "</a></td>";
|
||||||
|
}
|
||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Libellé
|
// Libell<EFBFBD>
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -231,7 +231,9 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print '<td width="20%">'.$langs->trans("Warehouse").'</td>';
|
print '<td width="20%">'.$langs->trans("Warehouse").'</td>';
|
||||||
|
|
||||||
// Entrepot
|
// Entrepot
|
||||||
print '<td width="20%"><select class="flat" name="id_entrepot">';
|
print '<td width="20%">';
|
||||||
|
|
||||||
|
print '<select class="flat" name="id_entrepot">';
|
||||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||||
$sql .= " WHERE statut = 1";
|
$sql .= " WHERE statut = 1";
|
||||||
$sql .= " ORDER BY lower(e.label)";
|
$sql .= " ORDER BY lower(e.label)";
|
||||||
@ -240,15 +242,20 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
if ($num > 1) print '<option value="-1"> ';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
print '<option value="'.$obj->rowid.'"';
|
||||||
|
if ($_GET["dwid"]==$obj->rowid) print ' selected="true"';
|
||||||
|
print '>'.$obj->label ;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</select></td>';
|
print '</select>';
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
print '<td width="20%">';
|
print '<td width="20%">';
|
||||||
print '<select name="mouvement" class="flat">';
|
print '<select name="mouvement" class="flat">';
|
||||||
print '<option value="0">'.$langs->trans("Add").'</option>';
|
print '<option value="0">'.$langs->trans("Add").'</option>';
|
||||||
@ -265,7 +272,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Transfert de pièces
|
* Transfert of units
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == "transfert")
|
if ($_GET["action"] == "transfert")
|
||||||
{
|
{
|
||||||
@ -273,7 +280,10 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||||
print '<input type="hidden" name="action" value="transfert_stock">';
|
print '<input type="hidden" name="action" value="transfert_stock">';
|
||||||
print '<table class="border" width="100%"><tr>';
|
print '<table class="border" width="100%"><tr>';
|
||||||
print '<td width="20%">'.$langs->trans("Source").'</td><td width="20%"><select name="id_entrepot_source">';
|
print '<td width="20%">'.$langs->trans("Source").'</td><td width="20%">';
|
||||||
|
|
||||||
|
// Select datewarehous
|
||||||
|
print '<select name="id_entrepot_source">';
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||||
$sql .= " WHERE statut = 1";
|
$sql .= " WHERE statut = 1";
|
||||||
@ -283,18 +293,25 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
if ($num > 1) print '<option value="-1"> ';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
print '<option value="'.$obj->rowid.'"';
|
||||||
|
if ($_GET["dwid"]==$obj->rowid) print ' selected="true"';
|
||||||
|
print '>'.$obj->label ;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</select></td>';
|
print '</select>';
|
||||||
|
|
||||||
print '<td width="20%">'.$langs->trans("Target").'</td><td width="20%"><select name="id_entrepot_destination">';
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td width="20%">'.$langs->trans("Target").'</td><td width="20%">';
|
||||||
|
|
||||||
|
// Select datawarehous
|
||||||
|
print '<select name="id_entrepot_destination">';
|
||||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||||
$sql .= " WHERE statut = 1";
|
$sql .= " WHERE statut = 1";
|
||||||
$sql .= " ORDER BY lower(e.label)";
|
$sql .= " ORDER BY lower(e.label)";
|
||||||
@ -303,6 +320,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
if ($num > 1) print '<option value="-1"> ';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -311,7 +329,9 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</select></td>';
|
print '</select>';
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
print '<td width="20%">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
print '<td width="20%">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||||
print '<tr><td colspan="6" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"> ';
|
print '<tr><td colspan="6" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"> ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||||
@ -329,8 +349,10 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||||
print '<input type="hidden" name="action" value="create_stock">';
|
print '<input type="hidden" name="action" value="create_stock">';
|
||||||
print '<table class="border" width="100%"><tr>';
|
print '<table class="border" width="100%"><tr>';
|
||||||
print '<td width="20%">'.$langs->trans("Warehouse").'</td><td width="40%"><select name="id_entrepot">';
|
print '<td width="20%">'.$langs->trans("Warehouse").'</td><td width="40%">';
|
||||||
|
|
||||||
|
// Select datawarehouse
|
||||||
|
print '<select name="id_entrepot">';
|
||||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||||
$sql .= " ORDER BY lower(e.label)";
|
$sql .= " ORDER BY lower(e.label)";
|
||||||
|
|
||||||
@ -338,6 +360,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
if ($num > 1) print '<option value="-1"> ';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -346,7 +369,8 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</select></td><td width="20%">Nb de pièce</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
print '</select>';
|
||||||
|
print '</td><td width="20%">'.$langs->trans("NbOfUnit").'</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||||
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"> ';
|
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"> ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'"></td></tr>';
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user