← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16301: local/in Maintenance RBF work on progress

 

------------------------------------------------------------
revno: 16301
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-08-04 07:49:50 +0100
message:
  local/in Maintenance RBF work on progress
added:
  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/webapp/dhis-web-maintenance-rbf/loadQualityMaxScore.vm
modified:
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/aggregation/action/AddAggregationQueryFormAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValue.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueService.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueStore.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultQualityMaxValueService.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.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/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/ValidateQualityMaxDataAction.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/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/dataEntrySelection.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityMaxDataEntry.js
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm
  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/pbfReportForm.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityMaxEntrySelection.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/aggregation/action/AddAggregationQueryFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/aggregation/action/AddAggregationQueryFormAction.java	2014-07-04 09:38:52 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/aggregation/action/AddAggregationQueryFormAction.java	2014-08-04 06:49:50 +0000
@@ -1,8 +1,12 @@
 package org.hisp.dhis.rbf.aggregation.action;
 
 import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
+import org.hisp.dhis.attribute.AttributeValue;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.rbf.api.Lookup;
@@ -55,28 +59,56 @@
     {
         lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.PBF_AGG_TYPE ) );
 
-        dataElementList = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
-        
-/*        Lookup lookup = lookupService.getLookupByName( "IS_PBF_AGGREGATED_DE_ATTRIBUTE_ID" );
-        Iterator<DataElement> iterator = dataElementList.iterator();
-        while( iterator.hasNext() )
+        List<DataElement> dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
+        
+        dataElementList = new ArrayList<DataElement>(); 
+        
+        Lookup lookup = lookupService.getLookupByName( "IS_PBF_AGGREGATED_DE_ATTRIBUTE_ID" );
+        
+        if( lookup != null )
         {
-            DataElement dataElement = iterator.next();            
+            System.out.println( " In side Lookup " );
             
-            Set<AttributeValue> dataElementAttributeValues = dataElement.getAttributeValues();
-            if( dataElementAttributeValues != null && dataElementAttributeValues.size() > 0 )
+            /*
+            Iterator<DataElement> iterator = dataElementList.iterator();
+            while( iterator.hasNext() )
             {
-                for( AttributeValue deAttributeValue : dataElementAttributeValues )
+                DataElement dataElement = iterator.next();            
+                
+                Set<AttributeValue> dataElementAttributeValues = dataElement.getAttributeValues();
+                if( dataElementAttributeValues != null && dataElementAttributeValues.size() > 0 )
                 {
-                    if( deAttributeValue.getAttribute().getId() == Integer.parseInt( lookup.getValue() ) &&  !deAttributeValue.getValue().equalsIgnoreCase( "true" ) )
+                    for( AttributeValue deAttributeValue : dataElementAttributeValues )
                     {
-                        iterator.remove();
+                        if(  deAttributeValue.getAttribute().getId() == Integer.parseInt( lookup.getValue() ) &&  !deAttributeValue.getValue().equalsIgnoreCase( "true" )  )
+                        {
+                            iterator.remove();
+                        }
                     }
                 }
             }
-        }
-*/
-
+            */
+            
+            for ( DataElement de : dataElements )
+            {
+                Set<AttributeValue> attrValueSet = new HashSet<AttributeValue>( de.getAttributeValues() );
+                for ( AttributeValue attValue : attrValueSet )
+                {
+                    if ( attValue.getAttribute().getId() == Integer.parseInt( lookup.getValue() ) && attValue.getValue().equalsIgnoreCase( "true" ) )
+                    {
+                        dataElementList.add( de );
+                    }
+                }
+            }           
+            
+        }
+        
+        else
+        {
+            dataElementList = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
+        }
+        
+        
         return SUCCESS;
     }
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValue.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValue.java	2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValue.java	2014-08-04 06:49:50 +0000
@@ -8,55 +8,58 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 
-public class QualityMaxValue implements Serializable
+public class QualityMaxValue
+    implements Serializable
 {
-	private static final long serialVersionUID = 1L;
-
-	private OrganisationUnitGroup orgUnitGroup;
-	
-	private OrganisationUnit organisationUnit;
-    
+    private static final long serialVersionUID = 1L;
+
+    private OrganisationUnitGroup orgUnitGroup;
+
+    private OrganisationUnit organisationUnit;
+
     private DataElement dataElement;
-    
+
     private DataSet dataSet;
-    
+
     private Date startDate;
-    
+
     private Date endDate;
-    
+
     private Double value;
-    
+
     private String storedBy;
 
     private Date timestamp;
 
-    private String comment;    
+    private String comment;
 
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
     public QualityMaxValue()
-    {   
-    }
-    
-    public QualityMaxValue( OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet, Date startDate, Date endDate, Double value)
-    {
-        this.organisationUnit = organisationUnit;
-        this.dataElement = dataElement;
-        this.dataSet = dataSet;
-        this.startDate = startDate;
-        this.endDate = endDate;
-        this.value = value;       
-    }
-
-    public QualityMaxValue( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet, Date startDate, Date endDate, Double value)
-    {
-        this.organisationUnit = organisationUnit;
-        this.dataElement = dataElement;
-        this.dataSet = dataSet;
-        this.startDate = startDate;
-        this.endDate = endDate;
-        this.value = value;       
+    {
+    }
+
+    public QualityMaxValue( OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet,
+        Date startDate, Date endDate, Double value )
+    {
+        this.organisationUnit = organisationUnit;
+        this.dataElement = dataElement;
+        this.dataSet = dataSet;
+        this.startDate = startDate;
+        this.endDate = endDate;
+        this.value = value;
+    }
+
+    public QualityMaxValue( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit,
+        DataElement dataElement, DataSet dataSet, Date startDate, Date endDate, Double value )
+    {
+        this.organisationUnit = organisationUnit;
+        this.dataElement = dataElement;
+        this.dataSet = dataSet;
+        this.startDate = startDate;
+        this.endDate = endDate;
+        this.value = value;
     }
 
     // -------------------------------------------------------------------------
@@ -83,7 +86,8 @@
 
         final QualityMaxValue other = (QualityMaxValue) o;
 
-        return dataElement.equals( other.getDataElement() ) && dataSet.equals( other.getDataSet() ) && organisationUnit.equals( other.getOrganisationUnit() ) && orgUnitGroup.equals( other.getOrgUnitGroup() );
+        return dataElement.equals( other.getDataElement() ) && dataSet.equals( other.getDataSet() )
+            && organisationUnit.equals( other.getOrganisationUnit() ) && orgUnitGroup.equals( other.getOrgUnitGroup() );
     }
 
     @Override
@@ -193,7 +197,7 @@
     {
         this.dataSet = dataSet;
     }
-    
+
     public OrganisationUnitGroup getOrgUnitGroup()
     {
         return orgUnitGroup;

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueService.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueService.java	2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueService.java	2014-08-04 06:49:50 +0000
@@ -2,6 +2,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 import org.hisp.dhis.dataelement.DataElement;
@@ -36,4 +37,8 @@
     Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataSet dataSet);
     
     Map<Integer, Double> getQualityMaxValues( OrganisationUnitGroup orgUnitGroup, String orgUnitBranchIds, DataSet dataSet, Period period );
+    
+    Collection<QualityMaxValue> getDistinctQualityMaxScore( OrganisationUnitGroup orgUnitGroup , OrganisationUnit organisationUnit, DataSet dataSet );
+    
+    List<String>  getDistinctStartDateEndDateFromQualityMaxScore( OrganisationUnitGroup orgUnitGroup , OrganisationUnit organisationUnit, DataSet dataSet );
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueStore.java	2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/QualityMaxValueStore.java	2014-08-04 06:49:50 +0000
@@ -2,6 +2,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 import org.hisp.dhis.dataelement.DataElement;
@@ -10,31 +11,40 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.period.Period;
 
-
 public interface QualityMaxValueStore
 {
-	String ID = QualityMaxValueStore.class.getName();
-	
-	void addQuantityMaxValue( QualityMaxValue qualityMaxValue );
-    
+    String ID = QualityMaxValueStore.class.getName();
+
+    void addQuantityMaxValue( QualityMaxValue qualityMaxValue );
+
     void updateQuantityMaxValue( QualityMaxValue qualityMaxValue );
-    
+
     void deleteQuantityMaxValue( QualityMaxValue qualityMaxValue );
-    
+
     Collection<QualityMaxValue> getAllQuanlityMaxValues();
-    
+
     Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnit organisationUnit, DataSet dataSet );
-    
+
     Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnit organisationUnit, DataElement dataElement );
-    
-    QualityMaxValue getQualityMaxValue( OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet, Date startDate ,Date endDate);
-    
-    QualityMaxValue getQualityMaxValue( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet,Date startDate ,Date endDate);
-    
-    Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement);
-    
-    Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataSet dataSet);
-    
-    Map<Integer, Double> getQualityMaxValues( OrganisationUnitGroup orgUnitGroup, String orgUnitBranchIds, DataSet dataSet, Period period );
+
+    QualityMaxValue getQualityMaxValue( OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet,
+        Date startDate, Date endDate );
+
+    QualityMaxValue getQualityMaxValue( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit,
+        DataElement dataElement, DataSet dataSet, Date startDate, Date endDate );
+
+    Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup,
+        OrganisationUnit organisationUnit, DataElement dataElement );
+
+    Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup,
+        OrganisationUnit organisationUnit, DataSet dataSet );
+
+    Map<Integer, Double> getQualityMaxValues( OrganisationUnitGroup orgUnitGroup, String orgUnitBranchIds,
+        DataSet dataSet, Period period );
+
+    Collection<QualityMaxValue> getDistinctQualityMaxScore( OrganisationUnitGroup orgUnitGroup,
+        OrganisationUnit organisationUnit, DataSet dataSet );
+    
+    List<String>  getDistinctStartDateEndDateFromQualityMaxScore( OrganisationUnitGroup orgUnitGroup , OrganisationUnit organisationUnit, DataSet dataSet );
     
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultQualityMaxValueService.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultQualityMaxValueService.java	2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultQualityMaxValueService.java	2014-08-04 06:49:50 +0000
@@ -2,6 +2,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 import org.hisp.dhis.dataelement.DataElement;
@@ -82,6 +83,11 @@
         return qualityMaxValueStore.getQuanlityMaxValues( organisationUnit, dataElement );
     }
 
+    public Collection<QualityMaxValue> getDistinctQualityMaxScore( OrganisationUnitGroup orgUnitGroup , OrganisationUnit organisationUnit, DataSet dataSet )
+    {
+        return qualityMaxValueStore.getDistinctQualityMaxScore( orgUnitGroup, organisationUnit, dataSet );
+    }    
+    
     public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement)
     {
     	return qualityMaxValueStore.getQuanlityMaxValues( orgUnitGroup, organisationUnit, dataElement);
@@ -101,4 +107,11 @@
     {
     	return qualityMaxValueStore.getQualityMaxValues( orgUnitGroup, orgUnitBranchIds, dataSet, period );
     }
+    
+    public List<String>  getDistinctStartDateEndDateFromQualityMaxScore( OrganisationUnitGroup orgUnitGroup , OrganisationUnit organisationUnit, DataSet dataSet )
+    {
+        return qualityMaxValueStore.getDistinctStartDateEndDateFromQualityMaxScore( orgUnitGroup, organisationUnit, dataSet );
+    }    
+    
+    
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.java	2014-08-01 09:36:15 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.java	2014-08-04 06:49:50 +0000
@@ -1,14 +1,17 @@
 package org.hisp.dhis.rbf.impl;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.hibernate.Criteria;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
+import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataset.DataSet;
@@ -20,7 +23,8 @@
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.support.rowset.SqlRowSet;
 
-public class HibernateQualityMaxValueStore implements QualityMaxValueStore
+public class HibernateQualityMaxValueStore
+    implements QualityMaxValueStore
 {
     // -------------------------------------------------------------------------
     // Dependencies
@@ -32,7 +36,7 @@
     {
         this.sessionFactory = sessionFactory;
     }
-    
+
     private JdbcTemplate jdbcTemplate;
 
     public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
@@ -43,175 +47,264 @@
     // -------------------------------------------------------------------------
     // QualityMaxValue
     // -------------------------------------------------------------------------
-    
-	@Override
-	public void addQuantityMaxValue(QualityMaxValue qualityMaxValue) {
-		
-		Session session = sessionFactory.getCurrentSession();
+
+    @Override
+    public void addQuantityMaxValue( QualityMaxValue qualityMaxValue )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
         session.save( qualityMaxValue );
-	}
-
-	@Override
-	public void updateQuantityMaxValue(QualityMaxValue qualityMaxValue) {
-		
-		Session session = sessionFactory.getCurrentSession();
+    }
+
+    @Override
+    public void updateQuantityMaxValue( QualityMaxValue qualityMaxValue )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
         session.update( qualityMaxValue );
-	}
-
-	@Override
-	public void deleteQuantityMaxValue(QualityMaxValue qualityMaxValue) {
-		
-		Session session = sessionFactory.getCurrentSession();
+    }
+
+    @Override
+    public void deleteQuantityMaxValue( QualityMaxValue qualityMaxValue )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
         session.delete( qualityMaxValue );
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Collection<QualityMaxValue> getAllQuanlityMaxValues() {
-		
-		Session session = sessionFactory.getCurrentSession();
-        Criteria criteria = session.createCriteria( QualityMaxValue.class );
-
-        return criteria.list();
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnit organisationUnit, DataSet dataSet) 
-	{
-		Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( QualityMaxValue.class );
-        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
-        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
-
-        return criteria.list();
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataSet dataSet) 
-	{
-		Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( QualityMaxValue.class );
-        
-        criteria.add( Restrictions.eq( "orgUnitGroup", orgUnitGroup ) );
-        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
-        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
-
-        return criteria.list();
-	}
-	
-	@Override
-	public QualityMaxValue getQualityMaxValue(
-			OrganisationUnit organisationUnit, DataElement dataElement,
-			DataSet dataSet,Date startDate ,Date endDate) {
-		
-		Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( QualityMaxValue.class );
-        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
-        criteria.add( Restrictions.eq( "dataElement", dataElement ) );        
-        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
-        criteria.add( Restrictions.eq( "startDate", startDate ) );
-        criteria.add( Restrictions.eq( "endDate", endDate ) );
-
-        return (QualityMaxValue) criteria.uniqueResult();
-	}
-
-	@Override
-	public QualityMaxValue getQualityMaxValue( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet,Date startDate ,Date endDate) 
-	{
-		
-		Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( QualityMaxValue.class );
-        
-        criteria.add( Restrictions.eq( "orgUnitGroup", orgUnitGroup ) );
-        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
-        criteria.add( Restrictions.eq( "dataElement", dataElement ) );        
-        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
-        criteria.add( Restrictions.eq( "startDate", startDate ) );
-        criteria.add( Restrictions.eq( "endDate", endDate ) );
-
-        return (QualityMaxValue) criteria.uniqueResult();
-	}
-	
-	@SuppressWarnings( "unchecked" )
-    @Override
-	public Collection<QualityMaxValue> getQuanlityMaxValues(
-			OrganisationUnit organisationUnit, DataElement dataElement) {
-		
-		Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( QualityMaxValue.class );
-        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
-        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
-
-        return criteria.list();
-	}
-	
-	@SuppressWarnings( "unchecked" )
-    @Override
-	public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement) 
-	{
-		
-		Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( QualityMaxValue.class );
-
-        criteria.add( Restrictions.eq( "orgUnitGroup", orgUnitGroup ) );
-        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
-        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
-
-        return criteria.list();
-	}
-	
-	public Map<Integer, Double> getQualityMaxValues( OrganisationUnitGroup orgUnitGroup, String orgUnitBranchIds, DataSet dataSet, Period period )
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<QualityMaxValue> getAllQuanlityMaxValues()
+    {
+
+        Session session = sessionFactory.getCurrentSession();
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+
+        return criteria.list();
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnit organisationUnit, DataSet dataSet )
+    {
+        Session session = sessionFactory.getCurrentSession();
+
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
+
+        return criteria.list();
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup,
+        OrganisationUnit organisationUnit, DataSet dataSet )
+    {
+        Session session = sessionFactory.getCurrentSession();
+
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+
+        criteria.add( Restrictions.eq( "orgUnitGroup", orgUnitGroup ) );
+        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
+
+        return criteria.list();
+    }
+
+    @Override
+    public QualityMaxValue getQualityMaxValue( OrganisationUnit organisationUnit, DataElement dataElement,
+        DataSet dataSet, Date startDate, Date endDate )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
+
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
+        criteria.add( Restrictions.eq( "startDate", startDate ) );
+        criteria.add( Restrictions.eq( "endDate", endDate ) );
+
+        return (QualityMaxValue) criteria.uniqueResult();
+    }
+
+    @Override
+    public QualityMaxValue getQualityMaxValue( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit,
+        DataElement dataElement, DataSet dataSet, Date startDate, Date endDate )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
+
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+
+        criteria.add( Restrictions.eq( "orgUnitGroup", orgUnitGroup ) );
+        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
+        criteria.add( Restrictions.eq( "startDate", startDate ) );
+        criteria.add( Restrictions.eq( "endDate", endDate ) );
+
+        return (QualityMaxValue) criteria.uniqueResult();
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnit organisationUnit, DataElement dataElement )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
+
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+
+        return criteria.list();
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup,
+        OrganisationUnit organisationUnit, DataElement dataElement )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
+
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+
+        criteria.add( Restrictions.eq( "orgUnitGroup", orgUnitGroup ) );
+        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+
+        //criteria.setProjection( Projections.distinct( Projections.property( "id" ) ) );
+
+        return criteria.list();
+    }
+    
+    
+    
+    @SuppressWarnings( "unchecked" )
+    public Collection<QualityMaxValue> getDistinctQualityMaxScore( OrganisationUnitGroup orgUnitGroup , OrganisationUnit organisationUnit, DataSet dataSet )
+    {
+
+        Session session = sessionFactory.getCurrentSession();
+
+        Criteria criteria = session.createCriteria( QualityMaxValue.class );
+
+        criteria.add( Restrictions.eq( "orgUnitGroup", orgUnitGroup ) );
+        criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+        criteria.add( Restrictions.eq( "dataSet", dataSet ) );
+
+        criteria.setProjection( Projections.distinct( Projections.property( "startDate" ) ) );
+
+        return criteria.list();
+        
+        /*
+        String hql = "SELECT  DISTINCT quality  FROM QualityMaxValue AS quality " +
+            " WHERE quality.orgUnitGroup.id = " + orgUnitGroup.getId()  + 
+            " AND quality.organisationUnit.id = " + organisationUnit.getId() + 
+            " AND quality.dataSet.id = " + dataSet.getId();
+        
+        Query query = getQuery( hql );
+        */
+        
+        //return query.list();
+       
+        
+        
+    }    
+    
+    
+    public List<String>  getDistinctStartDateEndDateFromQualityMaxScore( OrganisationUnitGroup orgUnitGroup , OrganisationUnit organisationUnit, DataSet dataSet )
+    {
+        List<String> qualityMaxValues = new ArrayList<String>();
+
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+        
+        try
         {
-            Map<Integer, Double> qualityMaxValueMap = new HashMap<Integer, Double>();
-            
-            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            String curPeriod = simpleDateFormat.format( period.getEndDate() );
-            
-            try
-            {                       
-                String query = "select td.dataelementid, td.value from "+
-                                "( " +
-                                    "select max(asd.level) as level,asd.dataelementid,asd.orgunitgroupid,datasetid " +
-                                    " from " +
-                                        "( "+
-                                            " select td.orgunitgroupid,td.organisationunitid,td.datasetid,td.dataelementid,os.level,td.value " +
-                                                " from qualitymaxvalue td inner join _orgunitstructure os on os.organisationunitid = td.organisationunitid "+
-                                                " where '" + curPeriod + "'  between date(td.startdate) and date(td.enddate) " +
-                                                    " and orgunitgroupid in ( " + orgUnitGroup.getId() + ") " +
-                                                    " and datasetid in ( " +dataSet.getId() + ") "+
-                                                    " )asd "+
-                                                    " group by asd.dataelementid,asd.orgunitgroupid,datasetid " +
-                                                    " )sag1 " +
-                                                    " inner join qualitymaxvalue td on td.dataelementid=sag1.dataelementid " +
-                                                    " where td.orgunitgroupid=sag1.orgunitgroupid " + 
-                                                    " and td.datasetid=sag1.datasetid " +
-                                                    " and td.organisationunitid in ("+ orgUnitBranchIds +") ";
+            
+            String query = " SELECT distinct( startdate), enddate from qualitymaxvalue " +
+                           " where orgunitgroupid =  " + orgUnitGroup.getId()  + " and organisationunitid =  " + organisationUnit.getId()  +
+                           " and  datasetid =  " + dataSet.getId();
+            
+            
+            System.out.println( "Query: " + query );
+            
+            SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
+            
+            while ( rs.next() )
+            {
+                Date startDate = rs.getDate( 1 );
+                Date endDate = rs.getDate( 2 );
                 
-                System.out.println("Query: " + query );
-                SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
-                while ( rs.next() )
+                if( startDate != null && endDate != null )
                 {
-                    Integer dataElementId = rs.getInt( 1 );
-                    Double value = rs.getDouble( 2 );
-                    qualityMaxValueMap.put( dataElementId, value );
-                    System.out.println( dataElementId + " : " + value );
+                    String startDateEndDate = simpleDateFormat.format( startDate ) + ":" + simpleDateFormat.format( endDate );
+                    qualityMaxValues.add( startDateEndDate );
+                    //System.out.println( startDateEndDate  );
                 }
+                
             }
-            catch( Exception e )
+        }
+        catch ( Exception e )
+        {
+            System.out.println( "In getQualityMaxValues Exception :" + e.getMessage() );
+        }
+
+        return qualityMaxValues;
+    }    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    public Map<Integer, Double> getQualityMaxValues( OrganisationUnitGroup orgUnitGroup, String orgUnitBranchIds,
+        DataSet dataSet, Period period )
+    {
+        Map<Integer, Double> qualityMaxValueMap = new HashMap<Integer, Double>();
+
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+        String curPeriod = simpleDateFormat.format( period.getEndDate() );
+
+        try
+        {
+            String query = "select td.dataelementid, td.value from "
+                + "( "
+                + "select max(asd.level) as level,asd.dataelementid,asd.orgunitgroupid,datasetid "
+                + " from "
+                + "( "
+                + " select td.orgunitgroupid,td.organisationunitid,td.datasetid,td.dataelementid,os.level,td.value "
+                + " from qualitymaxvalue td inner join _orgunitstructure os on os.organisationunitid = td.organisationunitid "
+                + " where '" + curPeriod + "'  between date(td.startdate) and date(td.enddate) "
+                + " and orgunitgroupid in ( " + orgUnitGroup.getId() + ") " + " and datasetid in ( " + dataSet.getId()
+                + ") " + " )asd " + " group by asd.dataelementid,asd.orgunitgroupid,datasetid " + " )sag1 "
+                + " inner join qualitymaxvalue td on td.dataelementid=sag1.dataelementid "
+                + " where td.orgunitgroupid=sag1.orgunitgroupid " + " and td.datasetid=sag1.datasetid "
+                + " and td.organisationunitid in (" + orgUnitBranchIds + ") ";
+
+            System.out.println( "Query: " + query );
+            SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
+            while ( rs.next() )
             {
-                System.out.println("In getQualityMaxValues Exception :"+ e.getMessage() );
+                Integer dataElementId = rs.getInt( 1 );
+                Double value = rs.getDouble( 2 );
+                qualityMaxValueMap.put( dataElementId, value );
+                System.out.println( dataElementId + " : " + value );
             }
-        
-            return qualityMaxValueMap;
-        }
-    
+        }
+        catch ( Exception e )
+        {
+            System.out.println( "In getQualityMaxValues Exception :" + e.getMessage() );
+        }
+
+        return qualityMaxValueMap;
+    }
 
 }

=== added 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	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityMaxScoreAction.java	2014-08-04 06:49:50 +0000
@@ -0,0 +1,136 @@
+package org.hisp.dhis.rbf.quality.dataentry;
+
+import java.text.SimpleDateFormat;
+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.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.QualityMaxValueService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class LoadQualityMaxScoreAction implements Action
+{
+
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private QualityMaxValueService qualityMaxValueService;
+
+    public void setQualityMaxValueService( QualityMaxValueService qualityMaxValueService )
+    {
+        this.qualityMaxValueService = qualityMaxValueService;
+    }
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    @Autowired
+    private OrganisationUnitGroupService orgUnitGroupService;
+    
+
+    // -------------------------------------------------------------------------
+    // Input / Output
+    // -------------------------------------------------------------------------
+
+    private String orgUnitId;
+
+    public void setOrgUnitId( String orgUnitId )
+    {
+        this.orgUnitId = orgUnitId;
+    }
+
+    private String orgUnitGroupId;
+
+    public void setOrgUnitGroupId( String orgUnitGroupId )
+    {
+        this.orgUnitGroupId = orgUnitGroupId;
+    }
+
+    private String dataSetId;
+
+    public void setDataSetId( String dataSetId )
+    {
+        this.dataSetId = dataSetId;
+    }
+    
+    /*
+    private List<QualityMaxValue> qualityMaxValues = new ArrayList<QualityMaxValue>();
+    
+    public List<QualityMaxValue> getQualityMaxValues()
+    {
+        return qualityMaxValues;
+    }
+    */
+    private List<String> qualityMaxValues = new ArrayList<String>();
+    
+    public List<String> getQualityMaxValues()
+    {
+        return qualityMaxValues;
+    }
+
+    private SimpleDateFormat dateFormat;
+    
+    public SimpleDateFormat getDateFormat()
+    {
+        return dateFormat;
+    }
+
+    
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+
+    public String execute()
+        throws Exception
+    {
+        
+        dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+        
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
+        
+        DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( dataSetId ) );
+        
+        OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( Integer.parseInt( orgUnitGroupId ) );
+
+        if ( organisationUnit == null || dataSet == null || orgUnitGroup == null )
+        {
+            return SUCCESS;
+        }
+
+        qualityMaxValues =  new ArrayList<String>();
+        
+        qualityMaxValues =  new ArrayList<String>( qualityMaxValueService.getDistinctStartDateEndDateFromQualityMaxScore( orgUnitGroup, organisationUnit, dataSet ) );
+        
+        
+        for ( String qualityMaxValue : qualityMaxValues )
+        {
+            System.out.println( qualityMaxValue  );
+        }
+        
+        
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== 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-08-01 09:36:15 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java	2014-08-04 06:49:50 +0000
@@ -336,6 +336,7 @@
         
         //System.out.println(" Payment dataSet Period Type---" + paymentDataSet.getPeriodType() );
         
+        period = periodService.reloadPeriod( period );
         
         Set<Period> periods = new HashSet<Period>( periodService.getIntersectingPeriodsByPeriodType( paymentDataSet.getPeriodType(), period.getStartDate(), period.getEndDate() ) );
         

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java	2014-07-04 09:38:52 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java	2014-08-04 06:49:50 +0000
@@ -224,7 +224,7 @@
             }
         }
         else
-        {
+        {   /*    
             if( !(value.trim().equalsIgnoreCase( dataValue.getValue() ) ) )
             {
                 dataValue.setValue( value.trim() );
@@ -232,7 +232,14 @@
                 dataValue.setLastUpdated( now );
                 dataValue.setStoredBy( storedBy );                
                 dataValueService.updateDataValue( dataValue );
-          }            
+            }
+            */
+            
+            dataValue.setValue( value );
+            dataValue.setLastUpdated( now );
+            dataValue.setStoredBy( storedBy );
+
+            dataValueService.updateDataValue( dataValue );  
         }
         
         // for saving Over All Score

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/ValidateQualityMaxDataAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/ValidateQualityMaxDataAction.java	2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/ValidateQualityMaxDataAction.java	2014-08-04 06:49:50 +0000
@@ -50,7 +50,7 @@
 
     @Autowired
     private OrganisationUnitGroupService orgUnitGroupService;
-    
+
     // -------------------------------------------------------------------------
     // Input / Output
     // -------------------------------------------------------------------------
@@ -63,13 +63,13 @@
     }
 
     private String orgUnitGroupId;
-    
-    public void setOrgUnitGroupId(String orgUnitGroupId) 
+
+    public void setOrgUnitGroupId( String orgUnitGroupId )
     {
-		this.orgUnitGroupId = orgUnitGroupId;
-	}
+        this.orgUnitGroupId = orgUnitGroupId;
+    }
 
-	private String dataSetId;
+    private String dataSetId;
 
     public void setDataSetId( String dataSetId )
     {
@@ -117,19 +117,19 @@
     {
         return message;
     }
-    
+
     private String maximumRange;
-    
-    public String getMaximumRange() 
+
+    public String getMaximumRange()
     {
-		return maximumRange;
-	}
+        return maximumRange;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
-	public String execute()
+    public String execute()
         throws Exception
     {
         SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
@@ -138,36 +138,41 @@
         Date eDate = dateFormat.parse( endDate );
         OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
         DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( dataSetId ) );
-        OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( Integer.parseInt( orgUnitGroupId ) );
+        OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( Integer
+            .parseInt( orgUnitGroupId ) );
 
-        List<QualityMaxValue> qualityMaxValues = new ArrayList<QualityMaxValue>( qualityMaxValueService.getQuanlityMaxValues( orgUnitGroup, organisationUnit, dataSet ) );
+        List<QualityMaxValue> qualityMaxValues = new ArrayList<QualityMaxValue>(
+            qualityMaxValueService.getQuanlityMaxValues( orgUnitGroup, organisationUnit, dataSet ) );
         for ( QualityMaxValue qualityMaxValue : qualityMaxValues )
         {
-            if ( qualityMaxValue.getStartDate().getTime() ==  sDate.getTime() && qualityMaxValue.getEndDate().getTime() ==  eDate.getTime() )
+            if ( qualityMaxValue.getStartDate().getTime() == sDate.getTime()
+                && qualityMaxValue.getEndDate().getTime() == eDate.getTime() )
             {
                 message = message && false;
-            }  
-            else if (sDate.before( qualityMaxValue.getStartDate() ) && eDate.after( qualityMaxValue.getEndDate() ) )
-            {            	
-            	message = message || true;            	
-            	//System.out.println("Start date is less and end date is greater or equal "+message);
-            }
-            else if (qualityMaxValue.getStartDate().getTime() >=  sDate.getTime() && sDate.getTime() <= qualityMaxValue.getEndDate().getTime() )
-            {            	
-            	message = message || true;
-            	//System.out.println("Start date between max start date and end date "+message);
-            }
-            else if (qualityMaxValue.getStartDate().getTime() >=  eDate.getTime() && eDate.getTime() <= qualityMaxValue.getEndDate().getTime() )
-            {            	
-            	message = message || true;
-            	//System.out.println("End date between max start date and end date  "+message);
-            }            
+            }
+            else if ( sDate.before( qualityMaxValue.getStartDate() ) && eDate.after( qualityMaxValue.getEndDate() ) )
+            {
+                message = message || true;
+                // System.out.println("Start date is less and end date is greater or equal "+message);
+            }
+            else if ( qualityMaxValue.getStartDate().getTime() >= sDate.getTime()
+                && sDate.getTime() <= qualityMaxValue.getEndDate().getTime() )
+            {
+                message = message || true;
+                // System.out.println("Start date between max start date and end date "+message);
+            }
+            else if ( qualityMaxValue.getStartDate().getTime() >= eDate.getTime()
+                && eDate.getTime() <= qualityMaxValue.getEndDate().getTime() )
+            {
+                message = message || true;
+                // System.out.println("End date between max start date and end date  "+message);
+            }
             else
             {
-            	message = message && false;
+                message = message && false;
             }
         }
-        //System.out.println("Message: "+message);
+        // System.out.println("Message: "+message);
         return SUCCESS;
     }
 }
\ No newline at end of file

=== 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-07-28 09:27:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml	2014-08-04 06:49:50 +0000
@@ -289,6 +289,14 @@
 		<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
 	</bean>
 	
+	
+	<bean id="org.hisp.dhis.rbf.quality.dataentry.LoadQualityMaxScoreAction"  class="org.hisp.dhis.rbf.quality.dataentry.LoadQualityMaxScoreAction" scope="prototype">
+		<property name="qualityMaxValueService" ref="org.hisp.dhis.rbf.api.QualityMaxValueService" />	
+		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+		<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+	</bean>	
+	
+	
 	<!-- Payment Adjustment -->
 	
 	<bean id="org.hisp.dhis.rbf.payment.action.GetOrganisationUnitForPaymentAction" class="org.hisp.dhis.rbf.payment.action.GetOrganisationUnitForPaymentAction" scope="prototype">

=== 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-07-23 11:47:17 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties	2014-08-04 06:49:50 +0000
@@ -94,4 +94,6 @@
 utilization_rule_management = Utilization Rule Management
 select_dataElement = Select DataElement
 confirm_delete_utilization_rate_reule = Are you sure you want to delete Utilization Rule Rate
-qty_external_verification = Quantity External Verification
\ No newline at end of file
+qty_external_verification = Quantity External Verification
+
+quality_max_score = Quality Max Score
\ No newline at end of file

=== 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-07-28 09:27:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml	2014-08-04 06:49:50 +0000
@@ -21,6 +21,7 @@
 			<param name="menu">/dhis-web-maintenance-rbf/tariffMenu.vm</param>
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/javascripts/ext/ext-all.js,javascript/TransformGrid.js,javascript/dataElement_combo.js</param>
 			<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>
@@ -49,6 +50,7 @@
             <param name="menu">/dhis-web-maintenance-rbf/tariffMenu.vm</param>
             <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/javascripts/ext/ext-all.js,javascript/TransformGrid.js</param>
         	<param name="stylesheets">../dhis-web-commons/javascripts/ext/resources/css/ext-all-gray.css</param>
+        	<param name="requiredAuthorities">F_PBF_BANK_MANAGEMENT</param>
         </action>
         
         <action name="loadbankDetails" class="org.hisp.dhis.rbf.action.LoadBankDetailsAction">
@@ -78,6 +80,7 @@
       <param name="menu">/dhis-web-maintenance-rbf/menuDataEntry.vm</param>
       <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/pbfDataEntry.js</param>
       <param name="stylesheets">css/dataentry.css</param>
+      <param name="requiredAuthorities">F_PBF_DATAENTRY</param>
     </action>	
 	
     <!-- Get OrganisationUnit Unit name -->
@@ -165,6 +168,7 @@
       <param name="menu">/dhis-web-maintenance-rbf/menuMaxEntry.vm</param>
       <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/qualityMaxDataEntry.js</param>
       <param name="stylesheets">css/dataentry.css</param>
+      <param name="requiredAuthorities">F_PBF_QUALITY_MAX_DATAENTRY</param>
     </action>
 	
 	<!-- Load DataEntry Form -->
@@ -173,6 +177,17 @@
 		<param name="page">/dhis-web-maintenance-rbf/loadQualityMaxEntryForm.vm</param>
 	</action>
 	
+	<!-- Load Quality Score Data -->
+	<action name="loadQualityMaxScore" class="org.hisp.dhis.rbf.quality.dataentry.LoadQualityMaxScoreAction">
+		<result name="success" type="velocity">/content.vm</result>
+		<param name="page">/dhis-web-maintenance-rbf/loadQualityMaxScore.vm</param>
+	</action>	
+	
+	
+	
+	
+	
+	
 	<!-- Save Quality Value -->
 	<action name="saveQualityValue"
 		class="org.hisp.dhis.rbf.quality.dataentry.SaveQualityValueAction">
@@ -194,6 +209,7 @@
       <param name="menu">/dhis-web-maintenance-rbf/menuScoreEntry.vm</param>
       <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/qualityScoreDataEntry.js</param>
       <param name="stylesheets">css/dataentry.css</param>
+      <param name="requiredAuthorities">F_PBF_QUALITY_SCORE_DATAENTRY</param>
     </action>
     
 	<!-- Load DataEntry Form -->
@@ -231,6 +247,7 @@
       <param name="menu">/dhis-web-maintenance-rbf/menuPayment.vm</param>
       <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/paymentAdjustment.js</param>
       <param name="stylesheets">css/dataentry.css</param>
+      <param name="requiredAuthorities">F_PBF_PAYMENT_ADJUSTMENT_MANAGEMENT</param>
     </action>
     
 	<!-- Load Payment Adjustment List -->
@@ -245,6 +262,7 @@
         <param name="page">/dhis-web-maintenance-rbf/aggregationQueryList.vm</param>
         <param name="menu">/dhis-web-maintenance-rbf/menu.vm</param>
         <param name="javascripts">javascript/aggregationEngine.js</param>
+        <param name="requiredAuthorities">F_PBF_AGGREGATION_QUERY</param>
     </action>
 
     <action name="addAggregationQueryForm" class="org.hisp.dhis.rbf.aggregation.action.AddAggregationQueryFormAction">
@@ -310,7 +328,7 @@
    		<param name="page">/dhis-web-maintenance-rbf/qualityScorePaymentList.vm</param>
    		<param name="javascripts">javascript/qualityScorePayment.js</param>
    		<param name="menu">/dhis-web-maintenance-rbf/menu.vm</param>
-   		<param name="anyAuthorities">F_QUALITY_SCORE_PAYMENT</param>
+   		<param name="anyAuthorities">F_PBF_QUALITY_SCORE_PAYMENT</param>
    </action>
 
 
@@ -375,6 +393,7 @@
    		<param name="page">/dhis-web-maintenance-rbf/getAllLookups.vm</param>
    		<param name="javascripts">javascript/lookup.js</param>
    		<param name="menu">/dhis-web-maintenance-rbf/menu.vm</param>
+   		<param name="requiredAuthorities">F_PBF_LOOKUP</param>
    </action>
    
    <!-- Add Lookup -->
@@ -444,6 +463,7 @@
         <param name="page">/dhis-web-maintenance-rbf/pbfReportForm.vm</param>
         <param name="javascripts">javascript/prevNextPeriods.js</param>
         <param name="menu">/dhis-web-maintenance-rbf/menu.vm</param>
+        <param name="requiredAuthorities">F_PBF_REPORT</param>
    </action>	
 	
 	
@@ -455,6 +475,7 @@
    		<param name="page">/dhis-web-maintenance-rbf/utilizationRuleDataElements.vm</param>
    		<param name="javascripts">javascript/utilizationRule.js</param>
    		<param name="menu">/dhis-web-maintenance-rbf/menu.vm</param>
+   		<param name="requiredAuthorities">F_PBF_UTILIZATION_RULE_MANAGEMENT</param>
    </action>	
 	
 

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm	2014-07-28 09:27:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm	2014-08-04 06:49:50 +0000
@@ -25,9 +25,11 @@
 	   var fieldId = "#"+valueId;
 	   var defaultValue = document.getElementById(valueId).defaultValue;
 	   var value = document.getElementById(valueId).value;
-	
-	   if(defaultValue != value)
-	   {
+		
+	   //alert( defaultValue + ":" + value );
+	   
+	   //if(defaultValue != value)
+	  // {
 	       var dataValue = {
                 'dataElementId' : $utilizationRateDataElementId,        
                 'organisationUnitId' : $("#selectedOrgunitID").val(),
@@ -42,7 +44,7 @@
 	            success: handleSuccess,
 	            error: handleError
 	        } );
-	   }
+	   //}
 	
 	   function handleSuccess( json )
 	   {

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js	2014-07-28 09:27:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js	2014-08-04 06:49:50 +0000
@@ -183,8 +183,8 @@
 	var defaultValue = document.getElementById(valueId).defaultValue;
 	var value = document.getElementById( valueId ).value;
 	
-	if(defaultValue != value)
-	{
+	//if(defaultValue != value)
+	//{
 		var dataValue = {
 				'dataElementId' : dataElementId,
 				'valueType' : valueType,
@@ -201,7 +201,7 @@
             success: handleSuccess,
             error: handleError
         } );
-	}
+	//}
 	
 	function handleSuccess( json )
 	{
@@ -453,3 +453,79 @@
 			
 		} );
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+function getUtilizationRateTariffValue()
+{
+    var utilizationRate = $('#utilizationRate').val();
+	//alert( utilizationRate );
+	
+	var tempUtilizationRateDataElements = document.getElementById("utilizationRateDataElementLB");
+   	
+	if( utilizationRate != "" || utilizationRate != " " || utilizationRate != '' || utilizationRate != ' ' || utilizationRate.length != 0 )
+	{
+		for ( i=0; i < tempUtilizationRateDataElements.length; i++ )
+        {                    
+			var utilizationRateTariffMapValue1 = utilizationRateTariffMap[tempUtilizationRateDataElements.options[i].value];
+			
+			//alert( utilizationRateTariffMapValue1.split("#").length + " :  " + utilizationRateTariffMapValue1 );
+			
+			for( j=0; j < utilizationRateTariffMapValue1.split("#").length; j++ )
+			{
+		        var utilizationRateTariffMapValue = utilizationRateTariffMapValue1.split("#")[j];
+		        
+                var startRange = parseFloat( utilizationRateTariffMapValue.split(":")[0] );           
+                var endRange = parseFloat( utilizationRateTariffMapValue.split(":")[1] );
+                var tariffValue = parseFloat( utilizationRateTariffMapValue.split(":")[2] );    				
+			
+			    //alert( startRange + "--" + endRange + "--" +  tariffValue + "--" + utilizationRate );
+			
+                if( parseFloat( utilizationRate) >= parseFloat( startRange ) && parseFloat( utilizationRate ) < parseFloat( endRange ) )
+                {	
+					//alert( "2 Alert" + " : " + startRange + "--" + endRange + "--" +  tariffValue + "--" +  utilizationRate );
+					var dataElementId = tempUtilizationRateDataElements.options[i].value;
+					//alert( '#pbfdv_tariff_amt_'+dataElementId );
+                    $('#pbfdv_tariff_amt_'+dataElementId).val( tariffValue );
+					
+					//alert( $('#pbfdv_tariff_amt_'+dataElementId).val( parseFloat( tariffValue ) ) );
+                }
+            }
+        }
+	}
+	            
+}
+
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityMaxDataEntry.js'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityMaxDataEntry.js	2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityMaxDataEntry.js	2014-08-04 06:49:50 +0000
@@ -1,3 +1,8 @@
+window.onload=function(){
+	jQuery('#qualityMaxScoreDiv').dialog({autoOpen: false});	
+
+}
+
 
 	var COLOR_GREEN = '#b9ffb9';
 	var COLOR_YELLOW = '#fffe8c';
@@ -23,6 +28,9 @@
 
 selection.setListenerFunction( orgUnitHasBeenSelected );
 
+
+
+
 function orgUnitGroupChange()
 {
 	$( '#dataEntryFormDiv' ).html( '' );
@@ -211,3 +219,75 @@
 	}
 }
 
+
+function loadQualityMaxScore()
+{
+	
+	var dataSetId = $( '#dataSetId' ).val();
+	var orgUnitId = $( '#selectedOrgunitID' ).val();
+	var orgUnitGroupId = $( '#orgUnitGroupId' ).val();
+	
+	if ( dataSetId == "-1"  || orgUnitGroupId == "-1"  || orgUnitId == "" ||  orgUnitId.length == 0 )
+	{
+		alert( "Please Select Organisation unit / Orgainsation Unit Group / Dataset" );
+		//return false;
+	}
+	
+	else
+	{
+		jQuery('#qualityMaxScoreDiv').dialog('destroy').remove();
+		jQuery('<div id="qualityMaxScoreDiv">' ).load( 'loadQualityMaxScore.action?dataSetId='+ dataSetId + "&orgUnitId=" + orgUnitId + "&orgUnitGroupId=" + orgUnitGroupId ).dialog({
+			title: " Quality Max Score ",
+			maximize: true,
+			closable: true,
+			modal:true,
+			overlay:{background:'#000000', opacity:0.1},
+			width: 500,
+			height: 200
+		});
+	}
+	
+}
+
+
+function applyStartDateEndDate( startDateEndDate )
+{
+	var sDateEDate = startDateEndDate.split(":");
+	var startDate = sDateEDate[0];
+	
+	var enddate = sDateEDate[1];
+	
+	document.getElementById("startDate").value = startDate;
+	document.getElementById("endDate").value = enddate;
+	
+	jQuery('#qualityMaxScoreDiv').dialog('destroy').remove();
+	
+	loadDataEntryForm();
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm	2014-07-30 11:58:29 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm	2014-08-04 06:49:50 +0000
@@ -276,27 +276,37 @@
 	#end
 	<script>
 		
-    	function getUtilizationRateTariffValue()
-    	{
-            var utilizationRate = $('#utilizationRate').val();
-			//alert( utilizationRate );
-			
-			var tempUtilizationRateDataElements = document.getElementById("utilizationRateDataElementLB");
-    	   	
-			if( utilizationRate != "" || utilizationRate != " " || utilizationRate != '' || utilizationRate != ' ' || utilizationRate.length != 0 )
+function getUtilizationRateTariffValue()
+{
+    var utilizationRate = $('#utilizationRate').val();
+	//alert( utilizationRate );
+	
+	//alert( utilizationRate.length);
+	
+	var tempUtilizationRateDataElements = document.getElementById("utilizationRateDataElementLB");
+   	
+	//if( utilizationRate != "" || utilizationRate != " " || utilizationRate != '' || utilizationRate != ' ' || utilizationRate.length != 0 )
+	//{
+		for ( i=0; i < tempUtilizationRateDataElements.length; i++ )
+        {                    
+			var utilizationRateTariffMapValue1 = utilizationRateTariffMap[tempUtilizationRateDataElements.options[i].value];
+			
+			//alert( utilizationRateTariffMapValue1.split("#").length + " :  " + utilizationRateTariffMapValue1 );
+			
+			for( j=0; j < utilizationRateTariffMapValue1.split("#").length; j++ )
 			{
-    			for ( i=0; i < tempUtilizationRateDataElements.length; i++ )
-                {	
-    			
-    				var utilizationRateTariffMapValue = utilizationRateTariffMap[tempUtilizationRateDataElements.options[i].value];
-    				
-                    var startRange = parseFloat( utilizationRateTariffMapValue.split(":")[0] );           
-                    var endRange = parseFloat( utilizationRateTariffMapValue.split(":")[1] );
-                    var tariffValue = parseFloat( utilizationRateTariffMapValue.split(":")[2] );
-    				
-    				//alert( startRange + "--" + endRange + "--" +  tariffValue );
-    				
-                    if( parseFloat( utilizationRate) >= parseFloat( startRange ) && parseFloat( utilizationRate ) < parseFloat( endRange ) )
+		        var utilizationRateTariffMapValue = utilizationRateTariffMapValue1.split("#")[j];
+		        
+                var startRange = parseFloat( utilizationRateTariffMapValue.split(":")[0] );           
+                var endRange = parseFloat( utilizationRateTariffMapValue.split(":")[1] );
+                var tariffValue = parseFloat( utilizationRateTariffMapValue.split(":")[2] );    				
+			
+			    //alert( startRange + "--" + endRange + "--" +  tariffValue + "--" + utilizationRate );
+                
+                
+                if( utilizationRate != "" || utilizationRate != " " || utilizationRate != '' || utilizationRate != ' ' || utilizationRate.length != 0 )
+                {
+                	if( parseFloat( utilizationRate) >= parseFloat( startRange ) && parseFloat( utilizationRate ) < parseFloat( endRange ) )
                     {	
     					//alert( "2 Alert" + " : " + startRange + "--" + endRange + "--" +  tariffValue + "--" +  utilizationRate );
     					var dataElementId = tempUtilizationRateDataElements.options[i].value;
@@ -306,9 +316,20 @@
     					//alert( $('#pbfdv_tariff_amt_'+dataElementId).val( parseFloat( tariffValue ) ) );
                     }
                 }
-			}
-			            
-    	}
+                
+                if(  utilizationRate.length == 0 )
+                {
+                	var dataElementId = tempUtilizationRateDataElements.options[i].value;
+					//alert( '#pbfdv_tariff_amt_'+dataElementId );
+                    $('#pbfdv_tariff_amt_'+dataElementId).val( "" );
+                }
+               
+            }
+        }
+	//}
+	            
+}
+
 			
 			function calTariffVal( dataElementId ) {
 					var total = 0.0;

=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadQualityMaxScore.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadQualityMaxScore.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadQualityMaxScore.vm	2014-08-04 06:49:50 +0000
@@ -0,0 +1,100 @@
+
+
+<script type="text/javascript">
+
+</script>
+
+<style>
+	
+/* tables */
+table.tablesorter {
+    font-family:arial;
+    background-color: #CDCDCD;
+    margin:10px 0pt 15px;
+    font-size: 8pt;
+    width: 100%;
+    text-align: left;
+}
+table.tablesorter thead tr th, table.tablesorter tfoot tr th {
+    background-color: #e6EEEE;
+    border: 1px solid #FFF;
+    font-size: 8pt;
+    padding: 4px;
+}
+table.tablesorter thead tr .header {
+    background-image: url(bg.gif);
+    background-repeat: no-repeat;
+    background-position: center right;
+    cursor: pointer;
+}
+table.tablesorter tbody td {
+    color: #3D3D3D;
+    padding: 4px;
+    background-color: #FFF;
+    vertical-align: top;
+}
+table.tablesorter tbody tr.odd td {
+    background-color:#F0F0F6;
+}
+table.tablesorter thead tr .headerSortUp {
+    background-image: url(asc.gif);
+}
+table.tablesorter thead tr .headerSortDown {
+    background-image: url(desc.gif);
+}
+table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
+background-color: #8dbdd8;
+}
+
+table.tablesorter td:hover {
+ background-color: #ffff99;
+}
+
+table.tablesorter tr.odd td:hover {
+ background-color: #ffff99;
+}
+	
+</style>
+
+
+
+#set( $tabIndex = 1 )
+#if ( $qualityMaxValues.size() > 0 )
+
+
+	<table class="tablesorter" id="table1">
+		<thead>
+        
+    	<tr bgcolor="#CBDDEB">
+    		<th style="text-align: center;width:100px">Sl No</th>
+			<th style="text-align: center;width:100px">$i18n.getString( "date" )(yyyy-mm-dd)</th>
+    		<th style="text-align: center;width:100px">Apply</th>
+    	</tr>
+        </thead>
+		<tbody>
+    	#set( $mark = false )
+    	#set( $count=1 )
+    	#foreach($qualityMaxValue in $qualityMaxValues )
+    		<tr #alternate($mark)>
+    			 <td style="text-align: center;width:100px" >$count</td>
+				 <td style="text-align: center;width:100px" >$qualityMaxValue</td>
+				
+				<td style="text-align: center;width:100px" >
+					#set( $buttonId = $qualityMaxValue )
+					<input type="button" id="button$buttonId" name="button$buttonId" value='$i18n.getString( "Apply" )' onclick="applyStartDateEndDate( '$qualityMaxValue' );" />
+				</td>
+    		</tr>
+    		#set( $tabIndex = $tabIndex + 1 )
+    		#set( $mark = !$mark)
+    		#set($count = $count + 1)
+    	#end
+		</tbody>
+	</table>
+#end
+
+<script>
+    $(document).ready(function()
+    { 
+        $("#table1").tablesorter( {widgets: ['zebra'], headers: { 2:{sorter: false}}} );                          
+    });
+</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-06-20 10:21:56 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm	2014-08-04 06:49:50 +0000
@@ -1,6 +1,32 @@
 
 <h2>$i18n.getString( "pbf_setup" )</h2>
 <ul>	
+
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "pbfDataEntry") )
+    	<li><a href="pbfDataEntry.action">$i18n.getString( "pbf_dataentry" )</a></li>
+    #end	
+	
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "qualityScoreDataEntry") )
+    	<li><a href="qualityScoreDataEntry.action">$i18n.getString( "quality_score_entry" )</a></li>
+    #end	
+
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "qualityMaxDataEntry") )
+    	<li><a href="qualityMaxDataEntry.action">$i18n.getString( "quality_max_entry" )</a></li>
+    #end	
+	
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "dataElementTariffManagement") )
+    	<li><a href="dataElementTariffManagement.action">$i18n.getString( "dataelement_tariff_target_management" )</a></li>
+    #end	
+	
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "bankDetailsManagement") )
+    	<li><a href="bankDetailsManagement.action">$i18n.getString( "bank_details_management" )</a></li>
+    #end	
+	
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "utilizationRuleManagement") )
+    	<li><a href="utilizationRuleManagement.action">$i18n.getString( "utilization_rule_management" )</a></li>
+	#end
+	
+	<!--
 	<li><a href="pbfDataEntry.action">$i18n.getString( "pbf_dataentry" )</a></li>
 
     <li><a href="qualityScoreDataEntry.action">$i18n.getString( "quality_score_entry" )</a></li>
@@ -13,35 +39,46 @@
 	
 	<li><a href="utilizationRuleManagement.action">$i18n.getString( "utilization_rule_management" )</a></li>
 	
-</ul>
-
-<h2>$i18n.getString( "quality_score_payment" )</h2>
-<ul>
-    <li><a href="qualityScorePaymentList.action">$i18n.getString( "quality_score_payment" )</a></li>
-</ul>
-
-<h2>$i18n.getString( "aggregation_builder" )</h2>
-<ul>
-    <li><a href="aggregationQueryList.action">$i18n.getString( "aggregation_query_list" )</a></li>
-    <li><a href="runAggregationQueryForm.action">$i18n.getString( "manual_aggregation" )</a></li>
-</ul>
-
-<h2>$i18n.getString( "pbf_report" )</h2>
-<ul>
-    <li><a href="pbfReportForm.action">$i18n.getString( "pbf_report" )</a></li>
-</ul>
-
-
-<h2>$i18n.getString( "Lookup" )</h2>
-<ul>
-	<li><a href="getAllLookups.action">$i18n.getString( "Lookup" )</a></li>
-</ul>
+	-->
+	
+</ul>
+
+
+#if( $auth.hasAccess( "dhis-web-maintenance-rbf", "qualityScorePaymentList") )
+	<h2>$i18n.getString( "quality_score_payment" )</h2>
+	<ul>
+		<li><a href="qualityScorePaymentList.action">$i18n.getString( "quality_score_payment" )</a></li>
+	</ul>
+#end
+
+#if( $auth.hasAccess( "dhis-web-maintenance-rbf", "aggregationQueryList") )
+    <h2>$i18n.getString( "aggregation_builder" )</h2>
+    <ul>
+        <li><a href="aggregationQueryList.action">$i18n.getString( "aggregation_query_list" )</a></li>
+        <li><a href="runAggregationQueryForm.action">$i18n.getString( "manual_aggregation" )</a></li>
+    </ul>
+#end
+
+
+#if( $auth.hasAccess( "dhis-web-maintenance-rbf", "pbfReportForm") )
+    <h2>$i18n.getString( "pbf_report" )</h2>
+    <ul>
+        <li><a href="pbfReportForm.action">$i18n.getString( "pbf_report" )</a></li>
+    </ul>
+#end
+
+#if( $auth.hasAccess( "dhis-web-maintenance-rbf", "pbfReportForm") )
+    <h2>$i18n.getString( "Lookup" )</h2>
+    <ul>
+    	<li><a href="getAllLookups.action">$i18n.getString( "Lookup" )</a></li>
+    </ul>
+#end
 
 #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "getPaymentAdjustmentDetail") )
-<h2>$i18n.getString( "payment_adjustment" )</h2>
-<ul>
-	<li><a href="getPaymentAdjustmentDetail.action">$i18n.getString( "payment_adjustment" )</a></li>
-</ul>
+    <h2>$i18n.getString( "payment_adjustment" )</h2>
+    <ul>
+    	<li><a href="getPaymentAdjustmentDetail.action">$i18n.getString( "payment_adjustment" )</a></li>
+    </ul>
 #end
 
 <!--

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm	2014-07-25 10:59:27 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm	2014-08-04 06:49:50 +0000
@@ -156,6 +156,12 @@
 			{
 				var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/monthly_pps.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
 				window.location.href =  birtReportURL;
+				
+				/*
+				var birtReportURL = "/birt/run?__report=/home/dhis2sever2/tomcat-8/webapps/birt/report/Mathealth_report3_PH.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+				window.location.href =  birtReportURL;
+				*/
+				
 			}
 			
 			else if( orgUnitGroupName == "Province Hospitals")
@@ -231,7 +237,7 @@
 					<option value="-1">[$i18n.getString( "select" )]</option>
 					<option value="MATERNAL_HEALTH" >Maternal Health</option>
 					<option value="MONTHLY_PPS" >Monthly PPS</option>
-					<option value="MH_PATIENT_ALLOWANCE_CLAIM" >MH Patient Allownce Claim</option>
+					<option value="MH_PATIENT_ALLOWANCE_CLAIM" >MH Patient Allowance Claim</option>
 					<option value="HEALTH_PROVIDER_PAYMENT_CLAIM" >Health Provider Payment Claim</option>
 					
 					<!--

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityMaxEntrySelection.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityMaxEntrySelection.vm	2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityMaxEntrySelection.vm	2014-08-04 06:49:50 +0000
@@ -37,7 +37,7 @@
 	
 </div>
 
-<div class="inputCriteria" style="width:560px;height:auto;">
+<div class="inputCriteria" style="width:650px;height:auto;">
 <table>
 	<tr>
 		<td><label for="orgUnitName">$i18n.getString( "organisation_unit" )</label></td>
@@ -66,6 +66,8 @@
 					<option value="$dataSet.id">$dataSet.name</option>
 				#end
 			</select>
+			&nbsp;<a href="javascript:loadQualityMaxScore()">$i18n.getString( "quality_max_score" )&nbsp;</a>
+			
 		</td>		
     </tr>
 	<tr>
@@ -85,7 +87,8 @@
 
 
 #parse( "/dhis-web-commons/loader/loader.vm" )
-<div id='dataEntryFormDiv'></div> <!-- DataEntry Form -->  	
+<div id='dataEntryFormDiv'></div> <!-- DataEntry Form -->
+<div id='qualityMaxScoreDiv'></div> <!-- DataEntry Form --> 
 
 </form>