check_visit
This commit is contained in:
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="1.8" />
|
<bytecodeTargetLevel target="11" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
+1
-1
@@ -46,7 +46,7 @@
|
|||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
Generated
+1
@@ -3,6 +3,7 @@
|
|||||||
<component name="RunConfigurationProducerService">
|
<component name="RunConfigurationProducerService">
|
||||||
<option name="ignoredProducers">
|
<option name="ignoredProducers">
|
||||||
<set>
|
<set>
|
||||||
|
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
|||||||
@@ -22,18 +22,18 @@ android {
|
|||||||
minSdkVersion 20
|
minSdkVersion 20
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
/*//For Egypt
|
//For Egypt
|
||||||
versionCode 31
|
versionCode 30
|
||||||
versionName "4.3"*/
|
versionName "4.2"
|
||||||
|
|
||||||
//For UAE
|
//For UAE
|
||||||
/* versionCode 29
|
/* versionCode 29
|
||||||
versionName "4.1"*/
|
versionName "4.1"*/
|
||||||
|
|
||||||
//For Turkey
|
//For Turkey
|
||||||
versionCode 27
|
/* versionCode 27
|
||||||
versionName "3.9"
|
versionName "3.9"
|
||||||
|
*/
|
||||||
//For KSA
|
//For KSA
|
||||||
/* versionCode 28
|
/* versionCode 28
|
||||||
versionName "4.0"*/
|
versionName "4.0"*/
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
|
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.NewStockDataActivity"
|
android:name=".dailyentry.NewStockDataActivity"
|
||||||
@@ -351,6 +350,10 @@
|
|||||||
android:name=".dailyentry.CoachingVisitActivity"
|
android:name=".dailyentry.CoachingVisitActivity"
|
||||||
android:label="@string/title_activity_coaching_visit"
|
android:label="@string/title_activity_coaching_visit"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" /> <activity
|
||||||
|
android:name=".dailyentry.CoachingVisitStoreActivity"
|
||||||
|
android:label="@string/title_activity_coaching_visit_store"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.DeliveryCallActivity"
|
android:name=".dailyentry.DeliveryCallActivity"
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_PHARMA_IMAGE_DATA);//--Added 20.05.2019
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_PHARMA_IMAGE_DATA);//--Added 20.05.2019
|
||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_COMPETIOTIONN_PROMO);//--Added 17.12.2019
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_COMPETIOTIONN_PROMO);//--Added 17.12.2019
|
||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_COMPETIOTIONN_PROMO_EXISTS);//--Added 17.12.2019
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_COMPETIOTIONN_PROMO_EXISTS);//--Added 17.12.2019
|
||||||
|
db.execSQL(CommonString.CREATE_TABLE_COACHING_VISIT_STORE);//--Added 28.06.2021
|
||||||
|
|
||||||
db.execSQL(TableBean.getAdhocJourneyplanAdditional());//--Added 7.10.2019
|
db.execSQL(TableBean.getAdhocJourneyplanAdditional());//--Added 7.10.2019
|
||||||
|
|
||||||
@@ -295,6 +296,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.delete(CommonString.TABLE_AUDIT_DATA_SAVE, "STORE_CD" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_AUDIT_DATA_SAVE, "STORE_CD" + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_POG_DATA_SAVE, "STORE_CD" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_POG_DATA_SAVE, "STORE_CD" + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_COACHING_VISIT, "STORE_ID" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_COACHING_VISIT, "STORE_ID" + "='" + storeid + "'", null);
|
||||||
|
db.delete(CommonString.TABLE_COACHING_VISIT_STORE, "STORE_ID" + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS, "STORE_ID" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS, "STORE_ID" + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT, "STORE_ID" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT, "STORE_ID" + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_INSERT_STOCK, "Store_Id" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_STOCK, "Store_Id" + "='" + storeid + "'", null);
|
||||||
@@ -349,6 +351,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO, null, null);
|
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO, null, null);
|
||||||
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO_EXISTS, null, null);
|
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO_EXISTS, null, null);
|
||||||
|
|
||||||
|
db.delete(CommonString.TABLE_COACHING_VISIT_STORE, null, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||||
@@ -7017,6 +7021,31 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void insertCoachingVisitStoreData(CoachingVisitGetterSetter data, String store_id) {
|
||||||
|
db.delete("COACHING_VISIT_STORE", "STORE_ID" + "='" + store_id + "' AND EMP_ID ='" + data.getEmp_id() + "'", null);
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
try {
|
||||||
|
values.put(CommonString.KEY_EMP_ID, Integer.parseInt(data.getEmp_id()));
|
||||||
|
values.put(CommonString.KEY_STORE_ID, store_id);
|
||||||
|
values.put(CommonString.KEY_IMAGE, data.getImg_path());
|
||||||
|
|
||||||
|
int exist;
|
||||||
|
if (data.isExists()) {
|
||||||
|
exist = 1;
|
||||||
|
} else {
|
||||||
|
exist = 0;
|
||||||
|
}
|
||||||
|
values.put(CommonString.KEY_EXIST, exist);
|
||||||
|
|
||||||
|
db.insert("COACHING_VISIT_STORE", null, values);
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Database Exception ", ex.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// get coaching visit data
|
// get coaching visit data
|
||||||
public ArrayList<CoachingVisitGetterSetter> getCoachingVisitData(String store_id) {
|
public ArrayList<CoachingVisitGetterSetter> getCoachingVisitData(String store_id) {
|
||||||
|
|
||||||
@@ -7052,6 +7081,38 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
return coachingVisitList;
|
return coachingVisitList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<CoachingVisitGetterSetter> getCoachingVisitStoreData(String store_id) {
|
||||||
|
|
||||||
|
ArrayList<CoachingVisitGetterSetter> coachingVisitList = new ArrayList<>();
|
||||||
|
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
try {
|
||||||
|
dbcursor = db.rawQuery("SELECT * FROM COACHING_VISIT_STORE where STORE_ID" + "='" + store_id + "'", null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
|
||||||
|
CoachingVisitGetterSetter sb = new CoachingVisitGetterSetter();
|
||||||
|
sb.setEmp_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_EMP_ID)));
|
||||||
|
sb.setImg_path(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE)));
|
||||||
|
sb.setExists(dbcursor.getInt(dbcursor.getColumnIndexOrThrow(CommonString.KEY_EXIST)) == 1);
|
||||||
|
|
||||||
|
coachingVisitList.add(sb);
|
||||||
|
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return coachingVisitList;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
return coachingVisitList;
|
||||||
|
}
|
||||||
|
return coachingVisitList;
|
||||||
|
}
|
||||||
|
|
||||||
//CONFIGURATION_MASTER
|
//CONFIGURATION_MASTER
|
||||||
public void InsertCONFIGURATION_MASTER(ConfigurationMasterGetterSetter data) {
|
public void InsertCONFIGURATION_MASTER(ConfigurationMasterGetterSetter data) {
|
||||||
db.delete("CONFIGURATION_MASTER", null, null);
|
db.delete("CONFIGURATION_MASTER", null, null);
|
||||||
|
|||||||
@@ -182,8 +182,8 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
//populateAutoComplete();
|
//populateAutoComplete();
|
||||||
mPasswordView = (EditText) findViewById(R.id.password);
|
mPasswordView = (EditText) findViewById(R.id.password);
|
||||||
|
|
||||||
/* museridView.setText("test.egypt");
|
museridView.setText("test.egypt");
|
||||||
mPasswordView.setText("cpm123");*/
|
mPasswordView.setText("cpm123");
|
||||||
/* museridView.setText("egypt.1");
|
/* museridView.setText("egypt.1");
|
||||||
mPasswordView.setText("cpm123");*/
|
mPasswordView.setText("cpm123");*/
|
||||||
/* museridView.setText("DSR_Alex_61");
|
/* museridView.setText("DSR_Alex_61");
|
||||||
|
|||||||
@@ -1352,4 +1352,14 @@ public class CommonString {
|
|||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
|
public static final String TABLE_COACHING_VISIT_STORE = "COACHING_VISIT_STORE";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_COACHING_VISIT_STORE = "CREATE TABLE IF NOT EXISTS " + TABLE_COACHING_VISIT_STORE
|
||||||
|
+ " ("
|
||||||
|
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
+ KEY_STORE_ID + " INTEGER,USER_ID VARCHAR, "
|
||||||
|
+ KEY_EMP_ID + " VARCHAR,"
|
||||||
|
+ KEY_IMAGE + " VARCHAR,"
|
||||||
|
+ KEY_EXIST + " INTEGER)";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,7 +334,8 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
if (saved_flag || update_flag) {
|
if (saved_flag || update_flag) {
|
||||||
|
|
||||||
Intent i = new Intent(CoachingVisitActivity.this, StoreCheckoutImageActivity.class);
|
//Intent i = new Intent(CoachingVisitActivity.this, StoreCheckoutImageActivity.class);
|
||||||
|
Intent i = new Intent(CoachingVisitActivity.this, CoachingVisitStoreActivity.class);
|
||||||
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
|
|||||||
+463
@@ -0,0 +1,463 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.androidbuts.multispinnerfilter.KeyPairBoolData;
|
||||||
|
import com.androidbuts.multispinnerfilter.MultiSpinnerSearch;
|
||||||
|
import com.androidbuts.multispinnerfilter.SpinnerListener;
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CoachingVisitGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||||
|
|
||||||
|
public class CoachingVisitStoreActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
private GSKOrangeDB database;
|
||||||
|
ArrayList<SupervisorListGetterSetter> supervisorList;
|
||||||
|
private Spinner exist_spinner; //supervisor_spinner;
|
||||||
|
private ArrayAdapter<CharSequence> exist_adapter, supervisor_adapter;
|
||||||
|
int coaching_visit;
|
||||||
|
LinearLayout linear_supervisor;
|
||||||
|
ImageView img_cam;
|
||||||
|
FloatingActionButton fab_next, fab_save;
|
||||||
|
String emp_id;
|
||||||
|
protected String _pathforcheck = "", _path, image_name = "", str, country_id, store_flag_str;
|
||||||
|
String visit_date, store_id, username;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
String gallery_package = "";
|
||||||
|
Uri outputFileUri;
|
||||||
|
boolean saved_flag = false, update_flag = false;
|
||||||
|
ArrayList<CoachingVisitGetterSetter> coachingVisitdata;
|
||||||
|
boolean coaching_visit_camera_flag = false;
|
||||||
|
MultiSpinnerSearch multi_spinner_supervisor;
|
||||||
|
|
||||||
|
ArrayList<String> selectedSupervisorList = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_coaching_visit_store);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
linear_supervisor = (LinearLayout) findViewById(R.id.linear_supervisor);
|
||||||
|
exist_spinner = (Spinner) findViewById(R.id.spinner_coaching_visit);
|
||||||
|
//supervisor_spinner = (Spinner) findViewById(R.id.spinner_supervisor);
|
||||||
|
img_cam = (ImageView) findViewById(R.id.img_cam);
|
||||||
|
|
||||||
|
multi_spinner_supervisor = (MultiSpinnerSearch) findViewById(R.id.multi_spinner_supervisor);
|
||||||
|
context = this;
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.title_activity_coaching_visit_store));
|
||||||
|
|
||||||
|
str = CommonString.FILE_PATH;
|
||||||
|
|
||||||
|
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
|
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
//store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
|
|
||||||
|
fab_next = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab_save = (FloatingActionButton) findViewById(R.id.fab_save);
|
||||||
|
|
||||||
|
database = new GSKOrangeDB(this);
|
||||||
|
database.open();
|
||||||
|
|
||||||
|
coachingVisitdata = database.getCoachingVisitStoreData(store_id);
|
||||||
|
|
||||||
|
//Enable disable According to Configuration
|
||||||
|
ArrayList<ConfigurationMasterGetterSetter> configurationData = database.getConfigurationMasterData(country_id);
|
||||||
|
if (configurationData.size() > 0) {
|
||||||
|
|
||||||
|
for (int i = 0; i < configurationData.size(); i++) {
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT IMAGE") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
coaching_visit_camera_flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (coaching_visit_camera_flag) {
|
||||||
|
img_cam.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
img_cam.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
supervisorList = database.getSupervisorListData();
|
||||||
|
|
||||||
|
exist_adapter = new ArrayAdapter<>(this,
|
||||||
|
android.R.layout.simple_spinner_item);
|
||||||
|
|
||||||
|
String select_str = getResources().getString(R.string.select);
|
||||||
|
|
||||||
|
exist_adapter.add(select_str);
|
||||||
|
exist_adapter.add(getResources().getString(R.string.yes));
|
||||||
|
exist_adapter.add(getResources().getString(R.string.no));
|
||||||
|
|
||||||
|
exist_spinner.setAdapter(exist_adapter);
|
||||||
|
|
||||||
|
exist_adapter
|
||||||
|
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
|
exist_spinner.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
|
if (coachingVisitdata.size() != 0) {
|
||||||
|
update_flag = true;
|
||||||
|
fab_save.hide();//setVisibility(View.GONE);
|
||||||
|
fab_next.show();//setVisibility(View.VISIBLE);
|
||||||
|
if (coachingVisitdata.get(0).isExists()) {
|
||||||
|
exist_spinner.setSelection(1);
|
||||||
|
} else {
|
||||||
|
exist_spinner.setSelection(2);
|
||||||
|
}
|
||||||
|
exist_spinner.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
fab_next.setOnClickListener(this);
|
||||||
|
fab_save.setOnClickListener(this);
|
||||||
|
img_cam.setOnClickListener(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
switch (parent.getId()) {
|
||||||
|
case R.id.spinner_coaching_visit:
|
||||||
|
if (position != 0) {
|
||||||
|
|
||||||
|
if (!update_flag) {
|
||||||
|
|
||||||
|
fab_save.show();//setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
if (position == 1) {
|
||||||
|
|
||||||
|
linear_supervisor.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
coaching_visit = 1;
|
||||||
|
|
||||||
|
/*supervisor_adapter = new ArrayAdapter<CharSequence>(this,
|
||||||
|
android.R.layout.simple_spinner_item);
|
||||||
|
|
||||||
|
String select_str = getResources().getString(R.string.select_promo);
|
||||||
|
|
||||||
|
supervisor_adapter.add(select_str);
|
||||||
|
|
||||||
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
|
supervisor_adapter.add(supervisorList.get(i).getSUPERVISOR().get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
supervisor_spinner.setAdapter(supervisor_adapter);
|
||||||
|
|
||||||
|
supervisor_adapter
|
||||||
|
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
|
supervisor_spinner.setOnItemSelectedListener(this);*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getting array of String to Bind in Spinner
|
||||||
|
*/
|
||||||
|
//final List<String> list = Arrays.asList(getResources().getStringArray(R.array.sports_array));
|
||||||
|
|
||||||
|
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
|
KeyPairBoolData h = new KeyPairBoolData();
|
||||||
|
h.setId(i + 1);
|
||||||
|
h.setName(supervisorList.get(i).getSUPERVISOR().get(0));
|
||||||
|
h.setSelected(false);
|
||||||
|
listArray0.add(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemsSelected(List<KeyPairBoolData> items) {
|
||||||
|
|
||||||
|
selectedSupervisorList.clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < items.size(); i++) {
|
||||||
|
if (items.get(i).isSelected()) {
|
||||||
|
|
||||||
|
selectedSupervisorList.add(items.get(i).getName());
|
||||||
|
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
coaching_visit = 0;
|
||||||
|
selectedSupervisorList.clear();
|
||||||
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
coaching_visit = -1;
|
||||||
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
|
fab_save.hide();//setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.multi_spinner_supervisor:
|
||||||
|
|
||||||
|
/* if(position!=0){
|
||||||
|
emp_id = supervisorList.get(position-1).getEMP_ID().get(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
emp_id = "";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.img_cam:
|
||||||
|
_pathforcheck = store_id + "CheckVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
|
|
||||||
|
startCameraActivity();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.fab_save:
|
||||||
|
|
||||||
|
if (coaching_visit == 1) {
|
||||||
|
|
||||||
|
String error_msg = "";
|
||||||
|
boolean flag = true;
|
||||||
|
//if(emp_id.equals("")){
|
||||||
|
if (selectedSupervisorList.size() == 0) {
|
||||||
|
flag = false;
|
||||||
|
error_msg = getString(R.string.title_activity_select_dropdown);
|
||||||
|
} else if (coaching_visit_camera_flag && image_name.equals("")) {
|
||||||
|
flag = false;
|
||||||
|
error_msg = getString(R.string.clickimage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
|
||||||
|
for (int i = 0; i < selectedSupervisorList.size(); i++) {
|
||||||
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
|
coachingVisitGetterSetter.setEmp_id(getEmp_idFromName(selectedSupervisorList.get(i)));
|
||||||
|
coachingVisitGetterSetter.setImg_path(image_name);
|
||||||
|
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||||
|
|
||||||
|
database.insertCoachingVisitStoreData(coachingVisitGetterSetter, store_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
saved_flag = true;
|
||||||
|
|
||||||
|
fab_next.show();//setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
|
coachingVisitGetterSetter.setEmp_id("0");
|
||||||
|
coachingVisitGetterSetter.setImg_path(image_name);
|
||||||
|
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||||
|
|
||||||
|
database.insertCoachingVisitStoreData(coachingVisitGetterSetter, store_id);
|
||||||
|
|
||||||
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
saved_flag = true;
|
||||||
|
fab_next.show();//setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.fab:
|
||||||
|
|
||||||
|
if (saved_flag || update_flag) {
|
||||||
|
|
||||||
|
Intent i = new Intent(CoachingVisitStoreActivity.this, StoreCheckoutImageActivity.class);
|
||||||
|
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||||
|
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
startActivity(i);
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else {
|
||||||
|
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String getEmp_idFromName(String name) {
|
||||||
|
String emp_id = "0";
|
||||||
|
|
||||||
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
|
if (supervisorList.get(i).getSUPERVISOR().get(0).equalsIgnoreCase(name)) {
|
||||||
|
emp_id = supervisorList.get(i).getEMP_ID().get(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return emp_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void startCameraActivity() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
Log.i("MakeMachine", "startCameraActivity()");
|
||||||
|
File file = new File(_path);
|
||||||
|
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||||
|
|
||||||
|
String defaultCameraPackage = "";
|
||||||
|
final PackageManager packageManager = getPackageManager();
|
||||||
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
|
for (int n = 0; n < list.size(); n++) {
|
||||||
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
|
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
|
Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||||
|
|
||||||
|
//temp value in case camera is gallery app above jellybean
|
||||||
|
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||||
|
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||||
|
gallery_package = list.get(n).packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//com.android.gallery3d
|
||||||
|
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(defaultCameraPackage);
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(gallery_package);
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||||
|
// Crashlytics.logException(e.getCause());
|
||||||
|
//Crashlytics.logException(new Exception(e.getCause()));
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("MissingSuperCall")
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
Log.i("MakeMachine", "resultCode: " + resultCode);
|
||||||
|
switch (resultCode) {
|
||||||
|
case 0:
|
||||||
|
Log.i("MakeMachine", "User cancelled");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case -1:
|
||||||
|
|
||||||
|
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||||
|
if (new File(str + _pathforcheck).exists()) {
|
||||||
|
|
||||||
|
img_cam.setImageDrawable(getResources().getDrawable(R.mipmap.camera_green));
|
||||||
|
|
||||||
|
image_name = _pathforcheck;
|
||||||
|
|
||||||
|
_pathforcheck = "";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1008,10 +1008,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
boolean coaching_visit_flag=false;
|
boolean coaching_visit_flag=false;
|
||||||
|
|
||||||
//Coaching visit will be not visible from Additional Stores - Egypt
|
|
||||||
//if(!store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
|
||||||
|
|
||||||
//Enable disable According to Configuration
|
//Enable disable According to Configuration
|
||||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||||
if(configurationData.size()>0){
|
if(configurationData.size()>0){
|
||||||
@@ -1129,7 +1125,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
// find which radio button is selected
|
// find which radio button is selected
|
||||||
if (checkedId == R.id.yes) {
|
if (checkedId == R.id.yes) {
|
||||||
|
|
||||||
if (!GeotagStatus.equalsIgnoreCase("Y")) {
|
if (GeotagStatus.equalsIgnoreCase("Y")) {
|
||||||
|
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
if (coverage.size() > 0) {
|
if (coverage.size() > 0) {
|
||||||
|
|||||||
-3
@@ -31,10 +31,7 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.CoachingVisitActivity;
|
|
||||||
import cpm.com.gskmtorange.dailyentry.MessageActivity;
|
import cpm.com.gskmtorange.dailyentry.MessageActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
||||||
|
|
||||||
public class StoreWisePerformanceActivity extends AppCompatActivity {
|
public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||||
|
|||||||
@@ -1401,6 +1401,55 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Coaching check visit data
|
||||||
|
db.open();
|
||||||
|
coachingVisitData = db.getCoachingVisitStoreData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (coachingVisitData.size() > 0) {
|
||||||
|
|
||||||
|
String onXml_coaching_data = "", coaching_xml = "";
|
||||||
|
for (int j = 0; j < coachingVisitData.size(); j++) {
|
||||||
|
|
||||||
|
String exist;
|
||||||
|
|
||||||
|
if (coachingVisitData.get(j).isExists()) {
|
||||||
|
exist = "1";
|
||||||
|
} else {
|
||||||
|
exist = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
coaching_xml = "[CHECK_VISIT_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||||
|
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||||
|
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||||
|
+ "[/CHECK_VISIT_DATA]";
|
||||||
|
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "CHECK_VISIT_DATA");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
data.value = 65;
|
||||||
|
data.name = getString(R.string.coaching_visit);
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
//Counterfeit Product - Country Id - 6 (UAE)
|
//Counterfeit Product - Country Id - 6 (UAE)
|
||||||
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
||||||
|
|
||||||
|
|||||||
@@ -664,6 +664,54 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
data.name = getString(R.string.coaching_visit);
|
data.name = getString(R.string.coaching_visit);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
//Coaching check visit data
|
||||||
|
db.open();
|
||||||
|
coachingVisitData = db.getCoachingVisitStoreData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (coachingVisitData.size() > 0) {
|
||||||
|
|
||||||
|
String onXml_coaching_data = "", coaching_xml = "";
|
||||||
|
for (int j = 0; j < coachingVisitData.size(); j++) {
|
||||||
|
|
||||||
|
String exist;
|
||||||
|
|
||||||
|
if (coachingVisitData.get(j).isExists()) {
|
||||||
|
exist = "1";
|
||||||
|
} else {
|
||||||
|
exist = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
coaching_xml = "[CHECK_VISIT_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||||
|
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||||
|
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||||
|
+ "[/CHECK_VISIT_DATA]";
|
||||||
|
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "CHECK_VISIT_DATA");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
data.value = 65;
|
||||||
|
data.name = getString(R.string.coaching_visit);
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//end usk
|
//end usk
|
||||||
@@ -1639,6 +1687,55 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Coaching check visit data
|
||||||
|
db.open();
|
||||||
|
coachingVisitData = db.getCoachingVisitStoreData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (coachingVisitData.size() > 0) {
|
||||||
|
|
||||||
|
String onXml_coaching_data = "", coaching_xml = "";
|
||||||
|
for (int j = 0; j < coachingVisitData.size(); j++) {
|
||||||
|
|
||||||
|
String exist;
|
||||||
|
|
||||||
|
if (coachingVisitData.get(j).isExists()) {
|
||||||
|
exist = "1";
|
||||||
|
} else {
|
||||||
|
exist = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
coaching_xml = "[CHECK_VISIT_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||||
|
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||||
|
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||||
|
+ "[/CHECK_VISIT_DATA]";
|
||||||
|
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "CHECK_VISIT_DATA");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
data.value = 65;
|
||||||
|
data.name = getString(R.string.coaching_visit);
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
//Counterfeit Product - Country Id - 6 (UAE)
|
//Counterfeit Product - Country Id - 6 (UAE)
|
||||||
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class UploadImageWithRetrofit {
|
|||||||
foldername = "CategoryImages";
|
foldername = "CategoryImages";
|
||||||
} else if (file[i].getName().contains("AuditAnsPic")) {
|
} else if (file[i].getName().contains("AuditAnsPic")) {
|
||||||
foldername = "AuditImages";
|
foldername = "AuditImages";
|
||||||
} else if (file[i].getName().contains("CoachingVisit")) {
|
} else if (file[i].getName().contains("CoachingVisit")||file[i].getName().contains("CheckVisit")) {
|
||||||
foldername = "CoachingVisits";
|
foldername = "CoachingVisits";
|
||||||
} else if (file[i].getName().contains("DeliveryCalls")) {
|
} else if (file[i].getName().contains("DeliveryCalls")) {
|
||||||
foldername = "DeliveryCallsImages";
|
foldername = "DeliveryCallsImages";
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context=".dailyentry.CoachingVisitStoreActivity">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/content_coaching_visit_store" />
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@drawable/right_arrow"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fab_save"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|left"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@drawable/save_icon" />
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context=".dailyentry.CoachingVisitStoreActivity"
|
||||||
|
tools:showIn="@layout/activity_coaching_visit_store"
|
||||||
|
android:background="@color/grey_background"
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:elevation="10dp"
|
||||||
|
app:cardCornerRadius="5dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginBottom="10dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/coaching_visit"
|
||||||
|
android:textSize="@dimen/text_size_normal"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:layout_marginRight="10dp"/>
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spinner_coaching_visit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"></Spinner>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_supervisor"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<!-- <Spinner
|
||||||
|
android:id="@+id/spinner_supervisor"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="20dp"
|
||||||
|
android:layout_marginTop="10dp"/>-->
|
||||||
|
|
||||||
|
<com.androidbuts.multispinnerfilter.MultiSpinnerSearch
|
||||||
|
android:id="@+id/multi_spinner_supervisor"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="20dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:hintText="@string/select_coach" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_cam"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@mipmap/camera_orange"
|
||||||
|
android:layout_centerInParent="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -333,6 +333,7 @@
|
|||||||
<string name="distance_from_the_store">Distance from Store</string>
|
<string name="distance_from_the_store">Distance from Store</string>
|
||||||
<string name="meters">meters</string>
|
<string name="meters">meters</string>
|
||||||
<string name="title_activity_coaching_visit">Coaching Visit</string>
|
<string name="title_activity_coaching_visit">Coaching Visit</string>
|
||||||
|
<string name="title_activity_coaching_visit_store">Check Visit</string>
|
||||||
<string name="select_supervisor">Select Supervisor</string>
|
<string name="select_supervisor">Select Supervisor</string>
|
||||||
<string name="coaching_visit">Coaching Visit</string>
|
<string name="coaching_visit">Coaching Visit</string>
|
||||||
<string name="please_save_data">Please save data</string>
|
<string name="please_save_data">Please save data</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user