← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3139: Minor fix

 

------------------------------------------------------------
revno: 3139
committer: Tran Ng Minh Luan <Luan@MinhLuan-PC>
branch nick: dhis2
timestamp: Sun 2011-03-27 22:39:28 +0700
message:
  Minor fix
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.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-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2011-03-22 04:36:39 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2011-03-27 15:39:28 +0000
@@ -108,24 +108,26 @@
             Set<ProgramStageInstance> programStageInstances = programInstance.getProgramStageInstances();
             Inner: for ( ProgramStageInstance programStageInstance : programStageInstances )
             {
-                expiredDate.setTime( DateUtils.getDateAfterAddition( programStageInstance.getDueDate(),
-                    programStageInstance.getProgramInstance().getProgram().getMaxDaysAllowedInputData() ) );
-                if ( programStageInstance.getDueDate().getTime() < time && expiredDate.getTimeInMillis() > time )
-                {
-                    Activity activity = new Activity();
-                    activity.setBeneficiary( programInstance.getPatient() );
-                    activity.setTask( programStageInstance );
-                    activity.setDueDate( programStageInstance.getDueDate() );
-                    items.add( activity );
-                }
-                if ( programStageInstance.getDueDate().getTime() > time && expiredDate.getTimeInMillis() > time )
-                {
-                    Activity activity = new Activity();
-                    activity.setBeneficiary( programInstance.getPatient() );
-                    activity.setTask( programStageInstance );
-                    activity.setDueDate( programStageInstance.getDueDate() );
-                    items.add( activity );
-                    break Inner;
+                if(!programStageInstance.isCompleted()){
+                    expiredDate.setTime( DateUtils.getDateAfterAddition( programStageInstance.getDueDate(),
+                        programStageInstance.getProgramInstance().getProgram().getMaxDaysAllowedInputData() ) );
+                    if ( programStageInstance.getDueDate().getTime() < time && expiredDate.getTimeInMillis() > time )
+                    {
+                        Activity activity = new Activity();
+                        activity.setBeneficiary( programInstance.getPatient() );
+                        activity.setTask( programStageInstance );
+                        activity.setDueDate( programStageInstance.getDueDate() );
+                        items.add( activity );
+                    }
+                    if ( programStageInstance.getDueDate().getTime() > time && expiredDate.getTimeInMillis() > time )
+                    {
+                        Activity activity = new Activity();
+                        activity.setBeneficiary( programInstance.getPatient() );
+                        activity.setTask( programStageInstance );
+                        activity.setDueDate( programStageInstance.getDueDate() );
+                        items.add( activity );
+                        break Inner;
+                    }
                 }
             }
         }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java	2011-03-22 04:36:39 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java	2011-03-27 15:39:28 +0000
@@ -128,8 +128,8 @@
             task.setProgramStageId( each.getTask().getProgramStage().getId() );
             task.setProgramId( each.getTask().getProgramInstance().getProgram().getId() );
             activity.setTask( task );
-
-            activity.setLate( each.isCompleted() );
+            
+            activity.setLate( each.getDueDate().getTime() < time );
 
             activity.setExpireDate( expiredDate );