From 705efcf1d3a9ee4781691a10adcdbf7655092890 Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Thu, 20 Apr 2023 07:16:02 +0200 Subject: [PATCH] refs varios --- app/build.gradle | 2 +- .../feature/collection/adapter/SaleAdapter.kt | 5 +++ .../fragment/CollectionFragmentPreChecker.kt | 31 +++++++++++++++---- .../presacador/fragment/EndSacadorFragment.kt | 2 ++ .../feature/sacador/model/TicketItemVO.kt | 3 +- .../ubicador/fragment/UbicadorFragment.kt | 11 ++++--- .../feature/ubicador/model/ItemUbicadorVO.kt | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values/strings.xml | 3 +- 9 files changed, 46 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4949b13b..f3df6ab8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,7 +14,7 @@ android { minSdkVersion 24 //21 targetSdkVersion 33 versionCode 177 - versionName = "23.14Beta" + versionName = "23.14" //versionName = "23.10" versionCode 174 //versionName = "23.10.2Beta" versionCode 174 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt index 3547f5cc..3ec8a595 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt @@ -13,6 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import es.verdnatura.R import es.verdnatura.databinding.ItemArticleRowFragmentBinding +import es.verdnatura.domain.ConstAndValues.SACADOR import es.verdnatura.presentation.common.* import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.sacador.model.SaleVO @@ -352,7 +353,11 @@ class SaleAdapter( txtdeNew.visibility = View.VISIBLE itemArticleQuantityPicked.visibility = View.VISIBLE itemArticleQuantityLine3.visibility = View.VISIBLE + if (type!=SACADOR){ imageErrorMessage.visibility = View.VISIBLE + }else{ + imageErrorMessage.visibility = View.INVISIBLE + } ivArrow.visibility = View.INVISIBLE } 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 68a1e804..c9d7f47a 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 @@ -395,11 +395,22 @@ class CollectionFragmentPreChecker( } "buy" -> binding.scanInput.setText(myQr.more) "parking" -> { - tickets.forEach { - viewModel.parking( - ticketFk = it, - parking = binding.scanInput.text.toString() - ) + + if (type == PRECHECKER) { + collection.tickets.forEach { + var saleGroup = "" + it.sales.forEach { at -> + if (at.saleGroupFk != saleGroup) { + viewModel.parking( + ticketFk = at.saleGroupFk, + parking = myQr.more + ) + saleGroup = at.saleGroupFk + } + + + } + } } } @@ -1165,8 +1176,15 @@ class CollectionFragmentPreChecker( if (type == CONTROLADOR || type == PRECHECKER) {// sergio:cuidado , esta es de lo último para marcar colores isScanned = false - markLine(index, type) + // markLine(index, type) /// Log.i("VERDNATURA:","marcamos linea") + d("VERDNA:TURA:","storedPosition $storedPosition : backPosition:$storedBackPosition") + lm!!.scrollToPositionWithOffset(30, 0) + d("VERDNA:TURA:","Primer elemento visible ${lm!!.findFirstVisibleItemPosition()}") + d("VERDNA:TURA:","Last elemento visible ${lm!!.findLastVisibleItemPosition()}") + + + } else if (type == SACADOR) { if (sale.isPrepared == "0" || sale.isPrepared.isNullOrEmpty()) { @@ -1255,6 +1273,7 @@ class CollectionFragmentPreChecker( binding.fragmentSacadorCollections.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { + d("VERDNA:TURA:","onScrollListener ${lm!!.findFirstVisibleItemPosition()}") storedBackPosition = lm.findFirstVisibleItemPosition() super.onScrolled(recyclerView, dx, dy) } 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 d6b68a10..8f3cc254 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 @@ -167,6 +167,8 @@ class EndSacadorFragment( //LISTA ========= binding.collectionSwipe.setOnRefreshListener { + sales.clear() + saleAdapter!!.notifyDataSetChanged() searchSaleCollection() binding.collectionSwipe.isRefreshing = false } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt index d96747bc..1268feb1 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt @@ -72,7 +72,8 @@ class SaleVO( var isParent: Boolean = false, var totalSales: Int = 0, var sonSales: MutableList = mutableListOf(), - var code: String = "" + var code: String = "", + var hasMistake :Boolean = false ) 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 c55cd8a8..068fe018 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 @@ -645,16 +645,19 @@ class UbicadorFragment( customDialogInput.setInputText() customDialogInput.setTitle(getString(R.string.selfConsumption)) - customDialogInput.setDescription(getString(R.string.Indicanuevacantidad)) + customDialogInput.setDescription(getString(R.string.quantityTake)) .setValue("") - .setOkButton(getString(R.string.modify)) { + .setOkButton(getString(R.string.take)) { try { - if (customDialogInput.getValue().toInt() >= 0) { + if (customDialogInput.getValue().toInt() > 0) { binding.splashProgress.visibility = VISIBLE + var quantity = if (item.visible.toInt()-customDialogInput.getValue().toInt()>0){ + item.visible.toInt()-customDialogInput.getValue().toInt() + }else{ 0 } viewModel.itemShelving_selfConsumption( shelvingFk, item.item, - customDialogInput.getValue().toInt() + quantity ) } else { throw Exception("") diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt index 2206db84..375fb5e7 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt @@ -7,6 +7,7 @@ class ItemUbicadorVO( var stickers: String = "", var packing: String = "", var grouping: String = "", + //Tarea 4904 refactor itemShelving_get, quitar col y row var col: String = "", var row: String = "", var code: String = "", diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 7e688edf..5ebf31a9 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -555,5 +555,6 @@ Número serie El número de carros ahora solo se puede modificar por los encargados Va a modificar el número de serie asociado a su dispositivo. + Indica la cantidad que coges diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1ef9a293..875bf8c5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -80,7 +80,8 @@ Ticket Item Indicate the new quantity and the action you want to take with the rest. Garbage - Indicates new quantity + Indicate new quantity + Indicate the quantity you take Indicates previous number for printing Complete collection Parking