refs #6276: prepare Salixback

This commit is contained in:
Sergio De la torre 2024-01-09 08:52:34 +01:00
parent 89cbca08c9
commit b788e29663
2 changed files with 9 additions and 16 deletions

View File

@ -51,8 +51,8 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
warehouseFk: Int, warehouseFk: Int,
) { ) {
//Tarea 6276 //Tarea 6276
// salix.getCard(itemFk = itemFk, warehouseFk = warehouseFk) // salix.getCard(itemFk = itemFk, warehouseFk = warehouseFk)
silex.getItemCard(itemFk, warehouseFk) silex.getItemCard(itemFk, warehouseFk)
.enqueue(object : SalixCallback<ItemCardVO>(context) { .enqueue(object : SalixCallback<ItemCardVO>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_itemcard.value = ItemCardVO( _itemcard.value = ItemCardVO(
@ -241,7 +241,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
delete: Boolean delete: Boolean
) { ) {
//Tarea 6276 //Tarea 6276
//salix.barcodesDelete(itemFk = itemFk, barcode = value) //salix.barcodesDelete(itemFk = itemFk, barcode = value)
silex.barcodes_edit(value, itemFk, delete) silex.barcodes_edit(value, itemFk, delete)
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
@ -298,14 +298,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
), ),
) { ) {
salix.uploadImage("catalog", itemFK, filePart) salix.uploadImage("catalog", itemFK, filePart)
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) { override fun onSuccess(response: Response<Any>) {
_responseinsert.value = ResponseItemVO( _responseinsert.value = ResponseItemVO(
isError = false isError = false

View File

@ -13,7 +13,6 @@ import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO 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.ItemVO
import es.verdnatura.presentation.view.feature.collection.SalesModifiedList import es.verdnatura.presentation.view.feature.collection.SalesModifiedList
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
@ -316,17 +315,18 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
buyFk: Long, buyFk: Long,
isScanned: Boolean? isScanned: Boolean?
) { ) {
salix.saleTrackingUpdate(SaleTrackingReplaceSalix( //Tarea 6276
/* salix.saleTrackingUpdate(SaleTrackingReplaceSalix(
saleFk,originalQuantity,code, isChecked != "0",buyFk,isScanned!! saleFk,originalQuantity,code, isChecked != "0",buyFk,isScanned!!
)) ))*/
/*silex.saleTrackingReplace( silex.saleTrackingReplace(
saleFk, saleFk,
originalQuantity, originalQuantity,
code, code,
isChecked != "0", isChecked != "0",
buyFk, buyFk,
isScanned!! isScanned!!
)*/ )
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responseSaleReplace.value = ResponseItemVO( _responseSaleReplace.value = ResponseItemVO(