Skip to content

Commit 385deec

Browse files
committed
fix reports stats
1 parent e530891 commit 385deec

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

claimManagement/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ repositories {
2121
android {
2222
compileSdkVersion 32
2323
buildToolsVersion '33.0.0'
24+
namespace 'org.openimis.imisclaims'
2425

2526
defaultConfig {
2627
applicationId "org.openimis.imisclaims"

claimManagement/src/main/java/org/openimis/imisclaims/Report.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import androidx.appcompat.widget.Toolbar;
66
import android.widget.TextView;
77

8+
import org.json.JSONObject;
9+
810
import java.io.File;
911

1012
public class Report extends ImisActivity {
@@ -38,6 +40,8 @@ protected void onCreate(Bundle savedInstanceState) {
3840
File pendingFolder = new File(PendingFolder);
3941
File trashFolder = new File(TrashFolder);
4042

43+
JSONObject counts = sqlHandler.getClaimCounts();
44+
4145
int countAccepted = 0;
4246
int countRejected = 0;
4347
if (acceptedClaims.listFiles().length > 0) {
@@ -54,7 +58,7 @@ protected void onCreate(Bundle savedInstanceState) {
5458
}
5559
}
5660
} else {
57-
countAccepted = 0;
61+
countAccepted = counts.optInt(SQLHandler.CLAIM_UPLOAD_STATUS_ACCEPTED, 0);;
5862
}
5963

6064
if (rejectedClaims.listFiles().length > 0) {
@@ -71,7 +75,7 @@ protected void onCreate(Bundle savedInstanceState) {
7175
}
7276
}
7377
} else {
74-
countRejected = 0;
78+
countRejected = counts.optInt(SQLHandler.CLAIM_UPLOAD_STATUS_REJECTED, 0);;
7579
}
7680
//Pending & Trash
7781
int count_pending = 0;
@@ -90,7 +94,7 @@ protected void onCreate(Bundle savedInstanceState) {
9094
}
9195
}
9296
} else {
93-
count_pending = 0;
97+
count_pending = counts.optInt(SQLHandler.CLAIM_UPLOAD_STATUS_ENTERED, 0);;
9498
}
9599

96100
if (trashFolder.listFiles().length > 0) {

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
android.enableJetifier=true
22
android.useAndroidX=true
3+
android.defaults.buildfeatures.buildconfig=true
4+
android.nonFinalResIds=false

0 commit comments

Comments
 (0)