refs #6810 feat:crashlytics

This commit is contained in:
Sergio De la torre 2024-03-22 13:01:58 +01:00
parent f5fda9ae7e
commit 4ce7dc9a01
1 changed files with 631 additions and 676 deletions

View File

@ -24,7 +24,15 @@ import es.verdnatura.domain.notNull
import es.verdnatura.domain.toInt import es.verdnatura.domain.toInt
import es.verdnatura.domain.toast import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.OnBarcodeRowClickListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.OnQuantityClickListener
import es.verdnatura.presentation.common.OnSaleClickListener
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.common.addViewObserver
import es.verdnatura.presentation.common.hideKeyboard
import es.verdnatura.presentation.common.itemScanValue
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.component.CustomDialogList import es.verdnatura.presentation.view.component.CustomDialogList
@ -67,7 +75,6 @@ class EndSacadorFragment(
private lateinit var customDialogInputParking: CustomDialogInput private lateinit var customDialogInputParking: CustomDialogInput
private lateinit var customDialogInput: CustomDialogInput private lateinit var customDialogInput: CustomDialogInput
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
private var ticketFk = ""
private var originalScanned = "" private var originalScanned = ""
private var positionUnmarked = -1 private var positionUnmarked = -1
@ -145,8 +152,13 @@ class EndSacadorFragment(
// miramos si el primer digito es un numero de esta manera sabemos que no es una matrícula que sería el findsale // miramos si el primer digito es un numero de esta manera sabemos que no es una matrícula que sería el findsale
if (binding.scanInput.text.first().isDigit()) { if (binding.scanInput.text.first().isDigit()) {
//es ticket //es ticket
ticketFk = binding.scanInput.text.toString() ticket = binding.scanInput.toInt()
searchTicket(binding.scanInput.toInt()) try {
searchTicket(ticket)
} catch (ex: Exception) {
getString(R.string.errorInputTicketParking).toast(requireContext())
}
} else { } else {
//es sale //es sale
findSale(binding.scanInput.text.toString()) findSale(binding.scanInput.text.toString())
@ -281,27 +293,6 @@ class EndSacadorFragment(
} }
/* responseSaleGroupAdd.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) {
if (it.isError) {
ma.messageWithSound(
getString(R.string.errorTicketAdd) + it.errorMessage,
isError = true,
true,
isToasted = true
)
} else {
viewModel.sectorCollection_getSale(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK)
)
}
}
})*/
responseSaleAddPrevOK.observe(viewLifecycleOwner, Observer { responseSaleAddPrevOK.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
@ -984,7 +975,7 @@ companion object {
override fun getLayoutId(): Int = R.layout.fragment_pre_sacador override fun getLayoutId(): Int = R.layout.fragment_pre_sacador
override fun onPause() { override fun onPause() {
goBack = true //SERGIO: se quita porque si no no entra la primera vez goBack = true
goBack2 = true goBack2 = true
super.onPause() super.onPause()
} }
@ -1005,47 +996,11 @@ private fun showQuantityDialog(position: Int) {
try { try {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)) customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
.setValue("") .setValue("")
/* .setOkButton(getString(R.string.titleFaults)) {
checkAndCall(
position,
customDialogThreeButtons.getValue().toInt(),
getString(R.string.titleFaults)
)
}.setOkButtonTwo(getString(R.string.BasuraRechazar)) {
checkAndCall(
position,
customDialogThreeButtons.getValue().toInt(),
getString(R.string.BasuraRechazar)
)
}.setOkButtonThree(getString(R.string.Reject)) {
checkAndCall(
position,
customDialogThreeButtons.getValue().toInt(),
getString(R.string.Reject)
)
}.setOkButtonFour(getString(R.string.Split)) {
checkAndCall(
position,
customDialogThreeButtons.getValue().toInt(),
getString(R.string.Split)
)
*/
.setOkButtonAdd(getString(R.string.Agregar)) { .setOkButtonAdd(getString(R.string.Agregar)) {
increaseQuantity(position, customDialogThreeButtons.getValue().toInt()) increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
/* checkAndCall(
position,
customDialogThreeButtons.getValue().toInt(),
getString(R.string.Agregar)
)*/
}.setKoButton(getString(R.string.cancel)) { }.setKoButton(getString(R.string.cancel)) {
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()