feat crashlytics refs #6810
This commit is contained in:
parent
4416820122
commit
59b91ffc61
|
@ -3,7 +3,7 @@ package es.verdnatura.presentation.view.feature.buffer.fragment
|
|||
import android.view.inputmethod.EditorInfo
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBufferBinding
|
||||
import es.verdnatura.domain.toInt
|
||||
import es.verdnatura.domain.toLong
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
||||
class BufferFragment(
|
||||
|
@ -46,7 +46,7 @@ class BufferFragment(
|
|||
}
|
||||
|
||||
viewModel.bufferSetTypeByName(
|
||||
binding.scanInput.toInt(),
|
||||
binding.scanInput.toLong(),
|
||||
entryPoint
|
||||
|
||||
)
|
||||
|
|
|
@ -19,7 +19,7 @@ class BufferFragmentViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val bufferLoadResponse: LiveData<String>
|
||||
get() = _bufferLoadResponse
|
||||
|
||||
fun bufferSetTypeByName(vBufferFk: Int, vType: String) {
|
||||
fun bufferSetTypeByName(vBufferFk: Number, vType: String) {
|
||||
salix.buffer_setTypeByName(params = listOf(vBufferFk, vType).formatWithQuotes())
|
||||
.enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
||||
override fun onSuccess(response: Response<List<JsonObject>>) {
|
||||
|
|
|
@ -395,7 +395,7 @@ class CollectionFragmentPicker(
|
|||
|
||||
"buy" -> binding.scanInput.setText(myQr.more)
|
||||
"ticket" -> {
|
||||
binding.scanInput.setText(myQr.id)
|
||||
binding.scanInput.setText(myQr.id.toString())
|
||||
findSale(binding.scanInput.text.toString())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import android.widget.Toast
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionLogDeliveryBinding
|
||||
import es.verdnatura.domain.toInt
|
||||
import es.verdnatura.domain.toLong
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -28,7 +28,7 @@ class LogExpeditionFragment(
|
|||
) {
|
||||
|
||||
private var adapter: ExpeditionLogAdapter? = null
|
||||
private var originalItem: Int = 0
|
||||
private var originalItem: Long = 0
|
||||
private var isScanned: Boolean = false
|
||||
|
||||
companion object {
|
||||
|
@ -88,8 +88,8 @@ class LogExpeditionFragment(
|
|||
isScanned =
|
||||
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||
try {
|
||||
viewModel.expeditionGetLog(binding.scanInput.toInt())
|
||||
originalItem = binding.scanInput.toInt()
|
||||
viewModel.expeditionGetLog(binding.scanInput.toLong())
|
||||
originalItem = binding.scanInput.toLong()
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
getString(
|
||||
R.string.titleLogExpedition,
|
||||
|
|
|
@ -30,7 +30,7 @@ class Expeditions(
|
|||
)
|
||||
|
||||
class ExpeditionSalix(
|
||||
val expeditionFk: Int,
|
||||
val expeditionFk: Number,
|
||||
val stateCode: String?,
|
||||
val isScanned: Int? = 0
|
||||
)
|
||||
|
|
|
@ -101,7 +101,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun expeditionGetLog(
|
||||
expedition: Int
|
||||
expedition: Number
|
||||
) {
|
||||
salix.getExpeditionStates(
|
||||
"""{"where": {"expeditionFk": $expedition},"include": [{"relation": "expeditionStateType","scope": {"fields": ["id","description"]}}],"fields": {"id": true,"created": true,"typeFk": true}}"""
|
||||
|
@ -126,7 +126,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun getRoutesFromExpedition(
|
||||
expedition: Int
|
||||
expedition: Number
|
||||
) {
|
||||
salix.getRoutesFromExpedition(
|
||||
filter = """{
|
||||
|
|
|
@ -11,20 +11,19 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
|||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
|
||||
class InventoryAdapter (
|
||||
class InventoryAdapter(
|
||||
private val items: List<ItemInventaryVO>,
|
||||
private val onInvetoryNichoClickListener: OnInvetoryNichoClickListener,
|
||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
|
||||
): RecyclerView.Adapter<InventoryAdapter.ItemHolder> () {
|
||||
|
||||
) : RecyclerView.Adapter<InventoryAdapter.ItemHolder>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||
return ItemHolder(
|
||||
ItemInventaryRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
|
||||
ItemInventaryRowBinding.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])
|
||||
|
@ -32,36 +31,59 @@ class InventoryAdapter (
|
|||
|
||||
inner class ItemHolder(
|
||||
val binding: ItemInventaryRowBinding
|
||||
) : RecyclerView.ViewHolder(binding.root){
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
private val res = binding.root.context.resources
|
||||
fun bind(item: ItemInventaryVO) {
|
||||
binding.apply {
|
||||
this.item = item
|
||||
if(item.producer.isNullOrEmpty()){
|
||||
if (item.producer.isNullOrEmpty()) {
|
||||
itemProducer.visibility = View.GONE
|
||||
}else{
|
||||
} else {
|
||||
itemProducer.visibility = View.VISIBLE
|
||||
}
|
||||
if (item.itemColour.isNullOrEmpty()){
|
||||
if (item.itemColour.isNullOrEmpty()) {
|
||||
itemColor.visibility = View.GONE
|
||||
}else{
|
||||
} else {
|
||||
itemColor.visibility = View.VISIBLE
|
||||
}
|
||||
itemNicho.setOnClickListener {
|
||||
onInvetoryNichoClickListener.onInvetoryNichoClickListener(item)
|
||||
}
|
||||
itemFk.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(
|
||||
R.string.titleItemConsult)),item.itemFk.toString())
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = res.getString(
|
||||
R.string.titleItemConsult
|
||||
)
|
||||
), item.itemFk.toString()
|
||||
)
|
||||
}
|
||||
itemUp.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(
|
||||
R.string.titleItemSearch)),item.itemFk.toString())
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = res.getString(
|
||||
R.string.titleItemSearch
|
||||
)
|
||||
), item.itemFk.toString()
|
||||
)
|
||||
}
|
||||
itemDown.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(
|
||||
R.string.titleItemSearch)),item.itemFk.toString())
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = res.getString(
|
||||
R.string.titleItemSearch
|
||||
)
|
||||
), item.itemFk.toString()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
binding.txtPendingAmount.text = if (item.pendingAmount != null) {
|
||||
binding.root.context.getString(R.string.pendingAmount, item.pendingAmount)
|
||||
} else {
|
||||
item.size
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import android.view.inputmethod.EditorInfo
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding
|
||||
import es.verdnatura.domain.toInt
|
||||
import es.verdnatura.domain.toLong
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionStateAdapter
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpedetionState
|
||||
|
@ -44,7 +44,7 @@ class ExpeditionStateFragment(
|
|||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (binding.editItemFk.text.toString().isNotEmpty()) {
|
||||
try {
|
||||
viewModel.expeditionGetStateJSON(binding.editItemFk.toInt())
|
||||
viewModel.expeditionGetStateJSON(binding.editItemFk.toLong())
|
||||
itemScan = binding.editItemFk.text.toString()
|
||||
} catch (ex: Exception) {
|
||||
ma.messageWithSound(
|
||||
|
|
|
@ -20,7 +20,7 @@ class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val itemExpedition: LiveData<ItemExpedetionState>
|
||||
get() = _itemExpedition
|
||||
|
||||
fun expeditionGetStateJSON(expeditionFk: Int) {
|
||||
fun expeditionGetStateJSON(expeditionFk: Long) {
|
||||
salix.expedition_getState(params = arrayListOf(expeditionFk))
|
||||
.enqueue(object : SalixCallback<ArrayList<JsonObject>>(context) {
|
||||
override fun onSuccess(response: Response<ArrayList<JsonObject>>) {
|
||||
|
|
|
@ -158,7 +158,16 @@ class EndSacadorFragment(
|
|||
} else {
|
||||
|
||||
if (binding.scanInput.text.first().isDigit()) {
|
||||
addSaleGroupToCollection(binding.scanInput.toInt())
|
||||
try {
|
||||
addSaleGroupToCollection(binding.scanInput.toInt())
|
||||
} catch (ex: Exception) {
|
||||
ma.messageWithSound(
|
||||
getString(R.string.errorInput),
|
||||
isError = true,
|
||||
isPlayed = true,
|
||||
isToasted = true
|
||||
)
|
||||
}
|
||||
} else {
|
||||
findSale(binding.scanInput.text.toString())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue