// NOTE: [This JS must loaded as last item]


	// ===============================================================
	// Initialize Form
	// ===============================================================
	function FORM_LOAD()
	{
		// Initialize
		// _______________________________________________________________________	
		var DGV_ELEMENT_CHILD = null;
		var DGV_ELEMENT_CHILD_INDEX = 0;
		
		
		// Load DataGridVuew
		// _______________________________________________________________________	
		INVENTORY_DGV = DataGridView("INVENTORY_DGV");
		//INVENTORY_DGV.SETTING_ALLOW_USER_TO_ADD_ROWS = true;
		//INVENTORY_DGV.SETTING_EDITABLE = true;
		// INVENTORY_DGV.ON_CLICK
		// (			
		// 	function(COL_INDEX, ROW_INDEX)
		// 	{
		// 		// Delete Button
		// 		// ...........................................
		// 		if(INVENTORY_DGV.COLUMN.NAME(COL_INDEX) == "DELETE_CMD")
		// 		{
		// 			// Delete Unsaved Item
		// 			if
		// 			(
		// 				INVENTORY_DGV.COLUMN.IS_EXISTS("REC_INVENTORY_ID") &&
		// 				JSVC_NUM.VAR_NVALL(INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_ID", ROW_INDEX)) <= 0
		// 			)
		// 			{
		// 				INVENTORY_DGV.ROW.REMOVE_AT(ROW_INDEX);
		// 			}
					
		// 			// Delete Saved Item
		// 			else
		// 			{
		// 				HTTP_DELETE
		// 				(
		// 					function(IS_SUCCESS)
		// 					{
		// 						console.log('Record Deleted.');
		// 					}, 
		// 					ROW_INDEX
		// 				);				
		// 			}
		// 		}			

		// 		// Void Button
		// 		// ...........................................
		// 		else if(INVENTORY_DGV.COLUMN.NAME(COL_INDEX) == "VOID_CMD")
		// 		{
		// 			// Delete Unsaved Item
		// 			if
		// 			(
		// 				INVENTORY_DGV.COLUMN.IS_EXISTS("REC_INVENTORY_ID") &&
		// 				JSVC_NUM.VAR_NVALL(INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_ID", ROW_INDEX)) <= 0
		// 			)
		// 			{
		// 				INVENTORY_DGV.ROW.REMOVE_AT(ROW_INDEX);
		// 			}
					
		// 			// Void Saved Item
		// 			else
		// 			{

		// 			}
		// 		}	
				
		// 		// Link to Child Table
		// 		// ...........................................
				
		// 		// Sample Child Code
		// 		else if(INVENTORY_DGV.COLUMN.NAME(COL_INDEX) == "CHILD_CMD")
		// 		{
		// 			// Get Current Root path
		// 			var CURRENT_ROOT_PATH = JSCUS_CACHE.ROOT_PATH + JSVC_STR.VAR_MID(JSVC_STR.VAR_DLEFT(JSCUS_CACHE.AUTH_REDIRECT_URL[JSCUS_CACHE.LOGIN_CLASS], JSCUS_CACHE.SERVER_URL.length), 1, 1);
			
		// 			// Cache Primary Key
		// 			JSVC_COOKIE.VAR_ADD
		// 			(
		// 				'PROPERTY_PARENT_ID', 
		// 				INVENTORY_DGV.CELL.VALUE('REC_INVENTORY_ID', ROW_INDEX), 
		// 				5, 
		// 				CURRENT_ROOT_PATH
		// 			);
		// 			JSVC_COOKIE.VAR_ADD
		// 			(
		// 				'PROPERTY_PARENT_DESCRIPTION', 
		// 				INVENTORY_DGV.CELL.VALUE('REC_INVENTORY_ID', ROW_INDEX), 
		// 				5, 
		// 				CURRENT_ROOT_PATH
		// 			);
					
		// 			// Open EditPage
		// 			window.location = JSCUS_CACHE.SERVER_URL + '/p/record/inventory.html';	
		// 			return;
		// 		}
				
						
	
		// 		// If dialog supported
		// 		// ...........................................
		// 		else if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_MODAL") == true)
		// 		{
		// 			// Clear Modal
		// 			if(JSVC_VAR.VAR_ISSET(INPUT_INSTANCE))
		// 			{
		// 				JSOC_WINDOW.VAR_INPUT_INSTANCE_RESTORE(INPUT_INSTANCE);
		// 			}
						
		// 			// Display Modal
		// 			PROPERTY_REC_INVENTORY_ID = INVENTORY_DGV.CELL.VALUE('REC_INVENTORY_ID', ROW_INDEX);
		// 			PROPERTY_EDIT_ROW_INDEX = ROW_INDEX;
					
		// 			PROPERTY_REC_INVENTORY_ACC_GROUP_ID = INVENTORY_DGV.CELL.VALUE('REC_INVENTORY_ACC_GROUP_ID', ROW_INDEX);
		// 			LOAD_MODAL_SPECIFIC_STORAGELOCATION();

		// 			EDIT_HANDLER.REF_IS_MODIFIED = false;
		// 			JSOC_DIALOG.VAR_MODAL("INVENTORY_MODAL", true);
		// 			HTTP_LOAD();
		// 			return;
		// 		}
				
		// 		// Open View / Edit Page
		// 		// ...........................................
		// 		else if(INVENTORY_DGV.SETTING_EDITABLE == false)
		// 		{
		// 			// Get Current Root path
		// 			var CURRENT_ROOT_PATH = JSCUS_CACHE.ROOT_PATH + JSVC_STR.VAR_MID(JSVC_STR.VAR_DLEFT(JSCUS_CACHE.AUTH_REDIRECT_URL[JSCUS_CACHE.LOGIN_CLASS], JSCUS_CACHE.SERVER_URL.length), 1, 1);

					
							
		// 			// Cache Primary Key
		// 			JSVC_COOKIE.VAR_ADD
		// 			(
		// 				'PROPERTY_PARENT_ID', 
		// 				INVENTORY_DGV.CELL.VALUE('REC_INVENTORY_ID', ROW_INDEX), 
		// 				5, 
		// 				CURRENT_ROOT_PATH
		// 			);
		// 			JSVC_COOKIE.VAR_ADD
		// 			(
		// 				'PROPERTY_PARENT_DESCRIPTION', 
		// 				INVENTORY_DGV.CELL.VALUE('REC_INVENTORY_ID', ROW_INDEX), 
		// 				5, 
		// 				CURRENT_ROOT_PATH
		// 			);
					
		// 			// Open EditPage
		// 			window.location = 'inventory_info.html';				
		// 		}

		// 	}
		// );   

		
		// Show Progress
		// _______________________________________________________________________	
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		
		
		// Requires Authentication
		// _______________________________________________________________________	
		PAGE_AUTH_REQUIRES_LOGIN(HTTP_POPULATE_RESULT);			


		
		
		// Foreign Key [Fixed]
		// _______________________________________________________________________	
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REC_INVENTORY_ACC_GROUP_ID_CMB") == true)
		// {
		// 	// Set Default Item, if used in DataGridView
		// 	JSOC_CMB.VAR_ADD("REC_INVENTORY_ACC_GROUP_ID_CMB", FLAG_BIGINT_NULL.toString(), "-");
		// 	// To use custom populate
		// 	// var GET_MAP_ARRAY = JSCUS_SQL._ACCOUNT._GROUP.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		// 	// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_', JSCUS_SQL._SYSTEM._STATUS.STATUS_ACTIVE);	
		// 	JSCUS_SQL._ACCOUNT._GROUP.CUS_GET_THEN_POPULATE_COMBOBOX
		// 	(
		// 		function()
		// 		{
		// 			// Set Default index
		// 			JSOC_CMB.VAR_SELECTED_INDEX("REC_INVENTORY_ACC_GROUP_ID_CMB", 0);
					
		// 			// Clone to DGV Cell if ComboBox Exists
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_DGV_ROW_REC_INVENTORY_ACC_GROUP_ID") == true)
		// 			{
		// 				DGV_ELEMENT_CHILD = JSOC_ELEMENT.VAR_SUB_ELEMENTS("INVENTORY_DGV_ROW_REC_INVENTORY_ACC_GROUP_ID");
		// 				DGV_ELEMENT_CHILD_INDEX = 0;
		// 				while(DGV_ELEMENT_CHILD.length > DGV_ELEMENT_CHILD_INDEX)
		// 				{
		// 					if
		// 					(
		// 						DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX].tagName == "SELECT" &&
		// 						JSVC_STR.VAR_IS_BLANK(DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX].id.toString())
		// 					)
		// 					{
		// 						JSOC_ELEMENT.VAR_INNER_HTML
		// 						(
		// 							DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX], 
		// 							JSOC_ELEMENT.VAR_INNER_HTML("REC_INVENTORY_ACC_GROUP_ID_CMB")
		// 						);
		// 					}	
		// 					DGV_ELEMENT_CHILD_INDEX ++;
		// 				}
		// 			}
					
		// 			// Copy items to edit control
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB") == true)
		// 			{
		// 				JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB");
		// 				JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Branch");
		// 				JSOC_ELEMENT.VAR_INNER_HTML("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB", JSOC_ELEMENT.VAR_INNER_HTML("REC_INVENTORY_ACC_GROUP_ID_CMB"), true);
		// 				JSOC_CMB.VAR_SELECTED_INDEX("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB", 0);
		// 				$('.BSSP_SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB').selectpicker('refresh');
		// 			}				
					
		// 			// Update Modal Settings
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_MODAL") == true)
		// 			{
		// 				INPUT_INSTANCE = JSOC_WINDOW.VAR_INPUT_INSTANCE_CLONE("INVENTORY_MODAL");
		// 			}
					
		// 			// Forward populate complete event.
		// 			$('.BSSP_REC_INVENTORY_ACC_GROUP_ID_CMB').selectpicker('refresh');
		// 			HTTP_POPULATE_RESULT();		
		// 		},
		// 		"REC_INVENTORY_ACC_GROUP_ID_CMB",
		// 		true, 2
		// 		// , GET_MAP_ARRAY 
		// 	);
		// }
		// if
		// (
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB") == true &&
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REC_INVENTORY_ACC_GROUP_ID_CMB") == false
		// )
		// {
		// 	JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB");
		// 	JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Branch");
		// 	// To use custom populate
		// 	// var GET_MAP_ARRAY = JSCUS_SQL._ACCOUNT._GROUP.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		// 	// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_', JSCUS_SQL._SYSTEM._STATUS.STATUS_ACTIVE);	
		// 	JSCUS_SQL._ACCOUNT._GROUP.CUS_GET_THEN_POPULATE_COMBOBOX
		// 	(
		// 		function()
		// 		{
		// 			// Set Default index
		// 			JSOC_CMB.VAR_SELECTED_INDEX("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB", 0);
					
		// 			// Forward populate complete event.		
		// 			$('.BSSP_SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB').selectpicker('refresh');
		// 			HTTP_POPULATE_RESULT();
		// 		},		
		// 		"SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB",
		// 		true, 2
		// 		// , GET_MAP_ARRAY 
		// 	);
		// }
		
		// Foreign Key [Fixed]
		// _______________________________________________________________________	
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REC_INVENTORY_CAT_PRODUCT_ID_CMB") == true)
		// {
		// 	// Set Default Item, if used in DataGridView
		// 	JSOC_CMB.VAR_ADD("REC_INVENTORY_CAT_PRODUCT_ID_CMB", FLAG_BIGINT_NULL.toString(), "-");
		// 	// To use custom populate
		// 	// var GET_MAP_ARRAY = JSCUS_SQL._CATEGORY._PRODUCT.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		// 	// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_', JSCUS_SQL._SYSTEM._STATUS.STATUS_ACTIVE);	
		// 	JSCUS_SQL._CATEGORY._PRODUCT.CUS_GET_THEN_POPULATE_COMBOBOX
		// 	(
		// 		function()
		// 		{
		// 			// Set Default index
		// 			JSOC_CMB.VAR_SELECTED_INDEX("REC_INVENTORY_CAT_PRODUCT_ID_CMB", 0);
					
		// 			// Clone to DGV Cell if ComboBox Exists
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_DGV_ROW_REC_INVENTORY_CAT_PRODUCT_ID") == true)
		// 			{
		// 				DGV_ELEMENT_CHILD = JSOC_ELEMENT.VAR_SUB_ELEMENTS("INVENTORY_DGV_ROW_REC_INVENTORY_CAT_PRODUCT_ID");
		// 				DGV_ELEMENT_CHILD_INDEX = 0;
		// 				while(DGV_ELEMENT_CHILD.length > DGV_ELEMENT_CHILD_INDEX)
		// 				{
		// 					if
		// 					(
		// 						DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX].tagName == "SELECT" &&
		// 						JSVC_STR.VAR_IS_BLANK(DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX].id.toString())
		// 					)
		// 					{
		// 						JSOC_ELEMENT.VAR_INNER_HTML
		// 						(
		// 							DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX], 
		// 							JSOC_ELEMENT.VAR_INNER_HTML("REC_INVENTORY_CAT_PRODUCT_ID_CMB")
		// 						);
		// 					}	
		// 					DGV_ELEMENT_CHILD_INDEX ++;
		// 				}
		// 			}
					
		// 			// Copy items to edit control
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB") == true)
		// 			{
		// 				JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB");
		// 				JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Product");
		// 				JSOC_ELEMENT.VAR_INNER_HTML("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB", JSOC_ELEMENT.VAR_INNER_HTML("REC_INVENTORY_CAT_PRODUCT_ID_CMB"), true);
		// 				JSOC_CMB.VAR_SELECTED_INDEX("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB", 0);
		// 				$('.BSSP_SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB').selectpicker('refresh');
		// 			}				
					
		// 			// Update Modal Settings
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_MODAL") == true)
		// 			{
		// 				INPUT_INSTANCE = JSOC_WINDOW.VAR_INPUT_INSTANCE_CLONE("INVENTORY_MODAL");
		// 			}
					
		// 			// Forward populate complete event.
		// 			$('.BSSP_REC_INVENTORY_CAT_PRODUCT_ID_CMB').selectpicker('refresh');
		// 			HTTP_POPULATE_RESULT();		
		// 		},
		// 		"REC_INVENTORY_CAT_PRODUCT_ID_CMB",
		// 		true, 2
		// 		// , GET_MAP_ARRAY 
		// 	);
		// }
		// if
		// (
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB") == true &&
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REC_INVENTORY_CAT_PRODUCT_ID_CMB") == false
		// )
		// {
		// 	JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB");
		// 	JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Product");
		// 	// To use custom populate
		// 	// var GET_MAP_ARRAY = JSCUS_SQL._CATEGORY._PRODUCT.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		// 	// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_', JSCUS_SQL._SYSTEM._STATUS.STATUS_ACTIVE);	
		// 	JSCUS_SQL._CATEGORY._PRODUCT.CUS_GET_THEN_POPULATE_COMBOBOX
		// 	(
		// 		function()
		// 		{
		// 			// Set Default index
		// 			JSOC_CMB.VAR_SELECTED_INDEX("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB", 0);
					
		// 			// Forward populate complete event.		
		// 			$('.BSSP_SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB').selectpicker('refresh');
		// 			HTTP_POPULATE_RESULT();
		// 		},		
		// 		"SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB",
		// 		true, 2
		// 		// , GET_MAP_ARRAY 
		// 	);
		// }
		
		// Foreign Key [Fixed]
		// _______________________________________________________________________	
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REC_INVENTORY_CAT_STORAGE_ID_CMB") == true)
		// {
		// 	// Set Default Item, if used in DataGridView
		// 	JSOC_CMB.VAR_ADD("REC_INVENTORY_CAT_STORAGE_ID_CMB", FLAG_BIGINT_NULL.toString(), "-");
		// 	// To use custom populate
		// 	// var GET_MAP_ARRAY = JSCUS_SQL._CATEGORY._STORAGE.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		// 	// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_', JSCUS_SQL._SYSTEM._STATUS.STATUS_ACTIVE);	
		// 	JSCUS_SQL._CATEGORY._STORAGE.CUS_GET_THEN_POPULATE_COMBOBOX
		// 	(
		// 		function()
		// 		{
		// 			// Set Default index
		// 			JSOC_CMB.VAR_SELECTED_INDEX("REC_INVENTORY_CAT_STORAGE_ID_CMB", 0);
					
		// 			// Clone to DGV Cell if ComboBox Exists
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_DGV_ROW_REC_INVENTORY_CAT_STORAGE_ID") == true)
		// 			{
		// 				DGV_ELEMENT_CHILD = JSOC_ELEMENT.VAR_SUB_ELEMENTS("INVENTORY_DGV_ROW_REC_INVENTORY_CAT_STORAGE_ID");
		// 				DGV_ELEMENT_CHILD_INDEX = 0;
		// 				while(DGV_ELEMENT_CHILD.length > DGV_ELEMENT_CHILD_INDEX)
		// 				{
		// 					if
		// 					(
		// 						DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX].tagName == "SELECT" &&
		// 						JSVC_STR.VAR_IS_BLANK(DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX].id.toString())
		// 					)
		// 					{
		// 						JSOC_ELEMENT.VAR_INNER_HTML
		// 						(
		// 							DGV_ELEMENT_CHILD[DGV_ELEMENT_CHILD_INDEX], 
		// 							JSOC_ELEMENT.VAR_INNER_HTML("REC_INVENTORY_CAT_STORAGE_ID_CMB")
		// 						);
		// 					}	
		// 					DGV_ELEMENT_CHILD_INDEX ++;
		// 				}
		// 			}
					
		// 			// Copy items to edit control
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB") == true)
		// 			{
		// 				JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB");
		// 				JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Storage");
		// 				JSOC_ELEMENT.VAR_INNER_HTML("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB", JSOC_ELEMENT.VAR_INNER_HTML("REC_INVENTORY_CAT_STORAGE_ID_CMB"), true);
		// 				JSOC_CMB.VAR_SELECTED_INDEX("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB", 0);
		// 				$('.BSSP_SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB').selectpicker('refresh');
		// 			}				
					
		// 			// Update Modal Settings
		// 			if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_MODAL") == true)
		// 			{
		// 				INPUT_INSTANCE = JSOC_WINDOW.VAR_INPUT_INSTANCE_CLONE("INVENTORY_MODAL");
		// 			}
					
		// 			// Forward populate complete event.
		// 			$('.BSSP_REC_INVENTORY_CAT_STORAGE_ID_CMB').selectpicker('refresh');
		// 			HTTP_POPULATE_RESULT();		
		// 		},
		// 		"REC_INVENTORY_CAT_STORAGE_ID_CMB",
		// 		true, 2
		// 		// , GET_MAP_ARRAY 
		// 	);
		// }
		// if
		// (
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB") == true &&
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REC_INVENTORY_CAT_STORAGE_ID_CMB") == false
		// )
		// {
		// 	JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB");
		// 	JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Storage");
		// 	// To use custom populate
		// 	// var GET_MAP_ARRAY = JSCUS_SQL._CATEGORY._STORAGE.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		// 	// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_', JSCUS_SQL._SYSTEM._STATUS.STATUS_ACTIVE);	
		// 	JSCUS_SQL._CATEGORY._STORAGE.CUS_GET_THEN_POPULATE_COMBOBOX
		// 	(
		// 		function()
		// 		{
		// 			// Set Default index
		// 			JSOC_CMB.VAR_SELECTED_INDEX("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB", 0);
					
		// 			// Forward populate complete event.		
		// 			$('.BSSP_SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB').selectpicker('refresh');
		// 			HTTP_POPULATE_RESULT();
		// 		},		
		// 		"SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB",
		// 		true, 2
		// 		// , GET_MAP_ARRAY 
		// 	);
		// }
		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB") == true)
		// {
		// 	JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB");
		// 	JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Storage");
		// }

		// Status		
		// _______________________________________________________________________	
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_STATUS_CMB") == true)
		// {
		// 	JSOC_CMB.VAR_CLEAR("SEARCH_REC_INVENTORY_STATUS_CMB");
		// 	JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_STATUS_CMB", "0","Any Status");
		// 	JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_STATUS_CMB", "1","Inactive");
		// 	JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_STATUS_CMB", "2","Active");
		// 	// JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_STATUS_CMB", "3","Closed");
		// 	// JSOC_CMB.VAR_ADD("SEARCH_REC_INVENTORY_STATUS_CMB", "4","Completed");
		// 	JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_INVENTORY_STATUS_CMB", "2");
		// }			
		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("REC_INVENTORY_STATUS_CMB") == true)
		// {
		// 	JSOC_CMB.VAR_CLEAR("REC_INVENTORY_STATUS_CMB");
		// 	JSOC_CMB.VAR_ADD("REC_INVENTORY_STATUS_CMB", "1","Inactive");
		// 	JSOC_CMB.VAR_ADD("REC_INVENTORY_STATUS_CMB", "2","Active");
		// 	// JSOC_CMB.VAR_ADD("REC_INVENTORY_STATUS_CMB", "3","Closed");
		// 	// JSOC_CMB.VAR_ADD("REC_INVENTORY_STATUS_CMB", "4","Completed");
		// 	JSOC_CMB.VAR_SELECTED_VALUE("REC_INVENTORY_STATUS_CMB", "2");
		// }
		
		
		
		// Get Modal Instance (Add Modal Adjustment before this line)
		// _______________________________________________________________________	
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("INVENTORY_MODAL") == true)
		// {
		// 	INPUT_INSTANCE = JSOC_WINDOW.VAR_INPUT_INSTANCE_CLONE("INVENTORY_MODAL");
		// }
		
		// Add Search Events for the SEARCH_DESCRIPTION_TXT - TextInput
		// _______________________________________________________________________		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_ID_TXT"))
		// {
		// 	var SEARCH_REC_INVENTORY_ID_TXT = JSOC_ELEMENT.VAR_GET("SEARCH_REC_INVENTORY_ID_TXT");
		// 	SEARCH_REC_INVENTORY_ID_TXT.onkeydown = 
		// 		function() 
		// 		{ 
		// 			return function(e) 
		// 			{
		// 				if
		// 				(
		// 					(
		// 						e.which == 13 || 
		// 						e.keyCode == 13 || 
		// 						e.key === "Enter"
		// 					) &&
		// 					JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_CMD")
		// 				)
		// 				{
		// 					HTTP_SEARCH();
		// 				}
		// 			};
		// 		}();;		
		// }
		
		
		// Load Parent Data (if Exists)
		// _______________________________________________________________________	
		HTTP_PARENT_LOAD();
		
		
		// Pre-Load Items (uncomment if no foreign key pre-fetch)
		// _______________________________________________________________________	
		if(CUS_SEND_REQUEST_HAS_QUEUE() == false)
		{
			HTTP_SEARCH();
		}
		
		
		// Disable Dialogs
		// _______________________________________________________________________	
		CUS_SEND_DIALOG_TRY_DISMISS();
	}
	
	
	// ===============================================================
	// Populate Foreign Keys
	// ===============================================================
	function HTTP_POPULATE_RESULT(IS_SUCCESS, HTTP_RESPONSE)
	{
		// Disable Dialogs
		CUS_SEND_DIALOG_TRY_DISMISS();
			
		// Handle Error
		if(IS_SUCCESS === false)
		{
			alert("Unable to populate lists.");
		}
		else
		{
			PRELOAD_POS_SHIFT
			(
				function(IS_SUCCESS, RESPONSE)
				{
					if(IS_SUCCESS)
					{
						HTTP_BRANCH_PRODUCTS();
						HTTP_SEARCH();

						if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("START_DATE_TXT")) {
							JSOC_ELEMENT.VAR_VALUE("START_DATE_TXT", JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_ADD('DAY', 0, JSVC_DATE.VAR_NOW()), "YYYY-MM-DD") + "T00:00");
						}

						if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("device_cashier")) {
							JSOC_ELEMENT.VAR_VALUE("device_cashier", JSCUS_SQL._ACCOUNT._LOGIN.ACC_ACCOUNT_FIRST_NAME + ' '+ JSCUS_SQL._ACCOUNT._LOGIN.ACC_ACCOUNT_LAST_NAME);
						}

						if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("DEVICE_ID_LBL")) {
							JSOC_ELEMENT.VAR_VALUE('DEVICE_ID_LBL', JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ID);
						}
					}
				}
			);
		}
	}

	
	// ===============================================================
	// Request Search - PART.A
	// ===============================================================
	function HTTP_SEARCH(NEW_ITEM_ID, EDITED_ROW_INDEX)
	{
		// Optional Value
		NEW_ITEM_ID = JSVC_VAR.VAR_OPTIONAL(NEW_ITEM_ID, -1);
		EDITED_ROW_INDEX = JSVC_VAR.VAR_OPTIONAL(EDITED_ROW_INDEX, -1);
		
		// Parameter Validate
		JSVC_AV.VAR_VALIDATE_ARGUMENT_TYPE(NEW_ITEM_ID, 'NEW_ITEM_ID', 'NUMERIC');
		JSVC_AV.VAR_VALIDATE_ARGUMENT_TYPE(EDITED_ROW_INDEX, 'EDITED_ROW_INDEX', 'NUMERIC');
		
		
		// Actual Function
		GET_MAP_ARRAY = JSCUS_SQL._RECORD._INVENTORY.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();	
		//  if(JSVC_VAR.VAR_ISSET("PROPERTY_PARENT_ID"))
		// {
		//	JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_PARENT_ID', PROPERTY_PARENT_ID);
		// }  // Parent ID Sample

		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_ACC_GROUP_ID', JSVC_NUM.VAR_NVAL(JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ACC_GROUP_ID));
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_STATUS', 2);

		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_FIELD', 'CAT_PRODUCT_DESCRIPTION');
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_TYPE', 'ASC');
		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB") == true)
		// {
		// 	JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_ACC_GROUP_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_INVENTORY_ACC_GROUP_ID_CMB")));
		// }
		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB") == true)
		// {
		// 	JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_CAT_PRODUCT_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_INVENTORY_CAT_PRODUCT_ID_CMB")));
		// }
		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB") == true)
		// {
		// 	JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_CAT_STORAGE_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_INVENTORY_CAT_STORAGE_ID_CMB")));
		// }
		
		// if
		// (
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_QUANTITY_FROM_TXT") == true &&
		// 	JSOC_STYLE.VAR_IS_VISIBLE('SEARCH_REC_INVENTORY_QUANTITY_FROM_TXT') == true
		// )
		// {
		// 	JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_QUANTITY_FROM', JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE("SEARCH_REC_INVENTORY_QUANTITY_FROM_TXT")));
		// }
		// if
		// (
		// 	JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_QUANTITY_TO_TXT") == true &&
		// 	JSOC_STYLE.VAR_IS_VISIBLE('SEARCH_REC_INVENTORY_QUANTITY_TO_TXT') == true
		// )
		// {
		// 	JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_QUANTITY_TO', JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE("SEARCH_REC_INVENTORY_QUANTITY_TO_TXT")));
		// }			
		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_INVENTORY_STATUS_CMB") == true)
		// {
		// 	JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_STATUS', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_INVENTORY_STATUS_CMB")));
		// }
		
		// if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_ORDER_BY_CMB") == true)
		// {
		// 	var SELECTED_VAL = JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_ORDER_BY_CMB");
		// 	if(JSVC_STR.VAR_CONTAINS_RIGHT(SELECTED_VAL, '_ASC'))
		// 	{
		// 		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_FIELD', JSVC_STR.VAR_DRIGHT(SELECTED_VAL, 4));
		// 		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_TYPE', 'ASC');		
		// 	}
		// 	else
		// 	{
		// 		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_FIELD', SELECTED_VAL);
		// 		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_TYPE', 'DESC');
		// 	}
		// }	
		
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		
		if(NEW_ITEM_ID < 0)
		{
			JSCUS_SQL._RECORD._INVENTORY.CUS_GET
			(
				GET_MAP_ARRAY,
				HTTP_SEARCH_CALLBACK,
				true
			); 		
		}
		else
		{		
			GET_MAP_ARRAY = JSCUS_SQL._RECORD._INVENTORY.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();	
			JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVENTORY_ID', NEW_ITEM_ID);
			
			JSCUS_SQL._RECORD._INVENTORY.CUS_GET
			(
				GET_MAP_ARRAY,
				function(IS_SUCCESS, RESPONSE_STRING)
				{
					// Update Existing Row
					if(EDITED_ROW_INDEX >= 0)
					{
						HTTP_SEARCH_LIMITED_ROWS_CALLBACK(IS_SUCCESS, RESPONSE_STRING, EDITED_ROW_INDEX);
					}
					
					// Add new item
					else
					{
						HTTP_SEARCH_LIMITED_ROWS_CALLBACK(IS_SUCCESS, RESPONSE_STRING, 0);
					}
				},
				true
			); 		
		}
       		
	}
	
	
	// ===============================================================
	// Request Search - PART.B
	// ===============================================================
	function HTTP_SEARCH_CALLBACK(IS_SUCCESS, RESPONSE_STRING)
	{
		// Disable Dialogs
		// _______________________________________________________________________
		CUS_SEND_DIALOG_TRY_DISMISS();
		
		// Validate
		// _______________________________________________________________________
		if(IS_SUCCESS === false)
		{
			console.error("CONNECTION ERROR: \n" + RESPONSE_STRING);
			return;
		}
		
		// Validate JSON Response
		// _______________________________________________________________________
		var JSON_OBJECT = JSRC_JSON.REF_CREATE(RESPONSE_STRING);
		if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
		{
			console.error("REQUEST ERROR: \n" + RESPONSE_STRING);
			return;
		}
		
		// JSON Empty (Clears the DataGrodView)
		// _______________________________________________________________________
		if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
		{
			INVENTORY_DGV.ROW.CLEAR();
			return;
		}

		// Populate DGV
		// _______________________________________________________________________
		// INVENTORY_DGV.POPULATE_FROM_QUERY
		// (
		// 		JSON_OBJECT, 
		// 		'',
		// 		false,
		// 		false,
		// 		1,
		// 		[2, 1]
		// );

		INVENTORY_DGV.ROW.CLEAR();

		var ROW_INDEX = 1;
		var RINDEX = INVENTORY_DGV.ROW.COUNT();

		while(JSON_OBJECT.JSON_COUNT >= ROW_INDEX)
		{
			if
			(
				PROPERTY_REC_BRANCH_PRODUCTS.includes(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_INVENTORY_CAT_PRODUCT_ID", ROW_INDEX)) == true &&
				JSVC_NUM.VAR_NVALL(JSRC_JSON.REF_READ(JSON_OBJECT, "CAT_STORAGE_IS_STORE", ROW_INDEX)) == 2
			)
			{
				INVENTORY_DGV.ROW.INSERT_AT(RINDEX);

				//INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_ID", RINDEX, ROW_INDEX);
				//INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_ACC_GROUP_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_INVENTORY_ACC_GROUP_ID", ROW_INDEX));
				//INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_ACC_GROUP_ID_DESCRIPTION", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_INVENTORY_ACC_GROUP_ID_DESCRIPTION", ROW_INDEX));
				INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_CAT_PRODUCT_ID_DESCRIPTION", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_INVENTORY_CAT_PRODUCT_ID_DESCRIPTION", ROW_INDEX));
				//INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_CAT_STORAGE_ID_DESCRIPTION", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_INVENTORY_CAT_STORAGE_ID_DESCRIPTION", ROW_INDEX));
				INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_QUANTITY", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_INVENTORY_QUANTITY", ROW_INDEX));
				//INVENTORY_DGV.CELL.VALUE("REC_INVENTORY_STATUS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_INVENTORY_STATUS", ROW_INDEX));

				RINDEX++;
			}

			ROW_INDEX++;
		}
		
		
		// For Applying CFormat
		// _______________________________________________________________________	
		INVENTORY_DGV.COLUMN.CFORMAT("REC_INVENTORY_QUANTITY");
		
		
		// Initialize
		// _______________________________________________________________________	
		var WEBTABLE_DATE = null;
		var ROW_INDEX = 0;
	
	
		// DateTime Format
		// _______________________________________________________________________	

	}
	
	
	// ===============================================================
	// Request Search - PART.C
	// ===============================================================
	function HTTP_SEARCH_LIMITED_ROWS_CALLBACK(IS_SUCCESS, RESPONSE_STRING, ROW_INDEX)
	{
		// Disable Dialogs
		// _______________________________________________________________________
		CUS_SEND_DIALOG_TRY_DISMISS();
		
		// Validate
		// _______________________________________________________________________
		if(IS_SUCCESS === false)
		{
			console.error("CONNECTION ERROR: \n" + RESPONSE_STRING);
			return;
		}
		
		// Validate JSON Response
		// _______________________________________________________________________
		var JSON_OBJECT = JSRC_JSON.REF_CREATE(RESPONSE_STRING);
		if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
		{
			console.error("REQUEST ERROR: \n" + RESPONSE_STRING);
			return;
		}
		
		// JSON Empty (Clears the DataGrodView)
		// _______________________________________________________________________
		if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
		{
			INVENTORY_DGV.ROW.CLEAR();
			return;
		}

		// Validate Row Count
		// _______________________________________________________________________	
		if(INVENTORY_DGV.ROW.COUNT() <= 0)
		{
			console.error("DataGridView has no rows to fill.");
			return;
		}
		//JSVC_AV.VAR_VALIDATE_RANGE(ROW_INDEX, "ROW_INDEX", 0, INVENTORY_DGV.ROW.COUNT() - 1);
		
		// Populate DGV
		// _______________________________________________________________________
		// INVENTORY_DGV.POPULATE_FROM_QUERY
		// (
		// 		JSON_OBJECT, 
		// 		'',
		// 		false,
		// 		false,
		// 		1,
		// 		[2, 1],
		// 		ROW_INDEX
		// );
		
		
		// For Applying CFormat
		// _______________________________________________________________________	
		//INVENTORY_DGV.COLUMN.CFORMAT("REC_INVENTORY_QUANTITY");
		
		
		// Initialize
		// _______________________________________________________________________	
		var WEBTABLE_DATE = null;
	
	
		// DateTime Format
		// _______________________________________________________________________	

	}
	
	function HTTP_BRANCH_PRODUCTS() 
	{
		// Get Branch Products
		var GET_MAP_ARRAY = JSCUS_SQL._CATEGORY._PRODUCT_BRANCH.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();

		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_CAT_PRODBRANCH_ACC_GROUP_ID', parseInt(JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ACC_GROUP_ID));
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_CAT_PRODBRANCH_STATUS', 2);

		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_FIELD', 'CAT_PRODUCT_DESCRIPTION');
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_TYPE', 'ASC');

		var RESPONSE_HANDLER =
			function(IS_SUCCESS, HTTP_RESPONSE)
				{
					// Disable Dialogs
					// ...........................................
					CUS_SEND_DIALOG_TRY_DISMISS();
					
					// Handle Error
					// ...........................................
					if(IS_SUCCESS === false)
					{
						METHOD_UNABLE_TO_SEND_REQUEST(CALLBACK_METHOD);	
						return;
					}
					
					// Catch JSON Error
					// ...........................................
					else if(JSRC_JSON.REF_IS_JSTRING(HTTP_RESPONSE) == false)
					{
						METHOD_SERVER_ISSUE(CALLBACK_METHOD, HTTP_RESPONSE);
						return;			
					}
						
					// Read Response
					// ...........................................
					else
					{
						// Load Response
						var JSON_OBJECT = JSRC_JSON.REF_CREATE(HTTP_RESPONSE);

						if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
						{
							METHOD_REQUEST_FAILURE(CALLBACK_METHOD, JSON_OBJECT);
							return;
						}
						else
						{
							var INDEX = 1;

							while(JSON_OBJECT.JSON_COUNT >= INDEX)
							{
								PROPERTY_REC_BRANCH_PRODUCTS.push(JSRC_JSON.REF_READ(JSON_OBJECT, "CAT_PRODUCT_ID", INDEX));

								INDEX++;
							}
						}
					}
				};

		JSCUS_SQL._CATEGORY._PRODUCT_BRANCH.CUS_GET
		(
			GET_MAP_ARRAY,
			RESPONSE_HANDLER,
			true
		);
	};


	function HTTP_PRINT_SUMMARY()
	{
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);

		var receipt = '';

		receipt += '<table border="0" style="width: 100%; border-collapse: collapse; font-size: 10px; margin-bottom: 0 !important;">';
			receipt += '<tr><td style="text-align: center;">'+JSCUS_CACHE.COMPANY_NAME+'</td></tr>';
			receipt += '<tr><td style="text-align: center;">'+JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ADDRESS+'</td></tr>';
			receipt += '<tr><td style="text-align: center;">'+JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_CONTACT+'</td></tr>';
			receipt += '<tr><td style="text-align: center;">VAT Reg TIN: '+JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_TIN+'</td></tr>';
		receipt += '</table>';

		receipt += '<br>';
		
		receipt += '<table border="0" style="width: 100%; border-collapse: collapse; font-size: 10px; margin-bottom: 0 !important;">';
			receipt += '<tr><td style="text-align: center;">INVENTORY SUMMARY</td></tr>';
		receipt += '</table>';

		receipt += '<hr style="border: 1px dashed black;">';

		receipt += '<table border="0" style="width: 100%; border-collapse: collapse; font-size: 10px; margin-bottom: 0 !important;">';
			receipt += '<tr><td>DATE: '+JSOC_ELEMENT.VAR_VALUE('device_datetime')+'</td></tr>';
			receipt += '<tr><td>CASHIER: '+JSCUS_SQL._ACCOUNT._LOGIN.ACC_ACCOUNT_NAME+'</td></tr>';
			receipt += '<tr><td>TERMINAL ID: '+JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_MACHINE_ID+'</td></tr>';
		receipt += '</table>';

		receipt += '<hr style="border: 1px dashed black;">';

		receipt += '<br>';

		receipt += '<table border="0" style="width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 0 !important;">';
			receipt += '<tr>';
				receipt += '<th style="width: 80%; text-align: left;">Product</th>';
				receipt += '<th style="width: 20%; text-align: right;">QTY</th>';
			receipt += '</tr>';
		receipt += '</table>';

		receipt += '<hr style="border: 1px dashed black;">';

		receipt += '<table border="0" style="width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 0 !important;">';
			receipt += $('#INVENTORY_DGV tbody').html();
		receipt += '</table>';

		receipt += '<hr style="border: 1px dashed black;">';

		JSOC_DIALOG.VAR_LOADING_SPINNER(false);

		Android.CALL('PRINT', '<html><body>' + receipt + '</body></html>');
	}

				
	// ===============================================================
	// Begin Processing the Page
	// ===============================================================
	FORM_INITIALIZE();
	FORM_LOAD();