feat qr #refs 7520

This commit is contained in:
Sergio De la torre 2024-06-18 12:23:12 +02:00
parent 6a5817844e
commit d44e145793
2 changed files with 7 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import es.verdnatura.databinding.FragmentGeneralBlackBinding
import es.verdnatura.domain.ConstAndValues import es.verdnatura.domain.ConstAndValues
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnCollectionSelectedListener import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.common.itemScanValue
import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketViewModel import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketViewModel
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
@ -63,9 +64,8 @@ class PreControladorFragment :
if (!binding.scanInput.text.isNullOrEmpty()) { if (!binding.scanInput.text.isNullOrEmpty()) {
try { try {
viewModel.getSales( viewModel.getSales(
collectionFk = binding.scanInput.text.toString().toInt(), collectionFk = itemScanValue(binding.scanInput.text.toString(),arrayOf("saleGroup"),"id").toString().toInt(),
print = false, print = false,
source = type source = type
) )

View File

@ -73,10 +73,10 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
val collectionList: LiveData<CollectionListVO> val collectionList: LiveData<CollectionListVO>
get() = _collectionList get() = _collectionList
private val _responseHasSaleRerserved by lazy { MutableLiveData<String>() } private val _responseHasSaleRerserved by lazy { MutableLiveData<Int>() }
val responseHasSaleRerserved: LiveData<String> = _responseHasSaleRerserved val responseHasSaleRerserved: LiveData<Int> = _responseHasSaleRerserved
val loadResponseHasSaleReserved: LiveData<Event<String>> = val loadResponseHasSaleReserved: LiveData<Event<Int>> =
_responseHasSaleRerserved.map { Event(it) } _responseHasSaleRerserved.map { Event(it) }
private val _responseSaleGroupAdd by lazy { MutableLiveData<ResponseItemVO>() } private val _responseSaleGroupAdd by lazy { MutableLiveData<ResponseItemVO>() }
@ -294,7 +294,7 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
salix.hasSalesReserved(sectorCollectionFk) salix.hasSalesReserved(sectorCollectionFk)
.enqueue(object : SalixCallback<String>(context) { .enqueue(object : SalixCallback<String>(context) {
override fun onSuccess(response: Response<String>) { override fun onSuccess(response: Response<String>) {
_responseHasSaleRerserved.value =response.body() _responseHasSaleRerserved.value = response.body()!!.toInt()
} }
}) })
} }
@ -364,6 +364,7 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
} }
}) })
} }
fun getReserveBySectorCollection( fun getReserveBySectorCollection(
vSectorCollectionFk: Int vSectorCollectionFk: Int
) { ) {