From b788e296633e2ec082ab4c3cb929ae5443c1d237 Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Tue, 9 Jan 2024 08:52:34 +0100 Subject: [PATCH] refs #6276: prepare Salixback --- .../articulo/fragment/ItemCardViewModel.kt | 15 ++++----------- .../collection/fragment/CollectionViewModel.kt | 10 +++++----- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt index ac32a7d3..ed6747e0 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt @@ -51,8 +51,8 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) { warehouseFk: Int, ) { //Tarea 6276 - // salix.getCard(itemFk = itemFk, warehouseFk = warehouseFk) - silex.getItemCard(itemFk, warehouseFk) + // salix.getCard(itemFk = itemFk, warehouseFk = warehouseFk) + silex.getItemCard(itemFk, warehouseFk) .enqueue(object : SalixCallback(context) { override fun onError(t: Throwable) { _itemcard.value = ItemCardVO( @@ -241,7 +241,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) { delete: Boolean ) { //Tarea 6276 - //salix.barcodesDelete(itemFk = itemFk, barcode = value) + //salix.barcodesDelete(itemFk = itemFk, barcode = value) silex.barcodes_edit(value, itemFk, delete) .enqueue(object : SilexCallback(context) { override fun onError(t: Throwable) { @@ -298,14 +298,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) { ), ) { salix.uploadImage("catalog", itemFK, filePart) - .enqueue(object : SilexCallback(context) { - override fun onError(t: Throwable) { - _responseinsert.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } - + .enqueue(object : SalixCallback(context) { override fun onSuccess(response: Response) { _responseinsert.value = ResponseItemVO( isError = false 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 e798ec4e..f5f71c63 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 @@ -13,7 +13,6 @@ import es.verdnatura.presentation.base.getMessageFromAllResponse import es.verdnatura.presentation.base.nameofFunction import es.verdnatura.presentation.common.Event import es.verdnatura.presentation.common.ResponseItemVO -import es.verdnatura.presentation.common.SaleTrackingReplaceSalix import es.verdnatura.presentation.view.feature.collection.ItemVO import es.verdnatura.presentation.view.feature.collection.SalesModifiedList import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity @@ -316,17 +315,18 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) { buyFk: Long, isScanned: Boolean? ) { - salix.saleTrackingUpdate(SaleTrackingReplaceSalix( + //Tarea 6276 + /* salix.saleTrackingUpdate(SaleTrackingReplaceSalix( saleFk,originalQuantity,code, isChecked != "0",buyFk,isScanned!! - )) - /*silex.saleTrackingReplace( + ))*/ + silex.saleTrackingReplace( saleFk, originalQuantity, code, isChecked != "0", buyFk, isScanned!! - )*/ + ) .enqueue(object : SilexCallback(context) { override fun onError(t: Throwable) { _responseSaleReplace.value = ResponseItemVO(