prodSerialNumbersMapObj.prototype.checkOutConfirm = function(serialNumber, recordID) {
var tmpObj = this;
let formMsg=`Are you sure you want to check out item ${serialNumber} ?`;
formMsg+='\nPlease note the serialized products get checked out from the same job site they got checked in.';
let title = 'Confirm';
let button1 = 'Yes';
let button2 = 'No';
let modal = $(makeModal(formMsg, title,[button1, button2], 'lg'));
modal.appendTo('body').modal('show');
modal.on('hidden.bs.modal', function(){
destroyModal(`#modal-${title}Main`,'body',false);
});
$(`#btn${button1}`).on('click', function() {
destroyModal(`#modal-${title}Main`,'body',false);
tmpObj.checkOutSerializedProd(serialNumber, recordID);
});
};
prodSerialNumbersMapObj.prototype.removeItem = function(recordID) {
var confirm = window.confirm("Are you sure you want to remove this item?");
if (confirm) {
var moduleHttp = ajaxObj();
moduleHttp.onreadystatechange=function(){
if(moduleHttp.readyState===4){
displayAlert("The item has been removed.", "", "modAE");
upc(2572);
}
}
ajaxPost(
moduleHttp,
this.apiPath,
"function=toggleActiveStatusByID&recordID=" + recordID + "&pmpmID=" + this.primaryPmpmAddEditID,
true,
1,
null,
false
);
}
};
prodSerialNumbersMapObj.prototype.checkOutSerializedProd = function(serialNumber, recordID) {
/* Update check in check out log, update company_inventory_map and update product_serial_number_map
We are going to update all these on the PHP side */
var moduleHttp = ajaxObj();
param = "function=checkOutSerializedProd" + "&recordID=" + recordID + "&serialNumber=" + serialNumber;
moduleHttp.onreadystatechange=function(){
if(moduleHttp.readyState===4){
var jsonResponse = JSON.parse(moduleHttp.responseText);
if(jsonResponse){
if (jsonResponse.error == "0") {
Fatal error: Uncaught TypeError: sort(): Argument #1 ($array) must be of type array, null given in /home/levisserver1/public_html/liv/prism-live-sites.levisrm.com/PRISM-Code/public/customModules/productSerialNumbersMap/productSerialNumbersMapJS.php:61
Stack trace:
#0 /home/levisserver1/public_html/liv/prism-live-sites.levisrm.com/PRISM-Code/public/customModules/productSerialNumbersMap/productSerialNumbersMapJS.php(61): sort(NULL)
#1 /home/levisserver1/public_html/liv/prism-live-sites.levisrm.com/PRISM-Code/cmsAPI/module/module.php(306): include('/home/levisserv...')
#2 /home/levisserver1/public_html/liv/prism-live-sites.levisrm.com/PRISM-Code/cmsAPI/pages/pageModuleBuild.php(61): Prism\module\module->setModuleScript(Array)
#3 /home/levisserver1/public_html/liv/prism-live-sites.levisrm.com/PRISM-Code/cmsAPI/pages/pages.php(884): include('/home/levisserv...')
#4 /home/levisserver1/public_html/liv/prism-live-sites.levisrm.com/PRISM-Code/index.php(95): Prism\pages\pages->getPage(2545)
#5 {main}
thrown in /home/levisserver1/public_html/liv/prism-live-sites.levisrm.com/PRISM-Code/public/customModules/productSerialNumbersMap/productSerialNumbersMapJS.php on line 61