


	function FORM_LOAD()
	{
		TRANSFLOW_SMRY_DGV = DataGridView("TRANSFLOW_SMRY_DGV");
		POS_SHIFT_DGV = DataGridView("POS_SHIFT_DGV");

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB") == true)
		{
			JSOC_CMB.VAR_CLEAR("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB");
			JSOC_CMB.VAR_ADD("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Branch");
			var GET_MAP_ARRAY = JSCUS_SQL._ACCOUNT._GROUP.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();

			JSCUS_SQL._ACCOUNT._GROUP.CUS_GET_THEN_POPULATE_COMBOBOX
			(
				function(){ },
				"SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB",
				true,
				2,
				GET_MAP_ARRAY 
			);
		}

		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_ACCOUNT_ID_CMB") == true)
		{
			JSOC_CMB.VAR_CLEAR("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_ACCOUNT_ID_CMB");
			JSOC_CMB.VAR_ADD("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_ACCOUNT_ID_CMB", FLAG_BIGINT_NULL.toString(),"Any Member");
			var GET_MAP_ARRAY = JSCUS_SQL._ACCOUNT._MEMBER.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();

			JSCUS_SQL._ACCOUNT._MEMBER.CUS_GET_THEN_POPULATE_COMBOBOX
			(
				function(){ },	
				"SEARCH_REC_TRANSFLOW_SUMMARY_ACC_ACCOUNT_ID_CMB",
				true,
				2,
				GET_MAP_ARRAY 
			);
		}
	}

	function HTTP_LOAD_BRANCH_PRODUCT()
	{
		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_STATUS', 2);
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_FIELD', 'CAT_PRODUCT_CAT_PRODTYPE_ID_LV1');
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_ORDER_TYPE', 'ASC');
		//
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB") == true)
		{
			JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_CAT_PRODBRANCH_ACC_GROUP_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB")));
		}
		
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._CATEGORY._PRODUCT_BRANCH.CUS_GET
		(
			GET_MAP_ARRAY,
			HTTP_LOAD_BRANCH_PRODUCT_CALLBACK,
			true
		);
	}

	function HTTP_LOAD_BRANCH_PRODUCT_CALLBACK(IS_SUCCESS, RESPONSE_STRING)
	{
		// Disable Dialogs
		// _______________________________________________________________________
		CUS_SEND_DIALOG_TRY_DISMISS();
		
		// Validate
		// _______________________________________________________________________
		if(IS_SUCCESS === false)
		{
			alert("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)
		{
			alert("REQUEST ERROR: \n" + RESPONSE_STRING);
			return;
		}
		
		// JSON Empty (Clears the DataGrodView)
		// _______________________________________________________________________
		if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
		{
			TRANSFLOW_SMRY_DGV.ROW.CLEAR();
			return;
		}

		// Populate DGV
		// _______________________________________________________________________
		TRANSFLOW_SMRY_DGV.POPULATE_FROM_QUERY
		(
			JSON_OBJECT, 
			'',
			false,
			false,
			1,
			[2, 1]
		);
		
		TRANSACTION_COUNT = 0;
		var CALLBACK_METHOD = function(IS_SUCCESS)
		{
			if(IS_SUCCESS)
			{
				var CALLBACK_METHOD2 = function(IS_SUCCESS)
				{
					if(IS_SUCCESS)
					{
						var CALLBACK_METHOD3 = function(IS_SUCCESS)
						{
							if(IS_SUCCESS)
							{
								ROW_INDEX++;
								if(ROW_INDEX <= TRANSFLOW_SMRY_DGV.ROW.COUNT())
									HTTP_RECORD_INVENTORY_LOAD(CALLBACK_METHOD, ROW_INDEX);
								else
								{
									JSOC_ELEMENT.VAR_VALUE("SALES_BY_PRODUCT_TOTAL_SALES", JSVC_NUM.VAR_CFORMAT(TRANSFLOW_SMRY_DGV.COLUMN.SUM("TOTAL_SALES")));
									CUS_SEND_DIALOG_TRY_DISMISS();

									HTTP_SEARCH();
								}
							}
							else
								CUS_SEND_DIALOG_TRY_DISMISS();
						}

						HTTP_SALES_BY_PRODUCT_LOAD(CALLBACK_METHOD3, ROW_INDEX);
					}
					else
						CUS_SEND_DIALOG_TRY_DISMISS();
				}

				HTTP_STOCKCARD_LOAD(CALLBACK_METHOD2, ROW_INDEX);
			}
			else
				CUS_SEND_DIALOG_TRY_DISMISS();
		}

		var WEBTABLE_DATE = null;
		ROW_INDEX = 1;
		HTTP_RECORD_INVENTORY_LOAD(CALLBACK_METHOD, ROW_INDEX);
	}

	function HTTP_LOAD_TRANS_COUNT(CALLBACK_METHOD)
	{
		var GET_MAP_ARRAY = JSCUS_SQL._RECORD._POS_SALE.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB") == true)
		{
			JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSSALE_ACC_GROUP_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB")));
		}
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSSALE_DATE_TRANSACT_FROM', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 00:00:00.000000");
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSSALE_DATE_TRANSACT_TO', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 23:59:59.999999");
		
		var RESPONSE_HANDLER = 			
			function(IS_SUCCESS, RESPONSE_STRING)
			{
				// Disable Dialogs
				// _______________________________________________________________________
				CUS_SEND_DIALOG_TRY_DISMISS();
				
				// Validate
				// _______________________________________________________________________
				if(IS_SUCCESS === false)
				{
					alert("CONNECTION ERROR: \n" + RESPONSE_STRING);
					CALLBACK_METHOD(false);
					return;
				}
				
				// Validate JSON Response
				// _______________________________________________________________________
				var JSON_OBJECT = JSRC_JSON.REF_CREATE(RESPONSE_STRING);
				if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
				{
					alert("REQUEST ERROR: \n" + RESPONSE_STRING);
					CALLBACK_METHOD(false);
					return;
				}
				
				if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
					JSOC_ELEMENT.VAR_VALUE("SALES_BY_PRODUCT_TOTAL_COUNT", 0);
				else
					JSOC_ELEMENT.VAR_VALUE("SALES_BY_PRODUCT_TOTAL_COUNT", JSVC_NUM.VAR_FORMAT(JSRC_JSON.REF_READ(JSON_OBJECT, "RECORD_COUNT", 1), 0));

				CALLBACK_METHOD(true);
			}

		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._POS_SALE.CUS_GET
		(
			GET_MAP_ARRAY,
			RESPONSE_HANDLER,
			true
		);
	}

	function HTTP_LOAD_BEG_ACT_CASH()
	{
		var GET_MAP_ARRAY = JSCUS_SQL._RECORD._POS_SHIFT.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB") == true)
		{
			JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_SHIFT_ACC_GROUP_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB")));
		}
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_SHIFT_TIME_BEGIN_FROM', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 00:00:00.000000");
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_SHIFT_TIME_BEGIN_TO', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 23:59:59.999999");
		
		var RESPONSE_HANDLER = 			
			function(IS_SUCCESS, RESPONSE_STRING)
			{
				// Disable Dialogs
				// _______________________________________________________________________
				CUS_SEND_DIALOG_TRY_DISMISS();
				
				// Validate
				// _______________________________________________________________________
				if(IS_SUCCESS === false)
				{
					alert("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)
				{
					alert("REQUEST ERROR: \n" + RESPONSE_STRING);
					return;
				}
				
				// JSON Empty (Clears the DataGrodView)
				// _______________________________________________________________________
				if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
				{
					return;
				}

				var JSON_COUNT = JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT");
				var COUNTER = 1;
				var BEG_CASH = 0;
				var ACT_CASH = 0;
				while(COUNTER <= JSON_COUNT)
				{
					BEG_CASH = BEG_CASH + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CASH_BEGIN", COUNTER));
					ACT_CASH = ACT_CASH + 
					(
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10KS", COUNTER)) * 10000) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5KS", COUNTER)) * 5000) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_2KS", COUNTER)) * 2000) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1KS", COUNTER)) * 1000) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_500S", COUNTER)) * 500) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_200S", COUNTER)) * 200) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_100S", COUNTER)) * 100) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_50S", COUNTER)) * 50) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_20S", COUNTER)) * 20) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10S", COUNTER)) * 10) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5S", COUNTER)) * 5) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1S", COUNTER)) * 1) +
						(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CENTS", COUNTER)) * 0.1)
					);
					COUNTER++;
				}

				JSOC_ELEMENT.VAR_VALUE("TRANS_FLOW_BEG_CASH", JSVC_NUM.VAR_CFORMAT(BEG_CASH));
				JSOC_ELEMENT.VAR_VALUE("TRANS_FLOW_ACT_CASH", JSVC_NUM.VAR_CFORMAT(ACT_CASH));
			}

		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._POS_SHIFT.CUS_GET
		(
			GET_MAP_ARRAY,
			RESPONSE_HANDLER,
			true
		);
	}

	function HTTP_LOAD_CASH_INOUT(CALLBACK_METHOD, R_INDEX)
	{
		POS_SHIFT_DGV.CELL.VALUE('REC_SHIFT_CASH_IN', R_INDEX - 1, '0.00');
		POS_SHIFT_DGV.CELL.VALUE('REC_SHIFT_CASH_OUT', R_INDEX - 1, '0.00');
		POS_SHIFT_DGV.CELL.VALUE
		(
			'TOTAL_CB',
			R_INDEX - 1,
			JSVC_NUM.VAR_CFORMAT
			(
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10KS", R_INDEX - 1)) * 10000) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5KS", R_INDEX - 1)) * 5000) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_2KS", R_INDEX - 1)) * 2000) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1KS", R_INDEX - 1)) * 1000) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_500S", R_INDEX - 1)) * 500) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_200S", R_INDEX - 1)) * 200) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_100S", R_INDEX - 1)) * 100) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_50S", R_INDEX - 1)) * 50) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_20S", R_INDEX - 1)) * 20) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10S", R_INDEX - 1)) * 10) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5S", R_INDEX - 1)) * 5) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1S", R_INDEX - 1)) * 1) +
				(JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CENTS", R_INDEX - 1)) * 0.1)
			)
		);

		var GET_MAP_ARRAY = JSCUS_SQL._RECORD._POS_CASHFLOW.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSCASHFLOW_DATE_PROCESSED_FROM', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 00:00:00.000000");
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSCASHFLOW_DATE_PROCESSED_TO', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 23:59:59.999999");
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSCASHFLOW_ACC_ACCOUNT_ID', JSVC_NUM.VAR_NVALL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID", R_INDEX - 1)));

		var RESPONSE_HANDLER = 			
			function(IS_SUCCESS, RESPONSE_STRING)
			{
				// Validate
				// _______________________________________________________________________
				if(IS_SUCCESS === false)
				{
					alert("CONNECTION ERROR: \n" + RESPONSE_STRING);
					CALLBACK_METHOD(false);
					return;
				}
				
				// Validate JSON Response
				// _______________________________________________________________________
				var JSON_OBJECT = JSRC_JSON.REF_CREATE(RESPONSE_STRING);
				if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
				{
					alert("REQUEST ERROR: \n" + RESPONSE_STRING);
					CALLBACK_METHOD(false);
					return;
				}
				
				// JSON Empty (Clears the DataGrodView)
				// _______________________________________________________________________
				if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
				{
					CALLBACK_METHOD(true);
					return;
				}

				var JSON_COUNT = JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT");
				var COUNTER = 1;
				var CASH_IN = 0;
				var CASH_OUT = 0;
				while(COUNTER <= JSON_COUNT)
				{
					if
					(
						JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB")) ==
						JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_ACC_GROUP_ID", COUNTER))
					)
					{
						if(JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSCASHFLOW_IS_IN", COUNTER)) == 1)
							CASH_IN = CASH_IN + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSCASHFLOW_AMOUNT", COUNTER));
						else
							CASH_OUT = CASH_OUT + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSCASHFLOW_AMOUNT", COUNTER));
					}
					
					COUNTER++;
				}

				POS_SHIFT_DGV.CELL.VALUE('REC_SHIFT_CASH_IN', R_INDEX - 1, JSVC_NUM.VAR_CFORMAT(CASH_IN));
				POS_SHIFT_DGV.CELL.VALUE('REC_SHIFT_CASH_OUT', R_INDEX - 1, JSVC_NUM.VAR_CFORMAT(CASH_OUT));
				CALLBACK_METHOD(true);
			}

		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._POS_CASHFLOW.CUS_GET
		(
			GET_MAP_ARRAY,
			RESPONSE_HANDLER,
			true
		);
	}

	function HTTP_SEARCH()
	{
		GET_MAP_ARRAY = JSCUS_SQL._RECORD._POS_SHIFT.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();	
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_SHIFT_TIME_BEGIN_FROM', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 00:00:00.000000");
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_SHIFT_TIME_BEGIN_TO', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 23:59:59.999999");
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB") == true)
		{
			JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_SHIFT_ACC_GROUP_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB")));
		}
		
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._POS_SHIFT.CUS_GET
		(
			GET_MAP_ARRAY,
			HTTP_SEARCH_CALLBACK,
			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)
		{
			POS_SHIFT_DGV.ROW.CLEAR();
			return;
		}

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

		var JSON_COUNT = JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT");
		var COUNTER = 1;
		while(COUNTER <= JSON_COUNT)
		{
			//TOTAL_SALES =  TOTAL_SALES + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSSALE_TOTAL_PAID", COUNTER));
			//POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID", R_INDEX - 1)
			if (POS_SHIFT_DGV.ROW.COUNT() == 0)
			{
				var RINDEX = POS_SHIFT_DGV.ROW.COUNT();
				POS_SHIFT_DGV.ROW.INSERT_AT(RINDEX);
				POS_SHIFT_DGV.CELL.VALUE("ROW_COUNT", RINDEX, RINDEX + 1);
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ID", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_GROUP_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_GROUP_ID", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_GROUP_ID_DESCRIPTION", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_GROUP_ID_DESCRIPTION", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_DEVICE_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_DEVICE_ID", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_ACCOUNT_ID", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID_DESCRIPTION", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_ACCOUNT_ID_DESCRIPTION", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_TIME_BEGIN", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_TIME_BEGIN", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_TIME_END", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_TIME_END", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_BEGIN", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CASH_BEGIN", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10KS", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5KS", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_2KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_2KS", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1KS", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_500S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_500S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_200S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_200S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_100S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_100S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_50S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_50S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_20S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_20S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1S", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CENTS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CENTS", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CHECK_COUNT", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CHECK_COUNT", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CHECK_AMOUNT", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CHECK_AMOUNT", COUNTER));
				POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_STATUS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_STATUS", COUNTER));
			}
			else
			{
				var R_INDEX = 1; var IS_INSERTED = 0;
				while(POS_SHIFT_DGV.ROW.COUNT() >= R_INDEX)
				{
					if
					(
						JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID", R_INDEX-1)) ==
						JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_ACCOUNT_ID", COUNTER))
						&&
						JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_GROUP_ID", R_INDEX-1)) ==
						JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_GROUP_ID", COUNTER))
					)
					{
						IS_INSERTED = 1;
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_BEGIN", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_BEGIN", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CASH_BEGIN", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10KS", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10KS", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10KS", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5KS", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5KS", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5KS", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_2KS", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_2KS", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_2KS", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1KS", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1KS", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1KS", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_500S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_500S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_500S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_200S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_200S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_200S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_100S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_100S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_100S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_50S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_50S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_50S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_20S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_20S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_20S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1S", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1S", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1S", COUNTER)));
						POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CENTS", R_INDEX-1, JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CENTS", R_INDEX-1)) + JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CENTS", COUNTER)));
						break;
					}
					R_INDEX++;
				}

				if(IS_INSERTED == 0)
				{
					var RINDEX = POS_SHIFT_DGV.ROW.COUNT();
					POS_SHIFT_DGV.ROW.INSERT_AT(RINDEX);
					POS_SHIFT_DGV.CELL.VALUE("ROW_COUNT", RINDEX, RINDEX + 1);
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ID", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_GROUP_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_GROUP_ID", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_GROUP_ID_DESCRIPTION", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_GROUP_ID_DESCRIPTION", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_DEVICE_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_DEVICE_ID", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_ACCOUNT_ID", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID_DESCRIPTION", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_ACC_ACCOUNT_ID_DESCRIPTION", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_TIME_BEGIN", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_TIME_BEGIN", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_TIME_END", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_TIME_END", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_BEGIN", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CASH_BEGIN", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10KS", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5KS", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_2KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_2KS", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1KS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1KS", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_500S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_500S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_200S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_200S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_100S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_100S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_50S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_50S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_20S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_20S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_10S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_10S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_5S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_5S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_1S", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_1S", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CENTS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CENTS", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CHECK_COUNT", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CHECK_COUNT", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CREDIT_CHECK_AMOUNT", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_CREDIT_CHECK_AMOUNT", COUNTER));
					POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_STATUS", RINDEX, JSRC_JSON.REF_READ(JSON_OBJECT, "REC_SHIFT_STATUS", COUNTER));
				}
			}
			
			COUNTER++;
		}
		
		
		// For Applying CFormat
		// _______________________________________________________________________	
		POS_SHIFT_DGV.COLUMN.CFORMAT("REC_SHIFT_CASH_BEGIN");
		POS_SHIFT_DGV.COLUMN.CFORMAT("REC_SHIFT_CREDIT_CENTS");
		var ROW_INDEX = 1;
		var ROW_INDEX2 = 1;

		var CALLBACK_METHOD2 = function(IS_SUCCESS)
		{
			if(IS_SUCCESS)
			{
				ROW_INDEX2++;
				if(ROW_INDEX2 <= POS_SHIFT_DGV.ROW.COUNT())
					HTTP_SYSTEM_SALES_BY_USER(CALLBACK_METHOD2, ROW_INDEX2);
				else
					CUS_SEND_DIALOG_TRY_DISMISS();
			}
			else
				CUS_SEND_DIALOG_TRY_DISMISS();
		}

		var CALLBACK_METHOD = function(IS_SUCCESS)
		{
			if(IS_SUCCESS)
			{
				ROW_INDEX++;
				if(ROW_INDEX <= POS_SHIFT_DGV.ROW.COUNT())
					HTTP_LOAD_CASH_INOUT(CALLBACK_METHOD, ROW_INDEX);
				else
				{
					HTTP_SYSTEM_SALES_BY_USER(CALLBACK_METHOD2, ROW_INDEX2);
					CUS_SEND_DIALOG_TRY_DISMISS();
				}
			}
			else
			{
				HTTP_SYSTEM_SALES_BY_USER(CALLBACK_METHOD2, ROW_INDEX2);
				CUS_SEND_DIALOG_TRY_DISMISS();
			}
		}

		// Initialize
		// _______________________________________________________________________	
		var WEBTABLE_DATE = null;
		HTTP_LOAD_CASH_INOUT(CALLBACK_METHOD, ROW_INDEX);
	
	}

	function HTTP_SYSTEM_SALES_BY_USER(CALLBACK_METHOD, R_INDEX)
	{
		POS_SHIFT_DGV.CELL.VALUE('TOTAL_SALES', R_INDEX - 1, '0.00');
		POS_SHIFT_DGV.CELL.VALUE('TOTAL_SHORT_OVER', R_INDEX - 1, '0.00');
		POS_SHIFT_DGV.CELL.VALUE('TOTAL_SYSTEM', R_INDEX - 1, '0.00');

		var GET_MAP_ARRAY = JSCUS_SQL._RECORD._POS_SALE_LIST.CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSSALE_ACC_ACCOUNT_ID', JSVC_NUM.VAR_NVALL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_ACC_ACCOUNT_ID", R_INDEX - 1)));
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSSALE_DATE_TRANSACT_FROM', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 00:00:00.000000");
		JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSSALE_DATE_TRANSACT_TO', JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_NOW(), "YYYY-MM-DD") + " 23:59:59.999999");
		if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB") == true)
		{
			JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_REC_POSSALE_ACC_GROUP_ID', JSVC_NUM.VAR_NVAL(JSOC_CMB.VAR_SELECTED_VALUE("SEARCH_REC_TRANSFLOW_SUMMARY_ACC_GROUP_ID_CMB")));
		}

		// Declare Post Request Handler
		// _______________________________________________________________________
		var RESPONSE_HANDLER = 			
			function(IS_SUCCESS, RESPONSE_STRING)
			{
				// Validate
				// _______________________________________________________________________
				if(IS_SUCCESS === false)
				{
					alert("CONNECTION ERROR: \n" + RESPONSE_STRING);
					CALLBACK_METHOD(false);
					return;
				}
				
				// Validate JSON Response
				// _______________________________________________________________________
				var JSON_OBJECT = JSRC_JSON.REF_CREATE(RESPONSE_STRING);
				if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
				{
					alert("REQUEST ERROR: \n" + RESPONSE_STRING);
					CALLBACK_METHOD(false);
					return;
				}
				
				// JSON Empty (Clears the DataGrodView)
				// _______________________________________________________________________
				if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
				{
					CALLBACK_METHOD(true);
					return;
				}
				// Read Response And Assign ID
				// ...........................................
				else
				{
					var JSON_COUNT = JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT");
					var COUNTER = 1;
					while(COUNTER <= JSON_COUNT)
					{
						POS_SHIFT_DGV.CELL.VALUE("TOTAL_SALES", R_INDEX - 1,
							JSVC_NUM.VAR_CFORMAT(
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE('TOTAL_SALES', R_INDEX - 1)) +
					    		JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSSALE_LIST_TOPAY_VATABLE", COUNTER)) +
					    		JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSSALE_LIST_TOPAY_VATEXEMPT", COUNTER)) +
					    		JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSSALE_LIST_TOPAY_NONVAT", COUNTER)) +
					    		JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSSALE_LIST_TOPAY_ZERORATED", COUNTER)) +
					    		JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSSALE_LIST_TOPAY_VATOTHER", COUNTER)) +
					    		JSVC_NUM.VAR_NVAL(JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSSALE_LIST_TOPAY_VAT", COUNTER))
							));

						COUNTER++;
					}

					POS_SHIFT_DGV.CELL.VALUE
					(
						"TOTAL_SYSTEM",
						R_INDEX - 1,
						JSVC_NUM.VAR_CFORMAT
						(
							(
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_BEGIN", R_INDEX - 1)) +
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("TOTAL_SALES", R_INDEX - 1)) +
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_IN", R_INDEX - 1))
							) -
							(
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_OUT", R_INDEX - 1))
							)
						)
					);
					
					POS_SHIFT_DGV.CELL.VALUE
					(
						"TOTAL_SHORT_OVER",
						R_INDEX - 1,
						JSVC_NUM.VAR_CFORMAT
						(
							(
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("TOTAL_CB", R_INDEX - 1)) +
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_OUT", R_INDEX - 1))
							) -
							(
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_BEGIN", R_INDEX - 1)) +
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("TOTAL_SALES", R_INDEX - 1)) +
								JSVC_NUM.VAR_NVAL(POS_SHIFT_DGV.CELL.VALUE("REC_SHIFT_CASH_IN", R_INDEX - 1))
							)
						)
					);

					CALLBACK_METHOD(true);
				}
			};

		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._RECORD._POS_SALE_LIST.CUS_GET_ALL
		(
			GET_MAP_ARRAY,
			RESPONSE_HANDLER,
			true
		);
	}


FORM_INITIALIZE();
FORM_LOAD();