// NOTE: [This JS must loaded as last item]


	// ===============================================================
	// Initialize Form
	// ===============================================================
	function RECORD_DAMAGES(SELECTED_ID, SELECTED_DESCRIPTION, RESULT_MAP_ARRAY)
	{
		JSOC_ELEMENT.VAR_VALUE(REC_CHARGE_ITEM_TXT, SELECTED_DESCRIPTION);
		JSOC_ELEMENT.VAR_VALUE_NVALL(REC_CHARGE_ITEM_HDDN, SELECTED_ID);
		JSOC_ELEMENT.VAR_VALUE(REC_CHARGE_COST_TXT, RESULT_MAP_ARRAY['CAT_PRODUCT_ING_PRICE']);
		EDITABLE_MODE(2);
	};


	function EDITABLE_MODE(IS_EDITABLE)
	{
		// New
		if(IS_EDITABLE == 1)
		{
			JSOC_ELEMENT.VAR_VALUE(REC_CHARGE_ITEM_HDDN, 0);
			REC_CHARGE_ITEM_TXT.readOnly = false;
			REC_CHARGE_QTY_TXT.readOnly = false;		
			
			REC_CHARGE_REC_EMPLOYEE_ID_CMB.disabled = false;
			REC_CHARGE_REFERENCE_TXT.readOnly = false;	
			JSOC_ELEMENT.VAR_GET("REC_CHARGE_REC_EMPLOYEE_ID_CMD").disabled = false;
		}
		
		// Assigned Product from db
		else if(IS_EDITABLE == 2)
		{
			REC_CHARGE_ITEM_TXT.readOnly = true;
			REC_CHARGE_QTY_TXT.readOnly = false;
			
			REC_CHARGE_REC_EMPLOYEE_ID_CMB.disabled = false;
			REC_CHARGE_REFERENCE_TXT.readOnly = false;
			JSOC_ELEMENT.VAR_GET("REC_CHARGE_REC_EMPLOYEE_ID_CMD").disabled = false;
		}
		
		// From production
		else if(IS_EDITABLE == 4)
		{
			REC_CHARGE_REC_EMPLOYEE_ID_CMB.disabled = true;
			REC_CHARGE_ITEM_TXT.readOnly = false;
			REC_CHARGE_REFERENCE_TXT.readOnly = true;
			
			JSOC_ELEMENT.VAR_GET("REC_CHARGE_REC_EMPLOYEE_ID_CMD").disabled = true;
		}
		
		// Edit
		else
		{
			JSOC_ELEMENT.VAR_VALUE(REC_CHARGE_ITEM_HDDN, 0);
			REC_CHARGE_ITEM_TXT.readOnly = true;
			REC_CHARGE_QTY_TXT.readOnly = true;
			
			REC_CHARGE_REC_EMPLOYEE_ID_CMB.disabled = false;
			REC_CHARGE_REFERENCE_TXT.readOnly = false;
			JSOC_ELEMENT.VAR_GET("REC_CHARGE_REC_EMPLOYEE_ID_CMD").disabled = false;
		}
	};