Ajout valorisation stocks dans menu eldy
This commit is contained in:
parent
529362b727
commit
6853892f7a
File diff suppressed because it is too large
Load Diff
@ -31,4 +31,12 @@ StockMovement=Transfer
|
||||
StockMovements=Stock transferts
|
||||
NumberOfUnit=Number of units
|
||||
TotalStock=Total in stock
|
||||
StockTooLow=Stock too low
|
||||
StockTooLow=Stock too low
|
||||
EnhancedValue=Value
|
||||
EnhancedValueOfWarehouses=Warehouses value
|
||||
UserWarehouseAutoCreate=Create a stock automatically when creating a user
|
||||
QtyDispatched=Quantity dispatched
|
||||
OrderDispatch=Order dispatching
|
||||
DeStockReStockOnBill=Decrease/increase stocks on invoices/credit notes (incompatible with stock decrease on sending/receiving)
|
||||
StockAvailable=Available stock
|
||||
StockInstant=Real stock
|
||||
@ -39,4 +39,4 @@ QtyDispatched=Quantit
|
||||
OrderDispatch=Ventilation commande
|
||||
DeStockReStockOnBill=Décrémente/Incrémente les stocks sur les factures/avoirs (incompatibles avec le destockage sur les expéditions)
|
||||
StockAvailable=Stock disponible
|
||||
StockInstant=Stock instantanné
|
||||
StockInstant=Stock actuel
|
||||
@ -114,7 +114,7 @@ if ($_GET["fourn_id"] > 0)
|
||||
$sql .= " WHERE 1=1";
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= " AND (p.ref like '%".$sall."%' OR p.label like '%".$sall."%' OR p.description like '%".$sall."%' OR p.note like '%".$sall."%')";
|
||||
$sql .= " AND (p.ref like '%".addslashes($sall)."%' OR p.label like '%".addslashes($sall)."%' OR p.description like '%".addslashes($sall)."%' OR p.note like '%".addslashes($sall)."%')";
|
||||
}
|
||||
if (strlen($_GET["type"]) || strlen($_POST["type"]))
|
||||
{
|
||||
@ -126,7 +126,7 @@ if ($sref)
|
||||
}
|
||||
if ($snom)
|
||||
{
|
||||
$sql .= " AND p.label like '%".$snom."%'";
|
||||
$sql .= " AND p.label like '%".addslashes($snom)."%'";
|
||||
}
|
||||
if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0)
|
||||
{
|
||||
@ -218,12 +218,11 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="sref" value="'.$sref.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
|
||||
print '</td>';
|
||||
if ($conf->service->enabled && $type != 0)
|
||||
|
||||
@ -79,7 +79,10 @@ $title=$langs->trans("ProductsAndServices");
|
||||
|
||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type, '.$db->pdate('p.tms').' as datem,';
|
||||
$sql.= ' p.duration, p.envente as statut, p.seuil_stock_alerte,';
|
||||
$sql.= ' SUM(reel) as stock,p.stock_commande,(SUM(reel) - p.stock_commande) as stock_dispo';
|
||||
$sql.= ' p.stock_commande,';
|
||||
$sql.= ' SUM(s.reel) as stock,';
|
||||
// \TODO Bug ? On soustrait le stock commandé alors qu'il ait stocké en base en négatif. Du coup on additionne !
|
||||
$sql.= ' (SUM(s.reel) - p.stock_commande) as stock_dispo';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; // '.MAIN_DB_PREFIX.'product_det as d'; //en attendant le debugage
|
||||
$sql.= ',' .MAIN_DB_PREFIX.'product_stock as s';
|
||||
if ($catid || ($conf->categorie->enabled && !$user->rights->categorie->voir))
|
||||
@ -96,7 +99,7 @@ if ($_GET["fourn_id"] > 0)
|
||||
$sql .= " WHERE p.rowid = s.fk_product";
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= " AND (p.ref like '%".$sall."%' OR p.label like '%".$sall."%' OR p.description like '%".$sall."%' OR p.note like '%".$sall."%')";
|
||||
$sql .= " AND (p.ref like '%".addslashes($sall)."%' OR p.label like '%".addslashes($sall)."%' OR p.description like '%".addslashes($sall)."%' OR p.note like '%".addslashes($sall)."%')";
|
||||
}
|
||||
if (strlen($_GET["type"]) || strlen($_POST["type"]))
|
||||
{
|
||||
@ -108,7 +111,7 @@ if ($sref)
|
||||
}
|
||||
if ($snom)
|
||||
{
|
||||
$sql .= " AND p.label like '%".$snom."%'";
|
||||
$sql .= " AND p.label like '%".addslashes($snom)."%'";
|
||||
}
|
||||
if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0)
|
||||
{
|
||||
@ -187,7 +190,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Label"),"reassort.php", "p.label","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("StockAvailable"),"reassort.php", "p.stock_dispo","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield);
|
||||
if ($conf->service->enabled && $type != 0) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="center"',$sortfield);
|
||||
print_liste_field_titre($langs->trans("Stock"),"reassort.php", "stock","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield);
|
||||
print_liste_field_titre($langs->trans("StockInstant"),"reassort.php", "stock","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield);
|
||||
print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.envente","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -42,16 +42,16 @@ $sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
|
||||
|
||||
$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||
$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
if (! $sortfield) $sortfield="valo_pmp";
|
||||
if (! $sortfield) $sortfield="valo";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
$page = $_GET["page"];
|
||||
if ($page < 0) $page = 0;
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* Affichage valorisation par entrepot
|
||||
*/
|
||||
$sql = "SELECT e.rowid as ref, e.label, e.statut, e.valo_pmp as valo";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
@ -62,7 +62,7 @@ if ($sref)
|
||||
}
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= " AND (e.label like '%".$sall."%' OR e.description like '%".$sall."%' OR e.lieu like '%".$sall."%' OR e.address like '%".$sall."%' OR e.ville like '%".$sall."%')";
|
||||
$sql .= " AND (e.label like '%".addslashes($sall)."%' OR e.description like '%".addslashes($sall)."%' OR e.lieu like '%".addslashes($sall)."%' OR e.address like '%".addslashes($sall)."%' OR e.ville like '%".addslashes($sall)."%')";
|
||||
}
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $db->plimit($limit + 1 ,$offset);
|
||||
@ -105,7 +105,7 @@ if ($result)
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="2" align="right">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total).' '.$langs->trans('Currency'.$conf->monnaie).'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user