Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
d72c192294 | |||
3d2cd94494 | |||
826de5246b | |||
488988f7d4 | |||
841c03847e | |||
5c0bea68a9 | |||
a960d5143f | |||
0e2c2c17a2 | |||
8964202a1a |
60
action.php
60
action.php
@ -363,4 +363,64 @@ switch ($VARS['action']) {
|
|||||||
session_destroy();
|
session_destroy();
|
||||||
header('Location: index.php?logout=1');
|
header('Location: index.php?logout=1');
|
||||||
die("Logged out.");
|
die("Logged out.");
|
||||||
|
case "addstock":
|
||||||
|
$insert = true;
|
||||||
|
|
||||||
|
if (empty($VARS['stock'])) {
|
||||||
|
$VARS['stock'] = 1;
|
||||||
|
} else if (!is_numeric($VARS['stock'])) {
|
||||||
|
returnToSender('field_nan');
|
||||||
|
}
|
||||||
|
|
||||||
|
$user = $_SESSION['uid'];
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'itemid' => $VARS['itemid'],
|
||||||
|
'stock' => $VARS['stock'],
|
||||||
|
'text1' => $VARS['text1'],
|
||||||
|
'userid' => $user
|
||||||
|
];
|
||||||
|
|
||||||
|
$database->insert('stock', $data);
|
||||||
|
|
||||||
|
$currentqty = $database->get('items', 'qty', ['itemid' => $VARS['itemid']]);
|
||||||
|
$newqty = $currentqty + $VARS['stock'];
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'qty' => $newqty
|
||||||
|
];
|
||||||
|
|
||||||
|
$database->update('items', $data, ['itemid' => $VARS['itemid']]);
|
||||||
|
|
||||||
|
returnToSender("stock_added");
|
||||||
|
case "removestock":
|
||||||
|
$insert = true;
|
||||||
|
|
||||||
|
if (empty($VARS['stock'])) {
|
||||||
|
$VARS['stock'] = -1;
|
||||||
|
} else if (!is_numeric($VARS['stock'])) {
|
||||||
|
returnToSender('field_nan');
|
||||||
|
}
|
||||||
|
|
||||||
|
$user = $_SESSION['uid'];
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'itemid' => $VARS['itemid'],
|
||||||
|
'stock' => -$VARS['stock'],
|
||||||
|
'text1' => $VARS['text1'],
|
||||||
|
'userid' => $user
|
||||||
|
];
|
||||||
|
|
||||||
|
$database->insert('stock', $data);
|
||||||
|
|
||||||
|
$currentqty = $database->get('items', 'qty', ['itemid' => $VARS['itemid']]);
|
||||||
|
$newqty = $currentqty - $VARS['stock'];
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'qty' => $newqty
|
||||||
|
];
|
||||||
|
|
||||||
|
$database->update('items', $data, ['itemid' => $VARS['itemid']]);
|
||||||
|
|
||||||
|
returnToSender("stock_removed");
|
||||||
}
|
}
|
||||||
|
BIN
database.mwb
BIN
database.mwb
Binary file not shown.
43
database.sql
43
database.sql
@ -1,5 +1,5 @@
|
|||||||
-- MySQL Script generated by MySQL Workbench
|
-- MySQL Script generated by MySQL Workbench
|
||||||
-- Sat 22 Sep 2018 02:40:11 AM MDT
|
-- Wed 11 Mar 2020 10:06:41 EET
|
||||||
-- Model: New Model Version: 1.0
|
-- Model: New Model Version: 1.0
|
||||||
-- MySQL Workbench Forward Engineering
|
-- MySQL Workbench Forward Engineering
|
||||||
|
|
||||||
@ -55,14 +55,14 @@ CREATE TABLE IF NOT EXISTS `items` (
|
|||||||
`price` DECIMAL(10,2) NULL,
|
`price` DECIMAL(10,2) NULL,
|
||||||
PRIMARY KEY (`itemid`),
|
PRIMARY KEY (`itemid`),
|
||||||
INDEX `fk_items_categories_idx` (`catid` ASC),
|
INDEX `fk_items_categories_idx` (`catid` ASC),
|
||||||
INDEX `fk_items_locations1_idx` (`locid` ASC),
|
INDEX `fk_items_locations_idx` (`locid` ASC),
|
||||||
UNIQUE INDEX `itemid_UNIQUE` (`itemid` ASC),
|
UNIQUE INDEX `itemid_UNIQUE` (`itemid` ASC),
|
||||||
CONSTRAINT `fk_items_categories`
|
CONSTRAINT `fk_items_categories`
|
||||||
FOREIGN KEY (`catid`)
|
FOREIGN KEY (`catid`)
|
||||||
REFERENCES `categories` (`catid`)
|
REFERENCES `categories` (`catid`)
|
||||||
ON DELETE NO ACTION
|
ON DELETE NO ACTION
|
||||||
ON UPDATE NO ACTION,
|
ON UPDATE NO ACTION,
|
||||||
CONSTRAINT `fk_items_locations1`
|
CONSTRAINT `fk_items_locations`
|
||||||
FOREIGN KEY (`locid`)
|
FOREIGN KEY (`locid`)
|
||||||
REFERENCES `locations` (`locid`)
|
REFERENCES `locations` (`locid`)
|
||||||
ON DELETE NO ACTION
|
ON DELETE NO ACTION
|
||||||
@ -89,12 +89,12 @@ CREATE TABLE IF NOT EXISTS `permissions` (
|
|||||||
`itemid` INT NOT NULL,
|
`itemid` INT NOT NULL,
|
||||||
`canedit` TINYINT(1) NOT NULL DEFAULT 0,
|
`canedit` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (`userid`, `itemid`),
|
PRIMARY KEY (`userid`, `itemid`),
|
||||||
INDEX `fk_permissions_items1_idx` (`itemid` ASC),
|
INDEX `fk_permissions_items_idx` (`itemid` ASC),
|
||||||
CONSTRAINT `fk_permissions_items1`
|
CONSTRAINT `fk_permissions_items`
|
||||||
FOREIGN KEY (`itemid`)
|
FOREIGN KEY (`itemid`)
|
||||||
REFERENCES `items` (`itemid`)
|
REFERENCES `items` (`itemid`)
|
||||||
ON DELETE NO ACTION
|
ON DELETE CASCADE
|
||||||
ON UPDATE NO ACTION)
|
ON UPDATE CASCADE)
|
||||||
ENGINE = InnoDB;
|
ENGINE = InnoDB;
|
||||||
|
|
||||||
|
|
||||||
@ -120,12 +120,33 @@ CREATE TABLE IF NOT EXISTS `images` (
|
|||||||
`primary` TINYINT(1) NOT NULL DEFAULT 0,
|
`primary` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (`imageid`, `itemid`),
|
PRIMARY KEY (`imageid`, `itemid`),
|
||||||
UNIQUE INDEX `imageid_UNIQUE` (`imageid` ASC),
|
UNIQUE INDEX `imageid_UNIQUE` (`imageid` ASC),
|
||||||
INDEX `fk_images_items1_idx` (`itemid` ASC),
|
INDEX `fk_images_items_idx` (`itemid` ASC),
|
||||||
CONSTRAINT `fk_images_items1`
|
CONSTRAINT `fk_images_items`
|
||||||
FOREIGN KEY (`itemid`)
|
FOREIGN KEY (`itemid`)
|
||||||
REFERENCES `items` (`itemid`)
|
REFERENCES `items` (`itemid`)
|
||||||
ON DELETE NO ACTION
|
ON DELETE CASCADE
|
||||||
ON UPDATE NO ACTION)
|
ON UPDATE CASCADE)
|
||||||
|
ENGINE = InnoDB;
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `stock`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `stock` (
|
||||||
|
`stockid` INT NOT NULL AUTO_INCREMENT,
|
||||||
|
`itemid` INT NOT NULL,
|
||||||
|
`stock` INT NOT NULL,
|
||||||
|
`text1` TEXT(500) NOT NULL,
|
||||||
|
`userid` INT NOT NULL,
|
||||||
|
`timestamp` TIMESTAMP NOT NULL,
|
||||||
|
PRIMARY KEY (`stockid`, `itemid`),
|
||||||
|
UNIQUE INDEX `stockid_UNIQUE` (`stockid` ASC),
|
||||||
|
INDEX `fk_stock_items_idx` (`itemid` ASC),
|
||||||
|
CONSTRAINT `fk_stock_items`
|
||||||
|
FOREIGN KEY (`itemid`)
|
||||||
|
REFERENCES `items` (`itemid`)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE)
|
||||||
ENGINE = InnoDB;
|
ENGINE = InnoDB;
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,5 +4,7 @@
|
|||||||
"save": "Save",
|
"save": "Save",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"view": "View",
|
"view": "View",
|
||||||
"show all items": "Show All Items"
|
"show all items": "Show All Items",
|
||||||
|
"addstock": "Add",
|
||||||
|
"removestock": "Remove"
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
"login server error": "The login server returned an error: {arg}",
|
"login server error": "The login server returned an error: {arg}",
|
||||||
"login server user data error": "The login server refused to provide account information. Try again or contact technical support.",
|
"login server user data error": "The login server refused to provide account information. Try again or contact technical support.",
|
||||||
"captcha error": "There was a problem with the CAPTCHA (robot test). Try again.",
|
"captcha error": "There was a problem with the CAPTCHA (robot test). Try again.",
|
||||||
"no access permission": "You do not have permission to access this system.",
|
|
||||||
"no permission": "You do not have permission to access this system.",
|
"no permission": "You do not have permission to access this system.",
|
||||||
"no edit permission": "You do not have permission to modify records."
|
"no edit permission": "You do not have permission to modify records."
|
||||||
}
|
}
|
||||||
|
@ -9,5 +9,8 @@
|
|||||||
"cloning item": "Copying {oitem} <i class=\"fa fa-angle-right\"></i> {nitem}",
|
"cloning item": "Copying {oitem} <i class=\"fa fa-angle-right\"></i> {nitem}",
|
||||||
"itemid": "Item ID",
|
"itemid": "Item ID",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
"Edit Item": "Edit Item"
|
"Edit Item": "Edit Item",
|
||||||
|
"stockid": "Stock ID",
|
||||||
|
"adding stock": "Adding stock for {item}",
|
||||||
|
"removing stock": "Removing stock from {item}"
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
"code 1": "Code 1",
|
"code 1": "Code 1",
|
||||||
"code 2": "Code 2",
|
"code 2": "Code 2",
|
||||||
"qty": "Qty",
|
"qty": "Qty",
|
||||||
"want": "Need",
|
"want": "Min",
|
||||||
"assigned to": "Assigned To",
|
"assigned to": "Assigned to",
|
||||||
"quantity": "Quantity",
|
"quantity": "Quantity",
|
||||||
"minwant": "Minimum On Hand",
|
"minwant": "Minimum on hand",
|
||||||
"item count": "Item count",
|
"item count": "Item count",
|
||||||
"Item cost": "Item cost",
|
"Item cost": "Item cost",
|
||||||
"Sale price": "Sale price",
|
"Sale price": "Sale price",
|
||||||
@ -18,5 +18,9 @@
|
|||||||
"Notes": "Notes",
|
"Notes": "Notes",
|
||||||
"Comments": "Comments",
|
"Comments": "Comments",
|
||||||
"Cost": "Cost",
|
"Cost": "Cost",
|
||||||
"Price": "Price"
|
"Price": "Price",
|
||||||
|
"date": "Date",
|
||||||
|
"amount": "Stock amount",
|
||||||
|
"description": "Description",
|
||||||
|
"changed by": "Changed by"
|
||||||
}
|
}
|
||||||
|
@ -17,5 +17,7 @@
|
|||||||
"only showing understocked": "Only showing understocked items.",
|
"only showing understocked": "Only showing understocked items.",
|
||||||
"missing name": "You need to enter a name.",
|
"missing name": "You need to enter a name.",
|
||||||
"use the dropdowns": "Whoops, you need to use the category and location autocomplete boxes.",
|
"use the dropdowns": "Whoops, you need to use the category and location autocomplete boxes.",
|
||||||
"make categories and locations": "Please create at least one category and location before adding an item."
|
"make categories and locations": "Please create at least one category and location before adding an item.",
|
||||||
|
"stock added": "Stock added.",
|
||||||
|
"stock removed": "Stock removed."
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,6 @@
|
|||||||
"choose an option": "Choose an option",
|
"choose an option": "Choose an option",
|
||||||
"csv file": "CSV text file",
|
"csv file": "CSV text file",
|
||||||
"ods file": "ODS spreadsheet",
|
"ods file": "ODS spreadsheet",
|
||||||
"html file": "HTML web page"
|
"html file": "HTML web page",
|
||||||
|
"Stock": "Stock movements"
|
||||||
}
|
}
|
||||||
|
@ -96,5 +96,13 @@ define("MESSAGES", [
|
|||||||
"upload_success" => [
|
"upload_success" => [
|
||||||
"string" => "Image uploaded.",
|
"string" => "Image uploaded.",
|
||||||
"type" => "success"
|
"type" => "success"
|
||||||
|
],
|
||||||
|
"stock_added" => [
|
||||||
|
"string" => "stock added",
|
||||||
|
"type" => "success"
|
||||||
|
],
|
||||||
|
"stock_removed" => [
|
||||||
|
"string" => "stock removed",
|
||||||
|
"type" => "success"
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
@ -32,25 +32,25 @@ if ($VARS['order'][0]['dir'] == 'asc') {
|
|||||||
$sortby = "ASC";
|
$sortby = "ASC";
|
||||||
}
|
}
|
||||||
switch ($VARS['order'][0]['column']) {
|
switch ($VARS['order'][0]['column']) {
|
||||||
case 2:
|
case 1:
|
||||||
$order = ["name" => $sortby];
|
$order = ["name" => $sortby];
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 2:
|
||||||
$order = ["catname" => $sortby];
|
$order = ["catname" => $sortby];
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 3:
|
||||||
$order = ["locname" => $sortby];
|
$order = ["locname" => $sortby];
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 4:
|
||||||
$order = ["code1" => $sortby];
|
$order = ["code1" => $sortby];
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 5:
|
||||||
$order = ["code2" => $sortby];
|
$order = ["code2" => $sortby];
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 6:
|
||||||
$order = ["qty" => $sortby];
|
$order = ["qty" => $sortby];
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 7:
|
||||||
$order = ["want" => $sortby];
|
$order = ["want" => $sortby];
|
||||||
break;
|
break;
|
||||||
// Note: We're not going to sort by assigned user. It's too hard. Maybe later.
|
// Note: We're not going to sort by assigned user. It's too hard. Maybe later.
|
||||||
@ -118,8 +118,17 @@ 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]["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]["removestockbtn"] = '';
|
||||||
}
|
}
|
||||||
$items[$i]["viewbtn"] = '<a class="btn btn-info" href="app.php?page=item&id=' . $items[$i]['itemid'] . '"><i class="fas fa-eye"></i> ' . $Strings->get("view", false) . '</a>';
|
$items[$i]["viewbtn"] = '<a class="btn btn-info" href="app.php?page=item&id=' . $items[$i]['itemid'] . '"><i class="fas fa-eye"></i> ' . $Strings->get("view", false) . '</a>';
|
||||||
if (is_null($items[$i]['userid'])) {
|
if (is_null($items[$i]['userid'])) {
|
||||||
|
@ -75,7 +75,7 @@ function getItemReport($filter = []): Report {
|
|||||||
$Strings->get("code 1", false),
|
$Strings->get("code 1", false),
|
||||||
$Strings->get("code 2", false),
|
$Strings->get("code 2", false),
|
||||||
$Strings->get("quantity", false),
|
$Strings->get("quantity", false),
|
||||||
$Strings->get("want", false),
|
$Strings->get("minwant", false),
|
||||||
$Strings->get("Cost", false),
|
$Strings->get("Cost", false),
|
||||||
$Strings->get("Price", false),
|
$Strings->get("Price", false),
|
||||||
$Strings->get("assigned to", false),
|
$Strings->get("assigned to", false),
|
||||||
@ -151,6 +151,49 @@ function getLocationReport(): Report {
|
|||||||
return $report;
|
return $report;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getStockReport($filter = []): Report {
|
||||||
|
global $database, $Strings;
|
||||||
|
$stock = $database->select(
|
||||||
|
"stock", [
|
||||||
|
"[>]items" => ["itemid"]
|
||||||
|
], [
|
||||||
|
"stockid",
|
||||||
|
"itemid",
|
||||||
|
"name",
|
||||||
|
'timestamp',
|
||||||
|
'stock',
|
||||||
|
'stock.text1',
|
||||||
|
'stock.userid'
|
||||||
|
]);
|
||||||
|
$report = new Report($Strings->get("Stock", false));
|
||||||
|
$report->setHeader([
|
||||||
|
$Strings->get("stockid", false),
|
||||||
|
$Strings->get("itemid", false),
|
||||||
|
$Strings->get("name", false),
|
||||||
|
$Strings->get("date", false),
|
||||||
|
$Strings->get("amount", false),
|
||||||
|
$Strings->get("description", false),
|
||||||
|
$Strings->get("changed by", false)
|
||||||
|
]);
|
||||||
|
for ($i = 0; $i < count($stock); $i++) {
|
||||||
|
$user = "";
|
||||||
|
if (!is_null($stock[$i]["userid"])) {
|
||||||
|
$u = new User($stock[$i]["userid"]);
|
||||||
|
$user = $u->getName() . " (" . $u->getUsername() . ')';
|
||||||
|
}
|
||||||
|
$report->addDataRow([
|
||||||
|
$stock[$i]["stockid"],
|
||||||
|
$stock[$i]["itemid"],
|
||||||
|
$stock[$i]["name"],
|
||||||
|
$stock[$i]["timestamp"],
|
||||||
|
$stock[$i]["stock"],
|
||||||
|
$stock[$i]["text1"],
|
||||||
|
$user
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return $report;
|
||||||
|
}
|
||||||
|
|
||||||
function getReport($type): Report {
|
function getReport($type): Report {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case "item":
|
case "item":
|
||||||
@ -165,6 +208,9 @@ function getReport($type): Report {
|
|||||||
case "itemstock":
|
case "itemstock":
|
||||||
return getItemReport(["AND" => ["qty[<]want", "want[>]" => 0]]);
|
return getItemReport(["AND" => ["qty[<]want", "want[>]" => 0]]);
|
||||||
break;
|
break;
|
||||||
|
case "stock":
|
||||||
|
return getStockReport();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return new Report("error", ["ERROR"], ["Invalid report type."]);
|
return new Report("error", ["ERROR"], ["Invalid report type."]);
|
||||||
}
|
}
|
||||||
@ -173,4 +219,4 @@ function getReport($type): Report {
|
|||||||
function generateReport($type, $format) {
|
function generateReport($type, $format) {
|
||||||
$report = getReport($type);
|
$report = getReport($type);
|
||||||
$report->output($format);
|
$report->output($format);
|
||||||
}
|
}
|
||||||
|
48
pages.php
48
pages.php
@ -24,19 +24,6 @@ define("PAGES", [
|
|||||||
"static/js/items.js"
|
"static/js/items.js"
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
"locations" => [
|
|
||||||
"title" => "Locations",
|
|
||||||
"navbar" => true,
|
|
||||||
"icon" => "fas fa-map-marker",
|
|
||||||
"styles" => [
|
|
||||||
"static/css/datatables.min.css",
|
|
||||||
"static/css/tables.css"
|
|
||||||
],
|
|
||||||
"scripts" => [
|
|
||||||
"static/js/datatables.min.js",
|
|
||||||
"static/js/locations.js"
|
|
||||||
],
|
|
||||||
],
|
|
||||||
"categories" => [
|
"categories" => [
|
||||||
"title" => "Categories",
|
"title" => "Categories",
|
||||||
"navbar" => true,
|
"navbar" => true,
|
||||||
@ -50,6 +37,19 @@ define("PAGES", [
|
|||||||
"static/js/categories.js"
|
"static/js/categories.js"
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
"locations" => [
|
||||||
|
"title" => "Locations",
|
||||||
|
"navbar" => true,
|
||||||
|
"icon" => "fas fa-map-marker",
|
||||||
|
"styles" => [
|
||||||
|
"static/css/datatables.min.css",
|
||||||
|
"static/css/tables.css"
|
||||||
|
],
|
||||||
|
"scripts" => [
|
||||||
|
"static/js/datatables.min.js",
|
||||||
|
"static/js/locations.js"
|
||||||
|
],
|
||||||
|
],
|
||||||
"item" => [
|
"item" => [
|
||||||
"title" => "Item",
|
"title" => "Item",
|
||||||
"navbar" => false
|
"navbar" => false
|
||||||
@ -99,5 +99,27 @@ define("PAGES", [
|
|||||||
],
|
],
|
||||||
"404" => [
|
"404" => [
|
||||||
"title" => "404 error"
|
"title" => "404 error"
|
||||||
|
],
|
||||||
|
"addstock" => [
|
||||||
|
"title" => "Add stock",
|
||||||
|
"navbar" => false,
|
||||||
|
"styles" => [
|
||||||
|
"static/css/easy-autocomplete.min.css"
|
||||||
|
],
|
||||||
|
"scripts" => [
|
||||||
|
"static/js/jquery.easy-autocomplete.min.js",
|
||||||
|
"static/js/edititem.js"
|
||||||
|
],
|
||||||
|
],
|
||||||
|
"removestock" => [
|
||||||
|
"title" => "Remove stock",
|
||||||
|
"navbar" => false,
|
||||||
|
"styles" => [
|
||||||
|
"static/css/easy-autocomplete.min.css"
|
||||||
|
],
|
||||||
|
"scripts" => [
|
||||||
|
"static/js/jquery.easy-autocomplete.min.js",
|
||||||
|
"static/js/edititem.js"
|
||||||
|
],
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
77
pages/addstock.php
Normal file
77
pages/addstock.php
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../required.php';
|
||||||
|
|
||||||
|
redirectifnotloggedin();
|
||||||
|
|
||||||
|
if ($database->count("locations") == 0 || $database->count("categories") == 0) {
|
||||||
|
header('Location: app.php?page=items&msg=noloccat');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemdata = [
|
||||||
|
'text1' => '',
|
||||||
|
'qty' => ''];
|
||||||
|
|
||||||
|
if (!empty($VARS['id'])) {
|
||||||
|
if ($database->has('items', ['itemid' => $VARS['id']])) {
|
||||||
|
$itemdata = $database->select(
|
||||||
|
'items', [
|
||||||
|
'name',
|
||||||
|
'qty',
|
||||||
|
], [
|
||||||
|
'itemid' => $VARS['id']
|
||||||
|
])[0];
|
||||||
|
} else {
|
||||||
|
// item id is invalid, redirect to a page that won't cause an error when pressing Save
|
||||||
|
header('Location: app.php?page=addstock');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form role="form" action="action.php" method="POST">
|
||||||
|
<div class="card border-green">
|
||||||
|
<h3 class="card-header text-green">
|
||||||
|
<i class="fas fa-edit"></i> <?php $Strings->build("adding stock", ['item' => "<span id=\"name_title\">" . htmlspecialchars($itemdata['name']) . "</span>"]); ?>
|
||||||
|
</h3>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="stock"><i class="fas fa-hashtag"></i> <?php $Strings->get('quantity'); ?></label>
|
||||||
|
<input type="number" min="1" class="form-control" id="stock" name="stock" required="required" placeholder="<?php echo $itemdata['qty']; ?>" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="info1"><i class="fas fa-info"></i> <?php $Strings->get("Description"); ?></label>
|
||||||
|
<textarea class="form-control" id="info1" name="text1" required="required"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="itemid" value="<?php
|
||||||
|
echo htmlspecialchars($VARS['id']);
|
||||||
|
?>" />
|
||||||
|
<input type="hidden" name="action" value="addstock" />
|
||||||
|
<?php
|
||||||
|
if (isset($_GET['source']) && $_GET['source'] === "item") {
|
||||||
|
echo '<input type="hidden" name="source" value="item" />';
|
||||||
|
} else {
|
||||||
|
echo '<input type="hidden" name="source" value="items" />';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="card-footer d-flex">
|
||||||
|
<button type="submit" class="btn btn-success mr-1"><i class="fas fa-save"></i> <?php $Strings->get("save"); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
@ -14,9 +14,9 @@ redirectifnotloggedin();
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-priority="0"></th>
|
<th data-priority="0"></th>
|
||||||
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
|
||||||
<th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th>
|
<th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th>
|
||||||
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th>
|
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th>
|
||||||
|
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -30,11 +30,11 @@ redirectifnotloggedin();
|
|||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
|
||||||
<a class="btn btn-primary btn-sm" href="app.php?page=editcat&id=<?php echo $cat['catid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
|
|
||||||
</td>
|
|
||||||
<td><?php echo $cat['catname']; ?></td>
|
<td><?php echo $cat['catname']; ?></td>
|
||||||
<td><?php echo $itemcount; ?></td>
|
<td><?php echo $itemcount; ?></td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-primary btn-sm" href="app.php?page=editcat&id=<?php echo $cat['catid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -43,9 +43,9 @@ redirectifnotloggedin();
|
|||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-priority="0"></th>
|
<th data-priority="0"></th>
|
||||||
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
|
||||||
<th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th>
|
<th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th>
|
||||||
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th>
|
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th>
|
||||||
|
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
@ -164,7 +164,17 @@ if (!empty($VARS['id'])) {
|
|||||||
<div class="col-12 col-md-3">
|
<div class="col-12 col-md-3">
|
||||||
<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>
|
||||||
<input type="number" class="form-control" id="qty" name="qty" placeholder="1" value="<?php echo $itemdata['qty']; ?>" />
|
<?php
|
||||||
|
if ($SETTINGS['stock_management'] && $editing && !$cloning) {
|
||||||
|
?>
|
||||||
|
<input type="text" class="form-control" id="qty" name="qty" readonly value="<?php echo $itemdata['qty']; ?>" />
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<input type="number" class="form-control" id="qty" name="qty" placeholder="1" value="<?php echo $itemdata['qty']; ?>" />
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-3">
|
<div class="col-12 col-md-3">
|
||||||
@ -263,4 +273,4 @@ if (!empty($VARS['id'])) {
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -16,6 +16,13 @@ redirectifnotloggedin();
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="type"><?php $Strings->get("report type"); ?></label>
|
<label for="type"><?php $Strings->get("report type"); ?></label>
|
||||||
<select name="type" class="form-control" required>
|
<select name="type" class="form-control" required>
|
||||||
|
<?php
|
||||||
|
if ($SETTINGS['stock_management']) {
|
||||||
|
?>
|
||||||
|
<option value="stock"><?php $Strings->get("Stock") ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
<option value="item"><?php $Strings->get("Items") ?></option>
|
<option value="item"><?php $Strings->get("Items") ?></option>
|
||||||
<option value="category"><?php $Strings->get("Categories") ?></option>
|
<option value="category"><?php $Strings->get("Categories") ?></option>
|
||||||
<option value="location"><?php $Strings->get("Locations") ?></option>
|
<option value="location"><?php $Strings->get("Locations") ?></option>
|
||||||
@ -46,4 +53,4 @@ redirectifnotloggedin();
|
|||||||
<button type="submit" class="btn btn-success ml-auto" id="genrptbtn"><i class="fas fa-download"></i> <?php $Strings->get("generate report"); ?></button>
|
<button type="submit" class="btn btn-success ml-auto" id="genrptbtn"><i class="fas fa-download"></i> <?php $Strings->get("generate report"); ?></button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -169,5 +169,49 @@ $item = $database->get(
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
if ($SETTINGS['stock_management']) {
|
||||||
|
?>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<div class="row mt-4 mx-0">
|
||||||
|
<table id="stocktable" class="table table-bordered table-hover table-sm">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th data-priority="1"><i class="fas fa-fw fa-calendar d-none d-md-inline"></i> <?php $Strings->get('date'); ?></th>
|
||||||
|
<th data-priority="2"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('amount'); ?></th>
|
||||||
|
<th data-priority="3"><i class="fas fa-fw fa-sticky-note d-none d-md-inline"></i> <?php $Strings->get('description'); ?></th>
|
||||||
|
<th data-priority="4"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('changed by'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$stockentries = $database->select('stock', [
|
||||||
|
'timestamp',
|
||||||
|
'stock',
|
||||||
|
'text1',
|
||||||
|
'userid'
|
||||||
|
], [
|
||||||
|
'itemid' => $item['itemid']
|
||||||
|
]
|
||||||
|
);
|
||||||
|
foreach ($stockentries as $stockentry) {
|
||||||
|
$user = new User($stockentry['userid'])
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo $stockentry['timestamp']; ?></td>
|
||||||
|
<td><?php echo $stockentry['stock']; ?></td>
|
||||||
|
<td><?php echo $stockentry['text1']; ?></td>
|
||||||
|
<td><?php echo $user->getName() . " (" . $user->getUsername() . ")"; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,7 +24,6 @@ redirectifnotloggedin();
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-priority="0"></th>
|
<th data-priority="0"></th>
|
||||||
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
|
||||||
<th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th>
|
<th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th>
|
||||||
<th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th>
|
<th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th>
|
||||||
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th>
|
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th>
|
||||||
@ -33,6 +32,7 @@ redirectifnotloggedin();
|
|||||||
<th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th>
|
<th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th>
|
||||||
<th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th>
|
<th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th>
|
||||||
<th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th>
|
<th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th>
|
||||||
|
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -40,7 +40,6 @@ redirectifnotloggedin();
|
|||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-priority="0"></th>
|
<th data-priority="0"></th>
|
||||||
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
|
||||||
<th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th>
|
<th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th>
|
||||||
<th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th>
|
<th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th>
|
||||||
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th>
|
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th>
|
||||||
@ -49,6 +48,7 @@ redirectifnotloggedin();
|
|||||||
<th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th>
|
<th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th>
|
||||||
<th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th>
|
<th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th>
|
||||||
<th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th>
|
<th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th>
|
||||||
|
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
@ -15,10 +15,10 @@ redirectifnotloggedin();
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-priority="0"></th>
|
<th data-priority="0"></th>
|
||||||
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
|
||||||
<th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th>
|
<th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th>
|
||||||
<th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th>
|
<th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th>
|
||||||
<th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th>
|
<th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th>
|
||||||
|
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -33,12 +33,12 @@ redirectifnotloggedin();
|
|||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
|
||||||
<a class="btn btn-primary btn-sm" href="app.php?page=editloc&id=<?php echo $loc['locid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
|
|
||||||
</td>
|
|
||||||
<td><?php echo $loc['locname']; ?></td>
|
<td><?php echo $loc['locname']; ?></td>
|
||||||
<td><?php echo $loc['loccode']; ?></td>
|
<td><?php echo $loc['loccode']; ?></td>
|
||||||
<td><?php echo $itemcount; ?></td>
|
<td><?php echo $itemcount; ?></td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-primary btn-sm" href="app.php?page=editloc&id=<?php echo $loc['locid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -47,10 +47,10 @@ redirectifnotloggedin();
|
|||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-priority="0"></th>
|
<th data-priority="0"></th>
|
||||||
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
|
||||||
<th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th>
|
<th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th>
|
||||||
<th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th>
|
<th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th>
|
||||||
<th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th>
|
<th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th>
|
||||||
|
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
77
pages/removestock.php
Normal file
77
pages/removestock.php
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../required.php';
|
||||||
|
|
||||||
|
redirectifnotloggedin();
|
||||||
|
|
||||||
|
if ($database->count("locations") == 0 || $database->count("categories") == 0) {
|
||||||
|
header('Location: app.php?page=items&msg=noloccat');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemdata = [
|
||||||
|
'text1' => '',
|
||||||
|
'qty' => ''];
|
||||||
|
|
||||||
|
if (!empty($VARS['id'])) {
|
||||||
|
if ($database->has('items', ['itemid' => $VARS['id']])) {
|
||||||
|
$itemdata = $database->select(
|
||||||
|
'items', [
|
||||||
|
'name',
|
||||||
|
'qty',
|
||||||
|
], [
|
||||||
|
'itemid' => $VARS['id']
|
||||||
|
])[0];
|
||||||
|
} else {
|
||||||
|
// item id is invalid, redirect to a page that won't cause an error when pressing Save
|
||||||
|
header('Location: app.php?page=removestock');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form role="form" action="action.php" method="POST">
|
||||||
|
<div class="card border-green">
|
||||||
|
<h3 class="card-header text-green">
|
||||||
|
<i class="fas fa-edit"></i> <?php $Strings->build("removing stock", ['item' => "<span id=\"name_title\">" . htmlspecialchars($itemdata['name']) . "</span>"]); ?>
|
||||||
|
</h3>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="stock"><i class="fas fa-hashtag"></i> <?php $Strings->get('quantity'); ?></label>
|
||||||
|
<input type="number" min="1" class="form-control" id="stock" name="stock" required="required" placeholder="<?php echo $itemdata['qty']; ?>" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="info1"><i class="fas fa-info"></i> <?php $Strings->get("Description"); ?></label>
|
||||||
|
<textarea class="form-control" id="info1" name="text1" required="required"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="itemid" value="<?php
|
||||||
|
echo htmlspecialchars($VARS['id']);
|
||||||
|
?>" />
|
||||||
|
<input type="hidden" name="action" value="removestock" />
|
||||||
|
<?php
|
||||||
|
if (isset($_GET['source']) && $_GET['source'] === "item") {
|
||||||
|
echo '<input type="hidden" name="source" value="item" />';
|
||||||
|
} else {
|
||||||
|
echo '<input type="hidden" name="source" value="items" />';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="card-footer d-flex">
|
||||||
|
<button type="submit" class="btn btn-success mr-1"><i class="fas fa-save"></i> <?php $Strings->get("save"); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
@ -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,
|
||||||
];
|
];
|
||||||
|
@ -24,11 +24,11 @@ $('#cattable').DataTable({
|
|||||||
orderable: false
|
orderable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
targets: 1,
|
targets: 3,
|
||||||
orderable: false
|
orderable: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
order: [
|
order: [
|
||||||
[2, 'asc']
|
[1, 'asc']
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -24,16 +24,16 @@ var itemtable = $('#itemtable').DataTable({
|
|||||||
orderable: false
|
orderable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
targets: 1,
|
targets: 8,
|
||||||
orderable: false
|
orderable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
targets: 8,
|
targets: 9,
|
||||||
orderable: false
|
orderable: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
order: [
|
order: [
|
||||||
[2, 'asc']
|
[1, 'asc']
|
||||||
],
|
],
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
ajax: {
|
ajax: {
|
||||||
@ -49,7 +49,6 @@ var itemtable = $('#itemtable').DataTable({
|
|||||||
json.items.forEach(function (row) {
|
json.items.forEach(function (row) {
|
||||||
json.data.push([
|
json.data.push([
|
||||||
"",
|
"",
|
||||||
"<span class='btn-group-vertical btn-group-sm'>" + row.viewbtn + " " + row.editbtn + "</span>",
|
|
||||||
row.name,
|
row.name,
|
||||||
row.catname,
|
row.catname,
|
||||||
row.locname + " (" + row.loccode + ")",
|
row.locname + " (" + row.loccode + ")",
|
||||||
@ -57,7 +56,8 @@ var itemtable = $('#itemtable').DataTable({
|
|||||||
row.code2,
|
row.code2,
|
||||||
row.qty,
|
row.qty,
|
||||||
row.want,
|
row.want,
|
||||||
row.username
|
row.username,
|
||||||
|
"<span class='btn-group btn-group-sm'>" + row.viewbtn + " " + row.editbtn + " " + row.addstockbtn + " " + row.removestockbtn + "</span>"
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
return JSON.stringify(json);
|
return JSON.stringify(json);
|
||||||
@ -74,4 +74,4 @@ $(document).ready(function () {
|
|||||||
$(searchInput).trigger("input");
|
$(searchInput).trigger("input");
|
||||||
$(searchInput).trigger("change");
|
$(searchInput).trigger("change");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -24,11 +24,11 @@ $('#loctable').DataTable({
|
|||||||
orderable: false
|
orderable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
targets: 1,
|
targets: 4,
|
||||||
orderable: false
|
orderable: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
order: [
|
order: [
|
||||||
[2, 'asc']
|
[1, 'asc']
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user