feat crashlytics refs #6810
This commit is contained in:
parent
a5d11b1613
commit
eb787e04cc
|
@ -20,7 +20,7 @@ data class SaleTrackingSalix(
|
||||||
var code: String,
|
var code: String,
|
||||||
var isChecked: Boolean,
|
var isChecked: Boolean,
|
||||||
var buyFk: Long,
|
var buyFk: Long,
|
||||||
var isScanned: Boolean,
|
var isScanned: Boolean?,
|
||||||
var quantity: Int,
|
var quantity: Int,
|
||||||
var itemShelvingFk: Int
|
var itemShelvingFk: Int
|
||||||
|
|
||||||
|
|
|
@ -2147,10 +2147,15 @@ class CollectionFragment(
|
||||||
try {
|
try {
|
||||||
|
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
||||||
.setValue("").setOkButtonAdd(getString(R.string.Agregar)) {
|
.setValue("").setOkButtonAdd(getString(R.string.modify)) {
|
||||||
|
try {
|
||||||
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtons.dismiss()
|
customDialogThreeButtons.dismiss()
|
||||||
|
}catch (ex:Exception){
|
||||||
|
ma.messageWithSound(message = getString(R.string.errorInputQuantity), isPlayed = true, isError = true, isToasted = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
|
|
|
@ -36,6 +36,7 @@ import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORDESCRIP
|
import es.verdnatura.domain.ConstAndValues.SECTORDESCRIP
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORFK
|
import es.verdnatura.domain.ConstAndValues.SECTORFK
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
|
import es.verdnatura.domain.toLong
|
||||||
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.ItemScanned
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
@ -417,11 +418,16 @@ class CollectionFragmentPreChecker(
|
||||||
} else {
|
} else {
|
||||||
storedBackPosition = 0
|
storedBackPosition = 0
|
||||||
storedPosition = 0
|
storedPosition = 0
|
||||||
|
try {
|
||||||
viewModel.getSales(
|
viewModel.getSales(
|
||||||
binding.scanInput.text.toString().toInt(),
|
binding.scanInput.toLong(),
|
||||||
print = "0",
|
print = "0",
|
||||||
source = type
|
source = type
|
||||||
)
|
)
|
||||||
|
}catch (ex:Exception){
|
||||||
|
ma.messageWithSound(message = getString(R.string.errorInput), isError = true, isPlayed = true, isToasted = true)
|
||||||
|
}
|
||||||
|
|
||||||
// findSale(binding.scanInput.text.toString())
|
// findSale(binding.scanInput.text.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
get() = _responseSaleAddPrevOK
|
get() = _responseSaleAddPrevOK
|
||||||
|
|
||||||
fun getSales(
|
fun getSales(
|
||||||
collectionFk: Int, print: String, source: String
|
collectionFk: Number, print: String, source: String
|
||||||
|
|
||||||
) {
|
) {
|
||||||
salix.getSalesFromTicketOrCollection(
|
salix.getSalesFromTicketOrCollection(
|
||||||
|
|
|
@ -210,13 +210,15 @@ class RoutesFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun filteredList(searchText: String) {
|
private fun filteredList(searchText: String) {
|
||||||
|
if (::myListRoute.isInitialized) {
|
||||||
val filteredList = myListRoute.filter { route ->
|
val filteredList = myListRoute.filter { route ->
|
||||||
route.toString().lowercase().contains(searchText)
|
route.toString().lowercase().contains(searchText)
|
||||||
}.toMutableList()
|
}.toMutableList()
|
||||||
adapter!!.updateList(filteredList)
|
adapter!!.updateList(filteredList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
loadRouteList.observe(viewLifecycleOwner) { event ->
|
loadRouteList.observe(viewLifecycleOwner) { event ->
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
@ -50,11 +51,11 @@ import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
|
|
||||||
class TicketsFragment(
|
class TicketsFragment : BaseFragment<FragmentTicketsBinding, DeliveryViewModel>(
|
||||||
var title: String = "", var route: RouteInfo,
|
|
||||||
) : BaseFragment<FragmentTicketsBinding, DeliveryViewModel>(
|
|
||||||
DeliveryViewModel::class
|
DeliveryViewModel::class
|
||||||
) {
|
) {
|
||||||
|
private var title: String? = null
|
||||||
|
private lateinit var route: RouteInfo
|
||||||
|
|
||||||
private var adapter: TicketAdapter? = null
|
private var adapter: TicketAdapter? = null
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
|
@ -67,13 +68,31 @@ class TicketsFragment(
|
||||||
private var firstVisibleItemPosition = -1
|
private var firstVisibleItemPosition = -1
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(title: String, entryPoint: String) =
|
//Tarea 6810 revisar fallos app
|
||||||
TicketsFragment(title, Gson().fromJson(entryPoint, RouteInfo::class.java))
|
private const val ARG_TITLE = "title"
|
||||||
|
private const val ARG_ROUTE = "route"
|
||||||
private const val REQUEST_CALL_PERMISSION = 1
|
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 getLayoutId(): Int = R.layout.fragment_tickets
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.ubicador.fragment
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.os.Bundle
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
@ -15,6 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentUbicadorBinding
|
import es.verdnatura.databinding.FragmentUbicadorBinding
|
||||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
||||||
|
import es.verdnatura.domain.isShelving
|
||||||
import es.verdnatura.domain.notNull
|
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
|
||||||
|
@ -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.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapterNew
|
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapterNew
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
||||||
import java.lang.Boolean.TRUE
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class UbicadorFragmentNew(
|
class UbicadorFragmentNew: BaseFragment<FragmentUbicadorBinding, UbicadorViewModel>(
|
||||||
var shelvingFk: String = "", var isAutoSelf: Boolean
|
|
||||||
) : BaseFragment<FragmentUbicadorBinding, UbicadorViewModel>(
|
|
||||||
UbicadorViewModel::class
|
UbicadorViewModel::class
|
||||||
) {
|
) {
|
||||||
|
private var shelvingFk: String = ""
|
||||||
|
private var isAutoSelf: Boolean = false
|
||||||
|
|
||||||
private var adapter: UbicadorAdapterNew? = null
|
private var adapter: UbicadorAdapterNew? = null
|
||||||
private lateinit var customDialogInput: CustomDialogInput
|
private lateinit var customDialogInput: CustomDialogInput
|
||||||
|
@ -61,9 +63,27 @@ class UbicadorFragmentNew(
|
||||||
private var buyScanned: String = ""
|
private var buyScanned: String = ""
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String, autoSelf: Boolean = false) =
|
private const val ARG_SHELVINGFK = "shelvingFk"
|
||||||
UbicadorFragmentNew(entryPoint, autoSelf)
|
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 getLayoutId(): Int = R.layout.fragment_ubicador
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
@ -236,7 +256,10 @@ class UbicadorFragmentNew(
|
||||||
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
||||||
setIconsActions(true)
|
setIconsActions(true)
|
||||||
setIcons()
|
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.mainToolbar.toolbarTitle.text =
|
||||||
binding.editMatricula.text.toString()
|
binding.editMatricula.text.toString()
|
||||||
shelvingFk = binding.editMatricula.text.toString()
|
shelvingFk = binding.editMatricula.text.toString()
|
||||||
|
@ -425,7 +448,11 @@ class UbicadorFragmentNew(
|
||||||
val listInt: ArrayList<Long> = ArrayList()
|
val listInt: ArrayList<Long> = ArrayList()
|
||||||
|
|
||||||
if (listItems.none { it.item == itemScanned }) {
|
if (listItems.none { it.item == itemScanned }) {
|
||||||
|
try {
|
||||||
listInt.add(buyScanned.toLong())
|
listInt.add(buyScanned.toLong())
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
listItems.sortedBy { it.isChecked }.forEachIndexed { index, item ->
|
listItems.sortedBy { it.isChecked }.forEachIndexed { index, item ->
|
||||||
if (item.item == itemScanned) {
|
if (item.item == itemScanned) {
|
||||||
|
@ -442,12 +469,14 @@ class UbicadorFragmentNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (listInt.isNotEmpty()) {
|
||||||
viewModel.itemShelvingAddList(
|
viewModel.itemShelvingAddList(
|
||||||
shelvingFk,
|
shelvingFk,
|
||||||
"" + listInt + "",
|
"" + listInt + "",
|
||||||
TRUE,
|
true,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
adapter!!.notifyDataSetChanged()
|
adapter!!.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
@ -514,7 +543,8 @@ class UbicadorFragmentNew(
|
||||||
}
|
}
|
||||||
loadResponseCode.observe(viewLifecycleOwner) { event ->
|
loadResponseCode.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
if (it != 0) checkUbications((it as Long))
|
//not always is true
|
||||||
|
if (it!=null)checkUbications((it as Long))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,11 +61,11 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
val loadReubicationList: LiveData<Event<ReubicationList>> = _reubicationList.map { Event(it) }
|
val loadReubicationList: LiveData<Event<ReubicationList>> = _reubicationList.map { Event(it) }
|
||||||
|
|
||||||
private val _responseCode by lazy { MutableLiveData<Any>() }
|
private val _responseCode by lazy { MutableLiveData<Any?>() }
|
||||||
val responseCode: LiveData<Any>
|
val responseCode: LiveData<Any?>
|
||||||
get() = _responseCode
|
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>() }
|
private val _responseAddList by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseAddList: LiveData<ResponseItemVO> = _responseAddList
|
val responseAddList: LiveData<ResponseItemVO> = _responseAddList
|
||||||
|
@ -405,11 +405,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<String?>) {
|
override fun onSuccess(response: Response<String?>) {
|
||||||
|
|
||||||
_responseCode.value = if (response.body() == null) {
|
_responseCode.value = response.body()
|
||||||
0
|
|
||||||
} else {
|
|
||||||
response.body().toString().toLong()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -833,5 +833,6 @@
|
||||||
<string name="scanParkingTxt">Escanea parking</string>
|
<string name="scanParkingTxt">Escanea parking</string>
|
||||||
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
||||||
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
||||||
|
<string name="errorInputQuantity">Error al introducir cantidad</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -833,5 +833,6 @@
|
||||||
<string name="scanParkingTxt">Escanea parking</string>
|
<string name="scanParkingTxt">Escanea parking</string>
|
||||||
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
||||||
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
||||||
|
<string name="errorInputQuantity">Error al introducir cantidad</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -833,5 +833,6 @@
|
||||||
<string name="scanParkingTxt">Escanea parking</string>
|
<string name="scanParkingTxt">Escanea parking</string>
|
||||||
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
||||||
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
||||||
|
<string name="errorInputQuantity">Error al introducir cantidad</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -835,5 +835,6 @@
|
||||||
<string name="scanParkingTxt">Escanea parking</string>
|
<string name="scanParkingTxt">Escanea parking</string>
|
||||||
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
<string name="reviewBoxPicking">Revisar sacado por cajas</string>
|
||||||
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
<string name="pendingAmount">Hoy quedan por salir %1$x unidades</string>
|
||||||
|
<string name="errorInputQuantity">Error al introducir cantidad</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue