newcode
This commit is contained in:
@@ -14,8 +14,8 @@ android {
|
||||
applicationId "cpm.com.gskmtorange"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 22
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionCode 2
|
||||
versionName "1.1"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
@@ -150,6 +150,7 @@
|
||||
android:name=".upload.UploadActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_upload"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".dailyentry.SettingsActivity"
|
||||
|
||||
@@ -1495,13 +1495,26 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
//Promo Compliance
|
||||
public ArrayList<Promo_Compliance_DataGetterSetter> getPromoComplianceSkuData(String store_id) {
|
||||
public ArrayList<Promo_Compliance_DataGetterSetter> getPromoComplianceSkuData(String store_id, String category_id) {
|
||||
ArrayList<Promo_Compliance_DataGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select * from MAPPING_PROMOTION " +
|
||||
"where STORE_ID='" + store_id + "'", null);
|
||||
dbcursor = db.rawQuery("Select M.* " +
|
||||
"from MAPPING_PROMOTION M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"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 CA.CATEGORY_ID='" + category_id + "' AND M.STORE_ID = '" + store_id + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND", null);
|
||||
|
||||
/*dbcursor = db.rawQuery("Select * from MAPPING_PROMOTION " +
|
||||
"where STORE_ID='" + store_id + "'", null);*/
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -1530,7 +1543,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return list;
|
||||
}
|
||||
|
||||
public ArrayList<Promo_Compliance_DataGetterSetter> getPromoSpinnerData(String store_id) {
|
||||
public ArrayList<Promo_Compliance_DataGetterSetter> getPromoSpinnerData(String store_id, String category_id) {
|
||||
ArrayList<Promo_Compliance_DataGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
@@ -1541,8 +1554,21 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
list.add(promo);
|
||||
|
||||
dbcursor = db.rawQuery("Select * from MAPPING_ADDITIONAL_PROMOTION " +
|
||||
"where STORE_ID='" + store_id + "'", null);
|
||||
dbcursor = db.rawQuery("Select M.* " +
|
||||
"from MAPPING_ADDITIONAL_PROMOTION M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"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 CA.CATEGORY_ID='" + category_id + "' AND M.STORE_ID = '" + store_id + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND", null);
|
||||
|
||||
/*dbcursor = db.rawQuery("Select * from MAPPING_ADDITIONAL_PROMOTION " +
|
||||
"where STORE_ID='" + store_id + "'", null);*/
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -1723,6 +1749,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
sb.setENTRY_ALLOW(dbcursor.getString(dbcursor.getColumnIndexOrThrow("ENTRY_ALLOW")));
|
||||
|
||||
sb.setIMAGE_ALLOW(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE_ALLOW")));
|
||||
|
||||
|
||||
list.add(sb);
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
@@ -3271,12 +3300,25 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return filled;
|
||||
}
|
||||
|
||||
public boolean isMappingPromotionData() {
|
||||
public boolean isMappingPromotionData(String store_id, String category_id) {
|
||||
boolean filled = false;
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("SELECT * FROM MAPPING_PROMOTION ", null);
|
||||
dbcursor = db.rawQuery("Select M.* " +
|
||||
"from MAPPING_PROMOTION M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"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 CA.CATEGORY_ID='" + category_id + "' AND M.STORE_ID = '" + store_id + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND ", null);
|
||||
|
||||
//dbcursor = db.rawQuery("SELECT * FROM MAPPING_PROMOTION ", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -3295,12 +3337,25 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return filled;
|
||||
}
|
||||
|
||||
public boolean isMappingStockData() {
|
||||
public boolean isMappingStockDataMSL_Availability(String category_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||
boolean filled = false;
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("SELECT * FROM MAPPING_STOCK ", null);
|
||||
//dbcursor = db.rawQuery("SELECT * FROM MAPPING_STOCK ", null);
|
||||
dbcursor = db.rawQuery("Select M.* from MAPPING_STOCK M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"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 M.MUST_HAVE=1 AND CA.CATEGORY_ID='" + category_id + "' " +
|
||||
"AND M.KEYACCOUNT_ID = '" + keyAccount_id + "' AND M.STORETYPE_ID = '" + storeType_id + "' " +
|
||||
"AND M.CLASS_ID = '" + class_id + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -3319,12 +3374,24 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return filled;
|
||||
}
|
||||
|
||||
public boolean isMappingT2PData() {
|
||||
public boolean isMappingStockDataStockFacing(String category_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||
boolean filled = false;
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("SELECT * FROM MAPPING_T2P ", null);
|
||||
//dbcursor = db.rawQuery("SELECT * FROM MAPPING_STOCK ", null);
|
||||
dbcursor = db.rawQuery("Select M.* from MAPPING_STOCK M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"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 CA.CATEGORY_ID='" + category_id + "' AND M.KEYACCOUNT_ID = '" + keyAccount_id + "' " +
|
||||
"AND M.STORETYPE_ID = '" + storeType_id + "' AND M.CLASS_ID = '" + class_id + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND ", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -3343,12 +3410,53 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return filled;
|
||||
}
|
||||
|
||||
public boolean isMappingAdditionalPromotionData() {
|
||||
|
||||
public boolean isMappingT2PData(String store_id, String category_id) {
|
||||
boolean filled = false;
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("SELECT * FROM MAPPING_ADDITIONAL_PROMOTION ", null);
|
||||
dbcursor = db.rawQuery("SELECT * FROM MAPPING_T2P M INNER JOIN BRAND_MASTER BR ON M.BRAND_ID = BR.BRAND_ID " +
|
||||
"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 M.STORE_ID = '" + store_id + "' AND CA.CATEGORY_ID= '" + category_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
int icount = dbcursor.getInt(0);
|
||||
dbcursor.close();
|
||||
if (icount > 0) {
|
||||
filled = true;
|
||||
} else {
|
||||
filled = false;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", " when fetching Records!!!!!!!!!!!!!!!!!!!!! " + e.toString());
|
||||
return filled;
|
||||
}
|
||||
return filled;
|
||||
}
|
||||
|
||||
public boolean isMappingAdditionalPromotionData(String store_id, String category_id) {
|
||||
boolean filled = false;
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select M.* " +
|
||||
"from MAPPING_ADDITIONAL_PROMOTION M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"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 CA.CATEGORY_ID='" + category_id + "' AND M.STORE_ID = '" + store_id + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND ", null);
|
||||
|
||||
//dbcursor = db.rawQuery("SELECT * FROM MAPPING_ADDITIONAL_PROMOTION ", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
|
||||
@@ -227,7 +227,8 @@ public class MainActivity extends AppCompatActivity
|
||||
if (coverageList.size() == 0) {
|
||||
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
|
||||
|
||||
Intent i = new Intent(getBaseContext(), UploadActivity.class);
|
||||
startActivity(i);
|
||||
} else {
|
||||
if (isStoreCheckedIn() && isValid()) {
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
dialog = new Dialog(context);
|
||||
dialog.setContentView(R.layout.custom);
|
||||
dialog.setTitle("Sending Checkout Data");
|
||||
dialog.setTitle(getString(R.string.title_activity_checkout));
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
ArrayList<NonWorkingReasonGetterSetter> reasondata = new ArrayList<NonWorkingReasonGetterSetter>();
|
||||
private Spinner reasonspinner;
|
||||
private GSKOrangeDB database;
|
||||
String reasonname, reasonid, entry_allow, image, entry, reason_reamrk, intime;
|
||||
String reasonname, reasonid, entry_allow, image, entry, reason_reamrk, intime,image_allow;
|
||||
Button save;
|
||||
private ArrayAdapter<CharSequence> reason_adapter;
|
||||
protected String _path, str;
|
||||
@@ -152,7 +152,9 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
||||
entry_allow = reasondata.get(position - 1).getENTRY_ALLOW().get(0);
|
||||
|
||||
if (reasonname.equalsIgnoreCase("Store closed")) {
|
||||
image_allow = reasondata.get(position - 1).getIMAGE_ALLOW().get(0);
|
||||
|
||||
if (image_allow.equalsIgnoreCase("1")) {
|
||||
rel_cam.setVisibility(View.VISIBLE);
|
||||
image = "true";
|
||||
} else {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar.setTitle(getString(R.string.title_activity_store_list));
|
||||
|
||||
db.open();
|
||||
storelist = db.getStoreData(date);
|
||||
coverage = db.getCoverageData(date);
|
||||
|
||||
|
||||
+29
-4
@@ -1,6 +1,7 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
@@ -53,6 +54,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
@@ -119,12 +121,35 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
if (isValid()) {
|
||||
|
||||
db.InsertT2PData(t2PGetterSetters, store_id, categoryId);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
T2PComplianceActivity.this);
|
||||
// set title
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||
// set dialog message
|
||||
alertDialogBuilder
|
||||
.setMessage(getResources().getString(R.string.title_activity_Want_save))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
db.InsertT2PData(t2PGetterSetters, store_id, categoryId);
|
||||
//Snackbar.make(view, "Data Saved", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
// if this button is clicked, just close
|
||||
// the dialog box and do nothing
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
Snackbar.make(view, "Data Saved", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
// show it
|
||||
alertDialog.show();
|
||||
|
||||
finish();
|
||||
} else {
|
||||
Snackbar.make(view, error_msg, Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
|
||||
@@ -145,9 +145,9 @@ public class ServiceActivityFragment extends Fragment {
|
||||
public void showExportDialog(){
|
||||
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
|
||||
builder1.setMessage("Are you sure you want to take the backup of your data")
|
||||
builder1.setMessage(R.string.Areyou_sure_take_backup)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@SuppressWarnings("resource")
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
try {
|
||||
@@ -192,7 +192,7 @@ public class ServiceActivityFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
||||
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
|
||||
+38
-20
@@ -102,27 +102,39 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
boolean flag_filled = false;
|
||||
String category_id = categoryList.get(i).getCategory_id();
|
||||
|
||||
//Additional_Visibility
|
||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||
boolean flag = true;
|
||||
|
||||
if (db.isMappingStockData()) {
|
||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)
|
||||
&& !db.checkStockAndFacingData(store_id, category_id)) {
|
||||
//MSL_Availability
|
||||
if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Stock_Facing
|
||||
if (flag) {
|
||||
if (!db.isMappingPromotionData()) {
|
||||
if (db.checkPromoComplianceData(store_id, category_id)) {
|
||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkStockAndFacingData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Promo Compliance
|
||||
if (flag) {
|
||||
if (!db.isMappingT2PData()) {
|
||||
if (db.isFilledT2P(store_id, category_id)) {
|
||||
if (db.isMappingPromotionData(store_id, category_id)) {
|
||||
if (!db.checkPromoComplianceData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//T2P
|
||||
if (flag) {
|
||||
if (db.isMappingT2PData(store_id, category_id)) {
|
||||
if (!db.isFilledT2P(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
@@ -289,25 +301,31 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||
//boolean flag = true;
|
||||
|
||||
if (db.isMappingStockData()) {
|
||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)
|
||||
&& !db.checkStockAndFacingData(store_id, category_id)) {
|
||||
if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Stock_Facing
|
||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkStockAndFacingData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (db.isMappingPromotionData(store_id, category_id)) {
|
||||
if (!db.checkPromoComplianceData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!db.isMappingPromotionData()) {
|
||||
if (db.checkPromoComplianceData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!db.isMappingT2PData()) {
|
||||
if (db.isFilledT2P(store_id, category_id)) {
|
||||
if (db.isMappingT2PData(store_id, category_id)) {
|
||||
if (!db.isFilledT2P(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
+12
-12
@@ -106,7 +106,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
||||
//data.setCategory_name("MSL Availability");
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
||||
if (db.isMappingStockData()) {
|
||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (db.checkMsl_AvailabilityData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
@@ -120,7 +120,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
//data.setCategory_name("Stock & Facing");
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||
if (db.isMappingStockData()) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (db.checkStockAndFacingData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.stock_facing_done);
|
||||
} else {
|
||||
@@ -135,7 +135,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
||||
|
||||
if (db.isMappingT2PData()) {
|
||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||
if (db.isFilledT2P(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.t2p_compliance_done);
|
||||
} else {
|
||||
@@ -163,7 +163,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
//data.setCategory_name("Promo Compliance");
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
||||
|
||||
if (db.isMappingPromotionData() || db.isMappingAdditionalPromotionData()) {
|
||||
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
||||
if (db.checkPromoComplianceData(store_id, categoryId) ||
|
||||
db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.promo_compliance_done);
|
||||
@@ -248,25 +248,25 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
||||
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||
if (db.isMappingStockData()) {
|
||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (db.isMappingStockData()) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||
if (db.isMappingPromotionData() || db.isMappingAdditionalPromotionData()) {
|
||||
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))) {
|
||||
if (db.isMappingT2PData()) {
|
||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
@@ -277,14 +277,14 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||
if (db.isMappingStockData()) {
|
||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_AvailabilityActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (db.isMappingStockData()) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, Stock_FacingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -292,14 +292,14 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||
|
||||
if (db.isMappingPromotionData() || db.isMappingAdditionalPromotionData()) {
|
||||
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, PromoComplianceActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))) {
|
||||
if (db.isMappingT2PData()) {
|
||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, T2PComplianceActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
|
||||
+2
-2
@@ -317,11 +317,11 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
//Promo SKU List
|
||||
promoSkuListData = db.getPromoComplianceSkuAfterData(store_id, categoryId);
|
||||
if (!(promoSkuListData.size() > 0)) {
|
||||
promoSkuListData = db.getPromoComplianceSkuData(store_id);
|
||||
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId);
|
||||
}
|
||||
|
||||
//Promo Spinner List
|
||||
promoSpinnerListData = db.getPromoSpinnerData(store_id);
|
||||
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId);
|
||||
|
||||
ArrayAdapter<String> sp_promo_adapter = new ArrayAdapter<>(PromoComplianceActivity.this, android.R.layout.simple_list_item_1);
|
||||
for (int i = 0; i < promoSpinnerListData.size(); i++) {
|
||||
|
||||
+1
-2
@@ -247,8 +247,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[APP_VERSION]" + app_version + "[/APP_VERSION]"
|
||||
+ "[LONGITUDE]" + coverageList.get(i).getLongitude() + "[/LONGITUDE]"
|
||||
+ "[IN_TIME]" + coverageList.get(i).getInTime() + "[/IN_TIME]"
|
||||
//+ "[OUT_TIME]" + coverageList.get(i).getOutTime() + "[/OUT_TIME]"
|
||||
+ "[OUT_TIME]" + "00:00" + "[/OUT_TIME]"
|
||||
+ "[OUT_TIME]" + coverageList.get(i).getOutTime() + "[/OUT_TIME]"
|
||||
+ "[UPLOAD_STATUS]" + "N" + "[/UPLOAD_STATUS]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[IMAGE_URL]" + coverageList.get(i).getImage() + "[/IMAGE_URL]"
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.os.AsyncTask;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
@@ -79,10 +80,13 @@ public class UploadActivity extends AppCompatActivity {
|
||||
private int factor, k = 0;
|
||||
Object result = "";
|
||||
|
||||
Toolbar toolbar;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_upload);
|
||||
setContentView(R.layout.activity_main);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
@@ -199,7 +203,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
super.onPreExecute();
|
||||
dialog = new Dialog(context);
|
||||
dialog.setContentView(R.layout.custom);
|
||||
dialog.setTitle("Uploading Data");
|
||||
dialog.setTitle(getString(R.string.uploaddata));
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
|
||||
@@ -250,8 +254,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[APP_VERSION]" + app_version + "[/APP_VERSION]"
|
||||
+ "[LONGITUDE]" + coverageList.get(i).getLongitude() + "[/LONGITUDE]"
|
||||
+ "[IN_TIME]" + coverageList.get(i).getInTime() + "[/IN_TIME]"
|
||||
//+ "[OUT_TIME]" + coverageList.get(i).getOutTime() + "[/OUT_TIME]"
|
||||
+ "[OUT_TIME]" + "00:00" + "[/OUT_TIME]"
|
||||
+ "[OUT_TIME]" + coverageList.get(i).getOutTime() + "[/OUT_TIME]"
|
||||
+ "[UPLOAD_STATUS]" + "N" + "[/UPLOAD_STATUS]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[IMAGE_URL]" + coverageList.get(i).getImage() + "[/IMAGE_URL]"
|
||||
@@ -342,7 +345,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
data.value = 10;
|
||||
data.name = "MSL_Availability Uploading";
|
||||
data.name = getString(R.string.availability_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
@@ -467,7 +470,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
data.value = 20;
|
||||
data.name = "Stock Facing Uploading";
|
||||
data.name = getString(R.string.stock_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
@@ -526,7 +529,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
data.value = 30;
|
||||
data.name = "Promotion Data Uploading";
|
||||
data.name = getString(R.string.promo_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
@@ -585,7 +588,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
data.value = 35;
|
||||
data.name = "Additional Promotion Data Uploading";
|
||||
data.name = getString(R.string.additional_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
@@ -700,9 +703,8 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
data.value = 35;
|
||||
data.name = "Additional Visibility Data";
|
||||
data.name = getString(R.string.additional_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
/////ashish close
|
||||
@@ -845,7 +847,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
data.value = 40;
|
||||
data.name = "T2P Data Uploading";
|
||||
data.name = getString(R.string.t2p_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
//Image Upload
|
||||
@@ -1069,6 +1071,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar.setTitle(getString(R.string.title_activity_upload));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<string name="cancel">İptal etmek</string>
|
||||
<string name="empty">Boş</string>
|
||||
|
||||
<string name="check_faceup">Raf Payı, stoktan daha az veya eşit olmalıdır</string>
|
||||
<string name="check_faceup">Önyüz sayısı stoktan daha az veya eşit olmalıdır</string>
|
||||
<string name="fill_stock_value">Önce stok değerini doldurun</string>
|
||||
<string name="want_add">Verileri eklemek istiyor musunuz?</string>
|
||||
<string name="promo_add">Promosyon eklendi</string>
|
||||
@@ -216,6 +216,18 @@
|
||||
<string name="select_promo">Seçiniz</string>
|
||||
<!--Gagan end code 3-->
|
||||
|
||||
//text for uploading screen
|
||||
|
||||
<string name="coverage_data_uploading">Kapsam yükleniyor</string>
|
||||
<string name="availability_data_uploading">Bulunurluk verisi paylaşılıyor</string>
|
||||
<string name="stock_data_uploading">Stok verisi paylaşılıyor</string>
|
||||
<string name="t2p_data_uploading">Kalıcı teşhir verisi paylaşılıyor</string>
|
||||
<string name="additional_data_uploading">Ek teşhir verisi paylaşılıyor</string>
|
||||
<string name="promo_data_uploading">Promosyon verisi paylaşılıyor</string>
|
||||
<string name="no_data_for_upload">Yükleme İçin Veri Yok</string>
|
||||
<string name="title_activity_checkout">Çıkış yapmak</string>
|
||||
<string name="Areyou_sure_take_backup">Verilerinizin yedeğini almak istediğinizden emin misiniz</string>
|
||||
<string name="data_exported_successfully">Veritabanı Başarıyla Gönderildi</string>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
<string name="title_activity_checkout">CheckoutActivity</string>
|
||||
<string name="title_activity_checkout">Checkout Activity</string>
|
||||
<string name="checkout_successful">Checkout Success</string>
|
||||
|
||||
<string name="NetworkError">Network Error ,</string>
|
||||
@@ -251,5 +251,16 @@
|
||||
<string name="select_promo">Select</string>
|
||||
|
||||
<!--Gagan end code 3-->
|
||||
|
||||
//text for uploading screen
|
||||
<string name="coverage_data_uploading">Coverage Uploading</string>
|
||||
<string name="availability_data_uploading">Availability Data Uploading</string>
|
||||
<string name="stock_data_uploading">Stock Data Uploading</string>
|
||||
<string name="t2p_data_uploading">T2P Data Uploading</string>
|
||||
<string name="additional_data_uploading">Additional Visibility Data Uploading</string>
|
||||
<string name="promo_data_uploading">Promo Data Uploading</string>
|
||||
<string name="Areyou_sure_take_backup"> Are you sure you want to take the backup of your data</string>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user