

	function HTTP_LOAD(CALLBACK_FUNCTION)
	{
		// Escape if new item
		// ...........................................
		if(JSRC_FLAG.IS_NULL_BIGINT(PROPERTY_REC_JORDER_ID, 1, 1))
		{
			return;
		}
		
		// Load DB data of item
		// ...........................................
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);

		// Actual Function
		var GET_MAP_ARRAY = JSCUS_SQL._RECORD._JOB_ORDER_TASK.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_JORDER_TASK_LONG_A_FROM', JSVC_NUM.VAR_NVALL(PROPERTY_REC_JORDER_ID));
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_JORDER_TASK_LONG_A_TO', JSVC_NUM.VAR_NVALL(PROPERTY_REC_JORDER_ID));
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_JORDER_TASK_DECIMAL_A_FROM', 1); // 1 for delivery 2 for return
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_JORDER_TASK_DECIMAL_A_TO', 1);


		// 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;
					}
					else
					{
						JOB_ORDER_TASK_DGV.POPULATE_FROM_QUERY
						(
							JSON_OBJECT, 
							'',
							false,
							false,
							1,
							[2, 1]
						);

						JOB_ORDER_TASK_DGV.COLUMN.CFORMAT("REC_JORDER_TASK_QTY_TARGET");
						JSOC_ELEMENT.VAR_VALUE("TOTAL_ITEMS", JSVC_NUM.VAR_CFORMAT(JOB_ORDER_TASK_DGV.COLUMN.SUM("REC_JORDER_TASK_QTY_TARGET")));
					}
				}
			};

		
		JSCUS_SQL._RECORD._JOB_ORDER_TASK.CUS_GET
		(
			GET_MAP_ARRAY,
			RESPONSE_HANDLER,
			true
		);		
	};


	function HTTP_SAVE(CALLBACK_METHOD)
	{
		// Save item [Prepare]
		// _______________________________________________________________________
		var SAVE_MAP_ARRAY = JSCUS_SQL._RECORD._JOB_ORDER.CUS_PREPARE_MAPPED_ARRAY_FOR_SAVE();

		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_JORDER_ID", PROPERTY_REC_JORDER_ID);
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_REC_JORDER_USER_ASSIGN", JSVC_NUM.VAR_NVALL(JSCUS_SQL._ACCOUNT._LOGIN.ACC_ACCOUNT_ID)); // RIDER ID
		
		// 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
					{
						if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS('JOB_ORDER_MODAL') == true)
							JSOC_DIALOG.VAR_MODAL('JOB_ORDER_MODAL', false);
						
						//SWAP_EDIT_MODE(false);
						CALLBACK_METHOD(true);
					}
				}
			};
			
		// Save Item [Send Request]
		// _______________________________________________________________________
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._JOB_ORDER.CUS_SAVE 
		(
			SAVE_MAP_ARRAY,
			RESPONSE_HANDLER
		);
	}

