← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13192: PBF Functionality

 

------------------------------------------------------------
revno: 13192
committer: Samta Bajpayee<samta-bajpayee@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-10 12:41:41 +0000
message:
  PBF Functionality
added:
  local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/AddTariffDataAction.java
  local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/DeleteTariffDataAction.java
  local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/GetDataElementforTariffAction.java
  local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/LoadTariffDetailsAction.java
  local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/images/delete.png
  local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadDataElementsforTariff.vm
  local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadTariffData.vm
  local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/status.vm
  local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/tariffMenu.vm
modified:
  local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java
  local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java
  local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/AddTariffDataAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/AddTariffDataAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/AddTariffDataAction.java	2013-12-10 12:41:41 +0000
@@ -0,0 +1,145 @@
+package org.hisp.dhis.pbf.action;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.pbf.api.TariffDataValue;
+import org.hisp.dhis.pbf.api.TariffDataValueService;
+import org.hisp.dhis.user.CurrentUserService;
+
+import com.opensymphony.xwork2.Action;
+
+public class AddTariffDataAction implements Action {
+	// -------------------------------------------------------------------------
+	// Dependencies
+	// -------------------------------------------------------------------------
+
+	private TariffDataValueService tariffDataValueService;
+
+	public void setTariffDataValueService(TariffDataValueService tariffDataValueService) 
+	{
+		this.tariffDataValueService = tariffDataValueService;
+	}
+	
+	private DataElementService dataElementService;
+	
+	public void setDataElementService(DataElementService dataElementService) {
+		this.dataElementService = dataElementService;
+	}
+
+	private OrganisationUnitService organisationUnitService;
+	
+	public void setOrganisationUnitService(
+			OrganisationUnitService organisationUnitService) {
+		this.organisationUnitService = organisationUnitService;
+	}
+	
+	private OrganisationUnitGroupService organisationUnitGroupService;
+	
+	public void setOrganisationUnitGroupService(
+			OrganisationUnitGroupService organisationUnitGroupService) {
+		this.organisationUnitGroupService = organisationUnitGroupService;
+	}
+	
+	private DataElementCategoryService categoryService;
+	
+	public void setCategoryService(DataElementCategoryService categoryService) {
+		this.categoryService = categoryService;
+	}
+	
+	private CurrentUserService currentUserService;
+	
+	public void setCurrentUserService(CurrentUserService currentUserService) {
+		this.currentUserService = currentUserService;
+	}
+
+	// -------------------------------------------------------------------------
+    // Input
+    // -------------------------------------------------------------------------
+	
+	
+	private String pbfType;
+	private String tariff;
+	private String startDate;
+	private String endDate;
+	
+	private String dataElementId;
+	private String orgUnitId;
+	
+	public void setDataElementId(String dataElementId) {
+		this.dataElementId = dataElementId;
+	}
+
+
+
+	public void setOrgUnitId(String orgUnitId) {
+		this.orgUnitId = orgUnitId;
+	}
+
+
+
+	public void setPbfType(String pbfType) {
+		this.pbfType = pbfType;
+	}
+
+
+
+	public void setTariff(String tariff) {
+		this.tariff = tariff;
+	}
+
+
+
+	public void setStartDate(String startDate) {
+		this.startDate = startDate;
+	}
+
+
+
+	public void setEndDate(String endDate) {
+		this.endDate = endDate;
+	}
+
+	// -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+	public String execute() throws Exception {
+		
+		Date sDate;
+		Date eDate;
+		SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+		sDate = dateFormat.parse(startDate);
+		eDate = dateFormat.parse(endDate);
+		
+		DataElement dataElement = dataElementService.getDataElement(Integer.parseInt(dataElementId));
+		
+		OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit(Integer.parseInt(orgUnitId));
+		
+		OrganisationUnitGroup orgUnitGrp = organisationUnitGroupService.getOrganisationUnitGroup(Integer.parseInt(pbfType));
+		
+		TariffDataValue tariffDataValue = new TariffDataValue();
+		
+		
+		tariffDataValue.setValue(Double.parseDouble(tariff));
+		tariffDataValue.setStartDate(sDate);
+		tariffDataValue.setEndDate(eDate);
+		tariffDataValue.setTimestamp(new Date());
+		tariffDataValue.setStoredBy(currentUserService.getCurrentUsername());
+		tariffDataValue.setDataElement(dataElement);
+		tariffDataValue.setOptionCombo(categoryService.getDefaultDataElementCategoryOptionCombo());
+		tariffDataValue.setOrganisationUnitGroup(orgUnitGrp);
+		tariffDataValue.setOrganisationUnit(orgUnit);
+		
+		tariffDataValueService.addTariffDataValue(tariffDataValue);
+		
+		return SUCCESS;
+	}
+}
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/DeleteTariffDataAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/DeleteTariffDataAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/DeleteTariffDataAction.java	2013-12-10 12:41:41 +0000
@@ -0,0 +1,64 @@
+package org.hisp.dhis.pbf.action;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.hisp.dhis.pbf.api.TariffDataValue;
+import org.hisp.dhis.pbf.api.TariffDataValueService;
+
+import com.opensymphony.xwork2.Action;
+
+public class DeleteTariffDataAction implements Action {
+	// -------------------------------------------------------------------------
+	// Dependencies
+	// -------------------------------------------------------------------------
+
+	private TariffDataValueService tariffDataValueService;
+
+	public void setTariffDataValueService(TariffDataValueService tariffDataValueService) 
+	{
+		this.tariffDataValueService = tariffDataValueService;
+	}
+	
+	// -------------------------------------------------------------------------
+    // Input
+    // -------------------------------------------------------------------------
+	
+	private String organisationUnitId;
+	
+	private String dataElementId;
+	
+	private String categoryOptionComboId;
+	
+	private String organisationUnitGroupId;
+	
+	private String startDate;
+	
+	private String endDate;
+	// -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+	public String execute() throws Exception {
+		
+		Date sDate;
+		Date eDate;
+		int orgUnitId = Integer.parseInt(organisationUnitId);
+		
+		int deId = Integer.parseInt(dataElementId);
+		
+		int categoryId = Integer.parseInt(categoryOptionComboId);
+		int orgUnitGrpId = Integer.parseInt(organisationUnitGroupId);
+		SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+		sDate = dateFormat.parse(startDate);
+		eDate = dateFormat.parse(endDate);
+		
+		TariffDataValue tariffDataValue = tariffDataValueService.getTariffDataValue
+						(orgUnitId, deId, categoryId, orgUnitGrpId, sDate, eDate);
+				
+				
+		tariffDataValueService.deleteTariffDataValue(tariffDataValue);
+		
+		return SUCCESS;
+	}
+}
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/GetDataElementforTariffAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/GetDataElementforTariffAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/GetDataElementforTariffAction.java	2013-12-10 12:41:41 +0000
@@ -0,0 +1,53 @@
+package org.hisp.dhis.pbf.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+
+import com.opensymphony.xwork2.Action;
+
+public class GetDataElementforTariffAction implements Action
+{
+	// -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+	
+	private DataElementService dataElementService;
+	
+	public void setDataElementService(DataElementService dataElementService) {
+		this.dataElementService = dataElementService;
+	}
+	
+	// -------------------------------------------------------------------------
+    // Input
+    // -------------------------------------------------------------------------
+	
+	private List<String> dataElementList = new ArrayList<String>();
+	
+    public List<String> getDataElementList() {
+		return dataElementList;
+	}
+
+	public void setDataElementList(List<String> dataElementList) {
+		this.dataElementList = dataElementList;
+	}
+
+	// -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+	public String execute()
+    {
+    	List<DataElement> dataElements = new ArrayList<DataElement>(dataElementService.getAllDataElements());
+    	for(DataElement de : dataElements)
+    	{
+    		if(!(dataElementList.contains("\""+de.getName()+"\"")))
+    		{
+    			dataElementList.add("\""+de.getName()+"\"");
+    		}
+    	}
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/LoadTariffDetailsAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/LoadTariffDetailsAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/LoadTariffDetailsAction.java	2013-12-10 12:41:41 +0000
@@ -0,0 +1,98 @@
+package org.hisp.dhis.pbf.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.pbf.api.TariffDataValue;
+import org.hisp.dhis.pbf.api.TariffDataValueService;
+
+import com.opensymphony.xwork2.Action;
+
+public class LoadTariffDetailsAction implements Action
+{
+	// -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+	
+	private TariffDataValueService tariffDataValueService;
+
+	public void setTariffDataValueService(TariffDataValueService tariffDataValueService) 
+	{
+		this.tariffDataValueService = tariffDataValueService;
+	}
+	
+	private DataElementService dataElementService;
+	
+	public void setDataElementService(DataElementService dataElementService) {
+		this.dataElementService = dataElementService;
+	}
+
+	private OrganisationUnitService organisationUnitService;
+	
+	public void setOrganisationUnitService(
+			OrganisationUnitService organisationUnitService) {
+		this.organisationUnitService = organisationUnitService;
+	}
+	
+	private OrganisationUnitGroupService organisationUnitGroupService;
+	
+	public void setOrganisationUnitGroupService(
+			OrganisationUnitGroupService organisationUnitGroupService) {
+		this.organisationUnitGroupService = organisationUnitGroupService;
+	}
+
+	// -------------------------------------------------------------------------
+    // Input / Output
+    // -------------------------------------------------------------------------
+	private String dataElementName;
+	
+	 public void setDataElementName(String dataElementName) {
+			this.dataElementName = dataElementName;
+		}
+	private String orgUnitId;
+	
+	public void setOrgUnitId(String orgUnitId) {
+		this.orgUnitId = orgUnitId;
+	}
+	
+	private List<TariffDataValue> tariffList = new ArrayList<TariffDataValue>();
+	
+	public List<TariffDataValue> getTariffList() {
+		return tariffList;
+	}
+	
+	private DataElement selecteddataElement;
+	
+	public DataElement getSelecteddataElement() {
+		return selecteddataElement;
+	}
+
+	private List<OrganisationUnitGroup> orGroupList = new ArrayList<OrganisationUnitGroup>();
+	
+	public List<OrganisationUnitGroup> getOrGroupList() {
+		return orGroupList;
+	}
+	
+	// -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+	
+	public String execute()
+    {
+		OrganisationUnitGroupSet organisationUnitGroupSet =  organisationUnitGroupService.getOrganisationUnitGroupSet(3);
+		orGroupList = new ArrayList<OrganisationUnitGroup>(organisationUnitGroupSet.getOrganisationUnitGroups()) ;
+		selecteddataElement = dataElementService.getDataElementByName(dataElementName);
+		OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit(Integer.parseInt(orgUnitId));
+		
+		tariffList = new ArrayList<TariffDataValue>(tariffDataValueService.getTariffDataValues(organisationUnit, selecteddataElement)) ;
+		
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java	2013-12-07 09:10:04 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java	2013-12-10 12:41:41 +0000
@@ -3,6 +3,7 @@
 import java.util.Collection;
 import java.util.Date;
 
+import org.hibernate.Session;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.organisationunit.OrganisationUnit;

=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java	2013-12-07 09:10:04 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java	2013-12-10 12:41:41 +0000
@@ -35,7 +35,8 @@
     // -------------------------------------------------------------------------
     // TariffDataValue
     // -------------------------------------------------------------------------
-
+    
+    
     @Override
     public void addTariffDataValue( TariffDataValue tariffDataValue )
     {
@@ -104,7 +105,7 @@
     {
         Session session = sessionFactory.getCurrentSession();
 
-        Criteria criteria = session.createCriteria( DataValue.class );
+        Criteria criteria = session.createCriteria( TariffDataValue.class );
         criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
         criteria.add( Restrictions.eq( "organisationUnitGroup", organisationUnitGroup ) );
 
@@ -116,7 +117,7 @@
     {
         Session session = sessionFactory.getCurrentSession();
 
-        Criteria criteria = session.createCriteria( DataValue.class );
+        Criteria criteria = session.createCriteria( TariffDataValue.class );
         criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
         criteria.add( Restrictions.eq( "dataElement", dataElement ) );
 

=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml	2013-12-07 09:10:04 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml	2013-12-10 12:41:41 +0000
@@ -18,6 +18,32 @@
 	<!-- Home page -->
 	<bean id="org.hisp.dhis.pbf.action.NoAction" class="org.hisp.dhis.pbf.action.NoAction" scope="prototype">
     </bean>
-
 	
+	<!-- Data Element for Tariff -->
+	<bean id="org.hisp.dhis.pbf.action.GetDataElementforTariffAction" class="org.hisp.dhis.pbf.action.GetDataElementforTariffAction" scope="prototype">
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    </bean>
+    
+    <!-- Get Tariff Data -->
+    <bean id="org.hisp.dhis.pbf.action.LoadTariffDetailsAction" class="org.hisp.dhis.pbf.action.LoadTariffDetailsAction" scope="prototype">
+		<property name="tariffDataValueService" ref="org.hisp.dhis.pbf.api.TariffDataValueService" />	
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />	
+    </bean>
+    
+    <!-- Add Tariff -->
+	<bean id="org.hisp.dhis.pbf.action.AddTariffDataAction" class="org.hisp.dhis.pbf.action.AddTariffDataAction" scope="prototype">
+		<property name="tariffDataValueService" ref="org.hisp.dhis.pbf.api.TariffDataValueService" />
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+		<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    </bean>
+    <!-- Delete Tariff -->
+    <bean id="org.hisp.dhis.pbf.action.DeleteTariffDataAction" class="org.hisp.dhis.pbf.action.DeleteTariffDataAction" scope="prototype">
+		<property name="tariffDataValueService" ref="org.hisp.dhis.pbf.api.TariffDataValueService" />
+    </bean>
+    
 </beans>
\ No newline at end of file

=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml'
--- local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml	2013-12-07 09:10:04 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml	2013-12-10 12:41:41 +0000
@@ -14,7 +14,24 @@
 			<param name="page">/dhis-web-maintenance-pbf/welcome.vm</param>
 			<param name="menu">/dhis-web-maintenance-pbf/menu.vm</param>
 		</action>
-	
+		<action name="dataElementTariffManagement" class="org.hisp.dhis.pbf.action.GetDataElementforTariffAction">
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-maintenance-pbf/loadDataElementsforTariff.vm</param>
+			<param name="menu">/dhis-web-maintenance-pbf/tariffMenu.vm</param>
+			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js</param>			
+		</action>
+		<action name="loadTariffDetails" class="org.hisp.dhis.pbf.action.LoadTariffDetailsAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-maintenance-pbf/loadTariffData.vm</param>			
+		</action>
+		 <action name="addTariffData" class="org.hisp.dhis.pbf.action.AddTariffDataAction">
+			<result name="success" type="velocity-json">/dhis-web-maintenance-pbf/status.vm</result>
+			<param name="onExceptionReturn">plainTextError</param>					
+		</action>
+		<action name="deleteTariffData" class="org.hisp.dhis.pbf.action.DeleteTariffDataAction">
+			<result name="success" type="velocity-json">/dhis-web-maintenance-pbf/status.vm</result>
+			<param name="onExceptionReturn">plainTextError</param>					
+		</action>
 	</package>
 	
 </struts>
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/images/delete.png'
Binary files local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/images/delete.png	1970-01-01 00:00:00 +0000 and local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/images/delete.png	2013-12-10 12:41:41 +0000 differ
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadDataElementsforTariff.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadDataElementsforTariff.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadDataElementsforTariff.vm	2013-12-10 12:41:41 +0000
@@ -0,0 +1,71 @@
+
+<script >
+$(function() {
+var availableTags = $dataElementList;
+$( "#dataElementName" ).autocomplete({
+			source: availableTags,
+			select: function( event, ui ) {
+				for(var i=0;i<=availableTags.length-1;i++)
+				{
+					if(availableTags[i] == ui.item.value)
+					{
+						var dataElementName = ui.item.value;
+        				$('#loadTariffDetails').load("loadTariffDetails.action", 
+            				{
+            					dataElementName:dataElementName,
+								orgUnitId:$("#orgUnitId").val()
+            				}
+            				, function( ){            										
+        				});
+					}
+				}
+			
+			}
+			});
+});
+function getTariffData()
+{
+			var availableTags = $dataElementList;	
+				for(var i=0;i<=availableTags.length-1;i++)
+				{
+					if(availableTags[i] == $("#dataElementName").val())
+					{
+						var dataElementName = $("#dataElementName").val();
+        				$('#loadTariffDetails').load("loadTariffDetails.action", 
+            				{
+            					dataElementName:dataElementName,
+								orgUnitId:$("#orgUnitId").val()
+            				}
+            				, function( ){            										
+        				});
+					}
+				}
+		
+}
+
+function organisationUnitSelected( orgUnits, orgUnitNames )
+{ 
+	setFieldValue("orgUnit", orgUnitNames[0]);
+	setFieldValue("orgUnitId", orgUnits[0]);
+}
+
+selection.setListenerFunction( organisationUnitSelected );
+</script>
+<h3>Data Element Tariff Management</h3>
+<input type="hidden" name="orgUnitId" id="orgUnitId">
+<table width="100%">
+	<tr>
+		<td >Orgainsation Unit <input type="text" id="orgUnit" name="orgUnit" readonly/></td>
+		<td >Tariff Setting Authority <input type="text" readonly/></td>
+	</tr>
+	<tr >
+		<td >&nbsp;</td>
+		<td >&nbsp;</td>
+    </tr>
+	<tr>
+		<td ><input id="dataElementName" name="dataElementName" onkeyup="getTariffData()" size="55" placeholder="Type the name of dataelement" /> &nbsp;</td>
+		<td >&nbsp;</td>
+	</tr>
+</table>
+<br/><br/><br/>
+<div id="loadTariffDetails" style="width:80%"></div>
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadTariffData.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadTariffData.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/loadTariffData.vm	2013-12-10 12:41:41 +0000
@@ -0,0 +1,114 @@
+<script >
+$(function() {
+$("#openAddTariff").button()
+			.click(function() {
+				$( "#addTariff" ).dialog( "open" );
+});
+
+$( "#addTariff" ).dialog({
+			autoOpen: false,
+			height: 450,
+			width: 350,
+			modal: true,
+			buttons: {
+			"Save": function() {
+			
+							var dataValue = {
+        		        			'pbfType' : $("#pbfType").val(),
+        		        			'tariff' : $("#tariff").val(),
+        		        			'startDate' : $("#startDate").val(),
+        							'endDate' : $("#endDate").val(),
+									'orgUnitId': $("#orgUnitId").val(),
+									'dataElementId' : $("#dataElementId").val()
+        		    			};
+								jQuery.ajax( {
+                                url: 'addTariffData.action', 
+								data: dataValue,
+                                dataType: 'json',
+                                success: handleSuccess,
+                                error: handleError
+                            } );
+				},
+				Cancel: function() {
+					$( this ).dialog( "close" );
+				}
+			},
+			close: function() {				
+			}
+		});
+		 function handleSuccess( json )
+	    {	
+			$( "#addTariff" ).dialog( "close" );
+	    }
+	    function handleError( json )
+	    {
+			$( "#addTariff" ).dialog( "close" );
+	    }
+});
+function deleteTariffDataValue(tariffId)
+{
+				var dataValue = {
+        		        		
+        		    			};
+								
+								jQuery.ajax( {
+                                url: 'deleteTariffData.action', 
+								data: dataValue,
+                                dataType: 'json'
+                              } );
+}
+</script>
+<div style="width:100%">
+	<input type="button" value="Add New Tariff" style="float:right;" id="openAddTariff"/>
+</div>
+<br/><br/>
+<input type="hidden" id="dataElementId" name="dataElementId" value="$!selecteddataElement.id"/>
+<table style="width:100%" class="mainPageTable">
+	<thead >
+		<tr >
+			<th >PBF Type</th>
+			<th >Tariff</th>
+			<th >Start Date</th>
+			<th >End Date</th>
+			<th >Operations</th>
+        </tr>
+	</thead>
+	<tbody id="list">
+		#foreach($tariff in $tariffList )
+		<tr >
+			<td >$!tariff.organisationUnitGroup.name</td>
+			<td >$!tariff.value</td>
+			<td >$!tariff.startDate</td>
+			<td >$!tariff.endDate</td>
+            <td><img src="images/delete.png" width="17px" onclick="deleteTariffDataValue('')"/></td>
+        </tr>
+		#end
+    </tbody>
+</table>
+<div id="addTariff" title="Add New Tariff">
+	<table style="width:100%">
+		<tr >
+			<td>&nbsp;</td>
+			<td>
+				<select id="pbfType">
+					<option >Select PBF Type</option>
+					#foreach($orGrp in $orGroupList)
+						<option value="$orGrp.id">$orGrp.name</option>
+					#end
+                </select>
+			</td>
+        </tr>
+		<tr >
+			<td>Tariff</td>
+			<td><input type="text" id="tariff"/></td>
+        </tr>
+		<tr >
+			<td>Start Date</td>
+			<td><input type="text" id="startDate"/></td>
+        </tr>
+		<tr >
+			<td>End Date</td>
+			<td><input type="text" id="endDate"/></td>
+        </tr>
+    </table>
+</div>
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/status.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/status.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/status.vm	2013-12-10 12:41:41 +0000
@@ -0,0 +1,7 @@
+{
+"c":"${statusCode}",
+"curValueDiv":"$!dataValue.value",
+"curCommentDiv":"$!dataValue.comment",
+"curStoredByDiv":"$!dataValue.storedBy",
+"curTimeStampDiv":"$standardDateFormat.format($!dataValue.timestamp)"
+}
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/tariffMenu.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/tariffMenu.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/tariffMenu.vm	2013-12-10 12:41:41 +0000
@@ -0,0 +1,2 @@
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )