Some fixes :)
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
// check if product exists
|
||||
$productId = $db->fetchByAssoc($db->query("SELECT id FROM ecmproducts WHERE id = '$productId'"))['id'];
|
||||
if ($productId == null) {
|
||||
echo json_encode(array('status' => 'Error', 'msg' => 'Nie znalaziono aktywnego produktu w bazie: '.$index ));
|
||||
echo json_encode(array('status' => 'Error', 'msg' => 'Nie znalaziono produktu w bazie: '.$index ));
|
||||
}
|
||||
// check if location is empty
|
||||
$location = $db->fetchByAssoc($db->query("SELECT stock_address FROM ecmproducts_stock_addresses WHERE stock_address = '$address'"));
|
||||
@@ -35,7 +35,7 @@
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$pRes = $db->query("SELECT DISTINCT id, code FROM ecmproducts WHERE deleted=0 AND status != 'end_of_life';");
|
||||
$pRes = $db->query("SELECT DISTINCT id, code FROM ecmproducts WHERE deleted=0;");
|
||||
$codes = array();
|
||||
while ($p = $db -> fetchByAssoc($pRes)) {
|
||||
$index = str_replace("'", "'", $p['code']);
|
||||
@@ -63,7 +63,7 @@
|
||||
$res = $db->query("
|
||||
SELECT a.ecmproduct_id, a.stock_address, a.is_not_full, p.name, p.code FROM ecmproducts_stock_addresses AS a
|
||||
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id
|
||||
WHERE p.id='$id' AND p.deleted=0 AND p.active=1;");
|
||||
WHERE p.id='$id' AND p.deleted=0;");
|
||||
$addresses = array();
|
||||
while ($r = $db -> fetchByAssoc($res)) {
|
||||
array_push($addresses, $r);
|
||||
|
||||
@@ -7,7 +7,7 @@ $(document).ready(function () {
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell) {
|
||||
return $(cell).find("input[id^=production-date]").val() || "1970-01-01";
|
||||
return $(cell).find("input[id^=production-date]").val() || "2222-01-01";
|
||||
},
|
||||
parsed: false,
|
||||
type: "text"
|
||||
@@ -62,6 +62,29 @@ $(document).ready(function () {
|
||||
3: { sorter: "production_date" },
|
||||
},
|
||||
});
|
||||
$("#allTable").bind('filterEnd', function () {
|
||||
localStorage.setItem("productionSchedule_filter", $.tablesorter.getFilters($("#allTable")));
|
||||
});
|
||||
$("#allTable").bind("sortEnd", function () {
|
||||
try {
|
||||
localStorage.setItem('productionSchedule_sort',
|
||||
$("#allTable")[0].config.sortList[0][0] + "|" + $("#allTable")[0].config.sortList[0][1]);
|
||||
} catch (e) {}
|
||||
});
|
||||
setTimeout(() => {
|
||||
const filters = localStorage.getItem("productionSchedule_filter");
|
||||
if (filters) {
|
||||
$.tablesorter.setFilters($('#allTable'), filters.split(','), true);
|
||||
}
|
||||
const sort = localStorage.getItem("productionSchedule_sort");
|
||||
if (sort) {
|
||||
try {
|
||||
var tmp = sort.split("|");
|
||||
$("#allTable")[0].config.sortList = [[parseInt(tmp[0]), parseInt(tmp[1])]];
|
||||
$.tablesorter.sortOn($("#allTable")[0].config, [[parseInt(tmp[0]), parseInt(tmp[1])]]);
|
||||
} catch (e) { }
|
||||
}
|
||||
}, 500);
|
||||
$("#duplicateBtn").click(() => duplicatePositions());
|
||||
$("#deleteBtn").click(() => { removePositions(); });
|
||||
$("#excelBtn").click(() => { exportExcel(); });
|
||||
@@ -153,7 +176,7 @@ function saveDescription(id) {
|
||||
$.ajax({
|
||||
method: "get",
|
||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=saveProductDescription&id=" + id + "&description=" + $("#descriptionInput-" + id).val(),
|
||||
success: function (data) {
|
||||
success: function () {
|
||||
$("#description-" + id).html($("#descriptionInput-" + id).val());
|
||||
},
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ if (!isset($_GET['ajaxAction'])) {
|
||||
$dateTo = date("Y-m-d", strtotime("+ 1 month"));
|
||||
}
|
||||
|
||||
$query = "SELECT s.id, s.document_no, s.status, s.parent_name, s.parent_id, s.send_date, s.type,
|
||||
$query = "SELECT s.id as orderId, s.document_no, s.status, s.parent_name, s.parent_id, s.send_date, s.type,
|
||||
p.code, p.name, ps.ecmproduct_id, ps.description,
|
||||
si.quantity, p.vendor_part_no as kind, p.brand, p.part_no as size, p.shape,
|
||||
ss.quantity as stockState, si.id as item_id, s.shipping_address_name, ps.production_date,
|
||||
@@ -34,9 +34,14 @@ if (!isset($_GET['ajaxAction'])) {
|
||||
ON ps.ecmproduct_id = p.id
|
||||
LEFT JOIN ecmstockstates AS ss
|
||||
ON ss.product_id = ps.ecmproduct_id AND ss.stock_id = 'c7afd71a-4c3a-bde4-138d-4acaee1644e4'
|
||||
WHERE ps.deleted = 0 AND ps.production_date >= '$dateFrom' AND ps.production_date <= '$dateTo'
|
||||
WHERE ps.deleted = 0 AND
|
||||
(
|
||||
(ps.production_date >= '$dateFrom' AND ps.production_date <= '$dateTo')
|
||||
OR ps.production_date IS NULL OR ps.production_date = '0000-00-00')
|
||||
ORDER BY s.delivery_date, s.register_date, s.document_no";
|
||||
|
||||
//echo $query;
|
||||
|
||||
$rows = $db->query($query);
|
||||
$data = array();
|
||||
$i = 0;
|
||||
@@ -57,7 +62,7 @@ if (!isset($_GET['ajaxAction'])) {
|
||||
$row['productShape'] = $app_list_strings['ecmproducts_shape_dom'][$r['shape']];
|
||||
$row['productBrand'] = $app_list_strings['ecmproducts_brand_dom'][$r['brand']];
|
||||
$row['orderNo'] = $r['document_no'];
|
||||
$row['orderId'] = $r['id'];
|
||||
$row['orderId'] = $r['orderId'];
|
||||
$row['orderStatus'] = $app_list_strings['ecmsales_status_dom'][$r['status']];
|
||||
$row['orderType'] = $app_list_strings['ecmsales_type_dom'][$r['type']];
|
||||
$row['orderParent'] = $r['parent_name'];
|
||||
|
||||
@@ -215,9 +215,9 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
$return_id = $focus->id;
|
||||
|
||||
if ($focus->out_module == 'EcmPurchaseOrders') {
|
||||
if (isset($focus->po_id)) {
|
||||
$db = $GLOBALS['db'];
|
||||
$db->query("UPDATE ecmpurchaseorders SET status='deliver' WHERE id='".$focus->out_id."';");
|
||||
$db->query("UPDATE ecmpurchaseorders SET status='deliver' WHERE id='".$focus->po_id."';");
|
||||
}
|
||||
|
||||
echo $return_id;
|
||||
|
||||
Reference in New Issue
Block a user