Commit 16841bab by Ramesh Babu Puvvadi

added with allow single barcode multiple times

parent 6bc2510d
......@@ -44,10 +44,9 @@ dependencies {
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics:18.2.1'
implementation 'com.karumi:dexter:6.2.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.android.support:multidex:1.0.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ package w.soulofpluto.posstockauditrecieving;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
......
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="w.soulofpluto.posstockauditrecieving">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
......@@ -24,6 +24,7 @@
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme.NoActionBar"
android:exported="true"
android:networkSecurityConfig="@xml/network_security_config">
<!--android:roundIcon="@drawable/adaptive_icon"
......@@ -34,7 +35,7 @@
-->
<activity
android:name="w.soulofpluto.posstockauditrecieving.SplashActivity"
android:name=".SplashActivity"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:exported="true">
......@@ -45,47 +46,47 @@
</activity>
<activity
android:name="w.soulofpluto.posstockauditrecieving.Login"
android:name=".Login"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait">
</activity>
<activity
android:name="w.soulofpluto.posstockauditrecieving.HomeActivity"
android:name=".HomeActivity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name="w.soulofpluto.posstockauditrecieving.DashBoardActivity"
android:name=".DashBoardActivity"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name="w.soulofpluto.posstockauditrecieving.MainActivity"
android:name=".MainActivity"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name="w.soulofpluto.posstockauditrecieving.PlanDetails"
android:name=".PlanDetails"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity
android:name="w.soulofpluto.posstockauditrecieving.RackWiseQty"
android:name=".RackWiseQty"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name="w.soulofpluto.posstockauditrecieving.SearchByBarcode"
android:name=".SearchByBarcode"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
......
......@@ -176,6 +176,9 @@ public class Constants{
public static Boolean Existing(ArrayList<Plans> plans, String barcode){
for(Plans plan : plans){
if(plan.getBarcode().contains(barcode)){
if(plan.IsGroupbarcode.equals("Y")){
return false;
}
return true;
}
}
......
......@@ -212,7 +212,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
if(Constants.isNetworkAvailable(PlanDetails.this)){
if(arrayList.size() > 0) {
if (Constants.Existing(arrayList, barcode.getText().toString().replace("\n", ""))) {
if(!(PlanDetails.this).isFinishing()) {
if(!(PlanDetails.this).isFinishing()) {
getNotification("Already scanned this item");
return;
}
......@@ -446,11 +446,16 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
if (response.code() == 200) {
if(object1.has(getResources().getString(R.string.success))) {
if(object1.getInt(getResources().getString(R.string.success)) == 1){
//Log.e("Testing Data =================>" ,object1.toString());
JSONObject jsonObject = object1.getJSONObject("barcode_attrs");
//Log.e("Testing Data1 =================>" ,jsonObject.toString());
barcode.requestFocus();
Plans plans = new Plans();
plans.setQty(qty);
plans.setPlanId(Id);
plans.setBarcode(Barcode);
plans.setIsGroupbarcode(jsonObject.getString("is_group_barcode"));
//Log.e("Testing =====>",jsonObject.getString("is_group_barcode"));
if (arrayList.size()>0) {
plans.setColumnId(arrayList.size() + 1);
} else {
......
......@@ -18,6 +18,16 @@ public class Plans implements Parcelable {
String Qty;
int ColumnId;
public static void setSortById(Comparator<Plans> sortById) {
Plans.sortById = sortById;
}
String IsGroupbarcode;
public int getColumnId() {
return ColumnId;
}
......@@ -34,6 +44,7 @@ public class Plans implements Parcelable {
Barcode = in.readString();
Qty = in.readString();
ColumnId = in.readInt();
IsGroupbarcode = in.readString();
}
public static final Creator<Plans> CREATOR = new Creator<Plans>() {
......@@ -102,6 +113,14 @@ public class Plans implements Parcelable {
return 0;
}
public String getIsGroupbarcode() {
return IsGroupbarcode;
}
public void setIsGroupbarcode(String isGroupbarcode) {
IsGroupbarcode = isGroupbarcode;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(PlanId);
......@@ -111,6 +130,7 @@ public class Plans implements Parcelable {
parcel.writeString(Barcode);
parcel.writeString(Qty);
parcel.writeInt(ColumnId);
parcel.writeString(IsGroupbarcode);
}
public String toString() {
......
<resources>
<string name="app_name">Pos Stock Receive And Transfer</string>
<string name="app_name">Pos Stock Audit</string>
<string name="success" translatable="false">success</string>
<string name="msg" translatable="false">msg</string>
<string name="data" translatable="false">data</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment