From 6fb4b69ab66c4a4396c3ea64a98f3bfa91abe18e Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Tue, 11 Apr 2023 10:16:49 +0200 Subject: [PATCH] refs #4765 Refactor --- .idea/workspace.xml | 38 +- .../java/es/verdnatura/di/viewModelModule.kt | 20 - .../es/verdnatura/domain/SilexInterceptor.kt | 2 + .../es/verdnatura/domain/VerdnaturaService.kt | 38 -- .../presentation/base/BaseFragment.kt | 6 +- .../presentation/common/UICallbacks.kt | 9 - .../calidad/adapter/ItemBuyersAdapter.kt | 129 ---- .../calidad/fragment/BuyersFragment.kt | 128 ---- .../calidad/fragment/BuyersViewModel.kt | 58 -- .../calidad/fragment/QaualityFragment.kt | 199 ------ .../calidad/fragment/QaualityViewModel.kt | 79 --- .../feature/collection/adapter/SaleAdapter.kt | 1 + .../collection/fragment/CollectionFragment.kt | 14 +- .../fragment/CollectionViewModel.kt | 4 +- .../fragments/LogExpeditionFragment.kt | 4 +- .../feature/faltas/adapter/FaltasAdapter.kt | 66 -- .../feature/faltas/fragment/FaltasFragment.kt | 236 ------- .../faltas/fragment/FaltasViewModel.kt | 126 ---- .../view/feature/faltas/model/ItemFaltasVO.kt | 19 - .../feature/main/activity/MainActivity.kt | 23 +- .../pasillero/fragment/PasilleroViewModel.kt | 52 +- .../presacador/fragment/EndSacadorFragment.kt | 17 +- .../fragment/InitPreSacadorFragment.kt | 1 - .../fragment/PreSacadorViewModel.kt | 102 +-- .../reposicion/adapter/ReposicionAdapter.kt | 100 --- .../reposicion/fragment/ReposicionFragment.kt | 605 ------------------ .../fragment/ReposicionViewModel.kt | 199 ------ app/src/main/res/layout/fragment_faltas.xml | 131 ---- app/src/main/res/layout/item_buyer_row.xml | 178 ------ app/src/main/res/layout/item_faltas_row.xml | 172 ----- app/src/main/res/layout/qauality_fragment.xml | 72 --- procedimientos.txt | 154 ----- 32 files changed, 61 insertions(+), 2921 deletions(-) delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/faltas/adapter/FaltasAdapter.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/faltas/model/ItemFaltasVO.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/adapter/ReposicionAdapter.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionFragment.kt delete mode 100644 app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionViewModel.kt delete mode 100644 app/src/main/res/layout/fragment_faltas.xml delete mode 100644 app/src/main/res/layout/item_buyer_row.xml delete mode 100644 app/src/main/res/layout/item_faltas_row.xml delete mode 100644 app/src/main/res/layout/qauality_fragment.xml delete mode 100644 procedimientos.txt diff --git a/.idea/workspace.xml b/.idea/workspace.xml index aaf067f1..58c0e134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -83,10 +83,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/es/verdnatura/di/viewModelModule.kt b/app/src/main/java/es/verdnatura/di/viewModelModule.kt index 4e76be23..ff1e8c67 100644 --- a/app/src/main/java/es/verdnatura/di/viewModelModule.kt +++ b/app/src/main/java/es/verdnatura/di/viewModelModule.kt @@ -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()) } diff --git a/app/src/main/java/es/verdnatura/domain/SilexInterceptor.kt b/app/src/main/java/es/verdnatura/domain/SilexInterceptor.kt index 50261215..6b990972 100644 --- a/app/src/main/java/es/verdnatura/domain/SilexInterceptor.kt +++ b/app/src/main/java/es/verdnatura/domain/SilexInterceptor.kt @@ -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()) diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt index eee45132..eeecdd1f 100644 --- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt +++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt @@ -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 - @POST("almacennew/saleMove")//REVISADA - fun saleMove( - - @Body vararg params: Any - ): - Call -/* - @POST("almacennew/collectionMissingTrash")//REVISADA - fun collectionMissingTrash( - @Body vararg params: Any - ): - Call*/ - @POST("almacennew/saleTrackingDel")//REVISADA fun saleTrackingDel( @Body vararg params: Any @@ -494,18 +479,6 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/faultsReview")//REVISADA - fun faultsReview( - - @Body vararg params: Any - ): - Call> - - @POST("almacennew/faultsReview_isChecked")//REVISADA - fun faultsReview_isChecked( - @Body vararg params: Any - ): - Call //SHELVING PARKING ========================================================================> @POST("almacennew/shelvingParking_get")//REVISADA @@ -729,17 +702,6 @@ interface VerdnaturaService { ): Call> - @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 - ): - Call> - @POST("almacennew/itemShelving_updateSpam")//REVISADA fun itemShelving_updateSpam( @Header("aplicacion") aplicacion: String, diff --git a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt index b717fea4..8974cf96 100644 --- a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt @@ -227,7 +227,7 @@ abstract class BaseFragment(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(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(viewModelCla saveWorkForm( WorkForms( "TestLOCALHOME", - "http://192.168.1.128:9000", + "http://192.168.1.37:9000", urlSalix = "http://localhost:3000/api/" ) ) diff --git a/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt b/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt index bc251d01..3951014d 100644 --- a/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt +++ b/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt @@ -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) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt deleted file mode 100644 index 7ad5b9bd..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt +++ /dev/null @@ -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, - private val onPasillerosItemClickListener: OnPasillerosItemClickListener, - private val onStarSelectedListener: OnStarSelectedListener -) : RecyclerView.Adapter() { - - - 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) { - } - } - } - } - - - } -} \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt deleted file mode 100644 index a660f420..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt +++ /dev/null @@ -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(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 = 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){ - var buyers = ArrayList() - 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) - } - -} \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt deleted file mode 100644 index 9ce27b03..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt +++ /dev/null @@ -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() } - val buyersList: LiveData - get() = _buyersList - - fun itemShelvingBuyerGet() { - silex.itemShelvingBuyerGet().enqueue(object : - SilexCallback>(context) { - override fun onError(t: Throwable) { - val listError: ArrayList = ArrayList() - listError.add( - BuyerVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - ) - _buyersList.value = BuyerListVO(listError) - } - - override fun onSuccess(response: Response>) { - - if (response.body() != null) { - _buyersList.value = response.body()?.let { BuyerListVO(it) } - } else { - val listError: ArrayList = ArrayList() - listError.add( - BuyerVO( - isError = true, - errorMessage = getMessageFromAllResponse( - nameofFunction(this), - response.message() - ) - ) - ) - _buyersList.value = BuyerListVO(listError) - } - } - - }) - } - -} diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt deleted file mode 100644 index 5027a7c8..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt +++ /dev/null @@ -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(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 = 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 = 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){ - 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) - } - } - -} \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt deleted file mode 100644 index 9fe6d961..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt +++ /dev/null @@ -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() } - val buyersList: LiveData - get() = _buyersList - - - private val _response by lazy { MutableLiveData() } - val response: LiveData - get() = _response - - - fun itemShelvingBuyerTask(userFk: String) { - silex.itemShelvingBuyerTask(userFk).enqueue(object : - SilexCallback>(context) { - override fun onError(t: Throwable) { - val listError: ArrayList = ArrayList() - listError.add( - ItemBuyerVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - ) - _buyersList.value = ItemBuyerListVO(listError) - } - - override fun onSuccess(response: Response>) { - super.onSuccess(response) - if (response.body() != null) { - _buyersList.value = response.body()?.let { ItemBuyerListVO(it) } - } else { - val listError: ArrayList = 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(context) { - override fun onError(t: Throwable) { - _response.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - _response.value = ResponseItemVO(isError = false, response = response.message()) - } - }) - } -} \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt index 26ba8c46..3547f5cc 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt @@ -72,6 +72,7 @@ class SaleAdapter( val childLayoutManagerV = LinearLayoutManager(context!!, RecyclerView.VERTICAL, false) + itemArticlePlacements.apply { layoutManager = childLayoutManager adapter = PlacementAdapter(sale.placements, onPasillerosItemClickListener) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt index 0d318d2b..b57e9b6d 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt @@ -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( } } } - + } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt index eaa298f9..b2210b49 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt @@ -79,9 +79,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) { val responseItemShelvingUpdate: LiveData get() = _responseItemShelvingUpdate - private val _responseSaleMove by lazy { MutableLiveData() } + /* private val _responseSaleMove by lazy { MutableLiveData() } val responseSaleMove: LiveData - get() = _responseSaleMove + get() = _responseSaleMove*/ private val _responseUsedShelves by lazy { MutableLiveData() } val responseUsedShelves: LiveData diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt index 988fb0d8..8b3a0a35 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt @@ -59,10 +59,10 @@ class LogExpeditionFragment( val listIcons: ArrayList = 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) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/adapter/FaltasAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/adapter/FaltasAdapter.kt deleted file mode 100644 index a34db1b7..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/adapter/FaltasAdapter.kt +++ /dev/null @@ -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, - private val onFaltasNichoClickListener: OnFaltasNichoClickListener, - private val onFaltasReviewClickListener:OnFaltasReviewClickListener, - private val onPasillerosItemClickListener: OnPasillerosItemClickListener -): RecyclerView.Adapter () { - - - 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) - } - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt deleted file mode 100644 index 154ce199..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt +++ /dev/null @@ -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(FaltasViewModel::class) { - - private var adapter: FaltasAdapter? = null - private lateinit var customDialogInput: CustomDialogInput - private var listInvetory: ArrayList = ArrayList() - private var listInvetoryAux: ArrayList = 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 = 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 - - } - - -} diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt deleted file mode 100644 index bdb59826..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt +++ /dev/null @@ -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() } - val faltasList: LiveData - get() = _faltasList - - private val _response by lazy { MutableLiveData() } - val response: LiveData - 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>(context) { - override fun onError(t: Throwable) { - val listError: ArrayList = ArrayList() - listError.add( - ItemFaltasVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - ) - _faltasList.value = ItemFaltasListVO(listError) - } - - override fun onSuccess(response: Response>) { - if (response.body() != null) { - _faltasList.value = response.body()?.let { ItemFaltasListVO(it) } - } else { - val listError: ArrayList = 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(context) { - override fun onError(t: Throwable) { - _response.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onResponse(call: Call, response: Response) { - 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(context) { - override fun onError(t: Throwable) { - - _response.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - - _response.value = - ResponseItemVO(isError = false, response = response.message()) - - } - }) - } - -} diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/model/ItemFaltasVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/model/ItemFaltasVO.kt deleted file mode 100644 index b990f8ea..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/model/ItemFaltasVO.kt +++ /dev/null @@ -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 = listOf() -) \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt index 28fc07a9..87b83d84 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt @@ -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(), OnPasillerosItemClickListener, OnTruckClickListener, OnPalletClickListener, OnComprobarPalletViewClickListener, - OnCollectionSelectedListener, OnBuyerSelectedListener { + OnCollectionSelectedListener { private var lastBottomMenuItemSelected: ItemMenuVO? = null private lateinit var customDialog: CustomDialogMainActivity @@ -448,9 +444,7 @@ class MainActivity : BaseActivity(), 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(), 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(), 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(), 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) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt index 9a669d44..caaf2af2 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt @@ -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 - ) - ) - )*/ } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt index dffe0d35..d6b68a10 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt @@ -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() } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt index 0d81a257..8ffcf2d1 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt @@ -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) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt index 55404a7b..58d49330 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt @@ -46,9 +46,9 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) { val responseSaleTrackingUpdate: LiveData get() = _responseSaleTrackingUpdate - private val _responseSaleMove by lazy { MutableLiveData() } +/* private val _responseSaleMove by lazy { MutableLiveData() } val responseSaleMove: LiveData - get() = _responseSaleMove + get() = _responseSaleMove*/ private val _responseParkingAdd by lazy { MutableLiveData() } @@ -104,51 +104,6 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) { val responseSaleupdateIsChecked: LiveData get() = _responseSaleupdateIsChecked - - /* fun ticketToPrePrepare(usuario: String, password: String, ticketFk: String, sectorFk: String) { - silex.ticketToPrePrepare(usuario, password, ticketFk, sectorFk) - .enqueue(object : - Callback> { - override fun onFailure(call: Call>, t: Throwable) { - //d("VERDNATURA::", "ha fallado") - _salesList.value = listOf() - } - - override fun onResponse( - call: Call>, - response: Response> - ) { - 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(context) { - override fun onError(t: Throwable) { - _response.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - _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(context) { - override fun onError(t: Throwable) { - _responseSaleMove.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - _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(context) { - override fun onError(t: Throwable) { - _responseMissingTrash.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - _responseMissingTrash.value = - ResponseItemVO(isError = false, response = response.message()) - } - }) - }*/ - fun collectionIncreaseQuantity( saleFk: Int, quantity: Int diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/adapter/ReposicionAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/adapter/ReposicionAdapter.kt deleted file mode 100644 index d67eb4c5..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/adapter/ReposicionAdapter.kt +++ /dev/null @@ -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, - private val onPasillerosItemClickListener: OnPasillerosItemClickListener, - private val onSaleClickListener: OnSaleClickListener -): RecyclerView.Adapter () { - 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 - - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionFragment.kt deleted file mode 100644 index c7ebafdb..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionFragment.kt +++ /dev/null @@ -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( - 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 = 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 = 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) { - 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 = 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() - } - - -} diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionViewModel.kt deleted file mode 100644 index 01ba036f..00000000 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionViewModel.kt +++ /dev/null @@ -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>() } - val salesList: LiveData> - get() = _salesList - - private val _response by lazy { MutableLiveData() } - val response: LiveData - get() = _response - - private val _responseClose by lazy { MutableLiveData() } - val responseClose: LiveData - get() = _responseClose - - private val _placementSuppleyList by lazy { MutableLiveData() } - val placementSuppleyList: LiveData - get() = _placementSuppleyList - - private val _responseCode by lazy { MutableLiveData() } - val responseCode: LiveData - get() = _responseCode - - fun itemPlacementSupplyGetOrder( - sectorFk: Int - - ) { - silex.itemPlacementSupplyGetOrder(sectorFk) - .enqueue(object : - SilexCallback>(context) { - override fun onError(t: Throwable) { - _salesList.value = listOf() - } - - override fun onSuccess(response: Response>) { - 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(context) { - override fun onError(t: Throwable) { - _response.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - _response.value = - ResponseItemVO(isError = false, response = response.message()) - } - }) - } - - fun itemPlacementSupplyAiming( - shelvingFk: String, - quantity: Int, - itemFk: Int - - ) { - silex.itemPlacementSupplyAiming( - shelvingFk, - quantity, - itemFk - ).enqueue(object : - SilexCallback>(context) { - override fun onError(t: Throwable) { - val listError: ArrayList = ArrayList() - listError.add( - PlacementSupplyVO( - itemShelvingFk = 0, - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - ) - _placementSuppleyList.value = PlacementSupplyListVO(listError) - } - - override fun onSuccess(response: Response>) { - if (response.body() != null) { - _placementSuppleyList.value = response.body()?.let { PlacementSupplyListVO(it) } - } else { - val listError: ArrayList = 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(context) { - override fun onError(t: Throwable) { - _responseCode.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - //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(context) { - override fun onError(t: Throwable) { - _response.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - _response.value = ResponseItemVO(isError = false, response = response.message()) - } - }) - } - - fun itemPlacementSupplyCloseOrder( - id: Int, - quantity: Int - ) { - silex.itemPlacementSupplyCloseOrder(id, quantity) - .enqueue(object : SilexCallback(context) { - override fun onError(t: Throwable) { - _responseClose.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - - override fun onSuccess(response: Response) { - _responseClose.value = - ResponseItemVO(isError = false, response = response.message()) - } - }) - } - -} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_faltas.xml b/app/src/main/res/layout/fragment_faltas.xml deleted file mode 100644 index db8ae165..00000000 --- a/app/src/main/res/layout/fragment_faltas.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_buyer_row.xml b/app/src/main/res/layout/item_buyer_row.xml deleted file mode 100644 index 917e081c..00000000 --- a/app/src/main/res/layout/item_buyer_row.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_faltas_row.xml b/app/src/main/res/layout/item_faltas_row.xml deleted file mode 100644 index de4dbb57..00000000 --- a/app/src/main/res/layout/item_faltas_row.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/qauality_fragment.xml b/app/src/main/res/layout/qauality_fragment.xml deleted file mode 100644 index 64251122..00000000 --- a/app/src/main/res/layout/qauality_fragment.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - ' - - - - - - - - \ No newline at end of file diff --git a/procedimientos.txt b/procedimientos.txt deleted file mode 100644 index 46bcaedb..00000000 --- a/procedimientos.txt +++ /dev/null @@ -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") -