stock dash
This commit is contained in:
@@ -286,14 +286,16 @@ let isAjaxProcessing = false;
|
||||
|
||||
function ajax_request(options) {
|
||||
|
||||
if (isAjaxProcessing) {
|
||||
if (isAjaxProcessing && options.queueLock !== false) {
|
||||
// Instead of rejecting, we just return a "never-ending" promise
|
||||
// or a resolved promise that does nothing.
|
||||
console.warn("Request is busy... ignoring click.");
|
||||
return new Promise(() => { }); // This stays pending and won't trigger .then or .catch
|
||||
}
|
||||
|
||||
isAjaxProcessing = true;
|
||||
if (options.queueLock !== false) {
|
||||
isAjaxProcessing = true;
|
||||
}
|
||||
|
||||
// Auto prepare form data
|
||||
if (options.autoPrepare === true) {
|
||||
@@ -339,6 +341,7 @@ function ajax_request(options) {
|
||||
let isSendingFiles = (options.data instanceof FormData);
|
||||
|
||||
if (options.debugMode) {
|
||||
isAjaxProcessing = false;
|
||||
console.log("REQUEST DATA:", options.data);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,14 @@ class WarehouseManager {
|
||||
$name = $this->getWarehouseName($warehouse_id);
|
||||
$table = "td_stock_" . $name;
|
||||
|
||||
if (empty($id)) {
|
||||
return [
|
||||
'table' => $table,
|
||||
'name' => $name,
|
||||
'row' => []
|
||||
];
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM `$table`
|
||||
WHERE company_id = :company_id AND id = :id";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user