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
d63feb8f
Commit
d63feb8f
authored
Mar 09, 2021
by
User
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few changes
parent
2db04546
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
33 deletions
+32
-33
PlanDetails.java
app/src/main/java/w/soulofpluto/posstock/PlanDetails.java
+20
-22
SearchByBarcode.java
...src/main/java/w/soulofpluto/posstock/SearchByBarcode.java
+11
-11
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/w/soulofpluto/posstock/PlanDetails.java
View file @
d63feb8f
...
@@ -366,7 +366,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -366,7 +366,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
public
void
run
(){
public
void
run
(){
try
{
try
{
Constants
.
getToast
(
PlanDetails
.
this
,
object
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
PlanDetails
.
this
,
object
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Do
l
ogin
();
Do
L
ogin
();
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -404,10 +404,9 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -404,10 +404,9 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
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
.
barcode_upload
),
Barcode
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
barcode_upload
),
Barcode
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
rule_id
)
,
Id
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
rule_id
),
Id
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
quantity_upload
),
qty
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
quantity_upload
),
qty
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
}
}
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -470,7 +469,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -470,7 +469,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
public
void
run
()
{
public
void
run
()
{
try
{
try
{
Constants
.
getToast
(
PlanDetails
.
this
,
object
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
PlanDetails
.
this
,
object
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Do
l
ogin
();
Do
L
ogin
();
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -534,7 +533,6 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -534,7 +533,6 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
object
.
put
(
getResources
().
getString
(
R
.
string
.
rule_id
),
plans
.
getPlanId
());
object
.
put
(
getResources
().
getString
(
R
.
string
.
rule_id
),
plans
.
getPlanId
());
object
.
put
(
getResources
().
getString
(
R
.
string
.
quantity_upload
),
plans
.
getQty
());
object
.
put
(
getResources
().
getString
(
R
.
string
.
quantity_upload
),
plans
.
getQty
());
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
}
}
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -593,13 +591,13 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -593,13 +591,13 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
public
void
run
()
{
public
void
run
()
{
try
{
try
{
Constants
.
getToast
(
PlanDetails
.
this
,
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
PlanDetails
.
this
,
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Do
l
ogin
();
Do
L
ogin
();
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
});
});
}
else
{
}
else
{
runOnUiThread
(
new
Runnable
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
...
@@ -614,7 +612,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -614,7 +612,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
}
}
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
NullPointerException
np
){
}
catch
(
NullPointerException
np
){
np
.
printStackTrace
();
np
.
printStackTrace
();
}
}
}
}
...
@@ -626,16 +624,16 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -626,16 +624,16 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
runOnUiThread
(
new
Runnable
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
count
.
setText
(
"Scanned Items : "
+
list
.
size
());
count
.
setText
(
"Scanned Items : "
+
list
.
size
());
}
else
{
}
else
{
count
.
setText
(
"Scanned Items : 0 "
);
count
.
setText
(
"Scanned Items : 0 "
);
}
}
}
}
});
});
}
}
private
void
Do
l
ogin
(){
private
void
Do
L
ogin
(){
dialog
=
new
Dialog
(
PlanDetails
.
this
);
dialog
=
new
Dialog
(
PlanDetails
.
this
);
dialog
.
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
dialog
.
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
dialog
.
setContentView
(
R
.
layout
.
dialog_session
);
dialog
.
setContentView
(
R
.
layout
.
dialog_session
);
...
@@ -643,23 +641,23 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -643,23 +641,23 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
dialog
.
setCanceledOnTouchOutside
(
false
);
dialog
.
setCanceledOnTouchOutside
(
false
);
dialog
.
getWindow
().
setLayout
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
);
dialog
.
getWindow
().
setLayout
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
);
dialog
.
show
();
dialog
.
show
();
final
TextView
user
i
d
=
dialog
.
findViewById
(
R
.
id
.
relogin_userid
);
final
TextView
user
I
d
=
dialog
.
findViewById
(
R
.
id
.
relogin_userid
);
final
TextView
pass
=
dialog
.
findViewById
(
R
.
id
.
relogin_pass
);
final
TextView
pass
=
dialog
.
findViewById
(
R
.
id
.
relogin_pass
);
final
Button
re
l
ogin
=
dialog
.
findViewById
(
R
.
id
.
relogin_submit
);
final
Button
re
L
ogin
=
dialog
.
findViewById
(
R
.
id
.
relogin_submit
);
user
i
d
.
setText
(
preferenceManager
.
getUserId
());
user
I
d
.
setText
(
preferenceManager
.
getUserId
());
//pass.setText(preferenceManager.getPassword());
//pass.setText(preferenceManager.getPassword());
re
login
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
re
Login
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
){
public
void
onClick
(
View
view
){
if
(
Constants
.
isNetworkAvailable
(
PlanDetails
.
this
)){
if
(
Constants
.
isNetworkAvailable
(
PlanDetails
.
this
)){
if
(
TextUtils
.
isEmpty
(
pass
.
getText
().
toString
())){
if
(
TextUtils
.
isEmpty
(
pass
.
getText
().
toString
())){
Constants
.
getToast
(
PlanDetails
.
this
,
"Please Enter Password"
);
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
enterPassword
)
);
}
else
{
}
else
{
doLogin
(
preferenceManager
.
getUserId
(),
Constants
.
getSHA256
(
pass
.
getText
().
toString
()));
doLogin
(
preferenceManager
.
getUserId
(),
Constants
.
getSHA256
(
pass
.
getText
().
toString
()));
Constants
.
ProgressDialogShow
(
PlanDetails
.
this
);
Constants
.
ProgressDialogShow
(
PlanDetails
.
this
);
}
}
}
else
{
}
else
{
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
Constants
.
getToast
(
PlanDetails
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
}
}
}
}
});
});
...
@@ -693,7 +691,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
...
@@ -693,7 +691,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
public
void
onFailure
(
Request
request
,
IOException
e
){
public
void
onFailure
(
Request
request
,
IOException
e
){
if
(
e
.
getCause
()
!=
null
&&
e
.
getCause
()
instanceof
UnknownHostException
){
if
(
e
.
getCause
()
!=
null
&&
e
.
getCause
()
instanceof
UnknownHostException
){
}
else
{
}
else
{
Log
.
e
(
"error ====>"
,
e
.
getMessage
());
Log
.
e
(
"error ====>"
,
e
.
getMessage
());
}
}
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
}
}
...
...
app/src/main/java/w/soulofpluto/posstock/SearchByBarcode.java
View file @
d63feb8f
...
@@ -64,7 +64,7 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
...
@@ -64,7 +64,7 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
}
else
{
}
else
{
Constants
.
getToast
(
SearchByBarcode
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
Constants
.
getToast
(
SearchByBarcode
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
}
}
searchbybarcode_spinner
.
setOnItemSelectedListener
(
this
);
searchbybarcode_spinner
.
setOnItemSelectedListener
(
this
);
/*
/*
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
searchby_barcode.setShowSoftInputOnFocus(false);
searchby_barcode.setShowSoftInputOnFocus(false);
...
@@ -109,11 +109,11 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
...
@@ -109,11 +109,11 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
client
.
newCall
(
request
).
enqueue
(
new
Callback
(){
client
.
newCall
(
request
).
enqueue
(
new
Callback
(){
@Override
@Override
public
void
onFailure
(
Request
request
,
final
IOException
e
){
public
void
onFailure
(
Request
request
,
final
IOException
e
){
runOnUiThread
(
new
Runnable
()
{
runOnUiThread
(
new
Runnable
(){
@Override
@Override
public
void
run
()
{
public
void
run
(){
Constants
.
getToast
(
SearchByBarcode
.
this
,
e
.
getMessage
());
Constants
.
getToast
(
SearchByBarcode
.
this
,
e
.
getMessage
());
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
}
}
});
});
}
}
...
@@ -129,7 +129,7 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
...
@@ -129,7 +129,7 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
public
void
run
(){
public
void
run
(){
try
{
try
{
final
JSONObject
object
=
new
JSONObject
(
Response
);
final
JSONObject
object
=
new
JSONObject
(
Response
);
if
(
response
.
code
()
==
200
)
{
if
(
response
.
code
()
==
200
)
{
if
(
object
.
has
(
getResources
().
getString
(
R
.
string
.
success
)))
{
if
(
object
.
has
(
getResources
().
getString
(
R
.
string
.
success
)))
{
if
(
object
.
getInt
(
getResources
().
getString
(
R
.
string
.
success
))
==
1
)
{
if
(
object
.
getInt
(
getResources
().
getString
(
R
.
string
.
success
))
==
1
)
{
Log
.
e
(
"Length"
,
String
.
valueOf
(
getResources
().
getString
(
R
.
string
.
data
).
length
()));
Log
.
e
(
"Length"
,
String
.
valueOf
(
getResources
().
getString
(
R
.
string
.
data
).
length
()));
...
@@ -141,14 +141,14 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
...
@@ -141,14 +141,14 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
}
else
{
}
else
{
searchby_barcode
.
setText
(
""
);
searchby_barcode
.
setText
(
""
);
try
{
try
{
JSONObject
jsonObject
=
object
.
getJSONObject
(
getResources
().
getString
(
R
.
string
.
data
));
JSONObject
jsonObject
=
object
.
getJSONObject
(
getResources
().
getString
(
R
.
string
.
data
));
searchbybarcode_rack
.
setText
(
Html
.
fromHtml
(
Constants
.
Id
)
+
jsonObject
.
getString
(
"rack_id"
)
+
"\n"
searchbybarcode_rack
.
setText
(
Html
.
fromHtml
(
Constants
.
Id
)
+
jsonObject
.
getString
(
"rack_id"
)
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
Barcode
)
+
jsonObject
.
getString
(
"barcode"
))
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
Barcode
)
+
jsonObject
.
getString
(
"barcode"
))
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
From
)
+
jsonObject
.
getString
(
"scanning_start_at"
))
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
From
)
+
jsonObject
.
getString
(
"scanning_start_at"
))
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
To
)
+
jsonObject
.
getString
(
"scanning_end_at"
)));
+
(
Html
.
fromHtml
(
Constants
.
To
)
+
jsonObject
.
getString
(
"scanning_end_at"
)));
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
}
}
}
else
if
(
object
.
getInt
(
getResources
().
getString
(
R
.
string
.
success
))
==
3
){
}
else
if
(
object
.
getInt
(
getResources
().
getString
(
R
.
string
.
success
))
==
3
){
...
...
app/src/main/res/values/strings.xml
View file @
d63feb8f
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<string
name=
"spalsh"
>
Splash Screen
</string>
<string
name=
"spalsh"
>
Splash Screen
</string>
<string
name=
"userId"
>
Employee Id
</string>
<string
name=
"userId"
>
Employee Id
</string>
<string
name=
"userIdPassword"
>
Password
</string>
<string
name=
"userIdPassword"
>
Password
</string>
<string
name=
"enterPassword"
>
Please Enter Password
</string>
<string
name=
"stockaudit"
>
Stock Audit Plans
</string>
<string
name=
"stockaudit"
>
Stock Audit Plans
</string>
<string
name=
"rackreport"
>
Rack Wise Qty
</string>
<string
name=
"rackreport"
>
Rack Wise Qty
</string>
<string
name=
"searchbarcode"
>
SEARCH BY BARCODE
</string>
<string
name=
"searchbarcode"
>
SEARCH BY BARCODE
</string>
...
...
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