diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt index 37454031..ef69fb96 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt @@ -129,6 +129,7 @@ class CollectionFragment( private var recylerViewState: Parcelable? = null private var isScanned: Boolean? = null private var canChangeState = true + private var allTicketsChecked = false private lateinit var myGroupList: List @@ -2060,13 +2061,19 @@ class CollectionFragment( getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT) saleAdapter!!.notifyDataSetChanged() - // Se quita de la app - /* if (!goBack) - ticketCollection_setUsedShelves() - goBack = false*/ - if (canChangeState) changeTicketState() + }else{ + if (allTicketsChecked){ + sales.forEach{ + if (it.isControlled == "0"){ + viewModel.ticketStateTodaySetState( + ticketFk = it.ticketFk.toInt(), state = "ON_CHECKING" + ) + } + } + allTicketsChecked = false + } } } @@ -2216,6 +2223,7 @@ class CollectionFragment( ticketFk = it.toInt(), state = "CHECKED" ) } + allTicketsChecked = true } else if (type == SACADOR) { tickets.forEach { viewModel.ticketStateTodaySetState(