feat: refs#8300 deprecatedCode

This commit is contained in:
Sergio De la torre 2025-02-05 10:37:42 +01:00
parent b6115837ae
commit ed6171da78
30 changed files with 137 additions and 1431 deletions

View File

@ -14,9 +14,7 @@ import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlV
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModel
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloViewModel
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.ItemShelvingLogViewModel
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.ShelvingLogViewModel
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoViewModel
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
import es.verdnatura.presentation.view.feature.packaging.fragment.SupplierViewModel
@ -158,13 +156,6 @@ val viewModelModule = module {
ControlVehiculoViewModel(androidContext())
}
viewModel {
HistoricoVehiculoViewModel(androidContext())
}
viewModel {
ItemShelvingLogViewModel(androidContext())
}
viewModel {
ShelvingLogViewModel(androidContext())
}

View File

@ -6,7 +6,6 @@ import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardRowVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
@ -140,10 +139,6 @@ interface OnTrashItemRowClickListener {
fun onTrashItemRowClickListener(item: WorkForms)
}
interface OnLocationRowClickListener {
fun onLocationRowClickListener(item: ItemLocationVO)
}
interface OnInvetoryNichoClickListener {
fun onInvetoryNichoClickListener(item: ItemInventaryVO)
}

View File

@ -2,19 +2,20 @@ package es.verdnatura.presentation.view.feature.buscaritem.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemLocationRowBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemShelvings
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
class LocationAdapter(
private val items: List<ItemLocationVO>,
private val items: List<ItemShelvings>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
) : RecyclerView.Adapter<LocationAdapter.ItemHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
ItemLocationRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
@ -26,8 +27,19 @@ class LocationAdapter (
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
holder.binding.root.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title =
R.string.titleUbicator),items[position].Matricula)
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
title =
R.string.titleUbicator
), items[position].shelving.code
)
}
holder.binding.root.setOnLongClickListener {
items[position].shelving.parking.sector.description.toast(
holder.binding.root.context,
Toast.LENGTH_SHORT
)
true
}
}
@ -35,8 +47,7 @@ class LocationAdapter (
class ItemHolder(
val binding: ItemLocationRowBinding
) : RecyclerView.ViewHolder(binding.root) {
//private val res = binding.root.context.resources
fun bind(item: ItemLocationVO) {
fun bind(item: ItemShelvings) {
binding.apply {
this.item = item
}

View File

@ -10,6 +10,7 @@ import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.itemScanValue
import es.verdnatura.presentation.view.feature.buscaritem.adapter.LocationAdapter
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemShelvings
class BuscarItemFragment(
var itemFk: Any? = null
@ -33,7 +34,7 @@ class BuscarItemFragment(
binding.mainToolbar.toolbarTitle.text = getString(R.string.getubicaition)
setEvents()
if (itemFk != null) {
getLocations(itemFk!!)
viewModel.getIdFromCodeSalix(itemFk!!.toString())
}
super.init()
}
@ -66,17 +67,22 @@ class BuscarItemFragment(
private fun getLocations(itemFk: Any) {
this.itemFk = itemFk
viewModel.itemshelvingGetInfo(itemFk)
viewModel.getIdFromCodeSalix(itemFk.toString())
}
override fun observeViewModel() {
with(viewModel) {
loadLocationList.observe(viewLifecycleOwner) { event ->
loadItemShelvingsList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { itemResponse ->
try {
adapter = LocationAdapter(itemResponse.list, pasillerosItemClickListener!!)
val sortedList = itemResponse.list.sortedWith(
compareByDescending<ItemShelvings> { it.shelving.priority }
.thenBy { it.created }
)
adapter = LocationAdapter(sortedList, pasillerosItemClickListener!!)
binding.locationRecyclerview.adapter = adapter
binding.locationRecyclerview.layoutManager =
LinearLayoutManager(

View File

@ -5,24 +5,44 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.map
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.buscaritem.model.LocationListVO
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemShelvings
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemShelvingsList
import retrofit2.Response
class BuscarItemViewModel(val context: Context) : BaseViewModel(context) {
private val _locationList by lazy { MutableLiveData<LocationListVO>() }
val locationList: LiveData<LocationListVO>
get() = _locationList
val loadLocationList: LiveData<Event<LocationListVO>> = _locationList.map { Event(it) }
fun itemshelvingGetInfo(itemFk: Any) {
salix.itemshelvingGetInfo(params = arrayListOf(itemFk).formatWithQuotes())
.enqueue(object : SalixCallback<List<ItemLocationVO>>(context) {
override fun onSuccess(response: Response<List<ItemLocationVO>>) {
_locationList.value = response.body()?.let { LocationListVO(it) }
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
private val _itemShelvingsList by lazy { MutableLiveData<ItemShelvingsList>() }
val itemShelvingsList: LiveData<ItemShelvingsList> = _itemShelvingsList
val loadItemShelvingsList: LiveData<Event<ItemShelvingsList>> =
_itemShelvingsList.map { Event(it) }
fun getIdFromCodeSalix(code: String) {
getItemFromBarcodeUseCase.execute(code)
.enqueue(object : SalixCallback<Int?>(context) {
override fun onSuccess(response: Response<Int?>) {
if (response.body() != null) {
itemshelvingsGet(response.body()!!)
}
}
})
}
fun itemshelvingsGet(itemFk: Any) {
salix.itemShelvingsGet(
filter = """{"where":{"itemFk":$itemFk},"fields":["created","visible","available","shelvingFk"],
|"include":[{"relation":"shelving","scope":{"fields":["code","priority","parkingFk"],
|"include":{"relation":"parking","scope":{"fields":["code","sectorFk"]}}}}]}""".trimMargin()
)
.enqueue(object : SalixCallback<List<ItemShelvings>>(context) {
override fun onSuccess(response: Response<List<ItemShelvings>>) {
_itemShelvingsList.value = response.body()?.let { ItemShelvingsList(it) }
}
})

View File

@ -2,21 +2,27 @@ package es.verdnatura.presentation.view.feature.buscaritem.model
import es.verdnatura.domain.isoToString
class ItemLocationVO(
var Parking: String = "",
var Matricula: String = "",
var visible: Int = 0,
var itemFk: Int = 0,
var priority: Int = 0
class ItemShelvingsList(
var list: List<ItemShelvings> = listOf()
)
data class ItemShelvings(
val visible: Int, val available: Int, val shelving: Shelving
) {
var created: String = ""
get() {
return field.isoToString()
}
}
class LocationListVO(
var list: List<ItemLocationVO> = listOf()
data class Shelving(
val code: String, val priority: Int, val parking: Parking
)
data class Parking(
val code: String, val sector: Sector
)
data class Sector(
val description: String
)

View File

@ -1,356 +0,0 @@
package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.util.TypedValue
import android.view.View.GONE
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.common.hideKeyboard
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ControlVehiculoFragment(
private var tagName: String = ""
) : BaseFragment<FragmentVehiclecontrolBinding, ControlVehiculoViewModel>(
ControlVehiculoViewModel::class
) {
private var goBack: Boolean = false
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
override fun getLayoutId(): Int = R.layout.fragment_vehiclecontrol
private lateinit var customDialog: CustomDialog
private var isWorkedTimed = "UNREGISTERED"
private lateinit var customDialogInput: CustomDialogInput
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
companion object {
fun newInstance(tagName: String) = ControlVehiculoFragment(tagName)
}
override fun onAttach(context: Context) {
super.onAttach(context)
if (context is OnCollectionSelectedListener) onCollectionSelectedListener = context
}
override fun init() {
customDialog = CustomDialog(requireContext())
customDialogInput = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
goBack = false
if (tagName == HistoricoVehiculoFragment.TAG) {
setToolBar("HISTORY")
showScanner(getString(R.string.scanShelvingHistorical), "HISTORY")
} else {
checkControlTimeVehicle()
setToolBar("ALL")
}
setEvents()
super.init()
}
override fun onPause() {
goBack = true
super.onPause()
}
private fun setToolBar(direction: String?) {
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontrol)
binding.mainToolbar.toolbarTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13F)
val listIcons: ArrayList<ImageView> = ArrayList()
val iconHistory = ImageView(context)
iconHistory.setImageResource(R.drawable.ic_history_black_24dp)
val iconVehicleIn = ImageView(context)
iconVehicleIn.setImageResource(R.drawable.car)
val iconVehicleOut = ImageView(context)
iconVehicleOut.setImageResource(R.drawable.car_off)
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
iconVehicleOut.tooltipText = getTooltip(R.drawable.car_off)
when (direction) {
"OUT" -> {
listIcons.remove(iconVehicleIn)
listIcons.add(iconVehicleOut)
listIcons.add(iconHistory)
}
"IN" -> {
listIcons.remove(iconVehicleOut)
listIcons.add(iconVehicleIn)
listIcons.add(iconHistory)
}
}
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
when (item) {
iconHistory.drawable -> showScanner(
getString(R.string.scanShelvingHistorical), "HISTORY"
)
iconVehicleIn.drawable -> showScanner(getString(R.string.scanPlate), "IN")
iconVehicleOut.drawable -> showScanner(
getString(R.string.scanPlateTakeoff), "OUT"
)
}
}
})
binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
private fun showScanner(description: String, action: String) {
customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription(description)
.setOkButton(getString(R.string.accept)) {
if (customDialogInput.getValue().isNotEmpty()) {
insertControlTimeVehicle(customDialogInput.getValue(), action)
}
}
.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
if (tagName == HistoricoVehiculoFragment.TAG) {
ma.onMyBackPressed()
}
}.setValue("").show()
customDialogInput.setFocusText()
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (customDialogInput.getValue().isNotEmpty()) {
insertControlTimeVehicle(customDialogInput.getValue(), action)
}
return@setOnEditorActionListener true
}
false
}
}
private fun checkControlTimeVehicle() {
if (!goBack) {
try {
viewModel.workerMachineryIsRegistered(mobileApplication.userId!!)
} catch (ex: Exception) {
ma.messageWithSound(
message = getString(R.string.errorUserId),
isError = true,
isToasted = true,
isPlayed = true
)
}
}
}
private fun insertControlTimeVehicle(plateNumber: String, direction: String) {
when (direction) {
"HISTORY" -> {
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = R.string.titleHistoricalHide), plateNumber
)
}
"IN" -> {
viewModel.machineWorkerUpdate(plateNumber)
}
"OUT" -> {
viewModel.machineWorkerUpdate(plateNumber)
}
"" -> {
ma.openFragmentPickers(true)
}
}
customDialogInput.setValue("")
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}
private fun scanRequest() {
binding.scanInput.requestFocus()
hideKeyboards()
}
private fun hideKeyboards() {
try {
requireActivity().hideKeyboard()
} catch (e: Exception) {
println(e.message)
}
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.openFragmentPickers(true)
}
binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (!binding.scanInput.text.isNullOrEmpty()) {
if (tagName == HistoricoVehiculoFragment.TAG) {
showOptionsHistorical(binding.scanInput.text.toString())
} else {
showOptionsVehicleControl(binding.scanInput.text.toString())
}
}
binding.scanInput.setText("")
ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true
}
false
}
}
private fun showOptionsVehicleControl(plate: String) {
customDialogThreeButtons.setCustomDialogValue(GONE)
customDialogThreeButtons.setDescription(getString(R.string.doVehiclePlate) + plate + "?")
.setValue(plate)
if (isWorkedTimed == "UNREGISTERED") {
customDialogThreeButtons.setOkButtonTwo("COGER") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
getString(R.string.returnScan).toast(requireContext())
} else {
customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "IN")
}
}
} else {
customDialogThreeButtons.setOkButtonThree("DEJAR") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
getString(R.string.returnScan).toast(requireContext())
} else {
customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "OUT")
}
}
}.setOkButtonFour(getString(R.string.historical)) {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
getString(R.string.returnScan).toast(requireContext())
} else {
customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY")
}
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
}
private fun showOptionsHistorical(plate: String) {
customDialogThreeButtons.setCustomDialogValue(GONE)
customDialogThreeButtons.setDescription(getString(R.string.doVehiclePlate) + plate + "?")
.setValue(plate)
.setOkButtonFour(getString(R.string.historical)) {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
getString(R.string.returnScan).toast(requireContext())
} else {
customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY")
}
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
}
override fun observeViewModel() {
with(viewModel) {
responseUpdate.observe(viewLifecycleOwner) {
ma.openFragmentPickers(false)
}
responseControl.observe(viewLifecycleOwner) {
if (it == "1") {
isWorkedTimed = "REGISTERED"
setToolBar("OUT")
if (tagName != SacadorFragment.TAG) {
ma.openFragmentPickers(false)
}
} else {
if (it == "0") {
setToolBar("IN")
customDialogInput.setTitle(getString(R.string.vehiclecontrol))
.setDescription(getString(R.string.scanPlate))
.setOkButton(getString(R.string.takeVehicle)) {
if (customDialogInput.getValue().isNotEmpty()) {
insertControlTimeVehicle(customDialogInput.getValue(), "IN")
}
customDialogInput.setValue("")
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}
.setKoButton(getString(R.string.noVehicle)) {
customDialogInput.dismiss()
ma.openFragmentPickers(true)
}.setValue("").show()
customDialogInput.setFocusText()
}
}
}
}
}
}

View File

@ -16,44 +16,12 @@ import retrofit2.Response
class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
private val _responseUpdate by lazy { MutableLiveData<Any>() }
val responseUpdate: LiveData<Any>
get() = _responseUpdate
private val _responseControl by lazy { MutableLiveData<String>() }
val responseControl: LiveData<String>
get() = _responseControl
private val _responseMachine by lazy { MutableLiveData<ResponseItemMachineControl>() }
val responseMachine: LiveData<ResponseItemMachineControl>
get() = _responseMachine
private val _responseGetName by lazy { MutableLiveData<NameWorker>() }
val responseGetName: LiveData<NameWorker> = _responseGetName
fun machineWorkerUpdate(
plate: String
) {
salix.machineWorkerUpdateInTime(hashMapOf("plate" to plate))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_responseUpdate.value = response.body()
}
})
}
fun workerMachineryIsRegistered(userId: Int) {
salix.workerMachineryIsRegistered(arrayListOf(userId))
.enqueue(object : SalixCallback<String>(context) {
override fun onSuccess(response: Response<String>) {
_responseControl.value =
response.body()!!
}
})
}
fun deviceProductionGetnameDevice(androidId: String) {

View File

@ -1,73 +0,0 @@
package es.verdnatura.presentation.view.feature.historicoshelving.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemShelvinglogRowBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
class ItemShelvingLogAdapter(
private var items: List<ItemShelvingLog>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
) : RecyclerView.Adapter<ItemShelvingLogAdapter.ItemHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
ItemShelvinglogRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
)
}
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
holder.binding.root.setOnClickListener {
if (!items[position].shelvingFk.isNullOrEmpty()) {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
title =
R.string.titleUbicator
), items[position].shelvingFk!!
)
}
}
}
fun addList(list:List<ItemShelvingLog>){
items = list
notifyDataSetChanged()
}
inner class ItemHolder(
val binding: ItemShelvinglogRowBinding
) : RecyclerView.ViewHolder(binding.root) {
private val res = binding.root.context.resources
fun bind(item: ItemShelvingLog) {
binding.apply {
binding.txtNickname.setOnClickListener {
if (item.worker?.id != null) openWorker(binding, item.worker?.id!!)
}
binding.txtVisible.setOnClickListener {
if (item.worker?.id != null) openWorker(binding, item.worker?.id!!)
}
this.item = item
}
}
}
private fun openWorker(binding: ItemShelvinglogRowBinding, id: Int) {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(title = R.string.titleUserControlVehicle),
id.toString()
)
}
}

View File

@ -1,153 +0,0 @@
package es.verdnatura.presentation.view.feature.historicoshelving.fragment
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentItemshelvinglogBinding
import es.verdnatura.domain.ConstAndValues.LIMITRECORDSSHELVINGLOG
import es.verdnatura.domain.toLong
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.historicoshelving.adapter.ItemShelvingLogAdapter
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ItemShelvingLogFragment(
var entryPoint: String = ""
) : BaseFragment<FragmentItemshelvinglogBinding, ItemShelvingLogViewModel>(ItemShelvingLogViewModel::class) {
private var adapter: ItemShelvingLogAdapter? = null
private var itemScan = ""
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
private var records: Int = LIMITRECORDSSHELVINGLOG
private var shelving: String = ""
private var positionScroll = 0
private var positionToReturn = 0
companion object {
fun newInstance(entryPoint: String) = ItemShelvingLogFragment(entryPoint)
}
private lateinit var customDialog: CustomDialog
override fun getLayoutId(): Int = R.layout.fragment_itemshelvinglog
override fun init() {
customDialog = CustomDialog(requireContext())
setEvents()
setToolBar(getString(R.string.itemShelvingLog))
setAdapter()
super.init()
}
private fun setAdapter() {
binding.itemshelvinglogRecyclerview.layoutManager =
LinearLayoutManager(
requireContext(),
LinearLayoutManager.VERTICAL,
false
)
adapter = ItemShelvingLogAdapter(
listOf(),
onPasillerosItemClickListener = pasillerosItemClickListener!!
)
binding.itemshelvinglogRecyclerview.adapter = adapter
}
override fun onAttach(context: Context) {
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
super.onAttach(context)
}
private fun setToolBar(title: String) {
binding.mainToolbar.toolbarTitle.text = title
}
private fun setEvents() {
val scrollView = binding.scrollView
scrollView.setOnScrollChangeListener { _, _, scrollY, _, _->
positionScroll = scrollY
}
binding.scanInput.requestFocus()
binding.loadMoreButton.setOnClickListener {
positionToReturn = positionScroll
records += LIMITRECORDSSHELVINGLOG
try {
viewModel.getIdFromCodeSalix(shelving.toLong().toString(), records)
} catch (ex: Exception) {
viewModel.itemShelvingLogGet(
shelving,
records
)
}
}
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (binding.scanInput.text.toString().isNotEmpty()) {
//Tarea 7168
shelving = binding.scanInput.text.toString()
records = LIMITRECORDSSHELVINGLOG
try {
viewModel.getIdFromCodeSalix(binding.scanInput.toLong().toString(), records)
} catch (ex: Exception) {
viewModel.itemShelvingLogGet(
shelving,
records
)
}
}
binding.scanInput.setText("")
ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true
}
false
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed()
}
}
override fun observeViewModel() {
with(viewModel) {
itemShelvingLogList.observe(viewLifecycleOwner) {
if (it.list.isEmpty()) {
customDialog.setTitle(getString(R.string.noResults))
.setDescription(getString(R.string.noDataLabelScanned))
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
} else {
//TAREA 7168
if (it.list.size == records) {
binding.loadMoreButton.visibility = View.VISIBLE
} else {
binding.loadMoreButton.visibility = View.GONE
}
adapter!!.addList(it.list)
setToolBar(getString(R.string.itemShelvingLog) + ":" + itemScan)
val handler = Handler(Looper.getMainLooper())
handler.postDelayed({
binding.scrollView.smoothScrollTo(0, positionToReturn)
}, 1000)
}
}
}
}
}

View File

@ -1,64 +0,0 @@
package es.verdnatura.presentation.view.feature.historicoshelving.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.ConstAndValues.LIMITRECORDSSHELVINGLOG
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLogList
import retrofit2.Response
class ItemShelvingLogViewModel(val context: Context) : BaseViewModel(context) {
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
private val _itemShelvingLogList by lazy { MutableLiveData<ItemShelvingLogList>() }
val itemShelvingLogList: LiveData<ItemShelvingLogList> = _itemShelvingLogList
private val _responseCode by lazy { MutableLiveData<Int?>() }
val responseCode: LiveData<Int?> = _responseCode
fun itemShelvingLogGet(shelvingOrItem: String, records: Int = LIMITRECORDSSHELVINGLOG) {
//tarea 7168
salix.itemShelvingLogGet(
filter = """{ "where": { "or": [ {"shelvingFk": "$shelvingOrItem"}, {"itemFk": "$shelvingOrItem"} ] },
"limit": $records,
"order": "created DESC",
"include": [ { "relation": "worker", "scope": { "fields": ["code"]} },
{ "relation": "item", "scope": { "fields": ["longName"] } } ] }
""".trim()
)
.enqueue(object :
SalixCallback<List<ItemShelvingLog>>(context) {
override fun onSuccess(response: Response<List<ItemShelvingLog>>) {
_itemShelvingLogList.value = response.body()?.let {
ItemShelvingLogList(it)
}
}
})
}
fun getIdFromCodeSalix(code: String, records: Int) {
getItemFromBarcodeUseCase.execute (code)
.enqueue(object : SalixCallback<Int?>(context) {
override fun onSuccess(response: Response<Int?>) {
itemShelvingLogGet(response.body()!!.toString(), records)
}
})
}
}

View File

@ -1,36 +0,0 @@
package es.verdnatura.presentation.view.feature.historicoshelving.model
import es.verdnatura.domain.isoToString
data class ItemShelvingLog(
var itemFk: Int? = null,
var longName: String? = null,
var shelvingFk: String? = null,
var visible: Int? = null,
var accion: String? = null,
var code: String? = null,
var worker: Worker? = null,
var item:ItemSalix? = null
) {
var created: String = ""
get() {
return field.isoToString(returnOnlyDate = false)
}
}
data class ItemSalix(var longName: String?)
data class ItemShelvingSaleDateList(
var list: List<ItemShelvingLog> = listOf()
)
data class ItemShelvingLogList(
var list: List<ItemShelvingLog> = listOf()
)
data class Worker(
var id:Int? ,
var code: String,
)

View File

@ -1,48 +0,0 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemHistoricovehiculoRowBinding
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
import java.text.SimpleDateFormat
import java.util.*
class HistoricoVehiculoAdapter (
private val items: List<ItemHistoricoVehiculo>
): RecyclerView.Adapter<HistoricoVehiculoAdapter.ItemHolder> () {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
ItemHistoricovehiculoRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
)
}
override fun getItemCount() =items.size
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
}
inner class ItemHolder(
val binding: ItemHistoricovehiculoRowBinding
) : RecyclerView.ViewHolder(binding.root){
private val res = binding.root.context.resources
fun bind(item: ItemHistoricoVehiculo) {
binding.apply {
this.item = item
val sdf = SimpleDateFormat(binding.root.context.getString(R.string.dateFormat))
val currentDate = sdf.format(Date())
if (currentDate == item.inTimed){
historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.context,R.color.verdnatura_pumpkin_orange))
}else{
historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.context,R.color.verdnatura_black_5))
}
}
}
}
}

View File

@ -1,93 +0,0 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentHistoricovehiculoBinding
import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.view.feature.historicovehiculo.adapter.HistoricoVehiculoAdapter
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
class HistoricoVehiculoFragment(
private var numberPlate: String = ""
) : BaseFragment<FragmentHistoricovehiculoBinding, HistoricoVehiculoViewModel>(
HistoricoVehiculoViewModel::class
) {
private var adapter: HistoricoVehiculoAdapter? = null
companion object {
fun newInstance(entryPoint: String) = HistoricoVehiculoFragment(entryPoint)
}
override fun getLayoutId(): Int = R.layout.fragment_historicovehiculo
override fun init() {
ma.hideBottomNavigation(View.GONE)
viewModel.machineWorkeGetHistorical(numberPlate,mobileApplication.userId!!)
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclediary)
setEvents()
super.init()
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed()
}
}
override fun observeViewModel() {
with(viewModel) {
loadHistoricoVehiculoList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
if (it.list.isEmpty()) {
ma.messageWithSound(
getString(R.string.lookWithpermission),
isError = true,
isPlayed = true,
getString(
R.string.info
)
)
} else {
adapter = HistoricoVehiculoAdapter(it.list)
binding.historicovehiculoRecyclerview.adapter = adapter
binding.historicovehiculoRecyclerview.layoutManager =
LinearLayoutManager(
requireContext(),
LinearLayoutManager.VERTICAL,
false
)
navigateToToday(it)
}
}
}
}
}
private fun navigateToToday(it: ItemHistoricoVehiculoList) {
var positionToday = 0
val sdf = SimpleDateFormat(getString(R.string.dateFormat), Locale.getDefault())
val currentDate = sdf.format(Date())
for (item in it.list) {
if (currentDate == item.inTimed) {
break
}
positionToday += 1
}
binding.historicovehiculoRecyclerview.scrollToPosition(positionToday)
}
}

View File

@ -1,31 +0,0 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.map
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
import retrofit2.Response
class HistoricoVehiculoViewModel(var context: Context) : BaseViewModel(context) {
private val _historicovehiculoList by lazy { MutableLiveData<ItemHistoricoVehiculoList>() }
val loadHistoricoVehiculoList: LiveData<Event<ItemHistoricoVehiculoList>> = _historicovehiculoList.map { Event(it) }
fun machineWorkeGetHistorical(plateNumber: String, workerId:Int) {
salix.machineWorkerGetHistorical(arrayListOf(plateNumber,workerId).formatWithQuotes())
.enqueue(object :
SalixCallback<List<ItemHistoricoVehiculo>>(context) {
override fun onSuccess(response: Response<List<ItemHistoricoVehiculo>>) {
_historicovehiculoList.value =
response.body()?.let { ItemHistoricoVehiculoList(it) }
}
})
}
}

View File

@ -1,22 +0,0 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.model
import es.verdnatura.domain.isoToString
class ItemHistoricoVehiculo(
var workerName: String? = null,
) {
var inTimed: String = ""
get() {
return field.isoToString()
}
var outTimed: String = ""
get() {
return field.isoToString()
}
}
class ItemHistoricoVehiculoList(
var list: List<ItemHistoricoVehiculo> = listOf()
)

View File

@ -556,13 +556,6 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
)
)
/* _pasillerositem.add(
PasillerosItemVO(
R.drawable.revision_icon,
R.string.titleShelvingHistorical,
R.string.titleShelvingHistDescrip
)
)*/
_pasillerositem.add(
PasillerosItemVO(

View File

@ -16,7 +16,6 @@ import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput
@ -132,7 +131,6 @@ class SacadorFragment(
}
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
iconPrint.drawable -> {
showPrintPrevious()
}

View File

@ -16,7 +16,6 @@ import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnCollectionTicketSelectedListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.common.convertToDateString
import es.verdnatura.presentation.view.component.CustomDialog
@ -134,7 +133,6 @@ class SacadorFragmentNew(
}
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
iconPrint.drawable -> {
showPrintPrevious()
}

View File

@ -258,47 +258,6 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun hasItemOlder(
shelvingFk: String,
parking: String?,
itemFk: Int?,
action: Action?,
itemShelvingFk: Number? = null
) {
salix.getListItemNewerNew(shelvingFk, parking, itemFk)
//salix.getListItemNewer(shelvingFk, parking)
.enqueue(object : SalixCallback<List<ItemShelvingNewer>>(context) {
override fun onSuccess(response: Response<List<ItemShelvingNewer>>) {
if (response.body()!!.isEmpty()) {
when (action) {
Action.PARKINEAR -> setParking(shelvingFk, parking!!)
Action.TRANSFERIR -> {
itemShelvingTransfer(itemShelvingFk!!, shelvingFk)
}
null -> setParking(shelvingFk, parking!!)
}
} else {
_shelvingListItemNewer.value =
response.body()?.let {
ItemShelvingNewerList(
it,
originalShelvingFk = shelvingFk,
originalParking = parking!!,
originalItem = itemFk,
originalAction = action
)
}
}
}
})
}
fun getItemsByReviewOrder(
shelving: String,
parking: String?,

View File

@ -63,6 +63,15 @@
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/reserve"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -1,75 +0,0 @@
<?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:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/toolbar_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal"
android:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:text="@string/Worker"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:text="@string/InTimed"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/OutTimed"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/historicovehiculo_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
tools:listitem="@layout/item_historicovehiculo_row" />
</LinearLayout>
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -1,117 +0,0 @@
<?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:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/scan_input"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:hint="@string/Escaneaetiqueta"
android:inputType="text"
android:lines="1"
android:maxLines="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal"
android:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/itemfk"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/name"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center"
android:text="@string/wagoon"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:text="@string/quantity"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/itemshelvinglog_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:visibility="visible"
tools:listitem="@layout/item_shelvinglog_row" />
<Button
android:id="@+id/load_more_button"
android:layout_width="200dp"
android:layout_height="40dp"
android:text="Cargar más resultados"
android:layout_centerHorizontal="true"
android:background="@color/verdnatura_orange_salix"
android:textColor="@color/verdnatura_white"
android:layout_below="@id/itemshelvinglog_recyclerview"
android:layout_marginTop="16dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
>
<data>
<variable
name="item"
type="es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/item_row_layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verdnatura_black_5"
android:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min"
android:paddingTop="@dimen/pasilleros_margin_main_menu"
android:paddingBottom="@dimen/pasilleros_margin_main_menu">
<TextView
android:id="@+id/historico_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{item.workerName}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:gravity="center"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.inTimed}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.outTimed}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/verdnatura_black_9"/>
</LinearLayout>
</layout>

View File

@ -1,72 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="item"
type="es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO" />
type="es.verdnatura.presentation.view.feature.buscaritem.model.ItemShelvings" />
</data>
<LinearLayout
style="@style/LayoutClickable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
style="@style/LayoutClickable">
android:orientation="vertical">
<LinearLayout
android:id="@+id/item_row_layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verdnatura_black_5"
android:orientation="horizontal"
android:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min"
android:paddingTop="@dimen/pasilleros_margin_main_menu"
android:paddingEnd="@dimen/layout_margin_min"
android:paddingBottom="@dimen/pasilleros_margin_main_menu">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.parking}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center"
android:text="@{item.shelving.parking.code}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.matricula}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center"
android:text="@{item.shelving.code}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@{String.valueOf(item.visible)}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{String.valueOf(item.priority)}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center"
android:text="@{String.valueOf(item.available)}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@{String.valueOf(item.shelving.priority)}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@{item.created}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:textSize="@dimen/body2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
>
<data>
<variable
name="item"
type="es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog" />
</data>
<LinearLayout
android:id="@+id/item_row_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verdnatura_black_5"
android:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min"
android:paddingTop="@dimen/layout_margin_min"
android:layout_gravity="center_horizontal"
android:paddingBottom="@dimen/layout_margin_min"
>
<TextView
android:id="@+id/itemFk"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{String.valueOf(item.itemFk)}"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="start"
/>
<TextView
android:layout_width="200dp"
android:layout_height="match_parent"
android:text="@{item.item.longName}"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_white"
android:singleLine="true"
android:layout_weight="1"
android:gravity="center"/>
<TextView
android:visibility="visible"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{item.shelvingFk}"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
<TextView
android:id="@+id/txtVisible"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{String.valueOf(item.visible)}"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="end"/>
</LinearLayout>
<LinearLayout
android:id="@+id/item_rowsub_layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verdnatura_black_5"
android:paddingTop="@dimen/pasilleros_margin_main_picker"
>
<TextView
android:id="@+id/item2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{item.accion}"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="start"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{item.created}"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_white"
android:layout_weight="1.5"
android:gravity="center"/>
<TextView
android:id="@+id/txtNickname"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{item.worker.code}"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_white"
android:layout_weight="0.5"
android:paddingEnd="@dimen/layout_margin_min"
android:gravity="end"/>
</LinearLayout>
<ImageView
android:id="@+id/imageViewSeparator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@android:drawable/divider_horizontal_bright"
android:background="@color/verdnatura_pumpkin_orange"
android:contentDescription="@string/divider"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/verdnatura_black_9"/>
</LinearLayout>
</layout>

View File

@ -19,7 +19,7 @@
<string name="Color">Color</string>
<string name="Origen">Origen</string>
<string name="Tamaño">Tamaño</string>
<string name="Matrícula">Matrícula</string>
<string name="Matrícula">Carro</string>
<string name="Visible">Visible</string>
<string name="Destino">Destino</string>
<string name="Nicho">Nicho</string>
@ -169,7 +169,6 @@
<string name="closeSession">Cerrar Sesión</string>
<string name="stickers">Stickers</string>
<string name="smarttags">SmartTags</string>
<string name="userVehicleControl">Control de usuario de vehículo</string>
<string name="error">Error</string>
<string name="sectors">Sectores</string>
<string name="printers">Impresoras</string>
@ -341,7 +340,6 @@
<string name="titlePrePicker">Pre Sacador</string>
<string name="titleDayOfSale">Día de venta</string>
<string name="titleShowTicket">Ver Ticket</string>
<string name="titleHistoricalVehicle">Historial del vehículo</string>
<string name="titleReplacement">Reposición</string>
<string name="titleInventory">Inventario</string>
<string name="titleFaults">Faltas</string>
@ -358,7 +356,6 @@
<string name="titleQrReader">Lector Qr</string>
<string name="titleBufferOff">Desactivado buffer</string>
<string name="titlePreControl">Pre Control</string>
<string name="titleShelvingHistorical">Histórico ítems del carro Viejo</string>
<string name="titleLogShelving">Histórico del carro</string>
<string name="itemScanetNotFound">Elemento escaneado no encontrado </string>
<string name="NotOrderReplacement">No existen pedidos para reponer</string>
@ -705,7 +702,7 @@
<string name="etd">ETD</string>
<string name="scanWagoons">ESCANEAR CARROS</string>
<string name="server">Servidor:</string>
<string name="priority">Prioridad:</string>
<string name="priority">Prior:</string>
<string name="stock">Stock</string>
<string name="password">Password</string>
<string name="nameSurname">Nombre o apellido</string>
@ -923,6 +920,7 @@
<string name="errorAddItemReserva">Revisa si hay cantidad ubicada en tu sector.</string>
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
<string name="reserve">Reserva</string>
</resources>

View File

@ -169,7 +169,6 @@
<string name="closeSession">Cerrar Sesión</string>
<string name="stickers">Stickers</string>
<string name="smarttags">SmartTags</string>
<string name="userVehicleControl">Control de usuario de vehículo</string>
<string name="error">Error</string>
<string name="sectors">Sectores</string>
<string name="printers">Impresoras</string>
@ -341,7 +340,6 @@
<string name="titlePrePicker">Pre Sacador</string>
<string name="titleDayOfSale">Día de venta</string>
<string name="titleShowTicket">Ver Ticket</string>
<string name="titleHistoricalVehicle">Historial del vehículo</string>
<string name="titleReplacement">Reposición</string>
<string name="titleInventory">Inventario</string>
<string name="titleFaults">Faltas</string>
@ -358,7 +356,6 @@
<string name="titleQrReader">Lector Qr</string>
<string name="titleBufferOff">Desactivado buffer</string>
<string name="titlePreControl">Pre Control</string>
<string name="titleShelvingHistorical">Histórico ítems del carro Viejo</string>
<string name="titleLogShelving">Histórico del carro</string>
<string name="itemScanetNotFound">Elemento escaneado no encontrado </string>
<string name="NotOrderReplacement">No existen pedidos para reponer</string>
@ -923,5 +920,6 @@
<string name="errorAddItemReserva">Revisa si hay cantidad ubicada en tu sector.</string>
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
<string name="reserve">Reserva</string>
</resources>

View File

@ -169,7 +169,6 @@
<string name="closeSession">Cerrar Sesión</string>
<string name="stickers">Stickers</string>
<string name="smarttags">SmartTags</string>
<string name="userVehicleControl">Control de usuario de vehículo</string>
<string name="error">Error</string>
<string name="sectors">Sectores</string>
<string name="printers">Impresoras</string>
@ -341,7 +340,6 @@
<string name="titlePrePicker">Pre Sacador</string>
<string name="titleDayOfSale">Día de venta</string>
<string name="titleShowTicket">Ver Ticket</string>
<string name="titleHistoricalVehicle">Historial del vehículo</string>
<string name="titleReplacement">Reposición</string>
<string name="titleInventory">Inventario</string>
<string name="titleFaults">Faltas</string>
@ -358,7 +356,6 @@
<string name="titleQrReader">Lector Qr</string>
<string name="titleBufferOff">Desactivado buffer</string>
<string name="titlePreControl">Pre Control</string>
<string name="titleShelvingHistorical">Histórico ítems del carro Viejo</string>
<string name="titleLogShelving">Histórico del carro</string>
<string name="itemScanetNotFound">Elemento escaneado no encontrado </string>
<string name="NotOrderReplacement">No existen pedidos para reponer</string>
@ -923,5 +920,6 @@
<string name="errorAddItemReserva">Revisa si hay cantidad ubicada en tu sector.</string>
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
<string name="reserve">Reserva</string>
</resources>

View File

@ -201,7 +201,6 @@
<string name="closeSession">Close session</string>
<string name="stickers">Stickers</string>
<string name="smarttags">SmartTags</string>
<string name="userVehicleControl">User control vehicle</string>
<string name="error">Error</string>
<string name="errorScanned">Scanned text no valid</string>
<string name="sectors">Sectors</string>
@ -415,7 +414,6 @@
<string name="titleQuality">Quality</string>
<string name="titleWebViewer">Web viewer</string>
<string name="titlePreControl">Pre Control</string>
<string name="titleShelvingHistorical">Shelving historical</string>
<string name="titleLogShelving">Log Shelving</string>
<string name="titlePickers">Pickers</string>
<string name="itemScanetNotFound">"Scanned element not found "</string>
@ -926,5 +924,6 @@
<string name="errorAddItemReserva">Revisa si hay cantidad ubicada en tu sector.</string>
<string name="actionParking">{\"action\":\"Se acepta el cambio de %1$s de %2$s a %3$s por el usuario %4$s\"}</string>
<string name="tansferItem">{\"action\":\"Se acepta el cambio de %1$s el artículo %2$s a %3$s por el usuario %4$s\"}</string>
<string name="reserve">Reserva</string>
</resources>