Add stock management mode setting
This commit is contained in:
parent
5c0bea68a9
commit
841c03847e
@ -118,8 +118,13 @@ for ($i = 0; $i < count($items); $i++) {
|
|||||||
$user = new User($_SESSION['uid']);
|
$user = new User($_SESSION['uid']);
|
||||||
if ($user->hasPermission("INV_EDIT")) {
|
if ($user->hasPermission("INV_EDIT")) {
|
||||||
$items[$i]["editbtn"] = '<a class="btn btn-primary" href="app.php?page=edititem&id=' . $items[$i]['itemid'] . '"><i class="fas fa-edit"></i> ' . $Strings->get("edit", false) . '</a>';
|
$items[$i]["editbtn"] = '<a class="btn btn-primary" href="app.php?page=edititem&id=' . $items[$i]['itemid'] . '"><i class="fas fa-edit"></i> ' . $Strings->get("edit", false) . '</a>';
|
||||||
|
if ($SETTINGS['stock_management']) {
|
||||||
$items[$i]["addstockbtn"] = '<a class="btn btn-success" href="app.php?page=addstock&id=' . $items[$i]['itemid'] . '"><i class="fas fa-plus"></i> ' . $Strings->get("addstock", false) . '</a>';
|
$items[$i]["addstockbtn"] = '<a class="btn btn-success" href="app.php?page=addstock&id=' . $items[$i]['itemid'] . '"><i class="fas fa-plus"></i> ' . $Strings->get("addstock", false) . '</a>';
|
||||||
$items[$i]["removestockbtn"] = '<a class="btn btn-danger" href="app.php?page=removestock&id=' . $items[$i]['itemid'] . '"><i class="fas fa-minus"></i> ' . $Strings->get("removestock", false) . '</a>';
|
$items[$i]["removestockbtn"] = '<a class="btn btn-danger" href="app.php?page=removestock&id=' . $items[$i]['itemid'] . '"><i class="fas fa-minus"></i> ' . $Strings->get("removestock", false) . '</a>';
|
||||||
|
} else {
|
||||||
|
$items[$i]["addstockbtn"] = '';
|
||||||
|
$items[$i]["removestockbtn"] = '';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$items[$i]["editbtn"] = '';
|
$items[$i]["editbtn"] = '';
|
||||||
$items[$i]["addstockbtn"] = '';
|
$items[$i]["addstockbtn"] = '';
|
||||||
|
@ -165,7 +165,7 @@ if (!empty($VARS['id'])) {
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="qty"><i class="fas fa-hashtag"></i> <?php $Strings->get('quantity'); ?></label>
|
<label for="qty"><i class="fas fa-hashtag"></i> <?php $Strings->get('quantity'); ?></label>
|
||||||
<?php
|
<?php
|
||||||
if ($editing) {
|
if ($SETTINGS['stock_management'] && $editing && !$cloning){
|
||||||
?>
|
?>
|
||||||
<input type="text" class="form-control" id="qty" name="qty" readonly value="<?php echo $itemdata['qty']; ?>" />
|
<input type="text" class="form-control" id="qty" name="qty" readonly value="<?php echo $itemdata['qty']; ?>" />
|
||||||
<?php
|
<?php
|
||||||
|
@ -169,7 +169,9 @@ $item = $database->get(
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
if ($SETTINGS['stock_management']) {
|
||||||
|
?>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div class="row mt-4 mx-0">
|
<div class="row mt-4 mx-0">
|
||||||
@ -208,5 +210,8 @@ $item = $database->get(
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -56,5 +56,7 @@ $SETTINGS = [
|
|||||||
// Base URL for building links relative to the location of the app.
|
// Base URL for building links relative to the location of the app.
|
||||||
// Only used when there's no good context for the path.
|
// Only used when there's no good context for the path.
|
||||||
// The default is almost definitely fine.
|
// The default is almost definitely fine.
|
||||||
"url" => "."
|
"url" => ".",
|
||||||
|
// Enable stock management mode.
|
||||||
|
"stock_management" => false,
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user