New: Store and show estimated value of stock
This commit is contained in:
parent
98926e977a
commit
40b860d624
@ -65,4 +65,5 @@ LieuWareHouse=Localisation warehouse
|
|||||||
WarehousesAndProducts=Warehouses and products
|
WarehousesAndProducts=Warehouses and products
|
||||||
AverageUnitPricePMP=Average price
|
AverageUnitPricePMP=Average price
|
||||||
EstimatedStockValueForProduct=Estimated value for product's stock
|
EstimatedStockValueForProduct=Estimated value for product's stock
|
||||||
|
EstimatedStockValueInWarehouse=Estimated value in warehouse
|
||||||
EstimatedStockValue=Estimated value in stock
|
EstimatedStockValue=Estimated value in stock
|
||||||
@ -65,4 +65,5 @@ LieuWareHouse=Lieu entrepôt
|
|||||||
WarehousesAndProducts=Entrepôts et produits
|
WarehousesAndProducts=Entrepôts et produits
|
||||||
AverageUnitPricePMP=Prix moyen pondéré (PMP)
|
AverageUnitPricePMP=Prix moyen pondéré (PMP)
|
||||||
EstimatedStockValueForProduct=Valeur estimée du produit en stock
|
EstimatedStockValueForProduct=Valeur estimée du produit en stock
|
||||||
|
EstimatedStockValueInWarehouse=Valeur estimée dans l'entrepot
|
||||||
EstimatedStockValue=Valeur estimée du stock
|
EstimatedStockValue=Valeur estimée du stock
|
||||||
@ -131,7 +131,7 @@ llxHeader("","",$langs->trans("WarehouseCard"));
|
|||||||
if ($_GET["action"] == 'create')
|
if ($_GET["action"] == 'create')
|
||||||
{
|
{
|
||||||
print_fiche_titre($langs->trans("NewWarehouse"));
|
print_fiche_titre($langs->trans("NewWarehouse"));
|
||||||
|
|
||||||
print "<form action=\"fiche.php\" method=\"post\">\n";
|
print "<form action=\"fiche.php\" method=\"post\">\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
@ -246,7 +246,7 @@ else
|
|||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $form->showrefnav($entrepot,'id','',1,'rowid','libelle');
|
print $form->showrefnav($entrepot,'id','',1,'rowid','libelle');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
|
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
@ -323,15 +323,15 @@ else
|
|||||||
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);
|
||||||
print_liste_field_titre($langs->trans("PMP"),"", "ps.pmp","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("AverageUnitPricePMP"),"", "ps.pmp","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("EstimatedStockValueInWarehouse"),"", "","&id=".$_GET['id'],"",'align="center"',$sortfield,$sortorder);
|
||||||
if ($user->rights->stock->mouvement->creer) print '<td> </td>';
|
if ($user->rights->stock->mouvement->creer) print '<td> </td>';
|
||||||
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,";
|
||||||
$sql.= " ps.reel as value";
|
$sql.= " ps.pmp, ps.reel as value";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."product p ";
|
|
||||||
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
|
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
|
||||||
{
|
{
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
|
||||||
@ -385,22 +385,24 @@ else
|
|||||||
|
|
||||||
print '<td align="right">'.$objp->value.'</td>';
|
print '<td align="right">'.$objp->value.'</td>';
|
||||||
|
|
||||||
print '<td align="center">'.$langs->trans("FeatureNotYetAvailableShort").'</td>';
|
print '<td align="center">'.price(price2num($objp->pmp,'MT')).'</td>';
|
||||||
|
|
||||||
|
print '<td align="center">'.price(price2num($objp->pmp,'MT')*$objp->value).'</td>';
|
||||||
|
|
||||||
if ($user->rights->stock->mouvement->creer)
|
if ($user->rights->stock->mouvement->creer)
|
||||||
{
|
{
|
||||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$entrepot->id.'&id='.$objp->rowid.'&action=transfert">';
|
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 img_picto($langs->trans("StockMovement"),'uparrow.png').' '.$langs->trans("StockMovement");
|
||||||
print "</a></td>";
|
print "</a></td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->stock->creer)
|
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 '<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 $langs->trans("StockCorrection");
|
||||||
print "</a></td>";
|
print "</a></td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user