Se quitan llamadas a itemGetAvailable por itemCard.

This commit is contained in:
Sergio De la torre 2021-10-29 10:55:20 +02:00
parent eea838f05a
commit def4d7e09e
4 changed files with 25 additions and 13 deletions

View File

@ -214,7 +214,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
)
}
fun itemGetAvailable(
/* fun itemGetAvailable(
usuario: String,
password: String,
itemFk: String,
@ -231,7 +231,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
"application/json",
params
)
}
}*/
fun collectionAddItem(
usuario: String,

View File

@ -256,6 +256,7 @@ interface VerdnaturaService {
):
Call<String>
/*sergio:modificada en el caso de que quiera utilizarse por item_Card
@POST("almacennew/itemGetAvailable")//REVISADA
fun itemGetAvailable(
@Header("aplicacion") aplicacion: String,
@ -265,7 +266,7 @@ interface VerdnaturaService {
@Header("Content-Type") content_type: String,
@Body params: List<String>
):
Call<ItemVO>
Call<ItemVO>*/
@POST("almacennew/collectionAddItem")//REVISADA
fun collectionAddItem(

View File

@ -200,9 +200,9 @@ class CollectionFragment(
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconPrint) {
print()
} else if (item == iconSearch) {
}/* else if (item == iconSearch) {
showDisponibility()
} else if (item == iconAdd) {
} */else if (item == iconAdd) {
addItem()
} else if (item == iconFace) {
showUser()
@ -324,7 +324,7 @@ class CollectionFragment(
responseNew.observe(viewLifecycleOwner, Observer {
if (splash_progress != null) splash_progress.visibility = View.GONE
if (!goBack) {
// if (!goBack) {
if (it.isError) {
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage)
.setKoButton("Cerrar") {
@ -343,7 +343,7 @@ class CollectionFragment(
// //Log.i("VERDNATURA:","La collection es ${collection.collectionFk}")
}
}
// }
goBack = false
@ -1252,7 +1252,7 @@ class CollectionFragment(
}
private fun showDisponibility() {
/* private fun showDisponibility() {
customDialogInput.setTitle(getString(R.string.Verdisponible))
.setDescription(getString(R.string.Escaneaetiqueta))
@ -1304,7 +1304,7 @@ class CollectionFragment(
}
false
}
}
}*/
private fun toastDisponibility(item: ItemVO) {
if (item.available.isNullOrEmpty()) {

View File

@ -279,7 +279,7 @@ class CollectionViewModel(context: Context) : BaseViewModel()
})
}
fun itemGetAvailable(usuario: String, password: String, itemFk: String, warehouseFk: String,callFunction:String)
/* fun itemGetAvailable(usuario: String, password: String, itemFk: String, warehouseFk: String,callFunction:String)
{
getSacadorControladorUserCase.itemGetAvailable(usuario, password, itemFk, warehouseFk)
.enqueue(object : Callback<ItemVO>
@ -306,7 +306,7 @@ class CollectionViewModel(context: Context) : BaseViewModel()
}
}
})
}
}*/
fun collectionAddItem(
usuario: String,
@ -336,7 +336,18 @@ class CollectionViewModel(context: Context) : BaseViewModel()
override fun onResponse(call: Call<String>, response: Response<String>)
{
if (response.body() == null)
if (!response.isSuccessful){
_responseNew.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
_responseNew.value =
ResponseItemVO(isError = false, response = response.body()!!)
}
/* if (response.body() == null)
{
_responseNew.value = ResponseItemVO(
isError = true,
@ -346,7 +357,7 @@ class CollectionViewModel(context: Context) : BaseViewModel()
{
_responseNew.value =
ResponseItemVO(isError = false, response = response.body()!!)
}
}*/
}
})
}