Version 9.6Beta. TEST6-13122022. Dos revisiones de ubicador.

This commit is contained in:
Sergio De la torre 2022-12-13 08:18:17 +01:00
parent 47667d1cd8
commit e006efb01a
15 changed files with 143 additions and 323 deletions

View File

@ -44,7 +44,7 @@
</shared>
</component>
<component name="AndroidLogFilters">
<option name="TOOL_WINDOW_CUSTOM_FILTER" value="verdnatura" />
<option name="TOOL_WINDOW_CUSTOM_FILTER" value="verdnatura::" />
<option name="TOOL_WINDOW_LOG_LEVEL" value="error" />
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="No Filters" />
<option name="TOOL_WINDOW_REGEXP_FILTER" value="false" />
@ -83,58 +83,22 @@
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Version 9.6Beta. TEST5: imprimir ok, ubicador ok, no se cierra app sacador">
<change afterPath="$PROJECT_DIR$/app/beta/app-beta.apk" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/beta/output-metadata.json" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/debug/app-debug.apk" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/debug/output-metadata.json" afterDir="false" />
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Version 9.6Beta. TEST6-final: Modificando llamadas a SilexCallback (AjustesFragment)">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/release/output-metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/app/release/output-metadata.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/release/vn-picking.apk" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/MobileApplication.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/MobileApplication.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetWokerMistakeUSerCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetWokerMistakeUSerCase.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixInterceptor.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixInterceptor.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/Extensions.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/Extensions.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SilexCallback.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SilexCallback.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemProposalFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemProposalFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/adapter/PreCollectionAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/adapter/PreCollectionAdapter.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/mapper/SaleMapper.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/mapper/SaleMapper.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reposicion/fragment/ReposicionViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/model/ItemUbicadorVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_ubication_row.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_ubication_row.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -145,7 +109,7 @@
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[21114523025303]" />
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[19192521400686]" />
<component name="ExportToHTMLSettings">
<option name="OPEN_IN_BROWSER" value="true" />
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
@ -274,7 +238,7 @@
<property name="DeviceAndSnapshotComboBoxAction.selectedDevice" value="SerialNumber@20211523021031" />
<property name="DeviceAndSnapshotComboBoxAction.selectionTime" value="2021-08-12T14:29:19.760785500Z" />
<property name="ExportApk.ApkPath" value="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app" />
<property name="ExportApk.BuildVariants" value="debug&#10;release" />
<property name="ExportApk.BuildVariants" value="release" />
<property name="ExportApk.SignV1" value="true" />
<property name="ExportApk.SignV2" value="true" />
<property name="I18N_FIX_LAST_USED_CONTEXT" value="Gestor_Almacén.app.main" />
@ -453,13 +417,6 @@
<option name="presentableId" value="Default" />
<updated>1618825571576</updated>
</task>
<task id="LOCAL-00054" summary="Revert &quot;Version 8.2 Subida de ficheros que no estaban versionados&quot;&#10;&#10;This reverts commit 3c0f949e">
<created>1651647601790</created>
<option name="number" value="00054" />
<option name="presentableId" value="LOCAL-00054" />
<option name="project" value="LOCAL" />
<updated>1651647601790</updated>
</task>
<task id="LOCAL-00055" summary="Revert &quot;Revert &quot;Version 8.2 Subida de ficheros que no estaban versionados&quot;&quot;&#10;&#10;This reverts commit 9b8d092d">
<created>1651648056868</created>
<option name="number" value="00055" />
@ -796,7 +753,14 @@
<option name="project" value="LOCAL" />
<updated>1669975009872</updated>
</task>
<option name="localTasksCounter" value="103" />
<task id="LOCAL-00103" summary="Version 9.6Beta. TEST6-final: Modificando llamadas a SilexCallback (AjustesFragment)">
<created>1670580001733</created>
<option name="number" value="00103" />
<option name="presentableId" value="LOCAL-00103" />
<option name="project" value="LOCAL" />
<updated>1670580001733</updated>
</task>
<option name="localTasksCounter" value="104" />
<servers />
</component>
<component name="Vcs.Log.History.Properties">
@ -898,8 +862,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="Version 9.1Beta-CMR quitado, rgb quitado" />
<MESSAGE value="Version 9.1Beta-Compilada versión y formateado Ajustes" />
<MESSAGE value="Version 9.1Beta-Quantity_y_originalQuantity_view_to_Integer.toString" />
<MESSAGE value="Version 9.2Beta-Controlador sin animacion y vuelve al sitio" />
<MESSAGE value="Version 9 Arreglado vuelta atrás controlador" />
@ -923,7 +885,9 @@
<MESSAGE value="Version 9.6Beta en test : ubicador, quality, posicion, buscar item, reclamaciones..." />
<MESSAGE value="Version 9.6Beta en test: paletizadores" />
<MESSAGE value="Version 9.6Beta. TEST5: imprimir ok, ubicador ok, no se cierra app sacador" />
<option name="LAST_COMMIT_MESSAGE" value="Version 9.6Beta. TEST5: imprimir ok, ubicador ok, no se cierra app sacador" />
<MESSAGE value="Version 9.6Beta. TEST6-final: Modificando llamadas con clase" />
<MESSAGE value="Version 9.6Beta. TEST6-final: Modificando llamadas a SilexCallback (AjustesFragment)" />
<option name="LAST_COMMIT_MESSAGE" value="Version 9.6Beta. TEST6-final: Modificando llamadas a SilexCallback (AjustesFragment)" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>

View File

@ -11,7 +11,7 @@ android {
defaultConfig {
applicationId "es.verdnatura"
minSdkVersion 21 //21
minSdkVersion 24 //21
targetSdkVersion 30
versionCode 144
//versionName = "9.4" versionCode 143

View File

@ -4,7 +4,7 @@
"type": "APK",
"kind": "Directory"
},
"applicationId": "es.verdnatura.releasex",
"applicationId": "es.verdnatura",
"variantName": "release",
"elements": [
{

View File

@ -1,11 +1,32 @@
package es.verdnatura.domain
import android.content.Context
import android.graphics.Color
import android.os.Build
import android.text.Html
import android.widget.EditText
import android.widget.Toast
import androidx.annotation.RequiresApi
fun Any.toast(context: Context?, duration: Int = Toast.LENGTH_SHORT): Toast {
/*fun Any.toast(context: Context?, duration: Int = Toast.LENGTH_SHORT): Toast {
return Toast.makeText(context, this.toString(), duration).apply { show() }
}*/
@RequiresApi(Build.VERSION_CODES.N)
fun Any.toast(
context: Context?,
duration: Int = Toast.LENGTH_SHORT,
color: Int = Color.WHITE
): Toast {
val toast = Toast.makeText(
context,
Html.fromHtml("<font color='$color' ><b>$this</b></font>", 0),
duration
)
//toast2.setGravity(Gravity.TOP, 0, 0)
toast.show()
return toast.apply { show() }
}
fun <T : Any> T?.notNull(f: (it: T) -> Unit) {

View File

@ -1,7 +1,7 @@
package es.verdnatura.domain
import android.content.Context
import es.verdnatura.MobileApplication
import android.graphics.Color
import es.verdnatura.R
import es.verdnatura.presentation.base.nameofFunction
import org.json.JSONObject
@ -55,7 +55,7 @@ abstract class SilexCallback<T>(val context: Context) : Callback<T> {
}
open fun onSuccess(response: Response<T>) {
context.getString(R.string.operationSuccessful).toast(context)
(nameofFunction((this))+ context.getString(R.string.operationSuccessful)).toast(context)
//(context as MobileApplication).playSoundIsOK(true)
}

View File

@ -709,7 +709,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
editor.putInt(name,value as Int)
}
"SUPPLIERID"->{
editor.putInt(name,value as Int)
editor.putString(name,value.toString())
}
else -> {
editor.putString(name, value.toString())

View File

@ -84,6 +84,7 @@ class AjustesFragment :
override fun observeViewModel() {
with(viewModel) {
ajustesAdapter = AjustesAdapter(ajustesitem, object : OnAjustesItemClickListener {
override fun onAjustesItemClickListener(item: AjustesItemVO) {
@ -205,12 +206,6 @@ class AjustesFragment :
loadUpdatePacking.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility=View.GONE
/* ma.messageWithSound(
if (it.isError) it.errorMessage else {
getString(R.string.itemUpdated)
}, it.isError, false
)*/
}
}
@ -228,11 +223,15 @@ class AjustesFragment :
workerupdatePrinter.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = View.GONE
ma.messageWithSound(
/* ma.messageWithSound(
if (it.isError) it.errorMessage else {
getString(R.string.printerUpdated)
}, it.isError, false
)
)*/
}
isLoadingProgress.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = it
}

View File

@ -2,6 +2,8 @@ package es.verdnatura.presentation.view.feature.ajustes.fragment
import android.content.Context
import android.view.View.GONE
import android.view.View.VISIBLE
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
@ -17,16 +19,11 @@ import es.verdnatura.presentation.view.feature.ajustes.model.*
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingTypeList
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
class AjustesViewModel(val context: Context) : BaseViewModel(context) {
// private val getAjustesUserCase: GetAjustesUserCase = GetAjustesUserCase(context)
// private val getLoginUserCase: GetLoginUserCase = GetLoginUserCase(context)
//private val getItemCardUserCase: GetItemCardUserCase = GetItemCardUserCase(context)
private val _ajustesitem by lazy { ArrayList<AjustesItemVO>() }
val ajustesitem: List<AjustesItemVO>
get() = _ajustesitem
@ -90,6 +87,15 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
val loadTrainList = Transformations.map(_trainList) { Event(it) }
val loadUpdatePacking = Transformations.map(_actionUpdatePackingTicket) { Event(it) }
private val _isLoadingProgress by lazy { MutableLiveData<Int>() }
val isLoadingProgress: LiveData<Int>
get() = _isLoadingProgress
fun ProgressLoading(visibility: Int) {
_isLoadingProgress.value = visibility
}
fun inititializeDefaultAjusts(
sectorDescrip: String,
sectorFk: Int,
@ -161,16 +167,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
action = actionIsAllowed
)
)
/* _ajustesitem.add(
AjustesItemVO(
3,
contextApp.getString(R.string.labelType),
TypeTags,
0,
0,
0, contextApp.getString(R.string.printerWithout)
)
)*/
_ajustesitem.add(
AjustesItemVO(
4,
@ -199,8 +196,9 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun getItemPackingTypeSalix() {
salix.get_ItemPackingType().enqueue(object :
Callback<List<ItemPackingType>> {
override fun onFailure(call: Call<List<ItemPackingType>>, t: Throwable) {
SilexCallback<List<ItemPackingType>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<ItemPackingType> = ArrayList()
listError.add(
ItemPackingType(
@ -211,10 +209,8 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
_itemspackinglist.value = ItemPackingTypeList(listError)
}
override fun onResponse(
call: Call<List<ItemPackingType>>,
response: Response<List<ItemPackingType>>
) {
override fun onSuccess(response: Response<List<ItemPackingType>>) {
if (response.body() != null) {
_itemspackinglist.value = response.body()?.let { ItemPackingTypeList(it) }
@ -237,18 +233,15 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
}
fun getSectorsSalix() {
salix.getSectorsSalix().enqueue(object : Callback<List<SectorItemVO>> {
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
salix.getSectorsSalix().enqueue(object : SilexCallback<List<SectorItemVO>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<SectorItemVO> = ArrayList()
listError.add(SectorItemVO(0, "", 0, true, t.message!!))
_sectorList.value = SectorListVO(listError)
}
override fun onResponse(
call: Call<List<SectorItemVO>>,
response: Response<List<SectorItemVO>>
) {
override fun onSuccess(response: Response<List<SectorItemVO>>) {
if (response.body() != null) {
_sectorList.value = response.body()?.let { SectorListVO(it) }
@ -268,18 +261,16 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
}
fun printer_get() {
silex.printer_get().enqueue(object : Callback<List<Printers>> {
override fun onFailure(call: Call<List<Printers>>, t: Throwable) {
silex.printer_get().enqueue(object : SilexCallback<List<Printers>>(context) {
override fun onError(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>>
) {
override fun onSuccess(response: Response<List<Printers>>) {
if (response.body() != null) {
@ -300,19 +291,16 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
}
fun train_get() {
silex.train_get().enqueue(object : Callback<List<Train>> {
override fun onFailure(call: Call<List<Train>>, t: Throwable) {
silex.train_get().enqueue(object : SilexCallback<List<Train>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<Train> = ArrayList()
listError.add(Train(0, "", true, t.message!!))
_trainList.value = TrainList(listError)
}
override fun onResponse(
call: Call<List<Train>>,
response: Response<List<Train>>
) {
override fun onSuccess(response: Response<List<Train>>) {
if (response.body() != null) {
_trainList.value = response.body()?.let { TrainList(it) }
@ -334,8 +322,8 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun worker_updateSector(sectorFk: Int) {
silex.worker_updateSector(sectorFk)
.enqueue(object : Callback<Unit> {
override fun onFailure(call: Call<Unit>, t: Throwable) {
.enqueue(object : SilexCallback<Unit>(context) {
override fun onError(t: Throwable) {
_actionUpdate.value = ResponseItemVO(
isError = true,
@ -343,27 +331,13 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
)
}
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
) {
override fun onSuccess(response: Response<Unit>) {
_actionUpdate.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
if (!response.isSuccessful) {
_actionUpdate.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_actionUpdate.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
)
}
)
}
@ -374,8 +348,8 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun operator_updateItemPackingType(itemPackingTypeFk: String) {
silex.operator_updateItemPackingType(itemPackingTypeFk)
.enqueue(object : Callback<Unit> {
override fun onFailure(call: Call<Unit>, t: Throwable) {
.enqueue(object : SilexCallback<Unit>(context) {
override fun onError(t: Throwable) {
_actionUpdatePacking.value = ResponseItemVO(
isError = true,
@ -383,28 +357,14 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
)
}
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
) {
override fun onSuccess(response: Response<Unit>) {
if (!response.isSuccessful) {
_actionUpdatePacking.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_actionUpdatePacking.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
)
}
_actionUpdatePacking.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
)
}
@ -414,8 +374,9 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun operator_getNumberOfWagons() {
silex.operator_getNumberOfWagons()
.enqueue(object : Callback<Int?> {
override fun onFailure(call: Call<Int?>, t: Throwable) {
.enqueue(object : SilexCallback<Int?>(context) {
override fun onError(t: Throwable) {
_operatorGetNumberOfWagons.value = ResponseItemNumber(
null,
@ -424,27 +385,10 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
)
}
override fun onResponse(
call: Call<Int?>,
response: Response<Int?>
) {
if (!response.isSuccessful) {
_operatorGetNumberOfWagons.value = ResponseItemNumber(
null, true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
if (response.body() != null)
_operatorGetNumberOfWagons.value =
ResponseItemNumber(response.body(), isError = false)
}
override fun onSuccess(response: Response<Int?>) {
if (response.body() != null)
_operatorGetNumberOfWagons.value =
ResponseItemNumber(response.body(), isError = false)
}
@ -454,40 +398,22 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun operator_getTrain() {
silex.operator_getTrain()
.enqueue(object : Callback<String?> {
override fun onFailure(call: Call<String?>, t: Throwable) {
.enqueue(object : SilexCallback<String?>(context) {
override fun onError(t: Throwable) {
_operatorGetTrainResponse.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(
call: Call<String?>,
response: Response<String?>
) {
if (!response.isSuccessful) {
_operatorGetTrainResponse.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
override fun onSuccess(response: Response<String?>) {
_operatorGetTrainResponse.value =
ResponseItemVO(
if (response.body().toString() == "false") "" else {
response.body().toString()
}, false
)
} else {
_operatorGetTrainResponse.value =
ResponseItemVO(
if (response.body().toString() == "false") "" else {
response.body().toString()
}, false
)
}
}
})
}
@ -495,9 +421,8 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun operator_getItemPackingType() {
silex.operator_getItemPackingType()
.enqueue(object : Callback<String?> {
override fun onFailure(call: Call<String?>, t: Throwable) {
.enqueue(object : SilexCallback<String?>(context) {
override fun onError(t: Throwable) {
_operatorGetItemPackingType.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
@ -534,10 +459,9 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
}
fun worker_isF11Allowed() {
silex.worker_isF11Allowed()
.enqueue(object : Callback<Boolean> {
override fun onFailure(call: Call<Boolean>, t: Throwable) {
.enqueue(object : SilexCallback<Boolean>(context) {
override fun onError(t: Throwable) {
_workerAllowedResponse.value = ResponseItemVO(
isError = true,
@ -545,126 +469,46 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
)
}
override fun onResponse(
call: Call<Boolean>,
response: Response<Boolean>
) {
if (!response.isSuccessful) {
_workerAllowedResponse.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_workerAllowedResponse.value =
ResponseItemVO(response.body().toString(), false)
}
override fun onSuccess(response: Response<Boolean>) {
_workerAllowedResponse.value = ResponseItemVO(
response = response.body().toString(),
isError = false,
)
}
})
}
fun worker_updatePrinter(printerFk: Int) {
ProgressLoading(VISIBLE)
silex.worker_updatePrinter(printerFk)
.enqueue(object : Callback<Unit> {
override fun onFailure(call: Call<Unit>, t: Throwable) {
_workerupdatePrinter.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
.enqueue(object : SilexCallback<Unit>(context) {
override fun onError(t: Throwable) {
ProgressLoading(GONE)
throw t
}
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
) {
if (!response.isSuccessful) {
_workerupdatePrinter.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_workerupdatePrinter.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
)
}
override fun onSuccess(response: Response<Unit>) {
ProgressLoading(GONE)
super.onSuccess(response)
}
})
}
fun operator_updateTrain(trainFk: Int) {
ProgressLoading(VISIBLE)
silex.operator_updateTrain(trainFk)
.enqueue(object : SilexCallback<Unit>(context) {
/* override fun onFailure(call: Call<Unit>, t: Throwable) {
_actionUpdatePacking.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
) {
if (!response.isSuccessful) {
_actionUpdatePacking.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_actionUpdatePacking.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
)
}
}*/
override fun onError(t: Throwable) {
//throw Error(nameofFunction((this)) + t.message)
_actionUpdatePackingTicket.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
ProgressLoading(GONE)
throw t
}
override fun onSuccess(response: Response<Unit>) {
_actionUpdatePackingTicket.value = ResponseItemVO(
isError = false,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
super.onSuccess(response)
ProgressLoading(GONE)
//super.onSuccess(response)
}
})

View File

@ -2506,15 +2506,14 @@ class CollectionFragment(
}
private fun showMistakeList(list: List<MistakeTypeVO>) {
customDialogInput.dismiss()
binding.splashProgress.visibility = GONE
listPlacementSupply = ArrayList()
list.forEach {
listPlacementSupply.add(BarcodeVO(code = it.description))
}
customDialogList.setTitle(getString(R.string.errorCause))
.setKoButton(getString(R.string.cancel)) {
scanRequest()

View File

@ -5,7 +5,6 @@ import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
@ -22,7 +21,6 @@ import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapter
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO

View File

@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.util.Log
import android.util.TypedValue
import android.view.View.GONE
import android.view.View.VISIBLE

View File

@ -500,7 +500,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
//#tarea4021
/* _pasillerositem.add(
/* _pasillerositem.add(
PasillerosItemVO(
6,
R.drawable.ic_packaging,

View File

@ -5,7 +5,6 @@ import android.graphics.drawable.Drawable
import android.media.MediaPlayer
import android.os.Build
import android.os.Bundle
import android.util.Log.d
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE

View File

@ -7,7 +7,6 @@ import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
@ -25,7 +24,6 @@ import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.reposicion.adapter.ReposicionAdapter
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO

View File

@ -497,7 +497,6 @@ class UbicadorFragment(
onVisibleClickListener = object : OnVisibleClickListener {
override fun onVisibleClickListener(item: ItemUbicadorVO) {
"el item es ${item.item}".toast(context)
showAddItem(
item.item.toString(),
item.packing,
@ -724,12 +723,12 @@ class UbicadorFragment(
val visible_calc = (etiquetas * packing!!.toInt())
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingMake(
shelvingFk,
itemFk,
visible_calc,
packing,
getDataInt(WAREHOUSEFK),
groupingPack
shelving = shelvingFk,
item = itemFk,
quantity = visible_calc,
packing = packing,
warehouse = getDataInt(WAREHOUSEFK),
grouping = groupingPack
)
customDialogUbicador.setItemValue("").setPackingValue("")