Version 8.4.1Beta, return "finish", strings y quitado test rocket

This commit is contained in:
Sergio De la torre 2022-05-26 17:02:28 +02:00
parent 03f825ad3e
commit 43350c66d6
88 changed files with 751 additions and 616 deletions

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\sergiodt\.android\avd\Pixel_3a_API_30_x86.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-05-20T11:37:38.376422500Z" />
</component>
</project>

View File

@ -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...

View File

@ -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(

View File

@ -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/"

View File

@ -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<String> {
): Call<Any> {
val params: ArrayList<String> = ArrayList()
params.add(itemFk)
params.add(quantityFk)

View File

@ -469,7 +469,7 @@ interface VerdnaturaService {
@Header("Content-Type") content_type: String,
@Body params: List<String>
):
Call<String>
Call<Any>
@POST("almacennew/saleMove")//REVISADA
fun saleMove(

View File

@ -44,7 +44,6 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(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<T : ViewDataBinding, V : BaseViewModel>(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 -> {""}

View File

@ -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!!,

View File

@ -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<String> = ArrayList()
listTagsType.add("Stickers")
listTagsType.add("SmartTags")
listTagsType.add(getString(R.string.stickers))
listTagsType.add(getString(R.string.smarttags))
tagsList = listTagsType
val array = arrayOfNulls<String>(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

View File

@ -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<AjustesItemVO>() }
val ajustesitem: List<AjustesItemVO>
get() = _ajustesitem
private val _ajustesitem by lazy { ArrayList<AjustesItemVO>() }
val ajustesitem: List<AjustesItemVO>
get() = _ajustesitem
private val _sectorList by lazy { MutableLiveData<SectorListVO>() }
val sectorList: LiveData<SectorListVO>
get() = _sectorList
private val _sectorList by lazy { MutableLiveData<SectorListVO>() }
val sectorList: LiveData<SectorListVO>
get() = _sectorList
private val _workerupdateSector by lazy { MutableLiveData<ResponseItemVO>() }
val workerupdateSector: LiveData<ResponseItemVO>
get() = _workerupdateSector
private val _workerupdateSector by lazy { MutableLiveData<ResponseItemVO>() }
val workerupdateSector: LiveData<ResponseItemVO>
get() = _workerupdateSector
private val _workerupdatePrinter by lazy { MutableLiveData<ResponseItemVO>() }
val workerupdatePrinter: LiveData<ResponseItemVO>
get() = _workerupdatePrinter
private val _workerupdatePrinter by lazy { MutableLiveData<ResponseItemVO>() }
val workerupdatePrinter: LiveData<ResponseItemVO>
get() = _workerupdatePrinter
private val _printerList by lazy { MutableLiveData<PrintersList>() }
val printerList: LiveData<PrintersList>
get
() = _printerList
private val _printerList by lazy { MutableLiveData<PrintersList>() }
val printerList: LiveData<PrintersList>
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<List<SectorItemVO>>{
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
val listError:ArrayList<SectorItemVO> = ArrayList()
listError.add(SectorItemVO(0,"",0,true,t.message!!))
fun getSectors(user: String, password: String) {
getAjustesUserCase.getSectors(user, password)
.enqueue(object : Callback<List<SectorItemVO>> {
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
val listError: ArrayList<SectorItemVO> = ArrayList()
listError.add(SectorItemVO(0, "", 0, true, t.message!!))
_sectorList.value = SectorListVO(listError)
}
}
override fun onResponse(
override fun onResponse(
call: Call<List<SectorItemVO>>,
response: Response<List<SectorItemVO>>
) {
if (response.body() != null){
_sectorList.value = response.body()?.let { SectorListVO(it) }
}else{
val listError:ArrayList<SectorItemVO> = 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<SectorItemVO> = 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<List<SectorItemVO>>{
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
val listError:ArrayList<SectorItemVO> = ArrayList()
listError.add(SectorItemVO(0,"",0,true,t.message!!))
})
}
fun getSectorsSalix(token: String) {
getAjustesUserCase.getSectorsSalix(token).enqueue(object : Callback<List<SectorItemVO>> {
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
val listError: ArrayList<SectorItemVO> = ArrayList()
listError.add(SectorItemVO(0, "", 0, true, t.message!!))
_sectorList.value = SectorListVO(listError)
}
override fun onResponse(
call: Call<List<SectorItemVO>>,
response: Response<List<SectorItemVO>>
) {
if (response.body() != null) {
_sectorList.value = response.body()?.let { SectorListVO(it) }
} else {
val listError: ArrayList<SectorItemVO> = ArrayList()
listError.add(
SectorItemVO(
0, "", 0, true,
getMessageFromAllResponse(nameofFunction(this), response.message())
)
)
_sectorList.value = SectorListVO(listError)
}
}
}
override fun onResponse(
call: Call<List<SectorItemVO>>,
response: Response<List<SectorItemVO>>
) {
})
}
fun printer_get(user: String, password: String) {
getAjustesUserCase.printer_get(user, password).enqueue(object : Callback<List<Printers>> {
override fun onFailure(call: Call<List<Printers>>, t: Throwable) {
val listError: ArrayList<Printers> = ArrayList()
listError.add(Printers(0, "", true, t.message!!))
_printerList.value = PrintersList(listError)
}
override fun onResponse(
call: Call<List<Printers>>,
response: Response<List<Printers>>
) {
if (response.body() != null){
_sectorList.value = response.body()?.let { SectorListVO(it) }
}else{
val listError:ArrayList<SectorItemVO> = 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<List<Printers>>{
override fun onFailure(call: Call<List<Printers>>, t: Throwable) {
val listError:ArrayList<Printers> = ArrayList()
listError.add(Printers(0,"",true,t.message!!))
if (response.body() != null) {
_printerList.value = response.body()?.let { PrintersList(it) }
} else {
val listError: ArrayList<Printers> = ArrayList()
listError.add(
Printers(
0, "", true,
getMessageFromAllResponse(nameofFunction(this), response.message())
)
)
_printerList.value = PrintersList(listError)
}
}
}
})
}
override fun onResponse(
call: Call<List<Printers>>,
response: Response<List<Printers>>
) {
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<Unit> {
override fun onFailure(call: Call<Unit>, 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<Printers> = 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<Unit>{
override fun onFailure(call: Call<Unit>, t: Throwable) {
_workerupdateSector.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
}
override fun onResponse(
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
) {
) {
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<Unit>{
override fun onFailure(call: Call<Unit>, 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<Unit> {
override fun onFailure(call: Call<Unit>, t: Throwable) {
override fun onResponse(
_workerupdatePrinter.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
) {
) {
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"
)
}
}
}
})
}
})
}
}

View File

@ -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 = ""

View File

@ -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()

View File

@ -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<List<ItemPackingType>> {
override fun onFailure(call: Call<List<ItemPackingType>>, 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<Any>{
override fun onFailure(call: Call<Any>, 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<String>{
override fun onFailure(call: Call<String>, 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<Boolean>{
override fun onFailure(call: Call<Boolean>, t: Throwable) {
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))

View File

@ -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()
}

View File

@ -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<Boolean> {
override fun onFailure(call: Call<Boolean>, 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<String>{
override fun onFailure(call: Call<String>, t: Throwable) {
_bufferloadresponse.value = ResponseItemVO(

View File

@ -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())

View File

@ -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() {

View File

@ -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<List<ItemLocationVO>> {
override fun onFailure(call: Call<List<ItemLocationVO>>, t: Throwable) {
val listError:ArrayList<ItemLocationVO> = ArrayList()

View File

@ -41,7 +41,7 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(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<BuyersFragmentBinding,BuyersViewModel>(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))
}
}

View File

@ -21,7 +21,7 @@ class BuyersViewModel(context: Context) : BaseViewModel() {
val buyersList: LiveData<BuyerListVO>
get() = _buyersList
fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){
fun itemShelvingBuyerGet(user:String,password:String){
getQualityUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
Callback<List<BuyerVO>> {
override fun onFailure(call: Call<List<BuyerVO>>, t: Throwable) {

View File

@ -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)
})
}
}

View File

@ -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<List<ItemBuyerVO>> {
override fun onFailure(call: Call<List<ItemBuyerVO>>, t: Throwable) {

View File

@ -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())

View File

@ -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])

View File

@ -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<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
).enqueue(object : Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_responseNew.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(call: Call<String>, response: Response<String>) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
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<String> {
override fun onFailure(call: Call<String>, t: Throwable) {

View File

@ -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()*/

View File

@ -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<CollectionVO> {
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {

View File

@ -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)) {

View File

@ -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 {

View File

@ -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

View File

@ -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()
}

View File

@ -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<List<ItemShelvingSaleDate>> {
override fun onFailure(call: Call<List<ItemShelvingSaleDate>>, 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<String> {

View File

@ -188,8 +188,7 @@ class FaltasFragment :
getData(USER),
getData(PASSWORD),
item.itemFk,
getData(WAREHOUSEFK),
"faultsReview_isChecked"
getData(WAREHOUSEFK)
)
changeOfflineValue(item)
}

View File

@ -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<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {

View File

@ -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() {

View File

@ -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<List<ItemHistoricoVO>> {
override fun onFailure(call: Call<List<ItemHistoricoVO>>, t: Throwable) {

View File

@ -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()
}

View File

@ -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<List<ItemShelvingLog>> {
override fun onFailure(call: Call<List<ItemShelvingLog>>, t: Throwable) {

View File

@ -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()
}

View File

@ -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<List<ShelvingLog>> {
override fun onFailure(call: Call<List<ShelvingLog>>, t: Throwable) {

View File

@ -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()

View File

@ -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<List<ItemHistoricoVehiculo>> {
override fun onFailure(call: Call<List<ItemHistoricoVehiculo>>, t: Throwable) {

View File

@ -60,7 +60,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
override fun onCreate(savedInstanceState: Bundle?) {
//sergio. se quita para subir version.A la espera de como será el inventario
viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelvingBuyerGet")
viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD))
super.onCreate(savedInstanceState)
}
@ -71,7 +71,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
binding.splashProgress.visibility = View.VISIBLE
buyerId=getData(BUYERID)
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer")
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK))
binding.filterBuyer.setOnClickListener{
//SimpleSearchDialogCompat(context,getString(R.string.compradores),getString(R.string.escribirparteNombre),null,initData(),
SimpleSearchDialogCompat(context,getString(R.string.compradores),getString(R.string.escribirparteNombre),null,items,
@ -81,7 +81,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
saveBuyer(nombre.getBuyerNickname())
saveBuyerId(nombre.getBuyerId())
buyerId=nombre.getBuyerId()
viewModel.getInventory(getData(USER),getData(PASSWORD),nombre.getBuyerId(),getData(WAREHOUSEFK),"itemShelving_filterBuyer")
viewModel.getInventory(getData(USER),getData(PASSWORD),nombre.getBuyerId(),getData(WAREHOUSEFK))
binding.splashProgress.visibility = View.VISIBLE
baseSearchDialogCompat.dismiss()
}).show()
@ -100,7 +100,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
reload = false
binding.splashProgress.visibility = View.VISIBLE
hideLoad = false
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer")
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK))
}
@ -126,7 +126,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
if (item == iconReload.drawable){
binding.splashProgress.visibility = View.VISIBLE
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer")
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK))
}
@ -242,7 +242,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
response.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()*/
}

View File

@ -64,7 +64,7 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
get() = _responseAddMistake
//sergio para obtener comprador
fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){
fun itemShelvingBuyerGet(user:String,password:String){
getInventaryUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
Callback<List<BuyerVO>> {
override fun onFailure(call: Call<List<BuyerVO>>, 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<List<ItemInventaryVO>> {
@ -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<List<WorkerFromMistake>> {
override fun onFailure(call: Call<List<WorkerFromMistake>>, t: Throwable) {

View File

@ -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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(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<FragmentLoginBinding, LoginViewModel>(LoginVi
viewModel.checkVersion(
user = binding.edittextUsername.text.toString(),
password = binding.edittextPassword.text.toString(),
nameApp = "warehouse", "getVersion",
nameApp = getString(R.string.nameApp)
)

View File

@ -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<LoginSalixVO>
{
@ -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<String>
@ -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<versionApp>
@ -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
}

View File

@ -330,7 +330,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), 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<ActivityMainBinding>(), 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<ActivityMainBinding>(), 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<ActivityMainBinding>(), OnPasillerosItemClickL
message: String,
isError: Boolean,
isPlayed: Boolean?,
titleWithError: String = "Error",
titleWithError: String = getString(R.string.error),
isToasted: Boolean? = false
) {

View File

@ -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)

View File

@ -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<List<ItemPalletViewVO>> {
override fun onFailure(call: Call<List<ItemPalletViewVO>>, 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<Any>{
override fun onFailure(call: Call<Any>, t: Throwable) {

View File

@ -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()
}

View File

@ -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<List<ItemPalletVO>> {
override fun onFailure(call: Call<List<ItemPalletVO>>, 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<List<ItemScanVO>> {
override fun onFailure(call: Call<List<ItemScanVO>>, 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<String>{
override fun onFailure(call: Call<String>, t: Throwable) {
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))

View File

@ -215,7 +215,7 @@ class ExpeditionScanFragment (
customDialogList.dismiss()
}.setKoButton("Cerrar"){
}.setKoButton(getString(R.string.close)){
ma.hideKeyboard(customDialogList.getEditText())
listExpeditions = ArrayList()
customDialogList.dismiss()

View File

@ -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()

View File

@ -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<Void>{
override fun onFailure(call: Call<Void>, t: Throwable) {

View File

@ -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)

View File

@ -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<JsonObject> {
override fun onFailure(call: Call<JsonObject>, t: Throwable) {

View File

@ -51,7 +51,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
setToolBar()
////Log.i("VERDNATURA:","1-cargamos expediciones")
viewModel.expeditionTruckList(getData(USER),
getData(PASSWORD),"expeditionTruck_List")
getData(PASSWORD))
super.init()
}
@ -71,7 +71,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
if (item == iconReload){
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionTruckList(getData(USER),
getData(PASSWORD),"expeditionTruck_List")
getData(PASSWORD))
}else if(item == iconPlus){
addTruck()
}
@ -96,7 +96,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
})
loadResponseExpeditionAdd.observe(viewLifecycleOwner, Observer { event ->
viewModel.expeditionTruckList(getData(USER),
getData(PASSWORD),"expeditionTruck_List")
getData(PASSWORD))
})
}
}

View File

@ -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<List<ItemExpeditionTruckVO>> {
override fun onFailure(call: Call<List<ItemExpeditionTruckVO>>, t: Throwable) {

View File

@ -72,7 +72,7 @@ class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBindi
// mperror?.start()
// binding.splashProgress.visibility = View.GONE
ma.messageWithSound(it.errorMessage, isError = true,isPlayed = true)
/*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{
@ -134,7 +134,7 @@ class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBindi
usuario = getData(USER),
password = getData(PASSWORD),
parking = txtScan,
scanItem = it.code!!,callFunction = "shelvingPark"
scanItem = it.code!!
)
}
}else{

View File

@ -39,7 +39,7 @@ class ParkingViewModel(context: Context) : BaseViewModel() {
_isLoadingProgress.value = visibility
}
fun parking(usuario: String,password: String,scanItem: String,parking:String,callFunction:String){
fun parking(usuario: String,password: String,scanItem: String,parking:String){
ProgressLoading(VISIBLE)
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
Callback<String> {

View File

@ -67,7 +67,7 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
if (it.isError){
mperror?.start()
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{
@ -129,7 +129,7 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
usuario = getData(USER),
password = getData(PASSWORD),
parking = txtScan,
scanItem = it.code!!,callFunction = "shelvingPark"
scanItem = it.code!!
)
}
}else{

View File

@ -45,7 +45,7 @@ class ParkingSaleViewModel(context: Context) : BaseViewModel() {
_isLoadingProgress.value = visibility
}
fun parking(usuario: String,password: String,scanItem: String,parking:String,callFunction:String){
fun parking(usuario: String,password: String,scanItem: String,parking:String){
ProgressLoading(VISIBLE)
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
Callback<String> {
@ -63,7 +63,7 @@ class ParkingSaleViewModel(context: Context) : BaseViewModel() {
}
})
}
/* fun saleParking_add(usuario: String, password: String, sales:List<String>,parking: String,callFunction:String)
/* fun saleParking_add(usuario: String, password: String, sales:List<String>,parking: String)
{
getUbicadorUserCase.saleParking_add(usuario, password, sales, parking)
.enqueue(object : Callback<String>

View File

@ -238,6 +238,7 @@ class PasilleroViewModel : BaseViewModel() {
)
)
_pasillerositem.add(
PasillerosItemVO(
31,

View File

@ -69,7 +69,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicket
password = getData(PASSWORD),
sectorFk = getData(SECTORFK),
collectionFk = binding.scanInput.text.toString(),
type = type,callFunction = "collection_getTickets"
type = type
)
}

View File

@ -22,7 +22,7 @@ class PreControladorViewModel(context: Context) : BaseViewModel() {
val collectionTicketList: LiveData<CollectionVO>
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<CollectionVO> {
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {

View File

@ -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()
}

View File

@ -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.

View File

@ -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()
}

View File

@ -197,7 +197,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
}
/* fun saleParking_add(usuario: String, password: String, sales:List<String>,parking: String,callFunction:String)
/* fun saleParking_add(usuario: String, password: String, sales:List<String>,parking: String)
{
getUbicadorUserCase.saleParking_add(usuario, password, sales, parking)
.enqueue(object : Callback<String>
@ -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<String> {
override fun onFailure(call: Call<String>, 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<Any> {
override fun onFailure(call: Call<Any>, 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<List<CollectionVO>> {

View File

@ -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()*/

View File

@ -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<String> {
override fun onFailure(call: Call<String>, t: Throwable) {

View File

@ -113,10 +113,10 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
binding.btnCancelar.setOnClickListener {
customDialog.setTitle("Confirmar").setDescription("¿Estás seguro de cerrar el pedido?")
.setKoButton("Cerrar") {
.setKoButton(getString(R.string.close)) {
scanRequest()
customDialog.dismiss()
}.setOkButton("Cerrar") {
}.setOkButton(getString(R.string.close)) {
binding.splashProgress.visibility = View.VISIBLE
if (sales.count() > 0) {
viewModel.itemPlacementSupplyCloseOrder(
@ -193,8 +193,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
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 ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
viewModel.getIdFromCode(
usuario = getData(USER),
password = getData(PASSWORD),
code = customDialogList.getValueTwo(), "barcodeToItem"
code = customDialogList.getValueTwo()
)
customDialogList.dismiss()
}
@ -403,7 +403,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
}
}.setKoButton("Cerrar") {
}.setKoButton(getString(R.string.close)) {
scanRequest()
hideKeyboards()
customDialogList.dismiss()
@ -434,7 +434,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
viewModel.getIdFromCode(
usuario = getData(USER),
password = getData(PASSWORD),
code = customDialogList.getValueTwo(), "barcodeToItem"
code = customDialogList.getValueTwo()
)
customDialogList.dismiss()
}
@ -548,7 +548,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
private fun showErrorMessage(text: String) {
customDialog.setTitle("Error al marcar la linea").setDescription(text)
.setKoButton("Cerrar") {
.setKoButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
}

View File

@ -153,7 +153,7 @@ class ReposicionViewModel(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<String> {
override fun onFailure(call: Call<String>, t: Throwable) {

View File

@ -31,8 +31,8 @@ class SacadorFragment :
private lateinit var customDialog: CustomDialog
private var collectionsList: ArrayList<CollectionVO> = 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<ImageView> = 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}
})

View File

@ -45,9 +45,9 @@ class SacadorViewModel(context: Context) : BaseViewModel() {
val response: LiveData<ResponseItemVO>
get() = _response
private val _responseCollectionSmarttag by lazy { MutableLiveData<ResponseItemVO>() }
val responseCollectionSmarttag: LiveData<ResponseItemVO>
get() = _responseCollectionSmarttag
private val _responseCollectionSmart by lazy { MutableLiveData<ResponseItemVO>() }
val responseCollectionSmart: LiveData<ResponseItemVO>
get() = _responseCollectionSmart
private val _registerSmarttagInsert by lazy { MutableLiveData<SmartTagRegister>() }
@ -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<String> {
@ -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<String> {
override fun onFailure(call: Call<String>, 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<String>
) {
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<String> {
override fun onFailure(call: Call<String>, 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<List<CollectionVO>> {
@ -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<SmartTagRegister>, 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
}

View File

@ -46,7 +46,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
if (!binding.shelvingText.text.toString().isNullOrEmpty()){
binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
binding.splashProgress.visibility = View.VISIBLE
viewModel.shelvingParking_get( getData(USER),getData(PASSWORD),binding.shelvingText.text.toString(),getData(WAREHOUSEFK),binding.dayrange.text.toString(),"shelvingParking_get")
viewModel.shelvingParking_get( getData(USER),getData(PASSWORD),binding.shelvingText.text.toString(),getData(WAREHOUSEFK),binding.dayrange.text.toString())
}
binding.shelvingText.setText("")
@ -65,7 +65,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
binding.shelvingText.requestFocus()
binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
viewModel.shelvingParking_get( getData(USER),getData(PASSWORD),binding.shelvingText.text.toString(),getData(WAREHOUSEFK),binding.dayrange.text.toString(),"shelvingParking_get")
viewModel.shelvingParking_get( getData(USER),getData(PASSWORD),binding.shelvingText.text.toString(),getData(WAREHOUSEFK),binding.dayrange.text.toString())
binding.shelvingText.setText("")
ma.hideKeyboard(binding.dayrange)
return@setOnEditorActionListener true

View File

@ -31,7 +31,7 @@ class ShelvingParkingViewModel(context: Context) : BaseViewModel() {
val loadShelvingList = Transformations.map(_shelvingList) { Event(it) }
fun shelvingParking_get(usuario:String,password:String,vShelvingFk:String,vWarehouseFk:String,vDayRange:String,callFunction:String){
fun shelvingParking_get(usuario:String,password:String,vShelvingFk:String,vWarehouseFk:String,vDayRange:String){
getShelvingParkingUserCase.shelvingParking_get(usuario,password,vShelvingFk.uppercase(),vWarehouseFk,vDayRange).enqueue(object :
Callback<List<ItemShelvingParkingVO>> {
override fun onFailure(call: Call<List<ItemShelvingParkingVO>>, t: Throwable) {

View File

@ -72,8 +72,8 @@ class ShowTicketFragment(var menuOrigin: String) : BaseFragment<FragmentControla
password = getData(PASSWORD),
sectorFk = getData(SECTORFK),
collectionFk = binding.scanInput.text.toString(),
type = type,
callFunction = "collection_getTickets"
type = type
)
}
binding.scanInput.setText("")

View File

@ -26,7 +26,7 @@ class ShowTicketViewModel(context: Context) : BaseViewModel() {
val responseTicket: LiveData<ResponseItemVO>
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<CollectionVO> {
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {

View File

@ -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())

View File

@ -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()) {

View File

@ -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
}

View File

@ -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(){

View File

@ -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()

View File

@ -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()

View File

@ -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"

View File

@ -21,7 +21,6 @@
<string name="Tamaño">Tamaño</string>
<string name="Matrícula">Matrícula</string>
<string name="Visible">Visible</string>
<string name="Finalizar">Finalizar</string>
<string name="Destino">Destino</string>
<string name="Nicho">Nicho</string>
<string name="Entrar">Entrar</string>
@ -119,7 +118,7 @@
<string name="vehiclecontrol">Control vehículos</string>
<string name="Worker">Trabajador</string>
<string name="vehiclediary">Histórico del vehículo</string>
<string name="SmarttagAssociate">Asociar SmartTag Sacador</string>
<string name="smarttagAssociate">Asociar SmartTag Sacador</string>
<string name="vehiclecontroluser">Control de usuario</string>
<string name="SmarttagRegister">Registro de Smarttags</string>
<string name="registered_vehiclecontrol">El usuario lleva la máquina:</string>
@ -164,4 +163,49 @@
<string name="claim">Ubicación de reclamación</string>
<string name="claims">Reclamaciones</string>
<string name="scanPallet">Escáner paletizar</string>
<string name="operationSuccess">Realizado correctamente</string>
<string name="settings">Configuración</string>
<string name="itemCard">Artículo info</string>
<string name="noResults">Sin resultados</string>
<string name="noDataLabelScanned">No se ha podido obtener datos de la etiqueta escaneada.</string>
<string name="reloadItemData">Recarga datos del elemento escaneado/seleccionado</string>
<string name="showHistoricalItem">Ver Histórico del ítem</string>
<string name="printTicket">Imprime ticket</string>
<string name="addItem">Añade ítem</string>
<string name="showFacePicker">Visualiza la foto del sacador</string>
<string name="callPicker">Realiza llamada al sacador</string>
<string name="allowSelectVehicle">Permite coger vehículo</string>
<string name="closeSession">Cerrar Sesión</string>
<string name="stickers">Stickers</string>
<string name="smarttags">SmartTags</string>
<string name="userVehicleControl">Control de usuario de vehículo</string>
<string name="error">Error</string>
<string name="sectors">Sectores</string>
<string name="printers">Impresoras</string>
<string name="androidid">Android_id</string>
<string name="baseurl">base_url</string>
<string name="SmarttagAssociate">Asociar SmartTag</string>
<string name="insertedLabel">Carro/etiqueta insertado</string>
<string name="labelNovalid">Etiqueta o carro no válido</string>
<string name="close">Cerrar</string>
<string name="deletedLabel">Carro/etiqueta borrada</string>
<string name="end">Finalizar</string>
<string name="undone">Deshacer</string>
<string name="labels">\"Etiquetas: \"</string>
<string name="nameApp">warehouse</string>
<string name="scanSmarttagOrShelving">Escanea etiqueta/s electrónica/s o matrícula/s</string>
<string name="scanHighLabel">Escanea etiqueta superior</string>
<string name="scanMedLabel">Escanea etiqueta del medio</string>
<string name="scanLowLabel">Escanea etiqueta inferior</string>
<string name="scannedWagon">Carro:</string>
<string name="scanned">Escaneado:</string>
<string name="speedProblems">Problemas con la velocidad de internet. No se puede usar la voz</string>
<string name="allowParking">Permite aparcar ticket/carro</string>
<string name="allowTakeoffVehicle">Permite dejar el vehículo</string>
<string name="newCollection">Genera colección para sacar</string>
<string name="showFilter">\"Ver filtro \"</string>
<string name="showFaults">Ver movimientos de Faltas</string>
<string name="showTrash">Ver movimientos de Basura</string>
<string name="filterFlower">Filtra por tipo de flor</string>
<string name="noprinter">Sin impresora</string>
</resources>

View File

@ -20,7 +20,6 @@
<string name="Tamaño">Size</string>
<string name="Matrícula">Registration number</string>
<string name="Visible">Visible</string>
<string name="Finalizar">Finalize</string>
<string name="Destino">Destination</string>
<string name="Nicho">Niche</string>
<string name="Entrar">Log In</string>
@ -162,5 +161,50 @@
<string name="buscarDepartamento">Find department</string>
<string name="claim">Claim Ubication</string>
<string name="claims">Claims</string>
<string name="operationSuccess"> done successful</string>
<string name="settings">Settings</string>
<string name="itemCard">Item info</string>
<string name="noResults">No results</string>
<string name="noDataLabelScanned">No data for label scanned</string>
<string name="reloadItemData">Reload item data</string>
<string name="showHistoricalItem">Show historical item</string>
<string name="printTicket">Print ticket</string>
<string name="addItem">Add item</string>
<string name="showFacePicker">Show face picker</string>
<string name="callPicker">Call picker</string>
<string name="allowSelectVehicle">Allows to select a vehicle</string>
<string name="closeSession">Sign off</string>
<string name="stickers">Stickers</string>
<string name="smarttags">SmartTags</string>
<string name="userVehicleControl">User control vehicle</string>
<string name="error">Error</string>
<string name="sectors">Sectors</string>
<string name="printers">Printers</string>
<string name="androidid">Android_id</string>
<string name="baseurl">base_url</string>
<string name="smarttagAssociate">Associate SmartTag Punch</string>
<string name="insertedLabel">Carro/etiqueta insertado</string>
<string name="labelNovalid">Etiqueta o carro no válido</string>
<string name="close">Cerrar</string>
<string name="deletedLabel">Carro/etiqueta borrada</string>
<string name="end">Finalizar</string>
<string name="undone">Deshacer</string>
<string name="labels">\"Etiquetas: \"</string>
<string name="nameApp">warehouse</string>
<string name="scanSmarttagOrShelving">Escanea etiqueta/s electrónica/s o matrícula/s</string>
<string name="scanHighLabel">Escanea etiqueta superior</string>
<string name="scanMedLabel">Escanea etiqueta del medio</string>
<string name="scanLowLabel">Escanea etiqueta inferior</string>
<string name="scannedWagon">Carro escaneado</string>
<string name="scanned">Escaneado:</string>
<string name="speedProblems">Problemas con la velocidad de internet. No se puede usar la voz</string>
<string name="allowParking">Permite aparcar ticket/carro</string>
<string name="allowTakeoffVehicle">Permite dejar el vehículo</string>
<string name="newCollection">Genera colección para sacar</string>
<string name="showFilter">\"Ver filtro \"</string>
<string name="showFaults">Ver movimientos de Faltas</string>
<string name="showTrash">Ver movimientos de Basura</string>
<string name="filterFlower">Filtra por tipo de flor</string>
<string name="noprinter">Sin impresora</string>
</resources>