Merge pull request #59 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GG_Today_Stock_Facing_Changes
Gg today stock facing changes
This commit is contained in:
@@ -1198,13 +1198,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Stock_FacingGetterSetter> getStockAndFacingHeader_AfterSaveData(String category_id) {
|
public ArrayList<Stock_FacingGetterSetter> getStockAndFacingHeader_AfterSaveData(String category_id, String store_id) {
|
||||||
ArrayList<Stock_FacingGetterSetter> list = new ArrayList<>();
|
ArrayList<Stock_FacingGetterSetter> list = new ArrayList<>();
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dbcursor = db.rawQuery("Select * from Stock_Facing_Header_Data " +
|
dbcursor = db.rawQuery("Select * from Stock_Facing_Header_Data " +
|
||||||
"where category_id='" + category_id + "'", null);
|
"where category_id='" + category_id + "' AND Store_Id='" + store_id + "'", null);
|
||||||
|
|
||||||
if (dbcursor != null) {
|
if (dbcursor != null) {
|
||||||
dbcursor.moveToFirst();
|
dbcursor.moveToFirst();
|
||||||
@@ -2216,6 +2216,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteStockEntryall(String storeid, String categoryid) {
|
public void deleteStockEntryall(String storeid, String categoryid) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -2586,8 +2587,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, null, values);
|
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, null, values);
|
||||||
|
|
||||||
for(int j=0;j<skulist.size();j++)
|
for (int j = 0; j < skulist.size(); j++) {
|
||||||
{
|
|
||||||
values1.put(CommonString.KEY_Common_ID, key_id);
|
values1.put(CommonString.KEY_Common_ID, key_id);
|
||||||
values1.put(CommonString.KEY_STORE_ID, skulist.get(j).getStore_id());
|
values1.put(CommonString.KEY_STORE_ID, skulist.get(j).getStore_id());
|
||||||
values1.put("categoryId", categoryId);
|
values1.put("categoryId", categoryId);
|
||||||
@@ -2601,8 +2601,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.d("Database Exception ", ex.getMessage());
|
Log.d("Database Exception ", ex.getMessage());
|
||||||
}
|
}
|
||||||
@@ -2664,7 +2662,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// get T2P Compliance data
|
// get T2P Compliance data
|
||||||
public ArrayList<T2PGetterSetter> getT2pComplianceData(String store_id, String category_id) {
|
public ArrayList<T2PGetterSetter> getT2pComplianceData(String store_id, String category_id) {
|
||||||
|
|
||||||
|
|||||||
@@ -206,12 +206,10 @@ public class MainActivity extends AppCompatActivity
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (coverageList.size() == 0) {
|
if (coverageList.size() == 0) {
|
||||||
|
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
|
||||||
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT)
|
|
||||||
.setAction("Action", null).show();
|
|
||||||
Intent i = new Intent(getBaseContext(), UploadActivity.class);
|
Intent i = new Intent(getBaseContext(), UploadActivity.class);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (isStoreCheckedIn() && isValid()) {
|
if (isStoreCheckedIn() && isValid()) {
|
||||||
|
|
||||||
@@ -219,11 +217,8 @@ public class MainActivity extends AppCompatActivity
|
|||||||
startActivity(i);
|
startActivity(i);
|
||||||
|
|
||||||
//finish();
|
//finish();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Snackbar.make(webView, error_msg, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
Snackbar.make(webView, error_msg, Snackbar.LENGTH_SHORT)
|
|
||||||
.setAction("Action", null).show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -414,9 +409,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
String coverage_status = db.getSpecificStoreData(date, coverageList.get(i).getStoreId()).getCHECKOUT_STATUS();
|
String coverage_status = db.getSpecificStoreData(date, coverageList.get(i).getStoreId()).getCHECKOUT_STATUS();
|
||||||
|
|
||||||
if (!storestatus.equalsIgnoreCase(CommonString.KEY_U)) {
|
if (!storestatus.equalsIgnoreCase(CommonString.KEY_U)) {
|
||||||
if ((coverage_status.equalsIgnoreCase(
|
if ((coverage_status.equalsIgnoreCase(CommonString.KEY_Y) || storestatus.equalsIgnoreCase(CommonString.KEY_P) ||
|
||||||
CommonString.KEY_C)
|
|
||||||
|| storestatus.equalsIgnoreCase(CommonString.KEY_P) ||
|
|
||||||
storestatus.equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE))) {
|
storestatus.equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE))) {
|
||||||
flag = true;
|
flag = true;
|
||||||
break;
|
break;
|
||||||
@@ -437,11 +430,9 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
if (language.equalsIgnoreCase("English")) {
|
||||||
lang = "EN";
|
lang = "EN";
|
||||||
}
|
} else if (language.equalsIgnoreCase("UAE")) {
|
||||||
else if(language.equalsIgnoreCase("UAE")) {
|
|
||||||
lang = "AR";
|
lang = "AR";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lang = "TR";
|
lang = "TR";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class CommonString {
|
|||||||
public static final String KEY_D = "D";
|
public static final String KEY_D = "D";
|
||||||
public static final String KEY_U = "U";
|
public static final String KEY_U = "U";
|
||||||
public static final String KEY_C = "C";
|
public static final String KEY_C = "C";
|
||||||
|
public static final String KEY_Y = "Y";
|
||||||
public static final String KEY_L = "Leave";
|
public static final String KEY_L = "Leave";
|
||||||
public static final String KEY_N = "NOT_VISITED";
|
public static final String KEY_N = "NOT_VISITED";
|
||||||
public static final String KEY_INVALID = "INVALID";
|
public static final String KEY_INVALID = "INVALID";
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
if (result.toString()
|
if (result.toString()
|
||||||
.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
db.updateCheckoutOuttime(store_id, getCurrentTime(),CommonString.KEY_C);
|
db.updateCheckoutOuttime(store_id, getCurrentTime(),CommonString.KEY_Y);
|
||||||
|
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.putString(CommonString.KEY_STORE_ID, "");
|
editor.putString(CommonString.KEY_STORE_ID, "");
|
||||||
@@ -210,7 +210,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
db.updateCheckoutStatus(store_id, CommonString.KEY_C);
|
db.updateCheckoutStatus(store_id, CommonString.KEY_Y);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_C)) {
|
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_Y)) {
|
||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
@@ -267,7 +267,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
||||||
|
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_data_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_data_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_C)) {
|
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_Y)) {
|
||||||
|
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
|||||||
+10
-11
@@ -93,11 +93,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
if (language.equalsIgnoreCase("English")) {
|
||||||
lang = "EN";
|
lang = "EN";
|
||||||
}
|
} else if (language.equalsIgnoreCase("UAE")) {
|
||||||
else if(language.equalsIgnoreCase("UAE")) {
|
|
||||||
lang = "AR";
|
lang = "AR";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lang = "TR";
|
lang = "TR";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,7 +289,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
hashMapListChildData = new HashMap<>();
|
hashMapListChildData = new HashMap<>();
|
||||||
|
|
||||||
//Header Data
|
//Header Data
|
||||||
headerDataList = db.getStockAndFacingHeader_AfterSaveData(categoryId);
|
headerDataList = db.getStockAndFacingHeader_AfterSaveData(categoryId, store_id);
|
||||||
if (!(headerDataList.size() > 0)) {
|
if (!(headerDataList.size() > 0)) {
|
||||||
headerDataList = db.getStockAndFacingHeaderData(categoryId);
|
headerDataList = db.getStockAndFacingHeaderData(categoryId);
|
||||||
}
|
}
|
||||||
@@ -952,7 +950,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
holder.ed_stock.setVisibility(View.GONE);
|
holder.ed_stock.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (childData.getStock().equals("0")) {
|
if (childData.getStock().equals("0")) {
|
||||||
holder.ed_facing.setEnabled(false);
|
holder.ed_facing.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -971,9 +968,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
String stock = edStock.replaceFirst("^0+(?!$)", "");
|
String stock = edStock.replaceFirst("^0+(?!$)", "");
|
||||||
childData.setStock(stock);
|
childData.setStock(stock);
|
||||||
|
|
||||||
if (edStock.equals("0")) {
|
if (stock.equals("0")) {
|
||||||
childData.setFacing("0");
|
childData.setFacing("0");
|
||||||
|
finalHolder.ed_facing.setText("0");
|
||||||
finalHolder.ed_facing.setEnabled(false);
|
finalHolder.ed_facing.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
childData.setFacing(childData.getFacing());
|
childData.setFacing(childData.getFacing());
|
||||||
@@ -981,6 +978,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
childData.setStock("");
|
childData.setStock("");
|
||||||
|
childData.setFacing("");
|
||||||
finalHolder.ed_facing.setEnabled(true);
|
finalHolder.ed_facing.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1007,8 +1005,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
childData.setStock(stock);
|
childData.setStock(stock);
|
||||||
|
|
||||||
if (edStock.equals("0")) {
|
if (edStock.equals("0")) {
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
childData.setFacing("0");
|
childData.setFacing("0");
|
||||||
|
}
|
||||||
finalHolder.ed_facing.setEnabled(false);
|
finalHolder.ed_facing.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
childData.setFacing(childData.getFacing());
|
childData.setFacing(childData.getFacing());
|
||||||
@@ -1016,10 +1015,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
childData.setStock("");
|
childData.setStock("");
|
||||||
|
childData.setFacing("");
|
||||||
finalHolder.ed_facing.setEnabled(true);
|
finalHolder.ed_facing.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
//expandableListView.invalidateViews();
|
||||||
expandableListView.invalidateViews();
|
|
||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,8 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
storeData = db.getSpecificStoreData(date, coverageList.get(i).getStoreId());
|
storeData = db.getSpecificStoreData(date, coverageList.get(i).getStoreId());
|
||||||
if (storeData.getSTORE_ID() != null) {
|
if (storeData.getSTORE_ID() != null) {
|
||||||
|
|
||||||
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_C) || storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_L) ||
|
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||||
|
storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_L) ||
|
||||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U)) {
|
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U)) {
|
||||||
|
|
||||||
String camera_allow = storeData.getCAMERA_ALLOW();
|
String camera_allow = storeData.getCAMERA_ALLOW();
|
||||||
|
|||||||
Reference in New Issue
Block a user