YSY commit
This commit is contained in:
@@ -21,12 +21,12 @@ android {
|
||||
targetSdkVersion 26
|
||||
|
||||
//For Egypt
|
||||
/*versionCode 22
|
||||
versionName "3.4"*/
|
||||
versionCode 23
|
||||
versionName "3.5"
|
||||
|
||||
//For UAE
|
||||
versionCode 19
|
||||
versionName "3.1"
|
||||
/*versionCode 19
|
||||
versionName "3.1"*/
|
||||
|
||||
//For Turkey
|
||||
/*versionCode 21
|
||||
|
||||
@@ -24,10 +24,18 @@
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name=".dailyentry.CounterfeitProductsActivity"
|
||||
android:label="@string/title_activity_counterfeit_products"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan"></activity>
|
||||
<activity
|
||||
android:name=".password.MPinActivity"
|
||||
android:label="@string/title_activity_mpin"
|
||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".password.ChangePasswordActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
|
||||
@@ -36,6 +36,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ChatMessageDownloadGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DeliveryCallsGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
@@ -86,7 +87,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
*/
|
||||
|
||||
public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE_DB48";
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE_DB49";
|
||||
public static final int DATABASE_VERSION = 15;
|
||||
TableBean tableBean;
|
||||
private SQLiteDatabase db;
|
||||
@@ -206,6 +207,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_PROMO_SKUWISE);//--Added 10.12.2018
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_PROMO_SKUWISE_EXISTS);//--Added 11.12.2018
|
||||
db.execSQL(CommonString.CREATE_ABLE_IS_ADHOC_SAVED);//--Added 20.02.2019
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS);//--Added 12.03.2019
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_COUNTERFEIT_PRODUCT);//--Added 12.03.2019
|
||||
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -263,6 +266,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
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_COACHING_VISIT, "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);
|
||||
|
||||
}
|
||||
|
||||
@@ -301,6 +306,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.delete(CommonString.TABLE_AUDIT_DATA_SAVE, null, null);
|
||||
db.delete(CommonString.TABLE_POG_DATA_SAVE, null, null);
|
||||
db.delete(CommonString.TABLE_COACHING_VISIT, null, null);
|
||||
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS, null, null);
|
||||
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT, null, null);
|
||||
}
|
||||
|
||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||
@@ -7381,4 +7388,174 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
//insert Counterfeit Product
|
||||
public void InsertCounterfeitProductData(ArrayList<CounterfeitProductGetterSetter> counterfeitProductListData, String category_id, String store_id, boolean exists) {
|
||||
|
||||
try {
|
||||
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT, "STORE_ID = '"+ store_id +"' AND CATEGORY_ID ='"+ category_id +"'", null);
|
||||
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS, "STORE_ID = '"+ store_id +"' AND CATEGORY_ID ='"+ category_id +"'", null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
ContentValues values1 = new ContentValues();
|
||||
int existexist_int = 0;
|
||||
|
||||
if(exists){
|
||||
existexist_int = 1;
|
||||
}
|
||||
|
||||
values1.put("STORE_ID", Integer.parseInt(store_id));
|
||||
values1.put("CATEGORY_ID", Integer.parseInt(category_id));
|
||||
values1.put("Existss", existexist_int);
|
||||
|
||||
long id = db.insert(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS, null, values1);
|
||||
|
||||
|
||||
db.beginTransaction();
|
||||
for (int i = 0; i < counterfeitProductListData.size(); i++) {
|
||||
CounterfeitProductGetterSetter data = counterfeitProductListData.get(i);
|
||||
|
||||
values.put("STORE_ID", Integer.parseInt(store_id));
|
||||
values.put("CATEGORY_ID", Integer.parseInt(category_id));
|
||||
values.put("BRAND_ID", data.getBrandId());
|
||||
values.put("BRAND", data.getBrand());
|
||||
values.put("SKU", data.getSkuName());
|
||||
values.put("STOCK", data.getStock());
|
||||
values.put("IMAGE", data.getImgStr());
|
||||
values.put("IMAGE1", data.getImgStr1());
|
||||
values.put("IMAGE2", data.getImgStr2());
|
||||
values.put("COMMON_ID", id);
|
||||
|
||||
db.insert(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT, null, values);
|
||||
}
|
||||
db.setTransactionSuccessful();
|
||||
db.endTransaction();
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", "Counterfeit Data " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
//get Counterfeit Product inserted data
|
||||
public ArrayList<CounterfeitProductGetterSetter> getCounterfeitProductExistsAfterData(String store_id, String category_id) {
|
||||
ArrayList<CounterfeitProductGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
if(category_id==null){
|
||||
dbcursor = db.rawQuery("Select * from COUNTERFEIT_PRODUCT_EXISTS " +
|
||||
"where STORE_ID='" + store_id + "'", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("Select * from COUNTERFEIT_PRODUCT_EXISTS " +
|
||||
"where STORE_ID='" + store_id + "' AND CATEGORY_ID='" + category_id + "'", null);
|
||||
}
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
CounterfeitProductGetterSetter cd = new CounterfeitProductGetterSetter();
|
||||
|
||||
cd.setExists(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Existss")).equals("1"));
|
||||
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY_ID")));
|
||||
cd.set_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("KEY_ID")));
|
||||
|
||||
list.add(cd);
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
dbcursor.close();
|
||||
return list;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "getCounterfeitAfterData!" + e.toString());
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public ArrayList<CounterfeitProductGetterSetter> getCounterfeitProductAfterData(String store_id, String category_id) {
|
||||
ArrayList<CounterfeitProductGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
if(category_id==null){
|
||||
//common_id is passed in variable store_id in this case
|
||||
dbcursor = db.rawQuery("Select * from COUNTERFEIT_PRODUCT " +
|
||||
"where COMMON_ID='" + store_id + "'", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("Select * from COUNTERFEIT_PRODUCT " +
|
||||
"where STORE_ID='" + store_id + "' AND CATEGORY_ID='" + category_id + "'", null);
|
||||
}
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
CounterfeitProductGetterSetter cd = new CounterfeitProductGetterSetter();
|
||||
|
||||
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY_ID")));
|
||||
cd.setSkuName(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
|
||||
cd.setBrandId(dbcursor.getInt(dbcursor.getColumnIndexOrThrow("BRAND_ID")));
|
||||
cd.setBrand(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND")));
|
||||
cd.setStock(dbcursor.getInt(dbcursor.getColumnIndexOrThrow("STOCK")));
|
||||
cd.setImgStr(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE")));
|
||||
cd.setImgStr1(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE1")));
|
||||
cd.setImgStr2(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE2")));
|
||||
|
||||
list.add(cd);
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
dbcursor.close();
|
||||
return list;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "getPromoComplianceSkuwiseAfterData!" + e.toString());
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public ArrayList<BrandMasterGetterSetter> getBrandData(String category_id) {
|
||||
Cursor cursordata = null;
|
||||
ArrayList<BrandMasterGetterSetter> Data = new ArrayList<BrandMasterGetterSetter>();
|
||||
|
||||
try {
|
||||
|
||||
cursordata = db.rawQuery("SELECT DISTINCT BR.BRAND_ID, BR.BRAND FROM BRAND_MASTER BR " +
|
||||
"INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID " +
|
||||
"INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID =CA.CATEGORY_ID WHERE COMPANY_ID =1 AND SB.CATEGORY_ID ='" + category_id + "'", null);
|
||||
|
||||
if (cursordata != null) {
|
||||
cursordata.moveToFirst();
|
||||
while (!cursordata.isAfterLast()) {
|
||||
BrandMasterGetterSetter sb = new BrandMasterGetterSetter();
|
||||
|
||||
sb.setBRAND_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_ID")));
|
||||
|
||||
sb.setBRAND(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND")));
|
||||
|
||||
|
||||
/*sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||
|
||||
sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||
|
||||
sb.setCOMPANY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("COMPANY_ID")));
|
||||
|
||||
sb.setBRAND_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_SEQUENCE")));*/
|
||||
|
||||
Data.add(sb);
|
||||
cursordata.moveToNext();
|
||||
}
|
||||
cursordata.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
return Data;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1081,4 +1081,63 @@ public class CommonString {
|
||||
public static String TABLE_MAPPING_PROMOTION = "MAPPING_PROMOTION";
|
||||
public static String TABLE_MAPPING_ADDITIONAL_PROMOTION = "MAPPING_ADDITIONAL_PROMOTION";
|
||||
public static String TABLE_MAPPING_SOS_TARGET = "MAPPING_SOS_TARGET";
|
||||
|
||||
public static final String TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS = "COUNTERFEIT_PRODUCT_EXISTS";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_COUNTERFEIT_PRODUCT_EXISTS
|
||||
+ "("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ "STORE_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "CATEGORY_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "Existss"
|
||||
+ " INTEGER"
|
||||
|
||||
+ ")";
|
||||
|
||||
public static final String TABLE_INSERT_COUNTERFEIT_PRODUCT = "COUNTERFEIT_PRODUCT";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_COUNTERFEIT_PRODUCT = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_COUNTERFEIT_PRODUCT
|
||||
+ "("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ "STORE_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "CATEGORY_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "COMMON_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "SKU"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "BRAND_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "BRAND"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "STOCK"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "IMAGE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "IMAGE1"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "IMAGE2"
|
||||
+ " VARCHAR"
|
||||
|
||||
+ ")";
|
||||
}
|
||||
|
||||
+601
@@ -0,0 +1,601 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
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.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||
|
||||
public class CounterfeitProductsActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||
|
||||
ToggleButton btntoggle;
|
||||
boolean isDataAdded = false, isExists = true, is_camera_compulsory = false;
|
||||
LinearLayout lin_parent;
|
||||
GSKOrangeDB db;
|
||||
private SharedPreferences preferences;
|
||||
Spinner spinner_brand_list;
|
||||
String store_id, visit_date, username, country_id;
|
||||
String categoryName, categoryId;
|
||||
ArrayList<BrandMasterGetterSetter> brand_list = new ArrayList<>();
|
||||
String brand = "", _path = "";
|
||||
EditText et_stock, et_sku_name;
|
||||
FloatingActionButton fab_save, fab_add;
|
||||
ImageView imgCam, imgCam1, imgCam2;
|
||||
String img_str = "", img_str1 = "", img_str2 = "";
|
||||
String _pathforcheck, _pathforcheck1, _pathforcheck2;
|
||||
Uri outputFileUri;
|
||||
String gallery_package = "";
|
||||
boolean editFlag = false, isdata_added = false;
|
||||
String str, skuName, stock = "";
|
||||
int brand_id = 0;
|
||||
RecyclerView rec_added_counterfeit_product;
|
||||
ArrayList<CounterfeitProductGetterSetter> addedCounterfeitProducts = new ArrayList<>();
|
||||
ArrayList<CounterfeitProductGetterSetter> exists_data = new ArrayList<>();
|
||||
|
||||
ProductAdapter productAdapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_counterfeit_products);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
||||
lin_parent = (LinearLayout) findViewById(R.id.lin_parent_promo);
|
||||
et_stock = (EditText) findViewById(R.id.et_stock);
|
||||
et_sku_name = (EditText) findViewById(R.id.et_sku_name);
|
||||
spinner_brand_list = (Spinner) findViewById(R.id.sp_brand);
|
||||
rec_added_counterfeit_product = (RecyclerView) findViewById(R.id.rec_added_counterfeit_product);
|
||||
|
||||
//fab
|
||||
fab_save = findViewById(R.id.fab);
|
||||
fab_add = findViewById(R.id.fab_add);
|
||||
|
||||
//camera Images
|
||||
imgCam = (ImageView) findViewById(R.id.img_cam);
|
||||
imgCam1 = (ImageView) findViewById(R.id.img_cam1);
|
||||
imgCam2 = (ImageView) findViewById(R.id.img_cam2);
|
||||
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
//Intent data
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
|
||||
db = new GSKOrangeDB(CounterfeitProductsActivity.this);
|
||||
db.open();
|
||||
|
||||
btntoggle.setOnClickListener(this);
|
||||
fab_save.setOnClickListener(this);
|
||||
fab_add.setOnClickListener(this);
|
||||
imgCam.setOnClickListener(this);
|
||||
imgCam1.setOnClickListener(this);
|
||||
imgCam2.setOnClickListener(this);
|
||||
|
||||
brand_list = db.getBrandMasterData(store_id, categoryId);
|
||||
//brand_list = db.getBrandData(categoryId);
|
||||
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
String select = getResources().getString(R.string.select);
|
||||
brand_select.setBRAND(select);
|
||||
brand_select.setBRAND_ID("0");
|
||||
brand_list.add(0, brand_select);
|
||||
CustomBrandAdapter adapter = new CustomBrandAdapter(CounterfeitProductsActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
|
||||
//Product List
|
||||
exists_data = db.getCounterfeitProductExistsAfterData(store_id, categoryId);
|
||||
|
||||
if(exists_data.size()>0){
|
||||
isExists = exists_data.get(0).isExists();
|
||||
if(exists_data.get(0).isExists()){
|
||||
addedCounterfeitProducts = db.getCounterfeitProductAfterData(store_id, categoryId);
|
||||
if(addedCounterfeitProducts.size()>0){
|
||||
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
||||
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//fab_add.hide();//.setVisibility(View.GONE);
|
||||
addedCounterfeitProducts.clear();
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
btntoggle.setChecked(isExists);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
switch (id) {
|
||||
case R.id.btntoggle:
|
||||
isExists = btntoggle.isChecked();
|
||||
|
||||
if (isExists) {
|
||||
lin_parent.setVisibility(View.VISIBLE);
|
||||
isdata_added = true;
|
||||
} else {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(CounterfeitProductsActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
|
||||
stock = "";
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
|
||||
et_stock.setText("");
|
||||
et_sku_name.setText("");
|
||||
spinner_brand_list.setSelection(0);
|
||||
|
||||
addedCounterfeitProducts.clear();
|
||||
isdata_added = true;
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//checkBox.setChecked(true);
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.fab_add:
|
||||
|
||||
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
||||
stock = et_stock.getText().toString();
|
||||
|
||||
if (brand.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (stock.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_stock, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (skuName.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_sku, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (img_str.equals("") && img_str1.equals("") && img_str2.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
CounterfeitProductGetterSetter product = new CounterfeitProductGetterSetter();
|
||||
product.setBrand(brand);
|
||||
product.setBrandId(brand_id);
|
||||
product.setStock(Integer.parseInt(stock));
|
||||
product.setSkuName(skuName);
|
||||
product.setImgStr(img_str);
|
||||
product.setImgStr1(img_str1);
|
||||
product.setImgStr2(img_str2);
|
||||
|
||||
addedCounterfeitProducts.add(product);
|
||||
|
||||
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
||||
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
|
||||
stock = "";
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
|
||||
et_stock.setText("");
|
||||
et_sku_name.setText("");
|
||||
spinner_brand_list.setSelection(0);
|
||||
//clearBrandSpinner();
|
||||
|
||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
|
||||
isdata_added = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.fab:
|
||||
if(isExists && addedCounterfeitProducts.size()==0){
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
db.InsertCounterfeitProductData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.img_cam:
|
||||
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
startCameraActivity();
|
||||
break;
|
||||
|
||||
case R.id.img_cam1:
|
||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
||||
startCameraActivity();
|
||||
break;
|
||||
|
||||
case R.id.img_cam2:
|
||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
||||
startCameraActivity();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void clearBrandSpinner() {
|
||||
brand_list.clear();
|
||||
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
String str = getResources().getString(R.string.select);
|
||||
brand_select.setBRAND(str);
|
||||
brand_select.setBRAND_ID("0");
|
||||
brand_list.add(0, brand_select);
|
||||
CustomBrandAdapter adapter = new CustomBrandAdapter(CounterfeitProductsActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
switch (parent.getId()) {
|
||||
case R.id.sp_brand:
|
||||
|
||||
if (position != 0) {
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||
} else {
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
|
||||
public class CustomBrandAdapter extends ArrayAdapter<String> {
|
||||
|
||||
private Activity activity;
|
||||
private ArrayList data;
|
||||
BrandMasterGetterSetter tempValues = null;
|
||||
LayoutInflater inflater;
|
||||
|
||||
/*************
|
||||
* CustomBrandAdapter Constructor
|
||||
*****************/
|
||||
public CustomBrandAdapter(
|
||||
CounterfeitProductsActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
|
||||
/********** Take passed values **********/
|
||||
activity = activitySpinner;
|
||||
data = objects;
|
||||
/*********** Layout inflator to call external xml layout () **********************/
|
||||
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
// This funtion called for each row ( Called data.size() times )
|
||||
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||
|
||||
/***** Get each Model object from Arraylist ********/
|
||||
tempValues = null;
|
||||
tempValues = (BrandMasterGetterSetter) data.get(position);
|
||||
|
||||
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||
|
||||
if (position == 0) {
|
||||
|
||||
// Default selected Spinner item
|
||||
label.setText(getResources().getString(R.string.select));
|
||||
//sub.setText("");
|
||||
} else {
|
||||
// Set values for spinner each row
|
||||
label.setText(tempValues.getBRAND().get(0));
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
protected void startCameraActivity() {
|
||||
try {
|
||||
|
||||
Log.i("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(_path);
|
||||
outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "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 (android.os.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) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@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:
|
||||
|
||||
editFlag = true;
|
||||
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
|
||||
imgCam.setBackgroundResource(R.mipmap.camera_green);
|
||||
|
||||
img_str = _pathforcheck;
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (_pathforcheck1 != null && !_pathforcheck1.equals("")) {
|
||||
if (new File(str + _pathforcheck1).exists()) {
|
||||
|
||||
imgCam1.setBackgroundResource(R.mipmap.camera_green);
|
||||
|
||||
img_str1 = _pathforcheck1;
|
||||
_pathforcheck1 = "";
|
||||
}
|
||||
}
|
||||
if (_pathforcheck2 != null && !_pathforcheck2.equals("")) {
|
||||
if (new File(str + _pathforcheck2).exists()) {
|
||||
|
||||
imgCam2.setBackgroundResource(R.mipmap.camera_green);
|
||||
|
||||
img_str2 = _pathforcheck2;
|
||||
_pathforcheck2 = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
public class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.ViewHolder> {
|
||||
|
||||
private ArrayList<CounterfeitProductGetterSetter> list;
|
||||
|
||||
public ProductAdapter(ArrayList<CounterfeitProductGetterSetter> promoList) {
|
||||
list = promoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_counterfeit_product, parent, false);
|
||||
return new ProductAdapter.ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ProductAdapter.ViewHolder holder, int position) {
|
||||
|
||||
final CounterfeitProductGetterSetter mItem = list.get(position);
|
||||
holder.tv_brand.setText(getString(R.string.brand) + " - " + mItem.getBrand());
|
||||
holder.tv_sku_name.setText(getString(R.string.skuname) + " - " + mItem.getSkuName());
|
||||
holder.tv_stock.setText(" - " + mItem.getStock());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
public final TextView tv_brand, tv_sku_name, tv_stock;
|
||||
|
||||
public ViewHolder(View view) {
|
||||
super(view);
|
||||
|
||||
mView = view;
|
||||
|
||||
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
|
||||
tv_sku_name = (TextView) mView.findViewById(R.id.tv_sku_name);
|
||||
tv_stock = (TextView) mView.findViewById(R.id.tv_stock);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
ischanged();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
void ischanged(){
|
||||
if(isdata_added){
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(CounterfeitProductsActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
else {
|
||||
super.onBackPressed();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
ischanged();
|
||||
}
|
||||
}
|
||||
+22
@@ -217,6 +217,18 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
if (flag){
|
||||
|
||||
//Counterfeit Product Option - Egypt
|
||||
if(country_id.equals("6")){
|
||||
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
flag_filled = flag;
|
||||
}
|
||||
|
||||
@@ -550,6 +562,16 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
//Counterfeit Product Option - Egypt
|
||||
if(country_id.equals("6")){
|
||||
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
flag_filled = true;
|
||||
} else {
|
||||
flag_filled = false;
|
||||
|
||||
+67
-62
@@ -36,6 +36,7 @@ import cpm.com.gskmtorange.dailyentry.AdditionalPromoSKUwiseActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
||||
import cpm.com.gskmtorange.dailyentry.AuditActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.CategoryPicture;
|
||||
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StockDataActivity;
|
||||
@@ -183,11 +184,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
@@ -215,29 +215,25 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
||||
if(country_id.equals("7")){
|
||||
if(db.getPromoComplianceSkuwiseExistsAfterData(store_id, categoryId).size()==0){
|
||||
if (country_id.equals("7")) {
|
||||
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, categoryId).size() == 0) {
|
||||
data.setCategory_img(R.mipmap.promo_compliance);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.promo_compliance_done);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
|
||||
boolean isMappingAdditionalPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId,CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId,CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||
} else {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
}
|
||||
|
||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||
@@ -315,6 +311,20 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data.setCategory_name(getString(R.string.pog));
|
||||
categoryList.add(data);
|
||||
|
||||
//Counterfeit Product Option - Egypt
|
||||
if(country_id.equals("6")){
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, categoryId).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.counterfeit_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.counterfeit);
|
||||
}
|
||||
|
||||
data.setCategory_name(getString(R.string.title_activity_counterfeit_products));
|
||||
categoryList.add(data);
|
||||
}
|
||||
|
||||
|
||||
/*data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_competition_tracking));
|
||||
@@ -367,11 +377,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
@@ -460,24 +469,21 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} else*/
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||
|
||||
if(country_id.equals("7")){
|
||||
if (country_id.equals("7")) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
|
||||
boolean isMappingAdditionalPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId,CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId,CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||
} else {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
}
|
||||
|
||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||
@@ -490,11 +496,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))) {
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
@@ -557,27 +562,24 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
} else */
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||
if(country_id.equals("7")){
|
||||
if (country_id.equals("7")) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalPromoSKUwiseActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
|
||||
boolean isMappingAdditionalPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId,CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId,CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||
} else {
|
||||
isMappingAdditionalPromotion_Flag = db.isMappingAdditionalPromotionData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
}
|
||||
|
||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||
@@ -592,11 +594,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))) {
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
if (flag_t2p_mapping) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, T2PComplianceActivity.class);
|
||||
@@ -667,6 +668,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_counterfeit_products))) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, CounterfeitProductsActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -692,15 +699,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isMappingStockData(){
|
||||
boolean isMappingStockData() {
|
||||
boolean flag;
|
||||
if(country_id.equals("7")){
|
||||
if (country_id.equals("7")) {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||
@@ -99,6 +100,8 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||
|
||||
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -1259,6 +1262,79 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
publishProgress(data);
|
||||
}
|
||||
|
||||
//Counterfeit Product - Country Id - 6 (UAE)
|
||||
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
||||
|
||||
db.open();
|
||||
counterfeitProductExistsGetterSetters = db.getCounterfeitProductExistsAfterData(coverageList.get(i).getStoreId(), null);
|
||||
if (counterfeitProductExistsGetterSetters.size() > 0) {
|
||||
|
||||
for (int l = 0; l < counterfeitProductExistsGetterSetters.size(); l++) {
|
||||
|
||||
counterfeitProductGetterSetters = db.getCounterfeitProductAfterData(counterfeitProductExistsGetterSetters.get(l).get_id(), null);
|
||||
|
||||
for (int i1 = 0; i1 < counterfeitProductGetterSetters.size(); i1++) {
|
||||
if (!counterfeitProductGetterSetters.get(i1).getCategory_id().equals("0")) {
|
||||
|
||||
product_add_xml = "[PRODUCT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[CATEGORY_ID]" + Integer.parseInt(counterfeitProductGetterSetters.get(i1).getCategory_id()) + "[/CATEGORY_ID]"
|
||||
+ "[SKU_NAME]" + counterfeitProductGetterSetters.get(i1).getSkuName() + "[/SKU_NAME]"
|
||||
+ "[BRAND_ID]" + counterfeitProductGetterSetters.get(i1).getBrandId() + "[/BRAND_ID]"
|
||||
+ "[STOCK]" + counterfeitProductGetterSetters.get(i1).getStock() + "[/STOCK]"
|
||||
+ "[IMAGE]" + counterfeitProductGetterSetters.get(i1).getImgStr() + "[/IMAGE]"
|
||||
+ "[IMAGE1]" + counterfeitProductGetterSetters.get(i1).getImgStr1() + "[/IMAGE1]"
|
||||
+ "[IMAGE2]" + counterfeitProductGetterSetters.get(i1).getImgStr2() + "[/IMAGE2]"
|
||||
+ "[/PRODUCT_DATA]";
|
||||
|
||||
add_product_data_xml = add_product_data_xml + product_add_xml;
|
||||
}
|
||||
}
|
||||
|
||||
int exists = 0;
|
||||
if (counterfeitProductExistsGetterSetters.get(l).isExists()) {
|
||||
exists = 1;
|
||||
}
|
||||
|
||||
product_exists_xml = "[COUNTERFEIT_PRODUCT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[CATEGORY_ID]" + Integer.parseInt(counterfeitProductExistsGetterSetters.get(l).getCategory_id()) + "[/CATEGORY_ID]"
|
||||
+ "[IS_EXISTS]" + exists + "[/IS_EXISTS]"
|
||||
+ "[COUNTERFEIT_DATA]" + add_product_data_xml + "[/COUNTERFEIT_DATA]"
|
||||
+ "[/COUNTERFEIT_PRODUCT_DATA]";
|
||||
|
||||
counterfeit_product_data_xml = counterfeit_product_data_xml + product_exists_xml;
|
||||
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + counterfeit_product_data_xml + "[/DATA]";
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "COUNTERFEIT_PRODUCT_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();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
|
||||
data.value = 65;
|
||||
data.name = getString(R.string.title_activity_counterfeit_products);
|
||||
publishProgress(data);
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Images Upload
|
||||
|
||||
@@ -63,6 +63,7 @@ import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
||||
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||
@@ -114,6 +115,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
ArrayList<Store_wise_camera_DataGetterSetter> storeWiseCameraDataGetterSetters;
|
||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
||||
|
||||
RequestBody body1;
|
||||
private Retrofit adapter;
|
||||
@@ -1301,6 +1303,81 @@ public class UploadActivity extends AppCompatActivity {
|
||||
publishProgress(data);
|
||||
}
|
||||
|
||||
//Counterfeit Product - Country Id - 6 (UAE)
|
||||
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
||||
|
||||
db.open();
|
||||
counterfeitProductExistsGetterSetters = db.getCounterfeitProductExistsAfterData(coverageList.get(i).getStoreId(), null);
|
||||
if (counterfeitProductExistsGetterSetters.size() > 0) {
|
||||
|
||||
for (int l = 0; l < counterfeitProductExistsGetterSetters.size(); l++) {
|
||||
|
||||
add_product_data_xml ="";
|
||||
|
||||
counterfeitProductGetterSetters = db.getCounterfeitProductAfterData(counterfeitProductExistsGetterSetters.get(l).get_id(), null);
|
||||
|
||||
for (int i1 = 0; i1 < counterfeitProductGetterSetters.size(); i1++) {
|
||||
if (!counterfeitProductGetterSetters.get(i1).getCategory_id().equals("0")) {
|
||||
|
||||
product_add_xml = "[PRODUCT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[CATEGORY_ID]" + Integer.parseInt(counterfeitProductGetterSetters.get(i1).getCategory_id()) + "[/CATEGORY_ID]"
|
||||
+ "[SKU_NAME]" + counterfeitProductGetterSetters.get(i1).getSkuName() + "[/SKU_NAME]"
|
||||
+ "[BRAND_ID]" + counterfeitProductGetterSetters.get(i1).getBrandId() + "[/BRAND_ID]"
|
||||
+ "[STOCK]" + counterfeitProductGetterSetters.get(i1).getStock() + "[/STOCK]"
|
||||
+ "[IMAGE]" + counterfeitProductGetterSetters.get(i1).getImgStr() + "[/IMAGE]"
|
||||
+ "[IMAGE1]" + counterfeitProductGetterSetters.get(i1).getImgStr1() + "[/IMAGE1]"
|
||||
+ "[IMAGE2]" + counterfeitProductGetterSetters.get(i1).getImgStr2() + "[/IMAGE2]"
|
||||
+ "[/PRODUCT_DATA]";
|
||||
|
||||
add_product_data_xml = add_product_data_xml + product_add_xml;
|
||||
}
|
||||
}
|
||||
|
||||
int exists = 0;
|
||||
if (counterfeitProductExistsGetterSetters.get(l).isExists()) {
|
||||
exists = 1;
|
||||
}
|
||||
|
||||
product_exists_xml = "[COUNTERFEIT_PRODUCT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[CATEGORY_ID]" + Integer.parseInt(counterfeitProductExistsGetterSetters.get(l).getCategory_id()) + "[/CATEGORY_ID]"
|
||||
+ "[IS_EXISTS]" + exists + "[/IS_EXISTS]"
|
||||
+ "[COUNTERFEIT_DATA]" + add_product_data_xml + "[/COUNTERFEIT_DATA]"
|
||||
+ "[/COUNTERFEIT_PRODUCT_DATA]";
|
||||
|
||||
counterfeit_product_data_xml = counterfeit_product_data_xml + product_exists_xml;
|
||||
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + counterfeit_product_data_xml + "[/DATA]";
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "COUNTERFEIT_PRODUCT_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();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
|
||||
data.value = 65;
|
||||
data.name = getString(R.string.title_activity_counterfeit_products);
|
||||
publishProgress(data);
|
||||
|
||||
// SET COVERAGE STATUS
|
||||
String final_xml = "";
|
||||
onXML = "";
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
public class CounterfeitProductGetterSetter {
|
||||
|
||||
String skuName, imgStr, imgStr1, imgStr2, brand, _id, category_id;
|
||||
int stock, brandId;
|
||||
|
||||
boolean isExists = true;
|
||||
|
||||
public String getSkuName() {
|
||||
return skuName;
|
||||
}
|
||||
|
||||
public void setSkuName(String skuName) {
|
||||
this.skuName = skuName;
|
||||
}
|
||||
|
||||
public String getImgStr() {
|
||||
return imgStr;
|
||||
}
|
||||
|
||||
public void setImgStr(String imgStr) {
|
||||
this.imgStr = imgStr;
|
||||
}
|
||||
|
||||
public String getImgStr1() {
|
||||
return imgStr1;
|
||||
}
|
||||
|
||||
public void setImgStr1(String imgStr1) {
|
||||
this.imgStr1 = imgStr1;
|
||||
}
|
||||
|
||||
public String getImgStr2() {
|
||||
return imgStr2;
|
||||
}
|
||||
|
||||
public void setImgStr2(String imgStr2) {
|
||||
this.imgStr2 = imgStr2;
|
||||
}
|
||||
|
||||
public int getStock() {
|
||||
return stock;
|
||||
}
|
||||
|
||||
public void setStock(int stock) {
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
public int getBrandId() {
|
||||
return brandId;
|
||||
}
|
||||
|
||||
public void setBrandId(int brandId) {
|
||||
this.brandId = brandId;
|
||||
}
|
||||
|
||||
public String getBrand() {
|
||||
return brand;
|
||||
}
|
||||
|
||||
public void setBrand(String brand) {
|
||||
this.brand = brand;
|
||||
}
|
||||
|
||||
public String get_id() {
|
||||
return _id;
|
||||
}
|
||||
|
||||
public void set_id(String _id) {
|
||||
this._id = _id;
|
||||
}
|
||||
|
||||
public boolean isExists() {
|
||||
return isExists;
|
||||
}
|
||||
|
||||
public void setExists(boolean exists) {
|
||||
isExists = exists;
|
||||
}
|
||||
|
||||
public String getCategory_id() {
|
||||
return category_id;
|
||||
}
|
||||
|
||||
public void setCategory_id(String category_id) {
|
||||
this.category_id = category_id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.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"
|
||||
tools:context=".dailyentry.CounterfeitProductsActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.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" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_counterfeit_products" />
|
||||
|
||||
<android.support.design.widget.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="@mipmap/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,313 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context=".dailyentry.CounterfeitProductsActivity"
|
||||
tools:showIn="@layout/activity_counterfeit_products"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
card_view:cardCornerRadius="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="4">
|
||||
|
||||
<!--Additional Promo-->
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@string/promo_compliance_additional_promo"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/black" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:weightSum="2"
|
||||
android:background="@color/light_orange_background">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="5dp"
|
||||
android:text="@string/is_there_counterfeit_product" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/btntoggle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textOn="@string/yes"
|
||||
android:textOff="@string/no"
|
||||
android:background="@drawable/toggle_selector_background"
|
||||
android:layout_weight=".5" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lin_parent_promo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--Brand Spinner-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight=".8"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@string/brand"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sp_brand"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.2" />
|
||||
</LinearLayout>
|
||||
|
||||
<!--SKU Spinner-->
|
||||
<!--<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight=".8"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="@string/sku"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sp_sku"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.2" />
|
||||
</LinearLayout>-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight=".8"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@string/stock"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_stock"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.2"
|
||||
android:textSize="@dimen/text_size_xsmall"
|
||||
android:inputType="number"
|
||||
android:maxLength="5"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight=".8"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="@string/skuname"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/black"
|
||||
android:textAllCaps="false"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_sku_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/text_size_xsmall"
|
||||
android:inputType="text"
|
||||
android:layout_weight="1.2"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/custom_margin"
|
||||
android:text="@string/image"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_cam"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/camera_orange"
|
||||
android:padding="@dimen/custom_margin"
|
||||
android:text="@string/image" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_cam1"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/camera_orange"
|
||||
android:padding="@dimen/custom_margin"
|
||||
android:text="@string/image" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_cam2"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/camera_orange"
|
||||
android:padding="@dimen/custom_margin"
|
||||
android:text="@string/image" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
<!--<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_remark"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/edit_deactive"
|
||||
android:padding="@dimen/custom_margin"
|
||||
android:text="@string/image" />
|
||||
</RelativeLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_add"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_margin="5dp"
|
||||
app:srcCompat="@drawable/add" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rec_added_counterfeit_product"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:card="http://schemas.android.com/tools"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
card_view:cardCornerRadius="10dp"
|
||||
card:background="@color/white"
|
||||
android:elevation="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_brand"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:paddingBottom="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:paddingTop="2dp"
|
||||
android:text="@string/brand"
|
||||
android:textColor="#222" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sku_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:paddingBottom="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:paddingTop="2dp"
|
||||
android:text="@string/skuname"
|
||||
android:textColor="#222" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingRight="2dp"
|
||||
android:paddingTop="2dp"
|
||||
android:text="@string/stock"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_stock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="@string/price"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -389,7 +389,7 @@
|
||||
<string name="discount_value">Discount Percentage</string>
|
||||
<string name="price">Price</string>
|
||||
<string name="pls_select_sub_category">Please select Sub category</string>
|
||||
<string name="pls_select_brand">Please select Sub category</string>
|
||||
<string name="pls_select_brand">Please select Brand</string>
|
||||
<string name="pls_select_sku">Please select SKU</string>
|
||||
<string name="pls_enter_discount">Please enter discount percentage </string>
|
||||
<string name="pls_enter_price">Please enter price</string>
|
||||
@@ -422,6 +422,9 @@
|
||||
<string name="store_planogram_type">What is the store planogram type?</string>
|
||||
<string name="incorrect_mpin_limit_reached">Incorrect MPin limit reached</string>
|
||||
<string name="need_to_reset_mpin">Need to reset MPin</string>
|
||||
|
||||
<string name="title_activity_counterfeit_products">Counterfeit Products</string>
|
||||
<string name="is_there_counterfeit_product">Is there counterfeit products in Store?</string>
|
||||
<string name="pls_enter_sku">Please enter SKU name</string>
|
||||
<string name="pls_enter_stock">Please enter Stock</string>
|
||||
|
||||
</resources>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#Fri Mar 08 21:08:32 IST 2019
|
||||
#Wed Mar 13 18:14:05 IST 2019
|
||||
D\:\\GITHub\\GSKORANGEV2\\library\\src\\main\\res\\layout\\item_listview_single.xml=D\:\\GITHub\\GSKORANGEV2\\library\\build\\intermediates\\packaged_res\\release\\layout\\item_listview_single.xml
|
||||
D\:\\GITHub\\GSKORANGEV2\\library\\src\\main\\res\\layout\\item_listview_multiple.xml=D\:\\GITHub\\GSKORANGEV2\\library\\build\\intermediates\\packaged_res\\release\\layout\\item_listview_multiple.xml
|
||||
D\:\\GITHub\\GSKORANGEV2\\library\\src\\main\\res\\layout\\activity_main.xml=D\:\\GITHub\\GSKORANGEV2\\library\\build\\intermediates\\packaged_res\\release\\layout\\activity_main.xml
|
||||
|
||||
Reference in New Issue
Block a user