refs #4765 Refactor
This commit is contained in:
parent
2efa03454b
commit
6fb4b69ab6
|
@ -83,10 +83,39 @@
|
|||
</select>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="version 23.10.1 Modificar controlador orden">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #4765">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/di/viewModelModule.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/di/viewModelModule.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SilexInterceptor.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SilexInterceptor.kt" 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/base/BaseFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.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/calidad/adapter/ItemBuyersAdapter.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/adapter/FaltasAdapter.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/model/ItemFaltasVO.kt" beforeDir="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/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/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/adapter/ReposicionAdapter.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionFragment.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionViewModel.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_faltas.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_buyer_row.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_faltas_row.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/qauality_fragment.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/procedimientos.txt" beforeDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -240,6 +269,7 @@
|
|||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"ScreenRecorder.SavePath": "C:\\Users\\sergiodt\\device-2023-03-17-114045.mp4",
|
||||
"android-custom-viewC:/Users/sergiodt/.gradle/caches/modules-2/files-2.1/androidx.recyclerview/recyclerview/1.2.1/f0f93e67af3f7417bdd560d5142f6dec4fe629c3/recyclerview-1.2.1-sources.jar!/androidx/recyclerview/widget/RecyclerView.java_SELECTED": "RecyclerView",
|
||||
"cidr.known.project.marker": "true",
|
||||
"com.google.services.firebase.aqiPopupShown": "true",
|
||||
"last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/java/es/verdnatura/presentation/view/feature",
|
||||
|
@ -841,7 +871,6 @@
|
|||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<MESSAGE value="Version 9.6Beta en test" />
|
||||
<MESSAGE value="Version 9.6Beta en test : ubicador, quality, posicion, buscar item, reclamaciones..." />
|
||||
<MESSAGE value="Version 9.6Beta en test: paletizadores" />
|
||||
<MESSAGE value="Version 9.6Beta. TEST5: imprimir ok, ubicador ok, no se cierra app sacador" />
|
||||
|
@ -866,7 +895,8 @@
|
|||
<MESSAGE value="refs #4940 packingHolland" />
|
||||
<MESSAGE value="version 23.10 General" />
|
||||
<MESSAGE value="version 23.10.1 Modificar controlador orden" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="version 23.10.1 Modificar controlador orden" />
|
||||
<MESSAGE value="refs #4765" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="refs #4765" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<pin-to-top-manager>
|
||||
|
|
|
@ -4,15 +4,12 @@ import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
|
|||
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
|
||||
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
||||
import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersViewModel
|
||||
import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityViewModel
|
||||
import es.verdnatura.presentation.view.feature.claim.fragment.ClaimViewModel
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
|
||||
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
|
||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel
|
||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModel
|
||||
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.itemShelvingLogViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.shelvingLogViewModel
|
||||
|
@ -27,7 +24,6 @@ import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewM
|
|||
import es.verdnatura.presentation.view.feature.precontrol.ShowTicketViewModel
|
||||
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorViewModel
|
||||
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
|
||||
import es.verdnatura.presentation.view.feature.reposicion.fragment.ReposicionViewModel
|
||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorViewModel
|
||||
import es.verdnatura.presentation.view.feature.shelvingparking.fragment.ShelvingParkingViewModel
|
||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemViewModel
|
||||
|
@ -82,10 +78,6 @@ val viewModelModule = module {
|
|||
viewModel {
|
||||
InventaryViewModel(androidContext())
|
||||
}
|
||||
// Pasilleros / Faltas
|
||||
viewModel {
|
||||
FaltasViewModel(androidContext())
|
||||
}
|
||||
|
||||
// ShelvingParking
|
||||
viewModel {
|
||||
|
@ -166,18 +158,6 @@ val viewModelModule = module {
|
|||
PreSacadorViewModel(androidContext())
|
||||
}
|
||||
|
||||
viewModel {
|
||||
ReposicionViewModel(androidContext())
|
||||
}
|
||||
|
||||
viewModel {
|
||||
BuyersViewModel(androidContext())
|
||||
}
|
||||
|
||||
viewModel {
|
||||
QaualityViewModel(androidContext())
|
||||
}
|
||||
|
||||
viewModel {
|
||||
ControlVehiculoViewModel(androidContext())
|
||||
}
|
||||
|
|
|
@ -24,12 +24,14 @@ class SilexInterceptor : Interceptor {
|
|||
val request = chain.request()
|
||||
//sergio: condición para que añada o no headers según se vaya quitando de las llamadas
|
||||
//no quitar condición hasta que estén quitados
|
||||
//Tarea 5486 se añade Authorization, más adelante ver de quitar.
|
||||
if (request.headers().toString().isEmpty()) {
|
||||
val newRequest = request.newBuilder()
|
||||
.addHeader("aplicacion", "json")
|
||||
.addHeader("version", "1")
|
||||
.addHeader("user", prefs.getString("user", null))
|
||||
.addHeader("pass", prefs.getString("password", null))
|
||||
.addHeader("Authorization", prefs.getString("token", ""))
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.build()
|
||||
// d("VERDNATURA::", newRequest.headers().toString() + newRequest.url())
|
||||
|
|
|
@ -15,10 +15,8 @@ import es.verdnatura.presentation.view.feature.delivery.model.DeliveryInfo
|
|||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLog
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginDevice
|
||||
|
@ -302,19 +300,6 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("almacennew/saleMove")//REVISADA
|
||||
fun saleMove(
|
||||
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
/*
|
||||
@POST("almacennew/collectionMissingTrash")//REVISADA
|
||||
fun collectionMissingTrash(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/saleTrackingDel")//REVISADA
|
||||
fun saleTrackingDel(
|
||||
@Body vararg params: Any
|
||||
|
@ -494,18 +479,6 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<ItemInventaryVO>>
|
||||
|
||||
@POST("almacennew/faultsReview")//REVISADA
|
||||
fun faultsReview(
|
||||
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemFaltasVO>>
|
||||
|
||||
@POST("almacennew/faultsReview_isChecked")//REVISADA
|
||||
fun faultsReview_isChecked(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
//SHELVING PARKING ========================================================================>
|
||||
@POST("almacennew/shelvingParking_get")//REVISADA
|
||||
|
@ -729,17 +702,6 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<ItemShelvingLog>>
|
||||
|
||||
@POST("almacennew/shelvingLog_get")//REVISADA
|
||||
fun shelvingLog_get(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<List<ShelvingLog>>
|
||||
|
||||
@POST("almacennew/itemShelving_updateSpam")//REVISADA
|
||||
fun itemShelving_updateSpam(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
|
|
@ -227,7 +227,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
R.drawable.ic_eye_ui -> getString(R.string.icViewCollection)
|
||||
R.drawable.ic_collection -> getString(R.string.icViewCollection)
|
||||
R.drawable.ic_ubicator_check -> getString(R.string.checkerUbication)
|
||||
R.drawable.ic_delivery ->"Abre la app de Reparto para escanear carga"
|
||||
R.drawable.ic_delivery_truck ->"Abre la app de Reparto para escanear carga"
|
||||
else -> {
|
||||
""
|
||||
}
|
||||
|
@ -667,7 +667,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestHome",
|
||||
"http://192.168.1.128:9000",
|
||||
"http://192.168.1.37:9000",
|
||||
urlSalix = "https://test-salix.verdnatura.es/api/"
|
||||
)
|
||||
)
|
||||
|
@ -681,7 +681,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestLOCALHOME",
|
||||
"http://192.168.1.128:9000",
|
||||
"http://192.168.1.37:9000",
|
||||
urlSalix = "http://localhost:3000/api/"
|
||||
)
|
||||
)
|
||||
|
|
|
@ -6,7 +6,6 @@ import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
|||
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardRowVO
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
|
||||
|
@ -94,14 +93,6 @@ interface OnItemProposalClickListener {
|
|||
fun onItemProposalClickListener(item: ItemProposal)
|
||||
}
|
||||
|
||||
interface OnFaltasNichoClickListener {
|
||||
fun onFaltasNichoClickListener(item: ItemFaltasVO)
|
||||
}
|
||||
|
||||
interface OnFaltasReviewClickListener {
|
||||
fun onFaltasReviewClickListener(item: ItemFaltasVO)
|
||||
}
|
||||
|
||||
interface OnAutomaticItemClickListener {
|
||||
fun onAutomaticItemClickListener(position: Int)
|
||||
}
|
||||
|
|
|
@ -1,129 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.calidad.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ItemBuyerRowBinding
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.OnStarSelectedListener
|
||||
import es.verdnatura.presentation.common.loadUrl
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
|
||||
class ItemBuyersAdapter(
|
||||
private val items: List<ItemBuyerVO>,
|
||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||
private val onStarSelectedListener: OnStarSelectedListener
|
||||
) : RecyclerView.Adapter<ItemBuyersAdapter.BuyersItemHolder>() {
|
||||
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BuyersItemHolder {
|
||||
return BuyersItemHolder(
|
||||
ItemBuyerRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
)
|
||||
}
|
||||
|
||||
override fun getItemCount() = items.size
|
||||
|
||||
override fun onBindViewHolder(holder: BuyersItemHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
|
||||
}
|
||||
|
||||
|
||||
inner class BuyersItemHolder(
|
||||
val binding: ItemBuyerRowBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(item: ItemBuyerVO) {
|
||||
binding.apply {
|
||||
this.itemBuyer = item
|
||||
if (item.image != "")
|
||||
imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/" + item.image)
|
||||
else
|
||||
imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/" + item.itemFk)
|
||||
|
||||
imgItem.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = binding.root.context.getString(
|
||||
R.string.titleItemConsult
|
||||
)
|
||||
), item.itemFk
|
||||
)
|
||||
}
|
||||
|
||||
if (item.showStars) layoutStars.visibility = View.VISIBLE
|
||||
else layoutStars.visibility = View.GONE
|
||||
|
||||
|
||||
s1.setOnClickListener {
|
||||
onStarSelectedListener.onStarSelected(item.id, "1")
|
||||
}
|
||||
|
||||
s2.setOnClickListener {
|
||||
onStarSelectedListener.onStarSelected(item.id, "2")
|
||||
}
|
||||
|
||||
s3.setOnClickListener {
|
||||
onStarSelectedListener.onStarSelected(item.id, "3")
|
||||
}
|
||||
|
||||
s4.setOnClickListener {
|
||||
onStarSelectedListener.onStarSelected(item.id, "4")
|
||||
}
|
||||
|
||||
s5.setOnClickListener {
|
||||
onStarSelectedListener.onStarSelected(item.id, "5")
|
||||
}
|
||||
|
||||
if (item.stars != "") {
|
||||
try {
|
||||
val punt = item.stars.toInt()
|
||||
if (punt == 1) {
|
||||
s1.setImageResource(item.iconResourceOk)
|
||||
s2.setImageResource(item.iconResourceKo)
|
||||
s3.setImageResource(item.iconResourceKo)
|
||||
s4.setImageResource(item.iconResourceKo)
|
||||
s5.setImageResource(item.iconResourceKo)
|
||||
} else if (punt == 2) {
|
||||
s1.setImageResource(item.iconResourceOk)
|
||||
s2.setImageResource(item.iconResourceOk)
|
||||
s3.setImageResource(item.iconResourceKo)
|
||||
s4.setImageResource(item.iconResourceKo)
|
||||
s5.setImageResource(item.iconResourceKo)
|
||||
} else if (punt == 3) {
|
||||
s1.setImageResource(item.iconResourceOk)
|
||||
s2.setImageResource(item.iconResourceOk)
|
||||
s3.setImageResource(item.iconResourceOk)
|
||||
s4.setImageResource(item.iconResourceKo)
|
||||
s5.setImageResource(item.iconResourceKo)
|
||||
} else if (punt == 4) {
|
||||
s1.setImageResource(item.iconResourceOk)
|
||||
s2.setImageResource(item.iconResourceOk)
|
||||
s3.setImageResource(item.iconResourceOk)
|
||||
s4.setImageResource(item.iconResourceOk)
|
||||
s5.setImageResource(item.iconResourceKo)
|
||||
} else if (punt == 5) {
|
||||
s1.setImageResource(item.iconResourceOk)
|
||||
s2.setImageResource(item.iconResourceOk)
|
||||
s3.setImageResource(item.iconResourceOk)
|
||||
s4.setImageResource(item.iconResourceOk)
|
||||
s5.setImageResource(item.iconResourceOk)
|
||||
} else {
|
||||
s1.setImageResource(item.iconResourceOk)
|
||||
s2.setImageResource(item.iconResourceOk)
|
||||
s3.setImageResource(item.iconResourceOk)
|
||||
s4.setImageResource(item.iconResourceOk)
|
||||
s5.setImageResource(item.iconResourceOk)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.BuyersFragmentBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnAjustesItemClickListener
|
||||
import es.verdnatura.presentation.common.OnBuyerSelectedListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.ajustes.adapter.AjustesAdapter
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
|
||||
class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(BuyersViewModel::class) {
|
||||
|
||||
// private lateinit var customDialog: CustomDialog
|
||||
private var onBuyerSelectedListener : OnBuyerSelectedListener? = null
|
||||
private var buyersAdapter: AjustesAdapter? = null
|
||||
|
||||
companion object {
|
||||
fun newInstance() = BuyersFragment()
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.buyers_fragment
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
if (context is OnBuyerSelectedListener) onBuyerSelectedListener = context
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.itemShelvingBuyerGet()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
// customDialog = CustomDialog(requireContext())
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.quality)
|
||||
|
||||
setToolBar()
|
||||
setEvents()
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setToolBar(){
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconReload = ImageView(context)
|
||||
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||
|
||||
}
|
||||
listIcons.add(iconReload)
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons,object: OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
when(item){
|
||||
iconReload.drawable->{
|
||||
binding.splashProgress.visibility= View.VISIBLE
|
||||
viewModel.itemShelvingBuyerGet()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
buyersList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createBuyerList(it.list)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun createBuyerList(list:List<BuyerVO>){
|
||||
var buyers = ArrayList<AjustesItemVO>()
|
||||
list.forEach { buyer ->
|
||||
if (!buyer.isError){
|
||||
try {
|
||||
buyers.add(
|
||||
AjustesItemVO(
|
||||
id = buyer.userFk.toInt(),
|
||||
title = buyer.nickname,
|
||||
sectorFk = 0,
|
||||
warehouse = 0,
|
||||
printerFk=0,
|
||||
printerSelected ="",
|
||||
action=false
|
||||
)
|
||||
)
|
||||
}catch (e:Exception){}
|
||||
}
|
||||
}
|
||||
buyersAdapter = AjustesAdapter(buyers,object: OnAjustesItemClickListener {
|
||||
override fun onAjustesItemClickListener(item: AjustesItemVO) {
|
||||
onBuyerSelectedListener?.onBuyerSelected(item.id.toString())
|
||||
}
|
||||
})
|
||||
binding.buyersItems.adapter = buyersAdapter
|
||||
binding.buyersItems.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import retrofit2.Response
|
||||
|
||||
class BuyersViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
// private val getQualityUserCase: GetQualityUserCase = GetQualityUserCase(context)
|
||||
|
||||
private val _buyersList by lazy { MutableLiveData<BuyerListVO>() }
|
||||
val buyersList: LiveData<BuyerListVO>
|
||||
get() = _buyersList
|
||||
|
||||
fun itemShelvingBuyerGet() {
|
||||
silex.itemShelvingBuyerGet().enqueue(object :
|
||||
SilexCallback<List<BuyerVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<BuyerVO> = ArrayList()
|
||||
listError.add(
|
||||
BuyerVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_buyersList.value = BuyerListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<BuyerVO>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_buyersList.value = response.body()?.let { BuyerListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<BuyerVO> = ArrayList()
|
||||
listError.add(
|
||||
BuyerVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_buyersList.value = BuyerListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -1,199 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ImageView
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.QaualityFragmentBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.calidad.adapter.ItemBuyersAdapter
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
class QaualityFragment(
|
||||
var userFk : String = "0"
|
||||
) : BaseFragment<QaualityFragmentBinding,QaualityViewModel>(QaualityViewModel::class) {
|
||||
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var buyersAdapter: ItemBuyersAdapter? = null
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
private var onStarSelectedListener : OnStarSelectedListener? = null
|
||||
private var listItems:List<ItemBuyerVO> = listOf()
|
||||
private var lm : LinearLayoutManager? = null
|
||||
private var storedPosition: Int = 0
|
||||
private var goBack:Boolean = false
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(userFk:String) = QaualityFragment(userFk)
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.qauality_fragment
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.itemShelvingBuyerTask(userFk = userFk)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.qualityFragment)
|
||||
setToolBar()
|
||||
setEvents()
|
||||
super.init()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
goBack = true
|
||||
storedPosition = lm?.findFirstVisibleItemPosition() ?: 0
|
||||
}
|
||||
|
||||
private fun setToolBar(){
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconReload = ImageView(context)
|
||||
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||
|
||||
}
|
||||
listIcons.add(iconReload)
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons,object: OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingBuyerTask(userFk = userFk)
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
//ESCANER =========
|
||||
hideKeyboards()
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (! binding.scanInput.text.toString().isEmpty()){
|
||||
findSale( binding.scanInput.text.toString())
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideKeyboards(){
|
||||
try{
|
||||
requireActivity().hideKeyboard()
|
||||
}catch (e:Exception){}
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
buyersList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createBuyerList(it.list)
|
||||
})
|
||||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
viewModel.itemShelvingBuyerTask(userFk = userFk)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun createBuyerList(list:List<ItemBuyerVO>){
|
||||
list.forEach { item ->
|
||||
if (!goBack){
|
||||
if (item.created != ""){
|
||||
item.created = getCalendarFromDate(item.created).convertToDateString()
|
||||
}
|
||||
}
|
||||
|
||||
if (item.visible.contains(getString(R.string.visible),ignoreCase = true)){
|
||||
item.visible = item.visible
|
||||
}else{
|
||||
item.visible = getString(R.string.visible)+item.visible
|
||||
}
|
||||
|
||||
item.iconResourceOk = R.drawable.ic_start_ok
|
||||
item.iconResourceKo = R.drawable.ic_star_ko
|
||||
}
|
||||
goBack = false
|
||||
listItems = list
|
||||
buyersAdapter = ItemBuyersAdapter(listItems,pasillerosItemClickListener!!,object: OnStarSelectedListener{
|
||||
override fun onStarSelected(vId: String, vStars: String) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingStarsUpdate(vId,vStars)
|
||||
}
|
||||
|
||||
})
|
||||
binding.shelvingBuyersItems.adapter = buyersAdapter
|
||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.shelvingBuyersItems.layoutManager = lm
|
||||
|
||||
if (storedPosition < listItems.size)
|
||||
goToPosition(storedPosition)
|
||||
}
|
||||
|
||||
private fun getCalendarFromDate(date:String): Calendar {
|
||||
val sdf = SimpleDateFormat(getString(R.string.dateFormat))
|
||||
val cal = Calendar.getInstance()
|
||||
cal.time = sdf.parse(date)!!
|
||||
return cal
|
||||
}
|
||||
|
||||
private fun findSale(matricula:String){
|
||||
var isSearch = false
|
||||
var index = 0
|
||||
var position = 0
|
||||
listItems.forEach { item ->
|
||||
if (item.shelvingFk.uppercase() == matricula.uppercase()){
|
||||
item.showStars = true
|
||||
if (!isSearch){
|
||||
position = index
|
||||
isSearch = true
|
||||
}
|
||||
}else{
|
||||
item.showStars = false
|
||||
}
|
||||
index += 1
|
||||
}
|
||||
|
||||
storedPosition = position
|
||||
goToPosition(position)
|
||||
|
||||
buyersAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
private fun goToPosition(position:Int){
|
||||
binding.shelvingBuyersItems.addViewObserver {
|
||||
lm!!.scrollToPositionWithOffset(position,0)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerListVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||
import retrofit2.Response
|
||||
|
||||
class QaualityViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
//private val getQualityUserCase: GetQualityUserCase = GetQualityUserCase(context)
|
||||
|
||||
private val _buyersList by lazy { MutableLiveData<ItemBuyerListVO>() }
|
||||
val buyersList: LiveData<ItemBuyerListVO>
|
||||
get() = _buyersList
|
||||
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
|
||||
fun itemShelvingBuyerTask(userFk: String) {
|
||||
silex.itemShelvingBuyerTask(userFk).enqueue(object :
|
||||
SilexCallback<List<ItemBuyerVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemBuyerVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemBuyerVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_buyersList.value = ItemBuyerListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemBuyerVO>>) {
|
||||
super.onSuccess(response)
|
||||
if (response.body() != null) {
|
||||
_buyersList.value = response.body()?.let { ItemBuyerListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemBuyerVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemBuyerVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_buyersList.value = ItemBuyerListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun itemShelvingStarsUpdate(vId: String, vStars: String) {
|
||||
silex.itemShelvingStarsUpdate(vId, vStars).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -72,6 +72,7 @@ class SaleAdapter(
|
|||
val childLayoutManagerV =
|
||||
LinearLayoutManager(context!!, RecyclerView.VERTICAL, false)
|
||||
|
||||
|
||||
itemArticlePlacements.apply {
|
||||
layoutManager = childLayoutManager
|
||||
adapter = PlacementAdapter(sale.placements, onPasillerosItemClickListener)
|
||||
|
|
|
@ -535,7 +535,7 @@ class CollectionFragment(
|
|||
getString(R.string.splitOk),
|
||||
it.isError, true
|
||||
)
|
||||
responseSaleMoveSuccesful()
|
||||
//responseSaleMoveSuccesful()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -726,7 +726,7 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
})
|
||||
responseSaleMove.observe(viewLifecycleOwner, Observer {
|
||||
/* responseSaleMove.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||
|
@ -737,7 +737,7 @@ class CollectionFragment(
|
|||
goBack = false
|
||||
}
|
||||
|
||||
})
|
||||
})*/
|
||||
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
@ -907,7 +907,9 @@ class CollectionFragment(
|
|||
|
||||
} else {
|
||||
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
if (type != PRECHECKER) {
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
goBack = false
|
||||
}
|
||||
})
|
||||
|
@ -1550,7 +1552,7 @@ class CollectionFragment(
|
|||
if (type == SACADOR || getData(SECTORDESCRIP).uppercase() == getString(
|
||||
R.string.sectorALGEMESINEW
|
||||
)
|
||||
) {
|
||||
|| type == PRECHECKER) {
|
||||
var myPosition = position
|
||||
|
||||
if (type == CONTROLADOR && getData(SECTORDESCRIP).uppercase() == getString(
|
||||
|
@ -1587,7 +1589,7 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -79,9 +79,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseItemShelvingUpdate: LiveData<ResponseItemVO>
|
||||
get() = _responseItemShelvingUpdate
|
||||
|
||||
private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
/* private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleMove: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleMove
|
||||
get() = _responseSaleMove*/
|
||||
|
||||
private val _responseUsedShelves by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseUsedShelves: LiveData<ResponseItemVO>
|
||||
|
|
|
@ -59,10 +59,10 @@ class LogExpeditionFragment(
|
|||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconDelivery = ImageView(context)
|
||||
iconDelivery.setImageResource(R.drawable.ic_delivery)
|
||||
iconDelivery.setImageResource(R.drawable.ic_delivery_truck)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconDelivery.tooltipText = getTooltip(R.drawable.ic_delivery)
|
||||
iconDelivery.tooltipText = getTooltip(R.drawable.ic_delivery_truck)
|
||||
}
|
||||
listIcons.add(iconDelivery)
|
||||
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.faltas.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ItemFaltasRowBinding
|
||||
import es.verdnatura.presentation.common.OnFaltasNichoClickListener
|
||||
import es.verdnatura.presentation.common.OnFaltasReviewClickListener
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
|
||||
class FaltasAdapter (
|
||||
private val items: List<ItemFaltasVO>,
|
||||
private val onFaltasNichoClickListener: OnFaltasNichoClickListener,
|
||||
private val onFaltasReviewClickListener:OnFaltasReviewClickListener,
|
||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
|
||||
): RecyclerView.Adapter<FaltasAdapter.ItemHolder> () {
|
||||
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||
return ItemHolder(
|
||||
ItemFaltasRowBinding.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: ItemFaltasRowBinding
|
||||
) : RecyclerView.ViewHolder(binding.root){
|
||||
private val res = binding.root.context.resources
|
||||
fun bind(item: ItemFaltasVO) {
|
||||
binding.apply {
|
||||
this.item = item
|
||||
if(item.producer.isNullOrEmpty()){
|
||||
itemProducer.visibility = View.GONE
|
||||
}else{
|
||||
itemProducer.visibility = View.VISIBLE
|
||||
}
|
||||
itemNicho.setOnClickListener {
|
||||
onFaltasNichoClickListener.onFaltasNichoClickListener(item)
|
||||
}
|
||||
itemFaltas.setOnClickListener {
|
||||
onFaltasReviewClickListener.onFaltasReviewClickListener(item)
|
||||
}
|
||||
itemFk.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(
|
||||
R.string.titleItemConsult)),item.itemFk)
|
||||
}
|
||||
itemUp.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(R.string.titleItemSearch)),item.itemFk)
|
||||
}
|
||||
itemDown.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(R.string.titleItemSearch)),item.itemFk)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,236 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.faltas.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ImageView
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentFaltasBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.feature.faltas.adapter.FaltasAdapter
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class FaltasFragment :
|
||||
BaseFragment<FragmentFaltasBinding, FaltasViewModel>(FaltasViewModel::class) {
|
||||
|
||||
private var adapter: FaltasAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private var listInvetory: ArrayList<ItemFaltasVO> = ArrayList()
|
||||
private var listInvetoryAux: ArrayList<ItemFaltasVO> = ArrayList()
|
||||
|
||||
// private lateinit var customDialog: CustomDialog
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
private var reload = false
|
||||
private var hideLoad = true
|
||||
|
||||
companion object {
|
||||
fun newInstance() = FaltasFragment()
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_faltas
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
viewModel.getFaltas(getData(USER), getData(PASSWORD), getData(WAREHOUSEFK))
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.faultsReview)
|
||||
setToolBar()
|
||||
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
// customDialog = CustomDialog(requireContext())
|
||||
setEvents()
|
||||
if (reload) {
|
||||
reload = false
|
||||
hideLoad = false
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getFaltas(getData(USER), getData(PASSWORD), getData(WAREHOUSEFK))
|
||||
}
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
private fun setToolBar() {
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconReload = ImageView(context)
|
||||
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||
|
||||
}
|
||||
listIcons.add(iconReload)
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload.drawable) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getFaltas(getData(USER), getData(PASSWORD), getData(WAREHOUSEFK))
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
binding.filterItemFk.setOnKeyListener { v, keyCode, event ->
|
||||
if (binding.filterItemFk.text.toString().isNullOrEmpty()) {
|
||||
if (listInvetory.size != listInvetoryAux.size) {
|
||||
listInvetory.removeAll(listInvetoryAux)
|
||||
listInvetoryAux.forEach {
|
||||
listInvetory.add(it)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
listInvetory.removeAll(listInvetoryAux)
|
||||
listInvetoryAux.forEach {
|
||||
if (it.itemFk.contains(binding.filterItemFk.text.toString(), true)) {
|
||||
listInvetory.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
adapter!!.notifyDataSetChanged()
|
||||
return@setOnKeyListener false
|
||||
}
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
faltasList.observe(viewLifecycleOwner, Observer {
|
||||
if (hideLoad) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
} else {
|
||||
hideLoad = true
|
||||
}
|
||||
listInvetory = ArrayList()
|
||||
listInvetoryAux = ArrayList()
|
||||
it.list.forEach {
|
||||
listInvetory.add(it)
|
||||
listInvetoryAux.add(it)
|
||||
}
|
||||
|
||||
adapter = FaltasAdapter(listInvetory, object : OnFaltasNichoClickListener {
|
||||
override fun onFaltasNichoClickListener(item: ItemFaltasVO) {
|
||||
customDialogInput.setTitle(item.itemFk + "\n" + item.longName + " " + item.size)
|
||||
.setDescription(getString(R.string.quantityReal) + item.nicho + ")")
|
||||
.setOkButton(getString(R.string.pull)) {
|
||||
viewModel.itemStockUpdate(
|
||||
item.itemFk,
|
||||
getData(WAREHOUSEFK),
|
||||
customDialogInput.getValue(),
|
||||
"0"
|
||||
|
||||
)
|
||||
changeOfflineValue(item)
|
||||
customDialogInput.dismiss()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
customDialogInput.dismiss()
|
||||
}.setValue("0").show()
|
||||
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
customDialogInput.getEditText()
|
||||
.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
viewModel.itemStockUpdate(
|
||||
item.itemFk,
|
||||
getData(WAREHOUSEFK),
|
||||
customDialogInput.getValue(),
|
||||
"0"
|
||||
|
||||
)
|
||||
changeOfflineValue(item)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.dismiss()
|
||||
ma.hideKeyboard(customDialogInput.getEditText())
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
}, object : OnFaltasReviewClickListener {
|
||||
override fun onFaltasReviewClickListener(item: ItemFaltasVO) {
|
||||
viewModel.faultsReview_isChecked(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
item.itemFk,
|
||||
getData(WAREHOUSEFK)
|
||||
)
|
||||
changeOfflineValue(item)
|
||||
}
|
||||
|
||||
}, pasillerosItemClickListener!!)
|
||||
binding.locationRecyclerview.adapter = adapter
|
||||
binding.locationRecyclerview.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
})
|
||||
|
||||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun changeOfflineValue(item: ItemFaltasVO) {
|
||||
var i = 0
|
||||
var position = 0
|
||||
listInvetory.forEach {
|
||||
if (it.itemFk == item.itemFk) {
|
||||
position = i
|
||||
}
|
||||
i = i.plus(1)
|
||||
}
|
||||
listInvetory.removeAt(position)
|
||||
|
||||
i = 0
|
||||
position = 0
|
||||
listInvetoryAux.forEach {
|
||||
if (it.itemFk == item.itemFk) {
|
||||
position = i
|
||||
}
|
||||
i = i.plus(1)
|
||||
}
|
||||
listInvetoryAux.removeAt(position)
|
||||
adapter?.notifyDataSetChanged()
|
||||
|
||||
reload = true
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.faltas.fragment
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasListVO
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Response
|
||||
|
||||
class FaltasViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _faltasList by lazy { MutableLiveData<ItemFaltasListVO>() }
|
||||
val faltasList: LiveData<ItemFaltasListVO>
|
||||
get() = _faltasList
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
|
||||
//val loadFaltasList = Transformations.map(_faltasList) { Event(it) }
|
||||
|
||||
|
||||
fun getFaltas(user: String, password: String, warehouseFk: String) {
|
||||
silex.faultsReview(user, password, warehouseFk).enqueue(object :
|
||||
SilexCallback<List<ItemFaltasVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemFaltasVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemFaltasVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_faltasList.value = ItemFaltasListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemFaltasVO>>) {
|
||||
if (response.body() != null) {
|
||||
_faltasList.value = response.body()?.let { ItemFaltasListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemFaltasVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemFaltasVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_faltasList.value = ItemFaltasListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun itemStockUpdate(
|
||||
itemFk: String,
|
||||
warehouseFk: String,
|
||||
newValue: String,
|
||||
isTrash: String
|
||||
) {
|
||||
silex.itemTrash(itemFk, warehouseFk, newValue, isTrash)
|
||||
.enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun faultsReview_isChecked(
|
||||
user: String,
|
||||
password: String,
|
||||
itemFk: String,
|
||||
warehouseFk: String
|
||||
) {
|
||||
silex.faultsReview_isChecked(user, password, itemFk, warehouseFk)
|
||||
.enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.faltas.model
|
||||
|
||||
class ItemFaltasVO (
|
||||
var itemFk:String = "",
|
||||
var longName:String= "",
|
||||
var size:String= "",
|
||||
var producer:String= "",
|
||||
var downstairs:String= "",
|
||||
var upstairs:String= "",
|
||||
var nicho:String= "",
|
||||
var faltas:String= "",
|
||||
var isError:Boolean = false,
|
||||
var errorMessage:String = ""
|
||||
)
|
||||
|
||||
|
||||
class ItemFaltasListVO (
|
||||
var list: List<ItemFaltasVO> = listOf()
|
||||
)
|
|
@ -24,8 +24,6 @@ import es.verdnatura.presentation.view.feature.articulo.fragment.ItemProposalFra
|
|||
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragment
|
||||
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferLoadFragment
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFragment
|
||||
import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersFragment
|
||||
import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityFragment
|
||||
import es.verdnatura.presentation.view.feature.claim.fragment.ClaimFragment
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionShowTicketFragment
|
||||
|
@ -36,7 +34,6 @@ import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlV
|
|||
import es.verdnatura.presentation.view.feature.delivery.fragments.InfoFragment
|
||||
import es.verdnatura.presentation.view.feature.delivery.fragments.LogExpeditionFragment
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleFragment
|
||||
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasFragment
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloFragment
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.itemShelvingLogFragment
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.shelvingLogFragment
|
||||
|
@ -57,7 +54,6 @@ import es.verdnatura.presentation.view.feature.precontrol.PreControladorFragment
|
|||
import es.verdnatura.presentation.view.feature.presacador.fragment.EndSacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.presacador.fragment.InitPreSacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.qr.QrFragment
|
||||
import es.verdnatura.presentation.view.feature.reposicion.fragment.ReposicionFragment
|
||||
import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationCollectionFragment
|
||||
import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationFragment
|
||||
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
||||
|
@ -77,7 +73,7 @@ import kotlinx.coroutines.launch
|
|||
|
||||
class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickListener,
|
||||
OnTruckClickListener, OnPalletClickListener, OnComprobarPalletViewClickListener,
|
||||
OnCollectionSelectedListener, OnBuyerSelectedListener {
|
||||
OnCollectionSelectedListener {
|
||||
|
||||
private var lastBottomMenuItemSelected: ItemMenuVO? = null
|
||||
private lateinit var customDialog: CustomDialogMainActivity
|
||||
|
@ -448,9 +444,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
// fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
// addFragment(HistoricoVehiculoFragment.newInstance(entryPoint),R.id.main_frame_layout, ControladorFragment.TAG,false)
|
||||
}
|
||||
getString(R.string.titleReplacement) -> {
|
||||
addFragmentOnTop(ReposicionFragment.newInstance())
|
||||
}
|
||||
|
||||
getString(R.string.titleItemConsult) -> {
|
||||
addFragmentOnTop(ItemCardFragment.newInstance(entryPoint))
|
||||
}
|
||||
|
@ -488,9 +482,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
getString(R.string.titleInventory) -> {
|
||||
addFragmentOnTop(InventaryFragment.newInstance())
|
||||
}
|
||||
getString(R.string.titleFaults) -> {
|
||||
addFragmentOnTop(FaltasFragment.newInstance())
|
||||
}
|
||||
|
||||
getString(R.string.titleShelvingParking) -> {
|
||||
addFragmentOnTop(ShelvingParkingFragment.newInstance())
|
||||
}
|
||||
|
@ -505,9 +497,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(AutomaticAddItemFragment.newInstance(entryPoint, item.title))
|
||||
}
|
||||
|
||||
getString(R.string.titleQuality) -> {
|
||||
addFragmentOnTop(BuyersFragment.newInstance())
|
||||
}
|
||||
|
||||
getString(R.string.titlePickers) -> {
|
||||
//addFragmentOnTop(SacadorFragment.newInstance())
|
||||
addFragmentOnTop(ControlVehiculoFragment.newInstance(""))
|
||||
|
@ -752,11 +742,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
}
|
||||
|
||||
override fun onBuyerSelected(userFk: String) {
|
||||
addFragmentOnTop(QaualityFragment.newInstance(userFk))
|
||||
}
|
||||
|
||||
|
||||
//sergio:se llama al pulsar sobre el coche IN desde Sacador
|
||||
fun onVehicleSelected(tag: String) {
|
||||
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
|
|
|
@ -133,7 +133,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
|||
)*/
|
||||
|
||||
//Tarea 5095
|
||||
/* _pasillerositem.add(
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
1,
|
||||
R.drawable.ic_shopping_self,
|
||||
|
@ -143,7 +143,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
|||
R.string.titleSelfConsumption
|
||||
)
|
||||
)
|
||||
)*/
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
|
@ -238,54 +238,6 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
)
|
||||
/* _pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
7,
|
||||
R.drawable.ic_baseline_all_inbox_24,
|
||||
contextApp.getString(R.string.titleReplacement),
|
||||
R.string.titleReplacement,
|
||||
contextApp.getString(
|
||||
R.string.titleReplacDescrip
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
4,
|
||||
R.drawable.ic_move_to_inbox_black_24dp,
|
||||
contextApp.getString(R.string.titleFaults),
|
||||
R.string.titleFaults,
|
||||
contextApp.getString(R.string.titleFaultsDescrip)
|
||||
)
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
5,
|
||||
R.drawable.ic_send_black_24dp,
|
||||
contextApp.getString(R.string.titleShelvingParking),
|
||||
R.string.titleShelvingParking,
|
||||
contextApp.getString(
|
||||
R.string.titleShelParkDescrip
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
//Tarea 3335 Borrat proced(Carles)
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
8,
|
||||
R.drawable.ic_baseline_star_24,
|
||||
contextApp.getString(R.string.titleQuality),
|
||||
R.string.titleQuality,
|
||||
contextApp.getString(
|
||||
R.string.titleQualityDescrip
|
||||
)
|
||||
)
|
||||
)*/
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -263,21 +263,6 @@ class EndSacadorFragment(
|
|||
|
||||
})
|
||||
|
||||
responseSaleMove.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||
|
||||
|
||||
} else {
|
||||
responseSaleMoveSuccesful()
|
||||
setTotalLines()
|
||||
}
|
||||
goBack = false
|
||||
}
|
||||
})
|
||||
|
||||
responseSplit.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
|
@ -286,7 +271,7 @@ class EndSacadorFragment(
|
|||
|
||||
|
||||
} else {
|
||||
responseSaleMoveSuccesful()
|
||||
// responseSaleMoveSuccesful()
|
||||
ma.messageWithSound(getString(R.string.splitOk), isError = false, true)
|
||||
setTotalLines()
|
||||
}
|
||||
|
|
|
@ -79,7 +79,6 @@ class InitPreSacadorFragment(
|
|||
val iconPrint = ImageView(context)
|
||||
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
||||
iconAdd.setImageResource(R.drawable.ic_add_black_24dp)
|
||||
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
||||
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
|
|
@ -46,9 +46,9 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseSaleTrackingUpdate: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleTrackingUpdate
|
||||
|
||||
private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
/* private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleMove: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleMove
|
||||
get() = _responseSaleMove*/
|
||||
|
||||
|
||||
private val _responseParkingAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
|
@ -104,51 +104,6 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseSaleupdateIsChecked: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleupdateIsChecked
|
||||
|
||||
|
||||
/* fun ticketToPrePrepare(usuario: String, password: String, ticketFk: String, sectorFk: String) {
|
||||
silex.ticketToPrePrepare(usuario, password, ticketFk, sectorFk)
|
||||
.enqueue(object :
|
||||
Callback<List<PreSacadorItemVO>> {
|
||||
override fun onFailure(call: Call<List<PreSacadorItemVO>>, t: Throwable) {
|
||||
//d("VERDNATURA::", "ha fallado")
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<PreSacadorItemVO>>,
|
||||
response: Response<List<PreSacadorItemVO>>
|
||||
) {
|
||||
if (response.body() != null) {
|
||||
_salesList.value = response.body()?.let { it }
|
||||
} else {
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
*/
|
||||
fun collectionStickerPrint(
|
||||
collectionFk: Int,
|
||||
sectorFk: Int
|
||||
) {
|
||||
silex.collectionStickerPrint(
|
||||
collectionFk,
|
||||
sectorFk
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun parking(
|
||||
ticketFk: String,
|
||||
parking: String
|
||||
|
@ -315,59 +270,6 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun saleMove(
|
||||
saleFk: String,
|
||||
quantity: String,
|
||||
originalQuantity: String
|
||||
) {
|
||||
silex.saleMove(
|
||||
saleFk,
|
||||
quantity,
|
||||
originalQuantity
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleMove.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseSaleMove.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* fun collectionMissingTrash(
|
||||
saleFk: Int,
|
||||
quantity: String,
|
||||
type: String,
|
||||
warehouseFk: Int,
|
||||
originalQuantity: Int
|
||||
) {
|
||||
silex.collectionMissingTrash(
|
||||
saleFk,
|
||||
quantity,
|
||||
type,
|
||||
warehouseFk,
|
||||
originalQuantity
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseMissingTrash.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseMissingTrash.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
fun collectionIncreaseQuantity(
|
||||
saleFk: Int,
|
||||
quantity: Int
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.reposicion.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ItemArticleRowBinding
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||
import es.verdnatura.presentation.view.feature.collection.adapter.PlacementAdapter
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.presacador.mapper.toSaleReposicion
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
|
||||
class ReposicionAdapter (
|
||||
private val items: List<PreSacadorItemVO>,
|
||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||
private val onSaleClickListener: OnSaleClickListener
|
||||
): RecyclerView.Adapter<ReposicionAdapter.AjustesItemHolder> () {
|
||||
var context: Context? = null
|
||||
var position:Int = 0
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||
this.context = parent.context
|
||||
return AjustesItemHolder(
|
||||
ItemArticleRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
|
||||
)
|
||||
}
|
||||
|
||||
override fun getItemCount() =items.size
|
||||
|
||||
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
|
||||
this.position = position
|
||||
holder.bind(items[position])
|
||||
}
|
||||
|
||||
inner class AjustesItemHolder(
|
||||
val binding: ItemArticleRowBinding
|
||||
) : RecyclerView.ViewHolder(binding.root){
|
||||
fun bind(preSale: PreSacadorItemVO) {
|
||||
binding.apply {
|
||||
|
||||
val sale : SaleVO = preSale.toSaleReposicion()
|
||||
|
||||
|
||||
itemRowLayout.visibility = View.GONE
|
||||
|
||||
if (sale.pickedQuantity==null)
|
||||
sale.pickedQuantity = 0
|
||||
|
||||
val childLayoutManager = LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
||||
|
||||
itemArticlePlacements.apply {
|
||||
layoutManager = childLayoutManager
|
||||
adapter = PlacementAdapter(sale.placements,onPasillerosItemClickListener)
|
||||
}
|
||||
|
||||
//CLICK EVENTS
|
||||
contentLayout.setOnClickListener {
|
||||
onSaleClickListener.onSaleClick(sale)
|
||||
}
|
||||
|
||||
itemArticleItemFk.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = binding.root.context.resources.getString(R.string.titleItemConsult)),sale.itemFk.toString())
|
||||
}
|
||||
|
||||
|
||||
if (sale.quantity == sale.pickedQuantity!!.toInt()){
|
||||
sale.isPreviousPrepared = "1"
|
||||
}else{
|
||||
sale.isPreviousPrepared = "0"
|
||||
}
|
||||
|
||||
//SEMAFORO
|
||||
if (sale.isPreviousPrepared == "1"){
|
||||
itemArticleRowSemaforoPre.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_dark_sky_blue))
|
||||
}else{
|
||||
itemArticleRowSemaforoPre.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_warm_grey))
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (sale.isPreviousPrepared == "1"){
|
||||
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_dark_sky_blue))
|
||||
}else{
|
||||
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_black))
|
||||
}
|
||||
|
||||
|
||||
//ASIGNAMOS VALOR A LA VSITA
|
||||
this.sale = sale
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,605 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.reposicion.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ImageView
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ReposicionFragmentBinding
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
import es.verdnatura.presentation.view.feature.reposicion.adapter.ReposicionAdapter
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionViewModel>(
|
||||
ReposicionViewModel::class
|
||||
) {
|
||||
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
|
||||
private var sales: ArrayList<PreSacadorItemVO> = ArrayList()
|
||||
|
||||
private var lm: LinearLayoutManager? = null
|
||||
private var saleAdapter: ReposicionAdapter? = null
|
||||
|
||||
var mperror: MediaPlayer? = null
|
||||
var mpok: MediaPlayer? = null
|
||||
|
||||
private var storedBackPosition: Int = 0
|
||||
private var storedShelvingPosition: Int = 0
|
||||
private var storedPosition: Int = 0
|
||||
private var listPlacementSupply: ArrayList<BarcodeVO> = ArrayList()
|
||||
private var itemShelvingFkStored: String = ""
|
||||
private var placementSupplyAdapter: BarcodeAdapter? = null
|
||||
|
||||
private var goBack: Boolean = false
|
||||
private var goBack2: Boolean = false
|
||||
|
||||
companion object {
|
||||
fun newInstance() = ReposicionFragment()
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.reposicion_fragment
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemPlacementSupplyGetOrder)
|
||||
setToolBar()
|
||||
setEvents()
|
||||
super.init()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
goBack = true
|
||||
goBack2 = true
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
|
||||
private fun setEvents() {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
binding.btnObtener.setOnClickListener {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemPlacementSupplyGetOrder(
|
||||
sectorFk = getDataInt(SECTORFK)
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
binding.btnCancelar.setOnClickListener {
|
||||
|
||||
customDialog.setTitle(getString(R.string.confirm)).setDescription(getString(R.string.closeOdrder))
|
||||
.setKoButton(getString(R.string.close)) {
|
||||
scanRequest()
|
||||
customDialog.dismiss()
|
||||
}.setOkButton(getString(R.string.close)) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
if (sales.count() > 0) {
|
||||
viewModel.itemPlacementSupplyCloseOrder(
|
||||
id = sales[0].id.toInt(),
|
||||
quantity = sales[0].quantity.toString().toInt()
|
||||
)
|
||||
}
|
||||
customDialog.dismiss()
|
||||
|
||||
}.show()
|
||||
|
||||
|
||||
}
|
||||
|
||||
//ESCANER =========
|
||||
hideKeyboards()
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||
|
||||
if (sales.count() > 0 && sales[0].saldo == 0) {
|
||||
getString(R.string.orderCompleted).toast(requireContext())
|
||||
} else {
|
||||
findSale(binding.scanInput.text.toString())
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
hideKeyboards()
|
||||
|
||||
|
||||
//LISTA =========
|
||||
binding.collectionSwipe.setOnRefreshListener {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemPlacementSupplyGetOrder(
|
||||
sectorFk = getDataInt(SECTORFK)
|
||||
|
||||
)
|
||||
binding.collectionSwipe.isRefreshing = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun hideKeyboards() {
|
||||
requireActivity().hideKeyboard()
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
salesList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createSaleList(it)
|
||||
})
|
||||
|
||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
/* if (!goBack) printShelvingResult(it)
|
||||
goBack = false*/
|
||||
})
|
||||
|
||||
responseCode.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (!goBack2) {
|
||||
if (it.isError) {
|
||||
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||
.setKoButton(getString(R.string.close)) {
|
||||
scanRequest()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
if (checkItemScan(it.response)) {
|
||||
scanRequest()
|
||||
customDialogList.dismiss()
|
||||
mpok?.start()
|
||||
onQuantityOfShelvingSelected(itemShelvingFkStored)
|
||||
} else {
|
||||
customDialogList.setValueTwo("")
|
||||
showErrorMessage(getString(R.string.lineNotExist))
|
||||
mperror?.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
goBack2 = false
|
||||
|
||||
})
|
||||
|
||||
responseClose.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
sales.clear()
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
binding.btnCancelar.visibility = View.GONE
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
super.observeViewModel()
|
||||
}
|
||||
|
||||
private fun createSaleList(salesList: List<PreSacadorItemVO>) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (salesList.isNullOrEmpty()) {
|
||||
customDialog.setTitle(getString(R.string.titleReplacement)).setDescription(getString(R.string.NotOrderReplacement))
|
||||
.setKoButton(getString(R.string.cancel)) {
|
||||
if (sales.count() > 0) {
|
||||
sales.clear()
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
binding.scanInput.visibility = View.GONE
|
||||
binding.btnCancelar.visibility = View.GONE
|
||||
} else if (salesList.count() > 0 && salesList[0].saldo == 0) {
|
||||
getString(R.string.orderCompleted).toast(requireContext())
|
||||
binding.scanInput.visibility = View.GONE
|
||||
binding.btnCancelar.visibility = View.GONE
|
||||
} else {
|
||||
|
||||
binding.scanInput.visibility = View.VISIBLE
|
||||
binding.btnCancelar.visibility = View.VISIBLE
|
||||
|
||||
sales = ArrayList()
|
||||
salesList.forEach {
|
||||
sales.add(it)
|
||||
}
|
||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
saleAdapter = ReposicionAdapter(sales, pasillerosItemClickListener!!, object :
|
||||
OnSaleClickListener {
|
||||
override fun onSaleClick(sale: SaleVO) {
|
||||
sales.forEachIndexed { index, saleVO ->
|
||||
if (saleVO.idMovimiento == sale.saleFk) {
|
||||
if (saleVO.quantity != saleVO.picked) {
|
||||
showScanner(index, saleVO)
|
||||
} else {
|
||||
unMarkLine(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.fragmentSacadorCollections.adapter = saleAdapter
|
||||
binding.fragmentSacadorCollections.layoutManager = lm
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//SEARCH AND MARK
|
||||
private fun findSale(txtscan: String) {
|
||||
var index = 0
|
||||
var isBreak = false
|
||||
var isOk = false
|
||||
|
||||
for (saleVO in sales) {
|
||||
if (saleVO.quantity != saleVO.picked) {
|
||||
//1- Por carro
|
||||
var shelvingIndex = 0
|
||||
for (placementVO in saleVO.carros) {
|
||||
if (txtscan.uppercase() == placementVO.shelving.uppercase()) {
|
||||
if (mpok != null) mpok!!.start()
|
||||
isOk = true
|
||||
showShelving(index, shelvingIndex)
|
||||
isBreak = true
|
||||
break
|
||||
}
|
||||
shelvingIndex += 1
|
||||
}
|
||||
if (isBreak) break
|
||||
}
|
||||
index += 1
|
||||
}
|
||||
|
||||
if (!isOk) {
|
||||
mperror!!.start()
|
||||
(getString(R.string.itemScanetNotFound) + txtscan).toast(requireContext())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun findSale(txtscan: String, position: Int) {
|
||||
var index = 0
|
||||
var isBreak = false
|
||||
var isOk = false
|
||||
|
||||
val saleVO = sales[position]
|
||||
|
||||
if (saleVO.quantity != saleVO.picked) {
|
||||
//1- Por carro
|
||||
var shelvingIndex = 0
|
||||
for (placementVO in saleVO.carros) {
|
||||
if (txtscan.uppercase() == placementVO.shelving.uppercase()) {
|
||||
if (mpok != null) mpok!!.start()
|
||||
isOk = true
|
||||
showShelving(position, shelvingIndex)
|
||||
isBreak = true
|
||||
break
|
||||
}
|
||||
shelvingIndex += 1
|
||||
}
|
||||
}
|
||||
index += 1
|
||||
|
||||
|
||||
if (!isOk) {
|
||||
mperror!!.start()
|
||||
(getString(R.string.itemScanetNotFound) + txtscan).toast(requireContext())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//SHELVINGS
|
||||
private fun showShelving(position: Int, shelvingPosition: Int) {
|
||||
storedShelvingPosition = shelvingPosition
|
||||
storedPosition = position
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
var quantityGet = 0
|
||||
try {
|
||||
quantityGet = (sales[position].saldo - sales[position].picked)
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.itemPlacementSupplyAiming(
|
||||
itemFk = sales[position].itemFk,
|
||||
quantity = quantityGet,
|
||||
shelvingFk = sales[position].carros[shelvingPosition].shelving
|
||||
)
|
||||
}
|
||||
|
||||
/* private fun printShelvingResult(placementSupplyListVO: PlacementSupplyListVO) {
|
||||
var shelving = ""
|
||||
var item = ""
|
||||
var longName = ""
|
||||
var total = "0"
|
||||
var itemShelvingFk = "0"
|
||||
if (!placementSupplyListVO.list.isEmpty()) {
|
||||
val placement = placementSupplyListVO.list[0]
|
||||
shelving = placement.shelving
|
||||
item = placement.itemFk
|
||||
longName = placement.longName
|
||||
total = placement.total
|
||||
itemShelvingFk = placement.itemShelvingFk
|
||||
}
|
||||
listPlacementSupply = ArrayList()
|
||||
placementSupplyListVO.list.forEach {
|
||||
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
||||
}
|
||||
|
||||
customDialogList.setTitle("$shelving($item) $total "+getString(R.string.de)+" $longName").setOkButton(getString( R.string.take)) {
|
||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
mpok?.start()
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo()
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
}
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
} else {
|
||||
getString(R.string.scanItemValidate).toast(requireContext())
|
||||
}
|
||||
|
||||
|
||||
}.setKoButton(getString(R.string.close)) {
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
customDialogList.dismiss()
|
||||
}.setHintValue(getString(R.string.quantitySelect)).setValue(total).setHintValueTwo(getString(R.string.scanItem))
|
||||
.setValueTwo("").show()
|
||||
|
||||
|
||||
customDialogList.getEditTextTwo().post(Runnable {
|
||||
customDialogList.getEditTextTwo().requestFocusFromTouch()
|
||||
val lManager: InputMethodManager =
|
||||
requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
lManager.hideSoftInputFromWindow(
|
||||
customDialogList.getEditTextTwo().windowToken,
|
||||
InputMethodManager.SHOW_FORCED
|
||||
)
|
||||
})
|
||||
|
||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
mpok?.start()
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo()
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
}
|
||||
} else {
|
||||
getString(R.string.scanItemValidate).toast(requireContext())
|
||||
}
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
placementSupplyAdapter =
|
||||
BarcodeAdapter(listPlacementSupply, object : OnBarcodeRowClickListener {
|
||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||
placementSupplyListVO.list.forEach {
|
||||
if (it.proposal == item.code) {
|
||||
customDialogList.setValue(it.total)
|
||||
total = it.total
|
||||
itemShelvingFk = it.itemShelvingFk
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}, showDelete = false)
|
||||
|
||||
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
|
||||
|
||||
customDialogList.getRecyclerView().layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
}*/
|
||||
|
||||
private fun onQuantityOfShelvingSelected(itemShelvingFk: String) {
|
||||
//1 - MODIFICAR CANTIDAD DEL CARRO
|
||||
try {
|
||||
val shelvingVisible = sales[storedPosition].carros[storedShelvingPosition].stockTotal
|
||||
|
||||
sales[storedPosition].carros[storedShelvingPosition].stockTotal =
|
||||
(shelvingVisible.toInt() - customDialogList.getValue().toInt()).toString()
|
||||
|
||||
/* viewModel.itemShelvingPlacementSupplyAdd(
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
itemPlacementSupplyFk = sales[storedPosition].id,
|
||||
quantity = customDialogList.getValue()
|
||||
)
|
||||
*/
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
||||
//2- MODIFICAR EL PICKED DEL SALE
|
||||
try {
|
||||
sales[storedPosition].saldo =
|
||||
sales[storedPosition].saldo - customDialogList.getValue().toInt()
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
||||
//3- MARCAR LINEA
|
||||
markLine(storedPosition)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//OTROS
|
||||
private fun setToolBar() {
|
||||
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconParking = ImageView(context)
|
||||
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
|
||||
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
|
||||
}
|
||||
|
||||
listIcons.add(iconParking)
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
||||
when (item) {
|
||||
iconParking.drawable -> pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = getString(R.string.Parking)),
|
||||
""
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
|
||||
private fun scanRequest() {
|
||||
binding.scanInput.requestFocus()
|
||||
hideKeyboards()
|
||||
}
|
||||
|
||||
private fun checkItemScan(valueToCheck: String): Boolean {
|
||||
val saleToCheck = sales[storedPosition]
|
||||
return saleToCheck.itemFk == valueToCheck.toInt()
|
||||
}
|
||||
|
||||
private fun showErrorMessage(text: String) {
|
||||
customDialog.setTitle(getString(R.string.errorMarkLine)).setDescription(text)
|
||||
.setKoButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
private fun showScanner(index: Int, sale: PreSacadorItemVO) {
|
||||
customDialogInput.setTitle("" + sale.itemFk)
|
||||
.setDescription(getString(R.string.scanWagonForItem)).setOkButton(getString(R.string.accept)) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
findSale(customDialogInput.getValue(), index)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
customDialogInput.dismiss()
|
||||
hideKeyboards()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
customDialogInput.dismiss()
|
||||
}.setValue("").show()
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
findSale(customDialogInput.getValue(), index)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
customDialogInput.dismiss()
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun unMarkLine(position: Int) {
|
||||
|
||||
if (sales[position].quantity == sales[position].picked) {
|
||||
customDialog.setTitle(getString(R.string.unmarkLine))
|
||||
.setDescription(getString(R.string.goUnmark) + sales[position].itemFk + getString(R.string.sure))
|
||||
.setOkButton(getString(R.string.unmark)) {
|
||||
sales[position].picked = 0
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
/*viewModel.saleTrackingDel(
|
||||
usuario = user,
|
||||
password = password,
|
||||
saleFk = sales[position].idMovimiento
|
||||
)*/
|
||||
scanRequest()
|
||||
customDialog.dismiss()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
scanRequest()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun markLine(position: Int) {
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,199 +0,0 @@
|
|||
package es.verdnatura.presentation.view.feature.reposicion.fragment
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
import retrofit2.Response
|
||||
|
||||
class ReposicionViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
private val _salesList by lazy { MutableLiveData<List<PreSacadorItemVO>>() }
|
||||
val salesList: LiveData<List<PreSacadorItemVO>>
|
||||
get() = _salesList
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
private val _responseClose by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseClose: LiveData<ResponseItemVO>
|
||||
get() = _responseClose
|
||||
|
||||
private val _placementSuppleyList by lazy { MutableLiveData<PlacementSupplyListVO>() }
|
||||
val placementSuppleyList: LiveData<PlacementSupplyListVO>
|
||||
get() = _placementSuppleyList
|
||||
|
||||
private val _responseCode by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseCode: LiveData<ResponseItemVO>
|
||||
get() = _responseCode
|
||||
|
||||
fun itemPlacementSupplyGetOrder(
|
||||
sectorFk: Int
|
||||
|
||||
) {
|
||||
silex.itemPlacementSupplyGetOrder(sectorFk)
|
||||
.enqueue(object :
|
||||
SilexCallback<List<PreSacadorItemVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<PreSacadorItemVO>>) {
|
||||
if (response.body() != null) {
|
||||
_salesList.value = response.body()?.let { it }
|
||||
} else {
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun parking(
|
||||
ticketFk: String,
|
||||
parking: String
|
||||
|
||||
) {
|
||||
silex.shelvingPark(ticketFk, parking)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemPlacementSupplyAiming(
|
||||
shelvingFk: String,
|
||||
quantity: Int,
|
||||
itemFk: Int
|
||||
|
||||
) {
|
||||
silex.itemPlacementSupplyAiming(
|
||||
shelvingFk,
|
||||
quantity,
|
||||
itemFk
|
||||
).enqueue(object :
|
||||
SilexCallback<List<PlacementSupplyVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||
listError.add(
|
||||
PlacementSupplyVO(
|
||||
itemShelvingFk = 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<PlacementSupplyVO>>) {
|
||||
if (response.body() != null) {
|
||||
_placementSuppleyList.value = response.body()?.let { PlacementSupplyListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||
listError.add(
|
||||
PlacementSupplyVO(
|
||||
itemShelvingFk = 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun getIdFromCode(usuario: String, password: String, code: String) {
|
||||
silex.getIdFromCode(usuario, password, code)
|
||||
.enqueue(object : SilexCallback<String>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseCode.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<String>) {
|
||||
//sergio:espera item en el body
|
||||
if (response.body() == null) {
|
||||
_responseCode.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_responseCode.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun itemShelvingPlacementSupplyAdd(
|
||||
itemShelvingFk: String,
|
||||
itemPlacementSupplyFk: String,
|
||||
quantity: String
|
||||
|
||||
) {
|
||||
silex.itemShelvingPlacementSupplyAdd(
|
||||
itemShelvingFk,
|
||||
itemPlacementSupplyFk,
|
||||
quantity
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemPlacementSupplyCloseOrder(
|
||||
id: Int,
|
||||
quantity: Int
|
||||
) {
|
||||
silex.itemPlacementSupplyCloseOrder(id, quantity)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseClose.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseClose.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -1,131 +0,0 @@
|
|||
<?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">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textinputlayout_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColorHint="@android:color/darker_gray">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/filter_itemFk"
|
||||
style="@style/InputLineTextSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:backgroundTint="@android:color/white"
|
||||
android:hint="@string/Filtro"
|
||||
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>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/layout_margin_min"
|
||||
android:layout_marginBottom="@dimen/layout_margin_1"
|
||||
android:paddingLeft="@dimen/layout_margin_min"
|
||||
android:paddingRight="@dimen/layout_margin_min">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Downstairs"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Upstairs"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/Nicho"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fault"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
|
||||
</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_faltas_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="visible"
|
||||
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>
|
|
@ -1,178 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tool="http://schemas.android.com/tools"
|
||||
>
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="itemBuyer"
|
||||
type="es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO" />
|
||||
</data>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="@dimen/layout_margin_1">
|
||||
<!--CABECERA=================================================-->
|
||||
<LinearLayout
|
||||
android:id="@+id/item_row_layout"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_black_2">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_warm_grey"
|
||||
android:padding="@dimen/layout_margin_min"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:text="@{itemBuyer.itemFk}"
|
||||
tool:text="1872"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/h6"
|
||||
android:layout_marginRight="@dimen/layout_margin_min"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:text="@{itemBuyer.longName}"
|
||||
tool:text="Planta de prueba"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/h8"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/layout_margin_min">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="@dimen/item_image_width_l"
|
||||
android:layout_height="@dimen/item_image_width_l"
|
||||
app:cardCornerRadius="30dp"
|
||||
android:layout_marginRight="@dimen/layout_margin_1">
|
||||
<ImageView
|
||||
android:id="@+id/img_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/layout_margin_min"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:text="@{itemBuyer.parking}"
|
||||
tool:text="parking"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/h8"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:text="@{itemBuyer.shelvingFk}"
|
||||
tool:text="shelvingFk"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/h8"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:text="@{itemBuyer.visible}"
|
||||
tool:text="visible"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/h8"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:text="@{itemBuyer.created}"
|
||||
tool:text="created"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/h8"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_stars"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/layout_margin_min"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/s1"
|
||||
android:tag="1"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_star_ko"/>
|
||||
<ImageView
|
||||
android:id="@+id/s2"
|
||||
android:tag="2"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_star_ko"/>
|
||||
<ImageView
|
||||
android:id="@+id/s3"
|
||||
android:tag="3"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_star_ko"/>
|
||||
<ImageView
|
||||
android:id="@+id/s4"
|
||||
android:tag="4"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_star_ko"/>
|
||||
<ImageView
|
||||
android:id="@+id/s5"
|
||||
android:tag="5"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_star_ko"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
|
@ -1,172 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tool="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO" />
|
||||
</data>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/item_row_layout"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_black_5"
|
||||
android:paddingLeft="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingRight="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingTop="@dimen/pasilleros_margin_main_menu">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_fk"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.itemFk}"
|
||||
android:textSize="@dimen/h7"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
tool:text="31100"/>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_black_5"
|
||||
android:paddingLeft="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingRight="@dimen/pasilleros_margin_main_menu">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.longName}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
tool:text="Alstromeria Blanca"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_black_5"
|
||||
android:paddingLeft="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingRight="@dimen/pasilleros_margin_main_menu">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.size}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="2"
|
||||
android:gravity="left"
|
||||
tool:text="80" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_black_5"
|
||||
android:paddingLeft="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingRight="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingBottom="@dimen/pasilleros_margin_main_menu">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_producer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.producer}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
tool:text="Benchmark"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_black_5"
|
||||
android:paddingLeft="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingRight="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingBottom="@dimen/pasilleros_margin_main_menu">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_down"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.downstairs}"
|
||||
android:textSize="@dimen/h6"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
tool:text="730"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.upstairs}"
|
||||
android:textSize="@dimen/h6"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
tool:text="0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_nicho"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.nicho}"
|
||||
android:textSize="@dimen/h6"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_red"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
tool:text="-50" />
|
||||
<TextView
|
||||
android:id="@+id/item_faltas"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.faltas}"
|
||||
android:textSize="@dimen/h6"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/verdnatura_dark_sky_blue"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
tool:text="-50" />
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/verdnatura_black_9"/>
|
||||
</LinearLayout>
|
||||
</layout>
|
|
@ -1,72 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/verdnatura_black">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/scan_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@android:color/white"
|
||||
android:hint="@string/Escaner"
|
||||
android:inputType="text"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textColorHint="@android:color/darker_gray"
|
||||
android:textSize="@dimen/body2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/main_toolbar"
|
||||
android:paddingLeft="@dimen/default_layout_margin"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/shelving_buyers_items"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:listitem="@layout/item_buyer_row" />
|
||||
|
||||
' <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="invisible"
|
||||
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>
|
|
@ -1,154 +0,0 @@
|
|||
|
||||
|
||||
//AJUSTES ======================================================================================================>
|
||||
|
||||
@POST("almacennew/sector_get")
|
||||
|
||||
//PRESACADORES ================================================================================================>
|
||||
|
||||
@POST("almacennew/ticketToPrePrepare")
|
||||
|
||||
|
||||
//SACADORES / CONTROLADORES ====================================================================================>
|
||||
|
||||
@POST("almacennew/collectionGet")
|
||||
|
||||
|
||||
@POST("almacennew/collectionTicketGet")
|
||||
|
||||
|
||||
@POST("almacennew/saleTrackingReplace")
|
||||
|
||||
|
||||
@POST("almacennew/itemPlacementSupplyAiming")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingSaleSupplyAdd")
|
||||
|
||||
|
||||
@POST("almacennew/collectionStickerPrint")
|
||||
|
||||
|
||||
@POST("almacennew/itemGetAvailable")
|
||||
|
||||
|
||||
@POST("almacennew/collectionAddItem")
|
||||
|
||||
|
||||
@POST("almacennew/saleMove")
|
||||
|
||||
|
||||
@POST("almacennew/collectionMissingTrash")
|
||||
|
||||
|
||||
@POST("almacennew/saleTrackingDel")
|
||||
|
||||
|
||||
@POST("almacennew/collectionUpdateState")
|
||||
|
||||
|
||||
@POST("almacennew/barcodeToItem")
|
||||
|
||||
|
||||
@POST("almacennew/collectionIncreaseQuantity")
|
||||
|
||||
|
||||
//CONSULTAR ARTICULO ==========================================================================================>
|
||||
@POST("almacennew/itemDiary")
|
||||
|
||||
|
||||
@POST("almacennew/item_card")
|
||||
|
||||
|
||||
@POST("almacennew/itemStockUpdate")
|
||||
|
||||
|
||||
@POST("almacennew/item_placement_save")
|
||||
|
||||
|
||||
@POST("almacennew/buy_updateGrouping")
|
||||
|
||||
|
||||
@POST("almacennew/buy_updatePacking")
|
||||
|
||||
|
||||
@POST("almacennew/itemSaveMin")
|
||||
|
||||
|
||||
|
||||
@POST("almacennew/barcodes_edit")
|
||||
|
||||
|
||||
//BUSCAR ITEM ================================================================================================>
|
||||
@POST("almacennew/getItemUbication")
|
||||
|
||||
|
||||
//INVENTARIO ================================================================================================>
|
||||
@POST("almacennew/itemShelvingRadar")
|
||||
|
||||
|
||||
@POST("almacennew/faultsReview")
|
||||
|
||||
|
||||
@POST("almacennew/faultsReview_isChecked")
|
||||
|
||||
|
||||
//SHELVING PARKING ==========================================================================================>
|
||||
@POST("almacennew/shelvingParking_get")
|
||||
|
||||
|
||||
//UBICADOR ==================================================================================================>
|
||||
@POST("almacennew/itemShelvingList")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingMake")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingMake_multi")
|
||||
|
||||
|
||||
@POST("almacennew/shelvingPark")
|
||||
|
||||
|
||||
@POST("almacennew/shelvingChange")
|
||||
|
||||
|
||||
@POST("almacennew/clearShelvingList")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingTransfer")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingDelete")
|
||||
|
||||
|
||||
//PALETIZADORES ==========================================================================================>
|
||||
@POST("almacennew/expeditionTruckList")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionTruckAdd")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletList")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanAdd")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanPut")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletView")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletDel")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanList")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanDel")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletPrintSet")
|
||||
|
Loading…
Reference in New Issue