← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17602: local/in Add Intriduction in Welcome page of Maintenance RBF

 

------------------------------------------------------------
revno: 17602
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-11-27 06:21:56 +0000
message:
  local/in Add Intriduction in Welcome page of Maintenance RBF
modified:
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/Lookup.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.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/resources/org/hisp/dhis/rbf/i18n_module.properties
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScoreDataEntry.js
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadQualityScoreEntryForm.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.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/api/Lookup.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/Lookup.java	2014-11-12 09:32:10 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/Lookup.java	2014-11-27 06:21:56 +0000
@@ -32,6 +32,9 @@
     public static final String CATEGORY_QUANTITY_VALIDATED = "CATEGORY_QUANTITY_VALIDATED";
     public static final String CATEGORY_QUANTITY_EXTERNAL_VERIFICATION = "CATEGORY_QUANTITY_EXTERNAL_VERIFICATION";
     
+    public static final String QUALITY_OVERHEAD_PAYMENT = "QUALITY_OVERHEAD_PAYMENT";
+    
+    
     private String type;
     
     private String value;

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java	2014-08-06 06:19:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java	2014-11-27 06:21:56 +0000
@@ -336,11 +336,25 @@
             	else if( valueType.equals("2") )
             	{
             	    pbfDataValue.setQuantityValidated( Integer.parseInt( value ) );
+            	    try
+            	    {
+            	        pbfDataValue.setTariffAmount( Double.parseDouble( tariffAmt ) );
+            	    }
+            	    catch( Exception e )
+            	    {
+            	    }
             	}
             	
             	else if( valueType.equals("3") )
                 {
                     pbfDataValue.setQuantityExternalVerification( Integer.parseInt( value ) );
+                    try
+                    {
+                        pbfDataValue.setTariffAmount( Double.parseDouble( tariffAmt ) );
+                    }
+                    catch( Exception e )
+                    {
+                    }
                 }
                 
             	pbfDataValue.setStoredBy(storedBy);
@@ -361,6 +375,14 @@
                 }
         	pbfDataValue.setQuantityReported( intVal );
         	
+        	try
+                {
+                    pbfDataValue.setTariffAmount( Double.parseDouble( tariffAmt ) );
+                }
+                catch( Exception e )
+                {
+                }
+        	
         	System.out.println(" PBF Value 1 " + intVal );
             }
             else if( valueType.equals("2") )
@@ -375,6 +397,14 @@
                 
         	pbfDataValue.setQuantityValidated( intVal );
         	
+        	try
+                {
+                    pbfDataValue.setTariffAmount( Double.parseDouble( tariffAmt ) );
+                }
+                catch( Exception e )
+                {
+                }
+        	
             }
             
             else if( valueType.equals("3") )
@@ -387,6 +417,14 @@
                 System.out.println(" PBF Value 3 " + intVal );
                 
                 pbfDataValue.setQuantityExternalVerification( intVal );
+                
+                try
+                {
+                    pbfDataValue.setTariffAmount( Double.parseDouble( tariffAmt ) );
+                }
+                catch( Exception e )
+                {
+                }
             }
             
             pbfDataValue.setStoredBy(storedBy);

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.java	2014-11-20 07:51:59 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.java	2014-11-27 06:21:56 +0000
@@ -119,17 +119,24 @@
         Constant orgUnitGrp = constantService.getConstantByName( PAYMENT_ADJUSTMENT_LEVEL_ORG_GROUP );
 
         Constant paymentAmount = constantService.getConstantByName( PAYMENT_ADJUSTMENT_AMOUNT_DE );
-
-        amountDEId = paymentAmount.getValue() + "";
-
-        List<OrganisationUnit> organisationUnitList = new ArrayList<OrganisationUnit>( organisationUnitGroupService
-            .getOrganisationUnitGroup( (int) orgUnitGrp.getValue() ).getMembers() );
-
-        for ( OrganisationUnit org : organisationUnitList )
-        {
-            orgUnitList.add( "\"" + org.getUid() + "\"" );
-        }
-
+        
+        if( paymentAmount != null )
+        {
+            amountDEId = paymentAmount.getValue() + "";
+        }
+        
+        List<OrganisationUnit> organisationUnitList = new ArrayList<OrganisationUnit>();
+        
+        if( orgUnitGrp != null )
+        {
+            organisationUnitList = new ArrayList<OrganisationUnit>( organisationUnitGroupService.getOrganisationUnitGroup( (int) orgUnitGrp.getValue() ).getMembers() );
+            
+            for ( OrganisationUnit org : organisationUnitList )
+            {
+                orgUnitList.add( "\"" + org.getUid() + "\"" );
+            }
+        }
+        
         List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );
         
         dataSets = new ArrayList<DataSet>();
@@ -141,6 +148,7 @@
 
             dataSets.add( dataSet );
         }
+        
         String periodType = "Quarterly";
 
         CalendarPeriodType _periodType = (CalendarPeriodType) CalendarPeriodType.getPeriodTypeByName( periodType );

=== 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-10-24 11:05:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java	2014-11-27 06:21:56 +0000
@@ -216,11 +216,24 @@
         return locked;
     }
     
+    private int overHeadPaymentDataElementId;
+    
+    public int getOverHeadPaymentDataElementId()
+    {
+        return overHeadPaymentDataElementId;
+    }
+    
+    private String overHeadPaymentDEValue = "";
+    
+    public String getOverHeadPaymentDEValue()
+    {
+        return overHeadPaymentDEValue;
+    }
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
-
     public String execute()
         throws Exception
     {
@@ -241,6 +254,11 @@
             tariff_setting_authority = (int) tariff_authority.getValue();
         }
         
+        Constant qualityMaxDataElement = constantService.getConstantByName( QUALITY_MAX_DATAELEMENT );
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
+        
+        
+        
         Constant overAllQtyDetId = constantService.getConstantByName( OVER_ALL_QUALITY_SCORE_DATAELEMENT_ID );
         DataElement overAllDataElement = dataElementService.getDataElement( (int) overAllQtyDetId.getValue() );
         overAllQtyDataElementId = 0;
@@ -249,8 +267,26 @@
             overAllQtyDataElementId = overAllDataElement.getId();
         }
         
-        Constant qualityMaxDataElement = constantService.getConstantByName( QUALITY_MAX_DATAELEMENT );
-        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
+        
+        Lookup ohPaymentlookup =  lookupService.getLookupByName( Lookup.QUALITY_OVERHEAD_PAYMENT );
+        
+        if( ohPaymentlookup != null )
+        {
+            DataElement overHeadPaymentDataElement = dataElementService.getDataElement( Integer.parseInt( ohPaymentlookup.getValue() ) );
+            overHeadPaymentDataElementId = 0;
+            if( overHeadPaymentDataElement != null )
+            {
+                overHeadPaymentDataElementId = overHeadPaymentDataElement.getId();
+            }
+            
+            DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
+            DataValue dataValue = dataValueService.getDataValue( overHeadPaymentDataElement, period, organisationUnit, optionCombo );
+            if ( dataValue != null )
+            {
+                overHeadPaymentDEValue = dataValue.getValue();
+            }        
+            
+        }
         
         List<OrganisationUnit> orgUnitBranch = organisationUnitService.getOrganisationUnitBranch( organisationUnit.getId() );
         String orgUnitBranchIds = "-1";

=== 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-08-04 06:49:50 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java	2014-11-27 06:21:56 +0000
@@ -139,6 +139,20 @@
         this.overAllScoreDeId = overAllScoreDeId;
     }
     
+    private String overHeadPaymentDeId;
+    
+    public void setOverHeadPaymentDeId( String overHeadPaymentDeId )
+    {
+        this.overHeadPaymentDeId = overHeadPaymentDeId;
+    }
+    
+    private String overHeadPaymentValue;
+    
+    public void setOverHeadPaymentValue( String overHeadPaymentValue )
+    {
+        this.overHeadPaymentValue = overHeadPaymentValue;
+    }
+    
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -291,6 +305,51 @@
             
         }
         
+        // Save Quality overhead payment in dataValue
+        if ( overHeadPaymentValue != null && overHeadPaymentDeId != null )
+        {
+            overHeadPaymentValue = overHeadPaymentValue.trim();
+            
+            DataElement overHeadPaymentDataElement = dataElementService.getDataElement( Integer.parseInt( overHeadPaymentDeId ) );
+
+            if ( overHeadPaymentDataElement == null )
+            {
+                return logError( "Invalid dataelement identifier: " + overHeadPaymentDeId );
+            }
+            
+            DataValue overHeadPaymentDataValue = dataValueService.getDataValue( overHeadPaymentDataElement, period, organisationUnit, optionCombo );
+            
+            if ( overHeadPaymentDataValue == null )
+            {
+                if ( overHeadPaymentValue != null && (!overHeadPaymentValue.trim().equals( "" ) )  )
+                {
+                    overHeadPaymentDataValue = new DataValue();
+                    
+                    overHeadPaymentDataValue.setPeriod( period );
+                    overHeadPaymentDataValue.setDataElement( overHeadPaymentDataElement );
+                    overHeadPaymentDataValue.setSource(organisationUnit);
+                    overHeadPaymentDataValue.setCategoryOptionCombo( optionCombo );
+                    
+                    overHeadPaymentDataValue.setValue( overHeadPaymentValue.trim() );
+                    overHeadPaymentDataValue.setLastUpdated( now );
+                    
+                    overHeadPaymentDataValue.setStoredBy( storedBy );
+                    
+                    dataValueService.addDataValue( overHeadPaymentDataValue );
+                }
+            }
+            else
+            {
+                if( !( overHeadPaymentValue.trim().equalsIgnoreCase( overHeadPaymentDataValue.getValue() ) ) )
+                {
+                    overHeadPaymentDataValue.setValue( overHeadPaymentValue.trim() );
+                    overHeadPaymentDataValue.setLastUpdated( now );
+                    overHeadPaymentDataValue.setStoredBy( storedBy );                
+                    dataValueService.updateDataValue( overHeadPaymentDataValue );
+              }            
+            }
+            
+        }
         
         return SUCCESS;
     }

=== 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-11-25 07:11:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties	2014-11-27 06:21:56 +0000
@@ -130,17 +130,17 @@
 report_management = Report Management
 lookup = Lookup
 
-intro_pbf_dataentry = Introduction to PBF Data Entry
-intro_quality_score_entry = 
-intro_quality_max_entry = 
-intro_dataelement_tariff_target_management = 
-intro_partner_management =
-intro_bank_details_management = 
-intro_utilization_rule_management = 
-intro_quality_score_payment = 
-intro_manual_aggregation = 
-intro_aggregation_query_list = 
-intro_pbf_report = 
-intro_report_management = 
-intro_lookup =
-intro_payment_adjustment = 
\ No newline at end of file
+intro_pbf_dataentry = Manage performance of PBF indicators
+intro_quality_score_entry = Manage quality scores for quality related indicators
+intro_quality_max_entry = Manage quality max scores for quality related indicators
+intro_dataelement_tariff_target_management = Manage tariffs for PBF indicators
+intro_partner_management = Manage partners for PBF indicators
+intro_bank_details_management = Manage bank details
+intro_utilization_rule_management = Manage utilisation rules and associate tariffs with utilisation rates
+intro_quality_score_payment = Manage quality score ranges for additional quality payment
+intro_manual_aggregation = Run the aggregation queries to aggregate facility based PBF data
+intro_aggregation_query_list = Create new aggregation queries for aggregate data analysis
+intro_pbf_report = Generate PBF Reports
+intro_report_management = Manage PBF reports
+intro_lookup = Configure and manage Look up combinations
+intro_payment_adjustment = Manage PBF payments based on availability of funds
\ No newline at end of file

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScoreDataEntry.js'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScoreDataEntry.js	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScoreDataEntry.js	2014-11-27 06:21:56 +0000
@@ -119,6 +119,12 @@
 	
 	var overAllScorefieldId = "#"+overAllScoreDeId;
 	
+	var overHeadPaymentValue = document.getElementById("qualityOverHeadPayment").value;
+	
+	var overHeadPaymentDeId  = document.getElementById("overHeadPaymentDataElementId").value;
+	
+	var overHeadPaymentfieldId = "#"+overHeadPaymentDeId;
+	
 	var fieldId = "#"+valueId;
 	var defaultValue = document.getElementById(valueId).defaultValue;
 	var value = document.getElementById(valueId).value;
@@ -131,7 +137,9 @@
         'periodIso' : period,
         'value' : value,
         'overAllScoreValue' : overAllScoreValue,
-        'overAllScoreDeId'  : overAllScoreDeId
+        'overAllScoreDeId'  : overAllScoreDeId,
+        'overHeadPaymentValue' : overHeadPaymentValue,
+        'overHeadPaymentDeId' : overHeadPaymentDeId
     };
 	    jQuery.ajax( {
 	            url: 'saveDataValue.action',
@@ -150,18 +158,21 @@
 	    {
 	    	 markValue( fieldId, COLOR_GREEN );
 	    	 markValue( overAllScorefieldId, COLOR_GREEN );
+	    	 markValue( overHeadPaymentfieldId, COLOR_GREEN );
 	    	 
 	    }
 	    else if ( code == 2 )
 	    {
 	        markValue( fieldId, COLOR_RED );
 	        markValue( overAllScorefieldId, COLOR_RED );
+	        markValue( overHeadPaymentfieldId, COLOR_RED );
 	        window.alert( i18n_saving_value_failed_dataset_is_locked );
 	    }
 	    else // Server error during save
 	    {
 	        markValue( fieldId, COLOR_RED );
 	        markValue( overAllScorefieldId, COLOR_RED );
+	        markValue( overHeadPaymentfieldId, COLOR_RED );
 	        window.alert( i18n_saving_value_failed_status_code + '\n\n' + code );
 	    }            
 	}
@@ -169,12 +180,15 @@
 	function handleError( jqXHR, textStatus, errorThrown )
 	{       
 	    markValue( fieldId, COLOR_GREEN );
+	    markValue( overAllScorefieldId, COLOR_GREEN );
+   	 	markValue( overHeadPaymentfieldId, COLOR_GREEN );
 	}
 
 	function markValue( fieldId, color )
 	{
 	    document.getElementById(valueId).style.backgroundColor = color;
 	    document.getElementById("all-total").style.backgroundColor = color;
+	    document.getElementById("qualityOverHeadPayment").style.backgroundColor = color;
 	}
 }
 

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadQualityScoreEntryForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadQualityScoreEntryForm.vm	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadQualityScoreEntryForm.vm	2014-11-27 06:21:56 +0000
@@ -27,6 +27,7 @@
 </select>
 
 <input type="hidden" id='overAllQtyDataElementId' name = 'overAllQtyDataElementId' value="$!overAllQtyDataElementId" />
+<input type="hidden" id='overHeadPaymentDataElementId' name = 'overHeadPaymentDataElementId' value="$!overHeadPaymentDataElementId" />
 <input type="hidden" id='dataSetLockStatus' name = 'dataSetLockStatus' value="$locked" />
 
 #set( $tabIndex = 1 )
@@ -120,7 +121,7 @@
         <tr>
             <td colspan="3" style="text-align: right;">Quality overhead payment</td>           
             <td >
-                <input type="text" id="qualityOverHeadPayment" style="text-align: center;" readonly size="18"/>%
+                <input type="text" id="qualityOverHeadPayment" style="text-align: center;" readonly size="18" value="$!overHeadPaymentDEValue" />%
             </td>
         </tr>       
 

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.vm	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.vm	2014-11-27 06:21:56 +0000
@@ -72,7 +72,7 @@
 <script type="text/javascript">
 
 var i18n_select_dataset = '$encoder.jsEscape( $i18n.getString( "select_dataSet" ) , "'")';
-var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';'
+var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
 var i18n_dataset_is_locked1 = '$encoder.jsEscape( $i18n.getString( "dataset_is_locked" ) , "'")';
 
 jQuery( document ).ready( function()