	// ===============================================================
	// 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()
	{
		// Fix String Fields
		// ...........................................
		
		
		// Fix Numeric Fields (if field type is not number.)
		// ...........................................
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D01_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D01_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D01_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D02_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D02_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D02_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D03_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D03_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D03_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D04_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D04_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D04_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D05_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D05_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D05_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D06_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D06_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D06_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D07_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D07_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D07_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D08_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D08_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D08_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D09_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D09_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D09_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D10_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D10_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D10_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D11_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D11_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D11_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D12_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D12_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D12_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D13_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D13_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D13_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D14_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D14_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D14_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D15_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D15_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D15_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D16_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D16_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D16_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D17_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D17_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D17_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D18_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D18_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D18_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D19_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D19_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D19_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D20_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D20_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D20_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D21_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D21_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D21_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D22_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D22_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D22_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D23_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D23_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D23_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D24_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D24_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D24_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D25_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D25_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D25_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D26_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D26_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D26_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D27_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D27_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D27_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D28_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D28_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D28_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D29_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D29_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D29_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D30_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D30_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D30_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_D31_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D31_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_D31_TXT);
			}			
			if(JSOC_ELEMENT.VAR_TYPE_IS(REC_PSACTUAL_QTY_TOTAL_TXT, 'input', 'number'))
			{
				JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_TOTAL_TXT);
			}
			else
			{
				JSOC_INPUT_TEXT.CTL_CFORMAT(REC_PSACTUAL_QTY_TOTAL_TXT);
			}			


		// Fix Password Fields
		// ...........................................
	};

		
	// ===============================================================
	// Request Save
	// ===============================================================
	function HTTP_SAVE(CALLBACK_METHOD)
	{

		// Sanitize User Inputs
		// _______________________________________________________________________
		FIX_INPUT();
	
	
		// Check Edit Status
		// _______________________________________________________________________
		if(EDIT_HANDLER.REF_IS_MODIFIED == false)
		{
			JSVC_INFO.VAR_NOTHING_TO_SAVE(function(){CALLBACK_METHOD(false);})	
			return;		
		}


		// Validate Null [String Input]
		// _______________________________________________________________________
		
		
		// Validate Zero [Numeric Input]
		// _______________________________________________________________________
	
	
		// Validate Negative [Numeric Input]
		// _______________________________________________________________________
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D01_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 1 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D01_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D01_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D02_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 2 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D02_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D02_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D03_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 3 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D03_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D03_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D04_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 4 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D04_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D04_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D05_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 5 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D05_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D05_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D06_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 6 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D06_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D06_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D07_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 7 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D07_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D07_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D08_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 8 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D08_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D08_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D09_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 9 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D09_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D09_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D10_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 10 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D10_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D10_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D11_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 11 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D11_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D11_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D12_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 12 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D12_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D12_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D13_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 13 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D13_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D13_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D14_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 14 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D14_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D14_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D15_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 15 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D15_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D15_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D16_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 16 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D16_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D16_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D17_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 17 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D17_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D17_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D18_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 18 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D18_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D18_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D19_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 19 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D19_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D19_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D20_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 20 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D20_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D20_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D21_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 21 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D21_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D21_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D22_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 22 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D22_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D22_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D23_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 23 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D23_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D23_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D24_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 24 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D24_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D24_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D25_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 25 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D25_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D25_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D26_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 26 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D26_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D26_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D27_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 27 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D27_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D27_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D28_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 28 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D28_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D28_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D29_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 29 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D29_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D29_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D30_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 30 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D30_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D30_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_D31_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Quantity Day 31 cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_D31_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_D31_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(REC_PSACTUAL_QTY_TOTAL_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Total Quantity cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_QTY_TOTAL_TXT.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_QTY_TOTAL_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		
		
		// Validate Range [Numeric Input]
		// _______________________________________________________________________	


		// Foreign key check
		// _______________________________________________________________________
		if
		(
			JSVC_VAR.VAR_ISSET(REC_PSACTUAL_ACC_GROUP_ID_CMB) &&
			(
				JSOC_CMB.VAR_SELECTED_INDEX(REC_PSACTUAL_ACC_GROUP_ID_CMB) < 0 ||
				JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(REC_PSACTUAL_ACC_GROUP_ID_CMB)) < 0
			)
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Branch is required.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_ACC_GROUP_ID_CMB.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_ACC_GROUP_ID_CMB.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if
		(
			JSVC_VAR.VAR_ISSET(REC_PSACTUAL_CAT_PRODUCT_ID_CMB) &&
			(
				JSOC_CMB.VAR_SELECTED_INDEX(REC_PSACTUAL_CAT_PRODUCT_ID_CMB) < 0 ||
				JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(REC_PSACTUAL_CAT_PRODUCT_ID_CMB)) < 0
			)
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Product is required.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					REC_PSACTUAL_CAT_PRODUCT_ID_CMB.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					REC_PSACTUAL_CAT_PRODUCT_ID_CMB.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		

		// Validate Duplicates
		// _______________________________________________________________________
		var EXCEPTION_ROW_INDEX = -1;
		if(PROPERTY_REC_PSACTUAL_ID >= 0)
		{
			EXCEPTION_ROW_INDEX = PROPERTY_EDIT_ROW_INDEX;
		}
			

		
		
		// Password Items (if available)
		// _______________________________________________________________________
		
		
		// CheckBox Items (if available)
		// _______________________________________________________________________

	
		// File is required
		// _______________________________________________________________________
		if
		(
			JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PARAM_REC_PSACTUAL_ID_FILE_FP") &&
			PARAM_REC_PSACTUAL_ID_FILE_FP.files.length <= 0
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				JSVC_ERROR.VAR_ARGUMENT_EXCEPTION_MISSING_INPUT("Upload File", false), 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					PARAM_REC_PSACTUAL_ID_FILE_FP.style.borderColor = JSCUS_CACHE.SITE_ON_ERROR_BORDER_COLOR;
					CALLBACK_METHOD(false);
				}
			);		
			return;	
		}
		
	
		// File is too large (Sample Code : 3mb)
		// _______________________________________________________________________
		if
		(
			JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PARAM_REC_PSACTUAL_ID_FILE_FP") &&
			PARAM_REC_PSACTUAL_ID_FILE_FP.files[0].size > 1024 * 1024 * 3
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Selected file is too large. File size is restricted to 3mb or below',
				'Information',
				'OK', 'ERROR',
				function()
				{
					CALLBACK_METHOD(false);
				}
			);	
		   PARAM_REC_PSACTUAL_ID_FILE_FP.value = "";
		   return;
		};
		
		 

		
		// Save item [Prepare]
		// _______________________________________________________________________
		var SAVE_MAP_ARRAY = JSCUS_SQL._RECORD._PSACTUAL.CUS_PREPARE_MAPPED_ARRAY_FOR_SAVE();
		// 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_PARENT_ID', INPUT_FILE_ELEMENT_FP);		// File Upload Sample
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_ID", PROPERTY_REC_PSACTUAL_ID);				
		
			
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_ACC_GROUP_ID", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(REC_PSACTUAL_ACC_GROUP_ID_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_CAT_PRODUCT_ID", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(REC_PSACTUAL_CAT_PRODUCT_ID_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D01", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D01_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D02", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D02_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D03", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D03_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D04", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D04_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D05", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D05_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D06", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D06_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D07", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D07_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D08", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D08_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D09", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D09_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D10", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D10_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D11", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D11_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D12", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D12_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D13", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D13_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D14", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D14_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D15", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D15_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D16", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D16_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D17", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D17_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D18", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D18_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D19", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D19_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D20", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D20_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D21", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D21_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D22", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D22_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D23", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D23_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D24", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D24_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D25", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D25_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D26", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D26_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D27", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D27_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D28", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D28_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D29", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D29_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D30", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D30_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_D31", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_D31_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_QTY_TOTAL", JSVC_NUM.VAR_NVAL(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_QTY_TOTAL_TXT)));	
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_DATE", JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_END_OF_DAY(JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_DATE_DTP)), "YYYY-MM-DD HH:mm:ss") + '.999999');
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_REMARKS", JSOC_ELEMENT.VAR_VALUE(REC_PSACTUAL_REMARKS_TXT));					
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_STATUS", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(REC_PSACTUAL_STATUS_CMB)));
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("PARAM_REC_PSACTUAL_ID_FILE_FP"))
		{
			JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_PSACTUAL_ID_FILE", PARAM_REC_PSACTUAL_ID_FILE_FP);
		}
		
		
		// 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
				// ...........................................
				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;
					}
					
			
					// Post Save Action
					else
					{				
						// Update Changes to DataGridView
						if(PROPERTY_REC_PSACTUAL_ID > 0)
						{
							HTTP_SEARCH(PROPERTY_REC_PSACTUAL_ID, PROPERTY_EDIT_ROW_INDEX);
						}
						
						// Load new item into the DataGridView
						else
						{
							// Retrieve Inserted ID
							PROPERTY_REC_PSACTUAL_ID = JSVC_NUM.VAR_NVALL(JSRC_JSON.REF_READ(JSON_OBJECT, "INSERTED_ID", "1"));
							
							// Add new line
							PSACTUAL_DGV.ROW.INSERT_AT(0);
							HTTP_SEARCH(PROPERTY_REC_PSACTUAL_ID, 0);
						}	

						// Lift edit and Exit EditMode
						EDIT_HANDLER.REF_IS_MODIFIED = false;
						EDIT_HANDLER.HAS_NEWLY_SAVED_DATA = true;			
						if
						(
							JSOC_ELEMENT.VAR_ELEMENT_EXISTS('PSACTUAL_MODAL') == true
						)
						{
							JSOC_DIALOG.VAR_MODAL('PSACTUAL_MODAL', false);
						}
						
						//SWAP_EDIT_MODE(false);
						CALLBACK_METHOD(true);											
					}
				}
			};
			
			
		// Save Item [Send Request]
		// _______________________________________________________________________
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._PSACTUAL.CUS_SAVE 
		(
			SAVE_MAP_ARRAY,
			RESPONSE_HANDLER
		);
		
	};
	
	
	// ===============================================================
	// Request Delete
	// ===============================================================
	function HTTP_DELETE(CALLBACK_METHOD, ROW_INDEX)
	{
		// Escape if Disabled
		// _______________________________________________________________________
		if(JSVC_VAR.VAR_ISSET(DELETE_BBI) && DELETE_BBI.Enabled == false)
		{
			CALLBACK_METHOD(false);
			return;
		}

		// Escape if nothing selected
		// _______________________________________________________________________
		if(ROW_INDEX < 0)
		{
			JSVC_ERROR.VAR_ARGUMENT_EXCEPTION_NOTHING_SELECTED(true);
			CALLBACK_METHOD(false);
			return;
		}
		
		// Initialize
		// _______________________________________________________________________
		var DELETE_ITEM_DESCRIPTION = PSACTUAL_DGV.CELL.VALUE('REC_PSACTUAL_ID', 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
			// ...........................................
			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;
				}
				
				// Post Delete Action
				else
				{
					PSACTUAL_DGV.ROW.REMOVE_AT(ROW_INDEX);
					PSACTUAL_DGV.COLUMN.ROW_COUNT_PRINT('ROW_COUNT');
					JSVC_INFO.VAR_RECORD_DELETED
					(
						DELETE_ITEM_DESCRIPTION, 
						function()
						{
							CALLBACK_METHOD(true);
						}
					);		
				}
			}
		};
		
		
		// Request User Verification for Delete
		// _______________________________________________________________________
		JSVC_INFO.VAR_VERIFY_DELETE
		(
			DELETE_ITEM_DESCRIPTION,
			function(VERIFY_RESULT) 
			{
				// Abort if rejected by user.
				// ...........................................
				if(VERIFY_RESULT != JSOC_DIALOG.MSGBOX_YES)
				{

					CALLBACK_METHOD(false);
					return;
				}
				
				
				//Delete Item
				// ...........................................
				JSOC_DIALOG.VAR_LOADING_SPINNER(true);
				JSCUS_SQL._RECORD._PSACTUAL.CUS_DELETE
				(
					PSACTUAL_DGV.CELL.VALUE('REC_PSACTUAL_ID', ROW_INDEX),
					RESPONSE_HANDLER
				)
			}
		);
	};
	
	
	// ===============================================================
	// Request Void
	// ===============================================================
	function HTTP_VOID(CALLBACK_METHOD, ROW_INDEX)
	{
		
		// Escape if Disabled
		// _______________________________________________________________________
		if
		(
			JSVC_VAR.VAR_ISSET(PSACTUAL_DGV.CELL.ELEMENT('REC_PSACTUAL_STATUS', ROW_INDEX)) && 
			PSACTUAL_DGV.CELL.ELEMENT('REC_PSACTUAL_STATUS', ROW_INDEX).Enabled == false
		)
		{
			CALLBACK_METHOD(false);
			return;
		}

		// Escape if nothing selected
		// _______________________________________________________________________
		if(ROW_INDEX < 0)
		{
			JSVC_ERROR.VAR_ARGUMENT_EXCEPTION_NOTHING_SELECTED(true);
			CALLBACK_METHOD(false);
			return;
		}
		
		// Abort if already Voided (Status = 3)
		// _______________________________________________________________________
		if(PSACTUAL_DGV.CELL.VALUE('REC_PSACTUAL_STATUS', ROW_INDEX) == 3)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'This item is already Voided', 
				'Information',
				'OK', 'INFO',
				null
			);		
			return;
		}		
		
		// Notify User to Void	
		// _______________________________________________________________________
		JSOC_DIALOG.VAR_MESSAGE_BOX
		(
			'Do you want to void the selected item?', 
			'Information',
			'YESNO', 'QUESTION',
			function(VERIFY_RESULT)
			{
				if(VERIFY_RESULT == JSOC_DIALOG.MSGBOX_YES)
				{
					PROPERTY_REC_VOUCHER_ID = PSACTUAL_DGV.CELL.VALUE('6635', ROW_INDEX);
					PROPERTY_EDIT_ROW_INDEX = ROW_INDEX;
					HTTP_LOAD
					(
						function()
						{
							JSOC_CMB.VAR_SELECTED_VALUE(REC_PSACTUAL_STATUS_CMB, 3);
							JSOC_DIALOG.VAR_MODAL("PSACTUAL_MODAL", true);
							EDIT_HANDLER.REF_IS_MODIFIED = true;				
						}
					);
				}
			}
		);
		
	};