Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-187: IMIS web and policies app: Renewal extracts dont work #126

Merged
merged 3 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

apply plugin: 'com.android.application'
apply plugin: "org.ajoberstar.grgit"
apply from: "$project.rootDir/script-git-version.gradle"
apply plugin: 'com.android.application'

// Load keystore
def keystorePropertiesFile = file("keystore.properties")
Expand Down Expand Up @@ -149,8 +149,6 @@ android {
resValue "string", "app_name_policies", "Policies CHF SIT"
}
niger {
print("Building niger flavour" + "API_BASE_URL" + '"' + (System.getenv("API_BASE_URL") ?: 'http://192.168.0.100/') + '"')
print("App name: " + System.getenv("CLI_APP_NAME") ?: "Polices Niger")
applicationId "org.openimis.imispolicies.niger"
buildConfigField "String", "API_BASE_URL", '"' + (System.getenv("API_BASE_URL") ?: 'http://192.168.0.100/') + '"'
buildConfigField "String", "APP_DIR", '"' + (System.getenv("CLI_APP_DIR") ?: 'IMIS-POL') + '"'
Expand Down Expand Up @@ -216,8 +214,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

Expand All @@ -236,6 +234,6 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.1'
//compile 'com.android.support:support-annotations:27.1.1'
}
8 changes: 2 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.READ_CALL_LOG"
tools:node="remove" />
<uses-permission
android:name="android.permission.READ_CONTACTS"
tools:node="remove" />
<uses-permission android:name="android.permission.READ_CALL_LOG"/>
dragos-dobre marked this conversation as resolved.
Show resolved Hide resolved
<uses-permission android:name="android.permission.READ_CONTACTS"/>

<uses-feature
android:name="android.hardware.camera"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2602,7 +2602,7 @@ public String OfflineRenewals(String OfficerCode) {
}


public String InsertRenewals(String Result) {
public String InsertRenewalsFromApi(String Result) {
String TableName = "tblRenewals";
String[] Columns = {"renewalId", "policyId", "officerId", "officerCode", "chfid", "lastName", "otherNames", "productCode", "productName", "villageName", "renewalPromptDate", "phone", "renewalUUID"};
String Where = "isDone = ?";
Expand All @@ -2617,6 +2617,21 @@ public String InsertRenewals(String Result) {
return String.valueOf(1);
}

public String InsertRenewalsFromExtract(String Result) {
String TableName = "tblRenewals";
String[] Columns = {"RenewalId", "PolicyId", "OfficerId", "OfficerCode", "CHFID", "LastName", "OtherNames", "ProductCode", "ProductName", "VillageName", "RenewalPromptDate", "Phone", "RenewalUUID"};
String Where = "isDone = ?";
String[] WhereArg = {"N"};
sqlHandler.deleteData(TableName, Where, WhereArg);
try {
sqlHandler.insertData(TableName, Columns, Result, "");
} catch (JSONException e) {
e.printStackTrace();
return String.valueOf(0);
}
return String.valueOf(1);
}

public Boolean deleteRecodedPolicy(String policyId) {
String Where = "PolicyId = ?";
String[] WhereArg = {policyId};
Expand Down Expand Up @@ -3942,7 +3957,6 @@ public boolean unZip(String FileName) {
public boolean unZipFeedbacksRenewals(String FileName) {
String targetPath = global.getSubdirectory("Database") + File.separator + FileName;
String unzippedFolderPath = global.getSubdirectory("Database");
//String unzippedFolderPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + "/IMIS/Enrolment/Enrolment_"+global.getOfficerCode()+"_"+d+".xml";

String password = getRarPwd();
try {
Expand Down
Loading