diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml
new file mode 100644
index 00000000..caa3055d
--- /dev/null
+++ b/.idea/assetWizardSettings.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
deleted file mode 100644
index 6b176872..00000000
--- a/.idea/deploymentTargetDropDown.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 2d159958..f6be540e 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -44,6 +44,7 @@
+
@@ -103,6 +104,7 @@
+
@@ -196,6 +198,11 @@
+
+
+
+
+
@@ -217,7 +224,7 @@
-
+
@@ -232,10 +239,13 @@
+
+
+
diff --git a/.idea/modules/app/Gestor_Almacén.app.iml b/.idea/modules/app/Gestor_Almacén.app.iml
new file mode 100644
index 00000000..2acb6145
--- /dev/null
+++ b/.idea/modules/app/Gestor_Almacén.app.iml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/vn-warehouseManager.iml b/.idea/modules/vn-warehouseManager.iml
new file mode 100644
index 00000000..f4915405
--- /dev/null
+++ b/.idea/modules/vn-warehouseManager.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/navEditor.xml b/.idea/navEditor.xml
new file mode 100644
index 00000000..18b1af64
--- /dev/null
+++ b/.idea/navEditor.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vn-warehouseManager.iml b/.idea/vn-warehouseManager.iml
new file mode 100644
index 00000000..d6ebd480
--- /dev/null
+++ b/.idea/vn-warehouseManager.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 00000000..4b177804
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,982 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ es
+
+ android-28
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ C:\Users\sergiodt\AppData\Roaming\Subversion
+
+
+
+
+ 1618825571576
+
+
+ 1618825571576
+
+
+ 1644472909011
+
+
+
+ 1644472909011
+
+
+ 1644911413401
+
+
+
+ 1644911413401
+
+
+ 1646409278855
+
+
+
+ 1646409278855
+
+
+ 1648617906228
+
+
+
+ 1648617906228
+
+
+ 1649233788632
+
+
+
+ 1649233788632
+
+
+ 1649234340659
+
+
+
+ 1649234340659
+
+
+ 1649235060928
+
+
+
+ 1649235060928
+
+
+ 1651646872970
+
+
+
+ 1651646872971
+
+
+ 1651647030034
+
+
+
+ 1651647030035
+
+
+ 1651647188750
+
+
+
+ 1651647188751
+
+
+ 1651647225421
+
+
+
+ 1651647225421
+
+
+ 1651647601790
+
+
+
+ 1651647601790
+
+
+ 1651648056868
+
+
+
+ 1651648056868
+
+
+ 1651648467597
+
+
+
+ 1651648467597
+
+
+ 1652788345754
+
+
+
+ 1652788345755
+
+
+ 1653400494828
+
+
+
+ 1653400494829
+
+
+ 1653577349342
+
+
+
+ 1653577349343
+
+
+ 1653644047502
+
+
+
+ 1653644047502
+
+
+ 1653663791334
+
+
+
+ 1653663791335
+
+
+ 1654145430078
+
+
+
+ 1654145430079
+
+
+ 1654670479261
+
+
+
+ 1654670479262
+
+
+ 1654772518409
+
+
+
+ 1654772518410
+
+
+ 1654781827179
+
+
+
+ 1654781827179
+
+
+ 1655369652090
+
+
+
+ 1655369652090
+
+
+ 1655960861634
+
+
+
+ 1655960861634
+
+
+ 1656322885999
+
+
+
+ 1656322886000
+
+
+ 1656930096719
+
+
+
+ 1656930096719
+
+
+ 1659005042067
+
+
+
+ 1659005042068
+
+
+ 1662699501924
+
+
+
+ 1662699501924
+
+
+ 1662982877783
+
+
+
+ 1662982877783
+
+
+ 1663050116723
+
+
+
+ 1663050116723
+
+
+ 1663770280710
+
+
+
+ 1663770280712
+
+
+ 1663770314650
+
+
+
+ 1663770314650
+
+
+ 1663835246994
+
+
+
+ 1663835246994
+
+
+ 1663849445751
+
+
+
+ 1663849445751
+
+
+ 1663850881923
+
+
+
+ 1663850881923
+
+
+ 1663930085261
+
+
+
+ 1663930085262
+
+
+ 1663943604196
+
+
+
+ 1663943604196
+
+
+ 1664276655283
+
+
+
+ 1664276655284
+
+
+ 1664430359823
+
+
+
+ 1664430359824
+
+
+ 1664790614473
+
+
+
+ 1664790614473
+
+
+ 1665032465280
+
+
+
+ 1665032465281
+
+
+ 1665037437997
+
+
+
+ 1665037437997
+
+
+ 1665038575752
+
+
+
+ 1665038575752
+
+
+ 1665118245168
+
+
+
+ 1665118245169
+
+
+ 1665123288355
+
+
+
+ 1665123288355
+
+
+ 1665470010499
+
+
+
+ 1665470010500
+
+
+ 1665470036509
+
+
+
+ 1665470036509
+
+
+ 1666276993765
+
+
+
+ 1666276993765
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
+ 61
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
+ 202
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
+ 195
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
index 0d0e6b74..09d7cf6f 100644
--- a/app/release/output-metadata.json
+++ b/app/release/output-metadata.json
@@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
- "versionCode": 138,
- "versionName": "9.2",
+ "versionCode": 140,
+ "versionName": "9.4Beta",
"outputFile": "app-release.apk"
}
],
diff --git a/app/release/vn-picking.apk b/app/release/vn-picking.apk
deleted file mode 100644
index d5581284..00000000
Binary files a/app/release/vn-picking.apk and /dev/null differ
diff --git a/app/src/main/java/es/verdnatura/di/viewModelModule.kt b/app/src/main/java/es/verdnatura/di/viewModelModule.kt
index 2f1c63ee..4936fa3f 100644
--- a/app/src/main/java/es/verdnatura/di/viewModelModule.kt
+++ b/app/src/main/java/es/verdnatura/di/viewModelModule.kt
@@ -1,5 +1,4 @@
package es.verdnatura.di
-
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
@@ -18,6 +17,7 @@ import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.she
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoViewModel
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
+import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
import es.verdnatura.presentation.view.feature.paletizador.fragment.*
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingViewModel
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel
@@ -38,7 +38,7 @@ import org.koin.dsl.module
val viewModelModule = module {
- viewModel{
+ viewModel {
WorkermistakeViewModel(androidContext())
}
@@ -188,7 +188,7 @@ val viewModelModule = module {
SmartTagsViewModel(androidContext())
}
viewModel {
- itemShelvingLogViewModel(androidContext())
+ itemShelvingLogViewModel(androidContext())
}
viewModel {
shelvingLogViewModel(androidContext())
@@ -200,5 +200,7 @@ val viewModelModule = module {
viewModel {
PalletScanViewModel(androidContext())
}
-
+ viewModel {
+ PackagingViewModel(androidContext())
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt
index 74f014db..bf02aa74 100644
--- a/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt
+++ b/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt
@@ -79,7 +79,7 @@ class GetLoginUserCase(context: Context) : RestClient(context)
fun sendChekingPresence(token:String,workerId:Int,message:String) : Call{
- var working_in_test=true // Enviar a grupo test Android o a los usuarios
+ var working_in_test=false // Enviar a grupo test Android o a los usuarios
if (!working_in_test) {
return salixClient!!.sendChekingPresence(
diff --git a/app/src/main/java/es/verdnatura/domain/GetPackagingUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetPackagingUserCase.kt
new file mode 100644
index 00000000..cdc80808
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/domain/GetPackagingUserCase.kt
@@ -0,0 +1,59 @@
+package es.verdnatura.domain
+
+import android.content.Context
+import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
+import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
+import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
+import es.verdnatura.presentation.view.feature.packaging.model.Supplier
+import retrofit2.Call
+
+class GetPackagingUserCase(context: Context) : RestClient(context) {
+
+ fun getSuppliers(token: String): Call> {
+ return salixClient!!.getSuppliers(authorization = token)
+ }
+
+ fun Entries(token: String, entry:EntrySalix): Call {
+ return salixClient!!.Entries(authorization = token,entry=entry)
+ }
+
+ fun faultsReview_isChecked(
+ usuario: String,
+ password: String,
+ itemFk: String,
+ warehouseFk: String
+ ): Call {
+ val params: ArrayList = ArrayList()
+ params.add(itemFk)
+ params.add(warehouseFk)
+ return restClient!!.faultsReview_isChecked(
+ "json",
+ "1",
+ usuario,
+ password,
+ "application/json",
+ params = params
+ )
+ }
+
+ fun itemShelvingBuyerGet(usuario: String, password: String): Call> {
+ return restClient!!.itemShelvingBuyerGet("json", "1", usuario, password, "application/json")
+ }
+
+ fun supplier_getItems(
+ usuario: String,
+ password: String,
+ supplierFk: String
+ ): Call> {
+ val params: ArrayList = ArrayList()
+ params.add(supplierFk)
+ return restClient!!.supplier_getItems(
+ "json",
+ "1",
+ usuario,
+ password,
+ "application/json",
+ params = params
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/domain/GetPaletizadoresUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetPaletizadoresUserCase.kt
index fd8cd0f8..7f56897e 100644
--- a/app/src/main/java/es/verdnatura/domain/GetPaletizadoresUserCase.kt
+++ b/app/src/main/java/es/verdnatura/domain/GetPaletizadoresUserCase.kt
@@ -45,10 +45,10 @@ class GetPaletizadoresUserCase(context: Context) : RestClient(context) {
fun cmrExpeditionPallet_add(
usuario: String,
password: String,
- vExpeditionPallet: String,
- vCmrId: String
+ vExpeditionPallet: String?,
+ vCmrId: String?
): Call {
- val params: ArrayList = ArrayList()
+ val params: ArrayList = ArrayList()
params.add(vExpeditionPallet)
params.add(vCmrId)
diff --git a/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt
index a8e415ee..70b12820 100644
--- a/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt
+++ b/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt
@@ -490,10 +490,9 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
params
)
}
- fun itemShelving_updateFromSale(usuario: String, password: String, saleFk: String,visible:String): Call {
+ fun itemShelving_updateFromSale(usuario: String, password: String, saleFk: String): Call {
val params: ArrayList = ArrayList()
params.add(saleFk)
- params.add(visible)
return restClient!!.itemShelving_updateFromSale(
"json",
"1",
diff --git a/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt
index 8f9d25f7..26b6fc20 100644
--- a/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt
+++ b/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt
@@ -30,17 +30,17 @@ class GetUbicadorUserCase(context: Context) : RestClient(context) {
shelving: String,
item: String,
quantity: String,
- packing: String,
+ packing: String?,
warehouse: String,
- grouping:String
+ grouping:String?
): Call {
val params: ArrayList = ArrayList()
params.add(shelving)
params.add(item)
params.add(quantity)
- params.add(packing)
+ if (packing!=null) params.add(packing)
params.add(warehouse)
- params.add(grouping)
+ if (grouping!=null)params.add(grouping)
return restClient!!.itemShelvingMake(
"json",
"1",
diff --git a/app/src/main/java/es/verdnatura/domain/SalixService.kt b/app/src/main/java/es/verdnatura/domain/SalixService.kt
index 13856003..59b626d7 100644
--- a/app/src/main/java/es/verdnatura/domain/SalixService.kt
+++ b/app/src/main/java/es/verdnatura/domain/SalixService.kt
@@ -1,36 +1,40 @@
package es.verdnatura.domain
+import com.google.gson.Gson
import com.google.gson.JsonObject
+import es.verdnatura.presentation.view.feature.packaging.model.Supplier
import es.verdnatura.presentation.common.itemBarCodeSalix
import es.verdnatura.presentation.common.itemPackingTypeSalix
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
-import es.verdnatura.presentation.view.feature.collection.saleSalix
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
import es.verdnatura.presentation.view.feature.login.model.SalixGrupo
import es.verdnatura.presentation.view.feature.login.model.SalixMessageVO
+import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import org.json.JSONObject
import retrofit2.Call
import retrofit2.http.*
-import java.net.URLEncoder
interface SalixService {
@POST("Accounts/login")
- fun login(@Header("Content-Type") content_type: String,
- @Body params: LoginSalixVO):
+ fun login(
+ @Header("Content-Type") content_type: String,
+ @Body params: LoginSalixVO
+ ):
Call
@POST("chats/sendCheckingPresence")
fun sendChekingPresence(
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
- @Body params: SalixMessageVO):
+ @Body params: SalixMessageVO
+ ):
Call
@POST("chats/send")
@@ -46,7 +50,7 @@ interface SalixService {
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
- ):
+ ):
Call>
@GET("collections/getCollection")
@@ -81,30 +85,30 @@ interface SalixService {
@Header("version") version: String,
@Header("Authorization") authorization: String,
@Header("Content-Type") content_type: String,
- @Path("idTicket") idTicket:String,
+ @Path("idTicket") idTicket: String,
@Body params: listSaleSalix
):
Call
//https://test-salix.verdnatura.es/api/Departments?filter={"fields": {"id": true, "name": true},"where": {"name": "COMPRAS"}}
- // http://test-salix.verdnatura.es/api/Departments?filter={"fields": {"id": true, "name": true},"where": {"hasToMistake": "FALSE"}}
+ // http://test-salix.verdnatura.es/api/Departments?filter={"fields": {"id": true, "name": true},"where": {"hasToMistake": "FALSE"}}
- // @GET("api/Departments?filter={\"fields\": {\"id\": true, \"name\": true},\"where\": {\"hasToMistake\": \"FALSE\"}}")
+ // @GET("api/Departments?filter={\"fields\": {\"id\": true, \"name\": true},\"where\": {\"hasToMistake\": \"FALSE\"}}")
@GET("Departments")
fun department_getHasMistake(
- @Header("Content-Type") content_type: String,
- @Header("Authorization") authorization: String,
- @Query("filter") filter:String = "{\"fields\": {\"id\": true, \"name\": true},\"where\": {\"name\": \"INFORMATICA\"}}"
- // @Query("name") name:String ="COMPRAS"
- ):
+ @Header("Content-Type") content_type: String,
+ @Header("Authorization") authorization: String,
+ @Query("filter") filter: String = "{\"fields\": {\"id\": true, \"name\": true},\"where\": {\"name\": \"INFORMATICA\"}}"
+ // @Query("name") name:String ="COMPRAS"
+ ):
Call>
@GET("Workers/{idWorker}/sip")
fun sip_getExtension(
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
- @Path("idWorker") idWorker:String
+ @Path("idWorker") idWorker: String
):
Call
@@ -113,7 +117,7 @@ interface SalixService {
fun update_ItemPackingType(
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
- @Path("itemFk") itemFk:String,
+ @Path("itemFk") itemFk: String,
@Body params: itemPackingTypeSalix
):
Call
@@ -124,12 +128,10 @@ interface SalixService {
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
- ):
+ ):
Call>
-
-
@PUT("ItemBarCodes")//REVISADA
fun barcodes_edit(
@Header("Content-Type") content_type: String,
@@ -143,20 +145,42 @@ interface SalixService {
fun barcodes_toitem(
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
- @Path("barCodeValue") barCodeValue:String
+ @Path("barCodeValue") barCodeValue: String
):
Call
+ @GET("Suppliers")//REVISADA
+ fun getSuppliers(
+ @Header("Content-Type") content_type: String="application/json",
+ @Header("Authorization") authorization: String,
+ //@Body params:JSONObject=JSONObject("""filter"={"fields":{"id":true,"name":true},"include":[{"relation":"contacts","scope":{"fields":["email"],"order":"id DESC","limit":1,"where":{"email":{"neq":null}}}}]}""")
+ /* @Query("filter") filter:String="{\"fields\":{\"id\":true,\"name\":true},\"include\":[{\"relation\":\"contacts\"," +
+ "\"scope\":{" +
+ "\"fields\":[\"email\"],\"order\":\"id DESC\",\"limit\":1," +
+ "\"where\":{ \"email\":{\"neq\":null } }}}]})"*/
+
+ ):
+ Call>
+
+ @PUT("Entries")//REVISADA
+ fun Entries(
+ @Header("Content-Type") content_type: String="application/json",
+ @Header("Authorization") authorization: String,
+ @Body entry:EntrySalix
+ ):
+ Call
+
@GET("Shelvings")
fun Shelvings(
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
- @Query("filter") filter:String
+ @Query("filter") filter: String
):
Call>
}
+
interface SalixServiceSend {
@POST("chats/send")
diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
index 5fd580f0..8098662c 100644
--- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
+++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
@@ -21,6 +21,7 @@ import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHisto
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.login.model.LoginDevice
import es.verdnatura.presentation.view.feature.login.model.versionApp
+import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
import es.verdnatura.presentation.view.feature.paletizador.model.*
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
@@ -1287,7 +1288,7 @@ interface VerdnaturaService {
@Header("user") user: String,
@Header("pass") pass: String,
@Header("Content-Type") content_type: String,
- @Body params: List
+ @Body params: List
):
Call
@@ -1590,6 +1591,16 @@ interface VerdnaturaService {
@Body params: List
):
Call
-
+ //SUPPLIERS
+ @POST("almacennew/supplier_getItems")//REVISADA
+ fun supplier_getItems(
+ @Header("aplicacion") aplicacion: String,
+ @Header("version") version: String,
+ @Header("user") user: String,
+ @Header("pass") pass: String,
+ @Header("Content-Type") content_type: String,
+ @Body params: List
+ ):
+ Call>
}
diff --git a/app/src/main/java/es/verdnatura/domain/itemShelvingLogUSerCase.kt b/app/src/main/java/es/verdnatura/domain/itemShelvingLogUSerCase.kt
index d0203b08..36ed1295 100644
--- a/app/src/main/java/es/verdnatura/domain/itemShelvingLogUSerCase.kt
+++ b/app/src/main/java/es/verdnatura/domain/itemShelvingLogUSerCase.kt
@@ -6,6 +6,7 @@ import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLog
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
+import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
import retrofit2.Call
class itemShelvingLogUSerCase(context: Context) : RestClient(context) {
@@ -45,6 +46,8 @@ class itemShelvingLogUSerCase(context: Context) : RestClient(context) {
)
}
+
+
fun Shelvings(
token: String,
vShelvingFilter: String,
diff --git a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt
index e3eb8a8f..a116fd93 100644
--- a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt
@@ -255,6 +255,7 @@ abstract class BaseFragment(viewModelCla
R.drawable.ic_logo_salix -> getString(R.string.accessSalix)
R.drawable.ic_eye_ui -> getString(R.string.icViewCollection)
R.drawable.ic_collection -> getString(R.string.icViewCollection)
+ R.drawable.ic_controller_ui -> getString(R.string.checkerUbication)
else -> {
""
}
@@ -547,6 +548,11 @@ abstract class BaseFragment(viewModelCla
ITEMPACKING -> prefs.getString(name, "").toString()
ITEMPACKINGFK -> prefs.getString(name, "").toString()
WORKFORMSELECTED -> prefs.getString(name, "Producción").toString()
+ "SUPPLIERNAME" -> prefs.getString(name, "").toString()
+ "SUPPLIERID" -> prefs.getString(name, "").toString()
+ "ENTRYTYPE" -> prefs.getString(name, "").toString()
+ "ENTRYNUMBERIMAGES" -> prefs.getString(name, "0").toString()
+ "ENTRYOBSERVATIONS" -> prefs.getString(name, "").toString()
"base_url" -> {
@@ -655,20 +661,22 @@ abstract class BaseFragment(viewModelCla
urlSalix = "https://test-salix.verdnatura.es/api/"
)
)
- saveWorkForm(
- WorkForms(
- "TestLocalhost",
- "http://10.1.4.42:9000",
- urlSalix = "https://test-salix.verdnatura.es/api/"
+
+ /* saveWorkForm(
+ WorkForms(
+ "TestLocalhost",
+ "http://10.1.4.42:9000",
+ urlSalix = "https://test-salix.verdnatura.es/api/"
+ )
)
- )
- saveWorkForm(
- WorkForms(
- "TestHome",
- "http://192.168.1.132:9000",
- urlSalix = "https://test-salix.verdnatura.es/api/"
- )
- )
+
+ saveWorkForm(
+ WorkForms(
+ "TestHome",
+ "http://192.168.1.132:9000",
+ urlSalix = "https://test-salix.verdnatura.es/api/"
+ )
+ )*/
saveWorkForm(
WorkForms(
diff --git a/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt b/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt
index 375b4916..9a525e39 100644
--- a/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt
+++ b/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt
@@ -9,6 +9,7 @@ import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.login.model.WorkForms
+import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
@@ -61,6 +62,15 @@ interface OnSmartTagRowClickListener {
interface OnGeneralItemRowClickListener {
fun OnGeneralItemRowClickListener(item: GeneralItem)
}
+
+interface OnImageTrashClickListener {
+ fun OnImageUpdateClickListener(item: Any)
+}
+
+interface OnImageUpdateClickListener {
+ fun OnImageUpdateClickListener(item: Any)
+}
+
interface OnWorkFormsItemRowClickListener {
fun OnWorkFormsItemRowClickListener(item: WorkForms)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt b/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt
index 13bb4d2d..d22840b2 100644
--- a/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt
+++ b/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt
@@ -3,7 +3,6 @@ package es.verdnatura.presentation.common
import org.json.JSONObject
data class itemScanned(var scanned: JSONObject) {
- // var schema: String = scanned!!.get("schema").toString()
- var table: String = scanned!!.get("table").toString()
- var id: String = scanned!!.get("id").toString()
+ var table: String? = scanned.get("table").toString()
+ var id: String? = scanned.get("id").toString()
}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogInputTwoValues.kt b/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogInputTwoValues.kt
index 6fca7759..de6430cb 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogInputTwoValues.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogInputTwoValues.kt
@@ -57,6 +57,7 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
return this
}
+
fun setValueTwo(value: String): CustomDialogInputTwoValues {
binding.customDialogValueTwo.setText(value)
@@ -80,6 +81,7 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
return this
}
+
fun setDescription(description: String): CustomDialogInputTwoValues {
binding.customDialogDescription.visibility = View.VISIBLE
@@ -118,6 +120,10 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
fun setInfoTex(text:String){
binding.textinputlayoutUsername.hint = text
}
+ fun setHint(visible:Boolean){
+ binding.textinputlayoutUsername.isHintEnabled = visible
+ binding.textinputlayoutTwo.isHintEnabled = visible
+ }
fun setInfoTextTwo(text:String){
binding.textinputlayoutTwo.hint = text
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt
index 04c6430c..eef57ab6 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt
@@ -24,6 +24,7 @@ class SaleAdapter(
private val onSaleClickListener: OnSaleClickListener,
private val onMistakeClickListener: OnMistakeClickListener,
private val onPackingClick: onPackingClickListener,
+
) : RecyclerView.Adapter() {
var context: Context? = null
var position: Int = 0
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
index f690ae28..a1888199 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
@@ -8,6 +8,7 @@ import android.media.MediaPlayer
import android.net.Uri
import android.os.Build
import android.os.Bundle
+import android.os.Parcelable
import android.util.Log.d
import android.view.View
import android.view.View.GONE
@@ -103,6 +104,7 @@ class CollectionFragment(
private var workerFkFromTicket = ""
private var itemShelvingTracking_mark: String = ""
+ private var recylerViewState: Parcelable? = null
companion object {
fun newInstance(collection: CollectionVO, type: String) =
@@ -156,10 +158,6 @@ class CollectionFragment(
}
override fun onResume() {
-
- if (type == CONTROLADOR && storedBackPosition != 0) {
- setListPosition(storedBackPosition, true)
- }
super.onResume()
scanRequest()
}
@@ -171,7 +169,6 @@ class CollectionFragment(
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = VISIBLE
-
setEvents()
setToolBar()
@@ -179,7 +176,6 @@ class CollectionFragment(
createCollectionList()
}
-
super.init()
}
@@ -188,6 +184,7 @@ class CollectionFragment(
goBack = true
goBack2 = true
goMistakeBack = true
+
}
private fun setToolBar() {
@@ -199,12 +196,8 @@ class CollectionFragment(
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
}
-
val listIcons: ArrayList = ArrayList()
- /* val iconPrevia = ImageView(context)
- iconPrevia.setImageResource(R.drawable.ic_local_parking_orange_24dp)*/
-
val iconPrint = ImageView(context)
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
@@ -386,9 +379,6 @@ class CollectionFragment(
}
//ESCANER =========
hideKeyboards()
- /* if (type.equals(CONTROLADOR)){
- binding.scanInput.inputType= InputType.TYPE_CLASS_NUMBER
- }*/
binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
@@ -889,15 +879,19 @@ class CollectionFragment(
if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true)
-
+ binding.splashProgress.visibility = VISIBLE
+ viewModel.collectionTicketGet(
+ getData(USER),
+ getData(PASSWORD),
+ collection.collectionFk,
+ getData(SECTORFK),
+ type
+ )
}
-
} else {
saleAdapter!!.notifyDataSetChanged()
-
-
goBack = false
}
})
@@ -1042,6 +1036,7 @@ class CollectionFragment(
//CREATE LIST
private fun createCollectionList() {
+
state = 0
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
@@ -1074,9 +1069,9 @@ class CollectionFragment(
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
- for (s in sales) {
- d("VERDNATURA::", "El id es " + s.saleFk + " tiene saleOrder" + s.saleOrder)
- }
+ /* for (s in sales) {
+ // d("VERDNATURA::", "El id es " + s.saleFk + " tiene saleOrder" + s.saleOrder)
+ }*/
if (type == CONTROLADOR) {
@@ -1157,20 +1152,37 @@ class CollectionFragment(
binding.fragmentSacadorCollections.adapter = saleAdapter
binding.fragmentSacadorCollections.layoutManager = lm
setTotalLines()
-
- if (storedPosition != 0)
- setListPosition(storedPosition, true)
- else if (storedBackPosition != 0)
+ //Tarea #4628
+ if (type == CONTROLADOR) {
setListPosition(storedBackPosition, true)
+ setScrollListener(lm!!)
+ } else {
+ if (storedPosition != 0)
+ setListPosition(storedPosition, true)
+ else if (storedBackPosition != 0)
+ setListPosition(storedBackPosition, true)
- setScrollListener(lm!!)
- //sergio: se quita porque se realiza desde triggers
- // changeInitTicketState()
+ }
+ //CAU ISMAELCT
+ if (type == SACADOR) {
+ for (indice in sales.indices){
+ //sales.forEachIndexed outer@{ pos, s ->
+
+ if (sales[indice].isPrepared == "0") {
+ // d("VERDNATURA::", "sale encontrada pos: " + sales[indice].saleFk + "-" + sales[indice].itemFk)
+ setListPosition(position = indice, isFromBack = true)
+ break
+ }
+
+ }
+ }
+ exit@
printObservations(observations)
}
private fun setScrollListener(lm: LinearLayoutManager) {
+ binding.fragmentSacadorCollections.clearOnScrollListeners()
binding.fragmentSacadorCollections.addOnScrollListener(object :
RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
@@ -1477,6 +1489,9 @@ class CollectionFragment(
private fun setListPosition(position: Int, isFromBack: Boolean) {
storedPosition = position
+ //tarea #4628, se asigna storedBackPosition
+ storedBackPosition = position
+
if (type == SACADOR || (type == CONTROLADOR && (getData(SECTORDESCRIP).uppercase() == getString(
R.string.sectorALGEMESI
) || getData(SECTORDESCRIP).uppercase() == getString(
@@ -1556,8 +1571,7 @@ class CollectionFragment(
viewModel.itemShelving_updateFromSale(
getData(USER),
getData(PASSWORD),
- sales[position].saleFk,
- sales[position].quantity.toString()
+ sales[position].saleFk
)
positionUnmarked = position
@@ -2298,24 +2312,24 @@ class CollectionFragment(
private fun showQuantityDialog(position: Int) {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("")
- //Tarea4495
+ //Tarea4495
// if (type != SACADOR) {
- customDialogThreeButtons.setOkButton(getString(R.string.titleFaults)) {
- checkAndCall(
- position,
- customDialogThreeButtons.getValue(),
- getString(R.string.titleFaults)
- )
+ customDialogThreeButtons.setOkButton(getString(R.string.titleFaults)) {
+ checkAndCall(
+ position,
+ customDialogThreeButtons.getValue(),
+ getString(R.string.titleFaults)
+ )
- }.setOkButtonTwo(getString(R.string.BasuraRechazar)) {
+ }.setOkButtonTwo(getString(R.string.BasuraRechazar)) {
- checkAndCall(
- position,
- customDialogThreeButtons.getValue(),
- getString(R.string.BasuraRechazar)
- )
- }
- // }
+ checkAndCall(
+ position,
+ customDialogThreeButtons.getValue(),
+ getString(R.string.BasuraRechazar)
+ )
+ }
+ // }
customDialogThreeButtons.setOkButtonThree(getString(R.string.Reject)) {
checkAndCall(
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt
index 6a41d491..2d699c28 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt
@@ -738,14 +738,13 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
fun itemShelving_updateFromSale(
usuario: String,
password: String,
- itemShelvingFk: String,
- visible: String
+ itemShelvingFk: String
) {
getSacadorControladorUserCase.itemShelving_updateFromSale(
usuario,
password,
- itemShelvingFk,
- visible
+ itemShelvingFk
+
)
.enqueue(object : Callback {
override fun onFailure(call: Call, t: Throwable) {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt
index 4a4774c2..be4fb1e4 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt
@@ -4,6 +4,7 @@ import android.content.Intent
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Build
+import android.util.Log.d
import android.view.View.*
import android.widget.ImageView
import androidx.annotation.RequiresApi
@@ -56,7 +57,7 @@ class ControlVehiculoUsuarioFragment(
iconPhone.setImageResource(R.drawable.phone_call)
iconPhone.tooltipText = getTooltip(R.drawable.phone_call)
- // listIcons.add(iconPhone)
+ listIcons.add(iconPhone)
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
@@ -110,14 +111,16 @@ class ControlVehiculoUsuarioFragment(
binding.userInformation.setOnClickListener({ binding.mainToolbar.backButton.performClick() })
viewModel.machine_getWorkerPlate(getData(USER), getData(PASSWORD))
}
+
binding.userImage.loadUrl(
- "https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=${
+ getData("base_urlSalix")+"/Images/user/160x160/$userFk/download?access_token=${
getData(
TOKEN
)
}"
)
+
binding.nameVehiclecontrol.text = getData(USER)
binding.registeredVehiclecontrol.text = ""
binding.deviceName.text = ""
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/adapter/ItemShelvingLogAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/adapter/ItemShelvingLogAdapter.kt
index 922a7c32..740859c8 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/adapter/ItemShelvingLogAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/adapter/ItemShelvingLogAdapter.kt
@@ -7,12 +7,15 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemShelvinglogRowBinding
+import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
+import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import java.text.SimpleDateFormat
import java.util.*
class ItemShelvingLogAdapter (
- private val items: List
+ private val items: List,
+ private val onPasillerosItemClickListener: OnPasillerosItemClickListener
): RecyclerView.Adapter() {
@@ -26,6 +29,12 @@ class ItemShelvingLogAdapter (
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
+ holder.binding.root.setOnClickListener {
+ onPasillerosItemClickListener.onPasillerosItemClickListener(
+ PasillerosItemVO(title = holder.binding.root.context.getString(
+ R.string.titleUbicator)),items[position].code)
+ }
+
}
inner class ItemHolder(
@@ -35,17 +44,7 @@ class ItemShelvingLogAdapter (
fun bind(item: ItemShelvingLog) {
binding.apply {
this.item = item
- /* val sdf = SimpleDateFormat("yyyy-MM-dd")
- val currentDate = sdf.format(Date())
- if (currentDate == item.created){
- saledate.setBackgroundColor(
- ContextCompat.getColor(historicoDate.context,
- R.color.verdnatura_pumpkin_orange))
- }else{
- saledate.setBackgroundColor(
- ContextCompat.getColor(historicoDate.context,
- R.color.verdnatura_black_5))
- }*/
+
}
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt
index 83dbbd60..a79a9664 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt
@@ -1,119 +1,126 @@
package es.verdnatura.presentation.view.feature.historicoshelving.fragment
- import android.view.View
- import android.view.inputmethod.EditorInfo
- import androidx.lifecycle.Observer
- import androidx.recyclerview.widget.LinearLayoutManager
- import es.verdnatura.R
- import es.verdnatura.databinding.FragmentItemshelvinglogBinding
- import es.verdnatura.domain.notNull
- import es.verdnatura.presentation.base.BaseFragment
- import es.verdnatura.presentation.view.component.CustomDialog
- import es.verdnatura.presentation.view.component.CustomDialogList
- import es.verdnatura.presentation.view.feature.historicoshelving.adapter.ItemShelvingLogAdapter
- import es.verdnatura.presentation.view.feature.main.activity.MainActivity
+import android.content.Context
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import androidx.lifecycle.Observer
+import androidx.recyclerview.widget.LinearLayoutManager
+import es.verdnatura.R
+import es.verdnatura.databinding.FragmentItemshelvinglogBinding
+import es.verdnatura.domain.notNull
+import es.verdnatura.presentation.base.BaseFragment
+import es.verdnatura.presentation.common.OnPasillerosItemClickListener
+import es.verdnatura.presentation.view.component.CustomDialog
+import es.verdnatura.presentation.view.feature.historicoshelving.adapter.ItemShelvingLogAdapter
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class itemShelvingLogFragment(
- var entryPoint: String = ""
- // ) : BaseFragment(itemShelvingLogViewModel::class) {
- ) : BaseFragment(itemShelvingLogViewModel::class) {
- //private lateinit var customDialogList: CustomDialogList
- private var adapter: ItemShelvingLogAdapter? = null
- private var itemScan = ""
+ var entryPoint: String = ""
+ // ) : BaseFragment(itemShelvingLogViewModel::class) {
+) : BaseFragment(itemShelvingLogViewModel::class) {
+ //private lateinit var customDialogList: CustomDialogList
+ private var adapter: ItemShelvingLogAdapter? = null
+ private var itemScan = ""
+ private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
- companion object {
- fun newInstance(entryPoint: String) = itemShelvingLogFragment(entryPoint)
- }
+ companion object {
+ fun newInstance(entryPoint: String) = itemShelvingLogFragment(entryPoint)
+ }
- private lateinit var customDialog: CustomDialog
+ private lateinit var customDialog: CustomDialog
- override fun getLayoutId(): Int = R.layout.fragment_itemshelvinglog
+ override fun getLayoutId(): Int = R.layout.fragment_itemshelvinglog
- override fun init() {
+ override fun init() {
- customDialog = CustomDialog(requireContext())
- // customDialogList = CustomDialogList(requireContext())
+ customDialog = CustomDialog(requireContext())
+ // customDialogList = CustomDialogList(requireContext())
- setEvents()
- setToolBar(getString(R.string.itemShelvingLog))
- super.init()
+ setEvents()
+ setToolBar(getString(R.string.itemShelvingLog))
+ super.init()
- }
+ }
- private fun setToolBar(title: String) {
- binding.mainToolbar.toolbarTitle.text = title
+ override fun onAttach(context: Context) {
+ if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
+ super.onAttach(context)
+ }
+ private fun setToolBar(title: String) {
+ binding.mainToolbar.toolbarTitle.text = title
+ }
- }
+ private fun setEvents() {
+ binding.scanInput.requestFocus()
+ binding.scanInput.setOnEditorActionListener { v, actionId, event ->
+ if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
+ if (!binding.scanInput.text.toString().isNullOrEmpty()) {
+ itemShelvingLog_get(binding.scanInput.text.toString())
- private fun setEvents() {
- binding.scanInput.requestFocus()
- binding.scanInput.setOnEditorActionListener { v, actionId, event ->
- if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
- if (!binding.scanInput.text.toString().isNullOrEmpty()) {
- itemShelvingLog_get(binding.scanInput.text.toString())
-
- itemScan = binding.scanInput.text.toString()
- }
- binding.scanInput.setText("")
- ma.hideKeyboard(binding.scanInput)
- return@setOnEditorActionListener true
+ itemScan = binding.scanInput.text.toString()
}
- false
+ binding.scanInput.setText("")
+ ma.hideKeyboard(binding.scanInput)
+ return@setOnEditorActionListener true
}
-
-
- binding.mainToolbar.backButton.setOnClickListener {
- requireActivity().onBackPressed()
- }
-
+ false
}
- private fun itemShelvingLog_get(vShelvingFK: String) {
- binding.splashProgress.visibility = View.VISIBLE
- viewModel.itemShelvingLog_get(getData(USER), getData(PASSWORD),vShelvingFK)
-
+ binding.mainToolbar.backButton.setOnClickListener {
+ requireActivity().onBackPressed()
}
+ }
- override fun observeViewModel() {
- with(viewModel) {
- loadItemShelvingLogList.observe(viewLifecycleOwner, Observer{ event ->
- event.getContentIfNotHandled().notNull {
- binding.splashProgress.visibility = View.GONE
- adapter = ItemShelvingLogAdapter(it.list)
- binding.itemshelvinglogRecyclerview.adapter = adapter
- binding.itemshelvinglogRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
- setToolBar(getString(R.string.itemShelvingLog)+":"+itemScan)
+ private fun itemShelvingLog_get(vShelvingFK: String) {
+ binding.splashProgress.visibility = View.VISIBLE
+ viewModel.itemShelvingLog_get(getData(USER), getData(PASSWORD), vShelvingFK)
- if (it.list.isEmpty()){
- customDialog.setTitle(getString(R.string.noResults))
- .setDescription(getString(R.string.noDataLabelScanned))
+ }
+
+
+ override fun observeViewModel() {
+ with(viewModel) {
+
+ loadItemShelvingLogList.observe(viewLifecycleOwner, Observer { event ->
+ event.getContentIfNotHandled().notNull {
+ binding.splashProgress.visibility = View.GONE
+ adapter = ItemShelvingLogAdapter(
+ it.list,
+ onPasillerosItemClickListener = pasillerosItemClickListener!!
+ )
+ binding.itemshelvinglogRecyclerview.adapter = adapter
+ binding.itemshelvinglogRecyclerview.layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
+ setToolBar(getString(R.string.itemShelvingLog) + ":" + itemScan)
+
+ if (it.list.isEmpty()) {
+ customDialog.setTitle(getString(R.string.noResults))
+ .setDescription(getString(R.string.noDataLabelScanned))
+ .setOkButton(getString(R.string.close)) {
+ customDialog.dismiss()
+ }.show()
+ } else {
+
+ if (it.list.get(0).isError) {
+ customDialog.setTitle(getString(R.string.error))
+ .setDescription(it.list.get(0).errorMessage)
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
- }else{
-
- if (it.list.get(0).isError){
- customDialog.setTitle(getString(R.string.error))
- .setDescription(it.list.get(0).errorMessage)
- .setOkButton(getString(R.string.close)) {
- customDialog.dismiss()
- }.show()
- }
}
-
}
- })
+
+ }
+ })
- }
}
-
-
-
}
+
+
+}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt
index 103b8fec..236d2eee 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt
@@ -80,7 +80,7 @@ class InventaryFragment :
items,
SearchResultListener { baseSearchDialogCompat, nombre, position ->
- binding.filterBuyer.text = (nombre.title)
+ binding.filterBuyer.text = (nombre.title)
saveBuyer(nombre.getBuyerNickname())
saveBuyerId(nombre.getBuyerId())
buyerId = nombre.getBuyerId()
@@ -273,7 +273,7 @@ class InventaryFragment :
private fun changeOfflineValue(item: ItemInventaryVO) {
listInvetory.removeAt(listInvetory.indexOf(item))
listInvetoryAux.removeAt(listInvetoryAux.indexOf(item))
- listInvetory.filter { it.itemFk.contains("996") }
+ //listInvetory.filter { it.itemFk.contains("996") }
adapter?.notifyDataSetChanged()
//reload = true
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt
index cb5b14f5..b99df0bf 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt
@@ -5,7 +5,6 @@ import ir.mirrajabi.searchdialog.core.Searchable
class SearchBuyerModel(private var nickname: String?, private var buyerId: String?) : Searchable {
-
override fun getTitle(): String {
return nickname!!
@@ -21,9 +20,8 @@ class SearchBuyerModel(private var nickname: String?, private var buyerId: Strin
}
-class SearchDepartmentModel(private var name: String?, private var departmentId: String?) : Searchable {
-
-
+class SearchDepartmentModel(private var name: String?, private var departmentId: String?) :
+ Searchable {
override fun getTitle(): String {
@@ -38,4 +36,19 @@ class SearchDepartmentModel(private var name: String?, private var departmentId:
return name!!
}
+}
+
+class SearchSupplierModel(private var name: String?, private var id: String?) : Searchable {
+
+
+ fun getId(): String {
+ return id!!
+ }
+ fun getName(): String {
+ return name!!
+ }
+
+ override fun getTitle(): String {
+ return name!!
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt
index 43d41200..e457d192 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt
@@ -43,6 +43,10 @@ import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.she
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryFragment
import es.verdnatura.presentation.view.feature.main.model.ItemMenuVO
+import es.verdnatura.presentation.view.feature.packaging.fragment.ObservFragment
+import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingCountFragment
+import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingSummaryFragment
+import es.verdnatura.presentation.view.feature.packaging.fragment.SupplierFragment
import es.verdnatura.presentation.view.feature.paletizador.fragment.*
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
@@ -346,8 +350,6 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL
}
getString(R.string.titleControllers) -> {
addFragmentOnTop(ControladorFragment.newInstance())
-
-
}
getString(R.string.titleCorridors) -> {
@@ -519,10 +521,23 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL
addFragmentOnTop(PalletScanFragment.newInstance(item.title, "receive"))
}
-
getString(R.string.titleScanPalletizar) -> {
addFragmentOnTop(PalletScanFragment.newInstance(item.title, "get"))
}
+ getString(R.string.titlePackaging) -> {
+ addFragmentOnTop(SupplierFragment.newInstance(item.title))
+ }
+
+ getString(R.string.titlePackagingCount) -> {
+ addFragmentOnTop(PackagingCountFragment.newInstance(item.title))
+ }
+
+ getString(R.string.titlePackagingObs) -> {
+ addFragmentOnTop(ObservFragment.newInstance(item.title))
+ }
+ getString(R.string.titlePackagingSummary) -> {
+ addFragmentOnTop(PackagingSummaryFragment.newInstance(item.title))
+ }
getString(R.string.testing) -> {
addFragmentOnTop(testPrint.newInstance(item.title))
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ItemSupplierAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ItemSupplierAdapter.kt
new file mode 100644
index 00000000..274931b2
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ItemSupplierAdapter.kt
@@ -0,0 +1,59 @@
+package es.verdnatura.presentation.view.feature.packaging.adapter
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import es.verdnatura.R
+import es.verdnatura.databinding.ItemItemsupplierRowBinding
+import es.verdnatura.presentation.common.OnImageTrashClickListener
+import es.verdnatura.presentation.common.OnImageUpdateClickListener
+import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
+import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
+
+class ItemSupplierAdapter(
+ private val items: List,
+ private val onImageUpdateClickListener: OnImageUpdateClickListener,
+ private val onImageTrashClickListener: OnImageTrashClickListener,
+ // private val OnGeneralItemRowClickListener: OnGeneralItemRowClickListener,
+ // private var showDelete: Boolean = false
+) : RecyclerView.Adapter() {
+
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
+ return ItemHolder(
+ ItemItemsupplierRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
+ )
+ }
+
+ override fun getItemCount() = items.size
+
+ override fun onBindViewHolder(holder: ItemHolder, position: Int) {
+ holder.bind(items[position])
+
+ holder.binding.root.setOnClickListener {
+ }
+
+ }
+
+
+ inner class ItemHolder(
+ val binding: ItemItemsupplierRowBinding
+ ) : RecyclerView.ViewHolder(binding.root) {
+ fun bind(item: ItemSupplier) {
+ binding.apply {
+ this.item = item
+
+ itemImageUpdate.setOnClickListener {
+ onImageUpdateClickListener.OnImageUpdateClickListener(
+ item
+ )
+ itemImageTrash.setOnClickListener {
+ onImageTrashClickListener.OnImageUpdateClickListener(item)
+ }
+ }
+ }
+
+ }
+
+ }
+}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ListImageAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ListImageAdapter.kt
new file mode 100644
index 00000000..c9c4076f
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ListImageAdapter.kt
@@ -0,0 +1,56 @@
+package es.verdnatura.presentation.view.feature.packaging.adapter
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import com.esafirm.imagepicker.model.Image
+import es.verdnatura.databinding.ItemImageRowBinding
+import es.verdnatura.presentation.common.OnImageTrashClickListener
+import es.verdnatura.presentation.common.OnImageUpdateClickListener
+
+
+
+class ListImageAdapter(
+ private val items: List,
+ private val onImageUpdateClickListener: OnImageUpdateClickListener,
+ private val onImageTrashClickListener: OnImageTrashClickListener,
+
+ ) : RecyclerView.Adapter() {
+
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
+ return ItemHolder(
+ ItemImageRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
+ )
+ }
+
+ override fun getItemCount() = items.size
+
+
+ inner class ItemHolder(
+ val binding: ItemImageRowBinding
+ ) : RecyclerView.ViewHolder(binding.root) {
+ fun bind(item: Image) {
+ binding.apply {
+ this.item = item
+ itemImage.setImageURI(item.uri)
+ itemName.text = item.name
+
+ itemImageUpdate.setOnClickListener {
+ onImageUpdateClickListener.OnImageUpdateClickListener(
+ item
+ )
+ itemImageTrash.setOnClickListener {
+ onImageTrashClickListener.OnImageUpdateClickListener(item)
+ }
+ }
+ }
+
+ }
+
+ }
+
+ override fun onBindViewHolder(holder: ListImageAdapter.ItemHolder, position: Int) {
+ holder.bind(items[position])
+ }
+}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/ObservFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/ObservFragment.kt
new file mode 100644
index 00000000..7cc59efe
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/ObservFragment.kt
@@ -0,0 +1,175 @@
+package es.verdnatura.presentation.view.feature.packaging.fragment
+
+import android.content.Context
+import android.graphics.Color
+import android.graphics.drawable.Drawable
+import android.os.Build
+import android.util.Log.d
+import android.view.View
+import android.widget.ImageView
+import androidx.recyclerview.widget.LinearLayoutManager
+import com.esafirm.imagepicker.features.ImagePickerConfig
+import com.esafirm.imagepicker.features.registerImagePicker
+import com.esafirm.imagepicker.model.Image
+import es.verdnatura.R
+import es.verdnatura.databinding.FragmentPackagingObsBinding
+import es.verdnatura.presentation.base.BaseFragment
+import es.verdnatura.presentation.common.*
+import es.verdnatura.presentation.view.component.CustomDialog
+import es.verdnatura.presentation.view.component.CustomDialogList
+import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
+import es.verdnatura.presentation.view.feature.packaging.adapter.ListImageAdapter
+import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
+
+
+@Suppress("UNUSED_ANONYMOUS_PARAMETER")
+class ObservFragment(
+ var entryPoint: String = ""
+
+) : BaseFragment(
+ InventaryViewModel::class
+) {
+
+ private var adapterListImage: ListImageAdapter? = null
+ private var listImages: MutableList? = null
+ private lateinit var customDialog: CustomDialog
+ private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
+ private var layoutManager: LinearLayoutManager? = null
+ private lateinit var customDialogList: CustomDialogList
+
+ companion object {
+ fun newInstance(entryPoint: String) = ObservFragment(entryPoint)
+ }
+
+ override fun getLayoutId(): Int = R.layout.fragment_packaging_obs
+
+ override fun onAttach(context: Context) {
+ if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
+ super.onAttach(context)
+ }
+
+ override fun init() {
+ customDialog = CustomDialog(requireContext())
+ ma.hideBottomNavigation(View.GONE)
+ binding.splashProgress.visibility = View.GONE
+ setToolBar()
+ setEvents()
+ super.init()
+ }
+
+ private fun setToolBar() {
+
+ binding.mainToolbar.toolbarTitle.text = getData("ENTRYTYPE") + ":" + getData("SUPPLIERNAME")
+
+ val listIcons: ArrayList = ArrayList()
+ val iconNext = ImageView(context)
+ iconNext.setImageResource(R.drawable.ic_chevron_right_black_24dp)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ iconNext.tooltipText = getString(R.string.nextEntrySummary)
+ }
+ listIcons.add(iconNext)
+ binding.mainToolbar.toolbarIcons.adapter =
+ ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
+ override fun onOptionsItemSelected(item: Drawable) {
+ when (item) {
+ iconNext.drawable -> {
+ saveData(
+ "ENTRYNUMBERIMAGES",
+ if (listImages.isNullOrEmpty()) "0" else {
+ listImages!!.size.toString()
+ }
+ )
+ saveData("ENTRYOBSERVATIONS",binding.observations.text.toString())
+ ma.onPasillerosItemClickListener(
+ PasillerosItemVO(title = getString(R.string.titlePackagingSummary)),
+ getString(R.string.titlePackagingSummary)
+ )
+ }
+
+
+ }
+
+
+ }
+
+ })
+ binding.mainToolbar.toolbarIcons.layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
+
+ }
+
+ private fun setEvents() {
+ val launcher = registerImagePicker {
+ for (image in it) {
+ d("VERDNATURA::", "el nombre es " + image.name)
+ d("VERDNATURA::", "el nombre es " + image.uri)
+ //binding.imageView30.setImageURI(image.uri)
+ }
+ listImages = it as MutableList
+ setAdapter(listImages!!)
+ }
+
+ binding.mainToolbar.backButton.setOnClickListener {
+ requireActivity().onBackPressed()
+ }
+ binding.openPickerImages.setOnClickListener {
+ val config = ImagePickerConfig {
+ doneButtonText = "HECHO" // done button text
+ language = "es" // Set image picker language
+ arrowColor = Color.WHITE // set toolbar arrow up color
+ theme = R.style.ToolPickerImage
+ /* mode = ImagePickerMode.SINGLE // default is multi image mode
+ language = "in" // Set image picker language
+ theme = R.style.ImagePickerTheme
+ // set whether pick action or camera action should return immediate result or not. Only works in single mode for image picker
+ returnMode = if (returnAfterCapture) ReturnMode.ALL else ReturnMode.NONE
+ isFolderMode = folderMode // set folder mode (false by default)
+ isIncludeVideo = includeVideo // include video (false by default)
+ isOnlyVideo = onlyVideo // include video (false by default)
+ arrowColor = Color.RED // set toolbar arrow up color
+ folderTitle = "Folder" // folder selection title
+ imageTitle = "Tap to select" // image selection title
+ doneButtonText = "DONE" // done button text
+ limit = 10 // max images can be selected (99 by default)
+ isShowCamera = true // show camera or not (true by default)
+ savePath = ImagePickerSavePath("Camera") // captured image directory name ("Camera" folder by default)
+ savePath = ImagePickerSavePath(Environment.getExternalStorageDirectory().path, isRelative = false) // can be a full path
+ excludedImages = images.toFiles() // don't show anything on this selected images
+ selectedImages = images // original selected images, used in multi mode*/
+ }
+ launcher.launch(config)
+ }
+
+
+ }
+
+ override fun observeViewModel() {
+ with(viewModel) {
+
+ }
+ }
+
+ fun setAdapter(list: MutableList) {
+ adapterListImage =
+ ListImageAdapter(list, object : OnImageUpdateClickListener {
+
+
+ override fun OnImageUpdateClickListener(item: Any) {
+ d("VERDNATURA::", "Seleccionado update" + (item as Image).name)
+ }
+ }, object : OnImageTrashClickListener {
+ override fun OnImageUpdateClickListener(item: Any) {
+ d("VERDNATURA::", "Seleccionado trash" + (item as Image).name)
+ list.remove(item)
+ adapterListImage!!.notifyDataSetChanged()
+ }
+
+ })
+
+ binding.listImagesRecycler.adapter = adapterListImage
+ layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
+ binding.listImagesRecycler.layoutManager = layoutManager
+ }
+}
+
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt
new file mode 100644
index 00000000..23b4e820
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt
@@ -0,0 +1,149 @@
+package es.verdnatura.presentation.view.feature.packaging.fragment
+
+import android.graphics.drawable.Drawable
+import android.os.Build
+import android.os.Bundle
+import android.util.Log.d
+import android.view.View
+import android.widget.ImageView
+import androidx.recyclerview.widget.LinearLayoutManager
+import es.verdnatura.R
+import es.verdnatura.databinding.FragmentPackagingCountBinding
+import es.verdnatura.presentation.base.BaseFragment
+import es.verdnatura.presentation.common.OnImageTrashClickListener
+import es.verdnatura.presentation.common.OnImageUpdateClickListener
+import es.verdnatura.presentation.common.OnOptionsSelectedListener
+import es.verdnatura.presentation.common.ToolBarAdapterTooltip
+import es.verdnatura.presentation.view.component.CustomDialog
+import es.verdnatura.presentation.view.component.CustomDialogInput
+import es.verdnatura.presentation.view.feature.packaging.adapter.ItemSupplierAdapter
+import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
+import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
+import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
+
+
+@Suppress("UNUSED_ANONYMOUS_PARAMETER")
+class PackagingCountFragment(
+ var entryPoint: String = ""
+
+) : BaseFragment(
+ PackagingViewModel::class
+) {
+
+ private var adapteritemsupplier: ItemSupplierAdapter? = null
+ private lateinit var customDialogInput: CustomDialogInput
+ private var listItemSupplier: MutableList = ArrayList()
+ private lateinit var customDialog: CustomDialog
+ private var layoutManager: LinearLayoutManager? = null
+
+ companion object {
+ fun newInstance(entryPoint: String) = PackagingCountFragment(entryPoint)
+ }
+
+ override fun getLayoutId(): Int = R.layout.fragment_packaging_count
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+
+ viewModel.supplier_getItems(
+ usuario = getData(USER),
+ password = getData(PASSWORD),
+ getData("SUPPLIERID")
+ )
+
+ super.onCreate(savedInstanceState)
+ }
+
+
+ override fun init() {
+ binding.quantityPackaging.setOnClickListener {
+ ma.onPasillerosItemClickListener(
+ PasillerosItemVO(title = getString(R.string.titlePackagingObs)),
+ getString(R.string.titlePackagingObs)
+ )
+ }
+ binding.splashProgress.visibility = View.VISIBLE
+
+ customDialogInput = CustomDialogInput(requireContext())
+ customDialog = CustomDialog(requireContext())
+ ma.hideBottomNavigation(View.GONE)
+ setToolBar()
+ setEvents()
+ super.init()
+ }
+
+ private fun setToolBar() {
+
+ binding.mainToolbar.toolbarTitle.text = getData("ENTRYTYPE") + ":" + getData("SUPPLIERNAME")
+
+ val listIcons: ArrayList = ArrayList()
+ val iconNext = ImageView(context)
+ iconNext.setImageResource(R.drawable.ic_chevron_right_black_24dp)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ iconNext.tooltipText = getString(R.string.entryNextObsers)
+ }
+ listIcons.add(iconNext)
+ binding.mainToolbar.toolbarIcons.adapter =
+ ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
+ override fun onOptionsItemSelected(item: Drawable) {
+ when (item) {
+ iconNext.drawable -> {
+ ma.onPasillerosItemClickListener(
+ PasillerosItemVO(title = getString(R.string.titlePackagingObs)),
+ getString(R.string.titlePackagingObs)
+ )
+ }
+
+
+ }
+
+
+ }
+
+ })
+ binding.mainToolbar.toolbarIcons.layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
+
+ }
+
+ private fun setEvents() {
+
+ binding.mainToolbar.backButton.setOnClickListener {
+ requireActivity().onBackPressed()
+ }
+
+ }
+
+
+ override fun observeViewModel() {
+ with(viewModel) {
+
+ itemSupplierList.observe(viewLifecycleOwner) {
+ binding.splashProgress.visibility = View.GONE
+ adapteritemsupplier =
+ ItemSupplierAdapter(it.list, object : OnImageUpdateClickListener {
+
+ override fun OnImageUpdateClickListener(item: Any) {
+ d("VERDNATURA::", "Seleccionado update" + (item as ItemSupplier).name)
+ }
+
+
+ }, object : OnImageTrashClickListener {
+ override fun OnImageUpdateClickListener(item: Any) {
+ d("VERDNATURA::", "Seleccionado trash" + (item as ItemSupplier).name)
+ }
+
+ })
+
+ binding.itemsupplierRecyclerview.adapter = adapteritemsupplier
+ layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
+ binding.itemsupplierRecyclerview.layoutManager = layoutManager
+
+ }
+
+ }
+ }
+
+
+}
+
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingSummaryFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingSummaryFragment.kt
new file mode 100644
index 00000000..89200b73
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingSummaryFragment.kt
@@ -0,0 +1,281 @@
+package es.verdnatura.presentation.view.feature.packaging.fragment
+
+import android.graphics.drawable.Drawable
+import android.os.Build
+import android.view.View
+import android.widget.ImageView
+import androidx.core.widget.addTextChangedListener
+import androidx.recyclerview.widget.LinearLayoutManager
+import es.verdnatura.R
+import es.verdnatura.databinding.FragmentPackagingSummaryBinding
+import es.verdnatura.presentation.base.BaseFragment
+import es.verdnatura.presentation.common.*
+import es.verdnatura.presentation.view.component.CustomDialog
+import es.verdnatura.presentation.view.component.CustomDialogInput
+import es.verdnatura.presentation.view.component.CustomDialogList
+import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
+import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
+import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
+import es.verdnatura.presentation.view.feature.inventario.fragment.SearchDepartmentModel
+import es.verdnatura.presentation.view.feature.workermistake.adapter.WorkermistakeAdapter
+import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
+import es.verdnatura.presentation.view.feature.workermistake.model.MistakeWorkerType
+import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
+import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
+
+
+@Suppress("UNUSED_ANONYMOUS_PARAMETER")
+class PackagingSummaryFragment(
+ var entryPoint: String = ""
+
+) : BaseFragment(
+ InventaryViewModel::class
+) {
+
+ private var adapterworker: WorkermistakeAdapter? = null
+
+ private lateinit var customDialogInput: CustomDialogInput
+
+
+ private var listWorker: MutableList = ArrayList()
+ private var listWorkerAuxiliary: MutableList = ArrayList()
+ private lateinit var customDialog: CustomDialog
+ private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
+ private var layoutManager: LinearLayoutManager? = null
+
+ private lateinit var customDialogList: CustomDialogList
+ private var listMistakes: ArrayList = ArrayList()
+ private var listMistakesAdapter: BarcodeAdapter? = null
+ private var workerMistakeName: WorkerFromMistake? = null
+
+
+ private val departments = ArrayList()
+ private lateinit var departmentId: String
+
+ companion object {
+ fun newInstance(entryPoint: String) = PackagingSummaryFragment(entryPoint)
+ }
+
+ override fun getLayoutId(): Int = R.layout.fragment_packaging_summary
+
+
+ override fun init() {
+
+ binding.splashProgress.visibility = View.VISIBLE
+ binding.totalImages.text = getData("ENTRYNUMBERIMAGES")
+ binding.observations.text=getData("ENTRYOBSERVATIONS")
+
+ departmentId = getData(DEPARTMENTMISTAKEID)
+ customDialogList = CustomDialogList(requireContext())
+
+
+
+ if (!departmentId.isEmpty()) {
+ viewModel.worker_getFromHasMistake(
+ getData(USER),
+ getData(PASSWORD),
+ getData(DEPARTMENTMISTAKEID)
+ )
+ }
+
+
+ customDialogInput = CustomDialogInput(requireContext())
+ customDialog = CustomDialog(requireContext())
+ ma.hideBottomNavigation(View.GONE)
+ binding.splashProgress.visibility = View.VISIBLE
+ setToolBar()
+ setEvents()
+ super.init()
+ }
+
+ private fun setToolBar() {
+
+ binding.mainToolbar.toolbarTitle.text = getData("ENTRYTYPE") + ":" + getData("SUPPLIERNAME")
+
+ val listIcons: ArrayList = ArrayList()
+ val iconConfirm = ImageView(context)
+ iconConfirm.setImageResource(R.drawable.check)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ iconConfirm.tooltipText = getString(R.string.confirmEntry)
+ }
+
+ listIcons.add(iconConfirm)
+ binding.mainToolbar.toolbarIcons.adapter =
+ ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
+ override fun onOptionsItemSelected(item: Drawable) {
+ when (item) {
+ iconConfirm.drawable -> {
+ // TODO()
+ }
+ }
+ }
+
+ })
+ binding.mainToolbar.toolbarIcons.layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
+
+ }
+
+ private fun setEvents() {
+
+
+ binding.mainToolbar.backButton.setOnClickListener {
+ requireActivity().onBackPressed()
+ }
+
+ }
+
+
+ override fun observeViewModel() {
+ with(viewModel) {
+
+
+ mistakeDepartmentList.observe(viewLifecycleOwner) {
+ binding.splashProgress.visibility = View.GONE
+ createDepartmentList(it.list)
+
+ }
+ workerFromMistakeList.observe(viewLifecycleOwner) {
+ binding.splashProgress.visibility = View.GONE
+ createWorkerList(it.list)
+
+ adapterworker =
+ WorkermistakeAdapter(listWorker, object : onMistakeWorkerClickListener {
+
+ override fun onMistakeWorkerClickListener(item: WorkerFromMistake) {
+ viewModel.workerMistakeType_get(
+ usuario = getData(USER),
+ password = getData(PASSWORD)
+ )
+ workerMistakeName =
+ WorkerFromMistake(
+ item.id,
+ item.firstName,
+ item.lastName,
+ true,
+ ""
+ )
+
+
+ }
+ })
+ binding.workermistakeRecyclerview.adapter = adapterworker
+ layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
+ binding.workermistakeRecyclerview.layoutManager = layoutManager
+
+ }
+
+ mistakeWorkerList.observe(viewLifecycleOwner, {
+ binding.splashProgress.visibility = View.GONE
+ showMistakeList(it.list)
+ //goBack = false
+
+ })
+
+ responseAddMistake.observe(viewLifecycleOwner, {
+
+
+ ma.messageWithSound(
+ if (it.isError) {
+ if (it.codeError == 403) {
+ getString(R.string.userNotPermission)
+ } else {
+ it.errorMessage
+ }
+
+ } else {
+ getString(R.string.errorCauseRegistered)
+ }, it.isError, true, isToasted = true
+ )
+
+ })
+
+ response.observe(viewLifecycleOwner, {
+ if (it.isError) {
+ ma.messageWithSound(it.errorMessage, true, false)
+
+ }
+ })
+ }
+ }
+
+
+ private fun showMistakeList(list: List) {
+ binding.splashProgress.visibility = View.GONE
+ listMistakes = ArrayList()
+ list.forEach {
+ listMistakes.add(BarcodeVO(code = it.description))
+ }
+
+
+ customDialogList.setTitle(getString(R.string.errorCause) + workerMistakeName!!.firstName)
+ .setKoButton(
+ getString(
+ R.string.cancel
+ )
+ ) {
+ customDialogList.dismiss()
+ }.hideDialog().show()
+
+
+ listMistakesAdapter =
+ BarcodeAdapter(listMistakes, object : OnBarcodeRowClickListener {
+ override fun onBarcodeRowClickListener(item: BarcodeVO) {
+ list.forEach {
+ if (it.description == item.code) {
+ viewModel.workerMistake_Add(
+ usuario = getData(USER),
+ password = getData(PASSWORD),
+ vUserFk = workerMistakeName!!.id,
+ vTypeFk = it.code
+ )
+ // getString(R.string.errorRegistered).toast(requireContext())
+ customDialogList.dismiss()
+ }
+ }
+
+ }
+ }, showDelete = false)
+
+ customDialogList.getRecyclerView().adapter = listMistakesAdapter
+
+ customDialogList.getRecyclerView().layoutManager =
+ LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
+
+ }
+
+
+ private fun createDepartmentList(list: List) {
+ departments.clear()
+ list.forEach { department ->
+ if (!department.isError) {
+ try {
+ departments.add(SearchDepartmentModel(department.name, department.id))
+ } catch (e: Exception) {
+ }
+ }
+ }
+ }
+
+ private fun createWorkerList(list: List) {
+ listWorker.clear()
+
+ list.forEach { worker ->
+
+ if (!worker.isError) {
+ try {
+ listWorker.add(worker)
+ } catch (e: Exception) {
+ }
+ }
+
+ }
+ listWorker.add(WorkerFromMistake("0", "Añadir nuevo", "", false))
+ listWorkerAuxiliary.clear()
+ listWorkerAuxiliary.addAll(listWorker)
+ listWorkerAuxiliary.add(WorkerFromMistake("0", "Añadir nuevo", "", false))
+
+ }
+}
+
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingViewModel/SupplierViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingViewModel/SupplierViewModel.kt
new file mode 100644
index 00000000..b4fb76b8
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingViewModel/SupplierViewModel.kt
@@ -0,0 +1,155 @@
+package es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel
+
+import android.content.Context
+import androidx.lifecycle.LiveData
+import androidx.lifecycle.MutableLiveData
+import es.verdnatura.domain.GetInventaryUserCase
+import es.verdnatura.domain.GetPackagingUserCase
+import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageFromAllResponse
+import es.verdnatura.presentation.base.nameofFunction
+import es.verdnatura.presentation.common.ResponseItemVO
+import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
+import es.verdnatura.presentation.view.feature.packaging.model.*
+import retrofit2.Call
+import retrofit2.Callback
+import retrofit2.Response
+
+class PackagingViewModel(context: Context) : BaseViewModel() {
+
+ private val getInventaryUserCase: GetInventaryUserCase = GetInventaryUserCase(context)
+ private val getPackagingUserCase: GetPackagingUserCase = GetPackagingUserCase(context)
+
+
+ private val _inventaryList by lazy { MutableLiveData() }
+ val inventaryList: LiveData
+ get() = _inventaryList
+
+ private val _itemSupplierList by lazy { MutableLiveData() }
+ val itemSupplierList: LiveData
+ get() = _itemSupplierList
+
+ private val _supplierList by lazy { MutableLiveData() }
+ val supplierList: LiveData
+ get() = _supplierList
+
+ private val _entry by lazy { MutableLiveData() }
+ val entry: LiveData
+ get() = _entry
+
+ private val _response by lazy { MutableLiveData() }
+ val response: LiveData
+ get() = _response
+
+ fun getSuppliers(token: String) {
+ getPackagingUserCase.getSuppliers(token)
+ .enqueue(object :
+ Callback> {
+ override fun onFailure(call: Call>, t: Throwable) {
+ val listError: ArrayList = ArrayList()
+ listError.add(
+ Supplier(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ t.message!!
+ )
+ )
+ )
+ _supplierList.value = SupplierList(listError)
+ }
+
+ override fun onResponse(
+ call: Call>,
+ response: Response>
+ ) {
+ if (response.body() != null) {
+ _supplierList.value = response.body()?.let { SupplierList(it) }
+ } else {
+ val listError: ArrayList = ArrayList()
+ listError.add(
+ Supplier(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ response.message()
+ )
+ )
+ )
+ _supplierList.value = SupplierList(listError)
+
+ }
+ }
+
+ })
+ }
+
+ fun supplier_getItems(usuario: String, password: String, supplierFk: String) {
+
+ getPackagingUserCase.supplier_getItems(usuario, password, supplierFk)
+ .enqueue(object : Callback> {
+ override fun onFailure(call: Call>, t: Throwable) {
+ val listError: ArrayList = ArrayList()
+ listError.add(
+ ItemSupplier(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ t.message!!
+ )
+ )
+ )
+ _itemSupplierList.value = itemSupplierList(listError)
+ }
+
+ override fun onResponse(
+ call: Call>,
+ response: Response>
+ ) {
+ if (response.body() != null) {
+ _itemSupplierList.value =
+ response.body()?.let { itemSupplierList(it) }
+ } else {
+ val listError: ArrayList = ArrayList()
+ listError.add(ItemSupplier(null, null))
+ _itemSupplierList.value = itemSupplierList(listError)
+ }
+ }
+
+ })
+ }
+
+ fun entry_addSalix(token: String, entry: EntrySalix) {
+ getPackagingUserCase.Entries(token, entry = entry)
+ .enqueue(object :
+ Callback {
+ override fun onFailure(call: Call, t: Throwable) {
+ _entry.value = EntrySalix(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ t.message!!
+ )
+ )
+ }
+
+ override fun onResponse(
+ call: Call,
+ response: Response
+ ) {
+ if (response.body() != null) {
+ _entry.value = response.body()
+ } else {
+ _entry.value = EntrySalix(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ response.message()
+ )
+ )
+ }
+
+ }
+ })
+ }
+}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt
new file mode 100644
index 00000000..38818903
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt
@@ -0,0 +1,153 @@
+package es.verdnatura.presentation.view.feature.packaging.fragment
+
+import android.content.Context
+import android.os.Bundle
+import android.util.Log.d
+import android.view.View
+import androidx.recyclerview.widget.LinearLayoutManager
+import es.verdnatura.R
+import es.verdnatura.databinding.FragmentPackagingBinding
+import es.verdnatura.presentation.base.BaseFragment
+import es.verdnatura.presentation.common.OnPasillerosItemClickListener
+import es.verdnatura.presentation.view.feature.inventario.fragment.SearchSupplierModel
+import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
+import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
+import es.verdnatura.presentation.view.feature.packaging.model.Supplier
+import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
+import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
+
+
+@Suppress("UNUSED_ANONYMOUS_PARAMETER")
+class SupplierFragment(
+ var entryPoint: String = ""
+
+) : BaseFragment(
+ PackagingViewModel::class
+) {
+
+ private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
+ private var layoutManager: LinearLayoutManager? = null
+ private var onBack = false
+ private val suppliers = ArrayList()
+
+
+ companion object {
+ fun newInstance(entryPoint: String) = SupplierFragment(entryPoint)
+ }
+
+ override fun getLayoutId(): Int = R.layout.fragment_packaging
+
+ override fun onAttach(context: Context) {
+ if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
+ super.onAttach(context)
+ }
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+
+ viewModel.getSuppliers(
+ getData(TOKEN),
+ )
+
+ super.onCreate(savedInstanceState)
+ }
+
+ override fun onPause() {
+ onBack = true
+ super.onPause()
+
+ }
+
+ override fun init() {
+
+ binding.splashProgress.visibility = View.VISIBLE
+ binding.filterSupplier.setOnClickListener {
+ SimpleSearchDialogCompat(
+ context,
+ getString(R.string.suppliers),
+ getString(R.string.escribirparteNombre),
+ null,
+ suppliers
+ ) { baseSearchDialogCompat, nombre, position ->
+ binding.filterSupplier.setText((nombre.getName()))
+ binding.radiobuttonTypePackaging.visibility = View.VISIBLE
+ saveData("SUPPLIERNAME", nombre.getName())
+ saveData("SUPPLIERID", nombre.getId())
+ baseSearchDialogCompat.dismiss()
+ }.show()
+ }
+
+ ma.hideBottomNavigation(View.GONE)
+ setToolBar()
+ setEvents()
+
+ var entrada = EntrySalix(supplierFk = "591", travelFk = "186025", companyFk = "442")
+ viewModel.entry_addSalix(getData(TOKEN), entrada)
+
+ super.init()
+ }
+
+ private fun setToolBar() {
+ binding.mainToolbar.toolbarTitle.text = entryPoint
+ }
+
+ private fun setEvents() {
+
+ binding.mainToolbar.backButton.setOnClickListener {
+ requireActivity().onBackPressed()
+ }
+
+ binding.radiobuttonTypePackaging.setOnCheckedChangeListener { buttonView, isChecked ->
+ when (isChecked) {
+ R.id.radioButtonRec -> {
+ saveData("ENTRYTYPE", "Rec")
+ }
+ R.id.radioButtonDev -> {
+ d("VERDNATURA::", "dev")
+ saveData("ENTRYTYPE", "Dev")
+ }
+
+ }
+ if (!onBack) {
+ ma.onPasillerosItemClickListener(
+ PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
+ getString(R.string.titlePackagingCount)
+ )
+
+ }
+ onBack = false
+
+ }
+ }
+
+
+ override fun observeViewModel() {
+ with(viewModel) {
+ supplierList.observe(viewLifecycleOwner) {
+ binding.splashProgress.visibility = View.GONE
+ createSupplierList(it.list)
+ }
+
+ response.observe(viewLifecycleOwner) {
+ if (it.isError) {
+ ma.messageWithSound(it.errorMessage, true, false)
+
+ }
+ }
+ }
+ }
+
+
+ private fun createSupplierList(list: List) {
+ suppliers.clear()
+ list.forEach { supplier ->
+ if (!supplier.isError) {
+ try {
+ suppliers.add(SearchSupplierModel(supplier.name, supplier.id.toString()))
+ } catch (e: Exception) {
+ }
+ }
+ }
+ }
+
+}
+
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/model/EntrySalix.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/model/EntrySalix.kt
new file mode 100644
index 00000000..051f06bb
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/model/EntrySalix.kt
@@ -0,0 +1,10 @@
+package es.verdnatura.presentation.view.feature.packaging.model
+
+class EntrySalix(
+ var id: String? = null,
+ var supplierFk: String? = null,
+ var travelFk: String? = null,
+ var companyFk: String? = null,
+ var isError: Boolean? = null,
+ var errorMessage: String? = null
+)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/model/Supplier.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/model/Supplier.kt
new file mode 100644
index 00000000..f946ffe8
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/model/Supplier.kt
@@ -0,0 +1,31 @@
+package es.verdnatura.presentation.view.feature.packaging.model
+
+import com.esafirm.imagepicker.model.Image
+
+
+data class Supplier(
+ var id: Int? = null,
+ var name: String? = null,
+ var isError: Boolean = false,
+ var errorMessage: String? = null
+)
+
+class SupplierList(
+ var list: List = listOf()
+)
+
+class itemSupplierList(
+ var list: List = listOf()
+)
+
+data class ItemSupplier(
+ var id: Int? = null,
+ var name: String? = null,
+ var quantity: Int? = 0,
+ var subquantity: Int? = 0,
+ var isError: Boolean = false,
+ var errorMessage: String? = null
+)
+
+
+
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletFragment.kt
index b6641fe0..2535f025 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletFragment.kt
@@ -1,6 +1,5 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment
-import android.util.Log.d
import android.view.View
import android.view.inputmethod.EditorInfo
import es.verdnatura.R
@@ -19,8 +18,8 @@ class CmrExpeditionPalletFragment(
override fun getLayoutId(): Int = R.layout.fragment_expeditionscan_sorter
private lateinit var customDialogList: CustomDialogInputTwoValues
private var itemScaned: String = ""
- private lateinit var dataScanned: itemScanned
- private lateinit var dataScannedTwo: itemScanned
+ private var dataScanned: itemScanned? = null
+ private var dataScannedTwo: itemScanned? = null
companion object {
fun newInstance(title: String) = CmrExpeditionPalletFragment(title)
@@ -41,7 +40,7 @@ class CmrExpeditionPalletFragment(
binding.mainToolbar.toolbarTitle.text = title
}
- private fun cmrExpeditionPallet_add(vExpeditionPallet: String, vCmrId: String) {
+ private fun cmrExpeditionPallet_add(vExpeditionPallet: String?, vCmrId: String?) {
customDialogList.dismiss()
binding.splashProgress.visibility = View.VISIBLE
@@ -73,15 +72,19 @@ class CmrExpeditionPalletFragment(
ma.messageWithSound(
getString(R.string.cmrError) + it.errorMessage,
- true,
- true,
+ isError = true,
+ isPlayed = true,
isToasted = true
)
showExpeditionPalletScan()
} else {
binding.splashProgress.visibility = View.GONE
- ma.messageWithSound(getString(R.string.operationSuccess), false, true)
+ ma.messageWithSound(
+ getString(R.string.operationSuccess),
+ isError = false,
+ isPlayed = true
+ )
showExpeditionPalletScan()
}
@@ -92,215 +95,153 @@ class CmrExpeditionPalletFragment(
}
private fun showExpeditionPalletScan() {
+ customDialogList.setHint(true)
customDialogList.setValue("")
customDialogList.setValueTwo("")
- customDialogList.setInfoTex("")
- customDialogList.setInfoTextTwo("")
- customDialogList.setInfoTex(getString(R.string.expeditionPalletOrCMR))
- customDialogList.setTitle(getString(R.string.expeditionPalletCMR))
- .setOkButton(getString(R.string.end)) {
- ma.hideKeyboard(customDialogList.getEditText())
- customDialogList.dismiss()
- binding.mainToolbar.backButton.performClick()
-
-
- }.setValue("").show()
-
-
+ customDialogList.setInfoTex("Código QR o PALLET")
+ customDialogList.setInfoTextTwo("Código QR o CMR")
+ customDialogList.setTitle("Escanea los valores : ")
+ customDialogList.setHint(false)
+ customDialogList.setOkButton(getString(R.string.end)) {
+ ma.hideKeyboard(customDialogList.getEditText())
+ customDialogList.dismiss()
+ binding.mainToolbar.backButton.performClick()
+ }.setValue("").show()
customDialogList.setFocusText()
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
-
+ // var action = true
if (customDialogList.getValue().isNotEmpty()) {
dataScanned = itemScan(customDialogList.getValue())
- d("VERDNATURA::","tabla v1 es "+dataScanned.table)
- when (itemScaned(customDialogList.getValue())) {
- "cmr" -> {
- customDialogList.setInfoTex(getString(R.string.cmr))
- customDialogList.setInfoTextTwo(getString(R.string.pallet))
- customDialogList.setValue(dataScanned.id)
- }
- "expeditionPallet" -> {
- customDialogList.setInfoTex(getString(R.string.pallet))
- customDialogList.setInfoTextTwo(getString(R.string.cmr))
- //customDialogList.setInputTextVisibility(View.GONE)
- customDialogList.setValue(dataScanned.id)
- }
- else ->
- customDialogList.setValue("No ha escaneado ni pallet ni CMR")
+ if (dataScanned == null) {
+ // action = false
+ /*ma.messageWithSound(
+ getString(R.string.errorPalletCmrNotScanned),
+ isError = true,
+ isPlayed = true,
+ titleWithError = getString(R.string.warning),
+ isToasted = true
+ )
+ customDialogList.setValue("")*/
+ } else {
+ // action = false
+ customDialogList.setValue(dataScanned!!.id!!)
+ customDialogList.setHint(true)
+ if (dataScanned!!.table == "cmr") {
+ customDialogList.setInfoTextTwo(getString(R.string.scanLabelPallet))
+ } else {
+ customDialogList.setInfoTextTwo(getString(R.string.scanLabelCMR))
+ }
+ customDialogList.setHint(false)
}
- customDialogList.setFocusTextTwo()
-
}
return@setOnEditorActionListener false
+
}
false
+
}
customDialogList.getEditTextTwo().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
- if (customDialogList.getValue().isNotEmpty() && customDialogList.getValueTwo()
+ if (customDialogList.getValueTwo().isNotEmpty() && customDialogList.getValue()
.isNotEmpty()
) {
dataScannedTwo = itemScan(customDialogList.getValueTwo())
- d("VERDNATURA::","tabla v1 es "+dataScanned.table)
- d("VERDNATURA::","tabla v2 es "+itemScaned(customDialogList.getValueTwo()))
+ if (dataScannedTwo == null) {
+ cmrExpeditionPallet_add(
+ customDialogList.getValue(),
+ customDialogList.getValueTwo()
+ )
- // customDialogList.setValueTwo(itemScanedValue(customDialogList.getValueTwo()))
- when (itemScaned(customDialogList.getValueTwo())){
- "cmr" -> {
- if (dataScanned.table == "cmr"){
- ma.messageWithSound(
- "Escanea pallet",
- true,
- true,
- isToasted = true
- )
- customDialogList.setValueTwo("")
- }
+ /* var messageLabel = ""
+ when (dataScanned!!.table) {
+ "cmr" -> {
+ messageLabel = "CMR"
+ }
+ "expeditionPallet" -> {
+ messageLabel = "Pallet"
+ }
+ }
- if (dataScanned.table == "expeditionPallet"){
- cmrExpeditionPallet_add(
- dataScanned.id,
- dataScannedTwo.id)
-
- }
- customDialogList.setValueTwo(dataScannedTwo.id)
- }
- "expeditionPallet"->{
- /* d("VERDNATURA::","tabla v1 es "+dataScanned.table)
- d("VERDNATURA::","tabla v2 es "+itemScaned(customDialogList.getValueTwo()))*/
- if (dataScanned.table == "cmr"){
- cmrExpeditionPallet_add(
- dataScannedTwo.id,
- dataScanned.id)
- customDialogList.setValueTwo(dataScannedTwo.id)
- }
-
- if (dataScanned.table == "expeditionPallet"){
- ma.messageWithSound(
- "Escanea CMR",
- true,
- true,
- isToasted = true
- )
- customDialogList.setValueTwo("")
-
- }
- }
- }
- // ma.hideKeyboard(customDialogList.getEditText())
- /* dataScannedTwo = itemScan(customDialogList.getValueTwo())
-
- d("VERDNATURA::","el valor es " + dataScannedTwo.id + "y tabla " + dataScannedTwo.table)
-*/
-
- /* when (itemScaned(customDialogList.getValueTwo())) {
- "cmr" -> {
- customDialogList.setValueTwo(dataScanned.id)
- *//* if (dataScanned.table == "cmr") {
- ma.messageWithSound(
- getString(R.string.palletScanError),
- true,
- true,
- isToasted = true
- )
- }*//*
-
- }
- *//* "expeditionPallet" -> {
-
- if (dataScanned.table == "expeditionPallet") {
- ma.messageWithSound(
- getString(R.string.errorCmrNotScanned),
- true,
- true,
- isToasted = true
- )
- }
- if (dataScanned.table == "cmr") {
- cmrExpeditionPallet_add(
- itemScanedValue(customDialogList.getValueTwo()),
- itemScanedValue(customDialogList.getValue()),
-
- )
- }
- }*//*
- else ->
- customDialogList.setValueTwo("No ha escanado ni pallet ni CMR")
-
- }*/
-
- // customDialogList.setFocusTextTwo()
- /* if (itemScaned(customDialogList.getValueTwo())) {
- itemScaned = dataScanned.value
- customDialogList.setValueTwo("")
- cmrExpeditionPallet_add(
- customDialogList.getValue(),
- itemScaned
- )
- } else {
- customDialogList.setValueTwo("")
ma.messageWithSound(
- getString(R.string.errorCmrNotScanned),
- true,
- true,
+ String.format(
+ getString(R.string.labelPalletOrCmrNotValid),
+ messageLabel
+ ),
+ isError = true,
+ isPlayed = true,
+ titleWithError = getString(R.string.warning),
isToasted = true
)
- }
+ customDialogList.setValueTwo("")*/
- */
+ } else {
+ if (dataScanned != null) {
+
+
+ if (dataScanned!!.table == dataScannedTwo!!.table) {
+ ma.messageWithSound(
+ getString(R.string.errorSameType),
+ isError = true,
+ isPlayed = true,
+ titleWithError = "Aviso",
+ isToasted = true
+ )
+ customDialogList.setValueTwo("")
+ } else {
+ customDialogList.setValueTwo(dataScanned!!.id!!)
+ cmrExpeditionPallet_add(
+ if (dataScannedTwo!!.table == "cmr") {
+ dataScanned!!.id
+ } else {
+ dataScannedTwo!!.id
+ },
+ if (dataScannedTwo!!.table == "cmr") {
+ dataScannedTwo!!.id
+ } else {
+ dataScanned!!.id
+ }
+ )
+ }
+ } else {
+ cmrExpeditionPallet_add(
+ customDialogList.getValue(),
+ dataScannedTwo!!.id
+
+ )
+ }
+ }
}
-
- return@setOnEditorActionListener true
}
- false
+
+ return@setOnEditorActionListener true
}
- }
-
- private fun itemScanedValue(valueTwo: String): String {
-
- return try {
- return itemScanned(JSONObject(valueTwo)).id
-
-
- } catch (Ex: Exception) {
- return valueTwo
- }
-
}
- private fun itemScan(value: String): itemScanned {
+}
- return try {
- itemScanned(JSONObject(value))
+private fun itemScan(value: String): itemScanned? {
- } catch (Ex: Exception) {
- return itemScan("")
+ return try {
+ val valueScanned = itemScanned(JSONObject(value))
+
+ if (valueScanned.table == "cmr" || valueScanned.table == "expeditionPallet") {
+ valueScanned
+ } else {
+ null
}
-
+ } catch (Ex: Exception) {
+ return null
}
- private fun itemScaned(valueTwo: String): String {
- try {
- return itemScanned(JSONObject(valueTwo)).table
-
-
- } catch (Ex: Exception) {
- d("VERDNATURA::", "EL VALUE ES " + Ex.message.toString())
- return ""
- }
-
-
- }
-
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletViewModel.kt
index 83b12c8f..4ae90a23 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletViewModel.kt
@@ -23,7 +23,7 @@ import retrofit2.Response
get() = _responsescan
- fun cmrExpeditionPallet_add(usuario: String, password: String, vExpeditionPallet: String,vCmrId:String) {
+ fun cmrExpeditionPallet_add(usuario: String, password: String, vExpeditionPallet: String?,vCmrId:String?) {
GetPaletizadoresUserCase.cmrExpeditionPallet_add(usuario, password, vExpeditionPallet, vCmrId)
.enqueue(object : Callback {
override fun onFailure(call: Call, t: Throwable) {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanFragment.kt
index 8f47ba88..b8cd4565 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanFragment.kt
@@ -1,13 +1,16 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment
+import android.util.Log
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.core.view.isVisible
import es.verdnatura.R
import es.verdnatura.databinding.FragmentGeneralBlackBinding
import es.verdnatura.presentation.base.BaseFragment
+import es.verdnatura.presentation.common.itemScanned
import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
+import org.json.JSONObject
class PalletScanFragment(
var title: String = "", var action: String
@@ -59,10 +62,20 @@ class PalletScanFragment(
binding.splashProgress.visibility = View.VISIBLE
customDialogList.dismiss()
+ var valueScanned:String
+ try {
+ valueScanned = itemScanned(JSONObject(vPalletId)).id.toString()
+ Log.d("VERDNATURA::", "el valor es " + valueScanned)
+ }
+ catch(ex:Exception){
+ valueScanned=vPalletId
+ Log.d("VERDNATURA::", "ex " + ex.message)
+ }
+ itemScaned=valueScanned
viewModel.expeditionPallet_get(
getData(USER),
getData(PASSWORD),
- vPalletId,
+ valueScanned,
)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt
index b172d920..e9238844 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt
@@ -80,6 +80,10 @@ class ParkingFragment (var menuOrigin:String): BaseFragment {
override fun onFailure(call: Call, t: Throwable) {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt
index 5fbeb976..a32ebb2d 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt
@@ -1,7 +1,8 @@
package es.verdnatura.presentation.view.feature.ubicador.adapter
import android.annotation.SuppressLint
-import android.provider.Settings.Global.getString
+import android.graphics.Color.GREEN
+import android.graphics.Color.RED
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
@@ -15,21 +16,21 @@ import es.verdnatura.presentation.common.loadUrl
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
-class UbicadorAdapter (
+class UbicadorAdapter(
private val items: List,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
private val onVisibleClickListener: OnVisibleClickListener,
private val onMoreClickListener: OnMoreClickListener
-): RecyclerView.Adapter () {
+) : RecyclerView.Adapter() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
- ItemUbicationRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
+ ItemUbicationRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
)
}
- override fun getItemCount() =items.size
+ override fun getItemCount() = items.size
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
@@ -37,35 +38,69 @@ class UbicadorAdapter (
inner class ItemHolder(
val binding: ItemUbicationRowBinding
- ) : RecyclerView.ViewHolder(binding.root){
+ ) : RecyclerView.ViewHolder(binding.root) {
private val res = binding.root.context.resources
+
@SuppressLint("SetTextI18n")
fun bind(item: ItemUbicadorVO) {
binding.apply {
this.item = item
multiText.text = "${item.stickers}x${item.packing}"
- imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/"+item.item)
+ imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/" + item.item)
imgItem.setOnClickListener {
- onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(
- R.string.itemSearch)),item.item)
+ onPasillerosItemClickListener.onPasillerosItemClickListener(
+ PasillerosItemVO(
+ title = res.getString(
+ R.string.itemSearch
+ )
+ ), item.item
+ )
}
layerVisible.setOnClickListener {
onVisibleClickListener.onVisibleClickListener(item)
}
- if (item.visible == "0"){
- visibleText.setTextColor(ContextCompat.getColor(visibleText.context,R.color.verdnatura_brown_grey))
+ if (item.visible == "0") {
+ visibleText.setTextColor(
+ ContextCompat.getColor(
+ visibleText.context,
+ R.color.verdnatura_brown_grey
+ )
+ )
- }else{
- visibleText.setTextColor(ContextCompat.getColor(visibleText.context,R.color.verdnatura_pumpkin_orange))
+ } else {
+ visibleText.setTextColor(
+ ContextCompat.getColor(
+ visibleText.context,
+ R.color.verdnatura_pumpkin_orange
+ )
+ )
}
moreImg.setOnClickListener {
onMoreClickListener.onMoreClickListener(item)
}
namelayout.setOnClickListener {
- onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(R.string.itemSearch)),item.item)
+ onPasillerosItemClickListener.onPasillerosItemClickListener(
+ PasillerosItemVO(
+ title = res.getString(R.string.itemSearch)
+ ), item.item
+ )
+ }
+
+ if (item.checked) {
+ itemRowLayout.setBackgroundColor(
+ ContextCompat.getColor(
+ visibleText.context,
+ R.color.verdnatura_dark_green_verdnatura
+ )
+ )
+ }
+ if (item.isNew){
+ itemRowLayout.setBackgroundColor(
+ RED
+ )
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt
index 575cff20..8f777a2f 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt
@@ -6,11 +6,12 @@ import android.graphics.drawable.Drawable
import android.media.MediaPlayer
import android.os.Build
import android.os.Bundle
-import android.util.Log.d
import android.view.View
+import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import android.widget.Toast
+import androidx.annotation.RequiresApi
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
@@ -41,12 +42,14 @@ class UbicadorFragment(
private lateinit var customDialogUbicador: CustomDialogUbicador
private lateinit var customDialogTwoButtons: CustomDialogTwoButtons
private var listItems: ArrayList = ArrayList()
+ private var listLocalItems: ArrayList = ArrayList()
private lateinit var customDialog: CustomDialog
private var deep: Int = 1
private var parking: String = ""
private var etiquetas: String = "0"
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
private var isShelvinLogfromMainScreen = false
+ private var modeCheckUbication = false
var mperror: MediaPlayer? = null
var mpok: MediaPlayer? = null
@@ -62,6 +65,7 @@ class UbicadorFragment(
super.onAttach(context)
}
+ @RequiresApi(Build.VERSION_CODES.O)
override fun init() {
customDialogInput = CustomDialogInput(requireContext())
@@ -75,7 +79,7 @@ class UbicadorFragment(
setToolBar()
if (!shelvingFk.isNullOrEmpty()) {
isShelvinLogfromMainScreen = false
- binding.splashProgress.visibility = View.VISIBLE
+ binding.splashProgress.visibility = VISIBLE
binding.mainToolbar.toolbarTitle.text = shelvingFk
viewModel.itemShelvingList(getData(USER), getData(PASSWORD), shelvingFk)
@@ -92,6 +96,7 @@ class UbicadorFragment(
super.onCreate(savedInstanceState)
}
+ @RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
val listIcons: ArrayList = ArrayList()
@@ -100,12 +105,34 @@ class UbicadorFragment(
val iconReload = ImageView(context)
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
+ binding.mainToolbar.switchButton.visibility = VISIBLE
+ binding.mainToolbar.switchButton.setOnCheckedChangeListener { buttonView, isChecked ->
+ modeCheckUbication = isChecked
+ binding.mainToolbar.switchButton.tooltipText = if (isChecked)
+ getString(R.string.activateModoChecking) else
+ getString(R.string.allowCheckingMode)
+ binding.textinputlayoutMatricula.hint =
+ if (isChecked) getString(R.string.scanItem) else {
+ getString(R.string.scanPlate)
+ }
+
+ if (!isChecked) {
+ listLocalItems.clear()
+ }
+ }
+
+ val iconChecker = ImageView(context)
+ iconChecker.setImageResource(R.drawable.ic_controller_ui)
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
iconAdd.tooltipText = getString(R.string.addItemShelving)
+
}
listIcons.add(iconAdd)
listIcons.add(iconReload)
+
+
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
@@ -113,7 +140,7 @@ class UbicadorFragment(
when (item) {
iconAdd.drawable -> showAddItem("", "", "", "", false, ItemUbicadorVO(), "")
iconReload.drawable -> {
- binding.splashProgress.visibility = View.VISIBLE
+ binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingList(
getData(USER),
getData(PASSWORD),
@@ -121,12 +148,7 @@ class UbicadorFragment(
)
}
}
- /*if (item == iconAdd){
- showAddItem("","","","",false,ItemUbicadorVO(),"")
- }else if(item == iconReload){
- binding.splashProgress.visibility = View.VISIBLE
- viewModel.itemShelvingList(user,password,shelvingFk,"itemShelvingList")
- }*/
+
}
})
@@ -145,17 +167,28 @@ class UbicadorFragment(
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.editMatricula.text.toString().isNullOrEmpty()) {
- binding.mainToolbar.toolbarTitle.text = binding.editMatricula.text.toString()
- shelvingFk = binding.editMatricula.text.toString()
- binding.splashProgress.visibility = View.VISIBLE
- viewModel.itemShelvingList(
- getData(USER),
- getData(PASSWORD),
- binding.editMatricula.text.toString()
- )
+
+ if (!modeCheckUbication) {
+ binding.mainToolbar.toolbarTitle.text =
+ binding.editMatricula.text.toString()
+ shelvingFk = binding.editMatricula.text.toString()
+ binding.splashProgress.visibility = VISIBLE
+ viewModel.itemShelvingList(
+ getData(USER),
+ getData(PASSWORD),
+ binding.editMatricula.text.toString()
+ )
+ } else {
+ binding.splashProgress.visibility = VISIBLE
+ viewModel.getIdFromCode(
+ usuario = getData(USER),
+ password = getData(PASSWORD),
+ code = binding.editMatricula.text.toString()
+ )
+
+ }
}
-
binding.editMatricula.setText("")
ma.hideKeyboard(binding.editMatricula)
return@setOnEditorActionListener true
@@ -315,6 +348,43 @@ class UbicadorFragment(
}
+ private fun checkUbications(itemScanned: String) {
+
+ for (item in listItems) {
+ if (item.item == itemScanned) {
+ item.checked = true
+ ma.messageWithSound("", false, true, "", false)
+ }
+ }
+
+ if (listItems.filter { it.item == itemScanned }.isEmpty()) {
+ binding.splashProgress.visibility = View.GONE
+ listItems.add(
+ ItemUbicadorVO(
+ item = itemScanned,
+ visible = "0",
+ packing = "0",
+ grouping = "0",
+ isNew = true
+ )
+ )
+ listLocalItems = listItems.clone() as ArrayList
+
+ viewModel.itemShelvingMake(
+ getData(USER),
+ getData(PASSWORD),
+ shelving = shelvingFk,
+ item = itemScanned,
+ quantity = "0",
+ packing = null,
+ warehouse = getData(WAREHOUSEFK),
+ grouping = null
+ )
+ }
+
+ adapter!!.notifyDataSetChanged()
+ }
+
private fun setTooltips() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
binding.editImg.tooltipText = getTooltip(R.drawable.ic_mode_edit_black_24dp)
@@ -333,6 +403,7 @@ class UbicadorFragment(
with(viewModel) {
loadShelvingList.observe(viewLifecycleOwner, Observer { event ->
event.getContentIfNotHandled().notNull {
+
deep = it.list.size
listItems = ArrayList()
var contEtiquetas = 0
@@ -343,7 +414,10 @@ class UbicadorFragment(
}
parking = item.code.uppercase()
+
listItems.add(item)
+
+
}
etiquetas = contEtiquetas.toString()
binding.mainToolbar.toolbarTitle.text =
@@ -354,13 +428,29 @@ class UbicadorFragment(
binding.editPrioridad.setText(it.list[0].priority)
binding.splashProgress.visibility = View.GONE
- //sergio: para mostrar CustomDialogUbicator, ubicador con grouping
- adapter = UbicadorAdapter(listItems,
+
+ for (item in listItems) {
+ for (localItem in listLocalItems) {
+ if (item.item == localItem.item) {
+ item.isNew = localItem.isNew
+ item.checked = localItem.checked
+ if (item.isNew && item.visible != "0") {
+ item.isNew = false
+ item.checked = true
+ }
+
+ binding.locationRecyclerview.postInvalidate()
+ }
+
+ }
+ }
+
+ adapter = UbicadorAdapter(
+ listItems,
onPasillerosItemClickListener = pasillerosItemClickListener!!,
onVisibleClickListener = object : OnVisibleClickListener {
override fun onVisibleClickListener(item: ItemUbicadorVO) {
- // if (item.grouping.isNullOrEmpty()){item.grouping=""}
showAddItem(
item.item,
item.packing,
@@ -387,9 +477,9 @@ class UbicadorFragment(
binding.locationRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, true)
- if (isShelvinLogfromMainScreen){
- //tarea 4454
- viewModel.shelvinLog_add(getData(USER),getData(PASSWORD),shelvingFk)
+ if (isShelvinLogfromMainScreen) {
+ //tarea 4454
+ viewModel.shelvinLog_add(getData(USER), getData(PASSWORD), shelvingFk)
}
}
@@ -406,7 +496,16 @@ class UbicadorFragment(
}
})
+ responseCode.observe(viewLifecycleOwner, Observer {
+ binding.splashProgress.visibility = View.GONE
+ if (it.isError) {
+ ma.messageWithSound(it.errorMessage, true, true)
+ } else {
+ checkUbications(it.response)
+ }
+
+ })
responsepriority.observe(viewLifecycleOwner, Observer {
ma.messageWithSound(
@@ -419,12 +518,14 @@ class UbicadorFragment(
responseMake.observe(viewLifecycleOwner, Observer {
if (!shelvingFk.isNullOrEmpty()) {
- binding.splashProgress.visibility = View.VISIBLE
+
binding.mainToolbar.toolbarTitle.text = shelvingFk
+ binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingList(
getData(USER),
getData(PASSWORD), shelvingFk
)
+
}
})
}
@@ -519,17 +620,15 @@ class UbicadorFragment(
if (updatePacking == null) {
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty()) {
- binding.splashProgress.visibility = View.VISIBLE
+ binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingMake(
getData(USER),
getData(PASSWORD),
shelvingFk,
itemFk,
- deep.toString(),
visible,
packing,
getData(WAREHOUSEFK),
- "1",
groupingPack
)
/*changeOfflineValue(
@@ -547,17 +646,15 @@ class UbicadorFragment(
} else if (!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()) {
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
- binding.splashProgress.visibility = View.VISIBLE
+ binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingMake(
getData(USER),
getData(PASSWORD),
shelvingFk,
itemFk,
- deep.toString(),
visible_calc,
packing,
getData(WAREHOUSEFK),
- "1",
groupingPack
)
/*changeOfflineValue(
@@ -582,7 +679,7 @@ class UbicadorFragment(
}
} else {
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty() && !updatePacking) {
- binding.splashProgress.visibility = View.VISIBLE
+ binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingMakeEdit(
getData(USER),
getData(PASSWORD),
@@ -615,7 +712,7 @@ class UbicadorFragment(
visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
} catch (e: Exception) {
}
- binding.splashProgress.visibility = View.VISIBLE
+ binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingMakeEdit(
getData(USER),
getData(PASSWORD),
@@ -659,35 +756,6 @@ class UbicadorFragment(
}
}
- /* private fun editItem(itemFk:String,etiquetas:String,packing:String,visible:String){
- if (!packing.isNullOrEmpty()){
- if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty()){
- viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible,packing,warehouseFk,"1","itemShelvingMake")
- changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible,packing = packing))
- customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
- customDialogUbicador.getEditItem().requestFocus()
- ma.hideKeyboard(customDialogUbicador.getEditItem())
- }else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()){
- val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
- viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1","itemShelvingMake")
- changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
- customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
- customDialogUbicador.getEditItem().requestFocus()
- ma.hideKeyboard(customDialogUbicador.getEditItem())
- }else{
- "Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
- }
- }else{
- "Packing obligatorio".toast((activity as MainActivity), Toast.LENGTH_LONG)
- }
- }*/
-
- /*private fun changeOfflineValue(item: ItemUbicadorVO) {
- binding.splashProgress.visibility = View.VISIBLE
- *//*listItems.add(item)
- adapter?.notifyDataSetChanged()*//*
- }*/
-
private fun showMoreOptions(item: ItemUbicadorVO) {
customDialogTwoButtons.setTitle(item.item).setDescription(getString(R.string.selectAction))
.setOkButton(getString(R.string.transfer)) {
@@ -707,10 +775,8 @@ class UbicadorFragment(
} else {
getString(R.string.wagonIncorrect).toast(requireContext())
-
}
-
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.show()
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt
index cb759094..801c1acc 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt
@@ -5,6 +5,7 @@ import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
+import es.verdnatura.domain.GetSacadorControladorUserCase
import es.verdnatura.domain.GetUbicadorUserCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
@@ -21,32 +22,28 @@ import retrofit2.Response
class UbicadorViewModel(context: Context) : BaseViewModel() {
-
private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase(context)
-
+ private val getSacadorControladorUserCase: GetSacadorControladorUserCase = GetSacadorControladorUserCase(context)
private val _shelvingList by lazy { MutableLiveData() }
-
private val _response by lazy { MutableLiveData() }
val response: LiveData
get() = _response
-
private val _responsepriority by lazy { MutableLiveData() }
val responsepriority: LiveData
get() = _responsepriority
-
private val _responseMake by lazy { MutableLiveData() }
val responseMake: LiveData
get() = _responseMake
-
val loadShelvingList = Transformations.map(_shelvingList) { Event(it) }
-
private val _reubicationList by lazy { MutableLiveData() }
val loadReubicationList = Transformations.map(_reubicationList) { Event(it) }
-
+ private val _responseCode by lazy { MutableLiveData() }
+ val responseCode: LiveData
+ get() = _responseCode
fun itemShelvingList(
usuario: String,
@@ -136,12 +133,10 @@ class UbicadorViewModel(context: Context) : BaseViewModel() {
password: String,
shelving: String,
item: String,
- deep: String,
quantity: String,
- packing: String,
+ packing: String?,
warehouse: String,
- level: String,
- grouping: String
+ grouping: String?
) {
getUbicadorUserCase.itemShelvingMake(
usuario,
@@ -500,4 +495,31 @@ class UbicadorViewModel(context: Context) : BaseViewModel() {
})
}
+ fun getIdFromCode(usuario: String, password: String, code: String) {
+ getSacadorControladorUserCase.getIdFromCode(usuario, password, code)
+ .enqueue(object : Callback {
+ override fun onFailure(call: Call, t: Throwable) {
+ _responseCode.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
+ )
+ }
+
+ override fun onResponse(call: Call, response: Response) {
+ if (response.body() == null) {
+ _responseCode.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ response.message()
+ )
+ )
+ } else {
+ _responseCode.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt
index 37b0bdd6..29e2fdcc 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt
@@ -13,7 +13,9 @@ class ItemUbicadorVO (
var id:String = "",
var priority:String = "",
var isError:Boolean = false,
- var errorMessage:String = ""
+ var errorMessage:String = "",
+ var checked:Boolean = false,
+ var isNew:Boolean = false
)
class ItemEscanerVO(
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt
index b93d6281..25067a3f 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt
@@ -32,10 +32,7 @@ class WorkermistakeFragment(
) {
private var adapterworker: WorkermistakeAdapter? = null
-
private lateinit var customDialogInput: CustomDialogInput
-
-
private var listWorker: MutableList = ArrayList()
private var listWorkerAuxiliary: MutableList = ArrayList()
private lateinit var customDialog: CustomDialog
diff --git a/app/src/main/res/drawable/.idea/drawable.iml b/app/src/main/res/drawable/.idea/drawable.iml
new file mode 100644
index 00000000..d6ebd480
--- /dev/null
+++ b/app/src/main/res/drawable/.idea/drawable.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/check.xml b/app/src/main/res/drawable/check.xml
new file mode 100644
index 00000000..d6154f28
--- /dev/null
+++ b/app/src/main/res/drawable/check.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_packaging.xml b/app/src/main/res/drawable/ic_packaging.xml
new file mode 100644
index 00000000..6d175516
--- /dev/null
+++ b/app/src/main/res/drawable/ic_packaging.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/component_custom_edit_dialog_two_values.xml b/app/src/main/res/layout/component_custom_edit_dialog_two_values.xml
index 2652f310..37243918 100644
--- a/app/src/main/res/layout/component_custom_edit_dialog_two_values.xml
+++ b/app/src/main/res/layout/component_custom_edit_dialog_two_values.xml
@@ -54,7 +54,7 @@
android:layout_width="match_parent"
android:background="@drawable/background_round"
android:enabled="true"
- android:hint="@string/quantity"
+ android:hint="@string/expeditionPalletOrCMR"
android:inputType="text"
android:lines="1"
android:maxLines="1"
@@ -68,7 +68,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/layout_margin_min"
- android:hint="@string/scanShelving"
+ android:hint="@string/expeditionPalletOrCMR"
android:textColorHint="@android:color/darker_gray"
android:visibility="visible">
diff --git a/app/src/main/res/layout/fragment_packaging.xml b/app/src/main/res/layout/fragment_packaging.xml
new file mode 100644
index 00000000..ffad3bbb
--- /dev/null
+++ b/app/src/main/res/layout/fragment_packaging.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_packaging_count.xml b/app/src/main/res/layout/fragment_packaging_count.xml
new file mode 100644
index 00000000..ce850414
--- /dev/null
+++ b/app/src/main/res/layout/fragment_packaging_count.xml
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_packaging_obs.xml b/app/src/main/res/layout/fragment_packaging_obs.xml
new file mode 100644
index 00000000..b56c9cb5
--- /dev/null
+++ b/app/src/main/res/layout/fragment_packaging_obs.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_packaging_summary.xml b/app/src/main/res/layout/fragment_packaging_summary.xml
new file mode 100644
index 00000000..7f3a5f71
--- /dev/null
+++ b/app/src/main/res/layout/fragment_packaging_summary.xml
@@ -0,0 +1,308 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_workermistake.xml b/app/src/main/res/layout/fragment_workermistake.xml
index 4e7a5c6a..7f5514b9 100644
--- a/app/src/main/res/layout/fragment_workermistake.xml
+++ b/app/src/main/res/layout/fragment_workermistake.xml
@@ -1,7 +1,7 @@
-
+
+ app:layout_constraintTop_toTopOf="parent">
@@ -110,13 +110,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
- tools:listitem="@layout/item_workermistake_row"/>
+ tools:listitem="@layout/item_workermistake_row" />
+ '
- '
-
+ app:layout_constraintTop_toTopOf="parent">
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_general_row_image.xml b/app/src/main/res/layout/item_general_row_image.xml
new file mode 100644
index 00000000..8a7bbb16
--- /dev/null
+++ b/app/src/main/res/layout/item_general_row_image.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_image_row.xml b/app/src/main/res/layout/item_image_row.xml
new file mode 100644
index 00000000..d0ed16d3
--- /dev/null
+++ b/app/src/main/res/layout/item_image_row.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_itemsupplier_row.xml b/app/src/main/res/layout/item_itemsupplier_row.xml
new file mode 100644
index 00000000..a4a4fb32
--- /dev/null
+++ b/app/src/main/res/layout/item_itemsupplier_row.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_ubication_row.xml b/app/src/main/res/layout/item_ubication_row.xml
index e2cad78e..001abe06 100644
--- a/app/src/main/res/layout/item_ubication_row.xml
+++ b/app/src/main/res/layout/item_ubication_row.xml
@@ -10,6 +10,7 @@
type="es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO" />
diff --git a/app/src/main/res/layout/toolbar_fragment.xml b/app/src/main/res/layout/toolbar_fragment.xml
index e6049906..8d2f0533 100644
--- a/app/src/main/res/layout/toolbar_fragment.xml
+++ b/app/src/main/res/layout/toolbar_fragment.xml
@@ -82,13 +82,14 @@
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h6"
android:visibility="invisible"
-
app:autoSizeTextType="uniform"
app:autoSizeMinTextSize="12sp"
app:autoSizeMaxTextSize="100sp"
tool:text="10/20"
tool:visibility="visible" />
+
+
+
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 4d35da11..c86363c0 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -193,6 +193,7 @@
Problemas con la velocidad de internet. No se puede usar la voz
Permite aparcar ticket/carro
Permite dejar el vehículo
+
Genera colección para sacar
Ver filtro
Ver movimientos de Faltas
@@ -459,7 +460,7 @@
En balda:
No es posible aparcar el ticket porque hay un ticket pendiente:
SACADOR V
- Informar CMR
+ Asociar pallet a CMR
Permite infomar de un CMR
Escanea el Pallet
Escanea CMR
@@ -494,5 +495,24 @@
(Su impresora ha sido borrada)
Escanea Pallet y CMR
Escanea pallet o cmr
+ Etiqueta escaneada para %s no válida
+ Escaneadas dos etiquetas del mismo tipo
+ Escanea CMR
+ Escanea PALLET
+ No ha escaneado ni pallet ni Cmr
+ Entradas
+ Permite realizar la entrada de embalajes
+ Embalajes
+ Observaciones
+ Resumen
+ Proveedores
+ Recepción
+ Devolución
+ Permite modo revisión de la ubicación
+ Confirmar entrada
+ Siguiente paso: observaciones e imágenes
+ Siguiente paso: resumen entrada
+ Activado modo revisión
+ Permite activar modo revisión. Escane primero una matrícula
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 74720138..f5e6115d 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -20,6 +20,7 @@
#f7931e
#ffd400
#4ab4e6
+ #a3d131
#50be87
#80be87
#b8daba
@@ -27,6 +28,7 @@
#ffffff
#991A1A1A
+
#4d4d4d
#1a1a1a
#333333
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 1d672588..7c10db75 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -77,6 +77,8 @@
15dp
+ 5dp
+
300dp
200dp
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 121930a9..2774769f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -100,6 +100,8 @@
Write here
Buyers
Departments
+ Suppliers
+ Reception
Grouping
Packing
Barcode
@@ -134,7 +136,7 @@
User assigned to device name
Scan plate or smartag
Expedition state
- Report CMR
+ Associate pallet to CMR
Buffer Management
Pallet make
Scan pallet
@@ -150,6 +152,7 @@
Min quantity
Producer
Control ticket
+ Permit check ubications
Scan expedition
Day of sale
Wagoon
@@ -298,6 +301,7 @@
Printer registered
sector updated
CMR not scanned
+ Not scanned neither pallet nor cmr
Item updated
warehouse
base_urlSalix
@@ -363,6 +367,11 @@
Scan expedition
Buffer management
Claims
+ Suppliers
+ Packaging
+ Observations
+ Summary
+ Confirm entry
Vehicle User Control
Pre puncher
Day of sale
@@ -380,7 +389,6 @@
Log Shelving
Pickers
"Scanned element not found "
-
There are no requests to replace
Completed order
Make sure to scan a plate.
@@ -460,6 +468,7 @@
Access the ticket review
Access the palletizers menu: palletize, buffer…
Access the claims menu
+ Access the packaging menu
Claims Location
Error building collection. Error description:
Main
@@ -494,6 +503,15 @@
Delete work form
¿Do you remove definitely?
Not assigned
+ Scanned label not valid for %s
+ Scanned two labels of same type
+ Scan PALLET
+ Scan CMR
+ Return
+ Next step: observations and images
+ Next step: entry summary
+ Activated checking mode
+ Allow checking mode. Scan firstly the plate and after activate the mode
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index bd41b88c..62306fda 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -40,6 +40,11 @@
- @drawable/btn_blue
- @color/verdnatura_white
+