refs #6276 feat:crashlytics

This commit is contained in:
Sergio De la torre 2024-03-27 15:46:55 +01:00
parent 1f53fe4643
commit 2c6e6bdfa9
11 changed files with 153 additions and 204 deletions

View File

@ -1,17 +1,6 @@
package es.verdnatura.domain
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
import es.verdnatura.presentation.view.feature.login.model.VersionApp
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import retrofit2.Call
import retrofit2.http.Body
@ -32,18 +21,18 @@ interface VerdnaturaService {
):
Call<Unit>*/
@POST("/security/getVersion")//REVISADA
/* @POST("/security/getVersion")//REVISADA
fun getVersion(
@Body vararg params: Any
):
Call<VersionApp>
Call<VersionApp>*/
//AJUSTES ========================================================================>
@POST("almacennew/printer_get")//NO SALIX
/* @POST("almacennew/printer_get")//NO SALIX
fun printer_get():
Call<List<Printers>>
Call<List<Printers>>*/
/* @POST("almacennew/train_get")//NO SALIX
fun train_get(
@ -55,11 +44,11 @@ interface VerdnaturaService {
):
Call<List<Printers>>*/
@POST("almacennew/operator_updateItemPackingType")//NO SALIX
/* @POST("almacennew/operator_updateItemPackingType")//NO SALIX
fun operator_updateItemPackingType(
@Body vararg params: Any
):
Call<Unit>
Call<Unit>*/
/* @POST("almacennew/operator_updateTrain")//NO SALIX
fun operator_updateTrain(
@ -78,11 +67,11 @@ interface VerdnaturaService {
):
Call<Any>*/
@POST("almacennew/operator_add")//NO SALIX
/* @POST("almacennew/operator_add")//NO SALIX
fun operator_add(
):
Call<Any>
*/
//PRESACADORES ========================================================================>
/* @POST("almacennew/ticketToPrePrepare")//NO SALIX
@ -91,11 +80,11 @@ interface VerdnaturaService {
):
Call<List<PreSacadorItemVO>>*/
@POST("almacennew/sectorCollection_getSale")//NO SALIX
/* @POST("almacennew/sectorCollection_getSale")//NO SALIX
fun sectorCollection_getSale(
@Body vararg params: Any
):
Call<List<PreSacadorItemVO>>
Call<List<PreSacadorItemVO>>*/
/* @POST("almacennew/itemPlacementSupplyGetOrder")//NO SALIX
fun itemPlacementSupplyGetOrder(
@ -127,16 +116,16 @@ interface VerdnaturaService {
):
Call<Any>*/
@POST("almacennew/collection_assign")//NO SALIX
/* @POST("almacennew/collection_assign")//NO SALIX
fun collection_assign(
):
Call<Int>
Call<Int>*/
@POST("almacennew/operator_getItemPackingType")//NO SALIX
/* @POST("almacennew/operator_getItemPackingType")//NO SALIX
fun operator_getItemPackingType(
):
Call<Any>
Call<Any>*/
/* @POST("almacennew/worker_isF11Allowed")//NO SALIX
fun worker_isF11Allowed(
@ -178,6 +167,7 @@ interface VerdnaturaService {
):
Call<Any>*/
//Tarea 3520
@POST("almacennew/collection_getUncheckedTicket")//NO SALIX
fun collection_getUncheckedTicket(
@Body vararg params: Any
@ -191,17 +181,18 @@ interface VerdnaturaService {
):
Call<CollectionVO>
// SE SACA CON LA DE ARRIBA collection_get_Tickets //
@POST("almacennew/collection_get")//REVISADA
fun collection_get(
@Body vararg params: Any
):
Call<CollectionVO>
@POST("almacennew/saleTrackingReplace")//REVISADA
/* @POST("almacennew/saleTrackingReplace")//REVISADA
fun saleTrackingReplace(
@Body vararg params: Any
):
Call<Any>
Call<Any>*/
/* @POST("almacennew/itemPlacementSupplyAiming")//REVISADA
fun itemPlacementSupplyAiming(
@ -215,11 +206,11 @@ interface VerdnaturaService {
):
Call<Any>*/
@POST("almacennew/saleTracking_mark")//REVISADA
/* @POST("almacennew/saleTracking_mark")//REVISADA
fun saleTracking_mark(
@Body vararg params: Any?
):
Call<Any>
Call<Any>*/
/* @POST("almacennew/collection_printSticker")//REVISADA
fun collectionStickerPrint(
@ -246,23 +237,23 @@ interface VerdnaturaService {
):
Call<Unit>*/
@POST("almacennew/collectionAddItem")//REVISADA
/* @POST("almacennew/collectionAddItem")//REVISADA
fun collectionAddItem(
@Body vararg params: Any
):
Call<Any>
Call<Any>*/
@POST("almacennew/saleTrackingDel")//REVISADA
/* @POST("almacennew/saleTrackingDel")//REVISADA
fun saleTrackingDel(
@Body vararg params: Any
):
Call<Any>
Call<Any>*/
@POST("almacennew/itemShelving_updateFromSale")//REVISADA
/* @POST("almacennew/itemShelving_updateFromSale")//REVISADA
fun itemShelving_updateFromSale(
@Body vararg params: Any
):
Call<Any>
Call<Any>*/
/* @POST("almacennew/ticket_setState")//REVISADA
fun ticket_setState(
@ -348,18 +339,18 @@ interface VerdnaturaService {
//PASILLEROS ========================================================================>
//CONSULTAR ARTICULO ========================================================================>
@POST("almacennew/itemDiary")//REVISADA
/* @POST("almacennew/itemDiary")//REVISADA
fun itemDiary(
@Body vararg params: Any
):
Call<List<ItemHistoricoVO>>
Call<List<ItemHistoricoVO>>*/
@POST("almacennew/item_card")//REVISADA
/* @POST("almacennew/item_card")//REVISADA
fun getItemCard(
@Body vararg params: Any
):
Call<ItemCardVO>
Call<ItemCardVO>*/
/* @POST("almacennew/item_getSimilar")//REVISADA
fun item_getSimilar(
@ -410,18 +401,18 @@ interface VerdnaturaService {
):
Call<Any>*/
@POST("almacennew/barcodes_edit")//REVISADA
/* @POST("almacennew/barcodes_edit")//REVISADA
fun barcodes_edit(
@Body vararg params: Any
):
Call<Any>
Call<Any>*/
//BUSCAR ITEM ========================================================================>
@POST("almacennew/getItemUbication")//REVISADA
/* @POST("almacennew/getItemUbication")//REVISADA
fun searchItemsUbicador(
@Body vararg params: Any
):
Call<List<ItemLocationVO>>
Call<List<ItemLocationVO>>*/
//INVENTARIO ========================================================================>
@ -433,17 +424,17 @@ interface VerdnaturaService {
Call<List<ItemInventaryVO>>*/
//CONTROL DE VEHICULOS
@POST("almacennew/machineWorker_add")//REVISADA
/* @POST("almacennew/machineWorker_add")//REVISADA
fun machineWorker_add(
@Body vararg params: Any
):
Call<Any>
@POST("almacennew/machineWorker_update")//REVISADA
@POST("almacennew/machineWorker_update")//REVISADA
fun machineWorker_update(
@Body vararg params: Any
):
Call<Any>
Call<Any>*/
/* @POST("almacennew/workerMachinery_isRegistered")//REVISADA
@ -469,11 +460,11 @@ interface VerdnaturaService {
):
Call<Any>*/
@POST("almacennew/machineWorker_getHistorical")//REVISADA
/* @POST("almacennew/machineWorker_getHistorical")//REVISADA
fun machineWorker_getHistorical(
@Body vararg params: Any
):
Call<List<ItemHistoricoVehiculo>>
Call<List<ItemHistoricoVehiculo>>*/
//UBICADOR ========================================================================>
/* @POST("almacennew/itemShelvingList")//REVISADA
@ -520,11 +511,11 @@ interface VerdnaturaService {
):
Call<Any>*/
@POST("almacennew/itemShelving_return")
/* @POST("almacennew/itemShelving_return")
fun itemShelving_return(
@Body vararg params: Any
):
Call<ArrayList<Reubication>>
Call<ArrayList<Reubication>>*/
/* @POST("almacennew/clearShelvingList")//REVISADA
@ -539,11 +530,11 @@ interface VerdnaturaService {
):
Call<Any>*/
@POST("almacennew/shelvingLog_add")//REVISADA
/* @POST("almacennew/shelvingLog_add")//REVISADA
fun shelvingLog_add(
@Body vararg params: Any
):
Call<Any>
Call<Any>*/
/*
@POST("almacennew/travel_updatePacking")//REVISADA
@ -625,17 +616,17 @@ interface VerdnaturaService {
):
Call<JsonObject>*/
@POST("almacennew/itemShelving_getSaleDate")//REVISADA
/* @POST("almacennew/itemShelving_getSaleDate")//REVISADA
fun itemShelving_getSaleDate(
@Body vararg params: Any
):
Call<List<ItemShelvingSaleDate>>
Call<List<ItemShelvingSaleDate>>*/
@POST("almacennew/itemShelvingLog_get")//REVISADA
/* @POST("almacennew/itemShelvingLog_get")//REVISADA
fun itemShelvingLog_get(
@Body vararg params: Any
):
Call<List<ItemShelvingLog>>
Call<List<ItemShelvingLog>>*/
/* @POST("almacennew/itemShelving_updateSpam")//REVISADA
fun itemShelving_updateSpam(
@ -720,11 +711,11 @@ interface VerdnaturaService {
):
Call<Unit>*/
@POST("almacennew/expeditionPallet_get")//REVISADA
/* @POST("almacennew/expeditionPallet_get")//REVISADA
fun expeditionPallet_get(
@Body vararg params: Any
):
Call<ItemExpeditionTruckVO>
Call<ItemExpeditionTruckVO>*/
/* @POST("almacennew/expeditionLoading_add")//REVISADA
fun expeditionLoading_add(
@ -752,7 +743,7 @@ interface VerdnaturaService {
):
Call<Unit>*/
//SUPPLIERS
//SUPPLIERS NO VA A UTILIZARSE
@POST("almacennew/supplier_getItems")//REVISADA
fun supplier_getItems(
@Body vararg params: Any

View File

@ -0,0 +1,24 @@
package es.verdnatura.presentation.view.feature.articulo.fragment
import es.verdnatura.R
import es.verdnatura.databinding.ActivityImageviewBinding
import es.verdnatura.presentation.base.BaseActivity
import es.verdnatura.presentation.common.loadUrl
class ImageViewActivity : BaseActivity<ActivityImageviewBinding>(){
override fun getLayoutId(): Int = R.layout.activity_imageview
override fun init() {
binding.mainToolbar.toolbarTitle.text = intent.getStringExtra(getString(R.string.title))
binding.imgView.loadUrl(intent.getStringExtra(getString(R.string.url))!!)
binding.mainToolbar.backButton.setOnClickListener {
onBackPressed()
}
}
}

View File

@ -1,6 +1,7 @@
package es.verdnatura.presentation.view.feature.articulo.fragment
import android.app.AlertDialog
import android.content.Intent
import android.graphics.drawable.Drawable
import android.os.Build
import android.text.InputType
@ -189,7 +190,13 @@ class ItemCardFragment(
customDynamic.cancel()
}
binding.itemcardImage.setOnClickListener {
val i = Intent(activity, ImageViewActivity::class.java)
i.putExtra(getString(R.string.url), urlLarge)
i.putExtra(getString(R.string.title), titleImage)
startActivity(i)
}
}
private fun getItemCard(itemFk: String) {
@ -286,7 +293,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.total),
value = itemInfo.visible.toString(),
value = (itemInfo.visible?:"0").toString(),
isEditable = false
)
)
@ -294,7 +301,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Disponible),
value = itemInfo.available.toString(),
value = (itemInfo.available?:"0").toString(),
isEditable = false
)
)
@ -302,7 +309,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Ubicado),
value = itemInfo.vVisibleItemShelving.toString(),
value = (itemInfo.vVisibleItemShelving?:"0").toString(),
isEditable = false
)
)
@ -310,7 +317,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.SINUBICAR),
value = itemInfo.unlocated.toString(),
value = (itemInfo.unlocated.toString()?:"0"),
isEditable = false,
action = "itemStockUpdate"
)
@ -560,64 +567,9 @@ class ItemCardFragment(
private fun prepareItemStockUpdate2(itemB: ItemCardRowVO, value: Int) {
//Tarea 5652 , quitar código cuando está asignada tarea
/* val test = true
if (test) {*/
viewModel.getAddress()
quantityToDiscard = value
/* } else {
try {
if (itemB.action == "itemStockUpdateRemove") {
customDialogTwo.setTitle(itemB.title!!)
.setDescription(getString(R.string.deleteStock))
.setOkButton(getString(R.string.fault)) {
viewModel.itemTrash(
itemFk = itemInfoG!!.id,
warehouseFk = warehouseFk!!,
newValue = value,
isTrash = false
)
showProgress()
customDialogTwo.dismiss()
}.setOkButtonTwo(getString(R.string.trash)) {
viewModel.itemTrash(
itemFk = itemInfoG!!.id,
warehouseFk = warehouseFk!!,
newValue = value,
isTrash = true
)
showProgress()
customDialogTwo.dismiss()
}.setKoButton(getString(R.string.cancel)) {
customDialogTwo.dismiss()
}.show()
} else {
showProgress()
viewModel.itemTrash(
itemFk = itemInfoG!!.id,
warehouseFk = warehouseFk!!,
newValue = (value * -1),
isTrash = false
)
}
} catch (e: Exception) {
// binding.itemcardLayout.visibility = View.GONE
ma.messageWithSound(getString(R.string.errorNotNumber), true, true)
}
}*/
}
private fun showDialogTrashFault(listAddress: List<AddressLoses>) {
@ -684,22 +636,15 @@ class ItemCardFragment(
}
listBarcodes.removeAt(posDelete)
//Tarea 6276
viewModel.barcodesEdit(
itemFk = itemInfoG!!.id,
value = code,
delete = delete,
)
} else {
listBarcodes.add(BarcodeVO(code))
viewModel.barcodesEditSalix(
itemFk = itemInfoG!!.id,
barCodeValue = code
)
}
viewModel.barcodesEditSalix(
itemFk = itemInfoG!!.id,
barCodeValue = code,
delete = delete,
)
barcodeAdapter!!.notifyDataSetChanged()
showProgress()
}

View File

@ -4,7 +4,6 @@ import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
@ -55,8 +54,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
warehouseFk: Int,
) {
//Tarea 6276
//salix.getCard(barcode = itemFk, warehouseFk = warehouseFk)
silex.getItemCard(itemFk, warehouseFk)
salix.getCard(barcode = itemFk, warehouseFk = warehouseFk)
.enqueue(object : SalixCallback<ItemCardVO>(context) {
override fun onError(t: Throwable) {
_itemcard.value = ItemCardVO(
@ -242,38 +240,17 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
})
}
fun barcodesEdit(
itemFk: Int,
value: String,
delete: Boolean
) {
//Tarea 6276 OK
//salix.barcodesDelete(itemFk = itemFk, barcode = value)
silex.barcodes_edit(value, itemFk, delete)
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(
isError = false,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
})
}
fun barcodesEditSalix(itemFk: Int, barCodeValue: String, delete: Boolean) {
fun barcodesEditSalix(itemFk: Int, barCodeValue: String) {
salix.barcodes_edit(
ItemBarCodeSalix(itemFk, barCodeValue)
)
if (delete) {
salix.barcodesDelete(itemFk = itemFk, barcode = barCodeValue)
} else {
salix.barcodesEdit(
ItemBarCodeSalix(itemFk, barCodeValue)
)
}
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {

View File

@ -12,7 +12,11 @@ import es.verdnatura.R
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.common.hideKeyboard
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
@ -295,7 +299,7 @@ class ControlVehiculoFragment(
responseinsert.observe(viewLifecycleOwner) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
ma.messageWithSound(it.errorMessage, true, false, isToasted = true)
} else {
if (it.response == "false") {

View File

@ -6,7 +6,6 @@ import androidx.lifecycle.MutableLiveData
import com.google.gson.Gson
import com.google.gson.JsonObject
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.domain.model.Filter
import es.verdnatura.presentation.base.BaseViewModel
@ -37,13 +36,12 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
get() = _responseGetExtensionFromUserId
fun machineWorker_add(
plateNumber: String
plate: String
) {
//tarea 6276 vehiculo
//salix.machineWorkerUpdateInTime(plateNumber)
silex.machineWorker_add(plateNumber)
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
salix.machineWorkerUpdateInTime(hashMapOf("plate" to plate))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
@ -51,7 +49,6 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
}
override fun onSuccess(response: Response<Any>) {
//sergio_devuelve true o false
if (response.body().toString() == "false") {
_responseinsert.value = ResponseItemVO(
@ -66,9 +63,10 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
_responseinsert.value = ResponseItemVO(
isError = false,
errorMessage = getMessageFromAllResponse(
nameofFunction(this), response.message()
nameofFunction(this),
response.message()
),
response = response.body().toString()
response = "true"//6276
)
}
@ -81,9 +79,8 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
plate: String
) {
//Tarea 6276 //vehiculo
//salix.machineWorkerUpdateInTime(plate)
silex.machineWorker_update(plate)
.enqueue(object : SilexCallback<Any>(context) {
salix.machineWorkerUpdateInTime( params = hashMapOf("plate" to plate))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,

View File

@ -236,7 +236,7 @@ class ReubicationCollectionFragment(
private fun callItemShelvingReturn() {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelving_return(
viewModel.itemShelvingAlternative(
shelvingFk = shelving,
)

View File

@ -59,7 +59,7 @@ class ReubicationFragment(var entrypoint: String) :
if (!binding.scanInput.text.isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
shelvingScaned = binding.scanInput.text.toString()
viewModel.itemShelving_return(
viewModel.itemShelvingAlternative(
shelvingFk = binding.scanInput.text.toString(),
)

View File

@ -22,8 +22,17 @@ import es.verdnatura.domain.notNull
import es.verdnatura.domain.toInt
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.*
import es.verdnatura.presentation.common.OnMoreClickListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.OnVisibleClickListener
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.common.itemScanValue
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
import es.verdnatura.presentation.view.component.CustomDialogTwoButtons
import es.verdnatura.presentation.view.component.CustomDialogUbicador
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter
@ -560,7 +569,7 @@ class UbicadorFragment(
)
if (isShelvinLogfromMainScreen) {
viewModel.shelvinLog_add(shelvingFk)
viewModel.shelvingLogAdd(shelvingFk)
}
if (modeCheckUbication) {

View File

@ -87,7 +87,7 @@ class UbicadorFragmentNew(
//setNewIcons()
ma.hideBottomNavigation(GONE)
if (shelvingFk.isEmpty()) {
if (shelvingFk.isNotEmpty()) {
isShelvinLogfromMainScreen = false
setIconsActions(true)
setIcons()
@ -180,7 +180,7 @@ class UbicadorFragmentNew(
iconReload.drawable -> {
if (shelvingFk.isEmpty()) {
if (shelvingFk.isNotBlank()) {
binding.editPrioridad.setText("")
viewModel.itemShelvingListNew(
shelvingFk
@ -193,7 +193,7 @@ class UbicadorFragmentNew(
}
iconReset.drawable -> {
if (shelvingFk.isBlank()) {
if (shelvingFk.isNotBlank()) {
val customDialogReset = CustomDialog(requireContext())
customDialogReset.setTitle(getString(R.string.checkItemShelvingDescrip))
.setDescription(getString(R.string.checkItemShelving))
@ -285,8 +285,7 @@ class UbicadorFragmentNew(
binding.automaticImg.setOnClickListener {
if (shelvingFk.isEmpty())
if (shelvingFk.isNotBlank())
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titleAuto)), entryPoint = shelvingFk
)
@ -296,7 +295,7 @@ class UbicadorFragmentNew(
}
binding.parkingImg.setOnClickListener {
if (shelvingFk.isBlank()) {
if (shelvingFk.isNotBlank()) {
customDialogInput.setTitle(getString(R.string.parkingShelving)).setValue("")
.setOkButton(
getString(
@ -329,7 +328,7 @@ class UbicadorFragmentNew(
}
binding.editImg.setOnClickListener {
if (shelvingFk.isBlank()) {
if (shelvingFk.isNotBlank()) {
customDialogInput.setTitle(getString(R.string.changeShelving)).setValue("")
.setOkButton(getString(R.string.save)) {
if (customDialogInput.getValue().isNotBlank()) {
@ -461,7 +460,7 @@ class UbicadorFragmentNew(
event.getContentIfNotHandled().notNull { it ->
if (isShelvinLogfromMainScreen) {
viewModel.shelvinLog_add(shelvingFk)
viewModel.shelvingLogAdd(shelvingFk)
}
listItems = ArrayList()
val totalStickers = it.list.sumOf { item -> item.stickers }

View File

@ -7,7 +7,6 @@ import androidx.lifecycle.map
import com.google.gson.JsonObject
import es.verdnatura.R
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
@ -211,7 +210,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun hasItemOlder(
shelvingFkIn:String,
shelvingFkIn: String,
parking: String? = null,
shelvingFkOut: String? = null,
itemFk: Int? = null,
@ -276,29 +275,33 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun shelvinLog_add(
fun shelvingLogAdd(
code: String
) {
//Tarea 6276 OK
//salix.shelvingLogAdd(hashMapOf("code" to code))
silex.shelvingLog_add(code).enqueue(object : SalixCallback<Any>(context) {
salix.shelvingLogAdd(hashMapOf("code" to code))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_responseLog.value =
ResponseItemVO(isError = false, response = response.message()!!)
}
override fun onSuccess(response: Response<Any>) {
_responseLog.value =
ResponseItemVO(isError = false, response = response.message()!!)
}
})
override fun onError(t: Throwable) {
_responseLog.value =
ResponseItemVO(isError = true, response = t.message!!)
}
})
}
fun itemShelving_return(
fun itemShelvingAlternative(
shelvingFk: String,
) {
//Tarea 6276
// salix.itemShelvingAlternative(shelvingFk)
silex.itemShelving_return(shelvingFk)
.enqueue(object : SilexCallback<ArrayList<Reubication>>(context) {
salix.itemShelvingAlternative(shelvingFk)
.enqueue(object : SalixCallback<ArrayList<Reubication>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<Reubication> = ArrayList()
listError.add(