Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
StockTransferReceive
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramesh Babu Puvvadi
StockTransferReceive
Commits
79d8faed
Commit
79d8faed
authored
Mar 07, 2022
by
User
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stock Audit changes noted version 1.1
parent
d0891c19
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
136 additions
and
97 deletions
+136
-97
build.gradle
app/build.gradle
+2
-10
AppUtils.java
app/src/main/java/w/soulofpluto/posstockaudit/AppUtils.java
+1
-0
Constants.java
app/src/main/java/w/soulofpluto/posstockaudit/Constants.java
+28
-26
DashBoardActivity.java
...n/java/w/soulofpluto/posstockaudit/DashBoardActivity.java
+4
-2
HomeActivity.java
...c/main/java/w/soulofpluto/posstockaudit/HomeActivity.java
+7
-4
Login.java
app/src/main/java/w/soulofpluto/posstockaudit/Login.java
+3
-3
MainActivity.java
...c/main/java/w/soulofpluto/posstockaudit/MainActivity.java
+20
-2
PlanDetails.java
...rc/main/java/w/soulofpluto/posstockaudit/PlanDetails.java
+44
-18
Plans.java
app/src/main/java/w/soulofpluto/posstockaudit/Plans.java
+1
-5
RackWiseAdapter.java
...ain/java/w/soulofpluto/posstockaudit/RackWiseAdapter.java
+12
-12
RackWiseQty.java
...rc/main/java/w/soulofpluto/posstockaudit/RackWiseQty.java
+14
-15
SearchByBarcode.java
...ain/java/w/soulofpluto/posstockaudit/SearchByBarcode.java
+0
-0
No files found.
app/build.gradle
View file @
79d8faed
...
@@ -9,8 +9,8 @@ android {
...
@@ -9,8 +9,8 @@ android {
applicationId
"w.soulofpluto.posstock"
applicationId
"w.soulofpluto.posstock"
minSdkVersion
16
minSdkVersion
16
targetSdkVersion
30
targetSdkVersion
30
versionCode
1
versionCode
2
versionName
"1.
0
"
versionName
"1.
1
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled
true
multiDexEnabled
true
}
}
...
@@ -35,23 +35,15 @@ dependencies {
...
@@ -35,23 +35,15 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'androidx.constraintlayout:constraintlayout:2.0.4'
implementation
'androidx.constraintlayout:constraintlayout:2.0.4'
implementation
'com.google.android.material:material:1.1.0-alpha09'
implementation
'com.google.android.material:material:1.1.0-alpha09'
implementation
'com.squareup.okhttp:okhttp:2.5.0'
implementation
'com.squareup.okhttp:okhttp:2.5.0'
implementation
'com.squareup.okhttp3:okhttp:3.10.0'
implementation
'com.squareup.okhttp3:okhttp:3.10.0'
implementation
'com.squareup.retrofit2:retrofit:2.3.0'
implementation
'com.squareup.retrofit2:retrofit:2.3.0'
implementation
'com.squareup.retrofit2:converter-gson:2.2.0'
implementation
'com.squareup.retrofit2:converter-gson:2.2.0'
implementation
'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation
'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation
platform
(
'com.google.firebase:firebase-bom:28.4.0'
)
implementation
platform
(
'com.google.firebase:firebase-bom:28.4.0'
)
implementation
'com.google.firebase:firebase-analytics'
implementation
'com.google.firebase:firebase-analytics'
implementation
'com.google.firebase:firebase-crashlytics:18.2.1'
implementation
'com.google.firebase:firebase-crashlytics:18.2.1'
implementation
'com.karumi:dexter:6.2.3'
implementation
'com.karumi:dexter:6.2.3'
testImplementation
'junit:junit:4.12'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
...
...
app/src/main/java/w/soulofpluto/posstockaudit/AppUtils.java
View file @
79d8faed
...
@@ -12,6 +12,7 @@ import static android.content.Context.ACTIVITY_SERVICE;
...
@@ -12,6 +12,7 @@ import static android.content.Context.ACTIVITY_SERVICE;
*/
*/
public
class
AppUtils
{
public
class
AppUtils
{
public
static
void
deleteCache
(
Context
context
)
{
public
static
void
deleteCache
(
Context
context
)
{
Log
.
e
(
"AppUtils ====<"
,
"Calling deleteCache"
);
Log
.
e
(
"AppUtils ====<"
,
"Calling deleteCache"
);
try
{
try
{
...
...
app/src/main/java/w/soulofpluto/posstockaudit/Constants.java
View file @
79d8faed
...
@@ -29,8 +29,8 @@ public class Constants{
...
@@ -29,8 +29,8 @@ public class Constants{
//public static String BASE_URL = "https://49588a.emporter.eu/";
//public static String BASE_URL = "https://49588a.emporter.eu/";
//public static String BASE_URL = "https://30ad04.emporter.eu/";
//public static String BASE_URL = "https://30ad04.emporter.eu/";
//public static String BASE_URL = "http://182.18.167.139/";
//public static String BASE_URL = "http://182.18.167.139/";
public
static
String
BASE_URL
=
"http://192.168.34.16/"
;
//
public static String BASE_URL = "http://192.168.34.16/";
//
public static String BASE_URL = "http://posapi.plutokm.com/";
public
static
String
BASE_URL
=
"http://posapi.plutokm.com/"
;
public
static
String
MenuBar
=
Constants
.
BASE_URL
+
"/Users/generateUserMenuBarLinksForAndroidApp"
;
public
static
String
MenuBar
=
Constants
.
BASE_URL
+
"/Users/generateUserMenuBarLinksForAndroidApp"
;
public
static
String
Logout
=
Constants
.
BASE_URL
+
"/login/doLogout/"
;
public
static
String
Logout
=
Constants
.
BASE_URL
+
"/login/doLogout/"
;
public
static
String
Login
=
Constants
.
BASE_URL
+
"/login/doLogin"
;
public
static
String
Login
=
Constants
.
BASE_URL
+
"/login/doLogin"
;
...
@@ -65,6 +65,8 @@ public class Constants{
...
@@ -65,6 +65,8 @@ public class Constants{
public
static
StringBuilder
stringBuilder
;
public
static
StringBuilder
stringBuilder
;
public
static
void
getToast
(
Context
context
,
String
data
){
public
static
void
getToast
(
Context
context
,
String
data
){
/* ((Activity)context).runOnUiThread(() -> {
});*/
Toast
toast
=
Toast
.
makeText
(
context
,
data
,
Toast
.
LENGTH_SHORT
);
Toast
toast
=
Toast
.
makeText
(
context
,
data
,
Toast
.
LENGTH_SHORT
);
toast
.
setGravity
(
Gravity
.
CENTER
,
0
,
0
);
toast
.
setGravity
(
Gravity
.
CENTER
,
0
,
0
);
toast
.
show
();
toast
.
show
();
...
@@ -215,29 +217,29 @@ public class Constants{
...
@@ -215,29 +217,29 @@ public class Constants{
return
null
;
return
null
;
}
}
public
static
String
Barcode
(
String
mrp
){
public
static
String
Barcode
(
String
bar
){
if
(
mrp
.
length
()
==
11
){
if
(
bar
.
length
()
==
11
){
return
mrp
;
return
bar
;
}
else
if
(
mrp
.
length
()
==
10
){
}
else
if
(
bar
.
length
()
==
10
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
9
){
}
else
if
(
bar
.
length
()
==
9
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
8
){
}
else
if
(
bar
.
length
()
==
8
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
7
){
}
else
if
(
bar
.
length
()
==
7
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
6
){
}
else
if
(
bar
.
length
()
==
6
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
5
){
}
else
if
(
bar
.
length
()
==
5
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
4
){
}
else
if
(
bar
.
length
()
==
4
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
3
){
}
else
if
(
bar
.
length
()
==
3
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
2
){
}
else
if
(
bar
.
length
()
==
2
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
else
if
(
mrp
.
length
()
==
1
){
}
else
if
(
bar
.
length
()
==
1
){
return
mrp
+
" "
;
return
bar
+
" "
;
}
}
return
null
;
return
null
;
}
}
...
@@ -585,7 +587,7 @@ public class Constants{
...
@@ -585,7 +587,7 @@ public class Constants{
return
null
;
return
null
;
}
}
public
static
String
IndianRupee
sf
ormat
(
String
amount
){
public
static
String
IndianRupee
F
ormat
(
String
amount
){
NumberFormat
formatter
=
NumberFormat
.
getCurrencyInstance
(
new
Locale
(
"en"
,
"in"
));
NumberFormat
formatter
=
NumberFormat
.
getCurrencyInstance
(
new
Locale
(
"en"
,
"in"
));
String
moneyString
=
formatter
.
format
(
Double
.
valueOf
(
amount
));
String
moneyString
=
formatter
.
format
(
Double
.
valueOf
(
amount
));
return
moneyString
;
return
moneyString
;
...
...
app/src/main/java/w/soulofpluto/posstockaudit/DashBoardActivity.java
View file @
79d8faed
...
@@ -27,9 +27,10 @@ import java.util.concurrent.TimeUnit;
...
@@ -27,9 +27,10 @@ import java.util.concurrent.TimeUnit;
public
class
DashBoardActivity
extends
AppCompatActivity
implements
View
.
OnClickListener
{
public
class
DashBoardActivity
extends
AppCompatActivity
implements
View
.
OnClickListener
{
Toolbar
dashboard_toolbar
;
Toolbar
dashboard_toolbar
;
Button
stock_audit
,
rack_qty
,
searchBy_Barcode
,
transfer
;
Button
stock_audit
,
rack_qty
,
searchBy_Barcode
,
transfer
;
TextView
version
;
TextView
version
;
PreferenceManager
preferenceManager
;
PreferenceManager
preferenceManager
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
){
protected
void
onCreate
(
Bundle
savedInstanceState
){
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -91,6 +92,7 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
...
@@ -91,6 +92,7 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
}
}
@Override
@Override
public
void
onResponse
(
Response
response
)
throws
IOException
{
public
void
onResponse
(
Response
response
)
throws
IOException
{
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
if
(
response
.
isSuccessful
()){
if
(
response
.
isSuccessful
()){
...
@@ -104,7 +106,7 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
...
@@ -104,7 +106,7 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setStoreId
(
""
);
preferenceManager
.
setStoreId
(
""
);
Login
.
l
ogout
(
DashBoardActivity
.
this
);
Login
.
L
ogout
(
DashBoardActivity
.
this
);
}
else
{
}
else
{
Constants
.
getToast
(
DashBoardActivity
.
this
,
jsonObject
.
getString
(
"msg"
));
Constants
.
getToast
(
DashBoardActivity
.
this
,
jsonObject
.
getString
(
"msg"
));
}
}
...
...
app/src/main/java/w/soulofpluto/posstockaudit/HomeActivity.java
View file @
79d8faed
...
@@ -44,10 +44,10 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
...
@@ -44,10 +44,10 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
ArrayList
<
String
>
arrayList
;
ArrayList
<
String
>
arrayList
;
RecyclerView
recyclerView
;
RecyclerView
recyclerView
;
private
static
final
int
REQUEST_PERMISSION
=
100
;
private
static
final
int
REQUEST_PERMISSION
=
100
;
@Override
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
){
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
){
setContentView
(
R
.
layout
.
activity_home
);
setContentView
(
R
.
layout
.
activity_home
);
//requestRuntimePermission();
home_toolbar
=
findViewById
(
R
.
id
.
home_toolbar
);
home_toolbar
=
findViewById
(
R
.
id
.
home_toolbar
);
version
=
findViewById
(
R
.
id
.
version
);
version
=
findViewById
(
R
.
id
.
version
);
recyclerView
=
findViewById
(
R
.
id
.
menu_list
);
recyclerView
=
findViewById
(
R
.
id
.
menu_list
);
...
@@ -87,8 +87,8 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
...
@@ -87,8 +87,8 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
if
(
requestCode
!=
REQUEST_PERMISSION
||
grantResults
.
length
==
0
)
{
if
(
requestCode
!=
REQUEST_PERMISSION
||
grantResults
.
length
==
0
)
{
return
;
return
;
}
}
}
}
private
void
setUI
(){
private
void
setUI
(){
final
OkHttpClient
client
=
new
OkHttpClient
();
final
OkHttpClient
client
=
new
OkHttpClient
();
client
.
setConnectTimeout
(
250
,
TimeUnit
.
SECONDS
);
client
.
setConnectTimeout
(
250
,
TimeUnit
.
SECONDS
);
...
@@ -137,7 +137,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
...
@@ -137,7 +137,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
try
{
try
{
Log
.
e
(
"session"
,
object
.
getString
(
"msg"
));
Log
.
e
(
"session"
,
object
.
getString
(
"msg"
));
Constants
.
getToast
(
HomeActivity
.
this
,
object
.
getString
(
"msg"
));
Constants
.
getToast
(
HomeActivity
.
this
,
object
.
getString
(
"msg"
));
Login
.
l
ogout
(
HomeActivity
.
this
);
Login
.
L
ogout
(
HomeActivity
.
this
);
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -154,11 +154,13 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
...
@@ -154,11 +154,13 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
}
}
});
});
}
}
@Override
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
){
public
boolean
onCreateOptionsMenu
(
Menu
menu
){
getMenuInflater
().
inflate
(
R
.
menu
.
menu
,
menu
);
getMenuInflater
().
inflate
(
R
.
menu
.
menu
,
menu
);
return
super
.
onCreateOptionsMenu
(
menu
);
return
super
.
onCreateOptionsMenu
(
menu
);
}
}
@Override
@Override
public
boolean
onOptionsItemSelected
(
@NonNull
MenuItem
item
){
public
boolean
onOptionsItemSelected
(
@NonNull
MenuItem
item
){
switch
(
item
.
getItemId
()){
switch
(
item
.
getItemId
()){
...
@@ -206,7 +208,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
...
@@ -206,7 +208,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setStoreId
(
""
);
preferenceManager
.
setStoreId
(
""
);
preferenceManager
.
setBLUETOOTH
(
""
);
preferenceManager
.
setBLUETOOTH
(
""
);
Login
.
l
ogout
(
HomeActivity
.
this
);
Login
.
L
ogout
(
HomeActivity
.
this
);
}
else
{
}
else
{
Constants
.
getToast
(
HomeActivity
.
this
,
jsonObject
.
getString
(
"msg"
));
Constants
.
getToast
(
HomeActivity
.
this
,
jsonObject
.
getString
(
"msg"
));
}
}
...
@@ -222,6 +224,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
...
@@ -222,6 +224,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
}
}
});
});
}
}
@Override
@Override
public
void
onBackPressed
(){
public
void
onBackPressed
(){
int
count
=
0
;
int
count
=
0
;
...
...
app/src/main/java/w/soulofpluto/posstockaudit/Login.java
View file @
79d8faed
...
@@ -48,8 +48,8 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
...
@@ -48,8 +48,8 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
private
PreferenceManager
preferenceManager
;
private
PreferenceManager
preferenceManager
;
private
String
Store_Name
;
private
String
Store_Name
;
public
static
void
l
ogout
(
Context
context
){
public
static
void
L
ogout
(
Context
context
){
AppUtils
.
clearAppData
(
context
);
//
AppUtils.clearAppData(context);
Activity
activity
=
(
Activity
)
context
;
Activity
activity
=
(
Activity
)
context
;
Intent
in_logout
=
new
Intent
(
context
,
Login
.
class
);
Intent
in_logout
=
new
Intent
(
context
,
Login
.
class
);
in_logout
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
in_logout
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
...
@@ -122,7 +122,7 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
...
@@ -122,7 +122,7 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
store
.
setStoreName
(
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
store_name
)));
store
.
setStoreName
(
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
store_name
)));
stores
.
add
(
store
);
stores
.
add
(
store
);
}
}
ArrayAdapter
<
Store
>
adapter
=
new
ArrayAdapter
<
Store
>(
Login
.
this
,
R
.
layout
.
spinner_item
,
stores
);
ArrayAdapter
<
Store
>
adapter
=
new
ArrayAdapter
<>(
Login
.
this
,
R
.
layout
.
spinner_item
,
stores
);
storeId
.
setAdapter
(
adapter
);
storeId
.
setAdapter
(
adapter
);
}
}
}
}
...
...
app/src/main/java/w/soulofpluto/posstockaudit/MainActivity.java
View file @
79d8faed
...
@@ -92,9 +92,16 @@ public class MainActivity extends AppCompatActivity {
...
@@ -92,9 +92,16 @@ public class MainActivity extends AppCompatActivity {
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setStoreId
(
""
);
preferenceManager
.
setStoreId
(
""
);
Login
.
l
ogout
(
MainActivity
.
this
);
Login
.
L
ogout
(
MainActivity
.
this
);
}
else
{
}
else
{
runOnUiThread
(()
->
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
MainActivity
.
this
,
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
});
}
}
}
}
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
...
@@ -185,6 +192,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -185,6 +192,7 @@ public class MainActivity extends AppCompatActivity {
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
data
)))
{
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
data
)))
{
plansArrayList
.
clear
();
plansArrayList
.
clear
();
JSONArray
jsonArray
=
object1
.
getJSONArray
(
getResources
().
getString
(
R
.
string
.
data
));
JSONArray
jsonArray
=
object1
.
getJSONArray
(
getResources
().
getString
(
R
.
string
.
data
));
if
(
jsonArray
.
length
()>
0
){
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++)
{
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
Plans
plans
=
new
Plans
();
Plans
plans
=
new
Plans
();
...
@@ -197,6 +205,16 @@ public class MainActivity extends AppCompatActivity {
...
@@ -197,6 +205,16 @@ public class MainActivity extends AppCompatActivity {
CustomAdapter
customAdapter
=
new
CustomAdapter
(
MainActivity
.
this
,
plansArrayList
);
CustomAdapter
customAdapter
=
new
CustomAdapter
(
MainActivity
.
this
,
plansArrayList
);
plans_list
.
setLayoutManager
(
new
LinearLayoutManager
(
MainActivity
.
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
plans_list
.
setLayoutManager
(
new
LinearLayoutManager
(
MainActivity
.
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
plans_list
.
setAdapter
(
customAdapter
);
plans_list
.
setAdapter
(
customAdapter
);
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
runOnUiThread
(()
->
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
});
}
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
try
{
try
{
...
@@ -218,7 +236,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -218,7 +236,7 @@ public class MainActivity extends AppCompatActivity {
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setStoreId
(
""
);
preferenceManager
.
setStoreId
(
""
);
Login
.
l
ogout
(
MainActivity
.
this
);
Login
.
L
ogout
(
MainActivity
.
this
);
}
}
}
}
}
}
...
...
app/src/main/java/w/soulofpluto/posstockaudit/PlanDetails.java
View file @
79d8faed
...
@@ -38,6 +38,7 @@ import com.squareup.okhttp.Response;
...
@@ -38,6 +38,7 @@ import com.squareup.okhttp.Response;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.lang.reflect.Constructor
;
import
java.net.UnknownHostException
;
import
java.net.UnknownHostException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -67,10 +68,10 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -67,10 +68,10 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
MediaPlayer
mp
;
MediaPlayer
mp
;
String
Rack_No
;
String
Rack_No
;
public
static
void
start
(
Context
context
,
Plans
plans
,
String
rack
n
o
){
public
static
void
start
(
Context
context
,
Plans
plans
,
String
rack
N
o
){
Intent
in
=
new
Intent
(
context
,
PlanDetails
.
class
);
Intent
in
=
new
Intent
(
context
,
PlanDetails
.
class
);
in
.
putExtra
(
"key"
,
plans
);
in
.
putExtra
(
"key"
,
plans
);
in
.
putExtra
(
"rack"
,
rack
n
o
);
in
.
putExtra
(
"rack"
,
rack
N
o
);
context
.
startActivity
(
in
);
context
.
startActivity
(
in
);
}
}
...
@@ -196,41 +197,42 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -196,41 +197,42 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
np
.
printStackTrace
();
np
.
printStackTrace
();
}
}
}
else
{
}
else
{
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
)));
}
}
}
else
{
}
else
{
if
(
TextUtils
.
isEmpty
(
qty
.
getText
().
toString
())){
if
(
TextUtils
.
isEmpty
(
qty
.
getText
().
toString
())){
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
barcode
.
setText
(
""
);
barcode
.
setText
(
""
);
Constants
.
getToast
(
PlanDetails
.
this
,
"Enter Qty"
);
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
"Enter Qty"
));
});
});
}
else
{
}
else
{
float
value
=
Float
.
parseFloat
(
qty
.
getText
().
toString
());
float
value
=
Float
.
parseFloat
(
qty
.
getText
().
toString
());
if
(
value
>
0
){
if
(
value
>
0
){
if
(
Constants
.
isNetworkAvailable
(
PlanDetails
.
this
)){
if
(
Constants
.
isNetworkAvailable
(
PlanDetails
.
this
)){
//barcode.setFocusable(false);
if
(
arrayList
.
size
()
>
0
)
{
if
(
arrayList
.
size
()
>
0
)
{
if
(
Constants
.
Existing
(
arrayList
,
barcode
.
getText
().
toString
().
replace
(
"\n"
,
""
)))
{
if
(
Constants
.
Existing
(
arrayList
,
barcode
.
getText
().
toString
().
replace
(
"\n"
,
""
)))
{
getNotification
(
"Already scanned this item"
);
getNotification
(
"Already scanned this item"
);
return
;
return
;
}
}
}
}
try
{
try
{
UploadBarcode
(
barcode
.
getText
().
toString
().
replace
(
"\n"
,
""
),
qty
.
getText
().
toString
(),
plans
.
getPlanId
());
UploadBarcode
(
barcode
.
getText
().
toString
().
replace
(
"\n"
,
""
),
qty
.
getText
().
toString
(),
plans
.
getPlanId
());
Constants
.
ProgressDialogShow
(
PlanDetails
.
this
);
Constants
.
ProgressDialogShow
(
PlanDetails
.
this
);
barcode
.
setText
(
""
);
}
catch
(
NullPointerException
np
){
}
catch
(
NullPointerException
np
){
np
.
printStackTrace
();
np
.
printStackTrace
();
}
}
}
else
{
}
else
{
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
)
));
}
}
}
}
}
}
}
}
}
}
}
else
{
}
else
{
getNotification
(
getResources
().
getString
(
R
.
string
.
connection
));
//getNotification(getResources().getString(R.string.connection));
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
)));
}
}
}
catch
(
NullPointerException
np
){
}
catch
(
NullPointerException
np
){
np
.
printStackTrace
();
np
.
printStackTrace
();
...
@@ -251,16 +253,16 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -251,16 +253,16 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
Constants
.
ProgressDialogShow
(
PlanDetails
.
this
);
Constants
.
ProgressDialogShow
(
PlanDetails
.
this
);
UploadAllBarCodes
(
Constants
.
BarcodeComplete
,
rack_number
.
getText
().
toString
());
UploadAllBarCodes
(
Constants
.
BarcodeComplete
,
rack_number
.
getText
().
toString
());
}
else
{
}
else
{
Constants
.
getToast
(
PlanDetails
.
this
,
"Enter Rack Id"
);
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
"Enter Rack Id"
)
);
}
}
}
else
{
}
else
{
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
)
));
}
}
}
else
{
}
else
{
Constants
.
getToast
(
PlanDetails
.
this
,
"No Scan items "
);
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
"No Scan items "
)
);
}
}
}
else
{
}
else
{
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
runOnUiThread
(()
->
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
)
));
}
}
break
;
break
;
}
}
...
@@ -269,15 +271,30 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -269,15 +271,30 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
public
void
getNotification
(
String
text
){
public
void
getNotification
(
String
text
){
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
mp
=
MediaPlayer
.
create
(
PlanDetails
.
this
,
R
.
raw
.
beep
);
mp
=
MediaPlayer
.
create
(
PlanDetails
.
this
,
R
.
raw
.
beep
);
if
(
mp
.
isPlaying
())
{
if
(
mp
!=
null
&&
mp
.
isPlaying
())
{
Log
.
e
(
"Media Player start"
,
" ====>1"
);
mp
.
stop
();
mp
.
stop
();
try
{
try
{
mp
.
prepare
();
mp
.
prepare
();
mp
.
start
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
IllegalStateException
e1
){
e1
.
printStackTrace
();
}
catch
(
NullPointerException
np
){
np
.
printStackTrace
();
}
}
}
}
else
{
try
{
Log
.
e
(
"Media Player start"
,
" ====>2"
);
mp
.
start
();
mp
.
start
();
mp
.
setLooping
(
true
);
}
catch
(
IllegalStateException
i
){
i
.
printStackTrace
();
}
catch
(
NullPointerException
n
){
n
.
printStackTrace
();
}
}
final
Dialog
dialog1
=
new
Dialog
(
PlanDetails
.
this
);
final
Dialog
dialog1
=
new
Dialog
(
PlanDetails
.
this
);
dialog1
.
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
dialog1
.
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
dialog1
.
setContentView
(
R
.
layout
.
activity_dialog
);
dialog1
.
setContentView
(
R
.
layout
.
activity_dialog
);
...
@@ -293,8 +310,16 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -293,8 +310,16 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
barcode
.
setFocusable
(
true
);
barcode
.
setFocusable
(
true
);
barcode
.
requestFocus
();
barcode
.
requestFocus
();
barcode
.
setText
(
""
);
barcode
.
setText
(
""
);
try
{
if
(
mp
!=
null
&&
mp
.
isPlaying
())
{
mp
.
stop
();
mp
.
stop
();
mp
.
release
();
mp
.
release
();
}
}
catch
(
IllegalStateException
ise
){
ise
.
printStackTrace
();
}
catch
(
NullPointerException
npe
){
npe
.
printStackTrace
();
}
});
});
});
});
}
}
...
@@ -432,7 +457,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -432,7 +457,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
plans
.
setColumnId
(
1
);
plans
.
setColumnId
(
1
);
}
}
arrayList
.
add
(
plans
);
arrayList
.
add
(
plans
);
Collections
.
sort
(
arrayList
,
Plans
.
sortBy
Name
);
Collections
.
sort
(
arrayList
,
Plans
.
sortBy
Id
);
setUI
(
arrayList
);
setUI
(
arrayList
);
if
(
arrayList
.
size
()
>
0
){
if
(
arrayList
.
size
()
>
0
){
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
...
@@ -640,7 +665,8 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -640,7 +665,8 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
preferenceManager
.
setLogged
(
true
);
preferenceManager
.
setLogged
(
true
);
dialog
.
dismiss
();
dialog
.
dismiss
();
}
else
{
}
else
{
Toast
.
makeText
(
PlanDetails
.
this
,
obj
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)),
Toast
.
LENGTH_SHORT
).
show
();
Constants
.
getToast
(
PlanDetails
.
this
,
obj
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
//Toast.makeText(PlanDetails.this,obj.getString(getResources().getString(R.string.msg)), Toast.LENGTH_SHORT).show();
}
}
}
}
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
...
...
app/src/main/java/w/soulofpluto/posstockaudit/Plans.java
View file @
79d8faed
...
@@ -27,8 +27,6 @@ public class Plans implements Parcelable {
...
@@ -27,8 +27,6 @@ public class Plans implements Parcelable {
ColumnId
=
columnId
;
ColumnId
=
columnId
;
}
}
protected
Plans
(
Parcel
in
)
{
protected
Plans
(
Parcel
in
)
{
PlanId
=
in
.
readString
();
PlanId
=
in
.
readString
();
Name
=
in
.
readString
();
Name
=
in
.
readString
();
...
@@ -44,7 +42,6 @@ public class Plans implements Parcelable {
...
@@ -44,7 +42,6 @@ public class Plans implements Parcelable {
public
Plans
createFromParcel
(
Parcel
in
)
{
public
Plans
createFromParcel
(
Parcel
in
)
{
return
new
Plans
(
in
);
return
new
Plans
(
in
);
}
}
@Override
@Override
public
Plans
[]
newArray
(
int
size
)
{
public
Plans
[]
newArray
(
int
size
)
{
return
new
Plans
[
size
];
return
new
Plans
[
size
];
...
@@ -52,7 +49,6 @@ public class Plans implements Parcelable {
...
@@ -52,7 +49,6 @@ public class Plans implements Parcelable {
};
};
public
Plans
()
{
public
Plans
()
{
}
}
public
String
getPlanId
()
{
public
String
getPlanId
()
{
...
@@ -122,5 +118,5 @@ public class Plans implements Parcelable {
...
@@ -122,5 +118,5 @@ public class Plans implements Parcelable {
return
Name
;
return
Name
;
}
}
public
static
Comparator
<
Plans
>
sortBy
Name
=
(
t1
,
t2
)
->
t2
.
getColumnId
()
-
t1
.
getColumnId
();
public
static
Comparator
<
Plans
>
sortBy
Id
=
(
t1
,
t2
)
->
t2
.
getColumnId
()
-
t1
.
getColumnId
();
}
}
app/src/main/java/w/soulofpluto/posstockaudit/RackWiseAdapter.java
View file @
79d8faed
...
@@ -25,7 +25,7 @@ public class RackWiseAdapter extends RecyclerView.Adapter<RackWiseAdapter.ViewHo
...
@@ -25,7 +25,7 @@ public class RackWiseAdapter extends RecyclerView.Adapter<RackWiseAdapter.ViewHo
@NonNull
@NonNull
@Override
@Override
public
RackWiseAdapter
.
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
){
public
RackWiseAdapter
.
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
LayoutInflater
layoutInflater
=
LayoutInflater
.
from
(
parent
.
getContext
());
LayoutInflater
layoutInflater
=
LayoutInflater
.
from
(
parent
.
getContext
());
View
listItem
=
layoutInflater
.
inflate
(
R
.
layout
.
rackwise_item
,
parent
,
false
);
View
listItem
=
layoutInflater
.
inflate
(
R
.
layout
.
rackwise_item
,
parent
,
false
);
RackWiseAdapter
.
ViewHolder
viewHolder
=
new
RackWiseAdapter
.
ViewHolder
(
listItem
);
RackWiseAdapter
.
ViewHolder
viewHolder
=
new
RackWiseAdapter
.
ViewHolder
(
listItem
);
...
@@ -33,31 +33,31 @@ public class RackWiseAdapter extends RecyclerView.Adapter<RackWiseAdapter.ViewHo
...
@@ -33,31 +33,31 @@ public class RackWiseAdapter extends RecyclerView.Adapter<RackWiseAdapter.ViewHo
}
}
@Override
@Override
public
void
onBindViewHolder
(
@NonNull
RackWiseAdapter
.
ViewHolder
holder
,
final
int
position
){
public
void
onBindViewHolder
(
@NonNull
RackWiseAdapter
.
ViewHolder
holder
,
final
int
position
)
{
final
RackWise
items
=
arrayList
.
get
(
position
);
final
RackWise
items
=
arrayList
.
get
(
position
);
if
(
items
.
getId
()
==
0
){
if
(
items
.
getId
()
==
0
){
// holder.rack_id.setText(Html.fromHtml(Constants.Id + "0")
);
holder
.
rack_id
.
setText
(
""
);
}
else
{
}
else
{
holder
.
rack_id
.
setText
(
Html
.
fromHtml
(
Constants
.
Id
+
items
.
getId
()));
holder
.
rack_id
.
setText
(
Html
.
fromHtml
(
Constants
.
Id
+
items
.
getId
()));
}
}
holder
.
rack_userid
.
setText
(
Html
.
fromHtml
(
Constants
.
User
+
items
.
getScanned_by
()));
holder
.
rack_UserId
.
setText
(
Html
.
fromHtml
(
Constants
.
User
+
items
.
getScanned_by
()));
holder
.
rack_from
.
setText
(
Html
.
fromHtml
(
Constants
.
From
+
items
.
getScanning_start_at
()));
holder
.
rack_from
.
setText
(
Html
.
fromHtml
(
Constants
.
From
+
items
.
getScanning_start_at
()));
holder
.
rack_to
.
setText
(
Html
.
fromHtml
(
Constants
.
To
+
items
.
getScanning_end_at
()));
holder
.
rack_to
.
setText
(
Html
.
fromHtml
(
Constants
.
To
+
items
.
getScanning_end_at
()));
holder
.
rack_qty
.
setText
(
String
.
valueOf
(
items
.
getQty
()));
holder
.
rack_qty
.
setText
(
String
.
valueOf
(
items
.
getQty
()));
}
}
@Override
@Override
public
int
getItemCount
(){
public
int
getItemCount
()
{
return
arrayList
.
size
();
return
arrayList
.
size
();
}
}
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
public
TextView
rack_id
,
rack_qty
,
rack_
useri
d
,
rack_from
,
rack_to
;
public
TextView
rack_id
,
rack_qty
,
rack_
UserI
d
,
rack_from
,
rack_to
;
public
ViewHolder
(
View
itemView
){
public
ViewHolder
(
View
itemView
)
{
super
(
itemView
);
super
(
itemView
);
rack_id
=
itemView
.
findViewById
(
R
.
id
.
rack_id
);
rack_id
=
itemView
.
findViewById
(
R
.
id
.
rack_id
);
rack_qty
=
itemView
.
findViewById
(
R
.
id
.
rack_qty
);
rack_qty
=
itemView
.
findViewById
(
R
.
id
.
rack_qty
);
rack_
useri
d
=
itemView
.
findViewById
(
R
.
id
.
rack_userid
);
rack_
UserI
d
=
itemView
.
findViewById
(
R
.
id
.
rack_userid
);
rack_from
=
itemView
.
findViewById
(
R
.
id
.
rack_from
);
rack_from
=
itemView
.
findViewById
(
R
.
id
.
rack_from
);
rack_to
=
itemView
.
findViewById
(
R
.
id
.
rack_to
);
rack_to
=
itemView
.
findViewById
(
R
.
id
.
rack_to
);
}
}
...
...
app/src/main/java/w/soulofpluto/posstockaudit/RackWiseQty.java
View file @
79d8faed
...
@@ -90,11 +90,11 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -90,11 +90,11 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
Date
from
=
getDateWithOffset
(-
Constants
.
Value
,
new
Date
());
Date
from
=
getDateWithOffset
(-
Constants
.
Value
,
new
Date
());
String
fromDate
=
currentDate
.
format
(
from
);
String
fromDate
=
currentDate
.
format
(
from
);
String
thisDate
=
currentDate
.
format
(
todayDate
);
String
thisDate
=
currentDate
.
format
(
todayDate
);
Log
.
e
(
"Last date"
,
fromDate
);
//Log.e("Last date"
,fromDate);
Log
.
e
(
"Today date"
,
thisDate
);
//
Log.e("Today date",thisDate);
object
.
put
(
getResources
().
getString
(
R
.
string
.
auditstatus
),
"In Progress"
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
auditstatus
),
"In Progress"
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
fromdate
),
fromDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
fromdate
),
fromDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
todate
),
thisDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
todate
),
thisDate
);
}
}
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -106,8 +106,8 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -106,8 +106,8 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
client
.
setReadTimeout
(
250
,
TimeUnit
.
SECONDS
);
client
.
setReadTimeout
(
250
,
TimeUnit
.
SECONDS
);
client
.
setWriteTimeout
(
250
,
TimeUnit
.
SECONDS
);
client
.
setWriteTimeout
(
250
,
TimeUnit
.
SECONDS
);
Request
request
=
new
Request
.
Builder
()
Request
request
=
new
Request
.
Builder
()
.
url
(
Url
)
.
url
(
Url
)
.
post
(
body
)
.
post
(
body
)
.
addHeader
(
Constants
.
Type
,
Constants
.
App_json
)
.
addHeader
(
Constants
.
Type
,
Constants
.
App_json
)
.
addHeader
(
getResources
().
getString
(
R
.
string
.
accesstoken
),
preferenceManager
.
getCustToken
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
accesstoken
),
preferenceManager
.
getCustToken
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
storeidtoken
),
preferenceManager
.
getStoreId
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
storeidtoken
),
preferenceManager
.
getStoreId
())
...
@@ -125,8 +125,8 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -125,8 +125,8 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
try
{
try
{
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
final
String
Response
=
response
.
body
().
string
();
final
String
Response
=
response
.
body
().
string
();
Log
.
e
(
"Store Response "
,
Response
);
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
());
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
());
Log
.
e
(
"Store Response "
,
Response
);
handler
.
post
(()
->
{
handler
.
post
(()
->
{
try
{
try
{
if
(
response
.
code
()
==
200
){
if
(
response
.
code
()
==
200
){
...
@@ -171,7 +171,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -171,7 +171,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setStoreId
(
""
);
preferenceManager
.
setStoreId
(
""
);
Login
.
l
ogout
(
RackWiseQty
.
this
);
Login
.
L
ogout
(
RackWiseQty
.
this
);
}
}
}
}
}
}
...
@@ -209,7 +209,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -209,7 +209,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
npe
.
printStackTrace
();
npe
.
printStackTrace
();
}
}
}
else
{
}
else
{
Constants
.
getToast
(
RackWiseQty
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
runOnUiThread
(()
->
Constants
.
getToast
(
RackWiseQty
.
this
,
getResources
().
getString
(
R
.
string
.
connection
)
));
}
}
}
}
break
;
break
;
...
@@ -218,11 +218,11 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -218,11 +218,11 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
@Override
@Override
public
void
onNothingSelected
(
AdapterView
<?>
adapterView
)
{
public
void
onNothingSelected
(
AdapterView
<?>
adapterView
)
{
}
}
private
void
getRackWiseData
(
String
plan
i
d
){
private
void
getRackWiseData
(
String
plan
I
d
){
JSONObject
object
=
new
JSONObject
();
JSONObject
object
=
new
JSONObject
();
try
{
try
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
){
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
){
object
.
put
(
getResources
().
getString
(
R
.
string
.
plan_id
),
plan
i
d
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
plan_id
),
plan
I
d
);
}
}
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -254,7 +254,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -254,7 +254,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
try
{
try
{
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
final
String
Response
=
response
.
body
().
string
();
final
String
Response
=
response
.
body
().
string
();
Log
.
e
(
"Rack
w
ise Response "
,
Response
);
Log
.
e
(
"Rack
W
ise Response "
,
Response
);
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
());
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
());
handler
.
post
(()
->
{
handler
.
post
(()
->
{
try
{
try
{
...
@@ -266,10 +266,9 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -266,10 +266,9 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
rackWiseArrayList
.
clear
();
rackWiseArrayList
.
clear
();
JSONObject
headerObject
=
object1
.
getJSONObject
(
getResources
().
getString
(
R
.
string
.
data
));
JSONObject
headerObject
=
object1
.
getJSONObject
(
getResources
().
getString
(
R
.
string
.
data
));
final
int
count
=
headerObject
.
getInt
(
"total_scanned_items"
);
final
int
count
=
headerObject
.
getInt
(
"total_scanned_items"
);
Log
.
e
(
"TOTAL SCANNED ITEMS : "
,
String
.
valueOf
(
count
));
//
Log.e("TOTAL SCANNED ITEMS : ",String.valueOf(count));
runOnUiThread
(()
->
total_scanned
.
setText
(
Html
.
fromHtml
(
Constants
.
getVal
(
count
))));
runOnUiThread
(()
->
total_scanned
.
setText
(
Html
.
fromHtml
(
Constants
.
getVal
(
count
))));
JSONArray
jsonArray
=
headerObject
.
getJSONArray
(
"rack_info"
);
JSONArray
jsonArray
=
headerObject
.
getJSONArray
(
"rack_info"
);
//JSONArray jsonArray = object.getJSONArray(getResources().getString(R.string.data));
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++){
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++){
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
RackWise
rackWise
=
new
RackWise
();
RackWise
rackWise
=
new
RackWise
();
...
@@ -309,7 +308,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
...
@@ -309,7 +308,7 @@ public class RackWiseQty extends AppCompatActivity implements AdapterView.OnItem
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setCustToken
(
""
);
preferenceManager
.
setStoreId
(
""
);
preferenceManager
.
setStoreId
(
""
);
Login
.
l
ogout
(
RackWiseQty
.
this
);
Login
.
L
ogout
(
RackWiseQty
.
this
);
}
}
}
}
}
}
...
...
app/src/main/java/w/soulofpluto/posstockaudit/SearchByBarcode.java
View file @
79d8faed
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment