Added new Project Stock Transfer and Recieve

parent 0328dfa1
POSSTOCK
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>
\ No newline at end of file
...@@ -4,17 +4,16 @@ ...@@ -4,17 +4,16 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="testRunner" value="PLATFORM" /> <option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="JDK" /> <option name="gradleJvm" value="jbr-17" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" /> <option value="$PROJECT_DIR$/app" />
</set> </set>
</option> </option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
</component> </component>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CMakeSettings"> <component name="CMakeSettings">
<configurations> <configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" /> <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations> </configurations>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<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>
\ No newline at end of file
...@@ -2,13 +2,13 @@ apply plugin: 'com.android.application' ...@@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.google.firebase.crashlytics'
android { android {
compileSdkVersion 30 compileSdkVersion 33
buildToolsVersion "30.0.3" buildToolsVersion "30.0.3"
defaultConfig { defaultConfig {
applicationId "w.soulofpluto.posstock" applicationId "w.soulofpluto.posstockauditrecieving"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 30 targetSdkVersion 33
versionCode 2 versionCode 2
versionName "1.1" versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...@@ -47,5 +47,7 @@ dependencies { ...@@ -47,5 +47,7 @@ dependencies {
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'
implementation 'com.android.support:multidex:1.0.3'
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"client_info": { "client_info": {
"mobilesdk_app_id": "1:503097399483:android:836d8165b3e50f7be6f19e", "mobilesdk_app_id": "1:503097399483:android:836d8165b3e50f7be6f19e",
"android_client_info": { "android_client_info": {
"package_name": "w.soulofpluto.posstock" "package_name": "w.soulofpluto.posstockauditrecieving"
} }
}, },
"oauth_client": [ "oauth_client": [
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"client_id": "503097399483-trqntkot7dvg8sv0eou1n766ug8ikt24.apps.googleusercontent.com", "client_id": "503097399483-trqntkot7dvg8sv0eou1n766ug8ikt24.apps.googleusercontent.com",
"client_type": 1, "client_type": 1,
"android_info": { "android_info": {
"package_name": "w.soulofpluto.posstock", "package_name": "w.soulofpluto.posstockauditrecieving",
"certificate_hash": "0c48f6fd7e869b837d0608cb7c2cdbc084c0552b" "certificate_hash": "0c48f6fd7e869b837d0608cb7c2cdbc084c0552b"
} }
}, },
......
{
"project_info": {
"project_number": "503097399483",
"project_id": "posstockandsale",
"storage_bucket": "posstockandsale.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:503097399483:android:836d8165b3e50f7be6f19e",
"android_client_info": {
"package_name": "w.soulofpluto.posstock"
}
},
"oauth_client": [
{
"client_id": "503097399483-trqntkot7dvg8sv0eou1n766ug8ikt24.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "w.soulofpluto.posstock",
"certificate_hash": "0c48f6fd7e869b837d0608cb7c2cdbc084c0552b"
}
},
{
"client_id": "503097399483-2fmt335f3lug1ds4a2sjkmqir5onssje.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyASvVmZ2XqEbqjJfEZOzIewIgPFrRRvIPM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "503097399483-2fmt335f3lug1ds4a2sjkmqir5onssje.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.content.Context; import android.content.Context;
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest <manifest
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
package="w.soulofpluto.posstockaudit"> package="w.soulofpluto.posstockauditrecieving">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
...@@ -32,9 +32,10 @@ ...@@ -32,9 +32,10 @@
</uses-library> --> </uses-library> -->
<activity <activity
android:name="w.soulofpluto.posstockaudit.SplashActivity" android:name="w.soulofpluto.posstockauditrecieving.SplashActivity"
android:windowSoftInputMode="adjustNothing" android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"> android:screenOrientation="portrait"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
...@@ -42,47 +43,47 @@ ...@@ -42,47 +43,47 @@
</activity> </activity>
<activity <activity
android:name="w.soulofpluto.posstockaudit.Login" android:name="w.soulofpluto.posstockauditrecieving.Login"
android:windowSoftInputMode="adjustResize|stateHidden" android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
</activity> </activity>
<activity <activity
android:name="w.soulofpluto.posstockaudit.HomeActivity" android:name="w.soulofpluto.posstockauditrecieving.HomeActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize"> android:configChanges="keyboardHidden|screenSize">
</activity> </activity>
<activity <activity
android:name="w.soulofpluto.posstockaudit.DashBoardActivity" android:name="w.soulofpluto.posstockauditrecieving.DashBoardActivity"
android:windowSoftInputMode="adjustNothing" android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize"> android:configChanges="keyboardHidden|screenSize">
</activity> </activity>
<activity <activity
android:name="w.soulofpluto.posstockaudit.MainActivity" android:name="w.soulofpluto.posstockauditrecieving.MainActivity"
android:windowSoftInputMode="adjustResize" android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize"> android:configChanges="keyboardHidden|screenSize">
</activity> </activity>
<activity <activity
android:name="w.soulofpluto.posstockaudit.PlanDetails" android:name="w.soulofpluto.posstockauditrecieving.PlanDetails"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize" android:configChanges="keyboardHidden|screenSize"
android:windowSoftInputMode="adjustNothing"> android:windowSoftInputMode="adjustNothing">
</activity> </activity>
<activity <activity
android:name="w.soulofpluto.posstockaudit.RackWiseQty" android:name="w.soulofpluto.posstockauditrecieving.RackWiseQty"
android:windowSoftInputMode="adjustNothing" android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize"> android:configChanges="keyboardHidden|screenSize">
</activity> </activity>
<activity <activity
android:name="w.soulofpluto.posstockaudit.SearchByBarcode" android:name="w.soulofpluto.posstockauditrecieving.SearchByBarcode"
android:windowSoftInputMode="adjustNothing" android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize"> android:configChanges="keyboardHidden|screenSize">
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.content.Context; import android.content.Context;
...@@ -12,7 +12,6 @@ import static android.content.Context.ACTIVITY_SERVICE; ...@@ -12,7 +12,6 @@ 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 {
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.app.Activity; import android.app.Activity;
import android.app.ProgressDialog; import android.app.ProgressDialog;
...@@ -29,8 +29,9 @@ public class Constants{ ...@@ -29,8 +29,9 @@ 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 BASE_URL = "http://192.168.34.16/";
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,8 +66,6 @@ public class Constants{ ...@@ -65,8 +66,6 @@ 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();
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
*/ */
import android.app.Dialog; import android.app.Dialog;
...@@ -25,6 +25,7 @@ public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder ...@@ -25,6 +25,7 @@ public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder
private Context context; private Context context;
private ArrayList<Plans> arrayList; private ArrayList<Plans> arrayList;
public boolean status = false; public boolean status = false;
public CustomAdapter(Context context, ArrayList<Plans> storesArrayList){ public CustomAdapter(Context context, ArrayList<Plans> storesArrayList){
this.context = context; this.context = context;
this.arrayList = storesArrayList; this.arrayList = storesArrayList;
...@@ -40,8 +41,8 @@ public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder ...@@ -40,8 +41,8 @@ public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder
@Override @Override
public void onBindViewHolder(@NonNull CustomAdapter.ViewHolder holder, final int position){ public void onBindViewHolder(@NonNull CustomAdapter.ViewHolder holder, final int position){
final Plans items = arrayList.get(position); final Plans items = arrayList.get(position);
holder.plan_id.setText("PLAN ID : "+items.getPlanId()); holder.plan_id.setText ("PLAN ID : " +items.getPlanId());
holder.plan_name.setText("NAME : "+items.getName()); holder.plan_name.setText("NAME : " +items.getName());
holder.view_section.setOnClickListener(view -> { holder.view_section.setOnClickListener(view -> {
final Dialog dialog = new Dialog(context); final Dialog dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
...@@ -53,29 +54,30 @@ public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder ...@@ -53,29 +54,30 @@ public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder
TextView section = dialog.findViewById(R.id.plan_section); TextView section = dialog.findViewById(R.id.plan_section);
TextView division = dialog.findViewById(R.id.plan_division); TextView division = dialog.findViewById(R.id.plan_division);
ImageView close = dialog.findViewById(R.id.close); ImageView close = dialog.findViewById(R.id.close);
section.setText(Html.fromHtml(Constants.Sec +items.getSection())); section.setText (Html.fromHtml(Constants.Sec +items.getSection()));
division.setText(Html.fromHtml(Constants.div+items.getDivision())); division.setText(Html.fromHtml(Constants.div +items.getDivision()));
close.setOnClickListener(view1 -> dialog.dismiss()); close.setOnClickListener(view1 -> dialog.dismiss());
}); });
holder.start_scan.setOnClickListener(view -> { holder.start_scan.setOnClickListener(view -> {
if(TextUtils.isEmpty(holder.rack_no.getText().toString())){ if (TextUtils.isEmpty(holder.rack_no.getText().toString())) {
Constants.getToast(context,"Please Enter Rack No"); Constants.getToast(context,"Please Enter Rack No");
}else{ } else {
if(holder.rack_no.getText().toString().length()<= 3) { if (holder.rack_no.getText().toString().length()<= 4) {
PlanDetails.start(context, items, holder.rack_no.getText().toString()); PlanDetails.start(context, items, holder.rack_no.getText().toString());
}else{ } else {
Constants.getToast(context,"Enter Valid Rack No"); Constants.getToast(context,"Enter Valid Rack No");
holder.rack_no.setText(""); holder.rack_no.setText("");
holder.rack_no.requestFocus(); holder.rack_no.requestFocus();
} }
} }
}); });
} }
@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 plan_id,plan_name; public TextView plan_id,plan_name;
Button start_scan,view_section; Button start_scan,view_section;
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
...@@ -7,7 +7,6 @@ import android.util.Log; ...@@ -7,7 +7,6 @@ import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.webkit.WebStorage;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -20,38 +19,37 @@ import com.squareup.okhttp.Response; ...@@ -20,38 +19,37 @@ 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.nio.file.FileSystemAlreadyExistsException;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
*/ */
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);
setContentView(R.layout.activity_dashboard); setContentView(R.layout.activity_dashboard);
stock_audit = findViewById(R.id.stock_audit); stock_audit = findViewById(R.id.stock_audit);
rack_qty = findViewById(R.id.rack_qty); rack_qty = findViewById(R.id.rack_qty);
searchBy_Barcode = findViewById(R.id.searchby_barcode); searchBy_Barcode = findViewById(R.id.searchby_barcode);
dashboard_toolbar = findViewById(R.id.dashboard_toolbar); dashboard_toolbar = findViewById(R.id.dashboard_toolbar);
version = findViewById(R.id.version); version = findViewById(R.id.version);
transfer = findViewById(R.id.transfer); transfer = findViewById(R.id.transfer);
preferenceManager = new PreferenceManager(this); preferenceManager = new PreferenceManager(this);
setSupportActionBar(dashboard_toolbar); setSupportActionBar(dashboard_toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.dashboard)); getSupportActionBar().setTitle(getResources().getString(R.string.dashboard));
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
stock_audit .setOnClickListener(this); stock_audit .setOnClickListener(this);
rack_qty .setOnClickListener(this); rack_qty .setOnClickListener(this);
searchBy_Barcode.setOnClickListener(this); searchBy_Barcode .setOnClickListener(this);
transfer .setOnClickListener(this); transfer .setOnClickListener(this);
version .setText(Html.fromHtml(Constants.Ver_Text +Constants.VERSION)); version .setText(Html.fromHtml(Constants.Ver_Text +Constants.VERSION));
} }
@Override @Override
...@@ -62,18 +60,18 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick ...@@ -62,18 +60,18 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
@Override @Override
public boolean onOptionsItemSelected(@NonNull MenuItem item){ public boolean onOptionsItemSelected(@NonNull MenuItem item){
switch(item.getItemId()){ switch(item.getItemId()){
case R.id.dashboard_logout: case R.id.dashboard_logout:
if(Constants.isNetworkAvailable(DashBoardActivity.this)){ if(Constants.isNetworkAvailable(DashBoardActivity.this)){
Logout(Constants.Logout+preferenceManager.getUserId()); Logout(Constants.Logout+preferenceManager.getUserId());
Constants.ProgressDialogShow(DashBoardActivity.this); Constants.ProgressDialogShow(DashBoardActivity.this);
}else{ }else{
Constants.getToast(DashBoardActivity.this,getResources().getString(R.string.connection)); Constants.getToast(DashBoardActivity.this,getResources().getString(R.string.connection));
} }
break; break;
case android.R.id.home: case android.R.id.home:
finish(); finish();
break; break;
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
...@@ -83,14 +81,14 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick ...@@ -83,14 +81,14 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
client.setConnectTimeout(240, TimeUnit.SECONDS); client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240,TimeUnit.SECONDS); client.setReadTimeout(240,TimeUnit.SECONDS);
client.setWriteTimeout(240,TimeUnit.SECONDS); client.setWriteTimeout(240,TimeUnit.SECONDS);
final Request request = new Request.Builder() final Request request = new Request.Builder()
.url(Url) .url(Url)
.get() .get()
.addHeader("Content-Type", "application/json") .addHeader("Content-Type", "application/json")
.build(); .build();
client.newCall(request).enqueue(new Callback(){ client.newCall(request).enqueue(new Callback(){
@Override @Override
public void onFailure(Request request, IOException e){ public void onFailure (Request request, IOException e){
Constants.ProgressDialogDismiss(); Constants.ProgressDialogDismiss();
} }
@Override @Override
...@@ -100,18 +98,18 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick ...@@ -100,18 +98,18 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
String res = response.body().string(); String res = response.body().string();
Log.e("Dashboard Logout ", res); Log.e("Dashboard Logout ", res);
try{ try{
JSONObject jsonObject = new JSONObject(res); JSONObject jsonObject = new JSONObject(res);
if(jsonObject.has("success")){ if(jsonObject.has("success")){
if(jsonObject.getInt("success") == 1){ if(jsonObject.getInt("success") == 1){
preferenceManager.setUserId(""); preferenceManager.setUserId("");
preferenceManager.setLogged(false); preferenceManager.setLogged(false);
preferenceManager.setCustToken(""); preferenceManager.setCustToken("");
preferenceManager.setStoreId(""); preferenceManager.setStoreId("");
Login.Logout(DashBoardActivity.this); Login.Logout(DashBoardActivity.this);
}else{ }else{
Constants.getToast(DashBoardActivity.this,jsonObject.getString("msg")); Constants.getToast(DashBoardActivity.this,jsonObject.getString("msg"));
} }
} }
}catch(JSONException e){ }catch(JSONException e){
e.printStackTrace(); e.printStackTrace();
}catch (NullPointerException np){ }catch (NullPointerException np){
...@@ -126,11 +124,11 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick ...@@ -126,11 +124,11 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
public void onClick(View view){ public void onClick(View view){
switch(view.getId()){ switch(view.getId()){
case R.id.stock_audit: case R.id.stock_audit:
Intent in_main = new Intent(this,MainActivity.class); Intent in_main = new Intent(this, MainActivity.class);
startActivity(in_main); startActivity(in_main);
break; break;
case R.id.rack_qty: case R.id.rack_qty:
Intent in_rack = new Intent(this,RackWiseQty.class); Intent in_rack = new Intent(this, RackWiseQty.class);
startActivity(in_rack); startActivity(in_rack);
break; break;
case R.id.searchby_barcode: case R.id.searchby_barcode:
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
*/ */
public interface DataInterface {
public interface DataInterface {
void onDeliveryData(int code, String data, String Id); void onDeliveryData(int code, String data, String Id);
void onDeliveryFail(String fail); void onDeliveryFail(String fail);
void onDeliveryDataRemove(int code, String data); void onDeliveryDataRemove(int code, String data);
void onDeliveryFailRemove(String fail); void onDeliveryFailRemove(String fail);
void onLogoutData(int code, String data); void onLogoutData(int code, String data);
void onLogoutFail(String fail); void onLogoutFail(String fail);
void onFinalData(int code, String finaldata); void onFinalData(int code, String data);
void onFinalFail(String finalfail); void onFinalFail(String fail);
void onCustomerName(int code,String name); void onCustomerName(int code,String name);
void onCustomerNameFail(String fail); void onCustomerNameFail(String fail);
} }
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.Manifest; import android.Manifest;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
...@@ -31,12 +31,15 @@ import java.io.IOException; ...@@ -31,12 +31,15 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static w.soulofpluto.posstockaudit.Constants.Logout; import static w.soulofpluto.posstockauditrecieving.Constants.Logout;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
*/ */
//1111
//180685gk
public class HomeActivity extends AppCompatActivity { public class HomeActivity extends AppCompatActivity {
Toolbar home_toolbar; Toolbar home_toolbar;
static PreferenceManager preferenceManager; static PreferenceManager preferenceManager;
...@@ -207,7 +210,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout; ...@@ -207,7 +210,7 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
preferenceManager.setLogged(false); preferenceManager.setLogged(false);
preferenceManager.setCustToken(""); preferenceManager.setCustToken("");
preferenceManager.setStoreId(""); preferenceManager.setStoreId("");
preferenceManager.setBLUETOOTH(""); //preferenceManager.setBLUETOOTH("");
Login.Logout(HomeActivity.this); Login.Logout(HomeActivity.this);
} else { } else {
Constants.getToast(HomeActivity.this, jsonObject.getString("msg")); Constants.getToast(HomeActivity.this, jsonObject.getString("msg"));
...@@ -239,5 +242,4 @@ import static w.soulofpluto.posstockaudit.Constants.Logout; ...@@ -239,5 +242,4 @@ import static w.soulofpluto.posstockaudit.Constants.Logout;
.show(); .show();
} }
} }
} }
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
...@@ -31,14 +31,13 @@ import java.io.IOException; ...@@ -31,14 +31,13 @@ import java.io.IOException;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static w.soulofpluto.posstockaudit.Constants.JSON; import static w.soulofpluto.posstockauditrecieving.Constants.JSON;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
*/ */
public class Login extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener{ public class Login extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener{
private EditText userId, password; private EditText userId, password;
private Spinner storeId; private Spinner storeId;
private Button submit; private Button submit;
...@@ -49,7 +48,6 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad ...@@ -49,7 +48,6 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
private String Store_Name; private String Store_Name;
public static void Logout(Context context){ public static void Logout(Context 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);
...@@ -73,9 +71,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad ...@@ -73,9 +71,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
}else{ }else{
if(Constants.isNetworkAvailable(Login.this)){ if(Constants.isNetworkAvailable(Login.this)){
if(userId.getText().toString().length() > 3){ if(userId.getText().toString().length() > 3){
StoreId(userId.getText().toString()); StoreId(userId.getText().toString());
Constants.ProgressDialogShow(Login.this); Constants.ProgressDialogShow(Login.this);
} }
}else{ }else{
Constants.getToast(Login.this, getResources().getString(R.string.connection)); Constants.getToast(Login.this, getResources().getString(R.string.connection));
} }
...@@ -94,8 +92,8 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad ...@@ -94,8 +92,8 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
@Override @Override
public void onFailure(Request request, final IOException e){ public void onFailure(Request request, final IOException e){
runOnUiThread(() -> { runOnUiThread(() -> {
Toast.makeText(Login.this, e.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(Login.this, e.getMessage(), Toast.LENGTH_SHORT).show();
Constants.ProgressDialogDismiss(); Constants.ProgressDialogDismiss();
}); });
} }
@Override @Override
...@@ -108,20 +106,20 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad ...@@ -108,20 +106,20 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
handler.post(() -> { handler.post(() -> {
try{ try{
if(response.code() == 200){ if(response.code() == 200){
JSONObject object = new JSONObject(Response); JSONObject object = new JSONObject(Response);
stores = new ArrayList<>(); stores = new ArrayList<>();
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){
if(object.has(getResources().getString(R.string.data))){ if(object.has(getResources().getString(R.string.data))){
JSONArray jsonArray = object.getJSONArray(getResources().getString(R.string.data)); JSONArray jsonArray = object.getJSONArray(getResources().getString(R.string.data));
if(jsonArray.length() > 0){ 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);
Store store = new Store(); Store store = new Store();
store.setStoreId(jsonObject.getInt(getResources().getString(R.string.id))); store.setStoreId(jsonObject.getInt(getResources().getString(R.string.id)));
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<>(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);
} }
...@@ -199,9 +197,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad ...@@ -199,9 +197,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
Constants.ProgressDialogDismiss(); Constants.ProgressDialogDismiss();
if(e.getCause() != null && e.getCause() instanceof UnknownHostException){ if(e.getCause() != null && e.getCause() instanceof UnknownHostException){
}else{ }else{
runOnUiThread(() -> Constants.getToast(Login.this,e.getMessage())); runOnUiThread(() -> Constants.getToast(Login.this,e.getMessage()));
} }
}//7842734567 }
@Override @Override
public void onResponse(final Response response) throws IOException{ public void onResponse(final Response response) throws IOException{
Constants.ProgressDialogDismiss(); Constants.ProgressDialogDismiss();
...@@ -240,9 +238,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad ...@@ -240,9 +238,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
}); });
}catch(NullPointerException io){ }catch(NullPointerException io){
io.printStackTrace(); io.printStackTrace();
}finally{ }finally{
response.body().close(); response.body().close();
} }
} }
}); });
} }
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.app.ActivityManager;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
...@@ -30,8 +29,8 @@ import java.util.ArrayList; ...@@ -30,8 +29,8 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static w.soulofpluto.posstockaudit.Constants.JSON; import static w.soulofpluto.posstockauditrecieving.Constants.JSON;
import static w.soulofpluto.posstockaudit.Constants.getDateWithOffset; import static w.soulofpluto.posstockauditrecieving.Constants.getDateWithOffset;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
Toolbar main_toolbar; Toolbar main_toolbar;
...@@ -54,11 +53,11 @@ public class MainActivity extends AppCompatActivity { ...@@ -54,11 +53,11 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
protected void onStart() { protected void onStart() {
if (Constants.isNetworkAvailable(MainActivity.this)) { if(Constants.isNetworkAvailable(MainActivity.this)) {
AppUtils.deleteCache(MainActivity.this); AppUtils.deleteCache(MainActivity.this);
FetchData(Constants.Dashboard); FetchData(Constants.Dashboard);
Constants.ProgressDialogShow(MainActivity.this); Constants.ProgressDialogShow(MainActivity.this);
} else { }else {
Constants.getToast(MainActivity.this, getResources().getString(R.string.connection)); Constants.getToast(MainActivity.this, getResources().getString(R.string.connection));
} }
super.onStart(); super.onStart();
...@@ -127,7 +126,6 @@ public class MainActivity extends AppCompatActivity { ...@@ -127,7 +126,6 @@ public class MainActivity extends AppCompatActivity {
break; break;
case R.id.dashboard_logout: case R.id.dashboard_logout:
if (Constants.isNetworkAvailable(MainActivity.this)) { if (Constants.isNetworkAvailable(MainActivity.this)) {
Logout(Constants.Logout + preferenceManager.getUserId()); Logout(Constants.Logout + preferenceManager.getUserId());
Constants.ProgressDialogShow(MainActivity.this); Constants.ProgressDialogShow(MainActivity.this);
} else { } else {
...@@ -146,7 +144,9 @@ public class MainActivity extends AppCompatActivity { ...@@ -146,7 +144,9 @@ public class MainActivity extends AppCompatActivity {
Date todayDate = new Date(); Date todayDate = new Date();
Date from = getDateWithOffset(-Constants.Value, new Date()); Date from = getDateWithOffset(-Constants.Value, new Date());
String fromDate = currentDate.format(from); String fromDate = currentDate.format(from);
Log.e("From Date", fromDate);
String thisDate = currentDate.format(todayDate); String thisDate = currentDate.format(todayDate);
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);
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -20,11 +19,13 @@ public class PlanDetailsAdapter extends RecyclerView.Adapter<PlanDetailsAdapter. ...@@ -20,11 +19,13 @@ public class PlanDetailsAdapter extends RecyclerView.Adapter<PlanDetailsAdapter.
private Context context; private Context context;
private ArrayList<Plans> arrayList; private ArrayList<Plans> arrayList;
PreferenceManager preferenceManager; PreferenceManager preferenceManager;
public PlanDetailsAdapter(Context context, ArrayList<Plans> storesArrayList){ public PlanDetailsAdapter(Context context, ArrayList<Plans> storesArrayList){
this.context = context; this.context = context;
this.arrayList = storesArrayList; this.arrayList = storesArrayList;
preferenceManager = new PreferenceManager(context); preferenceManager = new PreferenceManager(context);
} }
@NonNull @NonNull
@Override @Override
public PlanDetailsAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){ public PlanDetailsAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
...@@ -33,41 +34,38 @@ public class PlanDetailsAdapter extends RecyclerView.Adapter<PlanDetailsAdapter. ...@@ -33,41 +34,38 @@ public class PlanDetailsAdapter extends RecyclerView.Adapter<PlanDetailsAdapter.
PlanDetailsAdapter.ViewHolder viewHolder = new PlanDetailsAdapter.ViewHolder(listItem); PlanDetailsAdapter.ViewHolder viewHolder = new PlanDetailsAdapter.ViewHolder(listItem);
return viewHolder; return viewHolder;
} }
@Override @Override
public void onBindViewHolder(@NonNull PlanDetailsAdapter.ViewHolder holder, final int position){ public void onBindViewHolder(@NonNull PlanDetailsAdapter.ViewHolder holder, final int position){
final Plans items = arrayList.get(position); final Plans items = arrayList.get(position);
holder.plandetails_barcode.setText(items.getBarcode()); holder.planDetails_barcode . setText(items.getBarcode());
holder.plandetails_qty .setText(items.getQty()); holder.planDetails_qty . setText(items.getQty());
/*if(preferenceManager.getUserId().equalsIgnoreCase("20009") || preferenceManager.getUserId().equalsIgnoreCase("8057")){ holder.planDetails_delete . setOnClickListener(view -> {
holder.plandetails_delete.setVisibility(View.VISIBLE); try{
}else{ if(Constants.isNetworkAvailable(context)){
holder.plandetails_delete.setVisibility(View.INVISIBLE); ((PlanDetails) context).DeleteBarcode(items,position);
}*/ }else{
Log.e("PlanDetails", items.getPlanId()); ((Activity)context).runOnUiThread(() -> Constants.getToast(context,context.getResources().getString(R.string.connection)));
holder.plandetails_delete .setOnClickListener(view -> { }
try{ }catch(NullPointerException np){
if(Constants.isNetworkAvailable(context)){ np.printStackTrace();
((PlanDetails) context).DeleteBarcode(items,position); }
}else{
((Activity)context).runOnUiThread(() -> Constants.getToast(context,context.getResources().getString(R.string.connection)));
}
}catch(NullPointerException np){
np.printStackTrace();
}
}); });
} }
@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 plandetails_barcode, plandetails_qty; public TextView planDetails_barcode, planDetails_qty;
ImageView plandetails_delete; ImageView planDetails_delete;
public ViewHolder(View itemView){ public ViewHolder(View itemView){
super(itemView); super(itemView);
plandetails_barcode = itemView.findViewById(R.id.plandetails_barcode); planDetails_barcode = itemView.findViewById(R.id.plandetails_barcode);
plandetails_qty = itemView.findViewById(R.id.plandetails_qty); planDetails_qty = itemView.findViewById(R.id.plandetails_qty);
plandetails_delete = itemView.findViewById(R.id.plandetails_delete); planDetails_delete = itemView.findViewById(R.id.plandetails_delete);
} }
} }
} }
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
/* /*
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
...@@ -31,49 +31,90 @@ public class PreferenceManager { ...@@ -31,49 +31,90 @@ public class PreferenceManager {
public PreferenceManager(Context context){ public PreferenceManager(Context context){
_sharedPrefs = context.getSharedPreferences(APP_SHARED_PREFS, Activity.MODE_PRIVATE); _sharedPrefs = context.getSharedPreferences(APP_SHARED_PREFS, Activity.MODE_PRIVATE);
_prefsEditor = _sharedPrefs.edit(); _prefsEditor = _sharedPrefs.edit();
// --Commented out by Inspection START (9/25/2023 10:39 AM):
// public static PreferenceManager getInstance(){
// return (PreferenceManager) _sharedPrefs;
// }
// --Commented out by Inspection START (9/25/2023 10:39 AM):
//// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
//// --Commented out by Inspection START (9/25/2023 10:39 AM):
//// public void delete(){
//// --Commented out by Inspection START (9/25/2023 10:39 AM):
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
//// _prefsEditor.remove(KEY_USER_ID);
// --Commented out by Inspection START (9/25/2023 10:39 AM):
////// _prefsEditor.apply();
////// }
// --Commented out by Inspection START (9/25/2023 10:39 AM):
//////// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
////// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
//// public void setKeyUserLogin(String userLogin){
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
//_prefsEditor.putString(KEY_USER_LOGIN,userLogin);
//_prefsEditor.apply();
} }
public static PreferenceManager getInstance(){
return (PreferenceManager) _sharedPrefs;
}
public void delete(){
_prefsEditor.remove(KEY_USER_ID);
_prefsEditor.apply();
}
public void setKeyUserLogin(String userLogin){ public void setKeyUserLogin(String userLogin){
_prefsEditor.putString(KEY_USER_LOGIN,userLogin); _prefsEditor.putString(KEY_USER_LOGIN,userLogin);
_prefsEditor.apply(); _prefsEditor.apply();
} }
public String getKeyUserLogin(){ public String getKeyUserLogin(){
// --Commented out by Inspection START (9/25/2023 10:39 AM):
// --Commented out by Inspection START (9/25/2023 10:39 AM):
//// return _sharedPrefs.getString(KEY_USER_LOGIN,"");
//// }
////// --Commented out by Inspection START (9/25/2023 10:39 AM):
//// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
// public void setFirstName(String firstName){
// _prefsEditor.putString(FIRST_NAME,firstName);
// _prefsEditor.apply();
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
return _sharedPrefs.getString(KEY_USER_LOGIN,""); return _sharedPrefs.getString(KEY_USER_LOGIN,"");
} }
public void setFirstName(String firstName){
_prefsEditor.putString(FIRST_NAME,firstName);
_prefsEditor.apply();
}
public String getFirstName(){ public String getFirstName(){
return _sharedPrefs.getString(FIRST_NAME,""); return _sharedPrefs.getString(FIRST_NAME,"");
} }
public void setModule(String Mod){ public void setModule(String Mod) {
_prefsEditor.putString(MODULE,Mod);
_prefsEditor.putString(MODULE, Mod);
_prefsEditor.apply(); _prefsEditor.apply();
} }
public String getModule(){ public String getModule(){
// --Commented out by Inspection START (9/25/2023 10:39 AM):
// _prefsEditor.putString(MODULE,Mod);
// _prefsEditor.apply();
// }
// public String getModule(){
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
return _sharedPrefs.getString(MODULE,""); return _sharedPrefs.getString(MODULE,"");
} public void setBLUETOOTH(String Mod){ // --Commented out by Inspection START (9/25/2023 10:39 AM):
_prefsEditor.putString(BLUETOOTH,Mod); //// --Commented out by Inspection START (9/25/2023 10:39 AM):
_prefsEditor.apply(); //// } public void setBLUETOOTH(String Mod){
// --Commented out by Inspection START (9/25/2023 10:39 AM):
////// _prefsEditor.putString(BLUETOOTH,Mod);
//// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
//// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
//_prefsEditor.apply();
} }
public String getBLUETOOTH(){ public String getBLUETOOTH(){
return _sharedPrefs.getString(BLUETOOTH,""); return _sharedPrefs.getString(BLUETOOTH,"");
} }
public void setLastName(String lastName){ public void setLastName(String lastName){
_prefsEditor.putString(LAST_NAME,lastName); // --Commented out by Inspection START (9/25/2023 10:39 AM):
_prefsEditor.apply(); // _prefsEditor.putString(LAST_NAME,lastName);
} // _prefsEditor.apply();
public String getLastName(){ // }
return _sharedPrefs.getString(LAST_NAME,""); // public String getLastName(){
// return _sharedPrefs.getString(LAST_NAME,"");
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
} }
public void setStoreId(String quoteId){ public void setStoreId(String quoteId){
_prefsEditor.putString(STORE_ID,quoteId); _prefsEditor.putString(STORE_ID,quoteId);
...@@ -82,14 +123,23 @@ public class PreferenceManager { ...@@ -82,14 +123,23 @@ public class PreferenceManager {
public String getStoreId(){ public String getStoreId(){
return _sharedPrefs.getString(STORE_ID,""); return _sharedPrefs.getString(STORE_ID,"");
} }
public void setPrefix(String prefix){ public void setPrefix(String prefix) {
_prefsEditor.putString(PREFIX,prefix); _prefsEditor.putString(PREFIX, prefix);
_prefsEditor.apply(); _prefsEditor.apply();
} }
public String getPrefix(){ // --Commented out by Inspection START (9/25/2023 10:39 AM):
return _sharedPrefs.getString(PREFIX,""); // _prefsEditor.apply();
} // }
public void setCustToken(String token){ // --Commented out by Inspection START (9/25/2023 10:39 AM):
//// public String getPrefix(){
////// --Commented out by Inspection START (9/25/2023 10:39 AM):
//// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
// return _sharedPrefs.getString(PREFIX,"");
// }
// public void setCustToken(String token){
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
public void setCustToken(String token){
_prefsEditor.putString(CUST_TOKEN,token); _prefsEditor.putString(CUST_TOKEN,token);
_prefsEditor.apply(); _prefsEditor.apply();
} }
...@@ -97,11 +147,13 @@ public class PreferenceManager { ...@@ -97,11 +147,13 @@ public class PreferenceManager {
return _sharedPrefs.getString(CUST_TOKEN,""); return _sharedPrefs.getString(CUST_TOKEN,"");
} }
public void setID(String id){ public void setID(String id){
_prefsEditor.putString(ID, id); // --Commented out by Inspection START (9/25/2023 10:39 AM):
_prefsEditor.apply(); // _prefsEditor.putString(ID, id);
} // _prefsEditor.apply();
public String getID(){ // }
return _sharedPrefs.getString(ID, ""); // public String getID(){
// return _sharedPrefs.getString(ID, "");
// --Commented out by Inspection STOP (9/25/2023 10:39 AM)
} }
public void setEmail(String email){ public void setEmail(String email){
_prefsEditor.putString(KEY_EMAIL, email); _prefsEditor.putString(KEY_EMAIL, email);
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
...@@ -8,8 +8,8 @@ package w.soulofpluto.posstockaudit; ...@@ -8,8 +8,8 @@ package w.soulofpluto.posstockaudit;
import java.util.Comparator; import java.util.Comparator;
public class RackWise { public class RackWise {
int id; int id;
int Qty; int Qty;
String scanned_by; String scanned_by;
String scanning_start_at; String scanning_start_at;
String scanning_end_at; String scanning_end_at;
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.content.Context; import android.content.Context;
import android.text.Html; import android.text.Html;
...@@ -22,44 +22,57 @@ public class RackWiseAdapter extends RecyclerView.Adapter<RackWiseAdapter.ViewHo ...@@ -22,44 +22,57 @@ public class RackWiseAdapter extends RecyclerView.Adapter<RackWiseAdapter.ViewHo
this.context = context; this.context = context;
this.arrayList = storesArrayList; this.arrayList = storesArrayList;
} }
@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);
return viewHolder; return viewHolder;
} }
@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(""); holder.rack_id.setText ("");
}else {
holder.rack_id.setText (Html.fromHtml(Constants.Id + items.getId()));
}
if(items.getScanned_by().equalsIgnoreCase("null")){
holder.rack_UserId.setText(Html.fromHtml(Constants.User +"0"));
}else{ }else{
holder.rack_id.setText(Html.fromHtml(Constants.Id + items.getId())); holder.rack_UserId.setText(Html.fromHtml(Constants.User + items.getScanned_by()));
}
if(items.getScanning_start_at().equalsIgnoreCase("null")){
holder.rack_from.setText(Html.fromHtml(Constants.From + "0:00"));
}else {
holder.rack_from.setText(Html.fromHtml(Constants.From + items.getScanning_start_at()));
} }
holder.rack_UserId.setText(Html.fromHtml(Constants.User + items.getScanned_by())); if(items.getScanning_end_at().equalsIgnoreCase("null")){
holder.rack_from.setText(Html.fromHtml(Constants.From + items.getScanning_start_at())); holder.rack_to.setText(Html.fromHtml(Constants.To+"0:00"));
holder.rack_to.setText(Html.fromHtml(Constants.To + items.getScanning_end_at())); }else {
holder.rack_qty.setText(String.valueOf(items.getQty())); holder.rack_to.setText(Html.fromHtml(Constants.To + items.getScanning_end_at()));
}
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_UserId,rack_from,rack_to; public TextView rack_id,rack_qty,rack_UserId,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_UserId = itemView.findViewById(R.id.rack_userid); rack_UserId = 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);
} }
} }
} }
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
...@@ -16,12 +15,10 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics; ...@@ -16,12 +15,10 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics;
public class SplashActivity extends AppCompatActivity{ public class SplashActivity extends AppCompatActivity{
PreferenceManager preferenceManager; PreferenceManager preferenceManager;
//BluetoothAdapter bluetoothAdapter;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState){ protected void onCreate(@Nullable Bundle savedInstanceState){
setContentView(R.layout.activity_splash); setContentView(R.layout.activity_splash);
preferenceManager = new PreferenceManager(this); preferenceManager = new PreferenceManager(this);
//bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
FirebaseApp.initializeApp(this); FirebaseApp.initializeApp(this);
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true); FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
runOnUiThread(() -> splashMethod()); runOnUiThread(() -> splashMethod());
...@@ -31,13 +28,13 @@ public class SplashActivity extends AppCompatActivity{ ...@@ -31,13 +28,13 @@ public class SplashActivity extends AppCompatActivity{
public void splashMethod(){ public void splashMethod(){
Handler handler = new Handler(); Handler handler = new Handler();
Runnable runnable = () -> { Runnable runnable = () -> {
if(preferenceManager.isLogged()){ if(preferenceManager.isLogged()){
startActivity(new Intent(SplashActivity.this, HomeActivity.class)); startActivity(new Intent(SplashActivity.this, HomeActivity.class));
finish(); finish();
}else{ }else{
startActivity(new Intent(SplashActivity.this, Login.class)); startActivity(new Intent(SplashActivity.this, Login.class));
finish(); finish();
} }
}; };
handler.postDelayed(runnable, 2500); handler.postDelayed(runnable, 2500);
} }
......
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
/* /*
Create by Ramesh Babu Create by Ramesh Babu
*/ */
public class Store {
public class Store {
int StoreId; int StoreId;
String StoreName; String StoreName;
...@@ -27,5 +27,4 @@ public class Store { ...@@ -27,5 +27,4 @@ public class Store {
public String toString() { public String toString() {
return StoreName; return StoreName;
} }
}
}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</androidx.appcompat.widget.Toolbar> </androidx.appcompat.widget.Toolbar>
<!-- <EditText <!--<EditText
android:layout_below="@+id/main_toolbar" android:layout_below="@+id/main_toolbar"
android:id="@+id/barcode" android:id="@+id/barcode"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
android:layout_below="@+id/main_toolbar" android:layout_below="@+id/main_toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/plans_List" android:id="@+id/plans_List"/>
/>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -52,7 +52,13 @@ ...@@ -52,7 +52,13 @@
android:text="QTY" android:text="QTY"
style="@style/textfont" style="@style/textfont"
android:textColor="@color/colorPrimaryDark" android:textColor="@color/colorPrimaryDark"
android:gravity="center"/> android:gravity="right"
android:layout_marginRight="10dp"/>
<!--<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1"/>-->
</LinearLayout> </LinearLayout>
......
...@@ -56,7 +56,9 @@ ...@@ -56,7 +56,9 @@
android:layout_margin="5dp" android:layout_margin="5dp"
style="@style/textfont" style="@style/textfont"
android:layout_weight="0.3" android:layout_weight="0.3"
android:gravity="right"
android:layout_gravity="center"/> android:layout_gravity="center"/>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
\ No newline at end of file
<resources> <resources>
<string name="app_name">Pos Stock Audit</string> <string name="app_name">Pos Stock Receive And Transfer </string>
<string name="success" translatable="false">success</string> <string name="success" translatable="false">success</string>
<string name="msg" translatable="false">msg</string> <string name="msg" translatable="false">msg</string>
<string name="data" translatable="false">data</string> <string name="data" translatable="false">data</string>
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
<string name="lang_thai">THAI</string> <string name="lang_thai">THAI</string>
<string name="lang_southasia">SOUTH ASIA</string> <string name="lang_southasia">SOUTH ASIA</string>
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<string name="handlingmsg_warn_receipt_near_end">Roll paper is nearly end.\n</string> <string name="handlingmsg_warn_receipt_near_end">Roll paper is nearly end.\n</string>
<string name="handlingmsg_warn_battery_near_end">Battery level of printer is low.\n</string> <string name="handlingmsg_warn_battery_near_end">Battery level of printer is low.\n</string>
<string name="handlingmsg_err_no_response">Please check the connection of the printer and the mobile terminal.\nConnection get lost.\n</string> <string name="handlingmsg_err_no_response">Please check the connection of the printer and the mobile terminal.\nConnection get lost.\n</string>
...@@ -175,4 +176,5 @@ ...@@ -175,4 +176,5 @@
<string name="handlingmsg_err_wrong_paper">Please set correct roll paper.\n</string> <string name="handlingmsg_err_wrong_paper">Please set correct roll paper.\n</string>
<string name="handlingmsg_err_battery_real_end">Please connect AC adapter or change the battery.\nBattery of printer is almost empty.\n</string> <string name="handlingmsg_err_battery_real_end">Please connect AC adapter or change the battery.\nBattery of printer is almost empty.\n</string>
<string name="handlingmsg_err_offline">Printer is offline.\n</string> <string name="handlingmsg_err_offline">Printer is offline.\n</string>
</resources> </resources>
\ No newline at end of file
package w.soulofpluto.posstockaudit; package w.soulofpluto.posstockauditrecieving;
import org.junit.Test; import org.junit.Test;
......
...@@ -5,7 +5,7 @@ buildscript { ...@@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath "com.android.tools.build:gradle:4.0.1" classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
......
#Wed Jan 27 12:34:28 IST 2021
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
...@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=. ...@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS= set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
...@@ -35,7 +54,7 @@ goto fail ...@@ -35,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
...@@ -45,28 +64,14 @@ echo location of your Java installation. ...@@ -45,28 +64,14 @@ echo location of your Java installation.
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
......
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