
	// ===============================================================
	// EditHandler Flags
	// ===============================================================		
	function HTTP_LOAD(CALLBACK_FUNCTION)
	{
		// Escape if new item
		// _______________________________________________________________________
		PROPERTY_REC_INVOICE_ID = PROPERTY_PARENT_ID;
		
		
		// Initialize
		// _______________________________________________________________________
		var TARGET_MODAL = "FORM_DATA";
		var GET_MAP_ARRAY = JSCUS_SQL._RECORD._INVOICE.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVOICE_ID', PROPERTY_REC_INVOICE_ID);
		
		
		// Load Line
		// _______________________________________________________________________
		var INVOICE_LINE_CALLBACK = function(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;
			}
			
			// Back to DGV Top
			// ...........................................
			JSOC_ELEMENT.VAR_GET("INVOICE_LINE_DGV").scrollIntoView
			(
				{
			  		behavior: 'auto', 
			  		block: 'start'
				}
			);		
			
			
			// JSON Empty (Clears the DataGrodView)
			// ...........................................
			if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
			{
				INVOICE_LINE_DGV.ROW.CLEAR();
				if(INVOICE_LINE_DGV.COLUMN.TOTAL_IS_READY())
				{
					INVOICE_LINE_DGV.COLUMN.TOTAL_REFRESH();
				}
			}
			
			// Populate DGV
			// ...........................................
			else
			{
				// Populate Data
				INVOICE_LINE_DGV.POPULATE_FROM_QUERY
				(
						JSON_OBJECT, 
						'',
						false,
						false,
						1,
						[2, 1]
				);		
				
				// Apply CFormat
				JSOC_ELEMENT.VAR_VALUE
				(
					"REC_INVOICE_AMOUNT_PAID_LBL", 
					JSVC_NUM.VAR_CFORMAT(JSOC_ELEMENT.VAR_VALUE("REC_INVOICE_AMOUNT_PAID_LBL"))
				);
				JSOC_ELEMENT.VAR_VALUE
				(
					"REC_INVOICE_DISCOUNT_OTHER_LBL", 
					JSVC_NUM.VAR_CFORMAT(JSOC_ELEMENT.VAR_VALUE("REC_INVOICE_DISCOUNT_OTHER_LBL"))
				);
				JSOC_ELEMENT.VAR_VALUE
				(
					"REC_INVOICE_AMOUNT_RETURN_LBL", 
					JSVC_NUM.VAR_CFORMAT(JSOC_ELEMENT.VAR_VALUE("REC_INVOICE_AMOUNT_RETURN_LBL"))
				);
				JSOC_ELEMENT.VAR_VALUE
				(
					"REC_INVOICE_AMOUNT_ADJUSTMENT_LBL", 
					JSVC_NUM.VAR_CFORMAT(JSOC_ELEMENT.VAR_VALUE("REC_INVOICE_AMOUNT_ADJUSTMENT_LBL"))
				);
				JSOC_ELEMENT.VAR_VALUE
				(
					"REC_INVOICE_AMOUNT_DUE_LBL", 
					JSVC_NUM.VAR_CFORMAT(JSOC_ELEMENT.VAR_VALUE("REC_INVOICE_AMOUNT_DUE_LBL"))
				);	
			}
			
			// Actual Function
			// ...........................................
			GET_MAP_ARRAY = JSCUS_SQL._RECORD._INVOICE_RETURN.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();	
			JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVOICERTN_REC_INVOICE_ID', PROPERTY_REC_INVOICE_ID);
			JSOC_DIALOG.VAR_LOADING_SPINNER(true);
			JSCUS_SQL._RECORD._INVOICE_RETURN.CUS_GET
			(
				GET_MAP_ARRAY,
				INVOICE_RETURN_CALLBACK,
				true
			); 		
			
			// QR Code
			// ...........................................
			JSOC_IMAGE.VAR_SRC
			(
				"REC_INVOICE_CODE_IMG", 
				JSCUS_CACHE.SERVER_URL + '/System/image/qrcode?PARAM_QRCODE=' + JSOC_ELEMENT.VAR_VALUE('REC_INVOICE_CODE_LBL') + '&PARAM_SIZE=10'
			);
		};
		

		// Load Return
		// _______________________________________________________________________
		var INVOICE_RETURN_CALLBACK = function(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;
			}
			
			// Back to DGV Top
			// ...........................................
			JSOC_ELEMENT.VAR_GET("INVOICE_RTN_DGV").scrollIntoView
			(
				{
			  		behavior: 'auto', 
			  		block: 'start'
				}
			);		
			
			
			// JSON Empty (Clears the DataGrodView)
			// ...........................................
			if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
			{
				INVOICE_RTN_DGV.ROW.CLEAR();
				if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("FOR_RETURN_BLOCK"))
				{
					JSOC_ELEMENT.VAR_GET("FOR_RETURN_BLOCK").setAttribute('style', 'display:none');
				}
				
				if(INVOICE_RTN_DGV.COLUMN.TOTAL_IS_READY())
				{
					INVOICE_RTN_DGV.COLUMN.TOTAL_REFRESH();
				}
				if(JSVC_VAR.VAR_ISSET(CALLBACK_FUNCTION))
				{
					CALLBACK_FUNCTION();
				}
				return;
			}
			
			// Populate DGV
			// ...........................................
			INVOICE_RTN_DGV.POPULATE_FROM_QUERY
			(
					JSON_OBJECT, 
					'',
					false,
					false,
					1,
					[2, 1]
			);
			
			// Make callback if given
			// ...........................................
			if(JSVC_VAR.VAR_ISSET(CALLBACK_FUNCTION))
			{
				CALLBACK_FUNCTION();
			}
		};
		
						
		// Load DB data of item
		// _______________________________________________________________________
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._INVOICE.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_INVOICE_ID") + '&PARAM_SIZE=10', 
					JSCUS_CACHE.SERVER_URL + '/res/lib/dlg/noimage.png'
				);
				*/
				
				// Actual Function
				// ...........................................
				GET_MAP_ARRAY = JSCUS_SQL._RECORD._INVOICE_LINE.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();	
				JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_INVOICELIST_REC_INVOICE_ID', PROPERTY_REC_INVOICE_ID);
				JSOC_DIALOG.VAR_LOADING_SPINNER(true);
				JSCUS_SQL._RECORD._INVOICE_LINE.CUS_GET
				(
					GET_MAP_ARRAY,
					INVOICE_LINE_CALLBACK,
					true
				); 			
			},
			
			TARGET_MODAL, 
			FLAG_TINYINT_NULL, 
			PROPERTY_REC_INVOICE_ID
			//, GET_MAP_ARRAY
		);
		
		
		// Clear Changes due to loading
		// _______________________________________________________________________
		
		
	};
