vresion 23.26
This commit is contained in:
parent
75dc8e5656
commit
dccbb41ab1
|
@ -82,15 +82,20 @@
|
|||
</select>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #5613 renew token">
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/ic_inventory_parking.xml" afterDir="false" />
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #5891">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/adapter/InventoryParkingAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/adapter/InventoryParkingAdapter.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/model/ItemInventaryVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/model/ItemInventaryVO.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_inventory_parking.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_inventory_parking.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_inventory_parking_row.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_inventory_parking_row.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-fr/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-fr/strings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-pt/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-pt/strings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -101,7 +106,7 @@
|
|||
<component name="CodeInsightWorkspaceSettings">
|
||||
<option name="optimizeImportsOnTheFly" value="true" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[21114523025303]" />
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[C:\Users\sergiodt\.android\avd\Pixel_6_API_30.avd]" />
|
||||
<component name="ExportToHTMLSettings">
|
||||
<option name="OPEN_IN_BROWSER" value="true" />
|
||||
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
|
||||
|
@ -423,13 +428,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1618825571576</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00119" summary="EntrySalix">
|
||||
<created>1679575710293</created>
|
||||
<option name="number" value="00119" />
|
||||
<option name="presentableId" value="LOCAL-00119" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679575710293</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00120" summary="refs #4731 print">
|
||||
<created>1679905259957</created>
|
||||
<option name="number" value="00120" />
|
||||
|
@ -766,7 +764,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1688103597825</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="168" />
|
||||
<task id="LOCAL-00168" summary="refs #5891">
|
||||
<created>1688360978709</created>
|
||||
<option name="number" value="00168" />
|
||||
<option name="presentableId" value="LOCAL-00168" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1688360978709</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="169" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.History.Properties">
|
||||
|
@ -867,7 +872,6 @@
|
|||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<MESSAGE value="refs #4678 Carga/descarga" />
|
||||
<MESSAGE value="refs #5675 fallo parking" />
|
||||
<MESSAGE value="refs #5618 traducciones" />
|
||||
<MESSAGE value="refs #4940" />
|
||||
|
@ -892,7 +896,8 @@
|
|||
<MESSAGE value="refs #4678" />
|
||||
<MESSAGE value="version 23.26 refs #4678" />
|
||||
<MESSAGE value="refs #5613 renew token" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="refs #5613 renew token" />
|
||||
<MESSAGE value="refs #5891" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="refs #5891" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
|
|
|
@ -8,6 +8,7 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
|||
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
|
||||
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
|
||||
|
@ -110,6 +111,10 @@ interface OnVisibleClickListener {
|
|||
fun onVisibleClickListener(item: ItemUbicadorVO)
|
||||
}
|
||||
|
||||
interface OnVisibleInventoryClickListener {
|
||||
fun onVisibleInventoryClickListener(item: ItemInventoryParking)
|
||||
}
|
||||
|
||||
interface OnMoreClickListener {
|
||||
fun onMoreClickListener(item: ItemUbicadorVO)
|
||||
}
|
||||
|
|
|
@ -9,19 +9,19 @@ 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.OnVisibleInventoryClickListener
|
||||
import es.verdnatura.presentation.common.loadUrl
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.InventoryParking
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
|
||||
class InventoryParkingAdapter(
|
||||
private val items: List<InventoryParking>,
|
||||
private var items: List<ItemInventoryParking>,
|
||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||
private val onVisibleClickListener: OnVisibleClickListener,
|
||||
private val onVisibleInventoryClickListener: OnVisibleInventoryClickListener,
|
||||
private val onMoreClickListener: OnMoreClickListener
|
||||
) : RecyclerView.Adapter<InventoryParkingAdapter.ItemHolder>() {
|
||||
|
||||
fun getList(): List<InventoryParking> {
|
||||
fun getList(): List<ItemInventoryParking> {
|
||||
return items
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,32 @@ class InventoryParkingAdapter(
|
|||
|
||||
override fun getItemCount() = items.size
|
||||
|
||||
fun getListItems(): List<ItemInventoryParking> {
|
||||
return items
|
||||
}
|
||||
|
||||
fun sortBy(fieldSort: String) {
|
||||
when (fieldSort) {
|
||||
"sector" -> {
|
||||
items = items.sortedBy { it.sectorFk }
|
||||
}
|
||||
|
||||
"buyer" -> {
|
||||
items = items.sortedBy { it.buyer }
|
||||
}
|
||||
|
||||
"pickingOrder" -> {
|
||||
items = items.sortedBy { it.pickingOrder }
|
||||
}
|
||||
}
|
||||
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun setData(newData: List<ItemInventoryParking>) {
|
||||
items = newData
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
|
@ -49,7 +74,7 @@ class InventoryParkingAdapter(
|
|||
private val res = binding.root.context.resources
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun bind(item: InventoryParking) {
|
||||
fun bind(item: ItemInventoryParking) {
|
||||
binding.apply {
|
||||
this.item = item
|
||||
//multiText.text = "${item.stickers}x${item.packing}"
|
||||
|
@ -68,6 +93,10 @@ class InventoryParkingAdapter(
|
|||
// onVisibleClickListener.onVisibleClickListener(item)
|
||||
}
|
||||
|
||||
visibleText.setOnClickListener {
|
||||
onVisibleInventoryClickListener.onVisibleInventoryClickListener(item)
|
||||
}
|
||||
|
||||
if (item.visible == 0) {
|
||||
visibleText.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.view.View.GONE
|
|||
import android.view.View.VISIBLE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ImageView
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -21,10 +20,11 @@ import es.verdnatura.domain.toast
|
|||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.*
|
||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.InventoryParkingAdapter
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.InventoryParking
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||
|
||||
|
||||
|
@ -40,6 +40,7 @@ class InventaryParkingFragment(
|
|||
private lateinit var customDialogUbicador: CustomDialogUbicador
|
||||
private lateinit var customDialogTwoButtons: CustomDialogTwoButtons
|
||||
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private var listItems: MutableList<ItemUbicadorVO> = mutableListOf()
|
||||
private var listLocalItems: ArrayList<ItemUbicadorVO> = ArrayList()
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
@ -54,6 +55,9 @@ class InventaryParkingFragment(
|
|||
var mperror: MediaPlayer? = null
|
||||
var mpok: MediaPlayer? = null
|
||||
var isBack = false
|
||||
private lateinit var myListInventory: MutableList<ItemInventoryParking>
|
||||
private var listParkings: ArrayList<BarcodeVO> = ArrayList()
|
||||
private var listWagonsAdapter: BarcodeAdapter? = null
|
||||
|
||||
|
||||
companion object {
|
||||
|
@ -79,13 +83,14 @@ class InventaryParkingFragment(
|
|||
customDialog = CustomDialog(requireContext())
|
||||
customDialogUbicador = CustomDialogUbicador(requireContext())
|
||||
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
|
||||
ma.hideBottomNavigation(GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = title
|
||||
setEvents()
|
||||
setToolBar()
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.inventoryParking("MAD-01", "CAM-01")
|
||||
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -99,24 +104,30 @@ class InventaryParkingFragment(
|
|||
private fun setToolBar() {
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
|
||||
val iconAdd = ImageView(context)
|
||||
iconAdd.setImageResource(R.drawable.ic_add_black_24dp)
|
||||
|
||||
val iconReload = ImageView(context)
|
||||
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
||||
//Tarea#5052
|
||||
|
||||
val iconReset = ImageView(context)
|
||||
iconReset.setImageResource(R.drawable.ic_remove_checks)
|
||||
|
||||
val iconParkingFrom = ImageView(context)
|
||||
iconParkingFrom.setImageResource(R.drawable.ic_eye_ui)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconParkingFrom.tooltipText = getTooltip(R.drawable.ic_eye_ui)
|
||||
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||
iconAdd.tooltipText = getString(R.string.addItemShelving)
|
||||
iconReset.tooltipText = getTooltip(R.drawable.ic_remove_checks)
|
||||
|
||||
}
|
||||
listIcons.add(iconParkingFrom)
|
||||
listIcons.add(iconAdd)
|
||||
listIcons.add(iconReload)
|
||||
listIcons.add(iconReset)
|
||||
//listIcons.add(iconReset)
|
||||
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
|
@ -125,15 +136,11 @@ class InventaryParkingFragment(
|
|||
|
||||
when (item) {
|
||||
iconAdd.drawable -> {
|
||||
// createListInventoryParking(list,"sector")
|
||||
adapter!!.sortBy("sector")
|
||||
}
|
||||
|
||||
iconReload.drawable -> {
|
||||
//createListInventoryParking(list,"buyer")
|
||||
}
|
||||
|
||||
iconReset.drawable -> {
|
||||
|
||||
adapter!!.sortBy("buyer")
|
||||
}
|
||||
|
||||
iconReset.drawable -> {
|
||||
|
@ -149,6 +156,11 @@ class InventaryParkingFragment(
|
|||
.show()
|
||||
|
||||
}
|
||||
|
||||
iconParkingFrom.drawable -> {
|
||||
setParkingFromTo()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,6 +169,87 @@ class InventaryParkingFragment(
|
|||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setParkingFromTo() {
|
||||
|
||||
customDialogList.setTitle("Indica parkings a revisar")
|
||||
customDialogList.setDescription("Indica desde dónde hasta cual quieres revisar")
|
||||
|
||||
.setOkButton(
|
||||
getString(R.string.review)
|
||||
) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
|
||||
if (listParkings.isNotEmpty() && listParkings.size == 2) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.ItemListInventoryParking("MAD-01", "CAM-01")
|
||||
listParkings.clear()
|
||||
customDialog.dismiss()
|
||||
|
||||
} else {
|
||||
|
||||
customDialog
|
||||
.setDescription("Indica el parking hasta donde quieres revisar")
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
listParkings = ArrayList()
|
||||
customDialogList.dismiss()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogList.getEditText().requestFocus()
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
|
||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!customDialogList.getValue().isNullOrEmpty()) {
|
||||
try {
|
||||
|
||||
|
||||
if (listParkings.size == 1) {
|
||||
viewModel.ItemListInventoryParking(
|
||||
listParkings!!.first()!!.code!!,
|
||||
customDialogList.getValue()
|
||||
)
|
||||
listParkings.clear()
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
listParkings.add(0, BarcodeVO(code = customDialogList.getValue()))
|
||||
}
|
||||
|
||||
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
|
||||
listWagonsAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
customDialogList.setValue("")
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
listWagonsAdapter = BarcodeAdapter(
|
||||
listParkings,
|
||||
object : OnBarcodeRowClickListener {
|
||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||
|
||||
}
|
||||
}, showDelete = false
|
||||
)
|
||||
customDialogList.getRecyclerView().adapter = listWagonsAdapter
|
||||
|
||||
customDialogList.getRecyclerView().layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun setEvents() {
|
||||
|
@ -170,16 +263,11 @@ class InventaryParkingFragment(
|
|||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!binding.editMatricula.text.toString().isNullOrEmpty()) {
|
||||
|
||||
|
||||
/*Tarea 5336 */
|
||||
if (!modeCheckUbication || (modeCheckUbication && binding.editMatricula.text.toString().length == 3 && !binding.editMatricula.text!![0].isDigit())) {
|
||||
if (binding.editMatricula.text.toString().length == 3 && !binding.editMatricula.text!![0].isDigit()) {
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
binding.editMatricula.text.toString()
|
||||
//shelvingFk = binding.editMatricula.text.toString()
|
||||
parking = ""
|
||||
binding.editPrioridad.setText("")
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
isShelvinLogfromMainScreen = true
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -210,33 +298,8 @@ class InventaryParkingFragment(
|
|||
return@setOnEditorActionListener false
|
||||
}
|
||||
|
||||
binding.editPrioridad.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!binding.editPrioridad.text.toString().isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
|
||||
}
|
||||
ma.hideKeyboard(binding.editPrioridad)
|
||||
}
|
||||
|
||||
binding.editMatricula.requestFocus()
|
||||
return@setOnEditorActionListener false
|
||||
}
|
||||
|
||||
|
||||
binding.automaticImg.setOnClickListener {
|
||||
if (!shelvingFk.isNullOrEmpty())
|
||||
|
||||
ma.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = getString(R.string.titleAuto)),
|
||||
//PasillerosItemVO(title = getString(R.string.titleChecker)),
|
||||
entryPoint = shelvingFk
|
||||
)
|
||||
else
|
||||
getString(R.string.scanShelving).toast(requireActivity(), Toast.LENGTH_SHORT)
|
||||
}
|
||||
|
||||
binding.parkingImg.setOnClickListener {
|
||||
customDialogInput.setTitle(getString(R.string.parkingShelving)).setValue("")
|
||||
.setOkButton(
|
||||
|
@ -379,8 +442,8 @@ class InventaryParkingFragment(
|
|||
ma.messageWithSound(it.list[0].errorMessage, it.list[0].isError, false)
|
||||
|
||||
} else {
|
||||
|
||||
createListInventoryParking(it.list)
|
||||
myListInventory = it.list as MutableList<ItemInventoryParking>
|
||||
createListInventoryParking(myListInventory)
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -399,48 +462,20 @@ class InventaryParkingFragment(
|
|||
}
|
||||
})
|
||||
|
||||
/* 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 }
|
||||
}
|
||||
}
|
||||
private fun createListInventoryParking(list: List<ItemInventoryParking>, sort: String? = null) {
|
||||
|
||||
adapter = InventoryParkingAdapter(
|
||||
sortedList,
|
||||
myListInventory,
|
||||
onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
||||
onVisibleClickListener = object : OnVisibleClickListener {
|
||||
override fun onVisibleClickListener(item: ItemUbicadorVO) {
|
||||
|
||||
showAutoSelfConsumption(item)
|
||||
onVisibleInventoryClickListener = object : OnVisibleInventoryClickListener {
|
||||
override fun onVisibleInventoryClickListener(item: ItemInventoryParking) {
|
||||
changeQuantity(item)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
onMoreClickListener = object : OnMoreClickListener {
|
||||
override fun onMoreClickListener(item: ItemUbicadorVO) {
|
||||
|
@ -449,8 +484,9 @@ class InventaryParkingFragment(
|
|||
|
||||
})
|
||||
|
||||
binding.locationRecyclerview.adapter = adapter
|
||||
binding.locationRecyclerview.layoutManager =
|
||||
|
||||
binding.inventoryParkingRecyclerview.adapter = adapter
|
||||
binding.inventoryParkingRecyclerview.layoutManager =
|
||||
LinearLayoutManager(
|
||||
requireContext(),
|
||||
LinearLayoutManager.VERTICAL,
|
||||
|
@ -459,22 +495,20 @@ class InventaryParkingFragment(
|
|||
|
||||
}
|
||||
|
||||
private fun showAutoSelfConsumption(item: ItemUbicadorVO) {
|
||||
private fun changeQuantity(item: ItemInventoryParking) {
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setTitle(getString(R.string.selfConsumption))
|
||||
customDialogInput.setDescription(getString(R.string.quantityTake))
|
||||
customDialogInput.setTitle(getString(R.string.quantity))
|
||||
customDialogInput.setDescription(getString(R.string.quantityVisible))
|
||||
.setValue("")
|
||||
.setOkButton(getString(R.string.take)) {
|
||||
.setOkButton(getString(R.string.modify)) {
|
||||
try {
|
||||
if (customDialogInput.getValue().toInt() > 0) {
|
||||
if (customDialogInput.getValue().toInt() >= 0) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
var quantity =
|
||||
if (item.visible.toInt() - customDialogInput.getValue().toInt() > 0) {
|
||||
item.visible.toInt() - customDialogInput.getValue().toInt()
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
||||
//viewModel.ChangeVisible
|
||||
item.visible - customDialogInput.getValue().toInt()
|
||||
|
||||
|
||||
} else {
|
||||
throw Exception("")
|
||||
|
@ -491,228 +525,6 @@ class InventaryParkingFragment(
|
|||
}
|
||||
|
||||
|
||||
private fun showAddItem(
|
||||
itemFk: String,
|
||||
packing: String,
|
||||
etiquetas: String,
|
||||
visible: String,
|
||||
delete: Boolean,
|
||||
itemUbicador: ItemUbicadorVO,
|
||||
grouping: String
|
||||
) {
|
||||
var title = getString(R.string.newItem)
|
||||
if (delete) title = getString(R.string.editItem) + itemFk
|
||||
customDialogUbicador.setTitle(title).setItemValue(itemFk).setPackingValue(packing)
|
||||
.setGroupingValue(grouping).setEtiquetaValue(etiquetas).setVisibleValue(visible)
|
||||
.setOkButton(getString(R.string.save)) {
|
||||
var packingUpdate = false
|
||||
if (packing != customDialogUbicador.getPackingValue() || etiquetas != customDialogUbicador.getEtiquetaValue()) {
|
||||
packingUpdate = true
|
||||
}
|
||||
saveNewItem(
|
||||
customDialogUbicador.getItemValue().toInt(),
|
||||
if (customDialogUbicador.getEtiquetaValue().isNullOrEmpty()) {
|
||||
1
|
||||
} else {
|
||||
customDialogUbicador.getEtiquetaValue().toInt()
|
||||
},
|
||||
if (customDialogUbicador.getPackingValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getPackingValue().toInt()
|
||||
},
|
||||
if (customDialogUbicador.getVisibleValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getVisibleValue().toInt()
|
||||
},
|
||||
if (delete) packingUpdate else null,
|
||||
itemUbicador.id,
|
||||
if (customDialogUbicador.getGroupingValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getGroupingValue().toInt()
|
||||
}
|
||||
)
|
||||
}.setKoButton(getString(R.string.close)) {
|
||||
customDialogUbicador.dismiss()
|
||||
}.show()
|
||||
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
ma.hideKeyboard(customDialogUbicador.getEditItem())
|
||||
|
||||
customDialogUbicador.getVisibleItem().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
var packingUpdate = false
|
||||
if (packing != customDialogUbicador.getPackingValue() || etiquetas != customDialogUbicador.getEtiquetaValue()) {
|
||||
packingUpdate = true
|
||||
}
|
||||
saveNewItem(
|
||||
customDialogUbicador.getItemValue().toInt(),
|
||||
customDialogUbicador.getEtiquetaValue().toInt(),
|
||||
if (customDialogUbicador.getPackingValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getPackingValue().toInt()
|
||||
},
|
||||
if (customDialogUbicador.getVisibleValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getVisibleValue().toInt()
|
||||
},
|
||||
if (delete) packingUpdate else null,
|
||||
itemUbicador.id,
|
||||
customDialogUbicador.getGroupingValue().toInt()
|
||||
)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
customDialogUbicador.getEditItem().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
|
||||
if (!customDialogUbicador.getItemValue().isNullOrEmpty()) {
|
||||
try {
|
||||
|
||||
customDialogUbicador.setItemValue(
|
||||
itemScanValue(
|
||||
customDialogUbicador.getItemValue(),
|
||||
"buy",
|
||||
"more"
|
||||
).toString()
|
||||
)
|
||||
|
||||
} catch (ex: Exception) {
|
||||
ma.messageWithSound(ex.message.toString(), true, true)
|
||||
customDialogUbicador.setItemValue("")
|
||||
}
|
||||
}
|
||||
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
|
||||
customDialogUbicador.getPackingItem().requestFocus()
|
||||
}
|
||||
|
||||
customDialogUbicador.getEtiquetaItem().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
var packingUpdate = false
|
||||
if (packing != customDialogUbicador.getPackingValue() || etiquetas != customDialogUbicador.getEtiquetaValue()) {
|
||||
packingUpdate = true
|
||||
}
|
||||
saveNewItem(
|
||||
customDialogUbicador.getItemValue().toInt(),
|
||||
customDialogUbicador.getEtiquetaValue().toInt(),
|
||||
if (customDialogUbicador.getPackingValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getPackingValue().toInt()
|
||||
},
|
||||
if (customDialogUbicador.getVisibleValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getVisibleValue().toInt()
|
||||
},
|
||||
if (delete) packingUpdate else null,
|
||||
itemUbicador.id,
|
||||
if (customDialogUbicador.getGroupingValue().isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
customDialogUbicador.getGroupingValue().toInt()
|
||||
}
|
||||
)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun saveNewItem(
|
||||
itemFk: Int?,
|
||||
etiquetas: Int,
|
||||
packing: Int?,
|
||||
visible: Int?,
|
||||
updatePacking: Boolean? = null,
|
||||
itemShelvingFk: Int,
|
||||
groupingPack: Int?
|
||||
) {
|
||||
if (packing != null) {
|
||||
if (updatePacking == null) {
|
||||
if (itemFk != null && visible != null) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
|
||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||
.setGroupingValue("")
|
||||
.setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
ma.hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
} else if (itemFk != null && etiquetas != null) {
|
||||
val visible_calc = (etiquetas * packing!!.toInt())
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
|
||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||
.setGroupingValue("")
|
||||
.setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
ma.hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
} else {
|
||||
getString(R.string.fillFields).toast(
|
||||
(activity as MainActivity),
|
||||
Toast.LENGTH_LONG
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (itemFk != null && visible != null && !updatePacking) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
|
||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||
.setGroupingValue("")
|
||||
.setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
ma.hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
} else if (itemFk != null && etiquetas != null && updatePacking) {
|
||||
var visible_calc = 0
|
||||
try {
|
||||
visible_calc = (etiquetas * packing.toInt())
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
customDialogUbicador.setItemValue("").setPackingValue("")
|
||||
.setGroupingValue("")
|
||||
.setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
ma.hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
} else {
|
||||
getString(R.string.fillFields).toast(
|
||||
(activity as MainActivity),
|
||||
Toast.LENGTH_LONG
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
getString(R.string.mandatoryPacking).toast(
|
||||
(activity as MainActivity),
|
||||
Toast.LENGTH_LONG
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showMoreOptions(item: ItemUbicadorVO) {
|
||||
customDialogTwoButtons.setTitle(item.item.toString())
|
||||
.setDescription(getString(R.string.selectAction))
|
||||
|
|
|
@ -13,8 +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.BuyerVO
|
||||
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.ItemInventoryParking
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.*
|
||||
import retrofit2.Response
|
||||
|
@ -371,46 +371,46 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun inventoryParking(
|
||||
fun ItemListInventoryParking(
|
||||
vParkingFrom: String,
|
||||
vParkingTo: String
|
||||
) {
|
||||
|
||||
var myList = InventoryParkingList(
|
||||
listOf(
|
||||
InventoryParking(
|
||||
31, "F-01-1", "OZR", 19897, "Dendrobium Galaxy", 510, 37, "Jose Alarcan Gomex",
|
||||
ItemInventoryParking(
|
||||
31, vParkingFrom, vParkingTo, 19897, "Dendrobium Galaxy", 510, 37, "Jose Alarcan Gomex",
|
||||
"http://verdnatura.es/vn-image-data/catalog/1600x900/dgalaxy", 0, 2
|
||||
),
|
||||
InventoryParking(
|
||||
ItemInventoryParking(
|
||||
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
|
||||
"http://verdnatura.es/vn-image-data/catalog/1600x900/92400", 1, 2
|
||||
),
|
||||
InventoryParking(
|
||||
ItemInventoryParking(
|
||||
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(
|
||||
ItemInventoryParking(
|
||||
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(
|
||||
ItemInventoryParking(
|
||||
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(
|
||||
ItemInventoryParking(
|
||||
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
|
||||
"http://verdnatura.es/vn-image-data/catalog/1600x900/bqamor", 2, 0
|
||||
),
|
||||
InventoryParking(
|
||||
ItemInventoryParking(
|
||||
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(
|
||||
ItemInventoryParking(
|
||||
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(
|
||||
ItemInventoryParking(
|
||||
34, "F-01-4", "JXU", 50004, "Monstera IV", 240, 37, "Jose Alarcan Gomex",
|
||||
"http://verdnatura.es/vn-image-data/catalog/1600x900/50003", 0, 2
|
||||
)
|
||||
|
|
|
@ -19,7 +19,7 @@ class InventaryListVO(
|
|||
|
||||
|
||||
|
||||
data class InventoryParking(
|
||||
data class ItemInventoryParking(
|
||||
val pickingOrder: Int,
|
||||
val parking: String,
|
||||
val shelvingFk: String,
|
||||
|
@ -35,6 +35,6 @@ data class InventoryParking(
|
|||
var errorMessage: String = "",
|
||||
)
|
||||
class InventoryParkingList(
|
||||
var list: List<InventoryParking> = listOf()
|
||||
var list: List<ItemInventoryParking> = listOf()
|
||||
)
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
//Tarea 5891
|
||||
/* _pasillerositem.add(
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
3,
|
||||
R.drawable.ic_inventory_parking,
|
||||
|
@ -180,7 +180,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
|||
R.string.titleInventoryParkingDescrip
|
||||
)
|
||||
)
|
||||
)*/
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/location_recyclerview"
|
||||
android:id="@+id/inventory_parking_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<variable
|
||||
name="item"
|
||||
type="es.verdnatura.presentation.view.feature.inventario.model.InventoryParking" />
|
||||
type="es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -602,5 +602,6 @@
|
|||
<string name="errorConfigToken">Póngase en contacto con el dpto. de Informática</string>
|
||||
<string name="titleInventoryParking">Inventario por parking</string>
|
||||
<string name="titleInventoryParkingDescrip">Permite inventariar por parking</string>
|
||||
<string name="quantityVisible">Indica la nueva cantidad visible</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -602,5 +602,6 @@
|
|||
<string name="errorConfigToken">Póngase en contacto con el dpto. de Informática</string>
|
||||
<string name="titleInventoryParking">Inventario por parking</string>
|
||||
<string name="titleInventoryParkingDescrip">Permite inventariar por parking</string>
|
||||
<string name="quantityVisible">Indica la nueva cantidad visible</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -602,5 +602,6 @@
|
|||
<string name="errorConfigToken">Póngase en contacto con el dpto. de Informática</string>
|
||||
<string name="titleInventoryParking">Inventario por parking</string>
|
||||
<string name="titleInventoryParkingDescrip">Permite inventariar por parking</string>
|
||||
<string name="quantityVisible">Indica la nueva cantidad visible</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -601,4 +601,5 @@
|
|||
<string name="errorConfigToken">Póngase en contacto con el dpto. de Informática</string>
|
||||
<string name="titleInventoryParking">Inventory by parking</string>
|
||||
<string name="titleInventoryParkingDescrip">Inventory by parking, you can select ubications</string>
|
||||
<string name="quantityVisible">Indica la nueva cantidad visible</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue