feat crashlytics refs #6810

This commit is contained in:
Sergio De la torre 2024-06-26 12:35:04 +02:00
parent a5d11b1613
commit eb787e04cc
12 changed files with 108 additions and 46 deletions

View File

@ -20,7 +20,7 @@ data class SaleTrackingSalix(
var code: String,
var isChecked: Boolean,
var buyFk: Long,
var isScanned: Boolean,
var isScanned: Boolean?,
var quantity: Int,
var itemShelvingFk: Int

View File

@ -2147,10 +2147,15 @@ class CollectionFragment(
try {
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
.setValue("").setOkButtonAdd(getString(R.string.Agregar)) {
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
scanRequest()
customDialogThreeButtons.dismiss()
.setValue("").setOkButtonAdd(getString(R.string.modify)) {
try {
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
scanRequest()
customDialogThreeButtons.dismiss()
}catch (ex:Exception){
ma.messageWithSound(message = getString(R.string.errorInputQuantity), isPlayed = true, isError = true, isToasted = true)
}
}.setKoButton(getString(R.string.cancel)) {
scanRequest()

View File

@ -36,6 +36,7 @@ import es.verdnatura.domain.ConstAndValues.SACADOR
import es.verdnatura.domain.ConstAndValues.SECTORDESCRIP
import es.verdnatura.domain.ConstAndValues.SECTORFK
import es.verdnatura.domain.notNull
import es.verdnatura.domain.toLong
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.ItemScanned
@ -417,11 +418,16 @@ class CollectionFragmentPreChecker(
} else {
storedBackPosition = 0
storedPosition = 0
viewModel.getSales(
binding.scanInput.text.toString().toInt(),
print = "0",
source = type
)
try {
viewModel.getSales(
binding.scanInput.toLong(),
print = "0",
source = type
)
}catch (ex:Exception){
ma.messageWithSound(message = getString(R.string.errorInput), isError = true, isPlayed = true, isToasted = true)
}
// findSale(binding.scanInput.text.toString())
}

View File

@ -206,7 +206,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
get() = _responseSaleAddPrevOK
fun getSales(
collectionFk: Int, print: String, source: String
collectionFk: Number, print: String, source: String
) {
salix.getSalesFromTicketOrCollection(

View File

@ -210,11 +210,13 @@ class RoutesFragment(
}
private fun filteredList(searchText: String) {
if (::myListRoute.isInitialized) {
val filteredList = myListRoute.filter { route ->
route.toString().lowercase().contains(searchText)
}.toMutableList()
adapter!!.updateList(filteredList)
}
val filteredList = myListRoute.filter { route ->
route.toString().lowercase().contains(searchText)
}.toMutableList()
adapter!!.updateList(filteredList)
}
override fun observeViewModel() {

View File

@ -7,6 +7,7 @@ import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Bundle
import android.view.View
import android.widget.ImageView
import android.widget.TextView
@ -50,11 +51,11 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.Calendar
class TicketsFragment(
var title: String = "", var route: RouteInfo,
) : BaseFragment<FragmentTicketsBinding, DeliveryViewModel>(
class TicketsFragment : BaseFragment<FragmentTicketsBinding, DeliveryViewModel>(
DeliveryViewModel::class
) {
private var title: String? = null
private lateinit var route: RouteInfo
private var adapter: TicketAdapter? = null
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
@ -67,13 +68,31 @@ class TicketsFragment(
private var firstVisibleItemPosition = -1
companion object {
fun newInstance(title: String, entryPoint: String) =
TicketsFragment(title, Gson().fromJson(entryPoint, RouteInfo::class.java))
//Tarea 6810 revisar fallos app
private const val ARG_TITLE = "title"
private const val ARG_ROUTE = "route"
private const val REQUEST_CALL_PERMISSION = 1
}
fun newInstance(title: String, entryPoint: String) =
TicketsFragment().apply {
arguments = Bundle().apply {
putString(ARG_TITLE, title)
putString(ARG_ROUTE, entryPoint)
}
}
/* fun newInstance(title: String, entryPoint: String) =
TicketsFragment(title, Gson().fromJson(entryPoint, RouteInfo::class.java))*/
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
title = it.getString(ARG_TITLE)
route = Gson().fromJson(it.getString(ARG_ROUTE), RouteInfo::class.java)
}
}
override fun getLayoutId(): Int = R.layout.fragment_tickets
override fun init() {

View File

@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.ubicador.fragment
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.text.InputType
import android.text.TextWatcher
import android.view.View
@ -15,6 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentUbicadorBinding
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
import es.verdnatura.domain.isShelving
import es.verdnatura.domain.notNull
import es.verdnatura.domain.toInt
import es.verdnatura.domain.toast
@ -33,14 +35,14 @@ import es.verdnatura.presentation.view.component.CustomDialogUbicadorNew
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapterNew
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
import java.lang.Boolean.TRUE
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class UbicadorFragmentNew(
var shelvingFk: String = "", var isAutoSelf: Boolean
) : BaseFragment<FragmentUbicadorBinding, UbicadorViewModel>(
class UbicadorFragmentNew: BaseFragment<FragmentUbicadorBinding, UbicadorViewModel>(
UbicadorViewModel::class
) {
private var shelvingFk: String = ""
private var isAutoSelf: Boolean = false
private var adapter: UbicadorAdapterNew? = null
private lateinit var customDialogInput: CustomDialogInput
@ -58,12 +60,30 @@ class UbicadorFragmentNew(
private var isBack = false
var listIcons: ArrayList<ImageView> = ArrayList()
private lateinit var textWatcher: TextWatcher
private var buyScanned :String = ""
private var buyScanned: String = ""
companion object {
fun newInstance(entryPoint: String, autoSelf: Boolean = false) =
UbicadorFragmentNew(entryPoint, autoSelf)
private const val ARG_SHELVINGFK = "shelvingFk"
private const val ARG_ISAUTOSELF = "autoSelf"
fun newInstance(shelvingFk: String, isAutoSelf: Boolean = false) =
UbicadorFragmentNew().apply {
arguments = Bundle().apply {
putString(ARG_SHELVINGFK, shelvingFk)
putBoolean(ARG_ISAUTOSELF, isAutoSelf)
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
shelvingFk = it.getString(ARG_SHELVINGFK).toString()
isAutoSelf = it.getBoolean(ARG_ISAUTOSELF)
}
}
/*fun newInstance(entryPoint: String, autoSelf: Boolean = false) =
UbicadorFragmentNew(entryPoint, autoSelf)
}*/
override fun getLayoutId(): Int = R.layout.fragment_ubicador
override fun onPause() {
@ -236,7 +256,10 @@ class UbicadorFragmentNew(
if (binding.editMatricula.text.toString().isNotEmpty()) {
setIconsActions(true)
setIcons()
if (!modeCheckUbication || (modeCheckUbication && binding.editMatricula.text.toString().length == 3 && !binding.editMatricula.text!![0].isDigit())) {
if (!modeCheckUbication || (modeCheckUbication
&& (binding.editMatricula.text.toString().isShelving())
&& !binding.editMatricula.text!![0].isDigit())
) {
binding.mainToolbar.toolbarTitle.text =
binding.editMatricula.text.toString()
shelvingFk = binding.editMatricula.text.toString()
@ -425,7 +448,11 @@ class UbicadorFragmentNew(
val listInt: ArrayList<Long> = ArrayList()
if (listItems.none { it.item == itemScanned }) {
listInt.add(buyScanned.toLong())
try {
listInt.add(buyScanned.toLong())
} catch (_: Exception) {
}
} else {
listItems.sortedBy { it.isChecked }.forEachIndexed { index, item ->
if (item.item == itemScanned) {
@ -442,12 +469,14 @@ class UbicadorFragmentNew(
}
}
viewModel.itemShelvingAddList(
shelvingFk,
"" + listInt + "",
TRUE,
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
)
if (listInt.isNotEmpty()) {
viewModel.itemShelvingAddList(
shelvingFk,
"" + listInt + "",
true,
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
)
}
adapter!!.notifyDataSetChanged()
}
@ -514,7 +543,8 @@ class UbicadorFragmentNew(
}
loadResponseCode.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
if (it != 0) checkUbications((it as Long))
//not always is true
if (it!=null)checkUbications((it as Long))
}
}

View File

@ -61,11 +61,11 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
val loadReubicationList: LiveData<Event<ReubicationList>> = _reubicationList.map { Event(it) }
private val _responseCode by lazy { MutableLiveData<Any>() }
val responseCode: LiveData<Any>
private val _responseCode by lazy { MutableLiveData<Any?>() }
val responseCode: LiveData<Any?>
get() = _responseCode
val loadResponseCode: LiveData<Event<Any>> = _responseCode.map { Event(it) }
val loadResponseCode: LiveData<Event<Any?>> = _responseCode.map { Event(it) }
private val _responseAddList by lazy { MutableLiveData<ResponseItemVO>() }
val responseAddList: LiveData<ResponseItemVO> = _responseAddList
@ -405,11 +405,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
override fun onSuccess(response: Response<String?>) {
_responseCode.value = if (response.body() == null) {
0
} else {
response.body().toString().toLong()
}
_responseCode.value = response.body()
}
})

View File

@ -833,5 +833,6 @@
<string name="scanParkingTxt">Escanea parking</string>
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
<string name="errorInputQuantity">Error al introducir cantidad</string>
</resources>

View File

@ -833,5 +833,6 @@
<string name="scanParkingTxt">Escanea parking</string>
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
<string name="errorInputQuantity">Error al introducir cantidad</string>
</resources>

View File

@ -833,5 +833,6 @@
<string name="scanParkingTxt">Escanea parking</string>
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
<string name="errorInputQuantity">Error al introducir cantidad</string>
</resources>

View File

@ -835,5 +835,6 @@
<string name="scanParkingTxt">Escanea parking</string>
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
<string name="errorInputQuantity">Error al introducir cantidad</string>
</resources>