diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
deleted file mode 100644
index 76e58a0c..00000000
--- a/.idea/deploymentTargetDropDown.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 1b54e406..d9622d09 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -127,23 +127,96 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
@@ -157,7 +230,7 @@
-
+
@@ -175,7 +248,12 @@
-
+
+
+
+
+
+
@@ -244,7 +322,7 @@
@@ -276,6 +354,9 @@
+
+
+
@@ -293,30 +374,31 @@
- {
+ "keyToString": {
+ "ApkExportedModule": "Gestor_Almacén.app",
+ "ExportApk.ApkPathForGestor_Almacén.app": "C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app",
+ "PROJECT_TRUSTED_KEY": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.cidr.known.project.marker": "true",
+ "SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-29/android/widget/TextView.java_SELECTED": "TextView",
+ "cidr.known.project.marker": "true",
+ "com.google.services.firebase.aqiPopupShown": "true",
+ "git-widget-placeholder": "dev",
+ "last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable",
+ "project.structure.last.edited": "Dependencies",
+ "project.structure.proportion": "0.17",
+ "project.structure.side.proportion": "0.2",
+ "run.code.analysis.last.selected.profile": "pProject Default",
+ "settings.editor.selected.configurable": "preferences.rainbow.brackets.disable.when"
},
- "keyToStringList": {
- "ExportApk.BuildVariants": [
- "betaRelease"
+ "keyToStringList": {
+ "ExportApk.BuildVariants": [
+ "betaRelease"
]
}
-}]]>
+}
@@ -483,41 +565,6 @@
1618825571576
-
- 1685710258945
-
-
-
- 1685710258945
-
-
- 1685943727757
-
-
-
- 1685943727757
-
-
- 1686034135416
-
-
-
- 1686034135416
-
-
- 1686034154826
-
-
-
- 1686034154826
-
-
- 1686034214348
-
-
-
- 1686034214348
-
1686034256459
@@ -826,7 +873,42 @@
1697531313482
-
+
+ 1697532528361
+
+
+
+ 1697532528362
+
+
+ 1697532784146
+
+
+
+ 1697532784146
+
+
+ 1697533103477
+
+
+
+ 1697533103477
+
+
+ 1697620178800
+
+
+
+ 1697620178800
+
+
+ 1697695522957
+
+
+
+ 1697695522957
+
+
@@ -868,7 +950,7 @@
-
+
@@ -927,11 +1009,6 @@
-
-
-
-
-
@@ -940,7 +1017,6 @@
-
@@ -952,19 +1028,20 @@
-
+
+
+
+
+
+
+
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt
- 473
-
-
file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt
- 531
+ 548
@@ -974,29 +1051,9 @@
file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt
- 122
+ 123
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt
- 2134
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt
- 1789
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt
- 1241
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt
- 1475
-
-
jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/retrofit/2.3.0/76f3c69879d3e01c082f49d8661c5590838148e1/retrofit-2.3.0-sources.jar!/retrofit2/Response.java
29
diff --git a/app/beta/release/output-metadata.json b/app/beta/release/output-metadata.json
index 5c35c764..939039d8 100644
--- a/app/beta/release/output-metadata.json
+++ b/app/beta/release/output-metadata.json
@@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
- "versionCode": 230,
- "versionName": "23.40Beta",
+ "versionCode": 232,
+ "versionName": "23.40.1Beta",
"outputFile": "app-beta-release.apk"
}
],
diff --git a/app/src/main/java/es/verdnatura/di/viewModelModule.kt b/app/src/main/java/es/verdnatura/di/viewModelModule.kt
index c8fbc0d4..7fc9525d 100644
--- a/app/src/main/java/es/verdnatura/di/viewModelModule.kt
+++ b/app/src/main/java/es/verdnatura/di/viewModelModule.kt
@@ -26,7 +26,6 @@ import es.verdnatura.presentation.view.feature.precontrol.ShowTicketViewModel
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorViewModel
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorViewModel
-import es.verdnatura.presentation.view.feature.shelvingparking.fragment.ShelvingParkingViewModel
import es.verdnatura.presentation.view.feature.ticket.fragment.TicketViewModel
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemViewModel
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
@@ -81,11 +80,6 @@ val viewModelModule = module {
InventaryViewModel(androidContext())
}
- // ShelvingParking
- viewModel {
- ShelvingParkingViewModel(androidContext())
- }
-
// Ubicador
viewModel {
UbicadorViewModel(androidContext())
diff --git a/app/src/main/java/es/verdnatura/domain/SalixService.kt b/app/src/main/java/es/verdnatura/domain/SalixService.kt
index 18a480dd..99c9bc74 100644
--- a/app/src/main/java/es/verdnatura/domain/SalixService.kt
+++ b/app/src/main/java/es/verdnatura/domain/SalixService.kt
@@ -9,6 +9,7 @@ import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
+import es.verdnatura.presentation.view.feature.delivery.model.Expeditions
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
@@ -206,7 +207,7 @@ interface SalixService {
@POST("DeviceLogs")
fun deviceLogInsert(
@Body params: Any
- ): Call
+ ): Call
@POST("ExpeditionTrucks")
fun expeditionTrucksInsert(
@@ -226,7 +227,7 @@ interface SalixService {
@POST("PackingSiteAdvanceds")
fun ticket_advancePackaging(
@Body parms: packingSiteSalix
- ): Call
+ ): Call
@PUT("ItemBarCodes")//REVISADA
@@ -243,7 +244,7 @@ interface SalixService {
@GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA
fun barcodes_toitem(
@Path("barCodeValue") barCodeValue: String
- ): Call
+ ): Call
@GET("Suppliers")//REVISADA
fun getSuppliers(
@@ -294,8 +295,7 @@ interface SalixService {
@PATCH("Operators/{id}")
fun update_operator(
@Path("id") id: Number, @Body params: Any
-
- ): Call
+ ): Call
@GET("Operators")
fun operator_getData(
@@ -371,6 +371,11 @@ interface SalixService {
expeditionMistake: ExpeditionMistakeSalix
): Call
+ @POST("ExpeditionStates/addExpeditionState")
+ fun addExpeditionState(
+ @Body params: Expeditions?
+ ): Call
+
@POST("WorkerMistakes")
fun workerMistakesAdd(
workerMistake: WorkerMistakeSalix
diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
index f419aef5..3b42847f 100644
--- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
+++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
@@ -9,7 +9,6 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
-import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
import es.verdnatura.presentation.view.feature.collection.SalesModified
import es.verdnatura.presentation.view.feature.delivery.model.*
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
@@ -26,7 +25,6 @@ import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
-import es.verdnatura.presentation.view.feature.shelvingparking.model.ItemShelvingParkingVO
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
@@ -52,7 +50,7 @@ interface VerdnaturaService {
fun deviceLog_add(
@Body vararg params: Any
):
- Call
+ Call
@POST("/security/getVersion")//REVISADA
@@ -99,7 +97,7 @@ interface VerdnaturaService {
fun operator_getNumberOfWagons(
):
- Call
+ Call
@POST("almacennew/operator_add")//NO SALIX
fun operator_add(
@@ -159,7 +157,7 @@ interface VerdnaturaService {
@POST("almacennew/operator_getItemPackingType")//NO SALIX
fun operator_getItemPackingType(
):
- Call
+ Call
@POST("almacennew/worker_isF11Allowed")//NO SALIX
fun worker_isF11Allowed(
@@ -244,13 +242,6 @@ interface VerdnaturaService {
):
Call
- @POST("almacennew/itemShelvingPlacementSupplyAdd")//REVISADA
- fun itemShelvingPlacementSupplyAdd(
-
- @Body vararg params: Any
- ):
- Call
-
@POST("almacennew/collection_printSticker")//REVISADA
fun collectionStickerPrint(
@Body vararg params: Any?
@@ -261,20 +252,20 @@ interface VerdnaturaService {
fun ticketCollection_setUsedShelves(
@Body vararg params: Any
):
- Call
+ Call
@POST("almacennew/item_updatePackingShelve")//REVISADA
fun item_updatePackingShelve(
@Body vararg params: Any
):
- Call
+ Call
@POST("almacennew/saleTracking_add")//REVISADA
fun saleTracking_add(
@Body vararg params: Any
):
- Call
+ Call
@POST("almacennew/collectionAddItem")//REVISADA
fun collectionAddItem(
@@ -347,6 +338,7 @@ interface VerdnaturaService {
@Body vararg params: Any
):
Call
+
@POST("almacennew/mistakeType")//REVISADA
fun mistakeType(
):
@@ -461,14 +453,6 @@ interface VerdnaturaService {
):
Call>
-
- //SHELVING PARKING ========================================================================>
- @POST("almacennew/shelvingParking_get")//REVISADA
- fun shelvingParking_get(
- @Body vararg params: Any
- ):
- Call>
-
//CONTROL DE VEHICULOS
@POST("almacennew/machineWorker_add")//REVISADA
fun machineWorker_add(
@@ -498,7 +482,7 @@ interface VerdnaturaService {
fun deviceProductionUser_getWorker(
@Body vararg params: Any
):
- Call
+ Call
@POST("almacennew/machine_getWorkerPlate")//REVISADA
@@ -622,13 +606,13 @@ interface VerdnaturaService {
fun expedition_scan(
@Body vararg params: Any
):
- Call
+ Call
@POST("almacennew/cmrPallet_add")//REVISADA
fun cmrExpeditionPallet_add(
@Body vararg params: Any
):
- Call
+ Call
@POST("almacennew/expedition_getState")//REVISADA
fun expedition_getState(
@@ -753,7 +737,7 @@ interface VerdnaturaService {
fun expeditionState_addByPallet(
@Body vararg params: Any
):
- Call
+ Call
@POST("almacennew/expeditionPallet_get")//REVISADA
fun expeditionPallet_get(
@@ -785,7 +769,7 @@ interface VerdnaturaService {
fun itemShelving_addByClaim(
@Body vararg params: Any
):
- Call
+ Call
//SUPPLIERS
@POST("almacennew/supplier_getItems")//REVISADA
@@ -816,7 +800,7 @@ interface VerdnaturaService {
fun expeditionState_add(
@Body vararg params: Any?
):
- Call
+ Call
@POST("delivery/getInfoFreelance")//NO SALIX
fun getInfoFreelance(
diff --git a/app/src/main/java/es/verdnatura/presentation/common/UIExtensions.kt b/app/src/main/java/es/verdnatura/presentation/common/UIExtensions.kt
index 7a997cfc..4623352c 100644
--- a/app/src/main/java/es/verdnatura/presentation/common/UIExtensions.kt
+++ b/app/src/main/java/es/verdnatura/presentation/common/UIExtensions.kt
@@ -78,18 +78,20 @@ fun View.setMargins(left: Int, top: Int, right: Int, bottom: Int) {
mlp.setMargins(left, top, right, bottom)
}
-fun ImageView.loadUrl(url: String) {
- Glide.with(context)
- .asBitmap()
- .load(url)
- .into(object : CustomTarget() {
+fun ImageView.loadUrl(url: String?) {
+ if (!url.isNullOrEmpty()) {
+ Glide.with(context)
+ .asBitmap()
+ .load(url)
+ .into(object : CustomTarget() {
- override fun onLoadCleared(placeholder: Drawable?) {}
+ override fun onLoadCleared(placeholder: Drawable?) {}
- override fun onResourceReady(resource: Bitmap, transition: Transition?) {
- setImageBitmap(resource)
- }
- })
+ override fun onResourceReady(resource: Bitmap, transition: Transition?) {
+ setImageBitmap(resource)
+ }
+ })
+ }
}
inline val T.TAG: String
@@ -125,7 +127,7 @@ fun Calendar.convertToDateString(): String {
11 -> dayOfMonth = "Dic"
}
- return dayOfWeek + " " + day + " " + dayOfMonth
+ return "$dayOfWeek $day $dayOfMonth"
}
fun RecyclerView.addViewObserver(function: () -> Unit) {
@@ -168,6 +170,7 @@ fun Context.showKeyboardIn(view: View) {
}
+
// Extension function to change media volume programmatically
fun AudioManager.setMediaVolume(volumeIndex: Int) {
// Set media volume level
@@ -208,7 +211,6 @@ fun addDateToTime(time: String): String {
}
-
fun PackageManager.getPackageInfoCompat(packageName: String, flags: Int = 0): PackageInfo =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong()))
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt
index cb2184a9..a7110576 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt
@@ -7,7 +7,6 @@ import android.view.View.VISIBLE
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
-import es.verdnatura.MobileApplication
import es.verdnatura.R
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
@@ -28,6 +27,7 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingTypeList
import es.verdnatura.presentation.view.feature.login.model.Operator
import retrofit2.Response
+import kotlin.math.roundToInt
class AjustesViewModel(val context: Context) : BaseViewModel(context) {
@@ -352,7 +352,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun operator_getNumberOfWagons() {
silex.operator_getNumberOfWagons()
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
@@ -363,10 +363,16 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
if (response.body() != null)
_operatorGetNumberOfWagons.value =
- ResponseItemNumber(response.body(), isError = false)
+ ResponseItemNumber(
+ if (response.body() is Number) {
+ (response.body() as Double).roundToInt()
+ } else {
+ 0
+ }, isError = false
+ )
}
@@ -399,7 +405,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun operator_getItemPackingType() {
silex.operator_getItemPackingType()
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_operatorGetItemPackingType.value = ResponseItemVO(
isError = true,
@@ -407,7 +413,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_operatorGetItemPackingType.value =
ResponseItemVO(
@@ -443,10 +449,11 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
})
}
+
fun worker_updateOperatorSalix(entity: String, workerFk: Int, sectorFk: Int?, labelerFk: Int?) {
ProgressLoading(VISIBLE)
salix.update_operator(id = workerFk, Operator(sectorFk, labelerFk))
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
ProgressLoading(GONE)
_actionUpdate.value = ResponseItemVO(
@@ -456,7 +463,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
throw t
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
ProgressLoading(GONE)
if (entity == "sector") {
_actionUpdate.value = ResponseItemVO(
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt
index 47847a89..c3af8ac5 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt
@@ -13,7 +13,7 @@ class AjustesItemVO(
class SectorItemVO(
var id: Int,
- var description: String = "",
+ var description: String,
val warehouseFk: Int?,
val isError: Boolean = false,
var errorMessage: String = ""
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt
index 9ec860c6..3d84bbea 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt
@@ -52,21 +52,21 @@ class ItemProposalAdapter(
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
title = res.getString(R.string.itemSearch)
- ), item.itemFk
+ ), item.itemFk.toString()
)
}
itemUp.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
title = res.getString(R.string.titleItemSearch)
- ), item.itemFk
+ ), item.itemFk.toString()
)
}
itemDown.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
title = res.getString(R.string.titleItemSearch)
- ), item.itemFk
+ ), item.itemFk.toString()
)
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
index cdbf0a01..f026798e 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
@@ -37,7 +37,7 @@ class ItemCardFragment(
) : BaseFragment(ItemCardViewModel::class),
OnClickDynamic {
- private var urlLarge: String = ""
+ private var urlLarge: String? = ""
private var titleImage: String = ""
private var user = ""
private var password = ""
@@ -176,8 +176,8 @@ class ItemCardFragment(
"more"
).toString()
)
- } catch (Ex: Exception) {
- ma.messageWithSound(Ex.message.toString(), true, true)
+ } catch (ex: Exception) {
+ ma.messageWithSound(ex.message.toString(), true, true)
}
// getItemCard(binding.editItemFk.text.toString())
@@ -290,7 +290,7 @@ class ItemCardFragment(
titleImage = itemInfo.id.toString() + "-" + itemInfo.longName
binding.itemcardImage.loadUrl(itemInfo.urlImage200)
urlLarge = itemInfo.urlImage
- binding.itemcardTag1.text = itemInfo.size
+ binding.itemcardTag1.text = itemInfo.size.toString()
binding.itemcardTag2.text = itemInfo.value5
binding.itemcardTag3.text = itemInfo.value6
binding.itemcardTag4.text = itemInfo.value7 + " " + itemInfo.origin
@@ -300,7 +300,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.total),
- value = itemInfo.visible,
+ value = itemInfo.visible.toString(),
isEditable = false
)
)
@@ -308,7 +308,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Disponible),
- value = itemInfo.available,
+ value = itemInfo.available.toString(),
isEditable = false
)
)
@@ -316,7 +316,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Ubicado),
- value = itemInfo.vVisibleItemShelving,
+ value = itemInfo.vVisibleItemShelving.toString(),
isEditable = false
)
)
@@ -324,7 +324,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.SINUBICAR),
- value = itemInfo.unlocated,
+ value = itemInfo.unlocated.toString(),
isEditable = false,
action = "itemStockUpdate"
)
@@ -374,7 +374,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Grouping),
- value = itemInfo.grouping,
+ value = itemInfo.grouping.toString(),
isEditable = true,
action = "updateGrouping"
)
@@ -382,7 +382,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Packing),
- value = itemInfo.packing,
+ value = itemInfo.packing.toString(),
isEditable = true,
action = "updatePacking"
)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
index 312b116a..e563f763 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
@@ -48,10 +48,12 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
fun getItemCard(
+
itemFk: Number,
warehouseFk: Int,
) {
+ println("La sale el item es $itemFk")
silex.getItemCard(itemFk, warehouseFk)
.enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemCardVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemCardVO.kt
index 8edef768..93f6ba49 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemCardVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemCardVO.kt
@@ -1,59 +1,56 @@
package es.verdnatura.presentation.view.feature.articulo.model
-class ItemCardVO (
- var id:Int = 0,
- var longName:String = "0",
- var value5:String = "",
- var value6:String = "0",
- var value7:String = "0",
- var image:String = "0",
- var size:String = "0",
- var stems:String?,
- var itemCost:String?,
- var category:String = "0",
- var producer:String = "0",
- var origin:String = "0",
- var nicho:String = "0",
- var reserva:String = "0",
- var enNicho:String = "0",
- var available:String = "0",
- var enAltillo:String = "0",
- var repo:String = "0",
- var total:String = "0",
- var min:String = "0",
- var grouping:String = "0",
- var packing:String = "0",
- var barcodes:List = listOf(),
- var tag5:String = "",
- var tag6:String = "",
- var tag7:String = "",
+class ItemCardVO(
+ var id: Int = 0,
+ var longName: String? = null,
+ var value5: String? = null,
+ var value6: String? = null,
+ var value7: String? = null,
+ var image: String? = null,
+ var size: Int? = null,
+ var stems: String?,
+ var itemCost: String?,
+ var category:String? = null,
+ var producer: String? = null,
+ var origin: String? = null,
+ //var nicho: Int? = null,
+ var reserva: Int? = null,
+ var enNicho: Int? = null,
+ var available: Int? = null,
+ //var enAltillo: Int? = null,
+ var repo: Int? = null,
+ //var total: Int? = null,
+ var min: Int? = null,
+ var grouping: Int? = null,
+ var packing: Int? = null,
+ var barcodes: List = listOf(),
+ var tag5: String? = null,
+ var tag6: String? = null,
+ var tag7: String? = null,
var isError: Boolean = false,
- var errorMessage:String = "",
- var urlImage200:String = "",
- var urlImage:String = "",
- var itemPackingTypeFk:String =" ",
- var reference:String="",
- var buyer:String="",
-
-
+ var errorMessage: String = "",
+ var urlImage200: String? = null,
+ var urlImage: String? = null,
+ var itemPackingTypeFk: String? = null,
+ var reference: String? = null,
+ var buyer: String? = null,
//sergio para modificar la llamada de itemCard a item_getInfo
-
- var vVisibleItemShelving:String = "0", // = enAltillo
- var visible :String = "0",// = total
- var unlocated:String = "0" //= enNicho
+ var vVisibleItemShelving: Int? = null, // = enAltillo
+ var visible: Int? = null,// = total
+ var unlocated: Int? = null //= enNicho
)
-class ItemCardRowVO (
- var title:String? = "",
- var value:String? = "",
- var isEditable:Boolean = true,
- var action:String = "",
+class ItemCardRowVO(
+ var title: String? = "",
+ var value: String? = "",
+ var isEditable: Boolean = true,
+ var action: String = "",
var barcodes: List = listOf()
)
class BarcodeVO(
- var code:String?
+ var code: String?
)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemProposal.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemProposal.kt
index c9bc85fb..c48cd473 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemProposal.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemProposal.kt
@@ -2,24 +2,24 @@ package es.verdnatura.presentation.view.feature.articulo.model
class ItemProposal(
- var itemFk: String = "",
- var longName: String = "",
- var subName: String = "",
- var tag5: String = "",
- var value5: String = "",
- var match5: String = "",
- var tag6: String = "",
- var value6: String = "",
- var match6: String = "",
- var tag7: String = "",
- var value7: String = "",
- var match7: String = "",
- var tag8: String = "",
- var value8: String = "",
- var match8: String = "",
- var available: String = "",
- var counter: String = "",
- var minQuantity: String = "",
+ var itemFk: Int? = null,
+ var longName: String? = null,
+ var subName:String? = null,
+ var tag5: String? = null,
+ var value5: String? = null,
+ var match5: String? = null,
+ var tag6: String? = null,
+ var value6: String? = null,
+ var match6: String? = null,
+ var tag7: String? = null,
+ var value7: String? = null,
+ var match7: String? = null,
+ var tag8: String? = null,
+ var value8: String? = null,
+ var match8: String? = null,
+ var available: Int? = null,
+ var counter: Int? = null,
+ var minQuantity: Int? = null,
var isError: Boolean = false,
var errorMessage: String = ""
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
index c94f2e74..06b77fb5 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
@@ -100,8 +100,7 @@ class BuscarItemFragment(
var totalVisible = 0
it.list.forEach {
- if (!it.visible.isNullOrEmpty())
- totalVisible += it.visible.toInt()
+ totalVisible += it.visible
}
binding.mainToolbar.toolbarTitle.text =
getString(R.string.item) + itemFk + " " +getString(R.string.visibleTotal) + totalVisible
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt
index c1457bb3..5b61a0ab 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt
@@ -4,14 +4,14 @@ package es.verdnatura.presentation.view.feature.buscaritem.model
class ItemLocationVO (
var Parking:String = "",
var Matricula:String = "",
- var visible:String = "",
- var Disponible:String = "",
- var level:String = "",
+ var visible:Int = 0,
+ //var Disponible:Int = 0,
+ //var level:String = "",
var created:String = "",
- var itemFk:String = "",
+ var itemFk:Int = 0,
val isError : Boolean = false,
var errorMessage : String = "",
- var priority:String = ""
+ var priority:Int = 0
)
class LocationListVO (
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/model/BuyerVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/model/BuyerVO.kt
index f94a889a..73949ff4 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/model/BuyerVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/model/BuyerVO.kt
@@ -3,8 +3,8 @@ package es.verdnatura.presentation.view.feature.calidad.model
//import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
class BuyerVO (
- var userFk:String = "",
- var nickname:String= "",
+ var userFk:Int,
+ var nickname:String,
var isError:Boolean = false,
var errorMessage:String = ""
)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimViewModel.kt
index e010ec77..0f710761 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimViewModel.kt
@@ -22,7 +22,7 @@ class ClaimViewModel(val context: Context) : BaseViewModel(context) {
fun itemShelving_addByClaim(claimFK: Int, shelvingFK: String) {
silex.itemShelving_addByClaim(claimFK, shelvingFK)
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseadd.value = ResponseItemVO(
isError = true, errorMessage = getMessageFromAllResponse(
@@ -31,7 +31,7 @@ class ClaimViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_responseadd.value = ResponseItemVO(
isError = false,
errorMessage = getMessageFromAllResponse(
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapterNew.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapterNew.kt
index 1faf848e..d381bc80 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapterNew.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapterNew.kt
@@ -115,7 +115,7 @@ class SaleAdapterNew(
}*/
packingTopicker.setOnClickListener {
- onQuantityClick.onQuantityClick(sale)
+ //onQuantityClick.onQuantityClick(sale)
}
@@ -131,7 +131,7 @@ class SaleAdapterNew(
}
itemArticleFirstAccumulate.setOnClickListener {
- onQuantityClick.onQuantityClick(sale)
+ //onQuantityClick.onQuantityClick(sale)
}
itemFirstToPicker.setOnClickListener {
onPackingClick.onPackingClick(sale)
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 297f881b..9197ad63 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
@@ -799,7 +799,7 @@ class CollectionFragment(
customDialog.show()
} else {
viewModel.parking(
- ticketFk = tickets[0],
+ ticketFk = tickets[0].toInt(),
parking = ticketScanTxt
)
}
@@ -1323,7 +1323,7 @@ class CollectionFragment(
viewModel.parking(
- ticketFk = tickets[0],
+ ticketFk = tickets[0].toInt(),
parking = txtscan
)
@@ -1456,7 +1456,7 @@ class CollectionFragment(
if (txtscan.contains("-")) {
tickets.forEach {
viewModel.parking(
- ticketFk = it,
+ ticketFk = it.toInt(),
parking = txtscan
)
}
@@ -2060,7 +2060,7 @@ class CollectionFragment(
private fun addItem() {
listPlacementSupply = ArrayList()
collection.tickets.forEach {
- listPlacementSupply.add(BarcodeVO(code = it.ticketFk))
+ listPlacementSupply.add(BarcodeVO(code = it.ticketFk.toString()))
}
if (listPlacementSupply.size == 1) {
ticketSelected = listPlacementSupply[0].code!!.toInt()
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt
index cd56a63e..a8fac39b 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt
@@ -797,7 +797,7 @@ import org.json.JSONObject
customDialog.show()
} else {
viewModel.parking(
- ticketFk = tickets[0],
+ ticketFk = tickets[0].toInt(),
parking = ticketScanTxt
)
}
@@ -1338,7 +1338,7 @@ import org.json.JSONObject
viewModel.parking(
- ticketFk = tickets[0],
+ ticketFk = tickets[0].toInt(),
parking = txtscan
)
@@ -1472,7 +1472,7 @@ import org.json.JSONObject
if (txtscan.contains("-")) {
tickets.forEach {
viewModel.parking(
- ticketFk = it,
+ ticketFk = it.toInt(),
parking = txtscan
)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt
index 43c3af2f..3350499f 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt
@@ -402,7 +402,7 @@ class CollectionFragmentPreChecker(
it.sales.forEach { at ->
if (at.saleGroupFk != saleGroup) {
viewModel.parking(
- ticketFk = at.saleGroupFk,
+ ticketFk = at.saleGroupFk.toInt(),
parking = myQr.more
)
saleGroup = at.saleGroupFk
@@ -818,7 +818,7 @@ class CollectionFragmentPreChecker(
customDialog.show()
} else {
viewModel.parking(
- ticketFk = tickets[0],
+ ticketFk = tickets[0].toInt(),
parking = ticketScanTxt
)
}
@@ -1346,7 +1346,7 @@ class CollectionFragmentPreChecker(
viewModel.parking(
- ticketFk = tickets[0],
+ ticketFk = tickets[0].toInt(),
parking = txtscan
)
@@ -1479,7 +1479,7 @@ class CollectionFragmentPreChecker(
if (txtscan.contains("-")) {
tickets.forEach {
viewModel.parking(
- ticketFk = it,
+ ticketFk = it.toInt(),
parking = txtscan
)
}
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 9700ebc9..44897cb3 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
@@ -13,11 +13,19 @@ import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ItemShelvingSaleSalix
import es.verdnatura.presentation.common.ResponseItemVO
-import es.verdnatura.presentation.view.feature.collection.*
+import es.verdnatura.presentation.view.feature.collection.ItemVO
+import es.verdnatura.presentation.view.feature.collection.SalesModifiedList
+import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
+import es.verdnatura.presentation.view.feature.collection.listSaleSalix
import es.verdnatura.presentation.view.feature.collection.mapper.map
import es.verdnatura.presentation.view.feature.collection.mapper.proposal
-import es.verdnatura.presentation.view.feature.login.model.SalixMessageVO
-import es.verdnatura.presentation.view.feature.sacador.model.*
+import es.verdnatura.presentation.view.feature.collection.saleSalix
+import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
+import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
+import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeListVO
+import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
+import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
+import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
import retrofit2.Call
import retrofit2.Callback
@@ -542,7 +550,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
silex.ticketCollection_setUsedShelves(
ticketFk,
usedShelves
- ).enqueue(object : SilexCallback(context) {
+ ).enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseUsedShelves.value = ResponseItemVO(
@@ -551,7 +559,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_responseUsedShelves.value = ResponseItemVO(isError = false)
}
@@ -565,7 +573,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
silex.item_updatePackingShelve(
vSelf,
vPacking
- ).enqueue(object : SilexCallback(context) {
+ ).enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseItem_updatePackingShelve.value = ResponseItemVO(
isError = true,
@@ -573,7 +581,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_responseItem_updatePackingShelve.value = ResponseItemVO(isError = false)
}
})
@@ -585,7 +593,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
) {
silex.saleTracking_add(
saleGroupFk
- ).enqueue(object : SilexCallback(context) {
+ ).enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseSaleGroup.value = ResponseItemVO(
isError = true,
@@ -593,7 +601,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_responseSaleGroup.value = ResponseItemVO(isError = false)
}
})
@@ -748,7 +756,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
}
fun parking(
- ticketFk: String,
+ ticketFk: Int,
parking: String
) {
silex.shelvingPark(ticketFk, parking)
@@ -844,7 +852,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
fun getIdFromCodeSalix(code: String) {
salix.barcodes_toitem(code)
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseCode.value = ResponseItemVO(
isError = true,
@@ -852,14 +860,14 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
- _responseCode.value =
- ResponseItemVO(
- isError = false,
- response = if (response.body() == null) "" else {
- response.body()!!
- }
- )
+ override fun onSuccess(response: Response) {
+
+ _responseCode.value =
+ ResponseItemVO(
+ isError = false,
+ response = if (response.body() == null) "" else{response!!.body().toString()}
+ )
+
}
})
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
index 5846b0ae..22475d0e 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
@@ -180,7 +180,7 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
fun deviceProductionUser_getWorker(android_id: String) {
silex.deviceProductionUser_getWorker(
android_id
- ).enqueue(object : SilexCallback(context) {
+ ).enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responsemachine.value = ResponseItemMachineControl(
isError = true,
@@ -189,7 +189,7 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
if (response.body() != null) {
_responsemachine.value =
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/InfoFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/InfoFragment.kt
index ec897ae8..770b5014 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/InfoFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/InfoFragment.kt
@@ -36,9 +36,9 @@ class InfoFragment(var title: String) :
companyInfoList.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = View.GONE
if (it.list.isNotEmpty()) {
- binding.itemName.text = it.list[0].name
- binding.itemNif.text = it.list[0].nif
- binding.itemAdress.text = it.list[0].street + "-" + it.list[0].city
+ binding.itemName.text = it.list[0]?.name
+ binding.itemNif.text = it.list[0]?.nif
+ binding.itemAdress.text = it.list[0]?.street + "-" + it.list[0]?.city
}
}
@@ -46,9 +46,9 @@ class InfoFragment(var title: String) :
binding.splashProgress.visibility = View.GONE
if (it.list.isNotEmpty()) {
binding.linearInfoFreelance.visibility=View.VISIBLE
- binding.freelanceName.text = it.list[0].name
- binding.freelanceNif.text = it.list[0].nif
- binding.freelanceAddress.text = it.list[0].street + "-" + it.list[0].city
+ binding.freelanceName.text = it.list[0]?.name
+ binding.freelanceNif.text = it.list[0]?.nif
+ binding.freelanceAddress.text = it.list[0]?.street + "-" + it.list[0]?.city
}
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt
index dc5e2c44..78cb02cf 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt
@@ -73,7 +73,10 @@ class LogExpeditionFragment(
when (item) {
iconDelivery.drawable -> {
- ma.openSummaryFragment(binding.route.text.toString().toInt(),"ON_DELIVERY")
+ ma.openSummaryFragment(
+ binding.route.text.toString().toInt(),
+ "ON_DELIVERY"
+ )
}
}
}
@@ -90,15 +93,16 @@ class LogExpeditionFragment(
val info: PackageInfo = manager.getPackageInfo(requireContext().packageName, 0)
val version = info.versionName
- if (version.contains("Beta")){
- i.setClassName(
- "verdnatura.es.repartoverdnatura.sfusion",
- "verdnatura.es.repartoverdnatura.ExpeditionSummaryActivity"
- )}
- else{
+ if (version.contains("Beta")) {
+ i.setClassName(
+ "verdnatura.es.repartoverdnatura.sfusion",
+ "verdnatura.es.repartoverdnatura.ExpeditionSummaryActivity"
+ )
+ } else {
i.setClassName(
"verdnatura.es.repartoverdnatura",
- "verdnatura.es.repartoverdnatura.ExpeditionSummaryActivity")
+ "verdnatura.es.repartoverdnatura.ExpeditionSummaryActivity"
+ )
}
i.putExtra("routeId", binding.route.text)
i.putExtra("app", "picking")
@@ -119,7 +123,7 @@ class LogExpeditionFragment(
viewModel.expedition_getLog(binding.scanInput.toInt())
originalItem = binding.scanInput.toInt()
binding.mainToolbar.toolbarTitle.text =
- getString(R.string.expedition) + binding.scanInput.text
+ """${getString(R.string.expedition)} ${binding.scanInput.text}"""
} catch (ex: Exception) {
"Error al escanear expedición".toast(context, Toast.LENGTH_SHORT)
}
@@ -171,14 +175,21 @@ class LogExpeditionFragment(
binding.splashProgress.visibility = View.VISIBLE
if (isChecked) {
+
+ /*viewModel.expeditionStateAddSalix(Expeditions(listOf(
+ ExpeditionSalix(expeditionFk = originalItem, stateCode = "ON DELIVERY"))))*/
viewModel.expeditionState_add(arrayListOf(Expedition(originalItem)), "FOUND")
} else {
+ /* viewModel.expeditionStateAddSalix(Expeditions(listOf(
+ ExpeditionSalix(expeditionFk = originalItem, stateCode = "LOST"))))*/
+
viewModel.expeditionState_add(arrayListOf(Expedition(originalItem)), "LOST")
}
}
}
+
private fun setInfoText(routeDelivery: RouteDelivery) {
binding.routeLayout.visibility = View.VISIBLE
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt
index bd3f0440..028d5357 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt
@@ -18,29 +18,35 @@ class CompanyInfoList(
)
class DeliveryInfo(
- var name: String = "",
- var street: String = "",
- var city: String = "",
- var nif: String = "",
- var postCode: Int = 0
+ var name: String? = null,
+ var street: String? = null,
+ var city: String? = null,
+ var nif: String? = null,
+ var postCode: String? = null
)
-class ExpeditionInfoList (
+class Expeditions(
+ val expeditions: List = listOf()
+)
+
+class ExpeditionSalix(
+ val expeditionFk: Int,
+ val stateCode: String
+)
+
+class ExpeditionInfoList(
var list: List = listOf()
)
-class ExpeditionInfoLog(
- var description: String = "",
- var name: String = "",
- var created: String,
-) {
- /* posiblidad de meter función directo en xml*/
- fun getDateString(): String {
- val format = SimpleDateFormat("dd/MM/yyy")
- // return format.format(created)
- return created
- }
-}
+
+
+data class ExpeditionInfoLog(
+ var description: String,
+ var name: String,
+ var created: String
+)
+
+
class RouteDeliveryList(
var list: List = listOf()
@@ -88,8 +94,8 @@ class ExpeditionInfoPending(
var code: String?,
var nickname: String,
var postalCode: Int
-
-):Serializable
+
+) : Serializable
class ExpeditionSummaryList(
@@ -101,18 +107,20 @@ class ExpeditionInfoSummary(
var addressFk: Int,
var itemPackingType: String?,
var total: Int,
- var delivery: Int = 0,
- var lost: Int = 0,
- var delivered: Int = 0
+ var delivery: Int,
+ var lost: Int,
+ var delivered: Int
)
class RouteList(
var list: MutableList = mutableListOf()
)
+
@Entity(tableName = "routesLoaded")
class RouteLoaded(
@PrimaryKey var id: Long,
- var created: String)
+ var created: String
+)
@Entity(tableName = "routes")
class RouteInfo(
@@ -127,12 +135,13 @@ class RouteInfo(
var kmEnd: Long,
var started: String,
var finished: String,
- var header :Boolean = false,
+ var header: Boolean = false,
//tarea 5867
- var email:String? = null
-):Serializable {
+ var email: String? = null
+) : Serializable {
override fun toString(): String {
return "$driver$id$name$numberPlate$m3$created$hour$"
}
}
+
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt
index 6ef896a5..bf088c15 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt
@@ -5,6 +5,7 @@ import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
+import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.Event
@@ -18,6 +19,7 @@ import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionList
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSummaryList
+import es.verdnatura.presentation.view.feature.delivery.model.Expeditions
import es.verdnatura.presentation.view.feature.delivery.model.FreeLanceDeliveryInfoList
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
import es.verdnatura.presentation.view.feature.delivery.model.RouteDeliveryList
@@ -185,8 +187,8 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
fun expeditionState_add(expeditions: Any?, state: String) {
silex.expeditionState_add(expeditions, state)
- .enqueue(object : SilexCallback(context) {
- override fun onSuccess(response: Response) {
+ .enqueue(object : SilexCallback(context) {
+ override fun onSuccess(response: Response) {
_responseStateAdd.value = ResponseItemVO(state, false, "", 0)
}
@@ -195,7 +197,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
_responseStateAdd.value = ResponseItemVO()
}
- override fun onFailure(call: Call, t: Throwable) {
+ override fun onFailure(call: Call, t: Throwable) {
_responseStateList.value = ResponseItemVO("", true, t.message.toString(), 0)
@@ -203,7 +205,26 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
})
}
+ fun expeditionStateAddSalix(expeditions: Expeditions) {
+ salix.addExpeditionState(expeditions)
+ .enqueue(object : SalixCallback(context) {
+ override fun onSuccess(response: Response) {
+ _responseStateAdd.value = ResponseItemVO("", false, "", 0)
+ }
+
+ override fun onError(t: Throwable) {
+ super.onError(t)
+ _responseStateAdd.value = ResponseItemVO()
+ }
+
+ override fun onFailure(call: Call, t: Throwable) {
+ _responseStateList.value = ResponseItemVO("", true, t.message.toString(), 0)
+
+
+ }
+ })
+ }
fun getInfoFreelance(
userId: Int
) {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/adapter/DayOfSaleAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/adapter/DayOfSaleAdapter.kt
index 1b8ab623..9e21e394 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/adapter/DayOfSaleAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/adapter/DayOfSaleAdapter.kt
@@ -64,7 +64,7 @@ class DayOfSaleAdapter(
title = res.getString(
R.string.titleItemConsult
)
- ), item.itemFk
+ ), item.itemFk.toString()
)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.kt
index 08e24e11..697e75e9 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.kt
@@ -2,12 +2,12 @@ package es.verdnatura.presentation.view.feature.diadeventa.model
class ItemShelvingSaleDate (
- var itemFk:String = "",
- var longName:String = "",
- var dated:String = "",
- var amount:String = "",
- var visible:String ="",
- var stock:String = "",
+ var itemFk:Int? = null,
+ var longName:String? = null,
+ var dated:String? = null,
+ var amount:Int? = null,
+ var visible:Int? = null,
+ var stock:Int? = null,
var isError:Boolean = false,
var errorMessage:String = ""
)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/adapter/HistoricoAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/adapter/HistoricoAdapter.kt
index 2fca8c78..b80c8e16 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/adapter/HistoricoAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/adapter/HistoricoAdapter.kt
@@ -39,7 +39,6 @@ class HistoricoAdapter (
val sdf = SimpleDateFormat(res.getString(R.string.dateFormat))
val currentDate = sdf.format(Date())
if (currentDate == item.shipped){
- // historicoDate.setBackgroundColor(res.getColor(R.color.verdnatura_pumpkin_orange))
historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.getContext(),R.color.verdnatura_pumpkin_orange))
}else{
historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.getContext(),R.color.verdnatura_black_5))
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt
index 0d6459dc..14fe6a14 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt
@@ -89,6 +89,7 @@ class HistoricoArticuloFragment(
viewModelwithFilter("contenedor")
item.setTint(getColor(context!!, verdnatura_pumpkin_orange))
}
+
iconFault.drawable -> viewModelwithFilter("falta")
}
@@ -133,16 +134,15 @@ class HistoricoArticuloFragment(
listHistoric.removeAll(listHistoryAux)
listHistoryAux.forEach {
-
- if (it.name.contains(
+ if (it.name?.contains(
binding.filterNameordateitem.text.toString(),
true
- )
+ ) == true
) {
- //Log.i("VERDNATURA:","si contiene ${filter_nameordateitem.text.toString()}")
listHistoric.add(it)
}
+
}
}
@@ -180,7 +180,7 @@ class HistoricoArticuloFragment(
// listHistoryAux.add(it)
} else {
- if (it.name.contains(filter, true)) {
+ if (it.name?.contains(filter, true)!!) {
listHistoric.add(it)
// listHistoryAux.add(it)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/model/ItemHistoricoVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/model/ItemHistoricoVO.kt
index a56bd8c5..b0543280 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/model/ItemHistoricoVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/model/ItemHistoricoVO.kt
@@ -1,19 +1,19 @@
package es.verdnatura.presentation.view.feature.historicoarticulo.model
-class ItemHistoricoVO (
- var shipped:String = "",
- var stateName:String = "",
- var origin:String = "",
- var reference: String = "",
- var clientFk: String = "",
- var name:String = "",
- var invalue:String = "-",
- var out:String = "-",
- var balance:String = "-",
- var isError:Boolean = false,
- var errorMessage:String = ""
+class ItemHistoricoVO(
+ var shipped: String? = null,
+ var stateName: String? = null,
+ var origin: Int? = null,
+ var reference: String? = null,
+ var clientFk: Int? = null,
+ var name: String? = null,
+ var invalue: Int? = null,
+ var out: Int? = null,
+ var balance: Int? = null,
+ var isError: Boolean = false,
+ var errorMessage: String = ""
)
class ItemHistoricoListVO(
- var list:List = listOf()
+ var list: List = listOf()
)
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 8dc652d3..dd0912a0 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
@@ -3,43 +3,48 @@ package es.verdnatura.presentation.view.feature.historicoshelving.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
-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 (
+class ItemShelvingLogAdapter(
private val items: List,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
- ): RecyclerView.Adapter() {
+) : RecyclerView.Adapter() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
- ItemShelvinglogRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
- )
+ ItemShelvinglogRowBinding.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])
holder.binding.root.setOnClickListener {
- onPasillerosItemClickListener.onPasillerosItemClickListener(
- PasillerosItemVO(title = holder.binding.root.context.getString(
- R.string.titleUbicator)),items[position].shelvingFk)
- }
+ val shelvingFk = items[position].shelvingFk
+ if (!shelvingFk.isNullOrEmpty()) {
+ onPasillerosItemClickListener.onPasillerosItemClickListener(
+ PasillerosItemVO(
+ title = holder.binding.root.context.getString(
+ R.string.titleUbicator
+ )
+ ), shelvingFk
+ )
+ }
+
+ }
}
inner class ItemHolder(
val binding: ItemShelvinglogRowBinding
- ) : RecyclerView.ViewHolder(binding.root){
+ ) : RecyclerView.ViewHolder(binding.root) {
private val res = binding.root.context.resources
fun bind(item: ItemShelvingLog) {
binding.apply {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt
index 4a668c1b..ce368f0a 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt
@@ -3,13 +3,13 @@ package es.verdnatura.presentation.view.feature.historicoshelving.model
class ItemShelvingLog(
- var itemFk:String = "",
- var longName:String = "",
- var shelvingFk:String = "",
- var visible:String = "",
- var accion:String = "",
- var created:String = "",
- var code:String = "",
+ var itemFk:Int? = null,
+ var longName:String? = null,
+ var shelvingFk:String? = null,
+ var visible:Int? = null,
+ var accion:String? = null,
+ var created:String? = null,
+ var code:String? = null,
var isError:Boolean = false,
var errorMessage:String = ""
)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.kt
index d451d0f4..9d521498 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.kt
@@ -1,15 +1,14 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.model
+class ItemHistoricoVehiculo(
+ var inTimed: String? = null,
+ var workerName: String? = null,
+ var outTimed: String? = null,
+ var isError: Boolean = false,
+ var errorMessage: String = ""
+)
- class ItemHistoricoVehiculo (
- var inTimed:String = "", //timed
- var workerName:String = "",
- var outTimed:String = "",//direction
- var isError:Boolean = false,
- var errorMessage:String = ""
- )
-
- class ItemHistoricoVehiculoList(
- var list:List = listOf()
- )
+class ItemHistoricoVehiculoList(
+ var list: List = listOf()
+)
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 32dc4d4b..a42ac261 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
@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
-import android.util.Log
import android.view.View
import android.widget.ImageView
import androidx.lifecycle.Observer
@@ -164,10 +163,10 @@ class InventaryFragment :
it.itemFk!!.toString().contains(
binding.filterItemFk.text.toString(),
true
- ) || it.producer.contains(
+ ) || it.producer?.contains(
binding.filterItemFk.text.toString(),
true
- ) || it.longName?.contains(
+ )== true || it.longName?.contains(
binding.filterItemFk.text.toString(),
ignoreCase = true
) == true
@@ -217,14 +216,14 @@ class InventaryFragment :
adapter = InventoryAdapter(listInvetory, object : OnInvetoryNichoClickListener {
override fun onInvetoryNichoClickListener(item: ItemInventaryVO) {
- customDialog.setTitle(item.itemFk.toString() + "\n" + item.longName + " " + item.size)
+ customDialog.setTitle(item.itemFk.toString() + "\n" + item.longName)
.setDescription(getString(R.string.quantityReal) + item.nicho + ")")
.setOkButton(getString(R.string.pull)) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.itemTrash(
item.itemFk!!.toInt(),
getDataInt(WAREHOUSEFK),
- item.nicho,
+ item.nicho!!,
false
)
itemClicked = item
@@ -270,10 +269,8 @@ class InventaryFragment :
listInvetory.removeAt(listInvetory.indexOf(item))
listInvetoryAux.removeAt(listInvetoryAux.indexOf(item))
} catch (excep: Exception) {
- Log.d("VERDNATURA::", "Para evitar cierres inesperados.")
}
adapter?.notifyDataSetChanged()
- //reload = true
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt
index c76a961f..af0ae98f 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt
@@ -422,7 +422,7 @@ class InventaryParkingFragment(
if (allChecked) {
ma.messageWithSound(
- "Matrícula ya revisada",
+ getString(R.string.plateChecked),
false,
true,
"",
@@ -489,7 +489,7 @@ class InventaryParkingFragment(
}
private fun checkItem(itemCode: String) {
-
+ println("itemCode es $itemCode")
positionItemChecking = myListInventory.indexOfFirst { item ->
item.itemFk == itemCode
.toInt() && item.shelvingFk == myListInventory[positionShelvingChecking].shelvingFk && item.isChecked == null
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt
index 5e18183f..0c19936d 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt
@@ -5,7 +5,7 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.google.gson.JsonObject
-import es.verdnatura.MobileApplication
+import es.verdnatura.R
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.presentation.base.BaseViewModel
@@ -20,10 +20,8 @@ import es.verdnatura.presentation.view.feature.inventario.model.InventoryParking
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
-import es.verdnatura.presentation.view.feature.workermistake.model.ExpeditionMistakeSalix
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
-import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeSalix
import es.verdnatura.presentation.view.feature.workermistake.model.departmentMistakeList
import es.verdnatura.presentation.view.feature.workermistake.model.workerFromMistakeList
import es.verdnatura.presentation.view.feature.workermistake.model.workerMistakeTypeList
@@ -86,7 +84,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
override fun onError(t: Throwable) {
val listError: ArrayList = ArrayList()
listError.add(
- BuyerVO(
+ BuyerVO(0,"",
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
@@ -100,7 +98,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
} else {
val listError: ArrayList = ArrayList()
listError.add(
- BuyerVO(
+ BuyerVO(0,"",
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
@@ -662,7 +660,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
fun getIdFromCodeSalix(code: String) {
salix.barcodes_toitem(code)
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseCode.value = ResponseItemVO(
isError = true,
@@ -670,14 +668,21 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
- _responseCode.value =
- ResponseItemVO(
- isError = false,
- response = if (response.body() == null) "" else {
- response.body()!!
- }
+ override fun onSuccess(response: Response) {
+ if (response.body() == null) {
+ _responseCode.value = ResponseItemVO(
+ isError = true,
+ errorMessage = context.getString(R.string.itemNotValid)
)
+ } else {
+ println("itemCode response"+response.body())
+ println("itemCode response string"+response.body().toString())
+ println("itemCode response toInt"+response.body().toString().toInt())
+
+ _responseCode.value =
+ ResponseItemVO(isError = false, response = response.body()!!.toString())
+ }
+
}
})
}
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 31c63966..cc96f2ba 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
@@ -2,7 +2,7 @@ package es.verdnatura.presentation.view.feature.inventario.fragment
import ir.mirrajabi.searchdialog.core.Searchable
-class SearchBuyerModel(private var nickname: String?, private var buyerId: String?) : Searchable {
+class SearchBuyerModel(private var nickname: String?, private var buyerId: Int?) : Searchable {
override fun getTitle(): String {
@@ -11,7 +11,7 @@ class SearchBuyerModel(private var nickname: String?, private var buyerId: Strin
}
fun getBuyerId(): String {
- return buyerId!!
+ return buyerId.toString()!!
}
fun getBuyerNickname(): String {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/model/ItemInventaryVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/model/ItemInventaryVO.kt
index fcb9f284..58ca0fc6 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/model/ItemInventaryVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/model/ItemInventaryVO.kt
@@ -2,12 +2,12 @@ package es.verdnatura.presentation.view.feature.inventario.model
class ItemInventaryVO(
var itemFk: Int? = null,
- var longName: String? = "",
- var size: String = "",
- var producer: String = "",
- var downstairs: String = "",
- var upstairs: String = "",
- var nicho: Int = 0,
+ var longName: String? = null,
+ var size: String? = null,
+ var producer: String? = null,
+ var downstairs: Int? = null,
+ var upstairs: Int? = null,
+ var nicho: Int? = null,
var isError: Boolean = false,
var errorMessage: String = "",
var itemColour: String = ""
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt
index a4adc7ff..4a150c9b 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt
@@ -31,6 +31,7 @@ import es.verdnatura.presentation.view.feature.login.model.workerId
import es.verdnatura.presentation.view.feature.paletizador.model.itemsExpeditionDynamics
import retrofit2.Response
import java.util.Date
+import kotlin.math.roundToInt
class LoginViewModel(val context: Context) : BaseViewModel(context) {
private val _loginsalixitem by lazy { MutableLiveData() }
@@ -195,23 +196,32 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
//Tarea 4815
// salix.deviceLogInsert(DeviceLogSalix(androidId = android_id,userFk,nameApp= app,versionApp= versionApp))
silex.deviceLog_add(app, versionApp, android_id)
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
}
})
}
+
fun deviceLog_addSalix(
- app: String, versionApp: String, android_id: String,userFk:Int, serialnumber:String
+ app: String, versionApp: String, android_id: String, userFk: Int, serialnumber: String
) {
//Tarea 4815
- salix.deviceLogInsert(DeviceLogSalix(android_id = android_id,userFk=userFk,nameApp= app,versionApp= versionApp,serialNumber = serialnumber))
- .enqueue(object : SilexCallback(context) {
+ salix.deviceLogInsert(
+ DeviceLogSalix(
+ android_id = android_id,
+ userFk = userFk,
+ nameApp = app,
+ versionApp = versionApp,
+ serialNumber = serialnumber
+ )
+ )
+ .enqueue(object : SilexCallback(context) {
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
}
})
@@ -365,7 +375,7 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
fun operator_getNumberOfWagons() {
silex.operator_getNumberOfWagons()
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_operatorGetNumberOfWagons.value = ResponseItemNumber(
null,
@@ -374,18 +384,21 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
- if (response.body() != null)
+ override fun onSuccess(response: Response) {
_operatorGetNumberOfWagons.value =
- ResponseItemNumber(response.body(), isError = false)
-
-
+ ResponseItemNumber(
+ if (response.body() is Number) {
+ ((response.body() as Double).roundToInt())
+ } else {
+ 0
+ }, isError = false
+ )
}
})
}
fun operator_add() {
- //Tarea 5134 no se puede modificar directamente con un upsertWith, hay que modificar front. Y si al hacer login en Salix hacer el insertIgnore en -> operator_add, back de Salix sabe
+ //Tarea 5134 no se puede modificar directamente con un upsertWith, hay que modificar front. Y si al hacer login en Salix hacer el insertIgnore en -> operator_add, back de Salix sabe
//si es de app?
//salix.operatorAdd()
silex.operator_add().enqueue(object : SilexCallback(context) {
@@ -409,7 +422,8 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
override fun onError(t: Throwable) {
val listError: ArrayList = ArrayList()
listError.add(
- Printers(0,"",
+ Printers(
+ 0, "",
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
@@ -430,7 +444,8 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
} else {
val listError: ArrayList = ArrayList()
listError.add(
- Printers(0,"",
+ Printers(
+ 0, "",
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
@@ -446,6 +461,7 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
})
}
+
fun operator_getDataSalix(
workerId: String
) {
@@ -492,6 +508,7 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
})
}
+
fun getAccessTokenConfigs(
) {
@@ -537,6 +554,7 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
})
}
+
fun renewToken(
) {
salix.renewToken()
@@ -552,6 +570,7 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
_renewTokenResponse.value = RenewToken
}
+
override fun onError(t: Throwable) {
_renewTokenResponse.value = RenewToken(
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 ae66cb94..c628032b 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
@@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.main.activity
import NetworkUtils
import PhotosFragment
+import android.content.Intent
import android.content.SharedPreferences
import android.media.MediaPlayer
import android.net.Uri
@@ -80,7 +81,6 @@ import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragmentN
import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketFragment
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
-import es.verdnatura.presentation.view.feature.shelvingparking.fragment.ShelvingParkingFragment
import es.verdnatura.presentation.view.feature.ticket.fragment.TicketAdvanceFragment
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemFragment
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemFragmentTEST
@@ -153,8 +153,26 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL
setFragments()
setBottomMenuFragment()
setRegisterNetwork()
+ //Tarea
+ //printBluetooth()
+
+ }
+
+ private fun printBluetooth() {
+
+ /*var str =
+ "<113>Mate Technologies<100>Website: www.matetech.in\nEmail: matetusshar@gmail.com1#$imgpath"*/
+ var str = "0#100#50#21321375384721#40#testing text"
+ str =
+ "$strThis is left
This is right
"
+ val sendIntent = Intent()
+ sendIntent.action = Intent.ACTION_SEND
+ sendIntent.setPackage("mate.bluetoothprint")
+ sendIntent.putExtra(Intent.EXTRA_TEXT, str)
+ sendIntent.type = "text/plain"
+ startActivity(sendIntent)
}
private fun setRegisterNetwork() {
@@ -616,6 +634,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL
}
getString(R.string.titleItemConsult) -> {
+ println("La sale queda pasada con $entryPoint")
addFragmentOnTop(ItemCardFragment.newInstance(entryPoint))
}
//sergio:no visible desde el menú inicio
@@ -653,21 +672,12 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL
addFragmentOnTop(InventaryFragment.newInstance())
}
- getString(R.string.titleShelvingParking) -> {
- addFragmentOnTop(ShelvingParkingFragment.newInstance())
- }
-
getString(R.string.titleUbicator) -> {
addFragmentOnTop(UbicadorFragment.newInstance(entryPoint))
}
getString(R.string.titleAuto) -> {
- /* if ( (application as MobileApplication).userId== 19591){
- "Testeo rayo".toast(this, Color.RED)*/
addFragmentOnTop(AutomaticAddItemFragmentTEST.newInstance(entryPoint, item.title))
- /* }else{
- addFragmentOnTop(AutomaticAddItemFragment.newInstance(entryPoint, item.title))
- }*/
}
getString(R.string.titleChecker) -> {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/adapter/ExpeditionPalletAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/adapter/ExpeditionPalletAdapter.kt
index 44ed4724..1bc9a676 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/adapter/ExpeditionPalletAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/adapter/ExpeditionPalletAdapter.kt
@@ -51,7 +51,7 @@ class ExpeditionPalletAdapter (
fun bind(item: ItemPalletVO) {
binding.apply {
this.item = item
- if (item.Rutas != "1"){
+ if (item.Rutas != 1){
expeditionPalletRutas.setTextColor(ContextCompat.getColor(context!!, R.color.verdnatura_red))
}else {
expeditionPalletRutas.setTextColor(ContextCompat.getColor(context!!, R.color.verdnatura_white))
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 f0c896ba..9b5f688b 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
@@ -21,7 +21,7 @@ class CmrExpeditionPalletViewModel(val context: Context) : BaseViewModel(context
fun cmrExpeditionPallet_add(vExpeditionPallet: Int, cmrFk: Int) {
silex.cmrExpeditionPallet_add(vExpeditionPallet, cmrFk)
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responsescan.value = ResponseItemVO(
isError = true,
@@ -29,7 +29,7 @@ class CmrExpeditionPalletViewModel(val context: Context) : BaseViewModel(context
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_responsescan.value =
ResponseItemVO(isError = false, response = response.message()!!)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt
index 9b1380b5..b825c64c 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt
@@ -56,7 +56,7 @@ class ExpeditionPalletDetailFragment(
binding.splashProgress.visibility = View.VISIBLE
ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text =
- getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrEmpty()) {
+ itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrEmpty()) {
itemExpeditionTruckVO!!.description
}else{
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt
index de0bf473..cb4faeeb 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt
@@ -116,7 +116,7 @@ class ExpeditionPalletDetailViewModel(var context: Context) : BaseViewModel(cont
vStateCode: String,
) {
- silex.expeditionState_addByPallet(vPalletFk, vStateCode).enqueue(object : SilexCallback(context) {
+ silex.expeditionState_addByPallet(vPalletFk, vStateCode).enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
@@ -125,7 +125,7 @@ class ExpeditionPalletDetailViewModel(var context: Context) : BaseViewModel(cont
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_response.value = ResponseItemVO(isError = false, response = response.message())
}
})
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt
index 1e71a07a..4e2f4bcf 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt
@@ -76,7 +76,7 @@ class ExpeditionPalletFragment(
binding.splashProgress.visibility = View.VISIBLE
ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text =
- getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
+ itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
itemExpeditionTruckVO!!.description
}else{
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt
index 6e114aa6..97468e17 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt
@@ -73,7 +73,7 @@ class ExpeditionScanFragment(
binding.splashProgress.visibility = View.VISIBLE
ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text =
- getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
+ itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
itemExpeditionTruckVO!!.description
} else {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt
index 2b9f57fa..c610c5e3 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt
@@ -42,11 +42,11 @@ class ExpeditionScanSorterFragment(
binding.mainToolbar.toolbarTitle.text = title
}
- private fun expeditionscan(ExpeditionScan: String) {
+ private fun expeditionscan(expeditionScan: String) {
binding.splashProgress.visibility = VISIBLE
- viewModel.expedition_scan(ExpeditionScan)
- itemScaned = ExpeditionScan
+ viewModel.expedition_scan(expeditionScan)
+ itemScaned = expeditionScan
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt
index 85d64edb..7d506bbd 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt
@@ -20,8 +20,8 @@ class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(contex
fun expedition_scan(vExpeditionId: String) {
silex.expedition_scan(vExpeditionId)
- .enqueue(object : Callback {
- override fun onFailure(call: Call, t: Throwable) {
+ .enqueue(object : Callback {
+ override fun onFailure(call: Call, t: Throwable) {
_responsescan.value = ResponseItemVO(
isError = true,
@@ -29,7 +29,7 @@ class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(contex
)
}
- override fun onResponse(call: Call, response: Response) {
+ override fun onResponse(call: Call, response: Response) {
if (!response.isSuccessful) {
_responsescan.value = ResponseItemVO(
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt
index 87460748..bf93c761 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt
@@ -34,7 +34,7 @@ class ExpeditionTruckListFragment : BaseFragment(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseScan.value = ResponseItemVO(
@@ -41,7 +41,7 @@ class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_responseScan.value =
ResponseItemVO(isError = false, response = response.message()!!)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemPalletVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemPalletVO.kt
index acbf4e1c..6085bb65 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemPalletVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemPalletVO.kt
@@ -2,8 +2,8 @@ package es.verdnatura.presentation.view.feature.paletizador.model
class ItemPalletVO(
var Pallet:Int,
- var Rutas:String = "",
- var Eti:String = "",
+ var Rutas:Int =0,
+ var Eti:Int = 0,
var isError: Boolean = false,
var errorMessage: String = ""
@@ -15,9 +15,9 @@ class ItemPalletListVO(
class ItemPalletViewVO(
- var Pallet:String = "",
- var Rutas:String = "",
- var Cajas:String = "",
+ var Pallet:Int = 0,
+ var Rutas:Int = 0,
+ var Cajas:Int = 0,
var isError: Boolean = false,
var errorMessage: String = ""
)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemScanVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemScanVO.kt
index 4e35ac51..20cee657 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemScanVO.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemScanVO.kt
@@ -13,10 +13,10 @@ class ItemScanList(
class ItemExpeditionScanVO(
var id:Int,
- var expeditionFk:String = "",
- var Ruta:String = "",
- var Ticket:String = "",
- var Caja:String = "",
+ var expeditionFk:Int = 0,
+ var Ruta:Int = 0,
+ var Ticket:Int= 0,
+ var Caja:Int = 0,
var isError:Boolean = false,
var errorMessage:String = ""
)
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt
index 86207b47..89fce963 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt
@@ -5,7 +5,6 @@ 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.KeyEvent
import android.view.View
import android.view.View.GONE
@@ -282,16 +281,6 @@ class EndSacadorFragment(
}
})
- /* responseMissingTrash.observe(viewLifecycleOwner, Observer {
-
- if (it.isError) {
- ma.messageWithSound(it.errorMessage, isError = true, true)
-
- } else {
- missingTrashSuccesful()
- setTotalLines()
- }
- })*/
responseSaleGroupAdd.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
@@ -476,82 +465,6 @@ class EndSacadorFragment(
}
-
- private fun missingTrashSuccesful() {
-
- var totalQuantity: Int = 0
- try {
- totalQuantity =
- sales[positionCollectionMissing].saldo.toInt() - quantityCollectionMissing.toInt()
- } catch (e: Exception) {
- }
-
-
- try {
- sales[positionCollectionMissing].saldo = quantityCollectionMissing.toInt()
- } catch (e: Exception) {
- sales[positionCollectionMissing].saldo = 0
- }
-
- if (quantityCollectionMissing == 0)
- markLine(positionCollectionMissing)
-
-
-
-
- saleAdapter!!.notifyDataSetChanged()
-
-
- /* var message = ""
-
- val ticket =
- "[" + sales[positionCollectionMissing].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionMissing].id + "/summary)"
-
- when (typeCollectionMissing) {
-
- "TRUE" -> {
- message =
- getString(R.string.sentToTrashPrevious) + totalQuantity + getString(R.string.fromItem) + sales[positionCollectionMissing].itemFk + getString(
- R.string.ticketSpaces
- ) + ticket
- }
-
-
- "FALSE" -> {
- message =
- getString(R.string.sentToTrashFaults) + totalQuantity + getString(R.string.fromItem) + sales[positionCollectionMissing].itemFk + getString(
- R.string.ticketSpaces
- ) + ticket
-
- }
-
-
- "reject" -> {
- var quantityOriginal = totalQuantity.toInt() + quantityCollectionMissing.toInt()
- message =
- getString(R.string.modifiedQuantityPrevious) + quantityOriginal + getString(R.string.fromItem) + sales[positionCollectionMissing].itemFk + getString(
- R.string.toNewQuantity
- ) + quantityCollectionMissing + getString(R.string.fromTicket) + ticket
-
- }
- }
-
- sendSalixMessageNew(message, sales[positionCollectionMissing].salesPersonFk)*/
- searchSaleCollection()
- }
-
- /* private fun sendSalixMessageNew(message: String, workerId: String) {
-
-
- if (!goBack) {
-
- if (!workerId.isNullOrEmpty())
- viewModel.sendChekingPresence(
- workerId = workerId,
- message = message
- )
- }
- }*/
//CREATE LIST
private fun searchSaleCollection() {
@@ -843,7 +756,7 @@ class EndSacadorFragment(
binding.splashProgress.visibility = VISIBLE
var quantityGet = 0
try {
- quantityGet = (sales[position].saldo - sales[position].picked)
+ quantityGet = (sales[position].saldo!! - sales[position].picked!!)
} catch (e: Exception) {
}
viewModel.itemPlacementSupplyAiming(
@@ -1024,7 +937,7 @@ class EndSacadorFragment(
//2- MODIFICAR EL PICKED DEL SALE
try {
sales[storedPosition].picked =
- sales[storedPosition].picked + customDialogList.getValue().toInt()
+ sales[storedPosition].picked!! + customDialogList.getValue().toInt()
} catch (e: Exception) {
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt
index 4e6880ee..3d6600f7 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt
@@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.presacador.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
+import es.verdnatura.R
import es.verdnatura.domain.SilexCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
@@ -11,7 +12,6 @@ import es.verdnatura.presentation.common.ResponseItemVO
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.login.model.SalixMessageVO
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.sacador.mapper.toDateFormat
import es.verdnatura.presentation.view.feature.sacador.model.CollectionListVO
@@ -223,8 +223,8 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun getIdFromCode(code: String) {
- silex.getIdFromCode(code)
- .enqueue(object : SilexCallback(context) {
+ salix.barcodes_toitem(code)
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseCode.value = ResponseItemVO(
isError = true,
@@ -232,20 +232,18 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
+
//sergio: espera item en el body
if (response.body() == null) {
_responseCode.value = ResponseItemVO(
isError = true,
- errorMessage = getMessageFromAllResponse(
- nameofFunction(this),
- response.message()
- )
+ errorMessage = context.getString(R.string.itemNotValid)
)
} else {
_responseCode.value =
- ResponseItemVO(isError = false, response = response.body()!!)
+ ResponseItemVO(isError = false, response = response.body()!!.toString())
}
}
})
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/adapter/ReubicatorAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/adapter/ReubicatorAdapter.kt
index bbd18d98..88ca38d3 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/adapter/ReubicatorAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/adapter/ReubicatorAdapter.kt
@@ -1,455 +1,80 @@
package es.verdnatura.presentation.view.feature.reubication.adapter
- import android.content.Context
- import android.graphics.BlendMode
- import android.graphics.BlendModeColorFilter
- import android.graphics.Color
- import android.graphics.PorterDuff
- import android.os.Build
- import android.view.LayoutInflater
- import android.view.View
- import android.view.ViewGroup
- import androidx.core.content.ContextCompat.getColor
- import androidx.recyclerview.widget.LinearLayoutManager
- import androidx.recyclerview.widget.RecyclerView
- import es.verdnatura.R
- import es.verdnatura.databinding.ItemArticleRowFragmentBinding
- import es.verdnatura.databinding.ItemArticleRowReubicationFragmentBinding
- import es.verdnatura.presentation.common.*
- import es.verdnatura.presentation.view.feature.collection.adapter.PlacementAdapter
- import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
- import es.verdnatura.presentation.view.feature.reubication.model.PlacementReubication
- import es.verdnatura.presentation.view.feature.reubication.model.Reubication
- import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
+import android.content.Context
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import es.verdnatura.R
+import es.verdnatura.databinding.ItemArticleRowReubicationFragmentBinding
+import es.verdnatura.presentation.common.OnPasillerosItemClickListener
+import es.verdnatura.presentation.common.OnReubicationClickListener
+import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
+import es.verdnatura.presentation.view.feature.reubication.model.Reubication
class ReubicatorAdapter(
- private val items: List,
- private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
- private val onReubicationClickListener: OnReubicationClickListener
- /*private val onQuantityClick: OnQuantityClickListener,
- private val onSaleClickListener: OnSaleClickListener,
- private val onMistakeClickListener: OnMistakeClickListener,
- private val onPackingClick: onPackingClickListener,*/
- ) : RecyclerView.Adapter() {
- var context: Context? = null
- var position: Int = 0
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
- this.context = parent.context
- return AjustesItemHolder(
+ private val items: List,
+ private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
+ private val onReubicationClickListener: OnReubicationClickListener
+) : RecyclerView.Adapter() {
+ var context: Context? = null
+ var position: Int = 0
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
+ this.context = parent.context
+ return AjustesItemHolder(
- ItemArticleRowReubicationFragmentBinding.inflate(
- LayoutInflater.from(parent.context),
- parent,
- false
- )
+ ItemArticleRowReubicationFragmentBinding.inflate(
+ LayoutInflater.from(parent.context),
+ parent,
+ false
)
- }
+ )
+ }
- override fun getItemCount() = items.size
+ override fun getItemCount() = items.size
- override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
- this.position = position
- holder.bind(items[position])
- }
+ override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
+ this.position = position
+ holder.bind(items[position])
+ }
- inner class AjustesItemHolder(
- val binding: ItemArticleRowReubicationFragmentBinding
- ) : RecyclerView.ViewHolder(binding.root) {
- fun bind(reubication: Reubication) {
- binding.apply {
+ inner class AjustesItemHolder(
+ val binding: ItemArticleRowReubicationFragmentBinding
+ ) : RecyclerView.ViewHolder(binding.root) {
+ fun bind(reubication: Reubication) {
+ binding.apply {
- itemArticleItemFk.setOnClickListener {
- onPasillerosItemClickListener.onPasillerosItemClickListener(
- PasillerosItemVO(
- title = binding.root.context.getString(R.string.titleItemConsult)
- ), reubication.itemFk
- )}
- contentLayout.setOnClickListener {
- onReubicationClickListener.onReubicationClick(reubication)
- }
- /* if (sale.pickedQuantity.isNullOrEmpty())
- sale.pickedQuantity = "0"
- */
- val childLayoutManager =
- LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
-
- itemArticlePlacements.apply {
- layoutManager = childLayoutManager
- adapter = reubication.carros.let { ReubicatorPlacementAdapter(it, onPasillerosItemClickListener) }
- }
-
- //CLICK EVENTS
- /*
-
- itemArticleItemFk.setOnClickListener {
- onPasillerosItemClickListener.onPasillerosItemClickListener(
- PasillerosItemVO(
- title = binding.root.context.getString(R.string.titleItemConsult)
- ), sale.itemFk
- )
- }
-
- itemPackingItemFk.setOnClickListener {
- onPackingClick.onPackingClick(sale)
- }
-
- itemArticleQuantity.setOnClickListener {
- onQuantityClick.onQuantityClick(sale)
- }
-
- itemArticleQuantityPicked.setOnClickListener {
- onQuantityClick.onQuantityClick(sale)
- }
-
- txtde.setOnClickListener {
- onQuantityClick.onQuantityClick(sale)
- }*/
-
- contentLayout.setOnLongClickListener {
- //"Nueva funcionalidad en el icono de la derecha".toast(context!!)
- //onMistakeClickListener.onMistakeClickListener(sale)
- false
- }
-
- /*itemRowLayout.setOnLongClickListener{
- onMistakeClickListener.onMistakeClickListener(sale)
- false
- }*/
- /* imageErrorMessage.setOnClickListener {
- onMistakeClickListener.onMistakeClickListener(sale)
- false
- }
-
-
- //ERROR
- if (sale.originalQuantity != sale.quantity) {
- layoutError.visibility = View.VISIBLE
- txtError.text = binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
- if (sale.isPrepared == "1" || sale.isControlled == "1")
- sale.pickedQuantity = sale.quantity
- }
-
- if (sale.isNew) {
- layoutError.visibility = View.VISIBLE
- txtError.text = binding.root.context.getString(R.string.newItem)
-
- }
-
- // paintTicketcolor(sale.level, itemTicketColor)
- // paintTicketcolor(sale.color, itemColor)
-
-
- if (!sale.isNew && sale.originalQuantity == sale.quantity) {
- layoutError.visibility = View.GONE
- }
-*/
-
- //SEMAFORO
- /* if (sale.isPreviousPrepared == "1") {
- itemArticleRowSemaforoPre.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_dark_sky_blue
- )
- )
- } else {
- itemArticleRowSemaforoPre.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_warm_grey
- )
- )
- }
-
- if (sale.isPrepared == "1") {
- itemArticleRowSemaforoSac.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_pumpkin_orange
- )
- )
- } else {
- itemArticleRowSemaforoSac.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_warm_grey
- )
- )
- }
-
-
-
- if (sale.isControlled == "1") {
- itemArticleRowSemaforoCon.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_dark_mint
- )
- )
- } else {
- itemArticleRowSemaforoCon.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_warm_grey
- )
- )
- }
-
-
- if (sale.isControlled == "1") {
- contentLayout.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_dark_mint
- )
- )
- } else if (sale.isPrepared == "1") {
- contentLayout.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_pumpkin_orange
- )
- )
- } *//*else if (sale.isPreviousPrepared == "1") {
- contentLayout.setBackgroundColor(
- getColor(
- context!!,
- R.color.verdnatura_dark_sky_blue
- )
+ itemArticleItemFk.setOnClickListener {
+ onPasillerosItemClickListener.onPasillerosItemClickListener(
+ PasillerosItemVO(
+ title = binding.root.context.getString(R.string.titleItemConsult)
+ ), reubication.itemFk.toString()
)
- }*//* else if (sale.isPreControlled == "1") {
+ }
+ contentLayout.setOnClickListener {
+ onReubicationClickListener.onReubicationClick(reubication)
+ }
+ val childLayoutManager =
+ LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
- contentLayout.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_dark_mint_light_precontrolled
- )
- )
- itemArticleRowSemaforoCon.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_dark_mint_light_precontrolled
- )
- )
- } else if (sale.isPreviousPrepared == "1") {
- contentLayout.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_dark_sky_blue
- )
- )
- } else {
- contentLayout.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_black
- )
+ itemArticlePlacements.apply {
+ layoutManager = childLayoutManager
+ adapter = reubication.carros.let {
+ ReubicatorPlacementAdapter(
+ it,
+ onPasillerosItemClickListener
)
}
-
-
- //sergio: para de momento que pinten las lineas sin actualizar ni nada
- if (sale.isControlled == "2") {
- itemArticleRowSemaforoCon.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_white
- )
- )
- contentLayout.setBackgroundColor(
- ContextCompat.getColor(
- context!!,
- R.color.verdnatura_dark_mint_light
- )
- )
- }*/
-
-
- //ASIGNAMOS VALOR A LA VSITA
- this.reubication = reubication
-
}
+
+
+ //ASIGNAMOS VALOR A LA VSITA
+ this.reubication = reubication
+
}
}
+ }
- /* private fun paintTicketcolor(color: String, itemView: View) {
-
-
- when (color.uppercase().trim()) {
- "ROJO" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(Color.RED, BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP)
- }
- // itemView.background.setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP)
-
- "AMARILLO" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(Color.YELLOW, BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(Color.YELLOW, PorterDuff.Mode.SRC_ATOP)
- }
- "VERDE" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(Color.GREEN, BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(Color.GREEN, PorterDuff.Mode.SRC_ATOP)
- }
- "AZUL" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(Color.BLUE, BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_ATOP)
- }
- "BLANCO" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(Color.WHITE, BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP)
- }
- // "NEGRO"-> itemView.setBackgroundResource((R.drawable.rectangle))
-
- "NEGRO" -> {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(Color.BLACK, BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(Color.BLACK, PorterDuff.Mode.SRC_ATOP)
- }
-
- itemView.setBackgroundResource((R.drawable.border))
- }
- "VIOLETA" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFF4c2882.toInt(), BlendMode.SRC_ATOP)
- // BlendModeColorFilter(Color.YELLOW, BlendMode.SRC_ATOP)
- //Log.d("VERDNATURA::", "EL COLOR ES " + color)
- } else {
- itemView.background.setColorFilter(0xFF4c2882.toInt(), PorterDuff.Mode.SRC_ATOP)
- }
-
- "GRIS" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(Color.GRAY, BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(Color.GRAY, PorterDuff.Mode.SRC_ATOP)
- }
- "ORANGE" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(
- ContextCompat.getColor(
- context!!,
- android.R.color.holo_orange_light
- ), BlendMode.SRC_ATOP
- )
- } else {
- itemView.background.setColorFilter(
- ContextCompat.getColor(
- context!!,
- android.R.color.holo_orange_light
- ), PorterDuff.Mode.SRC_ATOP
- )
- }
-
- "MORADO" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(
- ContextCompat.getColor(
- context!!,
- android.R.color.holo_purple
- ), BlendMode.SRC_ATOP
- )
- } else {
- itemView.background.setColorFilter(
- ContextCompat.getColor(
- context!!,
- android.R.color.holo_purple
- ), PorterDuff.Mode.SRC_ATOP
- )
- }
-
- "CELESTE" ->if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFF5b85F5.toInt(), BlendMode.SRC_ATOP)
- }
-
-
- "ROSA" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFFfc0fc0.toInt(), BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(
- 0xFFfc0fc0.toInt(),
- PorterDuff.Mode.SRC_ATOP
- )
- }
-
- "DORADO" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFFb8860b.toInt(), BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(
- 0xFFb8860b.toInt(),
- PorterDuff.Mode.SRC_ATOP
- )
- }
- "MARRON" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFF663300.toInt(), BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(
- 0xFF663300.toInt(),
- PorterDuff.Mode.SRC_ATOP
- )
- }
- "PERLA" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFFcdcecf.toInt(), BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(
- 0xFFcdcecf.toInt(),
- PorterDuff.Mode.SRC_ATOP
- )
- }
- "MARFIL" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFFf7eada.toInt(), BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(
- 0xFFf7eada.toInt(),
- PorterDuff.Mode.SRC_ATOP
- )
- }
- "CIAN" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFF00ffff.toInt(), BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(
- 0xFF00ffff.toInt(),
- PorterDuff.Mode.SRC_ATOP
- )
- }
- "BEIGE" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- itemView.background.colorFilter =
- BlendModeColorFilter(0xFFf2e7bf.toInt(), BlendMode.SRC_ATOP)
- } else {
- itemView.background.setColorFilter(
- 0xFFf2e7bf.toInt(),
- PorterDuff.Mode.SRC_ATOP
- )
- }
-
- else -> {
- // itemView.setBackgroundColor(Color.TRANSPARENT)
- //itemView.setBackgroundResource(R.drawable.background_item_color)
- // itemView.visibility=View.INVISIBLE
- }
- }
- // itemTicketColor.setBackgroundResource((R.drawable.rectangle))
-
-
- }*/
- }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/fragment/ReubicationCollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/fragment/ReubicationCollectionFragment.kt
index e902a8ac..029048b0 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/fragment/ReubicationCollectionFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/fragment/ReubicationCollectionFragment.kt
@@ -18,8 +18,6 @@ import es.verdnatura.presentation.view.feature.reubication.adapter.ReubicatorAda
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
-
-//Tarea #3754
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ReubicationCollectionFragment(
var list: MutableList,
@@ -53,45 +51,34 @@ class ReubicationCollectionFragment(
@SuppressLint("SetTextI18n")
override fun init() {
- // customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
customDialogInputTwoValues = CustomDialogInputTwoValues(requireContext())
ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = GONE
binding.mainToolbar.toolbarTitle.text =
"${getString(R.string.wagoon)}:${shelving.uppercase()}"
setEvents()
-
- showList(list.sortedBy { it.pickingOrder } as MutableList)
+ showList(list)
super.init()
}
-
- private fun showList(list: MutableList) {
-
- //sergio:ponemos paréntesis y la matrícula
- //sergio: mirar de ordenar no solo por el picking order de un elemento si no de todos*/
+ private fun showList(list: List) {
for (item in list) {
item.code = shelving.uppercase()
for (i in item.carros) {
i.visible = "(" + i.visible + ")"
}
- if (item.carros.size == 0) {
- item.pickingOrder = 0
- } else {
- item.pickingOrder = item.carros[0].pickingOrder
- }
+
}
- adapter = ReubicatorAdapter(list.sortedBy { it.pickingOrder },
+ adapter = ReubicatorAdapter(list.sortedWith(compareBy { item ->
+ item.carros.getOrNull(0)?.pickingOrder ?: 0
+ }),
pasillerosItemClickListener!!,
object :
OnReubicationClickListener {
override fun onReubicationClick(reubication: Reubication) {
- //binding.splashProgress.visibility = VISIBLE
showLeaveItemDialog(reubication)
-
-
}
})
@@ -174,7 +161,7 @@ class ReubicationCollectionFragment(
customDialogInputTwoValues.setInfoTextTwo(getString(R.string.shelving))
customDialogInputTwoValues.setDescription(messageDescrip)
- .setValue(itemReubication.quantity)
+ .setValue(itemReubication.quantity.toString())
.setOkButton(getString(R.string.leaveItem)) {
@@ -289,7 +276,7 @@ class ReubicationCollectionFragment(
viewModel.itemShelving_return(
shelvingFk = shelving,
- )
+ )
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/adapter/ShelvingParkingAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/adapter/ShelvingParkingAdapter.kt
deleted file mode 100644
index f9eee3b9..00000000
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/adapter/ShelvingParkingAdapter.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package es.verdnatura.presentation.view.feature.shelvingparking.adapter
-
-import android.view.LayoutInflater
-import android.view.ViewGroup
-import androidx.recyclerview.widget.RecyclerView
-import es.verdnatura.databinding.ItemShelvingparkingRowBinding
-import es.verdnatura.presentation.view.feature.shelvingparking.model.ItemShelvingParkingVO
-
-class ShelvingParkingAdapter (
- private val items: List
-): RecyclerView.Adapter () {
-
-
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
- return ItemHolder(
- ItemShelvingparkingRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
- )
- }
-
- override fun getItemCount() =items.size
-
- override fun onBindViewHolder(holder: ItemHolder, position: Int) {
- holder.bind(items[position])
- }
-
- inner class ItemHolder(
- val binding: ItemShelvingparkingRowBinding
- ) : RecyclerView.ViewHolder(binding.root){
- private val res = binding.root.context.resources
- fun bind(item: ItemShelvingParkingVO) {
- binding.apply {
- this.item = item
-
- }
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingFragment.kt
deleted file mode 100644
index 1e6d7e25..00000000
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingFragment.kt
+++ /dev/null
@@ -1,104 +0,0 @@
-package es.verdnatura.presentation.view.feature.shelvingparking.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.FragmentShelvingParkingBinding
-import es.verdnatura.domain.notNull
-import es.verdnatura.presentation.base.BaseFragment
-import es.verdnatura.presentation.view.feature.shelvingparking.adapter.ShelvingParkingAdapter
-
-
-@Suppress("UNUSED_ANONYMOUS_PARAMETER")
-class ShelvingParkingFragment :
- BaseFragment(
- ShelvingParkingViewModel::class
- ) {
-
-
- private var adapter: ShelvingParkingAdapter? = null
-
- companion object {
- fun newInstance() = ShelvingParkingFragment()
- }
-
- override fun getLayoutId(): Int = R.layout.fragment_shelving_parking
-
-
- override fun init() {
-
- ma.hideBottomNavigation(View.GONE)
-
- binding.mainToolbar.toolbarTitle.text = getString(R.string.shelvingParking_get)
- setEvents()
- super.init()
- }
-
-
- private fun setEvents() {
- binding.mainToolbar.backButton.setOnClickListener {
- requireActivity().onBackPressed()
- }
-
- binding.shelvingText.requestFocus()
- binding.shelvingText.setOnEditorActionListener { v, actionId, event ->
- if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
- if (!binding.shelvingText.text.toString().isNullOrEmpty()) {
- binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
- binding.splashProgress.visibility = View.VISIBLE
- viewModel.shelvingParking_get(
- binding.shelvingText.text.toString(),
- getData(WAREHOUSEFK),
- binding.dayrange.text.toString()
- )
- }
-
- binding.shelvingText.setText("")
- ma.hideKeyboard(binding.shelvingText)
- return@setOnEditorActionListener true
- }
-
- return@setOnEditorActionListener false
- }
-
- binding.dayrange.setOnEditorActionListener { v, actionId, event ->
- if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
- if (!binding.shelvingText.text.toString().isNullOrEmpty())
- binding.splashProgress.visibility = View.VISIBLE
- else
- binding.shelvingText.requestFocus()
-
- binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
- viewModel.shelvingParking_get(
- binding.shelvingText.text.toString(),
- getData(WAREHOUSEFK),
- binding.dayrange.text.toString()
- )
- binding.shelvingText.setText("")
- ma.hideKeyboard(binding.dayrange)
- return@setOnEditorActionListener true
- }
-
- return@setOnEditorActionListener false
- }
- }
-
- override fun observeViewModel() {
- with(viewModel) {
- loadShelvingList.observe(viewLifecycleOwner, Observer { event ->
- event.getContentIfNotHandled().notNull {
- binding.splashProgress.visibility = View.GONE
- adapter = ShelvingParkingAdapter(it.list)
- binding.locationRecyclerview.adapter = adapter
- binding.locationRecyclerview.layoutManager =
- LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
-
- }
- })
- }
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingViewModel.kt
deleted file mode 100644
index 5c4cc901..00000000
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingViewModel.kt
+++ /dev/null
@@ -1,63 +0,0 @@
-package es.verdnatura.presentation.view.feature.shelvingparking.fragment
-
-import android.content.Context
-import androidx.lifecycle.LiveData
-import androidx.lifecycle.MutableLiveData
-import androidx.lifecycle.Transformations
-import es.verdnatura.domain.SilexCallback
-import es.verdnatura.presentation.base.BaseViewModel
-import es.verdnatura.presentation.base.getMessageFromAllResponse
-import es.verdnatura.presentation.base.nameofFunction
-import es.verdnatura.presentation.common.Event
-import es.verdnatura.presentation.view.feature.shelvingparking.model.ItemShelvingParkingListVO
-import es.verdnatura.presentation.view.feature.shelvingparking.model.ItemShelvingParkingVO
-import retrofit2.Response
-
-class ShelvingParkingViewModel(val context: Context) : BaseViewModel(context) {
-
- private val _shelvingList by lazy { MutableLiveData() }
- val shelvingList: LiveData
- get() = _shelvingList
-
-
- val loadShelvingList = Transformations.map(_shelvingList) { Event(it) }
-
-
- fun shelvingParking_get(vShelvingFk: String, vWarehouseFk: String, vDayRange: String) {
- silex.shelvingParking_get(vShelvingFk.uppercase(), vWarehouseFk, vDayRange).enqueue(object :
- SilexCallback>(context) {
- override fun onError(t: Throwable) {
- val listError: ArrayList = ArrayList()
- listError.add(
- ItemShelvingParkingVO(
- isError = true,
- errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
- )
- )
- _shelvingList.value = ItemShelvingParkingListVO(listError)
- }
-
- override fun onSuccess(response: Response>) {
-
- if (response.body() != null) {
- _shelvingList.value = response.body()?.let { ItemShelvingParkingListVO(it) }
- } else {
- val listError: ArrayList = ArrayList()
- listError.add(
- ItemShelvingParkingVO(
- isError = true,
- errorMessage = getMessageFromAllResponse(
- nameofFunction(this),
- response.message()
- )
- )
- )
- _shelvingList.value = ItemShelvingParkingListVO(listError)
- }
- }
-
- })
- }
-
-
-}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/model/ItemShelvingParkingVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/model/ItemShelvingParkingVO.kt
deleted file mode 100644
index d80bdc44..00000000
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/model/ItemShelvingParkingVO.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package es.verdnatura.presentation.view.feature.shelvingparking.model
-
-class ItemShelvingParkingVO (
- var itemFk:String = "0",
- var concept:String = "",
- var sinServir:String = "0",
- var aparcado:String = "0",
- var isError:Boolean = false,
- var errorMessage:String = ""
-)
-
-class ItemShelvingParkingListVO(
- var list:List = listOf()
-)
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ticket/fragment/TicketViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ticket/fragment/TicketViewModel.kt
index fa3ff847..38860ed9 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ticket/fragment/TicketViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ticket/fragment/TicketViewModel.kt
@@ -26,7 +26,7 @@ class TicketViewModel(val context: Context) : BaseViewModel(context) {
) {
salix.ticket_advancePackaging(packingSiteSalix(ticketFk, workerFk))
- .enqueue(object : SilexCallback(context) {
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
@@ -35,7 +35,7 @@ class TicketViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
}
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 4148b358..b6261886 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
@@ -29,6 +29,7 @@ import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
import java.lang.Boolean.TRUE
+import kotlin.math.roundToInt
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
@@ -634,29 +635,14 @@ class UbicadorFragment(
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
if (it.isError) {
- ma.messageWithSound(it.errorMessage, it.isError, false)
+ ma.messageWithSound(it.errorMessage, it.isError, true)
} else {
- if (it.response != "0") {
- checkUbications(it.response.toInt())
- } else {
- ma.messageWithSound(getString(R.string.labelNovalid), true, true)
- }
+ checkUbications(it.response.toDouble().roundToInt())
}
}
}
- /* responseCode.observe(viewLifecycleOwner, Observer {
- binding.splashProgress.visibility = GONE
- if (it.isError) {
- ma.messageWithSound(it.errorMessage, true, true)
- } else {
- if (it.response!="0") {checkUbications(it.response.toInt())}else{
- ma.messageWithSound(getString(R.string.labelNovalid), true, true)
- }
- }
-
- })*/
responsepriority.observe(viewLifecycleOwner, Observer {
if (!isBack) {
binding.splashProgress.visibility = GONE
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 09587383..becbbb9c 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 androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.google.gson.JsonObject
+import es.verdnatura.R
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.presentation.base.BaseViewModel
@@ -461,8 +462,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun getIdFromCode(code: String) {
- silex.getIdFromCode(code)
- .enqueue(object : SilexCallback(context) {
+ salix.barcodes_toitem(code)
+ .enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseCode.value = ResponseItemVO(
isError = true,
@@ -470,14 +471,13 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
)
}
- override fun onSuccess(response: Response) {
+ override fun onSuccess(response: Response) {
+
+
if (response.body() == null) {
_responseCode.value = ResponseItemVO(
isError = true,
- errorMessage = getMessageFromAllResponse(
- nameofFunction(this),
- response.message()
- )
+ errorMessage = context.getString(R.string.itemNotValid)
)
} else {
_responseCode.value =
diff --git a/app/src/main/res/layout/item_article_row_reubication_fragment.xml b/app/src/main/res/layout/item_article_row_reubication_fragment.xml
index d26967f3..73ebc9e8 100644
--- a/app/src/main/res/layout/item_article_row_reubication_fragment.xml
+++ b/app/src/main/res/layout/item_article_row_reubication_fragment.xml
@@ -11,9 +11,6 @@
type="es.verdnatura.presentation.view.feature.reubication.model.Reubication" />
-
-
-
-
-
-
-
-
-
-
@@ -153,39 +97,6 @@
android:background="@color/verdnatura_background_item_picker"
android:paddingTop="@dimen/layout_margin_min"
android:paddingBottom="@dimen/layout_margin_min">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/item_expedition_view_row.xml b/app/src/main/res/layout/item_expedition_view_row.xml
index 003e82e9..880eb2a9 100644
--- a/app/src/main/res/layout/item_expedition_view_row.xml
+++ b/app/src/main/res/layout/item_expedition_view_row.xml
@@ -26,7 +26,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index b2d1c273..364c17df 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -665,6 +665,8 @@
Envía la hoja de ruta al conductor
Abre la pantalla para escanear ruta
Permite escanear expediciones del consignatario seleccionado
+ La etiqueta escaenada no es válida
+ Matrícula ya revisada
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 9005aa21..7f945485 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -665,5 +665,7 @@
Envoyez la feuille de route au conducteur
Ouvre l\'écran pour scanner l\'itinéraire
Permet de scanner les expéditions du consignataire sélectionné
+ La etiqueta escaenada no es válida
+ Matrícula ya revisada
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 32922710..39991ce7 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -665,5 +665,7 @@
Envie o itinerário para o motorista
Abra a tela para escanear a rota
Permite escanear expedições do consignatário selecionado
+ La etiqueta escaenada no es válida
+ Matrícula ya revisada
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 13d5624f..d5bde082 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -664,5 +664,7 @@
Send the roadmap to the driver
Open the screen to scan the route
Allows scanning shipments of the selected consignee
+ La etiqueta escaenada no es válida
+ Matrícula ya revisada