production: update sorting
This commit is contained in:
@@ -8,7 +8,10 @@ $(document).ready(function () {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
format: function (s, table, cell) {
|
format: function (s, table, cell) {
|
||||||
return $(cell).find("input[id^=production-date]").val() + " " + $(cell).find("input[id^=production-time]").val() || "2222-01-01";
|
if ($(cell).find("input[id^=production-date]").val() === '') {
|
||||||
|
return "2222-01-01";
|
||||||
|
}
|
||||||
|
return $(cell).find("input[id^=production-date]").val() + " " + $(cell).find("input[id^=production-time]").val();
|
||||||
},
|
},
|
||||||
parsed: false,
|
parsed: false,
|
||||||
type: "text"
|
type: "text"
|
||||||
@@ -60,7 +63,7 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
3: { sorter: "production_date" },
|
3: {sorter: "production_date"},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
$("#allTable").bind('filterEnd', function () {
|
$("#allTable").bind('filterEnd', function () {
|
||||||
@@ -73,7 +76,8 @@ $(document).ready(function () {
|
|||||||
try {
|
try {
|
||||||
localStorage.setItem('productionSchedule_sort',
|
localStorage.setItem('productionSchedule_sort',
|
||||||
$("#allTable")[0].config.sortList[0][0] + "|" + $("#allTable")[0].config.sortList[0][1]);
|
$("#allTable")[0].config.sortList[0][0] + "|" + $("#allTable")[0].config.sortList[0][1]);
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
}
|
||||||
updateTimeSummary();
|
updateTimeSummary();
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -87,12 +91,13 @@ $(document).ready(function () {
|
|||||||
var tmp = sort.split("|");
|
var tmp = sort.split("|");
|
||||||
$("#allTable")[0].config.sortList = [[parseInt(tmp[0]), parseInt(tmp[1])]];
|
$("#allTable")[0].config.sortList = [[parseInt(tmp[0]), parseInt(tmp[1])]];
|
||||||
$.tablesorter.sortOn($("#allTable")[0].config, [[parseInt(tmp[0]), parseInt(tmp[1])]]);
|
$.tablesorter.sortOn($("#allTable")[0].config, [[parseInt(tmp[0]), parseInt(tmp[1])]]);
|
||||||
} catch (e) { }
|
} catch (e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
$("#selectAll").click(function () {
|
$("#selectAll").click(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
$(".allCheck").each(function() {
|
$(".allCheck").each(function () {
|
||||||
if ($(this).closest('tr').is(':visible')) {
|
if ($(this).closest('tr').is(':visible')) {
|
||||||
$(this).prop('checked', true);
|
$(this).prop('checked', true);
|
||||||
}
|
}
|
||||||
@@ -103,20 +108,35 @@ $(document).ready(function () {
|
|||||||
updateTimeSummary();
|
updateTimeSummary();
|
||||||
});
|
});
|
||||||
$("#duplicateBtn").click(() => duplicatePositions());
|
$("#duplicateBtn").click(() => duplicatePositions());
|
||||||
$("#deleteBtn").click(() => { removePositions(); });
|
$("#deleteBtn").click(() => {
|
||||||
$("#excelBtn").click(() => { exportExcel(); });
|
removePositions();
|
||||||
$("#pdfBtn").click(() => { exportPDF(); });
|
});
|
||||||
$("#changeDateBtn").click(() => { changeDate(); });
|
$("#excelBtn").click(() => {
|
||||||
$("#rawMaterialsExcelBtn").click(() => { exportRawMaterialsExcel(); });
|
exportExcel();
|
||||||
$("#productionBtn").click(() => { window.alert("In progress."); });
|
});
|
||||||
|
$("#pdfBtn").click(() => {
|
||||||
|
exportPDF();
|
||||||
|
});
|
||||||
|
$("#changeDateBtn").click(() => {
|
||||||
|
changeDate();
|
||||||
|
});
|
||||||
|
$("#rawMaterialsExcelBtn").click(() => {
|
||||||
|
exportRawMaterialsExcel();
|
||||||
|
});
|
||||||
|
$("#productionBtn").click(() => {
|
||||||
|
window.alert("In progress.");
|
||||||
|
});
|
||||||
$("#createInsideOrder").click(createInsideOrder);
|
$("#createInsideOrder").click(createInsideOrder);
|
||||||
$(document).on('change', '.allCheck', function() {
|
$(document).on('change', '.allCheck', function () {
|
||||||
updateTimeSummary();
|
updateTimeSummary();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function SetTab(tab_name) {
|
function SetTab(tab_name) {
|
||||||
if (TabsMainBlock) { return; }
|
if (TabsMainBlock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var TabMenu = document.getElementById("groupTabsPanels");
|
var TabMenu = document.getElementById("groupTabsPanels");
|
||||||
var tabs = TabMenu.getElementsByTagName("li");
|
var tabs = TabMenu.getElementsByTagName("li");
|
||||||
for (var i = 0; i < tabs.length; i++) {
|
for (var i = 0; i < tabs.length; i++) {
|
||||||
@@ -142,6 +162,7 @@ function SetTab(tab_name) {
|
|||||||
if (SelectedTab === "1") {
|
if (SelectedTab === "1") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRawMaterials() {
|
function getRawMaterials() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -177,6 +198,7 @@ function getRawMaterials() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawRawMaterials(data) {
|
function drawRawMaterials(data) {
|
||||||
$("#rawMaterialsTableContainer").html(rawMaterialsTablePrototype());
|
$("#rawMaterialsTableContainer").html(rawMaterialsTablePrototype());
|
||||||
// TODO: tutraj czasami się wiesza
|
// TODO: tutraj czasami się wiesza
|
||||||
@@ -190,7 +212,7 @@ function drawRawMaterials(data) {
|
|||||||
}
|
}
|
||||||
code += "><a target=\"_blank\" href=\"index.php?module=EcmProducts&action=DetailView&record=" + el.id + "\">" + el.code + "</a></td>";
|
code += "><a target=\"_blank\" href=\"index.php?module=EcmProducts&action=DetailView&record=" + el.id + "\">" + el.code + "</a></td>";
|
||||||
tr.append(code);
|
tr.append(code);
|
||||||
tr.append("<td title=\""+ el.fullName +"\">" + el.name + "</td>");
|
tr.append("<td title=\"" + el.fullName + "\">" + el.name + "</td>");
|
||||||
tr.append("<td id=\"qty-" + el.id + "\">" + el.quantity + "</td>");
|
tr.append("<td id=\"qty-" + el.id + "\">" + el.quantity + "</td>");
|
||||||
tr.append("<td>" + el.unit + "</td>");
|
tr.append("<td>" + el.unit + "</td>");
|
||||||
tr.append("<td id=\"state-" + el.id + "\">" + el.stockState + "</td>");
|
tr.append("<td id=\"state-" + el.id + "\">" + el.stockState + "</td>");
|
||||||
@@ -218,7 +240,7 @@ function drawRawMaterials(data) {
|
|||||||
$("#selectAllRawMaterials").attr('checked', false);
|
$("#selectAllRawMaterials").attr('checked', false);
|
||||||
$("#selectAllRawMaterials").click(function () {
|
$("#selectAllRawMaterials").click(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
$(".rawMaterialCheck").each(function() {
|
$(".rawMaterialCheck").each(function () {
|
||||||
if ($(this).closest('tr').is(':visible')) {
|
if ($(this).closest('tr').is(':visible')) {
|
||||||
$(this).prop('checked', true);
|
$(this).prop('checked', true);
|
||||||
}
|
}
|
||||||
@@ -229,9 +251,11 @@ function drawRawMaterials(data) {
|
|||||||
});
|
});
|
||||||
updateRawMaterialsPositions();
|
updateRawMaterialsPositions();
|
||||||
}
|
}
|
||||||
|
|
||||||
function rawMaterialsTablePrototype() {
|
function rawMaterialsTablePrototype() {
|
||||||
return '<table id="rawMaterialsTable"><thead><tr><th class="filter-false"><input type="checkbox" id="selectAllRawMaterials" /></th><th>Pozycja</th><th>Indeks</th><th>Nazwa</th><th>Ilość</th><th>JM.</th><th>Stan</th><th>Adres magazynowy</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody></table>';
|
return '<table id="rawMaterialsTable"><thead><tr><th class="filter-false"><input type="checkbox" id="selectAllRawMaterials" /></th><th>Pozycja</th><th>Indeks</th><th>Nazwa</th><th>Ilość</th><th>JM.</th><th>Stan</th><th>Adres magazynowy</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateRawMaterialsPositions() {
|
function updateRawMaterialsPositions() {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
$("#rawMaterialsTable").find("tr").each(function (index) {
|
$("#rawMaterialsTable").find("tr").each(function (index) {
|
||||||
@@ -241,6 +265,7 @@ function updateRawMaterialsPositions() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function editQty(id) {
|
function editQty(id) {
|
||||||
$("#edit-" + id).css("display", "none");
|
$("#edit-" + id).css("display", "none");
|
||||||
$("#qty-" + id).css("display", "none");
|
$("#qty-" + id).css("display", "none");
|
||||||
@@ -248,6 +273,7 @@ function editQty(id) {
|
|||||||
$("#qtyInput-" + id).select();
|
$("#qtyInput-" + id).select();
|
||||||
$("#save-" + id).css("display", "inline-block");
|
$("#save-" + id).css("display", "inline-block");
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveQty(id) {
|
function saveQty(id) {
|
||||||
showLoader("Trwa aktualizacja...");
|
showLoader("Trwa aktualizacja...");
|
||||||
$("#edit-" + id).css("display", "inline-block");
|
$("#edit-" + id).css("display", "inline-block");
|
||||||
@@ -263,6 +289,7 @@ function saveQty(id) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function duplicatePositions() {
|
function duplicatePositions() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -273,7 +300,9 @@ function duplicatePositions() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var userResponse = window.confirm("Zduplikować pozycje?");
|
var userResponse = window.confirm("Zduplikować pozycje?");
|
||||||
if (!userResponse) { return; }
|
if (!userResponse) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
showLoader("Duplikowanie...");
|
showLoader("Duplikowanie...");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "get",
|
||||||
@@ -283,6 +312,7 @@ function duplicatePositions() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePositions() {
|
function removePositions() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -293,17 +323,19 @@ function removePositions() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var userResponse = window.confirm("Usunąć pozycje?");
|
var userResponse = window.confirm("Usunąć pozycje?");
|
||||||
if (!userResponse) { return; }
|
if (!userResponse) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
showLoader("Usuwanie...");
|
showLoader("Usuwanie...");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "get",
|
||||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=removePositions&ids=" + ids.join("|"),
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=removePositions&ids=" + ids.join("|"),
|
||||||
success: function ()
|
success: function () {
|
||||||
{
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveProductionDate(id) {
|
function saveProductionDate(id) {
|
||||||
let date = $("#production-date-" + id).val();
|
let date = $("#production-date-" + id).val();
|
||||||
let time = $("#production-time-" + id).val();
|
let time = $("#production-time-" + id).val();
|
||||||
@@ -322,7 +354,7 @@ function saveProductionDate(id) {
|
|||||||
const timeParts = time.split(':');
|
const timeParts = time.split(':');
|
||||||
const hours = parseInt(timeParts[0], 10);
|
const hours = parseInt(timeParts[0], 10);
|
||||||
const minutes = parseInt(timeParts[1], 10);
|
const minutes = parseInt(timeParts[1], 10);
|
||||||
|
|
||||||
if (hours < 6 || (hours === 14 && minutes > 30) || hours > 14) {
|
if (hours < 6 || (hours === 14 && minutes > 30) || hours > 14) {
|
||||||
time = "06:00";
|
time = "06:00";
|
||||||
}
|
}
|
||||||
@@ -336,7 +368,7 @@ function saveProductionDate(id) {
|
|||||||
const timeParts = time.split(':');
|
const timeParts = time.split(':');
|
||||||
const hours = parseInt(timeParts[0], 10);
|
const hours = parseInt(timeParts[0], 10);
|
||||||
const minutes = parseInt(timeParts[1], 10);
|
const minutes = parseInt(timeParts[1], 10);
|
||||||
|
|
||||||
if (hours < 6 || (hours === 14 && minutes > 30) || hours > 14) {
|
if (hours < 6 || (hours === 14 && minutes > 30) || hours > 14) {
|
||||||
time = "06:00";
|
time = "06:00";
|
||||||
}
|
}
|
||||||
@@ -352,6 +384,7 @@ function saveProductionDate(id) {
|
|||||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=saveProductionDate&id=" + id + "&date=" + encodeURIComponent(date) + "&time=" + encodeURIComponent(time),
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=saveProductionDate&id=" + id + "&date=" + encodeURIComponent(date) + "&time=" + encodeURIComponent(time),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function editDescription(id) {
|
function editDescription(id) {
|
||||||
$("#edit-description-" + id).css("display", "none");
|
$("#edit-description-" + id).css("display", "none");
|
||||||
$("#description-" + id).css("display", "none");
|
$("#description-" + id).css("display", "none");
|
||||||
@@ -359,6 +392,7 @@ function editDescription(id) {
|
|||||||
$("#descriptionInput-" + id).select();
|
$("#descriptionInput-" + id).select();
|
||||||
$("#save-description-" + id).css("display", "inline-block");
|
$("#save-description-" + id).css("display", "inline-block");
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveDescription(id) {
|
function saveDescription(id) {
|
||||||
$("#edit-description-" + id).css("display", "inline-block");
|
$("#edit-description-" + id).css("display", "inline-block");
|
||||||
$("#description-" + id).css("display", "inline");
|
$("#description-" + id).css("display", "inline");
|
||||||
@@ -372,6 +406,7 @@ function saveDescription(id) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoader(msg = "Pobieranie danych") {
|
function showLoader(msg = "Pobieranie danych") {
|
||||||
$.blockUI({
|
$.blockUI({
|
||||||
css: {
|
css: {
|
||||||
@@ -388,9 +423,11 @@ function showLoader(msg = "Pobieranie danych") {
|
|||||||
message: msg
|
message: msg
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideLoader() {
|
function hideLoader() {
|
||||||
$.unblockUI();
|
$.unblockUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportExcel() {
|
function exportExcel() {
|
||||||
// Check if any rows are selected
|
// Check if any rows are selected
|
||||||
var checkedRows = $("input.allCheck:checkbox:checked").closest('tr:visible');
|
var checkedRows = $("input.allCheck:checkbox:checked").closest('tr:visible');
|
||||||
@@ -404,7 +441,7 @@ function exportExcel() {
|
|||||||
|
|
||||||
// Get headers (skip first checkbox column)
|
// Get headers (skip first checkbox column)
|
||||||
var headers = [];
|
var headers = [];
|
||||||
$("#allTable thead tr th").each(function(index) {
|
$("#allTable thead tr th").each(function (index) {
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
headers.push($(this).text().trim());
|
headers.push($(this).text().trim());
|
||||||
}
|
}
|
||||||
@@ -412,11 +449,11 @@ function exportExcel() {
|
|||||||
tableData.push(headers);
|
tableData.push(headers);
|
||||||
|
|
||||||
// Get data from checked and visible rows
|
// Get data from checked and visible rows
|
||||||
checkedRows.each(function() {
|
checkedRows.each(function () {
|
||||||
var rowData = [];
|
var rowData = [];
|
||||||
var $row = $(this);
|
var $row = $(this);
|
||||||
|
|
||||||
$row.find('td').each(function(index) {
|
$row.find('td').each(function (index) {
|
||||||
if (index > 0) { // Skip first checkbox column
|
if (index > 0) { // Skip first checkbox column
|
||||||
var $cell = $(this);
|
var $cell = $(this);
|
||||||
var cellValue = '';
|
var cellValue = '';
|
||||||
@@ -456,12 +493,13 @@ function exportExcel() {
|
|||||||
downloadFile(result.fileContent, result.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
downloadFile(result.fileContent, result.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
hideLoader();
|
hideLoader();
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function () {
|
||||||
window.alert("Błąd podczas generowania pliku");
|
window.alert("Błąd podczas generowania pliku");
|
||||||
hideLoader();
|
hideLoader();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportPDF() {
|
function exportPDF() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -476,13 +514,13 @@ function exportPDF() {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "get",
|
||||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=exportPDF&ids=" + ids.join("|"),
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=exportPDF&ids=" + ids.join("|"),
|
||||||
success: function (response)
|
success: function (response) {
|
||||||
{
|
|
||||||
downloadFile(response.fileContent, response.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
downloadFile(response.fileContent, response.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
hideLoader();
|
hideLoader();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportRawMaterialsExcel() {
|
function exportRawMaterialsExcel() {
|
||||||
// Check if raw materials table exists
|
// Check if raw materials table exists
|
||||||
if ($("#rawMaterialsTable").length === 0) {
|
if ($("#rawMaterialsTable").length === 0) {
|
||||||
@@ -506,7 +544,7 @@ function exportRawMaterialsExcel() {
|
|||||||
|
|
||||||
// Get headers (skip first checkbox column)
|
// Get headers (skip first checkbox column)
|
||||||
var headers = [];
|
var headers = [];
|
||||||
$("#rawMaterialsTable thead tr th").each(function(index) {
|
$("#rawMaterialsTable thead tr th").each(function (index) {
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
headers.push($(this).text().trim());
|
headers.push($(this).text().trim());
|
||||||
}
|
}
|
||||||
@@ -514,11 +552,11 @@ function exportRawMaterialsExcel() {
|
|||||||
tableData.push(headers);
|
tableData.push(headers);
|
||||||
|
|
||||||
// Get data from selected/visible rows
|
// Get data from selected/visible rows
|
||||||
checkedRows.each(function() {
|
checkedRows.each(function () {
|
||||||
var rowData = [];
|
var rowData = [];
|
||||||
var $row = $(this);
|
var $row = $(this);
|
||||||
|
|
||||||
$row.find('td').each(function(index) {
|
$row.find('td').each(function (index) {
|
||||||
if (index > 0) { // Skip first checkbox column
|
if (index > 0) { // Skip first checkbox column
|
||||||
var $cell = $(this);
|
var $cell = $(this);
|
||||||
var cellValue = '';
|
var cellValue = '';
|
||||||
@@ -552,30 +590,32 @@ function exportRawMaterialsExcel() {
|
|||||||
downloadFile(result.fileContent, result.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
downloadFile(result.fileContent, result.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
hideLoader();
|
hideLoader();
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function () {
|
||||||
window.alert("Błąd podczas generowania pliku");
|
window.alert("Błąd podczas generowania pliku");
|
||||||
hideLoader();
|
hideLoader();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createInsideOrder() {
|
function createInsideOrder() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$('input.allCheck:checkbox:checked').each(function () {
|
$('input.allCheck:checkbox:checked').each(function () {
|
||||||
ids.push($(this).val());
|
ids.push($(this).val());
|
||||||
});
|
});
|
||||||
if (ids.length === 0) {
|
if (ids.length === 0) {
|
||||||
alert('Wybierz pozycje.');
|
alert('Wybierz pozycje.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var products = [];
|
var products = [];
|
||||||
ids.forEach(el => {
|
ids.forEach(el => {
|
||||||
const qty = parseFloat($("#qtyInput-" + el).val().trim());
|
const qty = parseFloat($("#qtyInput-" + el).val().trim());
|
||||||
const id = $("#productId-" + el).val();
|
const id = $("#productId-" + el).val();
|
||||||
products.push(id + "|" + qty);
|
products.push(id + "|" + qty);
|
||||||
});
|
});
|
||||||
$("#insideOrderProducts").val(products.join('*'));
|
$("#insideOrderProducts").val(products.join('*'));
|
||||||
$("#createInsideOrderForm").submit();
|
$("#createInsideOrderForm").submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadFile(base64Data, fileName, mimeType) {
|
function downloadFile(base64Data, fileName, mimeType) {
|
||||||
// Stwórz blob z danych base64
|
// Stwórz blob z danych base64
|
||||||
const byteCharacters = atob(base64Data);
|
const byteCharacters = atob(base64Data);
|
||||||
@@ -605,11 +645,12 @@ function downloadFile(base64Data, fileName, mimeType) {
|
|||||||
link.click();
|
link.click();
|
||||||
|
|
||||||
// Usuń link z dokumentu
|
// Usuń link z dokumentu
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
window.URL.revokeObjectURL(link.href);
|
window.URL.revokeObjectURL(link.href);
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTimeSummary() {
|
function updateTimeSummary() {
|
||||||
var totalMinutes = 0;
|
var totalMinutes = 0;
|
||||||
var rows;
|
var rows;
|
||||||
@@ -622,7 +663,7 @@ function updateTimeSummary() {
|
|||||||
rows = $('#allTable tbody tr:visible');
|
rows = $('#allTable tbody tr:visible');
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.each(function() {
|
rows.each(function () {
|
||||||
var actionTimeCell = $(this).find('td').eq(17);
|
var actionTimeCell = $(this).find('td').eq(17);
|
||||||
var timeText = actionTimeCell.text().trim();
|
var timeText = actionTimeCell.text().trim();
|
||||||
|
|
||||||
@@ -645,6 +686,7 @@ function updateTimeSummary() {
|
|||||||
|
|
||||||
return formattedTime;
|
return formattedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeDate() {
|
function changeDate() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$('input.allCheck:checkbox:checked').each(function () {
|
$('input.allCheck:checkbox:checked').each(function () {
|
||||||
@@ -678,7 +720,7 @@ function changeDate() {
|
|||||||
success: function () {
|
success: function () {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function () {
|
||||||
window.alert("Aktualizacja nie powiodła się.");
|
window.alert("Aktualizacja nie powiodła się.");
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ WHERE ps.deleted = 0 ";
|
|||||||
if ($dateFrom != null && $dateTo != null) {
|
if ($dateFrom != null && $dateTo != null) {
|
||||||
$query .= " AND (
|
$query .= " AND (
|
||||||
(DATE(ps.production_date) >= '$dateFrom' AND DATE(ps.production_date) <= '$dateTo')
|
(DATE(ps.production_date) >= '$dateFrom' AND DATE(ps.production_date) <= '$dateTo')
|
||||||
OR ps.production_date IS NULL OR DATE(ps.production_date) = '0000-00-00')";
|
OR ps.production_date IS NULL OR DATE(ps.production_date) = '0000-00-00 06:00:00')";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ids != null) {
|
if ($ids != null) {
|
||||||
@@ -115,7 +115,6 @@ WHERE ps.deleted = 0 ";
|
|||||||
|
|
||||||
$query .= "GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id ";
|
$query .= "GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id ";
|
||||||
|
|
||||||
|
|
||||||
$rows = $db->query($query);
|
$rows = $db->query($query);
|
||||||
$data = array();
|
$data = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user