Version 8.4.1Beta, return "finish", strings y quitado test rocket
This commit is contained in:
parent
03f825ad3e
commit
43350c66d6
|
@ -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>
|
|
|
@ -14,8 +14,9 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 117
|
versionCode 118
|
||||||
versionName "8.4Beta" //versionCode 117: return i workerAppTester
|
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...
|
//versionName "8.3" //versionCode 116: versionCode 116: cambios finales en return, diseño grafico...
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import retrofit2.converter.gson.GsonConverterFactory
|
||||||
class ApiSalixUtils {
|
class ApiSalixUtils {
|
||||||
companion object {
|
companion object {
|
||||||
//const val BASE_URL:String = "http://192.168.1.155:9009/"
|
//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/"
|
const val BASE_URL: String = "https://salix.verdnatura.es/api/"
|
||||||
fun getApiService(): SalixService {
|
fun getApiService(): SalixService {
|
||||||
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
|
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.concurrent.TimeUnit
|
||||||
class ApiUtils {
|
class ApiUtils {
|
||||||
companion object {
|
companion object {
|
||||||
//const val BASE_URL:String = "http://192.168.1.54:8009/"
|
//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/"
|
const val BASE_URL: String = "https://app.verdnatura.es/"
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun collectionNew(
|
fun collectionNewSmarttag(
|
||||||
usuario: String,
|
usuario: String,
|
||||||
password: String,
|
password: String,
|
||||||
sectorFk: String,
|
sectorFk: String,
|
||||||
|
@ -340,7 +340,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
||||||
quantityFk: String,
|
quantityFk: String,
|
||||||
ticketFk: String,
|
ticketFk: String,
|
||||||
warehouseFk: String
|
warehouseFk: String
|
||||||
): Call<String> {
|
): Call<Any> {
|
||||||
val params: ArrayList<String> = ArrayList()
|
val params: ArrayList<String> = ArrayList()
|
||||||
params.add(itemFk)
|
params.add(itemFk)
|
||||||
params.add(quantityFk)
|
params.add(quantityFk)
|
||||||
|
|
|
@ -469,7 +469,7 @@ interface VerdnaturaService {
|
||||||
@Header("Content-Type") content_type: String,
|
@Header("Content-Type") content_type: String,
|
||||||
@Body params: List<String>
|
@Body params: List<String>
|
||||||
):
|
):
|
||||||
Call<String>
|
Call<Any>
|
||||||
|
|
||||||
@POST("almacennew/saleMove")//REVISADA
|
@POST("almacennew/saleMove")//REVISADA
|
||||||
fun saleMove(
|
fun saleMove(
|
||||||
|
|
|
@ -44,7 +44,6 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
Fragment(), TextToSpeech.OnInitListener, RecognitionListener {
|
Fragment(), TextToSpeech.OnInitListener, RecognitionListener {
|
||||||
|
|
||||||
protected val TAG = "VERDNATURA"
|
protected val TAG = "VERDNATURA"
|
||||||
protected val TD = "VERDNATURA:"
|
|
||||||
protected val PREFS_USER = "es.verdnatura.user.prefs"
|
protected val PREFS_USER = "es.verdnatura.user.prefs"
|
||||||
protected val USERFK = "userFk"
|
protected val USERFK = "userFk"
|
||||||
protected val USER = "user"
|
protected val USER = "user"
|
||||||
|
@ -91,14 +90,14 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
protected val ERROR = -1
|
protected val ERROR = -1
|
||||||
|
|
||||||
|
|
||||||
val allowedStrings =
|
/*val allowedStrings =
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
"cero", "uno", "dos", "tres", "cuatro", "cinco", "seis", "siete",
|
"cero", "uno", "dos", "tres", "cuatro", "cinco", "seis", "siete",
|
||||||
"ocho", "nueve", "diez", "once", "doce", "trece", "catorce",
|
"ocho", "nueve", "diez", "once", "doce", "trece", "catorce",
|
||||||
"quince", "dieziseis", "diezisiete", "dieziocho", "diezinueve", "veinte",
|
"quince", "dieziseis", "diezisiete", "dieziocho", "diezinueve", "veinte",
|
||||||
"treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa",
|
"treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa",
|
||||||
"cien", "mil"
|
"cien", "mil"
|
||||||
)
|
)*/
|
||||||
|
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
override fun onAttach(context: Context) {
|
||||||
|
@ -224,43 +223,44 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
|
|
||||||
return when (image) {
|
return when (image) {
|
||||||
//itemCard
|
//itemCard
|
||||||
R.drawable.ic_autorenew_black_24dp -> "Recarga datos del elemento escaneado/seleccionado"
|
R.drawable.ic_autorenew_black_24dp -> {
|
||||||
R.drawable.ic_history_black_24dp -> "Ver Histórico del ítem"
|
getString(R.string.reloadItemData)
|
||||||
|
}
|
||||||
|
R.drawable.ic_history_black_24dp -> getString(R.string.showHistoricalItem)
|
||||||
//presacador
|
//presacador
|
||||||
R.drawable.ic_local_parking_black_24dp->"Permite aparcar ticket/carro"
|
R.drawable.ic_local_parking_black_24dp->getString(R.string.allowParking)
|
||||||
//collection
|
//collection
|
||||||
R.drawable.ic_print_black_24dp->"Imprime ticket"
|
R.drawable.ic_print_black_24dp->getString(R.string.printTicket)
|
||||||
R.drawable.ic_playlist_add_black_24dp->"Añade ítem"
|
R.drawable.ic_playlist_add_black_24dp->getString(R.string.addItem)
|
||||||
R.drawable.ic_worker->"Visualiza la foto del sacador"
|
R.drawable.ic_worker->getString(R.string.showFacePicker)
|
||||||
R.drawable.phone_call->"Realiza llamada al sacador"
|
R.drawable.phone_call->getString(R.string.callPicker)
|
||||||
R.drawable.car->"Permite coger vehículo"
|
R.drawable.car->getString(R.string.allowSelectVehicle)
|
||||||
R.drawable.car_off->"Permite dejar el vehículo"
|
R.drawable.car_off->getString(R.string.allowTakeoffVehicle)
|
||||||
//REPETIDO:R.drawable.ic_history_black_24dp->"Realiza llamada al sacador"
|
//REPETIDO:R.drawable.ic_history_black_24dp->"Realiza llamada al sacador"
|
||||||
//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"
|
//REPETIDO: R.drawable.car->"Permite coger vehículo"
|
||||||
//ubicador:
|
//ubicador:
|
||||||
//REPETIDO: R.drawable.ic_add_black_24dp->"Genera colección para sacar"
|
//REPETIDO: R.drawable.ic_add_black_24dp->"Genera colección para sacar"
|
||||||
//REPETIDO: ic_autorenew_black_24dp
|
//REPETIDO: ic_autorenew_black_24dp
|
||||||
//historico articulo
|
//historico articulo
|
||||||
R.drawable.ic_transaction->"Ver filtro "
|
R.drawable.ic_transaction->getString(R.string.showFilter)
|
||||||
R.drawable.alpha_f_circle_outline->"Ver movimientos de Faltas"
|
R.drawable.alpha_f_circle_outline->getString(R.string.showFaults)
|
||||||
R.drawable.alpha_b_circle_outline->"Ver movimientos de Basura"
|
R.drawable.alpha_b_circle_outline->getString(R.string.showTrash)
|
||||||
|
|
||||||
R.drawable.filter_outline->"Filtra por tipo de flor"
|
R.drawable.filter_outline->getString(R.string.filterFlower)
|
||||||
R.drawable.previous_delete->"Quita de pantalla lo que ya está sacado ( misma función que escanear 2.000.000)"
|
|
||||||
else -> {""}
|
else -> {""}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onInit(status: Int) {
|
override fun onInit(status: Int) {
|
||||||
if (status == TextToSpeech.SUCCESS) {
|
/* if (status == TextToSpeech.SUCCESS) {
|
||||||
val spanish = Locale("es", "ES")
|
val spanish = Locale("es", "ES")
|
||||||
textToSpeech!!.language = spanish
|
textToSpeech!!.language = spanish
|
||||||
textToSpeech!!.setOnUtteranceProgressListener(object : UtteranceProgressListener() {
|
textToSpeech!!.setOnUtteranceProgressListener(object : UtteranceProgressListener() {
|
||||||
override fun onDone(utteranceId: String?) {
|
override fun onDone(utteranceId: String?) {
|
||||||
Log.i("SPEEAK", "on done")
|
//Log.i("SPEEAK", "on done")
|
||||||
requireActivity().runOnUiThread(Runnable {
|
requireActivity().runOnUiThread(Runnable {
|
||||||
if (mSpeechRecognizer != null) {
|
if (mSpeechRecognizer != null) {
|
||||||
mSpeechRecognizer!!.destroy()
|
mSpeechRecognizer!!.destroy()
|
||||||
|
@ -284,7 +284,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
"La voz no se ha podido iniciar".toast(requireContext())
|
"La voz no se ha podido iniciar".toast(requireContext())
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun runSound() {
|
private fun runSound() {
|
||||||
|
@ -315,29 +315,29 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
|
|
||||||
override fun onReadyForSpeech(params: Bundle?) {
|
override fun onReadyForSpeech(params: Bundle?) {
|
||||||
isOnReadyForSpeech = true
|
isOnReadyForSpeech = true
|
||||||
Log.i("Speech", "onReadyForSpeech")
|
// Log.i("Speech", "onReadyForSpeech")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBeginningOfSpeech() {
|
override fun onBeginningOfSpeech() {
|
||||||
Log.i("Speech", "onBeginningOfSpeech")
|
// Log.i("Speech", "onBeginningOfSpeech")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onRmsChanged(rmsdB: Float) {}
|
override fun onRmsChanged(rmsdB: Float) {}
|
||||||
|
|
||||||
override fun onBufferReceived(buffer: ByteArray?) {
|
override fun onBufferReceived(buffer: ByteArray?) {
|
||||||
Log.i("Speech", "onBufferReceived")
|
// Log.i("Speech", "onBufferReceived")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onEndOfSpeech() {
|
override fun onEndOfSpeech() {
|
||||||
Log.i("Speech", "onEndOfSpeech")
|
// Log.i("Speech", "onEndOfSpeech")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(error: Int) {
|
override fun onError(error: Int) {
|
||||||
if (!isOnReadyForSpeech && error == SpeechRecognizer.ERROR_NO_MATCH) {
|
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
|
return
|
||||||
} else {
|
} else {
|
||||||
Log.i("Speech", "onError " + error)
|
//Log.i("Speech", "onError " + error)
|
||||||
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
|
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
|
||||||
mSpeechRecognizer = null
|
mSpeechRecognizer = null
|
||||||
initialize()
|
initialize()
|
||||||
|
@ -348,11 +348,11 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
override fun onResults(results: Bundle) {}
|
override fun onResults(results: Bundle) {}
|
||||||
|
|
||||||
override fun onPartialResults(partialResults: Bundle?) {
|
override fun onPartialResults(partialResults: Bundle?) {
|
||||||
Log.i("Speech", "onPartialResults")
|
//Log.i("Speech", "onPartialResults")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onEvent(eventType: Int, params: Bundle?) {
|
override fun onEvent(eventType: Int, params: Bundle?) {
|
||||||
Log.i("Speech", "onEvent")
|
//Log.i("Speech", "onEvent")
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun checkText(text: String): Int {
|
open fun checkText(text: String): Int {
|
||||||
|
@ -523,7 +523,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
WAREHOUSEFK->prefs.getInt(name, ConstAndValues.WAREHOUSEFKDEFAULT).toString()
|
WAREHOUSEFK->prefs.getInt(name, ConstAndValues.WAREHOUSEFKDEFAULT).toString()
|
||||||
VOZ->prefs.getString(name, "NO").toString()
|
VOZ->prefs.getString(name, "NO").toString()
|
||||||
WAGON->prefs.getInt(name, 2).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()
|
SECTORDESCRIP->prefs.getString(name,getString(R.string.Sinsector)).toString()
|
||||||
BUYER->prefs.getString(name,"").toString()
|
BUYER->prefs.getString(name,"").toString()
|
||||||
BUYERID->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()
|
DEPARTMENTMISTAKE->prefs.getString(name,"").toString()
|
||||||
DEPARTMENTMISTAKEID->prefs.getString(name,"").toString()
|
DEPARTMENTMISTAKEID->prefs.getString(name,"").toString()
|
||||||
PRINTERFK->prefs.getInt(name,0).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"->{
|
"base_url"->{
|
||||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
preferences.getString("base_url","").toString()
|
preferences.getString(getString(R.string.baseurl),"").toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {""}
|
else -> {""}
|
||||||
|
|
|
@ -46,7 +46,7 @@ class AjustesAdapter (
|
||||||
|
|
||||||
this.item = item
|
this.item = item
|
||||||
|
|
||||||
if (item.title=="Cerrar Sesión"){
|
if (item.title==context!!.getString(R.string.closeSession)){
|
||||||
binding.itemTitle.setTextColor(
|
binding.itemTitle.setTextColor(
|
||||||
ContextCompat.getColor(
|
ContextCompat.getColor(
|
||||||
context!!,
|
context!!,
|
||||||
|
|
|
@ -63,9 +63,7 @@ class AjustesFragment :
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
//ma.hideBottomNavigationFragment(View.VISIBLE)
|
binding.mainToolbar.toolbarTitle.text=getString(R.string.settings)
|
||||||
|
|
||||||
binding.mainToolbar.toolbarTitle.text="Configuración"
|
|
||||||
hideBackButton(binding.mainToolbar)
|
hideBackButton(binding.mainToolbar)
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,7 +77,7 @@ class AjustesFragment :
|
||||||
binding.androididText.setText(
|
binding.androididText.setText(
|
||||||
getData(ANDROID_ID)
|
getData(ANDROID_ID)
|
||||||
)
|
)
|
||||||
binding.txtserver.setText(getData("base_url"))
|
binding.txtserver.setText(getData(getString(R.string.baseurl)))
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -130,15 +128,15 @@ class AjustesFragment :
|
||||||
|
|
||||||
} else if (item.id == 3) {
|
} else if (item.id == 3) {
|
||||||
val listTagsType: ArrayList<String> = ArrayList()
|
val listTagsType: ArrayList<String> = ArrayList()
|
||||||
listTagsType.add("Stickers")
|
listTagsType.add(getString(R.string.stickers))
|
||||||
listTagsType.add("SmartTags")
|
listTagsType.add(getString(R.string.smarttags))
|
||||||
tagsList = listTagsType
|
tagsList = listTagsType
|
||||||
val array = arrayOfNulls<String>(listTagsType.size)
|
val array = arrayOfNulls<String>(listTagsType.size)
|
||||||
showItemPickerType(array = listTagsType.toArray(array))
|
showItemPickerType(array = listTagsType.toArray(array))
|
||||||
} else if (item.id == 4) {
|
} else if (item.id == 4) {
|
||||||
ma.onPasillerosItemClickListener(
|
ma.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
title = "Control de usuario de vehículo"
|
title = getString(R.string.userVehicleControl)
|
||||||
), getData(USERFK)
|
), getData(USERFK)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -166,7 +164,7 @@ class AjustesFragment :
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
binding.splashProgress.visibility = View.INVISIBLE
|
binding.splashProgress.visibility = View.INVISIBLE
|
||||||
if (it.list.isNotEmpty() && it.list.get(0).isError) {
|
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)) {
|
.setOkButton(getString(R.string.Close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -182,7 +180,7 @@ class AjustesFragment :
|
||||||
showDialogSector(listSectores.toArray(array))
|
showDialogSector(listSectores.toArray(array))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
customDialog.setTitle("Sectores")
|
customDialog.setTitle(getString(R.string.sectors))
|
||||||
.setDescription(getString(R.string.Noexistessectores))
|
.setDescription(getString(R.string.Noexistessectores))
|
||||||
.setOkButton(getString(R.string.Close)) {
|
.setOkButton(getString(R.string.Close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
|
@ -196,7 +194,7 @@ class AjustesFragment :
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
binding.splashProgress.visibility = View.INVISIBLE
|
binding.splashProgress.visibility = View.INVISIBLE
|
||||||
if (it.list.isNotEmpty() && it.list.get(0).isError) {
|
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)) {
|
.setOkButton(getString(R.string.Close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -212,7 +210,7 @@ class AjustesFragment :
|
||||||
showDialogPrinters(listPrinters.toArray(array))
|
showDialogPrinters(listPrinters.toArray(array))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
customDialog.setTitle("Impresoras")
|
customDialog.setTitle(getString(R.string.printers))
|
||||||
.setDescription(getString(R.string.Noprinters))
|
.setDescription(getString(R.string.Noprinters))
|
||||||
.setOkButton(getString(R.string.Close)) {
|
.setOkButton(getString(R.string.Close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
|
@ -272,7 +270,6 @@ class AjustesFragment :
|
||||||
viewModel.ajustesitem.get(0).sectorFk = it.id
|
viewModel.ajustesitem.get(0).sectorFk = it.id
|
||||||
viewModel.ajustesitem.get(0).warehouse = it.warehouseFk
|
viewModel.ajustesitem.get(0).warehouse = it.warehouseFk
|
||||||
viewModel.ajustesitem.get(0).selected = it.description
|
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())
|
viewModel.worker_updateSector(getData(USER),getData(PASSWORD),it.id.toString())
|
||||||
ajustesAdapter!!.notifyDataSetChanged()
|
ajustesAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
|
@ -382,7 +379,7 @@ class AjustesFragment :
|
||||||
|
|
||||||
private fun copyanddrag(string: String): Boolean {
|
private fun copyanddrag(string: String): Boolean {
|
||||||
val clipboard = getActivity()?.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
|
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)
|
clipboard.setPrimaryClip(clip)
|
||||||
setTooltipText(binding.androididText, getString(R.string.copied))
|
setTooltipText(binding.androididText, getString(R.string.copied))
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -2,8 +2,6 @@ package es.verdnatura.presentation.view.feature.ajustes.fragment
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
|
||||||
import android.util.Printer
|
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.Transformations
|
import androidx.lifecycle.Transformations
|
||||||
|
@ -22,192 +20,237 @@ import timber.log.Timber.d
|
||||||
|
|
||||||
class AjustesViewModel(context: Context) : BaseViewModel() {
|
class AjustesViewModel(context: Context) : BaseViewModel() {
|
||||||
|
|
||||||
private val getAjustesUserCase:GetAjustesUserCase = GetAjustesUserCase(context)
|
private val getAjustesUserCase: GetAjustesUserCase = GetAjustesUserCase(context)
|
||||||
val version : String = "5.0.0"
|
val version: String = "5.0.0"
|
||||||
|
|
||||||
private val _ajustesitem by lazy { ArrayList<AjustesItemVO>() }
|
private val _ajustesitem by lazy { ArrayList<AjustesItemVO>() }
|
||||||
val ajustesitem: List<AjustesItemVO>
|
val ajustesitem: List<AjustesItemVO>
|
||||||
get() = _ajustesitem
|
get() = _ajustesitem
|
||||||
|
|
||||||
private val _sectorList by lazy { MutableLiveData<SectorListVO>() }
|
private val _sectorList by lazy { MutableLiveData<SectorListVO>() }
|
||||||
val sectorList: LiveData<SectorListVO>
|
val sectorList: LiveData<SectorListVO>
|
||||||
get() = _sectorList
|
get() = _sectorList
|
||||||
|
|
||||||
private val _workerupdateSector by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _workerupdateSector by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val workerupdateSector: LiveData<ResponseItemVO>
|
val workerupdateSector: LiveData<ResponseItemVO>
|
||||||
get() = _workerupdateSector
|
get() = _workerupdateSector
|
||||||
|
|
||||||
private val _workerupdatePrinter by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _workerupdatePrinter by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val workerupdatePrinter: LiveData<ResponseItemVO>
|
val workerupdatePrinter: LiveData<ResponseItemVO>
|
||||||
get() = _workerupdatePrinter
|
get() = _workerupdatePrinter
|
||||||
|
|
||||||
private val _printerList by lazy { MutableLiveData<PrintersList>() }
|
private val _printerList by lazy { MutableLiveData<PrintersList>() }
|
||||||
val printerList: LiveData<PrintersList>
|
val printerList: LiveData<PrintersList>
|
||||||
get
|
get
|
||||||
() = _printerList
|
() = _printerList
|
||||||
|
|
||||||
|
|
||||||
val loadSectorList = Transformations.map(_sectorList) {Event(it)}
|
val loadSectorList = Transformations.map(_sectorList) { Event(it) }
|
||||||
val loadprintersList = Transformations.map(_printerList) {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(
|
||||||
_ajustesitem.add(
|
AjustesItemVO(
|
||||||
AjustesItemVO(0,
|
1,
|
||||||
"Sector",
|
"Carros",
|
||||||
sectorDescrip,
|
carroDescrip,
|
||||||
sectorFk,
|
0,
|
||||||
warehouseFk,
|
0,
|
||||||
0,
|
0, "Sin impresora"
|
||||||
printerSelected)
|
)
|
||||||
)
|
)
|
||||||
|
_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(
|
fun getSectors(user: String, password: String) {
|
||||||
AjustesItemVO(1,
|
getAjustesUserCase.getSectors(user, password)
|
||||||
"Carros",
|
.enqueue(object : Callback<List<SectorItemVO>> {
|
||||||
carroDescrip,
|
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
|
||||||
0,
|
val listError: ArrayList<SectorItemVO> = ArrayList()
|
||||||
0,
|
listError.add(SectorItemVO(0, "", 0, true, t.message!!))
|
||||||
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!!))
|
|
||||||
_sectorList.value = SectorListVO(listError)
|
_sectorList.value = SectorListVO(listError)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResponse(
|
override fun onResponse(
|
||||||
call: Call<List<SectorItemVO>>,
|
call: Call<List<SectorItemVO>>,
|
||||||
response: Response<List<SectorItemVO>>
|
response: Response<List<SectorItemVO>>
|
||||||
) {
|
) {
|
||||||
if (response.body() != null){
|
if (response.body() != null) {
|
||||||
_sectorList.value = response.body()?.let { SectorListVO(it) }
|
_sectorList.value = response.body()?.let { SectorListVO(it) }
|
||||||
}else{
|
} else {
|
||||||
val listError:ArrayList<SectorItemVO> = ArrayList()
|
val listError: ArrayList<SectorItemVO> = ArrayList()
|
||||||
listError.add(SectorItemVO(0,"",0,true,"Error en la llamada sector_get"))
|
listError.add(
|
||||||
_sectorList.value = SectorListVO(listError)
|
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>>{
|
fun getSectorsSalix(token: String) {
|
||||||
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
|
getAjustesUserCase.getSectorsSalix(token).enqueue(object : Callback<List<SectorItemVO>> {
|
||||||
val listError:ArrayList<SectorItemVO> = ArrayList()
|
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
|
||||||
listError.add(SectorItemVO(0,"",0,true,t.message!!))
|
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)
|
_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){
|
if (response.body() != null) {
|
||||||
_sectorList.value = response.body()?.let { SectorListVO(it) }
|
_printerList.value = response.body()?.let { PrintersList(it) }
|
||||||
}else{
|
} else {
|
||||||
val listError:ArrayList<SectorItemVO> = ArrayList()
|
val listError: ArrayList<Printers> = ArrayList()
|
||||||
listError.add(SectorItemVO(0,"",0,true,
|
listError.add(
|
||||||
getMessageFromAllResponse(nameofFunction(this),response.message())
|
Printers(
|
||||||
))
|
0, "", true,
|
||||||
_sectorList.value = SectorListVO(listError)
|
getMessageFromAllResponse(nameofFunction(this), response.message())
|
||||||
}
|
)
|
||||||
}
|
)
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
_printerList.value = PrintersList(listError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
})
|
||||||
|
}
|
||||||
|
|
||||||
override fun onResponse(
|
fun worker_updateSector(user: String, password: String, sectorFk: String) {
|
||||||
call: Call<List<Printers>>,
|
d("El sector marcado dentro es " + sectorFk)
|
||||||
response: Response<List<Printers>>
|
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){
|
override fun onResponse(
|
||||||
_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(
|
|
||||||
call: Call<Unit>,
|
call: Call<Unit>,
|
||||||
response: Response<Unit>
|
response: Response<Unit>
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (!response.isSuccessful()){
|
if (!response.isSuccessful()) {
|
||||||
_workerupdateSector.value=ResponseItemVO(
|
_workerupdateSector.value = ResponseItemVO(
|
||||||
isError = true,
|
isError = true,
|
||||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
errorMessage = getMessageFromAllResponse(
|
||||||
)
|
nameofFunction(this),
|
||||||
}else{
|
response.message()
|
||||||
_workerupdateSector.value=ResponseItemVO(response="Actualizado sector",isError = false, errorMessage ="Actualizado sector")
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
_workerupdateSector.value = ResponseItemVO(
|
||||||
|
response = "Actualizado sector",
|
||||||
|
isError = false,
|
||||||
|
errorMessage = "Actualizado sector"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (response.body() != null){
|
/*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"))
|
listError.add(SectorItemVO(0,"",0,true,"Error en la llamada sector_get"))
|
||||||
_sectorList.value = SectorListVO(listError)
|
_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>,
|
call: Call<Unit>,
|
||||||
response: Response<Unit>
|
response: Response<Unit>
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (!response.isSuccessful()){
|
if (!response.isSuccessful()) {
|
||||||
_workerupdatePrinter.value=ResponseItemVO(
|
_workerupdatePrinter.value = ResponseItemVO(
|
||||||
isError = true,
|
isError = true,
|
||||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
errorMessage = getMessageFromAllResponse(
|
||||||
)
|
nameofFunction(this),
|
||||||
}else{
|
response.message()
|
||||||
_workerupdatePrinter.value=ResponseItemVO(response="Actualizada impresora",isError = false, errorMessage ="Actualizada impresora")
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
_workerupdatePrinter.value = ResponseItemVO(
|
||||||
|
response = "Actualizada impresora",
|
||||||
|
isError = false,
|
||||||
|
errorMessage = "Actualizada impresora"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ class AjustesItemVO (
|
||||||
|
|
||||||
class SectorItemVO (
|
class SectorItemVO (
|
||||||
var id: Int,
|
var id: Int,
|
||||||
var description:String = "des",
|
var description:String = "",
|
||||||
val warehouseFk:Int?,
|
val warehouseFk:Int?,
|
||||||
val isError : Boolean = false,
|
val isError : Boolean = false,
|
||||||
var errorMessage : String = ""
|
var errorMessage : String = ""
|
||||||
|
|
|
@ -188,7 +188,7 @@ class ItemCardFragment(
|
||||||
if (working_in_test){
|
if (working_in_test){
|
||||||
viewModel.getItemPackingTypeSalix(getData(TOKEN))
|
viewModel.getItemPackingTypeSalix(getData(TOKEN))
|
||||||
}else {
|
}else {
|
||||||
viewModel.getItemPackingType(getData(USER), getData(PASSWORD), "get_ItemPackingType")
|
viewModel.getItemPackingType(getData(USER), getData(PASSWORD))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ class ItemCardFragment(
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.itemcardLayout.visibility = GONE
|
binding.itemcardLayout.visibility = GONE
|
||||||
binding.splashProgressTwo.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)
|
ma.messageWithSound(it.errorMessage,true,false)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -209,8 +209,8 @@ class ItemCardFragment(
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgressTwo.visibility = GONE
|
binding.splashProgressTwo.visibility = GONE
|
||||||
binding.itemcardLayout.visibility = View.GONE
|
binding.itemcardLayout.visibility = View.GONE
|
||||||
binding.mainToolbar.toolbarTitle.text = "ItemCard"
|
binding.mainToolbar.toolbarTitle.text =getString(R.string.itemCard)
|
||||||
ma.messageWithSound("No hemos podido encontrar el articulo. Revisa el sector.",true,false,"Sin resultados")
|
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){
|
}catch (e:Exception){
|
||||||
binding.itemcardLayout.visibility = View.GONE
|
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()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
@ -686,7 +686,7 @@ class ItemCardFragment(
|
||||||
updateBarcode(customDialogList.getValue(), "0", itemB)
|
updateBarcode(customDialogList.getValue(), "0", itemB)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
||||||
}.setKoButton("Cerrar") {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
|
|
|
@ -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 :
|
getItemCardUserCase.getItemPackingType(user, password).enqueue(object :
|
||||||
Callback<List<ItemPackingType>> {
|
Callback<List<ItemPackingType>> {
|
||||||
override fun onFailure(call: Call<List<ItemPackingType>>, t: Throwable) {
|
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>{
|
getItemCardUserCase.itemStockUpdate(user,password,itemFk,warehouseFk,newValue,isTrash).enqueue(object : Callback<Any>{
|
||||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||||
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada $callFunction."+t.message!!)
|
_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>{
|
getItemCardUserCase.itemPlacementSave(user,password,itemFk,warehouseFk,value).enqueue(object : Callback<String>{
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
_response.value = ResponseItemVO(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
_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"
|
//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>{
|
getItemCardUserCase.updatePackingType(user,password,itemFk,itemPackingType).enqueue(object : Callback<Boolean>{
|
||||||
override fun onFailure(call: Call<Boolean>, t: Throwable) {
|
override fun onFailure(call: Call<Boolean>, t: Throwable) {
|
||||||
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||||
|
|
|
@ -17,7 +17,6 @@ class BufferFragment(
|
||||||
private var password = ""
|
private var password = ""
|
||||||
private var goBack: Boolean = false
|
private var goBack: Boolean = false
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_buffer
|
override fun getLayoutId(): Int = R.layout.fragment_buffer
|
||||||
//private lateinit var customDialog: CustomDialog
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = BufferFragment(entryPoint)
|
fun newInstance(entryPoint: String) = BufferFragment(entryPoint)
|
||||||
|
@ -27,7 +26,6 @@ class BufferFragment(
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
//customDialog = CustomDialog(requireContext())
|
|
||||||
setToolbar()
|
setToolbar()
|
||||||
setEvents()
|
setEvents()
|
||||||
super.init()
|
super.init()
|
||||||
|
@ -59,19 +57,20 @@ class BufferFragment(
|
||||||
|
|
||||||
|
|
||||||
when (entryPoint){
|
when (entryPoint){
|
||||||
"Vaciado buffer"->entryPoint="UNLOADING"
|
|
||||||
"Llenado buffer"-> entryPoint="LOADING"
|
getString(R.string.bufferempty)->entryPoint="UNLOADING"
|
||||||
"Acumulación buffer"->entryPoint="ACCUMULATION"
|
getString(R.string.bufferfill)-> entryPoint="LOADING"
|
||||||
"Desactivado buffer"->entryPoint="DISABLED"
|
getString(R.string.bufferaccumulate)->entryPoint="ACCUMULATION"
|
||||||
"Flejado buffer"->entryPoint="STRAPPING"
|
getString(R.string.bufferoff)->entryPoint="DISABLED"
|
||||||
|
getString(R.string.bufferfstrapping)->entryPoint="STRAPPING"
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.buffer_setTypeByName(
|
viewModel.buffer_setTypeByName(
|
||||||
getData(USER),
|
getData(USER),
|
||||||
getData(PASSWORD),
|
getData(PASSWORD),
|
||||||
binding.scanInput.text.toString(),
|
binding.scanInput.text.toString(),
|
||||||
entryPoint,
|
entryPoint
|
||||||
"buffer_setTypeByName"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +95,7 @@ class BufferFragment(
|
||||||
|
|
||||||
} else {
|
} 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()
|
binding.mainToolbar.backButton.performClick()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
GetPaletizadoresUserCase.buffer_setTypeByName(user, password, vBufferFk, vType)
|
||||||
.enqueue(object : Callback<Boolean> {
|
.enqueue(object : Callback<Boolean> {
|
||||||
override fun onFailure(call: Call<Boolean>, t: Throwable) {
|
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>{
|
GetPaletizadoresUserCase.expeditionLoading_add(usuario,password,vExpeditionFk, vBufferFk).enqueue(object : Callback<String>{
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
_bufferloadresponse.value = ResponseItemVO(
|
_bufferloadresponse.value = ResponseItemVO(
|
||||||
|
|
|
@ -80,8 +80,8 @@ class BufferLoadFragment(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password=getData(PASSWORD),
|
password=getData(PASSWORD),
|
||||||
vBufferFk = ExpeditionOrBuffer,
|
vBufferFk = ExpeditionOrBuffer,
|
||||||
vExpeditionFk = listTags.first().code.toString(),
|
vExpeditionFk = listTags.first().code.toString())
|
||||||
callFunction = "expeditionLoading_add")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemScaned = ExpeditionOrBuffer
|
itemScaned = ExpeditionOrBuffer
|
||||||
|
@ -154,7 +154,7 @@ class BufferLoadFragment(
|
||||||
private fun showExpeditionOrBufferScan() {
|
private fun showExpeditionOrBufferScan() {
|
||||||
|
|
||||||
customDialogList.setTitle("Escanea etiqueta de la expedición.")
|
customDialogList.setTitle("Escanea etiqueta de la expedición.")
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
|
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class BuscarItemFragment(
|
||||||
private fun getLocations(itemFk: String) {
|
private fun getLocations(itemFk: String) {
|
||||||
this.itemFk = itemFk
|
this.itemFk = itemFk
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.getLocations(getData(USER), getData(PASSWORD), itemFk, "getItemUbication")
|
viewModel.getLocations(getData(USER), getData(PASSWORD), itemFk)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
|
@ -27,7 +27,7 @@ class BuscarItemViewModel(context: Context) : BaseViewModel() {
|
||||||
val loadLocationList = Transformations.map(_locationList) { Event(it) }
|
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>> {
|
getBuscarItemUserCase.searchItemsUbicador(user,password,itemFk).enqueue(object : Callback<List<ItemLocationVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemLocationVO>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemLocationVO>>, t: Throwable) {
|
||||||
val listError:ArrayList<ItemLocationVO> = ArrayList()
|
val listError:ArrayList<ItemLocationVO> = ArrayList()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
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)
|
super.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
||||||
when(item){
|
when(item){
|
||||||
iconReload.drawable->{
|
iconReload.drawable->{
|
||||||
binding.splashProgress.visibility= View.VISIBLE
|
binding.splashProgress.visibility= View.VISIBLE
|
||||||
viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelving_BuyerGet")
|
viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class BuyersViewModel(context: Context) : BaseViewModel() {
|
||||||
val buyersList: LiveData<BuyerListVO>
|
val buyersList: LiveData<BuyerListVO>
|
||||||
get() = _buyersList
|
get() = _buyersList
|
||||||
|
|
||||||
fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){
|
fun itemShelvingBuyerGet(user:String,password:String){
|
||||||
getQualityUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
|
getQualityUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
|
||||||
Callback<List<BuyerVO>> {
|
Callback<List<BuyerVO>> {
|
||||||
override fun onFailure(call: Call<List<BuyerVO>>, t: Throwable) {
|
override fun onFailure(call: Call<List<BuyerVO>>, t: Throwable) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ class QaualityFragment(
|
||||||
override fun getLayoutId(): Int = R.layout.qauality_fragment
|
override fun getLayoutId(): Int = R.layout.qauality_fragment
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
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)
|
super.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ class QaualityFragment(
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
if (item == iconReload){
|
if (item == iconReload){
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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 {
|
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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class QaualityViewModel(context: Context) : BaseViewModel() {
|
||||||
get() = _response
|
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 :
|
getQualityUserCase.itemShelvingBuyerTask(user,password,userFk).enqueue(object :
|
||||||
Callback<List<ItemBuyerVO>> {
|
Callback<List<ItemBuyerVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemBuyerVO>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemBuyerVO>>, t: Throwable) {
|
||||||
|
|
|
@ -176,7 +176,7 @@ class ClaimFragment(
|
||||||
private fun showInputClaim() {
|
private fun showInputClaim() {
|
||||||
|
|
||||||
customDialogList.setTitle("Inserta el código de reclamación.")
|
customDialogList.setTitle("Inserta el código de reclamación.")
|
||||||
.setOkButton("Finalizar") {
|
.setOkButton(getString(R.string.end)) {
|
||||||
|
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
|
|
|
@ -158,9 +158,9 @@ class CollectionFragment(
|
||||||
setEvents()
|
setEvents()
|
||||||
setToolBar()
|
setToolBar()
|
||||||
|
|
||||||
if (type == SACADOR && getData(VOZ) != "NO") {
|
/* if (type == SACADOR && getData(VOZ) != "NO") {
|
||||||
setSpeak()
|
setSpeak()
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (collection.tickets.isNotEmpty()) {
|
if (collection.tickets.isNotEmpty()) {
|
||||||
createCollectionList()
|
createCollectionList()
|
||||||
|
@ -366,7 +366,7 @@ class CollectionFragment(
|
||||||
binding.mainToolbar.toolbarSubtitle.text = "0/0"
|
binding.mainToolbar.toolbarSubtitle.text = "0/0"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Aceptar") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
if (activity != null) requireActivity().onBackPressed()
|
if (activity != null) requireActivity().onBackPressed()
|
||||||
|
@ -406,7 +406,7 @@ class CollectionFragment(
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
if (it.list.get(0).isError){
|
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{
|
}else{
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ class CollectionFragment(
|
||||||
// if (!goBack) {
|
// if (!goBack) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage)
|
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -510,8 +510,8 @@ class CollectionFragment(
|
||||||
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
|
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
|
||||||
if (!goBack2) {
|
if (!goBack2) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -611,7 +611,7 @@ class CollectionFragment(
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Aceptar") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
@ -701,7 +701,7 @@ class CollectionFragment(
|
||||||
goBack = false
|
goBack = false
|
||||||
}
|
}
|
||||||
|
|
||||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Aceptar") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
@ -795,7 +795,7 @@ class CollectionFragment(
|
||||||
|
|
||||||
viewModel.sendChekingPresence(
|
viewModel.sendChekingPresence(
|
||||||
token = getData(TOKEN),
|
token = getData(TOKEN),
|
||||||
workerId = "19294",
|
workerId = salePerson,
|
||||||
message = message, "sendChekingPresence"
|
message = message, "sendChekingPresence"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1390,7 +1390,7 @@ class CollectionFragment(
|
||||||
"Escanea item para validar".toast(requireContext())
|
"Escanea item para validar".toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
}.setKoButton("Cerrar") {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
@ -1664,8 +1664,7 @@ class CollectionFragment(
|
||||||
itemFk = customDialogList.getValue(),
|
itemFk = customDialogList.getValue(),
|
||||||
ticketFk = ticketSelected,
|
ticketFk = ticketSelected,
|
||||||
quantityFk = customDialogList.getValueTwo(),
|
quantityFk = customDialogList.getValueTwo(),
|
||||||
warehouseFk = getData(WAREHOUSEFK),
|
warehouseFk = getData(WAREHOUSEFK)
|
||||||
callFunction = "collection_addItem"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1673,7 +1672,7 @@ class CollectionFragment(
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
}.setKoButton("Cerrar") {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.setHintValue(getString(R.string.Artículo)).setValue("")
|
}.setHintValue(getString(R.string.Artículo)).setValue("")
|
||||||
|
@ -1719,8 +1718,7 @@ class CollectionFragment(
|
||||||
itemFk = customDialogList.getValue(),
|
itemFk = customDialogList.getValue(),
|
||||||
ticketFk = ticketSelected,
|
ticketFk = ticketSelected,
|
||||||
quantityFk = customDialogList.getValueTwo(),
|
quantityFk = customDialogList.getValueTwo(),
|
||||||
warehouseFk = getData(WAREHOUSEFK),
|
warehouseFk = getData(WAREHOUSEFK)
|
||||||
callFunction = "collection_addItem"
|
|
||||||
)
|
)
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
@ -2473,7 +2471,7 @@ class CollectionFragment(
|
||||||
|
|
||||||
private fun showErrorMessage(text: String) {
|
private fun showErrorMessage(text: String) {
|
||||||
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
@ -2531,11 +2529,11 @@ class CollectionFragment(
|
||||||
//VOZ
|
//VOZ
|
||||||
override fun onResults(results: Bundle) {
|
override fun onResults(results: Bundle) {
|
||||||
super.onResults(results)
|
super.onResults(results)
|
||||||
Log.i("Speech", "onResults")
|
//Log.i("Speech", "onResults")
|
||||||
val matches = results
|
val matches = results
|
||||||
.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)
|
.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)
|
||||||
if (matches != null) {
|
if (matches != null) {
|
||||||
Log.i("RESPUESTA", matches[0])
|
//Log.i("RESPUESTA", matches[0])
|
||||||
mIsListening = false
|
mIsListening = false
|
||||||
mSpeechRecognizer!!.cancel()
|
mSpeechRecognizer!!.cancel()
|
||||||
getText(matches[0])
|
getText(matches[0])
|
||||||
|
|
|
@ -433,7 +433,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
||||||
itemFk: String,
|
itemFk: String,
|
||||||
quantityFk: String,
|
quantityFk: String,
|
||||||
ticketFk: String,
|
ticketFk: String,
|
||||||
warehouseFk: String, callFunction: String
|
warehouseFk: String
|
||||||
) {
|
) {
|
||||||
getSacadorControladorUserCase.collectionAddItem(
|
getSacadorControladorUserCase.collectionAddItem(
|
||||||
usuario,
|
usuario,
|
||||||
|
@ -442,15 +442,15 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
||||||
quantityFk,
|
quantityFk,
|
||||||
ticketFk,
|
ticketFk,
|
||||||
warehouseFk
|
warehouseFk
|
||||||
).enqueue(object : Callback<String> {
|
).enqueue(object : Callback<Any> {
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||||
_responseNew.value = ResponseItemVO(
|
_responseNew.value = ResponseItemVO(
|
||||||
isError = true,
|
isError = true,
|
||||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
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) {
|
if (!response.isSuccessful) {
|
||||||
_responseNew.value = ResponseItemVO(
|
_responseNew.value = ResponseItemVO(
|
||||||
|
@ -462,7 +462,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
_responseNew.value =
|
_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)
|
getSacadorControladorUserCase.getIdFromCode(usuario, password, code)
|
||||||
.enqueue(object : Callback<String> {
|
.enqueue(object : Callback<String> {
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ class ControladorFragment :
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
sectorFk = getData(SECTORFK),
|
sectorFk = getData(SECTORFK),
|
||||||
collectionFk = binding.scanInput.text.toString(),
|
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
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,isError = true, isPlayed = false)
|
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") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ControladorViewModel(context: Context) : BaseViewModel() {
|
||||||
get() = _collectionTicketList
|
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 :
|
getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object :
|
||||||
Callback<CollectionVO> {
|
Callback<CollectionVO> {
|
||||||
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||||
|
|
|
@ -180,7 +180,7 @@ class ControlVehiculoFragment(
|
||||||
// d("la fecha es "+getData("DATENOVEHICLE"))
|
// d("la fecha es "+getData("DATENOVEHICLE"))
|
||||||
//if (!IsNoVehicleDataToday()){
|
//if (!IsNoVehicleDataToday()){
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.workerMachinery_isRegistered(getData(USER),getData(PASSWORD),"workerMachinery_isRegistered")
|
viewModel.workerMachinery_isRegistered(getData(USER),getData(PASSWORD))
|
||||||
/*}else{
|
/*}else{
|
||||||
ma.openFragmentPickers()
|
ma.openFragmentPickers()
|
||||||
}*/
|
}*/
|
||||||
|
@ -321,16 +321,16 @@ class ControlVehiculoFragment(
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage,true,false)
|
||||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
} else {
|
} else {
|
||||||
if (it.response == "false") {
|
if (it.response == "false") {
|
||||||
|
|
||||||
customDialog.setTitle("Error")
|
customDialog.setTitle(getString(R.string.error))
|
||||||
.setDescription("Revisar llamada del registro de vehículos")
|
.setDescription("Revisar llamada del registro de vehículos")
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ class ControlVehiculoFragment(
|
||||||
//"Acción registrada correctamente".toast(context)
|
//"Acción registrada correctamente".toast(context)
|
||||||
/* customDialog.setTitle("Llamada correcta")
|
/* customDialog.setTitle("Llamada correcta")
|
||||||
.setDescription("Acción registrada satisfactoriamente")
|
.setDescription("Acción registrada satisfactoriamente")
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
ma.openFragmentPickers(true)
|
ma.openFragmentPickers(true)
|
||||||
|
@ -358,8 +358,8 @@ class ControlVehiculoFragment(
|
||||||
// Log.i("VERDNATURA:","${it.response}")
|
// Log.i("VERDNATURA:","${it.response}")
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage,true,false)
|
||||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
} else {
|
} else {
|
||||||
|
@ -368,7 +368,7 @@ class ControlVehiculoFragment(
|
||||||
setToolBar("OUT")
|
setToolBar("OUT")
|
||||||
/* customDialog.setTitle("Control de vehículos")
|
/* customDialog.setTitle("Control de vehículos")
|
||||||
.setDescription("SI Tienes coche asignado")
|
.setDescription("SI Tienes coche asignado")
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
if (!tagName.equals(SacadorFragment.TAG)) {
|
if (!tagName.equals(SacadorFragment.TAG)) {
|
||||||
|
|
|
@ -47,9 +47,9 @@ class ControlVehiculoUsuarioFragment(
|
||||||
if (userFk.equals(vUserFK)) {
|
if (userFk.equals(vUserFK)) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD),"machine_getWorkerPlate")
|
viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD))
|
||||||
viewModel.deviceProduction_getnameDevice(getData(USER),getData(PASSWORD), getData(ANDROID_ID),"deviceProduction_getnameDevice")
|
viewModel.deviceProduction_getnameDevice(getData(USER),getData(PASSWORD), getData(ANDROID_ID))
|
||||||
viewModel.deviceProductionUser_getWorker(getData(USER),getData(PASSWORD), getData(ANDROID_ID),"deviceProductionUser_getWorker")
|
viewModel.deviceProductionUser_getWorker(getData(USER),getData(PASSWORD), getData(ANDROID_ID))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
userFk = vUserFK
|
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)}")
|
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.nameVehiclecontrol.text = getData(USER)
|
||||||
binding.registeredVehiclecontrol.text = ""
|
binding.registeredVehiclecontrol.text = ""
|
||||||
binding.deviceName.text = ""
|
binding.deviceName.text = ""
|
||||||
|
@ -88,8 +88,8 @@ class ControlVehiculoUsuarioFragment(
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage,true,false)
|
||||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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(
|
getVehicleControlTimeUserCase.workerMachinery_isRegistered(
|
||||||
usuario,
|
usuario,
|
||||||
password
|
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(
|
getVehicleControlTimeUserCase.deviceProduction_getnameDevice(
|
||||||
usuario,
|
usuario,
|
||||||
password,
|
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(
|
getVehicleControlTimeUserCase.deviceProductionUser_getWorker(
|
||||||
usuario,
|
usuario,
|
||||||
password,
|
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(
|
getVehicleControlTimeUserCase.machine_getWorkerPlate(
|
||||||
usuario,
|
usuario,
|
||||||
password
|
password
|
||||||
|
|
|
@ -101,7 +101,7 @@ class DayOfSaleFragment(
|
||||||
|
|
||||||
private fun getItemsSaleDate(vShelvingFK: String) {
|
private fun getItemsSaleDate(vShelvingFK: String) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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)
|
binding.itemexpeditionstateRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
|
||||||
if (it.list.isEmpty()){
|
if (it.list.isEmpty()){
|
||||||
customDialog.setTitle("Sin resultados")
|
customDialog.setTitle(getString(R.string.noResults))
|
||||||
.setDescription("No hay nada vendido para el carro escaneado. ")
|
.setDescription("No hay nada vendido para el carro escaneado. ")
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if (it.list.get(0).isError){
|
if (it.list.get(0).isError){
|
||||||
ma.messageWithSound(it.list.get(0).errorMessage,it.list.get(0).isError,isPlayed = false)
|
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)
|
.setDescription(it.list.get(0).errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
}
|
}
|
||||||
|
@ -142,13 +142,13 @@ class DayOfSaleFragment(
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
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()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
customDialog.setTitle("Información").setDescription("Parking ok").setOkButton("Cerrar") {
|
customDialog.setTitle("Información").setDescription("Parking ok").setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class DayOfSaleFragment(
|
||||||
private fun showParking() {
|
private fun showParking() {
|
||||||
|
|
||||||
customDialogList.setTitle("Escanea el parking")
|
customDialogList.setTitle("Escanea el parking")
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
|
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
|
@ -196,8 +196,7 @@ class DayOfSaleFragment(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
parking = parking,
|
parking = parking,
|
||||||
scanItem = itemScan,
|
scanItem = itemScan)
|
||||||
callFunction="shelvingPark")
|
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel() {
|
||||||
|
|
||||||
val loadItemShelvingSaleDateList = Transformations.map(_itemShelvingSaleDateList) { Event(it) }
|
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 :
|
GetDayOfSaleUSerCase.itemShelving_getSaleDate(usuario,password,vShelvingFK).enqueue(object :
|
||||||
Callback<List<ItemShelvingSaleDate>> {
|
Callback<List<ItemShelvingSaleDate>> {
|
||||||
override fun onFailure(call: Call<List<ItemShelvingSaleDate>>, t: Throwable) {
|
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 :
|
GetDayOfSaleUSerCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
|
||||||
Callback<String> {
|
Callback<String> {
|
||||||
|
|
|
@ -188,8 +188,7 @@ class FaltasFragment :
|
||||||
getData(USER),
|
getData(USER),
|
||||||
getData(PASSWORD),
|
getData(PASSWORD),
|
||||||
item.itemFk,
|
item.itemFk,
|
||||||
getData(WAREHOUSEFK),
|
getData(WAREHOUSEFK)
|
||||||
"faultsReview_isChecked"
|
|
||||||
)
|
)
|
||||||
changeOfflineValue(item)
|
changeOfflineValue(item)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 :
|
getInventaryUserCase.faultsReview_isChecked(user,password,itemFk,warehouseFk).enqueue(object :
|
||||||
Callback<Any> {
|
Callback<Any> {
|
||||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ class HistoricoArticuloFragment(
|
||||||
// customDialog = CustomDialog(requireContext())
|
// customDialog = CustomDialog(requireContext())
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
filter = "all"
|
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
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -111,7 +111,7 @@ class HistoricoArticuloFragment(
|
||||||
private fun viewModelwithFilter(keyfilter: String) {
|
private fun viewModelwithFilter(keyfilter: String) {
|
||||||
filter = keyfilter
|
filter = keyfilter
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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() {
|
private fun setEvents() {
|
||||||
|
|
|
@ -28,7 +28,7 @@ class HistoricoArticuloViewModel(context: Context) : BaseViewModel() {
|
||||||
val loadHistoricoList = Transformations.map(_historicoList) { Event(it) }
|
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 :
|
getItemCardUserCase.itemDiary(usuario,password,itemFk,vWarehouseFk).enqueue(object :
|
||||||
Callback<List<ItemHistoricoVO>> {
|
Callback<List<ItemHistoricoVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemHistoricoVO>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemHistoricoVO>>, t: Throwable) {
|
||||||
|
|
|
@ -72,7 +72,7 @@ class itemShelvingLogFragment(
|
||||||
|
|
||||||
private fun itemShelvingLog_get(vShelvingFK: String) {
|
private fun itemShelvingLog_get(vShelvingFK: String) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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)
|
setToolBar(getString(R.string.itemShelvingLog)+":"+itemScan)
|
||||||
|
|
||||||
if (it.list.isEmpty()){
|
if (it.list.isEmpty()){
|
||||||
customDialog.setTitle("Sin resultados")
|
customDialog.setTitle(getString(R.string.noResults))
|
||||||
.setDescription("No se ha podido obtener datos de la etiqueta escaneada. ")
|
.setDescription(getString(R.string.noDataLabelScanned))
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if (it.list.get(0).isError){
|
if (it.list.get(0).isError){
|
||||||
customDialog.setTitle("Error")
|
customDialog.setTitle(getString(R.string.error))
|
||||||
.setDescription(it.list.get(0).errorMessage)
|
.setDescription(it.list.get(0).errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 :
|
itemShelvingLogUSerCase.itemShelvingLog_get(usuario,password,vShelvingFK).enqueue(object :
|
||||||
Callback<List<ItemShelvingLog>> {
|
Callback<List<ItemShelvingLog>> {
|
||||||
override fun onFailure(call: Call<List<ItemShelvingLog>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemShelvingLog>>, t: Throwable) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ class shelvingLogFragment(
|
||||||
|
|
||||||
private fun shelvingLog_get(vShelvingFK: String) {
|
private fun shelvingLog_get(vShelvingFK: String) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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)
|
setToolBar(getString(R.string.shelvingLog)+":"+itemScan)
|
||||||
|
|
||||||
if (it.list.isEmpty()){
|
if (it.list.isEmpty()){
|
||||||
customDialog.setTitle("Sin resultados")
|
customDialog.setTitle(getString(R.string.noResults))
|
||||||
.setDescription("No se ha podido obtener datos de la etiqueta escaneada. ")
|
.setDescription(getString(R.string.noDataLabelScanned))
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if (it.list.get(0).isError){
|
if (it.list.get(0).isError){
|
||||||
customDialog.setTitle("Error")
|
customDialog.setTitle(getString(R.string.error))
|
||||||
.setDescription(it.list.get(0).errorMessage)
|
.setDescription(it.list.get(0).errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ class shelvingLogViewModel(context: Context) : BaseViewModel() {
|
||||||
val loadShelvingLogList = Transformations.map(_itemShelvingLogList) { Event(it) }
|
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 :
|
itemShelvingLogUSerCase.shelvingLog_get(usuario,password,vShelvingFK).enqueue(object :
|
||||||
Callback<List<ShelvingLog>> {
|
Callback<List<ShelvingLog>> {
|
||||||
override fun onFailure(call: Call<List<ShelvingLog>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ShelvingLog>>, t: Throwable) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class HistoricoVehiculoFragment (
|
||||||
|
|
||||||
ma.hideBottomNavigation(View.GONE)
|
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)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclediary)
|
||||||
setEvents()
|
setEvents()
|
||||||
super.init()
|
super.init()
|
||||||
|
|
|
@ -26,7 +26,7 @@ class HistoricoVehiculoViewModel (context: Context) : BaseViewModel() {
|
||||||
val loadHistoricoVehiculoList = Transformations.map(_historicovehiculoList) { Event(it) }
|
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 :
|
GetVehicleControlTimeUserCase.machineWorker_getHistorical(usuario,password,plateNumber).enqueue(object :
|
||||||
Callback<List<ItemHistoricoVehiculo>> {
|
Callback<List<ItemHistoricoVehiculo>> {
|
||||||
override fun onFailure(call: Call<List<ItemHistoricoVehiculo>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemHistoricoVehiculo>>, t: Throwable) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
||||||
//sergio. se quita para subir version.A la espera de como será el inventario
|
//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)
|
super.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
buyerId=getData(BUYERID)
|
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{
|
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,initData(),
|
||||||
SimpleSearchDialogCompat(context,getString(R.string.compradores),getString(R.string.escribirparteNombre),null,items,
|
SimpleSearchDialogCompat(context,getString(R.string.compradores),getString(R.string.escribirparteNombre),null,items,
|
||||||
|
@ -81,7 +81,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
||||||
saveBuyer(nombre.getBuyerNickname())
|
saveBuyer(nombre.getBuyerNickname())
|
||||||
saveBuyerId(nombre.getBuyerId())
|
saveBuyerId(nombre.getBuyerId())
|
||||||
buyerId=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
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
baseSearchDialogCompat.dismiss()
|
baseSearchDialogCompat.dismiss()
|
||||||
}).show()
|
}).show()
|
||||||
|
@ -100,7 +100,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
||||||
reload = false
|
reload = false
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
hideLoad = false
|
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){
|
if (item == iconReload.drawable){
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
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 {
|
response.observe(viewLifecycleOwner, Observer {
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
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()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
|
||||||
get() = _responseAddMistake
|
get() = _responseAddMistake
|
||||||
|
|
||||||
//sergio para obtener comprador
|
//sergio para obtener comprador
|
||||||
fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){
|
fun itemShelvingBuyerGet(user:String,password:String){
|
||||||
getInventaryUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
|
getInventaryUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
|
||||||
Callback<List<BuyerVO>> {
|
Callback<List<BuyerVO>> {
|
||||||
override fun onFailure(call: Call<List<BuyerVO>>, t: Throwable) {
|
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.itemShelvingRadar(user,password,buyerFk).enqueue(object :
|
||||||
getInventaryUserCase.itemShelvingRadarFilterBuyer(user,password,buyerFk,warehouseFk).enqueue(object :
|
getInventaryUserCase.itemShelvingRadarFilterBuyer(user,password,buyerFk,warehouseFk).enqueue(object :
|
||||||
Callback<List<ItemInventaryVO>> {
|
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 :
|
getWorkerMistakeUserCase.worker_getFromHasMistake(usuario,password,departmentFk).enqueue(object :
|
||||||
Callback<List<WorkerFromMistake>> {
|
Callback<List<WorkerFromMistake>> {
|
||||||
override fun onFailure(call: Call<List<WorkerFromMistake>>, t: Throwable) {
|
override fun onFailure(call: Call<List<WorkerFromMistake>>, t: Throwable) {
|
||||||
|
|
|
@ -8,7 +8,6 @@ import android.content.pm.PackageInfo
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.util.Log
|
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
@ -42,8 +41,8 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.loginSalix(
|
viewModel.loginSalix(
|
||||||
user = binding.edittextUsername.text.toString(),
|
user = binding.edittextUsername.text.toString(),
|
||||||
password = binding.edittextPassword.text.toString(),
|
password = binding.edittextPassword.text.toString()
|
||||||
callFunction = "login de Salix"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,8 +111,8 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
} else {
|
} else {
|
||||||
|
@ -130,9 +129,9 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
) {
|
) {
|
||||||
val openURL = Intent(Intent.ACTION_VIEW)
|
val openURL = Intent(Intent.ACTION_VIEW)
|
||||||
openURL.data =
|
openURL.data =
|
||||||
// sergio REdmine Tarea #3730
|
// sergio REdmine Tarea #3730
|
||||||
//Uri.parse("https://app.verdnatura.es/bin/vn-picking.apk")
|
//Uri.parse("https://app.verdnatura.es/bin/vn-picking.apk")
|
||||||
Uri.parse(it.url)
|
Uri.parse(it.url)
|
||||||
//Log.d("VERDNATURA::","Datos"+ openURL.data)
|
//Log.d("VERDNATURA::","Datos"+ openURL.data)
|
||||||
startActivity(openURL)
|
startActivity(openURL)
|
||||||
|
|
||||||
|
@ -156,15 +155,16 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
} else {
|
} else {
|
||||||
if (it.vIsAuthorized == "0") {
|
if (it.vIsAuthorized == "0") {
|
||||||
|
|
||||||
customDialog.setTitle("Error").setDescription(it.vMessage!!)
|
customDialog.setTitle(getString(R.string.error))
|
||||||
.setOkButton("Cerrar") {
|
.setDescription(it.vMessage!!)
|
||||||
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
// goToMain()
|
// goToMain()
|
||||||
|
@ -174,8 +174,8 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
//sergio: se añade el log
|
//sergio: se añade el log
|
||||||
viewModel.worker_getId(
|
viewModel.worker_getId(
|
||||||
binding.edittextUsername.text.toString(),
|
binding.edittextUsername.text.toString(),
|
||||||
binding.edittextPassword.text.toString(),
|
binding.edittextPassword.text.toString()
|
||||||
callFunction = "worker_getId"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
viewModel.worker_getSector(
|
viewModel.worker_getSector(
|
||||||
|
@ -217,7 +217,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
if (it.vIsAuthorized == "1" && !it.vMessage.isNullOrEmpty()) {
|
if (it.vIsAuthorized == "1" && !it.vMessage.isNullOrEmpty()) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
customDialog.setTitle("Mensaje").setDescription(it.vMessage)
|
customDialog.setTitle("Mensaje").setDescription(it.vMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
/* binding.splashProgress.visibility = View.VISIBLE
|
/* binding.splashProgress.visibility = View.VISIBLE
|
||||||
loginSalix(
|
loginSalix(
|
||||||
|
@ -251,7 +251,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
devicelogresponse.observe(viewLifecycleOwner) {
|
devicelogresponse.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle("Error")
|
customDialog.setTitle(getString(R.string.error))
|
||||||
.setDescription(it.errorMessage)
|
.setDescription(it.errorMessage)
|
||||||
.setOkButton(
|
.setOkButton(
|
||||||
"Aceptar"
|
"Aceptar"
|
||||||
|
@ -268,7 +268,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
removeSector()
|
removeSector()
|
||||||
Log.d("VERDNATURA::","ERROR")
|
//Log.d("VERDNATURA::",getString(R.string.error))
|
||||||
} else {
|
} else {
|
||||||
if (it.id != 0) {
|
if (it.id != 0) {
|
||||||
saveDataInt("sectorFk", it.id)
|
saveDataInt("sectorFk", it.id)
|
||||||
|
@ -305,7 +305,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
saveTokenPref("")
|
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 + ". Puedes continuar pero algunas funcionalidades no estarán disponibles.")
|
||||||
.setDescription(it.errorMessage)
|
.setDescription(it.errorMessage)
|
||||||
.setOkButton(
|
.setOkButton(
|
||||||
|
@ -320,7 +320,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
viewModel.device_checkLogin(
|
viewModel.device_checkLogin(
|
||||||
binding.edittextUsername.text.toString(),
|
binding.edittextUsername.text.toString(),
|
||||||
binding.edittextPassword.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(
|
viewModel.checkVersion(
|
||||||
user = binding.edittextUsername.text.toString(),
|
user = binding.edittextUsername.text.toString(),
|
||||||
password = binding.edittextPassword.text.toString(),
|
password = binding.edittextPassword.text.toString(),
|
||||||
nameApp = "warehouse", "getVersion",
|
nameApp = getString(R.string.nameApp)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
||||||
|
|
||||||
val loadWorkerPrintList = Transformations.map(_workerPrintList) { Event(it) }
|
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>
|
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)
|
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)
|
getLoginUserCase.worker_getId(user, password)
|
||||||
.enqueue(object : Callback<String>
|
.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)
|
getLoginUserCase.checkVersion(user, password, nameApp)
|
||||||
.enqueue(object : Callback<versionApp>
|
.enqueue(object : Callback<versionApp>
|
||||||
|
@ -340,7 +340,7 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
||||||
val workerId: NodeJsService.SmartTagNode?
|
val workerId: NodeJsService.SmartTagNode?
|
||||||
|
|
||||||
*//* if (response.isSuccessful()){
|
*//* if (response.isSuccessful()){
|
||||||
Log.i("VERDNATURA::","OK")
|
//Log.i("VERDNATURA::","OK")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!response.errorBody().toString().isEmpty()){
|
if (!response.errorBody().toString().isEmpty()){
|
||||||
|
@ -372,7 +372,7 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
||||||
val workerId =
|
val workerId =
|
||||||
NodeJsService.SmartTagNode(isError = true, errorMessage = t.message!!)
|
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
|
_nodejs.value = workerId
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,7 +330,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
override fun onPasillerosItemClickListener(item: PasillerosItemVO, entryPoint: String) {
|
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) {
|
when (item.title) {
|
||||||
|
|
||||||
"Asociar Sacador SmartTags" -> {
|
"Asociar Sacador SmartTags" -> {
|
||||||
|
@ -476,7 +478,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
"Llenado buffer" -> {
|
"Llenado buffer" -> {
|
||||||
addFragmentOnTop(BufferFragment.newInstance(item.title))
|
addFragmentOnTop(BufferFragment.newInstance(item.title))
|
||||||
}
|
}
|
||||||
"Acumulación buffer" -> {
|
getString(R.string.bufferaccumulate).toString()-> {
|
||||||
addFragmentOnTop(BufferFragment.newInstance(item.title))
|
addFragmentOnTop(BufferFragment.newInstance(item.title))
|
||||||
}
|
}
|
||||||
"Desactivado buffer" -> {
|
"Desactivado buffer" -> {
|
||||||
|
@ -538,7 +540,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
customDialog.setTitle("Cerrar sesión")
|
customDialog.setTitle(getString(R.string.closeSession))
|
||||||
.setDescription("¿Estás seguro de cerrar la sesión?").setOkButton("Salir") {
|
.setDescription("¿Estás seguro de cerrar la sesión?").setOkButton("Salir") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
finish()
|
finish()
|
||||||
|
@ -656,7 +658,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
message: String,
|
message: String,
|
||||||
isError: Boolean,
|
isError: Boolean,
|
||||||
isPlayed: Boolean?,
|
isPlayed: Boolean?,
|
||||||
titleWithError: String = "Error",
|
titleWithError: String = getString(R.string.error),
|
||||||
isToasted: Boolean? = false
|
isToasted: Boolean? = false
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class ExpeditionPalletDetailFragment(
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
viewModel.expeditionPallet_List(getData(USER),
|
viewModel.expeditionPallet_List(getData(USER),
|
||||||
getData(PASSWORD),itemPallet!!.Pallet,"expeditionPallet_View")
|
getData(PASSWORD),itemPallet!!.Pallet)
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class ExpeditionPalletDetailFragment(
|
||||||
if (item == iconReload){
|
if (item == iconReload){
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionPallet_List(getData(USER),
|
viewModel.expeditionPallet_List(getData(USER),
|
||||||
getData(PASSWORD),itemPallet!!.Pallet,"expeditionPallet_View")
|
getData(PASSWORD),itemPallet!!.Pallet)
|
||||||
}else if(item == iconEditar){
|
}else if(item == iconEditar){
|
||||||
onPalletClickListener!!.onPalletClickListener(itemExpeditionTruckVO!!,itemPallet!!)
|
onPalletClickListener!!.onPalletClickListener(itemExpeditionTruckVO!!,itemPallet!!)
|
||||||
}else if(item == iconBorrar){
|
}else if(item == iconBorrar){
|
||||||
|
@ -114,8 +114,7 @@ class ExpeditionPalletDetailFragment(
|
||||||
getData(USER),
|
getData(USER),
|
||||||
getData(PASSWORD),
|
getData(PASSWORD),
|
||||||
itemPallet!!.Pallet,
|
itemPallet!!.Pallet,
|
||||||
getData(SECTORFK),
|
getData(SECTORFK)
|
||||||
"expeditionPallet_PrintSet"
|
|
||||||
)
|
)
|
||||||
}else{
|
}else{
|
||||||
ma.messageWithSound("Falta seleccionar impresora",isError = true,true,"Error al imprimir",false)
|
ma.messageWithSound("Falta seleccionar impresora",isError = true,true,"Error al imprimir",false)
|
||||||
|
|
|
@ -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 :
|
getPaletizadoresUserCase.expeditionPalletView(usuario,password,vPalletFk).enqueue(object :
|
||||||
Callback<List<ItemPalletViewVO>> {
|
Callback<List<ItemPalletViewVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemPalletViewVO>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemPalletViewVO>>, t: Throwable) {
|
||||||
|
@ -78,7 +78,7 @@ class ExpeditionPalletDetailViewModel(context: Context): BaseViewModel() {
|
||||||
usuario: String,
|
usuario: String,
|
||||||
password: String,
|
password: String,
|
||||||
vPalletFk: String,
|
vPalletFk: String,
|
||||||
vSectorFk: String,callFunction:String){
|
vSectorFk: String){
|
||||||
|
|
||||||
getPaletizadoresUserCase.expeditionPalletPrintSet(usuario,password,vPalletFk,vSectorFk).enqueue(object : Callback<Any>{
|
getPaletizadoresUserCase.expeditionPalletPrintSet(usuario,password,vPalletFk,vSectorFk).enqueue(object : Callback<Any>{
|
||||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||||
|
|
|
@ -78,7 +78,7 @@ class ExpeditionPalletFragment(
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
viewModel.expeditionPallet_List(getData(USER),
|
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")
|
////Log.i("VERDNATURA:","4-listamos listado de pallets para la expedicion")
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class ExpeditionPalletFragment(
|
||||||
if (item == iconReload){
|
if (item == iconReload){
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionPallet_List(getData(USER),
|
viewModel.expeditionPallet_List(getData(USER),
|
||||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk)
|
||||||
}else if(item == iconPlus){
|
}else if(item == iconPlus){
|
||||||
expeditionScanAdd()
|
expeditionScanAdd()
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ class ExpeditionPalletFragment(
|
||||||
responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer {
|
responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer {
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
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()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
}else{
|
}else{
|
||||||
|
@ -174,7 +174,7 @@ class ExpeditionPalletFragment(
|
||||||
private fun expeditionScanAdd(){
|
private fun expeditionScanAdd(){
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionScanAdd(getData(USER),
|
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){
|
private fun showScanExpeditions(it:ItemScanList){
|
||||||
|
@ -205,11 +205,11 @@ class ExpeditionPalletFragment(
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar"){
|
}.setKoButton(getString(R.string.close)){
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionPallet_List(getData(USER),
|
viewModel.expeditionPallet_List(getData(USER),
|
||||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk)
|
||||||
listExpeditions = ArrayList()
|
listExpeditions = ArrayList()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
|
@ -229,7 +229,7 @@ class ExpeditionPalletFragment(
|
||||||
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue())
|
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue())
|
||||||
////Log.i("VERDNATURA:"," palletizando ${it.list.get(0).palletFk} expedi: ${customDialogList.getValue()}")
|
////Log.i("VERDNATURA:"," palletizando ${it.list.get(0).palletFk} expedi: ${customDialogList.getValue()}")
|
||||||
viewModel.checkRouteExpeditionScanPut(getData(USER),
|
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{
|
}else{
|
||||||
if (mperror != null) mperror!!.start()
|
if (mperror != null) mperror!!.start()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 :
|
getPaletizadoresUserCase.expeditionPallet_List(usuario,password,vTruckFk).enqueue(object :
|
||||||
Callback<List<ItemPalletVO>> {
|
Callback<List<ItemPalletVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemPalletVO>>, t: Throwable) {
|
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 :
|
getPaletizadoresUserCase.expeditionScanAdd(usuario,password,vPalletFk,vTruckFk).enqueue(object :
|
||||||
Callback<List<ItemScanVO>> {
|
Callback<List<ItemScanVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemScanVO>>, t: Throwable) {
|
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>{
|
getPaletizadoresUserCase.checkRouteExpeditionScanPut(usuario,password,vPalletFk,vExpeditionFk).enqueue(object : Callback<String>{
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||||
|
|
|
@ -215,7 +215,7 @@ class ExpeditionScanFragment (
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar"){
|
}.setKoButton(getString(R.string.close)){
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
listExpeditions = ArrayList()
|
listExpeditions = ArrayList()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ExpeditionScanSorterFragment(
|
||||||
private fun expeditionscan(ExpeditionScan: String) {
|
private fun expeditionscan(ExpeditionScan: String) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.expedition_scan(getData(USER),getData(PASSWORD), ExpeditionScan,"expedition_scan")
|
viewModel.expedition_scan(getData(USER),getData(PASSWORD), ExpeditionScan)
|
||||||
itemScaned = ExpeditionScan
|
itemScaned = ExpeditionScan
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ class ExpeditionScanSorterFragment(
|
||||||
private fun showExpeditionScan() {
|
private fun showExpeditionScan() {
|
||||||
|
|
||||||
customDialogList.setTitle("Escanea expediciones que no han pasado por el Sorter")
|
customDialogList.setTitle("Escanea expediciones que no han pasado por el Sorter")
|
||||||
.setOkButton("Finalizar") {
|
.setOkButton(getString(R.string.end)) {
|
||||||
|
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
|
@ -22,7 +22,7 @@ class ExpeditionScanSorterViewModel(context: Context) : BaseViewModel() {
|
||||||
get() = _responsescan
|
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>{
|
GetPaletizadoresUserCase.expedition_scan(usuario,password,vExpeditionId).enqueue(object : Callback<Void>{
|
||||||
override fun onFailure(call: Call<Void>, t: Throwable) {
|
override fun onFailure(call: Call<Void>, t: Throwable) {
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ExpeditionStateFragment(
|
||||||
private fun getExpedtionState(expeditionFk: String) {
|
private fun getExpedtionState(expeditionFk: String) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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) {
|
if (it.isError) {
|
||||||
binding.itemcardLayout.visibility = View.GONE
|
binding.itemcardLayout.visibility = View.GONE
|
||||||
binding.mainToolbar.toolbarTitle.text = title
|
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 {
|
} else {
|
||||||
setItemExpeditionState(it)
|
setItemExpeditionState(it)
|
||||||
|
|
|
@ -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)
|
GetPaletizadoresUserCase.expedition_getStateJSON(user, password, expeditionFk)
|
||||||
.enqueue(object : Callback<JsonObject> {
|
.enqueue(object : Callback<JsonObject> {
|
||||||
override fun onFailure(call: Call<JsonObject>, t: Throwable) {
|
override fun onFailure(call: Call<JsonObject>, t: Throwable) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
||||||
setToolBar()
|
setToolBar()
|
||||||
////Log.i("VERDNATURA:","1-cargamos expediciones")
|
////Log.i("VERDNATURA:","1-cargamos expediciones")
|
||||||
viewModel.expeditionTruckList(getData(USER),
|
viewModel.expeditionTruckList(getData(USER),
|
||||||
getData(PASSWORD),"expeditionTruck_List")
|
getData(PASSWORD))
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
||||||
if (item == iconReload){
|
if (item == iconReload){
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionTruckList(getData(USER),
|
viewModel.expeditionTruckList(getData(USER),
|
||||||
getData(PASSWORD),"expeditionTruck_List")
|
getData(PASSWORD))
|
||||||
}else if(item == iconPlus){
|
}else if(item == iconPlus){
|
||||||
addTruck()
|
addTruck()
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
||||||
})
|
})
|
||||||
loadResponseExpeditionAdd.observe(viewLifecycleOwner, Observer { event ->
|
loadResponseExpeditionAdd.observe(viewLifecycleOwner, Observer { event ->
|
||||||
viewModel.expeditionTruckList(getData(USER),
|
viewModel.expeditionTruckList(getData(USER),
|
||||||
getData(PASSWORD),"expeditionTruck_List")
|
getData(PASSWORD))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 :
|
getPaletizadoresUserCase.expeditionTruckList(usuario,password).enqueue(object :
|
||||||
Callback<List<ItemExpeditionTruckVO>> {
|
Callback<List<ItemExpeditionTruckVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemExpeditionTruckVO>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemExpeditionTruckVO>>, t: Throwable) {
|
||||||
|
|
|
@ -72,7 +72,7 @@ class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBindi
|
||||||
// mperror?.start()
|
// mperror?.start()
|
||||||
// binding.splashProgress.visibility = View.GONE
|
// binding.splashProgress.visibility = View.GONE
|
||||||
ma.messageWithSound(it.errorMessage, isError = true,isPlayed = true)
|
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()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
}else{
|
}else{
|
||||||
|
@ -134,7 +134,7 @@ class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBindi
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
parking = txtScan,
|
parking = txtScan,
|
||||||
scanItem = it.code!!,callFunction = "shelvingPark"
|
scanItem = it.code!!
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -39,7 +39,7 @@ class ParkingViewModel(context: Context) : BaseViewModel() {
|
||||||
_isLoadingProgress.value = visibility
|
_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)
|
ProgressLoading(VISIBLE)
|
||||||
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
|
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
|
||||||
Callback<String> {
|
Callback<String> {
|
||||||
|
|
|
@ -67,7 +67,7 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
mperror?.start()
|
mperror?.start()
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
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()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
}else{
|
}else{
|
||||||
|
@ -129,7 +129,7 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
parking = txtScan,
|
parking = txtScan,
|
||||||
scanItem = it.code!!,callFunction = "shelvingPark"
|
scanItem = it.code!!
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ParkingSaleViewModel(context: Context) : BaseViewModel() {
|
||||||
_isLoadingProgress.value = visibility
|
_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)
|
ProgressLoading(VISIBLE)
|
||||||
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
|
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
|
||||||
Callback<String> {
|
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)
|
getUbicadorUserCase.saleParking_add(usuario, password, sales, parking)
|
||||||
.enqueue(object : Callback<String>
|
.enqueue(object : Callback<String>
|
||||||
|
|
|
@ -238,6 +238,7 @@ class PasilleroViewModel : BaseViewModel() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
31,
|
31,
|
||||||
|
|
|
@ -69,7 +69,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicket
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
sectorFk = getData(SECTORFK),
|
sectorFk = getData(SECTORFK),
|
||||||
collectionFk = binding.scanInput.text.toString(),
|
collectionFk = binding.scanInput.text.toString(),
|
||||||
type = type,callFunction = "collection_getTickets"
|
type = type
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ class PreControladorViewModel(context: Context) : BaseViewModel() {
|
||||||
val collectionTicketList: LiveData<CollectionVO>
|
val collectionTicketList: LiveData<CollectionVO>
|
||||||
get() = _collectionTicketList
|
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 :
|
getPreControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object :
|
||||||
Callback<CollectionVO> {
|
Callback<CollectionVO> {
|
||||||
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||||
|
|
|
@ -213,7 +213,7 @@ class EndSacadorFragment(
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
ma.messageWithSound(it.errorMessage, true, false)
|
||||||
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Aceptar") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
@ -241,7 +241,7 @@ class EndSacadorFragment(
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
ma.messageWithSound(it.errorMessage, true, false)
|
||||||
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Aceptar") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
@ -373,8 +373,8 @@ class EndSacadorFragment(
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (!goBack2) {
|
if (!goBack2) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -542,7 +542,7 @@ class EndSacadorFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun searchTicket(ticketFk: String) {
|
private fun searchTicket(ticketFk: String) {
|
||||||
Log.i(TAG, "Escaneamos ticket en previa" + ticketFk)
|
//Log.i(TAG, "Escaneamos ticket en previa" + ticketFk)
|
||||||
ticket = ticketFk
|
ticket = ticketFk
|
||||||
|
|
||||||
|
|
||||||
|
@ -898,7 +898,7 @@ class EndSacadorFragment(
|
||||||
viewModel.getIdFromCode(
|
viewModel.getIdFromCode(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
@ -909,7 +909,7 @@ class EndSacadorFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar") {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
@ -945,7 +945,7 @@ class EndSacadorFragment(
|
||||||
viewModel.getIdFromCode(
|
viewModel.getIdFromCode(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
@ -1219,7 +1219,7 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
private fun showErrorMessage(text: String) {
|
private fun showErrorMessage(text: String) {
|
||||||
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ class InitPreSacadorFragment (
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getcollection)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.getcollection)
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),"sectorCollection_get")
|
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD))
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class InitPreSacadorFragment (
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
binding.sacadorSwipe.setOnRefreshListener {
|
binding.sacadorSwipe.setOnRefreshListener {
|
||||||
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),"sectorCollection_get")
|
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD))
|
||||||
binding.sacadorSwipe.isRefreshing = false
|
binding.sacadorSwipe.isRefreshing = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ class InitPreSacadorFragment (
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//if (goBack)
|
//if (goBack)
|
||||||
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),getData(SECTORFK))
|
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD))
|
||||||
}
|
}
|
||||||
goBack = false
|
goBack = false
|
||||||
//sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta.
|
//sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta.
|
||||||
|
|
|
@ -178,7 +178,7 @@ class PreSacadorFragment :
|
||||||
responseSalixMessage.observe(viewLifecycleOwner, Observer {
|
responseSalixMessage.observe(viewLifecycleOwner, Observer {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage,true,false)
|
||||||
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Aceptar") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
@ -200,7 +200,7 @@ class PreSacadorFragment :
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage,true,false)
|
||||||
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Aceptar") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
@ -249,8 +249,8 @@ class PreSacadorFragment :
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (!goBack2) {
|
if (!goBack2) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -392,7 +392,7 @@ class PreSacadorFragment :
|
||||||
}
|
}
|
||||||
//CREATE LIST
|
//CREATE LIST
|
||||||
private fun searchTicket(ticketFk: String) {
|
private fun searchTicket(ticketFk: String) {
|
||||||
Log.i(TAG, "Escaneamos ticket en previa")
|
//Log.i(TAG, "Escaneamos ticket en previa")
|
||||||
ticket = ticketFk
|
ticket = ticketFk
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ class PreSacadorFragment :
|
||||||
viewModel.saleTrackingDel(
|
viewModel.saleTrackingDel(
|
||||||
usuario =getData(USER),
|
usuario =getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
saleFk = sales[position].idMovimiento, "saleTracking_del"
|
saleFk = sales[position].idMovimiento
|
||||||
)
|
)
|
||||||
setTotalLines()
|
setTotalLines()
|
||||||
scanRequest()
|
scanRequest()
|
||||||
|
@ -706,7 +706,7 @@ class PreSacadorFragment :
|
||||||
viewModel.getIdFromCode(
|
viewModel.getIdFromCode(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
|
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
@ -718,7 +718,7 @@ class PreSacadorFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar") {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
@ -754,7 +754,7 @@ class PreSacadorFragment :
|
||||||
viewModel.getIdFromCode(
|
viewModel.getIdFromCode(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
@ -1010,7 +1010,7 @@ class PreSacadorFragment :
|
||||||
|
|
||||||
private fun showErrorMessage(text: String) {
|
private fun showErrorMessage(text: String) {
|
||||||
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
getUbicadorUserCase.saleParking_add(usuario, password, sales, parking)
|
||||||
.enqueue(object : Callback<String>
|
.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)
|
getSacadorControladorUserCase.getIdFromCode(usuario, password, code)
|
||||||
.enqueue(object : Callback<String> {
|
.enqueue(object : Callback<String> {
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
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)
|
getSacadorControladorUserCase.saleTrackingDel(usuario, password, saleFk)
|
||||||
.enqueue(object : Callback<Any> {
|
.enqueue(object : Callback<Any> {
|
||||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
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 :
|
getPreSacadorUseCase.sectorCollection_get(usuario, password).enqueue(object :
|
||||||
Callback<List<CollectionVO>> {
|
Callback<List<CollectionVO>> {
|
||||||
|
|
|
@ -62,7 +62,7 @@ class QrFragment(
|
||||||
goBack = false
|
goBack = false
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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()
|
itemscaned = binding.scanInput.text.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class QrFragment(
|
||||||
|
|
||||||
// getMessageFromJSON(it.errorMessage)
|
// getMessageFromJSON(it.errorMessage)
|
||||||
ma.messageWithSound(it.errorMessage+ " "+itemscaned,true,false)
|
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") {
|
.setOkButton("Aceptar") {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
|
|
|
@ -25,7 +25,7 @@ class QrFragmentViewModel(context: Context) : BaseViewModel() {
|
||||||
get() = _qrresponse
|
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)
|
GetQrReaderUserCase.qr_getCall(user, password, vStatement)
|
||||||
.enqueue(object : Callback<String> {
|
.enqueue(object : Callback<String> {
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
|
|
@ -113,10 +113,10 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
||||||
binding.btnCancelar.setOnClickListener {
|
binding.btnCancelar.setOnClickListener {
|
||||||
|
|
||||||
customDialog.setTitle("Confirmar").setDescription("¿Estás seguro de cerrar el pedido?")
|
customDialog.setTitle("Confirmar").setDescription("¿Estás seguro de cerrar el pedido?")
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.setOkButton("Cerrar") {
|
}.setOkButton(getString(R.string.close)) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
if (sales.count() > 0) {
|
if (sales.count() > 0) {
|
||||||
viewModel.itemPlacementSupplyCloseOrder(
|
viewModel.itemPlacementSupplyCloseOrder(
|
||||||
|
@ -193,8 +193,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (!goBack2) {
|
if (!goBack2) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -392,7 +392,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
||||||
viewModel.getIdFromCode(
|
viewModel.getIdFromCode(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar") {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
@ -434,7 +434,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
||||||
viewModel.getIdFromCode(
|
viewModel.getIdFromCode(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
@ -548,7 +548,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
||||||
|
|
||||||
private fun showErrorMessage(text: String) {
|
private fun showErrorMessage(text: String) {
|
||||||
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
customDialog.setTitle("Error al marcar la linea").setDescription(text)
|
||||||
.setKoButton("Cerrar") {
|
.setKoButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
getSacadorControladorUserCase.getIdFromCode(usuario, password, code)
|
||||||
.enqueue(object : Callback<String> {
|
.enqueue(object : Callback<String> {
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
|
|
@ -31,8 +31,8 @@ class SacadorFragment :
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
private var collectionsList: ArrayList<CollectionVO> = ArrayList()
|
private var collectionsList: ArrayList<CollectionVO> = ArrayList()
|
||||||
private var adapter: CollectionAdapter? = null
|
private var adapter: CollectionAdapter? = null
|
||||||
private var resultTagMode:String? = ""
|
private var resultTagMode: String? = ""
|
||||||
private var getCollections=false
|
private var getCollections = false
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -49,6 +49,8 @@ class SacadorFragment :
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
|
//viewModel.smartTagInsertTicket("571974")
|
||||||
|
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
binding.splashProgressTwo.visibility = View.GONE
|
binding.splashProgressTwo.visibility = View.GONE
|
||||||
|
@ -56,18 +58,14 @@ class SacadorFragment :
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
|
||||||
// viewModel.smartTagInsertTicket("568672")
|
|
||||||
/*var working_in_test=false //sergio: Ok en app
|
/*var working_in_test=false //sergio: Ok en app
|
||||||
|
|
||||||
if (!working_in_test) {*/
|
if (!working_in_test) {*/
|
||||||
if (getCollections){
|
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||||
viewModel.collectionGetSalix(token = getData(TOKEN))
|
/* }else{
|
||||||
}
|
viewModel.collectionGet( getData(USER),
|
||||||
/* }else{
|
getData(PASSWORD),"collection_get")
|
||||||
viewModel.collectionGet( getData(USER),
|
}*/
|
||||||
getData(PASSWORD),"collection_get")
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
|
@ -80,20 +78,25 @@ class SacadorFragment :
|
||||||
setFragmentResultListener("requestKey") { requestKey, bundle ->
|
setFragmentResultListener("requestKey") { requestKey, bundle ->
|
||||||
|
|
||||||
val result = bundle.getString("tagMode")
|
val result = bundle.getString("tagMode")
|
||||||
resultTagMode=result
|
resultTagMode = result
|
||||||
Log.d("VERDNATURA::","el result es "+result)
|
if (result.equals("complete")) {
|
||||||
if (result.equals("complete")){
|
getCollections = TRUE
|
||||||
getCollections=TRUE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.equals("complete") && getData(TAGSTYPE).equals("SmartTags")) {
|
if (result.equals("complete") && getData(TAGSTYPE).equals("SmartTags")) {
|
||||||
Log.d("VERDNATURA::","Entramos a collectionNew_SMARTGS"+result)
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.collection_new_smarttag(getData(USER),
|
viewModel.collection_new_smart(
|
||||||
getData(PASSWORD), getData(SECTORFK), getData(WAGON), getData(TAGSTYPE),"collection_new_wagon")
|
getData(USER),
|
||||||
|
getData(PASSWORD),
|
||||||
|
getData(SECTORFK),
|
||||||
|
getData(WAGON),
|
||||||
|
getData(TAGSTYPE)
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
goBack = true
|
goBack = true
|
||||||
goBack2 = true
|
goBack2 = true
|
||||||
|
@ -102,7 +105,7 @@ class SacadorFragment :
|
||||||
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
|
|
||||||
ma.hideBottomNavigation(View.VISIBLE)
|
ma.hideBottomNavigation(View.VISIBLE)
|
||||||
|
|
||||||
|
|
||||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
|
@ -113,30 +116,31 @@ class SacadorFragment :
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
|
||||||
iconAdd.tooltipText=getTooltip(R.drawable.ic_add_black_24dp)
|
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
|
||||||
iconVehicleIn.tooltipText=getTooltip(R.drawable.car)
|
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
listIcons.add(iconVehicleIn)
|
listIcons.add(iconVehicleIn)
|
||||||
listIcons.add(iconAdd)
|
listIcons.add(iconAdd)
|
||||||
|
|
||||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
when(item){
|
when (item) {
|
||||||
|
|
||||||
iconAdd.drawable -> {
|
iconAdd.drawable -> {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
checkTagsMode()
|
checkTagsMode()
|
||||||
/* viewModel.collection_new_wagon(getData(USER),
|
/* viewModel.collection_new_wagon(getData(USER),
|
||||||
getData(PASSWORD),getData(SECTORFK),getData(WAGON),getData(TAGSTYPE),"collection_new_wagon")*/
|
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 =
|
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
}
|
}
|
||||||
|
@ -144,28 +148,38 @@ class SacadorFragment :
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
binding.sacadorSwipe.setOnRefreshListener {
|
binding.sacadorSwipe.setOnRefreshListener {
|
||||||
viewModel.collectionGetSalix(token = getData(TOKEN))
|
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||||
/* viewModel.collectionGet(getData(USER),
|
/* viewModel.collectionGet(
|
||||||
getData(PASSWORD),"collection_get")*/
|
getData(USER),
|
||||||
|
getData(PASSWORD)
|
||||||
|
)*/
|
||||||
binding.sacadorSwipe.isRefreshing = false
|
binding.sacadorSwipe.isRefreshing = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun checkTagsMode() {
|
private fun checkTagsMode() {
|
||||||
|
|
||||||
|
|
||||||
if (getData(TAGSTYPE).equals("Stickers")) {
|
if (getData(TAGSTYPE).equals("Stickers")) {
|
||||||
viewModel.collectionNew(getData(USER),
|
viewModel.collectionNew(
|
||||||
getData(PASSWORD), getData(SECTORFK), getData(WAGON),"collection_new_wagon")
|
getData(USER),
|
||||||
|
getData(PASSWORD), getData(SECTORFK), getData(WAGON)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
Log.d("VERDNATURA::","ResultMode"+resultTagMode)
|
Log.d("VERDNATURA::", "ResultMode" + resultTagMode)
|
||||||
if (resultTagMode.equals("complete")) {
|
if (resultTagMode.equals("complete")) {
|
||||||
viewModel.collection_new_wagon(getData(USER),
|
|
||||||
getData(PASSWORD), getData(SECTORFK), getData(WAGON), getData(TAGSTYPE),"collection_new_wagon")
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
/* viewModel.collectionNew(getData(USER),
|
viewModel.collection_new_smart(
|
||||||
getData(PASSWORD), getData(SECTORFK), getData(WAGON),"collection_new_wagon")
|
getData(USER),
|
||||||
*/
|
getData(PASSWORD),
|
||||||
|
getData(SECTORFK),
|
||||||
|
getData(WAGON),
|
||||||
|
getData(TAGSTYPE)
|
||||||
|
)
|
||||||
|
/* viewModel.collectionNew(getData(USER),
|
||||||
|
getData(PASSWORD), getData(SECTORFK), getData(WAGON),"collection_new_wagon")
|
||||||
|
*/
|
||||||
} else {
|
} else {
|
||||||
requireActivity().addFragment(
|
requireActivity().addFragment(
|
||||||
AssociateSmartTagsFragment.newInstance(AssociateSmartTagsFragment.TAG),
|
AssociateSmartTagsFragment.newInstance(AssociateSmartTagsFragment.TAG),
|
||||||
|
@ -180,7 +194,6 @@ class SacadorFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
|
@ -194,7 +207,7 @@ class SacadorFragment :
|
||||||
/* collectionTicketList.observe(viewLifecycleOwner, Observer {
|
/* collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress_two.visibility = View.GONE
|
binding.splashProgress_two.visibility = View.GONE
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
|
@ -206,7 +219,7 @@ class SacadorFragment :
|
||||||
binding.splashProgressTwo.visibility = View.GONE
|
binding.splashProgressTwo.visibility = View.GONE
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage, true, false)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (goBack) addCollectionToList(it.response)
|
if (goBack) addCollectionToList(it.response)
|
||||||
|
@ -214,41 +227,44 @@ class SacadorFragment :
|
||||||
goBack = false
|
goBack = false
|
||||||
//sergio:para asegurarnos que aparece en pantalla.
|
//sergio:para asegurarnos que aparece en pantalla.
|
||||||
|
|
||||||
/* var working_in_test=false //sergio: ok en app SACADOR
|
var working_in_test = false //sergio: ok en app SACADOR
|
||||||
if (!working_in_test) {*/
|
if (!working_in_test) {
|
||||||
viewModel.collectionGetSalix(token=getData(TOKEN))
|
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||||
/*}else{
|
} else {
|
||||||
viewModel.collectionGet(getData(USER),getData(PASSWORD),"collection_get")
|
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) {
|
} else {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage, false, false)
|
||||||
|
// Log.d("VERDNATURA::", "La colec a insertTicket es " + it.response)
|
||||||
|
viewModel.smartTagInsertTicket(it.response)
|
||||||
|
|
||||||
} else {
|
goBack = false
|
||||||
ma.messageWithSound(it.errorMessage,false,false)
|
}
|
||||||
Log.d("VERDNATURA::","La colec es "+it.response)
|
|
||||||
viewModel.smartTagInsertTicket(it.response)
|
|
||||||
|
|
||||||
goBack = false}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
registerSmarttagInsert.observe(viewLifecycleOwner, Observer {
|
registerSmarttagInsert.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (!goBack){
|
if (!goBack) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage, true, false)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(it.errorMessage,false,false)
|
ma.messageWithSound(it.errorMessage, false, false)
|
||||||
viewModel.collectionGetSalix(getData(TOKEN))
|
viewModel.collectionGetSalix(getData(TOKEN))
|
||||||
|
}
|
||||||
|
goBack = false
|
||||||
}
|
}
|
||||||
goBack = false}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ class SacadorViewModel(context: Context) : BaseViewModel() {
|
||||||
val response: LiveData<ResponseItemVO>
|
val response: LiveData<ResponseItemVO>
|
||||||
get() = _response
|
get() = _response
|
||||||
|
|
||||||
private val _responseCollectionSmarttag by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseCollectionSmart by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseCollectionSmarttag: LiveData<ResponseItemVO>
|
val responseCollectionSmart: LiveData<ResponseItemVO>
|
||||||
get() = _responseCollectionSmarttag
|
get() = _responseCollectionSmart
|
||||||
|
|
||||||
|
|
||||||
private val _registerSmarttagInsert by lazy { MutableLiveData<SmartTagRegister>() }
|
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(
|
getSacadorControladorUserCase.collectionNew(usuario, password, sectorFk, wagons).enqueue(
|
||||||
object :
|
object :
|
||||||
Callback<String> {
|
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){
|
fun collection_new_smart(usuario: String, password: String, sectorFk: String, wagons: String,tagtype:String){
|
||||||
getSacadorControladorUserCase.collectionNew(usuario, password, sectorFk, wagons,tagtype).enqueue(
|
getSacadorControladorUserCase.collectionNewSmarttag(usuario, password, sectorFk, wagons,tagtype).enqueue(
|
||||||
object :
|
object :
|
||||||
Callback<String> {
|
Callback<String> {
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
_response.value =
|
_responseCollectionSmart.value =
|
||||||
ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResponse(
|
override fun onResponse(
|
||||||
|
@ -141,11 +140,13 @@ class SacadorViewModel(context: Context) : BaseViewModel() {
|
||||||
response: Response<String>
|
response: Response<String>
|
||||||
) {
|
) {
|
||||||
if (response.body() != null) {
|
if (response.body() != null) {
|
||||||
_response.value =
|
|
||||||
|
Log.d("VERDNATURA::","Entramos y formamos _responseCollectionSmarttag:"+response.body())
|
||||||
|
_responseCollectionSmart.value =
|
||||||
ResponseItemVO(isError = false, response = response.body()!!)
|
ResponseItemVO(isError = false, response = response.body()!!)
|
||||||
} else {
|
} else {
|
||||||
|
Log.d("VERDNATURA::","Entramos y formamos _responseCollectionSmarttag")
|
||||||
_response.value = ResponseItemVO(
|
_responseCollectionSmart.value = ResponseItemVO(
|
||||||
isError = true,
|
isError = true,
|
||||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
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){
|
/* fun collection_new_smarttag(usuario: String, password: String, sectorFk: String, wagons: String,tagtype:String){
|
||||||
getSacadorControladorUserCase.collectionNew(usuario, password, sectorFk, wagons,tagtype).enqueue(
|
getSacadorControladorUserCase.collectionNewSmarttag(usuario, password, sectorFk, wagons,tagtype).enqueue(
|
||||||
object :
|
object :
|
||||||
Callback<String> {
|
Callback<String> {
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
// _response.value=
|
|
||||||
_responseCollectionSmarttag.value =
|
_responseCollectionSmarttag.value =
|
||||||
ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
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) {
|
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 =
|
_responseCollectionSmarttag.value =
|
||||||
ResponseItemVO(isError = false, response = response.body()!!)
|
ResponseItemVO(isError = false, response = response.body()!!)
|
||||||
} else {
|
} else {
|
||||||
|
Log.d("VERDNATURA::","Else del response.body() ")
|
||||||
_responseCollectionSmarttag.value =
|
_responseCollectionSmarttag.value =
|
||||||
ResponseItemVO(
|
ResponseItemVO(
|
||||||
isError = true,
|
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")
|
//////Log.i("VERDNATURA:","collectionGet para coger tickets")
|
||||||
getSacadorControladorUserCase.collectionGet(usuario, password).enqueue(object :
|
getSacadorControladorUserCase.collectionGet(usuario, password).enqueue(object :
|
||||||
Callback<List<CollectionVO>> {
|
Callback<List<CollectionVO>> {
|
||||||
|
@ -271,7 +271,7 @@ class SacadorViewModel(context: Context) : BaseViewModel() {
|
||||||
val responseSmart: SmartTagRegister
|
val responseSmart: SmartTagRegister
|
||||||
|
|
||||||
if (response.isSuccessful()){
|
if (response.isSuccessful()){
|
||||||
Log.i("VERDNATURA::","El mensaje es "+response.message())
|
//Log.i("VERDNATURA::","El mensaje es "+response.message())
|
||||||
responseSmart = SmartTagRegister(
|
responseSmart = SmartTagRegister(
|
||||||
message="Ticket insertado OK.",
|
message="Ticket insertado OK.",
|
||||||
isError = false,
|
isError = false,
|
||||||
|
@ -292,9 +292,9 @@ class SacadorViewModel(context: Context) : BaseViewModel() {
|
||||||
override fun onFailure(call: Call<SmartTagRegister>, t: Throwable)
|
override fun onFailure(call: Call<SmartTagRegister>, t: Throwable)
|
||||||
{
|
{
|
||||||
val responseSmart =
|
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
|
_registerSmarttagInsert.value = responseSmart
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
|
||||||
if (!binding.shelvingText.text.toString().isNullOrEmpty()){
|
if (!binding.shelvingText.text.toString().isNullOrEmpty()){
|
||||||
binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
|
binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
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("")
|
binding.shelvingText.setText("")
|
||||||
|
@ -65,7 +65,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
|
||||||
binding.shelvingText.requestFocus()
|
binding.shelvingText.requestFocus()
|
||||||
|
|
||||||
binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
|
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("")
|
binding.shelvingText.setText("")
|
||||||
ma.hideKeyboard(binding.dayrange)
|
ma.hideKeyboard(binding.dayrange)
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
|
|
|
@ -31,7 +31,7 @@ class ShelvingParkingViewModel(context: Context) : BaseViewModel() {
|
||||||
val loadShelvingList = Transformations.map(_shelvingList) { Event(it) }
|
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 :
|
getShelvingParkingUserCase.shelvingParking_get(usuario,password,vShelvingFk.uppercase(),vWarehouseFk,vDayRange).enqueue(object :
|
||||||
Callback<List<ItemShelvingParkingVO>> {
|
Callback<List<ItemShelvingParkingVO>> {
|
||||||
override fun onFailure(call: Call<List<ItemShelvingParkingVO>>, t: Throwable) {
|
override fun onFailure(call: Call<List<ItemShelvingParkingVO>>, t: Throwable) {
|
||||||
|
|
|
@ -72,8 +72,8 @@ class ShowTicketFragment(var menuOrigin: String) : BaseFragment<FragmentControla
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
sectorFk = getData(SECTORFK),
|
sectorFk = getData(SECTORFK),
|
||||||
collectionFk = binding.scanInput.text.toString(),
|
collectionFk = binding.scanInput.text.toString(),
|
||||||
type = type,
|
type = type
|
||||||
callFunction = "collection_getTickets"
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
|
|
|
@ -26,7 +26,7 @@ class ShowTicketViewModel(context: Context) : BaseViewModel() {
|
||||||
val responseTicket: LiveData<ResponseItemVO>
|
val responseTicket: LiveData<ResponseItemVO>
|
||||||
get() = _responseTicket
|
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 :
|
getPreControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object :
|
||||||
Callback<CollectionVO> {
|
Callback<CollectionVO> {
|
||||||
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||||
|
|
|
@ -244,7 +244,7 @@ class RegisterSmartTagsFragment(
|
||||||
private fun showScanSmartTags() {
|
private fun showScanSmartTags() {
|
||||||
|
|
||||||
customDialogList.setTitle("Escanea matrícula del carro y etiquetas smartTags de arriba a abajo.")
|
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())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,6 @@ class AssociateSmartTagsFragment(
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||||
goBack = false
|
goBack = false
|
||||||
//requireActivity().main_bottom_navigation.visibility = GONE
|
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
|
|
||||||
|
@ -92,7 +91,7 @@ class AssociateSmartTagsFragment(
|
||||||
|
|
||||||
private fun setToolBar() {
|
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() {
|
private fun setEvents() {
|
||||||
|
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
Log.i("VERDNATURA:", "PULSADO")
|
|
||||||
requireActivity().onBackPressed()
|
requireActivity().onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +156,7 @@ class AssociateSmartTagsFragment(
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
ma.messageWithSound("Carro/etiqueta insertado",false,false)
|
ma.messageWithSound(getString(R.string.insertedLabel),false,false)
|
||||||
var nameSmartTagwithWagon =
|
var nameSmartTagwithWagon =
|
||||||
getTextScaned(0) + itemScaned
|
getTextScaned(0) + itemScaned
|
||||||
customDialogList.setTitle(getTextToPosition(0))
|
customDialogList.setTitle(getTextToPosition(0))
|
||||||
|
@ -176,16 +174,16 @@ class AssociateSmartTagsFragment(
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage,true,false)
|
||||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
} else {
|
} else {
|
||||||
if (it.response == null) {
|
if (it.response == null) {
|
||||||
|
|
||||||
customDialog.setTitle("Error")
|
customDialog.setTitle(getString(R.string.error))
|
||||||
.setDescription("Etiqueta o carro no válido")
|
.setDescription(getString(R.string.labelNovalid))
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
|
||||||
|
@ -196,7 +194,7 @@ class AssociateSmartTagsFragment(
|
||||||
smartAdapter!!.notifyDataSetChanged()
|
smartAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
customDialogList.setValue("")
|
customDialogList.setValue("")
|
||||||
ma.messageWithSound("Carro/etiqueta borrada",false,false)
|
ma.messageWithSound(getString(R.string.deletedLabel),false,false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
|
@ -209,11 +207,11 @@ class AssociateSmartTagsFragment(
|
||||||
|
|
||||||
|
|
||||||
return when (TagsScaned) {
|
return when (TagsScaned) {
|
||||||
0 -> "Escanea etiqueta/s electrónica/s o matrícula/s"
|
0 -> getString(R.string.scanSmarttagOrShelving)
|
||||||
1 -> "Escanea etiqueta superior"
|
1 -> getString(R.string.scanHighLabel)
|
||||||
2 -> "Escanea etiqueta del medio"
|
2 -> getString(R.string.scanMedLabel)
|
||||||
3 -> "Escanea etiqueta inferior"
|
3 -> getString(R.string.scanLowLabel)
|
||||||
4 -> "Carro escaneado"
|
4 -> getString(R.string.scannedWagon)
|
||||||
else -> {""}
|
else -> {""}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,11 +221,11 @@ class AssociateSmartTagsFragment(
|
||||||
|
|
||||||
|
|
||||||
return when (TagScaned) {
|
return when (TagScaned) {
|
||||||
0 -> "Escaneado:"
|
0 -> getString(R.string.scanned)
|
||||||
1 -> "Carro:"
|
1 -> getString(R.string.wagon)
|
||||||
2 -> "Etiqueta superior:"
|
2 -> getString(R.string.scanHighLabel)
|
||||||
3 -> "Escanea del medio:"
|
3 -> getString(R.string.scanMedLabel)
|
||||||
4 -> "Etiqueta inferior:"
|
4 -> getString(R.string.scanLowLabel)
|
||||||
else -> {""}
|
else -> {""}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,8 +235,8 @@ class AssociateSmartTagsFragment(
|
||||||
|
|
||||||
private fun showScanSmartTags() {
|
private fun showScanSmartTags() {
|
||||||
|
|
||||||
customDialogList.setTitle("Escanea etiqueta/s electrónica/s o matrícula/s.")
|
customDialogList.setTitle(getString(R.string.scanSmarttagOrShelving))
|
||||||
.setOkButton("Finalizar") {
|
.setOkButton(getString(R.string.end)) {
|
||||||
|
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
|
@ -247,7 +245,7 @@ class AssociateSmartTagsFragment(
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
||||||
|
|
||||||
Log.d("VERDNATURA::","Vamos a abrrir Sacadores")
|
//Log.d("VERDNATURA::","Vamos a abrrir Sacadores")
|
||||||
val result = "complete"
|
val result = "complete"
|
||||||
setFragmentResult("requestKey", bundleOf("tagMode" to result))
|
setFragmentResult("requestKey", bundleOf("tagMode" to result))
|
||||||
ma.openFragmentPickers(true)
|
ma.openFragmentPickers(true)
|
||||||
|
@ -266,7 +264,7 @@ class AssociateSmartTagsFragment(
|
||||||
// }.show()
|
// }.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
}.setKoButton("Deshacer") {
|
}.setKoButton(getString(R.string.undone)) {
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
if (!listSmartTags.isEmpty()) {
|
if (!listSmartTags.isEmpty()) {
|
||||||
|
|
|
@ -121,7 +121,7 @@ class SmartTagsViewModel(context: Context) : BaseViewModel() {
|
||||||
val responseSmart: SmartTagRegister
|
val responseSmart: SmartTagRegister
|
||||||
|
|
||||||
if (response.isSuccessful()){
|
if (response.isSuccessful()){
|
||||||
Log.i("VERDNATURA::","El mensaje es "+response.message())
|
//Log.i("VERDNATURA::","El mensaje es "+response.message())
|
||||||
responseSmart = SmartTagRegister(
|
responseSmart = SmartTagRegister(
|
||||||
message="Registrada smartTag.",
|
message="Registrada smartTag.",
|
||||||
isError = false,
|
isError = false,
|
||||||
|
@ -147,7 +147,7 @@ class SmartTagsViewModel(context: Context) : BaseViewModel() {
|
||||||
val responseSmart =
|
val responseSmart =
|
||||||
SmartTagRegister(isError = true, errorMessage = t.message!!)
|
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
|
_registerSmarttagNode.value = responseSmart
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ class AutomaticAddItemFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setSubtitle(){
|
private fun setSubtitle(){
|
||||||
binding.mainToolbar.toolbarSubtitle.text = "Etiquetas: "+contador
|
binding.mainToolbar.toolbarSubtitle.text = getString(R.string.labels)+contador
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setViews(){
|
private fun setViews(){
|
||||||
|
|
|
@ -378,8 +378,8 @@ class UbicadorFragment(
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||||
|
|
||||||
/* mperror!!.start()
|
/* mperror!!.start()
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
}
|
}
|
||||||
|
@ -395,8 +395,8 @@ class UbicadorFragment(
|
||||||
|
|
||||||
/* if (it.isError) {
|
/* if (it.isError) {
|
||||||
mperror!!.start()
|
mperror!!.start()
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton("Cerrar") {
|
.setOkButton(getString(R.string.close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
} else {
|
} else {
|
||||||
|
@ -444,7 +444,7 @@ class UbicadorFragment(
|
||||||
itemUbicador.id,
|
itemUbicador.id,
|
||||||
customDialogUbicador.getGroupingValue()
|
customDialogUbicador.getGroupingValue()
|
||||||
)
|
)
|
||||||
}.setKoButton("Cerrar") {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
customDialogUbicador.dismiss()
|
customDialogUbicador.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ class WorkermistakeFragment( var entryPoint: String = ""
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
|
|
||||||
if (!departmentId.isEmpty()){
|
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{
|
binding.filterDepartment.setOnClickListener{
|
||||||
|
@ -95,7 +95,7 @@ class WorkermistakeFragment( var entryPoint: String = ""
|
||||||
|
|
||||||
saveData(DEPARTMENTMISTAKE,nombre.getDepartmentName())
|
saveData(DEPARTMENTMISTAKE,nombre.getDepartmentName())
|
||||||
saveData(DEPARTMENTMISTAKEID,nombre.getDepartmentId())
|
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.splashProgress.visibility = View.VISIBLE
|
||||||
binding.filterItemFk.isEnabled = true
|
binding.filterItemFk.isEnabled = true
|
||||||
baseSearchDialogCompat.dismiss()
|
baseSearchDialogCompat.dismiss()
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/btn_orange"
|
android:background="@drawable/btn_orange"
|
||||||
android:text="@string/Finalizar"
|
android:text="@string/end"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
<string name="Tamaño">Tamaño</string>
|
<string name="Tamaño">Tamaño</string>
|
||||||
<string name="Matrícula">Matrícula</string>
|
<string name="Matrícula">Matrícula</string>
|
||||||
<string name="Visible">Visible</string>
|
<string name="Visible">Visible</string>
|
||||||
<string name="Finalizar">Finalizar</string>
|
|
||||||
<string name="Destino">Destino</string>
|
<string name="Destino">Destino</string>
|
||||||
<string name="Nicho">Nicho</string>
|
<string name="Nicho">Nicho</string>
|
||||||
<string name="Entrar">Entrar</string>
|
<string name="Entrar">Entrar</string>
|
||||||
|
@ -119,7 +118,7 @@
|
||||||
<string name="vehiclecontrol">Control vehículos</string>
|
<string name="vehiclecontrol">Control vehículos</string>
|
||||||
<string name="Worker">Trabajador</string>
|
<string name="Worker">Trabajador</string>
|
||||||
<string name="vehiclediary">Histórico del vehículo</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="vehiclecontroluser">Control de usuario</string>
|
||||||
<string name="SmarttagRegister">Registro de Smarttags</string>
|
<string name="SmarttagRegister">Registro de Smarttags</string>
|
||||||
<string name="registered_vehiclecontrol">El usuario lleva la máquina:</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="claim">Ubicación de reclamación</string>
|
||||||
<string name="claims">Reclamaciones</string>
|
<string name="claims">Reclamaciones</string>
|
||||||
<string name="scanPallet">Escáner paletizar</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>
|
</resources>
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
<string name="Tamaño">Size</string>
|
<string name="Tamaño">Size</string>
|
||||||
<string name="Matrícula">Registration number</string>
|
<string name="Matrícula">Registration number</string>
|
||||||
<string name="Visible">Visible</string>
|
<string name="Visible">Visible</string>
|
||||||
<string name="Finalizar">Finalize</string>
|
|
||||||
<string name="Destino">Destination</string>
|
<string name="Destino">Destination</string>
|
||||||
<string name="Nicho">Niche</string>
|
<string name="Nicho">Niche</string>
|
||||||
<string name="Entrar">Log In</string>
|
<string name="Entrar">Log In</string>
|
||||||
|
@ -162,5 +161,50 @@
|
||||||
<string name="buscarDepartamento">Find department</string>
|
<string name="buscarDepartamento">Find department</string>
|
||||||
<string name="claim">Claim Ubication</string>
|
<string name="claim">Claim Ubication</string>
|
||||||
<string name="claims">Claims</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>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue