refs #5891
This commit is contained in:
parent
d3869ba122
commit
75dc8e5656
|
@ -14,7 +14,7 @@ android {
|
||||||
minSdkVersion 24 //21
|
minSdkVersion 24 //21
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 210
|
versionCode 210
|
||||||
versionName = "23.26Beta" //Esta rama viene de esta version
|
versionName = "23.26" //Esta rama viene de esta version
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.inventario.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
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.ItemInventoryParkingRowBinding
|
||||||
|
import es.verdnatura.presentation.common.OnMoreClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnVisibleClickListener
|
||||||
|
import es.verdnatura.presentation.common.loadUrl
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.InventoryParking
|
||||||
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
|
||||||
|
class InventoryParkingAdapter(
|
||||||
|
private val items: List<InventoryParking>,
|
||||||
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||||
|
private val onVisibleClickListener: OnVisibleClickListener,
|
||||||
|
private val onMoreClickListener: OnMoreClickListener
|
||||||
|
) : RecyclerView.Adapter<InventoryParkingAdapter.ItemHolder>() {
|
||||||
|
|
||||||
|
fun getList(): List<InventoryParking> {
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||||
|
return ItemHolder(
|
||||||
|
ItemInventoryParkingRowBinding.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: ItemInventoryParkingRowBinding
|
||||||
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
|
private val res = binding.root.context.resources
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
fun bind(item: InventoryParking) {
|
||||||
|
binding.apply {
|
||||||
|
this.item = item
|
||||||
|
//multiText.text = "${item.stickers}x${item.packing}"
|
||||||
|
imgItem.loadUrl(item.urlImage)
|
||||||
|
imgItem.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = res.getString(
|
||||||
|
R.string.itemSearch
|
||||||
|
)
|
||||||
|
), item.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
layerVisible.setOnClickListener {
|
||||||
|
// onVisibleClickListener.onVisibleClickListener(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.visible == 0) {
|
||||||
|
visibleText.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
visibleText.context,
|
||||||
|
R.color.verdnatura_brown_grey
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
visibleText.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
visibleText.context,
|
||||||
|
R.color.verdnatura_pumpkin_orange
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
moreImg.setOnClickListener {
|
||||||
|
// onMoreClickListener.onMoreClickListener(item)
|
||||||
|
}
|
||||||
|
namelayout.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = res.getString(R.string.itemSearch)
|
||||||
|
), item.itemFk.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.isChecked != null) {
|
||||||
|
|
||||||
|
when (item.isChecked!!.toInt()) {
|
||||||
|
|
||||||
|
in 1..Int.MAX_VALUE -> itemRowLayout.setBackgroundColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
visibleText.context,
|
||||||
|
R.color.verdnatura_dark_green_verdnatura
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
itemRowLayout.setBackgroundColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
visibleText.context,
|
||||||
|
R.color.verdnatura_black_5
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,6 @@ import android.graphics.drawable.Drawable
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
|
@ -16,30 +15,27 @@ import androidx.annotation.RequiresApi
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentUbicadorBinding
|
import es.verdnatura.databinding.FragmentInventoryParkingBinding
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toInt
|
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.*
|
import es.verdnatura.presentation.common.*
|
||||||
import es.verdnatura.presentation.view.component.*
|
import es.verdnatura.presentation.view.component.*
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.adapter.InventoryParkingAdapter
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.InventoryParking
|
||||||
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
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter
|
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
import java.lang.Boolean.TRUE
|
|
||||||
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class InventaryParkingFragment(
|
class InventaryParkingFragment(
|
||||||
var shelvingFk: String = "",
|
var title: String = "",
|
||||||
var isAutoSelf: Boolean
|
) : BaseFragment<FragmentInventoryParkingBinding, InventaryViewModel>(
|
||||||
) : BaseFragment<FragmentUbicadorBinding, UbicadorViewModel>(
|
InventaryViewModel::class
|
||||||
UbicadorViewModel::class
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private var adapter: UbicadorAdapter? = null
|
private var adapter: InventoryParkingAdapter? = null
|
||||||
private lateinit var customDialogInput: CustomDialogInput
|
private lateinit var customDialogInput: CustomDialogInput
|
||||||
private lateinit var customDialogUbicador: CustomDialogUbicador
|
private lateinit var customDialogUbicador: CustomDialogUbicador
|
||||||
private lateinit var customDialogTwoButtons: CustomDialogTwoButtons
|
private lateinit var customDialogTwoButtons: CustomDialogTwoButtons
|
||||||
|
@ -54,17 +50,18 @@ class InventaryParkingFragment(
|
||||||
private var isShelvinLogfromMainScreen = false
|
private var isShelvinLogfromMainScreen = false
|
||||||
private var modeCheckUbication = false
|
private var modeCheckUbication = false
|
||||||
private var itemScannedScreen = 0
|
private var itemScannedScreen = 0
|
||||||
|
private var shelvingFk: String = ""
|
||||||
var mperror: MediaPlayer? = null
|
var mperror: MediaPlayer? = null
|
||||||
var mpok: MediaPlayer? = null
|
var mpok: MediaPlayer? = null
|
||||||
var isBack = false
|
var isBack = false
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String, autoSelf: Boolean = false) =
|
fun newInstance(title: String) =
|
||||||
InventaryParkingFragment(entryPoint, autoSelf)
|
InventaryParkingFragment(title)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_ubicador
|
override fun getLayoutId(): Int = R.layout.fragment_inventory_parking
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
super.onPause()
|
super.onPause()
|
||||||
isBack = true
|
isBack = true
|
||||||
|
@ -84,23 +81,11 @@ class InventaryParkingFragment(
|
||||||
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
|
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
|
||||||
|
|
||||||
ma.hideBottomNavigation(GONE)
|
ma.hideBottomNavigation(GONE)
|
||||||
binding.mainToolbar.toolbarTitle.text = if (!isAutoSelf) {
|
binding.mainToolbar.toolbarTitle.text = title
|
||||||
getString(R.string.locator)
|
|
||||||
} else {
|
|
||||||
getString(R.string.selfConsumption)
|
|
||||||
}
|
|
||||||
setEvents()
|
setEvents()
|
||||||
setToolBar()
|
setToolBar()
|
||||||
if (!shelvingFk.isNullOrEmpty()) {
|
|
||||||
isShelvinLogfromMainScreen = false
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
binding.mainToolbar.toolbarTitle.text = shelvingFk
|
viewModel.inventoryParking("MAD-01", "CAM-01")
|
||||||
viewModel.itemShelvingList(shelvingFk)
|
|
||||||
} else {
|
|
||||||
isShelvinLogfromMainScreen = true
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,41 +107,16 @@ class InventaryParkingFragment(
|
||||||
val iconReset = ImageView(context)
|
val iconReset = ImageView(context)
|
||||||
iconReset.setImageResource(R.drawable.ic_remove_checks)
|
iconReset.setImageResource(R.drawable.ic_remove_checks)
|
||||||
|
|
||||||
//Tarea#5052
|
|
||||||
binding.mainToolbar.switchButton.visibility = VISIBLE
|
|
||||||
binding.mainToolbar.switchButton.setOnCheckedChangeListener { buttonView, isChecked ->
|
|
||||||
if (binding.mainToolbar.toolbarTitle.text == getString(R.string.titleUbicator)) {
|
|
||||||
ma.messageWithSound(getString(R.string.scanShelving), false, false)
|
|
||||||
binding.mainToolbar.switchButton.isChecked = false
|
|
||||||
} else {
|
|
||||||
modeCheckUbication = isChecked
|
|
||||||
binding.mainToolbar.switchButton.tooltipText = if (isChecked)
|
|
||||||
getString(R.string.activateModoChecking) else
|
|
||||||
getString(R.string.allowCheckingMode)
|
|
||||||
binding.textinputlayoutMatricula.hint =
|
|
||||||
if (isChecked) getString(R.string.scanItem) else {
|
|
||||||
getString(R.string.scanPlate)
|
|
||||||
}
|
|
||||||
if (!isChecked) {
|
|
||||||
listLocalItems.clear()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val iconChecker = ImageView(context)
|
|
||||||
iconChecker.setImageResource(R.drawable.ic_ubicator_check)
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||||
iconAdd.tooltipText = getString(R.string.addItemShelving)
|
iconAdd.tooltipText = getString(R.string.addItemShelving)
|
||||||
iconChecker.tooltipText = getTooltip(R.drawable.ic_ubicator_check)
|
iconReset.tooltipText = getTooltip(R.drawable.ic_remove_checks)
|
||||||
|
|
||||||
}
|
}
|
||||||
listIcons.add(iconAdd)
|
listIcons.add(iconAdd)
|
||||||
listIcons.add(iconReload)
|
listIcons.add(iconReload)
|
||||||
//listIcons.add(iconChecker)
|
listIcons.add(iconReset)
|
||||||
//tarea 5713
|
|
||||||
//listIcons.add(iconReset)
|
|
||||||
|
|
||||||
|
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
|
@ -164,43 +124,18 @@ class InventaryParkingFragment(
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
when (item) {
|
when (item) {
|
||||||
iconAdd.drawable -> showAddItem(
|
iconAdd.drawable -> {
|
||||||
"",
|
// createListInventoryParking(list,"sector")
|
||||||
"",
|
}
|
||||||
"",
|
|
||||||
"",
|
|
||||||
false,
|
|
||||||
ItemUbicadorVO(0),
|
|
||||||
""
|
|
||||||
)
|
|
||||||
iconReload.drawable -> {
|
|
||||||
|
|
||||||
if (!shelvingFk.isNullOrEmpty()) {
|
iconReload.drawable -> {
|
||||||
binding.editPrioridad.setText("")
|
//createListInventoryParking(list,"buyer")
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelvingList(
|
|
||||||
shelvingFk
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
getString(R.string.scanShelving).toast(
|
|
||||||
requireActivity(),
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iconChecker.drawable -> {
|
|
||||||
if (!shelvingFk.isNullOrEmpty()) {
|
|
||||||
ma.onPasillerosItemClickListener(
|
|
||||||
PasillerosItemVO(title = getString(R.string.titleChecker)),
|
|
||||||
entryPoint = shelvingFk
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
getString(R.string.scanShelving).toast(
|
|
||||||
requireActivity(),
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iconReset.drawable -> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
iconReset.drawable -> {
|
iconReset.drawable -> {
|
||||||
customDialog.setTitle(getString(R.string.checkItemShelvingDescrip))
|
customDialog.setTitle(getString(R.string.checkItemShelvingDescrip))
|
||||||
.setDescription(getString(R.string.checkItemShelving))
|
.setDescription(getString(R.string.checkItemShelving))
|
||||||
|
@ -212,10 +147,10 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||||
|
@ -240,14 +175,12 @@ class InventaryParkingFragment(
|
||||||
if (!modeCheckUbication || (modeCheckUbication && binding.editMatricula.text.toString().length == 3 && !binding.editMatricula.text!![0].isDigit())) {
|
if (!modeCheckUbication || (modeCheckUbication && binding.editMatricula.text.toString().length == 3 && !binding.editMatricula.text!![0].isDigit())) {
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
binding.editMatricula.text.toString()
|
binding.editMatricula.text.toString()
|
||||||
shelvingFk = binding.editMatricula.text.toString()
|
//shelvingFk = binding.editMatricula.text.toString()
|
||||||
parking = ""
|
parking = ""
|
||||||
binding.editPrioridad.setText("")
|
binding.editPrioridad.setText("")
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
isShelvinLogfromMainScreen = true
|
isShelvinLogfromMainScreen = true
|
||||||
viewModel.itemShelvingList(
|
|
||||||
binding.editMatricula.text.toString()
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/*Tarea#5109*/
|
/*Tarea#5109*/
|
||||||
|
@ -256,13 +189,13 @@ class InventaryParkingFragment(
|
||||||
)*/
|
)*/
|
||||||
try {
|
try {
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.getIdFromCode(
|
/* viewModel.getIdFromCode(
|
||||||
code = itemScanValue(
|
code = itemScanValue(
|
||||||
binding.editMatricula.text.toString(),
|
binding.editMatricula.text.toString(),
|
||||||
"buy",
|
"buy",
|
||||||
"more"
|
"more"
|
||||||
).toString()
|
).toString()
|
||||||
)
|
)*/
|
||||||
} catch (Ex: Exception) {
|
} catch (Ex: Exception) {
|
||||||
ma.messageWithSound(Ex.message.toString(), true, true)
|
ma.messageWithSound(Ex.message.toString(), true, true)
|
||||||
}
|
}
|
||||||
|
@ -281,10 +214,7 @@ class InventaryParkingFragment(
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
if (!binding.editPrioridad.text.toString().isNullOrEmpty()) {
|
if (!binding.editPrioridad.text.toString().isNullOrEmpty()) {
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.shelvingPriorityUpdate(
|
|
||||||
binding.editPrioridad.toInt(),
|
|
||||||
shelvingFk
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ma.hideKeyboard(binding.editPrioridad)
|
ma.hideKeyboard(binding.editPrioridad)
|
||||||
|
@ -314,10 +244,7 @@ class InventaryParkingFragment(
|
||||||
R.string.parking
|
R.string.parking
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
viewModel.shelvingPark(
|
|
||||||
shelvingFk,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
parking = customDialogInput.getValue()
|
parking = customDialogInput.getValue()
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
||||||
|
@ -333,10 +260,7 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
viewModel.shelvingPark(
|
|
||||||
shelvingFk,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
parking = customDialogInput.getValue()
|
parking = customDialogInput.getValue()
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
|
@ -355,10 +279,7 @@ class InventaryParkingFragment(
|
||||||
binding.editImg.setOnClickListener {
|
binding.editImg.setOnClickListener {
|
||||||
customDialogInput.setTitle(getString(R.string.changeShelving)).setValue("")
|
customDialogInput.setTitle(getString(R.string.changeShelving)).setValue("")
|
||||||
.setOkButton(getString(R.string.save)) {
|
.setOkButton(getString(R.string.save)) {
|
||||||
viewModel.shelvingChange(
|
|
||||||
shelvingFk,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
shelvingFk = customDialogInput.getValue()
|
shelvingFk = customDialogInput.getValue()
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
||||||
|
@ -375,10 +296,7 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
viewModel.shelvingChange(
|
|
||||||
shelvingFk,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
shelvingFk = customDialogInput.getValue()
|
shelvingFk = customDialogInput.getValue()
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
||||||
|
@ -397,9 +315,7 @@ class InventaryParkingFragment(
|
||||||
customDialog.setTitle(getString(R.string.empty))
|
customDialog.setTitle(getString(R.string.empty))
|
||||||
.setDescription(getString(R.string.operationNoReturn))
|
.setDescription(getString(R.string.operationNoReturn))
|
||||||
.setOkButton(getString(R.string.empty)) {
|
.setOkButton(getString(R.string.empty)) {
|
||||||
viewModel.clearShelvingList(
|
|
||||||
shelvingFk
|
|
||||||
)
|
|
||||||
listItems.forEach {
|
listItems.forEach {
|
||||||
it.stickers = "0"
|
it.stickers = "0"
|
||||||
it.visible = "0"
|
it.visible = "0"
|
||||||
|
@ -433,12 +349,7 @@ class InventaryParkingFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
viewModel.itemShelving_addList(
|
|
||||||
shelvingFk,
|
|
||||||
"" + listInt + "",
|
|
||||||
TRUE,
|
|
||||||
getDataInt(WAREHOUSEFK)
|
|
||||||
)
|
|
||||||
|
|
||||||
adapter!!.notifyDataSetChanged()
|
adapter!!.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
@ -461,87 +372,74 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
|
|
||||||
loadShelvingList.observe(viewLifecycleOwner, Observer { event ->
|
loadInventaryParkingList.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
|
binding.splashProgress.visibility = GONE
|
||||||
|
if (it.list[0].isError) {
|
||||||
|
ma.messageWithSound(it.list[0].errorMessage, it.list[0].isError, false)
|
||||||
|
|
||||||
deep = it.list.size
|
|
||||||
if (it.list.isNotEmpty() && it.list.get(0).isError) {
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
ma.messageWithSound(
|
|
||||||
it.list.get(0).errorMessage,
|
|
||||||
it.list.get(0).isError,
|
|
||||||
isPlayed = false
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
listItems = ArrayList()
|
|
||||||
var contEtiquetas = 0
|
|
||||||
it.list.forEach { item ->
|
|
||||||
try {
|
|
||||||
contEtiquetas += item.stickers.toInt()
|
|
||||||
parking = item.code.uppercase()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
createListInventoryParking(it.list)
|
||||||
listItems.add(item)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
etiquetas = contEtiquetas.toString()
|
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
|
||||||
R.string.label
|
|
||||||
) + etiquetas
|
|
||||||
if (it.list.size > 0)
|
|
||||||
binding.editPrioridad.setText(it.list[0].priority)
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
|
|
||||||
|
|
||||||
for (item in listItems) {
|
|
||||||
for (localItem in listLocalItems) {
|
|
||||||
if (item.item == localItem.item) {
|
|
||||||
item.isNew = localItem.isNew
|
|
||||||
item.checked = localItem.checked
|
|
||||||
if (item.isNew && item.visible != "0") {
|
|
||||||
item.isNew = false
|
|
||||||
item.checked = true
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.locationRecyclerview.postInvalidate()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!binding.mainToolbar.switchButton.isChecked && listItems.isNotEmpty()) {
|
|
||||||
|
|
||||||
listItems = listItems.asReversed()
|
|
||||||
}
|
}
|
||||||
adapter = UbicadorAdapter(
|
|
||||||
listItems.sortedBy { it.isChecked },
|
response.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
|
if (it.isError) {
|
||||||
|
binding.splashProgress.visibility = GONE
|
||||||
|
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ma.messageWithSound("", it.isError, true, isToasted = false)
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
/* loadResponseCode.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
binding.splashProgress.visibility = GONE
|
||||||
|
if (it.isError) {
|
||||||
|
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (it.response != "0") {
|
||||||
|
checkUbications(it.response.toInt())
|
||||||
|
} else {
|
||||||
|
ma.messageWithSound(getString(R.string.labelNovalid), true, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createListInventoryParking(list: List<InventoryParking>, sort:String?=null) {
|
||||||
|
var sortedList: List<InventoryParking>
|
||||||
|
//TODO() -> Falta obtindre la llista per a ordenar-la
|
||||||
|
// binding.locationRecyclerview.adapter.get
|
||||||
|
when (sort){
|
||||||
|
"sector"->{ sortedList = list.sortedBy { it.sectorFk }}
|
||||||
|
"buyer"->{sortedList = list.sortedBy { it.sectorFk }}
|
||||||
|
else->{
|
||||||
|
sortedList = list.sortedBy { it.pickingOrder }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adapter = InventoryParkingAdapter(
|
||||||
|
sortedList,
|
||||||
onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
||||||
onVisibleClickListener = object : OnVisibleClickListener {
|
onVisibleClickListener = object : OnVisibleClickListener {
|
||||||
override fun onVisibleClickListener(item: ItemUbicadorVO) {
|
override fun onVisibleClickListener(item: ItemUbicadorVO) {
|
||||||
|
|
||||||
if (!isAutoSelf) {
|
|
||||||
showAddItem(
|
|
||||||
item.item.toString(),
|
|
||||||
item.packing,
|
|
||||||
item.stickers,
|
|
||||||
item.visible,
|
|
||||||
true,
|
|
||||||
item,
|
|
||||||
grouping = if (item.grouping.isNullOrEmpty()) {
|
|
||||||
""
|
|
||||||
} else item.grouping
|
|
||||||
)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
showAutoSelfConsumption(item)
|
showAutoSelfConsumption(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onMoreClickListener = object : OnMoreClickListener {
|
onMoreClickListener = object : OnMoreClickListener {
|
||||||
|
@ -559,131 +457,6 @@ class InventaryParkingFragment(
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
if (isShelvinLogfromMainScreen) {
|
|
||||||
viewModel.shelvinLog_add(shelvingFk)
|
|
||||||
|
|
||||||
}
|
|
||||||
if (modeCheckUbication) {
|
|
||||||
listItems.sortedBy { it.isChecked }.forEachIndexed { index, item ->
|
|
||||||
if (item.item == itemScannedScreen) {
|
|
||||||
binding.locationRecyclerview.scrollToPosition(index)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
(binding.locationRecyclerview.layoutManager as LinearLayoutManager).scrollToPosition(
|
|
||||||
0
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
loadAddList.observe(viewLifecycleOwner) { event ->
|
|
||||||
event.getContentIfNotHandled().notNull {
|
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelvingList(shelvingFk)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* responseAddList.observe(viewLifecycleOwner, Observer {
|
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelvingList(shelvingFk)
|
|
||||||
|
|
||||||
}
|
|
||||||
})*/
|
|
||||||
response.observe(viewLifecycleOwner, Observer {
|
|
||||||
|
|
||||||
if (it.isError) {
|
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
viewModel.itemShelvingList(shelvingFk)
|
|
||||||
ma.messageWithSound("", it.isError, true, isToasted = false)
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
responseLog.observe(viewLifecycleOwner, Observer {
|
|
||||||
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
isShelvinLogfromMainScreen = false
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
loadResponseCode.observe(viewLifecycleOwner) { event ->
|
|
||||||
event.getContentIfNotHandled().notNull {
|
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (it.response != "0") {
|
|
||||||
checkUbications(it.response.toInt())
|
|
||||||
} else {
|
|
||||||
ma.messageWithSound(getString(R.string.labelNovalid), true, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* responseCode.observe(viewLifecycleOwner, Observer {
|
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, true, true)
|
|
||||||
} else {
|
|
||||||
if (it.response!="0") {checkUbications(it.response.toInt())}else{
|
|
||||||
ma.messageWithSound(getString(R.string.labelNovalid), true, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
})*/
|
|
||||||
responsepriority.observe(viewLifecycleOwner, Observer {
|
|
||||||
if (!isBack) {
|
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
ma.messageWithSound(
|
|
||||||
if (it.isError) it.errorMessage else {
|
|
||||||
getString(R.string.priorityChanged)
|
|
||||||
}, it.isError, true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
isBack = false
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
responseMake.observe(viewLifecycleOwner, Observer {
|
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, true, true, isToasted = true)
|
|
||||||
} else {
|
|
||||||
if (!shelvingFk.isNullOrEmpty()) {
|
|
||||||
|
|
||||||
binding.mainToolbar.toolbarTitle.text = shelvingFk
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelvingList(
|
|
||||||
shelvingFk
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showAutoSelfConsumption(item: ItemUbicadorVO) {
|
private fun showAutoSelfConsumption(item: ItemUbicadorVO) {
|
||||||
|
@ -702,11 +475,7 @@ class InventaryParkingFragment(
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
viewModel.itemShelving_selfConsumption(
|
|
||||||
shelvingFk,
|
|
||||||
item.item,
|
|
||||||
quantity
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
throw Exception("")
|
throw Exception("")
|
||||||
}
|
}
|
||||||
|
@ -874,14 +643,7 @@ class InventaryParkingFragment(
|
||||||
if (itemFk != null && visible != null) {
|
if (itemFk != null && visible != null) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.itemShelvingMake(
|
|
||||||
shelvingFk,
|
|
||||||
itemFk,
|
|
||||||
visible,
|
|
||||||
packing,
|
|
||||||
getDataInt(WAREHOUSEFK),
|
|
||||||
groupingPack
|
|
||||||
)
|
|
||||||
|
|
||||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||||
.setGroupingValue("")
|
.setGroupingValue("")
|
||||||
|
@ -893,14 +655,7 @@ class InventaryParkingFragment(
|
||||||
} else if (itemFk != null && etiquetas != null) {
|
} else if (itemFk != null && etiquetas != null) {
|
||||||
val visible_calc = (etiquetas * packing!!.toInt())
|
val visible_calc = (etiquetas * packing!!.toInt())
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.itemShelvingMake(
|
|
||||||
shelving = shelvingFk,
|
|
||||||
item = itemFk,
|
|
||||||
quantity = visible_calc,
|
|
||||||
packing = packing,
|
|
||||||
warehouse = getDataInt(WAREHOUSEFK),
|
|
||||||
grouping = groupingPack
|
|
||||||
)
|
|
||||||
|
|
||||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||||
.setGroupingValue("")
|
.setGroupingValue("")
|
||||||
|
@ -918,13 +673,7 @@ class InventaryParkingFragment(
|
||||||
} else {
|
} else {
|
||||||
if (itemFk != null && visible != null && !updatePacking) {
|
if (itemFk != null && visible != null && !updatePacking) {
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.itemShelvingMakeEdit(
|
|
||||||
visible,
|
|
||||||
packing!!.toInt(),
|
|
||||||
itemShelvingFk,
|
|
||||||
groupingPack
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||||
.setGroupingValue("")
|
.setGroupingValue("")
|
||||||
|
@ -940,13 +689,6 @@ class InventaryParkingFragment(
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
}
|
}
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.itemShelvingMakeEdit(
|
|
||||||
visible_calc,
|
|
||||||
packing.toInt(),
|
|
||||||
itemShelvingFk,
|
|
||||||
groupingPack
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||||
.setGroupingValue("")
|
.setGroupingValue("")
|
||||||
|
@ -980,10 +722,7 @@ class InventaryParkingFragment(
|
||||||
.setOkButton(getString(R.string.transfer)) {
|
.setOkButton(getString(R.string.transfer)) {
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
if (customDialogInput.getValue().isNotEmpty()) {
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.itemShelvingTransfer(
|
|
||||||
item.id,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
listItems.remove(item)
|
listItems.remove(item)
|
||||||
adapter!!.notifyDataSetChanged()
|
adapter!!.notifyDataSetChanged()
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
|
@ -1000,10 +739,7 @@ class InventaryParkingFragment(
|
||||||
customDialogInput.getEditText()
|
customDialogInput.getEditText()
|
||||||
.setOnEditorActionListener { v, actionId, event ->
|
.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
viewModel.itemShelvingTransfer(
|
|
||||||
item.id,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
listItems.remove(item)
|
listItems.remove(item)
|
||||||
adapter!!.notifyDataSetChanged()
|
adapter!!.notifyDataSetChanged()
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
|
@ -1015,24 +751,12 @@ class InventaryParkingFragment(
|
||||||
}.setOkButtonTwo(getString(R.string.delete)) {
|
}.setOkButtonTwo(getString(R.string.delete)) {
|
||||||
customDialog.setTitle(getString(R.string.confirm))
|
customDialog.setTitle(getString(R.string.confirm))
|
||||||
.setDescription(
|
.setDescription(
|
||||||
if (!isAutoSelf) {
|
|
||||||
getString(R.string.itemDeleteConfirm) + item.item + "?"
|
|
||||||
} else {
|
|
||||||
getString(R.string.deleteQuantity) + item.item
|
getString(R.string.deleteQuantity) + item.item
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.setOkButton(getString(R.string.delete)) {
|
.setOkButton(getString(R.string.delete)) {
|
||||||
if (!isAutoSelf) {
|
|
||||||
listItems.remove(item)
|
|
||||||
adapter!!.notifyDataSetChanged()
|
|
||||||
viewModel.itemShelvingDelete(
|
|
||||||
item.id
|
|
||||||
)
|
|
||||||
customDialogTwoButtons.dismiss()
|
|
||||||
customDialog.dismiss()
|
|
||||||
} else {
|
|
||||||
viewModel.itemShelving_selfConsumption(shelvingFk, item.item, 0)
|
|
||||||
}
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
customDialogTwoButtons.dismiss()
|
customDialogTwoButtons.dismiss()
|
||||||
|
|
|
@ -13,6 +13,8 @@ import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
||||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
|
import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.InventoryParking
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.InventoryParkingList
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.*
|
import es.verdnatura.presentation.view.feature.workermistake.model.*
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
@ -48,6 +50,13 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val responseAddMistake: LiveData<ResponseItemVO>
|
val responseAddMistake: LiveData<ResponseItemVO>
|
||||||
get() = _responseAddMistake
|
get() = _responseAddMistake
|
||||||
|
|
||||||
|
|
||||||
|
private val _inventoryListParking by lazy { MutableLiveData<InventoryParkingList>() }
|
||||||
|
val inventoryListParking: LiveData<InventoryParkingList>
|
||||||
|
get() = _inventoryListParking
|
||||||
|
|
||||||
|
val loadInventaryParkingList = Transformations.map(_inventoryListParking) { Event(it) }
|
||||||
|
|
||||||
//sergio para obtener comprador
|
//sergio para obtener comprador
|
||||||
fun itemShelvingBuyerGet() {
|
fun itemShelvingBuyerGet() {
|
||||||
silex.itemShelvingBuyerGet().enqueue(object :
|
silex.itemShelvingBuyerGet().enqueue(object :
|
||||||
|
@ -363,10 +372,52 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun inventoryParking(
|
fun inventoryParking(
|
||||||
vParkingFromFk: Int,
|
vParkingFrom: String,
|
||||||
vParkingToFk: Int
|
vParkingTo: String
|
||||||
) {
|
) {
|
||||||
silex.itemShelving_inventory(vParkingFromFk, vParkingToFk)
|
|
||||||
|
var myList = InventoryParkingList(
|
||||||
|
listOf(
|
||||||
|
InventoryParking(
|
||||||
|
31, "F-01-1", "OZR", 19897, "Dendrobium Galaxy", 510, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/dgalaxy", 0, 2
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
31, "F-01-1", "OZR", 92400, "Cymbidium Avalanche", 14, 37, "Sergio de la Torre Nebot",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/92400", 0, 2
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
31, "F-01-1", "OZR", 92400, "Cymbidium Avalanche", 2, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/92400", 0, 2
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
32, "F-01-2", "PLY", 19897, "Dendrobium Galaxy", 520, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/dgalaxy", 0, 2
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
33, "F-01-3", "ZLZ", 2912, "HEL Tropical Red", 2, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/002912", 0, 0
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
34, "F-01-4", "JXU", 25942, "HEL BQ Amor (x bouquet)", 0, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/bqamor", 0, 0
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
34, "F-01-4", "MUU", 25942, "HEL BQ Amor (x bouquet)", 5, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/bqamor", 0, 0
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
34, "F-01-4", "JXU", 50001, "Monstera I", 130, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/50001", 0, 2
|
||||||
|
),
|
||||||
|
InventoryParking(
|
||||||
|
34, "F-01-4", "JXU", 50004, "Monstera IV", 240, 37, "Jose Alarcan Gomex",
|
||||||
|
"http://verdnatura.es/vn-image-data/catalog/1600x900/50003", 0, 2
|
||||||
|
)
|
||||||
|
))
|
||||||
|
_inventoryListParking.value = myList
|
||||||
|
|
||||||
|
/*silex.itemShelving_inventory(vParkingFromFk, vParkingToFk)
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SilexCallback<Any>(context) {
|
SilexCallback<Any>(context) {
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
|
@ -385,7 +436,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
response = response.message()
|
response = response.message()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})*/
|
||||||
}
|
}
|
||||||
|
|
||||||
fun expeditionMistakeType_get() {
|
fun expeditionMistakeType_get() {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.inventario.model
|
package es.verdnatura.presentation.view.feature.inventario.model
|
||||||
|
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
|
||||||
|
|
||||||
class BuyerInventary(
|
class BuyerInventary(
|
||||||
var userFk: String = "",
|
var userFk: String = "",
|
||||||
var nickname: String = "",
|
var nickname: String = "",
|
||||||
|
|
|
@ -18,3 +18,23 @@ class InventaryListVO(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data class InventoryParking(
|
||||||
|
val pickingOrder: Int,
|
||||||
|
val parking: String,
|
||||||
|
val shelvingFk: String,
|
||||||
|
val itemFk: Int,
|
||||||
|
val longName: String,
|
||||||
|
val visible: Int,
|
||||||
|
val sectorFk: Int,
|
||||||
|
val buyer: String,
|
||||||
|
val urlImage: String,
|
||||||
|
val isChecked:Int?,
|
||||||
|
val priority: Int,
|
||||||
|
var isError: Boolean = false,
|
||||||
|
var errorMessage: String = "",
|
||||||
|
)
|
||||||
|
class InventoryParkingList(
|
||||||
|
var list: List<InventoryParking> = listOf()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
|
@ -813,7 +813,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
}
|
}
|
||||||
|
|
||||||
getString(R.string.titleInventoryParking) -> {
|
getString(R.string.titleInventoryParking) -> {
|
||||||
addFragmentOnTop(InventaryParkingFragment.newInstance(entryPoint))
|
addFragmentOnTop(InventaryParkingFragment.newInstance(item.title))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,148 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:paddingTop="@dimen/toolbar_height">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/textinputlayout_matricula"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColorHint="@android:color/darker_gray">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/edit_matricula"
|
||||||
|
style="@style/InputLineTextSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:hint="@string/Escaneamatricula"
|
||||||
|
android:inputType="text"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/textinputlayout_prioridad"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColorHint="@android:color/darker_gray"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/edit_prioridad"
|
||||||
|
style="@style/InputLineTextSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:hint="Prioridad:"
|
||||||
|
android:inputType="number"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/delete_img"
|
||||||
|
android:layout_width="@dimen/options_image_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/ic_delete_forever_black_24dp"
|
||||||
|
android:padding="@dimen/options_image_padding"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/edit_img"
|
||||||
|
android:layout_width="@dimen/options_image_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/ic_mode_edit_black_24dp"
|
||||||
|
android:padding="@dimen/options_image_padding"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/parking_img"
|
||||||
|
android:layout_width="@dimen/options_image_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/ic_local_parking_black_24dp"
|
||||||
|
android:padding="@dimen/options_image_padding"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/automatic_img"
|
||||||
|
android:layout_width="@dimen/options_image_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/ic_flash_auto_black_24dp"
|
||||||
|
android:padding="@dimen/options_image_padding"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/location_recyclerview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
tools:listitem="@layout/item_inventory_parking_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" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/splash_progress"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@color/verdnatura_black_8_alpha_6"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<com.airbnb.lottie.LottieAnimationView
|
||||||
|
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/verdnatura_logo_large_height"
|
||||||
|
|
||||||
|
app:lottie_autoPlay="true"
|
||||||
|
app:lottie_loop="true"
|
||||||
|
app:lottie_rawRes="@raw/orange_loading"
|
||||||
|
app:lottie_speed="2" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
|
@ -0,0 +1,175 @@
|
||||||
|
<?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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="item"
|
||||||
|
type="es.verdnatura.presentation.view.feature.inventario.model.InventoryParking" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
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:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/item_row_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/verdnatura_black_5"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="@dimen/pasilleros_margin_main_menu"
|
||||||
|
android:paddingTop="@dimen/inventory_item"
|
||||||
|
android:paddingRight="@dimen/pasilleros_margin_main_menu"
|
||||||
|
android:paddingBottom="@dimen/inventory_item">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="@dimen/layout_margin_min"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="@dimen/item_image_width"
|
||||||
|
android:layout_height="@dimen/item_image_width"
|
||||||
|
android:layout_marginRight="@dimen/layout_margin_1"
|
||||||
|
app:cardCornerRadius="100dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_item"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/namelayout"
|
||||||
|
style="@style/LayoutClickable"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_parking"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@{item.parking}"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h8"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_shelving"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@{item.shelvingFk}"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h8"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/itemfk_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:text="@{Integer.toString(item.itemFk)}"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h8"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/longname_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{item.longName}"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h8" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/buyer_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{item.buyer}"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h8" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layer_visible"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="8"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/visible_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{Integer.toString(item.visible)}"
|
||||||
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
|
android:textSize="@dimen/h6"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="@dimen/item_image_width_min"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="center"
|
||||||
|
android:src="@drawable/ic_more_vert_black_24dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/verdnatura_black_9" />
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
|
@ -81,6 +81,7 @@
|
||||||
<dimen name="parental_border_radius">3dp</dimen>
|
<dimen name="parental_border_radius">3dp</dimen>
|
||||||
|
|
||||||
<!--Pasilleros-->
|
<!--Pasilleros-->
|
||||||
|
<dimen name="inventory_item">10dp</dimen>
|
||||||
<dimen name="pasilleros_margin_main_menu">15dp</dimen>
|
<dimen name="pasilleros_margin_main_menu">15dp</dimen>
|
||||||
<dimen name="packaging_margin_main_menu">5dp</dimen>
|
<dimen name="packaging_margin_main_menu">5dp</dimen>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue