Commit 6b36b00f authored by Cédric Houbart's avatar Cédric Houbart
Browse files

Help on colored stock levels in inventory

parent 50ea0366
...@@ -45,18 +45,21 @@ $qty = isset($stocks[$product->id]) ? $stocks[$product->id] : 0; ...@@ -45,18 +45,21 @@ $qty = isset($stocks[$product->id]) ? $stocks[$product->id] : 0;
$security = isset($levels[$product->id]) ? $levels[$product->id]->security : NULL; $security = isset($levels[$product->id]) ? $levels[$product->id]->security : NULL;
$max = isset($levels[$product->id]) ? $levels[$product->id]->max : NULL; $max = isset($levels[$product->id]) ? $levels[$product->id]->max : NULL;
$class = ""; $class = "";
$help = "";
if ($security !== NULL && $qty < $security) { if ($security !== NULL && $qty < $security) {
$class=" warn-level"; $class=" warn-level";
$help = ' title="' . \i18n("Stock is below security level!", PLUGIN_NAME) . '"';
} }
if ($qty < 0 || ($max !== NULL && $qty > $max)) { if ($qty < 0 || ($max !== NULL && $qty > $max)) {
$class=" alert-level"; $class=" alert-level";
$help = ' title="' . \i18n("Stock is negative!", PLUGIN_NAME) . '"';
} }
?> ?>
<tr class="row-<?php echo $par ? 'par' : 'odd'; ?>"> <tr class="row-<?php echo $par ? 'par' : 'odd'; ?>">
<td><img class="thumbnail" src="?<?php echo \Pasteque\URL_ACTION_PARAM; ?>=img&w=product&id=<?php echo $product->id; ?>" /> <td><img class="thumbnail" src="?<?php echo \Pasteque\URL_ACTION_PARAM; ?>=img&w=product&id=<?php echo $product->id; ?>" />
<td><?php echo $product->reference; ?></td> <td><?php echo $product->reference; ?></td>
<td><?php echo $product->label; ?></td> <td><?php echo $product->label; ?></td>
<td class="numeric<?php echo $class; ?>"><?php echo $qty; ?></td> <td class="numeric<?php echo $class; ?>"<?php echo $help; ?>><?php echo $qty; ?></td>
<td class="numeric"><?php echo $security === NULL ? \i18n("Undefined") : $security; ?></td> <td class="numeric"><?php echo $security === NULL ? \i18n("Undefined") : $security; ?></td>
</tr> </tr>
<?php <?php
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
"Input (buy)": "Input (buy)", "Input (buy)": "Input (buy)",
"Output (sell)": "Output (sell)", "Output (sell)": "Output (sell)",
"Output (return to supplyer)": "Output (return to supplyer)", "Output (return to supplyer)": "Output (return to supplyer)",
"Stock is below security level!": "Stock is below security level!",
"Stock is negative!": "Stock is negative",
"Inventory": "Inventory", "Inventory": "Inventory",
"Security threshold": "Security threshold", "Security threshold": "Security threshold",
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
"Input (buy)": "Entrée (achat)", "Input (buy)": "Entrée (achat)",
"Output (sell)": "Sortie (vente)", "Output (sell)": "Sortie (vente)",
"Output (return to supplyer": "Sortie (retour au fournisseur)", "Output (return to supplyer": "Sortie (retour au fournisseur)",
"Stock is below security level!": "Le stock est sous le seuil de sécurité !",
"Stock is negative!": "Le stock est négatif !",
"Inventory": "Inventaire", "Inventory": "Inventaire",
"Security threshold": "Seuil de sécurité", "Security threshold": "Seuil de sécurité",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment