diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 76fa549c..00000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 967cc682..1cb33005 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,9 @@ android { applicationId "es.verdnatura" minSdkVersion 21 targetSdkVersion 30 - versionCode 117 - versionName "8.4Beta" //versionCode 117: return i workerAppTester + versionCode 118 + versionName "8.4.1Beta" //versionCode 118: arreglat rocket a Alex i llevat callFunction,strings ok + //versionName "8.4Beta" //versionCode 117: return i workerAppTester //versionName "8.3" //versionCode 116: versionCode 116: cambios finales en return, diseño grafico... diff --git a/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt b/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt index 5d409d21..36fb52ba 100644 --- a/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt +++ b/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt @@ -6,7 +6,7 @@ import retrofit2.converter.gson.GsonConverterFactory class ApiSalixUtils { companion object { //const val BASE_URL:String = "http://192.168.1.155:9009/" - // const val BASE_URL: String = "https://test-salix.verdnatura.es/api/" + //const val BASE_URL: String = "https://test-salix.verdnatura.es/api/" const val BASE_URL: String = "https://salix.verdnatura.es/api/" fun getApiService(): SalixService { val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory( diff --git a/app/src/main/java/es/verdnatura/domain/ApiUtils.kt b/app/src/main/java/es/verdnatura/domain/ApiUtils.kt index ee99a520..4598f82f 100644 --- a/app/src/main/java/es/verdnatura/domain/ApiUtils.kt +++ b/app/src/main/java/es/verdnatura/domain/ApiUtils.kt @@ -12,7 +12,7 @@ import java.util.concurrent.TimeUnit class ApiUtils { companion object { //const val BASE_URL:String = "http://192.168.1.54:8009/" - //const val BASE_URL:String = "https://10.1.3.102/" + //const val BASE_URL:String = "https://10.1.2.79/" const val BASE_URL: String = "https://app.verdnatura.es/" diff --git a/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt index f0861187..f6a9502b 100644 --- a/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt +++ b/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt @@ -115,7 +115,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) { } - fun collectionNew( + fun collectionNewSmarttag( usuario: String, password: String, sectorFk: String, @@ -340,7 +340,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) { quantityFk: String, ticketFk: String, warehouseFk: String - ): Call { + ): Call { val params: ArrayList = ArrayList() params.add(itemFk) params.add(quantityFk) diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt index 7d24fa18..96a5a310 100644 --- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt +++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt @@ -469,7 +469,7 @@ interface VerdnaturaService { @Header("Content-Type") content_type: String, @Body params: List ): - Call + Call @POST("almacennew/saleMove")//REVISADA fun saleMove( 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 2b44ad15..a073ce38 100644 --- a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt @@ -44,7 +44,6 @@ abstract class BaseFragment(viewModelCla Fragment(), TextToSpeech.OnInitListener, RecognitionListener { protected val TAG = "VERDNATURA" - protected val TD = "VERDNATURA:" protected val PREFS_USER = "es.verdnatura.user.prefs" protected val USERFK = "userFk" protected val USER = "user" @@ -91,14 +90,14 @@ abstract class BaseFragment(viewModelCla protected val ERROR = -1 - val allowedStrings = + /*val allowedStrings = Arrays.asList( "cero", "uno", "dos", "tres", "cuatro", "cinco", "seis", "siete", "ocho", "nueve", "diez", "once", "doce", "trece", "catorce", "quince", "dieziseis", "diezisiete", "dieziocho", "diezinueve", "veinte", "treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa", "cien", "mil" - ) + )*/ override fun onAttach(context: Context) { @@ -224,43 +223,44 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?) return when (image) { //itemCard - R.drawable.ic_autorenew_black_24dp -> "Recarga datos del elemento escaneado/seleccionado" - R.drawable.ic_history_black_24dp -> "Ver Histórico del ítem" + R.drawable.ic_autorenew_black_24dp -> { + getString(R.string.reloadItemData) + } + R.drawable.ic_history_black_24dp -> getString(R.string.showHistoricalItem) //presacador - R.drawable.ic_local_parking_black_24dp->"Permite aparcar ticket/carro" + R.drawable.ic_local_parking_black_24dp->getString(R.string.allowParking) //collection - R.drawable.ic_print_black_24dp->"Imprime ticket" - R.drawable.ic_playlist_add_black_24dp->"Añade ítem" - R.drawable.ic_worker->"Visualiza la foto del sacador" - R.drawable.phone_call->"Realiza llamada al sacador" - R.drawable.car->"Permite coger vehículo" - R.drawable.car_off->"Permite dejar el vehículo" + R.drawable.ic_print_black_24dp->getString(R.string.printTicket) + R.drawable.ic_playlist_add_black_24dp->getString(R.string.addItem) + R.drawable.ic_worker->getString(R.string.showFacePicker) + R.drawable.phone_call->getString(R.string.callPicker) + R.drawable.car->getString(R.string.allowSelectVehicle) + R.drawable.car_off->getString(R.string.allowTakeoffVehicle) //REPETIDO:R.drawable.ic_history_black_24dp->"Realiza llamada al sacador" //sacador - R.drawable.ic_add_black_24dp->"Genera colección para sacar" + R.drawable.ic_add_black_24dp->getString(R.string.newCollection) //REPETIDO: R.drawable.car->"Permite coger vehículo" //ubicador: //REPETIDO: R.drawable.ic_add_black_24dp->"Genera colección para sacar" //REPETIDO: ic_autorenew_black_24dp //historico articulo - R.drawable.ic_transaction->"Ver filtro " - R.drawable.alpha_f_circle_outline->"Ver movimientos de Faltas" - R.drawable.alpha_b_circle_outline->"Ver movimientos de Basura" + R.drawable.ic_transaction->getString(R.string.showFilter) + R.drawable.alpha_f_circle_outline->getString(R.string.showFaults) + R.drawable.alpha_b_circle_outline->getString(R.string.showTrash) - R.drawable.filter_outline->"Filtra por tipo de flor" - R.drawable.previous_delete->"Quita de pantalla lo que ya está sacado ( misma función que escanear 2.000.000)" + R.drawable.filter_outline->getString(R.string.filterFlower) else -> {""} } } override fun onInit(status: Int) { - if (status == TextToSpeech.SUCCESS) { + /* if (status == TextToSpeech.SUCCESS) { val spanish = Locale("es", "ES") textToSpeech!!.language = spanish textToSpeech!!.setOnUtteranceProgressListener(object : UtteranceProgressListener() { override fun onDone(utteranceId: String?) { - Log.i("SPEEAK", "on done") + //Log.i("SPEEAK", "on done") requireActivity().runOnUiThread(Runnable { if (mSpeechRecognizer != null) { mSpeechRecognizer!!.destroy() @@ -284,7 +284,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?) }) } else { "La voz no se ha podido iniciar".toast(requireContext()) - } + }*/ } private fun runSound() { @@ -315,29 +315,29 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?) override fun onReadyForSpeech(params: Bundle?) { isOnReadyForSpeech = true - Log.i("Speech", "onReadyForSpeech") + // Log.i("Speech", "onReadyForSpeech") } override fun onBeginningOfSpeech() { - Log.i("Speech", "onBeginningOfSpeech") + // Log.i("Speech", "onBeginningOfSpeech") } override fun onRmsChanged(rmsdB: Float) {} override fun onBufferReceived(buffer: ByteArray?) { - Log.i("Speech", "onBufferReceived") + // Log.i("Speech", "onBufferReceived") } override fun onEndOfSpeech() { - Log.i("Speech", "onEndOfSpeech") + // Log.i("Speech", "onEndOfSpeech") } override fun onError(error: Int) { if (!isOnReadyForSpeech && error == SpeechRecognizer.ERROR_NO_MATCH) { - ("Problemas con la velocidad de internet. No se puede usar la voz").toast(requireContext()) + (getString(R.string.speedProblems)).toast(requireContext()) return } else { - Log.i("Speech", "onError " + error) + //Log.i("Speech", "onError " + error) if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy() mSpeechRecognizer = null initialize() @@ -348,11 +348,11 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?) override fun onResults(results: Bundle) {} override fun onPartialResults(partialResults: Bundle?) { - Log.i("Speech", "onPartialResults") + //Log.i("Speech", "onPartialResults") } override fun onEvent(eventType: Int, params: Bundle?) { - Log.i("Speech", "onEvent") + //Log.i("Speech", "onEvent") } open fun checkText(text: String): Int { @@ -523,7 +523,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?) WAREHOUSEFK->prefs.getInt(name, ConstAndValues.WAREHOUSEFKDEFAULT).toString() VOZ->prefs.getString(name, "NO").toString() WAGON->prefs.getInt(name, 2).toString() - TAGSTYPE-> prefs.getString(name, "Stickers").toString() + TAGSTYPE-> prefs.getString(name, getString(R.string.stickers)).toString() SECTORDESCRIP->prefs.getString(name,getString(R.string.Sinsector)).toString() BUYER->prefs.getString(name,"").toString() BUYERID->prefs.getString(name,"").toString() @@ -531,11 +531,11 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?) DEPARTMENTMISTAKE->prefs.getString(name,"").toString() DEPARTMENTMISTAKEID->prefs.getString(name,"").toString() PRINTERFK->prefs.getInt(name,0).toString() - PRINTERNAME->prefs.getString(name,"Sin impresora").toString() + PRINTERNAME->prefs.getString(name,getString(R.string.noprinter)).toString() "base_url"->{ val preferences = PreferenceManager.getDefaultSharedPreferences(context) - preferences.getString("base_url","").toString() + preferences.getString(getString(R.string.baseurl),"").toString() } else -> {""} diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/adapter/AjustesAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/adapter/AjustesAdapter.kt index 600b337b..8a353ab7 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/adapter/AjustesAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/adapter/AjustesAdapter.kt @@ -46,7 +46,7 @@ class AjustesAdapter ( this.item = item - if (item.title=="Cerrar Sesión"){ + if (item.title==context!!.getString(R.string.closeSession)){ binding.itemTitle.setTextColor( ContextCompat.getColor( context!!, diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt index b2f0ec55..d7ab743b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt @@ -63,9 +63,7 @@ class AjustesFragment : override fun init() { - //ma.hideBottomNavigationFragment(View.VISIBLE) - - binding.mainToolbar.toolbarTitle.text="Configuración" + binding.mainToolbar.toolbarTitle.text=getString(R.string.settings) hideBackButton(binding.mainToolbar) @@ -79,7 +77,7 @@ class AjustesFragment : binding.androididText.setText( getData(ANDROID_ID) ) - binding.txtserver.setText(getData("base_url")) + binding.txtserver.setText(getData(getString(R.string.baseurl))) super.init() setEvents() @@ -130,15 +128,15 @@ class AjustesFragment : } else if (item.id == 3) { val listTagsType: ArrayList = ArrayList() - listTagsType.add("Stickers") - listTagsType.add("SmartTags") + listTagsType.add(getString(R.string.stickers)) + listTagsType.add(getString(R.string.smarttags)) tagsList = listTagsType val array = arrayOfNulls(listTagsType.size) showItemPickerType(array = listTagsType.toArray(array)) } else if (item.id == 4) { ma.onPasillerosItemClickListener( PasillerosItemVO( - title = "Control de usuario de vehículo" + title = getString(R.string.userVehicleControl) ), getData(USERFK) ) @@ -166,7 +164,7 @@ class AjustesFragment : event.getContentIfNotHandled().notNull { binding.splashProgress.visibility = View.INVISIBLE if (it.list.isNotEmpty() && it.list.get(0).isError) { - customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage) + customDialog.setTitle(getString(R.string.error)).setDescription(it.list.get(0).errorMessage) .setOkButton(getString(R.string.Close)) { customDialog.dismiss() }.show() @@ -182,7 +180,7 @@ class AjustesFragment : showDialogSector(listSectores.toArray(array)) } else { - customDialog.setTitle("Sectores") + customDialog.setTitle(getString(R.string.sectors)) .setDescription(getString(R.string.Noexistessectores)) .setOkButton(getString(R.string.Close)) { customDialog.dismiss() @@ -196,7 +194,7 @@ class AjustesFragment : event.getContentIfNotHandled().notNull { binding.splashProgress.visibility = View.INVISIBLE if (it.list.isNotEmpty() && it.list.get(0).isError) { - customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage) + customDialog.setTitle(getString(R.string.error)).setDescription(it.list.get(0).errorMessage) .setOkButton(getString(R.string.Close)) { customDialog.dismiss() }.show() @@ -212,7 +210,7 @@ class AjustesFragment : showDialogPrinters(listPrinters.toArray(array)) } else { - customDialog.setTitle("Impresoras") + customDialog.setTitle(getString(R.string.printers)) .setDescription(getString(R.string.Noprinters)) .setOkButton(getString(R.string.Close)) { customDialog.dismiss() @@ -272,7 +270,6 @@ class AjustesFragment : viewModel.ajustesitem.get(0).sectorFk = it.id viewModel.ajustesitem.get(0).warehouse = it.warehouseFk viewModel.ajustesitem.get(0).selected = it.description - d("El sector marcado es "+it.id.toString()) viewModel.worker_updateSector(getData(USER),getData(PASSWORD),it.id.toString()) ajustesAdapter!!.notifyDataSetChanged() @@ -382,7 +379,7 @@ class AjustesFragment : private fun copyanddrag(string: String): Boolean { val clipboard = getActivity()?.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager - val clip: ClipData = ClipData.newPlainText("Android_id", string) + val clip: ClipData = ClipData.newPlainText(getString(R.string.androidid), string) clipboard.setPrimaryClip(clip) setTooltipText(binding.androididText, getString(R.string.copied)) return false diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt index b708f726..3bcb126a 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt @@ -2,8 +2,6 @@ package es.verdnatura.presentation.view.feature.ajustes.fragment import android.content.Context -import android.util.Log -import android.util.Printer import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Transformations @@ -22,192 +20,237 @@ import timber.log.Timber.d class AjustesViewModel(context: Context) : BaseViewModel() { - private val getAjustesUserCase:GetAjustesUserCase = GetAjustesUserCase(context) - val version : String = "5.0.0" + private val getAjustesUserCase: GetAjustesUserCase = GetAjustesUserCase(context) + val version: String = "5.0.0" - private val _ajustesitem by lazy { ArrayList() } - val ajustesitem: List - get() = _ajustesitem + private val _ajustesitem by lazy { ArrayList() } + val ajustesitem: List + get() = _ajustesitem - private val _sectorList by lazy { MutableLiveData() } - val sectorList: LiveData - get() = _sectorList + private val _sectorList by lazy { MutableLiveData() } + val sectorList: LiveData + get() = _sectorList - private val _workerupdateSector by lazy { MutableLiveData() } - val workerupdateSector: LiveData - get() = _workerupdateSector + private val _workerupdateSector by lazy { MutableLiveData() } + val workerupdateSector: LiveData + get() = _workerupdateSector - private val _workerupdatePrinter by lazy { MutableLiveData() } - val workerupdatePrinter: LiveData - get() = _workerupdatePrinter + private val _workerupdatePrinter by lazy { MutableLiveData() } + val workerupdatePrinter: LiveData + get() = _workerupdatePrinter - private val _printerList by lazy { MutableLiveData() } - val printerList: LiveData - get - () = _printerList + private val _printerList by lazy { MutableLiveData() } + val printerList: LiveData + get + () = _printerList - val loadSectorList = Transformations.map(_sectorList) {Event(it)} - val loadprintersList = Transformations.map(_printerList) {Event(it)} + val loadSectorList = Transformations.map(_sectorList) { Event(it) } + val loadprintersList = Transformations.map(_printerList) { Event(it) } + fun inititializeDefaultAjusts( + sectorDescrip: String, + sectorFk: Int, + warehouseFk: Int, + carroDescrip: String, + TypeTags: String, + printerFk: Int, + printerSelected: String + ) { + _ajustesitem.add( + AjustesItemVO( + 0, + "Sector", + sectorDescrip, + sectorFk, + warehouseFk, + 0, + printerSelected + ) + ) - fun inititializeDefaultAjusts(sectorDescrip: String,sectorFk : Int, warehouseFk : Int,carroDescrip:String,TypeTags:String,printerFk:Int,printerSelected:String) { - _ajustesitem.add( - AjustesItemVO(0, - "Sector", - sectorDescrip, - sectorFk, - warehouseFk, - 0, - printerSelected) - ) + _ajustesitem.add( + AjustesItemVO( + 1, + "Carros", + carroDescrip, + 0, + 0, + 0, "Sin impresora" + ) + ) + _ajustesitem.add( + AjustesItemVO( + 2, + "Impresora etiquetas", + printerSelected, + 0, + 0, + printerFk, printerSelected + ) + ) + _ajustesitem.add( + AjustesItemVO( + 3, + "Tipo etiqueta", + TypeTags, + 0, + 0, + 0, "Sin impresora" + ) + ) + _ajustesitem.add( + AjustesItemVO( + 4, + "Control de vehículos", + "", + 0, + 0, + 0, "Sin impresora" + ) + ) + _ajustesitem.add( + AjustesItemVO( + 5, + "Cerrar Sesión", + "", + 0, + 0, + 0, "Sin impresora" + ) + ) + } - _ajustesitem.add( - AjustesItemVO(1, - "Carros", - carroDescrip, - 0, - 0, - 0,"Sin impresora") - ) - _ajustesitem.add( - AjustesItemVO(2, - "Impresora etiquetas", - printerSelected, - 0, - 0, - printerFk,printerSelected) - ) - _ajustesitem.add( - AjustesItemVO(3, - "Tipo etiqueta", - TypeTags, - 0, - 0, - 0,"Sin impresora") - ) - _ajustesitem.add( - AjustesItemVO(4, - "Control de vehículos", - "", - 0, - 0, - 0,"Sin impresora") - ) - _ajustesitem.add( - AjustesItemVO(5, - "Cerrar Sesión", - "", - 0, - 0, - 0,"Sin impresora") - ) - - } - - fun getSectors(user:String,password:String){ - getAjustesUserCase.getSectors(user,password).enqueue(object : Callback>{ - override fun onFailure(call: Call>, t: Throwable) { - val listError:ArrayList = ArrayList() - listError.add(SectorItemVO(0,"",0,true,t.message!!)) + fun getSectors(user: String, password: String) { + getAjustesUserCase.getSectors(user, password) + .enqueue(object : Callback> { + override fun onFailure(call: Call>, t: Throwable) { + val listError: ArrayList = ArrayList() + listError.add(SectorItemVO(0, "", 0, true, t.message!!)) _sectorList.value = SectorListVO(listError) - } + } - override fun onResponse( + override fun onResponse( call: Call>, response: Response> - ) { - if (response.body() != null){ - _sectorList.value = response.body()?.let { SectorListVO(it) } - }else{ - val listError:ArrayList = ArrayList() - listError.add(SectorItemVO(0,"",0,true,"Error en la llamada sector_get")) - _sectorList.value = SectorListVO(listError) + ) { + if (response.body() != null) { + _sectorList.value = response.body()?.let { SectorListVO(it) } + } else { + val listError: ArrayList = ArrayList() + listError.add( + SectorItemVO( + 0, + "", + 0, + true, + "Error en la llamada sector_get" + ) + ) + _sectorList.value = SectorListVO(listError) } - } + } - }) - } - fun getSectorsSalix(token:String){ - getAjustesUserCase.getSectorsSalix(token).enqueue(object : Callback>{ - override fun onFailure(call: Call>, t: Throwable) { - val listError:ArrayList = ArrayList() - listError.add(SectorItemVO(0,"",0,true,t.message!!)) + }) + } + + fun getSectorsSalix(token: String) { + getAjustesUserCase.getSectorsSalix(token).enqueue(object : Callback> { + override fun onFailure(call: Call>, t: Throwable) { + val listError: ArrayList = ArrayList() + listError.add(SectorItemVO(0, "", 0, true, t.message!!)) + _sectorList.value = SectorListVO(listError) + } + + override fun onResponse( + call: Call>, + response: Response> + ) { + + + if (response.body() != null) { + _sectorList.value = response.body()?.let { SectorListVO(it) } + } else { + val listError: ArrayList = ArrayList() + listError.add( + SectorItemVO( + 0, "", 0, true, + getMessageFromAllResponse(nameofFunction(this), response.message()) + ) + ) _sectorList.value = SectorListVO(listError) - } + } + } - override fun onResponse( - call: Call>, - response: Response> - ) { + }) + } + + fun printer_get(user: String, password: String) { + getAjustesUserCase.printer_get(user, password).enqueue(object : Callback> { + override fun onFailure(call: Call>, t: Throwable) { + val listError: ArrayList = ArrayList() + listError.add(Printers(0, "", true, t.message!!)) + _printerList.value = PrintersList(listError) + + } + + override fun onResponse( + call: Call>, + response: Response> + ) { - if (response.body() != null){ - _sectorList.value = response.body()?.let { SectorListVO(it) } - }else{ - val listError:ArrayList = ArrayList() - listError.add(SectorItemVO(0,"",0,true, - getMessageFromAllResponse(nameofFunction(this),response.message()) - )) - _sectorList.value = SectorListVO(listError) - } - } - - }) - } - - fun printer_get(user:String,password:String){ - getAjustesUserCase.printer_get(user,password).enqueue(object : Callback>{ - override fun onFailure(call: Call>, t: Throwable) { - val listError:ArrayList = ArrayList() - listError.add(Printers(0,"",true,t.message!!)) + if (response.body() != null) { + _printerList.value = response.body()?.let { PrintersList(it) } + } else { + val listError: ArrayList = ArrayList() + listError.add( + Printers( + 0, "", true, + getMessageFromAllResponse(nameofFunction(this), response.message()) + ) + ) _printerList.value = PrintersList(listError) + } + } - } + }) + } - override fun onResponse( - call: Call>, - response: Response> - ) { + fun worker_updateSector(user: String, password: String, sectorFk: String) { + d("El sector marcado dentro es " + sectorFk) + getAjustesUserCase.worker_updateSector(user, password, sectorFk) + .enqueue(object : Callback { + override fun onFailure(call: Call, t: Throwable) { + _workerupdateSector.value = ResponseItemVO( + isError = true, + errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) + ) + } - if (response.body() != null){ - _printerList.value = response.body()?.let { PrintersList (it) } - }else{ - val listError:ArrayList = ArrayList() - listError.add(Printers(0,"",true, - getMessageFromAllResponse(nameofFunction(this),response.message()) - )) - _printerList.value = PrintersList(listError) - } - } - - }) - } - - fun worker_updateSector(user:String,password:String,sectorFk:String){ - d("El sector marcado dentro es "+sectorFk) - getAjustesUserCase.worker_updateSector(user,password,sectorFk).enqueue(object : Callback{ - override fun onFailure(call: Call, t: Throwable) { - - _workerupdateSector.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) - } - - override fun onResponse( + override fun onResponse( call: Call, response: Response - ) { + ) { - if (!response.isSuccessful()){ - _workerupdateSector.value=ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()) - ) - }else{ - _workerupdateSector.value=ResponseItemVO(response="Actualizado sector",isError = false, errorMessage ="Actualizado sector") + if (!response.isSuccessful()) { + _workerupdateSector.value = ResponseItemVO( + isError = true, + errorMessage = getMessageFromAllResponse( + nameofFunction(this), + response.message() + ) + ) + } else { + _workerupdateSector.value = ResponseItemVO( + response = "Actualizado sector", + isError = false, + errorMessage = "Actualizado sector" + ) } /*if (response.body() != null){ @@ -217,34 +260,46 @@ class AjustesViewModel(context: Context) : BaseViewModel() { listError.add(SectorItemVO(0,"",0,true,"Error en la llamada sector_get")) _sectorList.value = SectorListVO(listError) }*/ - } + } - }) - } - fun worker_updatePrinter(user:String,password:String,printerFk:String){ - d("La impresora marcada "+printerFk) - getAjustesUserCase.worker_updatePrinter(user,password,printerFk).enqueue(object : Callback{ - override fun onFailure(call: Call, t: Throwable) { + }) + } - _workerupdatePrinter.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) - } + fun worker_updatePrinter(user: String, password: String, printerFk: String) { + d("La impresora marcada " + printerFk) + getAjustesUserCase.worker_updatePrinter(user, password, printerFk) + .enqueue(object : Callback { + override fun onFailure(call: Call, t: Throwable) { - override fun onResponse( + _workerupdatePrinter.value = ResponseItemVO( + isError = true, + errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) + ) + } + + override fun onResponse( call: Call, response: Response - ) { + ) { - if (!response.isSuccessful()){ - _workerupdatePrinter.value=ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()) - ) - }else{ - _workerupdatePrinter.value=ResponseItemVO(response="Actualizada impresora",isError = false, errorMessage ="Actualizada impresora") + if (!response.isSuccessful()) { + _workerupdatePrinter.value = ResponseItemVO( + isError = true, + errorMessage = getMessageFromAllResponse( + nameofFunction(this), + response.message() + ) + ) + } else { + _workerupdatePrinter.value = ResponseItemVO( + response = "Actualizada impresora", + isError = false, + errorMessage = "Actualizada impresora" + ) } - } + } - }) - } + }) + } } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt index 4303cc9f..ff402fec 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt @@ -12,7 +12,7 @@ class AjustesItemVO ( class SectorItemVO ( var id: Int, - var description:String = "des", + var description:String = "", val warehouseFk:Int?, val isError : Boolean = false, var errorMessage : String = "" diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt index 3aa0ea6d..4b89f752 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt @@ -188,7 +188,7 @@ class ItemCardFragment( if (working_in_test){ viewModel.getItemPackingTypeSalix(getData(TOKEN)) }else { - viewModel.getItemPackingType(getData(USER), getData(PASSWORD), "get_ItemPackingType") + viewModel.getItemPackingType(getData(USER), getData(PASSWORD)) } } @@ -199,7 +199,7 @@ class ItemCardFragment( if (it.isError) { binding.itemcardLayout.visibility = GONE binding.splashProgressTwo.visibility = GONE - binding.mainToolbar.toolbarTitle.text = "ItemCard" + binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard) ma.messageWithSound(it.errorMessage,true,false) } else { @@ -209,8 +209,8 @@ class ItemCardFragment( } else { binding.splashProgressTwo.visibility = GONE binding.itemcardLayout.visibility = View.GONE - binding.mainToolbar.toolbarTitle.text = "ItemCard" - ma.messageWithSound("No hemos podido encontrar el articulo. Revisa el sector.",true,false,"Sin resultados") + binding.mainToolbar.toolbarTitle.text =getString(R.string.itemCard) + ma.messageWithSound("No hemos podido encontrar el articulo. Revisa el sector.",true,false,getString(R.string.noResults)) } @@ -613,7 +613,7 @@ class ItemCardFragment( } }catch (e:Exception){ binding.itemcardLayout.visibility = View.GONE - customDialog.setTitle("Error").setDescription("El elemento introducido no es un número").setKoButton("Cancelar"){ + customDialog.setTitle(getString(R.string.error)).setDescription("El elemento introducido no es un número").setKoButton("Cancelar"){ customDialog.dismiss() }.show() } @@ -686,7 +686,7 @@ class ItemCardFragment( updateBarcode(customDialogList.getValue(), "0", itemB) customDialogList.dismiss() - }.setKoButton("Cerrar") { + }.setKoButton(getString(R.string.close)) { ma.hideKeyboard(customDialogList.getEditText()) customDialogList.dismiss() }.setValue("").show() 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 e6b62983..169b6ead 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 @@ -131,7 +131,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() { } - fun getItemPackingType(user: String, password: String, callFunction: String) { + fun getItemPackingType(user: String, password: String) { getItemCardUserCase.getItemPackingType(user, password).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { @@ -209,7 +209,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() { }) } - /* fun itemStockUpdate(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String,callFunction:String){ + /* fun itemStockUpdate(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String){ getItemCardUserCase.itemStockUpdate(user,password,itemFk,warehouseFk,newValue,isTrash).enqueue(object : Callback{ override fun onFailure(call: Call, t: Throwable) { _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada $callFunction."+t.message!!) @@ -263,7 +263,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() { }) } - /* fun itemPlacementSave(itemFk:String,warehouseFk:String,user:String,password:String,value:String,callFunction:String){ + /* fun itemPlacementSave(itemFk:String,warehouseFk:String,user:String,password:String,value:String){ getItemCardUserCase.itemPlacementSave(user,password,itemFk,warehouseFk,value).enqueue(object : Callback{ override fun onFailure(call: Call, t: Throwable) { _response.value = ResponseItemVO(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)) @@ -354,7 +354,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() { } //sergio ver como solucionar el tema del "Finish" - /* fun updatePackingType(itemFk:String,user:String,password:String,itemPackingType:String,callFunction:String){ + /* fun updatePackingType(itemFk:String,user:String,password:String,itemPackingType:String){ getItemCardUserCase.updatePackingType(user,password,itemFk,itemPackingType).enqueue(object : Callback{ override fun onFailure(call: Call, t: Throwable) { _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt index 624910bc..82af3de0 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt @@ -17,7 +17,6 @@ class BufferFragment( private var password = "" private var goBack: Boolean = false override fun getLayoutId(): Int = R.layout.fragment_buffer - //private lateinit var customDialog: CustomDialog companion object { fun newInstance(entryPoint: String) = BufferFragment(entryPoint) @@ -27,7 +26,6 @@ class BufferFragment( override fun init() { binding.splashProgress.visibility = View.GONE - //customDialog = CustomDialog(requireContext()) setToolbar() setEvents() super.init() @@ -59,19 +57,20 @@ class BufferFragment( when (entryPoint){ - "Vaciado buffer"->entryPoint="UNLOADING" - "Llenado buffer"-> entryPoint="LOADING" - "Acumulación buffer"->entryPoint="ACCUMULATION" - "Desactivado buffer"->entryPoint="DISABLED" - "Flejado buffer"->entryPoint="STRAPPING" + + getString(R.string.bufferempty)->entryPoint="UNLOADING" + getString(R.string.bufferfill)-> entryPoint="LOADING" + getString(R.string.bufferaccumulate)->entryPoint="ACCUMULATION" + getString(R.string.bufferoff)->entryPoint="DISABLED" + getString(R.string.bufferfstrapping)->entryPoint="STRAPPING" } viewModel.buffer_setTypeByName( getData(USER), getData(PASSWORD), binding.scanInput.text.toString(), - entryPoint, - "buffer_setTypeByName" + entryPoint + ) @@ -96,7 +95,7 @@ class BufferFragment( } else { - ma.messageWithSound("Operación "+entryPoint.lowercase() + " buffer realizada correctamente",false,isPlayed = true) + ma.messageWithSound(entryPoint.lowercase() + getString (R.string.operationSuccess),false,isPlayed = true) binding.mainToolbar.backButton.performClick() } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt index d8d75355..a9dcfa14 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt @@ -32,7 +32,7 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() { - fun buffer_setTypeByName(user: String, password: String, vBufferFk: String, vType: String,callFunction:String){ + fun buffer_setTypeByName(user: String, password: String, vBufferFk: String, vType: String){ GetPaletizadoresUserCase.buffer_setTypeByName(user, password, vBufferFk, vType) .enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { @@ -67,7 +67,7 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() { }) } - fun expeditionLoading_add(usuario:String,password:String,vExpeditionFk:String, vBufferFk:String,callFunction:String){ + fun expeditionLoading_add(usuario:String,password:String,vExpeditionFk:String, vBufferFk:String){ GetPaletizadoresUserCase.expeditionLoading_add(usuario,password,vExpeditionFk, vBufferFk).enqueue(object : Callback{ override fun onFailure(call: Call, t: Throwable) { _bufferloadresponse.value = ResponseItemVO( diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt index c0bf91a1..939b49bb 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt @@ -80,8 +80,8 @@ class BufferLoadFragment( usuario = getData(USER), password=getData(PASSWORD), vBufferFk = ExpeditionOrBuffer, - vExpeditionFk = listTags.first().code.toString(), - callFunction = "expeditionLoading_add") + vExpeditionFk = listTags.first().code.toString()) + } itemScaned = ExpeditionOrBuffer @@ -154,7 +154,7 @@ class BufferLoadFragment( private fun showExpeditionOrBufferScan() { customDialogList.setTitle("Escanea etiqueta de la expedición.") - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { ma.hideKeyboard(customDialogList.getEditText()) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt index 0c5eb2bf..d309681b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt @@ -68,7 +68,7 @@ class BuscarItemFragment( private fun getLocations(itemFk: String) { this.itemFk = itemFk binding.splashProgress.visibility = View.VISIBLE - viewModel.getLocations(getData(USER), getData(PASSWORD), itemFk, "getItemUbication") + viewModel.getLocations(getData(USER), getData(PASSWORD), itemFk) } override fun observeViewModel() { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt index f67f6055..838eb0b9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt @@ -27,7 +27,7 @@ class BuscarItemViewModel(context: Context) : BaseViewModel() { val loadLocationList = Transformations.map(_locationList) { Event(it) } - fun getLocations(user:String,password:String,itemFk:String,callFunction:String){ + fun getLocations(user:String,password:String,itemFk:String){ getBuscarItemUserCase.searchItemsUbicador(user,password,itemFk).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { val listError:ArrayList = ArrayList() 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 index 8271784f..cdc3befb 100644 --- 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 @@ -41,7 +41,7 @@ class BuyersFragment : BaseFragment(Buyer } override fun onCreate(savedInstanceState: Bundle?) { - viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelving_BuyerGet") + viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD)) super.onCreate(savedInstanceState) } @@ -74,7 +74,7 @@ class BuyersFragment : BaseFragment(Buyer when(item){ iconReload.drawable->{ binding.splashProgress.visibility= View.VISIBLE - viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelving_BuyerGet") + viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD)) } } 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 index f3edf3b5..e96092e8 100644 --- 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 @@ -21,7 +21,7 @@ class BuyersViewModel(context: Context) : BaseViewModel() { val buyersList: LiveData get() = _buyersList - fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){ + fun itemShelvingBuyerGet(user:String,password:String){ getQualityUserCase.itemShelvingBuyerGet(user,password).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { 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 index 307617f1..2379a550 100644 --- 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 @@ -47,7 +47,7 @@ class QaualityFragment( override fun getLayoutId(): Int = R.layout.qauality_fragment override fun onCreate(savedInstanceState: Bundle?) { - viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk,"itemShelving_BuyerTask") + viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk) super.onCreate(savedInstanceState) } @@ -81,7 +81,7 @@ class QaualityFragment( override fun onOptionsItemSelected(item: Drawable) { if (item == iconReload){ binding.splashProgress.visibility = View.VISIBLE - viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk,"itemShelving_BuyerTask") + viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk) } } }) @@ -123,7 +123,7 @@ class QaualityFragment( }) response.observe(viewLifecycleOwner, Observer { - viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk,"itemShelving_BuyerTask") + viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk) }) } } 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 index dfe89e08..4515e638 100644 --- 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 @@ -28,7 +28,7 @@ class QaualityViewModel(context: Context) : BaseViewModel() { get() = _response - fun itemShelvingBuyerTask(user:String,password:String,userFk:String,callFunction:String){ + fun itemShelvingBuyerTask(user:String,password:String,userFk:String){ getQualityUserCase.itemShelvingBuyerTask(user,password,userFk).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimFragment.kt index 1b31e342..367b66a9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimFragment.kt @@ -176,7 +176,7 @@ class ClaimFragment( private fun showInputClaim() { customDialogList.setTitle("Inserta el código de reclamación.") - .setOkButton("Finalizar") { + .setOkButton(getString(R.string.end)) { ma.hideKeyboard(customDialogList.getEditText()) 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 deb2cb3a..86d7e76a 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 @@ -158,9 +158,9 @@ class CollectionFragment( setEvents() setToolBar() - if (type == SACADOR && getData(VOZ) != "NO") { + /* if (type == SACADOR && getData(VOZ) != "NO") { setSpeak() - } + }*/ if (collection.tickets.isNotEmpty()) { createCollectionList() @@ -366,7 +366,7 @@ class CollectionFragment( binding.mainToolbar.toolbarSubtitle.text = "0/0" } } else { - customDialog.setTitle("Error").setDescription(it.errorMessage) + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() if (activity != null) requireActivity().onBackPressed() @@ -406,7 +406,7 @@ class CollectionFragment( if (!goBack) { if (it.list.get(0).isError){ - ma.messageWithSound((it.list.get(0).errorMessage),true,true,"Error",true) + ma.messageWithSound((it.list.get(0).errorMessage),true,true,getString(R.string.error),true) }else{ @@ -472,7 +472,7 @@ class CollectionFragment( // if (!goBack) { if (it.isError) { customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage) - .setKoButton("Cerrar") { + .setKoButton(getString(R.string.close)) { scanRequest() customDialog.dismiss() }.show() @@ -510,8 +510,8 @@ class CollectionFragment( if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE if (!goBack2) { if (it.isError) { - customDialog.setTitle("Error").setDescription(it.errorMessage) - .setKoButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setKoButton(getString(R.string.close)) { scanRequest() customDialog.dismiss() }.show() @@ -611,7 +611,7 @@ class CollectionFragment( binding.splashProgress.visibility = View.GONE if (it.isError) { ma.messageWithSound(it.errorMessage, it.isError, false) - /*customDialog.setTitle("Error").setDescription(it.errorMessage) + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ @@ -701,7 +701,7 @@ class CollectionFragment( goBack = false } - /*customDialog.setTitle("Error").setDescription(it.errorMessage) + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ @@ -795,7 +795,7 @@ class CollectionFragment( viewModel.sendChekingPresence( token = getData(TOKEN), - workerId = "19294", + workerId = salePerson, message = message, "sendChekingPresence" ) } @@ -1390,7 +1390,7 @@ class CollectionFragment( "Escanea item para validar".toast(requireContext()) } - }.setKoButton("Cerrar") { + }.setKoButton(getString(R.string.close)) { scanRequest() hideKeyboards() customDialogList.dismiss() @@ -1664,8 +1664,7 @@ class CollectionFragment( itemFk = customDialogList.getValue(), ticketFk = ticketSelected, quantityFk = customDialogList.getValueTwo(), - warehouseFk = getData(WAREHOUSEFK), - callFunction = "collection_addItem" + warehouseFk = getData(WAREHOUSEFK) ) @@ -1673,7 +1672,7 @@ class CollectionFragment( customDialogList.dismiss() } - }.setKoButton("Cerrar") { + }.setKoButton(getString(R.string.close)) { scanRequest() customDialogList.dismiss() }.setHintValue(getString(R.string.Artículo)).setValue("") @@ -1719,8 +1718,7 @@ class CollectionFragment( itemFk = customDialogList.getValue(), ticketFk = ticketSelected, quantityFk = customDialogList.getValueTwo(), - warehouseFk = getData(WAREHOUSEFK), - callFunction = "collection_addItem" + warehouseFk = getData(WAREHOUSEFK) ) scanRequest() customDialogList.dismiss() @@ -2473,7 +2471,7 @@ class CollectionFragment( private fun showErrorMessage(text: String) { customDialog.setTitle("Error al marcar la linea").setDescription(text) - .setKoButton("Cerrar") { + .setKoButton(getString(R.string.close)) { customDialog.dismiss() }.show() } @@ -2531,11 +2529,11 @@ class CollectionFragment( //VOZ override fun onResults(results: Bundle) { super.onResults(results) - Log.i("Speech", "onResults") + //Log.i("Speech", "onResults") val matches = results .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION) if (matches != null) { - Log.i("RESPUESTA", matches[0]) + //Log.i("RESPUESTA", matches[0]) mIsListening = false mSpeechRecognizer!!.cancel() getText(matches[0]) 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 3585e51e..f50815d9 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 @@ -433,7 +433,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() { itemFk: String, quantityFk: String, ticketFk: String, - warehouseFk: String, callFunction: String + warehouseFk: String ) { getSacadorControladorUserCase.collectionAddItem( usuario, @@ -442,15 +442,15 @@ class CollectionViewModel(context: Context) : BaseViewModel() { quantityFk, ticketFk, warehouseFk - ).enqueue(object : Callback { - override fun onFailure(call: Call, t: Throwable) { + ).enqueue(object : Callback { + override fun onFailure(call: Call, t: Throwable) { _responseNew.value = ResponseItemVO( isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) ) } - override fun onResponse(call: Call, response: Response) { + override fun onResponse(call: Call, response: Response) { if (!response.isSuccessful) { _responseNew.value = ResponseItemVO( @@ -462,7 +462,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() { ) } else { _responseNew.value = - ResponseItemVO(isError = false, response = response.body()!!) + ResponseItemVO(isError = false, response = response.message()!!) } @@ -755,7 +755,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() { } - fun getIdFromCode(usuario: String, password: String, code: String, callFunction: String) { + fun getIdFromCode(usuario: String, password: String, code: String) { getSacadorControladorUserCase.getIdFromCode(usuario, password, code) .enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt index d703cfb1..1531c477 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt @@ -68,7 +68,7 @@ class ControladorFragment : password = getData(PASSWORD), sectorFk = getData(SECTORFK), collectionFk = binding.scanInput.text.toString(), - type = ConstAndValues.CONTROLADOR, callFunction = "collection_getTickets" + type = ConstAndValues.CONTROLADOR ) } @@ -86,7 +86,7 @@ class ControladorFragment : binding.splashProgress.visibility = View.GONE if (it.isError) { ma.messageWithSound(it.errorMessage,isError = true, isPlayed = false) - /*customDialog.setTitle("Error").setDescription(it.errorMessage) + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorViewModel.kt index 50ab94a1..ff61bea0 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorViewModel.kt @@ -27,7 +27,7 @@ class ControladorViewModel(context: Context) : BaseViewModel() { get() = _collectionTicketList - fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String,callFunction:String){ + fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String){ getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt index a6131f98..16f66c6a 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt @@ -180,7 +180,7 @@ class ControlVehiculoFragment( // d("la fecha es "+getData("DATENOVEHICLE")) //if (!IsNoVehicleDataToday()){ binding.splashProgress.visibility = VISIBLE - viewModel.workerMachinery_isRegistered(getData(USER),getData(PASSWORD),"workerMachinery_isRegistered") + viewModel.workerMachinery_isRegistered(getData(USER),getData(PASSWORD)) /*}else{ ma.openFragmentPickers() }*/ @@ -321,16 +321,16 @@ class ControlVehiculoFragment( if (it.isError) { ma.messageWithSound(it.errorMessage,true,false) - /*customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ } else { if (it.response == "false") { - customDialog.setTitle("Error") + customDialog.setTitle(getString(R.string.error)) .setDescription("Revisar llamada del registro de vehículos") - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() @@ -340,7 +340,7 @@ class ControlVehiculoFragment( //"Acción registrada correctamente".toast(context) /* customDialog.setTitle("Llamada correcta") .setDescription("Acción registrada satisfactoriamente") - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ ma.openFragmentPickers(true) @@ -358,8 +358,8 @@ class ControlVehiculoFragment( // Log.i("VERDNATURA:","${it.response}") if (it.isError) { ma.messageWithSound(it.errorMessage,true,false) - /*customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ } else { @@ -368,7 +368,7 @@ class ControlVehiculoFragment( setToolBar("OUT") /* customDialog.setTitle("Control de vehículos") .setDescription("SI Tienes coche asignado") - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ if (!tagName.equals(SacadorFragment.TAG)) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt index 2f93ed87..61253013 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt @@ -47,9 +47,9 @@ class ControlVehiculoUsuarioFragment( if (userFk.equals(vUserFK)) { binding.splashProgress.visibility = VISIBLE - viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD),"machine_getWorkerPlate") - viewModel.deviceProduction_getnameDevice(getData(USER),getData(PASSWORD), getData(ANDROID_ID),"deviceProduction_getnameDevice") - viewModel.deviceProductionUser_getWorker(getData(USER),getData(PASSWORD), getData(ANDROID_ID),"deviceProductionUser_getWorker") + viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD)) + viewModel.deviceProduction_getnameDevice(getData(USER),getData(PASSWORD), getData(ANDROID_ID)) + viewModel.deviceProductionUser_getWorker(getData(USER),getData(PASSWORD), getData(ANDROID_ID)) } else { userFk = vUserFK @@ -60,7 +60,7 @@ class ControlVehiculoUsuarioFragment( } binding.userImage.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=${getData(TOKEN)}") - viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD),"machine_getWorkerPlate") + viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD)) binding.nameVehiclecontrol.text = getData(USER) binding.registeredVehiclecontrol.text = "" binding.deviceName.text = "" @@ -88,8 +88,8 @@ class ControlVehiculoUsuarioFragment( binding.splashProgress.visibility = GONE if (it.isError) { ma.messageWithSound(it.errorMessage,true,false) - /*customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ } else { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt index 166c326f..258cd669 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt @@ -94,7 +94,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { }) } - fun workerMachinery_isRegistered(usuario: String, password: String,callFunction:String) { + fun workerMachinery_isRegistered(usuario: String, password: String) { getVehicleControlTimeUserCase.workerMachinery_isRegistered( usuario, password @@ -124,7 +124,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { - fun deviceProduction_getnameDevice(usuario: String, password: String, android_id: String,callFunction:String) { + fun deviceProduction_getnameDevice(usuario: String, password: String, android_id: String) { getVehicleControlTimeUserCase.deviceProduction_getnameDevice( usuario, password, @@ -161,7 +161,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { }) } - fun deviceProductionUser_getWorker(usuario: String, password: String, userFk: String,callFunction:String) { + fun deviceProductionUser_getWorker(usuario: String, password: String, userFk: String) { getVehicleControlTimeUserCase.deviceProductionUser_getWorker( usuario, password, @@ -198,7 +198,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { - fun machine_getWorkerPlate(usuario: String, password: String,callFunction:String) { + fun machine_getWorkerPlate(usuario: String, password: String) { getVehicleControlTimeUserCase.machine_getWorkerPlate( usuario, password diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleFragment.kt index e418e345..73485d6f 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleFragment.kt @@ -101,7 +101,7 @@ class DayOfSaleFragment( private fun getItemsSaleDate(vShelvingFK: String) { binding.splashProgress.visibility = View.VISIBLE - viewModel.itemShelving_getSaleDate(getData(USER), getData(PASSWORD),vShelvingFK,"itemShelving_getSaleDate") + viewModel.itemShelving_getSaleDate(getData(USER), getData(PASSWORD),vShelvingFK) } @@ -118,18 +118,18 @@ class DayOfSaleFragment( binding.itemexpeditionstateRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) if (it.list.isEmpty()){ - customDialog.setTitle("Sin resultados") + customDialog.setTitle(getString(R.string.noResults)) .setDescription("No hay nada vendido para el carro escaneado. ") - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() }else{ if (it.list.get(0).isError){ ma.messageWithSound(it.list.get(0).errorMessage,it.list.get(0).isError,isPlayed = false) - /*customDialog.setTitle("Error") + /*customDialog.setTitle(getString(R.string.error)) .setDescription(it.list.get(0).errorMessage) - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ } @@ -142,13 +142,13 @@ class DayOfSaleFragment( binding.splashProgress.visibility = View.GONE ma.messageWithSound(it.errorMessage,true,false) - /*customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton(getString(R.string.close)){ customDialog.dismiss() }.show()*/ }else{ - customDialog.setTitle("Información").setDescription("Parking ok").setOkButton("Cerrar") { + customDialog.setTitle("Información").setDescription("Parking ok").setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() @@ -164,7 +164,7 @@ class DayOfSaleFragment( private fun showParking() { customDialogList.setTitle("Escanea el parking") - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { ma.hideKeyboard(customDialogList.getEditText()) @@ -196,8 +196,7 @@ class DayOfSaleFragment( usuario = getData(USER), password = getData(PASSWORD), parking = parking, - scanItem = itemScan, - callFunction="shelvingPark") + scanItem = itemScan) customDialogList.dismiss() } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt index 314b2c38..681f6b60 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt @@ -32,7 +32,7 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel() { val loadItemShelvingSaleDateList = Transformations.map(_itemShelvingSaleDateList) { Event(it) } - fun itemShelving_getSaleDate(usuario:String,password:String,vShelvingFK: String,callFunction:String){ + fun itemShelving_getSaleDate(usuario:String,password:String,vShelvingFK: String){ GetDayOfSaleUSerCase.itemShelving_getSaleDate(usuario,password,vShelvingFK).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { @@ -142,7 +142,7 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel() { }) }*/ - fun parking(usuario: String,password: String,scanItem: String,parking:String,callFunction:String){ + fun parking(usuario: String,password: String,scanItem: String,parking:String){ GetDayOfSaleUSerCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object : Callback { 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 index 1d4eaca8..0e27e18d 100644 --- 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 @@ -188,8 +188,7 @@ class FaltasFragment : getData(USER), getData(PASSWORD), item.itemFk, - getData(WAREHOUSEFK), - "faultsReview_isChecked" + getData(WAREHOUSEFK) ) changeOfflineValue(item) } 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 index b7971d5a..f0459e58 100644 --- 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 @@ -80,7 +80,7 @@ class FaltasViewModel(context: Context) : BaseViewModel() { }) } - fun faultsReview_isChecked(user:String,password:String,itemFk:String,warehouseFk:String,callFunction:String){ + fun faultsReview_isChecked(user:String,password:String,itemFk:String,warehouseFk:String){ getInventaryUserCase.faultsReview_isChecked(user,password,itemFk,warehouseFk).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt index 44c5c1f6..f8cff1eb 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt @@ -50,7 +50,7 @@ class HistoricoArticuloFragment( // customDialog = CustomDialog(requireContext()) ma.hideBottomNavigation(View.GONE) filter = "all" - viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK),"itemDiary") + viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK)) binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk setToolBar() setEvents() @@ -111,7 +111,7 @@ class HistoricoArticuloFragment( private fun viewModelwithFilter(keyfilter: String) { filter = keyfilter binding.splashProgress.visibility = View.VISIBLE - viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK),"itemDiary") + viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK)) } private fun setEvents() { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloViewModel.kt index b03aa2d8..2fb75cd5 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloViewModel.kt @@ -28,7 +28,7 @@ class HistoricoArticuloViewModel(context: Context) : BaseViewModel() { val loadHistoricoList = Transformations.map(_historicoList) { Event(it) } - fun itemDiary(usuario:String,password:String,itemFk:String,vWarehouseFk:String,callFunction:String){ + fun itemDiary(usuario:String,password:String,itemFk:String,vWarehouseFk:String){ getItemCardUserCase.itemDiary(usuario,password,itemFk,vWarehouseFk).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt index c9e69f85..7836683f 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt @@ -72,7 +72,7 @@ class itemShelvingLogFragment( private fun itemShelvingLog_get(vShelvingFK: String) { binding.splashProgress.visibility = View.VISIBLE - viewModel.itemShelvingLog_get(getData(USER), getData(PASSWORD),vShelvingFK,"itemShelvingLog_get") + viewModel.itemShelvingLog_get(getData(USER), getData(PASSWORD),vShelvingFK) } @@ -89,17 +89,17 @@ class itemShelvingLogFragment( setToolBar(getString(R.string.itemShelvingLog)+":"+itemScan) if (it.list.isEmpty()){ - customDialog.setTitle("Sin resultados") - .setDescription("No se ha podido obtener datos de la etiqueta escaneada. ") - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.noResults)) + .setDescription(getString(R.string.noDataLabelScanned)) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() }else{ if (it.list.get(0).isError){ - customDialog.setTitle("Error") + customDialog.setTitle(getString(R.string.error)) .setDescription(it.list.get(0).errorMessage) - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt index cc53444f..22a3b8d7 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt @@ -33,7 +33,7 @@ class itemShelvingLogViewModel(context: Context) : BaseViewModel() { - fun itemShelvingLog_get(usuario:String,password:String,vShelvingFK: String,callFunction:String){ + fun itemShelvingLog_get(usuario:String,password:String,vShelvingFK: String){ itemShelvingLogUSerCase.itemShelvingLog_get(usuario,password,vShelvingFK).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogFragment.kt index 7306c1e7..2ec33a05 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogFragment.kt @@ -75,7 +75,7 @@ class shelvingLogFragment( private fun shelvingLog_get(vShelvingFK: String) { binding.splashProgress.visibility = View.VISIBLE - viewModel.shelvingLog_get(getData(USER), getData(PASSWORD),vShelvingFK,"shelvingLog_get") + viewModel.shelvingLog_get(getData(USER), getData(PASSWORD),vShelvingFK) } @@ -92,17 +92,17 @@ class shelvingLogFragment( setToolBar(getString(R.string.shelvingLog)+":"+itemScan) if (it.list.isEmpty()){ - customDialog.setTitle("Sin resultados") - .setDescription("No se ha podido obtener datos de la etiqueta escaneada. ") - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.noResults)) + .setDescription(getString(R.string.noDataLabelScanned)) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() }else{ if (it.list.get(0).isError){ - customDialog.setTitle("Error") + customDialog.setTitle(getString(R.string.error)) .setDescription(it.list.get(0).errorMessage) - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogViewModel.kt index b95a3e6f..86852655 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogViewModel.kt @@ -26,7 +26,7 @@ class shelvingLogViewModel(context: Context) : BaseViewModel() { val loadShelvingLogList = Transformations.map(_itemShelvingLogList) { Event(it) } - fun shelvingLog_get(usuario:String,password:String,vShelvingFK: String,callFunction:String){ + fun shelvingLog_get(usuario:String,password:String,vShelvingFK: String){ itemShelvingLogUSerCase.shelvingLog_get(usuario,password,vShelvingFK).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt index fe31d3da..c73e921b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt @@ -36,7 +36,7 @@ class HistoricoVehiculoFragment ( ma.hideBottomNavigation(View.GONE) - viewModel.machineWorker_getHistorical(getData(USER),getData(PASSWORD),numberPlate,"machineWorker_getHistorical") + viewModel.machineWorker_getHistorical(getData(USER),getData(PASSWORD),numberPlate) binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclediary) setEvents() super.init() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt index e126e6f4..f40f125d 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt @@ -26,7 +26,7 @@ class HistoricoVehiculoViewModel (context: Context) : BaseViewModel() { val loadHistoricoVehiculoList = Transformations.map(_historicovehiculoList) { Event(it) } - fun machineWorker_getHistorical(usuario:String,password:String,plateNumber:String,callFunction:String){ + fun machineWorker_getHistorical(usuario:String,password:String,plateNumber:String){ GetVehicleControlTimeUserCase.machineWorker_getHistorical(usuario,password,plateNumber).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt index fbfae438..1fd30d59 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt @@ -60,7 +60,7 @@ class InventaryFragment : BaseFragment> { override fun onFailure(call: Call>, t: Throwable) { @@ -121,7 +121,7 @@ class InventaryViewModel(context: Context) : BaseViewModel() { }) }*/ - fun getInventory(user:String,password:String,buyerFk:String,warehouseFk: String,callFunction:String){ + fun getInventory(user:String,password:String,buyerFk:String,warehouseFk: String){ // getInventaryUserCase.itemShelvingRadar(user,password,buyerFk).enqueue(object : getInventaryUserCase.itemShelvingRadarFilterBuyer(user,password,buyerFk,warehouseFk).enqueue(object : Callback> { @@ -259,7 +259,7 @@ class InventaryViewModel(context: Context) : BaseViewModel() { }) } - fun worker_getFromHasMistake(usuario:String,password:String,departmentFk:String,callFunction:String){ + fun worker_getFromHasMistake(usuario:String,password:String,departmentFk:String){ getWorkerMistakeUserCase.worker_getFromHasMistake(usuario,password,departmentFk).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt index b1f2328b..4df4d989 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt @@ -8,7 +8,6 @@ import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.net.Uri import android.provider.Settings -import android.util.Log import android.view.KeyEvent import android.view.View import androidx.lifecycle.Observer @@ -42,8 +41,8 @@ class LoginFragment : BaseFragment(LoginVi binding.splashProgress.visibility = View.VISIBLE viewModel.loginSalix( user = binding.edittextUsername.text.toString(), - password = binding.edittextPassword.text.toString(), - callFunction = "login de Salix" + password = binding.edittextPassword.text.toString() + ) @@ -112,8 +111,8 @@ class LoginFragment : BaseFragment(LoginVi if (it.isError) { binding.splashProgress.visibility = View.GONE - customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() } else { @@ -130,9 +129,9 @@ class LoginFragment : BaseFragment(LoginVi ) { val openURL = Intent(Intent.ACTION_VIEW) openURL.data = - // sergio REdmine Tarea #3730 - //Uri.parse("https://app.verdnatura.es/bin/vn-picking.apk") - Uri.parse(it.url) + // sergio REdmine Tarea #3730 + //Uri.parse("https://app.verdnatura.es/bin/vn-picking.apk") + Uri.parse(it.url) //Log.d("VERDNATURA::","Datos"+ openURL.data) startActivity(openURL) @@ -156,15 +155,16 @@ class LoginFragment : BaseFragment(LoginVi if (it.isError) { binding.splashProgress.visibility = View.GONE - customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() } else { if (it.vIsAuthorized == "0") { - customDialog.setTitle("Error").setDescription(it.vMessage!!) - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)) + .setDescription(it.vMessage!!) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() binding.splashProgress.visibility = View.GONE // goToMain() @@ -174,8 +174,8 @@ class LoginFragment : BaseFragment(LoginVi //sergio: se añade el log viewModel.worker_getId( binding.edittextUsername.text.toString(), - binding.edittextPassword.text.toString(), - callFunction = "worker_getId" + binding.edittextPassword.text.toString() + ) viewModel.worker_getSector( @@ -217,7 +217,7 @@ class LoginFragment : BaseFragment(LoginVi if (it.vIsAuthorized == "1" && !it.vMessage.isNullOrEmpty()) { binding.splashProgress.visibility = View.GONE customDialog.setTitle("Mensaje").setDescription(it.vMessage) - .setOkButton("Cerrar") { + .setOkButton(getString(R.string.close)) { customDialog.dismiss() /* binding.splashProgress.visibility = View.VISIBLE loginSalix( @@ -251,7 +251,7 @@ class LoginFragment : BaseFragment(LoginVi devicelogresponse.observe(viewLifecycleOwner) { if (it.isError) { - customDialog.setTitle("Error") + customDialog.setTitle(getString(R.string.error)) .setDescription(it.errorMessage) .setOkButton( "Aceptar" @@ -268,7 +268,7 @@ class LoginFragment : BaseFragment(LoginVi if (it.isError) { removeSector() - Log.d("VERDNATURA::","ERROR") + //Log.d("VERDNATURA::",getString(R.string.error)) } else { if (it.id != 0) { saveDataInt("sectorFk", it.id) @@ -305,7 +305,7 @@ class LoginFragment : BaseFragment(LoginVi if (it.isError) { binding.splashProgress.visibility = View.GONE saveTokenPref("") - customDialog.setTitle("Error") + customDialog.setTitle(getString(R.string.error)) // .setDescription(it.errorMessage + ". Puedes continuar pero algunas funcionalidades no estarán disponibles.") .setDescription(it.errorMessage) .setOkButton( @@ -320,7 +320,7 @@ class LoginFragment : BaseFragment(LoginVi viewModel.device_checkLogin( binding.edittextUsername.text.toString(), binding.edittextPassword.text.toString(), - getData(ANDROID_ID), callFunction = "device_checkLogin" + getData(ANDROID_ID) ) } @@ -384,7 +384,7 @@ class LoginFragment : BaseFragment(LoginVi viewModel.checkVersion( user = binding.edittextUsername.text.toString(), password = binding.edittextPassword.text.toString(), - nameApp = "warehouse", "getVersion", + nameApp = getString(R.string.nameApp) ) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt index b119ee92..dc5c3d5a 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt @@ -76,7 +76,7 @@ class LoginViewModel(context: Context) : BaseViewModel() val loadWorkerPrintList = Transformations.map(_workerPrintList) { Event(it) } - fun loginSalix(user: String, password: String,callFunction:String) + fun loginSalix(user: String, password: String) { getLoginUserCase.salixLogin(user, password).enqueue(object : Callback { @@ -127,7 +127,7 @@ class LoginViewModel(context: Context) : BaseViewModel() }) } - fun device_checkLogin(user: String, password: String, android_id: String,callFunction:String) + fun device_checkLogin(user: String, password: String, android_id: String) { getLoginUserCase.device_checkLogin(user, password, android_id) @@ -189,7 +189,7 @@ class LoginViewModel(context: Context) : BaseViewModel() - fun worker_getId(user: String, password: String,callFunction: String) + fun worker_getId(user: String, password: String) { getLoginUserCase.worker_getId(user, password) .enqueue(object : Callback @@ -271,7 +271,7 @@ class LoginViewModel(context: Context) : BaseViewModel() } - fun checkVersion(user: String, password: String, nameApp: String,callFunction: String) + fun checkVersion(user: String, password: String, nameApp: String) { getLoginUserCase.checkVersion(user, password, nameApp) .enqueue(object : Callback @@ -340,7 +340,7 @@ class LoginViewModel(context: Context) : BaseViewModel() val workerId: NodeJsService.SmartTagNode? *//* if (response.isSuccessful()){ - Log.i("VERDNATURA::","OK") + //Log.i("VERDNATURA::","OK") } if (!response.errorBody().toString().isEmpty()){ @@ -372,7 +372,7 @@ class LoginViewModel(context: Context) : BaseViewModel() val workerId = NodeJsService.SmartTagNode(isError = true, errorMessage = t.message!!) - Log.i("VERDNATURA::","el error nodejs es "+t.message+"--"+t.cause.toString()+"--"+t.stackTrace.toString()) + //Log.i("VERDNATURA::","el error nodejs es "+t.message+"--"+t.cause.toString()+"--"+t.stackTrace.toString()) _nodejs.value = workerId } 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 7c0df8d5..9258f440 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 @@ -330,7 +330,9 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL override fun onPasillerosItemClickListener(item: PasillerosItemVO, entryPoint: String) { - + /* d("VERDNATURA::","El title es "+item.title) + d("VERDNATURA::","El titleTOsHOW es "+item.titleToShow) + d("VERDNATURA::","El entryPoint es "+entryPoint)*/ when (item.title) { "Asociar Sacador SmartTags" -> { @@ -476,7 +478,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL "Llenado buffer" -> { addFragmentOnTop(BufferFragment.newInstance(item.title)) } - "Acumulación buffer" -> { + getString(R.string.bufferaccumulate).toString()-> { addFragmentOnTop(BufferFragment.newInstance(item.title)) } "Desactivado buffer" -> { @@ -538,7 +540,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL } else { - customDialog.setTitle("Cerrar sesión") + customDialog.setTitle(getString(R.string.closeSession)) .setDescription("¿Estás seguro de cerrar la sesión?").setOkButton("Salir") { customDialog.dismiss() finish() @@ -656,7 +658,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL message: String, isError: Boolean, isPlayed: Boolean?, - titleWithError: String = "Error", + titleWithError: String = getString(R.string.error), isToasted: Boolean? = false ) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt index 074cbfa0..4c7c9608 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt @@ -63,7 +63,7 @@ class ExpeditionPalletDetailFragment( setToolBar() setEvents() viewModel.expeditionPallet_List(getData(USER), - getData(PASSWORD),itemPallet!!.Pallet,"expeditionPallet_View") + getData(PASSWORD),itemPallet!!.Pallet) super.init() } @@ -96,7 +96,7 @@ class ExpeditionPalletDetailFragment( if (item == iconReload){ binding.splashProgress.visibility = View.VISIBLE viewModel.expeditionPallet_List(getData(USER), - getData(PASSWORD),itemPallet!!.Pallet,"expeditionPallet_View") + getData(PASSWORD),itemPallet!!.Pallet) }else if(item == iconEditar){ onPalletClickListener!!.onPalletClickListener(itemExpeditionTruckVO!!,itemPallet!!) }else if(item == iconBorrar){ @@ -114,8 +114,7 @@ class ExpeditionPalletDetailFragment( getData(USER), getData(PASSWORD), itemPallet!!.Pallet, - getData(SECTORFK), - "expeditionPallet_PrintSet" + getData(SECTORFK) ) }else{ ma.messageWithSound("Falta seleccionar impresora",isError = true,true,"Error al imprimir",false) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt index d884051f..cd8b76d8 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt @@ -34,7 +34,7 @@ class ExpeditionPalletDetailViewModel(context: Context): BaseViewModel() { - fun expeditionPallet_List(usuario:String,password:String,vPalletFk:String,callFunction:String){ + fun expeditionPallet_List(usuario:String,password:String,vPalletFk:String){ getPaletizadoresUserCase.expeditionPalletView(usuario,password,vPalletFk).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { @@ -78,7 +78,7 @@ class ExpeditionPalletDetailViewModel(context: Context): BaseViewModel() { usuario: String, password: String, vPalletFk: String, - vSectorFk: String,callFunction:String){ + vSectorFk: String){ getPaletizadoresUserCase.expeditionPalletPrintSet(usuario,password,vPalletFk,vSectorFk).enqueue(object : Callback{ override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt index 587d60c4..0f398204 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt @@ -78,7 +78,7 @@ class ExpeditionPalletFragment( setToolBar() setEvents() viewModel.expeditionPallet_List(getData(USER), - getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List") + getData(PASSWORD),itemExpeditionTruckVO!!.truckFk) ////Log.i("VERDNATURA:","4-listamos listado de pallets para la expedicion") super.init() } @@ -101,7 +101,7 @@ class ExpeditionPalletFragment( if (item == iconReload){ binding.splashProgress.visibility = View.VISIBLE viewModel.expeditionPallet_List(getData(USER), - getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List") + getData(PASSWORD),itemExpeditionTruckVO!!.truckFk) }else if(item == iconPlus){ expeditionScanAdd() } @@ -139,7 +139,7 @@ class ExpeditionPalletFragment( responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer { if (it.isError){ ma.messageWithSound(it.errorMessage,true,false) - /* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ + /* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton(getString(R.string.close)){ customDialog.dismiss() }.show()*/ }else{ @@ -174,7 +174,7 @@ class ExpeditionPalletFragment( private fun expeditionScanAdd(){ binding.splashProgress.visibility = View.VISIBLE viewModel.expeditionScanAdd(getData(USER), - getData(PASSWORD),vPalletFk = "0",vTruckFk = itemExpeditionTruckVO!!.truckFk,"expeditionScan_Add") + getData(PASSWORD),vPalletFk = "0",vTruckFk = itemExpeditionTruckVO!!.truckFk) } private fun showScanExpeditions(it:ItemScanList){ @@ -205,11 +205,11 @@ class ExpeditionPalletFragment( customDialogList.dismiss() - }.setKoButton("Cerrar"){ + }.setKoButton(getString(R.string.close)){ ma.hideKeyboard(customDialogList.getEditText()) binding.splashProgress.visibility = View.VISIBLE viewModel.expeditionPallet_List(getData(USER), - getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List") + getData(PASSWORD),itemExpeditionTruckVO!!.truckFk) listExpeditions = ArrayList() customDialogList.dismiss() }.setValue("").show() @@ -229,7 +229,7 @@ class ExpeditionPalletFragment( getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue()) ////Log.i("VERDNATURA:"," palletizando ${it.list.get(0).palletFk} expedi: ${customDialogList.getValue()}") viewModel.checkRouteExpeditionScanPut(getData(USER), - getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue(),"expedition_checkRoute") + getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue()) }else{ if (mperror != null) mperror!!.start() } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletViewModel.kt index 06eea511..7cb183d9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletViewModel.kt @@ -42,7 +42,7 @@ class ExpeditionPalletViewModel (context: Context) : BaseViewModel() { - fun expeditionPallet_List(usuario:String,password:String,vTruckFk:String,callFunction:String){ + fun expeditionPallet_List(usuario:String,password:String,vTruckFk:String){ getPaletizadoresUserCase.expeditionPallet_List(usuario,password,vTruckFk).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { @@ -67,7 +67,7 @@ class ExpeditionPalletViewModel (context: Context) : BaseViewModel() { }) } - fun expeditionScanAdd(usuario:String,password:String,vPalletFk:String,vTruckFk:String,callFunction:String){ + fun expeditionScanAdd(usuario:String,password:String,vPalletFk:String,vTruckFk:String){ getPaletizadoresUserCase.expeditionScanAdd(usuario,password,vPalletFk,vTruckFk).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { @@ -107,7 +107,7 @@ class ExpeditionPalletViewModel (context: Context) : BaseViewModel() { }) } - fun checkRouteExpeditionScanPut(usuario:String,password:String,vPalletFk:String,vExpeditionFk:String,callFunction:String){ + fun checkRouteExpeditionScanPut(usuario:String,password:String,vPalletFk:String,vExpeditionFk:String){ getPaletizadoresUserCase.checkRouteExpeditionScanPut(usuario,password,vPalletFk,vExpeditionFk).enqueue(object : Callback{ override fun onFailure(call: Call, t: Throwable) { _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt index 99f169c7..9969ba54 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt @@ -215,7 +215,7 @@ class ExpeditionScanFragment ( customDialogList.dismiss() - }.setKoButton("Cerrar"){ + }.setKoButton(getString(R.string.close)){ ma.hideKeyboard(customDialogList.getEditText()) listExpeditions = ArrayList() customDialogList.dismiss() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt index b5e4e6aa..338b2d9c 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt @@ -45,7 +45,7 @@ class ExpeditionScanSorterFragment( private fun expeditionscan(ExpeditionScan: String) { binding.splashProgress.visibility = VISIBLE - viewModel.expedition_scan(getData(USER),getData(PASSWORD), ExpeditionScan,"expedition_scan") + viewModel.expedition_scan(getData(USER),getData(PASSWORD), ExpeditionScan) itemScaned = ExpeditionScan } @@ -87,7 +87,7 @@ class ExpeditionScanSorterFragment( private fun showExpeditionScan() { customDialogList.setTitle("Escanea expediciones que no han pasado por el Sorter") - .setOkButton("Finalizar") { + .setOkButton(getString(R.string.end)) { ma.hideKeyboard(customDialogList.getEditText()) customDialogList.dismiss() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt index 5a32f70b..3096c5b9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt @@ -22,7 +22,7 @@ class ExpeditionScanSorterViewModel(context: Context) : BaseViewModel() { get() = _responsescan - fun expedition_scan(usuario:String,password:String,vExpeditionId:String,callFunction:String){ + fun expedition_scan(usuario:String,password:String,vExpeditionId:String){ GetPaletizadoresUserCase.expedition_scan(usuario,password,vExpeditionId).enqueue(object : Callback{ override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt index 4be668fb..df9e6b3b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt @@ -62,7 +62,7 @@ class ExpeditionStateFragment( private fun getExpedtionState(expeditionFk: String) { binding.splashProgress.visibility = View.VISIBLE - viewModel.expedition_getStateJSON(expeditionFk, getData(USER), getData(PASSWORD),"expedition_getState") + viewModel.expedition_getStateJSON(expeditionFk, getData(USER), getData(PASSWORD)) } @@ -73,7 +73,7 @@ class ExpeditionStateFragment( if (it.isError) { binding.itemcardLayout.visibility = View.GONE binding.mainToolbar.toolbarTitle.text = title - ma.messageWithSound("No se ha podido obtener el estado de la expedición escaneada.",true,false,"Sin resultados") + ma.messageWithSound(getString(R.string.noDataLabelScanned),true,false,getString(R.string.noResults)) } else { setItemExpeditionState(it) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateViewModel.kt index 2b00ef92..eee4c19e 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateViewModel.kt @@ -97,7 +97,7 @@ class ExpeditionStateViewModel(context: Context) : BaseViewModel() { }) }*/ - fun expedition_getStateJSON(expeditionFk: String, user: String, password: String,callFunction:String){ + fun expedition_getStateJSON(expeditionFk: String, user: String, password: String){ GetPaletizadoresUserCase.expedition_getStateJSON(user, password, expeditionFk) .enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt index 90b78cb4..0381efe9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt @@ -51,7 +51,7 @@ class ExpeditionTruckListFragment : BaseFragment viewModel.expeditionTruckList(getData(USER), - getData(PASSWORD),"expeditionTruck_List") + getData(PASSWORD)) }) } } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListViewModel.kt index 6e9c00b4..42dce42e 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListViewModel.kt @@ -30,7 +30,7 @@ class ExpeditionTruckListViewModel(context: Context) : BaseViewModel() { - fun expeditionTruckList(usuario:String,password:String,callFunction:String){ + fun expeditionTruckList(usuario:String,password:String){ getPaletizadoresUserCase.expeditionTruckList(usuario,password).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt index 64e2ab33..8205c18b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt @@ -72,7 +72,7 @@ class ParkingFragment (var menuOrigin:String): BaseFragment { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/parkingSale/fragment/ParkingSaleFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/parkingSale/fragment/ParkingSaleFragment.kt index b836745d..736c6c47 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/parkingSale/fragment/ParkingSaleFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/parkingSale/fragment/ParkingSaleFragment.kt @@ -67,7 +67,7 @@ class ParkingSaleFragment : BaseFragment { @@ -63,7 +63,7 @@ class ParkingSaleViewModel(context: Context) : BaseViewModel() { } }) } - /* fun saleParking_add(usuario: String, password: String, sales:List,parking: String,callFunction:String) + /* fun saleParking_add(usuario: String, password: String, sales:List,parking: String) { getUbicadorUserCase.saleParking_add(usuario, password, sales, parking) .enqueue(object : Callback 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 39b98df2..dbb8e787 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 @@ -238,6 +238,7 @@ class PasilleroViewModel : BaseViewModel() { ) ) + _pasillerositem.add( PasillerosItemVO( 31, diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/precontrol/PreControladorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/precontrol/PreControladorFragment.kt index 53e1a35d..dd0bfc75 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/precontrol/PreControladorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/precontrol/PreControladorFragment.kt @@ -69,7 +69,7 @@ class PreControladorFragment: BaseFragment get() = _collectionTicketList - fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String,callFunction:String){ + fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String){ getPreControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { 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 969cd7f4..2207cef8 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 @@ -213,7 +213,7 @@ class EndSacadorFragment( if (!goBack) { if (it.isError) { ma.messageWithSound(it.errorMessage, true, false) - /* customDialog.setTitle("Error").setDescription(it.errorMessage) + /* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ @@ -241,7 +241,7 @@ class EndSacadorFragment( binding.splashProgress.visibility = GONE if (it.isError) { ma.messageWithSound(it.errorMessage, true, false) - /* customDialog.setTitle("Error").setDescription(it.errorMessage) + /* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ @@ -373,8 +373,8 @@ class EndSacadorFragment( binding.splashProgress.visibility = View.GONE if (!goBack2) { if (it.isError) { - customDialog.setTitle("Error").setDescription(it.errorMessage) - .setKoButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setKoButton(getString(R.string.close)) { scanRequest() customDialog.dismiss() }.show() @@ -542,7 +542,7 @@ class EndSacadorFragment( } private fun searchTicket(ticketFk: String) { - Log.i(TAG, "Escaneamos ticket en previa" + ticketFk) + //Log.i(TAG, "Escaneamos ticket en previa" + ticketFk) ticket = ticketFk @@ -898,7 +898,7 @@ class EndSacadorFragment( viewModel.getIdFromCode( usuario = getData(USER), password = getData(PASSWORD), - code = customDialogList.getValueTwo(), "barcodeToItem" + code = customDialogList.getValueTwo() ) customDialogList.dismiss() } @@ -909,7 +909,7 @@ class EndSacadorFragment( } - }.setKoButton("Cerrar") { + }.setKoButton(getString(R.string.close)) { scanRequest() hideKeyboards() customDialogList.dismiss() @@ -945,7 +945,7 @@ class EndSacadorFragment( viewModel.getIdFromCode( usuario = getData(USER), password = getData(PASSWORD), - code = customDialogList.getValueTwo(), "barcodeToItem" + code = customDialogList.getValueTwo() ) customDialogList.dismiss() } @@ -1219,7 +1219,7 @@ class EndSacadorFragment( private fun showErrorMessage(text: String) { customDialog.setTitle("Error al marcar la linea").setDescription(text) - .setKoButton("Cerrar") { + .setKoButton(getString(R.string.close)) { customDialog.dismiss() }.show() } 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 32b04af8..b3feacc0 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 @@ -51,7 +51,7 @@ class InitPreSacadorFragment ( binding.mainToolbar.toolbarTitle.text = getString(R.string.getcollection) setToolBar() setEvents() - viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),"sectorCollection_get") + viewModel.sectorCollection_get(getData(USER),getData(PASSWORD)) super.init() @@ -104,7 +104,7 @@ class InitPreSacadorFragment ( private fun setEvents() { binding.sacadorSwipe.setOnRefreshListener { - viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),"sectorCollection_get") + viewModel.sectorCollection_get(getData(USER),getData(PASSWORD)) binding.sacadorSwipe.isRefreshing = false } } @@ -143,7 +143,7 @@ class InitPreSacadorFragment ( } else { //if (goBack) - viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),getData(SECTORFK)) + viewModel.sectorCollection_get(getData(USER),getData(PASSWORD)) } goBack = false //sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta. diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt index 570cb5f3..5d7fef34 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt @@ -178,7 +178,7 @@ class PreSacadorFragment : responseSalixMessage.observe(viewLifecycleOwner, Observer { if (it.isError) { ma.messageWithSound(it.errorMessage,true,false) - /* customDialog.setTitle("Error").setDescription(it.errorMessage) + /* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ @@ -200,7 +200,7 @@ class PreSacadorFragment : binding.splashProgress.visibility = GONE if (it.isError) { ma.messageWithSound(it.errorMessage,true,false) - /* customDialog.setTitle("Error").setDescription(it.errorMessage) + /* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ @@ -249,8 +249,8 @@ class PreSacadorFragment : binding.splashProgress.visibility = View.GONE if (!goBack2) { if (it.isError) { - customDialog.setTitle("Error").setDescription(it.errorMessage) - .setKoButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setKoButton(getString(R.string.close)) { scanRequest() customDialog.dismiss() }.show() @@ -392,7 +392,7 @@ class PreSacadorFragment : } //CREATE LIST private fun searchTicket(ticketFk: String) { - Log.i(TAG, "Escaneamos ticket en previa") + //Log.i(TAG, "Escaneamos ticket en previa") ticket = ticketFk binding.splashProgress.visibility = View.VISIBLE @@ -635,7 +635,7 @@ class PreSacadorFragment : viewModel.saleTrackingDel( usuario =getData(USER), password = getData(PASSWORD), - saleFk = sales[position].idMovimiento, "saleTracking_del" + saleFk = sales[position].idMovimiento ) setTotalLines() scanRequest() @@ -706,7 +706,7 @@ class PreSacadorFragment : viewModel.getIdFromCode( usuario = getData(USER), password = getData(PASSWORD), - code = customDialogList.getValueTwo(), "barcodeToItem" + code = customDialogList.getValueTwo() ) customDialogList.dismiss() @@ -718,7 +718,7 @@ class PreSacadorFragment : } - }.setKoButton("Cerrar") { + }.setKoButton(getString(R.string.close)) { scanRequest() hideKeyboards() customDialogList.dismiss() @@ -754,7 +754,7 @@ class PreSacadorFragment : viewModel.getIdFromCode( usuario = getData(USER), password = getData(PASSWORD), - code = customDialogList.getValueTwo(), "barcodeToItem" + code = customDialogList.getValueTwo() ) customDialogList.dismiss() } @@ -1010,7 +1010,7 @@ class PreSacadorFragment : private fun showErrorMessage(text: String) { customDialog.setTitle("Error al marcar la linea").setDescription(text) - .setKoButton("Cerrar") { + .setKoButton(getString(R.string.close)) { customDialog.dismiss() }.show() } 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 e21340ce..d45dbd6a 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 @@ -197,7 +197,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() { } - /* fun saleParking_add(usuario: String, password: String, sales:List,parking: String,callFunction:String) + /* fun saleParking_add(usuario: String, password: String, sales:List,parking: String) { getUbicadorUserCase.saleParking_add(usuario, password, sales, parking) .enqueue(object : Callback @@ -358,7 +358,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() { }) } - fun getIdFromCode(usuario: String, password: String, code: String, callFunction: String) { + fun getIdFromCode(usuario: String, password: String, code: String) { getSacadorControladorUserCase.getIdFromCode(usuario, password, code) .enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { @@ -386,7 +386,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() { }) } - fun saleTrackingDel(usuario: String, password: String, saleFk: String, callFunction: String) { + fun saleTrackingDel(usuario: String, password: String, saleFk: String) { getSacadorControladorUserCase.saleTrackingDel(usuario, password, saleFk) .enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { @@ -567,7 +567,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() { } - fun sectorCollection_get(usuario: String, password: String, callFunction: String) { + fun sectorCollection_get(usuario: String, password: String) { getPreSacadorUseCase.sectorCollection_get(usuario, password).enqueue(object : Callback> { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt index 05b9fae1..c2492e8f 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt @@ -62,7 +62,7 @@ class QrFragment( goBack = false if (!binding.scanInput.text.isNullOrEmpty()) { binding.splashProgress.visibility = View.VISIBLE - viewModel.qr_getCall(getData(USER), getData(PASSWORD), binding.scanInput.text.toString(),"qr_getCall") + viewModel.qr_getCall(getData(USER), getData(PASSWORD), binding.scanInput.text.toString()) itemscaned = binding.scanInput.text.toString() } @@ -84,7 +84,7 @@ class QrFragment( // getMessageFromJSON(it.errorMessage) ma.messageWithSound(it.errorMessage+ " "+itemscaned,true,false) - /*customDialog.setTitle("Error").setDescription( it.errorMessage+ " "+itemscaned) + /*customDialog.setTitle(getString(R.string.error)).setDescription( it.errorMessage+ " "+itemscaned) .setOkButton("Aceptar") { customDialog.dismiss() }.show()*/ diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragmentViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragmentViewModel.kt index d0645939..995c15ee 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragmentViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragmentViewModel.kt @@ -25,7 +25,7 @@ class QrFragmentViewModel(context: Context) : BaseViewModel() { get() = _qrresponse - fun qr_getCall(user: String, password: String, vStatement: String,callFunction:String){ + fun qr_getCall(user: String, password: String, vStatement: String){ GetQrReaderUserCase.qr_getCall(user, password, vStatement) .enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { 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 index 8c008be6..5f78bbf4 100644 --- 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 @@ -113,10 +113,10 @@ class ReposicionFragment : BaseFragment 0) { viewModel.itemPlacementSupplyCloseOrder( @@ -193,8 +193,8 @@ class ReposicionFragment : BaseFragment { override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.kt index 9f6c1f27..662061a8 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.kt @@ -31,8 +31,8 @@ class SacadorFragment : private lateinit var customDialog: CustomDialog private var collectionsList: ArrayList = ArrayList() private var adapter: CollectionAdapter? = null - private var resultTagMode:String? = "" - private var getCollections=false + private var resultTagMode: String? = "" + private var getCollections = false companion object { @@ -49,6 +49,8 @@ class SacadorFragment : override fun init() { + //viewModel.smartTagInsertTicket("571974") + customDialog = CustomDialog(requireContext()) binding.splashProgress.visibility = View.GONE binding.splashProgressTwo.visibility = View.GONE @@ -56,18 +58,14 @@ class SacadorFragment : setToolBar() setEvents() - // viewModel.smartTagInsertTicket("568672") /*var working_in_test=false //sergio: Ok en app - if (!working_in_test) {*/ - if (getCollections){ - viewModel.collectionGetSalix(token = getData(TOKEN)) - } - /* }else{ - viewModel.collectionGet( getData(USER), - getData(PASSWORD),"collection_get") - }*/ - + if (!working_in_test) {*/ + viewModel.collectionGetSalix(token = getData(TOKEN)) + /* }else{ + viewModel.collectionGet( getData(USER), + getData(PASSWORD),"collection_get") + }*/ super.init() @@ -80,20 +78,25 @@ class SacadorFragment : setFragmentResultListener("requestKey") { requestKey, bundle -> val result = bundle.getString("tagMode") - resultTagMode=result - Log.d("VERDNATURA::","el result es "+result) - if (result.equals("complete")){ - getCollections=TRUE + resultTagMode = result + if (result.equals("complete")) { + getCollections = TRUE } - if (result.equals("complete") && getData(TAGSTYPE).equals("SmartTags")) { - Log.d("VERDNATURA::","Entramos a collectionNew_SMARTGS"+result) - viewModel.collection_new_smarttag(getData(USER), - getData(PASSWORD), getData(SECTORFK), getData(WAGON), getData(TAGSTYPE),"collection_new_wagon") + if (result.equals("complete") && getData(TAGSTYPE).equals("SmartTags")) { + binding.splashProgress.visibility = View.VISIBLE + viewModel.collection_new_smart( + getData(USER), + getData(PASSWORD), + getData(SECTORFK), + getData(WAGON), + getData(TAGSTYPE) + ) } } } + override fun onPause() { goBack = true goBack2 = true @@ -102,7 +105,7 @@ class SacadorFragment : private fun setToolBar() { - ma.hideBottomNavigation(View.VISIBLE) + ma.hideBottomNavigation(View.VISIBLE) val listIcons: ArrayList = ArrayList() @@ -113,30 +116,31 @@ class SacadorFragment : if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - iconAdd.tooltipText=getTooltip(R.drawable.ic_add_black_24dp) - iconVehicleIn.tooltipText=getTooltip(R.drawable.car) + iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp) + iconVehicleIn.tooltipText = getTooltip(R.drawable.car) } listIcons.add(iconVehicleIn) listIcons.add(iconAdd) - binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { - override fun onOptionsItemSelected(item: Drawable) { + binding.mainToolbar.toolbarIcons.adapter = + ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { + override fun onOptionsItemSelected(item: Drawable) { - when(item){ + when (item) { - iconAdd.drawable -> { - binding.splashProgress.visibility = View.VISIBLE - checkTagsMode() - /* viewModel.collection_new_wagon(getData(USER), - getData(PASSWORD),getData(SECTORFK),getData(WAGON),getData(TAGSTYPE),"collection_new_wagon")*/ + iconAdd.drawable -> { + binding.splashProgress.visibility = View.VISIBLE + checkTagsMode() + /* viewModel.collection_new_wagon(getData(USER), + getData(PASSWORD),getData(SECTORFK),getData(WAGON),getData(TAGSTYPE),"collection_new_wagon")*/ } - iconVehicleIn.drawable-> ma.onVehicleSelected(SacadorFragment.TAG) - } + iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG) + } - } - }) + } + }) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) } @@ -144,28 +148,38 @@ class SacadorFragment : private fun setEvents() { binding.sacadorSwipe.setOnRefreshListener { viewModel.collectionGetSalix(token = getData(TOKEN)) - /* viewModel.collectionGet(getData(USER), - getData(PASSWORD),"collection_get")*/ + /* viewModel.collectionGet( + getData(USER), + getData(PASSWORD) + )*/ binding.sacadorSwipe.isRefreshing = false } } - private fun checkTagsMode() { if (getData(TAGSTYPE).equals("Stickers")) { - viewModel.collectionNew(getData(USER), - getData(PASSWORD), getData(SECTORFK), getData(WAGON),"collection_new_wagon") + viewModel.collectionNew( + getData(USER), + getData(PASSWORD), getData(SECTORFK), getData(WAGON) + ) } else { - Log.d("VERDNATURA::","ResultMode"+resultTagMode) + Log.d("VERDNATURA::", "ResultMode" + resultTagMode) if (resultTagMode.equals("complete")) { - viewModel.collection_new_wagon(getData(USER), - getData(PASSWORD), getData(SECTORFK), getData(WAGON), getData(TAGSTYPE),"collection_new_wagon") - /* viewModel.collectionNew(getData(USER), - getData(PASSWORD), getData(SECTORFK), getData(WAGON),"collection_new_wagon") -*/ + + binding.splashProgress.visibility = View.VISIBLE + viewModel.collection_new_smart( + getData(USER), + getData(PASSWORD), + getData(SECTORFK), + getData(WAGON), + getData(TAGSTYPE) + ) + /* viewModel.collectionNew(getData(USER), + getData(PASSWORD), getData(SECTORFK), getData(WAGON),"collection_new_wagon") + */ } else { requireActivity().addFragment( AssociateSmartTagsFragment.newInstance(AssociateSmartTagsFragment.TAG), @@ -180,7 +194,6 @@ class SacadorFragment : } - override fun observeViewModel() { with(viewModel) { @@ -194,7 +207,7 @@ class SacadorFragment : /* collectionTicketList.observe(viewLifecycleOwner, Observer { binding.splashProgress_two.visibility = View.GONE if (it.isError){ - customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){ + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton("Aceptar"){ customDialog.dismiss() }.show() }else{ @@ -206,7 +219,7 @@ class SacadorFragment : binding.splashProgressTwo.visibility = View.GONE binding.splashProgress.visibility = View.GONE if (it.isError) { - ma.messageWithSound(it.errorMessage,true,false) + ma.messageWithSound(it.errorMessage, true, false) } else { if (goBack) addCollectionToList(it.response) @@ -214,41 +227,44 @@ class SacadorFragment : goBack = false //sergio:para asegurarnos que aparece en pantalla. - /* var working_in_test=false //sergio: ok en app SACADOR - if (!working_in_test) {*/ - viewModel.collectionGetSalix(token=getData(TOKEN)) - /*}else{ - viewModel.collectionGet(getData(USER),getData(PASSWORD),"collection_get") + var working_in_test = false //sergio: ok en app SACADOR + if (!working_in_test) { + viewModel.collectionGetSalix(token = getData(TOKEN)) + } else { + viewModel.collectionGet(getData(USER), getData(PASSWORD)) } - */ }) - responseCollectionSmarttag.observe(viewLifecycleOwner, Observer { + responseCollectionSmart.observe(viewLifecycleOwner,Observer{ + binding.splashProgress.visibility = View.GONE + Log.d("VERDNATURA::","Entramos a hacer el inserttt") + if (it.isError) { + ma.messageWithSound(it.errorMessage, true, false) - if (it.isError) { - ma.messageWithSound(it.errorMessage,true,false) + } else { + ma.messageWithSound(it.errorMessage, false, false) + // Log.d("VERDNATURA::", "La colec a insertTicket es " + it.response) + viewModel.smartTagInsertTicket(it.response) - } else { - ma.messageWithSound(it.errorMessage,false,false) - Log.d("VERDNATURA::","La colec es "+it.response) - viewModel.smartTagInsertTicket(it.response) - - goBack = false} + goBack = false + } }) + registerSmarttagInsert.observe(viewLifecycleOwner, Observer { - if (!goBack){ - if (it.isError) { - ma.messageWithSound(it.errorMessage,true,false) + if (!goBack) { + if (it.isError) { + ma.messageWithSound(it.errorMessage, true, false) - } else { - ma.messageWithSound(it.errorMessage,false,false) - viewModel.collectionGetSalix(getData(TOKEN)) + } else { + ma.messageWithSound(it.errorMessage, false, false) + viewModel.collectionGetSalix(getData(TOKEN)) + } + goBack = false } - goBack = false} }) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt index 5e1e863c..48ca7998 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt @@ -45,9 +45,9 @@ class SacadorViewModel(context: Context) : BaseViewModel() { val response: LiveData get() = _response - private val _responseCollectionSmarttag by lazy { MutableLiveData() } - val responseCollectionSmarttag: LiveData - get() = _responseCollectionSmarttag + private val _responseCollectionSmart by lazy { MutableLiveData() } + val responseCollectionSmart: LiveData + get() = _responseCollectionSmart private val _registerSmarttagInsert by lazy { MutableLiveData() } @@ -95,7 +95,7 @@ class SacadorViewModel(context: Context) : BaseViewModel() { }) } - fun collectionNew(usuario: String, password: String, sectorFk: String, wagons: String,callFunction:String){ + fun collectionNew(usuario: String, password: String, sectorFk: String, wagons: String){ getSacadorControladorUserCase.collectionNew(usuario, password, sectorFk, wagons).enqueue( object : Callback { @@ -125,15 +125,14 @@ class SacadorViewModel(context: Context) : BaseViewModel() { }) } - fun collection_new_wagon(usuario: String, password: String, sectorFk: String, wagons: String,tagtype:String,callFunction:String){ - getSacadorControladorUserCase.collectionNew(usuario, password, sectorFk, wagons,tagtype).enqueue( + fun collection_new_smart(usuario: String, password: String, sectorFk: String, wagons: String,tagtype:String){ + getSacadorControladorUserCase.collectionNewSmarttag(usuario, password, sectorFk, wagons,tagtype).enqueue( object : Callback { override fun onFailure(call: Call, t: Throwable) { - _response.value = + _responseCollectionSmart.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) - } override fun onResponse( @@ -141,11 +140,13 @@ class SacadorViewModel(context: Context) : BaseViewModel() { response: Response ) { if (response.body() != null) { - _response.value = + + Log.d("VERDNATURA::","Entramos y formamos _responseCollectionSmarttag:"+response.body()) + _responseCollectionSmart.value = ResponseItemVO(isError = false, response = response.body()!!) } else { - - _response.value = ResponseItemVO( + Log.d("VERDNATURA::","Entramos y formamos _responseCollectionSmarttag") + _responseCollectionSmart.value = ResponseItemVO( isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()) ) @@ -155,15 +156,14 @@ class SacadorViewModel(context: Context) : BaseViewModel() { }) } - fun collection_new_smarttag(usuario: String, password: String, sectorFk: String, wagons: String,tagtype:String,callFunction:String){ - getSacadorControladorUserCase.collectionNew(usuario, password, sectorFk, wagons,tagtype).enqueue( + /* fun collection_new_smarttag(usuario: String, password: String, sectorFk: String, wagons: String,tagtype:String){ + getSacadorControladorUserCase.collectionNewSmarttag(usuario, password, sectorFk, wagons,tagtype).enqueue( object : Callback { override fun onFailure(call: Call, t: Throwable) { - // _response.value= _responseCollectionSmarttag.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) - + Log.d("VERDNATURA::","onFAilure") } @@ -173,11 +173,11 @@ class SacadorViewModel(context: Context) : BaseViewModel() { ) { if (response.body() != null) { - Log.d("VERDNATURA::","LA coleccion de collectionNew_SMARTGS es "+response.body()) + Log.d("VERDNATURA::","La coleccion de collectionNew_SMARTGS es "+response.body()) _responseCollectionSmarttag.value = ResponseItemVO(isError = false, response = response.body()!!) } else { - + Log.d("VERDNATURA::","Else del response.body() ") _responseCollectionSmarttag.value = ResponseItemVO( isError = true, @@ -187,9 +187,9 @@ class SacadorViewModel(context: Context) : BaseViewModel() { } } }) - } + }*/ - fun collectionGet(usuario: String, password: String,callFunction:String){ + fun collectionGet(usuario: String, password: String){ //////Log.i("VERDNATURA:","collectionGet para coger tickets") getSacadorControladorUserCase.collectionGet(usuario, password).enqueue(object : Callback> { @@ -271,7 +271,7 @@ class SacadorViewModel(context: Context) : BaseViewModel() { val responseSmart: SmartTagRegister if (response.isSuccessful()){ - Log.i("VERDNATURA::","El mensaje es "+response.message()) + //Log.i("VERDNATURA::","El mensaje es "+response.message()) responseSmart = SmartTagRegister( message="Ticket insertado OK.", isError = false, @@ -292,9 +292,9 @@ class SacadorViewModel(context: Context) : BaseViewModel() { override fun onFailure(call: Call, t: Throwable) { val responseSmart = - SmartTagRegister(isError = true, errorMessage = t.message!!) + SmartTagRegister(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) - Log.i("VERDNATURA::","el error nodejs es "+t.message+"--"+t.cause.toString()+"--"+t.stackTrace.toString()) + //Log.i("VERDNATURA::","el error nodejs es "+t.message+"--"+t.cause.toString()+"--"+t.stackTrace.toString()) _registerSmarttagInsert.value = responseSmart } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingFragment.kt index 80cf5ab6..edbae97b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingFragment.kt @@ -46,7 +46,7 @@ class ShelvingParkingFragment : BaseFragment> { override fun onFailure(call: Call>, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/showticket/ShowTicketFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/showticket/ShowTicketFragment.kt index 89e2f795..e14f1733 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/showticket/ShowTicketFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/showticket/ShowTicketFragment.kt @@ -72,8 +72,8 @@ class ShowTicketFragment(var menuOrigin: String) : BaseFragment get() = _responseTicket - fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String,callFunction:String){ + fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String){ getPreControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt index 6fdd8ddb..583e7f24 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt @@ -244,7 +244,7 @@ class RegisterSmartTagsFragment( private fun showScanSmartTags() { customDialogList.setTitle("Escanea matrícula del carro y etiquetas smartTags de arriba a abajo.") - .setOkButton("Finalizar") { + .setOkButton(getString(R.string.end)) { ma.hideKeyboard(customDialogList.getEditText()) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt index 40992e08..dd6f3855 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt @@ -74,7 +74,6 @@ class AssociateSmartTagsFragment( customDialogInput = CustomDialogInput(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) goBack = false - //requireActivity().main_bottom_navigation.visibility = GONE ma.hideBottomNavigation(View.GONE) binding.splashProgress.visibility = GONE @@ -92,7 +91,7 @@ class AssociateSmartTagsFragment( private fun setToolBar() { - binding.mainToolbar.toolbarTitle.text = "Asociar smartTag" + binding.mainToolbar.toolbarTitle.text = getString(R.string.smarttagAssociate) } @@ -140,7 +139,6 @@ class AssociateSmartTagsFragment( private fun setEvents() { binding.mainToolbar.backButton.setOnClickListener { - Log.i("VERDNATURA:", "PULSADO") requireActivity().onBackPressed() } @@ -158,7 +156,7 @@ class AssociateSmartTagsFragment( } else { - ma.messageWithSound("Carro/etiqueta insertado",false,false) + ma.messageWithSound(getString(R.string.insertedLabel),false,false) var nameSmartTagwithWagon = getTextScaned(0) + itemScaned customDialogList.setTitle(getTextToPosition(0)) @@ -176,16 +174,16 @@ class AssociateSmartTagsFragment( if (it.isError) { ma.messageWithSound(it.errorMessage,true,false) - /*customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ } else { if (it.response == null) { - customDialog.setTitle("Error") - .setDescription("Etiqueta o carro no válido") - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)) + .setDescription(getString(R.string.labelNovalid)) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() @@ -196,7 +194,7 @@ class AssociateSmartTagsFragment( smartAdapter!!.notifyDataSetChanged() customDialogList.setValue("") - ma.messageWithSound("Carro/etiqueta borrada",false,false) + ma.messageWithSound(getString(R.string.deletedLabel),false,false) } } binding.splashProgress.visibility = GONE @@ -209,11 +207,11 @@ class AssociateSmartTagsFragment( return when (TagsScaned) { - 0 -> "Escanea etiqueta/s electrónica/s o matrícula/s" - 1 -> "Escanea etiqueta superior" - 2 -> "Escanea etiqueta del medio" - 3 -> "Escanea etiqueta inferior" - 4 -> "Carro escaneado" + 0 -> getString(R.string.scanSmarttagOrShelving) + 1 -> getString(R.string.scanHighLabel) + 2 -> getString(R.string.scanMedLabel) + 3 -> getString(R.string.scanLowLabel) + 4 -> getString(R.string.scannedWagon) else -> {""} } @@ -223,11 +221,11 @@ class AssociateSmartTagsFragment( return when (TagScaned) { - 0 -> "Escaneado:" - 1 -> "Carro:" - 2 -> "Etiqueta superior:" - 3 -> "Escanea del medio:" - 4 -> "Etiqueta inferior:" + 0 -> getString(R.string.scanned) + 1 -> getString(R.string.wagon) + 2 -> getString(R.string.scanHighLabel) + 3 -> getString(R.string.scanMedLabel) + 4 -> getString(R.string.scanLowLabel) else -> {""} } @@ -237,8 +235,8 @@ class AssociateSmartTagsFragment( private fun showScanSmartTags() { - customDialogList.setTitle("Escanea etiqueta/s electrónica/s o matrícula/s.") - .setOkButton("Finalizar") { + customDialogList.setTitle(getString(R.string.scanSmarttagOrShelving)) + .setOkButton(getString(R.string.end)) { ma.hideKeyboard(customDialogList.getEditText()) @@ -247,7 +245,7 @@ class AssociateSmartTagsFragment( customDialogList.dismiss() - Log.d("VERDNATURA::","Vamos a abrrir Sacadores") + //Log.d("VERDNATURA::","Vamos a abrrir Sacadores") val result = "complete" setFragmentResult("requestKey", bundleOf("tagMode" to result)) ma.openFragmentPickers(true) @@ -266,7 +264,7 @@ class AssociateSmartTagsFragment( // }.show() } - }.setKoButton("Deshacer") { + }.setKoButton(getString(R.string.undone)) { ma.hideKeyboard(customDialogList.getEditText()) if (!listSmartTags.isEmpty()) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/SmartTagsViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/SmartTagsViewModel.kt index 5e451ce3..f27bde31 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/SmartTagsViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/SmartTagsViewModel.kt @@ -121,7 +121,7 @@ class SmartTagsViewModel(context: Context) : BaseViewModel() { val responseSmart: SmartTagRegister if (response.isSuccessful()){ - Log.i("VERDNATURA::","El mensaje es "+response.message()) + //Log.i("VERDNATURA::","El mensaje es "+response.message()) responseSmart = SmartTagRegister( message="Registrada smartTag.", isError = false, @@ -147,7 +147,7 @@ class SmartTagsViewModel(context: Context) : BaseViewModel() { val responseSmart = SmartTagRegister(isError = true, errorMessage = t.message!!) - Log.i("VERDNATURA::","el error nodejs es "+t.message+"--"+t.cause.toString()+"--"+t.stackTrace.toString()) + //Log.i("VERDNATURA::","el error nodejs es "+t.message+"--"+t.cause.toString()+"--"+t.stackTrace.toString()) _registerSmarttagNode.value = responseSmart } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt index 995bfa12..788894c4 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt @@ -46,7 +46,7 @@ class AutomaticAddItemFragment( } private fun setSubtitle(){ - binding.mainToolbar.toolbarSubtitle.text = "Etiquetas: "+contador + binding.mainToolbar.toolbarSubtitle.text = getString(R.string.labels)+contador } private fun setViews(){ diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt index 96e47352..e8d4430d 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt @@ -378,8 +378,8 @@ class UbicadorFragment( ma.messageWithSound(it.errorMessage, it.isError, false) /* mperror!!.start() - customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show()*/ } @@ -395,8 +395,8 @@ class UbicadorFragment( /* if (it.isError) { mperror!!.start() - customDialog.setTitle("Error").setDescription(it.errorMessage) - .setOkButton("Cerrar") { + customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) + .setOkButton(getString(R.string.close)) { customDialog.dismiss() }.show() } else { @@ -444,7 +444,7 @@ class UbicadorFragment( itemUbicador.id, customDialogUbicador.getGroupingValue() ) - }.setKoButton("Cerrar") { + }.setKoButton(getString(R.string.close)) { customDialogUbicador.dismiss() }.show() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt index e64076fd..40088e21 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt @@ -84,7 +84,7 @@ class WorkermistakeFragment( var entryPoint: String = "" customDialogList = CustomDialogList(requireContext()) if (!departmentId.isEmpty()){ - viewModel.worker_getFromHasMistake(getData(USER),getData(PASSWORD),getData(DEPARTMENTMISTAKEID),"worker_getFromHasMistake") + viewModel.worker_getFromHasMistake(getData(USER),getData(PASSWORD),getData(DEPARTMENTMISTAKEID)) } binding.filterDepartment.setOnClickListener{ @@ -95,7 +95,7 @@ class WorkermistakeFragment( var entryPoint: String = "" saveData(DEPARTMENTMISTAKE,nombre.getDepartmentName()) saveData(DEPARTMENTMISTAKEID,nombre.getDepartmentId()) - viewModel.worker_getFromHasMistake(getData(USER),getData(PASSWORD),nombre.getDepartmentId(),"worker_getFromHasMistake") + viewModel.worker_getFromHasMistake(getData(USER),getData(PASSWORD),nombre.getDepartmentId()) binding.splashProgress.visibility = View.VISIBLE binding.filterItemFk.isEnabled = true baseSearchDialogCompat.dismiss() diff --git a/app/src/main/res/layout/fragment_automatic_add_item.xml b/app/src/main/res/layout/fragment_automatic_add_item.xml index 84665933..a2b10819 100644 --- a/app/src/main/res/layout/fragment_automatic_add_item.xml +++ b/app/src/main/res/layout/fragment_automatic_add_item.xml @@ -57,7 +57,7 @@ android:layout_marginEnd="16dp" android:layout_weight="1" android:background="@drawable/btn_orange" - android:text="@string/Finalizar" + android:text="@string/end" android:textColor="@color/verdnatura_white" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index c510aa97..e09da12c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -21,7 +21,6 @@ Tamaño Matrícula Visible - Finalizar Destino Nicho Entrar @@ -119,7 +118,7 @@ Control vehículos Trabajador Histórico del vehículo - Asociar SmartTag Sacador + Asociar SmartTag Sacador Control de usuario Registro de Smarttags El usuario lleva la máquina: @@ -164,4 +163,49 @@ Ubicación de reclamación Reclamaciones Escáner paletizar + Realizado correctamente + Configuración + Artículo info + Sin resultados + No se ha podido obtener datos de la etiqueta escaneada. + Recarga datos del elemento escaneado/seleccionado + Ver Histórico del ítem + Imprime ticket + Añade ítem + Visualiza la foto del sacador + Realiza llamada al sacador + Permite coger vehículo + Cerrar Sesión + Stickers + SmartTags + Control de usuario de vehículo + Error + Sectores + Impresoras + Android_id + base_url + Asociar SmartTag + Carro/etiqueta insertado + Etiqueta o carro no válido + Cerrar + Carro/etiqueta borrada + Finalizar + Deshacer + \"Etiquetas: \" + warehouse + Escanea etiqueta/s electrónica/s o matrícula/s + Escanea etiqueta superior + Escanea etiqueta del medio + Escanea etiqueta inferior + Carro: + Escaneado: + Problemas con la velocidad de internet. No se puede usar la voz + Permite aparcar ticket/carro + Permite dejar el vehículo + Genera colección para sacar + \"Ver filtro \" + Ver movimientos de Faltas + Ver movimientos de Basura + Filtra por tipo de flor + Sin impresora diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3e1aaadd..1ff3578a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,7 +20,6 @@ Size Registration number Visible - Finalize Destination Niche Log In @@ -162,5 +161,50 @@ Find department Claim Ubication Claims + done successful + Settings + Item info + No results + No data for label scanned + Reload item data + Show historical item + Print ticket + Add item + Show face picker + Call picker + Allows to select a vehicle + Sign off + Stickers + SmartTags + User control vehicle + Error + Sectors + Printers + Android_id + base_url + Associate SmartTag Punch + Carro/etiqueta insertado + Etiqueta o carro no válido + Cerrar + Carro/etiqueta borrada + Finalizar + Deshacer + \"Etiquetas: \" + warehouse + Escanea etiqueta/s electrónica/s o matrícula/s + Escanea etiqueta superior + Escanea etiqueta del medio + Escanea etiqueta inferior + Carro escaneado + Escaneado: + Problemas con la velocidad de internet. No se puede usar la voz + Permite aparcar ticket/carro + Permite dejar el vehículo + Genera colección para sacar + \"Ver filtro \" + Ver movimientos de Faltas + Ver movimientos de Basura + Filtra por tipo de flor + Sin impresora