← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17261: local/in Add partner in Maintenance RBF

 

------------------------------------------------------------
revno: 17261
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-10-24 12:05:35 +0100
message:
  local/in Add partner in Maintenance RBF
added:
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowAddTariffDetailsFormAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowUpdateTariffDetailsFormAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/GetDataElementAndPeriodListAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/partner.js
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff_old.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffAddDetailsForm.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData_old.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffUpdateDetailsForm.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/responseDataElementAndPeriods.vm
modified:
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/AddTariffDataAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateTariffDataValueStore.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityMaxScoreAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java
  local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml
  local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties
  local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm


--
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
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/AddTariffDataAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/AddTariffDataAction.java	2014-05-08 11:03:37 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/AddTariffDataAction.java	2014-10-24 11:05:35 +0000
@@ -176,7 +176,7 @@
             tariffDataValue.setOrgUnitLevel( organisationUnit.getOrganisationUnitLevel() );
             
             tariffDataValueService.addTariffDataValue( tariffDataValue );
-            System.out.println("Tariff Data Added");
+            //System.out.println("Tariff Data Added");
         }
         else
         {
@@ -193,7 +193,7 @@
             tariffDataValue.setStoredBy( currentUserService.getCurrentUsername() );
             
             tariffDataValueService.updateTariffDataValue( tariffDataValue );
-            System.out.println("Tariff Data Updated");
+            //System.out.println("Tariff Data Updated");
         }
         
         return SUCCESS;

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java	2014-05-15 06:51:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java	2014-10-24 11:05:35 +0000
@@ -13,6 +13,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
@@ -55,7 +56,10 @@
     
     @Autowired
     private OrganisationUnitGroupService orgUnitGroupService;
-        
+    
+    @Autowired
+    private DataSetService dataSetService;
+    
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -139,10 +143,38 @@
         Set<DataElement> dataElements = new TreeSet<DataElement>();
         for( OrganisationUnitGroup orgUnitGroup : orgUnitGroups )
         {
+            
+            /*
+            Set<OrganisationUnit> groupMember = new TreeSet<OrganisationUnit>( orgUnitGroup.getMembers() );
+            
+            Set<DataSet> dataSets = new TreeSet<DataSet>();
+            
+            for( OrganisationUnit orgUnit : groupMember )
+            {
+                dataSets.addAll( orgUnit.getDataSets() );
+            }
+            
+            for( DataSet dataSet : dataSets )
+            {
+                dataElements.addAll( dataSet.getDataElements() );
+            }
+            
+            */
+            
+            for( DataSet dataSet : dataSetService.getDataSetsBySources( orgUnitGroup.getMembers() ) )
+            {
+                dataElements.addAll( dataSet.getDataElements() );
+            }
+            
+            
+            /*
             for( DataSet dataSet : orgUnitGroup.getDataSets() )
             {
                 dataElements.addAll( dataSet.getDataElements() );
             }
+            */
+            
+            
         }
             
         for( DataElement de : dataElements )

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java	2014-05-08 11:03:37 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java	2014-10-24 11:05:35 +0000
@@ -172,8 +172,16 @@
         // selecteddataElement ) );
 
         tariffList = new ArrayList<TariffDataValue>( tariffDataValueService.getTariffDataValues( orgUnitGroup, organisationUnit, selecteddataElement ) );
-
-        System.out.println( tariffList.size() + " : " + orgUnitGroup.getId() + " : " + organisationUnit.getId() + " : " + selecteddataElement.getId() );
+        
+        
+        //System.out.println( tariffList.size() + " : " + orgUnitGroup.getId() + " : " + organisationUnit.getId() + " : " + selecteddataElement.getId() );
+        
+        /*
+        for ( TariffDataValue value : tariffList )
+        {
+            System.out.println( "DataElement  name : "+ value.getDataElement().getName()  +  "dataSet name : "+ value.getDataSet().getName()  + " value : " + value.getValue()  + " start date : " + value.getStartDate().toString() + " End date : " + value.getEndDate().toString()  );
+        }
+        */
         
         List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );
 
@@ -186,7 +194,23 @@
             dataSets.add( dataSet );
         }
         
-        dataSets.retainAll( orgUnitGroup.getDataSets() );
+        /*
+        Set<OrganisationUnit> groupMember = new TreeSet<OrganisationUnit>( orgUnitGroup.getMembers() );
+        
+        Set<DataSet> tempDataSets = new TreeSet<DataSet>();
+        
+        for( OrganisationUnit orgUnit : groupMember )
+        {
+            tempDataSets.addAll( orgUnit.getDataSets() );
+        }
+        
+        dataSets.retainAll( tempDataSets );
+        
+        */
+        
+        dataSets.retainAll( dataSetService.getDataSetsBySources( orgUnitGroup.getMembers() ) );
+        
+        //dataSets.retainAll( orgUnitGroup.getDataSets() );
         
         /*
         System.out.println( "Lookup DataSet Size : " + dataSets.size() );
@@ -204,6 +228,11 @@
         }
         
         System.out.println( "Final DataSet Size : " + dataSets.size() );
+        
+        for( DataSet dataSet : dataSets )
+        {
+            System.out.println(" Final dataSet ---" + dataSet.getId() +" -- " + dataSet.getName() );
+        }      
         */
         
         return SUCCESS;

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowAddTariffDetailsFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowAddTariffDetailsFormAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowAddTariffDetailsFormAction.java	2014-10-24 11:05:35 +0000
@@ -0,0 +1,119 @@
+package org.hisp.dhis.rbf.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.rbf.api.Lookup;
+import org.hisp.dhis.rbf.api.LookupService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class ShowAddTariffDetailsFormAction implements Action
+{
+
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+   
+    @Autowired
+    private LookupService lookupService;
+
+    @Autowired
+    private DataSetService dataSetService;
+
+    @Autowired
+    private OrganisationUnitGroupService orgUnitGroupService;
+
+    // -------------------------------------------------------------------------
+    // Input / Output
+    // -------------------------------------------------------------------------
+    
+    private Integer orgUnitGroupId;
+
+    public void setOrgUnitGroupId( Integer orgUnitGroupId )
+    {
+        this.orgUnitGroupId = orgUnitGroupId;
+    }
+
+    private List<DataSet> dataSets = new ArrayList<DataSet>();
+
+    public List<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+    {
+
+        OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( orgUnitGroupId );
+
+        //System.out.println( tariffList.size() + " : " + orgUnitGroup.getId() + " : " + organisationUnit.getId() + " : " + selecteddataElement.getId() );
+        
+        List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );
+
+        for ( Lookup lookup : lookups )
+        {
+            Integer dataSetId = Integer.parseInt( lookup.getValue() );
+
+            DataSet dataSet = dataSetService.getDataSet( dataSetId );
+
+            dataSets.add( dataSet );
+        }
+        
+        /*
+        Set<OrganisationUnit> groupMember = new TreeSet<OrganisationUnit>( orgUnitGroup.getMembers() );
+        
+        Set<DataSet> tempDataSets = new TreeSet<DataSet>();
+        
+        for( OrganisationUnit orgUnit : groupMember )
+        {
+            tempDataSets.addAll( orgUnit.getDataSets() );
+        }
+        
+        dataSets.retainAll( tempDataSets );
+        */
+        
+        
+        dataSets.retainAll( dataSetService.getDataSetsBySources( orgUnitGroup.getMembers() ) );
+        
+        //dataSets.retainAll( orgUnitGroup.getDataSets() );
+        
+        /*
+        System.out.println( "Lookup DataSet Size : " + dataSets.size() );
+        
+        for( DataSet dataSet : dataSets )
+        {
+            System.out.println(" Lookup dataSet ---" + dataSet.getId() +" -- " + dataSet.getName() );
+        }
+        
+        System.out.println( " OrgUnit DataSet Size : " + orgUnitGroup.getDataSets().size() );
+        
+        for( DataSet dataSet : orgUnitGroup.getDataSets() )
+        {
+            System.out.println(" Group dataSet ---" + dataSet.getId() +" -- " + dataSet.getName() );
+        }
+        
+        System.out.println( "Final DataSet Size : " + dataSets.size() );
+        
+        for( DataSet dataSet : dataSets )
+        {
+            System.out.println(" Final dataSet ---" + dataSet.getId() +" -- " + dataSet.getName() );
+        }      
+        */
+        
+        return SUCCESS;
+    }
+}

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowUpdateTariffDetailsFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowUpdateTariffDetailsFormAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ShowUpdateTariffDetailsFormAction.java	2014-10-24 11:05:35 +0000
@@ -0,0 +1,183 @@
+package org.hisp.dhis.rbf.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+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.rbf.api.Lookup;
+import org.hisp.dhis.rbf.api.LookupService;
+import org.hisp.dhis.rbf.api.TariffDataValue;
+import org.hisp.dhis.rbf.api.TariffDataValueService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class ShowUpdateTariffDetailsFormAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    @Autowired
+    private TariffDataValueService tariffDataValueService;
+
+    @Autowired
+    private DataElementService dataElementService;
+
+    @Autowired
+    private OrganisationUnitService organisationUnitService;
+
+    @Autowired
+    private DataSetService dataSetService;
+ 
+    @Autowired
+    private OrganisationUnitGroupService orgUnitGroupService;
+    
+    @Autowired
+    private LookupService lookupService;
+    
+    // -------------------------------------------------------------------------
+    // Input
+    // -------------------------------------------------------------------------
+
+    private Integer organisationUnitId;
+    
+    public void setOrganisationUnitId( Integer organisationUnitId )
+    {
+        this.organisationUnitId = organisationUnitId;
+    }
+
+    private Integer orgUnitGroupId;
+    
+    public void setOrgUnitGroupId(Integer orgUnitGroupId)
+    {
+        this.orgUnitGroupId = orgUnitGroupId;
+    }
+    
+    private String dataElementId;
+
+    public void setDataElementId( String dataElementId )
+    {
+        this.dataElementId = dataElementId;
+    }
+    
+    private Integer dataSetId;
+    
+    public void setDataSetId( Integer dataSetId )
+    {
+        this.dataSetId = dataSetId;
+    }
+
+    private String startDate;
+    
+    public void setStartDate( String startDate )
+    {
+        this.startDate = startDate;
+    }
+    
+    private String endDate;
+    
+    public void setEndDate( String endDate )
+    {
+        this.endDate = endDate;
+    }
+    
+    private TariffDataValue tariffDataValue;
+
+    public TariffDataValue getTariffDataValue()
+    {
+        return tariffDataValue;
+    }
+    
+    private List<DataSet> dataSets = new ArrayList<DataSet>();
+
+    public List<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+    
+    
+    private String tariffStartDate;
+    
+    public String getTariffStartDate()
+    {
+        return tariffStartDate;
+    }
+    
+    private String tariffEndDate;
+    
+    public String getTariffEndDate()
+    {
+        return tariffEndDate;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+        
+        Date sDate = dateFormat.parse( startDate );
+        Date eDate = dateFormat.parse( endDate );
+
+        DataElement dataElement = dataElementService.getDataElement( Integer.parseInt( dataElementId ) );
+
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
+        
+        OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( orgUnitGroupId );
+
+        DataSet dataSet = dataSetService.getDataSet( dataSetId );
+        
+        tariffDataValue = new TariffDataValue();
+        
+        tariffDataValue = tariffDataValueService.getTariffDataValue( organisationUnit, orgUnitGroup, dataElement, dataSet, sDate, eDate );
+        
+        tariffStartDate = dateFormat.format( tariffDataValue.getStartDate() );
+        
+        tariffEndDate = dateFormat.format( tariffDataValue.getEndDate() );
+        
+        List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );
+
+        for ( Lookup lookup : lookups )
+        {
+            Integer dataSetId = Integer.parseInt( lookup.getValue() );
+
+            DataSet pbfDataSet = dataSetService.getDataSet( dataSetId );
+
+            dataSets.add( pbfDataSet );
+        }
+        
+        /*
+        Set<OrganisationUnit> groupMember = new TreeSet<OrganisationUnit>( orgUnitGroup.getMembers() );
+        
+        Set<DataSet> tempDataSets = new TreeSet<DataSet>();
+        
+        for( OrganisationUnit orgUnit : groupMember )
+        {
+            tempDataSets.addAll( orgUnit.getDataSets() );
+        }
+        
+        dataSets.retainAll( tempDataSets );
+        */
+        
+        dataSets.retainAll( dataSetService.getDataSetsBySources( orgUnitGroup.getMembers() ) );
+        
+        //dataSets.retainAll( orgUnitGroup.getDataSets() );
+        
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java	2014-06-20 10:21:56 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java	2014-10-24 11:05:35 +0000
@@ -5,6 +5,7 @@
 
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.option.Option;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
 
@@ -32,6 +33,9 @@
     private Date timestamp;
 
     private String comment;
+    
+    private Option option;
+
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -209,4 +213,16 @@
     {
         this.comment = comment;
     }
+    
+    public Option getOption()
+    {
+        return option;
+    }
+
+    public void setOption( Option option )
+    {
+        this.option = option;
+    }
+
+    
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java	2014-10-24 11:05:35 +0000
@@ -389,12 +389,20 @@
             orgUnitBranchIds += "," + orgUnit.getId();
         }
         
+        
+        
+        
+        
+        
         OrganisationUnitGroup orgUnitGroup = findPBFOrgUnitGroupforTariff( organisationUnit, dataSet.getId(), orgUnitBranchIds );
         if( orgUnitGroup != null )
         {
             tariffDataValueMap.putAll( tariffDataValueService.getTariffDataValues( orgUnitGroup, orgUnitBranchIds, dataSet, period ) );
         }
         
+        //System.out.println( orgUnitBranchIds + " : " + orgUnitGroup.getId() + " : " + organisationUnit.getId() + " : " + dataSet.getId() );
+        
+        
         /*
         OrganisationUnit parentOrgunit = findParentOrgunitforTariff( organisationUnit, tariff_setting_authority );
 
@@ -556,10 +564,13 @@
     {
         Set<Integer> orgUnitGroupIds = tariffDataValueService.getOrgUnitGroupsByDataset( dataSetId, orgUnitIds );
         
+        //System.out.println( " orgUnitGroupIds : " + orgUnitGroupIds  );
+        
         OrganisationUnitGroup orgUnitGroup = null;
         if( orgUnitGroupIds != null && orgUnitGroupIds.size() > 0 )
         {
              orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( orgUnitGroupIds.iterator().next() );
+             //System.out.println( " 1 orgUnitGroup : " + orgUnitGroup.getId()  );
         }
         else
         {        
@@ -568,6 +579,8 @@
             OrganisationUnitGroupSet orgUnitGroupSet = orgUnitGroupService.getOrganisationUnitGroupSet( (int) tariff_authority.getValue() );
         	
             orgUnitGroup = organisationUnit.getGroupInGroupSet( orgUnitGroupSet );
+            
+            //System.out.println( " 2 orgUnitGroup : " + orgUnitGroup.getId()  );
         }
     	
     	return orgUnitGroup;

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateTariffDataValueStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateTariffDataValueStore.java	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateTariffDataValueStore.java	2014-10-24 11:05:35 +0000
@@ -177,6 +177,7 @@
         return criteria.list();
     }
     
+    @SuppressWarnings( "unchecked" )
     @Override
     public Collection<TariffDataValue> getTariffDataValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement )
     {
@@ -277,6 +278,8 @@
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         String curPeriod = simpleDateFormat.format( period.getEndDate() );
         
+        
+        
         try
         {
             /*String query = "SELECT dataelementid, value FROM tariffdatavalue " +
@@ -308,7 +311,7 @@
                                                 " and sag1.level=td.orgunitlevelid ";
                                                 //" and td.organisationunitid in ("+ orgUnitBranchIds +") ";
             
-            //System.out.println("Query: " + query );
+            System.out.println(" tariff Query: " + query );
             SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
             while ( rs.next() )
             {

=== added directory 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner'
=== added directory 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action'
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/GetDataElementAndPeriodListAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/GetDataElementAndPeriodListAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/GetDataElementAndPeriodListAction.java	2014-10-24 11:05:35 +0000
@@ -0,0 +1,123 @@
+package org.hisp.dhis.rbf.partner.action;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class GetDataElementAndPeriodListAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    @Autowired
+    private DataSetService dataSetService;
+    
+    @Autowired
+    private PeriodService periodService;
+    
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+    
+    private Integer dataSetId;
+
+    public void setDataSetId( Integer dataSetId )
+    {
+        this.dataSetId = dataSetId;
+    }
+
+    private List<DataElement> dataElements = new ArrayList<DataElement>();
+    
+    public List<DataElement> getDataElements()
+    {
+        return dataElements;
+    }
+
+    private List<Period> periods = new ArrayList<Period>();
+
+    public List<Period> getPeriods()
+    {
+        return periods;
+    }
+    
+    
+    // -------------------------------------------------------------------------
+    // Action
+    // -------------------------------------------------------------------------
+    
+    public String execute() throws Exception
+    {
+        DataSet dataSet = dataSetService.getDataSet( dataSetId );
+        
+        dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
+        
+        String periodTypeName = dataSet.getPeriodType().getName();
+        
+        PeriodType periodType = periodService.getPeriodTypeByName( periodTypeName );
+        
+        periods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( periodType ) );  
+        
+        Iterator<Period> periodIterator = periods.iterator();
+        while( periodIterator.hasNext() )
+        {
+            Period p1 = periodIterator.next();
+            
+            if ( p1.getStartDate().compareTo( new Date() ) > 0 )
+            {
+                periodIterator.remove( );
+            }
+            
+        }
+
+        for ( Period period : periods )
+        {
+            period.setName( format.formatPeriod( period ) );
+        }
+        
+        Collections.reverse( periods );
+       
+        /*
+        for ( DataElement de : dataElements )
+        {
+            System.out.println( " DataElement name -- " + de.getName() );
+        }
+        
+        for ( Period period : periods )
+        {
+            System.out.println( " Period name -- " + period.getName() );
+        }
+        */
+        
+        
+        //System.out.println( " Size of orgUnitList First -- " + orgUnitList.size() );
+        
+        
+        return SUCCESS;
+    }
+
+
+}

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java	2014-10-24 11:05:35 +0000
@@ -0,0 +1,80 @@
+package org.hisp.dhis.rbf.partner.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.option.Option;
+import org.hisp.dhis.option.OptionService;
+import org.hisp.dhis.option.OptionSet;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class PartnerFormAction implements Action
+{
+    private final String OPTION_SET_PARTNER = "Partner";
+    
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    @Autowired
+    private OptionService optionService;
+    
+    @Autowired
+    private DataSetService dataSetService;
+    
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+ 
+    private List<DataSet> dataSets = new ArrayList<DataSet>();
+
+    public List<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+    
+    private List<Option> options = new ArrayList<Option>();
+    
+    public List<Option> getOptions()
+    {
+        return options;
+    }
+    
+    
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+
+    public String execute() throws Exception
+    {
+        
+        OptionSet activitesOptionSet = optionService.getOptionSetByName( OPTION_SET_PARTNER );
+        
+        if( activitesOptionSet != null )
+        {
+            options = new ArrayList<Option>( activitesOptionSet.getOptions() );
+        }
+        
+        dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
+        
+        /*
+        for ( Option option : options )
+        {       
+            option.getId();
+            
+            System.out.println( " Option Id -- " + option.getId() + " Option name -- " + option.getName() );
+        }
+        */
+        
+        return SUCCESS;
+    }
+
+}

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java	2014-10-24 11:05:35 +0000
@@ -0,0 +1,137 @@
+package org.hisp.dhis.rbf.partner.action;
+
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.option.Option;
+import org.hisp.dhis.option.OptionService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.oust.manager.SelectionTreeManager;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.rbf.api.PBFDataValue;
+import org.hisp.dhis.rbf.api.PBFDataValueService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class SavePartnerDetailsResultAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    private SelectionTreeManager selectionTreeManager;
+    
+    public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
+    {
+        this.selectionTreeManager = selectionTreeManager;
+    }
+    
+    private PBFDataValueService pbfDataValueService;
+    
+    public void setPbfDataValueService(PBFDataValueService pbfDataValueService) 
+    {
+        this.pbfDataValueService = pbfDataValueService;
+    }
+    
+    @Autowired
+    private DataSetService dataSetService;
+    
+    @Autowired
+    private DataElementService dataElementService;
+    
+    @Autowired
+    private PeriodService periodService;
+    
+    @Autowired
+    private OptionService optionService;
+    
+    
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+    
+    private Integer dataSetId;
+    
+    public void setDataSetId( Integer dataSetId )
+    {
+        this.dataSetId = dataSetId;
+    }
+    
+    private Integer optionSetId;
+    
+    public void setOptionSetId( Integer optionSetId )
+    {
+        this.optionSetId = optionSetId;
+    }
+    
+    private Integer dataElementId;
+    
+    public void setDataElementId( Integer dataElementId )
+    {
+        this.dataElementId = dataElementId;
+    }
+    
+    private Integer periodId;
+    
+    public void setPeriodId( Integer periodId )
+    {
+        this.periodId = periodId;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Action
+    // -------------------------------------------------------------------------
+
+
+    public String execute() throws Exception
+    {
+        
+        DataSet dataSet = dataSetService.getDataSet( dataSetId );
+        
+        DataElement dataElement = dataElementService.getDataElement( dataElementId );
+        
+        Period period = periodService.getPeriod( periodId );
+        
+        Option option = optionService.getOption( optionSetId );
+        
+        /*
+        System.out.println( " Option name -- " + option.getName() );
+        System.out.println( " dataSet name -- " + dataSet.getName() );
+        System.out.println( " dataElement name -- " + dataElement.getName() );
+        System.out.println( " period name -- " + period.getName() );
+        */
+        
+        Set<OrganisationUnit> selectedOrgUnitList = new HashSet<OrganisationUnit>( selectionTreeManager.getReloadedSelectedOrganisationUnits() );
+        
+        for ( OrganisationUnit organisationUnit : selectedOrgUnitList )
+        {
+            PBFDataValue pbfDataValue = pbfDataValueService.getPBFDataValue( organisationUnit, dataSet, period, dataElement );
+            
+            if ( pbfDataValue != null )
+            {
+                pbfDataValue.setOption( option );
+                pbfDataValue.setTimestamp( new Date() );
+
+                pbfDataValueService.updatePBFDataValue( pbfDataValue );
+            }
+            
+            //System.out.println( " orgUnit name -- " + organisationUnit.getName() );
+        }
+        
+        //System.out.println( " Size of orgUnitList First -- " + orgUnitList.size() );
+        
+        
+        return SUCCESS;
+    }
+    
+}

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java	2014-07-30 11:58:29 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java	2014-10-24 11:05:35 +0000
@@ -110,15 +110,30 @@
             }
         }
 
-        dataSets.addAll( orgUnitGroup.getDataSets() );
+        /*
+        Set<OrganisationUnit> groupMember = new TreeSet<OrganisationUnit>( orgUnitGroup.getMembers() );
+        
+        Set<DataSet> tempDataSets = new TreeSet<DataSet>();
+        
+        for( OrganisationUnit orgUnit : groupMember )
+        {
+            tempDataSets.addAll( orgUnit.getDataSets() );
+        }
+        
+        dataSets.addAll( tempDataSets );
+        */
+        
+        dataSets.retainAll( dataSetService.getDataSetsBySources( orgUnitGroup.getMembers() ) );
+        
+        //dataSets.addAll( orgUnitGroup.getDataSets() );
 
-        System.out.println( "Before : " + dataSets.size() );
+        //System.out.println( "Before : " + dataSets.size() );
 
         dataSets.retainAll( pbfDataSets );
 
         Collections.sort( dataSets );
 
-        System.out.println( "After : " + dataSets.size() );
+        //System.out.println( "After : " + dataSets.size() );
 
         if ( dataSets.size() > 0 )
         {

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityMaxScoreAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityMaxScoreAction.java	2014-08-04 06:49:50 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityMaxScoreAction.java	2014-10-24 11:05:35 +0000
@@ -127,7 +127,7 @@
         
         for ( String qualityMaxValue : qualityMaxValues )
         {
-            System.out.println( qualityMaxValue  );
+            //System.out.println( qualityMaxValue  );
         }
         
         

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java	2014-10-24 11:05:35 +0000
@@ -267,11 +267,19 @@
 
         OrganisationUnitGroup orgUnitGroup = findPBFOrgUnitGroupforTariff( organisationUnit, dataSet.getId(), orgUnitBranchIds );
         
+        
+        //System.out.println(" DataSet Id ---" + dataSet.getId()  );
+        //System.out.println(" orgUnitGroup Id ---" + orgUnitGroup.getId()  );
+        //System.out.println(" orgUnitBranch Ids ---" + orgUnitBranchIds  );
+        //System.out.println(" period Id ---" + period.getId()  );
+        
         if( orgUnitGroup != null )
         {
             qualityMaxValueMap.putAll( qualityMaxValueService.getQualityMaxValues( orgUnitGroup, orgUnitBranchIds, dataSet, period ) );
         }
-
+        
+ 
+        
         //List<DataElement> dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
         
         
@@ -322,7 +330,15 @@
         
         dataElements = new ArrayList<DataElement>( geti18nDataElements( dataElementList ) );
         
+        /*
+        for ( DataElement de : dataElements )
+        {
+            System.out.println(" de name ---" + de.getId() + "-"+ de.getDisplayName() +" Quality max value is : " + qualityMaxValueMap.get( de.getId() )  );
+            
+        }
+        */
         
+       
         for ( DataElement dataElement : dataElements )
         {
             DataValue dataValue = dataValueService.getDataValue( dataElement, period, organisationUnit, optionCombo );

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml	2014-10-24 11:05:35 +0000
@@ -135,6 +135,16 @@
 		<property name="lookupService" ref="org.hisp.dhis.rbf.api.LookupService" />
     </bean>
     
+    
+    <!-- Add tariff details form -->
+    <bean id="org.hisp.dhis.rbf.action.ShowAddTariffDetailsFormAction" class="org.hisp.dhis.rbf.action.ShowAddTariffDetailsFormAction" scope="prototype">
+    </bean>   
+    
+     <!-- Add tariff details form -->
+    <bean id="org.hisp.dhis.rbf.action.ShowUpdateTariffDetailsFormAction" class="org.hisp.dhis.rbf.action.ShowUpdateTariffDetailsFormAction" scope="prototype">
+    
+    </bean>    
+    
     <!-- Add Tariff -->
 	<bean id="org.hisp.dhis.rbf.action.AddTariffDataAction" class="org.hisp.dhis.rbf.action.AddTariffDataAction" scope="prototype">
 		<property name="tariffDataValueService" ref="org.hisp.dhis.rbf.api.TariffDataValueService" />
@@ -787,9 +797,26 @@
 -->	
 	
 	
-	
-	
-	
+    <!-- Partner Form -->
+    <bean id="org.hisp.dhis.rbf.partner.action.PartnerFormAction"
+        class="org.hisp.dhis.rbf.partner.action.PartnerFormAction"
+        scope="prototype">
+    </bean>	
+
+    <!-- Get DataElements and Periods List-->
+    <bean id="org.hisp.dhis.rbf.partner.action.GetDataElementAndPeriodListAction"
+        class="org.hisp.dhis.rbf.partner.action.GetDataElementAndPeriodListAction"
+        scope="prototype">
+    </bean>
+
+	
+    <!-- Partner Form Save -->
+    <bean id="org.hisp.dhis.rbf.partner.action.SavePartnerDetailsResultAction"
+        class="org.hisp.dhis.rbf.partner.action.SavePartnerDetailsResultAction"
+        scope="prototype">
+        <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
+        <property name="pbfDataValueService" ref="org.hisp.dhis.rbf.api.PBFDataValueService" />
+    </bean>		
 	
 	
 	

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml	2014-06-20 10:21:56 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml	2014-10-24 11:05:35 +0000
@@ -26,6 +26,8 @@
     <property name="timestamp" column="lastupdated" type="timestamp" />
 
     <property name="comment" length="360" />
-
+    
+	<many-to-one name="option" class="org.hisp.dhis.option.Option" column="optionid" not-null="false" foreign-key="fk_pbfdatavalue_optionid" />    
+    
   </class>
 </hibernate-mapping>

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties	2014-10-24 11:05:35 +0000
@@ -113,3 +113,9 @@
 quality_max_score = Quality Max Score
 
 dataset_is_locked = Data set is locked
+
+partner_management = Partner Management
+dataSet = DataSet
+partner = Partner
+dataElement = DataElement
+

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml	2014-10-24 11:05:35 +0000
@@ -23,10 +23,25 @@
 			<param name="stylesheets">../dhis-web-commons/javascripts/ext/resources/css/ext-all-gray.css</param>
 			<param name="requiredAuthorities">F_PBF_DATAELEMENT_TARIFF_MANAGEMENT</param>
 		</action>
+		
 		<action name="loadTariffDetails" class="org.hisp.dhis.rbf.action.LoadTariffDetailsAction">
 			<result name="success" type="velocity">/content.vm</result>
 			<param name="page">/dhis-web-maintenance-rbf/loadTariffData.vm</param>
 		</action>
+		
+		<!--  add tariffDetails form -->
+		<action name="showAddTariffDetailsForm" class="org.hisp.dhis.rbf.action.ShowAddTariffDetailsFormAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-maintenance-rbf/loadTariffAddDetailsForm.vm</param>
+		</action>		
+		
+		<!--  Update tariffDetails form -->
+		<action name="showUpdateTariffDetailsForm" class="org.hisp.dhis.rbf.action.ShowUpdateTariffDetailsFormAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-maintenance-rbf/loadTariffUpdateDetailsForm.vm</param>
+		</action>		
+		
+		<!--  add/update tariff -->
 		 <action name="addTariffData" class="org.hisp.dhis.rbf.action.AddTariffDataAction">
 			<result name="success" type="velocity-json">/dhis-web-maintenance-rbf/tariffStatus.vm</result>
 			<param name="onExceptionReturn">plainTextError</param>					
@@ -604,7 +619,7 @@
 
 
     <!-- PBF Reports -->
-    <action name="PBFInvoiceReportForm" class="org.hisp.dhis.rbf.report.action.PBFInvoiceReportFormAction">
+   <action name="PBFInvoiceReportForm" class="org.hisp.dhis.rbf.report.action.PBFInvoiceReportFormAction">
         <result name="success" type="velocity">/main.vm</result>
         <param name="page">/dhis-web-maintenance-rbf/PBFInvoiceReportForm.vm</param>
         <param name="javascripts">javascript/prevNextPeriods.js</param>
@@ -627,10 +642,29 @@
 	-->	
 
 
-
-
-
-
+   <!-- PBF Reports -->
+   <action name="partnerForm" class="org.hisp.dhis.rbf.partner.action.PartnerFormAction">
+        <result name="success" type="velocity">/main.vm</result>
+        <param name="page">/dhis-web-maintenance-rbf/partnerForm.vm</param>
+        <param name="javascripts">javascript/partner.js</param>
+        <param name="menu">/dhis-web-maintenance-rbf/menu.vm</param>
+        <param name="requiredAuthorities">F_PBF_PARTNER</param>
+   </action>
+
+
+	<!-- Get DataElements and Periods List-->
+	<action name="getDataElementsAndPeriodList" class="org.hisp.dhis.rbf.partner.action.GetDataElementAndPeriodListAction">
+		<result name="success" type="velocity-xml">/dhis-web-maintenance-rbf/responseDataElementAndPeriods.vm</result>
+		<param name="onExceptionReturn">plainTextError</param>
+		<param name="requiredAuthorities">F_PBF_PARTNER</param>
+	</action>
+
+
+
+    <action name="partnerFormResult" class="org.hisp.dhis.rbf.partner.action.SavePartnerDetailsResultAction">
+        <result name="success" type="redirect">index.action</result>
+        <param name="requiredAuthorities">F_PBF_PARTNER</param>
+    </action>
 
 
 

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/partner.js'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/partner.js	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/partner.js	2014-10-24 11:05:35 +0000
@@ -0,0 +1,81 @@
+
+// Load DataElement and Period List
+function loadDataElementAndPeriod()
+{
+
+	var dataSetId = $( '#dataSetId' ).val();
+	
+	if ( dataSetId == "-1" )
+	{
+		showWarningMessage( "Please Select DataSet" );
+		
+		//document.getElementById( "dataSetId" ).disabled = true;
+		
+		//document.getElementById( "selectedPeriodId" ).disabled = true;
+		//document.getElementById( "prevButton" ).disabled = true;
+		//document.getElementById( "nextButton" ).disabled = true;
+		
+		return false;
+	}
+	
+	else
+	{
+		//enable('dataSetId');
+		
+		$.post("getDataElementsAndPeriodList.action",
+				{
+					dataSetId:dataSetId
+				},
+				function(data)
+				{
+					
+					populateDataElementAndPeriodList( data );
+					//loadDataSets();				
+				},'xml');
+	}
+	
+}
+
+
+function populateDataElementAndPeriodList( data )
+{
+	var dataElementId = document.getElementById("dataElementId");
+	clearList( dataElementId );
+	
+	var periodId = document.getElementById("periodId");
+	clearList( periodId );
+	
+	var dataElementList = data.getElementsByTagName("dataelement");
+	
+	dataElementId.options[0] = new Option( "Select", "-1" , false, false);
+	
+	for ( var i = 0; i < dataElementList.length; i++ )
+	{
+		var id = dataElementList[ i ].getElementsByTagName("id")[0].firstChild.nodeValue;
+		var name = dataElementList[ i ].getElementsByTagName("name")[0].firstChild.nodeValue;
+		
+		var option = document.createElement("option");
+		option.value = id;
+		option.text = name;
+		option.title = name;
+		dataElementId.add(option, null);
+	} 
+	
+	var periodList = data.getElementsByTagName("period");
+	
+	periodId.options[0] = new Option( "Select", "-1" , false, false);
+	
+	for ( var i = 0; i <  periodList.length; i++ )
+	{
+		var id = periodList[ i ].getElementsByTagName("id")[0].firstChild.nodeValue;
+		var name = periodList[ i ].getElementsByTagName("name")[0].firstChild.nodeValue;
+		
+		var option = document.createElement("option");
+		option.value = id;
+		option.text = name;
+		option.title = name;
+		periodId.add(option, null);
+	} 
+	
+}
+

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.vm	2014-05-15 06:51:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.vm	2014-10-24 11:05:35 +0000
@@ -1,4 +1,5 @@
 <script >
+
 	var windowWidth = $(window).width();
 	var windowHeight = $(window).height();
 	var tableWidth = (parseInt( windowWidth ) * 70.2) / 100 ;	
@@ -54,6 +55,11 @@
 });
 
 var changeOwner = function(combo, record, index) {
+
+						//jQuery('#loadTariffDetails').dialog('destroy').remove();
+						
+						setInnerHTML('loadTariffDetails', '');
+						
 						var dataElementName = combo.getValue();
 						$('#dataElementName').val(dataElementName);
         				$('#loadTariffDetails').load("loadTariffDetails.action", 
@@ -68,6 +74,9 @@
 	
 function getTariffData()
 {
+  //jQuery('#loadTariffDetails').dialog('destroy').remove();
+  
+  setInnerHTML('loadTariffDetails', '');
   $('#loadTariffDetails').load("loadTariffDetails.action", 
             				{
             					dataElementName : $('#dataElementName').val(),								
@@ -198,4 +207,5 @@
 </div>
 <br/><br/><br/>
 <div id="loadTariffDetails" style="width:85%"></div>
+
 	
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff_old.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff_old.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff_old.vm	2014-10-24 11:05:35 +0000
@@ -0,0 +1,201 @@
+<script >
+	var windowWidth = $(window).width();
+	var windowHeight = $(window).height();
+	var tableWidth = (parseInt( windowWidth ) * 70.2) / 100 ;	
+	var columnWidth = (parseInt( windowWidth ) * 10) / 100 ;
+$(function() {
+	$("#addDataElement").button();
+});
+Ext.require([
+    'Ext.form.field.ComboBox',    
+    'Ext.form.FieldSet', 	
+    'Ext.data.*'
+]);
+Ext.Loader.setConfig({
+		enabled: true
+	});
+	
+// Define the model for a State
+Ext.define('State', {
+    extend: 'Ext.data.Model',
+    fields: [        
+        {type: 'string', name: 'name'}
+    ]
+});
+
+// The data for all states
+var states = $dataElementList;
+
+
+function createStore() {
+    // The data store holding the states; shared by each of the ComboBox examples below
+    return Ext.create('Ext.data.Store', {
+        autoDestroy: true,
+        model: 'State',
+        data: states
+    });
+}
+Ext.onReady(function() {
+    Ext.tip.QuickTipManager.init();
+    // Simple ComboBox using the data store
+    var simpleCombo = Ext.create('Ext.form.field.ComboBox', {
+		fieldLabel: '',
+        renderTo: 'simpleCombo',
+        displayField: 'name',
+        labelWidth: 115,
+        width: 680,
+        size:58,
+        store: createStore(),
+        queryMode: 'local',
+        typeAhead: true,
+		listeners: {select: changeOwner}
+    });	
+	
+});
+
+var changeOwner = function(combo, record, index) {
+						var dataElementName = combo.getValue();
+						$('#dataElementName').val(dataElementName);
+        				$('#loadTariffDetails').load("loadTariffDetails.action", 
+            				{
+            					dataElementName:dataElementName,
+								orgUnitGroupId : $( "#orgUnitGroupId" ).val(),
+								orgUnitUid:$("#orgUnitUid").val()
+            				}
+            				, function( ){            										
+        				});
+	};
+	
+function getTariffData()
+{
+  $('#loadTariffDetails').load("loadTariffDetails.action", 
+            				{
+            					dataElementName : $('#dataElementName').val(),								
+								orgUnitGroupId : $( "#orgUnitGroupId" ).val(),
+								orgUnitUid : $("#orgUnitUid").val()
+            				}
+            				, function( ){  
+							loadExtTariff();
+        				});  	
+}
+
+function orgUnitGroupChange()
+{
+    if( $('#orgUnitGroupId').val() == "-1" )
+    {
+        document.getElementById('simpleCombo').style.display = 'none';
+        document.getElementById('loadTariffDetails').style.display = 'none';
+    }
+    else
+    {
+        document.getElementById('simpleCombo').style.display = 'block';
+        document.getElementById('loadTariffDetails').style.display = 'block';
+		
+		/*
+		$('#simpleCombo').load("dataElementTariffManagement.action",
+		{
+			orgUnitGroupId : $( "#orgUnitGroupId" ).val()
+        }
+            				, function( ){  
+							
+        				});  	
+		
+		*/
+        if( $('#dataElementName').val() != '' )
+        {
+            getTariffData();
+        }	
+	}
+}
+
+function organisationUnitSelected( orgUnits, orgUnitNames )
+{
+	document.getElementById('simpleCombo').style.display = 'block';
+    enable('orgUnit'); 
+    setFieldValue("orgUnit", orgUnitNames[0]);
+	setFieldValue("orgUnitUid", orgUnits[0]);
+	document.getElementById('loadTariffDetails').style.display = 'block';
+	if( $('#dataElementName').val() != '' && $( "#orgUnitGroupId" ).val() != "-1" )
+	{
+		getTariffData();	
+	}
+}
+
+selection.setListenerFunction( organisationUnitSelected );
+
+function loadExtTariff()
+{
+			
+}
+
+</script>
+<style >
+	#tariffSetting {
+   width: 280px;
+   height: 50px;
+   margin: 10px 10px 10px 10px;
+   float:right;
+   padding: 10px 10px 10px 10px ;
+   font: 1.6em bold;
+   background: #ccc;
+   box-shadow: 2px 2px 2px rgba(0,0,0,0.5),
+   inset 8px 10px 10px rgba(255,255,255,0.75);   
+   -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,0.5),
+   inset 8px 10px 10px rgba(255,255,255,0.75);
+   -moz-box-shadow: 2px 2px 2px rgba(0,0,0,0.5),
+   inset 8px 10px 10px rgba(255,255,255,0.75);
+   }
+</style>
+
+<!--
+<div width="100%">
+	<div id="tariffSetting">
+		Tariff Setting Authority : $!tariff_setting_authority
+    </div>
+</div>
+-->
+
+<h3>$i18n.getString( "dataelement_tariff_target_management" )</h3>
+<br/>
+<input type="hidden" name="orgUnitUid" id="orgUnitUid" />
+<input type="hidden" name="dataElementName" id="dataElementName" value="" />
+<div class="inputCriteria" style="height:130px;">
+<table >	
+    <tr>
+        <td>Orgainsation Unit: </td>
+        <td>
+        	<input type="text" id="orgUnit" name="orgUnit" readonly size="55" />
+        	<input type="hidden" id="orgUnit" name="orgUnit" readonly size="55" style="display:none" />
+        </td>
+        <td>&nbsp;</td>
+    </tr>
+    <tr>
+        <td >&nbsp;</td>
+        <td >&nbsp;</td>
+    </tr>
+	<tr>
+		<td>Orgainsation Unit Group: </td>
+		<td> 
+		    <select id="orgUnitGroupId" name="orgUnitGroupId" onchange="javascript:orgUnitGroupChange()" style="width:52%">
+                <option value="-1">[Please select]</option>		    	
+                #foreach( $orgUnitGroup in $orgUnitGroups )
+                	<option value="$!orgUnitGroup.id">$!orgUnitGroup.name</option>
+                #end
+      		</select>      		
+      	</td>
+		<td >&nbsp;</td>
+	</tr>
+	<tr >
+		<td >&nbsp;</td>
+		<td >&nbsp;</td>
+    </tr>
+	<tr>
+		<td>Select DataElement: </td>
+		<td><div id="simpleCombo" style="display:none;"></div></td>
+		<td ><input type="button" id="addDataElement" value="Add DataElement" disabled style="display:none;"/></td>
+	</tr>
+</table>
+</div>
+<br/><br/><br/>
+<div id="loadTariffDetails" style="width:85%"></div>
+	
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffAddDetailsForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffAddDetailsForm.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffAddDetailsForm.vm	2014-10-24 11:05:35 +0000
@@ -0,0 +1,108 @@
+## Macro for generating the jQuery validation rules
+#macro( validate $type $require )
+  #if( $type == "NUMBER" )
+    {validate:{ number:true #if($require), required:true #end }}
+  #elseif( $require )
+    {validate:{required:true}}
+  #end
+#end
+
+<script type="text/javascript" >
+
+$( document ).ready( function() {
+	//datePickerInRange( 'startDate' , 'endDate' );
+	//datePicker( 'startDate');// for allowed future period
+	//datePicker( 'endDate');// for allowed future period
+	//datePickerValid( 'startDate' ); // for not allowes future period
+	//datePickerValid( 'endDate' ); // for not allowes future period
+	
+} );
+
+
+function validateAddTariff()
+{
+	if($("#pbfType ").val() != '-1' && $("#tariff").val() != "" && $("#startDate").val() != "" && $("#endDate").val() != "")
+    {
+		$( '#saveAddTariffButton' ).removeAttr( 'disabled' );
+    }
+    else
+    {
+		document.getElementById( "saveAddTariffButton" ).disabled = true;
+		
+    }
+}
+	
+</script>
+
+<table style="width:100%;table-layout:fixed;">
+	<tr >
+		<td style="width:40%;">PBF Type <b class="mandatory">*</b> </td>
+		<td style="width:60%;">
+			<select id="pbfType" style="width:100%;" name = "pbfType" onblur="validateAddTariff()" >
+				<option value="-1">Select PBF Type</option>
+				#foreach( $dataSet in $dataSets )
+					<option value="$dataSet.id">$dataSet.name</option>
+				#end
+            </select>
+		</td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Start Date <b class="mandatory">*</b> </td>
+		<td style="width:60%;"><input type="text" id="startDate" style="width:100%;" name = "startDate" onblur="validateAddTariff()" />
+			<script type="text/javascript">
+            	datePicker( 'startDate' );
+            </script>
+		</td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">End Date <b class="mandatory">*</b> </td>
+		<td style="width:60%;"><input type="text" id="endDate" style="width:100%;" name = "endDate" onblur="validateAddTariff()"  />
+    		<script type="text/javascript">
+            	datePicker( 'endDate' );
+            </script>
+		</td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Tariff <b class="mandatory">*</b> </td>
+		<td style="width:60%;"><input type="text" id="tariff" style="width:100%;" name = "tariff" onblur="validateAddTariff()" /></td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Target  </td>
+		<td style="width:60%;"><input type="text" id="target" style="width:100%;"  name = "target" /></td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Target % </td>
+		<td style="width:60%;"><input type="text" id="targetPercentage" name = "targetPercentage" style="width:100%;" /></td>
+    </tr>
+	
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>	
+
+	<tr >
+       	<td>&nbsp;</td>
+        <td>
+        	<input type="button"  id="saveAddTariffButton" value="$i18n.getString( 'Save' )" style="width:75px" onclick="validateTariff();"/>&nbsp;&nbsp;
+        	&nbsp;&nbsp;<input type="button" id="cancelAddTariffButton" value="$i18n.getString( 'Cancel' )" onclick="dialogWindowClose();" style="width:75px"/>
+		</td>
+    </tr>	
+
+</table>
+<script type="text/javascript" >
+	validateAddTariff();
+</script>	
\ No newline at end of file

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm	2014-07-17 13:15:11 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm	2014-10-24 11:05:35 +0000
@@ -1,6 +1,13 @@
 
 <script type="text/javascript" >
 
+window.onload=function(){
+	jQuery('#addTariff').dialog({autoOpen: false});	
+}
+
+
+
+
 	Ext.Loader.setConfig({
 		enabled: true
 	});
@@ -75,98 +82,93 @@
 			
 			grid.render();
 			
-datePicker( 'startDate');
-datePicker( 'endDate');
-$("#openAddTariff").button()
-			.click(function() {
-			
-			validateAddTariff();
-
-			$( "#addTariff" ).dialog('option', 'title', 'Add New Tariff');
-			$( "#addTariff" ).dialog( "open" );
-			$('#pbfType option[value=-1]').attr('selected','selected');
-			$("#pbfType ").removeAttr('disabled');
-			$("#tariff").val('');
-			$("#target").val('');
-			$("#targetPercentage").val('');
-			$("#startDate").val('');
-			$("#startDate ").removeAttr('disabled');
-			$("#endDate").val('');
-			$("#endDate ").removeAttr('disabled');
 });
-			
-			
-$( "#addTariff" ).dialog({
-			width: 320,
-			autoOpen: false,			
-			modal: true,
-			buttons: [
-        {
-            id: "button-save",
-            text: "Save",
-            click: function() {
-                validateTariff();
-            }
-        },
-        {
-            id: "button-cancel",
-            text: "Cancel",
-            click: function() {
-                $(this).dialog("close");
-            }
-        }
-    ],
-			close: function() {				
-			}
+
+
+function showAddTariffDetailsForm()
+{
+		jQuery('#addTariff').dialog('destroy').remove();
+		
+		//validateAddTariff();
+		
+		orgUnitUid = $("#orgUnitUid").val();
+		orgUnitGroupId = $( "#orgUnitGroupId" ).val();
+		dataElementId = $( "#orgUnitGroupId" ).val();
+		
+		//alert( $( "#orgUnitGroupId" ).val() );
+		//alert( $("#orgUnitUid").val() );
+		//alert( $("#dataElementId").val() );
+		
+		jQuery('<div id="addTariff">' ).load( 'showAddTariffDetailsForm.action?orgUnitUid='+ orgUnitUid + "&orgUnitGroupId=" + orgUnitGroupId + "&dataElementId=" + dataElementId ).dialog({
+		title: 'Add New Tariff Details',
+		maximize: true,
+		closable: true,
+		modal:true,
+		overlay:{background:'#000000', opacity:0.1},
+		width: 320,
+		height: 350
 		});
 		
-});
-
-	function deleteTariffDataValue( organisationUnitId, orgUnitGroupId, dataElementId, dataSetId, startDate, endDate)
-	{
-		var dataValue = {		        		
-		        		'orgUnitGroupId' : orgUnitGroupId,
-		        		'organisationUnitId' : organisationUnitId,
-						'dataElementId' : dataElementId,								
-						'dataSetId' : dataSetId,
-						'startDate' : startDate,
-						'endDate' : endDate
-		    			};
-									
-		jQuery.ajax( {
-	                url: 'deleteTariffData.action', 
-					data: dataValue,
-	                dataType: 'json',
-					success: handleSuccess,
-	                error: handleError
-	              } );
-	    function handleSuccess( json )
-	    {
-			getTariffData();			
-	    }
-	    function handleError( json )
-	    {
-			getTariffData();			
-	    }
-	}
-
-	function editTariffDataValue( organisationUnitId, orgUnitGroupId, dataElementId, dataSetId, startDate, endDate, value, target, targetPercentage )
-	{	
-		validateAddTariff();
-		
-		$( "#addTariff" ).dialog('option', 'title', 'Edit Tariff');
-		$('#pbfType option[value='+dataSetId+']').attr('selected','selected');
-		$('#pbfType').attr('disabled','disabled');
-		$('#tariff').val(value);
-		$('#target').val(target);
-		$('#targetPercentage').val(targetPercentage);
-		$('#startDate').val(startDate);
-		$('#startDate').attr('disabled','disabled');
-		$('#endDate').val(endDate);
-		$('#endDate').attr('disabled','disabled');
-		
-		$( "#addTariff" ).dialog( "open" );
-	}
+		//validateAddTariff();
+}
+
+
+function editTariffDataValue( organisationUnitId, orgUnitGroupId, dataElementId, dataSetId, startDate, endDate, value, target, targetPercentage )
+{	
+	
+        jQuery('#addTariff').dialog('destroy').remove();
+        	
+		/*
+        alert( organisationUnitId );
+        alert( orgUnitGroupId );
+        alert( dataElementId );
+        alert( dataSetId );
+        alert( startDate );
+        alert( endDate );
+        */
+        
+        jQuery('<div id="addTariff">' ).load( 'showUpdateTariffDetailsForm.action?organisationUnitId='+ organisationUnitId + "&orgUnitGroupId=" + orgUnitGroupId + "&dataElementId=" + dataElementId + "&dataSetId=" + dataSetId + "&startDate=" + startDate + "&endDate=" + endDate ).dialog({
+        title: 'Update Tariff Details',
+        maximize: true,
+        closable: true,
+        modal:true,
+        overlay:{background:'#000000', opacity:0.1},
+        width: 320,
+        height: 350
+        });
+
+
+}
+
+function deleteTariffDataValue( organisationUnitId, orgUnitGroupId, dataElementId, dataSetId, startDate, endDate)
+{
+	var dataValue = {		        		
+	        		'orgUnitGroupId' : orgUnitGroupId,
+	        		'organisationUnitId' : organisationUnitId,
+					'dataElementId' : dataElementId,								
+					'dataSetId' : dataSetId,
+					'startDate' : startDate,
+					'endDate' : endDate
+	    			};
+								
+	jQuery.ajax( {
+                url: 'deleteTariffData.action', 
+				data: dataValue,
+                dataType: 'json',
+				success: handleSuccess,
+                error: handleError
+              } );
+    function handleSuccess( json )
+    {
+		getTariffData();			
+    }
+    function handleError( json )
+    {
+		getTariffData();			
+    }
+}
+
+
 	function validateTariff()
 	{
 		var bValue = false;
@@ -175,7 +177,8 @@
 		
 		if (date1 > date2) 
 		{
-    		alert ("Please enter correct date");                         
+    		//alert ("Please enter correct date");
+			alert ("Start date greater than end date");
 		}
 		else
 		{
@@ -269,17 +272,18 @@
 			getTariffData();
 			$( "#addTariff" ).dialog( "close" );
 	    }
-	function validateAddTariff()
+	
+	
+
+	
+	function dialogWindowClose()
 	{
-		if($("#pbfType ").val() != '-1' && $("#tariff").val() != "" && $("#startDate").val() != "" && $("#endDate").val() != "")
-        {
-        	$("#button-save").button( "option", "disabled", false ).removeClass("ui-state-disabled");
-        }
-        else
-        {
-			$("#button-save").button( "option", "disabled", true ).addClass("ui-state-disabled");       	
-        }
-	}
+		//$( "#addTariff" ).dialog( "close" );
+		
+		jQuery('#addTariff').dialog('destroy').remove();
+		
+	}	
+	
 </script>
 <style >
 	.mandatory
@@ -289,7 +293,7 @@
 	}
 </style>
 <div style="width:100%">
-	<input type="button" value="Add New Tariff" style="float:right;" id="openAddTariff" />
+	<input type="button" value="Add New Tariff" style="float:right;" id="openAddTariff" onclick="showAddTariffDetailsForm();" />
 </div>
 <br/><br/>
 <input type="hidden" id="dataElementId" name="dataElementId" value="$!selecteddataElement.id"/>
@@ -337,55 +341,4 @@
 		#end
     </tbody>
 </table>
-</div>
-
-<div id="addTariff" title="Add New Tariff">
-	<table style="width:100%;table-layout:fixed;">
-		<tr >
-			<td style="width:40%;">PBF Type <b class="mandatory">*</b> </td>
-			<td style="width:60%;">
-				<select id="pbfType" style="width:100%;" onchange="validateAddTariff()">
-					<option value="-1">Select PBF Type</option>
-					#foreach( $dataSet in $dataSets )
-						<option value="$dataSet.id">$dataSet.name</option>
-					#end
-                </select>
-			</td>
-        </tr>
-		<tr >
-			<td colspan="2">&nbsp;</td>
-        </tr>
-		<tr >
-			<td style="width:40%;">Start Date <b class="mandatory">*</b> </td>
-			<td style="width:60%;"><input type="text" id="startDate" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
-        </tr>
-		<tr >
-			<td colspan="2">&nbsp;</td>
-        </tr>
-		<tr >
-			<td style="width:40%;">End Date <b class="mandatory">*</b> </td>
-			<td style="width:60%;"><input type="text" id="endDate" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
-        </tr>
-		<tr >
-			<td colspan="2">&nbsp;</td>
-        </tr>
-		<tr >
-			<td style="width:40%;">Tariff <b class="mandatory">*</b> </td>
-			<td style="width:60%;"><input type="text" id="tariff" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
-        </tr>
-		<tr >
-			<td colspan="2">&nbsp;</td>
-        </tr>
-		<tr >
-			<td style="width:40%;">Target  </td>
-			<td style="width:60%;"><input type="text" id="target" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
-        </tr>
-		<tr >
-			<td colspan="2">&nbsp;</td>
-        </tr>
-		<tr >
-			<td style="width:40%;">Target % </td>
-			<td style="width:60%;"><input type="text" id="targetPercentage" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
-        </tr>				
-    </table>
 </div>
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData_old.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData_old.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData_old.vm	2014-10-24 11:05:35 +0000
@@ -0,0 +1,391 @@
+
+<script type="text/javascript" >
+
+	Ext.Loader.setConfig({
+		enabled: true
+	});
+	Ext.Loader.setPath('Ext.ux.grid', 'javascript');
+	Ext.require([
+		'Ext.data.*',
+		'Ext.grid.*',
+		'Ext.toolbar.Paging',
+		'Ext.ux.grid.TransformGrid'
+	]);
+	
+</script>
+
+<script >
+	
+
+$(function() {
+			Ext.QuickTips.init();
+			
+			var grid = Ext.create('Ext.ux.grid.TransformGrid', "tariffDetails", {				
+			sortableColumns: true,
+            enableColumnMove: true,
+            enableColumnResize: true,
+            sortOnLoad: true,
+			width: tableWidth,
+        	height: 360,			
+            sorters: {direction: 'ASC'},
+			autoCreateViewPort:false,
+			renderTo: Ext.Element.get('#tariffTable'),
+        	layout: {
+            	type: 'hbox',
+            	align: 'stretch'
+        	},
+			columns: [
+    		{
+                text     : 'PBF Type',
+    			width    : columnWidth,            
+                sortable : true
+            },
+			{
+                text     : 'Tariff',
+    			width    : columnWidth,            
+                sortable : true
+            },
+			{
+                text     : 'Target',
+    			width    : columnWidth,						
+                sortable : true
+            },
+			{
+                text     : 'Target %',
+    			width    : columnWidth,						
+                sortable : true
+            },
+			{
+                text     : 'Start Date',
+    			width    : columnWidth,						
+                sortable : true
+            },
+			{
+                text     : 'End Date',
+    			width    : columnWidth,						
+                sortable : true
+            },
+			{
+                text     : 'Operations',
+    			width    : columnWidth,						
+                sortable : false
+            }
+			]
+			});
+			
+			grid.render();
+			
+datePicker( 'startDate');
+datePicker( 'endDate');
+$("#openAddTariff").button()
+			.click(function() {
+			
+			validateAddTariff();
+
+			$( "#addTariff" ).dialog('option', 'title', 'Add New Tariff');
+			$( "#addTariff" ).dialog( "open" );
+			$('#pbfType option[value=-1]').attr('selected','selected');
+			$("#pbfType ").removeAttr('disabled');
+			$("#tariff").val('');
+			$("#target").val('');
+			$("#targetPercentage").val('');
+			$("#startDate").val('');
+			$("#startDate ").removeAttr('disabled');
+			$("#endDate").val('');
+			$("#endDate ").removeAttr('disabled');
+});
+			
+			
+$( "#addTariff" ).dialog({
+			width: 320,
+			autoOpen: false,			
+			modal: true,
+			buttons: [
+        {
+            id: "button-save",
+            text: "Save",
+            click: function() {
+                validateTariff();
+            }
+        },
+        {
+            id: "button-cancel",
+            text: "Cancel",
+            click: function() {
+                $(this).dialog("close");
+            }
+        }
+    ],
+			close: function() {				
+			}
+		});
+		
+});
+
+	function deleteTariffDataValue( organisationUnitId, orgUnitGroupId, dataElementId, dataSetId, startDate, endDate)
+	{
+		var dataValue = {		        		
+		        		'orgUnitGroupId' : orgUnitGroupId,
+		        		'organisationUnitId' : organisationUnitId,
+						'dataElementId' : dataElementId,								
+						'dataSetId' : dataSetId,
+						'startDate' : startDate,
+						'endDate' : endDate
+		    			};
+									
+		jQuery.ajax( {
+	                url: 'deleteTariffData.action', 
+					data: dataValue,
+	                dataType: 'json',
+					success: handleSuccess,
+	                error: handleError
+	              } );
+	    function handleSuccess( json )
+	    {
+			getTariffData();			
+	    }
+	    function handleError( json )
+	    {
+			getTariffData();			
+	    }
+	}
+
+	function editTariffDataValue( organisationUnitId, orgUnitGroupId, dataElementId, dataSetId, startDate, endDate, value, target, targetPercentage )
+	{	
+		validateAddTariff();
+		
+		$( "#addTariff" ).dialog('option', 'title', 'Edit Tariff');
+		$('#pbfType option[value='+dataSetId+']').attr('selected','selected');
+		$('#pbfType').attr('disabled','disabled');
+		$('#tariff').val(value);
+		$('#target').val(target);
+		$('#targetPercentage').val(targetPercentage);
+		$('#startDate').val(startDate);
+		$('#startDate').attr('disabled','disabled');
+		$('#endDate').val(endDate);
+		$('#endDate').attr('disabled','disabled');
+		
+		$( "#addTariff" ).dialog( "open" );
+	}
+	function validateTariff()
+	{
+		var bValue = false;
+		var date1 = Date.parse($("#startDate").val());
+		var date2 = Date.parse($("#endDate").val());
+		
+		if (date1 > date2) 
+		{
+    		alert ("Please enter correct date");                         
+		}
+		else
+		{
+		 var dataValue = {
+        		        			'pbfType' : $("#pbfType").val(),        		        			
+        		        			'startDate' : $("#startDate").val(),
+        							'endDate' : $("#endDate").val(),
+									'orgUnitGroupId': $( "#orgUnitGroupId" ).val(),
+									'orgUnitUid' : $("#orgUnitUid").val(),
+									'dataElementId' : $("#dataElementId").val()
+        		    			};
+								jQuery.ajax( {
+                                url: 'validateTariffData.action', 
+								data: dataValue,
+                                dataType: 'json',
+                                success: handleSuccess,
+                                error: handleError
+                            } );
+							
+		
+		}
+		return bValue;
+	}	
+		function handleSuccess( json )
+	    {	
+			//alert( json.message );
+		
+			if(json.message == "true")	
+			{
+				alert("Tariff value of this pbf type exist between this range");
+				bValue = true;				
+			}
+			
+			else if(json.message == "ok")
+			{
+				 var dataValue = {
+        		        			'pbfType' : $("#pbfType").val(),
+        		        			'tariff' : $("#tariff").val(),
+        		        			'startDate' : $("#startDate").val(),
+        							'endDate' : $("#endDate").val(),									
+									'orgUnitGroupId': $( "#orgUnitGroupId" ).val(),
+									'orgUnitUid' : $("#orgUnitUid").val(),
+									'dataElementId' : $("#dataElementId").val(),									
+									'target' : $("#target").val(),
+									'targetPercentage' : $("#targetPercentage").val(),
+        		    			};
+								jQuery.ajax( {
+                                url: 'addTariffData.action', 
+								data: dataValue,
+                                dataType: 'json',
+                                success: addTariffSuccess,
+                                error: addTariffError
+                            } );
+			}
+			
+			else
+			{
+				alert( json.message );
+				bValue = true;
+			}
+	
+	    }
+	    
+		function handleError( json )
+	    {	
+			alert( "Inside Error " + json.message );
+	    }
+		
+		function addTariffSuccess( json )
+	    {	
+			$('#pbfType option[value=-1]').attr('selected','selected');
+			$("#pbfType ").removeAttr('disabled');
+			$("#tariff").val('');			
+			$("#startDate").val('');
+			$("#startDate ").removeAttr('disabled');
+			$("#endDate").val('');
+			$("#endDate ").removeAttr('disabled');
+			
+			getTariffData();
+			$( "#addTariff" ).dialog( "close" );
+	    }
+	    function addTariffError( json )
+	    {
+			$('#pbfType option[value=-1]').attr('selected','selected');
+			$("#pbfType ").removeAttr('disabled');
+			$("#tariff").val('');			
+			$("#startDate").val('');
+			$("#startDate ").removeAttr('disabled');
+			$("#endDate").val('');
+			$("#endDate ").removeAttr('disabled');
+			getTariffData();
+			$( "#addTariff" ).dialog( "close" );
+	    }
+	function validateAddTariff()
+	{
+		if($("#pbfType ").val() != '-1' && $("#tariff").val() != "" && $("#startDate").val() != "" && $("#endDate").val() != "")
+        {
+        	$("#button-save").button( "option", "disabled", false ).removeClass("ui-state-disabled");
+        }
+        else
+        {
+			$("#button-save").button( "option", "disabled", true ).addClass("ui-state-disabled");       	
+        }
+	}
+</script>
+<style >
+	.mandatory
+	{
+		color:red;
+		font-size: 1.5em;
+	}
+</style>
+<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"/>
+<div style="width:100%;" id="tariffTable">
+<table id="tariffDetails" name="tariffDetails" cellspacing="0">
+	<thead >
+		<tr >
+			<th >PBF Type</th>
+			<th >Tariff</th>
+			<th >Target</th>
+			<th >Target %</th>
+			<th >Start Date</th>
+			<th >End Date</th>
+			##if( $updateAuthority == 'Yes' )
+				<th >Operations</th>
+			##end
+        </tr>
+	</thead>
+	<tbody>
+		#set( $mark = false )
+		#foreach( $tariff in $tariffList )
+			#if( $mark )
+                #set( $mark = false )
+			#else
+				#set( $mark = true )
+			#end
+            <tr >
+				<td >$!tariff.dataSet.name</td>
+				<td >$!tariff.value</td>
+				<td >$!tariff.target</td>
+				<td >$!tariff.targetPercentage</td>
+				<td data-sorter="shortDate" data-date-format="yyyymmdd">$simpleDateFormat.format($!tariff.startDate)</td>
+				<td data-sorter="shortDate" data-date-format="yyyymmdd">$simpleDateFormat.format($!tariff.endDate)</td>
+			##if($updateAuthority == 'Yes')
+	            <td>
+					<a href="javascript:deleteTariffDataValue('$tariff.organisationUnit.id','$tariff.orgUnitGroup.id','$tariff.dataElement.id','$tariff.dataSet.id','$simpleDateFormat.format($!tariff.startDate)','$simpleDateFormat.format($!tariff.endDate)')">
+						<img src="images/delete.png" width="17px"/>
+					</a>
+					<a href="javascript:editTariffDataValue('$tariff.organisationUnit.id','$tariff.orgUnitGroup.id','$tariff.dataElement.id','$tariff.dataSet.id','$simpleDateFormat.format($!tariff.startDate)','$simpleDateFormat.format($!tariff.endDate)','$tariff.value','$!tariff.target','$!tariff.targetPercentage')">
+						<img src="../images/edit.png" alt="$i18n.getString( 'edit' )" width="17px"/>
+					</a>				
+				</td>
+			##end
+        </tr>
+		#end
+    </tbody>
+</table>
+</div>
+
+<div id="addTariff" title="Add New Tariff">
+	<table style="width:100%;table-layout:fixed;">
+		<tr >
+			<td style="width:40%;">PBF Type <b class="mandatory">*</b> </td>
+			<td style="width:60%;">
+				<select id="pbfType" style="width:100%;" onchange="validateAddTariff()">
+					<option value="-1">Select PBF Type</option>
+					#foreach( $dataSet in $dataSets )
+						<option value="$dataSet.id">$dataSet.name</option>
+					#end
+                </select>
+			</td>
+        </tr>
+		<tr >
+			<td colspan="2">&nbsp;</td>
+        </tr>
+		<tr >
+			<td style="width:40%;">Start Date <b class="mandatory">*</b> </td>
+			<td style="width:60%;"><input type="text" id="startDate" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
+        </tr>
+		<tr >
+			<td colspan="2">&nbsp;</td>
+        </tr>
+		<tr >
+			<td style="width:40%;">End Date <b class="mandatory">*</b> </td>
+			<td style="width:60%;"><input type="text" id="endDate" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
+        </tr>
+		<tr >
+			<td colspan="2">&nbsp;</td>
+        </tr>
+		<tr >
+			<td style="width:40%;">Tariff <b class="mandatory">*</b> </td>
+			<td style="width:60%;"><input type="text" id="tariff" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
+        </tr>
+		<tr >
+			<td colspan="2">&nbsp;</td>
+        </tr>
+		<tr >
+			<td style="width:40%;">Target  </td>
+			<td style="width:60%;"><input type="text" id="target" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
+        </tr>
+		<tr >
+			<td colspan="2">&nbsp;</td>
+        </tr>
+		<tr >
+			<td style="width:40%;">Target % </td>
+			<td style="width:60%;"><input type="text" id="targetPercentage" style="width:100%;" value="" onblur="validateAddTariff()" /></td>
+        </tr>				
+    </table>
+</div>
\ No newline at end of file

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffUpdateDetailsForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffUpdateDetailsForm.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffUpdateDetailsForm.vm	2014-10-24 11:05:35 +0000
@@ -0,0 +1,93 @@
+
+<script type="text/javascript" >
+
+$( document ).ready( function() {
+	//datePickerInRange( 'startDate' , 'endDate' );
+	datePicker( 'startDate');
+	datePicker( 'endDate');
+	
+} );
+
+function validateAddTariff()
+{
+	if($("#pbfType ").val() != '-1' && $("#tariff").val() != "" && $("#startDate").val() != "" && $("#endDate").val() != "")
+    {
+		$( '#saveAddTariffButton' ).removeAttr( 'disabled' );
+    }
+    else
+    {
+		document.getElementById( "saveAddTariffButton" ).disabled = true;
+		
+    }
+}
+	
+</script>
+
+<table style="width:100%;table-layout:fixed;">
+	<tr >
+		<td style="width:40%;">PBF Type <b class="mandatory">*</b> </td>
+		<td style="width:60%;">
+			<select id="pbfType" style="width:100%;" name = "pbfType" onblur="validateAddTariff()" disabled="disabled" >
+				<option value="-1">Select PBF Type</option>
+				#foreach( $dataSet in $dataSets )
+					<option value="$dataSet.id" #if( $dataSet.id == $tariffDataValue.getDataSet().getId() ) selected="selected" #end >$dataSet.name</option>
+				#end
+            </select>
+		</td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Start Date <b class="mandatory">*</b> </td>
+		<td style="width:60%;"><input type="text" id="startDate" style="width:100%;" value="$tariffStartDate" name = "startDate" onblur="validateAddTariff()" disabled="disabled" />
+			
+		</td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">End Date <b class="mandatory">*</b> </td>
+		<td style="width:60%;"><input type="text" id="endDate" style="width:100%;" value="$tariffEndDate" name = "endDate" onblur="validateAddTariff()"  disabled="disabled" />
+
+		</td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Tariff <b class="mandatory">*</b> </td>
+		<td style="width:60%;"><input type="text" id="tariff" style="width:100%;" value="$tariffDataValue.getValue()"  name = "tariff" onblur="validateAddTariff()" /></td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Target  </td>
+		<td style="width:60%;"><input type="text" id="target" style="width:100%;"  name = "target" value="$!tariffDataValue.getTarget()" /></td>
+    </tr>
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>
+	<tr >
+		<td style="width:40%;">Target % </td>
+		<td style="width:60%;"><input type="text" id="targetPercentage" name = "targetPercentage" value="$!tariffDataValue.getTargetPercentage()" style="width:100%;" /></td>
+    </tr>
+	
+	<tr >
+		<td colspan="2">&nbsp;</td>
+    </tr>	
+
+	<tr >
+       	<td>&nbsp;</td>
+        <td>
+        	<input type="button"  id="saveAddTariffButton" value="$i18n.getString( 'Save' )" style="width:75px" onclick="validateTariff();"/>&nbsp;&nbsp;
+        	&nbsp;&nbsp;<input type="button" id="cancelAddTariffButton" value="$i18n.getString( 'Cancel' )" onclick="dialogWindowClose();" style="width:75px"/>
+		</td>
+    </tr>	
+
+</table>
+<script type="text/javascript" >
+	validateAddTariff();
+</script>	
\ No newline at end of file

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm	2014-10-24 11:05:35 +0000
@@ -2,6 +2,10 @@
 <h2>$i18n.getString( "pbf_setup" )</h2>
 <ul>	
 
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "partnerForm") )
+    	<li><a href="partnerForm.action">$i18n.getString( "partner_management" )</a></li>
+    #end	
+	
     #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "pbfDataEntry") )
     	<li><a href="pbfDataEntry.action">$i18n.getString( "pbf_dataentry" )</a></li>
     #end	

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm	2014-10-24 11:05:35 +0000
@@ -0,0 +1,121 @@
+
+<script type="text/javascript">
+
+function formValidations()
+{
+   	//alert("validation");
+    
+	/*
+    var startPeriodList = document.getElementById("dataSetId");
+    var startPeriodIndex = startPeriodList.selectedIndex;
+    
+    if( startPeriodList.options[startPeriodIndex].value == null || startPeriodList.options[startPeriodIndex].value== "-1" ) 
+   	{ 
+        showWarningMessage( "Please Select Period" );
+        //alert("Please Select Period"); 
+        return false; 
+    }
+    */
+	
+	var dataSetId = $( '#dataSetId' ).val();
+	var optionSetId = $( '#optionSetId' ).val();
+	var dataElementId = $( '#dataElementId' ).val();
+	var periodId = $( '#periodId' ).val();
+	
+	if ( dataSetId == "-1" )
+	{
+		showWarningMessage( "Please Select DataSet" );
+		
+		return false;
+	}
+	
+	else if( optionSetId == "-1" )
+	{
+		showWarningMessage( "Please Select Partner" );
+		return false;
+	}
+	
+	else if( dataElementId == "-1" )
+	{
+		showWarningMessage( "Please Select DataElement" );
+		return false;
+	}	
+	
+	else if( periodId == "-1" )
+	{
+		showWarningMessage( "Please Select Period" );
+		return false;
+	}	
+
+	return true;
+}
+
+</script>
+
+
+<h3>$i18n.getString( "partner_management" )</h3>
+
+<form id="partnerForm" name="partnerForm" action="partnerFormResult.action" method="post" onsubmit="return formValidations()" >
+
+	
+<table>
+	<tr>
+		<td><label for="dataSetId">$i18n.getString( "dataSet" )</label></td>
+		<td><select id="dataSetId" name="dataSetId" style="width:220px" onchange="loadDataElementAndPeriod()" >
+				<option value="-1">[$i18n.getString( "select" )]</option>
+					#foreach( $dataSet in $dataSets )
+						<option value="$dataSet.id">$encoder.htmlEncode( $dataSet.name )</option>
+					#end
+			</select>
+		</td>
+	</tr>
+	
+	<tr>
+		<td><label for="partner">$i18n.getString( "partner" )</label></td>
+		<td><select id="optionSetId" name="optionSetId" style="width:220px" >
+				<option value="-1">[$i18n.getString( "select" )]</option>
+					#foreach( $option in $options )
+						<option value="$option.id">$encoder.htmlEncode( $option.name )</option>
+					#end
+			</select>
+		</td>
+	</tr>
+
+	<tr>
+		<td><label>$i18n.getString( "dataElement" )</label></td>
+		<td>
+			<select id="dataElementId" name = "dataElementId" style="width:220px" >
+				<option value="-1">[$i18n.getString( "select" )]</option>
+			</select>
+		</td>
+    </tr>	
+	
+	<tr>
+		<td><label>$i18n.getString( "period" )</label></td>
+		<td>
+			<select id="periodId" name = "periodId" style="width:220px" >
+				<option value="-1">[$i18n.getString( "select" )]</option>
+			</select>
+		</td>
+    </tr>		
+	
+	
+</table>	
+	
+	
+	
+	
+<table id="selectionTable">
+    <tr>
+        <td>
+			#organisationUnitSelectionTree( false, true, false )
+        </td>
+    </tr>
+    <tr>
+        <td>
+            <input type="submit" id="saveButton" value="$i18n.getString( 'save' )" style="width:10em"/>
+        </td>
+    </tr>
+</table>
+
+</form>

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/responseDataElementAndPeriods.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/responseDataElementAndPeriods.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/responseDataElementAndPeriods.vm	2014-10-24 11:05:35 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<dataElements>
+	#foreach( $dataElement in $dataElements )	
+		<dataelement>
+			<id>$dataElement.id</id>
+			<name>$dataElement.getName()</name>
+		</dataelement>
+	#end
+	#foreach( $period in $periods )	
+		<period>
+			<id>$period.id</id>
+			<name>$period.name</name>
+		</period>
+	#end
+</dataElements>