Modifico control vehiculo para que no vuelva a pedir escanear cuando se vuelve atrás, modificado historico de vehiculos ahora informa en el caso que esté vacía la lista y añadido fallo de trabajador. En test. No subida

This commit is contained in:
Sergio De la torre 2022-02-10 07:01:48 +01:00
parent b76c721258
commit 87aea478c3
74 changed files with 834 additions and 1101 deletions

View File

@ -13,7 +13,9 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_oval_unchecked.xml" value="0.30052083333333335" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_oval_unchecked.xml" value="0.30052083333333335" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode.xml" value="0.2359375" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode.xml" value="0.2359375" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode_scan.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode_scan.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/border.xml" value="0.27447916666666666" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/border_parental.xml" value="0.11979166666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/border_parental.xml" value="0.11979166666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/btn_blue.xml" value="0.27447916666666666" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulate.xml" value="0.18489583333333334" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulate.xml" value="0.18489583333333334" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulation.xml" value="0.19814814814814816" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulation.xml" value="0.19814814814814816" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_desactivate.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_desactivate.xml" value="0.1" />
@ -31,6 +33,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/crane.xml" value="0.23802083333333332" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/crane.xml" value="0.23802083333333332" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/day_of_sale.xml" value="0.184375" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/day_of_sale.xml" value="0.184375" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/delete.xml" value="0.19166666666666668" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/delete.xml" value="0.19166666666666668" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/emoticon_error.xml" value="0.27447916666666666" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/eraser.xml" value="0.26564102564102565" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/eraser.xml" value="0.26564102564102565" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/face_man_outline.xml" value="0.22708333333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/face_man_outline.xml" value="0.22708333333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/filter_outline.xml" value="0.22239583333333332" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/filter_outline.xml" value="0.22239583333333332" />
@ -75,6 +78,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_black.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_black.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_selected.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_selected.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/phone_call.xml" value="0.26145833333333335" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/phone_call.xml" value="0.26145833333333335" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/previous_delete.xml" value="0.27447916666666666" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/qrcode_scan.xml" value="0.17395833333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/qrcode_scan.xml" value="0.17395833333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/rectangle.xml" value="0.31979166666666664" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/rectangle.xml" value="0.31979166666666664" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/revision_icon.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/revision_icon.xml" value="0.1" />
@ -84,13 +88,13 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/worker.xml" value="0.12" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/worker.xml" value="0.12" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/worker_mistake.xml" value="0.15364583333333334" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/worker_mistake.xml" value="0.15364583333333334" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_imageview.xml" value="0.134375" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_imageview.xml" value="0.134375" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_login.xml" value="0.134375" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_login.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_main.xml" value="0.17916666666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_main.xml" value="0.17916666666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/buyers_fragment.xml" value="0.18333333333333332" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/buyers_fragment.xml" value="0.18333333333333332" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_dialog.xml" value="0.1490036231884058" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_dialog.xml" value="0.1490036231884058" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog.xml" value="0.10208333333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog.xml" value="0.10208333333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_hour.xml" value="0.1793478260869565" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_hour.xml" value="0.1793478260869565" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_list_dialog.xml" value="0.1490036231884058" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_list_dialog.xml" value="0.3333333333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.12817028985507245" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.12817028985507245" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_two_dialog.xml" value="0.1793478260869565" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_two_dialog.xml" value="0.1793478260869565" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.3333333333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.3333333333333333" />
@ -150,6 +154,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionstate_row.xml" value="0.23489583333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionstate_row.xml" value="0.23489583333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditiontruck_row.xml" value="0.1793478260869565" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditiontruck_row.xml" value="0.1793478260869565" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_faltas_row.xml" value="0.1793478260869565" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_faltas_row.xml" value="0.1793478260869565" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_general_row.xml" value="0.13360507246376813" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historico_row.xml" value="0.15353260869565216" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historico_row.xml" value="0.15353260869565216" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historicovehiculo_row.xml" value="0.18795289855072464" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historicovehiculo_row.xml" value="0.18795289855072464" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_inventary_row.xml" value="0.22604166666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_inventary_row.xml" value="0.22604166666666667" />
@ -167,7 +172,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_toolbar_row.xml" value="0.15307971014492755" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_toolbar_row.xml" value="0.15307971014492755" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ubication_row.xml" value="0.11822916666666666" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ubication_row.xml" value="0.11822916666666666" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_worker_image.xml" value="0.23177083333333334" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_worker_image.xml" value="0.23177083333333334" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_workermistake_row.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_workermistake_row.xml" value="0.4466666666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/qauality_fragment.xml" value="0.15353260869565216" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/qauality_fragment.xml" value="0.15353260869565216" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/reposicion_fragment.xml" value="0.15353260869565216" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/reposicion_fragment.xml" value="0.15353260869565216" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/shelvinglog_row.xml" value="0.18385416666666668" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/shelvinglog_row.xml" value="0.18385416666666668" />

View File

@ -7,7 +7,7 @@ class ApiNodeJsUtils {
companion object { companion object {
//const val BASE_URL:String = "http://192.168.1.108:8000/" //const val BASE_URL:String = "http://192.168.1.108:8000/"
const val BASE_URL:String = "http://10.2.2.49:7777" const val BASE_URL:String = "https://smart-tag.verdnatura.es"
fun getApiService():NodeJsService{ fun getApiService():NodeJsService{
val nodeJsRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory( val nodeJsRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
GsonConverterFactory.create()).build() GsonConverterFactory.create()).build()

View File

@ -75,24 +75,21 @@ class GetLoginUserCase(context: Context) : RestClient(context)
shelving: String shelving: String
): Call<NodeJsService.SmartTagNode> ): Call<NodeJsService.SmartTagNode>
{ {
return nodejsClient!!.bindShelving("application/json", "A0A3B8224DBF", "ABC", "2") //https://smart-tag.verdnatura.es/bindShelving/A0A3B8224DBF&ABC&1
return nodejsClient!!.bindShelving("application/json", "A0A3B8224DBF", "ABB", "1")
// return nodejsClient!!.bindShelving("application/json", NodeJsService.SmartTagNode(smarttag, wagon, shelving),"A0A3B8224DBF","ABC","2") // return nodejsClient!!.bindShelving("application/json", NodeJsService.SmartTagNode(smarttag, wagon, shelving),"A0A3B8224DBF","ABC","2")
} }
/* fun checkVersion_old(usuario: String, password: String, version: String): Call<Boolean>
{
val params: ArrayList<String> = ArrayList()
params.add(version)
return restClient!!.version("json", "1", usuario, password, "application/json", params)
*/
//SALIX SERGIO MENSAJE : PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO. //SALIX SERGIO MENSAJE : PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO.
fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{ fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message)) return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message))
} }
// SERGIO: PARA DESARROLLO SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA // SERGIO: PARA DESARROLLO SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA
/*fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean> /*fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>

View File

@ -150,6 +150,23 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
) )
} }
fun saleTracking_update(
usuario: String,
password: String,
saleFk: String
): Call<Unit> {
val params: ArrayList<String> = ArrayList()
params.add(saleFk)
return restClient!!.saleTracking_update(
"json",
"1",
usuario,
password,
"application/json",
params
)
}
fun itemPlacementSupplyAiming( fun itemPlacementSupplyAiming(
usuario: String, usuario: String,
password: String, password: String,

View File

@ -23,18 +23,16 @@ class GetWokerMistakeUSerCase(context: Context) : RestClient(context) {
} }
fun saleMistakeAdd( fun workerMistake_Add(
usuario: String, usuario: String,
password: String, password: String,
vSaleFk: String,
vUserFk: String, vUserFk: String,
vTypeFk: String vTypeFk: String
): Call<String> { ): Call<Unit> {
val params: ArrayList<String> = ArrayList() val params: ArrayList<String> = ArrayList()
params.add(vSaleFk)
params.add(vUserFk) params.add(vUserFk)
params.add(vTypeFk) params.add(vTypeFk)
return restClient!!.saleMistakeAdd( return restClient!!.workerMistake_Add(
"json", "json",
"1", "1",
usuario, usuario,

View File

@ -1,6 +1,7 @@
package es.verdnatura.domain package es.verdnatura.domain
import retrofit2.Call import retrofit2.Call
import retrofit2.http.FormUrlEncoded
import retrofit2.http.Header import retrofit2.http.Header
import retrofit2.http.POST import retrofit2.http.POST
import retrofit2.http.Path import retrofit2.http.Path
@ -14,7 +15,7 @@ interface NodeJsService {
//NODEJS TEST //NODEJS TEST
// @FormUrlEncoded //@FormUrlEncoded
@POST("/bindShelving/{Id1}&{Id2}&{Id3}") @POST("/bindShelving/{Id1}&{Id2}&{Id3}")
fun bindShelving( fun bindShelving(
@Header("Content-Type") content_type: String, @Header("Content-Type") content_type: String,

View File

@ -37,7 +37,7 @@ interface SalixService {
fun getSectorsSalix( fun getSectorsSalix(
@Header("Content-Type") content_type: String, @Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String, @Header("Authorization") authorization: String,
//@Body params: SalixGrupo
): ):
Call<List<SectorItemVO>> Call<List<SectorItemVO>>

View File

@ -238,6 +238,17 @@ interface VerdnaturaService {
): ):
Call<String> Call<String>
@POST("almacennew/saleTracking_update")//REVISADA
fun saleTracking_update(
@Header("aplicacion") aplicacion: String,
@Header("version") version: String,
@Header("user") user: String,
@Header("pass") pass: String,
@Header("Content-Type") content_type: String,
@Body params: List<String>
):
Call<Unit>
@POST("almacennew/itemPlacementSupplyAiming")//REVISADA @POST("almacennew/itemPlacementSupplyAiming")//REVISADA
fun itemPlacementSupplyAiming( fun itemPlacementSupplyAiming(
@Header("aplicacion") aplicacion: String, @Header("aplicacion") aplicacion: String,
@ -416,6 +427,17 @@ interface VerdnaturaService {
): ):
Call<String> Call<String>
@POST("almacennew/workerMistake_Add")//REVISADA
fun workerMistake_Add(
@Header("aplicacion") aplicacion: String,
@Header("version") version: String,
@Header("user") user: String,
@Header("pass") pass: String,
@Header("Content-Type") content_type: String,
@Body params: List<String>
):
Call<Unit>
@POST("almacennew/mistakeType")//REVISADA @POST("almacennew/mistakeType")//REVISADA
fun mistakeType( fun mistakeType(
@Header("aplicacion") aplicacion: String, @Header("aplicacion") aplicacion: String,

View File

@ -14,7 +14,6 @@ import android.speech.RecognizerIntent
import android.speech.SpeechRecognizer import android.speech.SpeechRecognizer
import android.speech.tts.TextToSpeech import android.speech.tts.TextToSpeech
import android.speech.tts.UtteranceProgressListener import android.speech.tts.UtteranceProgressListener
import android.text.Editable
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -31,6 +30,7 @@ import es.verdnatura.domain.ConstAndValues
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
import es.verdnatura.domain.toast import es.verdnatura.domain.toast
import es.verdnatura.presentation.common.mediaCurrentVolume import es.verdnatura.presentation.common.mediaCurrentVolume
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
import timber.log.Timber import timber.log.Timber
import java.util.* import java.util.*
@ -60,10 +60,14 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
protected val WAGON = "wagon" protected val WAGON = "wagon"
protected val TAGSTYPE = "tagstype" protected val TAGSTYPE = "tagstype"
protected val WAREHOUSEFK_DEFAULT = 60 protected val WAREHOUSEFK_DEFAULT = 60
protected val DATENOVEHICLE="DATENOVEHICLE"
protected val DEPARTMENTMISTAKE="DEPARTMENTMISTAKE"
protected val DEPARTMENTMISTAKEID="DEPARTMENTMISTAKEID"
protected val viewModel: V by viewModel(viewModelClass) protected val viewModel: V by viewModel(viewModelClass)
protected lateinit var binding: T protected lateinit var binding: T
private var isOnReadyForSpeech = false private var isOnReadyForSpeech = false
protected lateinit var ma: MainActivity
private var textToSpeech: TextToSpeech? = null private var textToSpeech: TextToSpeech? = null
private var mAudioManager: AudioManager? = null private var mAudioManager: AudioManager? = null
@ -89,6 +93,16 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
) )
override fun onAttach(context: Context) {
super.onAttach(context)
if ((requireActivity().componentName).toString().contains("MainActivity")){
ma=activity as MainActivity
}
}
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, inflater: LayoutInflater,
container: ViewGroup?, container: ViewGroup?,
@ -120,6 +134,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
init() init()
} }
@LayoutRes @LayoutRes
@ -185,8 +200,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
if (textScanned.length>13) { if (textScanned.length>13) {
var size = textScanned.length var size = textScanned.length
if (textScanned!!.substring((size / 2), size) if (textScanned.substring((size / 2), size) == textScanned.substring(0, size / 2)
.equals(textScanned.substring(0, size / 2))
) { ) {
return textScanned.substring(0, size / 2) return textScanned.substring(0, size / 2)
@ -224,6 +238,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
R.drawable.alpha_b_circle_outline->"Ver movimientos de Basura" R.drawable.alpha_b_circle_outline->"Ver movimientos de Basura"
R.drawable.filter_outline->"Filtra por tipo de flor" R.drawable.filter_outline->"Filtra por tipo de flor"
R.drawable.previous_delete->"Quita de pantalla lo que ya está sacado ( misma función que escanear 2.000.000)"
else -> {""} else -> {""}
} }
@ -495,13 +510,29 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
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()
DATENOVEHICLE->prefs.getString(name,"0").toString()
DEPARTMENTMISTAKE->prefs.getString(name,"").toString()
DEPARTMENTMISTAKEID->prefs.getString(name,"").toString()
else -> {""} else -> {""}
} }
} }
fun saveData(name:String,value:String){
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
val editor = prefs.edit()
when (name){
name-> editor.putString(name, value)
}
editor.apply()
}
fun saveBuyer(buyernickname: String) { fun saveBuyer(buyernickname: String) {
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0) val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
val editor = prefs.edit() val editor = prefs.edit()
@ -522,23 +553,6 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
return imei.toString() return imei.toString()
} }
/* fun getANDROIDID(): String {
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
val androidid = prefs.getString(ANDROID_ID, "0")
return androidid.toString()
}*/
/*fun getWagons(): Int {
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
val wagons = prefs.getInt(WAGON, 2)
return wagons
}*/
/* fun getTagsType(): String {
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
val tagstype = prefs.getString(TAGSTYPE, "Stickers")
return tagstype.toString()
}*/
fun getMessageFromJSON(json: String): String { fun getMessageFromJSON(json: String): String {
val gson = Gson() val gson = Gson()

View File

@ -29,6 +29,7 @@ fun getMessageFromAllResponse(callFunction: String, ResponseMessage: String): St
messageFromError = ResponseMessage messageFromError = ResponseMessage
} }
//sergio:para personalizar los mensajes de respuesta según la llamada. //sergio:para personalizar los mensajes de respuesta según la llamada.
when (callFunction) when (callFunction)
{ {

View File

@ -0,0 +1,47 @@
package es.verdnatura.presentation.common
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.databinding.ItemGeneralRowBinding
class GeneralAdapter(
private val items: List<GeneralItem>,
private val OnGeneralItemRowClickListener: OnGeneralItemRowClickListener,
// private var showDelete: Boolean = true
): RecyclerView.Adapter<GeneralAdapter.ItemHolder> () {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
ItemGeneralRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
)
}
override fun getItemCount() =items.size
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
holder.binding.root.setOnClickListener {
OnGeneralItemRowClickListener.OnGeneralItemRowClickListener(items[position])
}
}
inner class ItemHolder(
val binding: ItemGeneralRowBinding
) : RecyclerView.ViewHolder(binding.root){
//private val res = binding.root.context.resources
fun bind(item: GeneralItem) {
binding.apply {
this.item = item
/* if (showDelete) itemImage.visibility = View.VISIBLE
else itemImage.visibility = View.GONE*/
itemTitle.visibility=View.GONE
}
}
}
}

View File

@ -20,3 +20,8 @@ class DataMessageSalix(
var personSale: String = "" var personSale: String = ""
) )
class GeneralItem(
var code:String? = "",
var text:String? = ""
)

View File

@ -45,9 +45,9 @@ interface OnAjustesItemClickListener {
interface OnItemCardRowClickListener { interface OnItemCardRowClickListener {
fun onItemCardRowClickListener(item: ItemCardRowVO) fun onItemCardRowClickListener(item: ItemCardRowVO)
} }
interface OnItemExpeditionStateRowClickListener { /*interface OnItemExpeditionStateRowClickListener {
fun OnItemExpeditionStateRowClickListener(item: ItemExpeditionStateRow) fun OnItemExpeditionStateRowClickListener(item: ItemExpeditionStateRow)
} }*/
interface OnBarcodeRowClickListener { interface OnBarcodeRowClickListener {
fun onBarcodeRowClickListener(item: BarcodeVO) fun onBarcodeRowClickListener(item: BarcodeVO)
@ -57,6 +57,10 @@ interface OnSmartTagRowClickListener {
fun OnSmartTagRowClickListener(item: SmartTag) fun OnSmartTagRowClickListener(item: SmartTag)
} }
interface OnGeneralItemRowClickListener {
fun OnGeneralItemRowClickListener(item: GeneralItem)
}
interface OnLocationRowClickListener { interface OnLocationRowClickListener {
fun onLocationRowClickListener(item: ItemLocationVO) fun onLocationRowClickListener(item: ItemLocationVO)
} }

View File

@ -66,7 +66,7 @@ class AjustesFragment :
override fun init() { override fun init() {
(activity as MainActivity).hideBottomNavigation(View.VISIBLE) ma.hideBottomNavigation(View.VISIBLE)
binding.userText.setText(getData(USER)) binding.userText.setText(getData(USER))
val versionName = requireActivity().packageManager.getPackageInfo( val versionName = requireActivity().packageManager.getPackageInfo(
requireActivity().packageName, requireActivity().packageName,
@ -137,7 +137,7 @@ class AjustesFragment :
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) {
(activity as MainActivity).onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Control de usuario de vehículo" title = "Control de usuario de vehículo"
), getData(USERFK) ), getData(USERFK)

View File

@ -66,7 +66,7 @@ class ItemCardFragment(
override fun init() { override fun init() {
binding.itemcardLayout.visibility = View.GONE binding.itemcardLayout.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
setEvents() setEvents()
//toolbar_title.text = getString(R.string.ConsultarArticulo) //toolbar_title.text = getString(R.string.ConsultarArticulo)
@ -117,7 +117,7 @@ class ItemCardFragment(
if (itemFk.isNullOrEmpty()) { if (itemFk.isNullOrEmpty()) {
"Escanea un item".toast(requireActivity()) "Escanea un item".toast(requireActivity())
} else { } else {
(activity as MainActivity).onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = "Historico"), PasillerosItemVO(title = "Historico"),
itemInfoG!!.id itemInfoG!!.id
) )
@ -147,7 +147,7 @@ class ItemCardFragment(
if (!binding.editItemFk.text.toString().isNullOrEmpty()) if (!binding.editItemFk.text.toString().isNullOrEmpty())
getItemCard(binding.editItemFk.text.toString()) getItemCard(binding.editItemFk.text.toString())
binding.editItemFk.setText("") binding.editItemFk.setText("")
(activity as MainActivity).hideKeyboard(binding.editItemFk) ma.hideKeyboard(binding.editItemFk)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -190,7 +190,7 @@ class ItemCardFragment(
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 = "ItemCard"
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
} else { } else {
if (it.id != "0") { if (it.id != "0") {
@ -200,7 +200,7 @@ class ItemCardFragment(
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 = "ItemCard"
(activity as MainActivity).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,"Sin resultados")
} }
@ -216,7 +216,7 @@ class ItemCardFragment(
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
} else { } else {
getItemCard(itemFk) getItemCard(itemFk)
} }
@ -386,7 +386,7 @@ class ItemCardFragment(
if (item.action == "itemProposal") { if (item.action == "itemProposal") {
(activity as MainActivity).onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Buscar artículos similares" title = "Buscar artículos similares"
), itemFk ), itemFk
@ -400,12 +400,12 @@ class ItemCardFragment(
customDialogInput.setTitle(item.title!!) customDialogInput.setTitle(item.title!!)
.setDescription("Valor actual: " + item.value!!) .setDescription("Valor actual: " + item.value!!)
.setOkButton("Guardar") { .setOkButton("Guardar") {
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton("Cancelar") { }.setKoButton("Cancelar") {
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.dismiss() customDialogInput.dismiss()
}.setValue("").show() }.setValue("").show()
customDialogInput.getEditText().requestFocus() customDialogInput.getEditText().requestFocus()
@ -416,7 +416,7 @@ class ItemCardFragment(
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
customDialogInput.setValue("") customDialogInput.setValue("")
customDialogInput.dismiss() customDialogInput.dismiss()
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -425,7 +425,7 @@ class ItemCardFragment(
//BARCODE ROW //BARCODE ROW
prepareBarcodeDialog(item) prepareBarcodeDialog(item)
} else if (item.action == "buscarItem") { } else if (item.action == "buscarItem") {
(activity as MainActivity).onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Buscar item" title = "Buscar item"
), itemFk ), itemFk
@ -434,12 +434,12 @@ class ItemCardFragment(
customDialogInput.setTitle(item.title!!) customDialogInput.setTitle(item.title!!)
.setDescription("Indica la cantidad a dar de alta") .setDescription("Indica la cantidad a dar de alta")
.setOkButton("Guardar") { .setOkButton("Guardar") {
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton("Cancelar") { }.setKoButton("Cancelar") {
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.dismiss() customDialogInput.dismiss()
}.setValue("").show() }.setValue("").show()
customDialogInput.getEditText().requestFocus() customDialogInput.getEditText().requestFocus()
@ -450,7 +450,7 @@ class ItemCardFragment(
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
customDialogInput.setValue("") customDialogInput.setValue("")
customDialogInput.dismiss() customDialogInput.dismiss()
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -459,12 +459,12 @@ class ItemCardFragment(
customDialogInput.setTitle(item.title!!) customDialogInput.setTitle(item.title!!)
.setDescription("Indica la cantidad a dar de baja ") .setDescription("Indica la cantidad a dar de baja ")
.setOkButton("Guardar") { .setOkButton("Guardar") {
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton("Cancelar") { }.setKoButton("Cancelar") {
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.dismiss() customDialogInput.dismiss()
}.setValue("").show() }.setValue("").show()
customDialogInput.getEditText().requestFocus() customDialogInput.getEditText().requestFocus()
@ -475,7 +475,7 @@ class ItemCardFragment(
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
customDialogInput.setValue("") customDialogInput.setValue("")
customDialogInput.dismiss() customDialogInput.dismiss()
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -663,7 +663,7 @@ class ItemCardFragment(
} }
} catch (e: Exception) { } catch (e: Exception) {
// binding.itemcardLayout.visibility = View.GONE // binding.itemcardLayout.visibility = View.GONE
(activity as MainActivity).messageWithSound("El elemento introducido no es un número",true,true) ma.messageWithSound("El elemento introducido no es un número",true,true)
} }
} }
@ -671,25 +671,25 @@ class ItemCardFragment(
private fun prepareBarcodeDialog(itemB: ItemCardRowVO) { private fun prepareBarcodeDialog(itemB: ItemCardRowVO) {
customDialogList.setTitle("Barcodes").setOkButton("Guardar") { customDialogList.setTitle("Barcodes").setOkButton("Guardar") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
if (!customDialogList.getValue().isNullOrEmpty()) if (!customDialogList.getValue().isNullOrEmpty())
updateBarcode(customDialogList.getValue(), "0", itemB) updateBarcode(customDialogList.getValue(), "0", itemB)
customDialogList.dismiss() customDialogList.dismiss()
}.setKoButton("Cerrar") { }.setKoButton("Cerrar") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.dismiss() customDialogList.dismiss()
}.setValue("").show() }.setValue("").show()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (!customDialogList.getValue().isNullOrEmpty()) if (!customDialogList.getValue().isNullOrEmpty())
updateBarcode(customDialogList.getValue(), "0", itemB) updateBarcode(customDialogList.getValue(), "0", itemB)
customDialogList.setValue("") customDialogList.setValue("")
customDialogList.dismiss() customDialogList.dismiss()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -68,7 +68,7 @@ class ItemProposalFragment(
override fun init() { override fun init() {
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
"${getString(R.string.ArticleSimilar)}:$itemFk".also { it -> it.also { binding.mainToolbar.toolbarTitle.text = it } } "${getString(R.string.ArticleSimilar)}:$itemFk".also { it -> it.also { binding.mainToolbar.toolbarTitle.text = it } }
setToolBar() setToolBar()

View File

@ -77,7 +77,7 @@ class BufferFragment(
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard( binding.scanInput) ma.hideKeyboard( binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -91,12 +91,12 @@ class BufferFragment(
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound( ma.messageWithSound(
it.errorMessage,true,isPlayed = true) it.errorMessage,true,isPlayed = true)
} else { } else {
(activity as MainActivity).messageWithSound("Operación "+entryPoint.lowercase() + " buffer realizada correctamente",false,isPlayed = true) ma.messageWithSound("Operación "+entryPoint.lowercase() + " buffer realizada correctamente",false,isPlayed = true)
binding.mainToolbar.backButton.performClick() binding.mainToolbar.backButton.performClick()
} }

View File

@ -41,7 +41,7 @@ class BufferLoadFragment(
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
goBack = false goBack = false
(activity as MainActivity).hideBottomNavigation(GONE) ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error) mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
@ -107,12 +107,12 @@ class BufferLoadFragment(
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage,it.isError,true) ma.messageWithSound(it.errorMessage,it.isError,true)
} else { } else {
if (it.response.equals("Registro añadido")){ if (it.response.equals("Registro añadido")){
(activity as MainActivity).messageWithSound(it.response,false,true) ma.messageWithSound(it.response,false,true)
}else{ }else{
mperror?.start() mperror?.start()
it.response.toast(requireContext()) it.response.toast(requireContext())
@ -156,7 +156,7 @@ class BufferLoadFragment(
customDialogList.setTitle("Escanea etiqueta de la expedición.") customDialogList.setTitle("Escanea etiqueta de la expedición.")
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
listTags.clear() listTags.clear()
@ -168,7 +168,7 @@ class BufferLoadFragment(
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
@ -179,7 +179,7 @@ class BufferLoadFragment(
} }
customDialogList.setValue("") customDialogList.setValue("")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -36,7 +36,7 @@ class BuscarItemFragment(
override fun init() { override fun init() {
(activity as MainActivity).hideBottomNavigation(GONE) ma.hideBottomNavigation(GONE)
binding.mainToolbar.toolbarTitle.text = getString(R.string.getubicaition) binding.mainToolbar.toolbarTitle.text = getString(R.string.getubicaition)
// customDialog = CustomDialog(requireContext()) // customDialog = CustomDialog(requireContext())
setEvents() setEvents()
@ -54,7 +54,7 @@ class BuscarItemFragment(
if (!binding.editItemFk.text.toString().isNullOrEmpty()) if (!binding.editItemFk.text.toString().isNullOrEmpty())
getLocations(binding.editItemFk.text.toString()) getLocations(binding.editItemFk.text.toString())
binding.editItemFk.setText("") binding.editItemFk.setText("")
(activity as MainActivity).hideKeyboard(binding.editItemFk) ma.hideKeyboard(binding.editItemFk)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -47,7 +47,7 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
override fun init() { override fun init() {
// customDialog = CustomDialog(requireContext()) // customDialog = CustomDialog(requireContext())
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.quality) binding.mainToolbar.toolbarTitle.text = getString(R.string.quality)

View File

@ -53,7 +53,7 @@ class QaualityFragment(
override fun init() { override fun init() {
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = "itemShelving_BuyerTask" binding.mainToolbar.toolbarTitle.text = "itemShelving_BuyerTask"
setToolBar() setToolBar()

View File

@ -52,13 +52,6 @@ class CollectionFragment(
) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) { ) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) {
private lateinit var dataMessageSalix: DataMessageSalix private lateinit var dataMessageSalix: DataMessageSalix
/* private var user = ""
private var password = ""
private var sectorFk = ""
private var warehouseFk = ""
private var SectorDescription = ""
private var token = ""
private var voz = ""*/
private var sales: List<SaleVO> = listOf() private var sales: List<SaleVO> = listOf()
private var saleAdapter: SaleAdapter? = null private var saleAdapter: SaleAdapter? = null
private var lm: LinearLayoutManager? = null private var lm: LinearLayoutManager? = null
@ -156,8 +149,7 @@ class CollectionFragment(
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
//requireActivity().main_bottom_navigation.visibility = View.GONE ma.hideBottomNavigation(View.GONE)
(activity as MainActivity).hideBottomNavigation(View.GONE)
if (binding.splashProgress != null) binding.splashProgress.visibility = VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = VISIBLE
setEvents() setEvents()
@ -252,7 +244,7 @@ class CollectionFragment(
private fun showUser() { private fun showUser() {
(activity as MainActivity).onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = "Control de usuario de vehículo"), PasillerosItemVO(title = "Control de usuario de vehículo"),
workerFkFromTicket workerFkFromTicket
) )
@ -357,7 +349,7 @@ class CollectionFragment(
responseUsedShelves.observe(viewLifecycleOwner, Observer { responseUsedShelves.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
(activity as MainActivity).messageWithSound( ma.messageWithSound(
if (it.isError) it.errorMessage else "Baldas guardadas", if (it.isError) it.errorMessage else "Baldas guardadas",
it.isError,true it.isError,true
) )
@ -365,7 +357,7 @@ class CollectionFragment(
}) })
responseItem_updatePackingShelve.observe(viewLifecycleOwner, Observer { responseItem_updatePackingShelve.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
(activity as MainActivity).messageWithSound( ma.messageWithSound(
if (it.isError) it.errorMessage else "Packing guardado", if (it.isError) it.errorMessage else "Packing guardado",
it.isError,!it.isError it.isError,!it.isError
) )
@ -386,9 +378,9 @@ class CollectionFragment(
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage, true,true) ma.messageWithSound(it.errorMessage, true,true)
} else { } else {
(activity as MainActivity).messageWithSound("Previa recogida", false,true) ma.messageWithSound("Previa recogida", false,true)
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
getData(USER), getData(USER),
@ -479,7 +471,7 @@ class CollectionFragment(
responseMissingTrash.observe(viewLifecycleOwner, Observer { responseMissingTrash.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true) ma.messageWithSound(it.errorMessage, isError = true,true)
} else { } else {
@ -494,7 +486,7 @@ class CollectionFragment(
responseIncQuantity.observe(viewLifecycleOwner, Observer { responseIncQuantity.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true) ma.messageWithSound(it.errorMessage, isError = true,true)
} else { } else {
incresaseSuccesful() incresaseSuccesful()
@ -505,7 +497,7 @@ class CollectionFragment(
responseSaleMove.observe(viewLifecycleOwner, Observer { responseSaleMove.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true) ma.messageWithSound(it.errorMessage, isError = true,true)
} else { } else {
responseSaleMoveSuccesful() responseSaleMoveSuccesful()
@ -517,7 +509,7 @@ class CollectionFragment(
binding.splashProgress.visibility=GONE binding.splashProgress.visibility=GONE
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage+"Usuario:"+workerFkFromTicket, isError = true,true) ma.messageWithSound(it.errorMessage+"Usuario:"+workerFkFromTicket, isError = true,true)
} else { } else {
@ -537,13 +529,15 @@ class CollectionFragment(
responsecheckfully.observe(viewLifecycleOwner, Observer { responsecheckfully.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,it.isError,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
//sergio: devuelve false si no hay para revisar y <> false. //sergio: devuelve false si no hay para revisar y <> false.
if (it.response != "false") { if (it.response != "false") {
customDialog.setTitle("Aviso") customDialog.setTitle("Aviso")
.setDescription("Pendiente de revisar : " + it.response) .setDescription("Pendiente de revisar : " + it.response)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
@ -570,11 +564,14 @@ class CollectionFragment(
}) })
responseSalixMessage.observe(viewLifecycleOwner, Observer { responseSalixMessage.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,it.isError,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} }
}) })
@ -734,8 +731,7 @@ class CollectionFragment(
markLine(index, type) markLine(index, type)
//////Log.i("VERDNATURA:","marcamos linea") //////Log.i("VERDNATURA:","marcamos linea")
} else if (type == SACADOR) { } else if (type == SACADOR) {
Log.d("VERDNATURA", "El tipo es sacador")
Log.d("VERDNATURA", "La sale es" + sale.isPrepared)
if (sale.isPrepared == "0" || sale.isPrepared.isNullOrEmpty()) { if (sale.isPrepared == "0" || sale.isPrepared.isNullOrEmpty()) {
showScanner(index, sale) showScanner(index, sale)
} else { } else {
@ -1624,7 +1620,7 @@ class CollectionFragment(
} }
private fun setTotalLines() { private fun setTotalLines() {
// Log.d("VERDNTURA::","el itempacking ggg es "+collection.tickets.get(0).itemPackingTypeFk)
var totalMark = 0 var totalMark = 0
sales.forEach { sales.forEach {
if (type == SACADOR) { if (type == SACADOR) {
@ -1644,10 +1640,9 @@ class CollectionFragment(
if (collection.collectionFk != null) collection.collectionFk else "" if (collection.collectionFk != null) collection.collectionFk else ""
if (binding.mainToolbar.toolbarSubtitle != null && totalMark != null && sales != null) binding.mainToolbar.toolbarSubtitle.text = if (binding.mainToolbar.toolbarSubtitle != null && totalMark != null && sales != null) binding.mainToolbar.toolbarSubtitle.text =
"" + totalMark + "/" + sales.size "" + totalMark + "/" + sales.size
if (totalMark == sales.size) { if (totalMark == sales.size) {
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT) getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
ticketCollection_setUsedShelves() ticketCollection_setUsedShelves()
//showBottomNavigation(View.VISIBLE) //showBottomNavigation(View.VISIBLE)
@ -2243,7 +2238,7 @@ class CollectionFragment(
} }
customDialogList.setTitle("Causa de error").setKoButton("Cerrar") { customDialogList.setTitle("Causa de error").setKoButton("Cancelar") {
scanRequest() scanRequest()
hideKeyboards() hideKeyboards()
customDialogList.dismiss() customDialogList.dismiss()

View File

@ -67,7 +67,7 @@ class CollectionShowTicketFragment(
override fun init() { override fun init() {
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
(activity as MainActivity).hideBottomNavigation(GONE) ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
setEvents() setEvents()
setToolBarIcon() setToolBarIcon()
@ -186,7 +186,7 @@ class CollectionShowTicketFragment(
binding.mainToolbar.toolbarSubtitle.text = "0/0" binding.mainToolbar.toolbarSubtitle.text = "0/0"
} }
} else { } else {
(activity as MainActivity).messageWithSound(it.errorMessage,it.isError,false) ma.messageWithSound(it.errorMessage,it.isError,false)
if (activity != null) requireActivity().onBackPressed() if (activity != null) requireActivity().onBackPressed()
} }

View File

@ -36,7 +36,7 @@ class ControladorFragment :
// customDialog = CustomDialog(requireContext()) // customDialog = CustomDialog(requireContext())
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket) binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
setEvents() setEvents()
(activity as MainActivity).hideBottomNavigation(View.VISIBLE) ma.hideBottomNavigation(View.VISIBLE)
super.init() super.init()
} }
@ -73,7 +73,7 @@ class ControladorFragment :
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -85,7 +85,7 @@ class ControladorFragment :
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage,isError = true, isPlayed = false) ma.messageWithSound(it.errorMessage,isError = true, isPlayed = false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage) /*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
customDialog.dismiss() customDialog.dismiss()

View File

@ -7,7 +7,6 @@ import android.util.TypedValue
import android.view.View.* import android.view.View.*
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.ImageView import android.widget.ImageView
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentVehiclecontrolBinding import es.verdnatura.databinding.FragmentVehiclecontrolBinding
@ -18,9 +17,9 @@ import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
@ -58,7 +57,7 @@ class ControlVehiculoFragment(
/* if (getWagons() < 2 && !tagName.equals(SacadorFragment.TAG)) /* if (getWagons() < 2 && !tagName.equals(SacadorFragment.TAG))
{ {
(activity as MainActivity).openFragmentPickers() ma.openFragmentPickers()
}*/ }*/
@ -66,20 +65,24 @@ class ControlVehiculoFragment(
setToolBar("HISTORY") setToolBar("HISTORY")
showScanner("Escanea matrícula para ver histórico", "HISTORY") showScanner("Escanea matrícula para ver histórico", "HISTORY")
} else { } else {
checkControlTimeVehicle() checkControlTimeVehicle()
setToolBar("ALL") setToolBar("ALL")
} }
setEvents()
setEvents()
super.init() super.init()
} }
override fun onPause() { override fun onPause() {
goBack = true goBack = true
super.onPause() super.onPause()
} }
private fun setToolBar(direction: String) { private fun setToolBar(direction: String?) {
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontrol) binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontrol)
binding.mainToolbar.toolbarTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13F) binding.mainToolbar.toolbarTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13F)
@ -112,28 +115,7 @@ class ControlVehiculoFragment(
listIcons.add(iconVehicleIn) listIcons.add(iconVehicleIn)
listIcons.add(iconHistory) listIcons.add(iconHistory)
} }
"OUT"->{
listIcons.remove(iconVehicleOut)
listIcons.remove(iconVehicleIn)
listIcons.add(iconHistory)
} }
}
/* if (direction.equals("OUT")) {
listIcons.remove(iconVehicleIn)
listIcons.add(iconVehicleOut)
listIcons.add(iconHistory)
}
if (direction.equals("IN")) {
listIcons.remove(iconVehicleOut)
listIcons.add(iconVehicleIn)
listIcons.add(iconHistory)
}
if (direction.equals("HISTORY")) {
listIcons.remove(iconVehicleOut)
listIcons.remove(iconVehicleIn)
listIcons.add(iconHistory)
}*/
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
@ -154,7 +136,7 @@ class ControlVehiculoFragment(
customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription(description) customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription(description)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
if (!customDialogInput.getValue().isNullOrEmpty()) { if (customDialogInput.getValue().isNotEmpty()) {
// "$description ${customDialogInput.getValue()} OK".toast(requireContext()) // "$description ${customDialogInput.getValue()} OK".toast(requireContext())
insertControlTimeVehicle(customDialogInput.getValue(), action) insertControlTimeVehicle(customDialogInput.getValue(), action)
} }
@ -166,6 +148,10 @@ class ControlVehiculoFragment(
.setKoButton("Cancelar") { .setKoButton("Cancelar") {
customDialogInput.dismiss() customDialogInput.dismiss()
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
ma.onBackPressed()
}
}.setValue("").show() }.setValue("").show()
customDialogInput.getEditText().requestFocus() customDialogInput.getEditText().requestFocus()
@ -173,7 +159,7 @@ class ControlVehiculoFragment(
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (!customDialogInput.getValue().isNullOrEmpty()) { if (customDialogInput.getValue().isNotEmpty()) {
insertControlTimeVehicle(customDialogInput.getValue(), action) insertControlTimeVehicle(customDialogInput.getValue(), action)
} }
@ -191,15 +177,20 @@ class ControlVehiculoFragment(
private fun checkControlTimeVehicle() { private fun checkControlTimeVehicle() {
if (!goBack) { if (!goBack) {
// d("la fecha es "+getData("DATENOVEHICLE"))
//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),"workerMachinery_isRegistered")
/*}else{
ma.openFragmentPickers()
}*/
} }
} }
private fun insertControlTimeVehicle(plateNumber: String, direction: String) { private fun insertControlTimeVehicle(plateNumber: String, direction: String) {
if (direction.equals("HISTORY")) { if (direction.equals("HISTORY")) {
(activity as MainActivity).onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = "Historico Vehículo"), PasillerosItemVO(title = "Historico Vehículo"),
plateNumber plateNumber
) )
@ -211,15 +202,15 @@ class ControlVehiculoFragment(
viewModel.machineWorker_update(getData(USER),getData(PASSWORD), plateNumber,"machineWorker_update") viewModel.machineWorker_update(getData(USER),getData(PASSWORD), plateNumber,"machineWorker_update")
} else if (direction.equals("")) { } else if (direction.equals("")) {
(activity as MainActivity).openFragmentPickers() ma.openFragmentPickers(true)
} }
} }
private fun scanRequest() { private fun scanRequest() {
if (binding.scanInput != null) { // if (binding.scanInput != null) {
binding.scanInput.requestFocus() binding.scanInput.requestFocus()
} //}
hideKeyboards() hideKeyboards()
} }
@ -234,7 +225,9 @@ class ControlVehiculoFragment(
private fun setEvents() { private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() ma.openFragmentPickers(true)
//requireActivity().onBackPressed()
} }
binding.scanInput.requestFocus() binding.scanInput.requestFocus()
@ -249,7 +242,7 @@ class ControlVehiculoFragment(
} }
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -264,7 +257,7 @@ class ControlVehiculoFragment(
.setValue(plate) .setValue(plate)
if (isWorkedTimed.equals("UNREGISTERED")) { if (isWorkedTimed.equals("UNREGISTERED")) {
customDialogThreeButtons.setOkButtonTwo("COGER") { customDialogThreeButtons.setOkButtonTwo("COGER") {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) "Vuelva a escanear".toast(requireContext())
} else { } else {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
@ -275,7 +268,7 @@ class ControlVehiculoFragment(
} else { } else {
customDialogThreeButtons.setOkButtonThree("DEJAR") { customDialogThreeButtons.setOkButtonThree("DEJAR") {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) "Vuelva a escanear".toast(requireContext())
} else { } else {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
@ -284,7 +277,7 @@ class ControlVehiculoFragment(
} }
} }
}.setOkButtonFour("HISTÓRICO") { }.setOkButtonFour("HISTÓRICO") {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) "Vuelva a escanear".toast(requireContext())
} else { } else {
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
@ -306,7 +299,7 @@ class ControlVehiculoFragment(
.setValue(plate) .setValue(plate)
.setOkButtonFour("HISTÓRICO") { .setOkButtonFour("HISTÓRICO") {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) "Vuelva a escanear".toast(requireContext())
} else { } else {
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
@ -324,16 +317,16 @@ class ControlVehiculoFragment(
with(viewModel) { with(viewModel) {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
responseinsert.observe(viewLifecycleOwner, Observer { responseinsert.observe(viewLifecycleOwner, {
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage,true,false)
customDialog.setTitle("Error").setDescription(it.errorMessage) /*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
if (it.response == null || it.response == "false") { if (it.response == "false") {
customDialog.setTitle("Error") customDialog.setTitle("Error")
.setDescription("Revisar llamada del registro de vehículos") .setDescription("Revisar llamada del registro de vehículos")
@ -350,8 +343,8 @@ class ControlVehiculoFragment(
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/
(activity as MainActivity).openFragmentPickers() ma.openFragmentPickers(true)
//(activity as MainActivity).onPasillerosItemClickListener( PasillerosItemVO(title = "Sacadores"),"CONTROL") //ma.onPasillerosItemClickListener( PasillerosItemVO(title = "Sacadores"),"CONTROL")
//checkControlTimeVehicle() //checkControlTimeVehicle()
} }
@ -360,21 +353,15 @@ class ControlVehiculoFragment(
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
}) })
responsecontrol.observe(viewLifecycleOwner, Observer { responsecontrol.observe(viewLifecycleOwner, {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
// Log.i("VERDNATURA:","${it.response}") // Log.i("VERDNATURA:","${it.response}")
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,true,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else {
if (it.response == null) {
customDialog.setTitle("Error")
.setDescription("Revisar llamada de control de vehículos")
.setOkButton("Cerrar") {
customDialog.dismiss()
}.show()
} else { } else {
if (it.response.equals("1")) { if (it.response.equals("1")) {
isWorkedTimed = "REGISTERED" isWorkedTimed = "REGISTERED"
@ -385,7 +372,7 @@ class ControlVehiculoFragment(
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/
if (!tagName.equals(SacadorFragment.TAG)) { if (!tagName.equals(SacadorFragment.TAG)) {
(activity as MainActivity).openFragmentPickers() ma.openFragmentPickers(true)
} }
} else { } else {
@ -400,21 +387,26 @@ class ControlVehiculoFragment(
} }
.setKoButton("SIN VEHÍCULO") { .setKoButton("SIN VEHÍCULO") {
customDialog.dismiss() customDialog.dismiss()
saveData(DATENOVEHICLE, SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()).toString())
ma.openFragmentPickers(true)
(activity as MainActivity).openFragmentPickers()
// getActivity()?.getFragmentManager()?.popBackStack();
}.show() }.show()
} }
} }
}
} }
}) })
} }
} }
private fun IsNoVehicleDataToday(): Boolean {
return (getData(DATENOVEHICLE)==SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()))
}
} }

View File

@ -87,7 +87,7 @@ class ControlVehiculoUsuarioFragment(
responsemachine.observe(viewLifecycleOwner, Observer { responsemachine.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage) /*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()

View File

@ -83,7 +83,7 @@ class DayOfSaleFragment(
itemScan = binding.scanInput.text.toString() itemScan = binding.scanInput.text.toString()
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -126,7 +126,7 @@ class DayOfSaleFragment(
}else{ }else{
if (it.list.get(0).isError){ if (it.list.get(0).isError){
(activity as MainActivity).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("Error")
.setDescription(it.list.get(0).errorMessage) .setDescription(it.list.get(0).errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
@ -141,7 +141,7 @@ class DayOfSaleFragment(
if (it.isError){ if (it.isError){
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /*customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/
@ -166,7 +166,7 @@ class DayOfSaleFragment(
customDialogList.setTitle("Escanea el parking") customDialogList.setTitle("Escanea el parking")
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.dismiss() customDialogList.dismiss()
@ -174,7 +174,7 @@ class DayOfSaleFragment(
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ -> customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
@ -182,7 +182,7 @@ class DayOfSaleFragment(
parking(customDialogList.getValue()) parking(customDialogList.getValue())
} }
customDialogList.setValue("") customDialogList.setValue("")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -50,7 +50,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
override fun init() { override fun init() {
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getString(R.string.faultsReview) binding.mainToolbar.toolbarTitle.text = getString(R.string.faultsReview)
setToolBar() setToolBar()
@ -154,7 +154,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
} }
customDialogInput.setValue("") customDialogInput.setValue("")
customDialogInput.dismiss() customDialogInput.dismiss()
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -176,7 +176,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,it.isError,false) ma.messageWithSound(it.errorMessage,it.isError,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/

View File

@ -48,7 +48,7 @@ class HistoricoArticuloFragment(
// customDialogInput = CustomDialogInput(requireContext()) // customDialogInput = CustomDialogInput(requireContext())
// customDialog = CustomDialog(requireContext()) // customDialog = CustomDialog(requireContext())
(activity as MainActivity).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),"itemDiary")
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk

View File

@ -56,7 +56,7 @@ class itemShelvingLogFragment(
itemScan = binding.scanInput.text.toString() itemScan = binding.scanInput.text.toString()
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -57,7 +57,7 @@ class shelvingLogFragment(
itemScan = binding.scanInput.text.toString() itemScan = binding.scanInput.text.toString()
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -12,6 +12,7 @@ import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.feature.historicovehiculo.adapter.HistoricoVehiculoAdapter import es.verdnatura.presentation.view.feature.historicovehiculo.adapter.HistoricoVehiculoAdapter
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import timber.log.Timber.d
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
@ -22,9 +23,6 @@ class HistoricoVehiculoFragment (
HistoricoVehiculoViewModel::class) { HistoricoVehiculoViewModel::class) {
private var adapter : HistoricoVehiculoAdapter? = null private var adapter : HistoricoVehiculoAdapter? = null
// private lateinit var customDialogInput: CustomDialogInput
// private lateinit var customDialog: CustomDialog
companion object { companion object {
fun newInstance(entryPoint:String) = HistoricoVehiculoFragment(entryPoint) fun newInstance(entryPoint:String) = HistoricoVehiculoFragment(entryPoint)
@ -36,9 +34,7 @@ class HistoricoVehiculoFragment (
override fun init() override fun init()
{ {
// customDialogInput = CustomDialogInput(requireContext()) ma.hideBottomNavigation(View.GONE)
// customDialog = CustomDialog(requireContext())
(activity as MainActivity).hideBottomNavigation(View.GONE)
viewModel.machineWorker_getHistorical(getData(USER),getData(PASSWORD),numberPlate,"machineWorker_getHistorical") viewModel.machineWorker_getHistorical(getData(USER),getData(PASSWORD),numberPlate,"machineWorker_getHistorical")
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclediary) binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclediary)
@ -63,6 +59,10 @@ class HistoricoVehiculoFragment (
binding.historicovehiculoRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) binding.historicovehiculoRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
navigateToToday(it) navigateToToday(it)
if (it.list.isEmpty()){
ma.messageWithSound("Solo puedes visualizar cuando has cogido tu mismo el vehículo a no ser que tengas permisos para ello.",true,true,"Información")
}
} }
}) })
} }

View File

@ -90,7 +90,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemShelvingRadar) binding.mainToolbar.toolbarTitle.text = getString(R.string.itemShelvingRadar)
setToolBar() setToolBar()
@ -241,7 +241,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/

View File

@ -59,6 +59,9 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
val mistakeWorkerList: LiveData<workerMistakeTypeList> val mistakeWorkerList: LiveData<workerMistakeTypeList>
get() = _mistakeWorkerList get() = _mistakeWorkerList
private val _responseAddMistake by lazy { MutableLiveData<ResponseItemVO>() }
val responseAddMistake: LiveData<ResponseItemVO>
get() = _responseAddMistake
//sergio para obtener comprador //sergio para obtener comprador
fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){ fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){
@ -281,5 +284,45 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
}) })
} }
fun workerMistake_Add(
usuario: String,
password: String,
vUserFk: String,
vTypeFk: String,callFunction:String
)
{
getWorkerMistakeUserCase.workerMistake_Add(usuario, password, vUserFk, vTypeFk)
.enqueue(object :
Callback<Unit>
{
override fun onFailure(call: Call<Unit>, t: Throwable)
{
_responseAddMistake.value = ResponseItemVO(
isError = true,
errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)
)
}
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
)
{
if (!response.isSuccessful)
{
_responseAddMistake.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
)
} else
{
_responseAddMistake.value =
// sergio:refactor:solo debería haber un mensaje no un response o errorMessage
ResponseItemVO(isError = false, response ="Causa del error registrada", errorMessage = "Causa del error registrada")
}
}
})
}
} }

View File

@ -9,6 +9,7 @@ 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
@ -83,8 +84,8 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
} }
//NODEJS TEST //NODEJS TEST
// Log.i("VERDNATURA:","NODEJS in") /* Log.d("VERDNATURA:","NODEJS in")
// viewModel.nodeJsTest("A0A3B8224DBF","ABC","1") viewModel.nodeJsTest("A0A3B8224DBF","AAA","1")*/
} }
@ -122,10 +123,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = View.INVISIBLE binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
if (it.version.equals(getInfoVersionNameApp())) { if (it.version.equals(getInfoVersionNameApp())) {
@ -163,10 +165,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = View.INVISIBLE binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
if (it.vIsAuthorized.equals("0")) { if (it.vIsAuthorized.equals("0")) {
@ -249,10 +252,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
loginitem.observe(viewLifecycleOwner, Observer { loginitem.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
saveUserFkPref(it) saveUserFkPref(it)

View File

@ -374,6 +374,7 @@ class LoginViewModel(context: Context) : BaseViewModel()
) )
{ {
var workerId: NodeJsService.SmartTagNode? var workerId: NodeJsService.SmartTagNode?
/* if (response.isSuccessful()){ /* if (response.isSuccessful()){
@ -410,7 +411,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
} }

View File

@ -351,9 +351,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
"Paletizar" -> { "Paletizar" -> {
addFragmentOnTop(ExpeditionTruckListFragment.newInstance()) addFragmentOnTop(ExpeditionTruckListFragment.newInstance())
} }
"Consultar expedición" -> { getString(R.string.ExpeditionState) -> {
// addFragment(ExpeditionStateFragment.newInstance(entryPoint),R.id.main_frame_layout, ExpeditionTruckListFragment.TAG,false) // addFragment(ExpeditionStateFragment.newInstance(entryPoint),R.id.main_frame_layout, ExpeditionTruckListFragment.TAG,false)
addFragmentOnTop(ExpeditionStateFragment.newInstance(entryPoint)) addFragmentOnTop(ExpeditionStateFragment.newInstance(item.title))
} }
"Escanear expedición" -> { "Escanear expedición" -> {
addFragmentOnTop(ExpeditionScanSorterFragment.newInstance(item.title)) addFragmentOnTop(ExpeditionScanSorterFragment.newInstance(item.title))
@ -471,8 +471,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
"Log Shelving" -> { "Log Shelving" -> {
addFragmentOnTop(shelvingLogFragment.newInstance("Log Shelving")) addFragmentOnTop(shelvingLogFragment.newInstance("Log Shelving"))
} }
"Fallo personal" -> { "Fallo del trabajador" -> {
addFragmentOnTop(WorkermistakeFragment.newInstance("Fallo personal")) addFragmentOnTop(WorkermistakeFragment.newInstance(item.title))
} }
} }
@ -551,26 +551,33 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
addFragmentOnTop(QaualityFragment.newInstance(userFk)) addFragmentOnTop(QaualityFragment.newInstance(userFk))
} }
//sergio:se llama al pulsar sobre el coche IN desde Sacador
fun onVehicleSelected(tag: String) { fun onVehicleSelected(tag: String) {
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
// se pone a true en la pila para que cuando se vuelva atrás permanezca ya que se borran todos los fragmentos desde otras opciones
addFragment( addFragment(
ControlVehiculoFragment.newInstance(tag), ControlVehiculoFragment.newInstance(tag),
R.id.main_frame_layout, R.id.main_frame_layout,
ControlVehiculoFragment.TAG, ControlVehiculoFragment.TAG,
false true
) )
//sergio: de esta manera la llamada del fragment no se vuelve a repetir. //sergio: de esta manera la llamada del fragment no se vuelve a repetir.
// addFragmentOnTop(ControlVehiculoFragment.newInstance(tag)) // addFragmentOnTop(ControlVehiculoFragment.newInstance(tag))
} }
fun openFragmentPickers() { fun openFragmentPickers(delete:Boolean) {
//delete_Fragments() //delete_Fragments()
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
if (delete){delete_Fragments()}
addFragment( addFragment(
SacadorFragment.newInstance(), SacadorFragment.newInstance(),
R.id.main_frame_layout, R.id.main_frame_layout,
SacadorFragment.TAG, SacadorFragment.TAG,
false false
) )
//addFragmentOnTop(SacadorFragment.newInstance()) //addFragmentOnTop(SacadorFragment.newInstance())
@ -589,16 +596,17 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
binding.mainBottomNavigation.visibility = visible binding.mainBottomNavigation.visibility = visible
} }
fun messageWithSound(message: String, isError: Boolean,isPlayed:Boolean?,title:String="Error") { fun messageWithSound(message: String, isError: Boolean,isPlayed:Boolean?,titleWithError:String="Error") {
if (!isError) { if (!isError) {
if (isPlayed == true)(mpok?.start()) if (isPlayed == true)(mpok?.start())
message.toast(this, Toast.LENGTH_SHORT) message.toast(this, Toast.LENGTH_SHORT)
} else { } else {
if (isPlayed == true)( mperror?.start()) if (isPlayed == true)( mperror?.start())
customDialog.setTitle(title).setDescription(message) customDialog.setTitle(titleWithError).setDescription(message)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()

View File

@ -5,19 +5,15 @@ import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.databinding.ItemExpeditionstateRowBinding import es.verdnatura.databinding.ItemExpeditionstateRowBinding
import es.verdnatura.presentation.common.OnItemExpeditionStateRowClickListener
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardRowVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionStateRow import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionStateRow
class ExpeditionStateAdapter ( class ExpeditionStateAdapter (
private val items: List<ItemExpeditionStateRow>, private val items: List<ItemExpeditionStateRow>,
private val OnItemExpeditionStateRowClickListener: OnItemExpeditionStateRowClickListener
): RecyclerView.Adapter<ExpeditionStateAdapter.ItemHolder> () { ): RecyclerView.Adapter<ExpeditionStateAdapter.ItemHolder> () {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder( return ItemHolder(
//ItemCardRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
ItemExpeditionstateRowBinding.inflate(LayoutInflater.from(parent.context),parent,false) ItemExpeditionstateRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
) )
} }
@ -26,34 +22,20 @@ class ExpeditionStateAdapter (
override fun onBindViewHolder(holder: ItemHolder, position: Int) { override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position]) holder.bind(items[position])
if (items[position].isEditable){ /* if (items[position].isEditable){
holder.binding.root.setOnClickListener { holder.binding.root.setOnClickListener {
OnItemExpeditionStateRowClickListener.OnItemExpeditionStateRowClickListener(items[position]) // OnItemExpeditionStateRowClickListener.OnItemExpeditionStateRowClickListener(items[position])
}
} }
}*/
} }
class ItemHolder( class ItemHolder(
val binding: ItemExpeditionstateRowBinding val binding: ItemExpeditionstateRowBinding
) : RecyclerView.ViewHolder(binding.root){ ) : RecyclerView.ViewHolder(binding.root){
private val res = binding.root.context.resources
fun bind(item: ItemExpeditionStateRow) { fun bind(item: ItemExpeditionStateRow) {
binding.apply { binding.apply {
if (item.barcodes.isNotEmpty()){
item.value = ""
item.barcodes.forEach {
item.value = item.value + it.code + "\n"
}
}
this.item = item this.item = item
/* if (item.isEditable){
itemImage.visibility = View.VISIBLE
itemRowLayout.setBackgroundColor(res.getColor(R.color.verdnatura_black_5))
}else{
itemImage.visibility = View.INVISIBLE
itemRowLayout.setBackgroundColor(res.getColor(R.color.verdnatura_black_9))
}*/
} }
} }

View File

@ -56,7 +56,7 @@ class ExpeditionPalletDetailFragment(
binding.expeditionPalletDetailPallet.text = "Pallet "+itemPallet!!.Pallet binding.expeditionPalletDetailPallet.text = "Pallet "+itemPallet!!.Pallet
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
//requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar() setToolBar()
@ -131,7 +131,7 @@ class ExpeditionPalletDetailFragment(
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/

View File

@ -73,7 +73,7 @@ class ExpeditionPalletFragment(
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
//requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar() setToolBar()
setEvents() setEvents()
@ -130,7 +130,7 @@ class ExpeditionPalletFragment(
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/
@ -140,7 +140,7 @@ class ExpeditionPalletFragment(
responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer { responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/
@ -192,7 +192,7 @@ class ExpeditionPalletFragment(
} }
customDialogList.setTitle("Expedition ("+binding.mainToolbar.toolbarTitle.text+")").setOkButton("Comprobar"){ customDialogList.setTitle("Expedition ("+binding.mainToolbar.toolbarTitle.text+")").setOkButton("Comprobar"){
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
if (listExpeditions.size > 0){ if (listExpeditions.size > 0){
@ -208,7 +208,7 @@ class ExpeditionPalletFragment(
}.setKoButton("Cerrar"){ }.setKoButton("Cerrar"){
(activity as MainActivity).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,"expeditionPallet_List")
@ -217,7 +217,7 @@ class ExpeditionPalletFragment(
}.setValue("").show() }.setValue("").show()
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
@ -243,7 +243,7 @@ class ExpeditionPalletFragment(
expeditionAdapter!!.notifyDataSetChanged() expeditionAdapter!!.notifyDataSetChanged()
} }
customDialogList.setValue("") customDialogList.setValue("")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -42,7 +42,6 @@ class ExpeditionScanFragment (
private var expeditionAdapter : BarcodeAdapter? = null private var expeditionAdapter : BarcodeAdapter? = null
private lateinit var customDialog: CustomDialog private lateinit var customDialog: CustomDialog
var mperror: MediaPlayer? = null var mperror: MediaPlayer? = null
var mpok: MediaPlayer? = null
companion object { companion object {
fun newInstance(item: ItemExpeditionTruckVO,itemPalletVO: ItemPalletVO) = fun newInstance(item: ItemExpeditionTruckVO,itemPalletVO: ItemPalletVO) =
@ -69,7 +68,7 @@ class ExpeditionScanFragment (
customDialogTwoButtons = CustomDialogTwoButtons(requireContext()) customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
binding.expeditionScanDetailPallet.text = "Pallet "+itemPalletVO!!.Pallet binding.expeditionScanDetailPallet.text = "Pallet "+itemPalletVO!!.Pallet
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar() setToolBar()
@ -99,7 +98,6 @@ class ExpeditionScanFragment (
viewModel.expeditionScanList(getData(USER), viewModel.expeditionScanList(getData(USER),
getData(PASSWORD),itemPalletVO!!.Pallet) getData(PASSWORD),itemPalletVO!!.Pallet)
}else if(item == iconPlus){ }else if(item == iconPlus){
//Log.i("VERDNATURA:","ENTRAMOS A SCAN ADD")
expeditionScanAdd () expeditionScanAdd ()
} }
@ -128,43 +126,29 @@ class ExpeditionScanFragment (
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss()
}.show()*/
} }
}) })
responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer { responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss()
}.show()*/
}else{ }else{
////Log.i("VERDNATURA:"," Resultado llamada es ${it.response.toString()}")
if (it.response=="0") {
//"Rutas iguales ${it.response}".toast(requireActivity())
////Log.i("VERDNATURA:","Rutas iguales")
}
if (it.response=="1"){ if (it.response=="1"){
mperror?.start() mperror?.start()
// "Resultado llamada $it.response".toast(requireActivity())
// customDialog.setTitle("Rutas distintas").setDescription(it.response).setOkButton("Cerrar"){
// customDialog.dismiss()
// }.show()
}} }}
}) })
responseDeleteScan.observe(viewLifecycleOwner, Observer { responseDeleteScan.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss()
}.show()*/
}else{ }else{
viewModel.expeditionScanList(getData(USER), viewModel.expeditionScanList(getData(USER),
getData(PASSWORD),itemPalletVO!!.Pallet) getData(PASSWORD),itemPalletVO!!.Pallet)
@ -202,28 +186,23 @@ class ExpeditionScanFragment (
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanAdd(usuario = getData(USER), viewModel.expeditionScanAdd(usuario = getData(USER),
getData(PASSWORD),vPalletFk = itemPalletVO!!.Pallet,vTruckFk = itemExpeditionTruckVO!!.truckFk) getData(PASSWORD),vPalletFk = itemPalletVO!!.Pallet,vTruckFk = itemExpeditionTruckVO!!.truckFk)
//Log.i("VERDNATURA:","entramos a escanear ticket del pallet")
} }
private fun showScanExpeditions(it: ItemScanList){ private fun showScanExpeditions(it: ItemScanList){
//sergio para smarttags:
// Log.i("VERDNATURA:","muestra expediciones y a escanear")
listExpeditions = ArrayList() listExpeditions = ArrayList()
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
it.list.forEach { it.list.forEach {
if(it.expeditionFk != "0") if(it.expeditionFk != "0")
listExpeditions.add(BarcodeVO(code = it.expeditionFk)) listExpeditions.add(BarcodeVO(code = it.expeditionFk))
} }
//sergio:Comprueba si el numero es mayor>0
customDialogList.setTitle("Pallet"+itemPalletVO!!.Pallet+" ("+binding.mainToolbar.toolbarTitle.text+")").setOkButton("Comprobar"){ customDialogList.setTitle("Pallet"+itemPalletVO!!.Pallet+" ("+binding.mainToolbar.toolbarTitle.text+")").setOkButton("Comprobar"){
//Log.i("VERDNATURA:","Añadida etiqueta")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
ma.hideKeyboard(customDialogList.getEditText())
if (listExpeditions.size > 0){ if (listExpeditions.size > 0){
////Log.i("VERDNATURA:","boton comprobar . si las expediciones >0 muetra DetailFragment")
onComprobarPalletViewClickListener!!.onComprobarPalletViewClickListener(itemExpeditionTruckVO!!, onComprobarPalletViewClickListener!!.onComprobarPalletViewClickListener(itemExpeditionTruckVO!!,
ItemPalletVO(Pallet = it.list.get(0).palletFk) ItemPalletVO(Pallet = it.list.get(0).palletFk)
) )
@ -237,24 +216,18 @@ class ExpeditionScanFragment (
}.setKoButton("Cerrar"){ }.setKoButton("Cerrar"){
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
listExpeditions = ArrayList() listExpeditions = ArrayList()
customDialogList.dismiss() customDialogList.dismiss()
}.setValue("").show() }.setValue("").show()
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
//sergio: seguimos escaneando id=0 -> sin especificar id=5->next
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!customDialogList.getValue().isNullOrEmpty()) { if (!customDialogList.getValue().isNullOrEmpty()) {
////Log.i("VERDNATURA:", "scan put pallet ${it.list.get(0).palletFk}");
////Log.i("VERDNATURA:", "scan put list ${customDialogList.getValue()}");
listExpeditions.add(BarcodeVO(code = customDialogList.getValue())) listExpeditions.add(BarcodeVO(code = customDialogList.getValue()))
viewModel.expeditionScanPut( viewModel.expeditionScanPut(
getData(USER), getData(USER),
@ -262,22 +235,15 @@ class ExpeditionScanFragment (
it.list.get(0).palletFk, it.list.get(0).palletFk,
customDialogList.getValue() customDialogList.getValue()
) )
////Log.i("VERDNATURA:", "scan put pallet ${it.list.get(0).palletFk}");
////Log.i("VERDNATURA:", "scan put list ${customDialogList.getValue()}");
// ////Log.i("VERDNATURA:","misma ruta ?")
//sergio:comprueba si es de la misma ruta. Check_route_expedition.
checkRouteExpeditionScanPut(getData(USER), checkRouteExpeditionScanPut(getData(USER),
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue()) getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue())
////Log.i("VERDNATURA:", "scan put pallet ${it.list.get(0).palletFk}");
////Log.i("VERDNATURA:", "scan put list ${customDialogList.getValue()}");
expeditionAdapter!!.notifyDataSetChanged() expeditionAdapter!!.notifyDataSetChanged()
} }
customDialogList.setValue("") customDialogList.setValue("")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -1,50 +1,35 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.content.SharedPreferences
import android.os.Bundle
import android.view.View
import android.view.View.* import android.view.View.*
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentExpeditionscanSorterBinding import es.verdnatura.databinding.FragmentExpeditionscanSorterBinding
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogList import es.verdnatura.presentation.view.component.CustomDialogList
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.smarttag.adapter.SmartTagAdapter
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
class ExpeditionScanSorterFragment( class ExpeditionScanSorterFragment(
var entryPoint: String = "" var title: String = ""
) : BaseFragment<FragmentExpeditionscanSorterBinding, ExpeditionScanSorterViewModel>( ) : BaseFragment<FragmentExpeditionscanSorterBinding, ExpeditionScanSorterViewModel>(
ExpeditionScanSorterViewModel::class ExpeditionScanSorterViewModel::class
) { ) {
private var user = ""
private var password = ""
private var goBack: Boolean = false
override fun getLayoutId(): Int = R.layout.fragment_expeditionscan_sorter override fun getLayoutId(): Int = R.layout.fragment_expeditionscan_sorter
// private lateinit var customDialog: CustomDialog
private lateinit var customDialogList: CustomDialogList private lateinit var customDialogList: CustomDialogList
private var listExpeditionScan: ArrayList<SmartTag> = ArrayList() private var listExpeditionScan: ArrayList<GeneralItem> = ArrayList()
private var expeditionScanAdapter: SmartTagAdapter? = null private var expeditionScanAdapter: GeneralAdapter? = null
private var itemScaned: String = "" private var itemScaned: String = ""
companion object { companion object {
fun newInstance(entryPoint: String) = ExpeditionScanSorterFragment(entryPoint) fun newInstance(title: String) = ExpeditionScanSorterFragment(title)
} }
override fun init() { override fun init() {
//customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
ma.hideBottomNavigation(GONE)
goBack = false
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
setEvents() setEvents()
@ -53,33 +38,18 @@ class ExpeditionScanSorterFragment(
super.init() super.init()
} }
override fun onPause() {
goBack = true
super.onPause()
}
private fun setToolBar() { private fun setToolBar() {
binding.mainToolbar.toolbarTitle.text = title
binding.mainToolbar.toolbarTitle.text = entryPoint
} }
private fun expeditionscan(ExpeditionScan: String) { private fun expeditionscan(ExpeditionScan: String) {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.expedition_scan(user, password, ExpeditionScan,"expedition_scan") viewModel.expedition_scan(getData(USER),getData(PASSWORD), ExpeditionScan,"expedition_scan")
itemScaned = ExpeditionScan itemScaned = ExpeditionScan
} }
override fun onCreate(savedInstanceState: Bundle?) {
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
user = getData(USER)
password = getData(PASSWORD)
super.onCreate(savedInstanceState)
}
private fun setEvents() { private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
@ -89,29 +59,25 @@ class ExpeditionScanSorterFragment(
} }
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
responsescan.observe(viewLifecycleOwner, Observer { responsescan.observe(viewLifecycleOwner, {
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") {
customDialog.dismiss()
}.show()*/
} else { } else {
listExpeditionScan.add(SmartTag(itemScaned, itemScaned)) listExpeditionScan.add(GeneralItem(itemScaned, itemScaned))
customDialogList.setDescription("Total:" + listExpeditionScan.size) customDialogList.setDescription("Total:" + listExpeditionScan.size)
expeditionScanAdapter!!.notifyItemInserted(listExpeditionScan.size-1) expeditionScanAdapter!!.notifyItemInserted(listExpeditionScan.size-1)
customDialogList.setValue("") customDialogList.setValue("")
ma.messageWithSound("Añadida",false,true)
} }
binding.splashProgress.visibility = GONE
}) })
} }
@ -123,23 +89,16 @@ class ExpeditionScanSorterFragment(
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("Finalizar") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
/* if (listExpeditionScan.size > 0) {
customDialogList.dismiss()
backButton.performClick()
} else {*/
customDialogList.dismiss() customDialogList.dismiss()
binding.mainToolbar.backButton.performClick() binding.mainToolbar.backButton.performClick()
// }
}.setValue("").show() }.setValue("").show()
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ -> customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
@ -147,17 +106,18 @@ class ExpeditionScanSorterFragment(
expeditionscan(customDialogList.getValue()) expeditionscan(customDialogList.getValue())
} }
customDialogList.setValue("") customDialogList.setValue("")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
} }
expeditionScanAdapter = expeditionScanAdapter =
SmartTagAdapter(listExpeditionScan, object : OnSmartTagRowClickListener { GeneralAdapter(listExpeditionScan, object : OnGeneralItemRowClickListener {
override fun OnSmartTagRowClickListener(item: SmartTag) { override fun OnGeneralItemRowClickListener(item: GeneralItem) {
} }
}, showDelete = false) })
customDialogList.getRecyclerView().adapter = expeditionScanAdapter customDialogList.getRecyclerView().adapter = expeditionScanAdapter
customDialogList.getRecyclerView().layoutManager = customDialogList.getRecyclerView().layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)

View File

@ -1,32 +1,21 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.content.Intent
import android.content.SharedPreferences
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnItemExpeditionStateRowClickListener
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.imageview.activity.ImageViewActivity
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionStateAdapter import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionStateAdapter
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionStateRow import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionStateRow
import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState
class ExpeditionStateFragment( class ExpeditionStateFragment(
var entryPoint: String = "" var title: String = ""
// ) : BaseFragment<FragmentExpeditionstateBinding, ExpeditionStateViewModel>(ExpeditionStateViewModel::class) {
) : BaseFragment<FragmentItemexpeditionstateCardBinding, ExpeditionStateViewModel>(ExpeditionStateViewModel::class) { ) : BaseFragment<FragmentItemexpeditionstateCardBinding, ExpeditionStateViewModel>(ExpeditionStateViewModel::class) {
private var urlLarge: String = ""
private var titleImage: String = ""
private var user = ""
private var password = ""
private var warehouseFk = ""
private var adapter: ExpeditionStateAdapter? = null private var adapter: ExpeditionStateAdapter? = null
private var listItemsRow: ArrayList<ItemExpeditionStateRow> = ArrayList() private var listItemsRow: ArrayList<ItemExpeditionStateRow> = ArrayList()
private var itemScan = "" private var itemScan = ""
@ -35,16 +24,11 @@ class ExpeditionStateFragment(
fun newInstance(entryPoint: String) = ExpeditionStateFragment(entryPoint) fun newInstance(entryPoint: String) = ExpeditionStateFragment(entryPoint)
} }
private lateinit var customDialog: CustomDialog
override fun getLayoutId(): Int = R.layout.fragment_itemexpeditionstate_card override fun getLayoutId(): Int = R.layout.fragment_itemexpeditionstate_card
override fun init() { override fun init() {
binding.itemcardLayout.visibility = View.GONE
customDialog = CustomDialog(requireContext())
setEvents() setEvents()
setToolBar(getString(R.string.ExpeditionState)) setToolBar(title)
super.init() super.init()
} }
@ -57,12 +41,12 @@ class ExpeditionStateFragment(
binding.editItemFk.requestFocus() binding.editItemFk.requestFocus()
binding.editItemFk.setOnEditorActionListener { v, actionId, event -> binding.editItemFk.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.editItemFk.text.toString().isNullOrEmpty()) { if (binding.editItemFk.text.toString().isNotEmpty()) {
getExpedtionState(binding.editItemFk.text.toString()) getExpedtionState(binding.editItemFk.text.toString())
itemScan = binding.editItemFk.text.toString() itemScan = binding.editItemFk.text.toString()
} }
binding.editItemFk.setText("") binding.editItemFk.setText("")
(activity as MainActivity).hideKeyboard(binding.editItemFk) ma.hideKeyboard(binding.editItemFk)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -73,58 +57,26 @@ class ExpeditionStateFragment(
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
binding.itemcardImage.setOnClickListener {
val i: Intent = Intent(activity, ImageViewActivity::class.java)
i.putExtra("url", urlLarge)
i.putExtra("title", titleImage)
startActivity(i)
} }
}
private fun getExpedtionState(expeditionFk: String) { private fun getExpedtionState(expeditionFk: String) {
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
user = getData(USER)
password = getData(PASSWORD)
warehouseFk = getData(WAREHOUSEFK)
// this.itemFk = itemFk
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expedition_getStateJSON(expeditionFk, user, password,"expedition_getState") viewModel.expedition_getStateJSON(expeditionFk, getData(USER), getData(PASSWORD),"expedition_getState")
} }
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
// itemcard.observe(viewLifecycleOwner, Observer { itemexpedition.observe(viewLifecycleOwner,{
itemexpedition.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
binding.itemcardLayout.visibility = View.GONE binding.itemcardLayout.visibility = View.GONE
binding.mainToolbar.toolbarTitle.text = "Estado de la expedición" binding.mainToolbar.toolbarTitle.text = title
customDialog.setTitle("Error") ma.messageWithSound("No se ha podido obtener el estado de la expedición escaneada.",true,false,"Sin resultados")
.setDescription("No se ha podido obtener el estado de la expedición escaneada. ")
.setOkButton("Cerrar") {
customDialog.dismiss()
}.show()
} else {
if (it != null) { } else {
binding.itemcardLayout.visibility = View.VISIBLE
setItemExpeditionState(it) setItemExpeditionState(it)
} else {
binding.itemcardLayout.visibility = View.GONE
binding.mainToolbar.toolbarTitle.text = "Estado de la expedición"
customDialog.setTitle("Sin resultados")
.setDescription("No hemos podido encontrar el estado de la expedición.")
.setOkButton("Cerrar") {
customDialog.dismiss()
}.show()
}
} }
}) })
@ -134,25 +86,19 @@ class ExpeditionStateFragment(
private fun setItemExpeditionState(itemInfo: itemExpedetionState) { private fun setItemExpeditionState(itemInfo: itemExpedetionState) {
setToolBar(getString(R.string.expedition) + itemScan) setToolBar(getString(R.string.expedition) + itemScan)
binding.itemcardLayout.visibility = View.VISIBLE
listItemsRow = ArrayList() listItemsRow = ArrayList()
for (i in itemInfo.list) { for (i in itemInfo.list) {
listItemsRow.add( listItemsRow.add(
ItemExpeditionStateRow( ItemExpeditionStateRow(
title = i.key, title = i.key,
value = i.value.replace(".0",""), value = i.value?.replace(".0",""),
isEditable = false isEditable = false
) )
) )
} }
adapter = ExpeditionStateAdapter(listItemsRow)
adapter = ExpeditionStateAdapter(listItemsRow, object :
OnItemExpeditionStateRowClickListener {
override fun OnItemExpeditionStateRowClickListener(item: ItemExpeditionStateRow) {
}
})
binding.itemexpeditionstateRecyclerview.adapter = adapter binding.itemexpeditionstateRecyclerview.adapter = adapter
binding.itemexpeditionstateRecyclerview.layoutManager = binding.itemexpeditionstateRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
@ -163,4 +109,3 @@ class ExpeditionStateFragment(
} }

View File

@ -157,7 +157,7 @@ class ExpeditionStateViewModel(context: Context) : BaseViewModel() {
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type) gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
expeditionState.forEach { expeditionState.forEach {
list.add(itemsExpeditionDynamics(key=it.key,value=it.value.toString())) list.add(itemsExpeditionDynamics(key=it.key,it.value?.toString()))
} }
return list return list

View File

@ -76,7 +76,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
addTruck() addTruck()
} }
if (item == iconState){ if (item == iconState){
(activity as MainActivity).openFragmentExpeditionState() ma.openFragmentExpeditionState()
} }
} }
}) })
@ -112,14 +112,14 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
private fun addTruck(){ private fun addTruck(){
customDialogHor.setTitle("Nuevo Camión").setOkButton("Guardar"){ customDialogHor.setTitle("Nuevo Camión").setOkButton("Guardar"){
(activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText()) ma.hideKeyboard(customDialogHor.getDestinoEditText())
if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){ if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){
viewModel.expeditionTruckAdd(getData(USER), viewModel.expeditionTruckAdd(getData(USER),
getData(PASSWORD),customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add") getData(PASSWORD),customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add")
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
customDialogHor.dismiss() customDialogHor.dismiss()
} }
(activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText()) ma.hideKeyboard(customDialogHor.getDestinoEditText())
customDialogHor.dismiss() customDialogHor.dismiss()
}.setKoButton("Cancelar"){ }.setKoButton("Cancelar"){
customDialogHor.dismiss() customDialogHor.dismiss()
@ -137,7 +137,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
(activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText()) ma.hideKeyboard(customDialogHor.getDestinoEditText())
false false
} }
} }

View File

@ -1,7 +1,6 @@
package es.verdnatura.presentation.view.feature.paletizador.model package es.verdnatura.presentation.view.feature.paletizador.model
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
class ItemExpeditionTruckVO ( class ItemExpeditionTruckVO (
var truckFk:String = "", var truckFk:String = "",
@ -17,19 +16,6 @@ class ItemExpeditionTruckList(
) )
class itemExpedetionState( class itemExpedetionState(
/* var ticket: String = "",
var cliente : String = "",
var ciudad : String = "",
var provincia : String ="",
var zonaTicket : String = "",
var zonaRuta : String = "",
var ruta : String ="",
var ubicacion : String="",
var ETD : String="",
var camion : String="",
var ticketsPendientes : String= "",
var etiquetasTotales : String = "",
var etiquetasEscaneadas : String="",*/
var isError:Boolean = false, var isError:Boolean = false,
var errorMessage:String = "", var errorMessage:String = "",
var list:MutableList<itemsExpeditionDynamics> var list:MutableList<itemsExpeditionDynamics>
@ -38,16 +24,9 @@ class itemExpedetionState(
class itemsExpeditionDynamics( class itemsExpeditionDynamics(
var key: String = "", var key: String = "",
var value:String = "" var value: String? = null
)
/*
class itemExpeditionDynamicsList(
var list: List<itemsExpeditionDynamics> = listOf()
) )
class itemExpedetionStateList (
var list: List<itemExpedetionState> = listOf()
)*/
class ItemExpeditionStateRow ( class ItemExpeditionStateRow (
var title:String? = "", var title:String? = "",
var value:String? = "", var value:String? = "",

View File

@ -68,7 +68,7 @@ class ParkingFragment : BaseFragment<FragmentParkingBinding,ParkingViewModel>(Pa
if (it.isError){ if (it.isError){
// mperror?.start() // mperror?.start()
// binding.splashProgress.visibility = View.GONE // binding.splashProgress.visibility = View.GONE
(activity as MainActivity).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("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/

View File

@ -66,7 +66,7 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
mperror?.start() mperror?.start()
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/

View File

@ -8,7 +8,6 @@ import es.verdnatura.R
import es.verdnatura.databinding.FragmentPasilleroBinding import es.verdnatura.databinding.FragmentPasilleroBinding
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.pasillero.adapter.PasillerosAdapter import es.verdnatura.presentation.view.feature.pasillero.adapter.PasillerosAdapter
@ -30,7 +29,7 @@ class PasilleroFragment(
override fun getLayoutId(): Int = R.layout.fragment_pasillero override fun getLayoutId(): Int = R.layout.fragment_pasillero
override fun init() { override fun init() {
(activity as MainActivity).hideBottomNavigation(View.VISIBLE) ma.hideBottomNavigation(View.VISIBLE)
binding.mainToolbar.toolbarTitle.text = tagName binding.mainToolbar.toolbarTitle.text = tagName
binding.mainToolbar.backButton.visibility = View.GONE binding.mainToolbar.backButton.visibility = View.GONE
super.init() super.init()

View File

@ -31,14 +31,6 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
//sergio para que aparezca el nuevo menu //sergio para que aparezca el nuevo menu
/* _pasillerositem.add(
PasillerosItemVO(
7,
R.drawable.worker_mistake,
"Fallo personal", R.string.workermistake,"Permite añadir fallos a un trabajador"
)
)*/
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7, 7,
@ -112,6 +104,14 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
) )
) )
_pasillerositem.add(
PasillerosItemVO(
7,
R.drawable.worker_mistake,
"Fallo del trabajador", R.string.workermistake,"Permite añadir fallos a un trabajador"
)
)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
10, 10,
@ -190,7 +190,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
PasillerosItemVO( PasillerosItemVO(
31, 31,
R.drawable.ic_visibility_black_24dp, R.drawable.ic_visibility_black_24dp,
"Consultar expedición", R.string.ExpeditionState,"Permite conocer el estado de una expedición" "Consultar estado expedición", R.string.ExpeditionState,"Permite conocer el estado de una expedición"
) )
) )
_pasillerositem.add( _pasillerositem.add(

View File

@ -74,7 +74,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicket
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -86,7 +86,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicket
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
}else{ }else{
if (!goBack)navigateToCollectionList(it) if (!goBack)navigateToCollectionList(it)

View File

@ -63,7 +63,7 @@ class PreSacadorFragment :
private var originalScanned = "" private var originalScanned = ""
fun changevariables(){ fun changevariables(){
TODO("llevar variables i deixar soles una com positionToChange i quantityToChange") TODO("Refactor llevar variables i deixar soles una com positionToChange i quantityToChange")
} }
private var typeCollectionMissing = "" private var typeCollectionMissing = ""
private var positionCollectionMissing = 0 private var positionCollectionMissing = 0
@ -73,6 +73,8 @@ class PreSacadorFragment :
private var quantityCollectionSplit = "" private var quantityCollectionSplit = ""
private var positionCollectionSplit = 0 private var positionCollectionSplit = 0
private val listIcons:ArrayList<ImageView> = ArrayList()
//sergio: se añada para leer el articulo leido que era el buyFk //sergio: se añada para leer el articulo leido que era el buyFk
private var originalItemScan: String = "" private var originalItemScan: String = ""
@ -175,17 +177,18 @@ class PreSacadorFragment :
responseSalixMessage.observe(viewLifecycleOwner, Observer { responseSalixMessage.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} }
}) })
responseIncQuantity.observe(viewLifecycleOwner, Observer { responseIncQuantity.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true) ma.messageWithSound(it.errorMessage, isError = true,true)
} else { } else {
incresaseSuccesful() incresaseSuccesful()
} }
@ -196,20 +199,36 @@ class PreSacadorFragment :
responseParkingAdd.observe(viewLifecycleOwner, Observer { responseParkingAdd.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
if (mpok != null) mpok!!.start() if (mpok != null) mpok!!.start()
"Sale/s aparcada/s".toast(requireContext()) "Sale/s aparcada/s".toast(requireContext())
} }
}) })
responseSaleTrackingUpdate.observe(viewLifecycleOwner, Observer {
ma.messageWithSound(it.errorMessage, isError = it.isError,true)
try {
sales.clear()
}
catch(e:Exception)
{
}
})
responseSaleMove.observe(viewLifecycleOwner, Observer { responseSaleMove.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true) ma.messageWithSound(it.errorMessage, isError = true,true)
} else { } else {
responseSaleMoveSuccesful() responseSaleMoveSuccesful()
@ -219,7 +238,7 @@ class PreSacadorFragment :
responseMissingTrash.observe(viewLifecycleOwner, Observer { responseMissingTrash.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true) ma.messageWithSound(it.errorMessage, isError = true,true)
} else { } else {
missingTrashSuccesful() missingTrashSuccesful()
@ -390,7 +409,7 @@ class PreSacadorFragment :
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
if (salesList.isNullOrEmpty()) { if (salesList.isNullOrEmpty()) {
(activity as MainActivity).messageWithSound("No hemos podido obtener movimientos para el ticket escaneado",true,false,"Pre Sacador") ma.messageWithSound("No hemos podido obtener movimientos para el ticket escaneado",true,false,"Pre Sacador")
/* customDialog.setTitle("Pre Sacador") /* customDialog.setTitle("Pre Sacador")
.setDescription("No hemos podido obtener movimientos para el ticket escaneado") .setDescription("No hemos podido obtener movimientos para el ticket escaneado")
@ -576,6 +595,16 @@ class PreSacadorFragment :
setTotalLines() setTotalLines()
} }
private fun saleTracking_update(){
viewModel.saleTracking_update(
usuario = getData(USER),
password = getData(PASSWORD),
saleFk ="000"
)
}
private fun saleTrackingReplace(position: Int) { private fun saleTrackingReplace(position: Int) {
viewModel.saleTrackingReplace( viewModel.saleTrackingReplace(
usuario = getData(USER), usuario = getData(USER),
@ -913,35 +942,29 @@ class PreSacadorFragment :
private fun setToolBar() { private fun setToolBar() {
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
val listIcons:ArrayList<ImageView> = ArrayList() // val listIcons:ArrayList<ImageView> = ArrayList()
val iconParking = ImageView(context) val iconParking = ImageView(context)
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp) iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
val iconEraser = ImageView(context)
iconEraser.setImageResource(R.drawable.previous_delete)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconParking.tooltipText=getTooltip(R.drawable.ic_local_parking_black_24dp) iconParking.tooltipText=getTooltip(R.drawable.ic_local_parking_black_24dp)
iconEraser.tooltipText=getTooltip(R.drawable.previous_delete)
} }
//listIcons.add(iconEraser)
listIcons.add(iconParking) listIcons.add(iconParking)
/*val listIcons: ArrayList<Drawable> = ArrayList()
val iconEraser: Drawable = resources.getDrawable(R.drawable.eraser, resources.newTheme())
val iconParking: Drawable =
resources.getDrawable(R.drawable.ic_local_parking_black_24dp, resources.newTheme())*/
//sergio para hacer el presacador como sacador
//val iconAdd : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
//val iconTransferir : Drawable = resources.getDrawable(R.drawable.ic_swap_horiz_black_24dp,resources.newTheme())
// listIcons.add(iconEraser)
//listIcons.add(iconParking)
//listIcons.add(iconAdd)
//listIcons.add(iconTransferir)
binding.mainToolbar.toolbarIcons.adapter = binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
/*if (item == iconEraser) { /*if (item == iconEraser) {
// saleTracking_update() saleTracking_update()
} else*/ } else*/
when (item){ when (item){
iconParking.drawable-> pasillerosItemClickListener?.onPasillerosItemClickListener( iconParking.drawable-> pasillerosItemClickListener?.onPasillerosItemClickListener(
@ -949,6 +972,7 @@ class PreSacadorFragment :
title = "Parking" title = "Parking"
), "" ), ""
) )
iconEraser.drawable->saleTracking_update()
} }
} }

View File

@ -35,6 +35,11 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
val response: LiveData<ResponseItemVO> val response: LiveData<ResponseItemVO>
get() = _response get() = _response
private val _responseSaleTrackingUpdate by lazy { MutableLiveData<ResponseItemVO>() }
val responseSaleTrackingUpdate: LiveData<ResponseItemVO>
get() = _responseSaleTrackingUpdate
private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() } private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
val responseSaleMove: LiveData<ResponseItemVO> val responseSaleMove: LiveData<ResponseItemVO>
get() = _responseSaleMove get() = _responseSaleMove
@ -279,6 +284,44 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
}) })
} }
fun saleTracking_update(
usuario: String,
password: String,
saleFk: String,
)
{
getSacadorControladorUserCase.saleTracking_update(
usuario,
password,
saleFk
).enqueue(object : Callback<Unit>
{
override fun onFailure(call: Call<Unit>, t: Throwable)
{
_responseSaleTrackingUpdate.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)
)
}
override fun onResponse(call: Call<Unit>, response: Response<Unit>)
{
if (!response.isSuccessful)
{
_responseSaleTrackingUpdate.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
)
} else
{
_responseSaleTrackingUpdate.value = ResponseItemVO(isError = false, errorMessage = "Actualizado listado previa", response = "Actualizado listado previa")
}
}
})
}
fun saleTrackingReplace( fun saleTrackingReplace(
usuario: String, usuario: String,
password: String, password: String,

View File

@ -16,7 +16,7 @@ class PreSacadorItemVO (
var carros : List<PlacementVO> = listOf(), var carros : List<PlacementVO> = listOf(),
//var priority:Int =0, 7-1-2022 //var priority:Int =0, 7-1-2022
var pickingOrder:Int =0, var pickingOrder:Int =0,
var salesPersonFk:String= "sergio" var salesPersonFk:String= ""
) )

View File

@ -68,7 +68,7 @@ class QrFragment(
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
// false // false
@ -83,10 +83,11 @@ class QrFragment(
if (it.isError) { if (it.isError) {
// getMessageFromJSON(it.errorMessage) // getMessageFromJSON(it.errorMessage)
customDialog.setTitle("Error").setDescription( it.errorMessage+ " "+itemscaned) ma.messageWithSound(it.errorMessage+ " "+itemscaned,true,false)
/*customDialog.setTitle("Error").setDescription( it.errorMessage+ " "+itemscaned)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
customDialog.setTitle("Mensaje") customDialog.setTitle("Mensaje")

View File

@ -72,7 +72,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemPlacementSupplyGetOrder) binding.mainToolbar.toolbarTitle.text = getString(R.string.itemPlacementSupplyGetOrder)
setToolBar() setToolBar()
@ -519,7 +519,6 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
} }
private fun showScanner(index:Int, sale:PreSacadorItemVO){ private fun showScanner(index:Int, sale:PreSacadorItemVO){
//////Log.i("VERDNATURA:","CUSTOMDIALOG para enviar")
customDialogInput.setTitle(""+sale.itemFk).setDescription("Escanea el carro para el item seleccionado").setOkButton("Aceptar"){ customDialogInput.setTitle(""+sale.itemFk).setDescription("Escanea el carro para el item seleccionado").setOkButton("Aceptar"){
if (!customDialogInput.getValue().isNullOrEmpty()) { if (!customDialogInput.getValue().isNullOrEmpty()) {
findSale(customDialogInput.getValue(),index) findSale(customDialogInput.getValue(),index)

View File

@ -27,7 +27,7 @@ class CollectionAdapter (
holder.bind(items[position]) holder.bind(items[position])
holder.binding.root.setOnClickListener { holder.binding.root.setOnClickListener {
onCollectionSelected.onCollectionSelected(items[position],SACADOR) onCollectionSelected.onCollectionSelected(items[position],SACADOR)
//////Log.i("VERDNATURA:","2-Click item ${items[position].collectionFk}") Log.d("VERDNATURA::","2-Click item ${items[position].collectionFk}")
} }
} }

View File

@ -17,6 +17,7 @@ import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.AssociateSmartTagsFragment import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.AssociateSmartTagsFragment
import timber.log.Timber.d
class SacadorFragment : class SacadorFragment :
@ -52,9 +53,11 @@ class SacadorFragment :
setToolBar() setToolBar()
setEvents() setEvents()
viewModel.collectionGetSalix(token = getData(TOKEN)) viewModel.collectionGetSalix(token = getData(TOKEN))
/*viewModel.collectionGet( getData(USER), /* viewModel.collectionGet( getData(USER),
getData(PASSWORD),"collection_get")*/ getData(PASSWORD),"collection_get")*/
super.init() super.init()
} }
override fun onPause() { override fun onPause() {
@ -66,7 +69,7 @@ class SacadorFragment :
private fun setToolBar() { private fun setToolBar() {
// requireActivity().main_bottom_navigation.visibility = View.VISIBLE // requireActivity().main_bottom_navigation.visibility = View.VISIBLE
(activity as MainActivity).hideBottomNavigation(View.VISIBLE) ma.hideBottomNavigation(View.VISIBLE)
binding.mainToolbar.backButton.visibility = View.GONE binding.mainToolbar.backButton.visibility = View.GONE
val listIcons: ArrayList<ImageView> = ArrayList() val listIcons: ArrayList<ImageView> = ArrayList()
@ -99,19 +102,9 @@ class SacadorFragment :
viewModel.collectionNew(getData(USER), viewModel.collectionNew(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-> (activity as MainActivity).onVehicleSelected(SacadorFragment.TAG) iconVehicleIn.drawable-> ma.onVehicleSelected(SacadorFragment.TAG)
}
/* if (item == iconAdd) {
binding.splashProgress.visibility = View.VISIBLE
//viewModel.collectionNew(user, password, sectorFk, wagons)
viewModel.collectionNew(user,password,sectorFk,wagons,getTagsType(),"collection_new_wagon")
//checkTagsMode()
} }
if (item.drawable == iconVehicleIn) {
(activity as MainActivity).onVehicleSelected(SacadorFragment.TAG)
}*/
} }
}) })
binding.mainToolbar.toolbarIcons.layoutManager = binding.mainToolbar.toolbarIcons.layoutManager =
@ -122,8 +115,8 @@ class SacadorFragment :
binding.sacadorSwipe.setOnRefreshListener { binding.sacadorSwipe.setOnRefreshListener {
viewModel.collectionGetSalix(token = getData(TOKEN)) viewModel.collectionGetSalix(token = getData(TOKEN))
/* viewModel.collectionGet(getData(USER), /* viewModel.collectionGet(getData(USER),
getData(PASSWORD),"collection_get") getData(PASSWORD),"collection_get")*/
binding.sacadorSwipe.isRefreshing = false*/ binding.sacadorSwipe.isRefreshing = false
} }
} }
@ -182,7 +175,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) {
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
} else { } else {
if (goBack) addCollectionToList(it.response) if (goBack) addCollectionToList(it.response)

View File

@ -27,7 +27,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
override fun init() { override fun init() {
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getString(R.string.shelvingParking_get) binding.mainToolbar.toolbarTitle.text = getString(R.string.shelvingParking_get)
setEvents() setEvents()
@ -50,7 +50,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
} }
binding.shelvingText.setText("") binding.shelvingText.setText("")
(activity as MainActivity).hideKeyboard(binding.shelvingText) ma.hideKeyboard(binding.shelvingText)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -67,7 +67,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
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(),"shelvingParking_get")
binding.shelvingText.setText("") binding.shelvingText.setText("")
(activity as MainActivity).hideKeyboard(binding.dayrange) ma.hideKeyboard(binding.dayrange)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }

View File

@ -73,7 +73,7 @@ class ShowTicketFragment: BaseFragment<FragmentControladorBinding, ShowTicketVie
) )
} }
binding.scanInput.setText("") binding.scanInput.setText("")
(activity as MainActivity).hideKeyboard(binding.scanInput) ma.hideKeyboard(binding.scanInput)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
@ -85,7 +85,7 @@ class ShowTicketFragment: BaseFragment<FragmentControladorBinding, ShowTicketVie
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
}else{ }else{
if (!goBack)navigateToCollectionList(it) if (!goBack)navigateToCollectionList(it)
goBack = false goBack = false

View File

@ -67,7 +67,7 @@ class RegisterSmartTagsFragment(
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
goBack = false goBack = false
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
setEvents() setEvents()
@ -157,11 +157,11 @@ class RegisterSmartTagsFragment(
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage,true,false)
customDialog.setTitle("Error").setDescription(it.errorMessage) /* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
var nameSmartTagwithWagon: String var nameSmartTagwithWagon: String
@ -218,12 +218,12 @@ class RegisterSmartTagsFragment(
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("Finalizar") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
if (listSmartTags.size > 0) { if (listSmartTags.size > 0) {
// setFragmentResult("requestkey", bundleOf("tagMode" to "SmartTag")) // setFragmentResult("requestkey", bundleOf("tagMode" to "SmartTag"))
customDialogList.dismiss() customDialogList.dismiss()
// (activity as MainActivity).openFragmentPickers() // ma.openFragmentPickers()
/*listSmartTags.forEach { /*listSmartTags.forEach {
Log.i("VERDNATURA:","El codigo es :${it.code}") Log.i("VERDNATURA:","El codigo es :${it.code}")
} }
@ -239,7 +239,7 @@ class RegisterSmartTagsFragment(
} }
}.setKoButton("Deshacer") { }.setKoButton("Deshacer") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
if (!listSmartTags.isEmpty()) { if (!listSmartTags.isEmpty()) {
@ -256,7 +256,7 @@ class RegisterSmartTagsFragment(
}.setValue("").show() }.setValue("").show()
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
@ -293,7 +293,7 @@ class RegisterSmartTagsFragment(
} }
customDialogList.setValue("") customDialogList.setValue("")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -73,7 +73,7 @@ class AssociateSmartTagsFragment(
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
goBack = false goBack = false
//requireActivity().main_bottom_navigation.visibility = GONE //requireActivity().main_bottom_navigation.visibility = GONE
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
setEvents() setEvents()
@ -160,11 +160,11 @@ class AssociateSmartTagsFragment(
// Log.i("VERDNATURA::", "Revisar llamada de las etiquetas smarttags : ${it.response}") // Log.i("VERDNATURA::", "Revisar llamada de las etiquetas smarttags : ${it.response}")
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage,true,false)
customDialog.setTitle("Error").setDescription(it.errorMessage) /* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
/* if (it.response != null) { /* if (it.response != null) {
@ -195,10 +195,11 @@ class AssociateSmartTagsFragment(
responseremove.observe(viewLifecycleOwner, Observer { responseremove.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) ma.messageWithSound(it.errorMessage,true,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} else { } else {
if (it.response == null) { if (it.response == null) {
@ -264,7 +265,7 @@ class AssociateSmartTagsFragment(
customDialogList.setTitle("Escanea etiqueta/s electrónica/s o matrícula/s.") customDialogList.setTitle("Escanea etiqueta/s electrónica/s o matrícula/s.")
.setOkButton("Finalizar") { .setOkButton("Finalizar") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
if (listSmartTags.size > 0) { if (listSmartTags.size > 0) {
// setFragmentResult("requestkey", bundleOf("tagMode" to "SmartTag")) // setFragmentResult("requestkey", bundleOf("tagMode" to "SmartTag"))
@ -272,7 +273,7 @@ class AssociateSmartTagsFragment(
val result = "complete" val result = "complete"
setFragmentResult("requestKey", bundleOf("tagMode" to result)) setFragmentResult("requestKey", bundleOf("tagMode" to result))
(activity as MainActivity).openFragmentPickers() ma.openFragmentPickers(true)
/*listSmartTags.forEach { /*listSmartTags.forEach {
Log.i("VERDNATURA:","El codigo es :${it.code}") Log.i("VERDNATURA:","El codigo es :${it.code}")
} }
@ -288,7 +289,7 @@ class AssociateSmartTagsFragment(
} }
}.setKoButton("Deshacer") { }.setKoButton("Deshacer") {
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
if (!listSmartTags.isEmpty()) { if (!listSmartTags.isEmpty()) {
@ -304,7 +305,7 @@ class AssociateSmartTagsFragment(
}.setValue("").show() }.setValue("").show()
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ -> customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
@ -312,7 +313,7 @@ class AssociateSmartTagsFragment(
bindShelving_add(customDialogList.getValue()) bindShelving_add(customDialogList.getValue())
} }
customDialogList.setValue("") customDialogList.setValue("")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -33,7 +33,7 @@ class AutomaticAddItemFragment(
override fun init() { override fun init() {
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = "itemShelvingMake" binding.mainToolbar.toolbarTitle.text = "itemShelvingMake"
setEvents() setEvents()
setViews() setViews()
@ -76,7 +76,7 @@ class AutomaticAddItemFragment(
adapter!!.notifyDataSetChanged() adapter!!.notifyDataSetChanged()
} }
binding.editMatricula.setText("") binding.editMatricula.setText("")
(activity as MainActivity).hideKeyboard(binding.editMatricula) ma.hideKeyboard(binding.editMatricula)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -103,7 +103,7 @@ class AutomaticAddItemFragment(
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/*customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ /*customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
}.show()*/ }.show()*/

View File

@ -66,7 +66,7 @@ class UbicadorFragment(
customDialogUbicador = CustomDialogUbicador(requireContext()) customDialogUbicador = CustomDialogUbicador(requireContext())
customDialogTwoButtons = CustomDialogTwoButtons(requireContext()) customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getString(R.string.locator) binding.mainToolbar.toolbarTitle.text = getString(R.string.locator)
setEvents() setEvents()
setToolBar() setToolBar()
@ -154,7 +154,7 @@ class UbicadorFragment(
} }
binding.editMatricula.setText("") binding.editMatricula.setText("")
(activity as MainActivity).hideKeyboard(binding.editMatricula) ma.hideKeyboard(binding.editMatricula)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -173,7 +173,7 @@ class UbicadorFragment(
) )
} }
(activity as MainActivity).hideKeyboard(binding.editPrioridad) ma.hideKeyboard(binding.editPrioridad)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -183,7 +183,7 @@ class UbicadorFragment(
binding.automaticImg.setOnClickListener { binding.automaticImg.setOnClickListener {
if (!shelvingFk.isNullOrEmpty()) if (!shelvingFk.isNullOrEmpty())
(activity as MainActivity).onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = "Automatic"), PasillerosItemVO(title = "Automatic"),
entryPoint = shelvingFk entryPoint = shelvingFk
) )
@ -210,7 +210,7 @@ class UbicadorFragment(
}.show() }.show()
customDialogInput.getEditText().requestFocus() customDialogInput.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
@ -259,7 +259,7 @@ class UbicadorFragment(
}.show() }.show()
customDialogInput.getEditText().requestFocus() customDialogInput.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
@ -375,17 +375,24 @@ class UbicadorFragment(
}) })
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
mperror!!.start() ma.messageWithSound(it.errorMessage,it.isError,false)
/* mperror!!.start()
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()*/
} }
}) })
responsepriority.observe(viewLifecycleOwner, Observer { responsepriority.observe(viewLifecycleOwner, Observer {
if (it.isError) {
ma.messageWithSound(
if (it.isError) it.errorMessage else{it.response},it.isError,true)
/* if (it.isError) {
mperror!!.start() mperror!!.start()
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
@ -393,7 +400,7 @@ class UbicadorFragment(
}.show() }.show()
} else { } else {
(it.response).toast(requireContext()) (it.response).toast(requireContext())
} }*/
}) })
responseMake.observe(viewLifecycleOwner, Observer { responseMake.observe(viewLifecycleOwner, Observer {
@ -439,7 +446,7 @@ class UbicadorFragment(
}.show() }.show()
customDialogUbicador.getEditItem().requestFocus() customDialogUbicador.getEditItem().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem()) ma.hideKeyboard(customDialogUbicador.getEditItem())
customDialogUbicador.getVisibleItem().setOnEditorActionListener { v, actionId, event -> customDialogUbicador.getVisibleItem().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
@ -518,7 +525,7 @@ class UbicadorFragment(
customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("") customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("")
.setEtiquetaValue("").setVisibleValue("") .setEtiquetaValue("").setVisibleValue("")
customDialogUbicador.getEditItem().requestFocus() customDialogUbicador.getEditItem().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem()) ma.hideKeyboard(customDialogUbicador.getEditItem())
customDialogUbicador.dismiss() customDialogUbicador.dismiss()
} else if (!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()) { } else if (!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()) {
@ -547,7 +554,7 @@ class UbicadorFragment(
customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("") customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("")
.setEtiquetaValue("").setVisibleValue("") .setEtiquetaValue("").setVisibleValue("")
customDialogUbicador.getEditItem().requestFocus() customDialogUbicador.getEditItem().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem()) ma.hideKeyboard(customDialogUbicador.getEditItem())
customDialogUbicador.dismiss() customDialogUbicador.dismiss()
} else { } else {
@ -582,7 +589,7 @@ class UbicadorFragment(
customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("") customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("")
.setEtiquetaValue("").setVisibleValue("") .setEtiquetaValue("").setVisibleValue("")
customDialogUbicador.getEditItem().requestFocus() customDialogUbicador.getEditItem().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem()) ma.hideKeyboard(customDialogUbicador.getEditItem())
customDialogUbicador.dismiss() customDialogUbicador.dismiss()
} else if (!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty() && updatePacking) { } else if (!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty() && updatePacking) {
@ -616,7 +623,7 @@ class UbicadorFragment(
customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("") customDialogUbicador.setItemValue("").setPackingValue("").setGroupingValue("")
.setEtiquetaValue("").setVisibleValue("") .setEtiquetaValue("").setVisibleValue("")
customDialogUbicador.getEditItem().requestFocus() customDialogUbicador.getEditItem().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem()) ma.hideKeyboard(customDialogUbicador.getEditItem())
customDialogUbicador.dismiss() customDialogUbicador.dismiss()
} else { } else {
@ -639,14 +646,14 @@ class UbicadorFragment(
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible,packing = packing)) changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible,packing = packing))
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("") customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
customDialogUbicador.getEditItem().requestFocus() customDialogUbicador.getEditItem().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem()) ma.hideKeyboard(customDialogUbicador.getEditItem())
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()){ }else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()){
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString() val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1","itemShelvingMake") viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1","itemShelvingMake")
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas)) changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("") customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
customDialogUbicador.getEditItem().requestFocus() customDialogUbicador.getEditItem().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem()) ma.hideKeyboard(customDialogUbicador.getEditItem())
}else{ }else{
"Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG) "Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
} }
@ -687,7 +694,7 @@ class UbicadorFragment(
customDialogInput.dismiss() customDialogInput.dismiss()
}.show() }.show()
customDialogInput.getEditText().requestFocus() customDialogInput.getEditText().requestFocus()
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
viewModel.itemShelvingTransfer( viewModel.itemShelvingTransfer(

View File

@ -1,61 +1,52 @@
package es.verdnatura.presentation.view.feature.workermistake.adapter package es.verdnatura.presentation.view.feature.workermistake.adapter
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchBuyerModel
import android.content.Context import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.ImageView import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentWorkermistakeBinding import es.verdnatura.databinding.FragmentWorkermistakeBinding
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.OnBarcodeRowClickListener
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.onMistakeWorkerClickListener
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO import es.verdnatura.presentation.view.component.CustomDialogList
import es.verdnatura.presentation.view.feature.inventario.adapter.InventoryAdapter import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchDepartmentModel import es.verdnatura.presentation.view.feature.inventario.fragment.SearchDepartmentModel
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeWorkerType
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
import es.verdnatura.presentation.view.feature.workermistake.model.workerFromMistakeList
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
import ir.mirrajabi.searchdialog.core.SearchResultListener
import timber.log.Timber.d
class WorkermistakeFragment( var entryPoint: String = "" class WorkermistakeFragment( var entryPoint: String = ""
) : BaseFragment<FragmentWorkermistakeBinding, InventaryViewModel>( ) : BaseFragment<FragmentWorkermistakeBinding, InventaryViewModel>(
InventaryViewModel::class) { InventaryViewModel::class) {
private var adapter : InventoryAdapter? = null
private var adapterworker:WorkermistakeAdapter? = null private var adapterworker:WorkermistakeAdapter? = null
private lateinit var customDialogInput: CustomDialogInput private lateinit var customDialogInput: CustomDialogInput
private var listInvetory:ArrayList<ItemInventaryVO> = ArrayList()
private var listInvetoryAux:ArrayList<ItemInventaryVO> = ArrayList()
private var listWorker:ArrayList<WorkerFromMistake> = ArrayList()
private var listWorker:MutableList<WorkerFromMistake> = ArrayList()
private var listWorkerAuxiliary:MutableList<WorkerFromMistake> = ArrayList()
private lateinit var customDialog: CustomDialog private lateinit var customDialog: CustomDialog
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
private var reload = false
private var hideLoad = true
private var layoutManager : LinearLayoutManager? = null private var layoutManager : LinearLayoutManager? = null
private var firstVisiblePosition = 0 // private var firstVisiblePosition = 0
private lateinit var customDialogList: CustomDialogList
private var listMistakes: ArrayList<BarcodeVO> = ArrayList()
private var listMistakesAdapter: BarcodeAdapter? = null
private var workerMistakeName: WorkerFromMistake? = null
//sergio : cmbios para insertar lista compradores en inventary en el searchable
private val items=ArrayList<SearchBuyerModel>()
private val departments=ArrayList<SearchDepartmentModel>() private val departments=ArrayList<SearchDepartmentModel>()
private lateinit var buyerId:String private lateinit var departmentId:String
companion object { companion object {
fun newInstance(entryPoint:String) = WorkermistakeFragment(entryPoint) fun newInstance(entryPoint:String) = WorkermistakeFragment(entryPoint)
@ -69,9 +60,6 @@ class WorkermistakeFragment( var entryPoint: String = ""
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
//viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelvingBuyerGet")
viewModel.department_getHasMistake(usuario = getData(USER),password = getData(PASSWORD)) viewModel.department_getHasMistake(usuario = getData(USER),password = getData(PASSWORD))
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
} }
@ -79,22 +67,28 @@ class WorkermistakeFragment( var entryPoint: String = ""
override fun init() { override fun init() {
binding.filterBuyer.setText(getData(BUYER))
binding.filterDepartment.setText(getData(DEPARTMENTMISTAKE))
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
buyerId=getData(BUYERID) departmentId=getData(DEPARTMENTMISTAKEID)
// viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer") customDialogList = CustomDialogList(requireContext())
binding.filterBuyer.setOnClickListener{
if (!departmentId.isEmpty()){
viewModel.worker_getFromHasMistake(getData(USER),getData(PASSWORD),getData(DEPARTMENTMISTAKEID),"worker_getFromHasMistake")
}
binding.filterDepartment.setOnClickListener{
SimpleSearchDialogCompat(context,getString(R.string.departamentos),getString(R.string.escribirparteNombre),null,departments, SimpleSearchDialogCompat(context,getString(R.string.departamentos),getString(R.string.escribirparteNombre),null,departments,
SearchResultListener { baseSearchDialogCompat, nombre, position -> { baseSearchDialogCompat, nombre, position ->
binding.filterBuyer.setText((nombre.title)) binding.filterDepartment.setText((nombre.title))
saveBuyer(nombre.getDepartmentName())
saveBuyerId(nombre.getDepartmentId()) saveData(DEPARTMENTMISTAKE,nombre.getDepartmentName())
buyerId=nombre.getDepartmentId() saveData(DEPARTMENTMISTAKEID,nombre.getDepartmentId())
// viewModel.getInventory(getData(USER),getData(PASSWORD),nombre.getBuyerId(),getData(WAREHOUSEFK),"itemShelving_filterBuyer")
viewModel.worker_getFromHasMistake(getData(USER),getData(PASSWORD),nombre.getDepartmentId(),"worker_getFromHasMistake") viewModel.worker_getFromHasMistake(getData(USER),getData(PASSWORD),nombre.getDepartmentId(),"worker_getFromHasMistake")
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
binding.filterItemFk.isEnabled = true
baseSearchDialogCompat.dismiss() baseSearchDialogCompat.dismiss()
}).show() }).show()
} }
@ -102,19 +96,10 @@ class WorkermistakeFragment( var entryPoint: String = ""
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
(activity as MainActivity).hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemShelvingRadar)
setToolBar() setToolBar()
setEvents() setEvents()
if (reload){
reload = false
binding.splashProgress.visibility = View.VISIBLE
hideLoad = false
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer")
}
super.init() super.init()
} }
@ -122,230 +107,155 @@ class WorkermistakeFragment( var entryPoint: String = ""
binding.mainToolbar.toolbarTitle.text=entryPoint binding.mainToolbar.toolbarTitle.text=entryPoint
val listIcons: ArrayList<ImageView> = ArrayList()
val iconReload = ImageView(context)
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
}
listIcons.add(iconReload)
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons,object: OnOptionsSelectedListener{
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload.drawable){
binding.splashProgress.visibility = View.VISIBLE
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
viewModel.department_getHasMistake(usuario = getData(USER),password = getData(PASSWORD))
}
}
})
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun setEvents(){ private fun setEvents(){
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
if (binding.filterDepartment.text.isNullOrEmpty()){binding.filterItemFk.isEnabled = false}
binding.filterItemFk.setOnKeyListener { v, keyCode, event -> binding.filterItemFk.addTextChangedListener{ filter()}
if (binding.filterItemFk.text.toString().isNullOrEmpty()){
if (listInvetory.size != listInvetoryAux.size){
listInvetory.removeAll(listInvetoryAux)
listInvetoryAux.forEach {
listInvetory.add(it)
}
} }
}else{ private fun filter() {
listInvetory.removeAll(listInvetoryAux)
listInvetoryAux.forEach { if (!listWorker.isNullOrEmpty())
if ((it.itemFk.contains(binding.filterItemFk.text.toString(),true)) || (it.producer.contains(binding.filterItemFk.text.toString(),true))){ {listWorker.clear()
listInvetory.add(it) listWorker.addAll(listWorkerAuxiliary.filter{it.firstName.uppercase().contains(binding.filterItemFk.text.toString().uppercase()) || it.lastName.uppercase().contains(binding.filterItemFk.text.toString().uppercase())} as MutableList<WorkerFromMistake>)
} adapterworker!!.notifyDataSetChanged()}
} }
} /* override fun onPause() {
adapter!!.notifyDataSetChanged()
return@setOnKeyListener false
}
}
override fun onPause() {
super.onPause() super.onPause()
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0 firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
} }*/
override fun onResume() { /* override fun onResume() {
super.onResume() super.onResume()
if (binding.workermistakeRecyclerview.layoutManager != null){ if (binding.workermistakeRecyclerview.layoutManager != null){
if (firstVisiblePosition <= listInvetory.size){ if (firstVisiblePosition <= listInvetory.size){
binding.workermistakeRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition) binding.workermistakeRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
} }
} }
} }*/
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel){ with(viewModel){
//sergio: para compradores
buyersList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
createBuyerList(it.list)
})
mistakeDepartmentList.observe(viewLifecycleOwner, Observer { mistakeDepartmentList.observe(viewLifecycleOwner, {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
createDepartmentList(it.list) createDepartmentList(it.list)
}) })
workerFromMistakeList.observe(viewLifecycleOwner, Observer { workerFromMistakeList.observe(viewLifecycleOwner, {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
createWorkerList(it.list) createWorkerList(it.list)
it.list.forEach {
if (it.id != "0"){
listWorker.add(it)
}
}
adapterworker= WorkermistakeAdapter(listWorker,object:onMistakeWorkerClickListener{ adapterworker= WorkermistakeAdapter(listWorker,object:onMistakeWorkerClickListener{
override fun onMistakeWorkerClickListener(item: WorkerFromMistake) { override fun onMistakeWorkerClickListener(item: WorkerFromMistake) {
viewModel.workerMistakeType_get(usuario = getData(USER), password = getData(PASSWORD)) viewModel.workerMistakeType_get(usuario = getData(USER), password = getData(PASSWORD))
workerMistakeName=WorkerFromMistake(item.id,item.firstName,item.lastName,true,"")
} }
}) })
binding.workermistakeRecyclerview.adapter = adapterworker binding.workermistakeRecyclerview.adapter = adapterworker
layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.workermistakeRecyclerview.layoutManager = layoutManager binding.workermistakeRecyclerview.layoutManager = layoutManager
}) })
inventaryList.observe(viewLifecycleOwner, Observer {
if (hideLoad){ mistakeWorkerList.observe(viewLifecycleOwner,{
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
}else{ showMistakeList(it.list)
hideLoad = true //goBack = false
}
listInvetory = ArrayList()
listInvetoryAux = ArrayList()
it.list.forEach {
if (it.nicho != "0"){
listInvetory.add(it)
listInvetoryAux.add(it)
}
}
adapter = InventoryAdapter(listInvetory,object: OnInvetoryNichoClickListener{
override fun onInvetoryNichoClickListener(item: ItemInventaryVO) {
//sergio: cambiado customdialogInput pòr customdialog 6.1.4
customDialog.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){
//customDialogInput.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){
viewModel.itemTrash(item.itemFk,getData(WAREHOUSEFK),getData(USER),getData(PASSWORD),item.nicho,"0","itemTrash")
//viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,"0","0")
// viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0")
changeOfflineValue(item)
// customDialogInput.dismiss()
customDialog.dismiss()
}.setKoButton("Cancelar"){
// customDialogInput.dismiss()
customDialog.dismiss()
}.show()
}
},onPasillerosItemClickListener = pasillerosItemClickListener!!)
binding.workermistakeRecyclerview.adapter = adapter
layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.workermistakeRecyclerview.layoutManager = layoutManager
if (firstVisiblePosition <= listInvetory.size){
binding.workermistakeRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
}
}) })
responseAddMistake.observe(viewLifecycleOwner, {
response.observe(viewLifecycleOwner, Observer { ma.messageWithSound(it.errorMessage,it.isError,true)
})
response.observe(viewLifecycleOwner, {
if (it.isError){ if (it.isError){
(activity as MainActivity).messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss()
}.show()*/
} }
}) })
} }
} }
private fun changeOfflineValue(item:ItemInventaryVO){
var i = 0
var position = 0
listInvetory.forEach {
if (it.itemFk == item.itemFk) {
position = i
}
i = i.plus(1)
}
listInvetory.removeAt(position)
i = 0 private fun showMistakeList(list: List<MistakeWorkerType>) {
position = 0 binding.splashProgress.visibility = View.GONE
listInvetoryAux.forEach { listMistakes = ArrayList()
if (it.itemFk == item.itemFk) { list.forEach {
position = i listMistakes.add(BarcodeVO(code = it.description))
} }
i = i.plus(1)
}
listInvetoryAux.removeAt(position)
adapter?.notifyDataSetChanged()
reload = true
customDialogList.setTitle("Causa de error para : ${workerMistakeName!!.firstName}").setKoButton("Cancelar") {
customDialogList.dismiss()
}.hideDialog().show()
listMistakesAdapter =
BarcodeAdapter(listMistakes, object : OnBarcodeRowClickListener {
override fun onBarcodeRowClickListener(item: BarcodeVO) {
list.forEach {
if (it.description == item.code) {
viewModel.workerMistake_Add(usuario = getData(USER),
password = getData(PASSWORD),
vUserFk = workerMistakeName!!.id,
vTypeFk = it.code, callFunction ="workerMistake_Add"
)
// "Causa del error registrado".toast(requireContext())
customDialogList.dismiss()
}
}
}
}, showDelete = false)
customDialogList.getRecyclerView().adapter = listMistakesAdapter
customDialogList.getRecyclerView().layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
} }
//sergio:añadido para compradores
private fun createBuyerList(list: List<BuyerVO>){
items.clear()
list.forEach { buyer ->
if (!buyer.isError){
try {
items.add(SearchBuyerModel(buyer.nickname,buyer.userFk));
}catch (e:Exception){}
}
}}
private fun createDepartmentList(list: List<DepartmentMistake>){ private fun createDepartmentList(list: List<DepartmentMistake>){
departments.clear() departments.clear()
list.forEach { department -> list.forEach { department ->
d("department"+department.name)
if (!department.isError){ if (!department.isError){
try { try {
departments.add(SearchDepartmentModel(department.name,department.id)); departments.add(SearchDepartmentModel(department.name,department.id))
}catch (e:Exception){} }catch (e:Exception){}
} }
}} }}
private fun createWorkerList(list: List<WorkerFromMistake>){ private fun createWorkerList(list: List<WorkerFromMistake>){
departments.clear() listWorker.clear()
list.forEach { worker -> list.forEach { worker ->
d("worker "+worker.firstName)
d("lastname "+worker.lastName)
if (!worker.isError){ if (!worker.isError){
try { try {
//departments.add(SearchDepartmentModel(department.name,department.id)); listWorker.add(worker)
}catch (e:Exception){} }catch (e:Exception){}
} }
}}
}
listWorkerAuxiliary.clear()
listWorkerAuxiliary.addAll(listWorker)
}
} }

View File

@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.workermistake.model
class MistakeWorkerType ( class MistakeWorkerType (
var id: String = "", var id: String = "",
var code:String = "",
var description: String = "", var description: String = "",
var isError:Boolean = false, var isError:Boolean = false,
var errorMessage:String = "" var errorMessage:String = ""

View File

@ -0,0 +1,8 @@
<!-- drawable/playlist_remove.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#FFF" android:pathData="M2,6V8H14V6H2M2,10V12H11V10H2M14.17,10.76L12.76,12.17L15.59,15L12.76,17.83L14.17,19.24L17,16.41L19.83,19.24L21.24,17.83L18.41,15L21.24,12.17L19.83,10.76L17,13.59L14.17,10.76M2,14V16H11V14H2Z" />
</vector>

View File

@ -55,13 +55,6 @@
android:padding="10dp" android:padding="10dp"
android:orientation="vertical"> android:orientation="vertical">
<ImageView
android:id="@+id/itemcard_image"
android:layout_width="match_parent"
android:layout_height="@dimen/itemcard_image_height"
android:scaleType="centerCrop"
android:visibility="gone"
android:src="@drawable/loadphoto" />
<!-- TAGS ======================================================================================================= --> <!-- TAGS ======================================================================================================= -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -69,302 +62,6 @@
android:orientation="horizontal" android:orientation="horizontal"
android:padding="@dimen/layout_margin_min" android:padding="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_min"> android:layout_marginBottom="@dimen/layout_margin_min">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:visibility="gone">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Ticket"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cliente"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ciudad"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Provincia"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Zona ticket"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="zonaRuta"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ruta"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ubicacion"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETD"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Camión"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ticketsPendientes"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="etiquetasTotales"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="etiquetasEscaneadas"
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body2"
android:textStyle="bold"
android:layout_marginEnd="@dimen/layout_margin_min"/>
<TextView
android:id="@+id/itemcard_tag13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
<!-- VALORES ================================================================================================== --> <!-- VALORES ================================================================================================== -->

View File

@ -33,10 +33,10 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/filter_itemFk" android:id="@+id/filter_itemFk"
style="@style/InputLineTextSearch" style="@style/InputLineTextSearch"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_weight="1.5" android:layout_weight="1.5"
android:backgroundTint="@android:color/white" android:backgroundTint="@android:color/white"
android:hint="@string/Filtro" android:hint="Nombre o apellido"
android:inputType="text" android:inputType="text"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
@ -45,14 +45,14 @@
android:textColorHint="@android:color/darker_gray" /> android:textColorHint="@android:color/darker_gray" />
<TextView <TextView
android:id="@+id/filter_buyer" android:id="@+id/filter_department"
style="@style/InputLineTextSearch" style="@style/InputLineTextSearch"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:backgroundTint="@android:color/white" android:backgroundTint="@android:color/white"
android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp" android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp"
android:focusable="false" android:focusable="false"
android:hint="@string/buscarcomprador" android:hint="@string/buscarDepartamento"
android:inputType="text" android:inputType="text"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
@ -79,7 +79,7 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1.25"
android:gravity="center" android:gravity="center"
android:text="Nombre" android:text="Nombre"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
@ -90,7 +90,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="Apellido" android:text="Apellidos"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" /> android:textSize="@dimen/body2" />

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
>
<data>
<variable
name="item"
type="es.verdnatura.presentation.common.GeneralItem" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/item_row_layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verdnatura_black_5"
android:padding="@dimen/pasilleros_margin_main_menu">
<TextView
android:id="@+id/item_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@{item.code}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h7"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/pasilleros_margin_main_menu"
android:textStyle="bold"/>
<TextView
android:id="@+id/item_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@{item.text}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h7"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/pasilleros_margin_main_menu"
android:visibility="visible"
android:textStyle="bold"/>
<ImageView
android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image"
android:layout_width="30dp"
android:layout_height="27dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_delete_black_24dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/verdnatura_black_9"/>
</LinearLayout>
</layout>

View File

@ -45,33 +45,33 @@
<TextView <TextView
android:id="@+id/item_firstname" android:id="@+id/item_firstname"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:gravity="center" android:gravity="left"
android:paddingRight="@dimen/pasilleros_margin_main_menu"
android:text="@{item.firstName}" android:text="@{item.firstName}"
android:textColor="@color/verdnatura_pumpkin_orange" android:textColor="@color/verdnatura_pumpkin_orange"
android:textSize="@dimen/row" android:textSize="@dimen/row"
android:textStyle="bold" android:layout_weight="2"
tool:text="Sergio" /> tool:text="Sergio" />
<TextView <TextView
android:id="@+id/item_lastname" android:id="@+id/item_lastname"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:gravity="left" android:gravity="left"
android:text="@{item.lastName}" android:text="@{item.lastName}"
android:textColor="@color/verdnatura_pumpkin_orange" android:textColor="@color/verdnatura_pumpkin_orange"
android:textSize="@dimen/row" android:textSize="@dimen/row"
android:textStyle="bold" android:layout_weight="1"
android:layout_marginLeft="5dp"
tool:text="de la Torre Nebot" /> tool:text="de la Torre Nebot" />
<ImageView <ImageView
android:id="@+id/imageErrorMessage" android:id="@+id/imageErrorMessage"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="end" android:layout_gravity="end"
app:srcCompat="@drawable/emoticon_error" /> app:srcCompat="@drawable/emoticon_error" />

View File

@ -158,4 +158,5 @@
<string name="bufferfstrapping">Flejado buffer</string> <string name="bufferfstrapping">Flejado buffer</string>
<string name="Split">Split</string> <string name="Split">Split</string>
<string name="workermistake">Fallo del trabajador</string> <string name="workermistake">Fallo del trabajador</string>
<string name="buscarDepartamento">Buscar departamento</string>
</resources> </resources>

View File

@ -156,5 +156,6 @@
<string name="bufferfstrapping">Buffer strapping</string> <string name="bufferfstrapping">Buffer strapping</string>
<string name="Split">Split</string> <string name="Split">Split</string>
<string name="workermistake">Worker mistaker</string> <string name="workermistake">Worker mistaker</string>
<string name="buscarDepartamento">Find department</string>
</resources> </resources>