	// ===============================================================
	// Load Parent Information Flags
	// ===============================================================	
	function HTTP_PARENT_LOAD()
	{
	};
	

	// ===============================================================
	// EditHandler Flags
	// ===============================================================	
	
	function HTTP_LOAD(CALLBACK_FUNCTION)
	{
		// Escape if new item
		// _______________________________________________________________________
		if(JSRC_FLAG.IS_NULL_BIGINT(PROPERTY_REC_PSACTUAL_ID, 1, 1))
		{
			return;
		}
		
		
		// Initialize
		// _______________________________________________________________________
		var TARGET_MODAL = "PSACTUAL_MODAL";
		var GET_MAP_ARRAY = JSCUS_SQL._RECORD._PSACTUAL.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_PSACTUAL_ID', PROPERTY_REC_PSACTUAL_ID);
		
		
		// Sample Only
		// _______________________________________________________________________
		var SECONDARY_OPTION = function()
		{
			// GET_MAP_ARRAY = JSCUS_SQL._RECORD._SECONDARY_OPTIONH.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
			// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_SECONDARY_OPTION', PROPERTY_SECONDARY_OPTION);
		
			JSCUS_SQL._RECORD._SECONDARY_OPTION.CUS_GET_THEN_POPULATE_FORM
			(
				function(IS_SUCCESS, RESPONSE_STRING)
				{
					// Dismiss Modal
					// ...........................................
					CUS_SEND_DIALOG_TRY_DISMISS();
					
					// Abort Action, close dialog
					// ...........................................
					if(IS_SUCCESS == false)
					{
						console.error("CONNECTION ERROR: \n" + RESPONSE_STRING);
						JSOC_DIALOG.VAR_MODAL(TARGET_MODAL, false);
						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);
						JSOC_DIALOG.VAR_MODAL(TARGET_MODAL, false);
						return;
					}
					
					// JSON Empty (Run Secondary Option Here)
					// ...........................................
					if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
					{
						console.error("REQUEST ERROR: \nData not found.");
						JSOC_DIALOG.VAR_MODAL(TARGET_MODAL, false);
						return;
					}
					
					// Assign Parent ID as Foreign field drop-down
					// ...........................................
					PROPERTY_REC_PSACTUAL_ID = -1;
					JSOC_CMB.VAR_CLEAR(SECONDARY_OPTION_CMB);
					JSOC_CMB.VAR_ADD
					(
						SECONDARY_OPTION_CMB,
						JSRC_JSON.REF_READ(JSON_OBJECT, "SECONDARY_OPTION_ID", "1"), 
						JSRC_JSON.REF_READ(JSON_OBJECT, "SECONDARY_OPTION_DESCRIPTION", "1")
					);
					JSOC_CMB.VAR_SELECTED_INDEX(SECONDARY_OPTION_CMB, 0);
						
					// Make callback if given
					// ...........................................
					if(JSVC_VAR.VAR_ISSET(CALLBACK_FUNCTION))
					{
						CALLBACK_FUNCTION();
					}	
				},
				TARGET_MODAL, 
				FLAG_TINYINT_NULL, 
				PROPERTY_REC_PSACTUAL_ID			
				//, GET_MAP_ARRAY
			);
		};

		
		// Load DB data of item
		// _______________________________________________________________________
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._PSACTUAL.CUS_GET_THEN_POPULATE_FORM
		(
			function(IS_SUCCESS, RESPONSE_STRING)
			{
				// Abort Action, close dialog
				// ...........................................
				if(IS_SUCCESS == false)
				{
					CUS_SEND_DIALOG_TRY_DISMISS();
					console.error("CONNECTION ERROR: \n" + RESPONSE_STRING);
					JSOC_DIALOG.VAR_MODAL(TARGET_MODAL, false);
					return;	
				}
				
				// Validate JSON Response
				// ...........................................
				var JSON_OBJECT = JSRC_JSON.REF_CREATE(RESPONSE_STRING);
				if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
				{
					CUS_SEND_DIALOG_TRY_DISMISS();
					console.error("REQUEST ERROR: \n" + RESPONSE_STRING);
					JSOC_DIALOG.VAR_MODAL(TARGET_MODAL, false);
					return;
				}
				
				// JSON Empty (Run Secondary Option Here)
				// ...........................................
				if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
				{
					// SECONDARY_OPTION();
					throw "Unable to load data";
					return;
				}
				else
				{
					CUS_SEND_DIALOG_TRY_DISMISS();
				}
				
				/*
				JSOC_IMAGE.VAR_SRC_WITH_PROGRESS
				(
					'QR_IMAGE_IMG', 
					'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAI=', 
					JSCUS_CACHE.SERVER_URL + '/System/image/qrcode?PARAM_QRCODE=' + JSOC_ELEMENT.VAR_VALUE("REC_PSACTUAL_ID") + '&PARAM_SIZE=10', 
					JSCUS_CACHE.SERVER_URL + '/res/lib/dlg/noimage.png'
				);
				*/
				
				// Make callback if given
				// ...........................................
				if(JSVC_VAR.VAR_ISSET(CALLBACK_FUNCTION))
				{
					CALLBACK_FUNCTION();
				}
			},
			
			TARGET_MODAL, 
			FLAG_TINYINT_NULL, 
			PROPERTY_REC_PSACTUAL_ID
			//, GET_MAP_ARRAY
		);
		
		
		// Clear Changes due to loading
		// _______________________________________________________________________
		
		
	};


	// ===============================================================
	// Trims empty spaces and perform convertion for numeric fields.
	// ===============================================================
	function FIX_INPUT()
	{
	};

		
	// ===============================================================
	// Request Save
	// ===============================================================
	function HTTP_SAVE(CALLBACK_METHOD, RESUME_INDEX = 0)
	{
		// Sanitize User Inputs
		// _______________________________________________________________________
		FIX_INPUT();
	
	
		// Check Edit Status
		// _______________________________________________________________________
		if(PSACTUAL_DGV.ROW.COUNT() <= 0)
		{
			JSVC_INFO.VAR_NOTHING_TO_SAVE(function(){CALLBACK_METHOD(false);})	
			return;		
		}


		// Validate Negative [Numeric Input]
		// _______________________________________________________________________
		var CURRENT_POSTFIX = "";
		var COLUMN_INDEX = 1;
		var ROW_COUNT = PSACTUAL_DGV.ROW.COUNT();
		var ROW_INDEX = 0;
		
		while(ROW_COUNT > ROW_INDEX)
		{
			COLUMN_INDEX = 1;
			while(PSACTUAL_DGV_COLUMN_COUNTS > COLUMN_INDEX)
			{
				// Prepare Postfix of columns (branch)
				// ...........................................
				CURRENT_POSTFIX = JSVC_STR.VAR_FIX(COLUMN_INDEX.toString(), null, 2, 2, "0");
	
				// Abort if reached an unused column
				// ...........................................
				if(PSACTUAL_DGV.CELL.VALUE_NVALL("ACC_GROUP_ID_" + CURRENT_POSTFIX, ROW_INDEX) <= 0)
				{
					break;			
				}
				
				// Check if not negative
				// ...........................................
				if(PSACTUAL_DGV.CELL.VALUE_NVAL("REC_PSACTUAL_QTY_" + CURRENT_POSTFIX, ROW_INDEX) < 0)
				{
					JSOC_DIALOG.VAR_MESSAGE_BOX
					(
						'Field Quantity for branch ' + 
						JSOC_ELEMENT.VAR_INNER_HTML
						(
							PSACTUAL_DGV.COLUMN.HEADER_ELEMENT("REC_PSACTUAL_QTY_" + CURRENT_POSTFIX)
						) + 
						' cannot be negative.', 
						'Information', 'OK', 'WARNING',
						function(MESSAGE_RESPONSE)
						{
							PSACTUAL_DGV.CELL.ELEMENT("REC_PSACTUAL_QTY_" + CURRENT_POSTFIX, ROW_INDEX).style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
							PSACTUAL_DGV.CELL.ELEMENT("REC_PSACTUAL_QTY_" + CURRENT_POSTFIX, ROW_INDEX).focus();
							CALLBACK_METHOD(false);
						}
					);	
					return;			
				}
		
				// To next loop		
				// ...........................................
				COLUMN_INDEX ++;
			}					
			
			
			if
			(
				PSACTUAL_DGV.CELL.VALUE_NVALL("REC_PSACTUAL_CAT_PRODUCT_ID", ROW_INDEX) < 0
			)
			{
				JSOC_DIALOG.VAR_MESSAGE_BOX
				(
					'Field Product [' + ROW_INDEX + '] is required.', 
					'Information',
					'OK', 'WARNING',
					function(MESSAGE_RESPONSE)
					{
						CALLBACK_METHOD(false);
					}
				);	
				return;			
			}
			
			ROW_INDEX ++;
		}

		
		// Save item [Prepare]
		// _______________________________________________________________________
		var REQUEST_PARAM_BUNDLE_MAP_ARRAY = [];
		var SAVE_MAP_ARRAY = [];
		var DATE_POST_FIX = "";	
		CURRENT_POSTFIX = "";
		COLUMN_INDEX = 1;
		ROW_COUNT = PSACTUAL_DGV.ROW.COUNT();
		ROW_INDEX = RESUME_INDEX;
		
		while(ROW_COUNT > ROW_INDEX && REQUEST_PARAM_BUNDLE_MAP_ARRAY.length <= 30)
		{		
			COLUMN_INDEX = 1;
			while(PSACTUAL_DGV_COLUMN_COUNTS > COLUMN_INDEX)
			{
				// Prepare Postfix of columns (branch)
				// ...........................................
				DATE_POST_FIX = JSVC_DATE.VAR_FORMAT
				(
					PSACTUAL_DGV.CELL.VALUE_TO_DATE("REC_PSACTUAL_DATE", ROW_INDEX), "DD"
				);	
				CURRENT_POSTFIX = JSVC_STR.VAR_FIX(COLUMN_INDEX.toString(), null, 2, 2, "0");
				
				// Abort if reached an unused column
				// ...........................................				
				if(PSACTUAL_DGV.CELL.VALUE_NVALL("ACC_GROUP_ID_" + CURRENT_POSTFIX, ROW_INDEX) <= 0)
				{
					break;			
				}
				
				// Populate Data
				// ...........................................	
				SAVE_MAP_ARRAY = JSCUS_SQL._RECORD._PSACTUAL.CUS_PREPARE_MAPPED_ARRAY_FOR_SAVE();
				JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_ID", PSACTUAL_DGV.CELL.VALUE_NVALL("REC_PSACTUAL_ID_" + CURRENT_POSTFIX, ROW_INDEX));	
				JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_ACC_GROUP_ID", PSACTUAL_DGV.CELL.VALUE("ACC_GROUP_ID_" + CURRENT_POSTFIX, ROW_INDEX));
				JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D" + DATE_POST_FIX, PSACTUAL_DGV.CELL.VALUE_NVAL("REC_PSACTUAL_QTY_" + CURRENT_POSTFIX, ROW_INDEX));	
				JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_CAT_PRODUCT_ID", PSACTUAL_DGV.CELL.VALUE("REC_PSACTUAL_CAT_PRODUCT_ID", ROW_INDEX));
				JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_DATE", JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_BEGIN_OF_MONTH(PSACTUAL_DGV.CELL.VALUE_TO_DATE("REC_PSACTUAL_DATE", ROW_INDEX)), 'YYYY-MM-DD HH:mm:ss') + '.000000');	
				JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_REMARKS", '');					
				JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_STATUS", 2);

				REQUEST_PARAM_BUNDLE_MAP_ARRAY.push(SAVE_MAP_ARRAY);
				
				
				// To next loop		
				// ...........................................
				COLUMN_INDEX ++;
			}					
	
			ROW_INDEX ++;
		}
		
		
		// Declare Post Request Handler
		// _______________________________________________________________________
		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
			// ...........................................
			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;
			}
				
			// Update Changes to DataGridView
			// ...........................................
			var JSON_COUNT = JSRC_JSON.REF_READ_NVALL(JSON_OBJECT, "JSON_COUNT");
			var CURRENT_CAT_PRODUCT_ID = 0;
			var CURRENT_ACC_GROUP_ID = 0;
				
			var CURRENT_COL_INDEX = 1;
			var CURRENT_COL_IS_FOUND = false;
			var CURRENT_COL_POSTFIX = "";
			var CURRENT_ROW_INDEX = 0;
					
			while(JSON_COUNT > 0)
			{
				// Locate Column
				CURRENT_COL_IS_FOUND = false;
				CURRENT_COL_INDEX = 1;
				while(PSACTUAL_DGV_COLUMN_COUNTS > CURRENT_COL_INDEX)
				{
					// Initialize Loop
					CURRENT_ACC_GROUP_ID = JSRC_JSON.REF_READ(JSON_OBJECT, "ACC_GROUP_ID", JSON_COUNT);
					CURRENT_COL_POSTFIX = JSVC_STR.VAR_FIX(CURRENT_COL_INDEX.toString(), null, 2, 2, "0");
						
					// Abort if reached an unused column		
					if(PSACTUAL_DGV.CELL.VALUE_NVALL("ACC_GROUP_ID_" + CURRENT_COL_POSTFIX, 0) <= 0)
					{
						break;			
					}
				
					// Check if group is matched with the save result
					if(PSACTUAL_DGV.CELL.VALUE_NVALL("ACC_GROUP_ID_" + CURRENT_COL_POSTFIX, 0) == CURRENT_ACC_GROUP_ID)
					{
						CURRENT_COL_NAME = "ACC_GROUP_ID_" + CURRENT_COL_POSTFIX;
						break;
					}
						
					CURRENT_COL_INDEX ++;
				}
				
				// Abort if unable to locate the saved column
				if(CURRENT_COL_IS_FOUND == false)
				{
					JSON_COUNT --;
					continue;
				}
							
				// Locate Row
				CURRENT_CAT_PRODUCT_ID = JSRC_JSON.REF_READ(JSON_OBJECT, "CAT_PRODUCT_ID", JSON_COUNT);
				CURRENT_ROW_INDEX = PSACTUAL_DGV.COLUMN.FIND("REC_PSACTUAL_CAT_PRODUCT_ID", CURRENT_CAT_PRODUCT_ID);			
				if(CURRENT_ROW_INDEX >= 0)
				{
					PSACTUAL_DGV.CELL.VALUE
					(
						"REC_PSACTUAL_ID_" + CURRENT_COL_POSTFIX, CURRENT_ROW_INDEX, 
						JSRC_JSON.REF_READ(JSON_OBJECT, "INSERTED_ID", JSON_COUNT)
					);
				}
						
				// To next loop
				JSON_COUNT --;
			}


			// Loop unfinished save
			// ...........................................
			if(ROW_COUNT > ROW_INDEX)
			{
				HTTP_SAVE(CALLBACK_METHOD, RESUME_INDEX);
				return;
			}
				
			// Lift edit and Exit EditMode
			// ...........................................
			EDIT_HANDLER.REF_IS_MODIFIED = false;
			EDIT_HANDLER.HAS_NEWLY_SAVED_DATA = true;			
			CUS_SEND_DIALOG_TRY_DISMISS();
			CALLBACK_METHOD(true);											
		
		};
			
			
		// Save Item [Send Request]
		// _______________________________________________________________________
		RESUME_INDEX = ROW_INDEX;
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._PSACTUAL.CUS_SAVE 
		(
			REQUEST_PARAM_BUNDLE_MAP_ARRAY,
			RESPONSE_HANDLER
		);
		
	};