Merge pull request #33 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GG_Additional_Visibility_Changes
Gg additional visibility changes
This commit is contained in:
@@ -193,6 +193,13 @@
|
|||||||
android:label="@string/title_activity_store_checkout_image"
|
android:label="@string/title_activity_store_checkout_image"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.MSL_Availability_StockFacingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.Database;
|
package cpm.com.gskmtorange.Database;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
@@ -13,6 +14,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||||
@@ -20,35 +22,34 @@ import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
|
||||||
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
||||||
@@ -150,6 +151,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
db.execSQL(TableBean.getMappingSubCategoryImageAllow());
|
db.execSQL(TableBean.getMappingSubCategoryImageAllow());
|
||||||
|
|
||||||
|
//15-03-2017
|
||||||
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING);
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Toast.makeText(context, "Error -" + e.toString(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Error -" + e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
@@ -224,6 +228,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE, null, null);
|
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE, null, null);
|
||||||
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE_LIST, null, null);
|
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE_LIST, null, null);
|
||||||
|
db.delete(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||||
@@ -2382,9 +2387,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
public void deleteStockEntryall(String storeid, String categoryid) {
|
public void deleteStockEntryall(String storeid, String categoryid) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
/* db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
||||||
db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
||||||
|
*/
|
||||||
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
||||||
|
|
||||||
db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
|
||||||
@@ -2539,7 +2544,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
// cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE Store_Id = '"+store_id + "'categoryId = '"+categoryId + "'", null);
|
// cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE Store_Id = '"+store_id + "'categoryId = '"+categoryId + "'", null);
|
||||||
cursordata = db.rawQuery("Select * from Stock_Additional_visibility " + "where categoryId='" + categoryId + "' and Store_Id='" + store_id + "'", null);
|
cursordata = db.rawQuery("Select * from Stock_Additional_visibility_Main " + "where categoryId='" + categoryId + "' and Store_Id='" + store_id + "'", null);
|
||||||
|
|
||||||
if (cursordata != null) {
|
if (cursordata != null) {
|
||||||
cursordata.moveToFirst();
|
cursordata.moveToFirst();
|
||||||
@@ -2778,7 +2783,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertMainListAdditionalData(AddittionalGetterSetter Mainlist, ArrayList<AdditionalDialogGetterSetter> skulist, String categoryId) {
|
/*public void InsertMainListAdditionalData(AddittionalGetterSetter Mainlist, ArrayList<AdditionalDialogGetterSetter> skulist, String categoryId) {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
ContentValues values1 = new ContentValues();
|
ContentValues values1 = new ContentValues();
|
||||||
try {
|
try {
|
||||||
@@ -2816,6 +2821,50 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
Log.d("Database Exception ", ex.getMessage());
|
Log.d("Database Exception ", ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public void InsertMainListAdditionalData(ArrayList<AddittionalGetterSetter> Mainlist, String categoryId) {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
ContentValues values1 = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < Mainlist.size(); i++) {
|
||||||
|
AddittionalGetterSetter data = Mainlist.get(i);
|
||||||
|
|
||||||
|
values.put("Store_Id", data.getStore_id());
|
||||||
|
values.put("categoryId", categoryId);
|
||||||
|
values.put("brand_name", data.getBrand());
|
||||||
|
values.put("brand_id", data.getBrand_id());
|
||||||
|
values.put("image_url", data.getImage());
|
||||||
|
values.put("image_url2", data.getImage2());
|
||||||
|
values.put("image_url3", data.getImage3());
|
||||||
|
values.put("sku_id", data.getSku_id());
|
||||||
|
values.put("sku_name", data.getSku());
|
||||||
|
values.put("toggle_value", data.getBtn_toogle());
|
||||||
|
|
||||||
|
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, null, values);
|
||||||
|
|
||||||
|
ArrayList<AdditionalDialogGetterSetter> skulist = data.getSkuDialogList();
|
||||||
|
if (skulist != null) {
|
||||||
|
|
||||||
|
for (int j = 0; j < skulist.size(); j++) {
|
||||||
|
values1.put(CommonString.KEY_Common_ID, key_id);
|
||||||
|
values1.put(CommonString.KEY_STORE_ID, skulist.get(j).getStore_id());
|
||||||
|
values1.put("categoryId", categoryId);
|
||||||
|
values1.put(CommonString.KEY_BRAND, skulist.get(j).getBrand());
|
||||||
|
values1.put(CommonString.KEY_BRAND_ID, skulist.get(j).getBrand_id());
|
||||||
|
values1.put(CommonString.KEY_QUANTITY, skulist.get(j).getQuantity());
|
||||||
|
values1.put(CommonString.KEY_SKU_ID, skulist.get(j).getSku_id());
|
||||||
|
values1.put(CommonString.KEY_SKUNAME, skulist.get(j).getSku_name());
|
||||||
|
|
||||||
|
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG_MAIN, null, values1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Database Exception ", ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<AdditionalDialogGetterSetter> getDialogStockUpload(String keyid) {
|
public ArrayList<AdditionalDialogGetterSetter> getDialogStockUpload(String keyid) {
|
||||||
@@ -4717,4 +4766,303 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
Log.d("Exception ", " in MAPPING_SUB_CATEGORY_IMAGE_ALLOW " + ex.toString());
|
Log.d("Exception ", " in MAPPING_SUB_CATEGORY_IMAGE_ALLOW " + ex.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//14-03-2017
|
||||||
|
//MSL_Availability_StockFacing
|
||||||
|
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getMSL_Availability_StockFacingHeaderData(
|
||||||
|
String category_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND,BR.COMPANY_ID ," +
|
||||||
|
" (SELECT SUM(SOS_TARGET) FROM MAPPING_SOS_TARGET WHERE STORE_ID = 1 AND BRAND_ID = BR.BRAND_ID)AS SOS_TARGET " +
|
||||||
|
"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.COMPANY_ID,BR.BRAND", null);
|
||||||
|
|
||||||
|
/*dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND " +
|
||||||
|
"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();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter cd = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
|
||||||
|
cd.setSub_category_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||||
|
cd.setSub_category(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY")));
|
||||||
|
cd.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND_ID")));
|
||||||
|
cd.setBrand(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND")));
|
||||||
|
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
|
||||||
|
|
||||||
|
|
||||||
|
list.add(cd);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "get MSL_AvailabilityHeader!" + e.toString());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getMSL_Availability_StockFacingSKUData(
|
||||||
|
String category_id, String brand_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE,M.MBQ,BR.COMPANY_ID " +
|
||||||
|
"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 BR.BRAND_ID='" + brand_id +
|
||||||
|
"' AND M.KEYACCOUNT_ID = '" + keyAccount_id + "' AND M.STORETYPE_ID = '" + storeType_id +
|
||||||
|
"' AND M.CLASS_ID = '" + class_id + "'", null);
|
||||||
|
|
||||||
|
/*dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE,M.MBQ " +
|
||||||
|
"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 BR.BRAND_ID='" + brand_id +
|
||||||
|
"' AND M.KEYACCOUNT_ID = '" + keyAccount_id + "' AND M.STORETYPE_ID = '" + storeType_id +
|
||||||
|
"' AND M.CLASS_ID = '" + class_id + "'", null);*/
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter cd = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
|
||||||
|
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
|
||||||
|
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
|
||||||
|
cd.setMrp(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MRP")));
|
||||||
|
cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE")));
|
||||||
|
cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ")));
|
||||||
|
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
|
||||||
|
cd.setToggleValue("1");
|
||||||
|
cd.setFacing("");
|
||||||
|
cd.setStock("");
|
||||||
|
|
||||||
|
list.add(cd);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "get MSL_AvailabilityHeader!" + e.toString());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getMSL_Availability_StockFacingSKU_AfterSaveData(
|
||||||
|
String category_id, String brand_id, String store_id) {
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
dbcursor = db.rawQuery("Select * from Msl_Availability_Stock_Facing_Data " +
|
||||||
|
"where category_id='" + category_id + "' and Brand_Id='" + brand_id + "' AND Store_Id='" + store_id + "'", null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter cd = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
|
||||||
|
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
|
||||||
|
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
|
||||||
|
cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE")));
|
||||||
|
cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ")));
|
||||||
|
cd.setToggleValue(dbcursor.getString(dbcursor.getColumnIndexOrThrow("TOGGLE_VALUE")));
|
||||||
|
cd.setFacing(dbcursor.getString(dbcursor.getColumnIndexOrThrow("FACING")));
|
||||||
|
cd.setStock(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STOCK")));
|
||||||
|
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
|
||||||
|
|
||||||
|
list.add(cd);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "get MSL_Availability Sku After Save Data!" + e.toString());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertMSL_Availability_StockFacing(
|
||||||
|
String storeId, String categoryId, List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData) {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
try {
|
||||||
|
db.beginTransaction();
|
||||||
|
for (int i = 0; i < hashMapListHeaderData.size(); i++) {
|
||||||
|
|
||||||
|
for (int j = 0; j < hashMapListChildData.get(hashMapListHeaderData.get(i)).size(); j++) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter data = hashMapListChildData.get(hashMapListHeaderData.get(i)).get(j);
|
||||||
|
|
||||||
|
values.put("Store_Id", storeId);
|
||||||
|
values.put("Category_Id", categoryId);
|
||||||
|
values.put("Brand_Id", hashMapListHeaderData.get(i).getBrand_id());
|
||||||
|
values.put("SKU_ID", data.getSku_id());
|
||||||
|
values.put("SKU", data.getSku());
|
||||||
|
values.put("SKU_SEQUENCE", data.getSku_sequence());
|
||||||
|
values.put("MBQ", data.getMbq());
|
||||||
|
values.put("TOGGLE_VALUE", data.getToggleValue());
|
||||||
|
values.put("FACING", data.getFacing());
|
||||||
|
values.put("STOCK", data.getStock());
|
||||||
|
values.put("COMPANY_ID", data.getCompany_id());
|
||||||
|
|
||||||
|
db.insert(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, null, values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
db.setTransactionSuccessful();
|
||||||
|
db.endTransaction();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in Insert MSL_Availability_StockFacing " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateMSL_Availability_StockFacing(
|
||||||
|
String storeId, String categoryId, List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData) {
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
try {
|
||||||
|
db.beginTransaction();
|
||||||
|
for (int i = 0; i < hashMapListHeaderData.size(); i++) {
|
||||||
|
|
||||||
|
for (int j = 0; j < hashMapListChildData.get(hashMapListHeaderData.get(i)).size(); j++) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter data = hashMapListChildData.get(hashMapListHeaderData.get(i)).get(j);
|
||||||
|
|
||||||
|
values.put("TOGGLE_VALUE", data.getToggleValue());
|
||||||
|
values.put("FACING", data.getFacing());
|
||||||
|
values.put("STOCK", data.getStock());
|
||||||
|
|
||||||
|
db.update(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, values,
|
||||||
|
"Brand_Id ='" + hashMapListHeaderData.get(i).getBrand_id() + "' AND SKU_ID ='" + data.getSku_id() +
|
||||||
|
"' AND Category_Id='" + categoryId + "' AND Store_Id='" + storeId + "'", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
db.setTransactionSuccessful();
|
||||||
|
db.endTransaction();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in Insert MSL_Availability_StockFacing " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("LongLogTag")
|
||||||
|
public boolean checkMsl_Availability_StockFacingData(String store_id, String category_id) {
|
||||||
|
Log.d("MSL_Availability ", "Stock data--------------->Start<------------");
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
dbcursor = db.rawQuery("Select * from Msl_Availability_Stock_Facing_Data " +
|
||||||
|
"where category_id='" + category_id + "' and Store_Id='" + store_id + "'", null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
if (dbcursor.moveToFirst()) {
|
||||||
|
do {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter sb = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
|
||||||
|
sb.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
|
||||||
|
list.add(sb);
|
||||||
|
} while (dbcursor.moveToNext());
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
|
||||||
|
return list.size() > 0;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.d("MSL_Availability_StockFacing ", "midday---------------------->Stop<-----------");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//MSL_Availability_StockFacing Server Upload Data
|
||||||
|
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getMSL_Availability_StockFacing_UploadServerData(String store_id) {
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
dbcursor = db.rawQuery("Select * from Msl_Availability_Stock_Facing_Data " +
|
||||||
|
"where Store_Id='" + store_id + "'", null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter cd = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
|
||||||
|
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Category_Id")));
|
||||||
|
cd.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Brand_Id")));
|
||||||
|
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
|
||||||
|
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
|
||||||
|
cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE")));
|
||||||
|
cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ")));
|
||||||
|
cd.setToggleValue(dbcursor.getString(dbcursor.getColumnIndexOrThrow("TOGGLE_VALUE")));
|
||||||
|
cd.setFacing(dbcursor.getString(dbcursor.getColumnIndexOrThrow("FACING")));
|
||||||
|
cd.setStock(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STOCK")));
|
||||||
|
|
||||||
|
list.add(cd);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "get MSL_Availability server upload Data!" + e.toString());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -1,11 +1,14 @@
|
|||||||
package cpm.com.gskmtorange.GetterSetter;
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ashishc on 09-01-2017.
|
* Created by ashishc on 09-01-2017.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AddittionalGetterSetter {
|
public class AddittionalGetterSetter {
|
||||||
|
|
||||||
|
|
||||||
public String getBrand() {
|
public String getBrand() {
|
||||||
return Brand;
|
return Brand;
|
||||||
}
|
}
|
||||||
@@ -107,4 +110,13 @@ public class AddittionalGetterSetter {
|
|||||||
|
|
||||||
String categoryId;
|
String categoryId;
|
||||||
|
|
||||||
|
ArrayList<AdditionalDialogGetterSetter> skuDialogList = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<AdditionalDialogGetterSetter> getSkuDialogList() {
|
||||||
|
return skuDialogList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSkuDialogList(ArrayList<AdditionalDialogGetterSetter> skuDialogList) {
|
||||||
|
this.skuDialogList = skuDialogList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,8 +242,8 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
mPasswordView.setError(null);
|
mPasswordView.setError(null);
|
||||||
|
|
||||||
// Store values at the time of the login attempt.
|
// Store values at the time of the login attempt.
|
||||||
userid = museridView.getText().toString();
|
userid = museridView.getText().toString().trim();
|
||||||
password = mPasswordView.getText().toString();
|
password = mPasswordView.getText().toString().trim();
|
||||||
|
|
||||||
boolean cancel = false;
|
boolean cancel = false;
|
||||||
View focusView = null;
|
View focusView = null;
|
||||||
|
|||||||
@@ -759,4 +759,46 @@ public class CommonString {
|
|||||||
public static final String KEY_LANGUAGE_OMAN = "English";
|
public static final String KEY_LANGUAGE_OMAN = "English";
|
||||||
public static final String KEY_RETURE_LANGUAGE_OMAN = "EN";
|
public static final String KEY_RETURE_LANGUAGE_OMAN = "EN";
|
||||||
|
|
||||||
|
public static final String TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING = "Msl_Availability_Stock_Facing_Data";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING
|
||||||
|
+ "("
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
|
+ "Store_Id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Category_Id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Brand_Id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SKU_ID"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SKU"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SKU_SEQUENCE"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "MBQ"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "COMPANY_ID"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "FACING"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "STOCK"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "TOGGLE_VALUE"
|
||||||
|
+ " VARCHAR"
|
||||||
|
|
||||||
|
+ ")";
|
||||||
}
|
}
|
||||||
|
|||||||
+141
-153
@@ -12,9 +12,6 @@ import android.content.pm.ApplicationInfo;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -40,7 +37,6 @@ import android.widget.EditText;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
@@ -49,21 +45,17 @@ import java.io.File;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GeoTag.GeoTagActivity;
|
|
||||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.DailyDataMenuActivity;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ashishc on 05-01-2017.
|
* Created by ashishc on 05-01-2017.
|
||||||
@@ -71,7 +63,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
|||||||
|
|
||||||
public class AdditionalVisibility extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener {
|
public class AdditionalVisibility extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener {
|
||||||
ArrayList<AdditionalDialogGetterSetter> list = new ArrayList<AdditionalDialogGetterSetter>();
|
ArrayList<AdditionalDialogGetterSetter> list = new ArrayList<AdditionalDialogGetterSetter>();
|
||||||
ArrayList<AddittionalGetterSetter> listdata = new ArrayList<AddittionalGetterSetter>();
|
ArrayList<AddittionalGetterSetter> listdata = new ArrayList<>();
|
||||||
ArrayList<AddittionalGetterSetter> listMain = new ArrayList<AddittionalGetterSetter>();
|
ArrayList<AddittionalGetterSetter> listMain = new ArrayList<AddittionalGetterSetter>();
|
||||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilityinsertSkuList;
|
ArrayList<AdditionalDialogGetterSetter> additionalVisibilityinsertSkuList;
|
||||||
@@ -226,22 +218,45 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
/// maintable
|
/// maintable
|
||||||
|
|
||||||
listMain = db.getAdditionalMainStock(store_id, categoryId);
|
listdata = db.getAdditionalMainStock(store_id, categoryId);
|
||||||
|
|
||||||
for (int k = 0; k < listMain.size(); k++) {
|
for (int k = 0; k < listdata.size(); k++) {
|
||||||
|
listdata.get(k).setSkuDialogList(db.getDialogStock(listdata.get(k).getKey_id()));
|
||||||
|
|
||||||
String tooglevalue = listMain.get(k).getBtn_toogle();
|
String tooglevalue = listdata.get(k).getBtn_toogle();
|
||||||
|
|
||||||
if (tooglevalue.equalsIgnoreCase("0")) {
|
/*if (tooglevalue.equalsIgnoreCase("0")) {
|
||||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||||
cardvew.setVisibility(View.INVISIBLE);
|
cardvew.setVisibility(View.INVISIBLE);
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
listviewlay.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
maincard.setVisibility(View.INVISIBLE);
|
||||||
btntoggle.setChecked(false);
|
btntoggle.setChecked(false);
|
||||||
brandlayout.setVisibility(View.GONE);
|
brandlayout.setVisibility(View.GONE);
|
||||||
diaplylayout.setVisibility(View.INVISIBLE);
|
diaplylayout.setVisibility(View.INVISIBLE);
|
||||||
cameralayout.setVisibility(View.INVISIBLE);
|
cameralayout.setVisibility(View.INVISIBLE);
|
||||||
btnsku.setVisibility(View.INVISIBLE);
|
btnsku.setVisibility(View.INVISIBLE);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (tooglevalue.equalsIgnoreCase("0")) {
|
||||||
|
listviewlay.setVisibility(View.INVISIBLE);
|
||||||
|
maincard.setVisibility(View.INVISIBLE);
|
||||||
|
cardvew.setVisibility(View.INVISIBLE);
|
||||||
|
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
btntoggle.setChecked(false);
|
||||||
|
brandlayout.setVisibility(View.GONE);
|
||||||
|
diaplylayout.setVisibility(View.INVISIBLE);
|
||||||
|
cameralayout.setVisibility(View.INVISIBLE);
|
||||||
|
btnsku.setVisibility(View.INVISIBLE);
|
||||||
|
} else {
|
||||||
|
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
|
listviewlay.setAdapter(adapteradditional);
|
||||||
|
listviewlay.invalidateViews();
|
||||||
|
btnaddlayout.setVisibility(View.VISIBLE);
|
||||||
|
cardvew.setVisibility(View.VISIBLE);
|
||||||
|
listviewlay.setVisibility(View.VISIBLE);
|
||||||
|
maincard.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* String KeyID = listdata.get(k).getKey_id();
|
/* String KeyID = listdata.get(k).getKey_id();
|
||||||
@@ -250,7 +265,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
/* listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
|
|
||||||
for (int k = 0; k < listdata.size(); k++) {
|
for (int k = 0; k < listdata.size(); k++) {
|
||||||
|
|
||||||
@@ -269,10 +284,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnsku.setVisibility(View.INVISIBLE);
|
btnsku.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
if (listdata.size() > 0) {
|
/*if (listdata.size() > 0) {
|
||||||
for (int i = 0; i < listdata.size(); i++) {
|
for (int i = 0; i < listdata.size(); i++) {
|
||||||
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
listviewlay.setVisibility(View.INVISIBLE);
|
||||||
@@ -290,7 +305,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -298,7 +313,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
if (togglevalue.equals("1")) {
|
if (togglevalue.equals("1")) {
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
//listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
|
|
||||||
if (listdata.size() > 0) {
|
if (listdata.size() > 0) {
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||||
@@ -314,7 +329,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
db.deleteStockEntryMainTable(store_id, categoryId);
|
db.deleteStockEntryMainTable(store_id, categoryId);
|
||||||
|
|
||||||
for (int J = 0; J < listdata.size(); J++) {
|
/*for (int J = 0; J < listdata.size(); J++) {
|
||||||
newadd = new AddittionalGetterSetter();
|
newadd = new AddittionalGetterSetter();
|
||||||
newadd.setBrand(listdata.get(J).getBrand_id());
|
newadd.setBrand(listdata.get(J).getBrand_id());
|
||||||
newadd.setBrand_id(listdata.get(J).getBrand_id());
|
newadd.setBrand_id(listdata.get(J).getBrand_id());
|
||||||
@@ -327,13 +342,16 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
newadd.setBtn_toogle(listdata.get(J).getBtn_toogle());
|
newadd.setBtn_toogle(listdata.get(J).getBtn_toogle());
|
||||||
newadd.setCategoryId(listdata.get(J).getCategoryId());
|
newadd.setCategoryId(listdata.get(J).getCategoryId());
|
||||||
String KeyID = listdata.get(J).getKey_id();
|
String KeyID = listdata.get(J).getKey_id();
|
||||||
additionalVisibilitySkuList = db.getDialogStock(KeyID);
|
|
||||||
|
|
||||||
db.InsertMainListAdditionalData(newadd, additionalVisibilitySkuList, categoryId);
|
//additionalVisibilitySkuList = db.getDialogStock(KeyID);
|
||||||
|
|
||||||
|
db.InsertMainListAdditionalData(listdata, additionalVisibilitySkuList, categoryId);
|
||||||
|
|
||||||
KeyID = "";
|
KeyID = "";
|
||||||
additionalVisibilitySkuList.clear();
|
additionalVisibilitySkuList.clear();
|
||||||
}
|
}*/
|
||||||
|
db.InsertMainListAdditionalData(listdata, categoryId);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -369,22 +387,25 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
|
||||||
db.deleteStockEntryall(store_id, categoryId);
|
db.deleteStockEntryMainTable(store_id, categoryId);
|
||||||
|
|
||||||
|
listdata.clear();
|
||||||
|
|
||||||
newadd = new AddittionalGetterSetter();
|
newadd = new AddittionalGetterSetter();
|
||||||
newadd.setBrand(brand_list_name);
|
newadd.setBrand("");
|
||||||
newadd.setBrand_id(brand_list_id);
|
newadd.setBrand_id("");
|
||||||
newadd.setImage(img_str1);
|
newadd.setImage("");
|
||||||
newadd.setImage2(img_str2);
|
newadd.setImage2("");
|
||||||
newadd.setImage3(img_str3);
|
newadd.setImage3("");
|
||||||
newadd.setSku(sku_list_name);
|
newadd.setSku("");
|
||||||
newadd.setSku_id(sku_list_id);
|
newadd.setSku_id("");
|
||||||
newadd.setStore_id(store_id);
|
newadd.setStore_id(store_id);
|
||||||
newadd.setBtn_toogle(togglevalue);
|
newadd.setBtn_toogle(togglevalue);
|
||||||
newadd.setCategoryId(categoryId);
|
newadd.setCategoryId(categoryId);
|
||||||
|
|
||||||
|
listdata.add(newadd);
|
||||||
|
|
||||||
db.InsertMainListAdditionalData(newadd, additionalVisibilitySkuList, categoryId);
|
db.InsertMainListAdditionalData(listdata, categoryId);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -425,7 +446,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
adGt.setBtn_toogle(togglevalue);
|
adGt.setBtn_toogle(togglevalue);
|
||||||
adGt.setCategoryId(categoryId);
|
adGt.setCategoryId(categoryId);
|
||||||
|
|
||||||
if (validateData(adGt, defdata)) {
|
adGt.setSkuDialogList(defdata);
|
||||||
|
|
||||||
|
if (validateData(adGt)) {
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||||
AdditionalVisibility.this);
|
AdditionalVisibility.this);
|
||||||
// set title
|
// set title
|
||||||
@@ -437,7 +460,11 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
db.InsertAdditionalData(adGt, defdata, categoryId);
|
// db.InsertAdditionalData(adGt, defdata, categoryId);
|
||||||
|
|
||||||
|
//Adding data to existing parent list
|
||||||
|
listdata.add(adGt);
|
||||||
|
|
||||||
spinner_brand_list.setSelection(0);
|
spinner_brand_list.setSelection(0);
|
||||||
spinner_sku_list.setSelection(0);
|
spinner_sku_list.setSelection(0);
|
||||||
img_str1 = "";
|
img_str1 = "";
|
||||||
@@ -449,16 +476,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
sku_list_id = "";
|
sku_list_id = "";
|
||||||
defdata.clear();
|
defdata.clear();
|
||||||
|
|
||||||
if(defdata.size()>0)
|
btnsku.setBackgroundResource(R.color.colorPrimary);
|
||||||
{
|
|
||||||
// btn_add.setBackgroundResource(Color);
|
|
||||||
btnsku.setBackgroundResource(R.color.green);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
btnsku.setBackgroundResource(R.color.colorPrimary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (camera_allow.equals("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
btnimage.setBackgroundResource(R.mipmap.camera_orange);
|
btnimage.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
@@ -474,7 +492,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
//listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
if (listdata.size() > 0) {
|
if (listdata.size() > 0) {
|
||||||
for (int i = 0; i < listdata.size(); i++) {
|
for (int i = 0; i < listdata.size(); i++) {
|
||||||
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
||||||
@@ -490,12 +508,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
cardvew.setVisibility(View.VISIBLE);
|
cardvew.setVisibility(View.VISIBLE);
|
||||||
listviewlay.setVisibility(View.VISIBLE);
|
listviewlay.setVisibility(View.VISIBLE);
|
||||||
maincard.setVisibility(View.VISIBLE);
|
maincard.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -525,9 +539,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (btntoggle.isChecked()) {
|
if (btntoggle.isChecked()) {
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
//listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
|
|
||||||
if (listdata.size() > 0) {
|
/*if (listdata.size() > 0) {
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||||
AdditionalVisibility.this);
|
AdditionalVisibility.this);
|
||||||
// set title
|
// set title
|
||||||
@@ -549,6 +563,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
cardvew.setVisibility(View.VISIBLE);
|
cardvew.setVisibility(View.VISIBLE);
|
||||||
listviewlay.setVisibility(View.VISIBLE);
|
listviewlay.setVisibility(View.VISIBLE);
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
maincard.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
|
|
||||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
@@ -628,11 +643,24 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
listdata.clear();
|
||||||
|
|
||||||
|
togglevalue = "1";
|
||||||
|
btntoggle.setChecked(true);
|
||||||
|
brandlayout.setVisibility(View.GONE);
|
||||||
|
diaplylayout.setVisibility(View.VISIBLE);
|
||||||
|
cameralayout.setVisibility(View.VISIBLE);
|
||||||
|
btnsku.setVisibility(View.VISIBLE);
|
||||||
|
btnaddlayout.setVisibility(View.VISIBLE);
|
||||||
|
cardvew.setVisibility(View.VISIBLE);
|
||||||
|
listviewlay.setVisibility(View.INVISIBLE);
|
||||||
|
maincard.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
//listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
|
|
||||||
if (listdata.size() > 0) {
|
if (listdata.size() > 0) {
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||||
@@ -646,22 +674,28 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
db.deleteStockEntryall(store_id, categoryId);
|
//db.deleteStockEntryall(store_id, categoryId);
|
||||||
togglevalue = "0";
|
/* togglevalue = "0";
|
||||||
btntoggle.setChecked(false);
|
btntoggle.setChecked(false);
|
||||||
|
*/
|
||||||
|
//clear both parent and child data lists
|
||||||
|
//defdata.clear();
|
||||||
|
listdata.clear();
|
||||||
|
|
||||||
defdata.clear();
|
/* btnaddlayout.setVisibility(View.INVISIBLE);
|
||||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
brandlayout.setVisibility(View.GONE);
|
||||||
diaplylayout.setVisibility(View.INVISIBLE);
|
diaplylayout.setVisibility(View.INVISIBLE);
|
||||||
cameralayout.setVisibility(View.INVISIBLE);
|
cameralayout.setVisibility(View.INVISIBLE);
|
||||||
btnsku.setVisibility(View.INVISIBLE);
|
btnsku.setVisibility(View.INVISIBLE);
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
maincard.setVisibility(View.INVISIBLE);*/
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
|
||||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
|
||||||
listviewlay.setAdapter(adapteradditional);
|
|
||||||
listviewlay.invalidateViews();
|
|
||||||
|
|
||||||
|
// listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
|
|
||||||
|
/* adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
|
listviewlay.setAdapter(adapteradditional);
|
||||||
|
listviewlay.invalidateViews();*/
|
||||||
|
|
||||||
|
adapteradditional.notifyDataSetChanged();
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -679,18 +713,20 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
// show it
|
// show it
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
} else {
|
|
||||||
togglevalue = "0";
|
|
||||||
defdata.clear();
|
|
||||||
btntoggle.setChecked(false);
|
|
||||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
|
||||||
diaplylayout.setVisibility(View.INVISIBLE);
|
|
||||||
cameralayout.setVisibility(View.INVISIBLE);
|
|
||||||
btnsku.setVisibility(View.INVISIBLE);
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
togglevalue = "0";
|
||||||
|
btntoggle.setChecked(false);
|
||||||
|
defdata.clear();
|
||||||
|
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||||
|
brandlayout.setVisibility(View.GONE);
|
||||||
|
diaplylayout.setVisibility(View.INVISIBLE);
|
||||||
|
cameralayout.setVisibility(View.INVISIBLE);
|
||||||
|
btnsku.setVisibility(View.INVISIBLE);
|
||||||
|
maincard.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -701,7 +737,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnimage.setOnClickListener(new View.OnClickListener() {
|
btnimage.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck1 = store_id +categoryId+ "AdditionalImage1" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + categoryId + "AdditionalImage1" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
_path = CommonString.FILE_PATH + _pathforcheck1;
|
||||||
intime = getCurrentTime();
|
intime = getCurrentTime();
|
||||||
@@ -713,7 +749,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnimage1.setOnClickListener(new View.OnClickListener() {
|
btnimage1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck2 = store_id +categoryId+ "AdditionalImage2" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + categoryId + "AdditionalImage2" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
_path = CommonString.FILE_PATH + _pathforcheck2;
|
||||||
intime = getCurrentTime();
|
intime = getCurrentTime();
|
||||||
@@ -725,7 +761,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnimage2.setOnClickListener(new View.OnClickListener() {
|
btnimage2.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck3 = store_id +categoryId+ "AdditionalImage3" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + categoryId + "AdditionalImage3" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck3;
|
_path = CommonString.FILE_PATH + _pathforcheck3;
|
||||||
intime = getCurrentTime();
|
intime = getCurrentTime();
|
||||||
@@ -746,7 +782,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
showSkuDialog();
|
showSkuDialog();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -995,18 +1030,18 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
//temp value in case camera is gallery app above jellybean
|
//temp value in case camera is gallery app above jellybean
|
||||||
String packag = list.get(n).loadLabel(packageManager).toString();
|
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") ||packag.equalsIgnoreCase("الاستوديو") ) {
|
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||||
gallery_package = list.get(n).packageName;
|
gallery_package = list.get(n).packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
break;
|
break;
|
||||||
@@ -1089,6 +1124,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
BrandMasterGetterSetter brand = new BrandMasterGetterSetter();
|
BrandMasterGetterSetter brand = new BrandMasterGetterSetter();
|
||||||
brand.setBRAND(getResources().getString(R.string.select));
|
brand.setBRAND(getResources().getString(R.string.select));
|
||||||
brandList.add(0, brand);
|
brandList.add(0, brand);
|
||||||
|
|
||||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||||
final Dialog dialog = new Dialog(AdditionalVisibility.this);
|
final Dialog dialog = new Dialog(AdditionalVisibility.this);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
@@ -1106,27 +1142,20 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
linearlay = (LinearLayout) dialog.findViewById(R.id.list_layout);
|
linearlay = (LinearLayout) dialog.findViewById(R.id.list_layout);
|
||||||
cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
||||||
|
|
||||||
|
|
||||||
//list = db.getDialogStock(store_id);
|
//list = db.getDialogStock(store_id);
|
||||||
|
|
||||||
|
|
||||||
if (defdata.size() > 0) {
|
if (defdata.size() > 0) {
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
cardlay.setVisibility(View.VISIBLE);
|
cardlay.setVisibility(View.VISIBLE);
|
||||||
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
|
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
|
||||||
listview.setAdapter(adapterData);
|
listview.setAdapter(adapterData);
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
linearlay.setVisibility(View.INVISIBLE);
|
linearlay.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
cardlay.setVisibility(View.INVISIBLE);
|
cardlay.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
spinner_sku.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinner_sku.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
@@ -1150,19 +1179,15 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btn_close.setOnClickListener(new View.OnClickListener() {
|
btn_close.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
|
|
||||||
if(defdata.size()>0)
|
if (defdata.size() > 0) {
|
||||||
{
|
|
||||||
// btn_add.setBackgroundResource(Color);
|
// btn_add.setBackgroundResource(Color);
|
||||||
btnsku.setBackgroundResource(R.color.green);
|
btnsku.setBackgroundResource(R.color.green);
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
btnsku.setBackgroundResource(R.color.colorPrimary);
|
btnsku.setBackgroundResource(R.color.colorPrimary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1172,10 +1197,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
AdditionalDialogGetterSetter ab = new AdditionalDialogGetterSetter();
|
AdditionalDialogGetterSetter ab = new AdditionalDialogGetterSetter();
|
||||||
|
|
||||||
|
|
||||||
ab.setBrand(brand_name);
|
ab.setBrand(brand_name);
|
||||||
ab.setBrand_id(brand_id);
|
ab.setBrand_id(brand_id);
|
||||||
|
|
||||||
//ab.setDisplay_id(data.get(position).getDisplay_id());
|
//ab.setDisplay_id(data.get(position).getDisplay_id());
|
||||||
ab.setStore_id(store_id);
|
ab.setStore_id(store_id);
|
||||||
// ab.setUnique_id(data.get(position).getUnique_id());
|
// ab.setUnique_id(data.get(position).getUnique_id());
|
||||||
@@ -1186,30 +1209,24 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
// ab.setCategory_id(category_id);
|
// ab.setCategory_id(category_id);
|
||||||
|
|
||||||
if (validateDialogData(ab)) {
|
if (validateDialogData(ab)) {
|
||||||
|
|
||||||
|
|
||||||
defdata.add(ab);
|
defdata.add(ab);
|
||||||
// db.InsertStockDialog(ab);
|
// db.InsertStockDialog(ab);
|
||||||
|
|
||||||
// spinner_brand.setSelection(0);
|
// spinner_brand.setSelection(0);
|
||||||
spinner_sku.setSelection(0);
|
spinner_sku.setSelection(0);
|
||||||
Edt_txt.setText("");
|
Edt_txt.setText("");
|
||||||
SKU_ID="";
|
SKU_ID = "";
|
||||||
SKU_name="";
|
SKU_name = "";
|
||||||
|
|
||||||
// list = db.getDialogStock(store_id);
|
// list = db.getDialogStock(store_id);
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
cardlay.setVisibility(View.VISIBLE);
|
cardlay.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
|
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
|
||||||
listview.setAdapter(adapterData);
|
listview.setAdapter(adapterData);
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(v, msg, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, msg, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// dialog.cancel();
|
// dialog.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1246,7 +1263,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
spinner_sku.setAdapter(skuadapter);
|
spinner_sku.setAdapter(skuadapter);
|
||||||
|
|
||||||
spinner_sku.setSelection(0);
|
spinner_sku.setSelection(0);
|
||||||
SKU_ID="";
|
SKU_ID = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1258,12 +1275,11 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if(defdata.size()>0)
|
if (defdata.size() > 0) {
|
||||||
{
|
|
||||||
// btn_add.setBackgroundResource(Color);
|
// btn_add.setBackgroundResource(Color);
|
||||||
btnsku.setBackgroundResource(R.color.green);
|
btnsku.setBackgroundResource(R.color.green);
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
btnsku.setBackgroundResource(R.color.colorPrimary);
|
btnsku.setBackgroundResource(R.color.colorPrimary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1278,10 +1294,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
SKU_name = sku_list.get(position).getSKU();
|
SKU_name = sku_list.get(position).getSKU();
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else{
|
SKU_ID = "";
|
||||||
SKU_ID="";
|
SKU_name = "";
|
||||||
SKU_name="";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1330,7 +1345,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
private ArrayList<AdditionalDialogGetterSetter> list;
|
private ArrayList<AdditionalDialogGetterSetter> list;
|
||||||
|
|
||||||
public MyAdaptorStock(Activity activity, ArrayList<AdditionalDialogGetterSetter> list1) {
|
public MyAdaptorStock(Activity activity, ArrayList<AdditionalDialogGetterSetter> list1) {
|
||||||
|
|
||||||
mInflater = LayoutInflater.from(getBaseContext());
|
mInflater = LayoutInflater.from(getBaseContext());
|
||||||
mcontext = activity;
|
mcontext = activity;
|
||||||
list = list1;
|
list = list1;
|
||||||
@@ -1362,42 +1376,31 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(final int position1, View convertView, ViewGroup parent) {
|
public View getView(final int position1, View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
final ViewHolder holder;
|
final ViewHolder holder;
|
||||||
|
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
|
|
||||||
convertView = mInflater
|
convertView = mInflater.inflate(R.layout.additionaldialoglayout, null);
|
||||||
.inflate(R.layout.additionaldialoglayout, null);
|
|
||||||
holder = new ViewHolder();
|
holder = new ViewHolder();
|
||||||
|
|
||||||
holder.brand = (TextView) convertView.findViewById(R.id.brand_name);
|
holder.brand = (TextView) convertView.findViewById(R.id.brand_name);
|
||||||
|
|
||||||
holder.display = (TextView) convertView.findViewById(R.id.display_name);
|
holder.display = (TextView) convertView.findViewById(R.id.display_name);
|
||||||
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
||||||
|
|
||||||
|
|
||||||
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
||||||
|
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
} else {
|
} else {
|
||||||
holder = (ViewHolder) convertView.getTag();
|
holder = (ViewHolder) convertView.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.delete.setOnClickListener(new View.OnClickListener() {
|
holder.delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdditionalVisibility.this);
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
|
||||||
AdditionalVisibility.this);
|
|
||||||
|
|
||||||
// set title
|
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
|
||||||
// set dialog message
|
// set dialog message
|
||||||
alertDialogBuilder
|
alertDialogBuilder.setMessage(getResources().getString(R.string.data_will_be_lost))
|
||||||
.setMessage(getResources().getString(R.string.data_will_be_lost))
|
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
@@ -1405,18 +1408,14 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
// db.deletedialogStockEntry(list.get(position1).getKEY_ID());
|
// db.deletedialogStockEntry(list.get(position1).getKEY_ID());
|
||||||
|
|
||||||
defdata.remove(position1);
|
defdata.remove(position1);
|
||||||
|
|
||||||
adapterData.notifyDataSetChanged();
|
adapterData.notifyDataSetChanged();
|
||||||
|
|
||||||
/* list = db.getTOTStockEntryDetail(store_id, category_id, process_id,
|
/* list = db.getTOTStockEntryDetail(store_id, category_id, process_id,
|
||||||
list.get(position1).getDisplay_id(),list.get(position1).getUnique_id());*/
|
list.get(position1).getDisplay_id(),list.get(position1).getUnique_id());*/
|
||||||
|
|
||||||
|
|
||||||
//list = db.getDialogStock(store_id);
|
//list = db.getDialogStock(store_id);
|
||||||
|
|
||||||
listview.setAdapter(new MyAdaptorStock(AdditionalVisibility.this, defdata));
|
//listview.setAdapter(new MyAdaptorStock(AdditionalVisibility.this, defdata));
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
@@ -1519,10 +1518,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdditionalVisibility.this);
|
||||||
AdditionalVisibility.this);
|
|
||||||
|
|
||||||
// set title
|
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
|
||||||
// set dialog message
|
// set dialog message
|
||||||
@@ -1532,18 +1528,20 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
db.deleteStockEntry(listdata.get(position1).getKey_id());
|
//db.deleteStockEntry(listdata.get(position1).getKey_id());
|
||||||
|
|
||||||
|
|
||||||
|
listdata.remove(position1);
|
||||||
adapteradditional.notifyDataSetChanged();
|
adapteradditional.notifyDataSetChanged();
|
||||||
|
listviewlay.invalidateViews();
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
/*listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
|
|
||||||
|
|
||||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
listviewlay.setAdapter(adapteradditional);
|
listviewlay.setAdapter(adapteradditional);
|
||||||
|
|
||||||
listviewlay.invalidateViews();
|
listviewlay.invalidateViews();*/
|
||||||
|
|
||||||
|
|
||||||
if (listdata.size() > 0) {
|
if (listdata.size() > 0) {
|
||||||
|
|
||||||
@@ -1570,25 +1568,18 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
})
|
})
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
// if this button is clicked, just close
|
|
||||||
// the dialog box and do nothing
|
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// create alert dialog
|
// create alert dialog
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
// show it
|
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
holder.brand.setText(list.get(position1).getBrand().toString());
|
holder.brand.setText(list.get(position1).getBrand().toString());
|
||||||
holder.display.setText(list.get(position1).getSku().toString());
|
holder.display.setText(list.get(position1).getSku().toString());
|
||||||
|
|
||||||
|
|
||||||
holder.brand.setId(position1);
|
holder.brand.setId(position1);
|
||||||
holder.display.setId(position1);
|
holder.display.setId(position1);
|
||||||
holder.qty_bought.setId(position1);
|
holder.qty_bought.setId(position1);
|
||||||
@@ -1598,7 +1589,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean validateData(AddittionalGetterSetter data, ArrayList<AdditionalDialogGetterSetter> dialog) {
|
boolean validateData(AddittionalGetterSetter data) {
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
String brandid = data.getBrand_id();
|
String brandid = data.getBrand_id();
|
||||||
@@ -1606,7 +1597,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
String imageu = data.getImage();
|
String imageu = data.getImage();
|
||||||
String toggleid = data.getBtn_toogle();
|
String toggleid = data.getBtn_toogle();
|
||||||
|
ArrayList<AdditionalDialogGetterSetter> skuList = data.getSkuDialogList();
|
||||||
|
|
||||||
if (toggleid.equalsIgnoreCase("0")) {
|
if (toggleid.equalsIgnoreCase("0")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
@@ -1623,12 +1614,12 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
errormsg = getResources().getString(R.string.title_activity_take_image);
|
errormsg = getResources().getString(R.string.title_activity_take_image);
|
||||||
|
|
||||||
} else if (dialog.size() == 0) {
|
} else if (skuList.size() == 0) {
|
||||||
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (dialog.size() == 0) {
|
} else if (skuList.size() == 0) {
|
||||||
|
|
||||||
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
||||||
flag = false;
|
flag = false;
|
||||||
@@ -1678,9 +1669,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+18
-3
@@ -107,7 +107,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
//MSL_Availability
|
//MSL_Availability
|
||||||
if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
/*if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
@@ -120,6 +120,13 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
//New MSL_Availability_StockFacing
|
||||||
|
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||||
|
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Promo Compliance
|
//Promo Compliance
|
||||||
@@ -279,7 +286,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||||
}else{
|
} else {
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +325,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||||
//boolean flag = true;
|
//boolean flag = true;
|
||||||
|
|
||||||
if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
/*if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
@@ -331,6 +338,14 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
//New MSL_Availability_StockFacing
|
||||||
|
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||||
|
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
||||||
|
flag_filled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (db.isMappingPromotionData(store_id, category_id)) {
|
if (db.isMappingPromotionData(store_id, category_id)) {
|
||||||
|
|||||||
+57
-43
@@ -41,7 +41,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String categoryName = "", categoryId;
|
String categoryName = "", categoryId;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id,camera_allow;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -105,8 +105,21 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
categoryList = new ArrayList<>();
|
categoryList = new ArrayList<>();
|
||||||
|
|
||||||
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
||||||
//data.setCategory_name("MSL Availability");
|
data = new DailyDataMenuGetterSetter();
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
||||||
|
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||||
|
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||||
|
}
|
||||||
|
categoryList.add(data);
|
||||||
|
|
||||||
|
|
||||||
|
/*data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
||||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||||
if (db.checkMsl_AvailabilityData(store_id, categoryId)) {
|
if (db.checkMsl_AvailabilityData(store_id, categoryId)) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
@@ -118,6 +131,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
|
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
//data.setCategory_name("Stock & Facing");
|
//data.setCategory_name("Stock & Facing");
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||||
@@ -130,12 +144,11 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.stockandfacing_grey);
|
data.setCategory_img(R.mipmap.stockandfacing_grey);
|
||||||
}
|
}
|
||||||
categoryList.add(data);
|
categoryList.add(data);*/
|
||||||
|
|
||||||
//T2p
|
//T2p
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
||||||
|
|
||||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||||
if (db.isFilledT2P(store_id, categoryId)) {
|
if (db.isFilledT2P(store_id, categoryId)) {
|
||||||
data.setCategory_img(R.mipmap.t2p_compliance_done);
|
data.setCategory_img(R.mipmap.t2p_compliance_done);
|
||||||
@@ -145,25 +158,22 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.t2pcompliance_grey);
|
data.setCategory_img(R.mipmap.t2pcompliance_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
//T2p added
|
|
||||||
|
|
||||||
|
|
||||||
|
//T2p added
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
//data.setCategory_name("Additional Visibility");
|
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||||
data.setCategory_img(R.mipmap.additional_visibility_done);
|
data.setCategory_img(R.mipmap.additional_visibility_done);
|
||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.additional_visibility);
|
data.setCategory_img(R.mipmap.additional_visibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
data = new DailyDataMenuGetterSetter();
|
|
||||||
//data.setCategory_name("Promo Compliance");
|
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
|
||||||
|
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
||||||
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
||||||
if (db.checkPromoComplianceData(store_id, categoryId) ||
|
if (db.checkPromoComplianceData(store_id, categoryId) ||
|
||||||
db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
||||||
@@ -178,26 +188,22 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
|
|
||||||
//Category Pictures
|
//Category Pictures
|
||||||
|
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
//data.setCategory_name("Additional Visibility");
|
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_category_picture));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_category_picture));
|
||||||
|
if (camera_allow.equalsIgnoreCase("1")) {
|
||||||
if(camera_allow.equalsIgnoreCase("1")){
|
if (db.isCategoryPictureData(store_id, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||||
if (db.isCategoryPictureData(store_id, categoryId)) {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.picturecatogory_done);
|
data.setCategory_img(R.mipmap.picturecatogory);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.picturecatogory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*data = new DailyDataMenuGetterSetter();
|
/*data = new DailyDataMenuGetterSetter();
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_competition_tracking));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_competition_tracking));
|
||||||
//data.setCategory_name("Competition Tracking");
|
//data.setCategory_name("Competition Tracking");
|
||||||
@@ -270,7 +276,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
holder.categoryName.setText(dailyData.getCategory_name());
|
holder.categoryName.setText(dailyData.getCategory_name());
|
||||||
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
||||||
|
|
||||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
/*if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
} else {
|
} else {
|
||||||
@@ -282,7 +288,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
} else*/
|
||||||
|
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||||
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
} else {
|
} else {
|
||||||
@@ -294,29 +301,32 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
|
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
||||||
}
|
if (camera_allow.equalsIgnoreCase("1")) {
|
||||||
|
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
} else {
|
||||||
if(camera_allow.equalsIgnoreCase("1")){
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
|
}
|
||||||
|
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||||
|
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
/*if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_AvailabilityActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_AvailabilityActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, Stock_FacingActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, Stock_FacingActivity.class);
|
||||||
@@ -324,14 +334,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
|
||||||
|
|
||||||
|
} else */
|
||||||
|
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||||
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
if (db.isMappingPromotionData(store_id, categoryId) || db.isMappingAdditionalPromotionData(store_id, categoryId)) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, PromoComplianceActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, PromoComplianceActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))) {
|
||||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, T2PComplianceActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, T2PComplianceActivity.class);
|
||||||
@@ -340,6 +352,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_activity_Additional_visibility)))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_activity_Additional_visibility)))) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalVisibility.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalVisibility.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
@@ -347,22 +360,23 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
}
|
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
||||||
else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
if (camera_allow.equalsIgnoreCase("1")) {
|
||||||
|
|
||||||
if(camera_allow.equalsIgnoreCase("1")){
|
|
||||||
|
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, CategoryPicture.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, CategoryPicture.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} /*else {
|
||||||
|
}*/
|
||||||
|
|
||||||
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||||
|
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_Availability_StockFacingActivity.class);
|
||||||
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
|
intent.putExtra("categoryId", categoryId);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,7 +428,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||||
}else{
|
} else {
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+922
@@ -0,0 +1,922 @@
|
|||||||
|
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.CardView;
|
||||||
|
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.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.AbsListView;
|
||||||
|
import android.widget.BaseExpandableListAdapter;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ExpandableListView;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
|
|
||||||
|
public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||||
|
ExpandableListView expandableListView;
|
||||||
|
TextView txt_mslAvailabilityName;
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList;
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||||
|
|
||||||
|
List<Integer> checkHeaderArray = new ArrayList<>();
|
||||||
|
boolean checkflag = true;
|
||||||
|
|
||||||
|
ExpandableListAdapter adapter;
|
||||||
|
ImageView camera1, camera2, camera3, camera4;
|
||||||
|
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
||||||
|
|
||||||
|
GSKOrangeDB db;
|
||||||
|
|
||||||
|
String categoryName, categoryId, storeId, Error_Message = "";
|
||||||
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
|
||||||
|
boolean isDialogOpen = true;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
||||||
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||||
|
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
try {
|
||||||
|
setContentView(R.layout.activity_msl__availability_stock_facing);
|
||||||
|
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
|
||||||
|
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||||
|
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
||||||
|
|
||||||
|
camera1 = (ImageView) findViewById(R.id.img_camera1);
|
||||||
|
camera2 = (ImageView) findViewById(R.id.img_camera2);
|
||||||
|
camera3 = (ImageView) findViewById(R.id.img_camera3);
|
||||||
|
camera4 = (ImageView) findViewById(R.id.img_camera4);
|
||||||
|
|
||||||
|
lin_camera1 = (LinearLayout) findViewById(R.id.lin_camera1);
|
||||||
|
lin_camera2 = (LinearLayout) findViewById(R.id.lin_camera2);
|
||||||
|
lin_camera3 = (LinearLayout) findViewById(R.id.lin_camera3);
|
||||||
|
lin_camera4 = (LinearLayout) findViewById(R.id.lin_camera4);
|
||||||
|
|
||||||
|
db = new GSKOrangeDB(this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
|
||||||
|
//preference data
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||||
|
|
||||||
|
//Intent data
|
||||||
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
|
||||||
|
//txt_mslAvailabilityName.setText(getResources().getString(R.string.title_activity_msl__availability));
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.title_activity_msl__availability));
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
prepareList();
|
||||||
|
|
||||||
|
//Camera
|
||||||
|
prepareDefaultList();
|
||||||
|
|
||||||
|
cameraMethod();
|
||||||
|
|
||||||
|
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(final View view) {
|
||||||
|
|
||||||
|
if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setMessage(getResources().getString(R.string.check_save_message))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||||
|
db.updateMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(view, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
db.InsertMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(view, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
} else {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setMessage(Error_Message)
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
|
@Override
|
||||||
|
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||||
|
int lastItem = firstVisibleItem + visibleItemCount;
|
||||||
|
|
||||||
|
if (firstVisibleItem == 0) {
|
||||||
|
fab.setVisibility(View.VISIBLE);
|
||||||
|
} else if (lastItem == totalItemCount) {
|
||||||
|
fab.setVisibility(View.INVISIBLE);
|
||||||
|
} else {
|
||||||
|
fab.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrollStateChanged(AbsListView arg0, int arg1) {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
//expandableListView.invalidateViews();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group click listener
|
||||||
|
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group expanded listener
|
||||||
|
expandableListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
||||||
|
@Override
|
||||||
|
public void onGroupExpand(int groupPosition) {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getWindow().getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group collasped listener
|
||||||
|
expandableListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
|
||||||
|
@Override
|
||||||
|
public void onGroupCollapse(int groupPosition) {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getWindow().getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview on child click listener
|
||||||
|
expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
|
||||||
|
int childPosition, long id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Resources.NotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cameraMethod() {
|
||||||
|
/*cameraData = new Store_wise_camera_DataGetterSetter();
|
||||||
|
|
||||||
|
if (db.isStorewiseCameraSave(store_id, categoryId)) {
|
||||||
|
cameraData = db.getStore_wise_camera(store_id, categoryId);
|
||||||
|
} else {
|
||||||
|
cameraData.setStore_id(store_id);
|
||||||
|
cameraData.setCategory_id(categoryId);
|
||||||
|
cameraData.setCamera1("");
|
||||||
|
cameraData.setCamera2("");
|
||||||
|
cameraData.setCamera3("");
|
||||||
|
cameraData.setCamera4("");
|
||||||
|
cameraData.setCheckSaveStatus("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (camera_allow.equals("1")) {
|
||||||
|
|
||||||
|
findViewById(R.id.view_camera2).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.view_camera3).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
if (cameraData.getCamera1().equals("")) {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
|
} else {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cameraData.getCamera2().equals("")) {
|
||||||
|
camera2.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
|
} else {
|
||||||
|
camera2.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cameraData.getCamera3().equals("")) {
|
||||||
|
camera3.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
|
} else {
|
||||||
|
camera3.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cameraData.getCamera4().equals("")) {
|
||||||
|
camera4.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
|
} else {
|
||||||
|
camera4.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lin_camera1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
_pathforcheck = "Stock_Camera1_" + store_id + "_" + categoryId
|
||||||
|
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
|
startCameraActivity(3);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lin_camera2.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
_pathforcheck = "Stock_Camera2_" + store_id + "_" + categoryId
|
||||||
|
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
|
startCameraActivity(4);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lin_camera3.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
_pathforcheck = "Stock_Camera3_" + store_id + "_" + categoryId
|
||||||
|
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
|
startCameraActivity(5);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lin_camera4.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
_pathforcheck = "Stock_Camera4_" + store_id + "_" + categoryId
|
||||||
|
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
|
startCameraActivity(6);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {*/
|
||||||
|
|
||||||
|
if (!camera_allow.equals("1")) {
|
||||||
|
findViewById(R.id.lin_camera).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
findViewById(R.id.view_camera2).setVisibility(View.GONE);
|
||||||
|
findViewById(R.id.view_camera3).setVisibility(View.GONE);
|
||||||
|
|
||||||
|
lin_camera2.setVisibility(View.GONE);
|
||||||
|
lin_camera3.setVisibility(View.GONE);
|
||||||
|
lin_camera4.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (db.isPlanogramAddShelfSaveData(store_id, categoryId)) {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
|
||||||
|
} else {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.new_no_camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
lin_camera1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Intent intent = new Intent(MSL_Availability_StockFacingActivity.this,
|
||||||
|
StockFacing_PlanogramTrackerActivity.class);
|
||||||
|
|
||||||
|
intent.putExtra("storeId", store_id);
|
||||||
|
intent.putExtra("keyAccount_id", keyAccount_id);
|
||||||
|
intent.putExtra("class_id", class_id);
|
||||||
|
intent.putExtra("storeType_id", storeType_id);
|
||||||
|
intent.putExtra("categoryId", categoryId);
|
||||||
|
intent.putExtra("categoryName", categoryName);
|
||||||
|
|
||||||
|
startActivityForResult(intent, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
findViewById(R.id.lin_camera).setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Planogram List for check and delete on backPress
|
||||||
|
private void prepareDefaultList() {
|
||||||
|
// Planogram After save shelf header data
|
||||||
|
planogramShelfHeaderDataList = db.getPlanogramAddShelfHeaderAfterSaveData(store_id, categoryId);
|
||||||
|
|
||||||
|
if (planogramShelfHeaderDataList.size() > 0) {
|
||||||
|
|
||||||
|
for (int i = 0; i < planogramShelfHeaderDataList.size(); i++) {
|
||||||
|
planogramSkuChildDataList = db.getStockAndFacingPlanogramAfterSKUData(planogramShelfHeaderDataList.get(i).getKey_id());
|
||||||
|
|
||||||
|
//After save sku child data
|
||||||
|
if (planogramSkuChildDataList.size() > 0) {
|
||||||
|
planogramHashMapListChildData.put(planogramShelfHeaderDataList.get(i), planogramSkuChildDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void prepareList() {
|
||||||
|
try {
|
||||||
|
hashMapListHeaderData = new ArrayList<>();
|
||||||
|
hashMapListChildData = new HashMap<>();
|
||||||
|
|
||||||
|
//Header
|
||||||
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id);
|
||||||
|
|
||||||
|
if (headerDataList.size() > 0) {
|
||||||
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
|
|
||||||
|
//childDataList = new ArrayList<>();
|
||||||
|
childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||||
|
if (!(childDataList.size() > 0)) {
|
||||||
|
childDataList = db.getMSL_Availability_StockFacingSKUData(categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
expandableListView.setAdapter(adapter);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean validateData(List<MSL_AvailabilityStockFacingGetterSetter> listDataHeader,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listDataChild) {
|
||||||
|
boolean flag = true;
|
||||||
|
checkHeaderArray.clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < listDataHeader.size(); i++) {
|
||||||
|
|
||||||
|
for (int j = 0; j < listDataChild.get(listDataHeader.get(i)).size(); j++) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter data = listDataChild.get(listDataHeader.get(i)).get(j);
|
||||||
|
|
||||||
|
String stock = data.getStock();
|
||||||
|
String faceup = data.getFacing();
|
||||||
|
|
||||||
|
//Company_id
|
||||||
|
if (listDataChild.get(listDataHeader.get(i)).get(j).getCompany_id().equals("1")) {
|
||||||
|
|
||||||
|
if (!camera_allow.equalsIgnoreCase("1")) {
|
||||||
|
if (!(planogramShelfHeaderDataList.size() > 0)) {
|
||||||
|
flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.stock_planogram_data_noCamera_data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (faceup.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.faceup_value);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
if (data.getToggleValue().equals("0")) {
|
||||||
|
|
||||||
|
if (stock.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.stock_value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (faceup.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.faceup_value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag == false) {
|
||||||
|
checkflag = false;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
checkflag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
return checkflag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
if (!validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
|
if (!camera_allow.equals("1")) {
|
||||||
|
db.deletePlanogramListStoreAndCategorywise(store_id, categoryId,
|
||||||
|
planogramShelfHeaderDataList, planogramHashMapListChildData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
//finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
//super.onBackPressed();
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
if (!validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
|
|
||||||
|
if (!camera_allow.equals("1")) {
|
||||||
|
db.deletePlanogramListStoreAndCategorywise(store_id, categoryId,
|
||||||
|
planogramShelfHeaderDataList, planogramHashMapListChildData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||||
|
private Context _context;
|
||||||
|
private List<MSL_AvailabilityStockFacingGetterSetter> _listDataHeader;
|
||||||
|
private HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> _listDataChild;
|
||||||
|
|
||||||
|
public ExpandableListAdapter(Context context, List<MSL_AvailabilityStockFacingGetterSetter> listDataHeader,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listChildData) {
|
||||||
|
this._context = context;
|
||||||
|
this._listDataHeader = listDataHeader;
|
||||||
|
this._listDataChild = listChildData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getGroup(int groupPosition) {
|
||||||
|
return this._listDataHeader.get(groupPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getGroupCount() {
|
||||||
|
return this._listDataHeader.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getGroupId(int groupPosition) {
|
||||||
|
return groupPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter headerTitle = (MSL_AvailabilityStockFacingGetterSetter) getGroup(groupPosition);
|
||||||
|
|
||||||
|
if (convertView == null) {
|
||||||
|
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
convertView = infalInflater.inflate(R.layout.item_msl_availability_stock_facing_header, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView txt_categoryHeader = (TextView) convertView.findViewById(R.id.txt_categoryHeader);
|
||||||
|
RelativeLayout rel_header = (RelativeLayout) convertView.findViewById(R.id.rel_categoryHeader);
|
||||||
|
ImageView img_camera = (ImageView) convertView.findViewById(R.id.img_camera);
|
||||||
|
|
||||||
|
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||||
|
|
||||||
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
|
} else {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
||||||
|
|
||||||
|
|
||||||
|
//empty check color change
|
||||||
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
|
if (!checkflag) {
|
||||||
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!checkflag) {
|
||||||
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getChild(int groupPosition, int childPosititon) {
|
||||||
|
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).get(childPosititon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getChildrenCount(int groupPosition) {
|
||||||
|
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getChildId(int groupPosition, int childPosition) {
|
||||||
|
return childPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,
|
||||||
|
View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
|
final MSL_AvailabilityStockFacingGetterSetter childData =
|
||||||
|
(MSL_AvailabilityStockFacingGetterSetter) getChild(groupPosition, childPosition);
|
||||||
|
ViewHolder holder = null;
|
||||||
|
|
||||||
|
if (convertView == null) {
|
||||||
|
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
convertView = infalInflater.inflate(R.layout.item_msl_availability_stock_facing_child, null, false);
|
||||||
|
|
||||||
|
holder = new ViewHolder();
|
||||||
|
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
||||||
|
holder.lin_category = (LinearLayout) convertView.findViewById(R.id.lin_category);
|
||||||
|
|
||||||
|
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
||||||
|
holder.txt_mbq = (TextView) convertView.findViewById(R.id.txt_mbq);
|
||||||
|
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
|
||||||
|
|
||||||
|
holder.facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
||||||
|
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
||||||
|
|
||||||
|
convertView.setTag(holder);
|
||||||
|
} else {
|
||||||
|
holder = (ViewHolder) convertView.getTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.txt_skuName.setText(childData.getSku());
|
||||||
|
holder.txt_mbq.setText(childData.getMbq());
|
||||||
|
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
holder.txt_mbq.setVisibility(View.VISIBLE);
|
||||||
|
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||||
|
holder.facing.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
if (childData.getToggleValue().equals("1")) {
|
||||||
|
holder.stock.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
holder.stock.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
holder.txt_mbq.setVisibility(View.GONE);
|
||||||
|
holder.toggle_available.setVisibility(View.GONE);
|
||||||
|
holder.facing.setVisibility(View.VISIBLE);
|
||||||
|
holder.stock.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ViewHolder finalHolder = holder;
|
||||||
|
holder.toggle_available.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked) {
|
||||||
|
childData.setToggleValue("1");
|
||||||
|
finalHolder.stock.setVisibility(View.GONE);
|
||||||
|
childData.setStock("");
|
||||||
|
} else {
|
||||||
|
childData.setToggleValue("0");
|
||||||
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
expandableListView.invalidateViews();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (childData.getToggleValue().equals("1")) {
|
||||||
|
holder.toggle_available.setChecked(true);
|
||||||
|
finalHolder.stock.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
holder.toggle_available.setChecked(false);
|
||||||
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
final EditText caption = (EditText) v;
|
||||||
|
final String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
if (!edFaceup.equals("")) {
|
||||||
|
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||||
|
childData.setFacing(faceup);
|
||||||
|
} else {
|
||||||
|
childData.setFacing("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.facing.setText(childData.getFacing());
|
||||||
|
|
||||||
|
|
||||||
|
holder.stock.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
final EditText caption = (EditText) v;
|
||||||
|
String edStock = caption.getText().toString();
|
||||||
|
|
||||||
|
if (!edStock.equals("")) {
|
||||||
|
String stock = edStock.replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
if (Integer.parseInt(stock) >= 0 && Integer.parseInt(stock) < Integer.parseInt(childData.getMbq())) {
|
||||||
|
childData.setStock(stock);
|
||||||
|
} else {
|
||||||
|
if (isDialogOpen) {
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_stock))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.dismiss();
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
childData.setStock("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.stock.setText(childData.getStock());
|
||||||
|
|
||||||
|
|
||||||
|
//empty check color change
|
||||||
|
if (!checkflag) {
|
||||||
|
boolean tempflag = false;
|
||||||
|
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
|
if (childData.getToggleValue().equals("0")) {
|
||||||
|
if (holder.stock.getText().toString().equals("")) {
|
||||||
|
holder.stock.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.stock.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (holder.facing.getText().toString().equals("")) {
|
||||||
|
holder.facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.facing.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (holder.facing.getText().toString().equals("")) {
|
||||||
|
holder.facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.facing.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempflag) {
|
||||||
|
holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (holder.facing.getText().toString().equals("")) {
|
||||||
|
holder.facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.facing.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempflag) {
|
||||||
|
holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasStableIds() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isChildSelectable(int groupPosition, int childPosition) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHolder {
|
||||||
|
CardView cardView;
|
||||||
|
TextView txt_skuName, txt_mbq;
|
||||||
|
ToggleButton toggle_available;
|
||||||
|
LinearLayout lin_category;
|
||||||
|
EditText facing, stock;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
|
||||||
|
/*String lang;
|
||||||
|
|
||||||
|
if (language.equalsIgnoreCase("English")) {
|
||||||
|
lang = "EN";
|
||||||
|
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
||||||
|
lang = "AR";
|
||||||
|
} else {
|
||||||
|
lang = "TR";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
String lang;
|
||||||
|
|
||||||
|
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
||||||
|
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
||||||
|
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||||
|
} else {
|
||||||
|
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
Locale locale = new Locale(lang);
|
||||||
|
Locale.setDefault(locale);
|
||||||
|
|
||||||
|
Resources resources = context.getResources();
|
||||||
|
|
||||||
|
Configuration configuration = resources.getConfiguration();
|
||||||
|
configuration.locale = locale;
|
||||||
|
|
||||||
|
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("LongLogTag")
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
Log.e("MSL_AVailability_StockFacing", "resultCode: " + resultCode);
|
||||||
|
|
||||||
|
switch (requestCode) {
|
||||||
|
case 100:
|
||||||
|
//Planogram List for check and delete on backPress
|
||||||
|
prepareDefaultList();
|
||||||
|
if (db.isPlanogramAddShelfSaveData(store_id, categoryId)) {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
|
||||||
|
} else {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.new_no_camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,6 +47,7 @@ import cpm.com.gskmtorange.constant.CommonString;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
@@ -73,6 +74,8 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
ArrayList<T2PGetterSetter> t2PGetterSetters;
|
ArrayList<T2PGetterSetter> t2PGetterSetters;
|
||||||
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
||||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
||||||
|
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
private TextView percentage, message;
|
private TextView percentage, message;
|
||||||
@@ -354,6 +357,73 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//MSL_Availability_StockFacing
|
||||||
|
String mslAvailability_stockFacing_xml = "";
|
||||||
|
onXML = "";
|
||||||
|
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
|
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||||
|
|
||||||
|
String stock;
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
||||||
|
stock = msl_availabilityStockFacingList.get(j).getStock();
|
||||||
|
} else {
|
||||||
|
stock = "0";
|
||||||
|
}
|
||||||
|
onXML = "[MSL_AVAILABILITY_STOCK_FACING_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
//+ "[CATEGORY_ID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getCategory_id()) + "[/CATEGORY_ID]"
|
||||||
|
//+ "[BRAND_ID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getBrand_id()) + "[/BRAND_ID]"
|
||||||
|
+ "[SKU_ID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SKU_ID]"
|
||||||
|
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||||
|
+ "[AVAILABILITY]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVAILABILITY]"
|
||||||
|
+ "[FACING]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FACING]"
|
||||||
|
+ "[STOCK]" + Integer.parseInt(stock) + "[/STOCK]" +
|
||||||
|
"[/MSL_AVAILABILITY_STOCK_FACING_DATA]";
|
||||||
|
|
||||||
|
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "MSL_AVAILABILITY_STOCK_FACING_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;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_NO_DATA)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.value = 15;
|
||||||
|
data.name = getString(R.string.availability_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Stock and Facing
|
//Stock and Facing
|
||||||
/*String stock_facing_xml = "";
|
/*String stock_facing_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import android.content.res.Resources;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
@@ -46,10 +46,10 @@ import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
@@ -76,6 +76,8 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
ArrayList<T2PGetterSetter> t2PGetterSetters;
|
ArrayList<T2PGetterSetter> t2PGetterSetters;
|
||||||
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
||||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
||||||
|
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
private TextView percentage, message;
|
private TextView percentage, message;
|
||||||
@@ -358,6 +360,71 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
//MSL_Availability_StockFacing
|
||||||
|
String mslAvailability_stockFacing_xml = "";
|
||||||
|
onXML = "";
|
||||||
|
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
|
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||||
|
|
||||||
|
String stock;
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
||||||
|
stock = msl_availabilityStockFacingList.get(j).getStock();
|
||||||
|
} else {
|
||||||
|
stock = "0";
|
||||||
|
}
|
||||||
|
onXML = "[MSL_AVAILABILITY_STOCK_FACING_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
//+ "[CATEGORY_ID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getCategory_id()) + "[/CATEGORY_ID]"
|
||||||
|
//+ "[BRAND_ID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getBrand_id()) + "[/BRAND_ID]"
|
||||||
|
+ "[SKU_ID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SKU_ID]"
|
||||||
|
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||||
|
+ "[AVAILABILITY]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVAILABILITY]"
|
||||||
|
+ "[FACING]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FACING]"
|
||||||
|
+ "[STOCK]" + Integer.parseInt(stock) + "[/STOCK]" +
|
||||||
|
"[/MSL_AVAILABILITY_STOCK_FACING_DATA]";
|
||||||
|
|
||||||
|
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "MSL_AVAILABILITY_STOCK_FACING_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;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_NO_DATA)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.value = 15;
|
||||||
|
data.name = getString(R.string.availability_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//Stock and Facing
|
//Stock and Facing
|
||||||
/*String stock_facing_xml = "";
|
/*String stock_facing_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
@@ -608,7 +675,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
String additional_visibility_dialog_xml = "";
|
String additional_visibility_dialog_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
String onXMLdIALOG = "";
|
String onXMLdIALOG = "";
|
||||||
|
|
||||||
String imageV1, imageV2, imageV3;
|
String imageV1, imageV2, imageV3;
|
||||||
|
|
||||||
additionalVisibilityList = db.getAdditionalStockUpload(coverageList.get(i).getStoreId());
|
additionalVisibilityList = db.getAdditionalStockUpload(coverageList.get(i).getStoreId());
|
||||||
@@ -634,71 +700,52 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
imageV3 = additionalVisibilityList.get(J).getImage3();
|
imageV3 = additionalVisibilityList.get(J).getImage3();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String KeyID = additionalVisibilityList.get(J).getKey_id();
|
String KeyID = additionalVisibilityList.get(J).getKey_id();
|
||||||
|
|
||||||
additionalVisibilitySkuList = db.getDialogStockUpload(KeyID);
|
additionalVisibilitySkuList = db.getDialogStockUpload(KeyID);
|
||||||
|
|
||||||
if (additionalVisibilitySkuList.size() > 0) {
|
if (additionalVisibilitySkuList.size() > 0) {
|
||||||
|
|
||||||
for (int k = 0; k < additionalVisibilitySkuList.size(); k++) {
|
for (int k = 0; k < additionalVisibilitySkuList.size(); k++) {
|
||||||
|
|
||||||
|
/*String sku_id = "";
|
||||||
|
if (!additionalVisibilitySkuList.get(k).getSku_id().equals("")) {
|
||||||
|
sku_id = additionalVisibilitySkuList.get(k).getSku_id();
|
||||||
|
}
|
||||||
|
|
||||||
onXMLdIALOG = "[VISIBILITY_DAILOG]"
|
onXMLdIALOG = "[VISIBILITY_DAILOG]"
|
||||||
+ "[MID]" + mid + "[/MID]"
|
+ "[MID]" + mid + "[/MID]"
|
||||||
+ "[USER_ID]"
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
+ userId
|
+ "[KEY_ID]" + additionalVisibilitySkuList.get(k).getCOMMON_ID() + "[/KEY_ID]"
|
||||||
+ "[/USER_ID]"
|
+ "[CATEGORY_ID]" + additionalVisibilitySkuList.get(k).getCategoryId() + "[/CATEGORY_ID]"
|
||||||
+ "[KEY_ID]"
|
+ "[SKU_ID]" + sku_id + "[/SKU_ID]"
|
||||||
+ additionalVisibilitySkuList.get(k).getCOMMON_ID()
|
+ "[QUANTITY]" + additionalVisibilitySkuList.get(k).getQuantity() + "[/QUANTITY]"
|
||||||
+ "[/KEY_ID]"
|
+ "[/VISIBILITY_DAILOG]";*/
|
||||||
+ "[CATEGORY_ID]"
|
|
||||||
+ additionalVisibilitySkuList.get(k).getCategoryId()
|
onXMLdIALOG = "[VISIBILITY_DAILOG]"
|
||||||
+ "[/CATEGORY_ID]"
|
+ "[MID]" + mid + "[/MID]"
|
||||||
+ "[SKU_ID]"
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
+ additionalVisibilitySkuList.get(k).getSku_id()
|
+ "[KEY_ID]" + additionalVisibilitySkuList.get(k).getCOMMON_ID() + "[/KEY_ID]"
|
||||||
+ "[/SKU_ID]"
|
+ "[CATEGORY_ID]" + additionalVisibilitySkuList.get(k).getCategoryId() + "[/CATEGORY_ID]"
|
||||||
+ "[QUANTITY]"
|
+ "[SKU_ID]" + additionalVisibilitySkuList.get(k).getSku_id() + "[/SKU_ID]"
|
||||||
+ additionalVisibilitySkuList.get(k).getQuantity()
|
+ "[QUANTITY]" + additionalVisibilitySkuList.get(k).getQuantity() + "[/QUANTITY]"
|
||||||
+ "[/QUANTITY]"
|
|
||||||
+ "[/VISIBILITY_DAILOG]";
|
+ "[/VISIBILITY_DAILOG]";
|
||||||
|
|
||||||
additional_visibility_dialog_xml = additional_visibility_dialog_xml + onXMLdIALOG;
|
additional_visibility_dialog_xml = additional_visibility_dialog_xml + onXMLdIALOG;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onXML = "[ADDITIONAL_VISIBILITY_NEW]"
|
onXML = "[ADDITIONAL_VISIBILITY_NEW]"
|
||||||
+ "[MID]" + mid + "[/MID]"
|
+ "[MID]" + mid + "[/MID]"
|
||||||
+ "[USER_ID]"
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
+ userId
|
+ "[KEY_ID]" + additionalVisibilityList.get(J).getKey_id() + "[/KEY_ID]"
|
||||||
+ "[/USER_ID]"
|
+ "[CATEGORY_ID]" + additionalVisibilityList.get(J).getCategoryId() + "[/CATEGORY_ID]"
|
||||||
+ "[KEY_ID]"
|
+ "[ADDITIONAL_DISPLAY]" + additionalVisibilityList.get(J).getBtn_toogle() + "[/ADDITIONAL_DISPLAY]"
|
||||||
+ additionalVisibilityList.get(J).getKey_id()
|
/* + "[BRAND_ID]"+ additionalVisibilityList.get(J).getBrand_id()+ "[/BRAND_ID]"*/
|
||||||
+ "[/KEY_ID]"
|
+ "[IMAGE_URL]" + imageV1 /*additionalVisibilityList.get(J).getImage()*/ + "[/IMAGE_URL]"
|
||||||
+ "[CATEGORY_ID]"
|
+ "[IMAGE_URL1]" + imageV2 /*additionalVisibilityList.get(J).getImage2()*/ + "[/IMAGE_URL1]"
|
||||||
+ additionalVisibilityList.get(J).getCategoryId()
|
+ "[IMAGE_URL2]" + imageV3 /*additionalVisibilityList.get(J).getImage3()*/ + "[/IMAGE_URL2]"
|
||||||
+ "[/CATEGORY_ID]"
|
+ "[DISPLAY_ID]" + additionalVisibilityList.get(J).getSku_id() + "[/DISPLAY_ID]"
|
||||||
+ "[ADDITIONAL_DISPLAY]"
|
+ "[SKU_LIST]" + additional_visibility_dialog_xml + "[/SKU_LIST]"
|
||||||
+ additionalVisibilityList.get(J).getBtn_toogle()
|
|
||||||
+ "[/ADDITIONAL_DISPLAY]"
|
|
||||||
/* + "[BRAND_ID]"
|
|
||||||
+ additionalVisibilityList.get(J).getBrand_id()
|
|
||||||
+ "[/BRAND_ID]"*/
|
|
||||||
+ "[IMAGE_URL]"
|
|
||||||
+ imageV1 /*additionalVisibilityList.get(J).getImage()*/
|
|
||||||
+ "[/IMAGE_URL]"
|
|
||||||
+ "[IMAGE_URL1]"
|
|
||||||
+ imageV2 /*additionalVisibilityList.get(J).getImage2()*/
|
|
||||||
+ "[/IMAGE_URL1]"
|
|
||||||
+ "[IMAGE_URL2]"
|
|
||||||
+ imageV3 /*additionalVisibilityList.get(J).getImage3()*/
|
|
||||||
+ "[/IMAGE_URL2]"
|
|
||||||
+ "[DISPLAY_ID]"
|
|
||||||
+ additionalVisibilityList.get(J).getSku_id()
|
|
||||||
+ "[/DISPLAY_ID]"
|
|
||||||
+ "[SKU_LIST]"
|
|
||||||
+ additional_visibility_dialog_xml
|
|
||||||
+ "[/SKU_LIST]"
|
|
||||||
+ "[/ADDITIONAL_VISIBILITY_NEW]";
|
+ "[/ADDITIONAL_VISIBILITY_NEW]";
|
||||||
|
|
||||||
|
|
||||||
@@ -707,11 +754,9 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
additionalVisibilitySkuList.clear();
|
additionalVisibilitySkuList.clear();
|
||||||
|
|
||||||
additional_visibility_dialog_xml = "";
|
additional_visibility_dialog_xml = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + additional_visibility_data_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + additional_visibility_data_xml + "[/DATA]";
|
||||||
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
request.addProperty("XMLDATA", sos_xml);
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
request.addProperty("KEYS", "ADDITIONAL_VISIBILITY_NEW");
|
request.addProperty("KEYS", "ADDITIONAL_VISIBILITY_NEW");
|
||||||
@@ -1709,7 +1754,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|||||||
+122
@@ -0,0 +1,122 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by gagang on 23-12-2016.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MSL_AvailabilityStockFacingGetterSetter {
|
||||||
|
String sub_category_id, sub_category, brand_id, brand,
|
||||||
|
sku_id, sku, mrp, sku_sequence, toggleValue, mbq, category_id, facing, stock,company_id;
|
||||||
|
|
||||||
|
public String getSub_category_id() {
|
||||||
|
return sub_category_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSub_category_id(String sub_category_id) {
|
||||||
|
this.sub_category_id = sub_category_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSub_category() {
|
||||||
|
return sub_category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSub_category(String sub_category) {
|
||||||
|
this.sub_category = sub_category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBrand_id() {
|
||||||
|
return brand_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrand_id(String brand_id) {
|
||||||
|
this.brand_id = brand_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBrand() {
|
||||||
|
return brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrand(String brand) {
|
||||||
|
this.brand = brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku_id() {
|
||||||
|
return sku_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku_id(String sku_id) {
|
||||||
|
this.sku_id = sku_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku() {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
this.sku = sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMrp() {
|
||||||
|
return mrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMrp(String mrp) {
|
||||||
|
this.mrp = mrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku_sequence() {
|
||||||
|
return sku_sequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku_sequence(String sku_sequence) {
|
||||||
|
this.sku_sequence = sku_sequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToggleValue() {
|
||||||
|
return toggleValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToggleValue(String toggleValue) {
|
||||||
|
this.toggleValue = toggleValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMbq() {
|
||||||
|
return mbq;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMbq(String mbq) {
|
||||||
|
this.mbq = mbq;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategory_id() {
|
||||||
|
return category_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory_id(String category_id) {
|
||||||
|
this.category_id = category_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFacing() {
|
||||||
|
return facing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFacing(String facing) {
|
||||||
|
this.facing = facing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStock() {
|
||||||
|
return stock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStock(String stock) {
|
||||||
|
this.stock = stock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompany_id() {
|
||||||
|
return company_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompany_id(String company_id) {
|
||||||
|
this.company_id = company_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
|
<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_msl__availability_stock_facing" />
|
||||||
|
|
||||||
|
<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="@drawable/save_icon" />
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/content_msl__availability"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:showIn="@layout/activity_msl__availability_stock_facing">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_mslAvailabilityName"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#FFF1710F"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:text="Must Have Availability"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<!--Camera Layout-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_camera"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="4">
|
||||||
|
|
||||||
|
<!--camera 1-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_camera1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/layout_click_background_effect"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_camera1"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="10dp" />
|
||||||
|
<!--android:src="@mipmap/camera_orange"-->
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/grey_dark_background" />
|
||||||
|
|
||||||
|
<!--camera 2-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_camera2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/layout_click_background_effect"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_camera2"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="10dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_camera2"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/grey_dark_background" />
|
||||||
|
|
||||||
|
<!--camera 3-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_camera3"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/layout_click_background_effect"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_camera3"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="10dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_camera3"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/grey_dark_background" />
|
||||||
|
|
||||||
|
<!--camera 4-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_camera4"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/layout_click_background_effect"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_camera4"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="10dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/grey_dark_background" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_category"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:weightSum="1">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:text="@string/msl_availability_mbq"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:text="@string/msl_availability_availability"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:text="@string/stock_facing_faceup"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:text="@string/stock_facing_stock"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ExpandableListView
|
||||||
|
android:id="@+id/expandableListView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:cacheColorHint="#00000000"
|
||||||
|
android:divider="@null"
|
||||||
|
android:dividerHeight="0dp"
|
||||||
|
android:scrollingCache="false" />
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
<?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="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/card_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
card_view:cardCornerRadius="10dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_category"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:weightSum="5">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2.5"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_skuName"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:text="SKU Name Value "
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="1">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_mbq"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="0"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222"
|
||||||
|
android:textColorHint="#666" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ToggleButton
|
||||||
|
android:id="@+id/toggle_available"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/toggle_selector_background"
|
||||||
|
android:textOff="@string/no"
|
||||||
|
android:textOn="@string/yes" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_facing"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222"
|
||||||
|
android:textColorHint="#666" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_stock"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222"
|
||||||
|
android:textColorHint="#666"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/card_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
card_view:cardBackgroundColor="@color/grey_background"
|
||||||
|
card_view:cardCornerRadius="10dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rel_categoryHeader"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_categoryHeader"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="25dp"
|
||||||
|
android:text="Brand Name "
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="#222" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_camera"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="30dp"
|
||||||
|
android:src="@drawable/ic_menu_camera"
|
||||||
|
android:visibility="invisible" />
|
||||||
|
</RelativeLayout>
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</LinearLayout>
|
||||||
@@ -297,4 +297,7 @@
|
|||||||
<!--Change 06-03-2017-->
|
<!--Change 06-03-2017-->
|
||||||
<string name="title_activity_store_checkout_image">Store Check out Image</string>
|
<string name="title_activity_store_checkout_image">Store Check out Image</string>
|
||||||
<string name="store_checkout">Click Store CheckOut Image</string>
|
<string name="store_checkout">Click Store CheckOut Image</string>
|
||||||
|
<string name="faceup_value">Please fill faceup value or fill 0 </string>
|
||||||
|
<string name="stock_value">Please fill stock value or fill 0 </string>
|
||||||
|
<string name="check_stock">Stock can not be greater equal than MBQ value</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user