← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2980: Fix bug: Error into 'Beneficiary Aggregation Form'.

 

------------------------------------------------------------
revno: 2980
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-03-07 16:15:23 +0700
message:
  Fix bug: Error into 'Beneficiary Aggregation Form'.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java


--
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 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java	2011-01-14 16:18:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java	2011-03-07 09:15:23 +0000
@@ -257,11 +257,12 @@
 
                         double resultValue = aggregationConditionService.parseConditition( condition, orgUnit, period );
 
+                        DataValue dataValue = dataValueService
+                                    .getDataValue( orgUnit, dElement, period, optionCombo );
+
                         if ( resultValue != 0 )
                         {
-                            DataValue dataValue = dataValueService
-                                .getDataValue( orgUnit, dElement, period, optionCombo );
-
+                           
                             if ( dataValue == null )
                             {
                                 dataValue = new DataValue( dElement, period, orgUnit, "" + resultValue, storedBy,
@@ -282,6 +283,16 @@
                             }
 
                         }
+                        else if ( dataValue != null )
+                        {
+                                dataValue.setValue( "" + resultValue );
+                                dataValue.setTimestamp( new Date() );
+                                dataValue.setStoredBy( storedBy );
+
+                                dataValueService.deleteDataValue( dataValue );
+
+                                mapDataValues.put( dataValue, i18n.getString( "updated" ) + " " + message );
+                        }
 
                     }// PeriodList end