Commit 988f2930 by User

added stock transfer

parent 042d3c1a
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "w.soulofpluto.posstock"
minSdkVersion 17
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
......@@ -21,7 +21,6 @@ android {
shrinkResources false
zipAlignEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
......@@ -42,22 +41,17 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation platform('com.google.firebase:firebase-bom:28.4.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics:18.2.1'
implementation 'com.karumi:dexter:6.2.3'
implementation files('libs/ePOS2.jar')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
\ No newline at end of file
......@@ -14,22 +14,29 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_back"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_back_round"
android:icon="@drawable/icon"
android:supportsRtl="true"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme.NoActionBar"
android:networkSecurityConfig="@xml/network_security_config">
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="true" />
<activity
android:name=".StockTransferActivity"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".StockReceived"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".SplashActivity"
......@@ -46,60 +53,78 @@
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".HomeActivity"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".DiscoveryActivity"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".DashBoardActivity"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".MainActivity"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".PlanDetails"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity
android:name=".RackWiseQty"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".SearchByBarcode"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".CreateDeliverySlip"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".CreateSaleBill"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
<activity
android:name=".StockOutWordActivity"
android:windowSoftInputMode="adjustResize|stateHidden"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|screenSize">
</activity>
</application>
</manifest>
\ No newline at end of file
package w.soulofpluto.posstock;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import java.util.Map;
import okhttp3.RequestBody;
import okhttp3.Response;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HeaderMap;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
......@@ -14,21 +16,21 @@ import retrofit2.http.Path;
*/
public interface ApiService{
//String BASE_URL = "https://aeebe1.emporter.eu/pos_actions/";
//String Token = "41f34d7009db337f6213be52f7151108";
//String StoreId = "980";
/*@Headers({"Pos-Access-Token:" + Token,"Pos-User-Access-Store-Id:"+StoreId,
"Accept: application/json","Content-Type:multipart/form-data"})*/
/*@Multipart
/*String BASE_URL = "https://aeebe1.emporter.eu/pos_actions/";
String Token = "41f34d7009db337f6213be52f7151108";
String StoreId = "980";
@Headers({"Pos-Access-Token:" + Token,"Pos-User-Access-Store-Id:"+StoreId, "Accept: application/json","Content-Type:multipart/form-data"})
@Multipart
@POST("uploadBarcodeImages")
Call<ResponseBody> uploadMultiple(@Part("Pos-Access-Token") RequestBody token,
@Part("Pos-User-Access-Store-Id") RequestBody storeId,
@Part("barcode") RequestBody barcode,
@Part List<MultipartBody.Part> files);*/
@Part("Pos-User-Access-Store-Id") RequestBody storeId, @Part("barcode") RequestBody barcode, @Part List<MultipartBody.Part> files);*/
@Headers({"Content-type: application/json"})
@POST("/login/doLogin")
Call<Response> login(@Body RequestBody body);
Call<String> Login(@Body RequestBody body);
@POST("/Tfs/getInfoWithTfsNumber")
Call<Response> getInfoTfsNumber(@HeaderMap Map<String, String> headers, @Body RequestBody responseBody);
@GET("/login/getStoresMappedToUser/{id}")
Call<Response> getStoreId(@Path("id") String id);
......
......@@ -4,7 +4,8 @@ package w.soulofpluto.posstock;
Create by Ramesh Babu
*/
public class Barcode {
public class
Barcode {
String barcode, empId;
int qty;
public Barcode(String Barcode, int Qty, String empId){
......
package w.soulofpluto.posstock;
/*
Create by Ramesh Babu
*/
public class BoxInfo {
private String barcode;
private String uom;
private String transfer_qty;
private String receive_qty;
private String pending_qty;
private Boolean Status;
public BoxInfo(String barcode, String uom, String transfer_qty, String receive_qty, String pending_qty, Boolean status) {
this.barcode = barcode;
this.uom = uom;
this.transfer_qty = transfer_qty;
this.receive_qty = receive_qty;
this.pending_qty = pending_qty;
Status = status;
}
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public String getUom() {
return uom;
}
public void setUom(String uom) {
this.uom = uom;
}
public String getTransfer_qty() {
return transfer_qty;
}
public void setTransfer_qty(String transfer_qty) {
this.transfer_qty = transfer_qty;
}
public String getReceive_qty() {
return receive_qty;
}
public void setReceive_qty(String receive_qty) {
this.receive_qty = receive_qty;
}
public String getPending_qty() {
return pending_qty;
}
public void setPending_qty(String pending_qty) {
this.pending_qty = pending_qty;
}
public Boolean getStatus() {
return Status;
}
public void setStatus(Boolean status) {
Status = status;
}
}
......@@ -15,8 +15,6 @@ import com.squareup.okhttp.MediaType;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.security.MessageDigest;
import java.text.NumberFormat;
import java.util.ArrayList;
......@@ -27,27 +25,39 @@ import java.util.Locale;
/*
Create by Ramesh Babu
*/
public class Constants{
//public static String BASE_URL = "https://49588a.emporter.eu/";
//public static String BASE_URL = "https://30ad04.emporter.eu/";
public static String BASE_URL = "http://192.168.34.14/";
//20009 13022020
//public static String BASE_URL = "http://182.18.167.139/";
//public static String BASE_URL = "https://2bc746.emporter.eu/";
//public static String BASE_URL = "https://68c783.emporter.eu/";
//public static String BASE_URL = "https://e0ca19.emporter.eu/";
public static String BASE_URL = "https://6d70e4.emporter.eu/";
//public static String BASE_URL = "http://posapi.plutokm.com/";
//public static String BASE_URL = "https://7fad42.emporter.eu/";
public static String MenuBar = Constants.BASE_URL + "/Users/generateUserMenuBarLinksForAndroidApp";
public static String Logout = Constants.BASE_URL + "/login/doLogout/";
public static String Login = Constants.BASE_URL + "/login/doLogin";
public static String StoreId = Constants.BASE_URL + "login/getStoresMappedToUser/";
public static String Dashboard = Constants.BASE_URL + "/stockaudit/listOfStockAuditsOfLoginStore";
public static String BarcodeUpload = Constants.BASE_URL + "/stockaudit/validateStockAuditBarcode";
public static String BarcodeDelete = Constants.BASE_URL + "/stockaudit/deleteBarcodeAndQuantityFromStockAudit";
public static String BarcodeComplete = Constants.BASE_URL + "/stockaudit/batchScanningCompleted";
public static String RackWiseQty = Constants.BASE_URL + "/stockaudit/stockAuditPlanBarcodesScannedInformation";
public static String BarcodeSearch = Constants.BASE_URL + "/stockaudit/stockAuditBarcodeRackInformation";
public static String GenerateSlip = Constants.BASE_URL + "/Sales/generateDeliverySlip";
public static String MenuBar = BASE_URL + "/Users/generateUserMenuBarLinksForAndroidApp";
public static String Logout = BASE_URL + "/login/doLogout/";
public static String Login = BASE_URL + "/login/doLogin";
public static String StoreId = BASE_URL + "login/getStoresMappedToUser/";
public static String Dashboard = BASE_URL + "/stockaudit/listOfStockAuditsOfLoginStore";
public static String BarcodeUpload = BASE_URL + "/stockaudit/validateStockAuditBarcode";
public static String BarcodeDelete = BASE_URL + "/stockaudit/deleteBarcodeAndQuantityFromStockAudit";
public static String BarcodeComplete = BASE_URL + "/stockaudit/batchScanningCompleted";
public static String RackWiseQty = BASE_URL + "/stockaudit/stockAuditPlanBarcodesScannedInformation";
public static String BarcodeSearch = BASE_URL + "/stockaudit/stockAuditBarcodeRackInformation";
public static String GenerateSlip = BASE_URL + "/Sales/generateDeliverySlip";
public static String GetInfoWithTFS = BASE_URL + "Tfs/getInfoWithTfsNumber";
public static String GetTFSBoxNumbers = BASE_URL + "/Tfs/getTfsBoxesNumbers/";
public static String GetTFSBoxDetailsByBarcode = BASE_URL + "/Tfs/getTfsBoxDetailsBybarcode/";
public static String StockReceiving = BASE_URL + "Tfs/stockReceiving";
public static String ToState = BASE_URL + "Stores/getActiveStoreStates";
public static String ToFormat = BASE_URL + "Stores/getDistinctActiveStoreForamtsOfGivenState/";
public static String ToStoreFormat = BASE_URL + "Stores/getActiveStoresInGivenStoreAndFormat/";
public static String StockPointId = BASE_URL + "/stockpoint/getGivenStoreSaleStockPointId/";
public static String CheckBarcodeQty = BASE_URL + "Inventory/checkBarcodeQuantityInGivenStockPoint";
public static String StockTransfer = BASE_URL + "/Tfs/stockTransfer";
public static String Type = "Content-Type";
public static String App_json = "application/json";
public static String Access_Token = "Pos-Access-Token";
public static String Access_StoreId = "Pos-User-Access-Store-Id";
public static MediaType JSON = MediaType.parse("application/json; charset=utf-8");
public static String Sec = "<font color=#3700B3><b>SECTION : </b></font>";
public static String div = "<font color=#3700B3><b>DIVISION : </b></font>";
......@@ -58,11 +68,11 @@ public class Constants{
public static String To = "<font color=#3700B3><b>End time : </b></font>";
public static String Count = "<font color=#3700B3><b>TOTAL SCANNED ITEMS : </b></font>";
public static String Barcode = "<font color=#3700B3><b>Barcode : </b></font>";
public static String Ver_Text = "<font color=#3700B3><b>Version : </b></font>";
public static String Ver_Text = "<font color=#ee4d35><b>Version : </b></font>";
public static String Plan_Id = "<font color=#3700B3><b>PLAN ID : </b></font>";
public static String Name = "<font color=#3700B3><b>NAME : </b></font>";
public static String VERSION = "1.1";
public static int Value = 7 ;
public static int Value = 14 ;
public static final String dashed = "------------------------------------------------"+"\n";
public static ProgressDialog progressDialog;
public static StringBuilder stringBuilder;
......@@ -78,32 +88,41 @@ public class Constants{
}
public static String getTotalItems(String count){
return "<font color=#F31505><b>Total Items : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
return "<font color=#ee4d35><b>Items : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getTotalMRP(String count){
return "<font color=#F31505><b>Total MRP : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
return "<font color=#ee4d35><b>Total MRP &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getTotalDisc(String count){
return "<font color=#ee4d35><b> Disc &nbsp;&nbsp;&nbsp; : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getTotalNetPayable(String count){
return "<font color=#ee4d35><b>NetPayable : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getBarcode(String count){
return "<font color=#6A95A5A6><b>Barcode : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
return "<font color=#797979><b>Barcode : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getCode(String count){
return "<font color=#6A95A5A6><b>Disc Amt : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
return "<font color=#797979><b>Disc : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getMRP(String count){
return "<font color=#6A95A5A6><b>MRP &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
return "<font color=#797979><b>MRP &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getEmpId(String count){
return "<font color=#6A95A5A6><b>SM &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
return "<font color=#797979><b>SM &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
}
public static String getNetPayable(String count){
return "<font color=#6A95A5A6><b>NetPayable : </b></font>"+"<font color=#FE3004><b>"+count+"</b></font>";
return "<font color=#797979><b>NetPayable : </b></font>"+"<font color=#4caa4c><b>"+count+"</b></font>";
}
public static boolean isNetworkAvailable(Context context){
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
......@@ -114,7 +133,6 @@ public class Constants{
NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "in"));
String moneyString = formatter.format(Double.valueOf(amount));
return moneyString;
//return formatter.format(amount);
}
public static void ProgressDialogShow(Context context){
......@@ -137,6 +155,7 @@ public class Constants{
public static String PrintData1(String Id){
return "{" + '"' + "delivery_slip_id" + '"' + ":" + '"' + Id + '"' + "," + '"' + "manual_discount" + '"' + ":" + 0 + "}";
}
public static String getSHA256(String data){
StringBuffer sb = new StringBuffer();
try{
......@@ -174,33 +193,29 @@ public class Constants{
return false;
}
public static Boolean ExistingStockWord(ArrayList<StockBarcode> plans, String barcode){
for(StockBarcode plan : plans){
Log.e("barcode ===>>",plan.barcode);
Log.e("barode ====<>",barcode);
if(plan.getBarcode().contains(barcode)){
return true;
}
}
return false;
}
public static Date getDateWithOffset(int offset, Date date){
Calendar calendar = calendar = Calendar.getInstance();;
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, offset);
return calendar.getTime();
}
public static boolean isNetworkOnline(){
boolean isOnline = false;
try{
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec("ping -c 1 8.8.8.8");
int waitFor = p.waitFor();
isOnline = waitFor == 0;
Log.e("Constants",String.valueOf(isOnline));
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
return isOnline;
}
protected static void hideSoftKeyboard(EditText input,Context context){
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(input.getWindowToken(), 0);
}
public static String SL(String len){
if(len.length() == 3){
return len;
......@@ -211,6 +226,7 @@ public class Constants{
}
return null;
}
public static String Qty(String len){
if(len.length() == 3){
return len+" ";
......@@ -221,6 +237,7 @@ public class Constants{
}
return null;
}
public static String Barcode(String mrp){
if(mrp.length() == 11){
return mrp;
......@@ -247,6 +264,7 @@ public class Constants{
}
return null;
}
public static String Mrp(String mrp){
if(mrp.length() == 9){
return mrp;
......@@ -271,6 +289,7 @@ public class Constants{
}
return null;
}
public static String Dis(String dis){
if(dis.length() == 9){
return dis;
......@@ -293,6 +312,7 @@ public class Constants{
}
return null;
}
public static String Total(String mrp){
if(mrp.length() == 11){
return mrp;
......@@ -319,6 +339,7 @@ public class Constants{
}
return null;
}
public static String Taxable(String tax){
if(tax.length() == 13){
return tax;
......@@ -349,6 +370,7 @@ public class Constants{
}
return null;
}
public static String CGST(String dis){
if(dis.length() == 9){
return dis;
......@@ -371,6 +393,7 @@ public class Constants{
}
return null;
}
public static String SGST(String dis){
if(dis.length() == 7){
return dis+" ";
......@@ -389,6 +412,7 @@ public class Constants{
}
return null;
}
public static String IGST(String dis){
if(dis.length()== 8){
return dis;
......@@ -409,6 +433,7 @@ public class Constants{
}
return null;
}
public static String GST(String dis){
if(dis.length() == 7){
return dis;
......@@ -427,6 +452,7 @@ public class Constants{
}
return null;
}
public static String Gross(String dis){
if(dis.length() == 10){
return " "+dis;
......@@ -451,6 +477,7 @@ public class Constants{
}
return null;
}
public static String RecievedCashText(String dis){
if(dis.length() == 13){
return dis+" ";
......@@ -467,6 +494,7 @@ public class Constants{
}
return null;
}
public static String Deliveryslipnumber(String dev){
if(dev.length() == 16){
return dev+" ";
......@@ -483,6 +511,7 @@ public class Constants{
}
return null;
}
public static String DeliveryslipQty(String dev){
if(dev.length() == 7){
return dev+" ";
......@@ -501,6 +530,7 @@ public class Constants{
}
return null;
}
public static String DeliveryslipAmt(String dev){
if(dev.length() == 11){
return dev+" ";
......@@ -527,6 +557,7 @@ public class Constants{
}
return null;
}
public static String RecievedCash(String dis){
if(dis.length() == 10){
return " "+dis;
......@@ -551,6 +582,7 @@ public class Constants{
}
return null;
}
public static String TotalSavings(String dis){
if(dis.length() == 10){
return " "+dis;
......@@ -575,17 +607,16 @@ public class Constants{
}
return null;
}
public static String IndianRupeesformat(String amount){
NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "in"));
String moneyString = formatter.format(Double.valueOf(amount));
return moneyString;
//return formatter.format(amount);
}
public static void hideKeyboard(Activity activity){
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
//Find the currently focused view, so we can grab the correct window token from it.
View view = activity.getCurrentFocus();
//If no view currently has focus, create a new one, just so we can grab a window token from it
if(view == null){
view = new View(activity);
}
......@@ -593,12 +624,13 @@ public class Constants{
}
public static void hideSoftKeyBoardOnTabClicked(View v,Context context) {
if (v != null && context != null) {
if(v != null && context != null){
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
public static String formdata(String builder, String name, String phone){
public static String formData(String builder, String name, String phone){
stringBuilder = new StringBuilder();
stringBuilder.append("{"+'"'+"approval_emp_id"+'"'+":"+'"'+"1"+'"'+",");
stringBuilder.append('"'+"from_mobile"+'"'+":"+'"'+"yes"+'"'+",");
......@@ -625,7 +657,8 @@ public class Constants{
stringBuilder.append('"'+"otp"+'"'+":"+'"'+'"'+"}");
return stringBuilder.toString();
}
public static String formdata1(String builder, String name, String phone, JSONObject obj){
public static String formData1(String builder, String name, String phone, JSONObject obj){
stringBuilder = new StringBuilder();
stringBuilder.append("{"+'"'+"approval_emp_id"+'"'+":"+'"'+"1"+'"'+",");
stringBuilder.append('"'+"from_mobile"+'"'+":"+'"'+"yes"+'"'+",");
......@@ -652,4 +685,35 @@ public class Constants{
stringBuilder.append('"'+"otp"+'"'+":"+'"'+'"'+"}");
return stringBuilder.toString();
}
public static String JsonFormatData( String TFS, String Box, ArrayList<BoxInfo> arrayList, String Store_Id) throws JSONException {
JSONArray jsonArray = new JSONArray();
for(int i = 0 ; i<arrayList.size();i++){
BoxInfo boxInfo = arrayList.get(i);
JSONObject jsonObject = new JSONObject();
if(boxInfo.getStatus()) {
jsonObject.put("barcode", boxInfo.getBarcode());
jsonObject.put("box_id", Box);
jsonObject.put("pending_qty", boxInfo.getPending_qty());
jsonObject.put("quantity", boxInfo.getReceive_qty());
jsonObject.put("received_qty", boxInfo.getReceive_qty());
jsonObject.put("transfered_qty", boxInfo.getTransfer_qty());
jsonObject.put("uom", "units");
}else{
jsonObject.put("barcode", boxInfo.getBarcode());
jsonObject.put("box_id", Box);
jsonObject.put("pending_qty", boxInfo.getPending_qty());
jsonObject.put("quantity", "0.00");
jsonObject.put("received_qty", boxInfo.getReceive_qty());
jsonObject.put("transfered_qty", boxInfo.getTransfer_qty());
jsonObject.put("uom", "units");
}
jsonArray.put(jsonObject);
}
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("tfs_id",TFS);
jsonObject1.put("receiving_store_id",Store_Id);
jsonObject1.put("received_items",jsonArray);
return jsonObject1.toString();
}
}
......@@ -98,7 +98,7 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
private Boolean initial = false;
Menu globalMenuItem;
Dialog dialog;
JSONObject responseobj;
JSONObject responseObj;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
......@@ -122,17 +122,16 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
arrayList = new ArrayList<>();
list = new ArrayList<>();
versionList = new ArrayList<>();
empId.setText(preferenceManager.getUserId());
//empId.setText(preferenceManager.getUserId());
checkBox.setChecked(true);
barcode_enter.requestFocus();
empId.requestFocus();
barcode_enter.setOnEditorActionListener(this);
setItems();
Log.e("Access Token ====> ", preferenceManager.getCustToken());
valid_print.setOnClickListener(view -> {
if(preferenceManager.getBLUETOOTH().length()>0) {
if (list.size() > 0) {
//print = true;
if(list.size() > 0){
if (Constants.isNetworkAvailable(CreateDeliverySlip.this)) {
Constants.ProgressDialogShow(CreateDeliverySlip.this);
GenerateDeliverySlip("save", barcode_enter.getText().toString().trim(), "Y", false);
......@@ -147,7 +146,6 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
}
});
valid.setOnClickListener(view -> {
if (list.size() > 0) {
if (Constants.isNetworkAvailable(CreateDeliverySlip.this)) {
......@@ -170,17 +168,16 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
@Override
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
final CreateResponse.Datum deletedCourse = versionList.get(viewHolder.getAdapterPosition());
final int position = viewHolder.getAdapterPosition();
versionList.remove(viewHolder.getAdapterPosition());
deliverySlipAdapter.notifyItemRemoved(viewHolder.getAdapterPosition());
for (Barcode barcode : list) {
if (barcode.getBarcode().equalsIgnoreCase(deletedCourse.getBarcode())) {
for(Barcode barcode : list){
if(barcode.getBarcode().equalsIgnoreCase(deletedCourse.getBarcode())){
list.remove(barcode);
break;
}
}
if(list.size()<1){
header_items.setVisibility(View.GONE);
valid_print.setVisibility(View.GONE);
if(checkBox.isChecked()){
barcode_enter.requestFocus();
}else{
......@@ -188,10 +185,10 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
empId.requestFocus();
}
}
if (Constants.isNetworkAvailable(CreateDeliverySlip.this)) {
if(Constants.isNetworkAvailable(CreateDeliverySlip.this)) {
Constants.ProgressDialogShow(CreateDeliverySlip.this);
GenerateDeliverySlip("scan", "", "N",false);
} else {
}else{
Constants.getToast(CreateDeliverySlip.this, getResources().getString(R.string.connection));
}
}
......@@ -255,7 +252,7 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
final Request request = new Request.Builder()
.url(Url)
.get()
.addHeader("Content-Type", "application/json")
.addHeader(Constants.Type, Constants.App_json)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
......@@ -357,10 +354,10 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
} else if (status.getOnline() == Printer.FALSE) {
return false;
} else {
}
return true;
}
private boolean printData() {
if (mPrinter == null) {
return false;
......@@ -369,7 +366,7 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
return false;
}
PrinterStatusInfo status = mPrinter.getStatus();
dispPrinterWarnings(status);
disPrinterWarnings(status);
if (!isPrintable(status)) {
ShowMsg.showMsg(makeErrorMessage(status), CreateDeliverySlip.this);
try {
......@@ -392,6 +389,7 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
}
return true;
}
private void finalizeObject() {
if (mPrinter == null) {
return;
......@@ -401,26 +399,56 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
mPrinter = null;
}
void getPrint() {
String method = "";
StringBuilder textData = new StringBuilder();
try {
if (responseobj.has("data")) {
System.out.println("Response Data =============>" + responseobj);
JSONObject dataobj = responseobj.getJSONObject("data");
if (responseObj.has("data")) {
System.out.println("Response Data =============>" + responseObj);
JSONObject dataobj = responseObj.getJSONObject("data");
method = "addTextSize";
mPrinter.addTextSize(2, 2);
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
mPrinter.addText(" * ESTIMATION SLIP * " + "\n");
textData.append(" * ESTIMATION SLIP * " + "\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextSize";
mPrinter.addTextSize(1, 1);
method = "addFeedLine";
mPrinter.addFeedLine(1);
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addText";
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
mPrinter.addText("Date : " + dataobj.getString("dsdate") + "\n");
textData.append("Date : " + dataobj.getString("dsdate") + "\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
mPrinter.addText(Constants.dashed);
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
if (dataobj.has("ds_lines")) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
mPrinter.addText("SL Barcode Qty MRP Disc Amount " + "\n");
textData.append("SL Barcode Qty MRP Disc Amount " + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
mPrinter.addText(Constants.dashed);
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
JSONObject da = dataobj.getJSONObject("ds_lines");
Iterator<String> keys = da.keys();
while (keys.hasNext()) {
......@@ -432,53 +460,103 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
JSONArray bill_data = new JSONArray(da.getString(key));
for (int i = 0; i < bill_data.length(); i++) {
JSONObject bill_object = bill_data.getJSONObject(i);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
mPrinter.addText(Constants.SL(bill_object.getString("sno")) +
textData.append(Constants.SL(bill_object.getString("sno")) +
Constants.Barcode(bill_object.getString("barcode"))
+ Constants.Qty(bill_object.getString("qty")) + Constants.Mrp(bill_object.getString("item_rsp"))
+ Constants.Dis(bill_object.getString("qty_disc"))
+ Constants.Total(bill_object.getString("qty_amount_after_discount")));
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
mPrinter.addText(" SM : " + bill_object.getString("sm") + " " + bill_object.getString("section") + "\n");
mPrinter.addText(Constants.dashed);
textData.append(" SM : " + bill_object.getString("sm") + " " + bill_object.getString("section") + "\n");
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
}
}
}
}
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
mPrinter.addText("Gross Amount : " + Constants.Gross(dataobj.getString("total_grossamount")) + "\n");
mPrinter.addText("Total Discount : " + Constants.TotalSavings(dataobj.getString("total_promodisc")) + "\n\n");
textData.append("Gross Amount : " + Constants.Gross(dataobj.getString("total_grossamount")) + "\n");
textData.append("Total Discount : " + Constants.TotalSavings(dataobj.getString("total_promodisc")) + "\n\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addTextSize";
mPrinter.addTextSize(2, 2);
method = "addText";
mPrinter.addText("Total Qty : " + dataobj.getString("total_qty") + "\n");
mPrinter.addText("Net Payable : " + dataobj.getString("total_payable") + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextSize";
mPrinter.addTextSize(1, 1);
method = "addFeedLine";
mPrinter.addFeedLine(1);
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
mPrinter.addText(" Biller : " + dataobj.getString("biller") + "\n");
textData.append(" Biller : " + dataobj.getString("biller") + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addFeedLine";
mPrinter.addFeedLine(1);
method = "addBarcode";
mPrinter.addBarcode(dataobj.getString("dsno"),
Printer.BARCODE_CODE39,
Printer.HRI_BELOW,
Printer.FONT_A,
2,
100);
method = "addFeedLine";
mPrinter.addFeedLine(2);
method = "addTextSize";
mPrinter.addTextSize(4, 4);
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
mPrinter.addText(dataobj.getString("dsno_last_number") + "\n\n");
method = "addCut";
mPrinter.addCut(Printer.CUT_FEED);
textData.delete(0, textData.length());
method = "addTextSize";
mPrinter.addTextSize(1, 1);
method = "addFeedLine";
mPrinter.addFeedLine(1);
}
} catch (JSONException jo) {
jo.printStackTrace();
} catch (Epos2Exception e) {
e.printStackTrace();
} catch (Exception e) {
System.out.println("Error Message ======>" + e.getMessage());
//ShowMsg.showException(e, method, CreateDeliverySlip.this);
ShowMsg.showException(e, method, CreateDeliverySlip.this);
}
}
......@@ -494,8 +572,8 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
getPrint();
} else {
for (int k = 0; k < 2; k++) {
if (mPrinter == null) {
for(int k = 0; k < 2; k++) {
if(mPrinter == null) {
return false;
}
getPrint();
......@@ -506,13 +584,10 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
arrayList.clear();
list.clear();
deliveryslip_list.setAdapter(null);
totalItems.setText("");
totalNetMrp.setText("");
totalMrp.setText("");
totalDis.setText("");
setItems();
});
}
mPrinter = null;
textData = null;
return true;
}
......@@ -529,13 +604,11 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
return true;
}
private void updateButtonState(boolean state) {
valid.setEnabled(state);
System.out.println("Data State Enables===>" + state);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
try {
......@@ -605,7 +678,6 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
try {
mPrinter.endTransaction();
} catch (final Exception e) {
}
try {
mPrinter.disconnect();
......@@ -620,34 +692,23 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
@Override
public synchronized void run() {
ShowMsg.showResult(code, makeErrorMessage(printerStatusInfo), CreateDeliverySlip.this);
dispPrinterWarnings(printerStatusInfo);
disPrinterWarnings(printerStatusInfo);
updateButtonState(true);
new Thread(new Runnable() {
@Override
public void run() {
disconnectPrinter();
}
}).start();
new Thread(() -> disconnectPrinter()).start();
}
});
}
private void dispPrinterWarnings(PrinterStatusInfo status) {
//EditText edtWarnings = (EditText)findViewById(R.id.edtWarnings);
private void disPrinterWarnings(PrinterStatusInfo status) {
String warningsMsg = "";
if (status == null) {
return;
}
if (status.getPaper() == Printer.PAPER_NEAR_END) {
warningsMsg += getString(R.string.handlingmsg_warn_receipt_near_end);
}
if (status.getPaper() == Printer.PAPER_EMPTY) {
warningsMsg += "Paper Roll Is Empty";
}
if (status.getBatteryLevel() == Printer.BATTERY_LEVEL_1) {
warningsMsg += getString(R.string.handlingmsg_warn_battery_near_end);
......@@ -655,7 +716,6 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
if (warningsMsg.length() > 0) {
Constants.getToast(CreateDeliverySlip.this, warningsMsg);
}
// edtWarnings.setText(warningsMsg);
}
@Override
......@@ -664,14 +724,19 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
if (TextUtils.isEmpty(barcode_enter.getText().toString())) {
Constants.getToast(CreateDeliverySlip.this, "Enter Barcode");
} else {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE) || (actionId == EditorInfo.IME_ACTION_NEXT) || (actionId == EditorInfo.IME_ACTION_GO)) {
if((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE) || (actionId == EditorInfo.IME_ACTION_NEXT) || (actionId == EditorInfo.IME_ACTION_GO)) {
Log.e("Event =============>","");
if(!TextUtils.isEmpty(empId.getText().toString())) {
Constants.hideKeyboard(this);
if(Constants.isNetworkAvailable(this)){
if (Constants.isNetworkAvailable(this)) {
GenerateDeliverySlip("scan", barcode_enter.getText().toString().trim(), "N", false);
Constants.ProgressDialogShow(CreateDeliverySlip.this);
}else {
Constants.getToast(CreateDeliverySlip.this,"Please check internet connection");
} else {
Constants.getToast(CreateDeliverySlip.this, "Please check internet connection");
}
}else{
Constants.getToast(CreateDeliverySlip.this,"Enter SalesMen No");
empId.requestFocus();
}
}
}
......@@ -683,30 +748,31 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence val, int i, int i1, int i2) {
try {
try{
if(!TextUtils.isEmpty(empId.getText().toString())) {
if (val.toString().length() > 0) {
if (val.toString().contains("\n")) {
if (Constants.isNetworkAvailable(CreateDeliverySlip.this)) {
Constants.ProgressDialogShow(CreateDeliverySlip.this);
GenerateDeliverySlip("scan", val.toString().trim(), "N",false);
GenerateDeliverySlip("scan", val.toString().trim(), "N", false);
} else {
Constants.getToast(CreateDeliverySlip.this, getResources().getString(R.string.connection));
}
}
}
}else{
Constants.getToast(CreateDeliverySlip.this,"Enter SalesMen No");
empId.requestFocus();
}
} catch (NullPointerException np) {
np.printStackTrace();
}
}
@Override
public void afterTextChanged(Editable editable) {
}
}
public void GenerateDeliverySlip(final String scan, String trim, String app, final boolean var) {
......@@ -740,6 +806,8 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
//object.put(getResources().getString(R.string.android_version),Constants.VERSION);
Log.e("Search", object.toString());
RequestBody body = RequestBody.create(JSON, object.toString());
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(250, TimeUnit.SECONDS);
client.setReadTimeout(250, TimeUnit.SECONDS);
......@@ -768,89 +836,93 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
try {
if(response.code() == 200){
responseobj = new JSONObject(Response);
if(responseobj.getInt("success") == 1){
if(scan.equalsIgnoreCase("save")){
if (response.code() == 200) {
responseObj = new JSONObject(Response);
if (responseObj.getInt("success") == 1) {
if (scan.equalsIgnoreCase("save")) {
valid_print.setVisibility(View.GONE);
valid.setVisibility(View.VISIBLE);
header_items.setVisibility(View.GONE);
if(responseobj.has("data")){
if (responseObj.has("data")) {
updateButtonState(false);
if (!runPrintReceiptSequence()) {
updateButtonState(true);
}
}
}else if(var){
} else if (var) {
header_items.setVisibility(View.VISIBLE);
valid_print.setVisibility(View.VISIBLE);
valid.setVisibility(View.GONE);
if (responseobj.has("data")) {
if (responseObj.has("data")) {
if (barcode_enter.getText().toString().length() > 0)
list.add(new Barcode(barcode_enter.getText().toString().trim(), 1, empId.getText().toString()));
barcode_enter.setText("");
barcode_enter.requestFocus();
versionList = new Gson().fromJson(String.valueOf(responseobj.getJSONArray(getResources().getString(R.string.data))),
versionList = new Gson().fromJson(String.valueOf(responseObj.getJSONArray(getResources().getString(R.string.data))),
new TypeToken<List<CreateResponse.Datum>>() {
}.getType());
Log.e("Response =====>", String.valueOf(responseobj.getJSONArray(getResources().getString(R.string.data))));
Log.e("Response =====>", String.valueOf(responseObj.getJSONArray(getResources().getString(R.string.data))));
deliveryslip_list.setLayoutManager(new LinearLayoutManager(CreateDeliverySlip.this));
deliverySlipAdapter = new DeliverySlipAdapter(CreateDeliverySlip.this, versionList);
deliveryslip_list.setAdapter(deliverySlipAdapter);
}
totalItems.setText(Html.fromHtml(Constants.getTotalItems(responseobj.getString(getResources().getString(R.string.totalqty)))));
totalMrp.setText(Html.fromHtml(Constants.getTotalMRP(Constants.IndianRupeesFormat(responseobj.getString(getResources().getString(R.string.netpayable))))));
totalItems.setText(Html.fromHtml(Constants.getTotalItems(responseObj.getString(getResources().getString(R.string.totalqty)))));
totalMrp.setText(Html.fromHtml(Constants.getTotalMRP(Constants.IndianRupeesFormat(responseObj.getString(getResources().getString(R.string.totalMrp))))));
totalDis.setText(Html.fromHtml(Constants.getTotalDisc(Constants.IndianRupeesFormat(responseObj.getString(getResources().getString(R.string.totalDisc))))));
totalNetMrp.setText(Html.fromHtml(Constants.getTotalNetPayable(Constants.IndianRupeesFormat(responseObj.getString(getResources().getString(R.string.netpayable))))));
if(checkBox.isChecked()){
barcode_enter.requestFocus();
}else{
empId.setText("");
empId.requestFocus();
}
Log.e("total Qty ========>", responseobj.getString(getResources().getString(R.string.totalqty)));
Log.e("total NetPayable ===>", responseobj.getString(getResources().getString(R.string.netpayable)));
Log.e("total Qty ========>", responseObj.getString(getResources().getString(R.string.totalqty)));
Log.e("total NetPayable ===>", responseObj.getString(getResources().getString(R.string.netpayable)));
} else {
valid_print.setVisibility(View.GONE);
valid.setVisibility(View.VISIBLE);
header_items.setVisibility(View.VISIBLE);
//List<CreateResponse> versionList = new Gson().fromJson(Response, new TypeToken<List<CreateResponse>>() {}.getType());
if (responseobj.has("data")) {
if (responseObj.has("data")) {
if (barcode_enter.getText().toString().length() > 0)
list.add(new Barcode(barcode_enter.getText().toString().trim(), 1, empId.getText().toString()));
barcode_enter.setText("");
barcode_enter.requestFocus();
versionList = new Gson().fromJson(String.valueOf(responseobj.getJSONArray(getResources().getString(R.string.data))),
versionList = new Gson().fromJson(String.valueOf(responseObj.getJSONArray(getResources().getString(R.string.data))),
new TypeToken<List<CreateResponse.Datum>>() {
}.getType());
Log.e("Response =====>", String.valueOf(responseobj.getJSONArray(getResources().getString(R.string.data))));
Log.e("Response =====>", String.valueOf(responseObj.getJSONArray(getResources().getString(R.string.data))));
deliveryslip_list.setLayoutManager(new LinearLayoutManager(CreateDeliverySlip.this));
deliverySlipAdapter = new DeliverySlipAdapter(CreateDeliverySlip.this, versionList);
deliveryslip_list.setAdapter(deliverySlipAdapter);
}
totalItems.setText(Html.fromHtml(Constants.getTotalItems(responseobj.getString(getResources().getString(R.string.totalqty)))));
totalMrp.setText(Html.fromHtml(Constants.getTotalMRP(Constants.IndianRupeesFormat(responseobj.getString(getResources().getString(R.string.netpayable))))));
totalItems.setText(Html.fromHtml(Constants.getTotalItems(responseObj.getString(getResources().getString(R.string.totalqty)))));
totalMrp.setText(Html.fromHtml(Constants.getTotalMRP(Constants.IndianRupeesFormat(responseObj.getString(getResources().getString(R.string.totalMrp))))));
totalDis.setText(Html.fromHtml(Constants.getTotalDisc(Constants.IndianRupeesFormat(responseObj.getString(getResources().getString(R.string.totalDisc))))));
totalNetMrp.setText(Html.fromHtml(Constants.getTotalNetPayable(Constants.IndianRupeesFormat(responseObj.getString(getResources().getString(R.string.netpayable))))));
if(checkBox.isChecked()){
barcode_enter.requestFocus();
}else{
empId.setText("");
empId.requestFocus();
}
Log.e("total Qty ========>", responseobj.getString(getResources().getString(R.string.totalqty)));
Log.e("total NetPayable ===>", responseobj.getString(getResources().getString(R.string.netpayable)));
Log.e("total Qty ========>", responseObj.getString(getResources().getString(R.string.totalqty)));
Log.e("total NetPayable ===>", responseObj.getString(getResources().getString(R.string.netpayable)));
}
} else if (responseobj.getInt("success") == 3) {
} else if (responseObj.getInt("success") == 3) {
runOnUiThread(() -> {
try {
Constants.getToast(CreateDeliverySlip.this, responseobj.getString(getResources().getString(R.string.msg)));
Constants.getToast(CreateDeliverySlip.this, responseObj.getString(getResources().getString(R.string.msg)));
Login.logout(CreateDeliverySlip.this);
} catch (JSONException e) {
e.printStackTrace();
}
});
} else if (responseobj.has(getResources().getString(R.string.msg))) {
} else if (responseObj.has(getResources().getString(R.string.msg))) {
runOnUiThread(() -> {
try {
Constants.getToast(CreateDeliverySlip.this, responseobj.getString(getResources().getString(R.string.msg)));
//barcode_enter.setText("");
Constants.getToast(CreateDeliverySlip.this, responseObj.getString(getResources().getString(R.string.msg)));
barcode_enter.setText("");
barcode_enter.requestFocus();
} catch (JSONException e) {
e.printStackTrace();
......@@ -874,8 +946,7 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
} else {
Constants.ProgressDialogDismiss();
Constants.getToast(CreateDeliverySlip.this, "No Barcode Scanned Items");
totalItems.setText("");
totalMrp.setText("");
setItems();
valid.setVisibility(View.GONE);
}
}
......@@ -886,45 +957,47 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
}
}
public void setItems(){
totalItems.setText(Html.fromHtml(Constants.getTotalItems("0")));
totalMrp.setText(Html.fromHtml(Constants.getTotalMRP("0")));
totalNetMrp.setText(Html.fromHtml(Constants.getTotalNetPayable("0")));
totalDis.setText(Html.fromHtml(Constants.getTotalDisc("0")));
}
private void bluetoothPair() {
dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.print_dialog);
dialog.getWindow().setLayout(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT);
dialog.getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
dialog.show();
bluetooth_list = dialog.findViewById(R.id.bluetooth_list);
ImageView refresh_bluetooth = dialog.findViewById(R.id.refresh_bluetooth);
mPrinterList = new ArrayList<HashMap<String, String>>();
mPrinterListAdapter = new SimpleAdapter(this, mPrinterList, R.layout.list_at,
new String[]{"PrinterName", "Target"},
new int[]{R.id.PrinterName, R.id.Target});
mPrinterList = new ArrayList<>();
mPrinterListAdapter = new SimpleAdapter(this, mPrinterList, R.layout.list_at,new String[]{"PrinterName","Target"},new int[]{R.id.PrinterName, R.id.Target});
bluetooth_list.setAdapter(mPrinterListAdapter);
bluetooth_list.setOnItemClickListener(this);
mFilterOption = new FilterOption();
mFilterOption.setDeviceType(Discovery.TYPE_PRINTER);
mFilterOption.setEpsonFilter(Discovery.FILTER_NAME);
try{
if (initial) {
if(initial){
Discovery.stop();
initial = false;
Discovery.start(this, mFilterOption, mDiscoveryListener);
// Constants.ProgressDialogShow(this);
} else {
try {
}else{
try{
Discovery.start(this, mFilterOption, mDiscoveryListener);
Constants.ProgressDialogShow(this);
} catch (Exception e) {
//Log.e("Exception =======>",e.getMessage());
}catch(Exception e) {
}
}
} catch (Epos2Exception e) {
try {
}catch(Epos2Exception e) {
try{
Discovery.start(this, mFilterOption, mDiscoveryListener);
} catch (Epos2Exception e1) {
}catch(Epos2Exception e1){
e1.getMessage();
}
if (e.getErrorStatus() != Epos2Exception.ERR_PROCESSING) {
if(e.getErrorStatus() != Epos2Exception.ERR_PROCESSING){
ShowMsg.showException(e, "stop", CreateDeliverySlip.this);
return;
}
......@@ -934,12 +1007,12 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
}
private void restartDiscovery() {
while (true) {
try {
while(true){
try{
Discovery.stop();
break;
} catch (Epos2Exception e) {
if (e.getErrorStatus() != Epos2Exception.ERR_PROCESSING) {
}catch(Epos2Exception e){
if(e.getErrorStatus() != Epos2Exception.ERR_PROCESSING){
ShowMsg.showException(e, "stop", CreateDeliverySlip.this);
return;
}
......@@ -947,26 +1020,24 @@ public class CreateDeliverySlip extends AppCompatActivity implements AdapterView
}
mPrinterList.clear();
mPrinterListAdapter.notifyDataSetChanged();
try {
try{
Discovery.start(this, mFilterOption, mDiscoveryListener);
Constants.ProgressDialogShow(this);
} catch (Exception e) {
}catch(Exception e){
ShowMsg.showException(e, "stop", CreateDeliverySlip.this);
}
}
private DiscoveryListener mDiscoveryListener = deviceInfo -> runOnUiThread(new Runnable() {
@Override
public synchronized void run() {
public synchronized void run(){
initial = true;
HashMap<String, String> item = new HashMap<>();
item.put("PrinterName", deviceInfo.getDeviceName());
item.put("Target", deviceInfo.getTarget());
item.put(getResources().getString(R.string.printerName), deviceInfo.getDeviceName());
item.put(getResources().getString(R.string.target) , deviceInfo.getTarget());
mPrinterList.add(item);
mPrinterListAdapter.notifyDataSetChanged();
Constants.ProgressDialogDismiss();
}
});
}
......@@ -123,13 +123,19 @@ public class CreateResponse {
private Integer quantity;
@SerializedName("promo_disc")
@Expose
private Integer promoDisc;
private Float promoDisc;
@SerializedName("item_rsp")
@Expose
private String itemRsp;
@SerializedName("net_payable")
@Expose
private Integer netPayable;
private Float netPayable;
@SerializedName("total_items_mrp")
@Expose
private Float totalMrp;
@SerializedName("total_items_promo_disc")
@Expose
private Float totalDisc;
@SerializedName("issis")
@Expose
private Integer issis;
......@@ -182,11 +188,11 @@ public class CreateResponse {
this.quantity = quantity;
}
public Integer getPromoDisc() {
public Float getPromoDisc() {
return promoDisc;
}
public void setPromoDisc(Integer promoDisc) {
public void setPromoDisc(Float promoDisc) {
this.promoDisc = promoDisc;
}
......@@ -198,11 +204,11 @@ public class CreateResponse {
this.itemRsp = itemRsp;
}
public Integer getNetPayable() {
public Float getNetPayable() {
return netPayable;
}
public void setNetPayable(Integer netPayable) {
public void setNetPayable(Float netPayable) {
this.netPayable = netPayable;
}
......
......@@ -11,12 +11,11 @@ import java.util.ArrayList;
/*
Create by Ramesh Babu
*/
public class CreateSaleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
private Context context;
private ArrayList<Model> List;
public CreateSaleAdapter(Context context, ArrayList<Model> list){
this.context = context;
this.List = list;
......@@ -32,13 +31,10 @@ public class CreateSaleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
public void onBindViewHolder(final RecyclerView.ViewHolder viewHolder, final int position){
final Model model = List.get(position);
((ViewHolder)viewHolder).Id.setText(model.getDelivery_slip_id());
((ViewHolder)viewHolder).remove.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
((ViewHolder)viewHolder).remove.setOnClickListener(v -> {
List.remove(position);
notifyDataSetChanged();
((CreateSaleBill)context).SetData(model.getDelivery_slip_id());
}
});
}
@Override
......
......@@ -74,7 +74,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
private StringBuilder build;
private String NetAmount;
private ArrayList<Model> datalist;
private JSONObject responseobj;
private JSONObject responseObj;
private RecyclerView ds_list;
ArrayList<String> arrayList;
Dialog dialog;
......@@ -89,7 +89,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
private Boolean initial = false;
private String BankName;
private int BankId;
Dialog bankdialog;
Dialog bankDialog;
private DataPresenter dataPresenter;
private Boolean print = false;
@Override
......@@ -110,12 +110,9 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
data = findViewById(R.id.data);
main_toolbar = findViewById(R.id.main_toolbar);
ds_list = findViewById(R.id.ds_list);
//last_four_digits = findViewById(R.id.last_four_digits);
generate_invoice = findViewById(R.id.generate_invoice);
//bank_details = findViewById(R.id.bank_details);
preferenceManager = new PreferenceManager(this);
store_location.setText(preferenceManager.getStoreName());
//pluto_pay.setOnClickListener(this);
pluto_Print.setOnClickListener(this);
generate_invoice.setOnClickListener(this);
send.setOnClickListener(this);
......@@ -123,7 +120,6 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
getSupportActionBar().setTitle(" Create Sale Bill ");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
builder = new StringBuilder();
//build = new StringBuilder();
datalist = new ArrayList<>();
requestRuntimePermission();
mContext = this;
......@@ -199,50 +195,48 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
private void DsData(final String Id) {
arrayList = new ArrayList<>();
build = new StringBuilder();
if (datalist.size() > 0) {
for (int i = 0; i < datalist.size(); i++) {
if(datalist.size() > 0){
for(int i = 0; i < datalist.size(); i++){
Model data = datalist.get(i);
if (data.getDelivery_slip_id().equalsIgnoreCase(Id)) {
if(data.getDelivery_slip_id().equalsIgnoreCase(Id)){
datalist.remove(i);
} else {
if (Id != "") {
if (build.toString().length() > 0) {
}else{
if(Id != ""){
if(build.toString().length() > 0){
arrayList.add(data.getDelivery_slip_id());
build.append(Constants.PrintData(data.getDelivery_slip_id()));
} else {
}else{
arrayList.add(data.getDelivery_slip_id());
build.append(Constants.PrintData1(data.getDelivery_slip_id()));
}
}
}
}
if (Id != "") {
if (build.toString().length() > 0) {
if(Id != ""){
if(build.toString().length() > 0){
build.append(Constants.PrintData(Id)).toString();
} else {
}else{
build.append(Constants.PrintData1(Id)).toString();
}
Log.e("Array List Data ====>" , Id);
Log.e("Array List Data1 ===>" , String.valueOf(arrayList));
}
} else {
if (Id != "") {
if (build.toString().length() > 0) {
}else{
if(Id != ""){
if(build.toString().length() > 0){
build.append(Constants.PrintData(Id)).toString();
} else {
}else{
build.append(Constants.PrintData1(Id)).toString();
}
Log.e("Array List Data ====>" , Id);
Log.e("Array List Data1 ===>" , String.valueOf(arrayList));
//Collections.sort(arrayList);
} else {
layout.setVisibility(View.GONE);
Constants.getToast(this, "No data");
//Constants.ProgressDialogDismiss();
}
}
Log.e("Formation Data ===========>" , Constants.formdata(build.toString(), cust_name.getText().toString(), cust_number.getText().toString()));
RequestBody body = RequestBody.create(JSON, Constants.formdata(build.toString(), cust_name.getText().toString(), cust_number.getText().toString()));
Log.e("Formation Data =====>" , Constants.formData(build.toString(), cust_name.getText().toString(), cust_number.getText().toString()));
RequestBody body = RequestBody.create(JSON, Constants.formData(build.toString(), cust_name.getText().toString(), cust_number.getText().toString()));
if(Constants.isNetworkAvailable(this)) {
dataPresenter.SendDeliverySlipNumber(Constants.BASE_URL + "/Sales/pre_sale_check", body,Id);
Constants.ProgressDialogShow(CreateSaleBill.this);
......@@ -251,24 +245,19 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
}
}
private void SetData(ArrayList<Model> dList){
CreateSaleAdapter benifitsAdapter = new CreateSaleAdapter(CreateSaleBill.this, dList);
CreateSaleAdapter createSaleAdapter = new CreateSaleAdapter(CreateSaleBill.this, dList);
ds_list.setLayoutManager(new LinearLayoutManager(this));
ds_list.setAdapter(benifitsAdapter);
ds_list.setAdapter(createSaleAdapter);
}
public void SetData(String Id){
//System.out.println("Data =====>" + Id);
//System.out.println("Before =====>" + datalist.size());
for(int i = 0; i < datalist.size(); i++)
Log.e("Before After =====>" , String.valueOf(datalist.size()));
Remove();
}
private void Remove(){
arrayList = new ArrayList<>();
build = new StringBuilder();
if (datalist.size() > 0){
if(datalist.size() > 0){
for(int i = 0; i < datalist.size(); i++){
Model data = datalist.get(i);
if (build.toString().length() > 0) {
......@@ -277,29 +266,25 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
build.append(Constants.PrintData1(data.getDelivery_slip_id())).toString();
}
}
RequestBody body = RequestBody.create(JSON, Constants.formdata(build.toString(), cust_name.getText().toString(), cust_number.getText().toString()));
RequestBody body = RequestBody.create(JSON, Constants.formData(build.toString(), cust_name.getText().toString(), cust_number.getText().toString()));
if(Constants.isNetworkAvailable(CreateSaleBill.this)) {
dataPresenter.SendDeliverySlipNumberremove(Constants.BASE_URL + "/Sales/pre_sale_check", body);
dataPresenter.SendDeliverySlipNumberRemove(Constants.BASE_URL + "/Sales/pre_sale_check", body);
Constants.ProgressDialogShow(CreateSaleBill.this);
}else{
Constants.getToast(CreateSaleBill.this,"Please check your internet connection");
}
} else {
//Constants.ProgressDialogDismiss();
}else{
layout.setVisibility(View.GONE);
Constants.getToast(this, "No data");
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.menu_create, menu);
globalMenuItem = menu;
if(preferenceManager.getBLUETOOTH().length()>0){
//System.out.println("connection ====>"+preferenceManager.getBLUETOOTH().length());
globalMenuItem.findItem(R.id.dashboard_connection).setIcon(R.drawable.ic_bluetooth_indicator);
}else{
//System.out.println("connection1 ====>"+preferenceManager.getBLUETOOTH());
globalMenuItem.findItem(R.id.dashboard_connection).setIcon(R.drawable.ic_bluetooth_signal_indicator);
}
return super.onCreateOptionsMenu(menu);
......@@ -322,7 +307,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
Discovery.stop();
break;
}catch (Epos2Exception e1){
Log.e("Output =====>",e1.getMessage());
//Log.e("Output =====>",e1.getMessage());
}
break;
case R.id.dashboard_connection:
......@@ -339,7 +324,6 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
//Log.e("Output =====>",e1.getMessage());
}
break;
}
return super.onOptionsItemSelected(item);
}
......@@ -352,7 +336,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
dialog.show();
bluetooth_list = dialog.findViewById(R.id.bluetooth_list);
ImageView refresh_bluetooth = dialog.findViewById(R.id.refresh_bluetooth);
mPrinterList = new ArrayList<HashMap<String,String>>();
mPrinterList = new ArrayList<>();
mPrinterListAdapter = new SimpleAdapter(this, mPrinterList, R.layout.list_at,
new String[] { "PrinterName", "Target" },
new int[] { R.id.PrinterName, R.id.Target });
......@@ -362,17 +346,12 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
mFilterOption.setDeviceType(Discovery.TYPE_PRINTER);
mFilterOption.setEpsonFilter(Discovery.FILTER_NAME);
try{
//Constants.ProgressDialogDismiss();
//18072
if(initial) {
if(initial){
Discovery.stop();
initial = false;
}
Discovery.start(this, mFilterOption, mDiscoveryListener);
Constants.ProgressDialogShow(this);
}else{
Discovery.start(this, mFilterOption, mDiscoveryListener);
Constants.ProgressDialogShow(this);
}
}catch(Epos2Exception e){
try {
Discovery.start(this, mFilterOption, mDiscoveryListener);
......@@ -392,7 +371,6 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
private void restartDiscovery(){
while (true) {
try {
//Constants.ProgressDialogDismiss();
Discovery.stop();
break;
}
......@@ -462,21 +440,21 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
break;
case R.id.generate_invoice:
if(preferenceManager.getBLUETOOTH().length()>0) {
bankdialog = new Dialog(this);
bankdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
bankdialog.setCancelable(false);
bankdialog.setContentView(R.layout.dialog);
final Spinner bank_names = bankdialog.findViewById(R.id.bank_names);
last_four_digits = bankdialog.findViewById(R.id.last_four_digits);
bankDialog = new Dialog(this);
bankDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
bankDialog.setCancelable(false);
bankDialog.setContentView(R.layout.dialog);
final Spinner bank_names = bankDialog.findViewById(R.id.bank_names);
last_four_digits = bankDialog.findViewById(R.id.last_four_digits);
last_four_digits.setOnEditorActionListener(this);
Button bank_submit = bankdialog.findViewById(R.id.bank_submit);
ImageView dialog_close = bankdialog.findViewById(R.id.dialog_close);
Button bank_submit = bankDialog.findViewById(R.id.bank_submit);
ImageView dialog_close = bankDialog.findViewById(R.id.dialog_close);
final ArrayList<String> arrayList = new ArrayList<>();
arrayList.add("Select Bank");
arrayList.add("Canara Bank");
arrayList.add("State Bank of India");
arrayList.add("Lakshmi Vilas Bank");
arrayList.add("Lakshmi Villas Bank");
final ArrayList<Integer> arrayList1 = new ArrayList<>();
arrayList1.add(0);
......@@ -499,7 +477,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
}
});
dialog_close.setOnClickListener(v1 -> bankdialog.dismiss());
dialog_close.setOnClickListener(v1 -> bankDialog.dismiss());
bank_submit.setOnClickListener(v12 -> {
if (BankName.equalsIgnoreCase("Select Bank") && last_four_digits.getText().toString().length() == 0) {
Constants.getToast(CreateSaleBill.this, "Please Select Bank and Enter last four digits");
......@@ -512,13 +490,12 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
if (Constants.isNetworkAvailable(CreateSaleBill.this)) {
Constants.hideSoftKeyBoardOnTabClicked(v12, CreateSaleBill.this);
PrintData(last_four_digits.getText().toString(), BankId);
//Constants.ProgreesDialogShow(CreateSaleBill.this);
}else{
Constants.getToast(CreateSaleBill.this,"Please check your internet connection");
}
}
});
bankdialog.show();
bankDialog.show();
}else{
Constants.getToast(this,"Please Pair Bluetooth Printer");
}
......@@ -569,17 +546,9 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
@Override
public synchronized void run() {
ShowMsg.showResult(code, makeErrorMessage(status), mContext);
dispPrinterWarnings(status);
disPrinterWarnings(status);
updateButtonState(true);
new Thread(new Runnable() {
@Override
public void run() {
disconnectPrinter();
}
}).start();
new Thread(() -> disconnectPrinter()).start();
}
});
}
......@@ -638,11 +607,8 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
if (!connectPrinter()) {
return false;
}
PrinterStatusInfo status = mPrinter.getStatus();
dispPrinterWarnings(status);
disPrinterWarnings(status);
if (!isPrintable(status)) {
ShowMsg.showMsg(makeErrorMessage(status), mContext);
try {
......@@ -653,7 +619,6 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
}
return false;
}
try {
mPrinter.sendData(Printer.PARAM_DEFAULT);
}
......@@ -667,12 +632,10 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
}
return false;
}
return true;
}
private void dispPrinterWarnings(PrinterStatusInfo status) {
//EditText edtWarnings = (EditText)findViewById(R.id.edtWarnings);
private void disPrinterWarnings(PrinterStatusInfo status) {
String warningsMsg = "";
if (status == null) {
return;
......@@ -777,19 +740,13 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
pluto_Print.setEnabled(state);
Log.e("Data State Enables===>", String.valueOf(state));
}
private boolean createReceiptData(){
void print(){
String method = "";
StringBuilder textData = new StringBuilder();
Constants.ProgressDialogDismiss();
if(print){
print = false;
try {
if (mPrinter == null) {
return false;
}
if (responseobj.has("data")) {
Log.e("Response Data =============>" , String.valueOf(responseobj));
JSONObject dataobj = responseobj.getJSONObject("data");
if (responseObj.has("data")) {
Log.e("Response ========>" , String.valueOf(responseObj));
JSONObject dataobj = responseObj.getJSONObject("data");
JSONObject dataobject = dataobj.getJSONObject("invoice_data");
if (dataobject.has("website")) {
......@@ -943,10 +900,10 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
textData.append(Constants.dashed);
textData.append(" Memo No : " + dataobject.getString("memono") + "\n");
textData.append(" Date : " + dataobject.getString("BillDate") + "\n");
Log.e("name ===================>" , dataobject.getString("customer"));
Log.e("name ==========>" , dataobject.getString("customer"));
if (dataobject.getString("customer") != "NA")
textData.append(" Customer : " + dataobject.getString("customer") + "\n");
Log.e("name ===================>" , dataobject.getString("mobile"));
Log.e("name ==========>" , dataobject.getString("mobile"));
if (dataobject.getString("mobile") != "NA")
textData.append(" Ph No : " + dataobject.getString("mobile") + "\n");
textData.append(Constants.dashed);
......@@ -1158,12 +1115,6 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
mPrinter.addTextSize(1, 1);
Bitmap logoData1 = BitmapFactory.decodeResource(getResources(), R.drawable.cash_paid);
final int barcodeWidth = 2;
final int barcodeHeight = 100;
if (mPrinter == null) {
return false;
}
try {
method = "addTextAlign";
......@@ -1186,14 +1137,12 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
}
if (dataobject.has("ds_number_last_numbers")) {
if(dataobject.has("ds_number_last_numbers")) {
JSONArray dsArray = dataobject.getJSONArray("ds_number_last_numbers");
Log.e("DS NUMBERS =====>" , String.valueOf(dsArray));
for (int n = 0; n < dsArray.length(); n++) {
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addTextSize";
mPrinter.addTextSize(5, 5);
method = "addText";
......@@ -1211,15 +1160,39 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
method = "addFeedLine";
mPrinter.addFeedLine(1);
}else if(responseObj.has("msg")){
runOnUiThread(() -> {
try{
Constants.getToast(CreateSaleBill.this,responseObj.getString("msg"));
}catch(JSONException e) {
e.printStackTrace();
}
});
}
method = null;
} catch (JSONException jo) {
jo.printStackTrace();
} catch (Epos2Exception e) {
e.printStackTrace();
} catch (Exception e) {
Log.e("Error Message ======>" , e.getMessage());
ShowMsg.showException(e, method, mContext);
//ShowMsg.showException(e, method, mContext);
}
}
private boolean createReceiptData(){
Constants.ProgressDialogDismiss();
if(print){
try {
print = false;
if (mPrinter == null) {
return false;
}
print();
}catch (NullPointerException np){
np.printStackTrace();
}catch (Exception e){
ShowMsg.showException(e, "getting Error", mContext);
return false;
}
}else {
......@@ -1228,550 +1201,119 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
if (mPrinter == null) {
return false;
}
if (responseobj.has("data")) {
Log.e("Response Data =============>" , String.valueOf(responseobj));
JSONObject dataobj = responseobj.getJSONObject("data");
JSONObject dataobject = dataobj.getJSONObject("invoice_data");
if (dataobject.has("website")) {
if (dataobject.getString("website").equalsIgnoreCase("www.kanchivml.com")) {
try {
Bitmap vml = BitmapFactory.decodeResource(getResources(), R.drawable.vara);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addImage";
mPrinter.addImage(vml, 0, 0,
vml.getWidth(),
vml.getHeight(),
Printer.COLOR_1,
Printer.MODE_MONO,
Printer.HALFTONE_DITHER,
Printer.PARAM_DEFAULT,
Printer.COMPRESS_AUTO);
print();
} catch (NullPointerException jo) {
jo.printStackTrace();
} catch (Exception e) {
Log.e("Error Message ======>" , e.getMessage());
ShowMsg.showException(e, "getting Error", mContext);
return false;
}
}
}
return true;
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onPause() {
super.onPause();
}
method = "addFeedLine";
mPrinter.addFeedLine(1);
} catch (Epos2Exception eps) {
eps.getMessage();
private void PrintData(String cardNo, final int batchId){
build = new StringBuilder();
for (Model data : datalist) {
if (build.toString().length() > 0) {
build.append(Constants.PrintData(data.getDelivery_slip_id()));
} else {
build.append(Constants.PrintData1(data.getDelivery_slip_id()));
}
} else if (dataobject.getString("website").equalsIgnoreCase("www.themandir.com")) {
}
JSONObject object = new JSONObject();
try {
Bitmap vml = BitmapFactory.decodeResource(getResources(), R.drawable.mandir);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
object.put("bank_mapping_id", batchId);
object.put("card_number", cardNo);
object.put("amount", Float.parseFloat(NetAmount));
} catch (JSONException e) {
e.printStackTrace();
}
method = "addImage";
mPrinter.addImage(vml, 0, 0,
vml.getWidth(),
vml.getHeight(),
Printer.COLOR_1,
Printer.MODE_MONO,
Printer.HALFTONE_DITHER,
Printer.PARAM_DEFAULT,
Printer.COMPRESS_AUTO);
if(Constants.isNetworkAvailable(CreateSaleBill.this)){
RequestBody body = RequestBody.create(JSON, Constants.formData1(build.toString(), cust_name.getText().toString(), cust_number.getText().toString(), object));
dataPresenter.FinalData(Constants.BASE_URL + "/Sales/pre_sale_check",body);
Constants.ProgressDialogShow(CreateSaleBill.this);
}else{
Constants.getToast(CreateSaleBill.this,"Please check your internet connection");
}
}
method = "addFeedLine";
mPrinter.addFeedLine(1);
} catch (Epos2Exception eps) {
eps.getMessage();
@Override
public void onDeliveryData(int code, final String res, String Id) {
try {
Constants.ProgressDialogDismiss();
if (code == 200) {
final JSONObject object = new JSONObject(res);
if (object.has("success")) {
if (object.getInt("success") == 1) {
layout.setVisibility(View.VISIBLE);
data.setVisibility(View.VISIBLE);
generate_invoice.setVisibility(View.VISIBLE);
ds_Number.setText("");
JSONObject data = object.getJSONObject("data");
gross_amount.setText(Constants.IndianRupeesformat(data.getString("total_gross")));
discount_amount.setText(Constants.IndianRupeesformat(data.getString("total_promo_discount")));
round_off.setText(Constants.IndianRupeesformat(data.getString("round_off_amount")));
netamount.setText(Constants.IndianRupeesformat(data.getString("total_payable")));
NetAmount = data.getString("total_payable");
//build.append("{"+'"'+"delivery_slip_id"+'"'+":"+'"'+preferenceManager.getPrefix()+Id+'"'+","+'"'+"manual_discount"+'"'+":"+0+"}");
//var = true;
datalist.add(new Model(Id, 0));
//setArraylist.add(new Model(Id,0));
if (datalist.size() > 0) {
SetData(datalist);
}
} else if (dataobject.getString("website").equalsIgnoreCase("www.klmfashionmall.com")) {
//pluto_pay.setVisibility(View.VISIBLE);
//pluto_Print.setVisibility(View.VISIBLE);
} else if (object.getInt("success") == 3) {
layout.setVisibility(View.GONE);
generate_invoice.setVisibility(View.GONE);
runOnUiThread(() -> {
try {
Bitmap vml = BitmapFactory.decodeResource(getResources(), R.drawable.klm);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addImage";
mPrinter.addImage(vml, 0, 0,
vml.getWidth(),
vml.getHeight(),
Printer.COLOR_1,
Printer.MODE_MONO,
Printer.HALFTONE_DITHER,
Printer.PARAM_DEFAULT,
Printer.COMPRESS_AUTO);
method = "addFeedLine";
mPrinter.addFeedLine(1);
} catch (Epos2Exception eps) {
eps.getMessage();
Constants.getToast(CreateSaleBill.this, object.getString("msg"));
Login.logout(CreateSaleBill.this);
} catch (JSONException e) {
e.printStackTrace();
}
} else if (dataobject.getString("website").equalsIgnoreCase("www.kalamandir.com")) {
});
} else if (object.has("msg")) {
runOnUiThread(() -> {
try {
Bitmap vml = BitmapFactory.decodeResource(getResources(), R.drawable.kala);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addImage";
mPrinter.addImage(vml, 0, 0,
vml.getWidth(),
vml.getHeight(),
Printer.COLOR_1,
Printer.MODE_MONO,
Printer.HALFTONE_DITHER,
Printer.PARAM_DEFAULT,
Printer.COMPRESS_AUTO);
method = "addFeedLine";
mPrinter.addFeedLine(1);
} catch (Epos2Exception eps) {
eps.getMessage();
layout.setVisibility(View.GONE);
generate_invoice.setVisibility(View.GONE);
Constants.getToast(CreateSaleBill.this, object.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
}
}else{
runOnUiThread(() -> Constants.getToast(CreateSaleBill.this, res));
}
if (dataobject.has("company_name")) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
mPrinter.addFeedLine(1);
textData.append(dataobject.getString("company_name") + "\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
if (dataobject.has("store_name")) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
textData.append(dataobject.getString("store_name") + "\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
if (dataobject.has("addr2")) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
textData.append(dataobject.getString("addr1") + "\n" + dataobject.getString("addr2") + "\n");
Log.e("Data ======>" , dataobject.getString("addr3"));
if (dataobject.getString("addr3").equalsIgnoreCase("null")) {
} else {
textData.append(dataobject.getString("addr3") + "\n");
}
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
if (dataobject.has("showroom_phone_no")) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
textData.append(dataobject.getString("showroom_phone_no") + "\n \n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
if (dataobject.has("website")) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
textData.append(dataobject.getString("website") + "\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
if (dataobject.has("gstno")) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
textData.append("GSTIN : " + dataobject.getString("gstno") + "\n\n");
textData.append("\n");
textData.append("Retail Invoice \n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(Constants.dashed);
textData.append(" Memo No : " + dataobject.getString("memono") + "\n");
textData.append(" Date : " + dataobject.getString("BillDate") + "\n");
Log.e("name ===================>" , dataobject.getString("customer"));
if (dataobject.getString("customer") != "NA")
textData.append(" Customer : " + dataobject.getString("customer") + "\n");
Log.e("name ===================>" , dataobject.getString("mobile"));
if (dataobject.getString("mobile") != "NA")
textData.append(" Ph No : " + dataobject.getString("mobile") + "\n");
textData.append(Constants.dashed);
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
if (dataobject.has("memono")) {
}
if (dataobject.has("BillDate")) {
}
if (dataobject.has("customer")) {
}
if (dataobject.has("mobile")) {
}
if (dataobject.has("bill_lines")) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" SL Barcode Qty MRP Disc Amount " + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
JSONObject da = dataobject.getJSONObject("bill_lines");
Iterator<String> keys = da.keys();
while (keys.hasNext()) {
String key = keys.next();
if (da.get(key) instanceof JSONArray) {
// do something with jsonObject here
Log.e("Connection =====>" , String.valueOf(da));
Log.e("Connection =====>" , key);
JSONArray bill_data = new JSONArray(da.getString(key));
for (int i = 0; i < bill_data.length(); i++) {
JSONObject bill_object = bill_data.getJSONObject(i);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" " + Constants.SL(bill_object.getString("sno")) +
Constants.Barcode(bill_object.getString("barcode"))
+ Constants.Qty(bill_object.getString("qty")) + Constants.Mrp(bill_object.getString("item_rsp"))
+ Constants.Dis(bill_object.getString("item_qty_disc"))
+ Constants.Total(bill_object.getString("item_qty_payable_amount")));
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" HSN " + bill_object.getString("hsn") + " " + "Gst %" + bill_object.getString("gst_per") + " "
+ " Gst Amt " + bill_object.getString("gst_amount") + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" SM " + bill_object.getString("sm") + " " + bill_object.getString("perticulars") + "\n");
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
}
}
}
}
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" Gross Amount : " + Constants.Gross(dataobject.getString("total_mrp")) + "\n");
textData.append(" Total Savings : " + Constants.TotalSavings(dataobject.getString("total_saving")) + "\n\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addTextSize";
mPrinter.addTextSize(2, 1);
method = "addText";
mPrinter.addText("Total Qty : " + dataobject.getString("total_qty") + "\n");
mPrinter.addText("Net Amount : " + dataobject.getString("total_payable") + "\n");
/*textData.append("Total Qty : " + dataobject.getString("total_qty")+"\n");
textData.append("Net Amount : " + dataobject.getString("total_payable")+"\n");*/
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextSize";
mPrinter.addTextSize(1, 1);
method = "addFeedLine";
mPrinter.addFeedLine(1);
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
if (dataobject.has("mop")) {
JSONArray mop = dataobject.getJSONArray("mop");
Log.e("Mop =====>" , String.valueOf(mop));
textData.delete(0, textData.length());
for (int L = 0; L < mop.length(); L++) {
JSONObject object = mop.getJSONObject(L);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
method = "addText";
mPrinter.addText(" " + Constants.RecievedCashText(object.getString("paidtype")) + Constants.RecievedCash(object.getString("paidamount")) + "\n");
}
}
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
textData.append("\n" + " Tax Details " + "\n");
method = "addText";
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" GST% Taxable CGST SGST IGST " + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
if (dataobject.has("gst_lines")) {
JSONArray TaxArray = new JSONArray(dataobject.getString("gst_lines"));
for (int j = 0; j < TaxArray.length(); j++) {
JSONObject taxoObject = TaxArray.getJSONObject(j);
JSONObject taxdata = new JSONObject();
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" " + Constants.GST(taxoObject.getString("gst_per").trim()) + Constants.Taxable(taxoObject.getString("taxable"))
+ Constants.CGST(taxoObject.getString("cgst")) + Constants.CGST(taxoObject.getString("sgst"))
+ Constants.CGST(taxoObject.getString("igst")) + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
if (dataobject.has("gst_total")) {
JSONObject jsonObject = new JSONObject(dataobject.getString("gst_total"));
method = "addText";
textData.append(" Total " + Constants.Taxable(jsonObject.getString("t_taxable")) + Constants.CGST(jsonObject.getString("t_cgst"))
+ Constants.CGST(jsonObject.getString("t_sgst")) + Constants.CGST(jsonObject.getString("t_igst")) + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
}
}
method = "addText";
textData.append(Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" Biller : " + dataobject.getString("biller") + "\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
textData.append("\n Delivery Slip Summary\n\n");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
if (dataobject.has("ds_numbers")) {
JSONArray dslipArray = dataobject.getJSONArray("ds_numbers");
Log.e("DS NUMBERS =====>" , String.valueOf(dslipArray));
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
textData.append(" DS Number Qty Amount ");
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
for (int m = 0; m < dslipArray.length(); m++) {
JSONObject object = dslipArray.getJSONObject(m);
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_LEFT);
method = "addText";
mPrinter.addText(" " + Constants.Deliveryslipnumber(object.getString("ds_no")) + DeliveryslipQty(object.getString("qty")) + DeliveryslipAmt(object.getString("ds_amount")));
textData.delete(0, textData.length());
}
}
method = "addText";
textData.append("\n" + Constants.dashed);
mPrinter.addText(textData.toString());
textData.delete(0, textData.length());
method = "addTextSize";
mPrinter.addTextSize(2, 2);
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
mPrinter.addText(dataobject.getString("memono") + "\n\n");
method = "addTextSize";
mPrinter.addTextSize(1, 1);
Bitmap logoData1 = BitmapFactory.decodeResource(getResources(), R.drawable.cash_paid);
final int barcodeWidth = 2;
final int barcodeHeight = 100;
if (mPrinter == null) {
return false;
}
try {
method = "addTextAlign";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addImage";
mPrinter.addImage(logoData1, 0, 0,
logoData1.getWidth(),
logoData1.getHeight(),
Printer.COLOR_1,
Printer.MODE_MONO,
Printer.HALFTONE_DITHER,
Printer.PARAM_DEFAULT,
Printer.COMPRESS_AUTO);
method = "addFeedLine";
mPrinter.addFeedLine(1);
} catch (Epos2Exception eps) {
eps.getMessage();
}
if (dataobject.has("ds_number_last_numbers")) {
JSONArray dsArray = dataobject.getJSONArray("ds_number_last_numbers");
Log.e("DS NUMBERS =====>" , String.valueOf(dsArray));
for (int n = 0; n < dsArray.length(); n++) {
method = "addText";
mPrinter.addTextAlign(Printer.ALIGN_CENTER);
method = "addTextSize";
mPrinter.addTextSize(5, 5);
method = "addText";
mPrinter.addText("\n" + dsArray.get(n) + "\n");
}
}
method = "addCut";
mPrinter.addCut(Printer.CUT_FEED);
textData.delete(0, textData.length());
method = "addTextSize";
mPrinter.addTextSize(1, 1);
method = "addFeedLine";
mPrinter.addFeedLine(1);
}
} catch (JSONException jo) {
jo.printStackTrace();
} catch (Epos2Exception e) {
e.printStackTrace();
} catch (Exception e) {
Log.e("Error Message ======>" , e.getMessage());
ShowMsg.showException(e, method, mContext);
return false;
}
}
}
textData = null;
return true;
}
@Override
protected void onDestroy() {
/* if(connection1!= null)
unbindService(connection1);*/
super.onDestroy();
}
@Override
protected void onPause() {
super.onPause();
}
private void PrintData(String cardNo, final int batchId){
build = new StringBuilder();
for (Model data : datalist) {
if (build.toString().length() > 0) {
build.append(Constants.PrintData(data.getDelivery_slip_id()));
} else {
build.append(Constants.PrintData1(data.getDelivery_slip_id()));
}
}
JSONObject object = new JSONObject();
try {
object.put("bank_mapping_id", batchId);
object.put("card_number", cardNo);
object.put("amount", Float.parseFloat(NetAmount));
} catch (JSONException e) {
e.printStackTrace();
}
if(Constants.isNetworkAvailable(CreateSaleBill.this)){
RequestBody body = RequestBody.create(JSON, Constants.formdata1(build.toString(), cust_name.getText().toString(), cust_number.getText().toString(), object));
dataPresenter.FinalData(Constants.BASE_URL + "/Sales/pre_sale_check",body);
Constants.ProgressDialogShow(CreateSaleBill.this);
}else{
Constants.getToast(CreateSaleBill.this,"Please check your internet connection");
}
}
@Override
public void onDeliveryData(int code, final String res, String Id) {
try {
Constants.ProgressDialogDismiss();
if (code == 200) {
final JSONObject object = new JSONObject(res);
if (object.has("success")) {
if (object.getInt("success") == 1) {
layout.setVisibility(View.VISIBLE);
data.setVisibility(View.VISIBLE);
generate_invoice.setVisibility(View.VISIBLE);
ds_Number.setText("");
JSONObject data = object.getJSONObject("data");
gross_amount.setText(Constants.IndianRupeesformat(data.getString("total_gross")));
discount_amount.setText(Constants.IndianRupeesformat(data.getString("total_promo_discount")));
round_off.setText(Constants.IndianRupeesformat(data.getString("round_off_amount")));
netamount.setText(Constants.IndianRupeesformat(data.getString("total_payable")));
NetAmount = data.getString("total_payable");
//build.append("{"+'"'+"delivery_slip_id"+'"'+":"+'"'+preferenceManager.getPrefix()+Id+'"'+","+'"'+"manual_discount"+'"'+":"+0+"}");
//var = true;
datalist.add(new Model(Id, 0));
//setArraylist.add(new Model(Id,0));
if (datalist.size() > 0) {
SetData(datalist);
}
//pluto_pay.setVisibility(View.VISIBLE);
//pluto_Print.setVisibility(View.VISIBLE);
} else {
layout.setVisibility(View.GONE);
generate_invoice.setVisibility(View.GONE);
runOnUiThread(() -> {
try {
Constants.getToast(CreateSaleBill.this, object.getString("msg"));
//Login.logout(CreateSaleBill.this);
} catch (JSONException e) {
e.printStackTrace();
}
});
}
}
} else {
runOnUiThread(() -> Constants.getToast(CreateSaleBill.this, res));
}
} catch (JSONException e) {
e.printStackTrace();
} catch (NullPointerException io) {
io.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
} catch (NullPointerException io) {
io.printStackTrace();
}
}
@Override
public void onDeliveryFail(final String fail) {
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
Constants.ProgressDialogDismiss();
Constants.getToast(CreateSaleBill.this, fail);
}
});
}
@Override
......@@ -1795,7 +1337,6 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
}
} else {
layout.setVisibility(View.GONE);
//bank_details.setVisibility(View.GONE);
runOnUiThread(() -> {
try {
Constants.getToast(CreateSaleBill.this, obj.getString("msg"));
......@@ -1807,12 +1348,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
}
}
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
Constants.getToast(CreateSaleBill.this, res);
}
});
runOnUiThread(() -> Constants.getToast(CreateSaleBill.this, res));
}
} catch (JSONException e) {
e.printStackTrace();
......@@ -1823,12 +1359,9 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
@Override
public void onDeliveryFailRemove(final String fail) {
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
Constants.ProgressDialogDismiss();
Constants.getToast(CreateSaleBill.this,fail);
}
});
}
......@@ -1841,10 +1374,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
//stores = new ArrayList<>();
if (object.has("success")) {
if (object.getInt("success") == 1) {
//JSONObject data = object.getJSONObject("data");
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
try {
Constants.getToast(CreateSaleBill.this, object.getString("msg"));
preferenceManager.setUserId("");
......@@ -1855,7 +1385,6 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
} catch (JSONException e) {
e.printStackTrace();
}
}
});
} else {
runOnUiThread(() -> {
......@@ -1877,15 +1406,11 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
np.printStackTrace();
}
}
@Override
public void onLogoutFail(final String fail) {
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
Constants.ProgressDialogDismiss();
Constants.getToast(CreateSaleBill.this,fail);
}
});
}
......@@ -1893,7 +1418,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
public void onFinalData(int code, String finalData) {
try{
Constants.ProgressDialogDismiss();
bankdialog.dismiss();
bankDialog.dismiss();
if (code == 200) {
pluto_Print.setVisibility(View.VISIBLE);
generate_invoice.setVisibility(View.GONE);
......@@ -1902,22 +1427,30 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
datalist.clear();
cust_name.setText("");
cust_number.setText("");
responseobj = new JSONObject(finalData);
if(responseobj.has("success")) {
if (responseobj.getInt("success") == 1) {
responseObj = new JSONObject(finalData);
if(responseObj.has("success")){
if(responseObj.getInt("success") == 1){
updateButtonState(false);
if (!runPrintReceiptSequence()) {
updateButtonState(true);
}
} else {
}else if(responseObj.getInt("success") == 3){
runOnUiThread(() -> {
try {
Constants.getToast(CreateSaleBill.this, responseobj.getString("msg"));
Constants.getToast(CreateSaleBill.this, responseObj.getString("msg"));
Login.logout(CreateSaleBill.this);
} catch (JSONException e) {
e.printStackTrace();
}
});
}else{
runOnUiThread(() -> {
try {
Constants.getToast(CreateSaleBill.this, responseObj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
}
}
} else {
......@@ -1935,7 +1468,7 @@ public class CreateSaleBill extends AppCompatActivity implements View.OnClickLis
runOnUiThread(() -> {
Constants.ProgressDialogDismiss();
Constants.getToast(CreateSaleBill.this,finalFail);
bankdialog.dismiss();
bankDialog.dismiss();
pluto_Print.setVisibility(View.GONE);
generate_invoice.setVisibility(View.VISIBLE);
data.setVisibility(View.VISIBLE);
......
......@@ -29,16 +29,17 @@ import java.util.concurrent.TimeUnit;
public class DashBoardActivity extends AppCompatActivity implements View.OnClickListener {
Toolbar dashboard_toolbar;
Button stock_audit,rack_qty,searchby_barcode, transfer;
Button stock_audit,rack_qty,searchBy_Barcode, transfer;
TextView version;
PreferenceManager preferenceManager;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard);
stock_audit = findViewById(R.id.stock_audit);
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);
version = findViewById(R.id.version);
transfer = findViewById(R.id.transfer);
......@@ -46,17 +47,19 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
setSupportActionBar(dashboard_toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.dashboard));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
stock_audit.setOnClickListener(this);
rack_qty.setOnClickListener(this);
searchby_barcode.setOnClickListener(this);
transfer.setOnClickListener(this);
version.setText(Html.fromHtml(Constants.Ver_Text +Constants.VERSION));
stock_audit .setOnClickListener(this);
rack_qty .setOnClickListener(this);
searchBy_Barcode.setOnClickListener(this);
transfer .setOnClickListener(this);
version .setText(Html.fromHtml(Constants.Ver_Text +Constants.VERSION));
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item){
switch(item.getItemId()){
......@@ -68,7 +71,6 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
Constants.getToast(DashBoardActivity.this,getResources().getString(R.string.connection));
}
break;
case android.R.id.home:
finish();
break;
......@@ -79,8 +81,8 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
public void Logout(String Url){
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240,TimeUnit.SECONDS);
client.setWriteTimeout(240,TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
final Request request = new Request.Builder()
.url(Url)
.get()
......@@ -96,16 +98,17 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
Constants.ProgressDialogDismiss();
if(response.isSuccessful()){
String res = response.body().string();
Log.e("Dashboard Logout ", res);
try{
JSONObject jsonObject = new JSONObject(res);
if(jsonObject.has("success")){
if(jsonObject.getInt("success") == 1){
}else if(jsonObject.getInt("success") == 3){
preferenceManager.setUserId("");
preferenceManager.setLogged(false);
preferenceManager.setCustToken("");
preferenceManager.setStoreId("");
Login.logout(DashBoardActivity.this);
Constants.getToast(DashBoardActivity.this,jsonObject.getString("msg"));
}else{
Constants.getToast(DashBoardActivity.this,jsonObject.getString("msg"));
}
......@@ -124,16 +127,16 @@ public class DashBoardActivity extends AppCompatActivity implements View.OnClick
public void onClick(View view){
switch(view.getId()){
case R.id.stock_audit:
Intent in_main = new Intent(this,MainActivity.class);
startActivity(in_main);
Intent in_main = new Intent(this, MainActivity.class);
this.startActivity(in_main);
break;
case R.id.rack_qty:
Intent in_rack = new Intent(this,RackWiseQty.class);
startActivity(in_rack);
Intent in_rack = new Intent(this, RackWiseQty.class);
this.startActivity(in_rack);
break;
case R.id.searchby_barcode:
Intent in_search = new Intent(this, SearchByBarcode.class);
startActivity(in_search);
this.startActivity(in_search);
break;
}
}
......
......@@ -11,8 +11,8 @@ public interface DataInterface {
void onDeliveryFailRemove(String fail);
void onLogoutData(int code, String data);
void onLogoutFail(String fail);
void onFinalData(int code, String finaldata);
void onFinalFail(String finalfail);
void onFinalData(int code, String finalData);
void onFinalFail(String finalFail);
void onCustomerName(int code,String name);
void onCustomerNameFail(String fail);
}
......@@ -11,6 +11,7 @@ import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import java.io.IOException;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
/*
......@@ -18,7 +19,6 @@ import java.util.concurrent.TimeUnit;
*/
public class DataPresenter{
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private Context context;
private DataInterface dataInterface;
private String Response;
......@@ -41,15 +41,14 @@ public class DataPresenter{
Request request = new Request.Builder()
.url(Url)
.post(object)
.addHeader("Content-Type", "application/json")
.addHeader("Pos-Access-Token",preferenceManager.getCustToken())
.addHeader("Pos-User-Access-Store-Id", preferenceManager.getStoreId())
.addHeader(Constants.Type, Constants.App_json)
.addHeader(Constants.Access_Token,preferenceManager.getCustToken())
.addHeader(Constants.Access_StoreId, preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, IOException e){
//featureDataInterface.FeatureFailure(request.toString());
dataInterface.onDeliveryFail(request.toString());
System.out.println("Delivery Slip error" +e.getMessage());
}
......@@ -59,12 +58,7 @@ public class DataPresenter{
Response = response.body().string();
System.out.println("Delivery Slip" + Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
dataInterface.onDeliveryData(response.code(),Response,Id);
}
});
handler.post(() -> dataInterface.onDeliveryData(response.code(),Response,Id));
}catch (NullPointerException np){
np.printStackTrace();
}finally {
......@@ -75,10 +69,9 @@ public class DataPresenter{
}
public void SendDeliverySlipNumberremove(String Url, RequestBody object){
public void SendDeliverySlipNumberRemove(String Url, RequestBody object){
System.out.println("Url ====>"+Url);
System.out.println("Object ====>"+object);
//RequestBody body = RequestBody.create(JSON, object);
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240,TimeUnit.SECONDS);
......@@ -86,9 +79,9 @@ public class DataPresenter{
Request request = new Request.Builder()
.url(Url)
.post(object)
.addHeader("Content-Type", "application/json")
.addHeader("Pos-Access-Token",preferenceManager.getCustToken())
.addHeader("Pos-User-Access-Store-Id", preferenceManager.getStoreId())
.addHeader(Constants.Type, Constants.App_json)
.addHeader(Constants.Access_Token, preferenceManager.getCustToken())
.addHeader(Constants.Access_StoreId, preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
......@@ -103,12 +96,7 @@ public class DataPresenter{
Response = response.body().string();
System.out.println("Delivery Slip Remove" + Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
dataInterface.onDeliveryDataRemove(response.code(),Response);
}
});
handler.post(() -> dataInterface.onDeliveryDataRemove(response.code(),Response));
}catch (NullPointerException np){
np.printStackTrace();
}finally {
......@@ -130,14 +118,13 @@ public class DataPresenter{
Request request = new Request.Builder()
.url(Url)
.post(object)
.addHeader("Content-Type", "application/json")
.addHeader(context.getResources().getString(R.string.accesstoken),preferenceManager.getCustToken())
.addHeader(context.getResources().getString(R.string.storeidtoken),preferenceManager.getStoreId())
.addHeader(Constants.Type, Constants.App_json)
.addHeader(Constants.Access_Token,preferenceManager.getCustToken())
.addHeader(Constants.Access_StoreId, preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, IOException e){
//featureDataInterface.FeatureFailure(request.toString());
dataInterface.onFinalFail(request.toString());
System.out.println("singup1 error" +e.getMessage());
}
......@@ -165,9 +152,9 @@ public class DataPresenter{
Request request = new Request.Builder()
.url(Url)
.get()
.addHeader("Content-Type", "application/json")
.addHeader(context.getResources().getString(R.string.accesstoken),preferenceManager.getCustToken())
.addHeader(context.getResources().getString(R.string.storeidtoken),preferenceManager.getStoreId())
.addHeader(Constants.Type, Constants.App_json)
.addHeader(Constants.Access_Token,preferenceManager.getCustToken())
.addHeader(Constants.Access_StoreId, preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
......@@ -180,29 +167,21 @@ public class DataPresenter{
Response = response.body().string();
System.out.println("cart count Response ====>" +Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run(){
dataInterface.onLogoutData(response.code(),Response);
}
});
handler.post(() -> dataInterface.onLogoutData(response.code(),Response));
}
});
}
public void CustomerName(String Url,RequestBody object){
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(2000, TimeUnit.SECONDS);
client.setReadTimeout(2000,TimeUnit.SECONDS);
client.setWriteTimeout(2000,TimeUnit.SECONDS);
System.out.println("Url ====>"+Url);
System.out.println("Object ====>"+object);
System.out.println("Token ====>"+preferenceManager.getCustToken());
client.setReadTimeout(2000, TimeUnit.SECONDS);
client.setWriteTimeout(2000, TimeUnit.SECONDS);
final Request request = new Request.Builder()
.url(Url)
.post(object)
.addHeader("Content-Type", "application/json")
.addHeader("Pos-Access-Token", preferenceManager.getCustToken())
.addHeader("Pos-User-Access-Store-Id", preferenceManager.getStoreId())
.addHeader(Constants.Type, Constants.App_json)
.addHeader(Constants.Access_Token, preferenceManager.getCustToken())
.addHeader(Constants.Access_StoreId, preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
......@@ -215,12 +194,7 @@ public class DataPresenter{
Response = response.body().string();
System.out.println("Customer Response ====>" + Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
dataInterface.onCustomerName(response.code(), Response);
}
});
handler.post(() -> dataInterface.onCustomerName(response.code(), Response));
}
});
}
......
package w.soulofpluto.posstock;
/*
/*
Create by Ramesh Babu
*/
import android.content.Context;
......@@ -14,10 +13,9 @@ import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
public class DeliverySlipAdapter extends RecyclerView.Adapter<DeliverySlipAdapter.ViewHolder> {
public class DeliverySlipAdapter extends RecyclerView.Adapter<DeliverySlipAdapter.ViewHolder>{
public List<CreateResponse.Datum> arrayList;
public Context context;
......@@ -28,7 +26,7 @@ public class DeliverySlipAdapter extends RecyclerView.Adapter<DeliverySlipAdapte
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
View listItem = layoutInflater.inflate(R.layout.delivery_list_item, parent, false);
DeliverySlipAdapter.ViewHolder viewHolder = new DeliverySlipAdapter.ViewHolder(listItem);
......@@ -36,7 +34,7 @@ public class DeliverySlipAdapter extends RecyclerView.Adapter<DeliverySlipAdapte
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
public void onBindViewHolder(@NonNull ViewHolder holder, int position){
CreateResponse.Datum datum = arrayList.get(position);
if(TextUtils.isEmpty(datum.getItemLevelPromoName())){
holder.item_level_promotion.setVisibility(View.GONE);
......@@ -45,26 +43,27 @@ public class DeliverySlipAdapter extends RecyclerView.Adapter<DeliverySlipAdapte
holder.item_level_promotion.setText(datum.getItemLevelPromoName());
}
holder.create_barcode.setText(Html.fromHtml(Constants.getBarcode(datum.getBarcode())));
holder.create_empid.setText(Html.fromHtml(Constants.getEmpId(datum.getEmpId())));
holder.create_EmpId.setText(Html.fromHtml(Constants.getEmpId(datum.getEmpId())));
holder.create_dis.setText(Html.fromHtml(Constants.getCode(Constants.IndianRupeesFormat(String.valueOf(datum.getPromoDisc())))));
holder.create_mrp.setText(Html.fromHtml(Constants.getMRP(Constants.IndianRupeesFormat(datum.getItemRsp()))));
holder.create_netpay.setText(Html.fromHtml(Constants.getNetPayable(Constants.IndianRupeesFormat(datum.getNetPayable().toString()))));
holder.create_NetPay.setText(Html.fromHtml(Constants.getNetPayable(Constants.IndianRupeesFormat(datum.getNetPayable().toString()))));
}
@Override
public int getItemCount() {
public int getItemCount(){
return arrayList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
public TextView create_barcode,create_empid,create_mrp,create_dis,create_netpay,item_level_promotion;
public TextView create_barcode,create_EmpId,create_mrp,create_dis,
create_NetPay,item_level_promotion;
public ViewHolder(View itemView){
super(itemView);
create_barcode = itemView.findViewById(R.id.create_barcode);
create_empid = itemView.findViewById(R.id.create_empid);
create_EmpId = itemView.findViewById(R.id.create_empid);
create_mrp = itemView.findViewById(R.id.create_mrp);
create_dis = itemView.findViewById(R.id.create_dis);
create_netpay = itemView.findViewById(R.id.create_netpay);
create_NetPay = itemView.findViewById(R.id.create_netpay);
item_level_promotion = itemView.findViewById(R.id.item_level_promotion);
}
}
......
......@@ -36,7 +36,7 @@ public class DiscoveryActivity extends Activity implements View.OnClickListener,
Button button = (Button)findViewById(R.id.btnRestart);
button.setOnClickListener(this);
mPrinterList = new ArrayList<HashMap<String, String>>();
mPrinterList = new ArrayList<>();
mPrinterListAdapter = new SimpleAdapter(this, mPrinterList, R.layout.list_at,
new String[] { "PrinterName", "Target" },
new int[] { R.id.PrinterName, R.id.Target });
......@@ -117,10 +117,7 @@ public class DiscoveryActivity extends Activity implements View.OnClickListener,
}
}
private DiscoveryListener mDiscoveryListener = new DiscoveryListener() {
@Override
public void onDiscovery(final DeviceInfo deviceInfo) {
runOnUiThread(new Runnable() {
private DiscoveryListener mDiscoveryListener = deviceInfo -> runOnUiThread(new Runnable() {
@Override
public synchronized void run() {
HashMap<String, String> item = new HashMap<String, String>();
......@@ -130,6 +127,4 @@ public class DiscoveryActivity extends Activity implements View.OnClickListener,
mPrinterListAdapter.notifyDataSetChanged();
}
});
}
};
}
package w.soulofpluto.posstock;
/*
Create by Ramesh Babu
*/
public class Format {
int pos_store_format_id;
String store_format;
public int getPos_store_format_id() {
return pos_store_format_id;
}
public void setPos_store_format_id(int pos_store_format_id) {
this.pos_store_format_id = pos_store_format_id;
}
public String getStore_format() {
return store_format;
}
public void setStore_format(String store_format) {
this.store_format = store_format;
}
@Override
public String toString() {
return store_format;
}
}
package w.soulofpluto.posstock;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
......@@ -8,21 +11,25 @@ import retrofit2.converter.gson.GsonConverterFactory;
import static w.soulofpluto.posstock.Constants.BASE_URL;
/*
Create by Ramesh Babu
*/
public class Getretrofit {
static String URL = BASE_URL;
static Gson gson = new GsonBuilder()
.setLenient()
.create();
static OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(5, TimeUnit.MINUTES)
.writeTimeout(5, TimeUnit.MINUTES)
.readTimeout(5, TimeUnit.MINUTES)
.build();
static Retrofit retrofit = new Retrofit.Builder()
.baseUrl(URL)
.addConverterFactory(GsonConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create(gson))
.client(client)
.build();
public static Retrofit getClient() {
......
package w.soulofpluto.posstock;
import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
......@@ -12,118 +7,56 @@ import android.text.Html;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.nio.channels.InterruptedByTimeoutException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static w.soulofpluto.posstock.Constants.JSON;
import static w.soulofpluto.posstock.Constants.Logout;
/*
Create by Ramesh Babu
*/
public class HomeActivity extends AppCompatActivity implements View.OnClickListener {
public class HomeActivity extends AppCompatActivity {
Toolbar home_toolbar;
static PreferenceManager preferenceManager;
TextView version;
ArrayList<String> arrayList;
RecyclerView recyclerView;
private static final int REQUEST_PERMISSION = 100;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState){
setContentView(R.layout.activity_home);
requestRuntimePermission();
home_toolbar = findViewById(R.id.home_toolbar);
version = findViewById(R.id.version);
recyclerView = findViewById(R.id.menu_list);
preferenceManager = new PreferenceManager(this);
setSupportActionBar(home_toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.home));
version.setText(Html.fromHtml(Constants.Ver_Text +Constants.VERSION));
if(Constants.isNetworkAvailable(HomeActivity.this)) {
getSupportActionBar().setTitle( Html.fromHtml("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + getResources().getString(R.string.home) ) );
version.setText(Html.fromHtml(Constants.Ver_Text + Constants.VERSION));
if (Constants.isNetworkAvailable(HomeActivity.this)) {
setUI();
Constants.ProgressDialogShow(HomeActivity.this);
} else {
Constants.getToast(HomeActivity.this,"Please check internet connection");
}
super.onCreate(savedInstanceState);
}
private void requestRuntimePermission() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return;
}
int permissionStorage = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
int permissionLocation = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION);
List<String> requestPermissions = new ArrayList<>();
if (permissionStorage == PackageManager.PERMISSION_DENIED) {
requestPermissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
if (permissionLocation == PackageManager.PERMISSION_DENIED) {
requestPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
}
if (!requestPermissions.isEmpty()) {
ActivityCompat.requestPermissions(this, requestPermissions.toArray(new String[requestPermissions.size()]), REQUEST_PERMISSION);
}
//ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.ACCESS_BACKGROUND_LOCATION}, REQUEST_PERMISSION);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
if (requestCode != REQUEST_PERMISSION || grantResults.length == 0) {
return;
}
List<String> requestPermissions = new ArrayList<>();
for(int i = 0; i < permissions.length; i++){
if(permissions[i].equals(Manifest.permission.WRITE_EXTERNAL_STORAGE)
&& grantResults[i] == PackageManager.PERMISSION_DENIED) {
requestPermissions.add(permissions[i]);
}
if (permissions[i].equals(Manifest.permission.ACCESS_COARSE_LOCATION)
&& grantResults[i] == PackageManager.PERMISSION_DENIED) {
requestPermissions.add(permissions[i]);
}
}
if (!requestPermissions.isEmpty()) {
ActivityCompat.requestPermissions(this, requestPermissions.toArray(new String[requestPermissions.size()]), REQUEST_PERMISSION);
}
}
private void setUI(){
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(250, TimeUnit.SECONDS);
......@@ -133,63 +66,53 @@ import static w.soulofpluto.posstock.Constants.Logout;
.url(Constants.MenuBar)
.get()
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken),preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken),preferenceManager.getStoreId())
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, final IOException e){
runOnUiThread(new Runnable(){
@Override
public void run(){
runOnUiThread(() -> {
Constants.getToast(HomeActivity.this,e.getMessage());
Constants.ProgressDialogDismiss();
}
});
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException{
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
try{
Constants.ProgressDialogDismiss();
arrayList = new ArrayList<>();
final String Response = response.body().string();
Log.e("MenuBar Response " , Response);
if(response.code() ==200) {
if(response.code() == 200) {
final JSONObject object = new JSONObject(Response);
if (object.getInt("success") == 1) {
JSONArray jsonArray = object.getJSONArray("data");
for (int i = 0; i < jsonArray.length(); i++) {
for(int i = 0; i < jsonArray.length(); i++) {
arrayList.add(jsonArray.get(i).toString());
}
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
handler.post(() -> {
recyclerView.setLayoutManager(new GridLayoutManager(HomeActivity.this, 2));
MenuAdapter menuAdapter = new MenuAdapter(HomeActivity.this, arrayList);
recyclerView.setAdapter(menuAdapter);
}
});
Log.e("Size", String.valueOf(arrayList.size()));
} else if (object.getInt("success") == 3) {
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
runOnUiThread(() -> {
try{
Log.e("session", object.getString("msg"));
preferenceManager.setLogged(false);
Constants.getToast(HomeActivity.this, object.getString("msg"));
Login.logout(HomeActivity.this);
} catch (JSONException e) {
}catch(JSONException e) {
e.printStackTrace();
}
}
});
}
}else{
runOnUiThread(() -> Constants.getToast(HomeActivity.this,Response));
}
}catch(NullPointerException | JSONException io){
io.printStackTrace();
}finally{
......@@ -226,8 +149,8 @@ import static w.soulofpluto.posstock.Constants.Logout;
final Request request = new Request.Builder()
.url(Url)
.get()
.addHeader("Content-Type", "application/json")
.addHeader(getResources().getString(R.string.accesstoken),preferenceManager.getCustToken())
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken),preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback(){
......@@ -239,7 +162,7 @@ import static w.soulofpluto.posstock.Constants.Logout;
public void onResponse(Response response) throws IOException{
Constants.ProgressDialogDismiss();
final String res = response.body().string();
try{
try {
Log.e("Dashboard Logout ", res);
if(response.code() == 200) {
JSONObject jsonObject = new JSONObject(res);
......@@ -266,38 +189,17 @@ import static w.soulofpluto.posstock.Constants.Logout;
}
});
}
@Override
public void onBackPressed(){
int count = 0;
if(count>0){
if(count>0) {
super.onBackPressed();
}else{
}else {
AlertDialog alert = new AlertDialog.Builder(this)
.setTitle("Are you sure you want to close this app")
//.setMessage("Are you sure to Exit")
.setPositiveButton("Yes", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialogInterface, int i){
finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialogInterface, int i){
}
})
.show();
}
}
@Override
public void onClick(View view) {
switch (view.getId()){
/* case R.id.layout1:
Intent intent = new Intent(HomeActivity.this,DashBoardActivity.class);
startActivity(intent);
break;*/
.setPositiveButton("Yes", (dialogInterface, i) -> finish())
.setNegativeButton("No", (dialogInterface, i) -> {
}).show();
}
}
}
......@@ -7,7 +7,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.InputType;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
......@@ -45,7 +44,6 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
private ArrayList<Store> stores;
private String Response;
private int Store_Id;
private Toolbar login_toolbar;
private PreferenceManager preferenceManager;
private String Store_Name;
......@@ -65,15 +63,10 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
password = findViewById(R.id.password);
storeId = findViewById(R.id.storeId);
submit = findViewById(R.id.submit);
login_toolbar = findViewById(R.id.login_toolbar);
setSupportActionBar(login_toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.login));
preferenceManager = new PreferenceManager(this);
submit.setOnClickListener(this);
storeId.setOnItemSelectedListener(this);
password.setOnFocusChangeListener(new View.OnFocusChangeListener(){
@Override
public void onFocusChange(View view, boolean hasFocus){
password.setOnFocusChangeListener((view, hasFocus) -> {
if(!hasFocus){
}else{
if(Constants.isNetworkAvailable(Login.this)){
......@@ -85,7 +78,6 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
Constants.getToast(Login.this, getResources().getString(R.string.connection));
}
}
}
});
}
......@@ -99,12 +91,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, final IOException e){
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
Toast.makeText(Login.this, e.getMessage(), Toast.LENGTH_SHORT).show();
Constants.ProgressDialogDismiss();
}
});
}
@Override
......@@ -112,11 +101,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
try{
Constants.ProgressDialogDismiss();
final String Response = response.body().string();
Log.e("Store Response ", Response);
Log.e("Login Response ", Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run(){
handler.post(() -> {
try{
if(response.code() == 200){
JSONObject object = new JSONObject(Response);
......@@ -133,27 +120,21 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
store.setStoreName(jsonObject.getString(getResources().getString(R.string.store_name)));
stores.add(store);
}
ArrayAdapter<Store> adapter = new ArrayAdapter<Store>(Login.this, android.R.layout.simple_dropdown_item_1line, stores);
ArrayAdapter<Store> adapter = new ArrayAdapter<Store>(Login.this, R.layout.spinner_item, stores);
storeId.setAdapter(adapter);
}
}
}else{
Toast.makeText(Login.this, getResources().getString(R.string.no_stores), Toast.LENGTH_SHORT).show();
Constants.getToast(Login.this,getResources().getString(R.string.no_stores));
storeId.setAdapter(null);
}
}
}else{
runOnUiThread(new Runnable() {
@Override
public void run() {
Constants.getToast(Login.this,Response);
}
});
runOnUiThread(() -> Constants.getToast(Login.this,Response));
}
}catch(JSONException e){
e.printStackTrace();
}
}
});
}catch (NullPointerException io) {
io.printStackTrace();
......@@ -178,36 +159,6 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
if(Constants.isNetworkAvailable(Login.this)){
doLogin(userId.getText().toString(), password.getText().toString());
Constants.ProgressDialogShow(Login.this);
/*JSONObject object = new JSONObject();
try{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
object.put(getResources().getString(R.string.empid), userId.getText().toString());
object.put(getResources().getString(R.string.password), Constants.getSHA256(password.getText().toString()));
object.put(getResources().getString(R.string.storeid), Store_Id);
object.put(getResources().getString(R.string.dongle), false);
object.put(getResources().getString(R.string.android_version),Constants.VERSION);
Log.e("post object ",object.toString());
}
}catch(JSONException e){
e.printStackTrace();
}
ApiService service = Getretrofit.getClient().create(ApiService.class);
//service.login(object);
RequestBody body = RequestBody.create(JSON, object.toString());
Call<Response> call = service.login(body);
call.enqueue(new retrofit2.Callback<com.squareup.okhttp.Response>(){
@Override
public void onResponse(Call<com.squareup.okhttp.Response> call, retrofit2.Response<com.squareup.okhttp.Response> response){
Log.e("Login",response.toString());
Log.e("Login",String.valueOf(response.isSuccessful()));
}
@Override
public void onFailure(Call<com.squareup.okhttp.Response> call, Throwable t){
Log.e("Fail",String.valueOf(t.getCause()));
Log.e("Fail",String.valueOf(t.getMessage()));
Log.e("Fail",String.valueOf(t.getLocalizedMessage()));
}
});*/
}else{
Constants.getToast(Login.this, getResources().getString(R.string.connection));
}
......@@ -225,10 +176,9 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
object.put(getResources().getString(R.string.storeid), Store_Id);
object.put(getResources().getString(R.string.dongle), false);
object.put(getResources().getString(R.string.android_version),Constants.VERSION);
Log.e("post object ",object.toString());
}
}catch(JSONException e){
e.printStackTrace();
}catch(JSONException je){
je.printStackTrace();
}
RequestBody body = RequestBody.create(JSON, object.toString());
final OkHttpClient client = new OkHttpClient();
......@@ -243,34 +193,32 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, IOException e){
Constants.ProgressDialogDismiss();
if(e.getCause() != null && e.getCause() instanceof UnknownHostException){
}else{
Log.e("error ====>", e.getMessage());
runOnUiThread(() -> Constants.getToast(Login.this,e.getMessage()));
}
Constants.ProgressDialogDismiss();
}
@Override
public void onResponse(final Response response) throws IOException{
Constants.ProgressDialogDismiss();
Response = response.body().string();
Log.e("Login",Response);
try{
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run(){
if(response.code() == 200){
try{
handler.post(() -> {
if (response.code() == 200) {
try {
JSONObject obj = new JSONObject(Response);
if(obj.has(getResources().getString(R.string.success))){
if(obj.getInt(getResources().getString(R.string.success)) == 1){
if( obj.has(getResources().getString(R.string.success))) {
if( obj.getInt(getResources().getString(R.string.success)) == 1) {
JSONObject data = obj.getJSONObject(getResources().getString(R.string.data));
preferenceManager.setUserId(data.getString(getResources().getString(R.string.empid)));
preferenceManager.setCustToken(data.getString(getResources().getString(R.string.usertoken)));
preferenceManager.setStoreId(data.getString(getResources().getString(R.string.storeid)));
preferenceManager.setPrefix(data.getString(getResources().getString(R.string.prefix)));
preferenceManager.setPassword(Constants.getSHA256(pass));
if (Store_Name != null)
if(Store_Name != null)
preferenceManager.setStoreName(Store_Name);
preferenceManager.setLogged(true);
Intent in = new Intent(Login.this, HomeActivity.class);
......@@ -280,16 +228,16 @@ public class Login extends AppCompatActivity implements View.OnClickListener, Ad
Toast.makeText(Login.this, obj.getString(getResources().getString(R.string.msg)), Toast.LENGTH_SHORT).show();
}
}
}catch(JSONException e){
e.printStackTrace();
} catch(JSONException je) {
je.printStackTrace();
}
} else {
}
runOnUiThread(() -> Constants.getToast(Login.this,Response));
}
});
}catch(NullPointerException io){
io.printStackTrace();
}finally{
} catch(NullPointerException np){
np.printStackTrace();
} finally{
response.body().close();
}
}
......
......@@ -43,7 +43,8 @@ public class MainActivity extends AppCompatActivity {
preferenceManager = new PreferenceManager(this);
setSupportActionBar(main_toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(getResources().getString(R.string.test)+ " UserId : " +preferenceManager.getUserId());
getSupportActionBar().setTitle(getResources().getString(R.string.test)+ " UserId : " + preferenceManager.getUserId());
}
@Override
......@@ -59,9 +60,9 @@ public class MainActivity extends AppCompatActivity {
public void Logout(String Url){
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(250, TimeUnit.SECONDS);
client.setReadTimeout(250,TimeUnit.SECONDS);
client.setWriteTimeout(250,TimeUnit.SECONDS);
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240,TimeUnit.SECONDS);
client.setWriteTimeout(240,TimeUnit.SECONDS);
final Request request = new Request.Builder()
.url(Url)
.get()
......@@ -151,18 +152,15 @@ public class MainActivity extends AppCompatActivity {
.url(Url)
.post(body)
.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())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, final IOException e){
runOnUiThread(new Runnable(){
@Override
public void run(){
runOnUiThread(() -> {
Constants.getToast(MainActivity.this,e.getMessage());
Constants.ProgressDialogDismiss();
}
});
}
@Override
......@@ -172,17 +170,15 @@ public class MainActivity extends AppCompatActivity {
final String Response = response.body().string();
Log.e("Store Response " , Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run(){
handler.post(() -> {
try{
if(response.code() == 200){
final JSONObject object = new JSONObject(Response);
if(object.has(getResources().getString(R.string.success))){
if(object.getInt(getResources().getString(R.string.success)) == 1){
if(object.has(getResources().getString(R.string.data))){
final JSONObject object1 = new JSONObject(Response);
if(object1.has(getResources().getString(R.string.success))){
if(object1.getInt(getResources().getString(R.string.success)) == 1){
if(object1.has(getResources().getString(R.string.data))){
plansArrayList.clear();
JSONArray jsonArray = object.getJSONArray(getResources().getString(R.string.data));
JSONArray jsonArray = object1.getJSONArray(getResources().getString(R.string.data));
for(int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Plans plans = new Plans();
......@@ -195,28 +191,22 @@ public class MainActivity extends AppCompatActivity {
CustomAdapter customAdapter = new CustomAdapter(MainActivity.this, plansArrayList);
plans_list.setLayoutManager(new LinearLayoutManager(MainActivity.this,LinearLayoutManager.VERTICAL,false));
plans_list.setAdapter(customAdapter);
}else if (object.has(getResources().getString(R.string.msg))){
runOnUiThread(new Runnable() {
@Override
public void run() {
}else if (object1.has(getResources().getString(R.string.msg))){
runOnUiThread(() -> {
try {
Constants.getToast(MainActivity.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(MainActivity.this, object1.getString(getResources().getString(R.string.msg)));
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
}else if(object.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(new Runnable() {
@Override
public void run() {
}else if(object1.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(() -> {
try{
Constants.getToast(MainActivity.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(MainActivity.this, object1.getString(getResources().getString(R.string.msg)));
}catch(JSONException e) {
e.printStackTrace();
}
}
});
preferenceManager.setUserId("");
preferenceManager.setLogged(false);
......@@ -229,7 +219,6 @@ public class MainActivity extends AppCompatActivity {
}catch(JSONException e){
e.printStackTrace();
}
}
});
}catch(NullPointerException io){
io.printStackTrace();
......
......@@ -2,7 +2,6 @@ package w.soulofpluto.posstock;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -13,16 +12,19 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
/*
/*
Create by Ramesh Babu
*/
public class MenuAdapter extends RecyclerView.Adapter<MenuAdapter.ViewHolder> {
ArrayList<String> arrayList;
Context context;
public MenuAdapter(Context context,ArrayList<String> arrayList){
public MenuAdapter(Context context,ArrayList<String> arrayList) {
this.context = context;
this.arrayList = arrayList;
}
@NonNull
@Override
public MenuAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
......@@ -36,19 +38,45 @@ import java.util.ArrayList;
public void onBindViewHolder(@NonNull MenuAdapter.ViewHolder holder, final int position) {
final String data = arrayList.get(position);
holder.menu_name.setText(data);
holder.layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(data.equalsIgnoreCase("Stock Audit")){
Intent intent = new Intent(context,DashBoardActivity.class);
if(data.equalsIgnoreCase("Create Delivery Slip")){
holder.menu_image.setImageResource(R.drawable.ic_create_delivery_slip);
}else if(data.equalsIgnoreCase("Stock Audit")){
holder.menu_image.setImageResource(R.drawable.ic_stock_audit);
}else if(data.equalsIgnoreCase("Create Sale Bill")){
holder.menu_image.setImageResource(R.drawable.ic_create_sale_bill);
}else if(data.equalsIgnoreCase("Stock OutWord")){
holder.menu_image.setImageResource(R.drawable.ic_stock_out_word);
}else if(data.equalsIgnoreCase("Stock Transfer")){
holder.menu_image.setImageResource(R.drawable.ic_stock_out_word);
}else{
holder.menu_image.setImageResource(R.drawable.ic_stock_transfer);
}
//45724.48
holder.layout.setOnClickListener(view -> {
if (data.equalsIgnoreCase("Stock Audit")) {
/*Intent intent = new Intent(context,DashBoardActivity.class);
context.startActivity(intent);*/
return;
} else if(data.equalsIgnoreCase("Create Delivery Slip")) {
/*Intent intent = new Intent(context,CreateDeliverySlip.class);
context.startActivity(intent);*/
return;
} else if(data.equalsIgnoreCase("Create Sale Bill")) {
/*Intent intent = new Intent(context,CreateSaleBill.class);
context.startActivity(intent);*/
return;
} else if(data.equalsIgnoreCase("Stock OutWord")) {
Intent intent = new Intent(context, StockOutWordActivity.class);
context.startActivity(intent);
}else if(data.equalsIgnoreCase("Create Delivery Slip")){
Intent intent = new Intent(context,CreateDeliverySlip.class);
return;
} else if(data.equalsIgnoreCase("Stock Transfer")){
Intent intent = new Intent(context, StockOutWordActivity.class);
context.startActivity(intent);
}else{
Intent intent = new Intent(context,CreateSaleBill.class);
return;
} else {
Intent intent = new Intent(context, StockTransferActivity.class);
context.startActivity(intent);
}
return;
}
});
}
......@@ -58,16 +86,15 @@ import java.util.ArrayList;
return arrayList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
public class ViewHolder extends RecyclerView.ViewHolder {
public TextView menu_name;
public ImageView menu_image;
public LinearLayout layout;
public ViewHolder(View itemView){
public ViewHolder(View itemView) {
super(itemView);
menu_name = itemView.findViewById(R.id.menu_name);
menu_image = itemView.findViewById(R.id.menu_image);
layout = itemView.findViewById(R.id.layout);
}
}
}
package w.soulofpluto.posstock;
/*
/*
Create by Ramesh Babu
*/
public class Model {
private String delivery_slip_id;
private int manual_discount;
......@@ -15,18 +15,13 @@ public class Model {
public String getDelivery_slip_id() {
return delivery_slip_id;
}
public void setDelivery_slip_id(String delivery_slip_id) {
this.delivery_slip_id = delivery_slip_id;
}
public int getManual_discount() {
return manual_discount;
}
public void setManual_discount(int manual_discount) {
this.manual_discount = manual_discount;
}
}
......@@ -104,21 +104,20 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
plandetails_id.setText(Html.fromHtml(Constants.Plan_Id + plans.getPlanId()));
plandetails_name.setText(Html.fromHtml(Constants.Name+ plans.getName()));
ScanComplete.setOnClickListener(this);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
barcode.setShowSoftInputOnFocus(false);
}
barcode.addTextChangedListener(new AutoChecked());
pieces.setChecked(true);
barcode.setOnFocusChangeListener(new View.OnFocusChangeListener(){
@Override
public void onFocusChange(View view, boolean hasFocus){
barcode.setOnFocusChangeListener((view, hasFocus) -> {
if(!hasFocus){
}else{
Constants.hideSoftKeyboard(barcode,PlanDetails.this);
}
}
});
}
public void PiecesClicked(View view){
boolean checked = ((RadioButton) view).isChecked();
switch(view.getId()){
......@@ -136,6 +135,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
break;
}
}
public void MetersClicked(View view){
boolean checked = ((RadioButton) view).isChecked();
switch (view.getId()){
......@@ -153,6 +153,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
break;
}
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item){
switch (item.getItemId()) {
......@@ -162,6 +163,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
}
return super.onOptionsItemSelected(item);
}
public class AutoChecked implements TextWatcher{
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
......@@ -175,11 +177,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", ""))){
//Constants.getToast(PlanDetails.this, "Already scanned this item");
//barcode.setText("");
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
MediaPlayer mp;
mp = MediaPlayer.create(PlanDetails.this, R.raw.beep);
mp.start();
......@@ -193,16 +191,12 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
TextView message = dialog1.findViewById(R.id.message);
Button ok = dialog1.findViewById(R.id.ok);
message.setText("Already scanned this item");
ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ok.setOnClickListener(view -> {
dialog1.dismiss();
barcode.setFocusable(true);
barcode.requestFocus();
barcode.setText("");
}
});
}
});
return;
}
......@@ -215,12 +209,9 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
}
}else{
if(TextUtils.isEmpty(qty.getText().toString())){
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
barcode.setText("");
Constants.getToast(PlanDetails.this, "Enter Qty");
}
});
}else{
float value = Float.parseFloat(qty.getText().toString());
......@@ -229,9 +220,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
//barcode.setFocusable(false);
if(arrayList.size() > 0){
if (Constants.Existing(arrayList, barcode.getText().toString().replace("\n", ""))) {
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
MediaPlayer mp;
mp = MediaPlayer.create(PlanDetails.this, R.raw.beep);
mp.start();
......@@ -245,16 +234,12 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
TextView message = dialog1.findViewById(R.id.message);
Button ok = dialog1.findViewById(R.id.ok);
message.setText("Already scanned this item");
ok.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
ok.setOnClickListener(view -> {
dialog1.dismiss();
barcode.setFocusable(true);
barcode.requestFocus();
barcode.setText("");
}
});
}
});
return;
}
......@@ -305,7 +290,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
break;
}
}
public void UploadAllBarcodes(String barcodeall,String rack){
public void UploadAllBarcodes(String barcodeAll,String rack){
JSONObject object = new JSONObject();
try{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
......@@ -322,21 +307,18 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
client.setReadTimeout(250, TimeUnit.SECONDS);
client.setWriteTimeout(250, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(barcodeall)
.url(barcodeAll)
.post(body)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.addHeader(getResources().getString(R.string.storeidtoken),preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, final IOException e){
runOnUiThread(new Runnable() {
@Override
public void run(){
runOnUiThread(() -> {
Toast.makeText(PlanDetails.this, e.getMessage(), Toast.LENGTH_SHORT).show();
Constants.ProgressDialogDismiss();
}
});
}
@Override
......@@ -346,49 +328,35 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
final String Response = response.body().string();
Log.e("upload all Response ", Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
handler.post(() -> {
try{
final JSONObject object = new JSONObject(Response);
final JSONObject object1 = new JSONObject(Response);
if(response.code() == 200) {
if (object.getInt(getResources().getString(R.string.success)) == 1) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Constants.getToast(PlanDetails.this, "Uploaded Successfully");
}
});
if (object1.getInt(getResources().getString(R.string.success)) == 1) {
runOnUiThread(() -> Constants.getToast(PlanDetails.this, "Uploaded Successfully"));
finish();
}else if(object.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(new Runnable(){
@Override
public void run(){
}else if(object1.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(() -> {
try{
Constants.getToast(PlanDetails.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(PlanDetails.this, object1.getString(getResources().getString(R.string.msg)));
DoLogin();
}catch(JSONException e){
e.printStackTrace();
}
}
});
}else{
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
try{
Constants.getToast(PlanDetails.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(PlanDetails.this, object1.getString(getResources().getString(R.string.msg)));
}catch(JSONException e){
e.printStackTrace();
}
}
});
}
}
}catch(JSONException e){
e.printStackTrace();
}
}
});
}catch(NullPointerException io){
io.printStackTrace();
......@@ -401,8 +369,8 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
public void UploadBarcode(final String Barcode, final String qty, final String Id){
JSONObject object = new JSONObject();
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
try{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
object.put(getResources().getString(R.string.barcode_upload), Barcode);
object.put(getResources().getString(R.string.rule_id), Id);
object.put(getResources().getString(R.string.quantity_upload), qty);
......@@ -427,12 +395,9 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, final IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
Constants.getToast(PlanDetails.this, e.getMessage());
Constants.ProgressDialogDismiss();
}
});
}
@Override
......@@ -442,14 +407,12 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
final String Response = response.body().string();
Log.e("Upload Barcode", Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
handler.post(() -> {
try{
final JSONObject object = new JSONObject(Response);
final JSONObject object1 = new JSONObject(Response);
if (response.code() == 200) {
if(object.has(getResources().getString(R.string.success))) {
if(object.getInt(getResources().getString(R.string.success)) == 1){
if(object1.has(getResources().getString(R.string.success))) {
if(object1.getInt(getResources().getString(R.string.success)) == 1){
barcode.requestFocus();
Plans plans = new Plans();
plans.setQty(qty);
......@@ -463,22 +426,17 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
barcode_recylerview.setAdapter(planDetailsAdapter);
}
setUI(arrayList);
}else if(object.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(new Runnable() {
@Override
public void run() {
}else if(object1.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(() -> {
try{
Constants.getToast(PlanDetails.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(PlanDetails.this, object1.getString(getResources().getString(R.string.msg)));
DoLogin();
}catch(JSONException e){
e.printStackTrace();
}
}
});
}else{
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
MediaPlayer mp;
mp = MediaPlayer.create(PlanDetails.this, R.raw.beep);
mp.start();
......@@ -492,20 +450,17 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
TextView message = dialog1.findViewById(R.id.message);
Button ok = dialog1.findViewById(R.id.ok);
try{
message.setText(object.getString(getResources().getString(R.string.msg)));
message.setText(object1.getString(getResources().getString(R.string.msg)));
}catch(JSONException e){
e.printStackTrace();
}
ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ok.setOnClickListener(view -> {
dialog1.dismiss();
barcode.setFocusable(true);
barcode.requestFocus();
barcode.setText("");
}
});
}
});
}
}
......@@ -513,7 +468,6 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
} catch (JSONException e) {
e.printStackTrace();
}
}
});
} catch (NullPointerException io) {
io.printStackTrace();
......@@ -553,12 +507,9 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, final IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
Constants.ProgressDialogDismiss();
Constants.getToast(PlanDetails.this, e.getMessage());
}
});
}
@Override
......@@ -571,42 +522,33 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
final JSONObject jsonObject = new JSONObject(res);
if (jsonObject.has(getResources().getString(R.string.success))) {
if(jsonObject.getInt(getResources().getString(R.string.success)) == 1){
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
runOnUiThread(() -> {
try{
Constants.getToast(PlanDetails.this, jsonObject.getString(getResources().getString(R.string.data)));
} catch (JSONException e) {
}catch(JSONException e) {
e.printStackTrace();
}
arrayList.remove(position);
planDetailsAdapter.notifyDataSetChanged();
setUI(arrayList);
}
});
}else if (jsonObject.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(new Runnable() {
@Override
public void run() {
} else if (jsonObject.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(() -> {
try{
Constants.getToast(PlanDetails.this, jsonObject.getString(getResources().getString(R.string.msg)));
DoLogin();
}catch(JSONException e){
e.printStackTrace();
}
}
});
} else{
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
try{
Constants.getToast(PlanDetails.this, jsonObject.getString(getResources().getString(R.string.msg)));
}catch(JSONException e){
e.printStackTrace();
}
}
});
}
}
......@@ -621,15 +563,12 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
}
public void setUI(final ArrayList<Plans> list){
runOnUiThread(new Runnable() {
@Override
public void run() {
runOnUiThread(() -> {
if(list.size() > 0) {
count.setText("Scanned Items : " + list.size());
}else {
count.setText("Scanned Items : 0 ");
}
}
});
}
......@@ -645,10 +584,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
final TextView pass = dialog.findViewById(R.id.relogin_pass);
final Button reLogin = dialog.findViewById(R.id.relogin_submit);
userId.setText(preferenceManager.getUserId());
//pass.setText(preferenceManager.getPassword());
reLogin.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
reLogin.setOnClickListener(view -> {
if(Constants.isNetworkAvailable(PlanDetails.this)){
if(TextUtils.isEmpty(pass.getText().toString())){
Constants.getToast(PlanDetails.this,getResources().getString(R.string.enterPassword));
......@@ -659,7 +595,6 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
}else{
Constants.getToast(PlanDetails.this,getResources().getString(R.string.connection));
}
}
});
}
......@@ -668,7 +603,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
try{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
object.put(getResources().getString(R.string.empid), userId);
object.put(getResources().getString(R.string.password),pass);
object.put(getResources().getString(R.string.password), pass);
object.put(getResources().getString(R.string.storeid), preferenceManager.getStoreId());
object.put(getResources().getString(R.string.dongle),false);
object.put(getResources().getString(R.string.android_version),Constants.VERSION);
......@@ -701,9 +636,7 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
Response = response.body().string();
try{
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run(){
handler.post(() -> {
if(response.code() == 200){
try{
JSONObject obj = new JSONObject(Response);
......@@ -727,7 +660,6 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
}
}else{
}
}
});
}catch(NullPointerException io){
io.printStackTrace();
......@@ -746,16 +678,8 @@ public class PlanDetails extends AppCompatActivity implements View.OnClickListen
}else{
AlertDialog alert = new AlertDialog.Builder(this)
.setTitle("Are you sure you want to close this app")
.setPositiveButton("Yes", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialogInterface, int i){
finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialogInterface, int i){
}
.setPositiveButton("Yes", (dialogInterface, i) -> finish())
.setNegativeButton("No", (dialogInterface, i) -> {
})
.show();
}
......
package w.soulofpluto.posstock;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
/*
/*
Create by Ramesh Babu
*/
public class PlanDetailsAdapter extends RecyclerView.Adapter<PlanDetailsAdapter.ViewHolder> {
private Context context;
private ArrayList<Plans> arrayList;
public PlanDetailsAdapter(Context context, ArrayList<Plans> storesArrayList){
public PlanDetailsAdapter(Context context, ArrayList<Plans> storesArrayList) {
this.context = context;
this.arrayList = storesArrayList;
}
@NonNull
@Override
public PlanDetailsAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
public PlanDetailsAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
View listItem = layoutInflater.inflate(R.layout.plansdetails_item, parent, false);
PlanDetailsAdapter.ViewHolder viewHolder = new PlanDetailsAdapter.ViewHolder(listItem);
return viewHolder;
}
@SuppressLint("ResourceAsColor")
@RequiresApi(api = Build.VERSION_CODES.N)
@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);
holder.plandetails_barcode.setText(items.getBarcode());
holder.plandetails_qty.setText(items.getQty());
Log.e("PlanDetails",items.getPlanId());
holder.plandetails_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try{
if(Constants.isNetworkAvailable(context)){
((PlanDetails) context).DeleteBarcode(items,position);
}else{
Constants.getToast(context,context.getResources().getString(R.string.connection));
holder.planDetails_barcode.setText(items.getBarcode());
holder.plandetails_qty .setText(items.getQty());
//Log.e("PlanDetails",items.getPlanId());
if (items.getSetNumber() == 0) {
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.transparent));
} else if( items.getSetNumber() == 1){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.white));
}else if( items.getSetNumber() == 2){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.darker_gray));
}else if( items.getSetNumber() == 3){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_blue_bright));
}else if( items.getSetNumber() == 4){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_blue_light));
}else if( items.getSetNumber() == 5){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_orange_light));
}else if( items.getSetNumber() == 6){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_purple));
}else if( items.getSetNumber() == 7){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_red_light));
}else if( items.getSetNumber() == 8){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.tab_indicator_text));
}else if( items.getSetNumber() == 9){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_green_light));
}else if( items.getSetNumber() == 10){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_green_dark));
}
}catch(NullPointerException np){
np.printStackTrace();
holder.plandetails_delete.setOnClickListener(view -> {
try {
if (Constants.isNetworkAvailable(context)) {
((StockOutWordActivity) context).DeleteBarcode(items, position,arrayList);
} else {
Constants.getToast(context, context.getResources().getString(R.string.connection));
}
} catch (NullPointerException np) {
np.printStackTrace();
}
});
}
@Override
public int getItemCount(){
public int getItemCount() {
return arrayList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
public TextView plandetails_barcode,plandetails_qty;
ImageView plandetails_delete;
public ViewHolder(View itemView){
public class ViewHolder extends RecyclerView.ViewHolder {
public TextView planDetails_barcode, plandetails_qty;
public ImageView plandetails_delete;
public LinearLayout background_layout;
public ViewHolder(View 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_delete = itemView.findViewById(R.id.plandetails_delete);
background_layout = itemView.findViewById(R.id.background_layout);
}
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package w.soulofpluto.posstock;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Comparator;
/*
Create by Ramesh Babu
......@@ -14,6 +16,47 @@ public class Plans implements Parcelable {
String division;
String Barcode;
String Qty;
Boolean Status;
int ColumnId;
int SetNumber;
public int getSetNumber() {
return SetNumber;
}
public void setSetNumber(int setNumber) {
SetNumber = setNumber;
}
public Boolean getStatus() {
return Status;
}
public void setStatus(Boolean status) {
Status = status;
}
public int getColumnId() {
return ColumnId;
}
public void setColumnId(int columnId) {
ColumnId = columnId;
}
public static Creator<Plans> getCREATOR() {
return CREATOR;
}
public static Comparator<Plans> getSortById() {
return sortById;
}
public static void setSortById(Comparator<Plans> sortById) {
Plans.sortById = sortById;
}
protected Plans(Parcel in) {
PlanId = in.readString();
......@@ -101,6 +144,7 @@ public class Plans implements Parcelable {
parcel.writeString(Barcode);
parcel.writeString(Qty);
}
public static Comparator<Plans> sortById = (t1, t2) -> t2.getColumnId() - t1.getColumnId();
public String toString() {
return Name;
......
......@@ -47,8 +47,6 @@ public class PreferenceManager {
public String getKeyUserLogin(){
return _sharedPrefs.getString(KEY_USER_LOGIN,"");
}
public void setFirstName(String firstName){
_prefsEditor.putString(FIRST_NAME,firstName);
_prefsEditor.apply();
......
......@@ -65,10 +65,6 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
Constants.getToast(SearchByBarcode.this,getResources().getString(R.string.connection));
}
searchbybarcode_spinner.setOnItemSelectedListener(this);
/*
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
searchby_barcode.setShowSoftInputOnFocus(false);
}*/
searchby_barcode.addTextChangedListener(new Checked());
}
......@@ -86,7 +82,7 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
JSONObject object = new JSONObject();
try{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
object.put(getResources().getString(R.string.plan_id),planId);
object.put(getResources().getString(R.string.plan_id), planId);
object.put(getResources().getString(R.string.barcode_upload), Barcode);
object.put(getResources().getString(R.string.android_version),Constants.VERSION);
}
......@@ -109,12 +105,9 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, final IOException e){
runOnUiThread(new Runnable(){
@Override
public void run(){
runOnUiThread(() -> {
Constants.getToast(SearchByBarcode.this, e.getMessage());
Constants.ProgressDialogDismiss();
}
});
}
@Override
......@@ -124,24 +117,22 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
final String Response = response.body().string();
Log.e("Barcode Search", Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run(){
handler.post(() -> {
try{
final JSONObject object = new JSONObject(Response);
final JSONObject object1 = new JSONObject(Response);
if(response.code() == 200) {
if (object.has(getResources().getString(R.string.success))) {
if(object.getInt(getResources().getString(R.string.success)) == 1) {
if (object1.has(getResources().getString(R.string.success))) {
if(object1.getInt(getResources().getString(R.string.success)) == 1) {
Log.e("Length",String.valueOf(getResources().getString(R.string.data).length()));
if(object.has(getResources().getString(R.string.data))){
if(object.getString(getResources().getString(R.string.msg)).equalsIgnoreCase("no data found")){
if(object1.has(getResources().getString(R.string.data))){
if(object1.getString(getResources().getString(R.string.msg)).equalsIgnoreCase("no data found")){
searchby_barcode.setText("");
searchbybarcode_rack.setText(object.getString(getResources().getString(R.string.msg)));
searchbybarcode_rack.setText(object1.getString(getResources().getString(R.string.msg)));
//Constants.getToast(SearchByBarcode.this, object.getString(getResources().getString(R.string.msg)));
}else{
searchby_barcode.setText("");
try{
JSONObject jsonObject = object.getJSONObject(getResources().getString(R.string.data));
JSONObject jsonObject = object1.getJSONObject(getResources().getString(R.string.data));
searchbybarcode_rack.setText(Html.fromHtml(Constants.Id) + jsonObject.getString("rack_id") + "\n"
+ (Html.fromHtml(Constants.Barcode) + jsonObject.getString("barcode")) + "\n"
+ (Html.fromHtml(Constants.From) + jsonObject.getString("scanning_start_at")) + "\n"
......@@ -151,20 +142,17 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
}
}
}
}else if(object.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(new Runnable(){
@Override
public void run(){
}else if(object1.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(() -> {
try{
Constants.getToast(SearchByBarcode.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(SearchByBarcode.this, object1.getString(getResources().getString(R.string.msg)));
}catch(JSONException e){
e.printStackTrace();
}
}
});
}else{
try{
Constants.getToast(SearchByBarcode.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(SearchByBarcode.this, object1.getString(getResources().getString(R.string.msg)));
}catch(JSONException e){
e.printStackTrace();
}
......@@ -174,7 +162,6 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}catch(NullPointerException io){
io.printStackTrace();
......@@ -184,7 +171,6 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
}
});
}
public class Checked implements TextWatcher{
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2){
......@@ -231,10 +217,9 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
Date from = getDateWithOffset(-Constants.Value, new Date());
String fromDate = currentDate.format(from);
String thisDate = currentDate.format(todayDate);
Log.e("Last date",fromDate);
object.put(getResources().getString(R.string.auditstatus),"In Progress");
object.put(getResources().getString(R.string.fromdate),fromDate);
object.put(getResources().getString(R.string.todate),thisDate);
object.put(getResources().getString(R.string.fromdate), fromDate);
object.put(getResources().getString(R.string.todate), thisDate);
}
}catch(JSONException e){
e.printStackTrace();
......@@ -249,18 +234,15 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
.url(Url)
.post(body)
.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())
.build();
client.newCall(request).enqueue(new Callback(){
@Override
public void onFailure(Request request, final IOException e){
runOnUiThread(new Runnable(){
@Override
public void run(){
runOnUiThread(() -> {
Constants.getToast(SearchByBarcode.this,e.getMessage());
Constants.ProgressDialogDismiss();
}
});
}
@Override
......@@ -268,25 +250,23 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
try{
Constants.ProgressDialogDismiss();
final String Response = response.body().string();
Log.e("SearchByBarcode" , Response);
Log.e("SearchByBarcode" , Response );
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run(){
handler.post(() -> {
try{
if(response.code() == 200){
final JSONObject object = new JSONObject(Response);
if(object.has(getResources().getString(R.string.success))){
final JSONObject object1 = new JSONObject(Response);
if(object1.has(getResources().getString(R.string.success))){
arrayList = new ArrayList<>();
if(object.getInt(getResources().getString(R.string.success)) == 1){
if(object.has(getResources().getString(R.string.data))){
if(object1.getInt(getResources().getString(R.string.success)) == 1){
if(object1.has(getResources().getString(R.string.data))){
arrayList.clear();
Plans plan = new Plans();
plan.setPlanId("0");
plan.setName("Select PlanId");
arrayList.add(plan);
JSONArray jsonArray = object.getJSONArray(getResources().getString(R.string.data));
for (int i = 0; i < jsonArray.length(); i++) {
JSONArray jsonArray = object1.getJSONArray(getResources().getString(R.string.data));
for(int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Plans plans = new Plans();
plans.setPlanId(String.valueOf(jsonObject.getInt("id")));
......@@ -295,28 +275,22 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
}
ArrayAdapter<Plans> adapter = new ArrayAdapter<Plans>(SearchByBarcode.this, android.R.layout.simple_dropdown_item_1line, arrayList);
searchbybarcode_spinner.setAdapter(adapter);
}else if (object.has(getResources().getString(R.string.msg))){
runOnUiThread(new Runnable() {
@Override
public void run() {
}else if (object1.has(getResources().getString(R.string.msg))){
runOnUiThread(() -> {
try{
Constants.getToast(SearchByBarcode.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(SearchByBarcode.this, object1.getString(getResources().getString(R.string.msg)));
}catch(JSONException e){
e.printStackTrace();
}
}
});
}
}else if(object.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(new Runnable() {
@Override
public void run() {
}else if(object1.getInt(getResources().getString(R.string.success)) == 3){
runOnUiThread(() -> {
try{
Constants.getToast(SearchByBarcode.this, object.getString(getResources().getString(R.string.msg)));
Constants.getToast(SearchByBarcode.this, object1.getString(getResources().getString(R.string.msg)));
}catch(JSONException e) {
e.printStackTrace();
}
}
});
preferenceManager.setUserId("");
preferenceManager.setLogged(false);
......@@ -329,7 +303,6 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
}catch(JSONException e){
e.printStackTrace();
}
}
});
}catch(NullPointerException io){
io.printStackTrace();
......@@ -339,7 +312,6 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
}
});
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l){
switch (adapterView.getId()){
......@@ -348,7 +320,6 @@ import static w.soulofpluto.posstock.Constants.getDateWithOffset;
planid = plan.PlanId;
Log.e("Search by barcode ===>",planid);
if(planid.equalsIgnoreCase("0")){
//Constants.getToast(RackWiseQty.this,"Please Choose PlanId");
searchbybarcode_rack.setText("");
}else{
searchbybarcode_rack.setText("");
......
......@@ -2,16 +2,13 @@ package w.soulofpluto.posstock;
import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.FirebaseApp;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
/*
Create by Ramesh Babu
......@@ -21,83 +18,55 @@ public class SplashActivity extends AppCompatActivity{
PreferenceManager preferenceManager;
BluetoothAdapter bluetoothAdapter;
private int REQUEST_ENABLE_BT = 1;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState){
setContentView(R.layout.activity_splash);
preferenceManager = new PreferenceManager(this);
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
FirebaseApp.initializeApp(this);
//FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
//FirebaseApp.getInstance().setAutomaticResourceManagementEnabled(true);
//FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
//FirebaseApp.getInstance().
if(bluetoothAdapter!=null && bluetoothAdapter.isEnabled()){
runOnUiThread(() -> splashMethod());
//throw new RuntimeException("Test Crash");
}else{
//Constants.getToast(this,"Please Enable your bluetooth device");
try {
try{
showDialog("Please Enable your bluetooth device");
} catch (Exception e) {
}catch(Exception e){
e.printStackTrace();
}
}
super.onCreate(savedInstanceState);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
protected void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_ENABLE_BT) {
if (resultCode == RESULT_OK) {
if(requestCode == REQUEST_ENABLE_BT){
if(resultCode == RESULT_OK){
Constants.getToast(this,"BlueTooth Turned On");
runOnUiThread(new Runnable(){
@Override
public void run(){
splashMethod();
}
});
//Toast.makeText(MainActivity.this, "BlueTooth Turned On", Toast.LENGTH_LONG).show();
} else {
//Toast.makeText(MainActivity.this, "Cancelled", Toast.LENGTH_LONG).show();
runOnUiThread(() -> splashMethod());
}else{
Constants.getToast(this,"Cancelled");
}
}
}
public void showDialog(final String phone) throws Exception
{
public void showDialog(final String phone){
AlertDialog.Builder builder = new AlertDialog.Builder(SplashActivity.this);
builder.setMessage(phone);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
builder.setPositiveButton("OK", (dialog, which) -> {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
dialog.dismiss();
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dialog.dismiss();
}
});
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.dismiss());
builder.show();
}
public void splashMethod(){
Handler handler = new Handler();
Runnable runnable = new Runnable(){
@Override
public void run(){
//TODO Auto-generated method stub
/*startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();*/
Runnable runnable = () -> {
if(preferenceManager.isLogged()){
startActivity(new Intent(SplashActivity.this, HomeActivity.class));
finish();
......@@ -105,7 +74,6 @@ public class SplashActivity extends AppCompatActivity{
startActivity(new Intent(SplashActivity.this, Login.class));
finish();
}
}
};
handler.postDelayed(runnable, 2500);
}
......
package w.soulofpluto.posstock;
/*
Create by Ramesh Babu
*/
public class State {
int state_Id;
String state_Name;
public int getState_Id() {
return state_Id;
}
public void setState_Id(int state_Id) {
this.state_Id = state_Id;
}
public String getState_Name() {
return state_Name;
}
public void setState_Name(String state_Name) {
this.state_Name = state_Name;
}
@Override
public String toString() {
return state_Name;
}
}
package w.soulofpluto.posstock;
/*
Create by Ramesh Babu
*/
public class StockBarcode {
String barcode;
int qty;
int stock_point_id;
boolean status;
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public int getQty() {
return qty;
}
public void setQty(int qty) {
this.qty = qty;
}
public int getStock_point_id() {
return stock_point_id;
}
public void setStock_point_id(int stock_point_id) {
this.stock_point_id = stock_point_id;
}
}
package w.soulofpluto.posstock;
import android.app.AlertDialog;
import android.app.Dialog;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import static w.soulofpluto.posstock.Constants.JSON;
/*
Create by Ramesh Babu
*/
public class StockOutWordActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
Toolbar stockOut_toolbar;
PreferenceManager preferenceManager;
String Response, uomText;
ArrayList<State> stateArrayList;
ArrayList<Format> formatArrayList;
ArrayList<StoreFormat> storeFormatArrayList;
Spinner state_spinner, format_spinner, location_spinner, uom_spinner;
int state_Id, format_Id, location_Id;
EditText qty, barcode;
String Store_Point_Id;
String[] uom = {"Units", "Meters"};
ArrayList<StockBarcode> StockBarcodeArrayList;
ArrayList<Plans> arrayList;
RecyclerView stockOutWord_recyclerView;
PlanDetailsAdapter planDetailsAdapter;
Dialog dialog;
Menu menu;
TextView total_boxes, total_lines, total_qty;
HashMap<Integer, ArrayList<Plans>> hashMap;
MediaPlayer mp;
int max = 10;
int min = 0;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_stockout);
setUI();
if (Constants.isNetworkAvailable(StockOutWordActivity.this)) {
getCall();
ArrayAdapter<String> adapter = new ArrayAdapter<>(StockOutWordActivity.this, android.R.layout.simple_list_item_1, uom);
uom_spinner.setAdapter(adapter);
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, getResources().getString(R.string.nonetwork)));
}
super.onCreate(savedInstanceState);
}
void setUI() {
total_boxes = findViewById(R.id.total_boxes);
total_lines = findViewById(R.id.total_lines);
total_qty = findViewById(R.id.total_qty);
stockOut_toolbar = findViewById(R.id.stockout_toolbar);
state_spinner = findViewById(R.id.state_spinner);
format_spinner = findViewById(R.id.format_spinner);
location_spinner = findViewById(R.id.location_spinner);
uom_spinner = findViewById(R.id.uom);
barcode = findViewById(R.id.barcode);
qty = findViewById(R.id.qty);
preferenceManager = new PreferenceManager(StockOutWordActivity.this);
stateArrayList = new ArrayList<>();
formatArrayList = new ArrayList<>();
storeFormatArrayList = new ArrayList<>();
StockBarcodeArrayList = new ArrayList<>();
arrayList = new ArrayList<>();
hashMap = new HashMap<>();
stockOutWord_recyclerView = findViewById(R.id.stockOutWord_recyclerView);
setSupportActionBar(stockOut_toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.stock_out));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
state_spinner .setOnItemSelectedListener(this);
format_spinner .setOnItemSelectedListener(this);
uom_spinner .setOnItemSelectedListener(this);
location_spinner .setOnItemSelectedListener(this);
barcode .requestFocus();
barcode .addTextChangedListener(new Checked());
barcode . setOnFocusChangeListener((view, hasFocus) -> {
if (!hasFocus) {
} else {
Constants.hideSoftKeyboard(barcode, StockOutWordActivity.this);
}
});
}
void getNotification() {
runOnUiThread(() -> {
mp = MediaPlayer.create(StockOutWordActivity.this, R.raw.beep);
if (mp != null && mp.isPlaying()) {
mp.stop();
try {
mp.prepare();
mp.start();
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalStateException e1) {
e1.printStackTrace();
} catch (NullPointerException np) {
np.printStackTrace();
}
} else {
try {
mp.start();
} catch (IllegalStateException il) {
il.printStackTrace();
} catch (NullPointerException n) {
n.printStackTrace();
}
}
final Dialog dialog1 = new Dialog(this);
dialog1.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog1.setContentView(R.layout.activity_dialog);
dialog1.setCancelable(false);
dialog1.setCanceledOnTouchOutside(false);
dialog1.getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
dialog1.show();
TextView message = dialog1.findViewById(R.id.message);
Button ok = dialog1.findViewById(R.id.ok);
message.setText("Already scanned this item");
ok.setOnClickListener(view -> {
dialog1.dismiss();
barcode.setFocusable(true);
barcode.requestFocus();
barcode.setText("");
try {
if (mp != null && mp.isPlaying()) {
mp.stop();
mp.release();
}
} catch (IllegalStateException ise) {
ise.printStackTrace();
} catch (NullPointerException npe) {
npe.printStackTrace();
}
});
});
}
@Override
public void onBackPressed() {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Stock OutWord");
alert.setMessage("Are you want to close app");
alert.setPositiveButton("Ok", (dialogInterface, i) -> {
super.onBackPressed();
});
alert.setNegativeButton("Cancel", (dialogInterface, i) -> {
});
alert.show();
}
public class Checked implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onTextChanged(CharSequence val, int i, int i1, int i2) {
try {
if (!TextUtils.isEmpty(barcode.getText().toString())) {
if (val.toString().length() > 0) {
if (val.toString().contains("\n")) {
if (Constants.isNetworkAvailable(StockOutWordActivity.this)) {
if (arrayList.size() > 0) {
if (Constants.Existing(arrayList, barcode.getText().toString().replace("\n", ""))) {
try {
getNotification();
} catch (Exception e) {
e.printStackTrace();
}
return;
}
}
if (state_Id != 0) {
UploadBarcode(barcode.getText().toString().replace("\n", ""), qty.getText().toString(), location_Id);
Constants.ProgressDialogShow(StockOutWordActivity.this);
barcode.setText("");
} else {
Constants.getToast(StockOutWordActivity.this, "Please Select StateId");
}
} else {
Constants.getToast(StockOutWordActivity.this, getResources().getString(R.string.connection));
}
}
}
}
} catch (NullPointerException jo) {
jo.getMessage();
}
}
@Override
public void afterTextChanged(Editable editable) {
}
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
break;
case R.id.Outword_box:
if (arrayList.size() > 0) {
ArrayList<Plans> tempArrayList = new ArrayList<>();
Random r = new Random();
//int i1 = r.nextInt(10 - 0) + 1;
int i1 = (int) (Math.random() * (max - min + 1) + min);
for (int i = 0; i < arrayList.size(); i++) {
Plans plans = arrayList.get(i);
if (plans.getStatus()) {
} else {
plans.setStatus(true);
plans.setSetNumber(i1);
Log.e("Random Number :", String.valueOf(i1));
tempArrayList.add(plans);
}
}
planDetailsAdapter.notifyDataSetChanged();
if (hashMap.size() > 0) {
hashMap.put(hashMap.size(), tempArrayList);
} else {
hashMap.put(0, tempArrayList);
}
}
setUpdateUI();
menu.findItem(R.id.Outword_box).setVisible(false);
menu.findItem(R.id.Outword_tfs).setVisible(true);
break;
case R.id.Outword_tfs:
menu.findItem(R.id.Outword_box).setVisible(false);
menu.findItem(R.id.Outword_tfs).setVisible(false);
JSONObject json = new JSONObject();
try {
json.put("from_location", preferenceManager.getStoreId());
json.put("to_location", String.valueOf(location_Id));
JSONArray jsonArray = new JSONArray();
for (Map.Entry<Integer, ArrayList<Plans>> item1 : hashMap.entrySet()) {
int key = item1.getKey();
ArrayList<Plans> value = item1.getValue();
JSONArray jsonArray1 = new JSONArray();
for (Plans plan : value) {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("barcode", plan.Barcode);
jsonObject.put("quantity", "1.0");
} catch (JSONException e) {
e.printStackTrace();
}
jsonArray1.put(jsonObject);
}
jsonArray.put(jsonArray1);
}
Log.e("JsonArray ", jsonArray.toString());
json.put("boxes", jsonArray);
json.put("stock_point_id", Store_Point_Id);
json.put("return_to_vendor", false);
RequestBody body = RequestBody.create(JSON, json.toString());
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(250, TimeUnit.SECONDS);
client.setReadTimeout(250, TimeUnit.SECONDS);
client.setWriteTimeout(250, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.StockTransfer)
.post(body)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, final IOException e) {
runOnUiThread(() -> {
Constants.getToast(StockOutWordActivity.this, e.getMessage());
Constants.ProgressDialogDismiss();
});
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
try {
Constants.ProgressDialogDismiss();
final String Response = response.body().string();
Log.e("Upload Barcode", Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
try {
final JSONObject object1 = new JSONObject(Response);
if (response.code() == 200) {
if (object1.has(getResources().getString(R.string.success))) {
if (object1.getInt(getResources().getString(R.string.success)) == 1) {
menu.findItem(R.id.Outword_tfs).setVisible(false);
menu.findItem(R.id.Outword_box).setVisible(false);
barcode.requestFocus();
Constants.getToast(StockOutWordActivity.this, object1.getString(getResources().getString(R.string.msg)));
hashMap.clear();
arrayList.clear();
planDetailsAdapter.notifyDataSetChanged();
total_boxes.setText("Total Boxes : 0");
total_lines.setText("Total Lines : 0");
total_qty.setText("Total Qty : 0");
} else if (object1.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try {
Constants.getToast(StockOutWordActivity.this, object1.getString(getResources().getString(R.string.msg)));
} catch (JSONException e) {
e.printStackTrace();
}
});
} else {
Constants.getToast(StockOutWordActivity.this, object1.getString(getResources().getString(R.string.msg)));
}
}
}
} catch (JSONException e) {
e.printStackTrace();
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
} catch (JSONException e) {
e.printStackTrace();
}
break;
}
return super.onOptionsItemSelected(item);
}
public void getCall() {
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.ToState)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new com.squareup.okhttp.Callback() {
@Override
public void onFailure(Request request, IOException e) {
Constants.ProgressDialogDismiss();
if (e.getCause() != null && e.getCause() instanceof UnknownHostException) {
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, e.getMessage()));
}
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
Constants.ProgressDialogDismiss();
Response = response.body().string();
//Log.e("GET CALL =====>", Response);
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
try {
JSONObject obj = new JSONObject(Response);
if (obj.has(getResources().getString(R.string.success))) {
stateArrayList.clear();
State state = new State();
state.setState_Id(0);
state.setState_Name("Select");
stateArrayList.add(state);
if (obj.getInt(getResources().getString(R.string.success)) == 1) {
Log.e("Response =====>", obj.toString());
JSONArray jsonArray = obj.getJSONArray("data");
for(int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
State state1 = new State();
state1.setState_Id(jsonObject.getInt("state_id"));
state1.setState_Name(jsonObject.getString("state_name"));
stateArrayList.add(state1);
}
ArrayAdapter<State> stateArrayAdapter = new ArrayAdapter<>(StockOutWordActivity.this, android.R.layout.simple_list_item_1, stateArrayList);
state_spinner.setAdapter(stateArrayAdapter);
} else if (obj.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try{
Login.logout(StockOutWordActivity.this);
Constants.getToast(StockOutWordActivity.this, obj.getString("msg"));
}catch(JSONException e) {
e.printStackTrace();
}
});
} else {
runOnUiThread(() -> {
try{
Constants.getToast(StockOutWordActivity.this, obj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
}
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, Response));
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
public void UploadBarcode(final String Barcode, final String qty, final int Id) {
JSONObject object = new JSONObject();
try{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
object.put(getResources().getString(R.string.barcode_upload), Barcode);
object.put(getResources().getString(R.string.quantity_upload), qty);
object.put(getResources().getString(R.string.stock_point), Store_Point_Id);
}
}catch(JSONException e){
e.printStackTrace();
}
Log.e("Upload Barcode", object.toString());
RequestBody body = RequestBody.create(JSON, object.toString());
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(250, TimeUnit.SECONDS);
client.setReadTimeout(250, TimeUnit.SECONDS);
client.setWriteTimeout(250, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.CheckBarcodeQty)
.post(body)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, final IOException e) {
runOnUiThread(() -> {
Constants.getToast(StockOutWordActivity.this, e.getMessage());
Constants.ProgressDialogDismiss();
});
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
try {
Constants.ProgressDialogDismiss();
final String Response = response.body().string();
Log.e("Upload Barcode", Response);
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
try {
final JSONObject object1 = new JSONObject(Response);
if (response.code() == 200) {
if (object1.has(getResources().getString(R.string.success))) {
if (object1.getInt(getResources().getString(R.string.success)) == 1) {
menu.findItem(R.id.Outword_tfs).setVisible(false);
menu.findItem(R.id.Outword_box).setVisible(true);
barcode.requestFocus();
Plans plans = new Plans();
plans.setQty(qty);
plans.setPlanId(Store_Point_Id);
plans.setBarcode(Barcode);
plans.setStatus(false);
plans.setSetNumber(0);
if (arrayList.size() > 0) {
plans.setColumnId(arrayList.size() + 1);
} else {
plans.setColumnId(1);
}
arrayList.add(plans);
setUpdateUI();
Collections.sort(arrayList, Plans.getSortById());
if (arrayList.size() > 0) {
runOnUiThread(() -> {
planDetailsAdapter = new PlanDetailsAdapter(StockOutWordActivity.this, arrayList);
stockOutWord_recyclerView.setLayoutManager(new LinearLayoutManager(StockOutWordActivity.this));
stockOutWord_recyclerView.setAdapter(planDetailsAdapter);
});
}
} else if (object1.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try {
Constants.getToast(StockOutWordActivity.this, object1.getString(getResources().getString(R.string.msg)));
DoLogin();
} catch (JSONException e) {
e.printStackTrace();
}
});
} else {
Constants.getToast(StockOutWordActivity.this, object1.getString(getResources().getString(R.string.msg)));
}
}
}
} catch (JSONException e) {
e.printStackTrace();
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
private void DoLogin() {
dialog = new Dialog(StockOutWordActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_session);
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
dialog.show();
final TextView userId = dialog.findViewById(R.id.relogin_userid);
final TextView pass = dialog.findViewById(R.id.relogin_pass);
final Button reLogin = dialog.findViewById(R.id.relogin_submit);
userId.setText(preferenceManager.getUserId());
reLogin.setOnClickListener(view -> {
if (Constants.isNetworkAvailable(StockOutWordActivity.this)) {
if (TextUtils.isEmpty(pass.getText().toString())) {
Constants.getToast(StockOutWordActivity.this, getResources().getString(R.string.enterPassword));
} else {
doLogin(preferenceManager.getUserId(), Constants.getSHA256(pass.getText().toString()));
Constants.ProgressDialogShow(StockOutWordActivity.this);
}
} else {
Constants.getToast(StockOutWordActivity.this, getResources().getString(R.string.connection));
}
});
}
private void doLogin(String userId, String pass) {
JSONObject object = new JSONObject();
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
object.put(getResources().getString(R.string.empid), userId);
object.put(getResources().getString(R.string.password), pass);
object.put(getResources().getString(R.string.storeid), preferenceManager.getStoreId());
object.put(getResources().getString(R.string.dongle), false);
object.put(getResources().getString(R.string.android_version), Constants.VERSION);
}
} catch (JSONException e) {
e.printStackTrace();
}
RequestBody body = RequestBody.create(JSON, object.toString());
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(100, TimeUnit.SECONDS);
client.setReadTimeout(100, TimeUnit.SECONDS);
client.setWriteTimeout(100, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.Login)
.post(body)
.addHeader(Constants.Type, Constants.App_json)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
if (e.getCause() != null && e.getCause() instanceof UnknownHostException) {
} else {
Log.e("error ====>", e.getMessage());
}
Constants.ProgressDialogDismiss();
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
Constants.ProgressDialogDismiss();
Response = response.body().string();
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
try {
JSONObject obj = new JSONObject(Response);
if (obj.has(getResources().getString(R.string.success))) {
if (obj.getInt(getResources().getString(R.string.success)) == 1) {
JSONObject data = obj.getJSONObject(getResources().getString(R.string.data));
preferenceManager.setUserId(data.getString(getResources().getString(R.string.empid)));
preferenceManager.setCustToken(data.getString(getResources().getString(R.string.usertoken)));
preferenceManager.setStoreId(data.getString(getResources().getString(R.string.storeid)));
preferenceManager.setPrefix(data.getString(getResources().getString(R.string.prefix)));
preferenceManager.setLogged(true);
dialog.dismiss();
} else {
Constants.getToast(StockOutWordActivity.this, obj.getString(getResources().getString(R.string.msg)));
}
}
} catch (JSONException e) {
e.printStackTrace();
} catch (NullPointerException np) {
np.printStackTrace();
}
} else {
Constants.getToast(StockOutWordActivity.this, Response);
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
@RequiresApi(api = Build.VERSION_CODES.N)
public void DeleteBarcode(final Plans plans1, final int position, ArrayList<Plans> plansArrayList) {
int k = 0;
for(int i = 0; i<arrayList.size(); i++){
Plans plans = arrayList.get(i);
if (plans.getStatus()) {
if( k > 1 ){
menu.findItem(R.id.Outword_tfs).setVisible(false);
}else{
menu.findItem(R.id.Outword_tfs).setVisible(true);
}
} else {
if( k > 0 ) {
menu.findItem(R.id.Outword_box).setVisible(true);
}else {
menu.findItem(R.id.Outword_box).setVisible(false);
}
k++;
}
}
arrayList.remove(position);
planDetailsAdapter.notifyDataSetChanged();
if (arrayList.size() > 0) {
ArrayList<Integer> tempArrayList = new ArrayList<>();
for (int i = 0; i < arrayList.size(); i++) {
Plans plans = arrayList.get(i);
if (plans.getStatus()) {
} else {
tempArrayList.add(1);
}
}
runOnUiThread(() -> {
total_qty.setText("Total Qty :" + arrayList.size());
total_lines.setText("Total Lines :" + tempArrayList.size());
});
synchronized (hashMap) {
try {
Iterator<Integer> it1 = hashMap.keySet().iterator();
while (it1.hasNext()) {
int key = it1.next();
ArrayList<Plans> value = hashMap.get(key);
if (value.size() == 1) {
Plans plans = value.get(0);
if (plans.getBarcode().equalsIgnoreCase(plans1.Barcode)) {
hashMap.remove(key);
}
} else if (value.size() > 1) {
for (Plans plan : value) {
if (plan.getBarcode().equalsIgnoreCase(plans1.Barcode)) {
value.remove(plan);
}
}
}
}
} catch (ConcurrentModificationException ce) {
ce.getMessage();
}
}
//Log.e("HashMap Items =====>", String.valueOf(hashMap.size()));
runOnUiThread(() -> total_boxes.setText("Total Boxes :" + hashMap.size()));
} else {
runOnUiThread(() -> {
total_qty.setText("Total Qty : 0");
total_lines.setText("Total Lines : 0");
total_boxes.setText("Total Boxes : 0");
hashMap.clear();
menu.findItem(R.id.Outword_box).setVisible(false);
menu.findItem(R.id.Outword_tfs).setVisible(false);
});
}
if (hashMap.size() > 0 && plansArrayList.size() > 0) {
runOnUiThread(() -> total_boxes.setText("Total Boxes :" + hashMap.size()));
}
}
@Override
public boolean onCreateOptionsMenu(Menu myMenu) {
getMenuInflater().inflate(R.menu.menu_item, myMenu);
this.menu = myMenu;
menu.findItem(R.id.Outword_tfs).setVisible(false);
menu.findItem(R.id.Outword_box).setVisible(false);
return super.onCreateOptionsMenu(menu);
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
switch (adapterView.getId()) {
case R.id.state_spinner:
State state = stateArrayList.get(i);
state_Id = stateArrayList.get(i).state_Id;
Log.e("Id ====>", state.state_Name);
if (!state.getState_Name().equalsIgnoreCase("Select")) {
getFormatAPI(state_Id);
}
break;
case R.id.format_spinner:
Format format = formatArrayList.get(i);
format_Id = formatArrayList.get(i).pos_store_format_id;
Log.e("Format ====>", String.valueOf(format.pos_store_format_id));
if (!format.getStore_format().equalsIgnoreCase("Select")) {
getStateFormatAPI(state_Id, format_Id);
}
break;
case R.id.location_spinner:
StoreFormat storeFormat = storeFormatArrayList.get(i);
if (!storeFormat.getStore_name().equalsIgnoreCase("Select")) {
location_Id = storeFormat.Id;
getStorePointId(preferenceManager.getStoreId());
} else {
runOnUiThread(() -> {
Constants.getToast(StockOutWordActivity.this, "Please Select Location Name");
});
}
break;
case R.id.uom:
uomText = uom_spinner.getSelectedItem().toString();
if (uomText.equalsIgnoreCase("units")) {
qty.setEnabled(false);
qty.setText("1");
} else {
qty.setText("");
qty.setEnabled(true);
}
break;
}
}
private void getStorePointId(String storeId) {
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url (Constants.StockPointId + storeId)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new com.squareup.okhttp.Callback() {
@Override
public void onFailure(Request request, IOException e) {
Constants.ProgressDialogDismiss();
if (e.getCause() != null && e.getCause() instanceof UnknownHostException) {
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, e.getMessage()));
}
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
Constants.ProgressDialogDismiss();
Response = response.body().string();
Log.e("StateFormat =====>", Response);
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
try {
JSONObject jsonObject = new JSONObject(Response);
if (jsonObject.has("data")) {
Store_Point_Id = jsonObject.getString("data");
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, Response));
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
private void getStateFormatAPI(int state_id, int format_id) {
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.ToStoreFormat + state_id + "/" + format_id)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new com.squareup.okhttp.Callback() {
@Override
public void onFailure(Request request, IOException e) {
Constants.ProgressDialogDismiss();
if (e.getCause() != null && e.getCause() instanceof UnknownHostException) {
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, e.getMessage()));
}
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
Constants.ProgressDialogDismiss();
Response = response.body().string();
Log.e("StateFormat =====>", Response);
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
try {
JSONObject obj = new JSONObject(Response);
if (obj.has(getResources().getString(R.string.success))) {
storeFormatArrayList.clear();
StoreFormat storeFormat = new StoreFormat();
storeFormat.setId(0);
storeFormat.setStore_name("Select");
storeFormatArrayList.add(storeFormat);
if (obj.getInt(getResources().getString(R.string.success)) == 1) {
Log.e("Response =====>", obj.toString());
JSONArray jsonArray = obj.getJSONArray("data");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
StoreFormat format1 = new StoreFormat();
format1.setId(jsonObject.getInt("id"));
format1.setStore_name(jsonObject.getString("store_name"));
storeFormatArrayList.add(format1);
}
ArrayAdapter<StoreFormat> stateArrayAdapter = new ArrayAdapter<>(StockOutWordActivity.this, android.R.layout.simple_list_item_1, storeFormatArrayList);
location_spinner.setAdapter(stateArrayAdapter);
} else if (obj.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try {
Login.logout(StockOutWordActivity.this);
Constants.getToast(StockOutWordActivity.this, obj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
} else {
runOnUiThread(() -> {
try {
Constants.getToast(StockOutWordActivity.this, obj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
}
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, Response));
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
private void getFormatAPI(int state_id) {
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.ToFormat + state_id)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new com.squareup.okhttp.Callback() {
@Override
public void onFailure(Request request, IOException e) {
Constants.ProgressDialogDismiss();
if (e.getCause() != null && e.getCause() instanceof UnknownHostException) {
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, e.getMessage()));
}
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
Constants.ProgressDialogDismiss();
Response = response.body().string();
Log.e("To Format =====>", Response);
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
try {
JSONObject obj = new JSONObject(Response);
if (obj.has(getResources().getString(R.string.success))) {
formatArrayList.clear();
Format format = new Format();
format.setPos_store_format_id(0);
format.setStore_format("Select");
formatArrayList.add(format);
if (obj.getInt(getResources().getString(R.string.success)) == 1) {
Log.e("Response =====>", obj.toString());
JSONArray jsonArray = obj.getJSONArray("data");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Format format1 = new Format();
format1.setPos_store_format_id(jsonObject.getInt("pos_store_format_id"));
format1.setStore_format(jsonObject.getString("store_format"));
formatArrayList.add(format1);
}
ArrayAdapter<Format> stateArrayAdapter = new ArrayAdapter<>(StockOutWordActivity.this, android.R.layout.simple_list_item_1, formatArrayList);
format_spinner.setAdapter(stateArrayAdapter);
} else if (obj.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try {
Login.logout(StockOutWordActivity.this);
Constants.getToast(StockOutWordActivity.this, obj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
} else {
runOnUiThread(() -> {
try {
Constants.getToast(StockOutWordActivity.this, obj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
}
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
runOnUiThread(() -> Constants.getToast(StockOutWordActivity.this, Response));
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
void setUpdateUI() {
if (arrayList.size() > 0) {
total_qty.setText("Total Qty :" + arrayList.size());
ArrayList<Integer> tempArrayList = new ArrayList<>();
for (int i = 0; i < arrayList.size(); i++) {
Plans plans = arrayList.get(i);
if (plans.getStatus()) {
} else {
tempArrayList.add(1);
}
}
total_lines.setText("Total Lines :" + tempArrayList.size());
}
if (hashMap.size() > 0) {
total_boxes.setText("Total Boxes :" + hashMap.size());
}
}
}
package w.soulofpluto.posstock;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import static w.soulofpluto.posstock.Constants.JSON;
import static w.soulofpluto.posstock.Constants.JsonFormatData;
/*
Create by Ramesh Babu
*/
public class StockReceived extends AppCompatActivity implements View.OnClickListener {
EditText tfSid;
Toolbar StockReceived_toolbar;
PreferenceManager preferenceManager;
String Response;
ArrayList<BoxInfo> boxInfoArrayList;
RecyclerView StockReceived_recyclerView;
TextView transfer_qty, pending_qty, received_qty;
String value;
StockReceivedAdapter adapter;
Button stock_received;
static int val1, val2, val3;
String Tfs_Id, Box_Id;
TextView tfs_Number;
static void startData(Context context, String data) {
Intent intent = new Intent(context, StockReceived.class);
intent.putExtra("key", data);
context.startActivity(intent);
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stock_received);
tfSid = findViewById(R.id.tfsid);
tfs_Number = findViewById(R.id.tfs_Number);
StockReceived_recyclerView = findViewById(R.id.stockReceived_recylerView);
StockReceived_toolbar = findViewById(R.id.stockReceived_toolbar);
transfer_qty = findViewById(R.id.transfer_qty);
pending_qty = findViewById(R.id.pending_qty);
received_qty = findViewById(R.id.received_qty);
stock_received = findViewById(R.id.stock_received);
preferenceManager = new PreferenceManager(StockReceived.this);
boxInfoArrayList = new ArrayList<>();
tfSid.addTextChangedListener(new Checked());
stock_received.setOnClickListener(this);
try {
if(getIntent().getStringExtra("key") != null) {
value = getIntent().getStringExtra("key");
setSupportActionBar(StockReceived_toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.stock_received) + " | " + value);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getCall();
}
} catch (NullPointerException np) {
np.printStackTrace();
}
}
void getCall() {
if (Constants.isNetworkAvailable(StockReceived.this)) {
PostRequest(value);
Log.e("Perform1 ========>", value);
} else {
Constants.getToast(StockReceived.this, getResources().getString(R.string.nonetwork));
}
}
@Override
protected void onStart() {
super.onStart();
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch(item.getItemId()) {
case android.R.id.home:
finish();
break;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.stock_received:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
String str[] = received_qty.getText().toString().split(":");
if(!str[1].trim().equalsIgnoreCase("0") && boxInfoArrayList.stream().map(BoxInfo::getStatus).anyMatch(Boolean.TRUE::equals)) {
try{
//Log.e("BoxInfo List ====>", JsonFormatData(Tfs_Id, Box_Id, boxInfoArrayList, preferenceManager.getStoreId()));
Constants.ProgressDialogShow(StockReceived.this);
FinalRequest(JsonFormatData(Tfs_Id, Box_Id, boxInfoArrayList, preferenceManager.getStoreId()));
}catch(JSONException e){
e.printStackTrace();
}
} else {
Constants.getToast(StockReceived.this, "Please Scan AtLeast one Barcode");
}
}
break;
}
}
public void FinalRequest(String res) {
com.squareup.okhttp.RequestBody body = com.squareup.okhttp.RequestBody.create(JSON, res);
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.StockReceiving)
.post(body)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new com.squareup.okhttp.Callback() {
@Override
public void onFailure(Request request, IOException e) {
Constants.ProgressDialogDismiss();
if(e.getCause() != null && e.getCause() instanceof UnknownHostException) {
}else{
runOnUiThread(() -> Constants.getToast(StockReceived.this, e.getMessage()));
}
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
Constants.ProgressDialogDismiss();
Response = response.body().string();
Log.e("Stock Transfer =====>", Response);
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
tfSid.setText("");
tfSid.requestFocus();
try {
JSONObject obj = new JSONObject(Response);
if (obj.has(getResources().getString(R.string.success))) {
if (obj.getInt(getResources().getString(R.string.success)) == 1) {
if (obj.getString("msg").equalsIgnoreCase("TFS Received Successfully")) {
finish();
Constants.getToast(StockReceived.this, obj.getString("msg"));
return;
} else {
Constants.getToast(StockReceived.this, obj.getString("msg"));
getCall();
}
} else if (obj.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try {
Login.logout(StockReceived.this);
Constants.getToast(StockReceived.this, obj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
} else {
runOnUiThread(() -> {
try {
Constants.getToast(StockReceived.this, obj.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
}
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
runOnUiThread(() -> Constants.getToast(StockReceived.this, Response));
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
public class Checked implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onTextChanged(CharSequence val, int i, int i1, int i2) {
try {
if (!TextUtils.isEmpty(tfSid.getText().toString())) {
if (val.toString().length() > 0) {
if (val.toString().trim().contains("\n")) {
if (Constants.isNetworkAvailable(StockReceived.this)) {
if (boxInfoArrayList.size() > 0) {
boolean itemExistsBasedOnProp = boxInfoArrayList.stream().map(BoxInfo::getBarcode).anyMatch(val.toString().replace("\n", "")::equals);
//Log.e("Barcode value =====>", String.valueOf(itemExistsBasedOnProp));
if (itemExistsBasedOnProp) {
for (int k = 0; k < boxInfoArrayList.size(); k++) {
BoxInfo boxInfo = boxInfoArrayList.get(k);
if (boxInfo.getStatus()) {
if (boxInfo.getBarcode().equalsIgnoreCase(val.toString().replace("\n", ""))) {
Constants.getToast(StockReceived.this, "Already Scanned on Same Barcode");
tfSid.setText("");
tfSid.requestFocus();
break;
}
}
if (boxInfo.getBarcode().equalsIgnoreCase(val.toString().replace("\n", ""))) {
if (boxInfo.getTransfer_qty().equalsIgnoreCase(boxInfo.getReceive_qty())) {
Constants.getToast(StockReceived.this, "Already Matched Sent and Received");
tfSid.setText("");
tfSid.requestFocus();
} else {
BoxInfo boxInfo1 = new BoxInfo(boxInfo.getBarcode(), boxInfo.getUom(), boxInfo.getTransfer_qty(), "1", "0", true);
boxInfoArrayList.set(k, boxInfo1);
adapter.notifyDataSetChanged();
val2 = val2 - 1;
val3 = val3 + 1;
runOnUiThread(() -> {
transfer_qty.setText("Sent : " + val1);
pending_qty.setText("Pending : " + val2);
received_qty.setText("Received : " + val3);
tfSid.setText("");
tfSid.requestFocus();
});
}
break;
}
}
} else {
runOnUiThread(() -> {
Constants.getToast(StockReceived.this, "Barcode Not Found");
tfSid.setText("");
tfSid.requestFocus();
});
}
} else {
runOnUiThread(() -> {
Constants.getToast(StockReceived.this, "No Data Found");
tfSid.setText("");
tfSid.requestFocus();
});
}
}
}
} else {
Constants.getToast(StockReceived.this, "Enter TFS No");
tfSid.requestFocus();
}
}
} catch (NullPointerException jo) {
jo.getMessage();
}
}
@Override
public void afterTextChanged(Editable editable) {
}
}
public void getTFSBoxDetails(String val) {
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.GetTFSBoxNumbers + val)
.get()
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
}
@Override
public void onResponse(com.squareup.okhttp.Response response) throws IOException {
try {
String res = response.body().string();
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
try {
JSONObject jsonObject = new JSONObject(res);
if (jsonObject.getInt(getResources().getString(R.string.success)) == 1) {
String data = jsonObject.getString("data");
JSONArray jsonArray = new JSONArray(data);
if (jsonArray.length() > 1) {
Constants.getToast(StockReceived.this, getResources().getString(R.string.AppCanNot));
} else {
JSONObject object = jsonArray.getJSONObject(0);
Box_Id = object.getString("id");
GetTFSBoxDetailsByBarcode(val, Box_Id);
}
} else if (jsonObject.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try {
Constants.getToast(StockReceived.this, jsonObject.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
Login.logout(StockReceived.this);
});
} else {
runOnUiThread(() -> {
try {
Constants.getToast(StockReceived.this, jsonObject.getString("msg"));
} catch (JSONException e) {
e.printStackTrace();
}
});
}
} catch (JSONException e) {
e.printStackTrace();
} catch (NullPointerException npe) {
npe.printStackTrace();
}
}
});
} catch (NullPointerException np) {
np.printStackTrace();
}
}
});
}
private void GetTFSBoxDetailsByBarcode(String val, String id) {
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url( Constants.GetTFSBoxDetailsByBarcode + val + "/" + id )
.get()
.addHeader( Constants.Type , Constants.App_json )
.addHeader( getResources().getString(R.string.accesstoken) , preferenceManager.getCustToken() )
.addHeader( getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId() )
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
}
@Override
public void onResponse(com.squareup.okhttp.Response response) throws IOException {
String res = response.body().string();
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
final JSONObject object;
try {
object = new JSONObject(res);
if (object.getInt("success") == 1) {
if (object.has("data")) {
JSONObject dataObject = object.getJSONObject("data");
JSONArray jsonArray = dataObject.getJSONArray("box_info");
boxInfoArrayList.clear();
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
BoxInfo boxInfo = new BoxInfo(jsonObject.getString("barcode"), jsonObject.getString("uom"),
jsonObject.getString("transfered_qty"), jsonObject.getString("received_qty"),
jsonObject.getString("pending_qty"), false);
boxInfoArrayList.add(boxInfo);
}
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(StockReceived.this, LinearLayoutManager.VERTICAL, false);
adapter = new StockReceivedAdapter(StockReceived.this, boxInfoArrayList);
StockReceived_recyclerView.setLayoutManager(linearLayoutManager);
StockReceived_recyclerView.setAdapter(adapter);
JSONObject totalJsonObject = dataObject.getJSONObject("totals");
val1 = totalJsonObject.getInt("transfered_qty");
val2 = totalJsonObject.getInt("pending_qty");
val3 = totalJsonObject.getInt("received_qty");
transfer_qty.setText("Sent : " + totalJsonObject.getString("transfered_qty"));
pending_qty.setText("Pending : " + totalJsonObject.getString("pending_qty"));
received_qty.setText("Received :" + totalJsonObject.getString("received_qty"));
}
} else if (object.getInt("success") == 3) {
runOnUiThread(() -> {
try {
Constants.getToast(StockReceived.this, object.getString("msg"));
Login.logout(StockReceived.this);
} catch (JSONException je) {
je.printStackTrace();
}
});
} else {
runOnUiThread(() -> {
try {
Constants.getToast(StockReceived.this, object.getString("msg"));
} catch (JSONException je) {
je.printStackTrace();
}
});
}
} catch (JSONException je) {
je.printStackTrace();
}
}
});
} catch (NullPointerException np) {
np.printStackTrace();
}
}
});
}
public void PostRequest(String res) {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("tfs_number", res);
} catch (JSONException je) {
je.printStackTrace();
}
com.squareup.okhttp.RequestBody body = com.squareup.okhttp.RequestBody.create(JSON, jsonObject.toString());
final OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(240, TimeUnit.SECONDS);
client.setReadTimeout(240, TimeUnit.SECONDS);
client.setWriteTimeout(240, TimeUnit.SECONDS);
Request request = new Request.Builder()
.url(Constants.GetInfoWithTFS)
.post(body)
.addHeader(Constants.Type, Constants.App_json)
.addHeader(getResources().getString(R.string.accesstoken), preferenceManager.getCustToken())
.addHeader(getResources().getString(R.string.storeidtoken), preferenceManager.getStoreId())
.build();
client.newCall(request).enqueue(new com.squareup.okhttp.Callback() {
@Override
public void onFailure(Request request, IOException e) {
Constants.ProgressDialogDismiss();
if (e.getCause() != null && e.getCause() instanceof UnknownHostException) {
} else {
runOnUiThread(() -> Constants.getToast(StockReceived.this, e.getMessage()));
}
}
@Override
public void onResponse(final com.squareup.okhttp.Response response) throws IOException {
Constants.ProgressDialogDismiss();
Response = response.body().string();
try {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
if (response.code() == 200) {
tfSid.setText("");
tfSid.requestFocus();
try {
JSONObject obj = new JSONObject(Response);
if (obj.has(getResources().getString(R.string.success))) {
if (obj.getInt(getResources().getString(R.string.success)) == 1) {
String tfSid = obj.getString("data");
JSONObject jsonObject1 = new JSONObject(tfSid);
Tfs_Id = jsonObject1.getString("tfs_id");
getTFSBoxDetails(Tfs_Id);
} else if (obj.getInt(getResources().getString(R.string.success)) == 3) {
runOnUiThread(() -> {
try {
Constants.getToast(StockReceived.this, obj.getString("msg"));
Login.logout(StockReceived.this);
} catch (JSONException je) {
je.printStackTrace();
}
});
} else {
runOnUiThread(() -> {
try {
Constants.getToast(StockReceived.this, obj.getString("msg"));
finish();
} catch (JSONException je) {
je.printStackTrace();
}
});
}
}
} catch (JSONException je) {
je.printStackTrace();
}
} else {
runOnUiThread(() -> Constants.getToast(StockReceived.this, Response));
}
});
} catch (NullPointerException io) {
io.printStackTrace();
} finally {
response.body().close();
}
}
});
}
}
package w.soulofpluto.posstock;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
/*
Create by Ramesh Babu
*/
public class StockReceivedAdapter extends RecyclerView.Adapter<StockReceivedAdapter.ViewHolder> {
public ArrayList<BoxInfo> arrayList;
public Context context;
public StockReceivedAdapter(Context context, ArrayList<BoxInfo> arrayList){
this.context = context;
this.arrayList = arrayList;
}
@NonNull
@Override
public StockReceivedAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
View listItem = layoutInflater.inflate(R.layout.stocktransfer_list_item, parent, false);
StockReceivedAdapter.ViewHolder viewHolder = new StockReceivedAdapter.ViewHolder(listItem);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull StockReceivedAdapter.ViewHolder holder, int position){
BoxInfo boxInfo = arrayList.get(position);
holder.stockTransfer_barcode.setText(boxInfo.getBarcode());
if(boxInfo.getReceive_qty().replace(".00","").equalsIgnoreCase(boxInfo.getTransfer_qty().replace(".00",""))) {
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_green_dark));
holder.stockReceived_sent_receive.setText(boxInfo.getReceive_qty().replace(".00", "") + "/" + boxInfo.getTransfer_qty().replace(".00", ""));
}else{
if(boxInfo.getStatus()){
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.holo_green_dark));
}else{
holder.background_layout.setBackgroundColor(context.getResources().getColor(android.R.color.transparent));
}
holder.stockReceived_sent_receive.setText(boxInfo.getReceive_qty().replace(".00", "") + "/" + boxInfo.getTransfer_qty().replace(".00", ""));
}
}
@Override
public int getItemCount(){
return arrayList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
TextView stockTransfer_barcode,stockReceived_sent_receive;
LinearLayout background_layout;
public ViewHolder(@NonNull View itemView){
super(itemView);
stockTransfer_barcode = itemView.findViewById(R.id.stockReceived_barcode);
stockReceived_sent_receive = itemView.findViewById(R.id.stockReceived_sent_receive);
background_layout = itemView.findViewById(R.id.background_layout);
}
}
}
package w.soulofpluto.posstock;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.MenuItem;
import android.widget.EditText;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import static w.soulofpluto.posstock.StockReceived.startData;
/*
Create by Ramesh Babu
*/
public class StockTransferActivity extends AppCompatActivity {
EditText tfs_number;
Toolbar StockTransfer_toolbar;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_stock_transfer);
super.onCreate(savedInstanceState);
tfs_number = findViewById(R.id.tfs_number);
StockTransfer_toolbar = findViewById(R.id.stockTransfer_toolbar);
setSupportActionBar(StockTransfer_toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.stock_transfer));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
tfs_number.addTextChangedListener(new Checked());
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()){
case android.R.id.home:
finish();
break;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onRestart() {
tfs_number.setText("");
tfs_number.requestFocus();
super.onRestart();
}
public class Checked implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence val, int i, int i1, int i2) {
try {
if(!TextUtils.isEmpty(tfs_number.getText().toString())){
if (val.toString().length() > 0) {
Log.e("Perform ========>", val.toString());
if (val.toString().contains("\n")) {
if (Constants.isNetworkAvailable(StockTransferActivity.this)) {
startData(StockTransferActivity.this,val.toString().replace("\n",""));
tfs_number.setText("");
}
}
} else {
Constants.getToast(StockTransferActivity.this, "Enter TFSId No");
tfs_number.requestFocus();
}
}
} catch (NullPointerException jo){
jo.getMessage();
}
}
@Override
public void afterTextChanged(Editable editable) {
}
}
}
package w.soulofpluto.posstock;
/*
/*
Create by Ramesh Babu
*/
public class Store {
public class Store {
int StoreId;
String StoreName;
public int getStoreId() {
return StoreId;
}
public void setStoreId(int storeId) {
StoreId = storeId;
}
public String getStoreName() {
return StoreName;
}
public void setStoreName(String storeName) {
StoreName = storeName;
}
public String toString() {
return StoreName;
}
}
}
package w.soulofpluto.posstock;
/*
Create by RameshBabu P
*/
public class StoreFormat {
int Id;
String store_name;
public int getId() {
return Id;
}
public void setId(int id) {
Id = id;
}
public String getStore_name() {
return store_name;
}
public void setStore_name(String store_name) {
this.store_name = store_name;
}
@Override
public String toString() {
return store_name;
}
}
......@@ -3,8 +3,8 @@
<item>
<shape android:shape="rectangle">
<gradient android:angle="180"
android:endColor="#0000FF"
android:startColor="#87ceeb" />
android:endColor="#07c4a0"
android:startColor="#007cde" />
</shape>
</item>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:angle="180"
android:endColor="#07c4a0"
android:startColor="#007cde"/>
<corners
android:bottomLeftRadius="7dp"
android:bottomRightRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp" />
</shape>
\ No newline at end of file
<vector android:height="24dp" android:viewportHeight="510"
android:viewportWidth="510" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ffffff" android:pathData="M311.1,255l58.65,58.65c7.65,-17.851 10.2,-38.25 10.2,-58.65c0,-20.4 -5.101,-40.8 -10.2,-58.65L311.1,255zM446.25,119.85L415.65,153c15.3,30.6 25.5,66.3 25.5,102s-10.2,71.4 -25.5,102l30.6,30.6c25.5,-38.25 38.25,-86.699 38.25,-135.149S471.75,158.1 446.25,119.85zM349.35,145.35L204,0h-25.5v193.8L61.2,76.5l-35.7,35.7L168.3,255L25.5,397.8l35.7,35.7l117.3,-117.3V510H204l145.35,-145.35L239.7,255L349.35,145.35zM229.5,96.9l48.45,48.45L229.5,193.8V96.9zM277.95,364.65L229.5,413.1V316.2L277.95,364.65z"/>
<path android:fillColor="#FFFFFF" android:pathData="M311.1,255l58.65,58.65c7.65,-17.851 10.2,-38.25 10.2,-58.65c0,-20.4 -5.101,-40.8 -10.2,-58.65L311.1,255zM446.25,119.85L415.65,153c15.3,30.6 25.5,66.3 25.5,102s-10.2,71.4 -25.5,102l30.6,30.6c25.5,-38.25 38.25,-86.699 38.25,-135.149S471.75,158.1 446.25,119.85zM349.35,145.35L204,0h-25.5v193.8L61.2,76.5l-35.7,35.7L168.3,255L25.5,397.8l35.7,35.7l117.3,-117.3V510H204l145.35,-145.35L239.7,255L349.35,145.35zM229.5,96.9l48.45,48.45L229.5,193.8V96.9zM277.95,364.65L229.5,413.1V316.2L277.95,364.65z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="80dp"
android:height="80dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M237.5,2.1c-60.6,4.3 -118.1,30.7 -161.4,74 -99.4,99.4 -99.4,260.4 0,359.8 99.4,99.4 260.4,99.4 359.8,-0 99.4,-99.4 99.4,-260.4 0,-359.8 -44.1,-44.1 -100.7,-69.7 -163.9,-74.1 -16,-1.1 -17.3,-1.1 -34.5,0.1zM166.6,115.5c1.9,2.9 1.1,6 -2,8l-2.3,1.5 2.6,5.3 2.6,5.2 0.5,124.2c0.5,123.4 0.5,124.2 2.6,126.9 4,5.4 7,6.9 13.9,6.9 6.9,-0 9.9,-1.5 13.9,-6.9 1.7,-2.2 2.2,-4.7 2.6,-13.2 0.4,-8.9 0.8,-10.8 2.4,-12 1.6,-1.2 9.8,-1.4 47.5,-1.4 40.9,-0 45.6,0.2 47.3,1.7 2.2,2 2.3,6.1 0.1,8.5 -1.5,1.7 -4.2,1.8 -43.5,1.8l-41.8,-0 0,6.3c0,4.7 -0.6,7.6 -2.4,11l-2.3,4.7 86.2,-0.2 86.2,-0.3 3.7,-2.9c4.5,-3.4 6.6,-7.9 6.6,-14.1l0,-4.5 -26.5,-0c-25.2,-0 -26.6,-0.1 -28.5,-2 -4.2,-4.2 -1.2,-10 5.1,-10l3.9,-0 0,-111.9 0,-111.8 -2.2,-3.3c-1.3,-1.8 -3.6,-4.3 -5.1,-5.4 -2.8,-2.1 -3.7,-2.1 -67.5,-2.4 -64.6,-0.2 -64.6,-0.2 -66.9,-2.4 -2.7,-2.5 -2.9,-4.5 -0.7,-7.6l1.5,-2.2 65.7,-0 65.7,-0 5,2.4c6.2,2.9 11.7,8.6 14.7,15.1l2.3,5 0.3,112.2 0.2,112.3 20.7,-0c25.7,-0 24.3,-0.8 24.3,13.9 0,8.2 -0.5,11.5 -1.9,14.7 -2.8,6.1 -8.9,12.4 -14.6,15l-5,2.4 -102,-0 -102,-0 -5,-2.4c-6.2,-2.9 -11.7,-8.6 -14.7,-15.1l-2.3,-5 -0.3,-112.3 -0.2,-112.2 -20.7,-0c-25.7,-0 -24.3,0.8 -24.3,-13.9 0,-8.2 0.5,-11.5 1.9,-14.7 2.8,-6.1 8.9,-12.4 14.6,-15 4.6,-2.2 6.3,-2.4 21.7,-2.4 16.7,-0 16.8,-0 18.4,2.5zM189.6,115.9c1.6,3.1 0.4,6.2 -2.9,8.1 -3.1,1.8 -5.3,0.8 -7.6,-3.2 -1.3,-2.3 -1.3,-2.9 0.3,-5.2 1.4,-2.3 2.3,-2.7 5.4,-2.4 2.7,0.2 4,0.9 4.8,2.7zM280.8,153.2c0.7,0.7 1.2,2.5 1.2,4l0,2.8 9.3,-0c6.8,-0 9.8,0.4 11.5,1.6 1.3,0.8 5.2,7.5 8.9,14.7 3.6,7.3 8.5,15.7 10.9,18.9l4.4,5.6 0,16.4c0,11.4 -0.4,16.8 -1.2,17.6 -0.7,0.7 -4.1,1.2 -8.3,1.2 -7.1,-0 -7.1,-0 -8.8,3.4 -6.4,13.5 -27.9,12.4 -33,-1.7 -0.6,-1.5 -2.1,-1.7 -13.1,-1.7l-12.4,-0 -2.5,4.3c-3.3,5.6 -8.9,8.7 -15.6,8.7 -2.9,-0 -6.5,-0.7 -8,-1.5 -3.3,-1.6 -7.7,-6.5 -8.6,-9.5 -0.6,-1.7 -1.5,-2 -7.4,-2 -7.1,-0 -9.1,-1 -9.1,-4.5 0,-3.5 2,-4.5 9.2,-4.5 5.4,-0 6.8,-0.3 6.8,-1.5 0,-2.6 7,-9.3 11.5,-11.1 8,-3 17.5,0.8 21.5,8.6l2,4 12.6,-0c11,-0 12.5,-0.2 13.1,-1.8 2,-5.6 7.5,-10.3 14,-11.6 6.8,-1.5 16.5,3.7 19.3,10.4 1.1,2.6 1.8,3 5.1,3l3.9,-0 0,-11.1c0,-10.9 -0.1,-11.2 -3.1,-15l-3.1,-3.9 -17.9,-0c-23.4,-0 -21.9,1.4 -21.9,-20l0,-16 -35.3,-0c-37.1,-0 -37.7,-0.1 -37.7,-4.5 0,-1.2 0.5,-2.6 1.2,-3.3 1.7,-1.7 78.9,-1.7 80.6,-0zM239.4,171.6c1.9,1.9 2,3.5 0.4,5.7 -1.1,1.4 -3.9,1.7 -21.8,1.7 -11.3,0.1 -21.3,-0.2 -22.2,-0.5 -2.6,-1 -3.2,-4.4 -1.2,-6.6 1.6,-1.8 3.2,-1.9 22.5,-1.9 17.5,-0 21,0.2 22.3,1.6zM232.4,189.2c2,2.9 2,3.4 -0.4,5.8 -1.9,1.9 -3.3,2 -21.8,2 -16.3,-0 -20.1,-0.3 -22,-1.6 -2.6,-1.8 -2.8,-4.1 -0.5,-6.6 1.5,-1.6 3.5,-1.8 22.4,-1.8 20.3,-0 20.8,-0 22.3,2.2zM221.1,205c2.2,1.2 2.6,5.9 0.7,7.8 -0.8,0.8 -5.3,1.2 -13.4,1.2 -11.6,-0 -12.4,-0.1 -13.8,-2.2 -2,-2.9 -2,-3.4 0.4,-5.8 1.8,-1.8 3.3,-2 13.1,-2 6.1,-0 11.9,0.5 13,1zM312.7,281.2c2.7,2.5 2.9,4.5 0.7,7.6l-1.5,2.2 -55.4,-0 -55.4,-0 -1.5,-2.2c-2.1,-3 -2,-4.7 0.6,-7.5l2.1,-2.3 54.1,-0 54,-0 2.3,2.2zM313,304c2.4,2.4 2.5,4.8 0.4,7.8l-1.5,2.2 -55.4,-0 -55.4,-0 -1.5,-2.2c-2.1,-3 -2,-5.4 0.4,-7.8 2,-2 3.3,-2 56.5,-2 53.2,-0 54.5,-0 56.5,2zM272.7,328.2c2.7,2.5 2.9,4.5 0.7,7.6l-1.5,2.2 -35.4,-0 -35.4,-0 -1.5,-2.2c-2.1,-3 -2,-5 0.4,-7.6 2.1,-2.2 2.4,-2.2 36.2,-2.2 33.7,-0 34.2,-0 36.5,2.2zM313,328.2c2.4,2.6 2.5,4.6 0.4,7.6 -1.4,2 -2.3,2.2 -12.1,2.2 -8.5,-0 -11,-0.3 -12.5,-1.7 -2.4,-2.1 -2.3,-5.8 0.2,-8.3 1.7,-1.7 3.3,-2 12,-2 8.9,-0 10.1,0.2 12,2.2zM321.2,361.7c3.7,3.3 1.1,10.3 -3.9,10.3 -2.8,-0 -6.3,-3.3 -6.3,-6 0,-2.6 3.4,-6 6.2,-6 1.2,-0 3,0.7 4,1.7z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M131.5,126.4c-6.1,2.7 -9.5,8.5 -9.5,16.2l0,4.4 16.8,-0 16.8,-0 -0.6,-6c-0.6,-6.6 -2.7,-10.2 -8,-13.8 -3.8,-2.5 -10.7,-2.9 -15.5,-0.8z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M282,178.5l0,8.5 12,-0 12,-0 -4.2,-8.5 -4.2,-8.5 -7.8,-0 -7.8,-0 0,8.5z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M226.5,225.5c-4.1,4 -3.3,10.5 1.7,13.1 5.9,3.1 12,-0.6 12,-7.3 0,-7.3 -8.6,-11 -13.7,-5.8z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M286.9,225.9c-3.5,3.6 -3.7,7 -0.5,10.7 6.1,7.2 17.4,-0.2 14,-9.1 -0.8,-1.9 -5.5,-4.5 -8.4,-4.5 -1.2,-0 -3.5,1.3 -5.1,2.9z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="80dp"
android:height="80dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M237.5,2.1c-60.6,4.3 -118.1,30.7 -161.4,74 -99.4,99.4 -99.4,260.4 0,359.8 99.4,99.4 260.4,99.4 359.8,-0 99.4,-99.4 99.4,-260.4 0,-359.8 -44.1,-44.1 -100.7,-69.7 -163.9,-74.1 -16,-1.1 -17.3,-1.1 -34.5,0.1zM318.3,109.6c5.6,1.9 12.9,8.1 16.1,13.7 4.4,7.6 4.6,11.4 4.6,78.7l0,64 -6.5,-0 -6.5,-0 0,-63.3c-0.1,-34.7 -0.5,-65.2 -0.9,-67.6 -1,-4.8 -3.3,-8.4 -7.5,-11.5 -2.7,-2 -4,-2.1 -54.7,-2.4l-51.9,-0.3 0,26.1c0,23.6 -0.2,26.4 -1.9,29.8 -4.2,8.2 -8.8,10.2 -23.6,10.2l-11.5,-0 0,-6.5 0,-6.5 10.4,-0c8.2,-0 10.8,-0.3 12,-1.6 1.4,-1.3 1.6,-4.7 1.6,-21.8l0,-20.2 -26.5,26.6 -26.5,26.5 0,94.8c0,104.8 -0.4,99 6.6,104.3l3.7,2.9 77.1,0.3c42.4,0.2 78.5,-0 80.3,-0.3 1.8,-0.3 4.6,-1.7 6.3,-3.2 5.5,-4.6 6.3,-7.4 6.8,-23.6l0.5,-14.8 6.1,0.3 6.1,0.3 0.3,11.5c0.5,19.3 -2.2,27.8 -11.3,35.8 -8.5,7.5 -4.5,7.2 -92.5,7.2 -90.4,-0 -84.6,0.5 -94.1,-8.9 -9.6,-9.6 -8.9,-1.2 -8.9,-114l0,-98.5 34.7,-34.8 34.8,-34.8 56.1,-0c48.4,-0 56.7,0.2 60.7,1.6zM272,138.5l0,6.5 -6.5,-0 -6.5,-0 0,-6.5 0,-6.5 6.5,-0 6.5,-0 0,6.5zM302.7,133.5c8.4,3.5 11.3,9 11.3,21l0,8.5 -6.5,-0 -6.5,-0 0,-7.4c0,-5.4 -0.4,-7.9 -1.6,-9 -1.1,-1.2 -3.6,-1.6 -9,-1.6l-7.4,-0 0,-6.5 0,-6.5 8,-0c5,-0 9.5,0.6 11.7,1.5zM247.8,210.8l0.3,6.2 8.3,-0c7.3,-0 8.7,0.3 12.8,2.9 4.6,3 8.8,9.5 8.8,13.9 0,2 -0.5,2.2 -6.5,2.2 -4.3,-0 -6.5,-0.4 -6.5,-1.2 0,-0.6 -0.7,-2 -1.7,-3 -1.5,-1.6 -3.5,-1.8 -22.4,-1.8 -20.8,-0 -20.9,-0 -22.4,2.4 -2,3 -0.5,7.3 2.7,8.1 1.3,0.3 11.8,0.6 23.5,0.7 23.6,0.3 23.3,0.2 29.7,8.2 2.7,3.3 3.1,4.5 3.1,9.9 -0.1,5.1 -0.6,6.9 -2.9,10.4 -4,6 -9.3,8.3 -18.9,8.3l-7.7,-0 0,6 0,6 -6.5,-0 -6.5,-0 0,-5.9 0,-5.9 -9.4,-0.4c-8.8,-0.3 -9.7,-0.5 -13.3,-3.4 -4.3,-3.5 -6.8,-7.4 -7.8,-12.2l-0.7,-3.2 6.6,-0c6.1,-0 6.6,0.2 7.8,2.7l1.3,2.8 20.9,0.3c18.4,0.2 21.1,-0 22.7,-1.4 2.3,-2.1 2.4,-5.2 0.2,-7.6 -1.5,-1.6 -3.5,-1.8 -22.5,-1.8 -16.6,-0 -21.6,-0.3 -24.6,-1.5 -12.2,-5.2 -15.6,-19.3 -6.9,-29.2 4.3,-4.9 8.2,-6.3 17.7,-6.3l8,-0 0,-5.8c0,-3.2 0.2,-6.1 0.4,-6.3 0.2,-0.2 3.1,-0.4 6.3,-0.3l5.8,-0 0.3,6.2zM412.3,218.4c10.2,4.3 14,17.4 7.7,26.7 -1.6,2.4 -21.7,23.1 -44.7,46.1l-41.8,41.6 -18.2,9.1 -18.3,9.1 -61.5,-0 -61.5,-0 0,-6.5 0,-6.5 58.8,-0 58.8,-0 7.4,-15 7.4,-14.9 44.1,-44c24.2,-24.1 45.4,-44.6 47,-45.5 3.7,-1.9 10.6,-2 14.8,-0.2zM290,314.5l0,6.5 -58,-0 -58,-0 0,-6.5 0,-6.5 58,-0 58,-0 0,6.5z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M400,232.5l-2.4,2.6 3.7,3.6 3.6,3.7 2.6,-2.4c2.7,-2.5 3.3,-6.8 1.3,-8.8 -2,-2 -6.3,-1.4 -8.8,1.3z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M354.9,277.6l-33.4,33.4 3.8,3.7 3.7,3.8 33.3,-33.5 33.4,-33.5 -3.7,-3.7 -3.7,-3.6 -33.4,33.4z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M312,326l-2.1,4.1 4.2,-2.1c3.9,-2.1 4,-2.2 2.3,-4.1 -0.9,-1 -1.9,-1.9 -2,-1.9 -0.2,-0 -1.3,1.8 -2.4,4z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M246,3.1c-63.9,8.5 -103.8,44.2 -117.1,104.4 -1.9,8.9 -2.2,13.8 -2.6,44.2l-0.5,34.3 -31.8,-0c-31.3,-0 -31.7,-0 -35.1,2.3 -1.8,1.2 -4.4,3.8 -5.6,5.6l-2.3,3.4 0,149.4c0,146.6 0,149.5 2,153.2 1.1,2.2 3.6,5 5.7,6.2l3.8,2.4 193,-0 193,-0 3.8,-2.4c2.1,-1.2 4.6,-4 5.7,-6.2 2,-3.7 2,-6.6 2,-153.2l0,-149.4 -2.3,-3.4c-1.2,-1.8 -3.8,-4.4 -5.6,-5.6 -3.4,-2.3 -3.8,-2.3 -35.2,-2.3l-31.9,-0 0,-30.3c0,-32.6 -0.9,-42.2 -5.6,-59.7 -2.9,-10.9 -10.2,-26.9 -17.1,-37.3 -10.1,-15.3 -28.6,-30.9 -48.1,-40.7 -21.6,-10.7 -51.2,-17.2 -68.2,-14.9zM269.5,25.5c44.2,7.2 75,32.1 88.1,71.1 4.9,14.6 5.4,20.1 5.4,56l0,33.4 -107.5,-0 -107.5,-0 0,-29.9c0,-25.9 0.3,-31.4 2,-40.4 7.1,-36.8 26.3,-64.4 55,-79.1 21.8,-11.2 42.4,-14.7 64.5,-11.1zM435.2,209.9l3.3,2.9 0.3,132.9c0.2,98.5 -0.1,133.5 -0.9,135.6 -2.6,6.1 11.1,5.7 -182.4,5.7 -193.5,-0 -179.8,0.4 -182.4,-5.7 -0.8,-2.1 -1.1,-37.1 -0.9,-135.6l0.3,-132.9 3.3,-2.9 3.2,-2.9 176.5,-0 176.5,-0 3.2,2.9z"
android:fillColor="#000000"
android:strokeColor="#00000000"/>
<path
android:pathData="M248.7,294.1c-23.7,5.6 -33.5,34.3 -17.8,52.1l3.1,3.6 0,17.3c0,14.8 0.3,18 1.9,21.4 7.7,16.6 31.5,16.6 39.2,-0 1.6,-3.4 1.9,-6.6 1.9,-21.4l0,-17.3 3.1,-3.6c5.3,-6 7.3,-11.7 7.3,-20.7 0,-6.8 -0.4,-8.8 -2.8,-13.5 -4.8,-9.6 -11.3,-14.9 -21.3,-17.5 -6.3,-1.7 -9,-1.7 -14.6,-0.4z"
android:fillColor="#000000"
android:strokeColor="#00000000"/>
</vector>
<vector android:height="26dp" android:viewportHeight="489.888"
android:viewportWidth="489.888" android:width="26dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M25.383,290.5c-7.2,-77.5 25.9,-147.7 80.8,-192.3c21.4,-17.4 53.4,-2.5 53.4,25l0,0c0,10.1 -4.8,19.4 -12.6,25.7c-38.9,31.7 -62.3,81.7 -56.6,136.9c7.4,71.9 65,130.1 136.8,138.1c93.7,10.5 173.3,-62.9 173.3,-154.5c0,-48.6 -22.5,-92.1 -57.6,-120.6c-7.8,-6.3 -12.5,-15.6 -12.5,-25.6l0,0c0,-27.2 31.5,-42.6 52.7,-25.6c50.2,40.5 82.4,102.4 82.4,171.8c0,126.9 -107.8,229.2 -236.7,219.9C122.183,481.8 35.283,396.9 25.383,290.5zM244.883,0c-18,0 -32.5,14.6 -32.5,32.5v149.7c0,18 14.6,32.5 32.5,32.5s32.5,-14.6 32.5,-32.5V32.5C277.383,14.6 262.883,0 244.883,0z"/>
<!--<vector
android:viewportHeight="489.888"
android:viewportWidth="489.888"
android:height="26dp"
android:width="26dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF"
android:pathData="M25.383,290.5c-7.2,-77.5 25.9,-147.7 80.8,-192.3c21.4,-17.4 53.4,-2.5 53.4,25l0,0c0,10.1 -4.8,19.4 -12.6,25.7c-38.9,31.7 -62.3,81.7 -56.6,136.9c7.4,71.9 65,130.1 136.8,138.1c93.7,10.5 173.3,-62.9 173.3,-154.5c0,-48.6 -22.5,-92.1 -57.6,-120.6c-7.8,-6.3 -12.5,-15.6 -12.5,-25.6l0,0c0,-27.2 31.5,-42.6 52.7,-25.6c50.2,40.5 82.4,102.4 82.4,171.8c0,126.9 -107.8,229.2 -236.7,219.9C122.183,481.8 35.283,396.9 25.383,290.5zM244.883,0c-18,0 -32.5,14.6 -32.5,32.5v149.7c0,18 14.6,32.5 32.5,32.5s32.5,-14.6 32.5,-32.5V32.5C277.383,14.6 262.883,0 244.883,0z"/>
</vector>-->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="26dp"
android:width="26dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M249.5,2.7c-4.6,2.4 -6.6,4.5 -8.6,8.8 -1.8,3.8 -1.9,9.1 -1.9,103.4 0,99.3 0,99.5 2.1,103.9 5.8,11.8 22.4,12.9 29.7,1.9l2.7,-4.1 0.3,-99.5c0.2,-67.4 0,-100.8 -0.7,-103.2 -3,-10.1 -15,-15.8 -23.6,-11.2z"
android:fillColor="#ffffff"
android:strokeColor="#ffffff"/>
<path
android:pathData="M158,61.5c-20.9,8.7 -45.6,25.4 -65.4,44.5 -33.3,32 -58.1,76.8 -67,121 -7.3,36.1 -7.3,61.2 0,97 5.6,27.2 18.5,58.2 34.2,81.5 37.9,56.6 95.7,93.2 162.7,103.1 16.6,2.5 50.4,2.5 67,-0 77.8,-11.5 143.7,-59.7 178.1,-130.1 12.1,-24.9 19.2,-49.5 22.9,-79.7 2.7,-22.7 1.5,-43.9 -4.1,-71.8 -7.2,-35.8 -25.7,-73.8 -50.2,-103.1 -21.3,-25.4 -52.1,-49.1 -79.6,-61.2 -11.5,-5.1 -16,-5.7 -22.2,-2.7 -8.3,4 -10.8,14.8 -5.5,23.4 1.8,2.8 4.9,4.9 15.9,10.5 23.7,12 39.5,23.4 56.3,40.8 46.3,47.8 65.5,113.4 52.4,178.9 -12.3,61.2 -53,113.2 -109.6,140.3 -55.2,26.4 -120.6,26.4 -175.8,-0 -113.3,-54.2 -149.2,-198.6 -74.3,-299.2 19.3,-25.9 42.4,-45.1 73.4,-60.8 11,-5.6 14.1,-7.7 15.9,-10.5 5.2,-8.5 2.7,-19.4 -5.3,-23.3 -6.1,-2.9 -9.9,-2.6 -19.8,1.4z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="26dp"
android:width="26dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M249.5,2.7c-4.6,2.4 -6.6,4.5 -8.6,8.8 -1.8,3.8 -1.9,9.1 -1.9,103.4 0,99.3 0,99.5 2.1,103.9 5.8,11.8 22.4,12.9 29.7,1.9l2.7,-4.1 0.3,-99.5c0.2,-67.4 0,-100.8 -0.7,-103.2 -3,-10.1 -15,-15.8 -23.6,-11.2z"
android:fillColor="#ffffff"
android:strokeColor="#ffffff"/>
<path
android:pathData="M158,61.5c-20.9,8.7 -45.6,25.4 -65.4,44.5 -33.3,32 -58.1,76.8 -67,121 -7.3,36.1 -7.3,61.2 0,97 5.6,27.2 18.5,58.2 34.2,81.5 37.9,56.6 95.7,93.2 162.7,103.1 16.6,2.5 50.4,2.5 67,-0 77.8,-11.5 143.7,-59.7 178.1,-130.1 12.1,-24.9 19.2,-49.5 22.9,-79.7 2.7,-22.7 1.5,-43.9 -4.1,-71.8 -7.2,-35.8 -25.7,-73.8 -50.2,-103.1 -21.3,-25.4 -52.1,-49.1 -79.6,-61.2 -11.5,-5.1 -16,-5.7 -22.2,-2.7 -8.3,4 -10.8,14.8 -5.5,23.4 1.8,2.8 4.9,4.9 15.9,10.5 23.7,12 39.5,23.4 56.3,40.8 46.3,47.8 65.5,113.4 52.4,178.9 -12.3,61.2 -53,113.2 -109.6,140.3 -55.2,26.4 -120.6,26.4 -175.8,-0 -113.3,-54.2 -149.2,-198.6 -74.3,-299.2 19.3,-25.9 42.4,-45.1 73.4,-60.8 11,-5.6 14.1,-7.7 15.9,-10.5 5.2,-8.5 2.7,-19.4 -5.3,-23.3 -6.1,-2.9 -9.9,-2.6 -19.8,1.4z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="80dp"
android:height="80dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M237.5,2.1c-60.6,4.3 -118.1,30.7 -161.4,74 -99.4,99.4 -99.4,260.4 0,359.8 99.4,99.4 260.4,99.4 359.8,-0 99.4,-99.4 99.4,-260.4 0,-359.8 -44.1,-44.1 -100.7,-69.7 -163.9,-74.1 -16,-1.1 -17.3,-1.1 -34.5,0.1zM318.7,146.2l36.3,36.3 0,27.5 0,27.5 4.8,2.5c7,3.7 17.1,14.3 21.4,22.6 4.9,9.3 6.8,16.9 6.8,27.2 0,10.4 -2.1,18.9 -6.9,27.8l-3.8,6.9 23,23.8 23,23.8 -3.8,3.9c-2.2,2.2 -4.4,4 -5,4 -0.5,-0 -11.3,-10.3 -23.8,-22.9l-22.8,-22.8 -6.4,4.1 -6.4,4.1 0,29.2 -0.1,29.3 -111.5,-0 -111.5,-0 0,-145.5 0,-145.5 75.2,-0 75.3,-0 36.2,36.2z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M146.8,256l-0.3,131 97.3,-0 97.2,-0 0,-19.8 0,-19.7 -8.7,0.3c-17.3,0.7 -31.6,-5 -43.9,-17.3 -8.3,-8.3 -13.6,-18 -15.9,-29 -1.8,-8.8 -1.8,-14.2 0,-23 4.3,-20.6 20,-37.8 40,-44.1 7,-2.2 9.7,-2.5 18.3,-2.2l10.2,0.3 0,-20.3 0,-20.2 -34,-0 -34,-0 0,-33.5 0,-33.5 -63,-0 -63,-0 -0.2,131zM287,222.5l0,7.5 -60.5,-0 -60.5,-0 0,-7.5 0,-7.5 60.5,-0 60.5,-0 0,7.5zM253,256.5l0,7.5 -43.5,-0 -43.5,-0 0,-7.5 0,-7.5 43.5,-0 43.5,-0 0,7.5zM252.5,291l0,7.5 -43.2,0.3 -43.3,0.2 0,-7.3c0,-4.1 0.3,-7.7 0.7,-8 0.3,-0.4 19.8,-0.6 43.2,-0.5l42.6,0.3 0,7.5zM253,325.5l0,7.5 -43.5,-0 -43.5,-0 0,-7.5 0,-7.5 43.5,-0 43.5,-0 0,7.5z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M285,155.4l0,25.6 25,-0c13.8,-0 25,-0.3 25,-0.6 0,-0.4 -11.2,-11.9 -25,-25.7l-25,-25 0,25.7z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M318.7,247.1c-10.9,2.6 -23.7,13 -28.7,23.4 -13,27.2 3.6,58.9 33.3,63.5 19.4,3 38.3,-7.4 47,-25.8 3,-6.3 3.2,-7.4 3.2,-17.7 0,-9.2 -0.4,-12 -2.4,-16.8 -4.7,-11.8 -15.8,-22 -27.9,-25.7 -6.8,-2.1 -17.7,-2.5 -24.5,-0.9zM357.4,272.1c1.8,1.4 2.6,3 2.6,5 0,3.4 -1.3,4.8 -19.2,21.8 -15.2,14.3 -15.2,14.3 -26.5,2.8 -4.5,-4.5 -8.7,-9.4 -9.2,-11 -1.9,-4.9 1.5,-9.7 6.9,-9.7 1.2,-0 4.7,2.4 8.1,5.7l6,5.7 4.2,-4c2.3,-2.2 7.6,-7.2 11.8,-11.2 8.4,-7.9 10.8,-8.7 15.3,-5.1z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="80dp"
android:height="80dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M237.5,2.1c-60.6,4.3 -118.1,30.7 -161.4,74 -99.4,99.4 -99.4,260.4 0,359.8 99.4,99.4 260.4,99.4 359.8,-0 99.4,-99.4 99.4,-260.4 0,-359.8 -44.1,-44.1 -100.7,-69.7 -163.9,-74.1 -16,-1.1 -17.3,-1.1 -34.5,0.1zM292,106.7c27.9,7.3 50.8,20.2 70.4,39.7 24.1,23.9 38.5,51.3 44.1,84 2,11.8 2,39.2 0,50.9 -11,62.7 -58.9,111.9 -121.4,124.7 -8,1.6 -13.8,2 -29.6,2 -28.8,-0 -43.6,-3.4 -68,-15.5 -43.9,-21.8 -74.6,-63 -83,-111.4 -2.3,-12.9 -2,-40.4 0.5,-53.6 11.9,-61.3 60.1,-110.5 119.6,-121.9 4.4,-0.8 8.8,-1.7 9.9,-2 1.1,-0.3 11.9,-0.3 24,-0.2 20.8,0.3 22.6,0.5 33.5,3.3z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M239.6,117c-60.7,7.7 -107.9,51.2 -120.8,111.3 -3.1,14.5 -3.1,39.9 0,54.4 11.8,55.3 51.7,96.1 106.5,109.1 10.1,2.4 13.1,2.6 30.2,2.6 17.1,-0 20.1,-0.2 30.2,-2.6 54.8,-13 94.7,-53.8 106.5,-109.1 3.1,-14.5 3.1,-39.9 0,-54.4 -12,-56 -54,-98.1 -109.4,-109.3 -11.5,-2.4 -32.6,-3.3 -43.2,-2zM336.4,181.6c1.4,1.3 1.6,6.6 1.6,42.8l0,41.2 3,2.9c10.2,9.8 15.4,26.7 12.6,40.4 -2.1,9.8 -5.9,17.3 -12.7,24.5 -8.8,9.5 -22.2,15.5 -34.4,15.6 -9.8,-0 -23.5,-5.5 -31.6,-12.7l-4.7,-4.3 -46.8,-0c-42.1,-0 -46.9,-0.2 -48.6,-1.7 -1.7,-1.5 -1.8,-5.2 -1.8,-74.4 0,-64.8 0.2,-72.9 1.6,-74.3 1.4,-1.4 10.1,-1.6 80.9,-1.6 70.8,-0 79.5,0.2 80.9,1.6z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M186,256l0,63 38.4,-0 38.4,-0 -1.5,-4.3c-1.1,-3 -1.4,-7.3 -1.1,-15.7 0.3,-10.5 0.6,-12.1 3.5,-18 6,-12.2 15.7,-20.7 28.1,-24.9 7.4,-2.5 21.4,-2.8 28.5,-0.7l4.7,1.4 0,-31.9 0,-31.9 -21,-0 -21,-0 0,27.8c0,26.6 -0.1,27.9 -2,30 -3.2,3.4 -6,2.7 -15.9,-3.8 -5,-3.3 -9.4,-6 -9.6,-6 -0.2,-0 -4.6,2.7 -9.6,6 -9.9,6.5 -12.7,7.2 -15.9,3.8 -1.9,-2.1 -2,-3.4 -2,-30l0,-27.8 -21,-0 -21,-0 0,63zM242.4,275.6c2.1,2 2,7.3 -0.1,9.6 -1.5,1.6 -3.5,1.8 -21.6,1.8 -17.2,-0 -20.3,-0.2 -21.9,-1.7 -2.1,-1.9 -2.5,-8.2 -0.6,-10.1 0.9,-0.9 7.1,-1.2 21.9,-1.2 17.5,-0 21,0.2 22.3,1.6zM222.4,296.6c2.3,2.3 2.1,9.1 -0.3,10.4 -1.1,0.5 -6.5,1 -12,1 -11.3,-0 -13.1,-0.9 -13.1,-6.5 0,-5.6 1.8,-6.5 13.5,-6.5 8.1,-0 10.7,0.3 11.9,1.6z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M241,213.6l0,20.5 4.3,-2.6c9.8,-6.1 10,-6.1 15.4,-3 2.6,1.6 5.8,3.5 7.1,4.3l2.2,1.4 0,-20.6 0,-20.6 -14.5,-0 -14.5,-0 0,20.6z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
<path
android:pathData="M296.5,265.4c-10.4,3.3 -19.6,11.2 -23.8,20.4 -3.2,6.8 -3.2,23.6 0,30.4 2.5,5.4 9.2,13.1 14.3,16.3 10.6,6.7 24.9,7.3 36.4,1.6 20.6,-10.1 26.9,-37.2 12.8,-55.6 -9,-11.9 -25.9,-17.5 -39.7,-13.1zM300.8,287.9l6,5.9 5.8,-5.9c6.3,-6.4 10.4,-7.7 12.4,-4 1.7,3.3 1.2,4.5 -5,11l-6,6.3 6,6c6,6.1 7.3,9.1 4.8,11.6 -2.6,2.6 -6.3,1.3 -11.8,-4.3 -3,-3 -5.8,-5.5 -6.2,-5.5 -0.3,-0 -3.1,2.5 -6.1,5.5 -6,6.1 -9.5,7.1 -12.1,3.3 -0.9,-1.2 -1.6,-2.6 -1.6,-3.1 0,-0.5 2.8,-3.8 6.2,-7.3l6.1,-6.4 -6.1,-6.4c-3.4,-3.5 -6.2,-6.8 -6.2,-7.3 0,-0.5 0.7,-1.9 1.6,-3.1 2.6,-3.7 5.7,-2.8 12.2,3.7z"
android:fillColor="#1c81ce"
android:strokeColor="#1c81ce"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="80dp"
android:height="80dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M237.5,2.1c-60.6,4.3 -118.1,30.7 -161.4,74 -99.4,99.4 -99.4,260.4 0,359.8 99.4,99.4 260.4,99.4 359.8,-0 99.4,-99.4 99.4,-260.4 0,-359.8 -44.1,-44.1 -100.7,-69.7 -163.9,-74.1 -16,-1.1 -17.3,-1.1 -34.5,0.1zM404.2,114.7c11.8,11.8 15.8,16.4 15.8,18.2 0,1.8 -4,6.4 -15.2,17.8 -8.4,8.5 -16.3,15.6 -17.6,16 -2.8,0.7 -9.2,-4.9 -9.2,-8.1 0,-1.2 3.3,-5.4 8.2,-10.3l8.3,-8.3 -39,-0 -38.9,-0 5.9,3.7c52.9,32.5 76,95.3 56.5,153.2 -13.6,40.5 -49.2,73.5 -90.6,84 -15.6,4 -23.1,4.3 -97.8,4.2l-71.9,-0.1 8.1,8.4c4.9,4.9 8.2,9.2 8.2,10.4 0,3.2 -4.8,8.2 -7.8,8.2 -3.8,-0 -34.2,-30.3 -34.2,-34 0,-3.4 30.4,-34 33.8,-34 3,-0 8.2,5.1 8.2,8 0,1.4 -3,5.3 -8.2,10.6l-8.2,8.4 39.5,-0 39.4,-0.1 -5.4,-3.2c-42.4,-25.2 -67.2,-70.9 -64.7,-119.2 2.9,-56.7 42.3,-104.7 97.4,-119 15.3,-4 29.3,-4.6 102,-4.3 36.9,0.2 67.2,0.1 67.2,-0.2 0,-0.3 -3.6,-4.1 -8,-8.5 -4.4,-4.4 -8,-8.7 -8,-9.6 0,-1 1.2,-3.1 2.6,-4.8 4.7,-5.6 6.1,-4.8 23.6,12.6z"
android:fillColor="#1c81ce"
android:strokeColor="#00000000"/>
<path
android:pathData="M249.5,140.6c-27.9,2.4 -51.5,12.6 -71.3,30.9 -36.5,33.9 -46.5,89.5 -24.1,134.8 5.5,11.1 11.1,19 20.7,28.9 44.4,46.1 119,46.1 163.4,-0 20.1,-20.8 30.7,-44.8 32.4,-73.3 3.2,-52.4 -30.1,-100.7 -80.1,-116.2 -12.1,-3.7 -30.1,-6 -41,-5.1zM325.5,193.4c1.4,2 1.5,9.6 1.3,62.8 -0.3,49.5 -0.5,60.8 -1.7,62.1 -1.2,1.6 -7.3,1.7 -68.6,1.7 -61.3,-0 -67.4,-0.1 -68.6,-1.7 -1.2,-1.3 -1.4,-12.6 -1.7,-62.1 -0.2,-53.2 -0.1,-60.8 1.3,-62.8l1.5,-2.4 67.5,-0 67.5,-0 1.5,2.4z"
android:fillColor="#1c81ce"
android:strokeColor="#00000000"/>
<path
android:pathData="M198,255.5l0,53.5 58.5,-0 58.5,-0 0,-53.5 0,-53.5 -17.5,-0 -17.5,-0 0,23.3c0,19.4 -0.3,23.6 -1.6,25.5 -2.3,3.4 -5.8,2.7 -13.9,-2.8 -4.1,-2.8 -7.7,-5 -8,-5 -0.3,-0 -3.9,2.2 -8,5 -8.1,5.5 -11.6,6.2 -13.9,2.8 -1.3,-1.9 -1.6,-6.1 -1.6,-25.5l0,-23.3 -17.5,-0 -17.5,-0 0,53.5zM245,272c2.4,2.4 2.5,4.8 0.4,7.8 -1.5,2.1 -2.1,2.2 -18,2.2 -9.5,-0 -17.4,-0.4 -18.5,-1 -2.4,-1.3 -2.6,-6.6 -0.2,-9.2 1.4,-1.6 3.4,-1.8 18,-1.8 15,-0 16.5,0.2 18.3,2zM228.2,289.7c2.2,2 2.4,6.6 0.2,8.7 -1.1,1.2 -3.6,1.6 -9.9,1.6 -9.2,-0 -11.5,-1.1 -11.5,-5.7 0,-4.9 2.4,-6.3 11.3,-6.3 6.1,-0 8.5,0.4 9.9,1.7z"
android:fillColor="#1c81ce"
android:strokeColor="#00000000"/>
<path
android:pathData="M244.8,219.4l-0.3,17.5 3,-2c1.7,-1.1 4.4,-2.7 6.2,-3.6 3.3,-1.7 4,-1.5 12.4,4l2.4,1.6 -0.3,-17.4 -0.3,-17.5 -11.4,-0 -11.4,-0 -0.3,17.4z"
android:fillColor="#1c81ce"
android:strokeColor="#00000000"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M246,3c-11.4,1.4 -26.3,4.8 -35.9,8.2 -35.1,12.4 -59.8,37.6 -71.5,72.9 -6.4,19.1 -6.8,24.4 -6.4,79.4l0.4,49 2.7,9.7c3.4,12.3 9.1,25.6 15.3,35.4 5,8.1 16.5,22.4 22.8,28.3l3.6,3.5 0,23.2 0,23.3 -19.2,9.7c-10.6,5.3 -31,15.2 -45.3,21.9 -31.1,14.5 -40.9,20.7 -55.6,35.4 -28,27.9 -40.8,62 -37.2,99.4l0.6,6.7 235.2,-0 235.2,-0 0.6,-6.8c4.5,-46.7 -17,-88.7 -59.8,-117.3 -4.5,-3 -10.3,-6.4 -13,-7.6 -2.8,-1.2 -12.2,-5.4 -21,-9.3 -16.1,-7.2 -33.9,-16.2 -53.7,-27.2l-10.8,-6 0,-25.1 0.1,-25.2 6,-4.5c16.4,-12.1 29.1,-35.7 36.2,-67 2,-8.8 2.1,-12.8 2.5,-55.4 0.4,-51.1 0.3,-51.4 -6.5,-71 -13.5,-38.8 -39.4,-65.6 -75,-77.7 -16.1,-5.4 -35.4,-7.7 -50.3,-5.9zM277.6,24.9c32.1,6.6 57.9,28.3 71.2,59.7 1.6,3.8 4.2,11.3 5.8,16.5l2.9,9.4 0,44.5c0,42.2 -0.1,45 -2.2,54.2 -7.1,31.4 -19.4,51.3 -37,60.2l-5.3,2.6 0,37.5 0,37.4 14.3,8.1c17.8,10.2 57.5,30.1 72.7,36.4 19.6,8.3 36.3,20.7 49,36.5 13.6,17 19.9,32.5 22.5,55.3l0.6,5.8 -216.6,-0 -216.6,-0 0.6,-5.8c2.3,-20.8 6.6,-32.4 18.1,-49.7 2.9,-4.5 8.4,-11.3 12.2,-15.1 14.3,-14.5 18.5,-17 72.9,-42.7 27.5,-13 45.3,-22.4 50.6,-26.8l3.7,-3 0,-33.7 0,-33.7 -3.5,-2.4c-5,-3.4 -15.5,-14.8 -21.5,-23.3 -9.7,-13.7 -15.8,-28.1 -18.5,-43.7 -1.8,-10 -2.1,-86 -0.5,-97.6 2.4,-16.3 9,-34.4 17,-46 4.9,-7.1 14.8,-17.2 21.5,-22 23.2,-16.4 59,-24.2 86.1,-18.6z"
android:fillColor="#000000"
android:strokeColor="#00000000"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108"
android:tint="#000000">
<group android:scaleX="0.08477816"
android:scaleY="0.08477816"
android:translateX="29.16"
android:translateY="46.99587">
<group android:translateY="134.71875">
<path android:pathData="M9,-0L9,-103L40.609375,-103Q51.78125,-103,57.09375,-101.03125Q64.34375,-98.375,68.671875,-91.140625Q73,-83.921875,73,-73.40625Q73,-59.53125,65.9375,-50.765625Q58.875,-42,41.53125,-42L20,-42L20,-0L9,-0ZM20,-54L41.984375,-54Q52.390625,-54,57.1875,-58.6875Q62,-63.390625,62,-72.859375Q62,-79,59.625,-83.375Q57.265625,-87.75,53.90625,-89.375Q50.546875,-91,41.78125,-91L20,-91L20,-54Z"
android:fillColor="#000000"/>
<path android:pathData="M85,-50.125Q85,-76.578125,96.625,-90.78125Q108.25,-105,125.578125,-105Q136.76562,-105,145.98438,-98.640625Q155.21875,-92.296875,160.60938,-80.203125Q166,-68.109375,166,-51.390625Q166,-28.40625,155.57812,-13.9375Q144.09375,2,125.5,2Q106.765625,2,95.359375,-14.359375Q85,-29.171875,85,-50.125ZM96,-49.953125Q96,-30.953125,104.578125,-20.46875Q113.15625,-10,125.421875,-10Q137.98438,-10,146.48438,-20.578125Q155,-31.171875,155,-51.703125Q155,-64.953125,150.625,-75.40625Q147.25,-83.390625,140.46875,-88.1875Q133.6875,-93,125.640625,-93Q112.71875,-93,104.359375,-82.484375Q96,-71.96875,96,-49.953125Z"
android:fillColor="#000000"/>
<path android:pathData="M177,-33L187,-34Q187.84375,-25.40625,190.82812,-20.609375Q193.82812,-15.828125,199.39062,-12.90625Q204.96875,-10,211.9375,-10Q221.9375,-10,227.46875,-14.984375Q233,-19.96875,233,-27.9375Q233,-32.59375,231.01562,-36.0625Q229.03125,-39.546875,225.03125,-41.765625Q221.04688,-44,207.76562,-47.75Q195.9375,-51.109375,190.8125,-54.71875Q185.6875,-58.328125,182.84375,-63.875Q180,-69.421875,180,-76.421875Q180,-89.015625,188.01562,-97Q196.03125,-105,209.625,-105Q218.96875,-105,225.96875,-101.25Q232.98438,-97.5,236.84375,-90.484375Q240.71875,-83.484375,241,-74L231,-73Q230.15625,-83.171875,224.98438,-88.078125Q219.82812,-93,210.46875,-93Q200.98438,-93,195.98438,-88.359375Q191,-83.71875,191,-76.359375Q191,-69.546875,194.29688,-65.78125Q197.57812,-62.03125,210.29688,-58.671875Q222.75,-55.390625,227.78125,-52.96875Q235.46875,-49.21875,239.73438,-42.96875Q244,-36.734375,244,-28.078125Q244,-19.484375,239.85938,-12.421875Q235.73438,-5.359375,228.625,-1.671875Q221.53125,2,211.51562,2Q195.90625,2,186.625,-7.4375Q177.34375,-16.875,177,-33Z"
android:fillColor="#000000"/>
<path android:pathData="M289,-33L299,-34Q299.84375,-25.40625,302.82812,-20.609375Q305.82812,-15.828125,311.39062,-12.90625Q316.96875,-10,323.9375,-10Q333.9375,-10,339.46875,-14.984375Q345,-19.96875,345,-27.9375Q345,-32.59375,343.01562,-36.0625Q341.03125,-39.546875,337.03125,-41.765625Q333.04688,-44,319.76562,-47.75Q307.9375,-51.109375,302.8125,-54.71875Q297.6875,-58.328125,294.84375,-63.875Q292,-69.421875,292,-76.421875Q292,-89.015625,300.01562,-97Q308.03125,-105,321.625,-105Q330.96875,-105,337.96875,-101.25Q344.98438,-97.5,348.84375,-90.484375Q352.71875,-83.484375,353,-74L343,-73Q342.15625,-83.171875,336.98438,-88.078125Q331.82812,-93,322.46875,-93Q312.98438,-93,307.98438,-88.359375Q303,-83.71875,303,-76.359375Q303,-69.546875,306.29688,-65.78125Q309.57812,-62.03125,322.29688,-58.671875Q334.75,-55.390625,339.78125,-52.96875Q347.46875,-49.21875,351.73438,-42.96875Q356,-36.734375,356,-28.078125Q356,-19.484375,351.85938,-12.421875Q347.73438,-5.359375,340.625,-1.671875Q333.53125,2,323.51562,2Q307.90625,2,298.625,-7.4375Q289.34375,-16.875,289,-33Z"
android:fillColor="#000000"/>
<path android:pathData="M362,0L394.26562,-103L405.67188,-103L439,0L427.51562,0L418.71875,-30L382.29688,-30L373.5,0L362,0ZM385.8125,-42L415.20312,-42L406.45312,-70.65625Q402.39062,-83.859375,400.5,-92.125Q398.78125,-82.171875,395.65625,-72.359375L385.8125,-42Z"
android:fillColor="#000000"/>
<path android:pathData="M450,0L450,-103L461,-103L461,-12L503,-12L503,0L450,0Z"
android:fillColor="#000000"/>
<path android:pathData="M516,0L516,-103L578,-103L578,-91L527,-91L527,-59L575,-59L575,-47L527,-47L527,-12L579,-12L579,0L516,0Z"
android:fillColor="#000000"/>
</group>
</group>
</vector>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="#FFFFFF" >
</solid>
<padding
android:left="2dp"
android:top="2dp"
android:right="2dp"
android:bottom="2dp">
</padding>
<corners
android:radius="3dp" >
</corners>
</shape>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -63,8 +63,7 @@
android:id="@+id/cust_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/cust_num"
android:layout_marginTop="10dp">
android:layout_below="@+id/cust_num">
<EditText
android:id="@+id/cust_name"
android:layout_width="match_parent"
......@@ -77,8 +76,6 @@
android:singleLine="true"/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:id="@+id/layout_ds"
android:layout_width="match_parent"
......@@ -119,15 +116,12 @@
android:minHeight="45dp"
android:layout_gravity="center"
style="@style/textfont"
android:background="@drawable/background_all"
android:background="@drawable/button_background"
android:textColor="@android:color/white"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/layout"
android:layout_below="@+id/layout_ds"
......@@ -282,9 +276,9 @@
android:id="@+id/generate_invoice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Generate Invoice "
android:text=" GENERATE INVOICE "
android:textAllCaps="false"
android:background="@drawable/background_all"
android:background="@drawable/button_background"
android:textColor="@android:color/white"
android:textSize="16dp"
style="@style/textfont"
......
......@@ -5,7 +5,6 @@
android:layout_height="match_parent"
android:background="@color/bg">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -28,13 +27,15 @@
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat"
app:titleTextAppearance="@style/Toolbartitleheader"
app:titleTextColor="@android:color/white"></androidx.appcompat.widget.Toolbar>
app:titleTextColor="@android:color/white">
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:layout_marginTop="5dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
......@@ -47,12 +48,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_margin="14dp"
android:orientation="horizontal">
<TextView
......@@ -61,7 +62,7 @@
android:layout_width="0dp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_weight="0.50" />
android:layout_weight="0.40" />
<TextView
android:id="@+id/totalMrp"
......@@ -69,13 +70,18 @@
android:layout_width="0dp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_weight="0.50" />
android:layout_weight="0.60" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/bg"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_margin="14dp"
android:orientation="horizontal">
<TextView
......@@ -83,18 +89,15 @@
style="@style/textfont"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="Total Disc"
android:visibility="invisible" />
android:layout_weight="0.40" />
<TextView
android:id="@+id/totalNetMrp"
style="@style/textfont"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="Net MRP"
android:visibility="invisible" />
android:layout_weight="0.60"/>
</LinearLayout>
</LinearLayout>
......@@ -104,20 +107,29 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_height="61dp"
android:layout_margin="5dp"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.40"
android:background="@drawable/layout_rounded">
<CheckBox
android:id="@+id/checked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/checked"/>
android:layout_marginLeft="5dp"
android:layout_gravity="center"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.30">
android:layout_margin="3dp">
<EditText
android:id="@+id/emp_id"
style="@style/textfont"
......@@ -125,15 +137,30 @@
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:hint="Sales Person"
android:inputType="number"
android:singleLine="true"
android:textColor="@android:color/black" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.70">
android:layout_weight="0.60"
android:background="@drawable/layout_rounded">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp">
<EditText
android:id="@+id/barcode_enter"
......@@ -146,6 +173,7 @@
android:textColor="@android:color/black" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</LinearLayout>
......@@ -164,7 +192,6 @@
android:id="@+id/deliveryslip_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_above="@+id/layout">
</androidx.recyclerview.widget.RecyclerView>
......@@ -187,8 +214,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="3dp"
android:background="@drawable/background_all"
android:layout_margin="5dp"
android:background="@drawable/button_background"
android:text="@string/resolve_promotions"
android:textColor="@android:color/white"
android:visibility="gone" />
......@@ -199,8 +226,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="3dp"
android:background="@drawable/background_all"
android:layout_margin="5dp"
android:background="@drawable/button_background"
android:text="@string/print"
android:textColor="@android:color/white"
android:visibility="gone" />
......
......@@ -34,7 +34,7 @@
android:layout_margin="10dp"
style="@style/headerfont"
android:textColor="@android:color/white"
android:background="@drawable/background_all"
android:background="@drawable/button_background"
android:padding="10dp"/>
<Button
......@@ -45,7 +45,7 @@
android:layout_margin="10dp"
style="@style/headerfont"
android:textColor="@android:color/white"
android:background="@drawable/background_all"
android:background="@drawable/button_background"
android:padding="10dp"/>
<Button
......@@ -56,7 +56,7 @@
android:layout_margin="10dp"
style="@style/headerfont"
android:textColor="@android:color/white"
android:background="@drawable/background_all"
android:background="@drawable/button_background"
android:padding="10dp"/>
......
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" android:background="#FFFFFF">
android:orientation="vertical"
android:background="#FFFFFF">
<Button
android:layout_width="match_parent"
......
......@@ -22,7 +22,7 @@
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:titleTextColor="@android:color/white"
app:titleTextAppearance="@style/Toolbartitleheader">
app:titleTextAppearance="@style/headerfont">
</androidx.appcompat.widget.Toolbar>
......@@ -146,6 +146,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/menu_list"
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
android:background="@drawable/background_all"
android:orientation="vertical"
android:weightSum="1"
>
<androidx.appcompat.widget.Toolbar
<!--<androidx.appcompat.widget.Toolbar
android:id="@+id/login_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/background_all"
app:elevation="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:elevation="0dp"
app:titleTextAppearance="@style/Toolbartitleheader"
app:titleTextColor="@android:color/white">
</androidx.appcompat.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>-->
<!-- <ImageView
......@@ -31,9 +34,48 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.40"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pos_logo"
android:layout_gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.60"
>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="10dp"
android:layout_margin="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:gravity="center">
android:layout_margin="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LOGIN"
android:gravity="center"
style="@style/headerfont"
android:layout_marginTop="30dp"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -45,14 +87,16 @@
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:drawableRight="@drawable/ic_user"
android:inputType="number"
style="@style/textfont"
android:textAllCaps="false" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/userIdPassword" >
android:hint="@string/userIdPassword">
<EditText
android:id="@+id/password"
......@@ -60,7 +104,9 @@
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:inputType="textPassword"/>
android:drawableRight="@drawable/ic_password"
style="@style/textfont"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
......@@ -70,20 +116,25 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp">
</Spinner>
android:layout_marginRight="15dp"></Spinner>
<Button
android:id="@+id/submit"
style="@style/textfont"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/background_all"
android:background="@drawable/button_background"
android:text="LOGIN"
android:textColor="@android:color/white"
android:text="Submit"
style="@style/textfont"/>
app:cornerRadius="5dp"
android:layout_marginBottom="30dp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background_all"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_back_foreground"/>
android:background="@drawable/splashscreen">
<ProgressBar
android:id="@+id/progress_circular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"/>
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="150dp"/>
<!-- <androidx.appcompat.widget.AppCompatTextView
<!--<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22sp"
......@@ -27,4 +23,4 @@
android:textColor="@android:color/white"
android:textAppearance="@style/textfont"/>-->
</LinearLayout>
\ No newline at end of file
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/stockReceived_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/background_all"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat"
app:elevation="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:titleTextColor="@android:color/white"
app:titleTextAppearance="@style/headerfont">
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:id="@+id/tfs_Number"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/headerfont"
android:layout_weight="0.5"/>
<Button
android:id="@+id/stock_received"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/background_all"
android:layout_margin="5dp"
android:text=" Stock Received "
style="@style/textfont"
android:textColor="@android:color/white"
android:gravity="center"
android:layout_weight="0.5"/>
</LinearLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_margin="5dp">
<TextView
android:id="@+id/transfer_qty"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.33"
style="@style/headerfont"
/>
<TextView
android:id="@+id/pending_qty"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.33"
style="@style/headerfont"
android:gravity="center"
/>
<TextView
android:id="@+id/received_qty"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.33"
style="@style/headerfont"
android:gravity="right"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Barcode"
android:layout_margin="10dp">
<EditText
android:id="@+id/tfsid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@android:color/black" />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_margin="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Barcode"
style="@style/headerfont"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Received/Sent"
android:gravity="right"
style="@style/headerfont"/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/stockReceived_recylerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/stockTransfer_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/background_all"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat"
app:elevation="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:titleTextColor="@android:color/white"
app:titleTextAppearance="@style/headerfont"
tools:ignore="MissingConstraints">
</androidx.appcompat.widget.Toolbar>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="TFS Number"
android:layout_margin="10dp"
tools:ignore="MissingConstraints">
<EditText
android:id="@+id/tfs_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@android:color/black"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="6dp"
tools:layout_editor_absoluteY="67dp"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/stockout_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/background_all"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat"
app:elevation="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:titleTextColor="@android:color/white"
app:titleTextAppearance="@style/headerfont">
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/textfont"
android:text="To State"
android:layout_margin="5dp"
android:layout_weight="0.25"/>
<Spinner
android:id="@+id/state_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.75"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/textfont"
android:text="To Format"
android:layout_margin="5dp"
android:layout_weight="0.25"/>
<Spinner
android:id="@+id/format_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.75"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="@style/textfont"
android:text="To Location"
android:layout_margin="5dp"
android:layout_weight="0.25"/>
<Spinner
android:id="@+id/location_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.75"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="UOM"
android:textAppearance="@style/textfont"
android:layout_margin="5dp"
android:layout_weight="0.20"/>
<Spinner
android:id="@+id/uom"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.40"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Qty"
style="@style/textfont"
android:layout_margin="5dp"
android:layout_weight="0.15"/>
<EditText
android:id="@+id/qty"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="0.25"
android:text="1"
android:inputType="numberDecimal"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:gravity="center">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Barcode"
android:textAppearance="@style/textfont"
android:layout_margin="10dp"
android:layout_weight="0.20"/>
<EditText
android:id="@+id/barcode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.80"
android:maxLines="1"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/stockOutWord_recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:layout_above="@+id/bottom"/>
<LinearLayout
android:id="@+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true">
<TextView
android:id="@+id/total_boxes"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.33"
android:text="Total Boxes : 0"
style="@style/textfont"/>
<TextView
android:id="@+id/total_lines"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.33"
android:text="Total Lines: 0"
style="@style/textfont"/>
<TextView
android:id="@+id/total_qty"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.33"
android:text="Total Qty :0"
style="@style/textfont"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
......@@ -6,7 +6,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="5dp"
android:background="@color/bg"
app:cardCornerRadius="3dp">
app:cardCornerRadius="5dp">
<LinearLayout
android:layout_width="match_parent"
......@@ -20,20 +20,21 @@
android:layout_height="wrap_content"
style="@style/textfont"
android:textStyle="bold"
android:layout_margin="5dp"/>
android:layout_marginTop="14dp"
android:layout_marginLeft="14dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_margin="5dp">
android:layout_margin="14dp">
<TextView
android:id="@+id/create_barcode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:layout_weight="0.60"
android:layout_marginRight="5dp"
style="@style/textfont"/>
......@@ -41,7 +42,7 @@
android:id="@+id/create_empid"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:layout_weight="0.40"
android:layout_marginLeft="5dp"
style="@style/textfont"/>
......@@ -57,13 +58,13 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_margin="5dp">
android:layout_margin="14dp">
<TextView
android:id="@+id/create_mrp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:layout_weight="0.60"
android:layout_marginRight="5dp"
style="@style/textfont"/>
......@@ -71,7 +72,7 @@
android:id="@+id/create_dis"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:layout_weight="0.40"
android:layout_marginLeft="5dp"
style="@style/textfont"/>
</LinearLayout>
......@@ -88,7 +89,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
style="@style/textfont"
android:layout_margin="5dp"/>
android:layout_margin="10dp"/>
</LinearLayout>
......
......@@ -6,21 +6,22 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@android:color/white"
app:cardCornerRadius="3dp"
android:layout_margin="3dp">
android:layout_margin="10dp">
<LinearLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_margin="15dp">
android:layout_margin="5dp">
<ImageView
android:id="@+id/menu_image"
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="15dp"/>
<TextView
android:id="@+id/menu_name"
......@@ -28,6 +29,8 @@
android:layout_height="wrap_content"
style="@style/textfont"
android:textColor="@android:color/black"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:text="name"/>
</LinearLayout>
......
......@@ -7,6 +7,7 @@
app:cardCornerRadius="3dp"
android:layout_margin="3dp">
<LinearLayout
android:id="@+id/background_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
......
......@@ -9,13 +9,14 @@
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:background="@color/colorAccent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bluetooth Devices List"
android:layout_margin="10dp"
style="@style/headerfont"
android:textColor="@android:color/white"/>
<ImageView
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="@style/textfont"
android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:text="Spinner"
android:paddingLeft="10dp"
android:paddingTop="22dp"
android:ellipsize="marquee" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="3dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/background_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:id="@+id/stockReceived_barcode"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/headerfont"
android:layout_margin="10dp"
android:layout_weight="0.5"/>
<TextView
android:id="@+id/stockReceived_sent_receive"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/headerfont"
android:layout_margin="10dp"
android:gravity="right"
android:layout_weight="0.5"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/black"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
......@@ -8,22 +8,24 @@
android:icon="@drawable/ic_bluetooth_signal_indicator"
android:title="connection"
app:showAsAction="always"/>
<!-- <item
<!--<item
android:id="@+id/option1"
android:orderInCategory="1"
android:title="Connected"
android:icon="@drawable/ic_bluetooth_indicator"
app:showAsAction="ifRoom|collapseActionView"/>-->
<item
android:id="@+id/dashboard_reload"
android:icon="@drawable/ic_refresh"
android:title="Reload"
app:showAsAction="always"/>
<item
android:id="@+id/dashboard_logout"
android:icon="@drawable/ic_power"
android:title="Delete"
app:showAsAction="always"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/Outword_box"
android:title="Create Box"
app:showAsAction="always"/>
<item
android:id="@+id/Outword_tfs"
android:title="Create TFS"
app:showAsAction="ifRoom"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/icon_background"/>
<foreground android:drawable="@drawable/icon_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/icon_background"/>
<foreground android:drawable="@drawable/icon_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#2C0465</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#2C0465</color>
<color name="colorPrimaryDark">#007cde</color>
<color name="colorAccent">#07c4a0</color>
<color name="bg">#6A95A5A6</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="icon_background">#35DCD8</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Pos Stock Audit</string>
<string name="app_name">Pos Sale And Stock</string>
<string name="success" translatable="false">success</string>
<string name="msg" translatable="false">msg</string>
<string name="data" translatable="false">data</string>
......@@ -18,8 +18,9 @@
<string name="no_stores">No Stores Available</string>
<string name="login">Login</string>
<string name="dashboard">DashBoard</string>
<string name="home">Home</string>
<string name="home">HOME</string>
<string name="test">Plans List</string>
<string name="nonetwork">No Internet Connection</string>
<string name="spalsh">Splash Screen</string>
<string name="userId">Employee Id</string>
......@@ -55,7 +56,9 @@
<string name="plan_id">pos_stock_audit_rule_id</string>
<string name="android_version">android_version</string>
<string name="plan_details">Plan Details</string>
<string name="stock_point">stock_point_id</string>
<string name="key">key</string>
<string name="AppCanNot">App cannot handled</string>
<string name="action">action</string>
......@@ -64,7 +67,9 @@
<string name="apply_promotion">apply_promotion_on_scan</string>
<string name="qty_name">quantity</string>
<string name="items">delivery_slip_items</string>
<string name="stock_transfer">Stock Transfer</string>
<string name="stock_out">Stock Out</string>
<string name="stock_received">Stock Received</string>
<string name="create_title">Create Delivery Slip</string>
<string name="resolve_promotions">Resolve Promotions</string>
<string name="save">Save</string>
......@@ -72,6 +77,11 @@
<string name="totalqty">total_qty</string>
<string name="netpayable">net_payable</string>
<string name="totalDisc">total_items_promo_disc</string>
<string name="totalMrp">total_items_mrp</string>
<string name="printerName">PrinterName</string>
<string name="target">Target</string>
<!--<string name="section"><font color=#cc0029>SECTION :</font></string>-->
......
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
......@@ -10,8 +9,9 @@
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDisablePreview">true</item>
</style>
<style name="Toolbartitleheader">
<item name="android:fontFamily">@font/whitneyhtf_book</item>
<item name="android:textSize">18sp</item>
......
......@@ -7,6 +7,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
......
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