feat: refs#8213 newUI
This commit is contained in:
parent
455f72c352
commit
136d2de399
|
@ -0,0 +1,365 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.collection.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.res.ColorStateList
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View.GONE
|
||||||
|
import android.view.View.INVISIBLE
|
||||||
|
import android.view.View.VISIBLE
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.content.ContextCompat.getColor
|
||||||
|
import androidx.core.graphics.drawable.DrawableCompat
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.databinding.SaleRowFragmentReserveBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PREITEMPICKERTEST
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PREPARED
|
||||||
|
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.presentation.common.OnAddItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnPackingClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleReserveClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnTicketClickSaleListener
|
||||||
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.Sale
|
||||||
|
|
||||||
|
class SaleAdapterReserve(
|
||||||
|
private val items: List<Sale>,
|
||||||
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||||
|
private val onSaleClickListener: OnSaleClickSaleListener,
|
||||||
|
private val onMistakeClickListener: OnMistakeClickListener,
|
||||||
|
private val onPackingClick: OnPackingClickSaleListener,
|
||||||
|
private var onTicketClick: OnTicketClickSaleListener? = null,
|
||||||
|
private var saleAdapter: SaleAdapterReserve? = null,
|
||||||
|
private var onReserveSaleClick: OnSaleReserveClickListener? = null,
|
||||||
|
private var onAddItemClickListener: OnAddItemClickListener? = null,
|
||||||
|
private var type: String? = null,
|
||||||
|
|
||||||
|
) : RecyclerView.Adapter<SaleAdapterReserve.AjustesItemHolder>() {
|
||||||
|
var context: Context? = null
|
||||||
|
var position: Int = 0
|
||||||
|
|
||||||
|
var isExpanded: Boolean = type == "PRECHECKER"
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||||
|
this.context = parent.context
|
||||||
|
|
||||||
|
|
||||||
|
return AjustesItemHolder(
|
||||||
|
|
||||||
|
SaleRowFragmentReserveBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context), parent, false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() = items.size
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
|
||||||
|
this.position = position
|
||||||
|
holder.bind(items[position])
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class AjustesItemHolder(
|
||||||
|
val binding: SaleRowFragmentReserveBinding
|
||||||
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
|
fun bind(sale: Sale) {
|
||||||
|
binding.apply {
|
||||||
|
println("type $type ")
|
||||||
|
println("type isExpanded $isExpanded")
|
||||||
|
/* val childLayoutManager =
|
||||||
|
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
||||||
|
*/
|
||||||
|
val childLayoutManagerV =
|
||||||
|
LinearLayoutManager(context!!, RecyclerView.VERTICAL, false)
|
||||||
|
|
||||||
|
/* itemArticlePlacements.apply {
|
||||||
|
layoutManager = childLayoutManager
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
//CLICK EVENTS
|
||||||
|
contentLayout.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
txtColor.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
txtDescrip.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ticketFk.setOnClickListener {
|
||||||
|
onTicketClick?.onTicketClickListener(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
txtParking.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleItemSearch
|
||||||
|
), sale.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
txtShelving.setOnClickListener {
|
||||||
|
onPackingClick.onPackingClick(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
txtItem.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleItemConsult
|
||||||
|
), sale.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//ERROR
|
||||||
|
|
||||||
|
if (sale.originalQuantity != sale.saleQuantity && sale.originalQuantity != null && !sale.isParent) {
|
||||||
|
layoutError.visibility = VISIBLE
|
||||||
|
txtError.text =
|
||||||
|
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
|
||||||
|
binding.addItem.visibility = VISIBLE
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layoutError.visibility = GONE
|
||||||
|
binding.addItem.visibility = GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.deleteReserve.visibility = if (sale.isAdded == 1) VISIBLE else GONE
|
||||||
|
|
||||||
|
if (sale.isAdded == 1) {
|
||||||
|
layoutError.visibility = VISIBLE
|
||||||
|
txtError.text = binding.root.context.getString(R.string.newItem)
|
||||||
|
binding.deleteReserve.setOnClickListener {
|
||||||
|
onReserveSaleClick!!.onSaleReserveListener(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isExpanded) {
|
||||||
|
itemArticlePlacements.visibility = VISIBLE
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
itemArticlePlacements.visibility = GONE
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_up)
|
||||||
|
}
|
||||||
|
|
||||||
|
itemArticlePlacements.visibility = if (isExpanded) VISIBLE else {
|
||||||
|
GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sale.isParent) {
|
||||||
|
txtQuantity.visibility = INVISIBLE
|
||||||
|
txtQuantityReserved.visibility = INVISIBLE
|
||||||
|
txtReserveToComplete.visibility = GONE
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
ivArrow.visibility = VISIBLE
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
if (type != SACADOR && type != PREITEMPICKERTEST) {
|
||||||
|
val colorRes =
|
||||||
|
if (sale.hasMistake == true) R.color.verdnatura_red_salix else R.color.verdnatura_black
|
||||||
|
imageErrorMessage.imageTintList =
|
||||||
|
ColorStateList.valueOf(getColor(context!!, colorRes))
|
||||||
|
imageErrorMessage.visibility = VISIBLE
|
||||||
|
} else {
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
}
|
||||||
|
ivArrow.visibility = INVISIBLE
|
||||||
|
}
|
||||||
|
println("sonSales ${sale.sonSales}")
|
||||||
|
|
||||||
|
if (!sale.sonSales.isNullOrEmpty()) {
|
||||||
|
|
||||||
|
itemArticlePlacements.apply {
|
||||||
|
layoutManager = childLayoutManagerV
|
||||||
|
adapter = SaleAdapterReserve(
|
||||||
|
sale.sonSales,
|
||||||
|
onPasillerosItemClickListener,
|
||||||
|
onSaleClickListener,
|
||||||
|
onMistakeClickListener,
|
||||||
|
onPackingClick,
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
itemArticlePlacements.visibility = VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
ivArrow.setOnClickListener {
|
||||||
|
|
||||||
|
if (isExpanded) {
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_up)
|
||||||
|
itemArticlePlacements.visibility = GONE
|
||||||
|
} else {
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
||||||
|
itemArticlePlacements.visibility = VISIBLE
|
||||||
|
}
|
||||||
|
isExpanded = !isExpanded
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sale.saleGroupFk == null) {
|
||||||
|
previous.visibility = INVISIBLE
|
||||||
|
} else {
|
||||||
|
previous.visibility = VISIBLE
|
||||||
|
previous.text = "PREV:${sale.saleGroupFk}"
|
||||||
|
}
|
||||||
|
|
||||||
|
val result: Int
|
||||||
|
val textToConcat: String
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
result = sale.reservedQuantity % (sale.packing ?: (sale.saleQuantity + 1))
|
||||||
|
textToConcat = if (result != 0) {
|
||||||
|
"${sale.reservedQuantity / (sale.grouping ?: 1)} x ${sale.grouping ?: "1"}"
|
||||||
|
} else {
|
||||||
|
"${sale.reservedQuantity / (sale.packing ?: 1)} pack de ${sale.packing ?: "1"}"
|
||||||
|
}
|
||||||
|
binding.txtQuantityReserved.text = textToConcat
|
||||||
|
|
||||||
|
val textToConcat2: String
|
||||||
|
|
||||||
|
val result2: Int =
|
||||||
|
sale.accumulatedQuantity % (sale.packing ?: (sale.saleQuantity + 1))
|
||||||
|
textToConcat2 = if (result2 != 0) {
|
||||||
|
"${(sale.saleQuantity - sale.accumulatedQuantity) / (sale.grouping ?: 1)} x ${sale.grouping ?: "1"}"
|
||||||
|
} else {
|
||||||
|
"${(sale.saleQuantity - sale.accumulatedQuantity) / (sale.packing ?: 1)} pack de ${sale.packing ?: "1"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sale.totalItemShelving > 1) {
|
||||||
|
binding.txtQuantityReserved.text = textToConcat
|
||||||
|
binding.txtQuantity.text = textToConcat2
|
||||||
|
binding.txtReserveToComplete.text =
|
||||||
|
"${sale.currentItemShelving}/${sale.totalItemShelving}"
|
||||||
|
binding.txtReserveToComplete.visibility = VISIBLE
|
||||||
|
binding.txtQuantity.text =
|
||||||
|
"${sale.reservedQuantity}"
|
||||||
|
} else {
|
||||||
|
binding.txtQuantity.text = "${sale.reservedQuantity}"
|
||||||
|
binding.txtReserveToComplete.visibility = GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ex.message!!.toast(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
binding.txtReserveToComplete.text =
|
||||||
|
"${sale.currentItemShelving}/${sale.totalItemShelving}"
|
||||||
|
|
||||||
|
//COLORES
|
||||||
|
paintTicketcolor(sale.rgb, binding.itemTicketColor.background)
|
||||||
|
if (sale.isPicked == 1) {
|
||||||
|
if (type == PREPARED) {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
|
||||||
|
if (sale.saleGroupFk == null) {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_orange_salix
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
println("stateCode ${sale.stateCode}")
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "PREPARED") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_orange_salix
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "OK PREVIOUS") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_sky_blue
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "PREVIOUS_CONTROLLED") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_mint_light
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_black
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_sky_blue
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_black
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.txtParking.text =
|
||||||
|
// if (type == PREPARED) sale.parkingCodePrevia else sale.parkingCode
|
||||||
|
sale.parkingCode ?: sale.parkingCodePrevia
|
||||||
|
|
||||||
|
binding.addItem.setOnClickListener {
|
||||||
|
onAddItemClickListener!!.onAddItemClickListener(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == PREITEMPICKERTEST) {
|
||||||
|
binding.level.visibility = GONE
|
||||||
|
binding.levelTxt.visibility = GONE
|
||||||
|
binding.ticketOrder.visibility = VISIBLE
|
||||||
|
binding.txtPoints.visibility = GONE
|
||||||
|
} else {
|
||||||
|
binding.level.visibility = VISIBLE
|
||||||
|
binding.levelTxt.visibility = VISIBLE
|
||||||
|
binding.ticketOrder.visibility = GONE
|
||||||
|
binding.txtPoints.visibility = VISIBLE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.sale = sale
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun paintTicketcolor(color: String?, backgroundDrawableTicket: Drawable) {
|
||||||
|
|
||||||
|
if (color.isNullOrBlank()) {
|
||||||
|
DrawableCompat.setTint(
|
||||||
|
backgroundDrawableTicket, Color.TRANSPARENT
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
DrawableCompat.setTint(
|
||||||
|
backgroundDrawableTicket, Color.parseColor(color)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,363 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.collection.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.res.ColorStateList
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View.GONE
|
||||||
|
import android.view.View.INVISIBLE
|
||||||
|
import android.view.View.VISIBLE
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.content.ContextCompat.getColor
|
||||||
|
import androidx.core.graphics.drawable.DrawableCompat
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.databinding.SaleRowFragmentReserveSacadorBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PREITEMPICKERTEST
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PREPARED
|
||||||
|
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.presentation.common.OnAddItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnPackingClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleReserveClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnTicketClickSaleListener
|
||||||
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.Sale
|
||||||
|
|
||||||
|
class SaleAdapterReserveSacador(
|
||||||
|
private val items: List<Sale>,
|
||||||
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||||
|
private val onSaleClickListener: OnSaleClickSaleListener,
|
||||||
|
private val onMistakeClickListener: OnMistakeClickListener,
|
||||||
|
private val onPackingClick: OnPackingClickSaleListener,
|
||||||
|
private var onTicketClick: OnTicketClickSaleListener? = null,
|
||||||
|
private var saleAdapter: SaleAdapterReserveSacador? = null,
|
||||||
|
private var onReserveSaleClick: OnSaleReserveClickListener? = null,
|
||||||
|
private var onAddItemClickListener: OnAddItemClickListener? = null,
|
||||||
|
private var type: String? = null,
|
||||||
|
|
||||||
|
) : RecyclerView.Adapter<SaleAdapterReserveSacador.AjustesItemHolder>() {
|
||||||
|
var context: Context? = null
|
||||||
|
var position: Int = 0
|
||||||
|
|
||||||
|
var isExpanded: Boolean = false
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||||
|
this.context = parent.context
|
||||||
|
|
||||||
|
|
||||||
|
return AjustesItemHolder(
|
||||||
|
|
||||||
|
SaleRowFragmentReserveSacadorBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context), parent, false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() = items.size
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
|
||||||
|
this.position = position
|
||||||
|
holder.bind(items[position])
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class AjustesItemHolder(
|
||||||
|
val binding: SaleRowFragmentReserveSacadorBinding
|
||||||
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
|
fun bind(sale: Sale) {
|
||||||
|
binding.apply {
|
||||||
|
|
||||||
|
val childLayoutManagerV =
|
||||||
|
LinearLayoutManager(context!!, RecyclerView.VERTICAL, false)
|
||||||
|
|
||||||
|
//CLICK EVENTS
|
||||||
|
contentLayout.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
txtColor.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
txtDescrip.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ticketFk.setOnClickListener {
|
||||||
|
onTicketClick?.onTicketClickListener(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
txtParking.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleItemSearch
|
||||||
|
), sale.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
txtShelving.setOnClickListener {
|
||||||
|
onPackingClick.onPackingClick(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
txtItem.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleItemConsult
|
||||||
|
), sale.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//ERROR
|
||||||
|
|
||||||
|
if (sale.originalQuantity != sale.saleQuantity && sale.originalQuantity != null && !sale.isParent) {
|
||||||
|
layoutError.visibility = VISIBLE
|
||||||
|
txtError.text =
|
||||||
|
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
|
||||||
|
binding.addItem.visibility = VISIBLE
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layoutError.visibility = GONE
|
||||||
|
binding.addItem.visibility = GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.deleteReserve.visibility = if (sale.isAdded == 1) VISIBLE else GONE
|
||||||
|
|
||||||
|
if (sale.isAdded == 1) {
|
||||||
|
layoutError.visibility = VISIBLE
|
||||||
|
txtError.text = binding.root.context.getString(R.string.newItem)
|
||||||
|
binding.deleteReserve.setOnClickListener {
|
||||||
|
onReserveSaleClick!!.onSaleReserveListener(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sale.isParent) {
|
||||||
|
txtQuantity.visibility = INVISIBLE
|
||||||
|
txtQuantityReserved.visibility = INVISIBLE
|
||||||
|
txtReserveToComplete.visibility = GONE
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
ivArrow.visibility = VISIBLE
|
||||||
|
sale.color = sale.username ?: "" //mostrar en campo del colo el usuario
|
||||||
|
} else {
|
||||||
|
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
if (type != SACADOR && type != PREITEMPICKERTEST) {
|
||||||
|
val colorRes =
|
||||||
|
if (sale.hasMistake == true) R.color.verdnatura_red_salix else R.color.verdnatura_black
|
||||||
|
imageErrorMessage.imageTintList =
|
||||||
|
ColorStateList.valueOf(getColor(context!!, colorRes))
|
||||||
|
imageErrorMessage.visibility = VISIBLE
|
||||||
|
} else {
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
}
|
||||||
|
ivArrow.visibility = INVISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sale.sonSales.isNullOrEmpty()) {
|
||||||
|
|
||||||
|
itemArticlePlacements.apply {
|
||||||
|
layoutManager = childLayoutManagerV
|
||||||
|
adapter = SaleAdapterReserveSacadorSaleGroup(
|
||||||
|
sale.sonSales,
|
||||||
|
onPasillerosItemClickListener,
|
||||||
|
onSaleClickListener,
|
||||||
|
onMistakeClickListener,
|
||||||
|
onPackingClick,
|
||||||
|
type = "PREPARED"
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
itemArticlePlacements.visibility = GONE
|
||||||
|
}
|
||||||
|
if (isExpanded) {
|
||||||
|
if (sale.isParent) {
|
||||||
|
itemArticlePlacements.visibility = VISIBLE
|
||||||
|
} else {
|
||||||
|
itemArticlePlacements.visibility = GONE
|
||||||
|
}
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
itemArticlePlacements.visibility = GONE
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_up)
|
||||||
|
}
|
||||||
|
|
||||||
|
itemArticlePlacements.visibility = if (isExpanded) VISIBLE else {
|
||||||
|
GONE
|
||||||
|
}
|
||||||
|
ivArrow.setOnClickListener {
|
||||||
|
|
||||||
|
if (isExpanded) {
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_up)
|
||||||
|
itemArticlePlacements.visibility = GONE
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
||||||
|
if (sale.isParent) {
|
||||||
|
itemArticlePlacements.visibility = VISIBLE
|
||||||
|
} else {
|
||||||
|
itemArticlePlacements.visibility = GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
isExpanded = !isExpanded
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sale.saleGroupFk == null) {
|
||||||
|
previous.visibility = INVISIBLE
|
||||||
|
} else {
|
||||||
|
previous.visibility = VISIBLE
|
||||||
|
previous.text = "PREV:${sale.saleGroupFk}"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
val result: Int
|
||||||
|
val textToConcat: String
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
result = sale.reservedQuantity % (sale.packing ?: (sale.saleQuantity + 1))
|
||||||
|
textToConcat = if (result != 0) {
|
||||||
|
"${sale.reservedQuantity / (sale.grouping ?: 1)} x ${sale.grouping ?: "1"}"
|
||||||
|
} else {
|
||||||
|
"${sale.reservedQuantity / (sale.packing ?: 1)} pack de ${sale.packing ?: "1"}"
|
||||||
|
}
|
||||||
|
binding.txtQuantityReserved.text = textToConcat
|
||||||
|
|
||||||
|
val textToConcat2: String
|
||||||
|
|
||||||
|
val result2: Int =
|
||||||
|
sale.accumulatedQuantity % (sale.packing ?: (sale.saleQuantity + 1))
|
||||||
|
textToConcat2 = if (result2 != 0) {
|
||||||
|
"${(sale.saleQuantity - sale.accumulatedQuantity) / (sale.grouping ?: 1)} x ${sale.grouping ?: "1"}"
|
||||||
|
} else {
|
||||||
|
"${(sale.saleQuantity - sale.accumulatedQuantity) / (sale.packing ?: 1)} pack de ${sale.packing ?: "1"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sale.totalItemShelving > 1) {
|
||||||
|
binding.txtQuantityReserved.text = textToConcat
|
||||||
|
binding.txtQuantity.text = textToConcat2
|
||||||
|
binding.txtReserveToComplete.text =
|
||||||
|
"${sale.currentItemShelving}/${sale.totalItemShelving}"
|
||||||
|
binding.txtReserveToComplete.visibility = VISIBLE
|
||||||
|
binding.txtQuantity.text =
|
||||||
|
"${sale.reservedQuantity}"
|
||||||
|
} else {
|
||||||
|
binding.txtQuantity.text = "${sale.reservedQuantity}"
|
||||||
|
binding.txtReserveToComplete.visibility = GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ex.message!!.toast(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
binding.txtReserveToComplete.text =
|
||||||
|
"${sale.currentItemShelving}/${sale.totalItemShelving}"
|
||||||
|
|
||||||
|
//COLORES
|
||||||
|
paintTicketcolor(sale.rgb, binding.itemTicketColor.background)
|
||||||
|
if (sale.isPicked == 1) {
|
||||||
|
if (type == PREPARED) {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
|
||||||
|
if (sale.saleGroupFk == null) {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_orange_salix
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "PREPARED") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_orange_salix
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "OK PREVIOUS") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_sky_blue
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "PREVIOUS_CONTROLLED") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_mint_light
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_black
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_sky_blue
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_black
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.txtParking.text =
|
||||||
|
// if (type == PREPARED) sale.parkingCodePrevia else sale.parkingCode
|
||||||
|
sale.parkingCode ?: sale.parkingCodePrevia
|
||||||
|
|
||||||
|
binding.addItem.setOnClickListener {
|
||||||
|
onAddItemClickListener!!.onAddItemClickListener(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == PREITEMPICKERTEST) {
|
||||||
|
binding.level.visibility = GONE
|
||||||
|
binding.levelTxt.visibility = GONE
|
||||||
|
binding.ticketOrder.visibility = VISIBLE
|
||||||
|
binding.txtPoints.visibility = GONE
|
||||||
|
} else {
|
||||||
|
binding.level.visibility = VISIBLE
|
||||||
|
binding.levelTxt.visibility = VISIBLE
|
||||||
|
binding.ticketOrder.visibility = GONE
|
||||||
|
binding.txtPoints.visibility = VISIBLE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.sale = sale
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun paintTicketcolor(color: String?, backgroundDrawableTicket: Drawable) {
|
||||||
|
|
||||||
|
if (color.isNullOrBlank()) {
|
||||||
|
DrawableCompat.setTint(
|
||||||
|
backgroundDrawableTicket, Color.TRANSPARENT
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
DrawableCompat.setTint(
|
||||||
|
backgroundDrawableTicket, Color.parseColor(color)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,308 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.collection.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.res.ColorStateList
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View.GONE
|
||||||
|
import android.view.View.INVISIBLE
|
||||||
|
import android.view.View.VISIBLE
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.content.ContextCompat.getColor
|
||||||
|
import androidx.core.graphics.drawable.DrawableCompat
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.databinding.SaleRowFragmentReserveSacadorBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PREITEMPICKERTEST
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PREPARED
|
||||||
|
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.presentation.common.OnAddItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnPackingClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleReserveClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnTicketClickSaleListener
|
||||||
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.Sale
|
||||||
|
|
||||||
|
class SaleAdapterReserveSacadorSaleGroup(
|
||||||
|
private val items: List<Sale>,
|
||||||
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||||
|
private val onSaleClickListener: OnSaleClickSaleListener,
|
||||||
|
private val onMistakeClickListener: OnMistakeClickListener,
|
||||||
|
private val onPackingClick: OnPackingClickSaleListener,
|
||||||
|
private var onTicketClick: OnTicketClickSaleListener? = null,
|
||||||
|
private var saleAdapter: SaleAdapterReserveSacadorSaleGroup? = null,
|
||||||
|
private var onReserveSaleClick: OnSaleReserveClickListener? = null,
|
||||||
|
private var onAddItemClickListener: OnAddItemClickListener? = null,
|
||||||
|
private var type: String? = null,
|
||||||
|
|
||||||
|
) : RecyclerView.Adapter<SaleAdapterReserveSacadorSaleGroup.AjustesItemHolder>() {
|
||||||
|
var context: Context? = null
|
||||||
|
var position: Int = 0
|
||||||
|
|
||||||
|
var isExpanded: Boolean = false
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||||
|
this.context = parent.context
|
||||||
|
|
||||||
|
|
||||||
|
return AjustesItemHolder(
|
||||||
|
|
||||||
|
SaleRowFragmentReserveSacadorBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context), parent, false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() = items.size
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
|
||||||
|
this.position = position
|
||||||
|
holder.bind(items[position])
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class AjustesItemHolder(
|
||||||
|
val binding: SaleRowFragmentReserveSacadorBinding
|
||||||
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
|
fun bind(sale: Sale) {
|
||||||
|
binding.apply {
|
||||||
|
|
||||||
|
//CLICK EVENTS
|
||||||
|
contentLayout.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
txtColor.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
txtDescrip.setOnClickListener {
|
||||||
|
if (!sale.isParent) {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ticketFk.setOnClickListener {
|
||||||
|
onTicketClick?.onTicketClickListener(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
txtParking.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleItemSearch
|
||||||
|
), sale.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
txtShelving.setOnClickListener {
|
||||||
|
onPackingClick.onPackingClick(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
txtItem.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleItemConsult
|
||||||
|
), sale.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//ERROR
|
||||||
|
|
||||||
|
if (sale.originalQuantity != sale.saleQuantity && sale.originalQuantity != null && !sale.isParent) {
|
||||||
|
layoutError.visibility = VISIBLE
|
||||||
|
txtError.text =
|
||||||
|
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
|
||||||
|
binding.addItem.visibility = VISIBLE
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layoutError.visibility = GONE
|
||||||
|
binding.addItem.visibility = GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.deleteReserve.visibility = if (sale.isAdded == 1) VISIBLE else GONE
|
||||||
|
|
||||||
|
if (sale.isAdded == 1) {
|
||||||
|
layoutError.visibility = VISIBLE
|
||||||
|
txtError.text = binding.root.context.getString(R.string.newItem)
|
||||||
|
binding.deleteReserve.setOnClickListener {
|
||||||
|
onReserveSaleClick!!.onSaleReserveListener(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sale.isParent) {
|
||||||
|
txtQuantity.visibility = INVISIBLE
|
||||||
|
txtQuantityReserved.visibility = INVISIBLE
|
||||||
|
txtReserveToComplete.visibility = GONE
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
ivArrow.visibility = VISIBLE
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
if (type != SACADOR && type != PREITEMPICKERTEST) {
|
||||||
|
val colorRes =
|
||||||
|
if (sale.hasMistake == true) R.color.verdnatura_red_salix else R.color.verdnatura_black
|
||||||
|
imageErrorMessage.imageTintList =
|
||||||
|
ColorStateList.valueOf(getColor(context!!, colorRes))
|
||||||
|
imageErrorMessage.visibility = VISIBLE
|
||||||
|
} else {
|
||||||
|
imageErrorMessage.visibility = GONE
|
||||||
|
}
|
||||||
|
ivArrow.visibility = INVISIBLE
|
||||||
|
}
|
||||||
|
println("sonSales RESERVESACADORSALEGROUP ${sale.sonSales}")
|
||||||
|
|
||||||
|
|
||||||
|
if (sale.saleGroupFk == null) {
|
||||||
|
previous.visibility = INVISIBLE
|
||||||
|
} else {
|
||||||
|
previous.visibility = VISIBLE
|
||||||
|
previous.text = "PREV:${sale.saleGroupFk}"
|
||||||
|
}
|
||||||
|
|
||||||
|
val result: Int
|
||||||
|
val textToConcat: String
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
result = sale.reservedQuantity % (sale.packing ?: (sale.saleQuantity + 1))
|
||||||
|
textToConcat = if (result != 0) {
|
||||||
|
"${sale.reservedQuantity / (sale.grouping ?: 1)} x ${sale.grouping ?: "1"}"
|
||||||
|
} else {
|
||||||
|
"${sale.reservedQuantity / (sale.packing ?: 1)} pack de ${sale.packing ?: "1"}"
|
||||||
|
}
|
||||||
|
binding.txtQuantityReserved.text = textToConcat
|
||||||
|
|
||||||
|
val textToConcat2: String
|
||||||
|
|
||||||
|
val result2: Int =
|
||||||
|
sale.accumulatedQuantity % (sale.packing ?: (sale.saleQuantity + 1))
|
||||||
|
textToConcat2 = if (result2 != 0) {
|
||||||
|
"${(sale.saleQuantity - sale.accumulatedQuantity) / (sale.grouping ?: 1)} x ${sale.grouping ?: "1"}"
|
||||||
|
} else {
|
||||||
|
"${(sale.saleQuantity - sale.accumulatedQuantity) / (sale.packing ?: 1)} pack de ${sale.packing ?: "1"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sale.totalItemShelving > 1) {
|
||||||
|
binding.txtQuantityReserved.text = textToConcat
|
||||||
|
binding.txtQuantity.text = textToConcat2
|
||||||
|
binding.txtReserveToComplete.text =
|
||||||
|
"${sale.currentItemShelving}/${sale.totalItemShelving}"
|
||||||
|
binding.txtReserveToComplete.visibility = VISIBLE
|
||||||
|
binding.txtQuantity.text =
|
||||||
|
"${sale.reservedQuantity}"
|
||||||
|
} else {
|
||||||
|
binding.txtQuantity.text = "${sale.reservedQuantity}"
|
||||||
|
binding.txtReserveToComplete.visibility = GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ex.message!!.toast(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
binding.txtReserveToComplete.text =
|
||||||
|
"${sale.currentItemShelving}/${sale.totalItemShelving}"
|
||||||
|
|
||||||
|
//COLORES
|
||||||
|
paintTicketcolor(sale.rgb, binding.itemTicketColor.background)
|
||||||
|
if (sale.isPicked == 1) {
|
||||||
|
if (type == PREPARED) {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
|
||||||
|
if (sale.saleGroupFk == null) {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_orange_salix
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
println("stateCode ${sale.stateCode}")
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "PREPARED") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_orange_salix
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "OK PREVIOUS") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_sky_blue
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if (sale.stateCode != null && sale.stateCode == "PREVIOUS_CONTROLLED") {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_mint_light
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_black
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_dark_sky_blue
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
contentLayout.setBackgroundColor(
|
||||||
|
getColor(
|
||||||
|
context!!, R.color.verdnatura_black
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.txtParking.text =
|
||||||
|
// if (type == PREPARED) sale.parkingCodePrevia else sale.parkingCode
|
||||||
|
sale.parkingCode ?: sale.parkingCodePrevia
|
||||||
|
|
||||||
|
binding.addItem.setOnClickListener {
|
||||||
|
onAddItemClickListener!!.onAddItemClickListener(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == PREITEMPICKERTEST) {
|
||||||
|
binding.level.visibility = GONE
|
||||||
|
binding.levelTxt.visibility = GONE
|
||||||
|
binding.ticketOrder.visibility = VISIBLE
|
||||||
|
binding.txtPoints.visibility = GONE
|
||||||
|
} else {
|
||||||
|
binding.level.visibility = VISIBLE
|
||||||
|
binding.levelTxt.visibility = VISIBLE
|
||||||
|
binding.ticketOrder.visibility = GONE
|
||||||
|
binding.txtPoints.visibility = VISIBLE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sale = sale
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun paintTicketcolor(color: String?, backgroundDrawableTicket: Drawable) {
|
||||||
|
|
||||||
|
if (color.isNullOrBlank()) {
|
||||||
|
DrawableCompat.setTint(
|
||||||
|
backgroundDrawableTicket, Color.TRANSPARENT
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
DrawableCompat.setTint(
|
||||||
|
backgroundDrawableTicket, Color.parseColor(color)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -27,6 +27,7 @@ import retrofit2.Response
|
||||||
|
|
||||||
class CollectionCheckerViewModel(val context: Context) : BaseViewModel(context) {
|
class CollectionCheckerViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
||||||
|
private val collectionViewModelChecker = CollectionViewModel(context)
|
||||||
|
|
||||||
//var isPaused: Boolean = false
|
//var isPaused: Boolean = false
|
||||||
|
|
||||||
|
@ -359,4 +360,14 @@ class CollectionCheckerViewModel(val context: Context) : BaseViewModel(context)
|
||||||
_isPaused.value = paused
|
_isPaused.value = paused
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleBySale(
|
||||||
|
saleFk: Number, quantityDiff: Int
|
||||||
|
|
||||||
|
) {
|
||||||
|
collectionViewModelChecker.itemShelvingSaleBySale(
|
||||||
|
saleFk = saleFk,
|
||||||
|
quantityDiff = quantityDiff
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -59,7 +59,7 @@ import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapterNew
|
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapterReserve
|
||||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
@ -82,7 +82,7 @@ import org.json.JSONObject
|
||||||
variables:
|
variables:
|
||||||
isVerifiedCollection
|
isVerifiedCollection
|
||||||
*/
|
*/
|
||||||
class CollectionFragmentPickerPreviousNew(
|
class CollectionFragmentPickerPreviousNewInterface(
|
||||||
var collection: CollectionTicket,
|
var collection: CollectionTicket,
|
||||||
var type: String = PRESACADOR,
|
var type: String = PRESACADOR,
|
||||||
private var hasPickingOrder: Boolean = false
|
private var hasPickingOrder: Boolean = false
|
||||||
|
@ -90,7 +90,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
CollectionViewModel::class
|
CollectionViewModel::class
|
||||||
) {
|
) {
|
||||||
private var sales: List<Sale> = listOf()
|
private var sales: List<Sale> = listOf()
|
||||||
private var saleAdapter: SaleAdapterNew? = null
|
private var saleAdapter: SaleAdapterReserve? = null
|
||||||
private var lm: LinearLayoutManager? = null
|
private var lm: LinearLayoutManager? = null
|
||||||
private var storedPosition: Int = 0
|
private var storedPosition: Int = 0
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
|
@ -119,7 +119,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(
|
fun newInstance(
|
||||||
collection: CollectionTicket, type: String, hasPickingOrder: Boolean = false
|
collection: CollectionTicket, type: String, hasPickingOrder: Boolean = false
|
||||||
) = CollectionFragmentPickerPreviousNew(collection, type, hasPickingOrder)
|
) = CollectionFragmentPickerPreviousNewInterface(collection, type, hasPickingOrder)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
override fun onAttach(context: Context) {
|
||||||
|
@ -141,6 +141,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
println("El tipo es $type ")
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
|
@ -158,9 +159,9 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = VISIBLE
|
||||||
binding.mainToolbar.backButton.visibility = View.VISIBLE
|
binding.mainToolbar.backButton.visibility = VISIBLE
|
||||||
collection.collectionFk.let {
|
collection.collectionFk.let {
|
||||||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
||||||
}
|
}
|
||||||
|
@ -237,6 +238,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
when (myQr.table) {
|
when (myQr.table) {
|
||||||
"saleGroup" -> {
|
"saleGroup" -> {
|
||||||
binding.scanInput.setText(myQr.id.toString())
|
binding.scanInput.setText(myQr.id.toString())
|
||||||
|
findSale(binding.scanInput.text.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
"buy" -> binding.scanInput.setText(myQr.more)
|
"buy" -> binding.scanInput.setText(myQr.more)
|
||||||
|
@ -437,19 +439,22 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
saleAdapter = SaleAdapterNew(myGroupList, pasillerosItemClickListener!!,
|
saleAdapter = SaleAdapterReserve(myGroupList, pasillerosItemClickListener!!,
|
||||||
|
|
||||||
object : OnSaleClickSaleListener {
|
object : OnSaleClickSaleListener {
|
||||||
override fun onSaleClick(sale: Sale) {
|
override fun onSaleClick(sale: Sale) {
|
||||||
|
|
||||||
|
println("sale ${sale.saleFk} ${sale.itemFk} ${sale.isPicked}")
|
||||||
val position =
|
val position =
|
||||||
myGroupList.indexOfFirst { it.itemShelvingSaleFk == sale.itemShelvingSaleFk }
|
myGroupList.indexOfFirst { it.itemShelvingSaleFk == sale.itemShelvingSaleFk }
|
||||||
if (position > -1) {
|
if (position > -1 && !myGroupList[position].isParent) {
|
||||||
if (sale.isPicked == 1) {
|
if (sale.isPicked == 1) {
|
||||||
unMarkLine(position, myGroupList[position])
|
unMarkLine(position, myGroupList[position])
|
||||||
} else {
|
} else {
|
||||||
showScanner(position, sale)
|
showScanner(position, sale)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//TODO desmarcamos una linea de previa ?
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -563,14 +568,27 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
isFoundSale = true
|
isFoundSale = true
|
||||||
storedPosition = indice
|
storedPosition = indice
|
||||||
viewModel.itemShelvingSaleSetSaleGroup(txtscan.toInt())
|
viewModel.itemShelvingSaleSetSaleGroup(txtscan.toInt())
|
||||||
setStateSaleGroup(txtscan.toInt())
|
//actualizamos padre
|
||||||
myGroupList[indice].stateCode =
|
myGroupList[indice].stateCode =
|
||||||
if (myGroupList[indice].stateCode == "PREPARED") {
|
if (myGroupList[indice].stateCode == "PREPARED") {
|
||||||
"OK PREVIOUS"
|
"OK PREVIOUS"
|
||||||
} else {
|
} else {
|
||||||
"PREPARED"
|
"PREPARED"
|
||||||
}
|
}
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
//actualizamos hijos
|
||||||
|
myGroupList[indice].sonSales.forEach {
|
||||||
|
it.stateCode = myGroupList[indice].stateCode
|
||||||
|
}
|
||||||
|
//actualizamos saleGroup
|
||||||
|
setStateSaleGroup(
|
||||||
|
txtscan.toInt(), if (myGroupList[indice].stateCode == "PREPARED") {
|
||||||
|
14
|
||||||
|
} else {
|
||||||
|
28
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// saleAdapter!!.notifyDataSetChanged()
|
||||||
break
|
break
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -594,7 +612,10 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
for (indice in sales.indices) {
|
for (indice in sales.indices) {
|
||||||
if (sales[indice].saleGroupFk != null && sales[indice].saleGroupFk == saleGroupScanned.toInt()) {
|
if (sales[indice].saleGroupFk != null && sales[indice].saleGroupFk == saleGroupScanned.toInt()) {
|
||||||
viewModel.itemShelvingSaleSetSaleGroup(saleGroupScanned.toInt())
|
viewModel.itemShelvingSaleSetSaleGroup(saleGroupScanned.toInt())
|
||||||
setStateSaleGroup(saleGroupScanned.toInt())
|
setStateSaleGroup(
|
||||||
|
saleGroupScanned.toInt(),
|
||||||
|
if (sales[indice].stateCode == "PREPARED") 28 else 14
|
||||||
|
)
|
||||||
storedPosition = indice
|
storedPosition = indice
|
||||||
mpok!!.start()
|
mpok!!.start()
|
||||||
return true
|
return true
|
||||||
|
@ -1082,7 +1103,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
if (distinctSaleGroups.isNotEmpty())
|
if (distinctSaleGroups.isNotEmpty())
|
||||||
distinctSaleGroups.forEach { saleGroup ->
|
distinctSaleGroups.forEach { saleGroup ->
|
||||||
setStateSaleGroup(saleGroup)
|
setStateSaleGroup(saleGroup, stateCodeId!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1090,8 +1111,8 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setStateSaleGroup(saleGroup: Number) {
|
private fun setStateSaleGroup(saleGroup: Number, stateCode: Number) {
|
||||||
viewModel.saleGroupUpdateState(saleGroup, stateCodeId!!)
|
viewModel.saleGroupUpdateState(saleGroup, stateCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showScanner(index: Int, sale: Sale) {
|
private fun showScanner(index: Int, sale: Sale) {
|
||||||
|
@ -1146,6 +1167,8 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
} else { // si tiene saleGroup se crea el padre con el tamaño e indicando que es padre, como ejemplo se toma el primer elemento
|
} else { // si tiene saleGroup se crea el padre con el tamaño e indicando que es padre, como ejemplo se toma el primer elemento
|
||||||
/*crea padre*/
|
/*crea padre*/
|
||||||
|
|
||||||
|
println("saleGroup $key lineas ${value.size}")
|
||||||
if (value.size > 1) {
|
if (value.size > 1) {
|
||||||
val mySale = //= value[0]
|
val mySale = //= value[0]
|
||||||
Sale(
|
Sale(
|
||||||
|
@ -1166,9 +1189,11 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
origin = value[0].origin,
|
origin = value[0].origin,
|
||||||
size = value[0].size,
|
size = value[0].size,
|
||||||
itemShelvingSaleFk = value[0].itemShelvingSaleFk,
|
itemShelvingSaleFk = value[0].itemShelvingSaleFk,
|
||||||
longName = value[0].parkingCode ?: "",
|
longName = value[0].parkingCodePrevia ?: "",
|
||||||
itemShelvingFk = 0,
|
itemShelvingFk = 0,
|
||||||
ticketOrder = value[0].ticketOrder ?: null
|
ticketOrder = value[0].ticketOrder ?: null,
|
||||||
|
parkingCodePrevia = value[0].parkingCodePrevia,
|
||||||
|
stateCode = value[0].stateCode
|
||||||
)
|
)
|
||||||
|
|
||||||
//prime elemento//hay que hacer una copia si no queda la referencia
|
//prime elemento//hay que hacer una copia si no queda la referencia
|
||||||
|
@ -1228,7 +1253,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
if (foundTicketInCollection != null) {
|
if (foundTicketInCollection != null) {
|
||||||
isVerifiedCollection = true
|
isVerifiedCollection = true
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
binding.fragmentSacadorCollections.visibility = View.VISIBLE
|
binding.fragmentSacadorCollections.visibility = VISIBLE
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
} else {
|
} else {
|
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.map
|
import androidx.lifecycle.map
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import es.verdnatura.MobileApplication
|
import es.verdnatura.MobileApplication
|
||||||
|
import es.verdnatura.R
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
|
@ -24,10 +25,12 @@ import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.ItemShelvingSale
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeListVO
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeListVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||||
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
|
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.SaleTrackingDelSalix
|
import es.verdnatura.presentation.view.feature.workermistake.model.SaleTrackingDelSalix
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
@ -192,6 +195,11 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val responseStateId: LiveData<Number> = _responseStateId
|
val responseStateId: LiveData<Number> = _responseStateId
|
||||||
val loadResponseStateId: LiveData<Event<Number>> = _responseStateId.map { Event(it) }
|
val loadResponseStateId: LiveData<Event<Number>> = _responseStateId.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseStatePreparedId by lazy { MutableLiveData<Number>() }
|
||||||
|
val responseStatePreparedId: LiveData<Number> = _responseStatePreparedId
|
||||||
|
val loadResponseStatePreparedId: LiveData<Event<Number>> =
|
||||||
|
_responseStatePreparedId.map { Event(it) }
|
||||||
|
|
||||||
private val _mistakeList by lazy { MutableLiveData<MistakeTypeListVO>() }
|
private val _mistakeList by lazy { MutableLiveData<MistakeTypeListVO>() }
|
||||||
val mistakeList: LiveData<MistakeTypeListVO>
|
val mistakeList: LiveData<MistakeTypeListVO>
|
||||||
get() = _mistakeList
|
get() = _mistakeList
|
||||||
|
@ -347,6 +355,54 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleBySale(
|
||||||
|
saleFk: Number, quantityDiff: Int
|
||||||
|
|
||||||
|
) {
|
||||||
|
salix.itemShelvingSaleTotalBySale(
|
||||||
|
filter = """{"where":{"saleFk":$saleFk},"limit":2}"""
|
||||||
|
).enqueue(object : SalixCallback<List<ItemShelvingSale>>(context) {
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<List<ItemShelvingSale>>) {
|
||||||
|
|
||||||
|
if (!response.body().isNullOrEmpty()) {
|
||||||
|
if (response.body()!!.size == 1) {
|
||||||
|
val itemList = response.body()
|
||||||
|
val itemShelvingFk = itemList?.firstOrNull()?.itemShelvingFk
|
||||||
|
salix.itemShelvingGet(
|
||||||
|
id = itemShelvingFk!!
|
||||||
|
).enqueue(object : SalixCallback<ItemShelving>(context) {
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<ItemShelving>) {
|
||||||
|
|
||||||
|
if (response.body() != null) {
|
||||||
|
val visible = response.body()!!.visible!!.toInt()
|
||||||
|
val differenceVisible = (visible + quantityDiff)
|
||||||
|
val available = response.body()!!.available!!.toInt()
|
||||||
|
val differenceAvailable = (available + quantityDiff)
|
||||||
|
|
||||||
|
val updateParams = mapOf(
|
||||||
|
"visible" to (differenceVisible),
|
||||||
|
"available" to (differenceAvailable)
|
||||||
|
)
|
||||||
|
|
||||||
|
salix.itemShelvingUpdate(
|
||||||
|
id = itemShelvingFk, params = updateParams
|
||||||
|
).enqueue(object : SalixCallback<ItemUbicador?>(context) {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun itemShelvingGet(
|
fun itemShelvingGet(
|
||||||
itemShelvingFk: Number, position: Int, quantity: Int
|
itemShelvingFk: Number, position: Int, quantity: Int
|
||||||
|
|
||||||
|
@ -502,6 +558,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
_responseCollectionAddItem.value = true
|
_responseCollectionAddItem.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
|
||||||
|
super.onError(Throwable(context.getString(R.string.errorAddItemReserva)))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,6 +579,20 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getStatePreparedId(stateCode: String) {
|
||||||
|
|
||||||
|
salix.getStateId(
|
||||||
|
filter = """{"where":{"code":"$stateCode"}, "fields":["id"]}""".trimMargin()
|
||||||
|
).enqueue(object : SalixCallback<JsonObject>(context) {
|
||||||
|
override fun onSuccess(response: Response<JsonObject>) {
|
||||||
|
_responseStatePreparedId.value =
|
||||||
|
response.body()?.get("id").toString().toInt()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun setStateSaleGroup(
|
fun setStateSaleGroup(
|
||||||
saleGroups: List<Number>, stateCode: Int
|
saleGroups: List<Number>, stateCode: Int
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -68,7 +68,8 @@ import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFra
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentChecker
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentChecker
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentCheckerPreviousNew
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentCheckerPreviousNew
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPicker
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPicker
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPickerPreviousNew
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPickerPreviousNewInterface
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPickerPreviousNewInterfaceSacador
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPreChecker
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPreChecker
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionShowTicketFragment
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionShowTicketFragment
|
||||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoFragment
|
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoFragment
|
||||||
|
@ -781,7 +782,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
addFragmentOnTop(PackingMistakeFragment.newInstance(itemTitle))
|
addFragmentOnTop(PackingMistakeFragment.newInstance(itemTitle))
|
||||||
}
|
}
|
||||||
|
|
||||||
getString(R.string.titlePrePickerTest) -> {
|
/* getString(R.string.titlePrePickerTest) -> {
|
||||||
|
addFragmentOnTop(SacadorFragmentNew.newInstance("PREITEMPICKERTEST"))
|
||||||
|
}*/
|
||||||
|
|
||||||
|
getString(R.string.preSacadorInterfaz) -> {
|
||||||
addFragmentOnTop(SacadorFragmentNew.newInstance("PREITEMPICKERTEST"))
|
addFragmentOnTop(SacadorFragmentNew.newInstance("PREITEMPICKERTEST"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -952,13 +957,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
}
|
}
|
||||||
|
|
||||||
"PREITEMPICKERTEST" -> {
|
"PREITEMPICKERTEST" -> {
|
||||||
|
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
CollectionFragmentPickerPreviousNew.newInstance(
|
CollectionFragmentPickerPreviousNewInterface.newInstance(
|
||||||
CollectionTicket(collectionFk = entryPoint.toInt()),
|
CollectionTicket(collectionFk = entryPoint.toInt()),
|
||||||
"PREITEMPICKERTEST",
|
"PREITEMPICKERTEST",
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1066,15 +1073,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
//Misma pantalla para los dos scador y prescador
|
//Misma pantalla para los dos scador y prescador
|
||||||
SACADOR -> {
|
SACADOR -> {
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
CollectionFragmentPickerPreviousNew.newInstance(
|
CollectionFragmentPickerPreviousNewInterfaceSacador.newInstance(
|
||||||
collection, type, hasPicking
|
collection, type, hasPicking
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
/* addFragmentOnTop(
|
|
||||||
CollectionFragmentPickerNew.newInstance(
|
|
||||||
collection, type, hasPicking
|
|
||||||
)
|
|
||||||
)*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,12 +282,22 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
)
|
)
|
||||||
//sacador
|
//sacador
|
||||||
if (isOnReservationModeSector == true || (!existSectorOnReservationMode && isOnReservationMode)) {
|
if (isOnReservationModeSector == true || (!existSectorOnReservationMode && isOnReservationMode)) {
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
R.drawable.ic_picker_ui, R.string.sacador_test, R.string.sacador_test
|
R.drawable.ic_picker_ui, R.string.sacador_test, R.string.sacador_test
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//a quitar
|
||||||
|
_pasillerositem.add(
|
||||||
|
PasillerosItemVO(
|
||||||
|
R.drawable.ic_picker_ui, R.string.titlePickers, R.string.titlePickersDescrip
|
||||||
|
|
||||||
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
R.drawable.ic_picker_ui, R.string.titlePickers, R.string.titlePickersDescrip
|
R.drawable.ic_picker_ui, R.string.titlePickers, R.string.titlePickersDescrip
|
||||||
|
@ -418,21 +428,25 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
workerActivityAdd(CodeWorkerAction.PREVIOUS)
|
workerActivityAdd(CodeWorkerAction.PREVIOUS)
|
||||||
|
|
||||||
if (isOnReservationModeSector == true || (!existSectorOnReservationMode && isOnReservationMode)) {
|
if (isOnReservationModeSector == true || (!existSectorOnReservationMode && isOnReservationMode)) {
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
R.drawable.ic_previous_presacador,
|
R.drawable.ic_previous_presacador,
|
||||||
R.string.titlePrePickerTest,
|
R.string.preSacadorInterfaz,
|
||||||
R.string.titlePickerDescrip
|
R.string.preSacadorInterfaz
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
R.drawable.ic_previous_presacador,
|
R.drawable.ic_previous_presacador,
|
||||||
R.string.titlePrePicker,
|
R.string.titlePrePicker,
|
||||||
R.string.titlePickerDescrip
|
R.string.titlePrePicker
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:clickable="false">
|
android:clickable="false">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/verdnatura_black"
|
android:background="@color/verdnatura_black">
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
@ -19,27 +16,26 @@
|
||||||
style="@style/ScanLineTextSearch"
|
style="@style/ScanLineTextSearch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:autofillHints="text"
|
||||||
android:hint="@string/Escaner"
|
android:hint="@string/Escaner"
|
||||||
android:inputType="textVisiblePassword"
|
android:inputType="textVisiblePassword"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:autofillHints="text"
|
android:paddingStart="@dimen/default_layout_margin"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/main_toolbar"
|
app:layout_constraintTop_toTopOf="@+id/main_toolbar" />
|
||||||
android:paddingStart="@dimen/default_layout_margin"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/previaButton"
|
android:id="@+id/previaButton"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:visibility="invisible"
|
|
||||||
android:tooltipText="@string/allowMarkSalesPrevia"
|
|
||||||
android:contentDescription="@string/previousCollected"
|
android:contentDescription="@string/previousCollected"
|
||||||
app:srcCompat="@drawable/ic_streetview_black_24dp"
|
android:tooltipText="@string/allowMarkSalesPrevia"
|
||||||
|
android:visibility="invisible"
|
||||||
app:layout_constraintStart_toEndOf="@+id/scan_input"
|
app:layout_constraintStart_toEndOf="@+id/scan_input"
|
||||||
app:layout_constraintTop_toTopOf="@+id/scan_input"
|
app:layout_constraintTop_toTopOf="@+id/scan_input"
|
||||||
/>
|
app:srcCompat="@drawable/ic_streetview_black_24dp" />
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/collection_swipe"
|
android:id="@+id/collection_swipe"
|
||||||
|
@ -56,8 +52,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
tools:listitem="@layout/sale_row_fragment" />
|
tools:listitem="@layout/sale_row_fragment_reserve_sacador" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{Integer.toString(sale.ticketFk)}"
|
android:text="@{Integer.toString(sale.ticketFk)}"
|
||||||
android:textColor="@color/verdnatura_black"
|
android:textColor="@color/verdnatura_black"
|
||||||
android:textSize="@dimen/h7"
|
android:textSize="@dimen/h9"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tool:text="123456789"
|
tool:text="123456789"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,337 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tool="http://schemas.android.com/tools"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="sale"
|
||||||
|
type="es.verdnatura.presentation.view.feature.sacador.model.Sale" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
|
||||||
|
>
|
||||||
|
<!--CABECERA=================================================-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/item_row_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/verdnatura_white"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="@dimen/layout_margin_min"
|
||||||
|
android:textColor="@color/verdnatura_black">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/levelTxt"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/layout_margin_minest"
|
||||||
|
android:text="@string/level"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h8" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/level"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/layout_margin_minest"
|
||||||
|
android:text="@{sale.level}"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h9"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="2" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtPoints"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/layout_margin_minest"
|
||||||
|
android:text="@string/ticketAbb"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h9" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ticketFk"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{Integer.toString(sale.ticketFk)}"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h7"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="123456789"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ticketOrder"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text='@{"(" + sale.ticketOrder + ")"}'
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h7"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="3" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/item_ticket_color"
|
||||||
|
android:layout_width="@dimen/semaforo_next_to_ticket"
|
||||||
|
android:layout_height="@dimen/semaforo_next_to_ticket"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:background="@drawable/background_and_round_collection_fragment" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/previous"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/layout_margin_minest"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h9"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="PREV:"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivArrow"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:contentDescription="@string/previousCollected"
|
||||||
|
android:rotation="180"
|
||||||
|
android:src="@drawable/ic_arrow_down" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageErrorMessage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:contentDescription="@string/error"
|
||||||
|
app:srcCompat="@drawable/emoticon_error_fragment" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/content_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="110dp"
|
||||||
|
android:background="#000000"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp">
|
||||||
|
|
||||||
|
<!-- Parte Izquierda -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_parking"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
tool:text="KA-04-4" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_shelving"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{sale.code}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
tool:text="QMV" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Parte Central -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="3"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_item"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{Long.toString(sale.itemFk)}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="18sp"
|
||||||
|
tool:text="1634405" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_color"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{sale.color}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tool:text="Mixto Natural" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_descrip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autoSizeMaxTextSize="16sp"
|
||||||
|
android:autoSizeMinTextSize="14sp"
|
||||||
|
android:autoSizeStepGranularity="2sp"
|
||||||
|
android:autoSizeTextType="uniform"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{sale.longName}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
tool:text="Set de 3 unidades Cesta pie" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Parte Derecha -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_quantity_reserved"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autoSizeMaxTextSize="18sp"
|
||||||
|
android:autoSizeMinTextSize="12sp"
|
||||||
|
android:autoSizeStepGranularity="1sp"
|
||||||
|
android:autoSizeTextType="uniform"
|
||||||
|
android:gravity="end|center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
tool:text="2 pack de 1500" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_quantity"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="end|center"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
tool:text="50/300" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_reserve_to_complete"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="end|center"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tool:text="1/2" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_error"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
tool:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_error"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="5"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
tool:text="Cantidad original 100" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/addItem"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
android:contentDescription="@string/images"
|
||||||
|
android:gravity="end"
|
||||||
|
android:src="@drawable/ic_add_black_24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/delete_reserve"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
android:contentDescription="im"
|
||||||
|
android:gravity="end"
|
||||||
|
android:src="@drawable/ic_delete_black_24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/item_article_placements"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/verdnatura_background_item_picker"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/item_placement_row"
|
||||||
|
tools:orientation="horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</layout>
|
|
@ -0,0 +1,336 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tool="http://schemas.android.com/tools"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="sale"
|
||||||
|
type="es.verdnatura.presentation.view.feature.sacador.model.Sale" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
|
||||||
|
>
|
||||||
|
<!--CABECERA=================================================-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/item_row_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/verdnatura_white"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="@dimen/layout_margin_min"
|
||||||
|
android:textColor="@color/verdnatura_black">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/levelTxt"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/layout_margin_minest"
|
||||||
|
android:text="@string/level"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h8" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/level"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/layout_margin_minest"
|
||||||
|
android:text="@{sale.level}"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h9"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="2" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtPoints"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/layout_margin_minest"
|
||||||
|
android:text="@string/ticketAbb"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h9" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ticketFk"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{Integer.toString(sale.ticketFk)}"
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h8"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="123456789"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ticketOrder"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text='@{"(" + sale.ticketOrder + ")"}'
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h8"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="3" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/item_ticket_color"
|
||||||
|
android:layout_width="@dimen/semaforo_next_to_ticket"
|
||||||
|
android:layout_height="@dimen/semaforo_next_to_ticket"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:background="@drawable/background_and_round_collection_fragment" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/previous"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/layout_margin_minest"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/h9"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="PREV:"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivArrow"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:contentDescription="@string/previousCollected"
|
||||||
|
android:rotation="180"
|
||||||
|
android:src="@drawable/ic_arrow_down" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageErrorMessage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:contentDescription="@string/error"
|
||||||
|
app:srcCompat="@drawable/emoticon_error_fragment" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/content_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="110dp"
|
||||||
|
android:background="#000000"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp">
|
||||||
|
|
||||||
|
<!-- Parte Izquierda -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_parking"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
tool:text="KA-04-4" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_shelving"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{sale.code}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
tool:text="QMV" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Parte Central -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="3"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_item"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{Long.toString(sale.itemFk)}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="18sp"
|
||||||
|
tool:text="1634405" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_color"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{sale.color}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tool:text="Mixto Natural" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_descrip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autoSizeMaxTextSize="16sp"
|
||||||
|
android:autoSizeMinTextSize="14sp"
|
||||||
|
android:autoSizeStepGranularity="2sp"
|
||||||
|
android:autoSizeTextType="uniform"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{sale.longName}"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
tool:text="Set de 3 unidades Cesta pie" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Parte Derecha -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_quantity_reserved"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autoSizeMaxTextSize="18sp"
|
||||||
|
android:autoSizeMinTextSize="12sp"
|
||||||
|
android:autoSizeStepGranularity="1sp"
|
||||||
|
android:autoSizeTextType="uniform"
|
||||||
|
android:gravity="end|center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
tool:text="2 pack de 1500" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_quantity"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="end|center"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
tool:text="50/300" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_reserve_to_complete"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="end|center"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tool:text="1/2" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_error"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
tool:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_error"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="5"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
tool:text="Cantidad original 100" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/addItem"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
android:gravity="end"
|
||||||
|
android:src="@drawable/ic_add_black_24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/delete_reserve"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
android:gravity="end"
|
||||||
|
android:src="@drawable/ic_delete_black_24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/item_article_placements"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/verdnatura_background_item_picker"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/item_placement_row"
|
||||||
|
tools:orientation="horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</layout>
|
Loading…
Reference in New Issue