feat reservas refs #6861
This commit is contained in:
parent
60bdd285bf
commit
6331fee2e1
|
@ -109,7 +109,7 @@ interface OnEditSubQuantityListener {
|
||||||
fun OnEditSubQuantityListener(item: Any, text: String)
|
fun OnEditSubQuantityListener(item: Any, text: String)
|
||||||
}
|
}
|
||||||
interface AdapterCallback {
|
interface AdapterCallback {
|
||||||
fun getPosition():Int
|
fun getPosition(): Int
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnItemClickListener {
|
interface OnItemClickListener {
|
||||||
|
@ -151,6 +151,7 @@ interface OnClientHistoricItemClickListener {
|
||||||
interface OnVisibleClickListener {
|
interface OnVisibleClickListener {
|
||||||
fun onVisibleClickListener(item: ItemUbicadorVO)
|
fun onVisibleClickListener(item: ItemUbicadorVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnVisibleClickListenerNew {
|
interface OnVisibleClickListenerNew {
|
||||||
fun onVisibleClickListener(item: ItemUbicador)
|
fun onVisibleClickListener(item: ItemUbicador)
|
||||||
}
|
}
|
||||||
|
@ -162,21 +163,32 @@ interface OnVisibleInventoryClickListener {
|
||||||
interface OnMoreClickListener {
|
interface OnMoreClickListener {
|
||||||
fun onMoreClickListener(item: ItemUbicadorVO)
|
fun onMoreClickListener(item: ItemUbicadorVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnMoreClickListenerNew {
|
interface OnMoreClickListenerNew {
|
||||||
fun onMoreClickListener(item: ItemUbicador)
|
fun onMoreClickListener(item: ItemUbicador)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnTruckClickListener {
|
interface OnTruckClickListener {
|
||||||
fun onTruckClickListener(item: ItemExpeditionTruckVO, entryPoint: String)
|
fun onTruckClickListener(item: ItemExpeditionTruckVO, entryPoint: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnRoadMapClickListener {
|
interface OnRoadMapClickListener {
|
||||||
fun onRoadMapClickListener(item: RoadMapTruck, entryPoint: String)
|
fun onRoadMapClickListener(item: RoadMapTruck, entryPoint: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnStopMapClickListener {
|
interface OnStopMapClickListener {
|
||||||
fun onStopMapClickListener(item: RoadStopMapTruck, entryPoint: String, action:TruckAction, view: View? = null)
|
fun onStopMapClickListener(
|
||||||
|
item: RoadStopMapTruck,
|
||||||
|
entryPoint: String,
|
||||||
|
action: TruckAction,
|
||||||
|
view: View? = null
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnStopMapLoadClickListener {
|
interface OnStopMapLoadClickListener {
|
||||||
fun onStopMapClickListener(item: RoadStopMapTruck, entryPoint: String)
|
fun onStopMapClickListener(item: RoadStopMapTruck, entryPoint: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnStopMapUnloadClickListener {
|
interface OnStopMapUnloadClickListener {
|
||||||
fun onStopMapClickListener(item: RoadStopMapTruck, entryPoint: String)
|
fun onStopMapClickListener(item: RoadStopMapTruck, entryPoint: String)
|
||||||
}
|
}
|
||||||
|
@ -185,7 +197,6 @@ interface OnPrintClickListener {
|
||||||
fun onPrintClickListener(item: StopMapTruckPallet, entryPoint: String)
|
fun onPrintClickListener(item: StopMapTruckPallet, entryPoint: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface OnPalletClickListener {
|
interface OnPalletClickListener {
|
||||||
fun onPalletClickListener(itemTruck: ItemExpeditionTruckVO, itemPallet: ItemPalletVO)
|
fun onPalletClickListener(itemTruck: ItemExpeditionTruckVO, itemPallet: ItemPalletVO)
|
||||||
}
|
}
|
||||||
|
@ -206,7 +217,12 @@ interface OnCollectionSelectedListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnCollectionTicketSelectedListener {
|
interface OnCollectionTicketSelectedListener {
|
||||||
fun onCollectionSelected(collection: CollectionTicket, type: String, hasPicking:Boolean = false)
|
fun onCollectionSelected(
|
||||||
|
collection: CollectionTicket,
|
||||||
|
type: String,
|
||||||
|
hasPicking: Boolean = false,
|
||||||
|
hasToAdd: Boolean = false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnQuantityClickListener {
|
interface OnQuantityClickListener {
|
||||||
|
|
|
@ -1941,12 +1941,15 @@ class CollectionFragmentPicker(
|
||||||
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
try {
|
||||||
viewModel.collectionAddItem(
|
viewModel.collectionAddItem(
|
||||||
itemFk = customDialogList.getValue().toInt(),
|
itemFk = customDialogList.getValue().toInt(),
|
||||||
ticketFk = ticketSelected,
|
ticketFk = ticketSelected,
|
||||||
quantity = customDialogList.getValueTwo().toInt()
|
quantity = customDialogList.getValueTwo().toInt()
|
||||||
)
|
)
|
||||||
|
}catch (ex:Exception){
|
||||||
|
ma.messageWithSound(message = getString(R.string.errorScanItem), isError = true, isToasted = true, isPlayed = true)
|
||||||
|
}
|
||||||
|
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
|
@ -991,7 +991,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCollectionSelected(
|
override fun onCollectionSelected(
|
||||||
collection: CollectionTicket, type: String, hasPicking: Boolean
|
collection: CollectionTicket, type: String, hasPicking: Boolean, hasToAdd:Boolean
|
||||||
) {
|
) {
|
||||||
when (type) {
|
when (type) {
|
||||||
"PREITEMPICKERTEST" -> {
|
"PREITEMPICKERTEST" -> {
|
||||||
|
@ -999,7 +999,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
//addFragmentOnTop(EndSacadorFragment.newInstance(collection, type))
|
//addFragmentOnTop(EndSacadorFragment.newInstance(collection, type))
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
SectorCollectionReserveFragment.newInstance(
|
SectorCollectionReserveFragment.newInstance(
|
||||||
"PREITEMPICKERTEST", collection.collectionFk
|
"PREITEMPICKERTEST", collection.collectionFk, hasToAdd
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1205,9 +1205,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
action: TruckAction,
|
action: TruckAction,
|
||||||
view: View?
|
view: View?
|
||||||
) {
|
) {
|
||||||
println("stopMapList ${item.description}")
|
|
||||||
println("stopMapList id ${item.id}")
|
|
||||||
println("action $action")
|
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
StopMapPalletListFragment.newInstance(
|
StopMapPalletListFragment.newInstance(
|
||||||
title = item.description ?: "", item, action
|
title = item.description ?: "", item, action
|
||||||
|
|
|
@ -98,6 +98,11 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val loadResponseReserveSectorCollection: LiveData<Event<ResponseItemVO>> =
|
val loadResponseReserveSectorCollection: LiveData<Event<ResponseItemVO>> =
|
||||||
_responseReserveSectorCollection.map { Event(it) }
|
_responseReserveSectorCollection.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseReserveSaleGroup by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseReserveSaleGroup: LiveData<ResponseItemVO> = _responseReserveSaleGroup
|
||||||
|
val loadResponseReserveSaleGroup: LiveData<Event<ResponseItemVO>> =
|
||||||
|
_responseReserveSaleGroup.map { Event(it) }
|
||||||
|
|
||||||
private val _responseSaleAddPrevOK by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseSaleAddPrevOK by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseSaleAddPrevOK: LiveData<ResponseItemVO>
|
val responseSaleAddPrevOK: LiveData<ResponseItemVO>
|
||||||
get() = _responseSaleAddPrevOK
|
get() = _responseSaleAddPrevOK
|
||||||
|
@ -371,6 +376,33 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getReserveBySaleGroup(
|
||||||
|
saleGroup: Int
|
||||||
|
) {
|
||||||
|
salix.getReserveBySaleGroup(
|
||||||
|
params = arrayListOf(
|
||||||
|
saleGroup
|
||||||
|
).formatWithQuotes()
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseReserveSectorCollection.value = ResponseItemVO(
|
||||||
|
isError = false, errorMessage = "" + getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), response.message()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseReserveSectorCollection.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun saleTrackingAddPrevOK(
|
fun saleTrackingAddPrevOK(
|
||||||
sectorCollectionFk: Int
|
sectorCollectionFk: Int
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -3,7 +3,9 @@ package es.verdnatura.presentation.view.feature.sacador.adapter
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ItemCollectionRowNewBinding
|
import es.verdnatura.databinding.ItemCollectionRowNewBinding
|
||||||
import es.verdnatura.presentation.common.OnCollectionTicketSelectedListener
|
import es.verdnatura.presentation.common.OnCollectionTicketSelectedListener
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||||
|
@ -11,7 +13,7 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||||
class CollectionAdapterNew(
|
class CollectionAdapterNew(
|
||||||
private val items: List<CollectionTicket>,
|
private val items: List<CollectionTicket>,
|
||||||
private val onCollectionTicketSelected: OnCollectionTicketSelectedListener,
|
private val onCollectionTicketSelected: OnCollectionTicketSelectedListener,
|
||||||
private val type: String
|
private val type: String,
|
||||||
) : RecyclerView.Adapter<CollectionAdapterNew.AjustesItemHolder>() {
|
) : RecyclerView.Adapter<CollectionAdapterNew.AjustesItemHolder>() {
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||||
|
@ -28,6 +30,9 @@ class CollectionAdapterNew(
|
||||||
holder.binding.root.setOnClickListener {
|
holder.binding.root.setOnClickListener {
|
||||||
onCollectionTicketSelected.onCollectionSelected(items[position], type)
|
onCollectionTicketSelected.onCollectionSelected(items[position], type)
|
||||||
}
|
}
|
||||||
|
holder.binding.itemImage.setOnClickListener {
|
||||||
|
onCollectionTicketSelected.onCollectionSelected(items[position], type, hasToAdd = true )
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AjustesItemHolder(
|
class AjustesItemHolder(
|
||||||
|
@ -39,6 +44,7 @@ class CollectionAdapterNew(
|
||||||
binding.apply {
|
binding.apply {
|
||||||
if (item.ticketTotalCount == null || type == "PREITEMPICKERTEST") {
|
if (item.ticketTotalCount == null || type == "PREITEMPICKERTEST") {
|
||||||
binding.totalTicketsId.visibility = View.GONE
|
binding.totalTicketsId.visibility = View.GONE
|
||||||
|
binding.itemImage.setImageDrawable(ContextCompat.getDrawable(root.context, R.drawable.ic_add_black_24dp))
|
||||||
}
|
}
|
||||||
this.item = item
|
this.item = item
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue