SecondCommit
@@ -1,116 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="GSKMTOrange">
|
||||
<State />
|
||||
</entry>
|
||||
</value>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="GSKMTOrange">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||
</project>
|
||||
@@ -4,10 +4,8 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="delegatedBuild" value="false" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
@@ -15,8 +13,7 @@
|
||||
<option value="$PROJECT_DIR$/library" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="ConstantConditions" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
|
||||
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="Deprecation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
@@ -11,25 +11,20 @@
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://maven.google.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Kotlin2JsCompilerArguments">
|
||||
<option name="sourceMapEmbedSources" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,52 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="mavenHome" value="Bundled (Maven 3)" />
|
||||
</MavenGeneralSettings>
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_daily_data_menu.xml" value="0.11277173913043478" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_login.xml" value="0.25" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_msl__availability.xml" value="0.115625" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_msl__availability_stock_facing.xml" value="0.11197916666666667" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_confirm.xml" value="0.2" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_status_detail.xml" value="0.22" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_taking.xml" value="0.2" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_visit_type_status.xml" value="0.11875" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_daily_main_menu.xml" value="0.13697916666666668" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_msl__availability_stock_facing.xml" value="0.11197916666666667" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_order_status_detail.xml" value="0.17" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_order_taking.xml" value="0.11197916666666667" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_store_wise_performance.xml" value="0.11302083333333333" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/contentcatgoryadpterlayout.xml" value="0.10833333333333334" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/contentorderstatus.xml" value="0.16302083333333334" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/daily_main_menu_row.xml" value="0.15416666666666667" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_category_wise_performance.xml" value="0.1390625" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_msl_availability_stock_facing_child.xml" value="0.16" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_msl_availability_stock_facing_header.xml" value="0.2" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_received_status_child.xml" value="0.2" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_status_child.xml" value="0.17" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_taking.xml" value="0.128125" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_taking_child.xml" value="0.2" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/order_status_item_layout.xml" value="0.33" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelist.xml" value="0.11875" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelist_child.xml" value="0.159375" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelistfablayout.xml" value="0.11875" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/visitstatuslist.xml" value="0.11875" />
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/visittypelist_child.xml" value="0.159375" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_audit.xml" value="0.14990942028985507" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_main.xml" value="0.20416666666666666" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/audit_question_list_item.xml" value="0.30676552363299353" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_audit.xml" value="0.14990942028985507" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_t2_pcompliance.xml" value="0.20416666666666666" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/t2p_sku_dialog_layout.xml" value="0.20416666666666666" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/t2pbranddialoglayout.xml" value="0.20416666666666666" />
|
||||
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/menu/activity_main_drawer.xml" value="0.20416666666666666" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="12">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||
<item index="4" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
|
||||
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
|
||||
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
||||
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
||||
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
||||
<item index="10" class="java.lang.String" itemvalue="android.annotation.Nullable" />
|
||||
<item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="11">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
|
||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
|
||||
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
||||
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
||||
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
||||
<item index="9" class="java.lang.String" itemvalue="android.annotation.NonNull" />
|
||||
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -4,7 +4,13 @@
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKORANGEV2-JORDAN.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKORANGEV2-JORDAN.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.androidTest.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.main.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.unitTest.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.androidTest.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.main.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.unitTest.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,329 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="direct_access_persist.xml">
|
||||
<option name="deviceSelectionList">
|
||||
<list>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="27" />
|
||||
<option name="brand" value="DOCOMO" />
|
||||
<option name="codename" value="F01L" />
|
||||
<option name="id" value="F01L" />
|
||||
<option name="manufacturer" value="FUJITSU" />
|
||||
<option name="name" value="F-01L" />
|
||||
<option name="screenDensity" value="360" />
|
||||
<option name="screenX" value="720" />
|
||||
<option name="screenY" value="1280" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="28" />
|
||||
<option name="brand" value="DOCOMO" />
|
||||
<option name="codename" value="SH-01L" />
|
||||
<option name="id" value="SH-01L" />
|
||||
<option name="manufacturer" value="SHARP" />
|
||||
<option name="name" value="AQUOS sense2 SH-01L" />
|
||||
<option name="screenDensity" value="480" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2160" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="Lenovo" />
|
||||
<option name="codename" value="TB370FU" />
|
||||
<option name="id" value="TB370FU" />
|
||||
<option name="manufacturer" value="Lenovo" />
|
||||
<option name="name" value="Tab P12" />
|
||||
<option name="screenDensity" value="340" />
|
||||
<option name="screenX" value="1840" />
|
||||
<option name="screenY" value="2944" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="31" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="a51" />
|
||||
<option name="id" value="a51" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy A51" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="akita" />
|
||||
<option name="id" value="akita" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 8a" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="b0q" />
|
||||
<option name="id" value="b0q" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy S22 Ultra" />
|
||||
<option name="screenDensity" value="600" />
|
||||
<option name="screenX" value="1440" />
|
||||
<option name="screenY" value="3088" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="32" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="bluejay" />
|
||||
<option name="id" value="bluejay" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 6a" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="caiman" />
|
||||
<option name="id" value="caiman" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9 Pro" />
|
||||
<option name="screenDensity" value="360" />
|
||||
<option name="screenX" value="960" />
|
||||
<option name="screenY" value="2142" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="comet" />
|
||||
<option name="id" value="comet" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9 Pro Fold" />
|
||||
<option name="screenDensity" value="390" />
|
||||
<option name="screenX" value="2076" />
|
||||
<option name="screenY" value="2152" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="29" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="crownqlteue" />
|
||||
<option name="id" value="crownqlteue" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Note9" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="2220" />
|
||||
<option name="screenY" value="1080" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="dm3q" />
|
||||
<option name="id" value="dm3q" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy S23 Ultra" />
|
||||
<option name="screenDensity" value="600" />
|
||||
<option name="screenX" value="1440" />
|
||||
<option name="screenY" value="3088" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="e1q" />
|
||||
<option name="id" value="e1q" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy S24" />
|
||||
<option name="screenDensity" value="480" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2340" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="felix" />
|
||||
<option name="id" value="felix" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Fold" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="2208" />
|
||||
<option name="screenY" value="1840" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="felix" />
|
||||
<option name="id" value="felix" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Fold" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="2208" />
|
||||
<option name="screenY" value="1840" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="felix_camera" />
|
||||
<option name="id" value="felix_camera" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Fold (Camera-enabled)" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="2208" />
|
||||
<option name="screenY" value="1840" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="gts8uwifi" />
|
||||
<option name="id" value="gts8uwifi" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Tab S8 Ultra" />
|
||||
<option name="screenDensity" value="320" />
|
||||
<option name="screenX" value="1848" />
|
||||
<option name="screenY" value="2960" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="husky" />
|
||||
<option name="id" value="husky" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 8 Pro" />
|
||||
<option name="screenDensity" value="390" />
|
||||
<option name="screenX" value="1008" />
|
||||
<option name="screenY" value="2244" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="30" />
|
||||
<option name="brand" value="motorola" />
|
||||
<option name="codename" value="java" />
|
||||
<option name="id" value="java" />
|
||||
<option name="manufacturer" value="Motorola" />
|
||||
<option name="name" value="G20" />
|
||||
<option name="screenDensity" value="280" />
|
||||
<option name="screenX" value="720" />
|
||||
<option name="screenY" value="1600" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="komodo" />
|
||||
<option name="id" value="komodo" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9 Pro XL" />
|
||||
<option name="screenDensity" value="360" />
|
||||
<option name="screenX" value="1008" />
|
||||
<option name="screenY" value="2244" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="lynx" />
|
||||
<option name="id" value="lynx" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 7a" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="31" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="oriole" />
|
||||
<option name="id" value="oriole" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 6" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="panther" />
|
||||
<option name="id" value="panther" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 7" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="q5q" />
|
||||
<option name="id" value="q5q" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Z Fold5" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1812" />
|
||||
<option name="screenY" value="2176" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="q6q" />
|
||||
<option name="id" value="q6q" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Z Fold6" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1856" />
|
||||
<option name="screenY" value="2160" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="30" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="r11" />
|
||||
<option name="id" value="r11" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Watch" />
|
||||
<option name="screenDensity" value="320" />
|
||||
<option name="screenX" value="384" />
|
||||
<option name="screenY" value="384" />
|
||||
<option name="type" value="WEAR_OS" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="30" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="redfin" />
|
||||
<option name="id" value="redfin" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 5" />
|
||||
<option name="screenDensity" value="440" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2340" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="shiba" />
|
||||
<option name="id" value="shiba" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 8" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="tangorpro" />
|
||||
<option name="id" value="tangorpro" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Tablet" />
|
||||
<option name="screenDensity" value="320" />
|
||||
<option name="screenX" value="1600" />
|
||||
<option name="screenY" value="2560" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="tokay" />
|
||||
<option name="id" value="tokay" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2424" />
|
||||
</PersistentDeviceSelectionData>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -3,12 +3,14 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion '29.0.3'
|
||||
compileSdk 34
|
||||
// buildToolsVersion '29.0.3'
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
disable 'MissingTranslation'
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -19,52 +21,92 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cpm.com.gskmtorange"
|
||||
minSdkVersion 20
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
|
||||
// For Lebanon
|
||||
/*versionCode 1
|
||||
versionName "1.0"*/
|
||||
|
||||
//For Egypt
|
||||
versionCode 30
|
||||
versionName "4.1"
|
||||
/*versionCode 35
|
||||
versionName "4.6"*/
|
||||
|
||||
//For UAE
|
||||
/* versionCode 29
|
||||
/* versionCode 29
|
||||
versionName "4.1"*/
|
||||
|
||||
//For Turkey
|
||||
/* versionCode 28
|
||||
versionName "4.0"
|
||||
*/
|
||||
/* versionCode 34
|
||||
versionName "4.6"*/
|
||||
|
||||
//For Turkey
|
||||
/*versionCode 32
|
||||
versionName "4.4"*/
|
||||
|
||||
//For KSA
|
||||
/* versionCode 27
|
||||
versionName "3.9"*/
|
||||
/*versionCode 28
|
||||
versionName "4.0"*/
|
||||
|
||||
// aading price facing
|
||||
/* versionCode 27
|
||||
versionName "3.8"*/
|
||||
|
||||
//sa
|
||||
/* versionCode 29
|
||||
versionName "4.1"*/
|
||||
/* versionCode 28
|
||||
versionName "3.9"*/
|
||||
|
||||
//Kenya
|
||||
/* versionCode 2
|
||||
/* versionCode 2
|
||||
versionName "1.1"*/
|
||||
|
||||
//kenya-lite
|
||||
/* versionCode 2
|
||||
versionName "1.1"*/
|
||||
|
||||
//nigeria
|
||||
/* versionCode 1
|
||||
/*versionCode 1
|
||||
versionName "1.0"*/
|
||||
|
||||
//For jordan
|
||||
/* versionCode 1
|
||||
versionName "1.0"*/
|
||||
versionCode 6
|
||||
versionName "1.5"
|
||||
|
||||
//For Kuwait
|
||||
/* versionCode 1
|
||||
/*versionCode 1
|
||||
versionName "1.0"*/
|
||||
|
||||
multiDexEnabled true
|
||||
//For Bahrain
|
||||
/*versionCode 1
|
||||
versionName "1.0"*/
|
||||
|
||||
//For QATAR
|
||||
/*versionCode 1
|
||||
versionName "1.0"*/
|
||||
|
||||
//For Libya
|
||||
/*versionCode 3
|
||||
versionName "1.2"*/
|
||||
|
||||
//For Oman
|
||||
/*versionCode 1
|
||||
versionName "1.0"*/
|
||||
|
||||
multiDexEnabled true
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
/* release {
|
||||
debuggable true
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
minifyEnabled true
|
||||
shrinkResources false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}*/
|
||||
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
@@ -88,6 +130,7 @@ dependencies {
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.firebase:firebase-auth:20.0.3'
|
||||
implementation 'androidx.activity:activity:1.9.3'
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
@@ -114,6 +157,7 @@ dependencies {
|
||||
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
|
||||
// Recommended: Add the Google Analytics SDK.
|
||||
implementation 'com.google.firebase:firebase-analytics:18.0.0'
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
|
||||
}
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "cpm.com.gskmtorange",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 6,
|
||||
"versionName": "1.5",
|
||||
"outputFile": "GSKMTOrange-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":26,"versionName":"3.8","enabled":true,"outputFile":"GSKMTOrange-release.apk","fullName":"release","baseName":"release"},"path":"GSKMTOrange-release.apk","properties":{}}]
|
||||
@@ -21,4 +21,5 @@
|
||||
string in this file.
|
||||
-->
|
||||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="cpm.com.gskmtorange">
|
||||
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
@@ -15,23 +20,55 @@
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="an[droid.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<meta-data
|
||||
android:name="firebase_crashlytics_collection_enabled"
|
||||
android:value="false" />
|
||||
android:value="true" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="false"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:theme="@style/AppTheme">
|
||||
tools:replace="android:supportsRtl">
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.StockEntryActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".dailyentry.VisitTypeStatusActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="Ad hoc - Visit Type"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.OrderStatusDetailActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.OrderConfirmActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".dailyentry.OrderTakingActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".dailyentry.NewStockDataActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_new_stock_data"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
@@ -41,6 +78,7 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.StockPricingActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_stock_pricing"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
@@ -76,6 +114,8 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".SplashScreenActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
@@ -87,11 +127,13 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_login"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/main_menu_activity_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -100,6 +142,7 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".SelectLanguageActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_select_language"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -109,11 +152,13 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".GeoTag.GeoTagStoreList"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_list"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.StoreListActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_list"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -125,6 +170,7 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".GeoTag.GeoTagActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_geotag"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -139,9 +185,9 @@
|
||||
<activity
|
||||
android:name=".dailyentry.T2PComplianceActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" /> <!-- Gagan Start Declaration -->
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" /> <!-- Gagan Start Declaration -->
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.CategoryListActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
@@ -204,6 +250,7 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.SettingsActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_settings"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -224,7 +271,9 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".dailyentry.T2pBrand_Avaibility"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_t2p_brand__avaibility"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.StockFacing_PlanogramTrackerActivity"
|
||||
@@ -284,7 +333,8 @@
|
||||
android:name=".dailyentry.AuditActivity"
|
||||
android:label="@string/audit"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<service
|
||||
android:name=".service.FCMNotificationService"
|
||||
@@ -308,7 +358,12 @@
|
||||
Note that the API key is linked to the encryption key used to sign the APK.
|
||||
You need a different API key for each encryption key, including the release key that is used to
|
||||
sign the APK for publishing.
|
||||
You can define the keys for the debug and release targets in src/debug/ and src/release/.
|
||||
You can define the keys for the debug and release targets in src/debug/ and src/release/.
|
||||
-->
|
||||
<!--
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value="@string/google_maps_key" />
|
||||
-->
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
@@ -350,7 +405,8 @@
|
||||
android:name=".dailyentry.CoachingVisitActivity"
|
||||
android:label="@string/title_activity_coaching_visit"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" /> <activity
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.CoachingVisitStoreActivity"
|
||||
android:label="@string/title_activity_coaching_visit_store"
|
||||
android:screenOrientation="portrait"
|
||||
|
||||
@@ -82,6 +82,7 @@ import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.StoreimageActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.VisitTypeStatusActivity;
|
||||
import cpm.com.gskmtorange.messgae.AlertMessage;
|
||||
import cpm.com.gskmtorange.upload.Base64;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
@@ -91,7 +92,6 @@ import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
* Created by ashishc on 27-12-2016.
|
||||
*/
|
||||
|
||||
|
||||
public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||
private Context context;
|
||||
String result, errormsg = "";
|
||||
@@ -99,6 +99,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
private GoogleMap mMap;
|
||||
double latitude = 0.0;
|
||||
double longitude = 0.0;
|
||||
String country_id;
|
||||
protected String diskpath = "", _path, _pathforcheck, img_str = "", status;
|
||||
private Location mLastLocation;
|
||||
private LocationManager locmanager = null;
|
||||
@@ -154,6 +155,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
visitData = preferences.getString(CommonString.KEY_DATE, null);
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
storeid = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
|
||||
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -224,7 +226,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Write your code here to invoke NO event
|
||||
|
||||
dialog.cancel();
|
||||
finish();
|
||||
}
|
||||
@@ -485,8 +486,21 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -750,29 +764,51 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
} catch (SocketException ex) {
|
||||
ex.printStackTrace();
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
|
||||
startActivity(intent);
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
VisitTypeStatusActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
else{
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
GeoTagActivity.this.finish();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
Intent intent = new Intent(
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
VisitTypeStatusActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
else{
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
/* Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);*/
|
||||
|
||||
startActivity(intent);
|
||||
// startActivity(intent);
|
||||
|
||||
GeoTagActivity.this.finish();
|
||||
}
|
||||
@@ -889,11 +925,8 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
|
||||
return "GeotagImages";
|
||||
}
|
||||
|
||||
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||
|
||||
return CommonString.METHOD_Get_DR_STORE_IMAGES_GEO;
|
||||
@@ -902,7 +935,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
return CommonString.METHOD_Get_DR_STORE_IMAGES_GEO + "," + errormsg;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,13 +967,29 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
//Crashlytics.logException(new Exception(e.getCause()));
|
||||
Intent intent = new Intent(
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
VisitTypeStatusActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
else{
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
/* Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
|
||||
startActivity(intent);
|
||||
startActivity(intent);*/
|
||||
|
||||
GeoTagActivity.this.finish();
|
||||
|
||||
@@ -994,13 +1042,29 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
+ result, getResources().getString(R.string.success), null);
|
||||
message.showMessage();*/
|
||||
|
||||
Intent intent = new Intent(
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
VisitTypeStatusActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
else{
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
/* Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
|
||||
startActivity(intent);
|
||||
startActivity(intent);*/
|
||||
|
||||
GeoTagActivity.this.finish();
|
||||
|
||||
@@ -1015,13 +1079,30 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
+ result, getResources().getString(R.string.failure), null);
|
||||
message.showMessage();*/
|
||||
Toast.makeText(context,getResources().getString(R.string.failure),Toast.LENGTH_LONG).show();
|
||||
Intent intent = new Intent(
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
VisitTypeStatusActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
else{
|
||||
Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
startActivity(intent);
|
||||
}
|
||||
/* Intent intent = new Intent(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
|
||||
startActivity(intent);
|
||||
startActivity(intent);*/
|
||||
|
||||
GeoTagActivity.this.finish();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package cpm.com.gskmtorange.GetterSetter;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class OrderReceivedStatus implements Serializable {
|
||||
//TextView sys_gen_poTV,storepoTV,podateTV,lineItemTV,statusTV;
|
||||
String sys_gen_po="";
|
||||
String storepo="";
|
||||
String podate="";
|
||||
String lineItem="";
|
||||
String status="";
|
||||
int SKU_ID;
|
||||
int ORDERQTY;
|
||||
int CATEGORY_ID;
|
||||
int POID;
|
||||
|
||||
public int getPOID() {
|
||||
return POID;
|
||||
}
|
||||
|
||||
public void setPOID(int POID) {
|
||||
this.POID = POID;
|
||||
}
|
||||
|
||||
|
||||
public int getStoreid() {
|
||||
return Storeid;
|
||||
}
|
||||
|
||||
public void setStoreid(int storeid) {
|
||||
Storeid = storeid;
|
||||
}
|
||||
|
||||
int Storeid;
|
||||
|
||||
public int getSKU_ID() {
|
||||
return SKU_ID;
|
||||
}
|
||||
|
||||
public void setSKU_ID(int SKU_ID) {
|
||||
this.SKU_ID = SKU_ID;
|
||||
}
|
||||
|
||||
public int getORDERQTY() {
|
||||
return ORDERQTY;
|
||||
}
|
||||
|
||||
public void setORDERQTY(int ORDERQTY) {
|
||||
this.ORDERQTY = ORDERQTY;
|
||||
}
|
||||
|
||||
public int getCATEGORY_ID() {
|
||||
return CATEGORY_ID;
|
||||
}
|
||||
|
||||
public void setCATEGORY_ID(int CATEGORY_ID) {
|
||||
this.CATEGORY_ID = CATEGORY_ID;
|
||||
}
|
||||
|
||||
|
||||
public String getSys_gen_po() {
|
||||
return sys_gen_po;
|
||||
}
|
||||
|
||||
public void setSys_gen_po(String sys_gen_po) {
|
||||
this.sys_gen_po = sys_gen_po;
|
||||
}
|
||||
|
||||
public String getStorepo() {
|
||||
return storepo;
|
||||
}
|
||||
|
||||
public void setStorepo(String storepo) {
|
||||
this.storepo = storepo;
|
||||
}
|
||||
|
||||
public String getPodate() {
|
||||
return podate;
|
||||
}
|
||||
|
||||
public void setPodate(String podate) {
|
||||
this.podate = podate;
|
||||
}
|
||||
|
||||
public String getLineItem() {
|
||||
return lineItem;
|
||||
}
|
||||
|
||||
public void setLineItem(String lineItem) {
|
||||
this.lineItem = lineItem;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -36,6 +37,7 @@ import android.widget.Toast;
|
||||
//import com.crashlytics.android.Crashlytics;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
@@ -96,25 +98,18 @@ import static android.Manifest.permission.READ_CONTACTS;
|
||||
/**
|
||||
* A login screen that offers login via userid/password.
|
||||
*/
|
||||
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||
|
||||
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks,
|
||||
GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||
private static final int MY_PERMISSIONS_REQUEST_CAMERA = 10;
|
||||
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
||||
|
||||
private FirebaseAnalytics mFirebaseAnalytics;
|
||||
|
||||
TextView tv_version;
|
||||
String app_ver;
|
||||
|
||||
LoginGetterSetter lgs = null;
|
||||
|
||||
static int counter = 1;
|
||||
|
||||
private SharedPreferences preferences = null;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
|
||||
/**
|
||||
* Id to identity READ_CONTACTS permission request.
|
||||
*/
|
||||
@@ -124,28 +119,17 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
* A dummy authentication store containing known user names and passwords.
|
||||
* TODO: remove after connecting to a real authentication system.
|
||||
*/
|
||||
private static final String[] DUMMY_CREDENTIALS = new String[]{
|
||||
"foo@example.com:hello", "bar@example.com:world"
|
||||
};
|
||||
|
||||
double lat = 0.0;
|
||||
double lon = 0.0;
|
||||
|
||||
// UI references.
|
||||
private AutoCompleteTextView museridView;
|
||||
private EditText mPasswordView;
|
||||
private View mProgressView;
|
||||
private View mLoginFormView;
|
||||
|
||||
private String userid, password, p_username, p_password;
|
||||
|
||||
private String userid, password;
|
||||
private int versionCode;
|
||||
|
||||
int eventType;
|
||||
|
||||
Button museridSignInButton;
|
||||
|
||||
// Trace myTrace;
|
||||
CardView museridSignInButton;
|
||||
|
||||
GoogleApiClient mGoogleApiClient;
|
||||
private static int UPDATE_INTERVAL = 200; // 5 sec
|
||||
@@ -160,9 +144,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_login);
|
||||
context = this;
|
||||
|
||||
TextView tv_version = (TextView) findViewById(R.id.tv_version_code);
|
||||
try {
|
||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||
@@ -173,19 +157,22 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
}
|
||||
|
||||
tv_version.setText("Version/Versiyon - " + app_ver);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
editor = preferences.edit();
|
||||
|
||||
// Set up the login form.
|
||||
museridView = (AutoCompleteTextView) findViewById(R.id.userid);
|
||||
//populateAutoComplete();
|
||||
mPasswordView = (EditText) findViewById(R.id.password);
|
||||
|
||||
/*museridView.setText("test.egypt");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
/* museridView.setText("egypt.1");
|
||||
//for lebanon
|
||||
// museridView.setText("test.lebanon1");
|
||||
// mPasswordView.setText("cpm@123");
|
||||
// for EGYPT
|
||||
// museridView.setText("test.egypt");
|
||||
// mPasswordView.setText("cpm123");
|
||||
/*museridView.setText("egypt.1");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
/* museridView.setText("DSR_Alex_61");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
@@ -211,18 +198,22 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
/* museridView.setText("testksa");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
|
||||
//turkey
|
||||
// museridView.setText("testmer");
|
||||
//mPasswordView.setText("cpm123");
|
||||
/* //turkey
|
||||
museridView.setText("testmer");
|
||||
mPasswordView.setText("cpm123");
|
||||
*/
|
||||
//sa
|
||||
/* museridView.setText("testsa");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
//Qatar
|
||||
/* museridView.setText("test.qatar1");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
//Kenya
|
||||
// museridView.setText("test.Kenya");
|
||||
// museridView.setText("testkenya");
|
||||
// mPasswordView.setText("cpm123");
|
||||
// museridView.setText("test.Kenya");
|
||||
// museridView.setText("testkenya");
|
||||
// mPasswordView.setText("cpm123");
|
||||
|
||||
/*museridView.setText("rajesh.r");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
@@ -236,9 +227,15 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
/* museridView.setText("test.jordan");
|
||||
mPasswordView.setText("cpm@123");*/
|
||||
museridView.setText("test.kuwait");
|
||||
// museridView.setText("test.oman");
|
||||
|
||||
// museridView.setText("test.kuwait");
|
||||
// mPasswordView.setText("cpm@123");
|
||||
|
||||
// museridView.setText("test.oman");
|
||||
|
||||
/* museridView.setText("test.bahrain");
|
||||
mPasswordView.setText("cpm@123");
|
||||
*/
|
||||
|
||||
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
@@ -253,7 +250,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
try {
|
||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||
|
||||
// tv_version.setText("Version " + app_ver);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
@@ -263,7 +259,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
|
||||
museridSignInButton = (Button) findViewById(R.id.user_login_button);
|
||||
museridSignInButton = (CardView) findViewById(R.id.user_login_button);
|
||||
museridSignInButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@@ -512,9 +508,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
|
||||
super.onPreExecute();
|
||||
|
||||
dialog = new ProgressDialog(LoginActivity.this);
|
||||
dialog.setTitle("Login");
|
||||
dialog.setMessage("Authenticating....");
|
||||
@@ -524,11 +518,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
|
||||
try {
|
||||
|
||||
Log.e("latitudedata",lat + ","+ lon);
|
||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||
|
||||
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]"
|
||||
+ userid + "[/USER_ID]" + "[PASSWORD]" + password
|
||||
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
||||
@@ -542,17 +534,24 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_LOGIN);
|
||||
request.addProperty("onXML", userauth_xml);
|
||||
Log.d("loginrequest", String.valueOf(request));
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||
SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
try {
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
||||
envelope);
|
||||
} catch (Exception e){
|
||||
Log.e("httpexception",e.getMessage());
|
||||
}
|
||||
/*HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
CommonString.URL);
|
||||
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
||||
envelope);
|
||||
envelope);*/
|
||||
|
||||
Object result = (Object) envelope.getResponse();
|
||||
|
||||
@@ -570,24 +569,18 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
} else if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_FALSE)) {
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
showAlert(CommonString.MESSAGE_FALSE);
|
||||
}
|
||||
});
|
||||
|
||||
} else if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_CHANGED)) {
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
showAlert(CommonString.MESSAGE_CHANGED);
|
||||
}
|
||||
});
|
||||
@@ -635,15 +628,16 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// PUT IN PREFERENCES
|
||||
editor.putString(CommonString.KEY_USERNAME, userid);
|
||||
editor.putString(CommonString.KEY_PASSWORD, password);
|
||||
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
||||
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
||||
//editor.putString(CommonString.KEY_DATE, "12/05/2022");
|
||||
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
||||
//editor.putString(CommonString.KEY_DATE, "01/25/2019");
|
||||
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
||||
Log.e("countryid",lgs.getCOUNTRY_ID());
|
||||
editor.commit();
|
||||
setDataFromSharedPreferences(lgs);
|
||||
|
||||
@@ -707,7 +701,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
});
|
||||
}
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -719,7 +712,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||
// manually set true for South Africa
|
||||
boolean forSA = false;
|
||||
// database.open();
|
||||
// database.open();
|
||||
if (forSA) {
|
||||
//For SA Only
|
||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
||||
@@ -752,20 +745,16 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
finish();
|
||||
//uploadPreviousImages();
|
||||
}
|
||||
|
||||
} else {
|
||||
Intent intent = new Intent(getBaseContext(), AutoUpdateActivity.class);
|
||||
intent.putExtra(CommonString.KEY_PATH, preferences.getString(CommonString.KEY_PATH, ""));
|
||||
startActivity(intent);
|
||||
finish();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
@@ -810,10 +799,23 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
cdate = arabicToenglish(cdate);
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -873,8 +875,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
e.printStackTrace();
|
||||
sendToMain();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void sendToMain() {
|
||||
@@ -962,7 +962,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
}
|
||||
//attemptLogin();
|
||||
attemptLogin();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1124,6 +1124,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
@Override
|
||||
public void onConnected(Bundle bundle) {
|
||||
Log.e("onConnectdata","true" + ","+mGoogleApiClient);
|
||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
// TODO: Consider calling
|
||||
// ActivityCompat#requestPermissions
|
||||
@@ -1135,6 +1136,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
return;
|
||||
}
|
||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||
// Log.e("mlastlocationdata",mLastLocation.getLatitude() + ","+mLastLocation.getLongitude() + ","+mLastLocation);
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||
|| ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
if (mLastLocation != null) {
|
||||
|
||||
@@ -106,9 +106,7 @@ public class MainActivity extends AppCompatActivity
|
||||
webView.getSettings().setJavaScriptEnabled(true);
|
||||
|
||||
if (!url.equals("")) {
|
||||
|
||||
webView.loadUrl(url);
|
||||
|
||||
}
|
||||
|
||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
@@ -315,7 +313,6 @@ public class MainActivity extends AppCompatActivity
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == R.id.nav_route_plan) {
|
||||
|
||||
Intent in_jcp = new Intent(this, StoreListActivity.class);
|
||||
in_jcp.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_JCP);
|
||||
startActivity(in_jcp);
|
||||
@@ -345,13 +342,10 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT)
|
||||
.setAction("Action", null).show();
|
||||
|
||||
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
|
||||
if (coverageList.size() == 0) {
|
||||
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
|
||||
} else {
|
||||
if (isStoreCheckedIn() && isValid()) {
|
||||
|
||||
@@ -446,7 +440,6 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else if (id == R.id.nav_planogram) {
|
||||
|
||||
if (checkNetIsAvailable()) {
|
||||
Intent planogram_pdf = new Intent(this, PlanogramPDFActivity.class);
|
||||
startActivity(planogram_pdf);
|
||||
@@ -469,10 +462,8 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
|
||||
Intent in = new Intent(this, StoreListActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_DEVIATION);
|
||||
|
||||
startActivity(in);
|
||||
|
||||
// overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package cpm.com.gskmtorange;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
public class MovableFloatingActionButton extends FloatingActionButton implements View.OnTouchListener {
|
||||
|
||||
private final static float CLICK_DRAG_TOLERANCE = 10; // Often, there will be a slight, unintentional, drag when the user taps the FAB, so we need to account for this.
|
||||
|
||||
private float downRawX, downRawY;
|
||||
private float dX, dY;
|
||||
|
||||
public MovableFloatingActionButton(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public MovableFloatingActionButton(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public MovableFloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setOnTouchListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent motionEvent){
|
||||
|
||||
int action = motionEvent.getAction();
|
||||
if (action == MotionEvent.ACTION_DOWN) {
|
||||
|
||||
downRawX = motionEvent.getRawX();
|
||||
downRawY = motionEvent.getRawY();
|
||||
dX = view.getX() - downRawX;
|
||||
dY = view.getY() - downRawY;
|
||||
|
||||
return true; // Consumed
|
||||
|
||||
}
|
||||
else if (action == MotionEvent.ACTION_MOVE) {
|
||||
|
||||
int viewWidth = view.getWidth();
|
||||
int viewHeight = view.getHeight();
|
||||
|
||||
View viewParent = (View)view.getParent();
|
||||
int parentWidth = viewParent.getWidth();
|
||||
int parentHeight = viewParent.getHeight();
|
||||
|
||||
float newX = motionEvent.getRawX() + dX;
|
||||
newX = Math.max(0, newX); // Don't allow the FAB past the left hand side of the parent
|
||||
newX = Math.min(parentWidth - viewWidth, newX); // Don't allow the FAB past the right hand side of the parent
|
||||
|
||||
float newY = motionEvent.getRawY() + dY;
|
||||
newY = Math.max(0, newY); // Don't allow the FAB past the top of the parent
|
||||
newY = Math.min(parentHeight - viewHeight, newY); // Don't allow the FAB past the bottom of the parent
|
||||
|
||||
view.animate()
|
||||
.x(newX)
|
||||
.y(newY)
|
||||
.setDuration(0)
|
||||
.start();
|
||||
|
||||
return true; // Consumed
|
||||
|
||||
}
|
||||
else if (action == MotionEvent.ACTION_UP) {
|
||||
|
||||
float upRawX = motionEvent.getRawX();
|
||||
float upRawY = motionEvent.getRawY();
|
||||
|
||||
float upDX = upRawX - downRawX;
|
||||
float upDY = upRawY - downRawY;
|
||||
|
||||
if (Math.abs(upDX) < CLICK_DRAG_TOLERANCE && Math.abs(upDY) < CLICK_DRAG_TOLERANCE) { // A click
|
||||
return performClick();
|
||||
}
|
||||
else { // A drag
|
||||
return true; // Consumed
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
return super.onTouchEvent(motionEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,15 +27,12 @@ import cpm.com.gskmtorange.password.MPinActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||
|
||||
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
Button btn_lang_1, btn_lang_2;
|
||||
private Context context;
|
||||
private SharedPreferences preferences = null;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
|
||||
LoginGetterSetter login_data;
|
||||
ArrayList<String> language, culture_id;
|
||||
|
||||
boolean selected_flag = false;
|
||||
|
||||
@Override
|
||||
@@ -47,36 +44,26 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
||||
context = this;
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
editor = preferences.edit();
|
||||
|
||||
btn_lang_1 = (Button) findViewById(R.id.btn_language_one);
|
||||
btn_lang_2 = (Button) findViewById(R.id.btn_language_two);
|
||||
|
||||
|
||||
login_data = (LoginGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_LOGIN_DATA);
|
||||
language = login_data.getCULTURE_NAME();
|
||||
culture_id = login_data.getCULTURE_ID();
|
||||
|
||||
setDataFromSharedPreferences(login_data);
|
||||
|
||||
if (language.size() > 1) {
|
||||
|
||||
btn_lang_1.setText(language.get(0));
|
||||
btn_lang_2.setText(language.get(1));
|
||||
|
||||
btn_lang_1.setOnClickListener(this);
|
||||
btn_lang_2.setOnClickListener(this);
|
||||
}
|
||||
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (selected_flag) {
|
||||
/* Intent intent = new Intent(getBaseContext(),
|
||||
MainActivity.class);
|
||||
|
||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
||||
startActivity(intent);
|
||||
finish();*/
|
||||
@@ -103,38 +90,34 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
||||
selected_flag = true;
|
||||
CommonFunctions.updateLangResources(context, language.get(0));
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_1.setTextColor(getResources().getColor(R.color.white));
|
||||
btn_lang_2.setTextColor(getResources().getColor(R.color.black));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
||||
editor.commit();
|
||||
|
||||
break;
|
||||
|
||||
case R.id.btn_language_two:
|
||||
|
||||
selected_flag = true;
|
||||
|
||||
CommonFunctions.updateLangResources(context, language.get(1));
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_1.setTextColor(getResources().getColor(R.color.black));
|
||||
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
||||
editor.commit();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||
Gson gson = new Gson();
|
||||
String jsonCurProduct = gson.toJson(lgs);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
@@ -4,11 +4,14 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
@@ -40,13 +43,14 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
setContentView(R.layout.activity_splash_main_layout);
|
||||
|
||||
linearLayout = findViewById(R.id.lin_lay);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
context = this;
|
||||
StartAnimations();
|
||||
//StartAnimations();
|
||||
|
||||
sendToLogin();
|
||||
|
||||
@@ -83,7 +87,7 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
*/
|
||||
|
||||
}
|
||||
private void StartAnimations() {
|
||||
/* private void StartAnimations() {
|
||||
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
|
||||
anim.reset();
|
||||
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
|
||||
@@ -96,7 +100,7 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
iv.clearAnimation();
|
||||
iv.startAnimation(anim);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
public void sendToLogin(){
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@@ -108,40 +112,12 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// This method will be executed once the timer is over
|
||||
// Start your app main activity
|
||||
|
||||
/* SharedPreferences sharedpreferences = getSharedPreferences("MyPref", Context.MODE_PRIVATE);
|
||||
|
||||
boolean isLoggedIn = sharedpreferences.getBoolean("isLoggedIn", false);
|
||||
|
||||
if (isLoggedIn) {
|
||||
|
||||
Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
|
||||
startActivity(i);
|
||||
} else {
|
||||
|
||||
Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
|
||||
startActivity(i);
|
||||
|
||||
}*/
|
||||
|
||||
// close this activity
|
||||
//before MPin
|
||||
/* Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
|
||||
startActivity(i);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
finish();*/
|
||||
|
||||
//after Mpin
|
||||
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||
if(mpin!=null){
|
||||
Intent in = new Intent(context, MPinActivity.class);
|
||||
in.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||
startActivity(in);
|
||||
|
||||
finish();
|
||||
}
|
||||
else {
|
||||
@@ -167,14 +143,4 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* public boolean isValidDateForUpload(String dateImg){
|
||||
boolean flag=false;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
Date strDate = sdf.parse(valid_until);
|
||||
if (System.currentTimeMillis() > strDate.getTime()) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -141,6 +142,7 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
String size = new DecimalFormat("##.##")
|
||||
.format((double) ((double) length / 1024) / 1024)
|
||||
+ " MB";
|
||||
Log.e("appsize",size);
|
||||
|
||||
String PATH = Environment.getExternalStorageDirectory()
|
||||
+ "/download/";
|
||||
@@ -294,12 +296,9 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
activity.startActivity(i);
|
||||
activity.finish();*/
|
||||
finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,9 +12,11 @@ import android.preference.PreferenceManager;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
@@ -25,9 +27,7 @@ import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
||||
*/
|
||||
|
||||
public class CommonFunctions {
|
||||
|
||||
public static boolean updateLangResources(Context context, String language) {
|
||||
|
||||
String lang;
|
||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
||||
@@ -37,43 +37,60 @@ public class CommonFunctions {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||
lang = CommonString.KEY_RETURN_LANGUAGE_EGYPT;
|
||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||
}else{
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||
}
|
||||
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||
}
|
||||
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||
}
|
||||
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
public static String getCurrentTimeWithLanguage(Context context) {
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||
Calendar m_cal = Calendar.getInstance();
|
||||
|
||||
String cdate = formatter.format(m_cal.getTime());
|
||||
SharedPreferences preferences = preferences = PreferenceManager.getDefaultSharedPreferences(context);;
|
||||
//SharedPreferences preferences = preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)
|
||||
////aDDED NEW COUNTRY FOR TIME BY JP
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -90,6 +107,25 @@ public class CommonFunctions {
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
/* private static String arabicToenglish(String number) {
|
||||
String abc ="";
|
||||
try {
|
||||
abc = new String(number.getBytes("UTF-8"), "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
char[] chars = new char[abc.length()];
|
||||
for (int i = 0; i < abc.length(); i++) {
|
||||
char ch = abc.charAt(i);
|
||||
if (ch >= 0x0660 && ch <= 0x0669)
|
||||
ch -= 0x0660 - '0';
|
||||
else if (ch >= 0x06f0 && ch <= 0x06F9)
|
||||
ch -= 0x06f0 - '0';
|
||||
chars[i] = ch;
|
||||
}
|
||||
return new String(chars);
|
||||
}*/
|
||||
|
||||
public static void setScaledImage(ImageView imageView, final String path) {
|
||||
final ImageView iv = imageView;
|
||||
ViewTreeObserver viewTreeObserver = iv.getViewTreeObserver();
|
||||
@@ -104,8 +140,7 @@ public class CommonFunctions {
|
||||
});
|
||||
}
|
||||
|
||||
private static Bitmap decodeSampledBitmapFromPath(String path,
|
||||
int reqWidth, int reqHeight) {
|
||||
private static Bitmap decodeSampledBitmapFromPath(String path, int reqWidth, int reqHeight) {
|
||||
// First decode with inJustDecodeBounds = true to check dimensions
|
||||
final BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = true;
|
||||
@@ -139,7 +174,7 @@ public class CommonFunctions {
|
||||
return inSampleSize;
|
||||
}
|
||||
|
||||
public static void showAlertDialog(final Context context, String msg){
|
||||
public static void showAlertDialog(final Context context, String msg) {
|
||||
|
||||
final DialogCallbackListener[] mListener = new DialogCallbackListener[1];
|
||||
|
||||
@@ -174,12 +209,9 @@ public class CommonFunctions {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
// show it
|
||||
alertDialog.show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,9 @@ import android.os.Environment;
|
||||
/**
|
||||
* Created by yadavendras on 19-12-2016.
|
||||
*/
|
||||
|
||||
public class CommonString {
|
||||
|
||||
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||
// String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||
|
||||
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath() + "/gsk_orange_backup";
|
||||
// webservice constants
|
||||
|
||||
// preferenec keys
|
||||
public static final String KEY_USERNAME = "username";
|
||||
public static final String KEY_PASSWORD = "password";
|
||||
@@ -69,6 +64,7 @@ public class CommonString {
|
||||
|
||||
public static final String KEY_LOGIN_DONE = "IS_LOGGED_IN";
|
||||
public static final String KEY_DOWNLOAD_DONE = "IS_DOWNLOAD_DONE";
|
||||
public static final String KEY_STOCK_MAPPING = "STOCK_MAPPING";
|
||||
|
||||
//KEYS RELATED TO T2P COMPLIANCE
|
||||
|
||||
@@ -136,8 +132,8 @@ public class CommonString {
|
||||
public static final String KEY_SUB_CATEGORY = "SUB_CATEGORY";
|
||||
public static final String KEY_SUB_CATEGORY_ID = "SUB_CATEGORY_ID";
|
||||
public static final String KEY_FROM = "FROM";
|
||||
public static final String KEY_CHAT_ID= "CHAT_ID";
|
||||
public static final String KEY_MESSAGE= "MESSAGE";
|
||||
public static final String KEY_CHAT_ID = "CHAT_ID";
|
||||
public static final String KEY_MESSAGE = "MESSAGE";
|
||||
|
||||
public static final String KEY_NO_DATA = "NODATA";
|
||||
|
||||
@@ -146,11 +142,15 @@ public class CommonString {
|
||||
public static final int UNIT_VERTICAL = 50;
|
||||
public static final int UNIT_HORIZONTAL = 200;
|
||||
|
||||
public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
||||
|
||||
//temp remove
|
||||
//public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
||||
// public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
||||
public static String URL = "http://gskmeIR.parinaam.in/Gskwebservice.asmx";
|
||||
// public static String URL = "https://gskme1.parinaam.in/Gskwebservice.asmx";
|
||||
//Added new Test url for Turkey
|
||||
// public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
||||
|
||||
// public static String URL = "https://haleonme.parinaam.in/Gskwebservice.asmx";
|
||||
//public static String URL = " https://gskme1.parinaam.in/Gskwebservice.asmx";
|
||||
//public static String URL = "https://gskme-test.parinaam.in/Gskwebservice.asmx";
|
||||
|
||||
public static final String NAMESPACE = "http://tempuri.org/";
|
||||
public static final String METHOD_LOGIN = "UserLoginDetail";
|
||||
@@ -246,7 +246,11 @@ public class CommonString {
|
||||
+ KEY_COVERAGE_REMARK + " VARCHAR,"
|
||||
+ KEY_CHECKOUT_IMAGE + " VARCHAR,"
|
||||
+ KEY_STORE_FLAG + " VARCHAR,"
|
||||
+ KEY_REASON + " VARCHAR)";
|
||||
+ KEY_KEYACCOUNT_ID + " INTEGER,"
|
||||
+ KEY_STORETYPE_ID + " INTEGER,"
|
||||
+ KEY_CLASS_ID + " INTEGER,"
|
||||
+ KEY_REASON + " VARCHAR,"
|
||||
+ KEY_STOCK_MAPPING + " VARCHAR)";
|
||||
|
||||
|
||||
public static final String TABLE_COACHING_VISIT = "COACHING_VISIT";
|
||||
@@ -266,10 +270,10 @@ public class CommonString {
|
||||
|
||||
public static final String KEY_ADDRESS = "ADDRESS";
|
||||
|
||||
public static final String CREATE_TABLE_DELIVERY_CALLS= "CREATE TABLE IF NOT EXISTS " + TABLE_DELIVERY_CALLS
|
||||
public static final String CREATE_TABLE_DELIVERY_CALLS = "CREATE TABLE IF NOT EXISTS " + TABLE_DELIVERY_CALLS
|
||||
+ " ("
|
||||
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
+ KEY_STORE_NAME+ " NVARCHAR,"
|
||||
+ KEY_STORE_NAME + " NVARCHAR,"
|
||||
+ KEY_ADDRESS + " VARCHAR,"
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_IMAGE1 + " VARCHAR,"
|
||||
@@ -933,9 +937,15 @@ public class CommonString {
|
||||
|
||||
public static final String KEY_LANGUAGE_TURKISH = "TURKISH";
|
||||
public static final String KEY_RETURE_LANGUAGE_TURKISH = "TR";
|
||||
|
||||
public static final String KEY_LANGUAGE_ARABIC_KUWAIT = "ARABIC-KUWAIT";
|
||||
public static final String KEY_LANGUAGE_ARABIC_BAHRAIN = "ARABIC-BAHRAIN";
|
||||
public static final String KEY_LANGUAGE_ARABIC_OMAN = "ARABIC-OMAN";
|
||||
public static final String KEY_LANGUAGE_ARABIC_QATAR = "ARABIC-QATAR";
|
||||
public static final String KEY_LANGUAGE_ARABIC_LEBANON = "ARABIC-LEBANON";
|
||||
public static final String KEY_LANGUAGE_ARABIC_LIBIYA = "ARABIC-LIBYA";
|
||||
public static final String KEY_LANGUAGE_OMAN = "English";
|
||||
public static final String KEY_RETURE_LANGUAGE_OMAN = "EN";
|
||||
|
||||
public static final String KEY_RETURN_LANGUAGE_EGYPT = "AR";
|
||||
public static final String KEY_LANGUAGE_ARABIC_UAE = "ARABIC-UAE";
|
||||
public static final String KEY_LANGUAGE_ARABIC_EGYPT = "ARABIC-EGYPT";
|
||||
@@ -943,6 +953,11 @@ public class CommonString {
|
||||
public static final String KEY_RETURE_LANGUAGE_UAE_ARABIC = "AR";
|
||||
|
||||
public static final String TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING = "Msl_Availability_Stock_Facing_Data";
|
||||
public static final String TABLE_INSERT_STOCK_ENTRY = "STOCK_ENTRY";
|
||||
public static final String TABLE_INSERT_ORDER_TAKING_DATA = "ORDER_TAKING_DATA";
|
||||
public static final String TABLE_INSERT_ORDER_RECEIVED_DATA = "ORDER_RECEIVED_STATUS_DATA";
|
||||
public static final String POSM_STOCK = "POSM_STOCK";
|
||||
public static final String WAREHOUSE_STOCK = "WAREHOUSE_STOCK";
|
||||
|
||||
public static final String TABLE_INSERT_NO_CAMERA_FACING_DATA = "NO_CAMERA_FACING_DATA";
|
||||
|
||||
@@ -952,48 +967,78 @@ public class CommonString {
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ KEY_VISIT_DATE
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "Category_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "Brand_Id"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "SKU_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "SKU"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "SKU_SEQUENCE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "MBQ"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "COMPANY_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "FACING"
|
||||
+ " REAL,"
|
||||
|
||||
+ "STOCK"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "PRICING"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "PRICING_DEFAULT"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "TOGGLE_VALUE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "MUST_HAVE"
|
||||
+ " VARCHAR"
|
||||
+ ")";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_STOCK = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING
|
||||
+ "("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ KEY_VISIT_DATE
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "Category_Id"
|
||||
+ " INTEGER,"
|
||||
+ "Brand_Id"
|
||||
+ " VARCHAR,"
|
||||
+ "SKU_ID"
|
||||
+ " INTEGER,"
|
||||
+ "SKU"
|
||||
+ " VARCHAR,"
|
||||
+ "SKU_SEQUENCE"
|
||||
+ " VARCHAR,"
|
||||
+ "MBQ"
|
||||
+ " VARCHAR,"
|
||||
+ "COMPANY_ID"
|
||||
+ " INTEGER,"
|
||||
+ "FACING"
|
||||
+ " REAL,"
|
||||
+ "STOCK"
|
||||
+ " INTEGER,"
|
||||
+ "PRICING"
|
||||
+ " INTEGER,"
|
||||
+ "PRICING_DEFAULT"
|
||||
+ " VARCHAR,"
|
||||
+ "TOGGLE_VALUE"
|
||||
+ " VARCHAR,"
|
||||
+ "MUST_HAVE"
|
||||
+ " VARCHAR"
|
||||
+ ")";
|
||||
|
||||
public static final String KEY_ROW_NO = "ROW_NO";
|
||||
@@ -1057,7 +1102,10 @@ public class CommonString {
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "REMARK"
|
||||
+ " VARCHAR"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "MAX_LENGHT"
|
||||
+ " INTEGER"
|
||||
|
||||
+ ")";
|
||||
|
||||
@@ -1188,12 +1236,15 @@ public class CommonString {
|
||||
|
||||
public static final String TABLE_INSERT_STOCK = "Stock_Data";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_STOCK = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_STOCK
|
||||
public static final String CREATE_TABLE_INSERT_STOCK_ENTRY = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_STOCK_ENTRY
|
||||
+ "("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ KEY_VISIT_DATE
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
@@ -1218,15 +1269,29 @@ public class CommonString {
|
||||
+ "COMPANY_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "FACING"
|
||||
+ " REAL,"
|
||||
|
||||
+ "STOCK"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "PRICING"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "PRICING_DEFAULT"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ POSM_STOCK
|
||||
+ " INTEGER,"
|
||||
|
||||
+ WAREHOUSE_STOCK
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "TOGGLE_VALUE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "MUST_HAVE"
|
||||
+ " VARCHAR"
|
||||
|
||||
+ ")";
|
||||
|
||||
public static final String TABLE_INSERT_STORE_PROFILE_DATA = "Store_Profile_Data";
|
||||
@@ -1258,7 +1323,7 @@ public class CommonString {
|
||||
+ KEY_IMAGE4 + " INTEGER)";
|
||||
|
||||
public static final String TABLE_INSERT_SOS_PHARMA_DATA = "SOS_PHARMA_DATA";
|
||||
public static final String KEY_GSK_FACING= "GSK_FACING";
|
||||
public static final String KEY_GSK_FACING = "GSK_FACING";
|
||||
public static final String KEY_COMPETITION_FACING = "COMPETITION_FACING";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_SOS_PHARMA_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_INSERT_SOS_PHARMA_DATA
|
||||
@@ -1362,4 +1427,107 @@ public class CommonString {
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_EXIST + " INTEGER)";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_ORDER_TAKING_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_ORDER_TAKING_DATA
|
||||
+ " ("
|
||||
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ "IsExist"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "Sys_PO_No"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_PO_No"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "PO_Date"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "PO_IMAGE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "Category_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "BRAND_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "SKU_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "SKU"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "SKU_SEQUENCE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Order_Qty"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "COMPANY_ID"
|
||||
+ " INTEGER)";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_ORDER_RECEIVED_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_ORDER_RECEIVED_DATA
|
||||
+ " ("
|
||||
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ "Sys_PO_No"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_PO_No"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "PO_Date"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "Category_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "BRAND_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "SKU_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "SKU"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "SKU_SEQUENCE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "PO_Qty"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "ACTUAL_Qty"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "COMPANY_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "POID"
|
||||
+ " INTEGER)";
|
||||
|
||||
public static final String TABLE_VISIT_TYPE = "VISIT_TYPE";
|
||||
public static final String KEY_VISIT_ID = "VISIT_TYPE_ID";
|
||||
|
||||
public static final String CREATE_TABLE_VISIT_TYPE = "CREATE TABLE IF NOT EXISTS " + TABLE_VISIT_TYPE
|
||||
+ " ("
|
||||
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
+ KEY_STORE_ID + " INTEGER,"
|
||||
+ KEY_VISIT_DATE + " VARCHAR,"
|
||||
+ KEY_VISIT_ID + " INTEGER)";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.method.DigitsKeyListener;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -41,6 +42,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -56,18 +58,18 @@ import cpm.com.gskmtorange.xmlGetterSetter.SelectGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
|
||||
public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener{
|
||||
public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||
|
||||
private Context context;
|
||||
GSKOrangeDB db;
|
||||
String store_id, visit_date, username, intime, date;
|
||||
String categoryName, categoryId;
|
||||
String sub_category="", sub_category_id="0", brand="", brand_id="0", sku="", sku_id="0", discount="", price="", _pathforcheck = "", _path = "", img_str="", country_id;
|
||||
String sub_category = "", sub_category_id = "0", brand = "", brand_id = "0", sku = "", sku_id = "0", discount = "", price = "", _pathforcheck = "", _path = "", img_str = "", country_id;
|
||||
private SharedPreferences preferences;
|
||||
Spinner spinner_sub_category_list, spinner_brand_list, spinner_sku_list, sp_flasher;
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list;
|
||||
ArrayList<BrandMasterGetterSetter> brand_list = new ArrayList<>();
|
||||
ArrayList<SkuMasterGetterSetter> sku_list= new ArrayList<>();
|
||||
ArrayList<SkuMasterGetterSetter> sku_list = new ArrayList<>();
|
||||
Toolbar toolbar;
|
||||
FloatingActionButton fab_save, fab_add;
|
||||
|
||||
@@ -108,6 +110,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
img_cam = (ImageView) findViewById(R.id.img_promotion_add);
|
||||
lin_parent = (LinearLayout) findViewById(R.id.lin_parent_promo);
|
||||
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
||||
|
||||
context = this;
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
@@ -115,6 +118,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
et_price.setKeyListener(DigitsKeyListener.getInstance(false, true));
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
@@ -127,32 +131,30 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
//Enable camera compulsory According to Configuration
|
||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||
if(configurationData.size()>0){
|
||||
for(int i=0; i<configurationData.size();i++){
|
||||
if (configurationData.size() > 0) {
|
||||
for (int i = 0; i < configurationData.size(); i++) {
|
||||
|
||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADDITIONAL_PROMO_SKUWISE_IMAGE_MANDATORY") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
||||
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADDITIONAL_PROMO_SKUWISE_IMAGE_MANDATORY") && configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||
is_camera_compulsory = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(is_camera_compulsory){
|
||||
if (is_camera_compulsory) {
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
}
|
||||
|
||||
//Promo SKU List
|
||||
exists_data = db.getPromoComplianceSkuwiseExistsAfterData(store_id, categoryId);
|
||||
|
||||
if(exists_data.size()>0){
|
||||
if (exists_data.size() > 0) {
|
||||
isExists = exists_data.get(0).isExists();
|
||||
if(exists_data.get(0).isExists()){
|
||||
if (exists_data.get(0).isExists()) {
|
||||
added_promo_list = db.getPromoComplianceSkuwiseAfterData(store_id, categoryId);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fab_add.hide();//.setVisibility(View.GONE);
|
||||
added_promo_list.clear();
|
||||
if(promoAdapter!=null){
|
||||
if (promoAdapter != null) {
|
||||
promoAdapter.list.clear();
|
||||
promoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
@@ -163,7 +165,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
btntoggle.setChecked(isExists);
|
||||
|
||||
if(added_promo_list.size()>0){
|
||||
if (added_promo_list.size() > 0) {
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
promoAdapter = new PromoAdapter(added_promo_list);
|
||||
rec_added_promo.setAdapter(promoAdapter);
|
||||
@@ -211,7 +213,6 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_promo_compliance));
|
||||
}
|
||||
|
||||
@@ -221,7 +222,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
switch (parent.getId()) {
|
||||
case R.id.sp_sub_category:
|
||||
|
||||
if(position!=0){
|
||||
if (position != 0) {
|
||||
sub_category = sub_category_list.get(position).getSub_category();
|
||||
sub_category_id = sub_category_list.get(position).getSub_category_id();
|
||||
|
||||
@@ -236,8 +237,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
clearBrandSpinner();
|
||||
}
|
||||
@@ -246,7 +246,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
case R.id.sp_brand:
|
||||
|
||||
if(position!=0){
|
||||
if (position != 0) {
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = brand_list.get(position).getBRAND_ID().get(0);
|
||||
|
||||
@@ -261,8 +261,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
spinner_sku_list.setAdapter(adapter);
|
||||
spinner_sku_list.setOnItemSelectedListener(this);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
clearSkuSpinner();
|
||||
}
|
||||
@@ -271,7 +270,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
case R.id.sp_sku:
|
||||
|
||||
if(position!=0) {
|
||||
if (position != 0) {
|
||||
sku = sku_list.get(position).getSKU().get(0);
|
||||
sku_id = sku_list.get(position).getSKU_ID().get(0);
|
||||
}
|
||||
@@ -280,7 +279,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
case R.id.sp_flasher:
|
||||
|
||||
switch (position){
|
||||
switch (position) {
|
||||
|
||||
case 0:
|
||||
|
||||
@@ -305,7 +304,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
}
|
||||
|
||||
void clearBrandSpinner(){
|
||||
void clearBrandSpinner() {
|
||||
brand_list.clear();
|
||||
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
@@ -319,7 +318,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
}
|
||||
|
||||
void clearSkuSpinner(){
|
||||
void clearSkuSpinner() {
|
||||
sku_list.clear();
|
||||
|
||||
SkuMasterGetterSetter sku_select = new SkuMasterGetterSetter();
|
||||
@@ -337,82 +336,108 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
switch (id){
|
||||
switch (id) {
|
||||
|
||||
case R.id.fab:
|
||||
|
||||
boolean valid_flag = true;
|
||||
|
||||
if(isExists){
|
||||
if(added_promo_list.size()==0){
|
||||
if (isExists) {
|
||||
if (added_promo_list.size() == 0) {
|
||||
valid_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!valid_flag){
|
||||
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(isdata_added){
|
||||
if (!valid_flag) {
|
||||
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (isdata_added) {
|
||||
|
||||
db.InsertPromoSKUwiseData(added_promo_list, categoryId, store_id, isExists);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
/*AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
AdditionalPromoSKUwiseActivity.this);
|
||||
// set title
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||
// set dialog message
|
||||
alertDialogBuilder
|
||||
.setMessage(getResources().getString(R.string.title_activity_Want_save))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
/*String promotion_sku_wise_data_xml = "", add_promotion_data_xml = "", exists_xml = "", add_xml = "";
|
||||
|
||||
db.open();
|
||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||
promoComplianceSkuwiseExistsGetterSetters = db.getPromoComplianceSkuwiseExistsAfterData(store_id, null);
|
||||
if (promoComplianceSkuwiseExistsGetterSetters.size() > 0) {
|
||||
|
||||
for (int l = 0; l < promoComplianceSkuwiseExistsGetterSetters.size(); l++) {
|
||||
|
||||
promoComplianceSkuwiseGetterSetters = db.getPromoComplianceSkuwiseAfterData(promoComplianceSkuwiseExistsGetterSetters.get(l).get_id(), null);
|
||||
|
||||
for (int i1 = 0; i1 < promoComplianceSkuwiseGetterSetters.size(); i1++) {
|
||||
if (!promoComplianceSkuwiseGetterSetters.get(i1).getCategory_id().equals("0")) {
|
||||
|
||||
String discount_val = promoComplianceSkuwiseGetterSetters.get(i1).getDiscount_value();
|
||||
if (discount_val.equals("")) {
|
||||
discount_val = "0";
|
||||
}
|
||||
|
||||
add_xml = "[PROMOTION_DATA]"
|
||||
+ "[MID]" + "0" + "[/MID]"
|
||||
+ "[USER_ID]" + username + "[/USER_ID]"
|
||||
+ "[CATEGORY_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getCategory_id()) + "[/CATEGORY_ID]"
|
||||
+ "[SUB_CATEGORY_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getSub_category_id()) + "[/SUB_CATEGORY_ID]"
|
||||
+ "[SKU_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getSku_id()) + "[/SKU_ID]"
|
||||
+ "[BRAND_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getBrand_id()) + "[/BRAND_ID]"
|
||||
+ "[DISCOUNT_VALUE]" + discount_val + "[/DISCOUNT_VALUE]"
|
||||
+ "[PRICE]" + promoComplianceSkuwiseGetterSetters.get(i1).getPrice() + "[/PRICE]"
|
||||
+ "[PROMO_IMAGE]" + promoComplianceSkuwiseGetterSetters.get(i1).getImg() + "[/PROMO_IMAGE]"
|
||||
+ "[PRICE_FLASHER_AVAILABLE]" + promoComplianceSkuwiseGetterSetters.get(i1).getPrice_flasher() + "[/PRICE_FLASHER_AVAILABLE]"
|
||||
+ "[/PROMOTION_DATA]";
|
||||
add_promotion_data_xml = add_promotion_data_xml + add_xml;
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
// if this button is clicked, just close
|
||||
// the dialog box and do nothing
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
int exists = 0;
|
||||
if (promoComplianceSkuwiseExistsGetterSetters.get(l).isExists()) {
|
||||
exists = 1;
|
||||
}
|
||||
|
||||
// show it
|
||||
alertDialog.show();*/
|
||||
exists_xml = "[ADDITIONAL_PROMOTION_SKUWISE_DATA]"
|
||||
+ "[MID]" + "0" + "[/MID]"
|
||||
+ "[USER_ID]" + username + "[/USER_ID]"
|
||||
+ "[CATEGORY_ID]" + Integer.parseInt(promoComplianceSkuwiseExistsGetterSetters.get(l).getCategory_id()) + "[/CATEGORY_ID]"
|
||||
+ "[IS_EXISTS]" + exists + "[/IS_EXISTS]"
|
||||
+ "[ADDITIONAL_PROMOTION_DATA]" + add_promotion_data_xml + "[/ADDITIONAL_PROMOTION_DATA]"
|
||||
+ "[/ADDITIONAL_PROMOTION_SKUWISE_DATA]";
|
||||
|
||||
}else {
|
||||
promotion_sku_wise_data_xml = promotion_sku_wise_data_xml + exists_xml;
|
||||
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + promotion_sku_wise_data_xml + "[/DATA]";
|
||||
Log.d("sosdata", sos_xml);
|
||||
}*/
|
||||
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.fab_add:
|
||||
|
||||
discount = et_discount.getText().toString();
|
||||
price = et_price.getText().toString();
|
||||
|
||||
if(sub_category.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(brand.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_brand,Snackbar.LENGTH_SHORT).show();
|
||||
}else if(sku.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sku,Snackbar.LENGTH_SHORT).show();
|
||||
if (sub_category.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (brand.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (sku.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sku, Snackbar.LENGTH_SHORT).show();
|
||||
}/*else if(discount.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_enter_discount,Snackbar.LENGTH_SHORT).show();
|
||||
}*/else if(price.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_enter_price,Snackbar.LENGTH_SHORT).show();
|
||||
}else if(is_camera_compulsory && img_str.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.click_image,Snackbar.LENGTH_SHORT).show();
|
||||
}else if(price_flasher_available==-1){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_price,Snackbar.LENGTH_SHORT).show();
|
||||
}else {
|
||||
}*/ else if (price.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_enter_price, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (!price.equals("") && price.substring(0, 1).equals(".")) {
|
||||
Snackbar.make(rec_added_promo, R.string.incorrect_price, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (is_camera_compulsory && img_str.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (price_flasher_available == -1) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_price, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
PromoComplianceSkuwiseGetterSetter promo = new PromoComplianceSkuwiseGetterSetter();
|
||||
promo.setBrand(brand);
|
||||
promo.setBrand_id(brand_id);
|
||||
@@ -424,7 +449,6 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
promo.setDiscount_value(discount);
|
||||
promo.setPrice(price);
|
||||
promo.setPrice_flasher(price_flasher_available);
|
||||
|
||||
added_promo_list.add(promo);
|
||||
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
@@ -433,7 +457,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
sub_category = "";
|
||||
sub_category_id = "0";
|
||||
brand= "";
|
||||
brand = "";
|
||||
brand_id = "0";
|
||||
sku = "";
|
||||
sku_id = "0";
|
||||
@@ -449,10 +473,9 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
clearSkuSpinner();
|
||||
sp_flasher.setSelection(0);
|
||||
|
||||
if(is_camera_compulsory){
|
||||
if (is_camera_compulsory) {
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
isdata_added = true;
|
||||
@@ -462,8 +485,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
case R.id.img_promotion_add:
|
||||
|
||||
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
@@ -473,63 +495,59 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
case R.id.btntoggle:
|
||||
isExists = btntoggle.isChecked();
|
||||
|
||||
if(isExists){
|
||||
if (isExists) {
|
||||
lin_parent.setVisibility(View.VISIBLE);
|
||||
fab_add.show();//.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false).setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
fab_add.hide();//.setVisibility(View.GONE);
|
||||
added_promo_list.clear();
|
||||
fab_add.hide();//.setVisibility(View.GONE);
|
||||
added_promo_list.clear();
|
||||
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
promoAdapter = new PromoAdapter(added_promo_list);
|
||||
rec_added_promo.setAdapter(promoAdapter);
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
promoAdapter = new PromoAdapter(added_promo_list);
|
||||
rec_added_promo.setAdapter(promoAdapter);
|
||||
|
||||
/* if(promoAdapter!=null){
|
||||
promoAdapter.list.clear();
|
||||
promoAdapter.notifyDataSetChanged();
|
||||
}*/
|
||||
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
|
||||
sub_category = "";
|
||||
sub_category_id = "0";
|
||||
brand= "";
|
||||
brand_id = "0";
|
||||
sku = "";
|
||||
sku_id = "0";
|
||||
discount = "";
|
||||
price = "";
|
||||
img_str = "";
|
||||
sub_category = "";
|
||||
sub_category_id = "0";
|
||||
brand = "";
|
||||
brand_id = "0";
|
||||
sku = "";
|
||||
sku_id = "0";
|
||||
discount = "";
|
||||
price = "";
|
||||
img_str = "";
|
||||
|
||||
et_discount.setText("");
|
||||
et_price.setText("");
|
||||
spinner_sub_category_list.setSelection(0);
|
||||
clearBrandSpinner();
|
||||
clearSkuSpinner();
|
||||
if(is_camera_compulsory){
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
}
|
||||
else {
|
||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
isdata_added = true;
|
||||
et_discount.setText("");
|
||||
et_price.setText("");
|
||||
spinner_sub_category_list.setSelection(0);
|
||||
clearBrandSpinner();
|
||||
clearSkuSpinner();
|
||||
if (is_camera_compulsory) {
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
} else {
|
||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
isdata_added = true;
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//checkBox.setChecked(true);
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//checkBox.setChecked(true);
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
@@ -542,7 +560,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(_path);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -632,10 +650,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomBrandAdapter Constructor
|
||||
*****************/
|
||||
public CustomBrandAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomBrandAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
@@ -694,10 +709,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomSkuAdapter Constructor
|
||||
*****************/
|
||||
public CustomSkuAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomSkuAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
@@ -756,10 +768,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomSubCategoryAdapter Constructor
|
||||
*****************/
|
||||
public CustomSubCategoryAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomSubCategoryAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
@@ -818,8 +827,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_added_promo, parent, false);
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_added_promo, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@@ -833,10 +841,9 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
holder.tv_discount_val.setText(getString(R.string.discount_value) + " - " + mItem.getDiscount_value());
|
||||
holder.tv_price.setText(getString(R.string.price) + " - " + mItem.getPrice());
|
||||
String exists = "";
|
||||
if(mItem.getPrice_flasher()==1){
|
||||
if (mItem.getPrice_flasher() == 1) {
|
||||
exists = getString(R.string.yes);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
exists = getString(R.string.no);
|
||||
}
|
||||
holder.tv_promo_flasher_exists.setText(" - " + exists);
|
||||
@@ -973,28 +980,25 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
void ischanged(){
|
||||
if(isdata_added){
|
||||
void ischanged() {
|
||||
if (isdata_added) {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false).setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
@@ -1010,10 +1014,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomAdapter Constructor
|
||||
*****************/
|
||||
public CustomSpinnerAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomSpinnerAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
|
||||
@@ -194,13 +194,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
brand.setBRAND(str);
|
||||
brand_list.add(0, brand);
|
||||
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brand_list);
|
||||
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
|
||||
///Display List
|
||||
|
||||
DisplayMaster_list = db.getADDITIONAL_DISPLAYData(categoryId);
|
||||
|
||||
ADDITIONAL_DISPLAY_MASTERGetterSetter select = new ADDITIONAL_DISPLAY_MASTERGetterSetter();
|
||||
select.setDISPLAY_ID(str);
|
||||
DisplayMaster_list.add(0, select);
|
||||
@@ -210,9 +207,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
spinner_brand_list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
if (position != 0) {
|
||||
|
||||
brand_list_name = brand_list.get(position).getBRAND().get(0);
|
||||
brand_list_id = brand_list.get(position).getBRAND_ID().get(0);
|
||||
|
||||
@@ -830,7 +825,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
||||
@@ -1313,14 +1307,14 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
public void showSkuDialog() {
|
||||
|
||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||
/* if(country_id.equals("7")){
|
||||
/* if(country_id.equals("]")){
|
||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id);
|
||||
}
|
||||
else {
|
||||
brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId, store_id);
|
||||
}*/
|
||||
|
||||
if (country_id.equals("7")||country_id.equals("8")) {
|
||||
if (country_id.equals("7")||country_id.equals("8") ||country_id.equals("11") || country_id.equals("17")) {
|
||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
@@ -1438,7 +1432,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Create custom adapter object ( see below CustomAdapter.java )
|
||||
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brandList);
|
||||
// Set adapter to spinner
|
||||
@@ -1460,7 +1453,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||
brand_name = brandList.get(position).getBRAND().get(0);
|
||||
|
||||
if(country_id.equals("7")||country_id.equals("8")){
|
||||
if(country_id.equals("7")||country_id.equals("8")||country_id.equals("11") ||country_id.equals("17")){
|
||||
sku_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
}
|
||||
else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
@@ -1872,9 +1865,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_Additional_visibility));
|
||||
toolbar.setTitle(categoryName);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -14,6 +14,9 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.InputFilter;
|
||||
import android.text.InputType;
|
||||
import android.text.Spanned;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
@@ -35,7 +38,6 @@ import androidx.cardview.widget.CardView;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
@@ -44,6 +46,8 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
@@ -61,7 +65,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
boolean checkflag = true;
|
||||
private SharedPreferences preferences;
|
||||
String categoryName, categoryId, Error_Message = "", pathforcheck = "", _path = "", str, img_str = "", img_str2 = "";
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, store_flag_str, country_id="";
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, store_flag_str, country_id = "";
|
||||
GSKOrangeDB db;
|
||||
ArrayList<AuditDataGetterSetter> question_list = new ArrayList<>(), childListData;
|
||||
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> hashMapAnsListChildData;
|
||||
@@ -96,11 +100,8 @@ public class AuditActivity extends AppCompatActivity {
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
|
||||
toolbar.setTitle(getResources().getString(R.string.audit));
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.list);
|
||||
|
||||
db = new GSKOrangeDB(this);
|
||||
@@ -113,9 +114,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
//Header
|
||||
question_list = db.getAfterSaveAuditQuestionAnswerData(store_id, categoryId);
|
||||
if (question_list.size() == 0) {
|
||||
|
||||
question_list = getAuditQnsRemoved();
|
||||
|
||||
}
|
||||
|
||||
hashMapAnsListChildData = new HashMap<>();
|
||||
@@ -143,15 +142,39 @@ public class AuditActivity extends AppCompatActivity {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener()
|
||||
{
|
||||
@Override
|
||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy)
|
||||
{
|
||||
if (dy > 0 && fab.isShown())
|
||||
{
|
||||
fab.hide();
|
||||
}
|
||||
|
||||
if (dy < 0 && !fab.isShown())
|
||||
{
|
||||
fab.show();
|
||||
}
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public void onScrollStateChanged(RecyclerView recyclerView, int newState)
|
||||
{
|
||||
if (newState == RecyclerView.SCROLL_STATE_IDLE)
|
||||
{
|
||||
fab.show();
|
||||
}
|
||||
|
||||
super.onScrollStateChanged(recyclerView, newState);
|
||||
}*/
|
||||
});
|
||||
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
|
||||
recyclerView.clearFocus();
|
||||
|
||||
if (validateData(question_list)) {
|
||||
db.saveAuditQuestionAnswerData(question_list, store_id, categoryId);
|
||||
finish();
|
||||
@@ -163,7 +186,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
} else {
|
||||
Snackbar.make(recyclerView, getString(R.string.NodataAvailable), Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -173,11 +195,10 @@ public class AuditActivity extends AppCompatActivity {
|
||||
boolean t2p_flag = false;
|
||||
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
@@ -196,7 +217,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
if (!t2p_flag) {
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
ArrayList<AddittionalGetterSetter> additionalList = db.getAdditionalMainStock(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < additionalList.size(); i++) {
|
||||
if (additionalList.get(i).getBtn_toogle().equals("1")) {
|
||||
t2p_flag = true;
|
||||
@@ -207,7 +227,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||
@@ -219,7 +238,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
if (!t2p_flag) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,9 +257,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
// 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) {
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
@@ -250,15 +266,13 @@ public class AuditActivity extends AppCompatActivity {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
@@ -272,15 +286,12 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
@@ -299,6 +310,26 @@ public class AuditActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class DecimalDigitsInputFilter implements InputFilter {
|
||||
|
||||
Pattern mPattern;
|
||||
|
||||
public DecimalDigitsInputFilter(int digitsBeforeZero, int digitsAfterZero) {
|
||||
mPattern = Pattern.compile("[0-9]{0," + (digitsBeforeZero - 1) + "}+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||
|
||||
Matcher matcher = mPattern.matcher(dest);
|
||||
if (!matcher.matches())
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class AnswerAdapter extends RecyclerView.Adapter<AnswerAdapter.ViewHolder> {
|
||||
ArrayList<AuditDataGetterSetter> questionList;
|
||||
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> answerHashMap;
|
||||
@@ -314,44 +345,92 @@ public class AuditActivity extends AppCompatActivity {
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
public void onBindViewHolder(final AnswerAdapter.ViewHolder holder, final int position) {
|
||||
public void onBindViewHolder(final AnswerAdapter.ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
|
||||
holder.data = questionList.get(position);
|
||||
|
||||
holder.txt_question.setText(holder.data.getQUESTION());
|
||||
holder.txt_question.setId(position);
|
||||
|
||||
// Log.e("mandate_data",holder.data.getCAMERA_ALLOW()+","+holder.data.getCAMERA_MANDATORY() + "," + holder.data.getQUESTION_ID());
|
||||
|
||||
ArrayList<AuditDataGetterSetter> ans_list = answerHashMap.get(holder.data);
|
||||
|
||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown")) {
|
||||
holder.sp_auditAnswer.setVisibility(View.VISIBLE);
|
||||
holder.sp_auditAnswer.setId(position);
|
||||
holder.edt_answer.setVisibility(View.GONE);
|
||||
} else if(holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")){
|
||||
holder.edt_answer.setId(position);
|
||||
}
|
||||
else if (holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")) {
|
||||
int maxLength = Integer.parseInt(holder.data.getMaxlength());
|
||||
InputFilter[] fArray = new InputFilter[1];
|
||||
fArray[0] = new InputFilter.LengthFilter(maxLength);
|
||||
holder.edt_answer.setFilters(fArray);
|
||||
holder.edt_answer.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
holder.edt_answer.setVisibility(View.VISIBLE);
|
||||
if(country_id.equals("4")){
|
||||
holder.edt_answer.setId(position);
|
||||
if (country_id.equals("4")) {
|
||||
holder.edt_answer.setHint(R.string.pls_fill_stock_count);
|
||||
holder.edt_answer.setId(position);
|
||||
}
|
||||
|
||||
holder.sp_auditAnswer.setVisibility(View.GONE);
|
||||
holder.sp_auditAnswer.setId(position);
|
||||
|
||||
} else if (holder.data.getANSWER_TYPE().equalsIgnoreCase("DECIMAL")) {
|
||||
int maxLength = Integer.parseInt(holder.data.getMaxlength());
|
||||
holder.edt_answer.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_NUMBER_FLAG_SIGNED);
|
||||
holder.edt_answer.setFilters(new InputFilter[]{new DecimalDigitsInputFilter(maxLength, 2)});
|
||||
|
||||
holder.edt_answer.setVisibility(View.VISIBLE);
|
||||
holder.edt_answer.setId(position);
|
||||
|
||||
if (country_id.equals("4")) {
|
||||
holder.edt_answer.setHint(R.string.pls_fill_stock_count);
|
||||
}
|
||||
|
||||
holder.sp_auditAnswer.setVisibility(View.GONE);
|
||||
holder.sp_auditAnswer.setId(position);
|
||||
|
||||
} else if (holder.data.getANSWER_TYPE().equalsIgnoreCase("NUMBER")) {
|
||||
int maxLength = Integer.parseInt(holder.data.getMaxlength());
|
||||
InputFilter[] fArray = new InputFilter[1];
|
||||
fArray[0] = new InputFilter.LengthFilter(maxLength);
|
||||
holder.edt_answer.setFilters(fArray);
|
||||
holder.edt_answer.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
|
||||
holder.edt_answer.setVisibility(View.VISIBLE);
|
||||
holder.edt_answer.setId(position);
|
||||
|
||||
if (country_id.equals("4")) {
|
||||
holder.edt_answer.setHint(R.string.pls_fill_stock_count);
|
||||
}
|
||||
|
||||
holder.sp_auditAnswer.setVisibility(View.GONE);
|
||||
holder.sp_auditAnswer.setId(position);
|
||||
}
|
||||
|
||||
if (holder.data.getCAMERA_ALLOW().equals("1")) {
|
||||
holder.parent_cam_layout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
holder.parent_cam_layout.setId(position);
|
||||
} else {
|
||||
holder.parent_cam_layout.setVisibility(View.GONE);
|
||||
holder.parent_cam_layout.setId(position);
|
||||
}
|
||||
//text
|
||||
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
||||
holder.edt_text.setVisibility(View.VISIBLE);
|
||||
holder.edt_text.setId(position);
|
||||
|
||||
holder.txt_leval.setVisibility(View.VISIBLE);
|
||||
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
||||
|
||||
}
|
||||
else {
|
||||
holder.txt_leval.setId(position);
|
||||
} else {
|
||||
holder.edt_text.setVisibility(View.GONE);
|
||||
holder.edt_text.setId(position);
|
||||
holder.txt_leval.setVisibility(View.GONE);
|
||||
holder.txt_leval.setId(position);
|
||||
}
|
||||
|
||||
|
||||
|
||||
holder.sp_auditAnswer.setAdapter(new AnswerSpinnerAdapter(AuditActivity.this, R.layout.custom_spinner_item, ans_list));
|
||||
|
||||
final ArrayList<AuditDataGetterSetter> finalAns_list = ans_list;
|
||||
@@ -364,13 +443,16 @@ public class AuditActivity extends AppCompatActivity {
|
||||
holder.data.setCAMERA_ALLOW(ans.getCAMERA_ALLOW());
|
||||
holder.data.setREMARK_ALLOW(ans.getREMARK_ALLOW());
|
||||
holder.data.setREMARK_LEVEL(ans.getREMARK_LEVEL());
|
||||
holder.data.setCAMERA_MANDATORY(ans.getCAMERA_MANDATORY());
|
||||
|
||||
Log.e("mandate_data",holder.data.getCAMERA_ALLOW() + ","+ holder.data.getCAMERA_MANDATORY());
|
||||
|
||||
//text
|
||||
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
||||
holder.edt_text.setVisibility(View.VISIBLE);
|
||||
holder.txt_leval.setVisibility(View.VISIBLE);
|
||||
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
||||
}else {
|
||||
} else {
|
||||
holder.edt_text.setVisibility(View.GONE);
|
||||
holder.txt_leval.setVisibility(View.GONE);
|
||||
holder.data.setTXT_REMARK("");
|
||||
@@ -401,7 +483,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
@@ -411,8 +492,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
pathforcheck = store_id + "AuditAnsPic" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
pathforcheck = store_id + "AuditAnsPic" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + pathforcheck;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
child_position = position;
|
||||
@@ -436,8 +516,14 @@ public class AuditActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus) {
|
||||
holder.data.setANSWER_ID("0");
|
||||
holder.data.setANSWER(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("NUMBER")) {
|
||||
holder.data.setANSWER_ID("0");
|
||||
holder.data.setANSWER(((EditText) v).getText().toString().replaceFirst("^0+.(?!$)", ""));
|
||||
} else {
|
||||
holder.data.setANSWER_ID("0");
|
||||
holder.data.setANSWER(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -447,26 +533,30 @@ public class AuditActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus) {
|
||||
// holder.data.setANSWER_ID("0");
|
||||
holder.data.setTXT_REMARK(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (int i = 0; i < ans_list.size(); i++) {
|
||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown") && ans_list.get(i).getANSWER_ID().equals(holder.data.getANSWER_ID())) {
|
||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown")
|
||||
&& ans_list.get(i).getANSWER_ID().equals(holder.data.getANSWER_ID())) {
|
||||
holder.sp_auditAnswer.setSelection(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")){
|
||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")
|
||||
|| holder.data.getANSWER_TYPE().equalsIgnoreCase("DECIMAL")
|
||||
|| holder.data.getANSWER_TYPE().equalsIgnoreCase("NUMBER")) {
|
||||
holder.edt_answer.setText(holder.data.getANSWER());
|
||||
holder.edt_answer.setId(position);
|
||||
}
|
||||
//set text
|
||||
|
||||
if(holder.data.getREMARK_ALLOW().equalsIgnoreCase("1")){
|
||||
//set text
|
||||
if (holder.data.getREMARK_ALLOW().equalsIgnoreCase("1")) {
|
||||
holder.edt_text.setText(holder.data.getTXT_REMARK());
|
||||
holder.edt_text.setId(position);
|
||||
}
|
||||
|
||||
if (!img_str.equals("")) {
|
||||
@@ -487,22 +577,29 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
if (holder.data.getCAM_IMAGE().equals("")) {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
holder.img_cam.setId(position);
|
||||
|
||||
} else {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
|
||||
holder.img_cam.setId(position);
|
||||
}
|
||||
|
||||
if (holder.data.getCAM_IMAGE2().equals("")) {
|
||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
holder.img_cam2.setId(position);
|
||||
} else {
|
||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_green);
|
||||
holder.img_cam2.setId(position);
|
||||
}
|
||||
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(position)) {
|
||||
holder.card_view.setBackgroundColor(getResources().getColor(R.color.red));
|
||||
holder.card_view.setId(position);
|
||||
} else {
|
||||
holder.card_view.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.card_view.setId(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,9 +611,9 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
public final TextView txt_question,txt_leval;
|
||||
public final TextView txt_question, txt_leval;
|
||||
public final Spinner sp_auditAnswer;
|
||||
public final EditText edt_answer,edt_text;
|
||||
public final EditText edt_answer, edt_text;
|
||||
public final ImageView img_cam, img_cam2;
|
||||
public final RelativeLayout parent_cam_layout;
|
||||
CardView card_view;
|
||||
@@ -585,23 +682,26 @@ public class AuditActivity extends AppCompatActivity {
|
||||
checkHeaderArray.clear();
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if(data.get(i).getANSWER_TYPE().equalsIgnoreCase("TEXTBOX") && data.get(i).getANSWER().equalsIgnoreCase("")){
|
||||
if (data.get(i).getANSWER_TYPE().equalsIgnoreCase("TEXTBOX") && data.get(i).getANSWER().equalsIgnoreCase("")
|
||||
|| data.get(i).getANSWER_TYPE().equalsIgnoreCase("DECIMAL") && data.get(i).getANSWER().equalsIgnoreCase("")
|
||||
|| data.get(i).getANSWER_TYPE().equalsIgnoreCase("NUMBER") && data.get(i).getANSWER().equalsIgnoreCase("")) {
|
||||
error_msg = getString(R.string.pls_answer_all_qns);
|
||||
checkflag = false;
|
||||
}else if (data.get(i).getANSWER_TYPE().equalsIgnoreCase("DROPDOWN") && data.get(i).getANSWER_ID().equalsIgnoreCase("0")) {
|
||||
} else if (data.get(i).getANSWER_TYPE().equalsIgnoreCase("DROPDOWN") && data.get(i).getANSWER_ID().equalsIgnoreCase("0")) {
|
||||
error_msg = getString(R.string.pls_answer_all_qns);
|
||||
checkflag = false;
|
||||
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getCAM_IMAGE().equals("")) {
|
||||
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getCAMERA_MANDATORY().equals("1") && data.get(i).getCAM_IMAGE().equals("")) {
|
||||
error_msg = getString(R.string.click_image);
|
||||
checkflag = false;
|
||||
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getNO_OF_CAMERA().equals("2") && data.get(i).getCAM_IMAGE2().equals("")) {
|
||||
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getCAMERA_MANDATORY().equals("1")
|
||||
&& data.get(i).getNO_OF_CAMERA().equals("2") && data.get(i).getCAM_IMAGE2().equals("")) {
|
||||
error_msg = getString(R.string.click_image);
|
||||
checkflag = false;
|
||||
//text
|
||||
} else if (data.get(i).getREMARK_ALLOW().equals("1") && data.get(i).getTXT_REMARK().equals("")) {
|
||||
} else if (data.get(i).getREMARK_ALLOW().equals("1") && data.get(i).getTXT_REMARK().equals("")) {
|
||||
error_msg = getString(R.string.pleaseenterRemarks);
|
||||
checkflag = false;
|
||||
}else {
|
||||
} else {
|
||||
checkflag = true;
|
||||
}
|
||||
|
||||
@@ -620,7 +720,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
Log.i("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(_path);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||
@@ -86,25 +87,20 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
|
||||
//store_id = "2";
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
str = CommonString.FILE_PATH;
|
||||
db = new GSKOrangeDB(CategoryPicture.this);
|
||||
db.open();
|
||||
|
||||
im1 = (ImageView) findViewById(R.id.image1);
|
||||
im2 = (ImageView) findViewById(R.id.image2);
|
||||
im3 = (ImageView) findViewById(R.id.image3);
|
||||
im4 = (ImageView) findViewById(R.id.image4);
|
||||
listview = (ListView) findViewById(R.id.listview);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
|
||||
|
||||
adddata = db.getCategoryPictureData(store_id, categoryId);
|
||||
categoryImagesAllowed = db.getCategoryPictureAllowedData(categoryId);
|
||||
|
||||
if (categoryImagesAllowed.size() > 0) {
|
||||
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam1(), im1);
|
||||
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam2(), im2);
|
||||
@@ -124,36 +120,34 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
String image4 = adddata.get(0).getCategoryImage4();
|
||||
|
||||
if (image1 != null && !image1.equals("")) {
|
||||
im1.setBackgroundResource(R.mipmap.camera_green);
|
||||
im1.setImageResource(R.mipmap.camera_green);
|
||||
img_str1 = image1;
|
||||
}
|
||||
|
||||
if (image2 != null && !image2.equals("")) {
|
||||
im2.setBackgroundResource(R.mipmap.camera_green);
|
||||
im2.setImageResource(R.mipmap.camera_green);
|
||||
img_str2 = image2;
|
||||
}
|
||||
|
||||
if (image3 != null && !image3.equals("")) {
|
||||
im3.setBackgroundResource(R.mipmap.camera_green);
|
||||
im3.setImageResource(R.mipmap.camera_green);
|
||||
img_str3 = image3;
|
||||
}
|
||||
|
||||
if (image4 != null && !image4.equals("")) {
|
||||
im4.setBackgroundResource(R.mipmap.camera_green);
|
||||
im4.setImageResource(R.mipmap.camera_green);
|
||||
img_str4 = image4;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (country_id.equals("7")||country_id.equals("8")) {
|
||||
if (country_id.equals("7")||country_id.equals("8") ||country_id.equals("11")|| country_id.equals("17")) {
|
||||
listdat = db.getCategoryPicturedata(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
adapteradditional = new CategoryPicture.CategoryAdapter(CategoryPicture.this, listdat);
|
||||
listview.setAdapter(adapteradditional);
|
||||
|
||||
@@ -161,9 +155,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View view) {
|
||||
|
||||
final CategoryPictureGetterSetter CP = new CategoryPictureGetterSetter();
|
||||
|
||||
CP.setCategoryImage1(img_str1);
|
||||
CP.setCategoryImage2(img_str2);
|
||||
CP.setCategoryImage3(img_str3);
|
||||
@@ -172,9 +164,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
CP.setCamera_allow(camera_allow);
|
||||
|
||||
if (validateData(CP, listdat)) {
|
||||
|
||||
db.open();
|
||||
|
||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
@@ -233,8 +223,6 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
startCameraActivity();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
im3.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -291,8 +279,6 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -370,7 +356,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck1 != null && !_pathforcheck1.equals("")) {
|
||||
if (new File(str + _pathforcheck1).exists()) {
|
||||
|
||||
im1.setBackgroundResource(R.mipmap.camera_green);
|
||||
im1.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str1 = _pathforcheck1;
|
||||
_pathforcheck1 = "";
|
||||
@@ -379,7 +365,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck2 != null && !_pathforcheck2.equals("")) {
|
||||
if (new File(str + _pathforcheck2).exists()) {
|
||||
|
||||
im2.setBackgroundResource(R.mipmap.camera_green);
|
||||
im2.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str2 = _pathforcheck2;
|
||||
_pathforcheck2 = "";
|
||||
@@ -389,7 +375,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck3 != null && !_pathforcheck3.equals("")) {
|
||||
if (new File(str + _pathforcheck3).exists()) {
|
||||
|
||||
im3.setBackgroundResource(R.mipmap.camera_green);
|
||||
im3.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str3 = _pathforcheck3;
|
||||
_pathforcheck3 = "";
|
||||
@@ -399,7 +385,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck4 != null && !_pathforcheck4.equals("")) {
|
||||
if (new File(str + _pathforcheck4).exists()) {
|
||||
|
||||
im4.setBackgroundResource(R.mipmap.camera_green);
|
||||
im4.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str4 = _pathforcheck4;
|
||||
_pathforcheck4 = "";
|
||||
@@ -481,9 +467,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
convertView = mInflater
|
||||
.inflate(R.layout.contentcatgoryadpterlayout, null);
|
||||
holder = new CategoryPicture.CategoryAdapter.ViewHolder();
|
||||
|
||||
holder.brand = (TextView) convertView.findViewById(R.id.textviewname);
|
||||
|
||||
holder.camera1 = (Button) convertView.findViewById(R.id.button3);
|
||||
holder.camera2 = (Button) convertView.findViewById(R.id.cameranew);
|
||||
convertView.setTag(holder);
|
||||
@@ -492,26 +476,29 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
}
|
||||
|
||||
holder.camera1.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
//Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
/* if(CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "").contains("????")){
|
||||
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + new Random().nextInt(999999) + ".jpg";
|
||||
}
|
||||
else{
|
||||
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "") + ".jpg";
|
||||
}*/
|
||||
|
||||
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "") + ".jpg";
|
||||
Adapterposition = position1;
|
||||
|
||||
// Log.e("Camimage",Camerapath1);
|
||||
_path = CommonString.FILE_PATH + Camerapath1;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
// intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(mcontext);
|
||||
startCameraActivity();
|
||||
|
||||
listview.invalidateViews();
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
holder.camera2.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -519,15 +506,16 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
Snackbar.make(listview,R.string.first_click_compulsory_image,Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
else {
|
||||
Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
// Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "") + ".jpg";
|
||||
Adapterposition = position1;
|
||||
_path = CommonString.FILE_PATH + Camerapath2;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(mcontext);
|
||||
// intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
startCameraActivity();
|
||||
listview.invalidateViews();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
holder.brand.setText(list.get(position1).getSUB_CATEGORY().toString());
|
||||
@@ -553,9 +541,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
holder.camera2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
|
||||
|
||||
holder.brand.setId(position1);
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
@@ -680,9 +666,9 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
public void setCamAllowImage(boolean isAllowed, ImageView img_cam) {
|
||||
|
||||
if (isAllowed) {
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
img_cam.setImageResource(R.drawable.camera_orange_star_green);
|
||||
} else {
|
||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
img_cam.setImageResource(R.mipmap.camera_orange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +359,6 @@ else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(C
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(CheckoutActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
|
||||
@@ -58,17 +58,13 @@ import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
|
||||
public class ConversationActivity extends AppCompatActivity {
|
||||
|
||||
String userId, culture_id, store_id, chat_id, message_main, visit_date;
|
||||
private SharedPreferences preferences = null;
|
||||
|
||||
GSKOrangeDB db;
|
||||
private Context context;
|
||||
ArrayList<ChatMessageGetterSetter> conversation_list = new ArrayList<>();
|
||||
|
||||
MyRecyclerAdapter adapter;
|
||||
RecyclerView rec;
|
||||
|
||||
EditText et_reply;
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
|
||||
@@ -46,10 +46,10 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
|
||||
GSKOrangeDB db;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, store_flag_str;
|
||||
String categoryName, categoryId,country_id;
|
||||
String categoryName, categoryId, country_id;
|
||||
private SharedPreferences preferences;
|
||||
MSL_AvailabilityStockFacingGetterSetter brand_selected;
|
||||
int number_of_rows=0;
|
||||
int number_of_rows = 0;
|
||||
RecyclerView rec_sub_category;
|
||||
static int FROM_DIALOG = 0;
|
||||
static int FROM_CLICK = 1;
|
||||
@@ -98,35 +98,28 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
number_of_rows=0;
|
||||
number_of_rows = 0;
|
||||
brand_selected = null;
|
||||
|
||||
db.open();
|
||||
|
||||
added_sub_category_list = new ArrayList<>();
|
||||
|
||||
//kenya use
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId,store_id,country_id);
|
||||
|
||||
for(int i=0; i<sub_category_list.size(); i++){
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId, store_id, country_id);
|
||||
|
||||
for (int i = 0; i < sub_category_list.size(); i++) {
|
||||
ArrayList<NoCameraDataGetterSetter> noCameraLastVisitData;
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id(), CommonString.TABLE_NO_CAMERA_LAST_VISIT_DATA_ADHOC);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId,
|
||||
sub_category_list.get(i).getSub_category_id(), CommonString.TABLE_NO_CAMERA_LAST_VISIT_DATA_ADHOC);
|
||||
} else {
|
||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id(),
|
||||
"NO_CAMERA_LAST_VISIT_DATA");
|
||||
}
|
||||
else {
|
||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id(), "NO_CAMERA_LAST_VISIT_DATA");
|
||||
}
|
||||
if(db.getNoCameraCategoryDataInserted(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size()>0){
|
||||
|
||||
if (db.getNoCameraCategoryDataInserted(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size() > 0) {
|
||||
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||
added_sub_category_list.add(subCategory);
|
||||
}
|
||||
else if(noCameraLastVisitData.size()>0){
|
||||
} else if (noCameraLastVisitData.size() > 0) {
|
||||
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||
@@ -134,7 +127,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
if(added_sub_category_list.size()>0){
|
||||
if (added_sub_category_list.size() > 0) {
|
||||
rec_sub_category.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
SubcategoryAdapter skuAdapter = new SubcategoryAdapter(added_sub_category_list);
|
||||
rec_sub_category.setAdapter(skuAdapter);
|
||||
@@ -151,13 +144,11 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public void showSkuDialog() {
|
||||
|
||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId,store_id,country_id);
|
||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId, store_id, country_id);
|
||||
MSL_AvailabilityStockFacingGetterSetter brand = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
brand.setSub_category("select");
|
||||
sub_category_list.add(0, brand);
|
||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||
|
||||
final Dialog dialog = new Dialog(CreateSelfActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
@@ -173,28 +164,25 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if(brand_selected==null){
|
||||
Snackbar.make(btn_create,"Please select Sub Category",Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(number_of_rows==0){
|
||||
Snackbar.make(btn_create,"Please select number of rows",Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
if (brand_selected == null) {
|
||||
Snackbar.make(btn_create, "Please select Sub Category", Snackbar.LENGTH_SHORT).show();
|
||||
} else if (number_of_rows == 0) {
|
||||
Snackbar.make(btn_create, "Please select number of rows", Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
|
||||
boolean sub_category_already_filled = false;
|
||||
if(added_sub_category_list.size()>0){
|
||||
for(int k=0;k<added_sub_category_list.size();k++){
|
||||
if(added_sub_category_list.get(k).getSub_category_id().equals(brand_selected.getSub_category_id())){
|
||||
if (added_sub_category_list.size() > 0) {
|
||||
for (int k = 0; k < added_sub_category_list.size(); k++) {
|
||||
if (added_sub_category_list.get(k).getSub_category_id().equals(brand_selected.getSub_category_id())) {
|
||||
sub_category_already_filled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(sub_category_already_filled){
|
||||
Snackbar.make(btn_create,"Sub Category already added",Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
if (sub_category_already_filled) {
|
||||
Snackbar.make(btn_create, "Sub Category already added", Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Intent in = new Intent(context, NoCameraActivity.class);
|
||||
in.putExtra("categoryName", categoryName);
|
||||
in.putExtra("categoryId", categoryId);
|
||||
@@ -228,7 +216,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
|
||||
final ArrayList<String> no_of_rows = new ArrayList<>();
|
||||
no_of_rows.add(getString(R.string.select));
|
||||
for(int i=1; i<9; i++){
|
||||
for (int i = 1; i < 9; i++) {
|
||||
no_of_rows.add(i + "");
|
||||
}
|
||||
CustomSpinnerAdapter skuadapter = new CustomSpinnerAdapter(CreateSelfActivity.this, R.layout.custom_spinner_item, no_of_rows);
|
||||
@@ -241,8 +229,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
|
||||
if (position != 0) {
|
||||
brand_selected = sub_category_list.get(position);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
brand_selected = null;
|
||||
}
|
||||
|
||||
@@ -260,8 +247,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
|
||||
if (position != 0) {
|
||||
number_of_rows = Integer.parseInt(no_of_rows.get(position));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
number_of_rows = 0;
|
||||
}
|
||||
|
||||
@@ -493,7 +479,6 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
super(view);
|
||||
|
||||
mView = view;
|
||||
|
||||
tv_sub_category = (TextView) mView.findViewById(R.id.tv_sub_category);
|
||||
parentLayout = (LinearLayout) mView.findViewById(R.id.linear_parent);
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.content.res.Resources;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@@ -91,13 +92,11 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
Snackbar.make(v, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void showDatePickerDialog(int year, int month, int day) {
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(this, pickerListener, year, month, day);
|
||||
// ((ViewGroup) datePickerDialog.getDatePicker()).findViewById(Resources.getSystem().getIdentifier("year", "id", "android")).setVisibility(View.GONE);
|
||||
//datePickerDialog.findViewById(Resources.getSystem().getIdentifier("year", "id", "android")).setVisibility(View.GONE);
|
||||
@@ -195,19 +194,17 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
Log.d("requestdata",request.toString());
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
Object resultFuturedata = (Object) envelope.getResponse();
|
||||
|
||||
if (resultFuturedata.toString() != null) {
|
||||
|
||||
xpp.setInput(new StringReader(resultFuturedata.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
|
||||
journeyPlanPreviousGetterSetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
||||
|
||||
}
|
||||
return "Success";
|
||||
} catch (XmlPullParserException e) {
|
||||
@@ -236,7 +233,6 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
MyListAdapter adapter = new MyListAdapter(context, journeyPlanPreviousGetterSetter);
|
||||
futureJcpList.setLayoutManager(new LinearLayoutManager(context));
|
||||
futureJcpList.setAdapter(adapter);
|
||||
|
||||
} else {
|
||||
|
||||
Snackbar.make(futureJcpList,R.string.no_route_plan_for_day,Snackbar.LENGTH_SHORT).show();
|
||||
@@ -275,11 +271,8 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
|
||||
// NavUtils.navigateUpFromSameTask(this);
|
||||
finish();
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@@ -302,7 +295,6 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
|
||||
if (holder != null) {
|
||||
holder.txt_store_cd.setText(journeyPlanPreviousGetterSetter.getSTORE_ID().get(position));
|
||||
holder.txt_keyacct.setText(journeyPlanPreviousGetterSetter.getKEYACCOUNT().get(position));
|
||||
@@ -313,10 +305,8 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
|
||||
return journeyPlanPreviousGetterSetter.getSTORE_ID().size();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||
|
||||
public class MessageActivity extends AppCompatActivity {
|
||||
|
||||
//ArrayList<MessageGetterSetter> messages;
|
||||
private Context context;
|
||||
String categoryName = "", categoryId;
|
||||
@@ -121,10 +120,8 @@ public class MessageActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar.setTitle(getString(R.string.title_activity_message));
|
||||
|
||||
new DowloadAsync(MessageActivity.this).execute();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
@@ -67,9 +66,7 @@ import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||
|
||||
public class NewStockDataActivity extends AppCompatActivity implements DialogCallbackListener{
|
||||
|
||||
public class NewStockDataActivity extends AppCompatActivity implements DialogCallbackListener {
|
||||
private Context context;
|
||||
ExpandableListView expandableListView;
|
||||
TextView txt_mslAvailabilityName;
|
||||
@@ -84,7 +81,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
||||
GSKOrangeDB db;
|
||||
String categoryName, categoryId, storeId, Error_Message = "";
|
||||
String store_id,store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||
boolean isDialogOpen = true;
|
||||
private SharedPreferences preferences;
|
||||
int scrollPosition = 0;
|
||||
@@ -171,12 +168,19 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
db.open();
|
||||
|
||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
/*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();
|
||||
}*/
|
||||
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId, visit_date)) {
|
||||
db.updateMSL_Availability_StockFacingNew(visit_date, 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_StockFacingNew(visit_date, 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);
|
||||
@@ -303,50 +307,6 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
/* view = (RelativeLayout)findViewById(R.id.content_msl__availability);
|
||||
//bmImage = (ImageView)findViewById(R.id.image);
|
||||
|
||||
view.setDrawingCacheEnabled(true);
|
||||
// this is the important code :)
|
||||
// Without it the view will have a dimension of 0,0 and the bitmap will be null
|
||||
|
||||
view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
|
||||
|
||||
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
|
||||
|
||||
view.buildDrawingCache(true);
|
||||
final Bitmap b = Bitmap.createBitmap(view.getDrawingCache());
|
||||
view.setDrawingCacheEnabled(false); // clear drawing cache
|
||||
|
||||
//bmImage.setImageBitmap(b);
|
||||
|
||||
try{
|
||||
|
||||
|
||||
File yourFile = new File(FILE_PATH+"imgForTxt.png");
|
||||
yourFile.createNewFile(); // if file already exists will do nothing
|
||||
final FileOutputStream stream = new FileOutputStream(yourFile, false); //create your FileOutputStream here
|
||||
|
||||
new Thread(new Runnable() {
|
||||
public void run(){
|
||||
b.compress(Bitmap.CompressFormat.PNG, 85, stream);
|
||||
b.recycle();
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -670,28 +630,37 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
//Header
|
||||
if (country_id.equals("7")) {
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET,store_flag_hide);
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC,store_flag_hide);
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC, store_flag_hide);
|
||||
} else {
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET,store_flag_hide);
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||
}
|
||||
|
||||
|
||||
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)) {
|
||||
if (country_id.equals("7")) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,store_flag_hide);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC,store_flag_hide);
|
||||
} else {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,store_flag_hide);
|
||||
}
|
||||
//childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (country_id.equals("7")) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide, visit_date, false);
|
||||
updateCoverage(CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,store_flag_hide);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC,store_flag_hide);
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC, store_flag_hide, visit_date, false);
|
||||
updateCoverage(CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,store_flag_hide);
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(), categoryId,
|
||||
headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK, store_flag_hide, visit_date, false);
|
||||
updateCoverage(CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
@@ -938,7 +907,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
|
||||
if (headerTitle.getCompany_id().equals("1")) {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||
} else {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
@@ -948,6 +917,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||
} else {
|
||||
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
@@ -1014,7 +984,6 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
holder.facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
||||
holder.facing.setFilters(new InputFilter[]{new NewStockDataActivity.DecimalDigitsInputFilter(3, 1)});
|
||||
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
||||
|
||||
holder.stock_view = convertView.findViewById(R.id.stock_view);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
@@ -1025,12 +994,13 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
holder.txt_mbq.setText(childData.getMbq());
|
||||
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
|
||||
holder.txt_mbq.setVisibility(View.VISIBLE);
|
||||
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||
holder.facing.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
if (country_id.equals("6")) {
|
||||
holder.stock.setVisibility(View.VISIBLE);
|
||||
holder.stock_view.setVisibility(View.VISIBLE);
|
||||
@@ -1115,18 +1085,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
childData.setFacing("");
|
||||
}
|
||||
}
|
||||
|
||||
/* else {
|
||||
if (finalHolder.facing.getText().toString() != null && !finalHolder.facing.getText().toString().equals("")) {
|
||||
if (Integer.parseInt(finalHolder.facing.getText().toString()) >= 0
|
||||
&& Integer.parseInt(finalHolder.facing.getText().toString()) >= Integer.parseInt(childData.getMbq())) {
|
||||
childData.setFacing("");
|
||||
finalHolder.facing.setText("");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
expandableListView.clearFocus();
|
||||
expandableListView.invalidateViews();
|
||||
}
|
||||
@@ -1523,11 +1482,13 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
if (tempflag) {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
} else {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -1543,11 +1504,12 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
if (tempflag) {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
} else {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -1575,6 +1537,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
ToggleButton toggle_available;
|
||||
LinearLayout lin_category;
|
||||
EditText facing, stock;
|
||||
|
||||
View stock_view;
|
||||
}
|
||||
|
||||
@@ -1641,6 +1604,9 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
private void updateCoverage(String table) {
|
||||
long l = db.updateStockMapping(store_id, visit_date, table);
|
||||
if (l > 0) Log.e("CoverageUpdate", "" + l);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,6 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
@Override
|
||||
public boolean onLongClick(View tvView) {
|
||||
showDeleteDialog(tvView);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -1063,7 +1062,7 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList;
|
||||
|
||||
|
||||
if (country_id.equals("7")) {
|
||||
if (country_id.equals("7")||country_id.equals("8")||country_id.equals("11")) {
|
||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, null, null, store_id, CommonString.TABLE_MAPPING_PLANOGRAM_STORE_WISE);
|
||||
} else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, storeType_id, class_id, null, CommonString.TABLE_MAPPING_PLANOGRAM_ADHOC);
|
||||
@@ -1202,12 +1201,10 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
|
||||
void addRow(){
|
||||
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
||||
|
||||
// first Button
|
||||
RelativeLayout rLayout = new RelativeLayout(context);
|
||||
RelativeLayout.LayoutParams lprams = new RelativeLayout.LayoutParams(
|
||||
RelativeLayout.LayoutParams.MATCH_PARENT,
|
||||
RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
TextView tv = new TextView(context);
|
||||
//tv.setHeight(60);
|
||||
tv.setTextSize(20);
|
||||
@@ -1217,21 +1214,15 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
tv.setLayoutParams(lprams);
|
||||
int tv_id = View.generateViewId();
|
||||
tv.setId(tv_id);
|
||||
|
||||
//set dynamic textview id to object
|
||||
dynamic_ids.setTextview_id(tv_id);
|
||||
|
||||
RecyclerView rec_bottom = new RecyclerView(context);
|
||||
int rec_id = View.generateViewId();
|
||||
|
||||
//set dynamic recycler id to object
|
||||
dynamic_ids.setRecycler_id(rec_id);
|
||||
|
||||
rec_bottom.setLayoutParams(lprams);
|
||||
rec_bottom.setPadding(0, 0, 0, 0);
|
||||
|
||||
rec_bottom.setVisibility(View.GONE);
|
||||
|
||||
rec_bottom.setId(rec_id);
|
||||
rec_bottom.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
private ProgressBar pb;
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
boolean nonflag=true;
|
||||
String store_flag_str;
|
||||
String store_flag_str,country_id, keyAccount_id, class_id, storeType_id;
|
||||
|
||||
TextView tv_remark;
|
||||
|
||||
@@ -117,7 +117,6 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.nonworkingmainlayout);
|
||||
|
||||
reasonspinner = (Spinner) findViewById(R.id.spinner_reason);
|
||||
camera = (ImageButton) findViewById(R.id.imgcam);
|
||||
save = (Button) findViewById(R.id.save);
|
||||
@@ -126,24 +125,21 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
reason_lay = (RelativeLayout) findViewById(R.id.layout_reason);
|
||||
rel_cam = (RelativeLayout) findViewById(R.id.relimgcam);
|
||||
subreason_spinner = (Spinner) findViewById(R.id.spinner_sub_reason);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
context = this;
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
|
||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
//store_id = preferences.getString(CommonString.KEY_STORE_ID, "");
|
||||
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
@@ -496,13 +492,22 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
cdata.setLongitude("0.0");
|
||||
cdata.setImage(image1);
|
||||
cdata.setSub_reasonId(sub_reason_id);
|
||||
|
||||
cdata.setRemark(text.getText().toString().replaceAll("[&^<>{}'$]", " "));
|
||||
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
||||
cdata.setFlag_from(store_flag_str);
|
||||
|
||||
database.InsertCoverageData(cdata);
|
||||
if (country_id.equals("7") || country_id.equals("8")) {
|
||||
cdata.setKeyAccountId("0");
|
||||
cdata.setStoreTypeId("0");
|
||||
cdata.setClassId("0");
|
||||
} else {
|
||||
cdata.setKeyAccountId(keyAccount_id);
|
||||
cdata.setStoreTypeId(storeType_id);
|
||||
cdata.setClassId(class_id);
|
||||
}
|
||||
|
||||
database.open();
|
||||
database.InsertCoverageData(cdata);
|
||||
database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, store_flag_str);
|
||||
|
||||
|
||||
@@ -541,34 +546,27 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
||||
cdata.setFlag_from(store_flag_str);
|
||||
|
||||
if (country_id.equals("7") || country_id.equals("8")) {
|
||||
cdata.setKeyAccountId("0");
|
||||
cdata.setStoreTypeId("0");
|
||||
cdata.setClassId("0");
|
||||
} else {
|
||||
cdata.setKeyAccountId(keyAccount_id);
|
||||
cdata.setStoreTypeId(storeType_id);
|
||||
cdata.setClassId(class_id);
|
||||
}
|
||||
database.open();
|
||||
database.InsertCoverageData(cdata);
|
||||
|
||||
//database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, CommonString.FROM_JCP);
|
||||
database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, store_flag_str);
|
||||
|
||||
SharedPreferences.Editor editor = preferences
|
||||
.edit();
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS + store_id, "No");
|
||||
editor.putString(
|
||||
CommonString.KEY_STOREVISITED_STATUS,
|
||||
"");
|
||||
editor.putString(
|
||||
CommonString.KEY_STORE_IN_TIME,
|
||||
"");
|
||||
editor.putString(
|
||||
CommonString.KEY_LATITUDE,
|
||||
"");
|
||||
editor.putString(
|
||||
CommonString.KEY_LONGITUDE,
|
||||
"");
|
||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||
editor.putString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
editor.putString(CommonString.KEY_LATITUDE, "");
|
||||
editor.putString(CommonString.KEY_LONGITUDE, "");
|
||||
editor.commit();
|
||||
|
||||
}
|
||||
|
||||
new NonWorkingReason.GeoTagUpload(NonWorkingReason.this).execute();
|
||||
|
||||
// finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.closed,
|
||||
|
||||
@@ -28,16 +28,14 @@ import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
||||
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
||||
|
||||
public class SettingsActivity extends AppCompatActivity implements SelectLanguageFragment.OnFragmentInteractionListener {
|
||||
|
||||
String selected_lang = "", culture_id, notice_url;
|
||||
private Context context;
|
||||
FloatingActionButton fab;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
|
||||
private SharedPreferences.Editor editor = null;
|
||||
|
||||
Toolbar toolbar;
|
||||
private static final String SELECTED_ITEM_POSITION = "ItemPosition";
|
||||
private int mPosition;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -47,11 +45,9 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
setSupportActionBar(toolbar);
|
||||
context = this;
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
editor = preferences.edit();
|
||||
|
||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
/* SettingsActivityFragment fragment = new SettingsActivityFragment();
|
||||
@@ -61,37 +57,27 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (selected_lang.equals("")) {
|
||||
|
||||
Snackbar.make(view, getString(R.string.select_language), Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
Snackbar.make(view, getString(R.string.select_language), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else {
|
||||
|
||||
CommonFunctions.updateLangResources(context,selected_lang);
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, selected_lang);
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id);
|
||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, notice_url);
|
||||
editor.commit();
|
||||
|
||||
Intent startDownload = new Intent(context, MainActivity.class);
|
||||
startActivity(startDownload);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentInteraction(String selected_lang, String culture_id, String notice_url) {
|
||||
|
||||
this.selected_lang = selected_lang;
|
||||
this.culture_id = culture_id;
|
||||
this.notice_url = notice_url;
|
||||
|
||||
if (!selected_lang.equals("")) {
|
||||
fab.show();
|
||||
}
|
||||
@@ -139,5 +125,18 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
toolbar.setTitle(R.string.title_activity_settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(final Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
// Save the state of item position
|
||||
outState.putInt(SELECTED_ITEM_POSITION, mPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(final Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
// Read the state of item position
|
||||
mPosition = savedInstanceState.getInt(SELECTED_ITEM_POSITION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -121,12 +121,11 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
alert.show();*/
|
||||
|
||||
db.open();
|
||||
|
||||
if (db.checkStockData(store_id, categoryId)) {
|
||||
db.updateStockData(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
if (db.checkStockData(store_id, categoryId, visit_date)) {
|
||||
db.updateStockData(store_id, categoryId, visit_date, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else {
|
||||
db.InsertStockData(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
db.InsertStockData(store_id, categoryId, visit_date, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
finish();
|
||||
@@ -234,45 +233,45 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
db.open();
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
try {
|
||||
hashMapListHeaderData = new ArrayList<>();
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
//Header
|
||||
if(country_id.equals("7")){
|
||||
if (country_id.equals("7")) {
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||
} else {
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id,CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC);
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id,CommonString.TABLE_MAPPING_STOCK_ADDITIONAL, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||
}
|
||||
else{
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id,CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||
}
|
||||
|
||||
|
||||
if (headerDataList.size() > 0) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
//childDataList = new ArrayList<>();
|
||||
childDataList = db.getStockAfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
if (country_id.equals("7")) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,"0");
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC,"0");
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL,"0");
|
||||
} else {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,"0");
|
||||
}
|
||||
//childDataList = db.getStockAfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (country_id.equals("7")) {
|
||||
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,"0");
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE, "0", visit_date, true);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC, "0", visit_date, true);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(), categoryId,
|
||||
headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADDITIONAL, "0", visit_date, true);
|
||||
} else {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK, "0", visit_date, true);
|
||||
}
|
||||
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
@@ -330,7 +329,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
|
||||
if (headerTitle.getCompany_id().equals("1")) {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||
} else {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
@@ -339,7 +338,10 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
// card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||
|
||||
} else {
|
||||
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
@@ -412,7 +414,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
holder.txt_skuName.setText(childData.getSku());
|
||||
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
|
||||
} else {
|
||||
|
||||
@@ -465,11 +467,12 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
if (tempflag) {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
} else {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -491,11 +494,13 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
if (tempflag) {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
} else {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -593,6 +598,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
return all_flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (editFlag) {
|
||||
|
||||
@@ -135,12 +135,19 @@ public class StockDataActivity extends AppCompatActivity implements DialogCallba
|
||||
|
||||
db.open();
|
||||
|
||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
/*if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
db.updateMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, 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(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}*/
|
||||
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId,visit_date)) {
|
||||
db.updateMSL_Availability_StockFacingNew(visit_date,store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else {
|
||||
db.InsertMSL_Availability_StockFacingNew(visit_date,store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, 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);
|
||||
@@ -276,6 +283,7 @@ public class StockDataActivity extends AppCompatActivity implements DialogCallba
|
||||
}
|
||||
else {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, null, CommonString.TABLE_MAPPING_STOCK,"0");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
private SharedPreferences preferences;
|
||||
|
||||
String categoryName, categoryId, Error_Message = "";
|
||||
String store_id,store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||
GSKOrangeDB db;
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList= new ArrayList<>();
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList = new ArrayList<>();
|
||||
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||
ExpandableListAdapter adapter;
|
||||
@@ -59,7 +59,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
boolean checkflag = true;
|
||||
|
||||
FloatingActionButton fab;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -116,17 +116,18 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
//Header
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET,store_flag_hide);
|
||||
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||
|
||||
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(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,"0");
|
||||
}
|
||||
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,"0");
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK, "0", visit_date, false);
|
||||
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
}
|
||||
@@ -263,7 +264,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
|
||||
if (headerTitle.getCompany_id().equals("1")) {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||
} else {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
@@ -273,6 +274,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||
} else {
|
||||
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
@@ -359,7 +361,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
holder.et_price.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if(!hasFocus){
|
||||
if (!hasFocus) {
|
||||
final EditText caption = (EditText) v;
|
||||
String edStock = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||
|
||||
@@ -383,11 +385,12 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
|
||||
if (tempflag) {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
} else {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -403,11 +406,12 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
|
||||
if (tempflag) {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
} else {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
@@ -196,7 +196,6 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
break;
|
||||
|
||||
case R.id.btn_save_selfie:
|
||||
|
||||
if (img_str != null) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||
|
||||
@@ -98,7 +98,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
String _pathforcheck, _path, str;
|
||||
|
||||
String store_id, visit_date, username, intime, date, _UserId, store_flag_str, country_id;
|
||||
String store_id, visit_date, username, intime, date, _UserId, store_flag_str, country_id, keyAccount_id, class_id, storeType_id;
|
||||
private SharedPreferences preferences;
|
||||
AlertDialog alert;
|
||||
String img_str, strflag;
|
||||
@@ -110,11 +110,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
Toolbar toolbar;
|
||||
boolean ResultFlag = true;
|
||||
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
||||
|
||||
String VISIT_TYPE_ID = "";
|
||||
LocationManager locationManager;
|
||||
boolean enabled;
|
||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
||||
|
||||
private LocationRequest mLocationRequest;
|
||||
private static int UPDATE_INTERVAL = 500; // 5 sec
|
||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||
@@ -131,29 +130,25 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
||||
img_clicked = (ImageView) findViewById(R.id.img_cam_selfie);
|
||||
|
||||
btn_save = (Button) findViewById(R.id.btn_save_selfie);
|
||||
|
||||
//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);
|
||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
// store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
|
||||
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
VISIT_TYPE_ID = getIntent().getStringExtra("VISIT_TYPE_ID");
|
||||
// Log.e("visittypeid",VISIT_TYPE_ID);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
|
||||
@@ -167,7 +162,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
// Building the GoogleApi client
|
||||
buildGoogleApiClient();
|
||||
|
||||
createLocationRequest();
|
||||
}
|
||||
|
||||
@@ -489,27 +483,31 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
break;
|
||||
|
||||
case R.id.btn_save_selfie:
|
||||
|
||||
if (img_str != null) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||
|
||||
String status;
|
||||
//if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase(CommonString.COUNTRY_ID_EGYPT +"")
|
||||
// || store_flag_str.equals(CommonString.FROM_ADDITIONAL) || store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5")
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase("15")
|
||||
|| store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||
status = CommonString.KEY_INVALID;
|
||||
} else {
|
||||
status = CommonString.KEY_VALID;
|
||||
}
|
||||
if (VISIT_TYPE_ID != null) {
|
||||
if (country_id.equals("2") && (VISIT_TYPE_ID.equals("1") || VISIT_TYPE_ID.equals("3"))) {
|
||||
status = CommonString.KEY_INVALID;
|
||||
} else {
|
||||
status = CommonString.KEY_VALID;
|
||||
}
|
||||
} else {
|
||||
status = CommonString.KEY_VALID;
|
||||
}
|
||||
|
||||
}
|
||||
CoverageBean cdata = new CoverageBean();
|
||||
cdata.setStoreId(store_id);
|
||||
cdata.setVisitDate(visit_date);
|
||||
@@ -522,24 +520,32 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
cdata.setImage(img_str);
|
||||
cdata.setSub_reasonId("0");
|
||||
cdata.setRemark("");
|
||||
|
||||
cdata.setStatus(status);
|
||||
|
||||
cdata.setCheckOut_Image("");
|
||||
cdata.setFlag_from(store_flag_str);
|
||||
|
||||
database.InsertCoverageData(cdata);
|
||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||
cdata.setKeyAccountId("0");
|
||||
cdata.setStoreTypeId("0");
|
||||
cdata.setClassId("0");
|
||||
} else {
|
||||
cdata.setKeyAccountId(keyAccount_id);
|
||||
cdata.setStoreTypeId(storeType_id);
|
||||
cdata.setClassId(class_id);
|
||||
}
|
||||
|
||||
database.open();
|
||||
database.InsertCoverageData(cdata);
|
||||
String table;
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN;
|
||||
} else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL)) {
|
||||
} else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN_ADDITIONAL;
|
||||
} else if (store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN_PHARMA;
|
||||
}else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
||||
} else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
||||
table = CommonString.KEY_ADHOC_JOURNEYPLAN_ADDITIONAL;
|
||||
} else{
|
||||
} else {
|
||||
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
||||
}
|
||||
|
||||
@@ -592,7 +598,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
//android.os.FileUriExposedException: file:///storage/emulated/0/.GSK_MT_ORANGE_IMAGES/15024SI_01022019_120426.jpg exposed beyond app through ClipData.Item.getUri()
|
||||
//outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -640,9 +646,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
//Crashlytics.logException(e.getCause());
|
||||
//Crashlytics.logException(new Exception(e.getCause()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,12 +662,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
|
||||
//temp check--------
|
||||
/*File file = new File(str + _pathforcheck);
|
||||
saveBitmapToFileSmaller(file);*/
|
||||
//saveBitmapToFile(file);
|
||||
//-------------------
|
||||
|
||||
try {
|
||||
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
||||
@@ -711,7 +708,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
if (mGoogleApiClient.isConnected()) {
|
||||
startLocationUpdates();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*protected void onStart() {
|
||||
@@ -730,7 +726,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
||||
|
||||
private Context context;
|
||||
@@ -770,56 +765,50 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
String service;
|
||||
|
||||
if(coverage.get(0).getFlag_from().equals(CommonString.FROM_ADDITIONAL)){
|
||||
if (coverage.get(0).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
||||
service = CommonString.METHOD_UPLOAD_CURRENT_DATA_ADDITIONAL;
|
||||
}
|
||||
else if(coverage.get(0).getFlag_from().equals(CommonString.FROM_PHARMA)){
|
||||
} else if (coverage.get(0).getFlag_from().equals(CommonString.FROM_PHARMA)) {
|
||||
service = CommonString.METHOD_UPLOAD_CURRENT_DATA_PHARMA;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
service = CommonString.METHOD_UPLOAD_CURRENT_DATA;
|
||||
|
||||
}
|
||||
|
||||
String current_xml = "";
|
||||
|
||||
if (coverage.size() > 0) {
|
||||
|
||||
//for (int i = 0; i < coverage.size(); i++) {
|
||||
|
||||
String onXML = "[Coverage_Intime][USER_ID]"
|
||||
+ _UserId
|
||||
+ "[/USER_ID]"
|
||||
+ "[STORE_ID]"
|
||||
+ coverage.get(0).getStoreId()
|
||||
+ "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]"
|
||||
+ coverage.get(0).getVisitDate()
|
||||
+ "[/VISIT_DATE]"
|
||||
+ "[IN_TIME]"
|
||||
+ coverage.get(0).getInTime()
|
||||
+ "[/IN_TIME]"
|
||||
+ "[LATITUDE]"
|
||||
+ coverage.get(0).getLatitude()
|
||||
+ "[/LATITUDE]"
|
||||
+ "[LONGITUDE ]"
|
||||
+ coverage.get(0).getLongitude()
|
||||
+ "[/LONGITUDE ]"
|
||||
+ "[REASON_ID]"
|
||||
+ coverage.get(0).getReasonid()
|
||||
+ "[/REASON_ID]"
|
||||
+ "[REMARK]"
|
||||
+ coverage.get(0).getReason()
|
||||
+ "[/REMARK][/Coverage_Intime]";
|
||||
|
||||
String onXML = "[Coverage_Intime][USER_ID]"
|
||||
+ _UserId
|
||||
+ "[/USER_ID]"
|
||||
+ "[STORE_ID]"
|
||||
+ coverage.get(0).getStoreId()
|
||||
+ "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]"
|
||||
+ coverage.get(0).getVisitDate()
|
||||
+ "[/VISIT_DATE]"
|
||||
+ "[IN_TIME]"
|
||||
+ coverage.get(0).getInTime()
|
||||
+ "[/IN_TIME]"
|
||||
+ "[LATITUDE]"
|
||||
+ coverage.get(0).getLatitude()
|
||||
+ "[/LATITUDE]"
|
||||
+ "[LONGITUDE ]"
|
||||
+ coverage.get(0).getLongitude()
|
||||
+ "[/LONGITUDE ]"
|
||||
+ "[REASON_ID]"
|
||||
+ coverage.get(0).getReasonid()
|
||||
+ "[/REASON_ID]"
|
||||
+ "[REMARK]"
|
||||
+ coverage.get(0).getReason()
|
||||
+ "[/REMARK][/Coverage_Intime]";
|
||||
|
||||
//current_xml = current_xml + onXML;
|
||||
|
||||
|
||||
//current_xml = current_xml + onXML;
|
||||
//}
|
||||
|
||||
current_xml = "[DATA]" + onXML
|
||||
+ "[/DATA]";
|
||||
Log.d("currentdata",current_xml);
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||
service);
|
||||
@@ -896,18 +885,18 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
//Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
|
||||
ResultFlag = false;
|
||||
strflag = CommonString.MESSAGE_XmlPull;
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
|
||||
ResultFlag = false;
|
||||
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||
@@ -916,15 +905,11 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
if (ResultFlag) {
|
||||
return CommonString.KEY_SUCCESS;
|
||||
|
||||
} else {
|
||||
|
||||
return strflag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String result) {
|
||||
super.onPostExecute(result);
|
||||
@@ -939,8 +924,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
/* if (store_flag_str.equals(CommonString.FROM_JCP)|| country_id.equalsIgnoreCase("5")
|
||||
||store_flag_str.equals(CommonString.FROM_DEVIATION)) {*/
|
||||
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)|| country_id.equalsIgnoreCase("5")) {
|
||||
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase("15")) {
|
||||
Intent in = new Intent(StoreimageActivity.this, StoreWisePerformanceActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
@@ -950,12 +934,27 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
startActivity(in);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else{
|
||||
} else if (VISIT_TYPE_ID != null) {
|
||||
if (store_flag_str.equals(CommonString.FROM_DEVIATION) &&
|
||||
VISIT_TYPE_ID.equals("1") || VISIT_TYPE_ID.equals("3")) {
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_VISIT_ID, VISIT_TYPE_ID);
|
||||
editor.commit();
|
||||
|
||||
Intent in = new Intent(StoreimageActivity.this, StoreWisePerformanceActivity.class);
|
||||
in.putExtra("VISIT_TYPE_ID", VISIT_TYPE_ID);
|
||||
startActivity(in);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
|
||||
//showAlert(getString(R.string.data_downloaded_successfully));
|
||||
} else {
|
||||
|
||||
@@ -978,10 +977,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
|
||||
finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
|
||||
@@ -133,14 +133,14 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
rec_t2p = (RecyclerView) findViewById(R.id.rec_t2p);
|
||||
|
||||
|
||||
if (country_id.equals("8")){
|
||||
if (country_id.equals("8") || country_id.equals("17")) {
|
||||
toolbar.setTitle(getResources().getString(R.string.title_posm));
|
||||
}else {
|
||||
} else {
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_t2_pcompliance));
|
||||
}
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
// toolbar.setTitle(R.string.title_activity_t2_pcompliance + " - " + categoryName);
|
||||
// toolbar.setTitle(R.string.title_activity_t2_pcompliance + " - " + categoryName);
|
||||
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -200,10 +200,8 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
t2PGetterSetters = db.getT2PDefaultData(store_id, categoryId, "MAPPING_T2P");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||
|
||||
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(t2PGetterSetters.get(i).getKey_id());
|
||||
ArrayList<SkuGetterSetter> skuList = db.getT2PSKUData(t2PGetterSetters.get(i).getKey_id());
|
||||
ArrayList<BrandAvabilityGetterSetter> brandList = db.getT2BrandData(t2PGetterSetters.get(i).getKey_id());
|
||||
@@ -212,9 +210,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
//
|
||||
t2PGetterSetters.get(i).setSkulist(skuList);
|
||||
t2PGetterSetters.get(i).setBrandlist(brandList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||
@@ -856,13 +852,12 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public void showSkuDialog(final ArrayList<SkuGetterSetter> skuAddedList) {
|
||||
|
||||
final SkuGetterSetter[] sku_selected = new SkuGetterSetter[1];
|
||||
final BrandMasterGetterSetter[] brand_selected = new BrandMasterGetterSetter[1];
|
||||
|
||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||
//usk just
|
||||
if (country_id.equals("7")) {
|
||||
if (country_id.equals("7") || country_id.equals("8")) {
|
||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
brandList = db.getBrandT2PData(storeType_id, class_id, keyAccount_id, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
@@ -875,7 +870,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
brand.setBRAND("select");
|
||||
brandList.add(0, brand);
|
||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||
|
||||
final Dialog dialog = new Dialog(T2PComplianceActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
@@ -967,17 +961,12 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
spinner_brand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
if (position != 0) {
|
||||
|
||||
sku_list.clear();
|
||||
|
||||
brand_selected[0] = brandList.get(position);
|
||||
|
||||
String brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||
|
||||
ArrayList<SkuGetterSetter> temp_list;
|
||||
if (country_id.equals("7")) {
|
||||
if (country_id.equals("7") || country_id.equals("8")) {
|
||||
temp_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
temp_list = db.getSkuT2PData(storeType_id, class_id, keyAccount_id, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
@@ -1081,23 +1070,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
public String getCurrentTimeNotUsed() {
|
||||
Calendar m_cal = Calendar.getInstance();
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||
String cdate = formatter.format(m_cal.getTime());
|
||||
|
||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
private void startCameraActivity(int pos) {
|
||||
try {
|
||||
|
||||
@@ -1662,15 +1634,16 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
||||
|
||||
final ArrayList<BrandAvabilityGetterSetter> brandList;
|
||||
|
||||
if (country_id.equals("7") || country_id.equals("8")) {
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, null, null, null, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, null, null, null,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id, CommonString.TABLE_MAPPING_STOCK);
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id,
|
||||
CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
|
||||
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
||||
@@ -1694,7 +1667,8 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
// cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
||||
|
||||
// Create custom adapter object ( see below CustomAdapter.java )
|
||||
T2PComplianceActivity.CustomBRANDAdapter adapter = new T2PComplianceActivity.CustomBRANDAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, brandList);
|
||||
T2PComplianceActivity.CustomBRANDAdapter adapter = new T2PComplianceActivity.CustomBRANDAdapter(T2PComplianceActivity.this,
|
||||
R.layout.custom_spinner_item, brandList);
|
||||
|
||||
spinner_brand.setAdapter(adapter);
|
||||
|
||||
@@ -1763,8 +1737,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
brand_id = "";
|
||||
|
||||
} else {
|
||||
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.gms.common.api.GoogleApiClient;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||
import cpm.com.gskmtorange.storeinmap.StoreListRouteActivity;
|
||||
import cpm.com.gskmtorange.storeinmap.StoreRouteActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramStorewiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
|
||||
public class VisitTypeStatusActivity extends AppCompatActivity {
|
||||
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
||||
ArrayList<Visit_Type_Master_GetterSetter> storelist = new ArrayList<Visit_Type_Master_GetterSetter>();
|
||||
//ListView list;
|
||||
private SharedPreferences preferences;
|
||||
String date, visit_status;
|
||||
GSKOrangeDB db;
|
||||
ValueAdapter adapter;
|
||||
RecyclerView recyclerView;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
LinearLayout linearlay;
|
||||
String store_id, userId, culture_id, visit_date, store_facing_hide;
|
||||
private Dialog dialog;
|
||||
boolean result_flag = false, leaveflag = false;
|
||||
FloatingActionButton fab;
|
||||
//String storeid;
|
||||
Toolbar toolbar;
|
||||
String language, country_id;
|
||||
String store_flag_str;
|
||||
String str_facing="";
|
||||
|
||||
Context context;
|
||||
boolean enabled = true;
|
||||
|
||||
private ProgressBar pb;
|
||||
|
||||
private TextView percentage, message;
|
||||
int eventType;
|
||||
boolean ResultFlag = true;
|
||||
String str;
|
||||
StoreBean storeCurrentObj;
|
||||
|
||||
String from_checkedIn = "";
|
||||
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_visit_type_status);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
context = this;
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||
language = preferences.getString(CommonString.KEY_LANGUAGE, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
db = new GSKOrangeDB(context);
|
||||
db.open();
|
||||
|
||||
linearlay = (LinearLayout) findViewById(R.id.no_data_lay);
|
||||
recyclerView = (RecyclerView) findViewById(R.id.drawer_layout_recycle);
|
||||
|
||||
toolbar.setTitle("Ad-Hoc Visit Type" + "-"+ date);
|
||||
storelist = db.getVisitType(date, "VISIT_TYPE_MASTER");
|
||||
adapter = new ValueAdapter(context, storelist);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
str_facing = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG_FACING_HIDE);
|
||||
|
||||
}
|
||||
public class ValueAdapter extends RecyclerView.Adapter<ValueAdapter.MyViewHolder> {
|
||||
|
||||
private LayoutInflater inflator;
|
||||
|
||||
List<Visit_Type_Master_GetterSetter> data = Collections.emptyList();
|
||||
|
||||
public ValueAdapter(Context context, List<Visit_Type_Master_GetterSetter> data) {
|
||||
inflator = LayoutInflater.from(context);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||
|
||||
View view = inflator.inflate(R.layout.visittypelist_child, parent, false);
|
||||
|
||||
ValueAdapter.MyViewHolder holder = new ValueAdapter.MyViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ValueAdapter.MyViewHolder viewHolder, final int position) {
|
||||
final Visit_Type_Master_GetterSetter current = data.get(position);
|
||||
viewHolder.visitTypeTV.setText(current.getVISIT_TYPE().get(0));
|
||||
viewHolder.Cardbtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
db.open();
|
||||
db.insertVisitTypeData(visit_date,store_id,current.getVISIT_TYPE_ID().get(0));
|
||||
|
||||
Intent in = new Intent(VisitTypeStatusActivity.this, StoreimageActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||
in.putExtra("VISIT_TYPE_ID", current.getVISIT_TYPE_ID().get(0));
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG_FACING_HIDE, str_facing);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView visitTypeTV;
|
||||
CardView Cardbtn;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
visitTypeTV = itemView.findViewById(R.id.visitTypeTV);
|
||||
Cardbtn = itemView.findViewById(R.id.card_view);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
// NavUtils.navigateUpFromSameTask(this);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,12 @@ import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.Window;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
@@ -71,6 +73,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Order_Received_Status_GetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_CATEGORY_WISEGetterSetter;
|
||||
@@ -81,6 +84,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||
|
||||
public class DownloadActivity extends AppCompatActivity {
|
||||
@@ -132,6 +136,9 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
PROMOTION_TYPE_MASTERGetterSetter promotion_type_masterGetterSetter;
|
||||
STORE_CATEGORY_WISEGetterSetter store_category_wiseGetterSetter;
|
||||
MAPPING_SKU_PRICING_ENABLEGetterSetter mapping_sku_pricing_enableGetterSetter;
|
||||
Order_Received_Status_GetterSetter order_received_status_getterSetter;
|
||||
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
||||
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
@@ -183,16 +190,16 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
||||
dialog.setContentView(R.layout.custom_dialog_progress);
|
||||
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||
pb.getProgressDrawable().setColorFilter(
|
||||
getResources().getColor(R.color.colorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
||||
message = (TextView) dialog.findViewById(R.id.message);
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... voids) {
|
||||
try {
|
||||
|
||||
boolean no_jcp_flag = false, no_adhoc_flag = false, no_addtional_jcp_flag = false;
|
||||
|
||||
String resultHttp = "";
|
||||
@@ -211,6 +218,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
request.addProperty("Type", "JOURNEY_PLAN");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
@@ -218,10 +226,12 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
Object result = envelope.getResponse();
|
||||
Log.d("requestdata",request.toString());
|
||||
|
||||
Object result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
//InputStream stream = new ByteArrayInputStream(result.toString().getBytes("UTF-8"));
|
||||
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||
@@ -260,8 +270,9 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
Log.d("resultdata",result.toString());
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||
@@ -303,8 +314,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
@@ -336,7 +347,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -371,7 +383,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -405,7 +418,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -441,7 +455,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -477,7 +492,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -513,7 +529,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -548,7 +565,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -583,7 +601,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -617,7 +636,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -643,7 +663,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
//Added on 04/12/2018
|
||||
// MAPPING_STOCK_STOREWISE
|
||||
if (country_id.equals("7")||country_id.equals("8")) {
|
||||
if (country_id.equals("7")||country_id.equals("8") || country_id.equals("17")) {
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_STOCK_STOREWISE");
|
||||
@@ -656,7 +676,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -672,7 +693,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
if (mappingStockStorewiseGetterSetter.getSKU_ID().size() > 0) {
|
||||
data.value = 45;
|
||||
data.name = "_MAPPING_STOCK_STOREWISE " + getResources().getString(R.string.download_data);
|
||||
data.name = "MAPPING_STOCK_STOREWISE " + getResources().getString(R.string.download_data);
|
||||
} else {
|
||||
// return "MAPPING_STOCK";
|
||||
}
|
||||
@@ -695,7 +716,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -733,7 +755,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -760,6 +783,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
request.addProperty("Type", "MAPPING_DISPLAY_CHECKLIST");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
Log.d("requestdata",request.toString());
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
@@ -767,7 +791,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -787,11 +812,9 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
} else {
|
||||
//return "MAPPING_DISPLAY_CHECKLIST";
|
||||
}
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
// NON_WORKING_REASON
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
@@ -806,7 +829,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -840,7 +864,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -860,7 +885,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
} else {
|
||||
//return "NON_WORKING_SUB_REASON";
|
||||
}
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
@@ -878,7 +902,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -897,13 +922,10 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
data.name = "MAPPING_PROMOTION " + getResources().getString(R.string.download_data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//Gagan start code
|
||||
|
||||
// MAPPING_ADDITIONAL_PROMOTION
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
@@ -917,7 +939,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -953,7 +976,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -991,7 +1015,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1027,7 +1052,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1062,7 +1088,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1098,7 +1125,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1133,7 +1161,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1171,7 +1200,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1206,7 +1236,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1241,7 +1272,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1262,7 +1294,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//MAPPING_CATEGORY_IMAGE_ALLOW
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
@@ -1276,7 +1307,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1310,7 +1342,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1329,6 +1362,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
data.name = "ADDITIONAL_QUESTION " + getResources().getString(R.string.download_data);
|
||||
}
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
//ADDITIONAL_QUESTION
|
||||
@@ -1345,7 +1379,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1379,7 +1414,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1413,7 +1449,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1447,7 +1484,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1481,7 +1519,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1516,7 +1555,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1540,7 +1580,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//JOURNEY_PLAN_PHARMA
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
@@ -1554,7 +1593,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1583,7 +1623,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1612,7 +1653,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1634,7 +1676,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
//usk
|
||||
// MAPPING_PHARMA_MSL
|
||||
@@ -1650,7 +1692,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1674,6 +1717,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
@@ -1687,7 +1732,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -1709,14 +1755,11 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
// return "MAPPING_PHARMA_MSL";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
/* //MAPPING_COUNTRYWISE_PLANOGRAM
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_COUNTRYWISE_PLANOGRAM");
|
||||
request.addProperty("Type", "ORDER_RECEIVED_STATUS");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
@@ -1726,27 +1769,70 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
mappingPlanogramCountrywiseGetterSetter = XMLHandlers.MAPPING_COUNTRYWISE_PLANOGRAM_XMLHandler(xpp, eventType);
|
||||
|
||||
String table_mapping_planogram = mappingPlanogramCountrywiseGetterSetter.getTable_MAPPING_COUNTRYWISE_PLANOGRAM();
|
||||
if (table_mapping_planogram != null) {
|
||||
order_received_status_getterSetter = XMLHandlers.order_Received_Status_XMLHandler(xpp, eventType);
|
||||
String stocktable = order_received_status_getterSetter.getTable_Order_Received_Status();
|
||||
if (stocktable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setMappingCountrywisePlanogram(table_mapping_planogram);
|
||||
TableBean.setTable_ORDER_RECEIVED_STATUS(stocktable);
|
||||
}
|
||||
if (mappingPlanogramCountrywiseGetterSetter.getCOUNTRY_ID().size() > 0) {
|
||||
data.value = 92;
|
||||
data.name = "MAPPING_COUNTRYWISE_PLANOGRAM Data Download";
|
||||
|
||||
if (order_received_status_getterSetter.getSTORE_ID().size() > 0) {
|
||||
data.value = 99;
|
||||
data.name = "ORDER_RECEIVED_STATUS" + getResources().getString(R.string.download_data);
|
||||
} else {
|
||||
//return "MAPPING_COUNTRYWISE_PLANOGRAM";
|
||||
// return "MAPPING_PHARMA_MSL";
|
||||
}
|
||||
}
|
||||
publishProgress(data);*/
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//VISIT_TYPE_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "VISIT_TYPE_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
Log.d("resultdata",result.toString());
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
|
||||
visit_type_master_getterSetter = XMLHandlers.Visit_Type_Status_XMLHandler(xpp, eventType);
|
||||
String stocktable = visit_type_master_getterSetter.getTable_Visit_Type_Status();
|
||||
if (stocktable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setTable_VISIT_TYPE_STATUS(stocktable);
|
||||
}
|
||||
|
||||
if (order_received_status_getterSetter.getSTORE_ID().size() > 0) {
|
||||
data.value = 99;
|
||||
data.name = "VISIT_TYPE_MASTER" + getResources().getString(R.string.download_data);
|
||||
} else {
|
||||
// return "MAPPING_PHARMA_MSL";
|
||||
}
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
|
||||
|
||||
//Images DownLoads
|
||||
|
||||
@@ -1763,14 +1849,13 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
String image_name = mapping_planogram_masterGetterSetter.getPLANOGRAM_IMAGE().get(i);
|
||||
String path = mapping_planogram_masterGetterSetter.getIMAGE_PATH().get(i);
|
||||
|
||||
String PATH = CommonString.FILE_PATH_PLANOGRAM;
|
||||
File file = new File(PATH);
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
}
|
||||
|
||||
if (!new File(PATH + image_name).exists()) {
|
||||
if (!new File(PATH + image_name).exists()) {
|
||||
if (!image_name.equalsIgnoreCase("NA") && !image_name.equalsIgnoreCase("")) {
|
||||
URL url = new URL(path + "/" + image_name);
|
||||
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
||||
@@ -1935,10 +2020,11 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
db.open();
|
||||
db.InsertJCP(jcpgettersetter);
|
||||
db.InsertOrderReceivingStatus(order_received_status_getterSetter);
|
||||
db.InsertAdhoc_JCP(adhoc_jcpgettersetter);
|
||||
db.InsertVisit_Type_Status(visit_type_master_getterSetter);
|
||||
db.InsertCategory(categoryMasterGetterSetter);
|
||||
db.InsertSubCategoryMaster(subCategoryMasterGetterSetter);
|
||||
db.InsertBrandMaster(brandMasterGetterSetter);
|
||||
@@ -1983,10 +2069,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
db.InsertPROMOTION_TYPE_MASTER(promotion_type_masterGetterSetter);
|
||||
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
|
||||
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
|
||||
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
ResultFlag = false;
|
||||
str = CommonString.MESSAGE_EXCEPTION;
|
||||
return CommonString.MESSAGE_EXCEPTION;
|
||||
@@ -1995,18 +2079,16 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||
} catch (InterruptedIOException e) {
|
||||
|
||||
ResultFlag = false;
|
||||
str = CommonString.MESSAGE_EXCEPTION;
|
||||
return CommonString.MESSAGE_EXCEPTION;
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
ResultFlag = false;
|
||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||
} catch (XmlPullParserException e) {
|
||||
ResultFlag = false;
|
||||
Log.d("exceptiondata",e.getMessage() + ","+data.name );
|
||||
str = CommonString.MESSAGE_XmlPull;
|
||||
return CommonString.MESSAGE_XmlPull;
|
||||
} catch (Exception e) {
|
||||
@@ -2015,7 +2097,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
ResultFlag = false;
|
||||
str = CommonString.MESSAGE_EXCEPTION;
|
||||
|
||||
return CommonString.MESSAGE_EXCEPTION;
|
||||
}
|
||||
|
||||
@@ -2029,7 +2110,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onProgressUpdate(Data... values) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
pb.setProgress(values[0].value);
|
||||
percentage.setText(values[0].value + "%");
|
||||
message.setText(values[0].name);
|
||||
@@ -2041,7 +2121,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
if (s.equalsIgnoreCase("")) {
|
||||
dialog.dismiss();
|
||||
|
||||
showAlert(getString(R.string.data_downloaded_successfully));
|
||||
} else {
|
||||
dialog.dismiss();
|
||||
@@ -2052,7 +2131,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(DownloadActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
@@ -2074,10 +2152,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -116,10 +116,12 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
||||
if(lang.equals(language.get(0))){
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_1.setTextColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
else if(lang.equals(language.get(1))){
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
btn_lang_1.setOnClickListener(this);
|
||||
@@ -131,7 +133,6 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
||||
// TODO: Rename method, update argument and hook method into UI event
|
||||
public void onButtonPressed(String selected_lang, String culture_id, String notice_url) {
|
||||
if (mListener != null) {
|
||||
|
||||
mListener.onFragmentInteraction(selected_lang,culture_id,notice_url);
|
||||
}
|
||||
}
|
||||
@@ -167,6 +168,8 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_1.setTextColor(getResources().getColor(R.color.white));
|
||||
btn_lang_2.setTextColor(getResources().getColor(R.color.black));
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
||||
@@ -178,13 +181,14 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
||||
case R.id.btn_language_two:
|
||||
|
||||
//selected_flag = true;
|
||||
|
||||
onButtonPressed(language.get(1),culture_id.get(1),login_data.getNOTICE_URL().get(1));
|
||||
|
||||
CommonFunctions.updateLangResources(getActivity(), language.get(1));
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||
btn_lang_1.setTextColor(getResources().getColor(R.color.black));
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ServiceActivityFragment extends Fragment {
|
||||
|
||||
if(position==0){
|
||||
showExportDialog();
|
||||
//restoreBackup();
|
||||
// restoreBackup();
|
||||
}
|
||||
/* else if(position==1){
|
||||
|
||||
@@ -201,7 +201,7 @@ public class ServiceActivityFragment extends Fragment {
|
||||
|
||||
if (sd.canWrite()) {
|
||||
String currentDBPath = "//data//cpm.com.gskmtorange//databases//" + GSKOrangeDB.DATABASE_NAME;
|
||||
String backupDBPath = "GSKMT_ORANGE_Database_backup_testksa_02272019_155842";
|
||||
String backupDBPath = "GSKMT_ORANGE_Database_backup_abdullah.bakr_06122024_144633.db";
|
||||
File currentDB = new File(data, currentDBPath);
|
||||
File backupDB = new File(sd, backupDBPath);
|
||||
|
||||
@@ -270,7 +270,6 @@ public class ServiceActivityFragment extends Fragment {
|
||||
//usk
|
||||
// File dir = new File(CommonString.BACKUP_PATH);
|
||||
File dir = new File(CommonString.BACKUP_PATH);
|
||||
|
||||
ArrayList<String> list = new ArrayList();
|
||||
list = getFileNames(dir.listFiles());
|
||||
if (list.size() > 0) {
|
||||
@@ -278,9 +277,9 @@ public class ServiceActivityFragment extends Fragment {
|
||||
if (list.get(i1).contains("GSKMT_ORANGE_Database_backup")) {
|
||||
// File originalFile = new File(CommonString.BACKUP_PATH + list.get(i1));
|
||||
Object result = uploadBackup(getActivity(), list.get(i1), "DBBackup");
|
||||
/* if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
Toast.makeText(getActivity(), getString(R.string.databasexported), Toast.LENGTH_SHORT).show();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,4 +238,43 @@ public class CoverageBean {
|
||||
public void setFlag_from(String flag_from) {
|
||||
this.flag_from = flag_from;
|
||||
}
|
||||
|
||||
String keyAccountId;
|
||||
String classId;
|
||||
|
||||
public String getKeyAccountId() {
|
||||
return keyAccountId;
|
||||
}
|
||||
|
||||
public void setKeyAccountId(String keyAccountId) {
|
||||
this.keyAccountId = keyAccountId;
|
||||
}
|
||||
|
||||
public String getClassId() {
|
||||
return classId;
|
||||
}
|
||||
|
||||
public void setClassId(String classId) {
|
||||
this.classId = classId;
|
||||
}
|
||||
|
||||
public String getStoreTypeId() {
|
||||
return storeTypeId;
|
||||
}
|
||||
|
||||
public void setStoreTypeId(String storeTypeId) {
|
||||
this.storeTypeId = storeTypeId;
|
||||
}
|
||||
|
||||
String storeTypeId;
|
||||
|
||||
public String getMappingStk() {
|
||||
return mappingStk;
|
||||
}
|
||||
|
||||
public void setMappingStk(String mappingStk) {
|
||||
this.mappingStk = mappingStk;
|
||||
}
|
||||
|
||||
String mappingStk="";
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -44,8 +45,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
ArrayList<CategoryGetterSetter> categoryList;
|
||||
CategoryListAdapter adapter;
|
||||
GSKOrangeDB db;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id,camera_allow, country_id, store_flag_str, pog_type_id;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str, pog_type_id;
|
||||
private SharedPreferences preferences;
|
||||
String visit_type_id = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -69,14 +71,15 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||
if(preferences.getString(CommonString.KEY_VISIT_ID, "")!= null){
|
||||
visit_type_id = preferences.getString(CommonString.KEY_VISIT_ID, "");
|
||||
}
|
||||
|
||||
/*txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||
txt_categoryName.setText(getResources().getString(R.string.title_activity_category_list));*/
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_category_list));
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_category);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -90,219 +93,214 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
categoryList = new ArrayList<>();
|
||||
|
||||
if(country_id.equals("7")||country_id.equals("8")){
|
||||
Log.e("country_data",country_id + ","+ keyAccount_id);
|
||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||
categoryList = db.getCategoryListData(null, null, null, store_id, "MAPPING_STOCK_STOREWISE");
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
Log.d("catlistsize", String.valueOf(categoryList.size()));
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, "MAPPING_STOCK");
|
||||
}
|
||||
|
||||
if (categoryList.size() > 0) {
|
||||
|
||||
for (int i = 0; i < categoryList.size(); i++) {
|
||||
|
||||
boolean flag_filled = false;
|
||||
String category_id = categoryList.get(i).getCategory_id();
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
||||
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||
|
||||
if (flag_mapping_stock) {
|
||||
if (db.checkStockData(store_id, category_id)) {
|
||||
flag_filled = true;
|
||||
}
|
||||
else {
|
||||
flag_filled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
//Additional_Visibility
|
||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||
boolean flag = true;
|
||||
|
||||
//MSL_Availability
|
||||
/*if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
||||
flag = false;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
db.open();
|
||||
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id,
|
||||
keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||
if (flag_mapping_stock) {
|
||||
if (db.checkStockData(store_id, category_id,visit_date)) {
|
||||
flag_filled = true;
|
||||
} else {
|
||||
flag_filled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) &&
|
||||
country_id.equals("2") && visit_type_id.equals("3")){
|
||||
db.open();
|
||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||
flag_filled = true;
|
||||
} else {
|
||||
flag_filled = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//Additional_Visibility
|
||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||
boolean flag = true;
|
||||
//MSL_Availability
|
||||
|
||||
//Stock_Facing
|
||||
if (flag) {
|
||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkStockAndFacingData(store_id, category_id)) {
|
||||
boolean flag_mapping_stock;
|
||||
//New MSL_Availability_StockFacing
|
||||
if (country_id.equals("7")) {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
if (flag_mapping_stock) {
|
||||
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id,visit_date)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
boolean flag_mapping_stock;
|
||||
//New MSL_Availability_StockFacing
|
||||
if(country_id.equals("7")){
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
if (flag_mapping_stock) {
|
||||
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
//Stock_Entry
|
||||
boolean flag_stock_mapping_stock;
|
||||
if (country_id.equals("10")) {
|
||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
if (flag_stock_mapping_stock) {
|
||||
if (!db.checkStock_Entry_FacingDataNew(store_id, category_id,visit_date)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Promo Compliance
|
||||
if (flag) {
|
||||
if(country_id.equals("7")){
|
||||
if(db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size()==0){
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
if (isMappingPromotion_Flag) {
|
||||
if (!db.checkPromoComplianceData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Promo Compliance
|
||||
if (flag) {
|
||||
if (country_id.equals("7")) {
|
||||
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
} else {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
if (isMappingPromotion_Flag) {
|
||||
if (!db.checkPromoComplianceData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//T2P
|
||||
if (flag) {
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
if (flag_t2p_mapping) {
|
||||
if (!db.isFilledT2P(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//T2P
|
||||
if (flag) {
|
||||
boolean flag_t2p_mapping;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
if (flag_t2p_mapping) {
|
||||
if (!db.isFilledT2P(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Category image
|
||||
if (camera_allow.equalsIgnoreCase("1")) {
|
||||
//if (category_camera_list.size()>0) {
|
||||
if (!db.isCategoryPictureData(store_id, category_id)) {
|
||||
flag = false;
|
||||
//Category image
|
||||
if (camera_allow.equals("1")) {
|
||||
//if (category_camera_list.size()>0) {
|
||||
if (!db.isCategoryPictureData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id, store_id, country_id);
|
||||
//if Sub Group Data exists for any Sub Category of the Category
|
||||
boolean isSubGroupDataExists = false;
|
||||
for (int j = 0; j < sub_category_list.size(); j++) {
|
||||
if (db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size() > 0) {
|
||||
isSubGroupDataExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (isSubGroupDataExists) {
|
||||
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id,store_id,country_id);
|
||||
//Order Taking Data
|
||||
if(country_id.equals("15") || ((country_id.equals("17") && category_id.equals("2")))){
|
||||
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
//if Sub Group Data exists for any Sub Category of the Category
|
||||
boolean isSubGroupDataExists = false;
|
||||
for(int j=0;j<sub_category_list.size();j++){
|
||||
if(db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size()>0){
|
||||
isSubGroupDataExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
//changed on 23.10.2018
|
||||
//ArrayList<AuditDataGetterSetter> question_list = getAuditAfterDeletion(category_id);
|
||||
//changed on 03.12.2018
|
||||
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
||||
if (question_list.size() > 0) {
|
||||
/*if (!country_id.equals("6") && db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}*/
|
||||
if (db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isSubGroupDataExists){
|
||||
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag){
|
||||
|
||||
//changed on 23.10.2018
|
||||
//ArrayList<AuditDataGetterSetter> question_list = getAuditAfterDeletion(category_id);
|
||||
//changed on 03.12.2018
|
||||
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
||||
|
||||
if(question_list.size()>0){
|
||||
|
||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
||||
flag = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//new add UAE pharma
|
||||
if(flag){
|
||||
|
||||
/* if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
//new add UAE pharma
|
||||
if (flag) {
|
||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}*/
|
||||
if (country_id.equals("2")){
|
||||
if (camera_allow.equals("1")){
|
||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
}else {
|
||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (country_id.equals("2")) {
|
||||
if (camera_allow.equals("1")) {
|
||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
} else {
|
||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (flag) {
|
||||
//Counterfeit Product Option - Egypt
|
||||
if (country_id.equals("6")) {
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if (flag){
|
||||
|
||||
//Counterfeit Product Option - Egypt
|
||||
if(country_id.equals("6")){
|
||||
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
}
|
||||
//usk
|
||||
if(country_id.equals("6")&& category_id.equals("2")){
|
||||
|
||||
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
flag_filled = flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
//usk
|
||||
if (country_id.equals("6") && category_id.equals("2")) {
|
||||
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
flag_filled = flag;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag_filled) {
|
||||
if (category_id.equals("1")) {
|
||||
@@ -311,17 +309,17 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.oralcare_tick);
|
||||
} else if (category_id.equals("3")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.wellness_tick);
|
||||
}else if (category_id.equals("4")) {
|
||||
} else if (category_id.equals("4")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.nutritionals_tick);
|
||||
}else if (category_id.equals("5")) {
|
||||
} else if (category_id.equals("5")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion_tick);
|
||||
}else if (category_id.equals("6")) {
|
||||
} else if (category_id.equals("6")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold_tick);
|
||||
}else if (category_id.equals("7")) {
|
||||
} else if (category_id.equals("7")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics_tick);
|
||||
}else if (category_id.equals("8")) {
|
||||
} else if (category_id.equals("8")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.first_aid_tick);
|
||||
}else if (category_id.equals("9")) {
|
||||
} else if (category_id.equals("9")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics_tick);
|
||||
} else if (category_id.equals("10")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold_tick);
|
||||
@@ -333,17 +331,17 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.oral_care);
|
||||
} else if (category_id.equals("3")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.wellness);
|
||||
}else if (category_id.equals("4")) {
|
||||
} else if (category_id.equals("4")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.nutritionals);
|
||||
}else if (category_id.equals("5")) {
|
||||
} else if (category_id.equals("5")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion);
|
||||
}else if (category_id.equals("6")) {
|
||||
} else if (category_id.equals("6")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold);
|
||||
}else if (category_id.equals("7")) {
|
||||
} else if (category_id.equals("7")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics);
|
||||
}else if (category_id.equals("8")) {
|
||||
} else if (category_id.equals("8")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.first_aid);
|
||||
}else if (category_id.equals("9")) {
|
||||
} else if (category_id.equals("9")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics);
|
||||
} else if (category_id.equals("10")) {
|
||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold);
|
||||
@@ -354,14 +352,13 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
adapter = new CategoryListAdapter(CategoryListActivity.this, categoryList);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
|
||||
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditAfterDeletion(String category_id){
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(category_id,storeType_id);
|
||||
ArrayList<AuditDataGetterSetter> getAuditAfterDeletion(String category_id) {
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(category_id, storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -371,11 +368,10 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
if (!flag_t2p_mapping) {
|
||||
iterator.remove();
|
||||
@@ -387,14 +383,12 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved(String categoryId) {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
@@ -423,8 +417,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
Log.e("questionlistsize", String.valueOf(question_list.size()));
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||
@@ -432,11 +427,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!t2p_flag) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +449,6 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
@@ -537,85 +529,99 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
public void updateStatus() {
|
||||
//Update Checkout Status
|
||||
boolean flag_filled = false;
|
||||
|
||||
for (int i = 0; i < categoryList.size(); i++) {
|
||||
String category_id = categoryList.get(i).getCategory_id();
|
||||
|
||||
/* if (db.checkMsl_AvailabilityData(store_id, category_id)
|
||||
&& db.checkStockAndFacingData(store_id, category_id)
|
||||
&& db.checkPromoComplianceData(store_id, category_id)
|
||||
&& db.isFilledT2P(store_id, category_id)
|
||||
&& db.additionalVisibilitydata(store_id, category_id)) {
|
||||
|
||||
flag_filled = true;
|
||||
} else {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}*/
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
||||
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||
if (flag_mapping_stock) {
|
||||
if (db.checkStockData(store_id, category_id)) {
|
||||
if (db.checkStockData(store_id, category_id,visit_date)) {
|
||||
flag_filled = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) &&
|
||||
country_id.equals("2") && visit_type_id.equals("3")){
|
||||
db.open();
|
||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||
flag_filled = true;
|
||||
} else {
|
||||
flag_filled = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||
//boolean flag = true;
|
||||
|
||||
/*if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Stock_Facing
|
||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if (!db.checkStockAndFacingData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
boolean flag_mapping_stock;
|
||||
//New MSL_Availability_StockFacing
|
||||
if(country_id.equals("7")){
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
}
|
||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||
if (country_id.equals("7")||country_id.equals("8")) {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
if (flag_mapping_stock) {
|
||||
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
||||
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id,visit_date)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(country_id.equals("7")){
|
||||
if(db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size()==0){
|
||||
|
||||
//New MSL_Availability_StockFacing
|
||||
if (country_id.equals("10")||country_id.equals("8")) {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
if (flag_mapping_stock) {
|
||||
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id,visit_date)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
|
||||
//Stock_Entry
|
||||
boolean flag_stock_mapping_stock;
|
||||
if (country_id.equals("10")) {
|
||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
if (flag_stock_mapping_stock) {
|
||||
if (!db.checkStock_Entry_FacingDataNew(store_id, category_id,visit_date)) {
|
||||
flag_filled = false;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
if (country_id.equals("7")) {
|
||||
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
} else {
|
||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
if (isMappingPromotion_Flag) {
|
||||
@@ -627,40 +633,38 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
boolean flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
if (flag_t2p_mapping) {
|
||||
if (!db.isFilledT2P(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (camera_allow.equalsIgnoreCase("1")) {
|
||||
if (camera_allow.equals("1")) {
|
||||
//if (category_camera_list.size()>0) {
|
||||
if (!db.isCategoryPictureData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
|
||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id,store_id,country_id);
|
||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id, store_id, country_id);
|
||||
|
||||
//if Sub Group Data exists for any Sub Category of the Category
|
||||
boolean isSubGroupDataExists = false;
|
||||
for(int j=0;j<sub_category_list.size();j++){
|
||||
if(db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size()>0){
|
||||
for (int j = 0; j < sub_category_list.size(); j++) {
|
||||
if (db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size() > 0) {
|
||||
isSubGroupDataExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(isSubGroupDataExists){
|
||||
if (isSubGroupDataExists) {
|
||||
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
@@ -668,14 +672,20 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
if(getAuditQnsRemoved(category_id).size()>0){
|
||||
|
||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
||||
if (getAuditQnsRemoved(category_id).size() > 0) {
|
||||
///Make non Mandate Audit KPI for EGIPT
|
||||
/*if (!country_id.equals("6") && db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}*/
|
||||
//Make Mandate Audit KPI FOR EGYPT 17-01-2023 BY VIKAS
|
||||
if (db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//add UAE pharma No camera pog disable
|
||||
|
||||
/* if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
@@ -684,8 +694,8 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
if (country_id.equals("2")){
|
||||
if (camera_allow.equals("1")){
|
||||
if (country_id.equals("2")) {
|
||||
if (camera_allow.equals("1")) {
|
||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
@@ -700,7 +710,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}else {
|
||||
} else {
|
||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
@@ -710,8 +720,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
//Counterfeit Product Option - Egypt
|
||||
if(country_id.equals("6")){
|
||||
|
||||
if (country_id.equals("6")) {
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
@@ -719,23 +728,27 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
//usk
|
||||
if(country_id.equals("6")&& category_id.equals("2")){
|
||||
|
||||
if (country_id.equals("6") && category_id.equals("2")) {
|
||||
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(country_id.equals("15")){
|
||||
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
flag_filled = true;
|
||||
} else {
|
||||
}
|
||||
else{
|
||||
flag_filled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag_filled) {
|
||||
db.updateCheckoutStatus(store_id, CommonString.KEY_VALID, CommonString.KEY_JOURNEY_PLAN);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -41,6 +42,7 @@ import cpm.com.gskmtorange.dailyentry.CompetitionPromoActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StockDataActivity;
|
||||
@@ -49,6 +51,7 @@ import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
|
||||
public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
RecyclerView recyclerView;
|
||||
@@ -56,33 +59,28 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
DailyDataMenuAdapter adapter;
|
||||
TextView txt_categoryName;
|
||||
private Context context;
|
||||
|
||||
GSKOrangeDB db;
|
||||
String categoryName = "", categoryId;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, pog_type_id, store_flag_str;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
ArrayList<CategoryPictureGetterSetter> category_camera_list;
|
||||
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = new ArrayList<Visit_Type_Master_GetterSetter>();
|
||||
String visit_type_id = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
try {
|
||||
setContentView(R.layout.activity_daily_data_menu);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
//txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
context = this;
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
CommonFunctions.updateLangResources(context, 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);
|
||||
@@ -95,24 +93,22 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
if (preferences.getString(CommonString.KEY_VISIT_ID, "") != null) {
|
||||
visit_type_id = preferences.getString(CommonString.KEY_VISIT_ID, "");
|
||||
}
|
||||
//Intent data
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
|
||||
//txt_categoryName.setText(getResources().getString(R.string.title_activity_daily_main_menu) + " - " + categoryName);
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_daily_main_menu) + " - " + categoryName);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
db.open();
|
||||
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
||||
if (visittypelist.size() > 0) {
|
||||
if (visittypelist.get(0).getVISIT_TYPE_ID().equals("3")) {
|
||||
|
||||
/*FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
}
|
||||
});*/
|
||||
} catch (Resources.NotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -121,20 +117,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
try {
|
||||
categoryList = new ArrayList<>();
|
||||
|
||||
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
||||
|
||||
//For Additional Stores in Egypt(6) Only Stock Data will be captured
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.stock));
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkStockData(store_id, categoryId)) {
|
||||
if (db.checkStockData(store_id, categoryId, visit_date)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
@@ -143,13 +135,21 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
categoryList.add(data);
|
||||
}
|
||||
else {
|
||||
if (country_id.equals(CommonString.COUNTRY_ID_EGYPT+"") && categoryId.equals("3")) {
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2") && visit_type_id.equals("3")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.additional_visibility_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.additional_visibility);
|
||||
}
|
||||
categoryList.add(data);
|
||||
} else {
|
||||
if (country_id.equals(CommonString.COUNTRY_ID_EGYPT + "") && categoryId.equals("3")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId, visit_date)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
@@ -162,7 +162,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId, visit_date)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
@@ -174,38 +174,11 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
/*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.checkMsl_AvailabilityData(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 = new DailyDataMenuGetterSetter();
|
||||
//data.setCategory_name("Stock & Facing");
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (db.checkStockAndFacingData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.stock_facing_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.stock_facing);
|
||||
}
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.stockandfacing_grey);
|
||||
}
|
||||
categoryList.add(data);*/
|
||||
|
||||
//T2p and kenya POSm
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
if (country_id.equals("8")){
|
||||
if (country_id.equals("8") || country_id.equals("17")) {
|
||||
data.setCategory_name(getResources().getString(R.string.title_posm));
|
||||
}else {
|
||||
} else {
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
||||
}
|
||||
|
||||
@@ -230,7 +203,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
//T2p added
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||
if(country_id.equals("17")){
|
||||
data.setCategory_name(getResources().getString(R.string.title_posm) +"/"+getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||
}
|
||||
else{
|
||||
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)) {
|
||||
data.setCategory_img(R.mipmap.additional_visibility_done);
|
||||
} else {
|
||||
@@ -238,7 +217,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
categoryList.add(data);
|
||||
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
||||
if (country_id.equals("7")) {
|
||||
@@ -263,8 +241,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||
if (db.checkPromoComplianceData(store_id, categoryId) ||
|
||||
db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
||||
if (db.checkPromoComplianceData(store_id, categoryId) || db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.promo_compliance_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.promo_compliance);
|
||||
@@ -273,7 +250,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data.setCategory_img(R.mipmap.promocompliance_grey);
|
||||
}
|
||||
}
|
||||
|
||||
categoryList.add(data);
|
||||
|
||||
//Category Pictures
|
||||
@@ -290,17 +266,51 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} /*else {
|
||||
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||
}*/
|
||||
|
||||
} else {
|
||||
}
|
||||
else if(country_id!=null && country_id.equals("17") && camera_allow.equalsIgnoreCase("0")){
|
||||
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||
}
|
||||
else {
|
||||
if (db.getNoCameraCategoryDataInserted(store_id, categoryId, null).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.picturecatogory);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
categoryList.add(data);
|
||||
|
||||
//Order Taking
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
// ArrayList<AuditDataGetterSetter> question_list;
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
if (country_id.equals("15") || (country_id.equals("17") && categoryId.equals("2"))) {
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkOrder_taking_Data(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);
|
||||
}
|
||||
data.setCategory_name(getString(R.string.order_taking));
|
||||
categoryList.add(data);
|
||||
}
|
||||
|
||||
//Order Confirm
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
// ArrayList<AuditDataGetterSetter> question_list;
|
||||
if (country_id.equals("15") ) {
|
||||
if (db.checkOrder_Received_Data(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
}
|
||||
data.setCategory_name(getString(R.string.order_confirm));
|
||||
categoryList.add(data);
|
||||
}
|
||||
|
||||
//Audit
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
|
||||
@@ -335,8 +345,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}*/
|
||||
//new add UAE Pharma
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
if (country_id.equals("2")){
|
||||
if (camera_allow.equals("1")){
|
||||
if (country_id.equals("2")) {
|
||||
if (camera_allow.equals("1")) {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
@@ -347,10 +357,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
@@ -365,8 +375,24 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data.setCategory_name(getString(R.string.pog));
|
||||
categoryList.add(data);
|
||||
|
||||
//Warehouse Stock - Jordan
|
||||
if (country_id.equals("10")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.stock_entry));
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkStock_Entry_FacingDataNew(store_id, categoryId, visit_date)) {
|
||||
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);
|
||||
}
|
||||
|
||||
//Counterfeit Product Option - Egypt
|
||||
if(country_id.equals("6")){
|
||||
if (country_id.equals("6")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, categoryId).size() > 0) {
|
||||
@@ -381,8 +407,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
//usk
|
||||
//Cometition promo Option - Egypt
|
||||
if (categoryId.equals("2")){
|
||||
if(country_id.equals("6")){
|
||||
if (categoryId.equals("2")) {
|
||||
if (country_id.equals("6")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
|
||||
if (db.getCompetitionPromoExistsAfterData(store_id, categoryId).size() > 0) {
|
||||
@@ -463,7 +489,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved() {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
@@ -499,6 +524,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
Log.e("catid", categoryId + "," + storeType_id + "," + question_list.size());
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -507,14 +533,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!t2p_flag) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Log.e("questionlistsize", String.valueOf(question_list));
|
||||
return question_list;
|
||||
}
|
||||
|
||||
@@ -543,23 +567,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
holder.categoryName.setText(dailyData.getCategory_name());
|
||||
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
||||
|
||||
/*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)) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else*/
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||
|
||||
db.open();
|
||||
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
||||
// if(visittypelist.get(0).getVISIT_TYPE_ID().equals())
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||
if (country_id.equals("7")) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
@@ -576,12 +590,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))||dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p))) || dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
@@ -592,85 +606,79 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
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 {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
else if(country_id.equals("17") && !camera_allow.equalsIgnoreCase("1")){
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
/*else {
|
||||
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 (isMappingStockData()) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))
|
||||
|| dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
||||
}
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock_entry))) {
|
||||
if (isMappingStockData()) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing)) || dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
||||
if (isMappingStockData()) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||
if (getAuditQnsRemoved().size() > 0) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||
//new add UAE pharma
|
||||
|
||||
/*if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}*/
|
||||
if (country_id.equals("2")){
|
||||
if (camera_allow.equals("1")){
|
||||
|
||||
|
||||
if (country_id.equals("2")) {
|
||||
if (camera_allow.equals("1")) {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
/*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)) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_AvailabilityActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, Stock_FacingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
} else */
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||
if (country_id.equals("7")) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalPromoSKUwiseActivity.class);
|
||||
@@ -700,8 +708,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))||dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p))) || dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
@@ -716,14 +723,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
startActivity(intent);
|
||||
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))) ||
|
||||
dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm) +"/"+getResources().getString(R.string.daily_data_menu_additional_visibility)))) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalVisibility.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
||||
if (camera_allow.equalsIgnoreCase("1")) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, CategoryPicture.class);
|
||||
@@ -731,15 +737,31 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else {
|
||||
} else if(country_id!=null && !country_id.equals("17")) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, CreateSelfActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.order_taking))) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, OrderTakingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.order_confirm))) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, OrderConfirmActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
}
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_Availability_StockFacingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -747,10 +769,20 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
} 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.stock_entry))) {
|
||||
if (isMappingStockData()) {
|
||||
// Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockEntryActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
}
|
||||
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (isMappingStockData()) {
|
||||
// Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, NewStockDataActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -760,7 +792,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||
//if (db.getAuditCategoryWise(categoryId, storeType_id).size()>0) {
|
||||
|
||||
if (getAuditQnsRemoved().size() > 0) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, AuditActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -772,8 +803,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||
|
||||
//add uae pharma
|
||||
if (country_id.equals("2")){
|
||||
if (camera_allow.equals("1")){
|
||||
if (country_id.equals("2")) {
|
||||
if (camera_allow.equals("1")) {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -783,7 +814,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -800,7 +831,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -809,10 +840,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_stock_pricing))) {
|
||||
/*if (isMappingStockData()) {
|
||||
|
||||
}*/
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_stock_pricing))) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockPricingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -825,11 +853,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -853,19 +879,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
boolean isMappingStockData() {
|
||||
boolean flag;
|
||||
if (country_id.equals("7")||country_id.equals("8")) {
|
||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -300,7 +300,8 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(MSL_AvailabilityActivity.this);
|
||||
super.onBackPressed();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_AvailabilityActivity.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() {
|
||||
@@ -314,7 +315,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.firebase.crashlytics.internal.common.CrashlyticsCore;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.OrderReceivedStatus;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
|
||||
public class OrderConfirmActivity extends AppCompatActivity {
|
||||
RecyclerView recyclerview;
|
||||
GSKOrangeDB db;
|
||||
String visit_date, username, intime;
|
||||
private SharedPreferences preferences;
|
||||
JourneyPlanGetterSetter jcpGetset;
|
||||
Recycler_view_adapter adapter;
|
||||
ArrayList<OrderReceivedStatus> inserteslistData;
|
||||
private Dialog dialog;
|
||||
private boolean ResultFlag;
|
||||
Context context;
|
||||
LinearLayout poLL;
|
||||
TextView sys_gen_poTV;
|
||||
String storeid;
|
||||
String categoryName="",categoryId="";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_order_confirm);
|
||||
context = this;
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
//toolbar.setTitle("Order Status" + "-"+"PO List");
|
||||
toolbar.setTitle(context.getString(R.string.order_status_polist));
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
declaration();
|
||||
}
|
||||
|
||||
private void declaration() {
|
||||
recyclerview = (RecyclerView) findViewById(R.id.recyclerview);
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
|
||||
//Intent data
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
|
||||
storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
setDataToListView();
|
||||
}
|
||||
|
||||
private void setDataToListView() {
|
||||
try {
|
||||
db.open();
|
||||
inserteslistData=db.getOrderstatusData(storeid,categoryId);
|
||||
if(inserteslistData.size()>0){
|
||||
adapter = new Recycler_view_adapter(context, inserteslistData);
|
||||
recyclerview.setAdapter(adapter);
|
||||
recyclerview.setLayoutManager(new LinearLayoutManager(context));
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public class Recycler_view_adapter extends RecyclerView.Adapter<Recycler_view_adapter.Viewholder>{
|
||||
ArrayList<OrderReceivedStatus> orderReceivedStatuses;
|
||||
Context context;
|
||||
public Recycler_view_adapter(Context context, ArrayList<OrderReceivedStatus> list) {
|
||||
this.context = context;
|
||||
this.orderReceivedStatuses = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Recycler_view_adapter.Viewholder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
||||
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.order_status_item_layout,viewGroup,false);
|
||||
return new Viewholder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final Recycler_view_adapter.Viewholder viewholder, final int pos) {
|
||||
final OrderReceivedStatus current = orderReceivedStatuses.get(pos);
|
||||
viewholder.sys_gen_poTV.setText(current.getSys_gen_po());
|
||||
viewholder.podateTV.setText(current.getPodate());
|
||||
viewholder.storepoTV.setText(current.getStorepo());
|
||||
|
||||
viewholder.lineItemTV.setText( ""+current.getORDERQTY());
|
||||
if(current.getStatus().equalsIgnoreCase("CONFIRMED")){
|
||||
viewholder.statusTV.setText(context.getString(R.string.confirmed));
|
||||
}
|
||||
else if(current.getStatus().equalsIgnoreCase("CONFIRM")){
|
||||
viewholder.statusTV.setText(context.getString(R.string.confirmed));
|
||||
}
|
||||
else if(current.getStatus().equalsIgnoreCase("NOT CONFIRMED")){
|
||||
viewholder.statusTV.setText(context.getString(R.string.not_confirmed));
|
||||
}
|
||||
else if(current.getStatus().equalsIgnoreCase("PENDING")){
|
||||
viewholder.statusTV.setText(context.getString(R.string.pending));
|
||||
}
|
||||
else{
|
||||
viewholder.statusTV.setText(current.getStatus());
|
||||
}
|
||||
|
||||
viewholder.cardview.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(OrderConfirmActivity.this,OrderStatusDetailActivity.class).putExtra("categoryId",String.valueOf(current.getCATEGORY_ID()))
|
||||
.putExtra("SYS_PO_NUM",current.getSys_gen_po())
|
||||
.putExtra("PO_NUM",current.getStorepo())
|
||||
.putExtra("PO_DATE",current.getPodate())
|
||||
.putExtra("POID",String.valueOf(current.getPOID()))
|
||||
.putExtra("LINE",String.valueOf(current.getORDERQTY())));
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return orderReceivedStatuses.size();
|
||||
}
|
||||
|
||||
public class Viewholder extends RecyclerView.ViewHolder {
|
||||
TextView sys_gen_poTV,storepoTV,podateTV,lineItemTV,statusTV;
|
||||
CardView cardview;
|
||||
LinearLayout storepoLL;
|
||||
public Viewholder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
cardview= (CardView) itemView.findViewById(R.id.cardview);
|
||||
storepoLL= itemView.findViewById(R.id.storepoLL);
|
||||
sys_gen_poTV= itemView.findViewById(R.id.sys_gen_poTV);
|
||||
storepoTV= itemView.findViewById(R.id.storepoTV);
|
||||
podateTV= itemView.findViewById(R.id.podateTV);
|
||||
lineItemTV= itemView.findViewById(R.id.lineItemTV);
|
||||
statusTV= itemView.findViewById(R.id.statusTV);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
//return super.onOptionsItemSelected(item);
|
||||
int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// super.onBackPressed();
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
}
|
||||
}
|
||||
@@ -196,8 +196,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
img_addPromotion.setClickable(false);
|
||||
img_addPromotion.setBackgroundResource(R.mipmap.camera_grey);
|
||||
|
||||
if(!cd.getImage_promotion().equalsIgnoreCase(""))
|
||||
{
|
||||
if (!cd.getImage_promotion().equalsIgnoreCase("")) {
|
||||
if (new File(str + cd.getImage_promotion()).exists()) {
|
||||
//img = _pathforcheck;
|
||||
new File(str + cd.getImage_promotion()).delete();
|
||||
@@ -210,8 +209,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
cd.setIn_stock("-1");
|
||||
img_addPromotion.setClickable(false);
|
||||
img_addPromotion.setBackgroundResource(R.mipmap.camera_grey);
|
||||
if(!cd.getImage_promotion().equalsIgnoreCase(""))
|
||||
{
|
||||
if (!cd.getImage_promotion().equalsIgnoreCase("")) {
|
||||
if (new File(str + cd.getImage_promotion()).exists()) {
|
||||
//img = _pathforcheck;
|
||||
new File(str + cd.getImage_promotion()).delete();
|
||||
@@ -456,20 +454,17 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
promoSkuListData = db.getPromoComplianceSkuAfterData(store_id, categoryId);
|
||||
if (!(promoSkuListData.size() > 0)) {
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Promo Spinner List
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
}
|
||||
|
||||
@@ -986,7 +981,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -1095,7 +1090,21 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,855 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.InputFilter;
|
||||
import android.text.Spanned;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.BaseExpandableListAdapter;
|
||||
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 androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||
import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||
|
||||
public class StockEntryActivity extends AppCompatActivity implements DialogCallbackListener {
|
||||
ExpandableListView expandableListView;
|
||||
private Context context;
|
||||
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, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||
boolean isDialogOpen = true;
|
||||
private SharedPreferences preferences;
|
||||
int scrollPosition = 0;
|
||||
|
||||
String str_planogram = "", _pathforcheck = "";
|
||||
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
||||
boolean editFlag = false;
|
||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
||||
LinearLayout pricingLL;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
try {
|
||||
setContentView(R.layout.activity_msl_availability_stock_entry);
|
||||
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);
|
||||
pricingLL = findViewById(R.id.pricingLL);
|
||||
context = this;
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
store_flag_hide = preferences.getString(CommonString.KEY_STORE_FLAG_FACING_HIDE, 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, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
//Intent data
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
/*if (country_id != null && country_id.equals("5")) {
|
||||
pricingLL.setVisibility(View.GONE);
|
||||
} else {
|
||||
pricingLL.setVisibility(View.VISIBLE);
|
||||
}*/
|
||||
toolbar.setTitle(getResources().getString(R.string.stock_entry));
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
str_planogram = CommonString.FILE_PATH_PLANOGRAM;
|
||||
prepareList();
|
||||
prepareDefaultList();
|
||||
cameraMethod();
|
||||
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(view -> {
|
||||
expandableListView.clearFocus();
|
||||
adapter.notifyDataSetChanged();
|
||||
//if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||
// if (!validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||
db.open();
|
||||
if (db.checkStock_Entry_FacingDataNew(store_id, categoryId, visit_date)) {
|
||||
db.updateStock_Entry_FacingNew(visit_date, store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
||||
String mslAvailability_stockFacing_xml = "";
|
||||
String onXML = "";
|
||||
db.open();
|
||||
Log.d("listdata", store_id + "," + visit_date);
|
||||
msl_availabilityStockFacingList = db.getStock_Entry_UploadServerDataNew(store_id, visit_date,
|
||||
keyAccount_id, storeType_id, class_id,CommonString.TABLE_MAPPING_STOCK);
|
||||
Log.d("msllistsize", String.valueOf(msl_availabilityStockFacingList.size()));
|
||||
|
||||
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, pricing;
|
||||
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
||||
stock = msl_availabilityStockFacingList.get(j).getStock();
|
||||
} else {
|
||||
stock = "0";
|
||||
}
|
||||
if (!msl_availabilityStockFacingList.get(j).getPricingStock().equals("")) {
|
||||
pricing = msl_availabilityStockFacingList.get(j).getPricingStock();
|
||||
} else {
|
||||
pricing = "-1";
|
||||
}
|
||||
onXML = "[ST]"
|
||||
+ "[MID]" + "0" + "[/MID]"
|
||||
+ "[USERID]" + username + "[/USERID]"
|
||||
+ "[SID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SID]"
|
||||
+ "[POSM_STOCK]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getPosmStock()) + "[/POSM_STOCK]"
|
||||
+ "[WAREHOUSE_STOCK]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getWarehouseStock()) + "[/WAREHOUSE_STOCK]"
|
||||
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||
"[/ST]";
|
||||
|
||||
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
||||
}
|
||||
}
|
||||
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||
Log.d("MSL_DATA", sos_xml);
|
||||
}
|
||||
} else {
|
||||
db.InsertStock_EntryNew(visit_date, store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
}
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
/*} else {
|
||||
Snackbar.make(expandableListView, Error_Message, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
for (int i = 0; i < adapter.getGroupCount(); i++)
|
||||
expandableListView.expandGroup(i);
|
||||
}*/
|
||||
|
||||
});
|
||||
|
||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
|
||||
expandableListView.invalidate();
|
||||
|
||||
int lastItem = firstVisibleItem + visibleItemCount;
|
||||
|
||||
if (firstVisibleItem == 0) {
|
||||
fab.show();//.setVisibility(View.VISIBLE);
|
||||
} else if (lastItem == totalItemCount) {
|
||||
fab.hide();//setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
fab.show();//setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView arg0, int arg1) {
|
||||
InputMethodManager inputManager = (InputMethodManager) context
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
expandableListView.invalidateViews();
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group click listener
|
||||
expandableListView.setOnGroupClickListener((parent, v, groupPosition, id) -> false);
|
||||
|
||||
// Listview Group expanded listener
|
||||
expandableListView.setOnGroupExpandListener(groupPosition -> {
|
||||
InputMethodManager inputManager = (InputMethodManager) context
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getWindow().getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group collasped listener
|
||||
expandableListView.setOnGroupCollapseListener(groupPosition -> {
|
||||
InputMethodManager inputManager = (InputMethodManager) context
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getWindow().getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
});
|
||||
|
||||
// Listview on child click listener
|
||||
expandableListView.setOnChildClickListener((parent, v, groupPosition, childPosition, id) -> false);
|
||||
} catch (Resources.NotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// getMenuInflater().inflate(R.menu.planogram, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
if (editFlag) {
|
||||
CommonFunctions.showAlertDialog(context, getResources().getString(R.string.data_will_be_lost));
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelect(boolean flag) {
|
||||
if (flag) {
|
||||
if (!validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||
if (!camera_allow.equals("1")) {
|
||||
db.deletePlanogramListStoreAndCategorywise(store_id, categoryId,
|
||||
planogramShelfHeaderDataList, planogramHashMapListChildData);
|
||||
}
|
||||
}
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSave(boolean flag) {
|
||||
|
||||
}
|
||||
|
||||
private class MyWebViewClient extends WebViewClient {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
view.clearCache(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
}
|
||||
}
|
||||
|
||||
private void cameraMethod() {
|
||||
if (!camera_allow.equals("1")) {
|
||||
findViewById(R.id.lin_camera).setVisibility(View.GONE);
|
||||
} 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();
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
try {
|
||||
hashMapListHeaderData = new ArrayList<>();
|
||||
hashMapListChildData = new HashMap<>();
|
||||
//Header
|
||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||
headerDataList = db.getStockEntryHeaderData(country_id,categoryId, null, null, null,
|
||||
store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
headerDataList = db.getStockEntryHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC, store_flag_hide);
|
||||
} else {
|
||||
headerDataList = db.getStockEntryHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id,
|
||||
store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||
}
|
||||
if (headerDataList.size() > 0) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||
db.open();
|
||||
childDataList = db.getStock_Entry_SKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide, visit_date, false);
|
||||
updateCoverage(CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
childDataList = db.getStock_Entry_SKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK_ADHOC, store_flag_hide, visit_date, false);
|
||||
updateCoverage(CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||
} else {
|
||||
childDataList = db.getStock_Entry_SKUDataNewUpdate(headerDataList.get(i).getSub_category_id(), categoryId,
|
||||
headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||
CommonString.TABLE_MAPPING_STOCK, store_flag_hide, visit_date, false);
|
||||
updateCoverage(CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
}
|
||||
}
|
||||
|
||||
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
|
||||
expandableListView.setAdapter(adapter);
|
||||
//expand all
|
||||
for (int i = 0; i < adapter.getGroupCount(); i++)
|
||||
expandableListView.expandGroup(i);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
boolean validateData(List<MSL_AvailabilityStockFacingGetterSetter> listDataHeader,
|
||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listDataChild) {
|
||||
boolean flag = true, child_flag = true, all_flag = true;
|
||||
checkHeaderArray.clear();
|
||||
int childCount = 0;
|
||||
//temp list data for empty only
|
||||
List<MSL_AvailabilityStockFacingGetterSetter> listDataHeaderTemp = new ArrayList<>();
|
||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listDataChildTemp = new HashMap<>();
|
||||
for (int i = 0; i < listDataHeader.size(); i++) {
|
||||
flag = true;
|
||||
List<MSL_AvailabilityStockFacingGetterSetter> listTemp = new ArrayList<>();
|
||||
for (int j = 0; j < listDataChild.get(listDataHeader.get(i)).size(); j++) {
|
||||
child_flag = true;
|
||||
MSL_AvailabilityStockFacingGetterSetter data = listDataChild.get(listDataHeader.get(i)).get(j);
|
||||
String stock = data.getStock();
|
||||
String faceup = data.getFacing();
|
||||
String defaultpricing = data.getPricing();
|
||||
String pricing = data.getPricingStock();
|
||||
String companyId = data.getCompany_id();
|
||||
String must_have = data.getMust_have();
|
||||
//Company_id
|
||||
if (companyId.equals("1")) {
|
||||
if (must_have.equals("1")) {
|
||||
//usk ksa pricing
|
||||
if (!defaultpricing.equals("0")) {
|
||||
if (!country_id.equals("17") && pricing.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
scrollPosition = i + j + childCount;
|
||||
all_flag = false;
|
||||
flag = false;
|
||||
child_flag = false;
|
||||
Error_Message = getResources().getString(R.string.title_activity_stock_pricing);
|
||||
}
|
||||
}
|
||||
|
||||
if (store_flag_hide.equals("0") && !country_id.equals("15")) {
|
||||
if (!country_id.equals("17") && faceup.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
scrollPosition = i + j + childCount;
|
||||
all_flag = false;
|
||||
flag = false;
|
||||
child_flag = false;
|
||||
Error_Message = getResources().getString(R.string.faceup_value);
|
||||
} else {
|
||||
if (data.getToggleValue().equals("0") && !country_id.equals("10")) {
|
||||
if (stock.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
scrollPosition = i + j + childCount;
|
||||
all_flag = false;
|
||||
flag = false;
|
||||
child_flag = false;
|
||||
Error_Message = getResources().getString(R.string.stock_value);
|
||||
}
|
||||
} else {
|
||||
//for Egypt
|
||||
if (country_id.equals("6")) {
|
||||
if (stock.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
scrollPosition = i + j + childCount;
|
||||
all_flag = false;
|
||||
flag = false;
|
||||
child_flag = false;
|
||||
Error_Message = getResources().getString(R.string.stock_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (data.getToggleValue().equals("0") && !country_id.equals("10")) {
|
||||
if (stock.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
scrollPosition = i + j + childCount;
|
||||
all_flag = false;
|
||||
flag = false;
|
||||
child_flag = false;
|
||||
Error_Message = getResources().getString(R.string.stock_value);
|
||||
}
|
||||
} else {
|
||||
//for Egypt
|
||||
if (country_id.equals("6")) {
|
||||
if (stock.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
all_flag = false;
|
||||
flag = false;
|
||||
child_flag = false;
|
||||
Error_Message = getResources().getString(R.string.stock_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
if (store_flag_hide.equals("0")) {
|
||||
if (country_id != null && !country_id.equals("17") && faceup.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
scrollPosition = i + j + childCount;
|
||||
all_flag = false;
|
||||
flag = false;
|
||||
child_flag = false;
|
||||
Error_Message = getResources().getString(R.string.faceup_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!child_flag)
|
||||
listTemp.add(data);
|
||||
}
|
||||
|
||||
if (!flag) {
|
||||
listDataHeaderTemp.add(listDataHeader.get(i));
|
||||
listDataChildTemp.put(listDataHeader.get(i), listTemp);
|
||||
} else {
|
||||
childCount = childCount + listDataChild.get(listDataHeader.get(i)).size();
|
||||
}
|
||||
}
|
||||
|
||||
if (!all_flag) {
|
||||
adapter = new ExpandableListAdapter(context, listDataHeaderTemp, listDataChildTemp);
|
||||
expandableListView.setAdapter(adapter);
|
||||
checkflag = false;
|
||||
} else {
|
||||
checkflag = true;
|
||||
}
|
||||
|
||||
return all_flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
if (editFlag) {
|
||||
CommonFunctions.showAlertDialog(context, getResources().getString(R.string.data_will_be_lost));
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
CardView card_view = (CardView) convertView.findViewById(R.id.card_view);
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
|
||||
if (headerTitle.getCompany_id().equals("1")) {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||
} else {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||
} else {
|
||||
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}
|
||||
|
||||
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_stock_entry_child, null, false);
|
||||
holder = new ViewHolder();
|
||||
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
||||
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
||||
holder.posmStockET = convertView.findViewById(R.id.posmStockET);
|
||||
holder.warehouse_StockET = convertView.findViewById(R.id.warehouse_StockET);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
holder.txt_skuName.setText(childData.getSku());
|
||||
|
||||
|
||||
/* if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||
holder.txt_mbq.setVisibility(View.VISIBLE);
|
||||
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||
holder.toggle_available.setId(childPosition);
|
||||
if (country_id.equals("6") || country_id.equals("10")) {
|
||||
holder.stock.setVisibility(View.VISIBLE);
|
||||
holder.stock_view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
if (childData.getToggleValue().equals("1")) {
|
||||
holder.stock.setVisibility(View.GONE);
|
||||
holder.stock_view.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.stock.setVisibility(View.VISIBLE);
|
||||
holder.stock_view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.txt_mbq.setVisibility(View.GONE);
|
||||
holder.toggle_available.setVisibility(View.GONE);
|
||||
holder.toggle_available.setId(childPosition);
|
||||
holder.stock.setVisibility(View.GONE);
|
||||
holder.stock_view.setVisibility(View.GONE);
|
||||
}*/
|
||||
|
||||
/*if (country_id != null && !country_id.equals("17")) {
|
||||
if (childData.getPricing().equals("0")) {
|
||||
holder.ed_pricing.setVisibility(View.GONE);
|
||||
holder.pricing_view.setVisibility(View.GONE);
|
||||
holder.ed_pricing.setId(childPosition);
|
||||
holder.pricing_view.setId(childPosition);
|
||||
} else {
|
||||
holder.ed_pricing.setVisibility(View.VISIBLE);
|
||||
holder.pricing_view.setVisibility(View.VISIBLE);
|
||||
holder.ed_pricing.setId(childPosition);
|
||||
holder.pricing_view.setId(childPosition);
|
||||
}
|
||||
}*/
|
||||
|
||||
/* if (childData.getCompany_id().equals("1")) {
|
||||
if (country_id != null && country_id.equals("17") && !childData.getPricing().equals("0")) {
|
||||
holder.ed_pricing.setVisibility(View.VISIBLE);
|
||||
holder.pricing_view.setVisibility(View.VISIBLE);
|
||||
holder.ed_pricing.setId(childPosition);
|
||||
holder.pricing_view.setId(childPosition);
|
||||
} else {
|
||||
holder.ed_pricing.setVisibility(View.GONE);
|
||||
holder.pricing_view.setVisibility(View.GONE);
|
||||
holder.ed_pricing.setId(childPosition);
|
||||
holder.pricing_view.setId(childPosition);
|
||||
}
|
||||
if (childData.getMust_have().equals("1")) {
|
||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||
} else {
|
||||
if (country_id != null && country_id.equals("17")) {
|
||||
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||
holder.toggle_available.setId(childPosition);
|
||||
}
|
||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.blue));
|
||||
}
|
||||
} else {
|
||||
if (country_id != null && country_id.equals("17")) {
|
||||
holder.ed_pricing.setVisibility(View.GONE);
|
||||
holder.pricing_view.setVisibility(View.GONE);
|
||||
holder.ed_pricing.setId(childPosition);
|
||||
holder.pricing_view.setId(childPosition);
|
||||
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||
holder.toggle_available.setId(childPosition);
|
||||
}
|
||||
|
||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||
}*/
|
||||
|
||||
final ViewHolder finalHolder = holder;
|
||||
|
||||
holder.warehouse_StockET.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
final EditText caption = (EditText) v;
|
||||
String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||
|
||||
editFlag = true;
|
||||
|
||||
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||
finalHolder.warehouse_StockET.setText(edFaceup);
|
||||
childData.setWarehouseStock(edFaceup);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.warehouse_StockET.setText(childData.getWarehouseStock());
|
||||
|
||||
holder.posmStockET.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
final EditText caption = (EditText) v;
|
||||
String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||
|
||||
editFlag = true;
|
||||
|
||||
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||
finalHolder.posmStockET.setText(edFaceup);
|
||||
childData.setPosmStock(edFaceup);
|
||||
}
|
||||
}
|
||||
});
|
||||
holder.posmStockET.setText(childData.getPosmStock());
|
||||
|
||||
|
||||
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;
|
||||
EditText posmStockET, warehouse_StockET;
|
||||
}
|
||||
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
public String PerfectDecimal(String str, int MAX_BEFORE_POINT, int MAX_DECIMAL) {
|
||||
if (str.charAt(0) == '.') str = "0" + str;
|
||||
int max = str.length();
|
||||
|
||||
String rFinal = "";
|
||||
boolean after = false;
|
||||
int i = 0, up = 0, decimal = 0;
|
||||
char t;
|
||||
while (i < max) {
|
||||
t = str.charAt(i);
|
||||
if (t != '.' && after == false) {
|
||||
up++;
|
||||
if (up > MAX_BEFORE_POINT) return rFinal;
|
||||
} else if (t == '.') {
|
||||
after = true;
|
||||
} else {
|
||||
decimal++;
|
||||
if (decimal > MAX_DECIMAL)
|
||||
return rFinal;
|
||||
}
|
||||
rFinal = rFinal + t;
|
||||
i++;
|
||||
}
|
||||
return rFinal;
|
||||
}
|
||||
|
||||
public class DecimalDigitsInputFilter implements InputFilter {
|
||||
Pattern mPattern;
|
||||
|
||||
public DecimalDigitsInputFilter(int digitsBeforeZero, int digitsAfterZero) {
|
||||
mPattern = Pattern.compile("[0-9]{0," + (digitsBeforeZero - 1) + "}+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||
Matcher matcher = mPattern.matcher(dest);
|
||||
if (!matcher.matches())
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateCoverage(String table) {
|
||||
long l = db.updateStockMapping(store_id, visit_date, table);
|
||||
if (l > 0) Log.e("CoverageUpdate", "" + l);
|
||||
}
|
||||
}
|
||||
@@ -552,15 +552,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
Error_Message = getResources().getString(R.string.fill_data);
|
||||
break;
|
||||
}
|
||||
/*} else {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
|
||||
flag = false;
|
||||
Error_Message = getResources().getString(R.string.click_image);
|
||||
break;
|
||||
}*/
|
||||
} else {
|
||||
if (stock.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
@@ -730,7 +721,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
try {
|
||||
Log.e("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -777,47 +768,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void startCameraActivity1(int position) {
|
||||
/*try {
|
||||
Log.e("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
for (int n = 0; n < list.size(); n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
*//*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
Log.e("TAG", "package name : " + list.get(n).packageName);*//*
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, 1);
|
||||
//startActivityForResult(intent, position);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
|
||||
try {
|
||||
Log.e("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -863,45 +817,11 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void startCameraActivity2(int position) {
|
||||
/*try {
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
for (int n = 0; n < list.size(); n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
*//*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
Log.e("TAG", "package name : " + list.get(n).packageName);*//*
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
|
||||
try {
|
||||
Log.e("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -949,144 +869,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
Log.e("Stock & Facing", "resultCode: " + resultCode);
|
||||
/*switch (resultCode) {
|
||||
case 0:
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
break;
|
||||
case -1:
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img1 = _pathforcheck;
|
||||
adapter.notifyDataSetChanged();
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
|
||||
switch (requestCode) {
|
||||
/*case 1:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img1 = _pathforcheck;
|
||||
adapter.notifyDataSetChanged();
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img2 = _pathforcheck;
|
||||
adapter.notifyDataSetChanged();
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img3 = _pathforcheck;
|
||||
_pathforcheck = "";
|
||||
|
||||
if (!img3.equalsIgnoreCase("")) {
|
||||
cameraData.setCamera1(img3);
|
||||
img3 = "";
|
||||
}
|
||||
|
||||
if (cameraData.getCamera1().equals("")) {
|
||||
camera1.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
camera1.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img4 = _pathforcheck;
|
||||
_pathforcheck = "";
|
||||
|
||||
if (!img4.equalsIgnoreCase("")) {
|
||||
cameraData.setCamera2(img4);
|
||||
img4 = "";
|
||||
}
|
||||
|
||||
if (cameraData.getCamera2().equals("")) {
|
||||
camera2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
camera2.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img5 = _pathforcheck;
|
||||
_pathforcheck = "";
|
||||
|
||||
if (!img5.equalsIgnoreCase("")) {
|
||||
cameraData.setCamera3(img5);
|
||||
img5 = "";
|
||||
}
|
||||
|
||||
if (cameraData.getCamera3().equals("")) {
|
||||
camera3.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
camera3.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img6 = _pathforcheck;
|
||||
_pathforcheck = "";
|
||||
|
||||
if (!img6.equalsIgnoreCase("")) {
|
||||
cameraData.setCamera4(img6);
|
||||
img6 = "";
|
||||
}
|
||||
|
||||
if (cameraData.getCamera4().equals("")) {
|
||||
camera4.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
camera4.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;*/
|
||||
|
||||
case 100:
|
||||
//Planogram List for check and delete on backPress
|
||||
@@ -1132,12 +916,25 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
|
||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -1194,9 +991,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList;
|
||||
|
||||
if (country_id.equals("7")) {
|
||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, null, null, store_id, CommonString.TABLE_MAPPING_PLANOGRAM_STORE_WISE);
|
||||
mappingPlanogramList = db.getMappingPlanogramData(categoryId, null, null, store_id, CommonString.TABLE_MAPPING_PLANOGRAM_STORE_WISE);
|
||||
} else {
|
||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, storeType_id, class_id, null, CommonString.TABLE_MAPPING_PLANOGRAM);
|
||||
mappingPlanogramList = db.getMappingPlanogramData(categoryId, storeType_id, class_id, null, CommonString.TABLE_MAPPING_PLANOGRAM);
|
||||
}
|
||||
|
||||
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
||||
|
||||
@@ -61,7 +61,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
context = this;
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
CommonFunctions.updateLangResources(context, 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);
|
||||
@@ -131,12 +131,11 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
try {
|
||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
storeWisePerformanceList = db.getStoreWisePerformance(store_id, CommonString.TABLE_STORE_PERFORMANCE_NEW_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
storeWisePerformanceList = db.getStoreWisePerformance(store_id, "STORE_PERFORMANCE_REVISED");
|
||||
|
||||
|
||||
@@ -198,7 +197,6 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onBindViewHolder(StoreWisePerformaceAdapter.MyViewHolder holder, int position) {
|
||||
final StoreWisePerformaceGetterSetter categoryData = list.get(position);
|
||||
|
||||
if (categoryData.getPeriod().equalsIgnoreCase("LTM")) {
|
||||
holder.txt_period.setText(getResources().getString(R.string.category_performance_ltm));
|
||||
} else if (categoryData.getPeriod().equalsIgnoreCase("MTD")) {
|
||||
@@ -220,7 +218,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView txt_period, txt_sos, txt_t2p, txt_promo, txt_msl_availability,txt_planogram;
|
||||
TextView txt_period, txt_sos, txt_t2p, txt_promo, txt_msl_availability, txt_planogram;
|
||||
LinearLayout lay_menu;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
@@ -233,7 +231,6 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
txt_msl_availability = (TextView) itemView.findViewById(R.id.txt_msl_availability);
|
||||
txt_planogram = (TextView) itemView.findViewById(R.id.txt_planogram);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,13 +137,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
setContentView(R.layout.activity_mpin);
|
||||
|
||||
context = this;
|
||||
/*Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);*/
|
||||
|
||||
// Obtain the FirebaseAnalytics instance.
|
||||
// mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
// myTrace = FirebasePerformance.getInstance().newTrace("test_trace");
|
||||
// myTrace.start();
|
||||
|
||||
IS_PASSWORD_CHECK = getIntent().getBooleanExtra(CommonString.IS_PASSWORD_CHECK, false);
|
||||
|
||||
@@ -250,12 +243,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
"Correct",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
/* blurLockView.hide(
|
||||
getIntent().getIntExtra("HIDE_DURATION", 1000),
|
||||
getHideType(getIntent().getIntExtra("HIDE_DIRECTION", 0)),
|
||||
getEaseType(getIntent().getIntExtra("HIDE_EASE_TYPE", 30)));*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -527,37 +514,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
return easeType;
|
||||
}
|
||||
|
||||
/*public void showComment(){
|
||||
|
||||
dialog = new Dialog(MPinActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
||||
dialog.setContentView(R.layout.comment_layout);
|
||||
TextView tv = (TextView) dialog.findViewById(R.id.tv_comment);
|
||||
|
||||
tv.setText("");
|
||||
|
||||
Window window = dialog.getWindow();
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
|
||||
wlp.gravity = Gravity.TOP;
|
||||
//wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;
|
||||
window.setAttributes(wlp);
|
||||
|
||||
dialog.show();
|
||||
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Represents an asynchronous login/registration task used to authenticate
|
||||
* the user.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents an asynchronous login/registration task used to authenticate
|
||||
* the user.
|
||||
*/
|
||||
|
||||
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
||||
private Dialog dialog;
|
||||
|
||||
@@ -656,10 +612,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
final FailureGetterSetter failureGetterSetter = XMLHandlers.failureXMLHandler(xpp, eventType);
|
||||
|
||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
MPinActivity.this, CommonString.METHOD_LOGIN
|
||||
+ failureGetterSetter.getErrorMsg(),
|
||||
"login", null);*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -700,10 +652,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, CommonString.KEY_LOGIN_DATA);
|
||||
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "Data");
|
||||
bundle.putString(CommonString.KEY_LANGUAGE, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
// mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
|
||||
|
||||
// Crashlytics.setUserIdentifier(userId);
|
||||
|
||||
return CommonString.KEY_SUCCESS;
|
||||
|
||||
}
|
||||
@@ -713,10 +661,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
MPinActivity.this, AlertMessage.MESSAGE_EXCEPTION,
|
||||
"acra_login", e);*/
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -746,12 +690,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
MPinActivity.this, AlertMessage.MESSAGE_EXCEPTION,
|
||||
"acra_login", e);*/
|
||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
//Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception("My custom login Exception"));
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -835,19 +773,15 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
}
|
||||
|
||||
ArrayList<String> language, culture_id, notice_url;
|
||||
|
||||
LoginGetterSetter login_data;
|
||||
|
||||
private void setLanguageDataFromSharedPreferences() {
|
||||
Gson gson = new Gson();
|
||||
login_data = new LoginGetterSetter();
|
||||
|
||||
String jsonPreferences = preferences.getString(CommonString.KEY_LOOGIN_PREF, "");
|
||||
|
||||
Type type = new TypeToken<LoginGetterSetter>() {
|
||||
}.getType();
|
||||
login_data = gson.fromJson(jsonPreferences, type);
|
||||
|
||||
language = login_data.getCULTURE_NAME();
|
||||
culture_id = login_data.getCULTURE_ID();
|
||||
notice_url = login_data.getNOTICE_URL();
|
||||
@@ -914,7 +848,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||
Gson gson = new Gson();
|
||||
String jsonCurProduct = gson.toJson(lgs);
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||
editor.commit();
|
||||
@@ -922,12 +855,9 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
//permission and location related
|
||||
void checkAppPermission(String permission, int requestCode) {
|
||||
|
||||
boolean permission_flag = false;
|
||||
// Here, thisActivity is the current activity
|
||||
if (ContextCompat.checkSelfPermission(MPinActivity.this,
|
||||
permission)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
if (ContextCompat.checkSelfPermission(MPinActivity.this, permission) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
// Permission is not granted
|
||||
// Should we show an explanation?
|
||||
|
||||
@@ -17,7 +17,8 @@ import com.google.android.material.snackbar.Snackbar;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
|
||||
public class PharmaActivity extends AppCompatActivity implements StoreDetailFragment.OnFragmentInteractionListener, MSLFragment.OnFragmentInteractionListener, SOSFragment.OnFragmentInteractionListener{
|
||||
public class PharmaActivity extends AppCompatActivity implements StoreDetailFragment.OnFragmentInteractionListener,
|
||||
MSLFragment.OnFragmentInteractionListener, SOSFragment.OnFragmentInteractionListener{
|
||||
private SharedPreferences.Editor editor = null;
|
||||
private SharedPreferences preferences;
|
||||
FloatingActionButton fab;
|
||||
|
||||
@@ -25,6 +25,7 @@ public class FCMNotificationService extends FirebaseMessagingService {
|
||||
String TAG ="FCM Notification";
|
||||
|
||||
public FCMNotificationService() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.graphics.BitmapFactory;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
@@ -67,6 +68,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGette
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
|
||||
public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
@@ -288,18 +290,18 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
for (int i = 0; i < coverageList.size(); i++) {
|
||||
|
||||
storeData = db.getSpecificStoreData(coverageList.get(i).getVisitDate(), coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||
storeData = db.getSpecificStoreData(coverageList.get(i).getVisitDate(), coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||
if (storeData.getSTORE_ID() != null) {
|
||||
|
||||
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||
storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_L) ||
|
||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U)||
|
||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U) ||
|
||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_UN)) {
|
||||
|
||||
String camera_allow = storeData.getCAMERA_ALLOW();
|
||||
|
||||
String adhoc;
|
||||
if (coverageList.get(i).getFlag_from()!=null && coverageList.get(i).getFlag_from().equals(CommonString.FROM_DEVIATION)) {
|
||||
if (coverageList.get(i).getFlag_from() != null && coverageList.get(i).getFlag_from().equals(CommonString.FROM_DEVIATION)) {
|
||||
adhoc = "1";
|
||||
} else {
|
||||
adhoc = "0";
|
||||
@@ -307,17 +309,16 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
String coverage_service, status_service;
|
||||
|
||||
if(coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)){
|
||||
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
||||
status_service = CommonString.METHOD_UPLOAD_COVERAGE_STATUS_ADDITIONAL;
|
||||
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW_ADDITIONAL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
status_service = CommonString.METHOD_UPLOAD_COVERAGE_STATUS;
|
||||
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW;
|
||||
}
|
||||
|
||||
String sub_reason_id = coverageList.get(i).getSub_reasonId();
|
||||
if (sub_reason_id!=null && sub_reason_id.equals("")) {
|
||||
if (sub_reason_id != null && sub_reason_id.equals("")) {
|
||||
sub_reason_id = "0";
|
||||
}
|
||||
|
||||
@@ -462,7 +463,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
store_detail_xml = store_detail_xml + onXML;
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + image_xml+ store_detail_xml + "[/DATA]";
|
||||
final String sos_xml = "[DATA]" + image_xml + store_detail_xml + "[/DATA]";
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
@@ -548,7 +549,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[BID]" + Integer.parseInt(pharmaMSLList.get(j).getBrandId()) + "[/BID]"
|
||||
+ "[SKID]" + Integer.parseInt(pharmaMSLList.get(j).getSkuId()) + "[/SKID]"
|
||||
+ "[PRESENT]" + pharmaMSLList.get(j).getPresent() + "[/PRESENT]"+
|
||||
+ "[PRESENT]" + pharmaMSLList.get(j).getPresent() + "[/PRESENT]" +
|
||||
"[/ST]";
|
||||
|
||||
pharma_msl_xml = pharma_msl_xml + onXML;
|
||||
@@ -585,13 +586,16 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
String mslAvailability_stockFacing_xml = "";
|
||||
onXML = "";
|
||||
db.open();
|
||||
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
||||
|
||||
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerDataNew(coverageList.get(i)
|
||||
.getStoreId(), coverageList.get(i).getVisitDate(),
|
||||
coverageList.get(i).getKeyAccountId(),
|
||||
coverageList.get(i).getStoreTypeId(),
|
||||
coverageList.get(i).getClassId(),
|
||||
coverageList.get(i).getMappingStk());
|
||||
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,pricing;
|
||||
String stock, pricing;
|
||||
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
||||
stock = msl_availabilityStockFacingList.get(j).getStock();
|
||||
} else {
|
||||
@@ -610,7 +614,8 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[AVL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVL]"
|
||||
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
||||
+ "[SK]" + Integer.parseInt(stock) + "[/SK]"
|
||||
+ "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
||||
+ "[PRICING]" + Double.parseDouble(pricing) + "[/PRICING]"
|
||||
// + "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
||||
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||
"[/ST]";
|
||||
|
||||
@@ -619,12 +624,67 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
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", "STOCK_AVAILABILITY_WITH_PRICING");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
result = envelope.getResponse();
|
||||
}
|
||||
data.value = 15;
|
||||
data.name = getString(R.string.availability_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
String msl_availabilityStockEntryXml = "";
|
||||
onXML = "";
|
||||
db.open();
|
||||
msl_availabilityStockFacingList = db.getStock_Entry_UploadServerDataNew(coverageList.get(i)
|
||||
.getStoreId(),coverageList.get(i).getVisitDate(),
|
||||
coverageList.get(i).getKeyAccountId(),
|
||||
coverageList.get(i).getStoreTypeId(),
|
||||
coverageList.get(i).getClassId(),
|
||||
coverageList.get(i).getMappingStk());
|
||||
|
||||
if (msl_availabilityStockFacingList.size() > 0) {
|
||||
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||
String posm_stock,warehouse_stock;
|
||||
if (!msl_availabilityStockFacingList.get(j).getPosmStock().equals("")) {
|
||||
posm_stock = msl_availabilityStockFacingList.get(j).getPosmStock();
|
||||
} else {
|
||||
posm_stock = "0";
|
||||
}
|
||||
if (!msl_availabilityStockFacingList.get(j).getWarehouseStock().equals("")) {
|
||||
warehouse_stock = msl_availabilityStockFacingList.get(j).getWarehouseStock();
|
||||
} else {
|
||||
warehouse_stock = "0";
|
||||
}
|
||||
onXML = "[ST]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[SID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SID]"
|
||||
+ "[POSM_STOCK]" + Integer.parseInt(posm_stock) + "[/POSM_STOCK]"
|
||||
+ "[WAREHOUSE_STOCK]" + Integer.parseInt(warehouse_stock) + "[/WAREHOUSE_STOCK]"
|
||||
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||
"[/ST]";
|
||||
|
||||
msl_availabilityStockEntryXml = msl_availabilityStockEntryXml + onXML;
|
||||
}
|
||||
}
|
||||
final String sos_xml = "[DATA]" + msl_availabilityStockEntryXml + "[/DATA]";
|
||||
Log.d("STOCK_ENTRY_DATA",sos_xml);
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "STOCK_ENTRY");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
@@ -639,11 +699,12 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
data.value = 15;
|
||||
data.name = getString(R.string.availability_data_uploading);
|
||||
data.value = 16;
|
||||
data.name = getString(R.string.stock_entry_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
|
||||
//Promo Compliance - Promotion Data
|
||||
String promoition_data_xml = "";
|
||||
onXML = "";
|
||||
@@ -1001,8 +1062,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
present = "1";
|
||||
} else {
|
||||
present = "0";
|
||||
}*/String qty = t2PGetterSetters.get(i1).getQty();
|
||||
if(qty.equals("")){
|
||||
}*/
|
||||
String qty = t2PGetterSetters.get(i1).getQty();
|
||||
if (qty.equals("")) {
|
||||
qty = "0";
|
||||
}
|
||||
|
||||
@@ -1564,7 +1626,6 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[/COMPETITION_PROMOTION_DATA]";
|
||||
|
||||
competiton_data_xml = competiton_data_xml + competiton_exists_xml;
|
||||
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + competiton_data_xml + "[/DATA]";
|
||||
@@ -1588,6 +1649,169 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
data.value = 68;
|
||||
data.name = getString(R.string.title_activity_competition_promo);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
String order_taking_xml = "";
|
||||
String _onxml = "";
|
||||
String categoryxml = "";
|
||||
db.open();
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> ordertakingdata = db.getOrder_TAKING_UploadServerData(coverageList.get(i).getStoreId());
|
||||
db.open();
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> getOrder_TAKING_CategoryData = db.getOrder_TAKING_CategoryData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (ordertakingdata.size() > 0) {
|
||||
for (int k = 0; k < getOrder_TAKING_CategoryData.size(); k++) {
|
||||
_onxml = "[CATEGORY_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[PRESENT]" + getOrder_TAKING_CategoryData.get(k).getIsExist() + "[/PRESENT]"
|
||||
+ "[CATEGORY_ID]" + getOrder_TAKING_CategoryData.get(k).getCategory_id() + "[/CATEGORY_ID]"
|
||||
+ "[/CATEGORY_DATA]";
|
||||
categoryxml = categoryxml + _onxml;
|
||||
}
|
||||
|
||||
String cat_xml = categoryxml;
|
||||
for (int j = 0; j < ordertakingdata.size(); j++) {
|
||||
if (ordertakingdata.get(j).getIsExist() == 1) {
|
||||
if (!ordertakingdata.get(j).getFacing().equals("0") &&
|
||||
!ordertakingdata.get(j).getFacing().equals("")) {
|
||||
onXML = "[ORDER_TAKING]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[CATEGORY_ID]" + ordertakingdata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||
+ "[SYSTEM_PO_NUM]" + ordertakingdata.get(j).getSys_PO_No() + "[/SYSTEM_PO_NUM]"
|
||||
+ "[STORE_PO_NUM]" + ordertakingdata.get(j).getStore_PO_No() + "[/STORE_PO_NUM]"
|
||||
+ "[PO_DATE]" + ordertakingdata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||
+ "[BRAND_ID]" + ordertakingdata.get(j).getBrand_id() + "[/BRAND_ID]"
|
||||
+ "[SKU_ID]" + ordertakingdata.get(j).getSku_id() + "[/SKU_ID]"
|
||||
+ "[ORDER_QTY]" + ordertakingdata.get(j).getFacing() + "[/ORDER_QTY]"
|
||||
+ "[PO_IMAGE]" + ordertakingdata.get(j).getPO_Img() + "[/PO_IMAGE]" +
|
||||
"[/ORDER_TAKING]";
|
||||
order_taking_xml = order_taking_xml + onXML;
|
||||
}
|
||||
}
|
||||
}
|
||||
String data_xml = cat_xml + order_taking_xml;
|
||||
|
||||
final String sos_xml = "[DATA]" + data_xml + "[/DATA]";
|
||||
Log.e("order_xml_data", sos_xml);
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "ORDER_TAKING_NEW_XML");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
|
||||
data.value = 69;
|
||||
data.name = getString(R.string.order_taking_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
String order_received_xml = "";
|
||||
onXML = "";
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> orderreceiveddata = db.getOrder_RECEIVED_UploadServerData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (orderreceiveddata.size() > 0) {
|
||||
for (int j = 0; j < orderreceiveddata.size(); j++) {
|
||||
onXML = "[ORDER_CONFIRM]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[CATEGORY_ID]" + orderreceiveddata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||
+ "[SYSTEM_PO_NUM]" + orderreceiveddata.get(j).getSys_PO_No() + "[/SYSTEM_PO_NUM]"
|
||||
+ "[STORE_PO_NUM]" + orderreceiveddata.get(j).getStore_PO_No() + "[/STORE_PO_NUM]"
|
||||
+ "[PO_DATE]" + orderreceiveddata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||
+ "[BRAND_ID]" + orderreceiveddata.get(j).getBrand_id() + "[/BRAND_ID]"
|
||||
+ "[SKU_ID]" + orderreceiveddata.get(j).getSku_id() + "[/SKU_ID]"
|
||||
+ "[PO_QTY]" + orderreceiveddata.get(j).getOrderqty() + "[/PO_QTY]"
|
||||
+ "[ACTUAL_QTY]" + orderreceiveddata.get(j).getFacing() + "[/ACTUAL_QTY]" +
|
||||
"[/ORDER_CONFIRM]";
|
||||
|
||||
order_received_xml = order_received_xml + onXML;
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + order_received_xml + "[/DATA]";
|
||||
Log.e("order_xml_data", sos_xml);
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "ORDER_RECEIVED_STATUS_XML");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
|
||||
data.value = 70;
|
||||
data.name = getString(R.string.order_received_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
String visit_xml = "";
|
||||
onXML = "";
|
||||
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = db.getUploadedVisitType(coverageList.get(i).getStoreId());
|
||||
|
||||
if (visittypelist.size() > 0) {
|
||||
for (int j = 0; j < visittypelist.size(); j++) {
|
||||
onXML = "[VISIT_TYPE_STATUS]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[STORE_ID]" + coverageList.get(i).getStoreId() + "[/STORE_ID]"
|
||||
+ "[VISIT_TYPE_ID]" + visittypelist.get(j).getVISIT_TYPE_ID().get(0) + "[/VISIT_TYPE_ID]"
|
||||
+ "[/VISIT_TYPE_STATUS]";
|
||||
|
||||
visit_xml = visit_xml + onXML;
|
||||
}
|
||||
final String sos_xml = "[DATA]" + visit_xml + "[/DATA]";
|
||||
Log.e("visit_xml_data", sos_xml);
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "VISIT_TYPE_XML");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}
|
||||
}
|
||||
data.value = 71;
|
||||
data.name = getString(R.string.visit_type_data_uploading);
|
||||
publishProgress(data);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -2164,11 +2388,11 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
e.printStackTrace();
|
||||
} catch (XmlPullParserException e) {
|
||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
//Crashlytics.logException(e.getCause());
|
||||
//Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -83,6 +83,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGette
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
import retrofit.Retrofit;
|
||||
|
||||
@@ -96,8 +97,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
String[] words;
|
||||
String validity;
|
||||
int mid;
|
||||
String errormsg = "", Path;
|
||||
Data data;
|
||||
String errormsg = "", Path; Data data;
|
||||
ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList;
|
||||
ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList;
|
||||
ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList;
|
||||
@@ -123,14 +123,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
||||
ArrayList<CompetitonPromoGetterSetter> competitonGetterSetters, competitonExistsGetterSetters;
|
||||
|
||||
RequestBody body1;
|
||||
private Retrofit adapter;
|
||||
int status = 0;
|
||||
int count = 0;
|
||||
public static int uploadedFiles = 0;
|
||||
public static int totalFiles = 0;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -375,7 +367,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
adhoc = "0";
|
||||
}
|
||||
|
||||
|
||||
String coverage_service, status_service;
|
||||
|
||||
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL) || coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
||||
@@ -559,7 +550,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
publishProgress(data);*/
|
||||
|
||||
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
||||
|
||||
//MSL_Availability_StockFacing
|
||||
String mslAvailability_stockFacing_xml = "";
|
||||
onXML = "";
|
||||
@@ -583,7 +573,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[STK]" + Integer.parseInt(stock) + "[/STK]"
|
||||
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||
+ "[MSL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/MSL]" +
|
||||
|
||||
"[/ST]";
|
||||
|
||||
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
||||
@@ -607,9 +596,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
data.value = 15;
|
||||
data.name = getString(R.string.availability_data_uploading);
|
||||
@@ -876,7 +862,12 @@ public class UploadActivity extends AppCompatActivity {
|
||||
String mslAvailability_stockFacing_xml = "";
|
||||
onXML = "";
|
||||
db.open();
|
||||
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
||||
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerDataNew(coverageList.get(i)
|
||||
.getStoreId(),coverageList.get(i).getVisitDate(),
|
||||
coverageList.get(i).getKeyAccountId(),
|
||||
coverageList.get(i).getStoreTypeId(),
|
||||
coverageList.get(i).getClassId(),
|
||||
coverageList.get(i).getMappingStk());
|
||||
|
||||
if (msl_availabilityStockFacingList.size() > 0) {
|
||||
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||
@@ -901,7 +892,8 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[AVL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVL]"
|
||||
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
||||
+ "[SK]" + Integer.parseInt(stock) + "[/SK]"
|
||||
+ "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
||||
+ "[PRICING]" + Double.parseDouble(pricing) + "[/PRICING]"
|
||||
// + "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
||||
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||
"[/ST]";
|
||||
|
||||
@@ -910,7 +902,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||
|
||||
Log.d("MSL_DATA",sos_xml);
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "STOCK_AVAILABILITY_WITH_PRICING");
|
||||
@@ -935,6 +927,70 @@ public class UploadActivity extends AppCompatActivity {
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//MSL_Availability_StockFacing
|
||||
String msl_availabilityStockEntryXml = "";
|
||||
onXML = "";
|
||||
db.open();
|
||||
msl_availabilityStockFacingList = db.getStock_Entry_UploadServerDataNew(coverageList.get(i)
|
||||
.getStoreId(),coverageList.get(i).getVisitDate(),
|
||||
coverageList.get(i).getKeyAccountId(),
|
||||
coverageList.get(i).getStoreTypeId(),
|
||||
coverageList.get(i).getClassId(),
|
||||
coverageList.get(i).getMappingStk());
|
||||
|
||||
if (msl_availabilityStockFacingList.size() > 0) {
|
||||
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||
String posm_stock,warehouse_stock;
|
||||
if (!msl_availabilityStockFacingList.get(j).getPosmStock().equals("")) {
|
||||
posm_stock = msl_availabilityStockFacingList.get(j).getPosmStock();
|
||||
} else {
|
||||
posm_stock = "0";
|
||||
}
|
||||
if (!msl_availabilityStockFacingList.get(j).getWarehouseStock().equals("")) {
|
||||
warehouse_stock = msl_availabilityStockFacingList.get(j).getWarehouseStock();
|
||||
} else {
|
||||
warehouse_stock = "0";
|
||||
}
|
||||
onXML = "[ST]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[SID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SID]"
|
||||
+ "[POSM_STOCK]" + Integer.parseInt(posm_stock) + "[/POSM_STOCK]"
|
||||
+ "[WAREHOUSE_STOCK]" + Integer.parseInt(warehouse_stock) + "[/WAREHOUSE_STOCK]"
|
||||
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||
"[/ST]";
|
||||
|
||||
msl_availabilityStockEntryXml = msl_availabilityStockEntryXml + onXML;
|
||||
}
|
||||
}
|
||||
final String sos_xml = "[DATA]" + msl_availabilityStockEntryXml + "[/DATA]";
|
||||
Log.d("STOCK_ENTRY_DATA",sos_xml);
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "STOCK_ENTRY");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
data.value = 16;
|
||||
data.name = getString(R.string.stock_entry_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//Promo Compliance - Promotion Data
|
||||
String promoition_data_xml = "";
|
||||
onXML = "";
|
||||
@@ -1018,7 +1074,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[PROMO_IMAGE]" + promoComplianceSkuwiseGetterSetters.get(i1).getImg() + "[/PROMO_IMAGE]"
|
||||
+ "[PRICE_FLASHER_AVAILABLE]" + promoComplianceSkuwiseGetterSetters.get(i1).getPrice_flasher() + "[/PRICE_FLASHER_AVAILABLE]"
|
||||
+ "[/PROMOTION_DATA]";
|
||||
|
||||
add_promotion_data_xml = add_promotion_data_xml + add_xml;
|
||||
}
|
||||
}
|
||||
@@ -1554,7 +1609,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
ArrayList<AuditDataGetterSetter> audit_data = db.getAuditDataForUpload(coverageList.get(i).getStoreId());
|
||||
|
||||
if (audit_data.size() > 0) {
|
||||
|
||||
String onXml_audit_data = "", Audit_data = "";
|
||||
for (int n = 0; n < audit_data.size(); n++) {
|
||||
|
||||
@@ -1574,7 +1628,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + Audit_data + "[/DATA]";
|
||||
|
||||
Log.d("sos_xml_audit",sos_xml);
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "AUDIT_DATA_NEW_REMARK");
|
||||
@@ -1880,6 +1934,167 @@ public class UploadActivity extends AppCompatActivity {
|
||||
data.value = 68;
|
||||
data.name = getString(R.string.title_activity_competition_promo);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
String order_taking_xml = "";
|
||||
String _onxml = "";
|
||||
String categoryxml = "";
|
||||
db.open();
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> ordertakingdata = db.getOrder_TAKING_UploadServerData(coverageList.get(i).getStoreId());
|
||||
db.open();
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> getOrder_TAKING_CategoryData = db.getOrder_TAKING_CategoryData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (ordertakingdata.size() > 0) {
|
||||
for(int k = 0; k < getOrder_TAKING_CategoryData.size(); k++){
|
||||
_onxml = "[CATEGORY_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[PRESENT]" + getOrder_TAKING_CategoryData.get(k).getIsExist() + "[/PRESENT]"
|
||||
+ "[CATEGORY_ID]" + getOrder_TAKING_CategoryData.get(k).getCategory_id() + "[/CATEGORY_ID]"
|
||||
+ "[/CATEGORY_DATA]";
|
||||
categoryxml = categoryxml + _onxml;
|
||||
}
|
||||
|
||||
String cat_xml = categoryxml;
|
||||
for (int j = 0; j < ordertakingdata.size(); j++) {
|
||||
if(ordertakingdata.get(j).getIsExist()==1){
|
||||
if(!ordertakingdata.get(j).getFacing().equals("0") &&
|
||||
!ordertakingdata.get(j).getFacing().equals("")){
|
||||
onXML = "[ORDER_TAKING]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[CATEGORY_ID]" + ordertakingdata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||
+ "[SYSTEM_PO_NUM]" + ordertakingdata.get(j).getSys_PO_No() + "[/SYSTEM_PO_NUM]"
|
||||
+ "[STORE_PO_NUM]" + ordertakingdata.get(j).getStore_PO_No() + "[/STORE_PO_NUM]"
|
||||
+ "[PO_DATE]" + ordertakingdata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||
+ "[BRAND_ID]" + ordertakingdata.get(j).getBrand_id() + "[/BRAND_ID]"
|
||||
+ "[SKU_ID]" + ordertakingdata.get(j).getSku_id() + "[/SKU_ID]"
|
||||
+ "[ORDER_QTY]" + ordertakingdata.get(j).getFacing() + "[/ORDER_QTY]"
|
||||
+ "[PO_IMAGE]" + ordertakingdata.get(j).getPO_Img() + "[/PO_IMAGE]" +
|
||||
"[/ORDER_TAKING]";
|
||||
order_taking_xml = order_taking_xml + onXML;
|
||||
}
|
||||
}
|
||||
}
|
||||
String data_xml = cat_xml + order_taking_xml;
|
||||
|
||||
final String sos_xml = "[DATA]" + data_xml + "[/DATA]";
|
||||
Log.e("order_xml_data",sos_xml);
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "ORDER_TAKING_NEW_XML");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
|
||||
data.value = 69;
|
||||
data.name = getString(R.string.order_taking_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
String order_received_xml = "";
|
||||
onXML = "";
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> orderreceiveddata = db.getOrder_RECEIVED_UploadServerData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (orderreceiveddata.size() > 0) {
|
||||
for (int j = 0; j < orderreceiveddata.size(); j++) {
|
||||
onXML = "[ORDER_CONFIRM]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[CATEGORY_ID]" + orderreceiveddata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||
+ "[PO_DATE]" + orderreceiveddata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||
+ "[POID]" + orderreceiveddata.get(j).getPOID() + "[/POID]"
|
||||
+ "[SKU_ID]" + orderreceiveddata.get(j).getSku_id() + "[/SKU_ID]"
|
||||
+ "[PO_QTY]" + orderreceiveddata.get(j).getOrderqty() + "[/PO_QTY]"
|
||||
+ "[ACTUAL_QTY]" + orderreceiveddata.get(j).getFacing() + "[/ACTUAL_QTY]" +
|
||||
"[/ORDER_CONFIRM]";
|
||||
|
||||
order_received_xml = order_received_xml + onXML;
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + order_received_xml + "[/DATA]";
|
||||
// Log.e("order_xml_data",sos_xml);
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "ORDER_RECEIVED_STATUS_XML");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
|
||||
data.value = 70;
|
||||
data.name = getString(R.string.order_received_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
String visit_xml = "";
|
||||
onXML = "";
|
||||
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = db.getUploadedVisitType(coverageList.get(i).getStoreId());
|
||||
|
||||
if (visittypelist.size() > 0) {
|
||||
for (int j = 0; j < visittypelist.size(); j++) {
|
||||
onXML = "[VISIT_TYPE_STATUS]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[STORE_ID]" + coverageList.get(i).getStoreId() + "[/STORE_ID]"
|
||||
+ "[VISIT_TYPE_ID]" + visittypelist.get(j).getVISIT_TYPE_ID().get(0) + "[/VISIT_TYPE_ID]"
|
||||
+ "[/VISIT_TYPE_STATUS]";
|
||||
|
||||
visit_xml = visit_xml + onXML;
|
||||
}
|
||||
final String sos_xml = "[DATA]" + visit_xml + "[/DATA]";
|
||||
Log.e("visit_xml_data", sos_xml);
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "VISIT_TYPE_XML");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}
|
||||
}
|
||||
data.value = 71;
|
||||
data.name = getString(R.string.visit_type_data_uploading);
|
||||
publishProgress(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -1947,7 +2162,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onPostExecute(String result) {
|
||||
super.onPostExecute(result);
|
||||
|
||||
dialog.dismiss();
|
||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
@@ -1991,5 +2205,4 @@ public class UploadActivity extends AppCompatActivity {
|
||||
alert.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@ import android.util.Log;
|
||||
|
||||
//import com.crashlytics.android.Crashlytics;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.squareup.okhttp.MediaType;
|
||||
import com.squareup.okhttp.MultipartBuilder;
|
||||
import com.squareup.okhttp.OkHttpClient;
|
||||
import com.squareup.okhttp.Protocol;
|
||||
import com.squareup.okhttp.RequestBody;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@@ -35,6 +37,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
@@ -46,6 +49,7 @@ import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
||||
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import retrofit.GsonConverterFactory;
|
||||
import retrofit.Retrofit;
|
||||
|
||||
/**
|
||||
@@ -92,7 +96,7 @@ public class UploadImageWithRetrofit {
|
||||
if (file.length > 0) {
|
||||
filename = "";
|
||||
totalfiles = f.listFiles().length;
|
||||
pd.setMessage(context.getString(R.string.uploaddata)+" - " +context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||
pd.setMessage(context.getString(R.string.uploaddata) + " - " + context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||
for (int i = 0; i < file.length; i++) {
|
||||
if (new File(CommonString.FILE_PATH + file[i].getName()).exists()) {
|
||||
if (file[i].getName().contains("SI_") || file[i].getName().contains("CHK_SI_") || file[i].getName().contains("NonWorking")) {
|
||||
@@ -103,7 +107,7 @@ public class UploadImageWithRetrofit {
|
||||
foldername = "T2PImages";
|
||||
} else if (file[i].getName().contains("AddPromo_Image") || file[i].getName().contains("Additional_Promo_Skuwise_Image")) {
|
||||
foldername = "AdditionalPromotionImages";
|
||||
}else if (file[i].getName().contains("AdditionalImage")) {
|
||||
} else if (file[i].getName().contains("AdditionalImage")) {
|
||||
foldername = "AdditionalVisibilityImages";
|
||||
} else if (file[i].getName().contains("Promo_Image")) {
|
||||
foldername = "PromotionImages";
|
||||
@@ -111,13 +115,17 @@ public class UploadImageWithRetrofit {
|
||||
foldername = "CategoryImages";
|
||||
} else if (file[i].getName().contains("AuditAnsPic")) {
|
||||
foldername = "AuditImages";
|
||||
} else if (file[i].getName().contains("CoachingVisit")||file[i].getName().contains("CheckVisit")) {
|
||||
} else if (file[i].getName().contains("CoachingVisit") || file[i].getName().contains("CheckVisit")) {
|
||||
foldername = "CoachingVisits";
|
||||
} else if (file[i].getName().contains("DeliveryCalls")) {
|
||||
} else if (file[i].getName().contains("DeliveryCalls")) {
|
||||
foldername = "DeliveryCallsImages";
|
||||
} else if (file[i].getName().contains("CounterfeitProduct")) {//added 15.04.2019
|
||||
foldername = "CounterFeitImages";
|
||||
} else{
|
||||
}
|
||||
else if (file[i].getName().contains("POImage")) {//added 15.04.2019
|
||||
foldername = "POImages";
|
||||
}
|
||||
else {
|
||||
foldername = "Bulkimages";
|
||||
}
|
||||
|
||||
@@ -126,34 +134,43 @@ public class UploadImageWithRetrofit {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
File originalFile = new File(CommonString.FILE_PATH+ filename);
|
||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
File originalFile = new File(CommonString.FILE_PATH + filename);
|
||||
File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
if (finalFile == null) {
|
||||
finalFile = originalFile;
|
||||
}
|
||||
|
||||
OkHttpClient okHttpClient = new OkHttpClient();
|
||||
// okHttpClient.setProtocols(Arrays.asList(Protocol.HTTP_1_1));
|
||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
||||
// MediaType mediaType = MediaType.parse("text/plain");
|
||||
|
||||
com.squareup.okhttp.RequestBody photo = com.squareup.okhttp.RequestBody.create(com.squareup.okhttp.MediaType.parse("application/octet-stream"), finalFile);
|
||||
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), finalFile);
|
||||
body1 = new MultipartBuilder()
|
||||
.type(MultipartBuilder.FORM)
|
||||
.addFormDataPart("file", finalFile.getName(), photo)
|
||||
.addFormDataPart("FolderName", foldername)
|
||||
.build();
|
||||
// Log.e("imagedata", String.valueOf(body1));
|
||||
|
||||
adapter = new retrofit.Retrofit.Builder()
|
||||
adapter = new Retrofit.Builder()
|
||||
.baseUrl(CommonString.URL + "/")
|
||||
// .client(okHttpClient)
|
||||
// .addConverterFactory(GsonConverterFactory.create())
|
||||
.addConverterFactory(new StringConverterFactory())
|
||||
.build();
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||
File finalFile1 = finalFile;
|
||||
call.enqueue(new retrofit.Callback<String>() {
|
||||
@Override
|
||||
public void onResponse(retrofit.Response<String> response) {
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile.delete();
|
||||
Log.d("responsedata", String.valueOf(response));
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile1.delete();
|
||||
status = 1;
|
||||
uploadedFiles++;
|
||||
} else {
|
||||
@@ -163,7 +180,7 @@ public class UploadImageWithRetrofit {
|
||||
if (status == 0) {
|
||||
pd.dismiss();
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot), false);
|
||||
}
|
||||
} else {
|
||||
UploadImageRecursiveNew(context);
|
||||
@@ -176,9 +193,10 @@ public class UploadImageWithRetrofit {
|
||||
status = -1;
|
||||
//uploadedFiles = 0;
|
||||
pd.dismiss();
|
||||
Log.e("Errormsg :",t.toString());
|
||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,19 +215,19 @@ public class UploadImageWithRetrofit {
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
showAlert((Activity) context, "Invalid Json",false);
|
||||
showAlert((Activity) context, "Invalid Json", false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (totalFiles == uploadedFiles) {
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||
} else {
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE,false);
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void UploadDeliveryImageRecursive(final Context context, final ArrayList<String> file_list, final int index) {
|
||||
public void UploadDeliveryImageRecursive(final Context context, final ArrayList<String> file_list, final int index) {
|
||||
try {
|
||||
final int[] _index = {index};
|
||||
status = 0;
|
||||
@@ -218,10 +236,14 @@ public class UploadImageWithRetrofit {
|
||||
if (_index[0] < file_list.size()) {
|
||||
filename = file_list.get(_index[0]);
|
||||
|
||||
pd.setMessage(context.getString(R.string.uploaddata)+" - " +context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||
pd.setMessage(context.getString(R.string.uploaddata) + " - " + context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||
|
||||
File originalFile = new File(CommonString.FILE_PATH + filename);
|
||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
|
||||
if (finalFile == null) {
|
||||
finalFile = originalFile;
|
||||
}
|
||||
|
||||
OkHttpClient okHttpClient = new OkHttpClient();
|
||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||
@@ -242,11 +264,12 @@ public class UploadImageWithRetrofit {
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
|
||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||
File finalFile1 = finalFile;
|
||||
call.enqueue(new retrofit.Callback<String>() {
|
||||
@Override
|
||||
public void onResponse(retrofit.Response<String> response) {
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile.delete();
|
||||
finalFile1.delete();
|
||||
status = 1;
|
||||
uploadedFiles++;
|
||||
} else {
|
||||
@@ -256,7 +279,7 @@ public class UploadImageWithRetrofit {
|
||||
if (status == 0) {
|
||||
pd.dismiss();
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot), false);
|
||||
}
|
||||
} else {
|
||||
UploadDeliveryImageRecursive(context, file_list, ++_index[0]);
|
||||
@@ -271,7 +294,7 @@ public class UploadImageWithRetrofit {
|
||||
pd.dismiss();
|
||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,103 +313,73 @@ public class UploadImageWithRetrofit {
|
||||
//pd.cancel();
|
||||
//showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
}
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
showAlert((Activity) context, "Invalid Json",false);
|
||||
showAlert((Activity) context, "Invalid Json", false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (totalFiles == uploadedFiles) {
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||
} else {
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE,false);
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
public File saveBitmapToFileSmaller(File file) {
|
||||
File file2 = file;
|
||||
try {
|
||||
public File saveBitmapToFileSmaller(File file) {
|
||||
File file2 = file;
|
||||
try {
|
||||
int inWidth = 0;
|
||||
int inHeight = 0;
|
||||
|
||||
InputStream in = new FileInputStream(file2);
|
||||
// decode image size (decode metadata only, not the whole image)
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeStream(in, null, options);
|
||||
in.close();
|
||||
InputStream in = new FileInputStream(file2);
|
||||
// decode image size (decode metadata only, not the whole image)
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeStream(in, null, options);
|
||||
in.close();
|
||||
in = null;
|
||||
|
||||
// decode full image pre-resized
|
||||
in = new FileInputStream(file2);
|
||||
options = new BitmapFactory.Options();
|
||||
// decode full image
|
||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||
|
||||
// save image
|
||||
FileOutputStream out = new FileOutputStream(file2);
|
||||
roughBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("Image", e.toString(), e);
|
||||
return file;
|
||||
}
|
||||
return file2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
public File saveBitmapToFileSmaller(File file) {
|
||||
File file2 = file;
|
||||
try {
|
||||
int inWidth = 0;
|
||||
int inHeight = 0;
|
||||
|
||||
InputStream in = new FileInputStream(file2);
|
||||
// decode image size (decode metadata only, not the whole image)
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeStream(in, null, options);
|
||||
in.close();
|
||||
in = null;
|
||||
|
||||
// save width and height
|
||||
inWidth = options.outWidth;
|
||||
inHeight = options.outHeight;
|
||||
|
||||
// decode full image pre-resized
|
||||
in = new FileInputStream(file2);
|
||||
options = new BitmapFactory.Options();
|
||||
// calc rough re-size (this is no exact resize)
|
||||
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
||||
// decode full image
|
||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||
|
||||
// calc exact destination size
|
||||
Matrix m = new Matrix();
|
||||
RectF inRect = new RectF(0, 0, roughBitmap.getWidth(), roughBitmap.getHeight());
|
||||
RectF outRect = new RectF(0, 0, 1632, 1224);
|
||||
m.setRectToRect(inRect, outRect, Matrix.ScaleToFit.CENTER);
|
||||
float[] values = new float[9];
|
||||
m.getValues(values);
|
||||
// resize bitmap
|
||||
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
||||
// save image
|
||||
FileOutputStream out = new FileOutputStream(file2);
|
||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("Image", e.toString(), e);
|
||||
return file;
|
||||
}
|
||||
return file2;
|
||||
}
|
||||
// save width and height
|
||||
inWidth = options.outWidth;
|
||||
inHeight = options.outHeight;
|
||||
|
||||
// decode full image pre-resized
|
||||
in = new FileInputStream(file2);
|
||||
options = new BitmapFactory.Options();
|
||||
// calc rough re-size (this is no exact resize)
|
||||
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
||||
// decode full image
|
||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||
if (roughBitmap == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// calc exact destination size
|
||||
Matrix m = new Matrix();
|
||||
RectF inRect = new RectF(0, 0, roughBitmap.getWidth(), roughBitmap.getHeight());
|
||||
RectF outRect = new RectF(0, 0, 1632, 1224);
|
||||
m.setRectToRect(inRect, outRect, Matrix.ScaleToFit.CENTER);
|
||||
float[] values = new float[9];
|
||||
m.getValues(values);
|
||||
// resize bitmap
|
||||
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
||||
// save image
|
||||
if (resizedBitmap == null) {
|
||||
return null;
|
||||
}
|
||||
FileOutputStream out = new FileOutputStream(file2);
|
||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("Image", e.toString(), e);
|
||||
return file;
|
||||
}
|
||||
return file2;
|
||||
}
|
||||
|
||||
|
||||
public void showAlert(final Context context, String str, final boolean flag) {
|
||||
@@ -396,13 +389,13 @@ public class UploadImageWithRetrofit {
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
Activity activity =(Activity) context;
|
||||
if(flag){
|
||||
Intent i = new Intent(activity, MainActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();
|
||||
Activity activity = (Activity) context;
|
||||
if (flag) {
|
||||
Intent i = new Intent(activity, MainActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -427,7 +420,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + storeList.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + storeList.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
||||
+ "[VISIT_DATE]" + storeList.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
@@ -456,10 +449,9 @@ public class UploadImageWithRetrofit {
|
||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeList.get(i).getVISIT_DATE(), storeList.get(i).getSTORE_ID());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
@@ -482,7 +474,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + storeList_deviation.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + storeList_deviation.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
||||
+ "[VISIT_DATE]" + storeList_deviation.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
@@ -526,7 +518,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + storeListPharma.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + storeListPharma.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
||||
+ "[VISIT_DATE]" + storeListPharma.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
@@ -555,10 +547,9 @@ public class UploadImageWithRetrofit {
|
||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListPharma.get(i).getVISIT_DATE(), storeListPharma.get(i).getSTORE_ID());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
@@ -581,7 +572,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + storeListAdditional.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
||||
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
@@ -610,17 +601,15 @@ public class UploadImageWithRetrofit {
|
||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListAdditional.get(i).getVISIT_DATE(), storeListAdditional.get(i).getSTORE_ID());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
db.updateCoverageStatus(storeListAdditional.get(i).getSTORE_ID(), uploadStatus);
|
||||
db.updateStoreStatusOnLeave(storeListAdditional.get(i).getSTORE_ID(), storeListAdditional.get(i).getVISIT_DATE(),
|
||||
uploadStatus, CommonString.FROM_ADDITIONAL);
|
||||
|
||||
db.deleteTableWithStoreID(storeListAdditional.get(i).getSTORE_ID());
|
||||
}
|
||||
|
||||
@@ -636,7 +625,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + storeListAdditional.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
||||
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
@@ -665,10 +654,9 @@ public class UploadImageWithRetrofit {
|
||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListAdditional.get(i).getVISIT_DATE(), storeListAdditional.get(i).getSTORE_ID());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
@@ -685,16 +673,16 @@ public class UploadImageWithRetrofit {
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (statusUpdated) {
|
||||
@@ -710,10 +698,9 @@ public class UploadImageWithRetrofit {
|
||||
pd.dismiss();
|
||||
if (s.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
if (totalFiles == uploadedFiles) {
|
||||
//AlertandMessages.showAlert((Activity) context, "All images uploaded Successfully", true);
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||
} else {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),true);
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,16 @@ public class AdditionalQuestiongetterSetter {
|
||||
ArrayList<String> NO_OF_CAMERA = new ArrayList<>();
|
||||
ArrayList<String> TYPE = new ArrayList<>();
|
||||
|
||||
ArrayList<String> CAMERA_MANDATORY = new ArrayList<>();
|
||||
|
||||
public ArrayList<String> getCAMERA_MANDATORY() {
|
||||
return CAMERA_MANDATORY;
|
||||
}
|
||||
public void setCAMERA_MANDATORY(String CAMERA_MANDATORY) {
|
||||
this.CAMERA_MANDATORY.add(CAMERA_MANDATORY);
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<String> getREMARK_ALLOW() {
|
||||
return REMARK_ALLOW;
|
||||
}
|
||||
@@ -42,6 +52,16 @@ public class AdditionalQuestiongetterSetter {
|
||||
ArrayList<String> REMARK_ALLOW = new ArrayList<>();
|
||||
ArrayList<String> REMARK_LEVEL = new ArrayList<>();
|
||||
|
||||
public ArrayList<String> getMAX_LENGTH() {
|
||||
return MAX_LENGTH;
|
||||
}
|
||||
|
||||
public void setMAX_LENGTH(String MAX_LENGTH) {
|
||||
this.MAX_LENGTH.add(MAX_LENGTH);
|
||||
}
|
||||
|
||||
ArrayList<String> MAX_LENGTH = new ArrayList<>();
|
||||
|
||||
public String getTable_ADDITIONAL_QUESTION() {
|
||||
return table_ADDITIONAL_QUESTION;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
*/
|
||||
|
||||
public class AuditDataGetterSetter {
|
||||
|
||||
String QUESTION_ID;
|
||||
String CULTURE_ID;
|
||||
String CATEGORY_ID;
|
||||
@@ -15,6 +14,16 @@ public class AuditDataGetterSetter {
|
||||
String ANSWER="";
|
||||
String CAM_IMAGE="";
|
||||
|
||||
public String getMaxlength() {
|
||||
return maxlength;
|
||||
}
|
||||
|
||||
public void setMaxlength(String maxlength) {
|
||||
this.maxlength = maxlength;
|
||||
}
|
||||
|
||||
String maxlength="0";
|
||||
|
||||
public String getTXT_REMARK() {
|
||||
return TXT_REMARK;
|
||||
}
|
||||
@@ -29,6 +38,16 @@ public class AuditDataGetterSetter {
|
||||
String NO_OF_CAMERA ="1";
|
||||
String CAM_IMAGE2="";
|
||||
String CHECK_TYPE;
|
||||
String CAMERA_MANDATORY="0";
|
||||
|
||||
public String getCAMERA_MANDATORY() {
|
||||
return CAMERA_MANDATORY;
|
||||
}
|
||||
|
||||
public void setCAMERA_MANDATORY(String CAMERA_MANDATORY) {
|
||||
this.CAMERA_MANDATORY = CAMERA_MANDATORY;
|
||||
}
|
||||
|
||||
|
||||
public String getREMARK_ALLOW() {
|
||||
return REMARK_ALLOW;
|
||||
|
||||
@@ -9,7 +9,6 @@ import java.util.ArrayList;
|
||||
public class MAPPING_SKU_PRICING_ENABLEGetterSetter {
|
||||
|
||||
String table_MAPPING_SKU_PRICING_ENABLE;
|
||||
|
||||
ArrayList<String> STORE_ID = new ArrayList<>();
|
||||
ArrayList<String> SUB_CATEGORY_ID = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -20,9 +20,32 @@ public class MSL_AvailabilityStockFacingGetterSetter implements Serializable{
|
||||
String category_id;
|
||||
String facing="";
|
||||
String stock;
|
||||
String posmStock;
|
||||
String warehouseStock;
|
||||
String company_id;
|
||||
String must_have;
|
||||
|
||||
public String getPOID() {
|
||||
return POID;
|
||||
}
|
||||
|
||||
public void setPOID(String POID) {
|
||||
this.POID = POID;
|
||||
}
|
||||
|
||||
String POID;
|
||||
|
||||
|
||||
public String getOrderqty() {
|
||||
return orderqty;
|
||||
}
|
||||
|
||||
public void setOrderqty(String orderqty) {
|
||||
this.orderqty = orderqty;
|
||||
}
|
||||
|
||||
String orderqty = "";
|
||||
|
||||
public String getPricing() {
|
||||
return pricing;
|
||||
}
|
||||
@@ -181,4 +204,68 @@ public class MSL_AvailabilityStockFacingGetterSetter implements Serializable{
|
||||
public void setMust_have(String must_have) {
|
||||
this.must_have = must_have;
|
||||
}
|
||||
|
||||
int IsExist = -1;
|
||||
|
||||
public int getIsExist() {
|
||||
return IsExist;
|
||||
}
|
||||
|
||||
public void setIsExist(int isExist) {
|
||||
IsExist = isExist;
|
||||
}
|
||||
String Sys_PO_No = "";
|
||||
String Store_PO_No = "";
|
||||
String PO_Date = "";
|
||||
|
||||
public String getPO_Img() {
|
||||
return PO_Img;
|
||||
}
|
||||
|
||||
public void setPO_Img(String PO_Img) {
|
||||
this.PO_Img = PO_Img;
|
||||
}
|
||||
|
||||
String PO_Img = "";
|
||||
|
||||
public String getSys_PO_No() {
|
||||
return Sys_PO_No;
|
||||
}
|
||||
|
||||
public void setSys_PO_No(String sys_PO_No) {
|
||||
Sys_PO_No = sys_PO_No;
|
||||
}
|
||||
|
||||
public String getStore_PO_No() {
|
||||
return Store_PO_No;
|
||||
}
|
||||
|
||||
public void setStore_PO_No(String store_PO_No) {
|
||||
Store_PO_No = store_PO_No;
|
||||
}
|
||||
|
||||
public String getPO_Date() {
|
||||
return PO_Date;
|
||||
}
|
||||
|
||||
public void setPO_Date(String PO_Date) {
|
||||
this.PO_Date = PO_Date;
|
||||
}
|
||||
|
||||
public String getPosmStock() {
|
||||
return posmStock;
|
||||
}
|
||||
|
||||
public void setPosmStock(String posmStock) {
|
||||
this.posmStock = posmStock;
|
||||
}
|
||||
|
||||
public String getWarehouseStock() {
|
||||
return warehouseStock;
|
||||
}
|
||||
|
||||
public void setWarehouseStock(String warehouseStock) {
|
||||
this.warehouseStock = warehouseStock;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Order_Received_Status_GetterSetter {
|
||||
|
||||
String table_Order_Received_Status;
|
||||
|
||||
ArrayList<String> STORE_ID = new ArrayList<>();
|
||||
ArrayList<String> APP_PONUMBER = new ArrayList<>();
|
||||
ArrayList<String> STORE_PONUMBER = new ArrayList<>();
|
||||
ArrayList<String> PO_DATE = new ArrayList<>();
|
||||
ArrayList<String> CATEGORY_ID = new ArrayList<>();
|
||||
ArrayList<String> SKU_ID = new ArrayList<>();
|
||||
ArrayList<String> ORDERQTY = new ArrayList<>();
|
||||
ArrayList<String> STATUS = new ArrayList<>();
|
||||
ArrayList<String> POID = new ArrayList<>();
|
||||
|
||||
public ArrayList<String> getPOID() {
|
||||
return POID;
|
||||
}
|
||||
|
||||
public void setPOID(String POID) {
|
||||
this.POID.add(POID);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getTable_Order_Received_Status() {
|
||||
return table_Order_Received_Status;
|
||||
}
|
||||
|
||||
public void setTable_Order_Received_Status(String table_Order_Received_Status) {
|
||||
this.table_Order_Received_Status = table_Order_Received_Status;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORE_ID() {
|
||||
return STORE_ID;
|
||||
}
|
||||
|
||||
public void setSTORE_ID(String STORE_ID) {
|
||||
this.STORE_ID.add(STORE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getAPP_PONUMBER() {
|
||||
return APP_PONUMBER;
|
||||
}
|
||||
|
||||
public void setAPP_PONUMBER(String APP_PONUMBER) {
|
||||
this.APP_PONUMBER.add(APP_PONUMBER);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORE_PONUMBER() {
|
||||
return STORE_PONUMBER;
|
||||
}
|
||||
|
||||
public void setSTORE_PONUMBER(String STORE_PONUMBER) {
|
||||
this.STORE_PONUMBER.add(STORE_PONUMBER);
|
||||
}
|
||||
|
||||
public ArrayList<String> getPO_DATE() {
|
||||
return PO_DATE;
|
||||
}
|
||||
|
||||
public void setPO_DATE(String PO_DATE) {
|
||||
this.PO_DATE.add(PO_DATE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCATEGORY_ID() {
|
||||
return CATEGORY_ID;
|
||||
}
|
||||
|
||||
public void setCATEGORY_ID(String CATEGORY_ID) {
|
||||
this.CATEGORY_ID.add(CATEGORY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSKU_ID() {
|
||||
return SKU_ID;
|
||||
}
|
||||
|
||||
public void setSKU_ID(String SKU_ID) {
|
||||
this.SKU_ID.add(SKU_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getORDERQTY() {
|
||||
return ORDERQTY;
|
||||
}
|
||||
|
||||
public void setORDERQTY(String ORDERQTY) {
|
||||
this.ORDERQTY.add(ORDERQTY);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTATUS() {
|
||||
return STATUS;
|
||||
}
|
||||
|
||||
public void setSTATUS(String STATUS) {
|
||||
this.STATUS.add(STATUS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,6 +54,25 @@ public class TableBean {
|
||||
public static String Table_MAPPING_STOCK_STOREWISE;
|
||||
public static String Table_MAPPING_PLANOGRAM_STORE_WISE;
|
||||
public static String Table_PROMOTION_TYPE_MASTER;
|
||||
public static String Table_ORDER_RECEIVED_STATUS;
|
||||
|
||||
public static String getTable_VISIT_TYPE_STATUS() {
|
||||
return Table_VISIT_TYPE_STATUS;
|
||||
}
|
||||
|
||||
public static void setTable_VISIT_TYPE_STATUS(String table_VISIT_TYPE_STATUS) {
|
||||
Table_VISIT_TYPE_STATUS = table_VISIT_TYPE_STATUS;
|
||||
}
|
||||
|
||||
public static String Table_VISIT_TYPE_STATUS;
|
||||
|
||||
public static String getTable_ORDER_RECEIVED_STATUS() {
|
||||
return Table_ORDER_RECEIVED_STATUS;
|
||||
}
|
||||
|
||||
public static void setTable_ORDER_RECEIVED_STATUS(String table_ORDER_RECEIVED_STATUS) {
|
||||
Table_ORDER_RECEIVED_STATUS = table_ORDER_RECEIVED_STATUS;
|
||||
}
|
||||
|
||||
public static String getTable_MAPPING_SKU_PRICING_ENABLE() {
|
||||
return Table_MAPPING_SKU_PRICING_ENABLE;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Visit_Type_Master_GetterSetter {
|
||||
|
||||
String table_Visit_Type_Status;
|
||||
ArrayList<String> VISIT_TYPE_ID = new ArrayList<String>();
|
||||
ArrayList<String> VISIT_TYPE = new ArrayList<String>();
|
||||
|
||||
public String getTable_Visit_Type_Status() {
|
||||
return table_Visit_Type_Status;
|
||||
}
|
||||
|
||||
public void setTable_Visit_Type_Status(String table_Visit_Type_Status) {
|
||||
this.table_Visit_Type_Status = table_Visit_Type_Status;
|
||||
}
|
||||
|
||||
public ArrayList<String> getVISIT_TYPE_ID() {
|
||||
return VISIT_TYPE_ID;
|
||||
}
|
||||
|
||||
public void setVISIT_TYPE_ID(String VISIT_TYPE_ID) {
|
||||
this.VISIT_TYPE_ID.add(VISIT_TYPE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getVISIT_TYPE() {
|
||||
return VISIT_TYPE;
|
||||
}
|
||||
|
||||
public void setVISIT_TYPE(String VISIT_TYPE) {
|
||||
this.VISIT_TYPE.add(VISIT_TYPE);
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Order_Received_Status_GetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_CATEGORY_WISEGetterSetter;
|
||||
@@ -47,6 +48,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 21-12-2016.
|
||||
@@ -1084,27 +1086,31 @@ public class XMLHandlers {
|
||||
if (xpp.getName().equals("QUESTION_ID")) {
|
||||
st.setQUESTION_ID(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("CULTURE_ID")) {
|
||||
st.setCULTURE_ID(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("STORETYPE_ID")) {
|
||||
st.setSTORETYPE_ID(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("CATEGORY_ID")) {
|
||||
st.setCATEGORY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("QUESTION")) {
|
||||
st.setQUESTION(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CULTURE_ID")) {
|
||||
st.setCULTURE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("ANSWER_TYPE")) {
|
||||
st.setANSWER_TYPE(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("ANSWER_ID")) {
|
||||
st.setANSWER_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("ANSWER")) {
|
||||
st.setANSWER(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORETYPE_ID")) {
|
||||
st.setSTORETYPE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CAMERA_ALLOW")) {
|
||||
st.setCAMERA_ALLOW(xpp.nextText());
|
||||
}
|
||||
@@ -1123,6 +1129,14 @@ public class XMLHandlers {
|
||||
if (xpp.getName().equals("REMARK_LEVEL")) {
|
||||
st.setREMARK_LEVEL(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("MAX_LENGTH")) {
|
||||
st.setMAX_LENGTH(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("CAMERA_MANDATORY")) {
|
||||
st.setCAMERA_MANDATORY(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
@@ -1396,10 +1410,8 @@ public class XMLHandlers {
|
||||
}
|
||||
|
||||
// NON_WORKING_SUB_REASON XML HANDLER
|
||||
public static NonWorkingSubReasonGetterSetter nonWorkingSubReasonXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
public static NonWorkingSubReasonGetterSetter nonWorkingSubReasonXMLHandler(XmlPullParser xpp, int eventType) {
|
||||
NonWorkingSubReasonGetterSetter reason = new NonWorkingSubReasonGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
@@ -1419,7 +1431,6 @@ public class XMLHandlers {
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -1703,4 +1714,84 @@ public class XMLHandlers {
|
||||
return stock;
|
||||
}
|
||||
|
||||
|
||||
public static Order_Received_Status_GetterSetter order_Received_Status_XMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
Order_Received_Status_GetterSetter stock = new Order_Received_Status_GetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
stock.setTable_Order_Received_Status(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORE_ID")) {
|
||||
stock.setSTORE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("APP_PONUMBER")) {
|
||||
stock.setAPP_PONUMBER(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORE_PONUMBER")) {
|
||||
stock.setSTORE_PONUMBER(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("PO_DATE")) {
|
||||
stock.setPO_DATE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CATEGORY_ID")) {
|
||||
stock.setCATEGORY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SKU_ID")) {
|
||||
stock.setSKU_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("ORDERQTY")) {
|
||||
stock.setORDERQTY(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STATUS")) {
|
||||
stock.setSTATUS(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("POID")) {
|
||||
stock.setPOID(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stock;
|
||||
}
|
||||
|
||||
|
||||
public static Visit_Type_Master_GetterSetter Visit_Type_Status_XMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
Visit_Type_Master_GetterSetter visittype = new Visit_Type_Master_GetterSetter();
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
visittype.setTable_Visit_Type_Status(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("VISIT_TYPE_ID")) {
|
||||
visittype.setVISIT_TYPE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("VISIT_TYPE")) {
|
||||
visittype.setVISIT_TYPE(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return visittype;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/colorPrimaryDark" android:state_checked="true" />
|
||||
<item android:color="@color/black" />
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 8.4 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/white"/>
|
||||
<stroke android:width="1dp"
|
||||
android:color="@color/red" />
|
||||
<corners android:radius="5dp"/>
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 5.8 KiB |
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/custom_margin" />
|
||||
<solid android:color="#FFF" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/colorPrimary" />
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.8 KiB |