Versión 6.4 añadido historico del carro y de items, buffer "flejado" y cambiado menú buffer.

This commit is contained in:
Sergio De la torre 2021-12-10 09:52:58 +01:00
parent 26c9046903
commit 7fb7825a6b
52 changed files with 651 additions and 814 deletions

View File

@ -18,10 +18,12 @@
<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" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_empty.xml" value="0.13333333333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_empty.xml" value="0.13333333333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_fill.xml" value="0.19814814814814816" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_fill.xml" value="0.19814814814814816" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_flejado.xml" value="0.2916666666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_full.xml" value="0.18489583333333334" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_full.xml" value="0.18489583333333334" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_off.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_off.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_outline.xml" value="0.22407407407407406" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_outline.xml" value="0.22407407407407406" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_control.xml" value="0.22407407407407406" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_control.xml" value="0.22407407407407406" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_info.xml" value="0.2916666666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/circleshape.xml" value="0.11979166666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/circleshape.xml" value="0.11979166666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/component_progress.xml" value="0.11979166666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/component_progress.xml" value="0.11979166666666667" />
<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" />
@ -86,6 +88,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_load.xml" value="0.20923913043478262" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_load.xml" value="0.20923913043478262" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_loadexpedition.xml" value="0.1398176291793313" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_loadexpedition.xml" value="0.1398176291793313" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item.xml" value="0.21014492753623187" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item.xml" value="0.21014492753623187" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item_all.xml" value="0.3333333333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_collection.xml" value="0.23007246376811594" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_collection.xml" value="0.23007246376811594" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_controlador.xml" value="0.20153985507246377" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_controlador.xml" value="0.20153985507246377" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_scan.xml" value="0.21666666666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_scan.xml" value="0.21666666666666667" />
@ -106,6 +109,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_parking.xml" value="0.5" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_parking.xml" value="0.5" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pasillero.xml" value="0.13829787234042554" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pasillero.xml" value="0.13829787234042554" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_qr.xml" value="0.19882246376811594" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_qr.xml" value="0.19882246376811594" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador.xml" value="0.12952898550724637" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador_associatesmarttag.xml" value="0.22" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador_associatesmarttag.xml" value="0.22" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.13269927536231885" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.13269927536231885" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" />
@ -114,12 +118,14 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol.xml" value="0.1546875" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol.xml" value="0.1546875" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol_user.xml" value="0.23052536231884058" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol_user.xml" value="0.23052536231884058" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_web.xml" value="0.2463768115942029" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_web.xml" value="0.2463768115942029" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ajustes_row.xml" value="0.10009057971014493" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.4466666666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.4466666666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_card_row.xml" value="0.2269021739130435" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_card_row.xml" value="0.2269021739130435" />
<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_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" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_itemshelvingdayofsale_row.xml" value="0.18206521739130435" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_itemshelvingdayofsale_row.xml" value="0.18206521739130435" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_all_row.xml" value="0.12259371833839919" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_row.xml" value="0.16875" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_row.xml" value="0.16875" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_pasilleros_main_menu.xml" value="0.13829787234042554" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_pasilleros_main_menu.xml" value="0.13829787234042554" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_proposal_row.xml" value="0.22604166666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_proposal_row.xml" value="0.22604166666666667" />

View File

@ -1,6 +1,6 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'//deprecated:sergio //apply plugin: 'kotlin-android-extensions'//deprecated:sergio
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.google.firebase.crashlytics'
@ -14,8 +14,9 @@ android {
applicationId "es.verdnatura" applicationId "es.verdnatura"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 83 versionCode 84
versionName "6.3" //VERSION CODE 83 Nueva funcionalidad Cargar expedición en buffer versionName "6.4" //VERSION CODE 84. Modificados menus buffer y añadido hsitorico carro por items y por carro.
//versionName "6.3" //VERSION CODE 83 Nueva funcionalidad Cargar expedición en buffer
//versionName "6.2.1" // VERSION CODE 82 Aparece mensaje de error completo en "Error al construir la colección". //versionName "6.2.1" // VERSION CODE 82 Aparece mensaje de error completo en "Error al construir la colección".
//versionName "6.2" //VERSION CODE 81, arreglado el null de grouping en ubicador. //versionName "6.2" //VERSION CODE 81, arreglado el null de grouping en ubicador.
//versionName "6.1.9.1" //VERSION CODE 80, arreglado el null de grouping en ubicador. //versionName "6.1.9.1" //VERSION CODE 80, arreglado el null de grouping en ubicador.

View File

@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 83, "versionCode": 84,
"versionName": "6.3", "versionName": "6.4",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
], ],

Binary file not shown.

BIN
app/release/vn-picking.apk Normal file

Binary file not shown.

View File

@ -4,7 +4,6 @@ import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
import es.verdnatura.presentation.view.feature.buscaritemall.fragment.BuscarItemAllViewModel
import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersViewModel import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersViewModel
import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityViewModel import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityViewModel
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
@ -65,9 +64,6 @@ val viewModelModule = module {
} }
// Pasilleros / Buscar Item 2 // Pasilleros / Buscar Item 2
viewModel {
BuscarItemAllViewModel(androidContext())
}
viewModel { viewModel {
PreControladorViewModel(androidContext()) PreControladorViewModel(androidContext())

View File

@ -1,12 +1,12 @@
package es.verdnatura.domain package es.verdnatura.domain
import android.content.Context import android.content.Context
import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll //import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll
import retrofit2.Call import retrofit2.Call
class GetBuscarItemAllUserCase(context: Context) : RestClient(context) { class GetBuscarItemAllUserCase(context: Context) : RestClient(context) {
fun searchItemsUbicadorAll( /* fun searchItemsUbicadorAll(
usuario: String, usuario: String,
password: String, password: String,
itemFk: String itemFk: String
@ -21,6 +21,6 @@ class GetBuscarItemAllUserCase(context: Context) : RestClient(context) {
"application/json", "application/json",
params = params params = params
) )
} }*/
} }

View File

@ -6,7 +6,7 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll //import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
@ -526,7 +526,7 @@ interface VerdnaturaService {
Call<List<ItemLocationVO>> Call<List<ItemLocationVO>>
// BUSCAR ITEM ALL // BUSCAR ITEM ALL
@POST("almacennew/getItemUbication")//REVISADA /* @POST("almacennew/getItemUbication")//REVISADA
fun searchItemsUbicadorAll( fun searchItemsUbicadorAll(
@Header("aplicacion") aplicacion: String, @Header("aplicacion") aplicacion: String,
@Header("version") version: String, @Header("version") version: String,
@ -535,7 +535,7 @@ interface VerdnaturaService {
@Header("Content-Type") content_type: String, @Header("Content-Type") content_type: String,
@Body params: List<String> @Body params: List<String>
): ):
Call<List<ItemLocationAll>> Call<List<ItemLocationAll>>*/
//INVENTARIO ========================================================================> //INVENTARIO ========================================================================>

View File

@ -40,5 +40,4 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
} }
} }

View File

@ -4,11 +4,17 @@ package es.verdnatura.presentation.view.component
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.view.View import android.view.View
import android.widget.TextView
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.ComponentCustomDialogBinding import es.verdnatura.databinding.ComponentCustomDialogBinding
import kotlinx.android.synthetic.main.component_custom_dialog.*
//import kotlinx.android.synthetic.main.component_custom_dialog.*
private lateinit var binding: ComponentCustomDialogBinding private lateinit var binding: ComponentCustomDialogBinding
private lateinit var custom_dialog_title: TextView
private lateinit var custom_dialog_description: TextView
private lateinit var custom_dialog_button_ok: TextView
private lateinit var custom_dialog_button_ko: TextView
class CustomDialogMainActivity(context: Context) : Dialog(context, R.style.DialogTheme) { class CustomDialogMainActivity(context: Context) : Dialog(context, R.style.DialogTheme) {
@ -16,48 +22,52 @@ class CustomDialogMainActivity(context: Context) : Dialog(context, R.style.Dialo
//sergio: de momento se deja el componentDialogMainActivity porque no acaba de funciona bien //sergio: de momento se deja el componentDialogMainActivity porque no acaba de funciona bien
// con el viewbinding del customDialog // con el viewbinding del customDialog
setContentView(R.layout.component_custom_dialog) /* setContentView(R.layout.component_custom_dialog)
/* binding = ComponentCustomDialogBinding.inflate(layoutInflater) custom_dialog_title = findViewById(R.id.custom_dialog_title)
setContentView(binding.root)*/ custom_dialog_description = findViewById(R.id.custom_dialog_description)
custom_dialog_button_ok = findViewById(R.id.custom_dialog_button_ok)
custom_dialog_button_ko = findViewById(R.id.custom_dialog_button_ko)*/
binding = ComponentCustomDialogBinding.inflate(layoutInflater)
setContentView(binding.root)
} }
fun setTitle(title: String): CustomDialogMainActivity { fun setTitle(title: String): CustomDialogMainActivity {
custom_dialog_title.visibility = View.VISIBLE /* custom_dialog_title.visibility = View.VISIBLE
custom_dialog_title.text = title custom_dialog_title.text = title*/
/* binding.customDialogTitle.visibility = View.VISIBLE binding.customDialogTitle.visibility = View.VISIBLE
binding.customDialogTitle.text = title*/ binding.customDialogTitle.text = title
return this return this
} }
fun setDescription(description: String): CustomDialogMainActivity { fun setDescription(description: String): CustomDialogMainActivity {
custom_dialog_description.visibility = View.VISIBLE /* custom_dialog_description.visibility = View.VISIBLE
custom_dialog_description.text = description custom_dialog_description.text = description
/*binding.customDialogDescription.visibility = View.VISIBLE */
binding.customDialogDescription.text = description*/ binding.customDialogDescription.visibility = View.VISIBLE
binding.customDialogDescription.text = description
return this return this
} }
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity { fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity {
custom_dialog_button_ok.visibility = View.VISIBLE /* custom_dialog_button_ok.visibility = View.VISIBLE
custom_dialog_button_ok.text = text custom_dialog_button_ok.text = text
custom_dialog_button_ok.setOnClickListener { onButtonClicked() } custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
/* binding.customDialogButtonOk.visibility = View.VISIBLE binding.customDialogButtonOk.visibility = View.VISIBLE
binding.customDialogButtonOk.text = text binding.customDialogButtonOk.text = text
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }*/ binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
return this return this
} }
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity { fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity {
custom_dialog_button_ko.visibility = View.VISIBLE /* custom_dialog_button_ko.visibility = View.VISIBLE
custom_dialog_button_ko.text = text custom_dialog_button_ko.text = text
custom_dialog_button_ko.setOnClickListener { onButtonClicked() } custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
/* binding.customDialogButtonKo.visibility = View.VISIBLE binding.customDialogButtonKo.visibility = View.VISIBLE
binding.customDialogButtonKo.text = text binding.customDialogButtonKo.text = text
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }*/ binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
return this return this
} }

View File

@ -13,6 +13,7 @@ import android.os.Bundle
import android.provider.Settings import android.provider.Settings
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import androidx.appcompat.widget.TooltipCompat.setTooltipText
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
@ -27,7 +28,7 @@ import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.main.activity.MainActivity 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 kotlinx.android.synthetic.main.activity_main.view.* //import kotlinx.android.synthetic.main.activity_main.view.*
//import kotlinx.android.synthetic.main.fragment_login.* //import kotlinx.android.synthetic.main.fragment_login.*
@ -345,7 +346,7 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
//androidid_text.performLongClick() //androidid_text.performLongClick()
//Log.i(TD,"se copia $string") //Log.i(TD,"se copia $string")
//getString(R.string.copied).toast(requireContext()) //getString(R.string.copied).toast(requireContext())
//setTooltipText(androidid_text, getString(R.string.copied)) setTooltipText(binding.androididText, getString(R.string.copied))
return false return false
} }

View File

@ -11,7 +11,9 @@ import android.app.AlertDialog
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.util.Log
import android.view.View import android.view.View
import android.view.View.GONE
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
@ -143,13 +145,11 @@ class ItemCardFragment(
false false
} }
//backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
//itemcard_image.setOnClickListener {
binding.itemcardImage.setOnClickListener{ binding.itemcardImage.setOnClickListener{
val i = Intent(activity,ImageViewActivity::class.java) val i = Intent(activity,ImageViewActivity::class.java)
@ -165,9 +165,12 @@ class ItemCardFragment(
password = prefs.getString(PASSWORD,"").toString() password = prefs.getString(PASSWORD,"").toString()
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString() warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
this.itemFk = itemFk this.itemFk = itemFk
binding.splashProgress.visibility = View.VISIBLE
binding.splashProgressTwo.visibility = View.VISIBLE
viewModel.getItemCard(itemFk,warehouseFk,user,password,"item_card") viewModel.getItemCard(itemFk,warehouseFk,user,password,"item_card")
binding.splashProgress.visibility = View.VISIBLE
viewModel.getItemPackingType(user,password,"get_ItemPackingType") viewModel.getItemPackingType(user,password,"get_ItemPackingType")
} }
override fun observeViewModel() { override fun observeViewModel() {
@ -175,7 +178,8 @@ class ItemCardFragment(
itemcard.observe(viewLifecycleOwner, Observer { itemcard.observe(viewLifecycleOwner, Observer {
if (it.isError){ if (it.isError){
binding.itemcardLayout.visibility = View.GONE binding.itemcardLayout.visibility = GONE
binding.splashProgressTwo.visibility=GONE
binding.mainToolbar.toolbarTitle.text = "ItemCard" binding.mainToolbar.toolbarTitle.text = "ItemCard"
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()
@ -185,6 +189,7 @@ class ItemCardFragment(
binding.itemcardLayout.visibility = View.VISIBLE binding.itemcardLayout.visibility = View.VISIBLE
setItemCard(it) setItemCard(it)
}else{ }else{
binding.splashProgressTwo.visibility=GONE
binding.itemcardLayout.visibility = View.GONE binding.itemcardLayout.visibility = View.GONE
binding.mainToolbar.toolbarTitle.text = "ItemCard" binding.mainToolbar.toolbarTitle.text = "ItemCard"
customDialog.setTitle("Sin resultados").setDescription("No hemos podido encontrar el articulo. Revisa el sector.").setOkButton("Cerrar"){ customDialog.setTitle("Sin resultados").setDescription("No hemos podido encontrar el articulo. Revisa el sector.").setOkButton("Cerrar"){
@ -193,13 +198,11 @@ class ItemCardFragment(
} }
} }
//binding.splashProgress.visibility = View.GONE
}) })
itemspackinglist.observe(viewLifecycleOwner, Observer { itemspackinglist.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = GONE
// //Log.i("VERDNATURA:","el code es $it.code")
// //Log.i("VERDNATURA:","la descrip es $it.description")
createItemTypeTypeList(it.list) createItemTypeTypeList(it.list)
}) })
@ -385,7 +388,7 @@ class ItemCardFragment(
binding.scrollView.scrollTo(0, position[1]) binding.scrollView.scrollTo(0, position[1])
} }
} }
binding.splashProgress.visibility = View.GONE binding.splashProgressTwo.visibility=GONE
} }
private fun editItemCardRow(item:ItemCardRowVO,value:String){ private fun editItemCardRow(item:ItemCardRowVO,value:String){

View File

@ -3,20 +3,16 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import android.widget.Toast import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.appcompat.widget.TooltipCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat.getColor
import androidx.lifecycle.Observer 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.FragmentInventaryBinding import es.verdnatura.databinding.FragmentInventaryBinding
import es.verdnatura.databinding.FragmentItemproposalBinding
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnItemProposalClickListener import es.verdnatura.presentation.common.OnItemProposalClickListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener import es.verdnatura.presentation.common.OnOptionsSelectedListener
@ -26,19 +22,17 @@ import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.feature.articulo.adapter.ItemProposalAdapter import es.verdnatura.presentation.view.feature.articulo.adapter.ItemProposalAdapter
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchBuyerModel import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_buscar_item.* import kotlinx.android.synthetic.main.fragment_buscar_item.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
class ItemProposalFragment( class ItemProposalFragment(
var itemFk: String = "" var itemFk: String = ""
) : BaseFragment<FragmentInventaryBinding, ItemCardViewModel>( ) : BaseFragment<FragmentItemproposalBinding, ItemCardViewModel>(
ItemCardViewModel::class ItemCardViewModel::class
) { ) {
@ -106,9 +100,10 @@ class ItemProposalFragment(
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
splash_progress.visibility = View.VISIBLE (activity as MainActivity).hideBottomNavigation(View.GONE)
toolbar_title.text = getString(R.string.ArticleSimilar) + ":" + itemFk binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.ArticleSimilar) + ":" + itemFk
setToolBar() setToolBar()
setEvents() setEvents()
@ -125,10 +120,10 @@ class ItemProposalFragment(
listIcons.add(iconFilter) listIcons.add(iconFilter)
toolbar_icons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload) { if (item == iconReload) {
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0 firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
viewModel.item_getSimilar( viewModel.item_getSimilar(
itemFk, itemFk,
@ -142,7 +137,7 @@ class ItemProposalFragment(
} }
if (item == iconFilter) { if (item == iconFilter) {
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0 firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
@ -179,7 +174,7 @@ class ItemProposalFragment(
} }
}) })
toolbar_icons.layoutManager = binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
@ -194,7 +189,7 @@ class ItemProposalFragment(
mytoast.show() mytoast.show()
} }
private fun setEvents() { private fun setEvents() {
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
@ -207,9 +202,9 @@ class ItemProposalFragment(
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (location_recyclerview.layoutManager != null) { if (binding.locationRecyclerview.layoutManager != null) {
if (firstVisiblePosition <= listInvetory.size) { if (firstVisiblePosition <= listInvetory.size) {
location_recyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition) binding.locationRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
} }
} }
} }
@ -219,7 +214,7 @@ class ItemProposalFragment(
itemProposallist.observe(viewLifecycleOwner, Observer { itemProposallist.observe(viewLifecycleOwner, Observer {
if (hideLoad) { if (hideLoad) {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
} else { } else {
hideLoad = true hideLoad = true
} }
@ -249,13 +244,13 @@ class ItemProposalFragment(
} }
}, onPasillerosItemClickListener = pasillerosItemClickListener!!) }, onPasillerosItemClickListener = pasillerosItemClickListener!!)
location_recyclerview.adapter = adapter binding.locationRecyclerview.adapter = adapter
layoutManager = layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
location_recyclerview.layoutManager = layoutManager binding.locationRecyclerview.layoutManager = layoutManager
if (firstVisiblePosition <= listInvetory.size) { if (firstVisiblePosition <= listInvetory.size) {
location_recyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition) binding.locationRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
} }
}) })

View File

@ -78,7 +78,25 @@ class BufferFragment(
if (! binding.scanInput.text.isNullOrEmpty()) { if (! binding.scanInput.text.isNullOrEmpty()) {
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
if (entryPoint.equals("Vaciado buffer")){
when (entryPoint){
"Vaciado buffer"->entryPoint="UNLOADING"
"Llenado buffer"-> entryPoint="LOADING"
"Acumulación buffer"->entryPoint="ACCUMULATION"
"Desactivado buffer"->entryPoint="DISABLED"
"Flejado buffer"->entryPoint="STRAPPING"
}
viewModel.buffer_setTypeByName(
user,
password,
binding.scanInput.text.toString(),
entryPoint,
"buffer_setTypeByName"
)
/* if (entryPoint.equals("Vaciado buffer")){
viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"UNLOADING","buffer_setTypeByName") viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"UNLOADING","buffer_setTypeByName")
} }
if (entryPoint.equals("Llenado buffer")){ if (entryPoint.equals("Llenado buffer")){
@ -89,7 +107,8 @@ class BufferFragment(
} }
if (entryPoint.equals("Desactivado buffer")){ if (entryPoint.equals("Desactivado buffer")){
viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"DISABLED","buffer_setTypeByName") viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"DISABLED","buffer_setTypeByName")
} }*/
} }
binding.scanInput.setText("") binding.scanInput.setText("")
@ -106,18 +125,14 @@ class BufferFragment(
itembuffertype.observe(viewLifecycleOwner, Observer { itembuffertype.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)
.setOkButton("Aceptar") {
customDialog.dismiss()
}.show()
} else {
// customDialog.setTitle("Mensaje").setDescription(it.errorMessage)
customDialog.setTitle("Mensaje").setDescription("Operación "+entryPoint.lowercase() + " realizada correctamente") (activity as MainActivity).messageWithSound(
.setOkButton("Aceptar") { it.errorMessage,false)
customDialog.dismiss()
} else {
(activity as MainActivity).messageWithSound("Operación "+entryPoint.lowercase() + " buffer realizada correctamente",true)
binding.mainToolbar.backButton.performClick() binding.mainToolbar.backButton.performClick()
}.show()
} }

View File

@ -58,7 +58,7 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() {
//_bufferresponse.value = false //_bufferresponse.value = false
_itembuffertype.value = ResponseItemVO( _itembuffertype.value = ResponseItemVO(
isError = true, isError = true,
errorMessage = getMessageFromAllResponse(callFunction,response.message())) errorMessage = getMessageFromAllResponse(callFunction,"Error al realizar la operación"))
} }

View File

@ -1,44 +0,0 @@
package es.verdnatura.presentation.view.feature.buscaritemall.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.databinding.ItemLocationAllRowBinding
import es.verdnatura.databinding.ItemLocationRowBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
class LocationAdapterAll (
private val items: List<ItemLocationAll>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
): RecyclerView.Adapter<LocationAdapterAll.ItemHolderAll> () {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolderAll{
return ItemHolderAll(
ItemLocationAllRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
)
}
override fun getItemCount() =items.size
override fun onBindViewHolder(holder: ItemHolderAll, position: Int) {
holder.bind(items[position])
holder.binding.root.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = "Ubicador"),items[position].Matricula)
}
}
class ItemHolderAll(
val binding: ItemLocationAllRowBinding
) : RecyclerView.ViewHolder(binding.root){
private val res = binding.root.context.resources
fun bind(item: ItemLocationAll) {
binding.apply {
this.item = item
}
}
}
}

View File

@ -1,143 +0,0 @@
package es.verdnatura.presentation.view.feature.buscaritem.fragment
import android.content.Context
import android.content.SharedPreferences
import android.util.Log
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentBuscarItemAllBinding
import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.buscaritemall.adapter.LocationAdapterAll
import es.verdnatura.presentation.view.feature.buscaritemall.fragment.BuscarItemAllViewModel
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_buscar_item.*
import kotlinx.android.synthetic.main.fragment_buscar_item.edit_itemFk
import kotlinx.android.synthetic.main.fragment_buscar_item.location_recyclerview
import kotlinx.android.synthetic.main.fragment_buscar_item.splash_progress
import kotlinx.android.synthetic.main.fragment_buscar_item_all.*
import kotlinx.android.synthetic.main.fragment_inventary.*
import kotlinx.android.synthetic.main.toolbar.*
class BuscarItemAllFragment(
var itemFk:String = ""
) : BaseFragment<FragmentBuscarItemAllBinding, BuscarItemAllViewModel>(BuscarItemAllViewModel::class) {
private var user = ""
private var password = ""
private var warehouseFk = ""
private var adapter : LocationAdapterAll? = null
private lateinit var customDialog: CustomDialog
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
companion object {
fun newInstance(entryPoint:String) = BuscarItemAllFragment(entryPoint)
}
override fun onAttach(context: Context) {
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
super.onAttach(context)
}
override fun getLayoutId(): Int = R.layout.fragment_buscar_item_all
override fun init() {
requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getString(R.string.getubicaition)
customDialog = CustomDialog(requireContext())
setEvents()
if (!itemFk.isNullOrEmpty()){
getLocations(itemFk)
}
super.init()
}
private fun setEvents(){
edit_itemFk.requestFocus()
edit_itemFk.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!edit_itemFk.text.toString().isNullOrEmpty())
getLocations(edit_itemFk.text.toString())
edit_itemFk.setText("")
(activity as MainActivity).hideKeyboard(edit_itemFk)
return@setOnEditorActionListener true
}
false
}
edit_itemFk.setOnKeyListener { v, keyCode, event ->
//Log.i("VERDNATURA:","text")
return@setOnKeyListener false}
/*if (filter_itemFk.text.toString().isNullOrEmpty()){
if (listInvetory.size != listInvetoryAux.size){
listInvetory.removeAll(listInvetoryAux)
listInvetoryAux.forEach {
listInvetory.add(it)
}
}
}else{
listInvetory.removeAll(listInvetoryAux)
listInvetoryAux.forEach {
if ((it.itemFk.contains(filter_itemFk.text.toString(),true)) || (it.producer?.contains(filter_itemFk.text.toString(),true))){
listInvetory.add(it)
}
}
}
LocationAdapterAll!!.notifyDataSetChanged()
return@setOnKeyListener false
}*/
backButton.setOnClickListener {
requireActivity().onBackPressed()
}
}
private fun getLocations(itemFk:String){
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
user = prefs.getString(USER,"").toString()
password = prefs.getString(PASSWORD,"").toString()
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
this.itemFk = itemFk
splash_progress.visibility = View.VISIBLE
viewModel.getLocationsAll(user,password,itemFk,"getItemUbication")
}
override fun observeViewModel() {
with(viewModel){
loadLocationListAll.observe(viewLifecycleOwner, Observer { event ->
event.getContentIfNotHandled().notNull {
splash_progress.visibility = View.GONE
adapter = LocationAdapterAll(it.list,pasillerosItemClickListener!!)
location_all_recyclerview.adapter = adapter
location_all_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
var totalVisible:Int = 0
it.list.forEach {
if (!it.visible.isNullOrEmpty())
totalVisible += it.visible.toInt()
}
toolbar_title.text = "Item: "+itemFk+ " Total visible: "+totalVisible
}
})
}
}
}

View File

@ -1,55 +0,0 @@
package es.verdnatura.presentation.view.feature.buscaritemall.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.GetBuscarItemAllUserCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageError
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll
import es.verdnatura.presentation.view.feature.buscaritemall.model.LocationListAll
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
class BuscarItemAllViewModel(context: Context) : BaseViewModel() {
private val getBuscarItemAllUserCase: GetBuscarItemAllUserCase = GetBuscarItemAllUserCase(context)
private val _locationListAll by lazy { MutableLiveData<LocationListAll>() }
val locationListAll: LiveData<LocationListAll>
get() = _locationListAll
val loadLocationListAll = Transformations.map(_locationListAll) { Event(it) }
fun getLocationsAll(user:String,password:String,itemFk:String,callFunction:String){
getBuscarItemAllUserCase.searchItemsUbicadorAll(user,password,itemFk).enqueue(object : Callback<List<ItemLocationAll>> {
override fun onFailure(call: Call<List<ItemLocationAll>>, t: Throwable) {
val listError:ArrayList<ItemLocationAll> = ArrayList()
listError.add(ItemLocationAll(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!)))
_locationListAll.value = LocationListAll(listError)
}
override fun onResponse(
call: Call<List<ItemLocationAll>>,
response: Response<List<ItemLocationAll>>
) {
if (response.body() != null){
_locationListAll.value = response.body()?.let { LocationListAll(it) }
}else{
val listError:ArrayList<ItemLocationAll> = ArrayList()
listError.add(ItemLocationAll(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message())))
_locationListAll.value = LocationListAll(listError)
}
}
})
}
}

View File

@ -1,18 +0,0 @@
package es.verdnatura.presentation.view.feature.buscaritemall.model
class ItemLocationAll (
var Parking:String = "",
var Matricula:String = "",
var visible:String = "",
var Disponible:String = "",
var level:String = "",
var created:String = "",
var itemFk:String = "",
val isError : Boolean = false,
var errorMessage : String = ""
)
class LocationListAll (
var list: List<ItemLocationAll> = listOf()
)

View File

@ -16,12 +16,13 @@ import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.calidad.adapter.ItemBuyersAdapter import es.verdnatura.presentation.view.feature.calidad.adapter.ItemBuyersAdapter
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import kotlinx.android.synthetic.main.activity_main.* import es.verdnatura.presentation.view.feature.main.activity.MainActivity
/*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_collection.* import kotlinx.android.synthetic.main.fragment_collection.*
import kotlinx.android.synthetic.main.qauality_fragment.* import kotlinx.android.synthetic.main.qauality_fragment.*
import kotlinx.android.synthetic.main.qauality_fragment.scan_input import kotlinx.android.synthetic.main.qauality_fragment. binding.scanInput
import kotlinx.android.synthetic.main.qauality_fragment.splash_progress import kotlinx.android.synthetic.main.qauality_fragment.binding.splashProgress
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
@ -67,9 +68,10 @@ class QaualityFragment(
override fun init() { override fun init() {
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
splash_progress.visibility = View.VISIBLE (activity as MainActivity).hideBottomNavigation(View.GONE)
toolbar_title.text = "itemShelving_BuyerTask" binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = "itemShelving_BuyerTask"
setToolBar() setToolBar()
setEvents() setEvents()
super.init() super.init()
@ -85,31 +87,31 @@ class QaualityFragment(
val listIcons:ArrayList<Drawable> = ArrayList() val listIcons:ArrayList<Drawable> = ArrayList()
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme()) val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
listIcons.add(iconReload) listIcons.add(iconReload)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){ if (item == iconReload){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask") viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
} }
} }
}) })
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun setEvents(){ private fun setEvents(){
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
//ESCANER ========= //ESCANER =========
hideKeyboards() hideKeyboards()
scan_input.requestFocus() binding.scanInput.requestFocus()
scan_input.setOnEditorActionListener { v, actionId, event -> binding.scanInput.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 (!scan_input.text.toString().isNullOrEmpty()){ if (! binding.scanInput.text.toString().isNullOrEmpty()){
findSale(scan_input.text.toString()) findSale( binding.scanInput.text.toString())
} }
scan_input.setText("") binding.scanInput.setText("")
hideKeyboards() hideKeyboards()
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -126,7 +128,7 @@ class QaualityFragment(
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
buyersList.observe(viewLifecycleOwner, Observer { buyersList.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
createBuyerList(it.list) createBuyerList(it.list)
}) })
@ -157,14 +159,14 @@ class QaualityFragment(
listItems = list listItems = list
buyersAdapter = ItemBuyersAdapter(listItems,pasillerosItemClickListener!!,object: OnStarSelectedListener{ buyersAdapter = ItemBuyersAdapter(listItems,pasillerosItemClickListener!!,object: OnStarSelectedListener{
override fun onStarSelected(vId: String, vStars: String) { override fun onStarSelected(vId: String, vStars: String) {
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingStarsUpdate(user,password,vId,vStars) viewModel.itemShelvingStarsUpdate(user,password,vId,vStars)
} }
}) })
shelving_buyers_items.adapter = buyersAdapter binding.shelvingBuyersItems.adapter = buyersAdapter
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
shelving_buyers_items.layoutManager = lm binding.shelvingBuyersItems.layoutManager = lm
if (storedPosition < listItems.size) if (storedPosition < listItems.size)
goToPosition(storedPosition) goToPosition(storedPosition)
@ -201,8 +203,8 @@ class QaualityFragment(
} }
private fun goToPosition(position:Int){ private fun goToPosition(position:Int){
if (shelving_buyers_items != null){ if (binding.shelvingBuyersItems != null){
shelving_buyers_items.addViewObserver { binding.shelvingBuyersItems.addViewObserver {
lm!!.scrollToPositionWithOffset(position,0) lm!!.scrollToPositionWithOffset(position,0)
} }
} }

View File

@ -8,6 +8,8 @@ import android.os.Bundle
import android.speech.SpeechRecognizer import android.speech.SpeechRecognizer
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.Toast import android.widget.Toast
@ -41,6 +43,7 @@ import es.verdnatura.presentation.view.feature.sacador.model.*
import kotlinx.android.synthetic.main.fragment_collection.* import kotlinx.android.synthetic.main.fragment_collection.*
import kotlinx.android.synthetic.main.toolbar.**/ import kotlinx.android.synthetic.main.toolbar.**/
import timber.log.Timber import timber.log.Timber
import timber.log.Timber.d
class CollectionFragment( class CollectionFragment(
var collection: CollectionVO = CollectionVO(), var collection: CollectionVO = CollectionVO(),
@ -75,6 +78,8 @@ class CollectionFragment(
private var storedBackPosition: Int = 0 private var storedBackPosition: Int = 0
private var tickets: ArrayList<String> = ArrayList() private var tickets: ArrayList<String> = ArrayList()
private var mistakeSale: SaleVO? = null private var mistakeSale: SaleVO? = null
private var positionIncreaseQuantity=0
private var quantityIncrease=""
//private var myKM: KeyguardManager? = null //private var myKM: KeyguardManager? = null
@ -142,9 +147,7 @@ class CollectionFragment(
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
//requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE) (activity as MainActivity).hideBottomNavigation(View.GONE)
if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = VISIBLE
setEvents() setEvents()
@ -176,12 +179,15 @@ class CollectionFragment(
private fun setToolBar() { private fun setToolBar() {
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
if (!collection.collectionFk.isNullOrEmpty()){
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
}
val listIcons: ArrayList<Drawable> = ArrayList() val listIcons: ArrayList<Drawable> = ArrayList()
val iconPrint: Drawable = val iconPrint: Drawable =
resources.getDrawable(R.drawable.ic_print_black_24dp, resources.newTheme()) resources.getDrawable(R.drawable.ic_print_black_24dp, resources.newTheme())
val iconSearch: Drawable = /*val iconSearch: Drawable =
resources.getDrawable(R.drawable.ic_visibility, resources.newTheme()) resources.getDrawable(R.drawable.ic_visibility, resources.newTheme())*/
val iconAdd: Drawable = val iconAdd: Drawable =
resources.getDrawable(R.drawable.ic_playlist_add_black_24dp, resources.newTheme()) resources.getDrawable(R.drawable.ic_playlist_add_black_24dp, resources.newTheme())
val iconFace: Drawable = val iconFace: Drawable =
@ -190,7 +196,6 @@ class CollectionFragment(
listIcons.add(iconFace) listIcons.add(iconFace)
listIcons.add(iconPrint) listIcons.add(iconPrint)
// listIcons.add(iconSearch) // listIcons.add(iconSearch)
listIcons.add(iconAdd) listIcons.add(iconAdd)
@ -243,7 +248,7 @@ class CollectionFragment(
binding.scanInput.setOnEditorActionListener { v, actionId, event -> binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED) if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
if (!binding.scanInput.text.toString().isNullOrEmpty()) { if (!binding.scanInput.text.toString().isNullOrEmpty()) {
//////Log.i("VERDNATURA:","Pita o no pita si encuentra. Diferencia si es matricula o no") d("La tecla es "+actionId)
findSale(binding.scanInput.text.toString()) findSale(binding.scanInput.text.toString())
@ -263,7 +268,7 @@ class CollectionFragment(
binding.collectionSwipe.isRefreshing = false binding.collectionSwipe.isRefreshing = false
if (type != PRECHECKER) { if (type != PRECHECKER) {
if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
user, user,
password, password,
@ -285,9 +290,9 @@ class CollectionFragment(
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
binding.splashProgress.visibility=GONE
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!it.isError) { if (!it.isError) {
if (it.tickets.isNotEmpty()) { if (it.tickets.isNotEmpty()) {
collection = it collection = it
@ -386,11 +391,42 @@ class CollectionFragment(
}) })
responseIncQuantity.observe(viewLifecycleOwner, Observer { responseMissingTrash.observe(viewLifecycleOwner, Observer {
if (it.isError){
customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") {
customDialog.dismiss()
}.show()
}else
{
//incresaseSuccesful()
/*FALTA RELLENAR*/
//TODO()
} //sergio:esto ya estaba
/* binding.splashProgress.visibility = View.VISIBLE /* binding.splashProgress.visibility = View.VISIBLE
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/ viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/
}) })
responseIncQuantity.observe(viewLifecycleOwner, Observer {
if (it.isError){
customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") {
customDialog.dismiss()
}.show()
}else
{
incresaseSuccesful()
}
//sergio:esto ya estaba
/* binding.splashProgress.visibility = View.VISIBLE
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/
})
mistakeList.observe(viewLifecycleOwner, Observer { mistakeList.observe(viewLifecycleOwner, Observer {
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!goBack) showMistakeList(it.list) if (!goBack) showMistakeList(it.list)
@ -1460,53 +1496,78 @@ class CollectionFragment(
// //Log.i("VERDNATURA:","Aparece CustomDialog") // //Log.i("VERDNATURA:","Aparece CustomDialog")
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("") customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("")
.setOkButton(getString(R.string.Faltas)) { .setOkButton(getString(R.string.Faltas)) {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) { checkAndCall(position,customDialogThreeButtons.getValue(),getString(R.string.Faltas))
/*if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
getString(R.string.Indicanuevacantidad).toast(requireContext()) getString(R.string.Indicanuevacantidad).toast(requireContext())
} else { } else {
trash(position, customDialogThreeButtons.getValue()) trash(position, customDialogThreeButtons.getValue())
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
} }*/
}.setOkButtonTwo(getString(R.string.BasuraRechazar)) { }.setOkButtonTwo(getString(R.string.BasuraRechazar)) {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
checkAndCall(position,customDialogThreeButtons.getValue(),getString(R.string.BasuraRechazar))
/* if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
getString(R.string.Indicanuevacantidad).toast(requireContext()) getString(R.string.Indicanuevacantidad).toast(requireContext())
} else { } else {
missing(position, customDialogThreeButtons.getValue()) missing(position, customDialogThreeButtons.getValue())
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
} }*/
}.setOkButtonThree(getString(R.string.Reject)) { }.setOkButtonThree(getString(R.string.Reject)) {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) { checkAndCall(position,customDialogThreeButtons.getValue(),getString(R.string.Reject))
/* if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
getString(R.string.Indicanuevacantidad).toast(requireContext()) getString(R.string.Indicanuevacantidad).toast(requireContext())
} else { } else {
reject(position, customDialogThreeButtons.getValue()) reject(position, customDialogThreeButtons.getValue())
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
} }*/
}.setOkButtonFour(getString(R.string.Split)) {
checkAndCall(position,customDialogThreeButtons.getValue(),getString(R.string.Split))
/*if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
}.setOkButtonFour("Split") {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
getString(R.string.Indicanuevacantidad).toast(requireContext()) getString(R.string.Indicanuevacantidad).toast(requireContext())
} else { } else {
split(position, customDialogThreeButtons.getValue()) split(position, customDialogThreeButtons.getValue())
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
} }*/
}.setOkButtonAdd(getString(R.string.Agregar)) { }.setOkButtonAdd(getString(R.string.Agregar)) {
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) { checkAndCall(position,customDialogThreeButtons.getValue(),getString(R.string.Agregar))
/* if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
getString(R.string.Indicanuevacantidad).toast(requireContext()) getString(R.string.Indicanuevacantidad).toast(requireContext())
} else { } else {
increaseQuantity(position, customDialogThreeButtons.getValue()) increaseQuantity(position, customDialogThreeButtons.getValue())
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
} }*/
}.setKoButton("Cancelar") { }.setKoButton("Cancelar") {
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
}.show() }.show()
} }
private fun checkAndCall(position: Int, value: String, action: String) {
if (value.trim().isNullOrEmpty()) {
getString(R.string.Indicanuevacantidad).toast(requireContext())
} else {
when (action){
getString(R.string.Agregar)->increaseQuantity(position, value)
getString(R.string.BasuraRechazar)-> missing(position, value)
getString(R.string.Faltas)->trash(position, value)
getString(R.string.Reject)->reject(position, value)
getString(R.string.Split)-> split(position, value)
}
scanRequest()
customDialogThreeButtons.dismiss()
}
}
private fun split(position: Int, quantity: String) { private fun split(position: Int, quantity: String) {
var totalQuantity: Int = 0 var totalQuantity: Int = 0
try { try {
@ -1647,35 +1708,42 @@ class CollectionFragment(
message = message,"sendChekingPresence" message = message,"sendChekingPresence"
) )
} }
private fun incresaseSuccesful(){
private fun increaseQuantity(position: Int, quantity: String) {
viewModel.collectionIncreaseQuantity(
usuario = user,
password = password,
saleFk = sales[position].saleFk,
quantity = quantity,"collection_increaseQuantity"
)
try { try {
//val quantityPicked = (quantity.toInt() - sales[position].quantity.toInt()).toString() //val quantityPicked = (quantity.toInt() - sales[position].quantity.toInt()).toString()
//sales[position].originalQuantity = quantity //sales[position].originalQuantity = quantity
sales[position].quantity = quantity sales[positionIncreaseQuantity].quantity = quantityIncrease
/*if (type == CONTROLADOR){ /*if (type == CONTROLADOR){
showShelving(position,0,quantityPicked) showShelving(position,0,quantityPicked)
}*/ }*/
} catch (e: Exception) { } catch (e: Exception) {
} }
saleAdapter?.notifyDataSetChanged() saleAdapter?.notifyDataSetChanged()
//enviar mensaje a salix //enviar mensaje a salix
val ticket = val ticket =
"[" + sales[position].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].ticketFk + "/summary)" "[" + sales[positionIncreaseQuantity].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].ticketFk + "/summary)"
val message = val message =
"Se ha modificado la cantidad original " + sales[position].originalQuantity + " del artículo " + sales[position].itemFk + " a nueva cantidad: " + sales[position].quantity + " del ticket " + ticket "Se ha modificado la cantidad original " + sales[positionIncreaseQuantity].originalQuantity + " del artículo " + sales[positionIncreaseQuantity].itemFk + " a nueva cantidad: " + sales[positionIncreaseQuantity].quantity + " del ticket " + ticket
viewModel.sendChekingPresence( viewModel.sendChekingPresence(
token = token, token = token,
workerId = sales[position].salePersonFk, workerId = sales[positionIncreaseQuantity].salePersonFk,
message = message,"sendChekingPresence" message = message,"sendChekingPresence"
) )
}
private fun increaseQuantity(position: Int, quantity: String) {
positionIncreaseQuantity=position
quantityIncrease=quantity
viewModel.collectionIncreaseQuantity(
usuario = user,
password = password,
saleFk = sales[position].saleFk,
quantity = quantity,"collection_increaseQuantity"
)
} }
//ESTADOS //ESTADOS

View File

@ -44,6 +44,10 @@ class CollectionViewModel(context: Context) : BaseViewModel()
val responsecheckfully: LiveData<ResponseItemVO> val responsecheckfully: LiveData<ResponseItemVO>
get() = _responsecheckfully get() = _responsecheckfully
private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
val responseMissingTrash: LiveData<ResponseItemVO>
get() = _responseMissingTrash
private val _responseNew by lazy { MutableLiveData<ResponseItemVO>() } private val _responseNew by lazy { MutableLiveData<ResponseItemVO>() }
val responseNew: LiveData<ResponseItemVO> val responseNew: LiveData<ResponseItemVO>
get() = _responseNew get() = _responseNew
@ -424,7 +428,7 @@ class CollectionViewModel(context: Context) : BaseViewModel()
{ {
override fun onFailure(call: Call<String>, t: Throwable) override fun onFailure(call: Call<String>, t: Throwable)
{ {
_response.value = ResponseItemVO( _responseMissingTrash.value = ResponseItemVO(
isError = true, isError = true,
errorMessage = getMessageFromAllResponse(callFunction,t.message!!) errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
) )
@ -434,13 +438,13 @@ class CollectionViewModel(context: Context) : BaseViewModel()
{ {
if (response.body() == null) if (response.body() == null)
{ {
_response.value = ResponseItemVO( _responseMissingTrash.value = ResponseItemVO(
isError = true, isError = true,
errorMessage = getMessageFromAllResponse(callFunction,response.message()) errorMessage = getMessageFromAllResponse(callFunction,response.message())
) )
} else } else
{ {
_response.value = ResponseItemVO(isError = false, response = response.body()!!) _responseMissingTrash.value = ResponseItemVO(isError = false, response = response.body()!!)
} }
} }
}) })

View File

@ -6,27 +6,40 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
fun CollectionVO.map() : CollectionVO{ fun CollectionVO.map(): CollectionVO {
try { try {
this.tickets.forEach { ticket ->
this.tickets.forEach { ticket.sales.forEach {
ticket -> ticket.sales.forEach {
it.ticketFk = ticket.ticketFk it.ticketFk = ticket.ticketFk
it.level = ticket.level it.level = ticket.level
it.salePersonFk = ticket.salesPersonFk it.salePersonFk = ticket.salesPersonFk
it.agencyName = ticket.agencyName it.agencyName = ticket.agencyName
it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))
it.isNew = it.isAdded == "1" it.isNew = it.isAdded == "1"
// Log.d("VERDNATURA:","ORIGINAL QUANT"+it.originalQuantity)
it.originalQuantity = // sergio: OBLIGAR A ACTUALIZAR VERSIÓN PARA SUBIR DESPUÉS FICHEROS DEL BACK collection_getTickets al mismo tiempo")
//it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))
it.quantity = if (it.quantity.indexOf(".") > 0) {
it.quantity.substring(0, it.quantity.indexOf("."))
} else {
it.quantity
}
it.originalQuantity = (if (it.originalQuantity.indexOf(".") > 0) {
it.originalQuantity.substring(0, it.originalQuantity.indexOf("."))
} else it.originalQuantity)
if (it.originalQuantity.equals("-1")) it.originalQuantity = it.quantity
/* it.originalQuantity =
if (it.originalQuantity != "-1") it.originalQuantity.substring( if (it.originalQuantity != "-1") it.originalQuantity.substring(
0, 0,
it.originalQuantity.indexOf(".") it.originalQuantity.indexOf(".")
) else it.quantity ) else it.quantity*/
// it.originalQuantity=it.originalQuantity.toInt().toString()
it.pickedQuantity = it.pickedQuantity =
if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.pickedQuantity if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.pickedQuantity
if (!it.placements.isNullOrEmpty()) { if (!it.placements.isNullOrEmpty()) {
@ -40,7 +53,8 @@ fun CollectionVO.map() : CollectionVO{
} }
placement.created = placement.created =
getCalendarFromDate(placement.created).convertToDateString() getCalendarFromDate(placement.created).convertToDateString()
placement.visible = "(" + (if(placement.visible.toInt() > 0) placement.visible else "0") + ")" placement.visible =
"(" + (if (placement.visible.toInt() > 0) placement.visible else "0") + ")"
} }
} else { } else {
it.placements = listOf() it.placements = listOf()
@ -48,20 +62,21 @@ fun CollectionVO.map() : CollectionVO{
} }
} }
}catch (e:Exception){ } catch (e: Exception) {
this.isError = true this.isError = true
if (this.tickets == null || this.tickets.isEmpty()){ if (this.tickets == null || this.tickets.isEmpty()) {
this.errorMessage = "La colección no tiene tickets" this.errorMessage = "La colección no tiene tickets"
}else{ } else {
this.errorMessage = "Error al construir la colección. Descripción del error:"+ e.message.toString() this.errorMessage =
"Error al construir la colección. Descripción del error:" + e.message.toString()
} }
} }
return this return this
} }
private fun getCalendarFromDate(date:String): Calendar { private fun getCalendarFromDate(date: String): Calendar {
val sdf = SimpleDateFormat("yyyy-MM-dd") val sdf = SimpleDateFormat("yyyy-MM-dd")
val cal = Calendar.getInstance() val cal = Calendar.getInstance()
cal.setTime(sdf.parse(date)) cal.setTime(sdf.parse(date))

View File

@ -14,6 +14,8 @@ import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import timber.log.Timber.d
import timber.log.Timber.i
/* /*
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
@ -79,7 +81,8 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
binding.scanInput.requestFocus() binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { v, actionId, event -> binding.scanInput.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 || actionId == 5) {
d("Action id "+actionId)
goBack=false goBack=false
if (!binding.scanInput.text.isNullOrEmpty()) { if (!binding.scanInput.text.isNullOrEmpty()) {
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE

View File

@ -5,12 +5,10 @@ import android.os.Bundle
import android.view.View.* import android.view.View.*
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.loadUrl import es.verdnatura.presentation.common.loadUrl
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
import kotlinx.android.synthetic.main.fragment_vehiclecontrol_user.*
/*import kotlinx.android.synthetic.main.fragment_controlador.splash_progress /*import kotlinx.android.synthetic.main.fragment_controlador.splash_progress
import kotlinx.android.synthetic.main.fragment_vehiclecontrol_user.* import kotlinx.android.synthetic.main.fragment_vehiclecontrol_user.*

View File

@ -2,8 +2,11 @@ package es.verdnatura.presentation.view.feature.diadeventa.fragment
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.view.Gravity
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.Toast
import androidx.appcompat.widget.TooltipCompat
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
@ -67,6 +70,8 @@ class DayOfSaleFragment(
listIcons.add(iconParking) listIcons.add(iconParking)
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {

View File

@ -27,8 +27,6 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
ViewGroup.LayoutParams.WRAP_CONTENT))*/ ViewGroup.LayoutParams.WRAP_CONTENT))*/
//goToMain() //goToMain()
//goToMain()
addFragment(LoginFragment.newInstance(), R.id.main_frame_layout, LoginFragment.TAG) addFragment(LoginFragment.newInstance(), R.id.main_frame_layout, LoginFragment.TAG)
} }

View File

@ -26,6 +26,7 @@ import es.verdnatura.presentation.view.feature.login.activity.LoginActivity
import es.verdnatura.presentation.view.feature.login.model.LoginItemVO import es.verdnatura.presentation.view.feature.login.model.LoginItemVO
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import java.lang.Boolean.TRUE import java.lang.Boolean.TRUE
import kotlin.system.exitProcess
class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) { class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
@ -44,17 +45,10 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
checkUser() checkUser()
binding.buttonLogin.setOnClickListener(View.OnClickListener { binding.buttonLogin.setOnClickListener(View.OnClickListener {
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
// Log.i(TD,"el imei pasado al login es ${getANDROIDID()}")
/* viewModel.login(
binding.edittextUsername.text.toString(),
binding.edittextPassword.text.toString(),
getANDROIDID()
)*/
viewModel.device_checkLogin( viewModel.device_checkLogin(
binding.edittextUsername.text.toString(), binding.edittextUsername.text.toString(),
binding.edittextPassword.text.toString(), binding.edittextPassword.text.toString(),
getANDROIDID(),callFunction = "device_checkLogin" getANDROIDID(), callFunction = "device_checkLogin"
) )
}) })
@ -71,9 +65,14 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
binding.edittextServer.setText(this.getDefaults("base_url", this.requireContext())) binding.edittextServer.setText(this.getDefaults("base_url", this.requireContext()))
binding.edittextServer.setOnKeyListener(View.OnKeyListener { v, keyCode, event -> binding.edittextServer.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) { if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) {
this.setDefaults("base_url", binding.edittextServer.text.toString(), this.requireContext()) this.setDefaults(
"base_url",
binding.edittextServer.text.toString(),
this.requireContext()
)
this.hideKeyboard() this.hideKeyboard()
//sergio: deberia lanzar la funcion nueva creada por mi restartapp de BaseFragment. Pero no vuelve a arrancar //sergio: deberia lanzar la funcion nueva creada por mi restartapp de BaseFragment. Pero no vuelve a arrancar
exitProcess(0)
restartapp() restartapp()
return@OnKeyListener false return@OnKeyListener false
@ -124,16 +123,16 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
with(viewModel) { with(viewModel) {
versionappitem.observe(viewLifecycleOwner, Observer { versionappitem.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()
} else { } else {
binding.splashProgress.visibility = View.VISIBLE
if (it.version.equals(getInfoVersionNameApp())) { if (it.version.equals(getInfoVersionNameApp())) {
binding.splashProgress.visibility = View.INVISIBLE
goToMain() goToMain()
} else { } else {
@ -165,21 +164,20 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
}) })
logindevice.observe(viewLifecycleOwner, Observer { logindevice.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()
} else { } else {
binding.splashProgress.visibility = View.VISIBLE
if (it.vIsAuthorized.equals("0")) { if (it.vIsAuthorized.equals("0")) {
binding.splashProgress.visibility = View.INVISIBLE
// Log.i("VERDNATURA:",it.vMessage)
customDialog.setTitle("Error").setDescription(it.vMessage!!) customDialog.setTitle("Error").setDescription(it.vMessage!!)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
binding.splashProgress.visibility = View.INVISIBLE
// goToMain() // goToMain()
}.show() }.show()
@ -195,10 +193,9 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
binding.edittextPassword.text.toString(), binding.edittextPassword.text.toString(),
"warehouse", "warehouse",
getInfoVersionNameApp(), getInfoVersionNameApp(),
getANDROIDID(),"deviceLog_add" getANDROIDID(), "deviceLog_add"
) )
binding.splashProgress.visibility = View.INVISIBLE
//saveUserFkPref(it) //saveUserFkPref(it)
if (binding.switchRemember.isChecked) { if (binding.switchRemember.isChecked) {
saveRemember(true) saveRemember(true)
@ -213,8 +210,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
if (it.vIsAuthorized.equals("1") && it.vMessage.isNullOrEmpty()) { if (it.vIsAuthorized.equals("1") && it.vMessage.isNullOrEmpty()) {
// Log.i("VERDNATURA", "Sin mensaje")
binding.splashProgress.visibility = View.VISIBLE
loginSalix( loginSalix(
user = binding.edittextUsername.text.toString(), user = binding.edittextUsername.text.toString(),
password = binding.edittextPassword.text.toString(), password = binding.edittextPassword.text.toString(),
@ -223,14 +219,15 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
} }
if (it.vIsAuthorized.equals("1") && !it.vMessage.isNullOrEmpty()) { if (it.vIsAuthorized.equals("1") && !it.vMessage.isNullOrEmpty()) {
binding.splashProgress.visibility = View.GONE
customDialog.setTitle("Mensaje").setDescription(it.vMessage) customDialog.setTitle("Mensaje").setDescription(it.vMessage)
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
customDialog.dismiss() customDialog.dismiss()
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
loginSalix( loginSalix(
user = binding.edittextUsername.text.toString(), user = binding.edittextUsername.text.toString(),
password = binding.edittextPassword.text.toString(),"login de Salix" password = binding.edittextPassword.text.toString(),
"login de Salix"
) )
}.show() }.show()
@ -245,17 +242,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
workerId.observe(viewLifecycleOwner, Observer { workerId.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (!it.isError) { if (!it.isError) {
saveUserFkPref(it.Id.toString()) saveUserFkPref(it.Id.toString())
} }
/* customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") {
customDialog.dismiss()
}.show()
} else {
saveUserFkPref(it.Id.toString())
}*/
}) })
@ -290,7 +281,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
}) })
devicelogresponse.observe(viewLifecycleOwner, Observer { devicelogresponse.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error") customDialog.setTitle("Error")
.setDescription(it.errorMessage) .setDescription(it.errorMessage)
@ -300,13 +291,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
customDialog.dismiss() customDialog.dismiss()
getVersion() getVersion()
}.show() }.show()
} else {
} }
}) })
loginsalixitem.observe(viewLifecycleOwner, Observer { loginsalixitem.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
saveTokenPref("") saveTokenPref("")
customDialog.setTitle("Error") customDialog.setTitle("Error")
@ -323,18 +312,15 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
} }
}) })
version.observe(viewLifecycleOwner, Observer { /* version.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE binding.splashProgress.visibility = View.INVISIBLE
if (it) { if (it) {
/* customDialog.setTitle("Atención").setDescription("La aplicación se encuentra en fase de desarrollo. Algunas funcionalidades están desactivadas y se van a ir añadiendo de forma progresiva.").setOkButton("Entrar"){ binding.constrainlayoutLogin.visibility=INVISIBLE
goToMain()
customDialog.dismiss()
}.setKoButton("Cancelar"){
customDialog.dismiss()
}.show()*/
goToMain() goToMain()
binding.splashProgress.visibility = View.INVISIBLE
} else { } else {
binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle(getString(R.string.Actualizar)) customDialog.setTitle(getString(R.string.Actualizar))
.setDescription(getString(R.string.updatemng)).setOkButton( .setDescription(getString(R.string.updatemng)).setOkButton(
getString( getString(
@ -349,7 +335,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
goToMain() goToMain()
}.show() }.show()
} }
}) })*/
} }
super.observeViewModel() super.observeViewModel()
} }
@ -408,7 +394,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
viewModel.checkVersion( viewModel.checkVersion(
user = binding.edittextUsername.text.toString(), user = binding.edittextUsername.text.toString(),
password = binding.edittextPassword.text.toString(), password = binding.edittextPassword.text.toString(),
nameApp = "warehouse","getVersion" nameApp = "warehouse", "getVersion"
) )
} }
@ -437,7 +423,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
) )
val mgr = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager val mgr = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager
mgr[AlarmManager.RTC, System.currentTimeMillis() + 100] = mPendingIntent mgr[AlarmManager.RTC, System.currentTimeMillis() + 100] = mPendingIntent
System.exit(0) exitProcess(0)
} }
} }

View File

@ -30,9 +30,9 @@ class LoginViewModel(context: Context) : BaseViewModel()
val loginsalixitem: LiveData<LoginSalixVO> val loginsalixitem: LiveData<LoginSalixVO>
get() = _loginsalixitem get() = _loginsalixitem
private val _version by lazy { MutableLiveData<Boolean>() } /* private val _version by lazy { MutableLiveData<Boolean>() }
val version: LiveData<Boolean> val version: LiveData<Boolean>
get() = _version get() = _version*/
private val _devicelogresponse by lazy { MutableLiveData<ResponseItemVO>() } private val _devicelogresponse by lazy { MutableLiveData<ResponseItemVO>() }
val devicelogresponse: LiveData<ResponseItemVO> val devicelogresponse: LiveData<ResponseItemVO>
@ -165,10 +165,6 @@ class LoginViewModel(context: Context) : BaseViewModel()
var loginDevice: LoginDevice? var loginDevice: LoginDevice?
/* Log.d("VERDNATIRA",response.message())
Log.d("VERDNATIRA",response.errorBody().toString())
Log.d("VERDNATIRA",response.toString())
Log.d("VERDNATIRA",response.raw().toString())*/
if (!response.isSuccessful) if (!response.isSuccessful)
{ {

View File

@ -2,7 +2,9 @@ package es.verdnatura.presentation.view.feature.main.activity
//import kotlinx.android.synthetic.main.activity_main.* //import kotlinx.android.synthetic.main.activity_main.*
import android.content.SharedPreferences import android.content.SharedPreferences
import android.media.MediaPlayer
import android.view.Menu import android.view.Menu
import android.widget.Toast
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
@ -10,6 +12,7 @@ import es.verdnatura.BuildConfig
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.ActivityMainBinding import es.verdnatura.databinding.ActivityMainBinding
import es.verdnatura.domain.ConstAndValues.MAINACTIVITY import es.verdnatura.domain.ConstAndValues.MAINACTIVITY
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseActivity import es.verdnatura.presentation.base.BaseActivity
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.CustomDialogMainActivity import es.verdnatura.presentation.view.component.CustomDialogMainActivity
@ -66,10 +69,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
var firstItem: ItemMenuVO? = null var firstItem: ItemMenuVO? = null
var fm = supportFragmentManager var fm = supportFragmentManager
var TAG = "MainActivity" var TAG = "MainActivity"
var mperror: MediaPlayer? = null
var mpok: MediaPlayer? = null
override fun getLayoutId(): Int = R.layout.activity_main override fun getLayoutId(): Int = R.layout.activity_main
override fun init() { override fun init() {
mperror = MediaPlayer.create((this),R.raw.error)
mpok = MediaPlayer.create((this),R.raw.ok)
customDialog = CustomDialogMainActivity(this) customDialog = CustomDialogMainActivity(this)
setBottomMenu() setBottomMenu()
if (haveSector()) addFragment( if (haveSector()) addFragment(
@ -393,21 +401,23 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
//Menu buffer //Menu buffer
"Vaciado buffer" -> { "Vaciado buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Vaciado buffer")) addFragmentOnTop(BufferFragment.newInstance(item.title))
} }
"Llenado buffer" -> { "Llenado buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Llenado buffer")) addFragmentOnTop(BufferFragment.newInstance(item.title))
} }
"Acumulación buffer" -> { "Acumulación buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Acumulación buffer")) addFragmentOnTop(BufferFragment.newInstance(item.title))
} }
"Desactivado buffer" -> { "Desactivado buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Desactivado buffer")) addFragmentOnTop(BufferFragment.newInstance(item.title))
} }
"Cargar expedición en buffer"->{ "Cargar expedición en buffer"->{
addFragmentOnTop(BufferLoadFragment.newInstance("Cargar expedición en buffer")) addFragmentOnTop(BufferLoadFragment.newInstance("Cargar expedición en buffer"))
} }
"Flejado buffer"->{
addFragmentOnTop(BufferFragment.newInstance(item.title))
}
/*sergio:pruebas*/ /*sergio:pruebas*/
"Pre Control" -> { "Pre Control" -> {
addFragmentOnTop(PreControladorFragment.newInstance()) addFragmentOnTop(PreControladorFragment.newInstance())
@ -523,4 +533,22 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
binding.mainBottomNavigation.visibility = visible binding.mainBottomNavigation.visibility = visible
} }
fun messageWithSound(message:String,isSuccess:Boolean){
if (isSuccess){
mpok?.start()
}
else{
mperror?.start()
message.toast(this, Toast.LENGTH_SHORT)
customDialog.setTitle("Error").setDescription(message)
.setOkButton("Aceptar") {
customDialog.dismiss()
}.show()
}
}
} }

View File

@ -1,10 +1,12 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
/*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_expedition_pallet_detail.*
import kotlinx.android.synthetic.main.toolbar.**/
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
@ -23,9 +25,6 @@ import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionPal
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewListVO import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewListVO
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_expedition_pallet_detail.*
import kotlinx.android.synthetic.main.toolbar.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
@ -75,10 +74,12 @@ class ExpeditionPalletDetailFragment(
override fun init() { override fun init() {
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
expedition_pallet_detail_pallet.text = "Pallet "+itemPallet!!.Pallet binding.expeditionPalletDetailPallet.text = "Pallet "+itemPallet!!.Pallet
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar() setToolBar()
setEvents() setEvents()
viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View") viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View")
@ -86,11 +87,11 @@ class ExpeditionPalletDetailFragment(
} }
private fun setEvents(){ private fun setEvents(){
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
button_ok.setOnClickListener { binding.buttonOk.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
// sergio: en caso de que hay problemas habrá que cambiar aquí la llamada // sergio: en caso de que hay problemas habrá que cambiar aquí la llamada
// MainActivity.addFragmentOnTop(ExpeditionPalletDetailFragment.newInstance(itemTruck,itemPallet)) // MainActivity.addFragmentOnTop(ExpeditionPalletDetailFragment.newInstance(itemTruck,itemPallet))
@ -109,18 +110,18 @@ class ExpeditionPalletDetailFragment(
listIcons.add(iconEditar) listIcons.add(iconEditar)
listIcons.add(iconBorrar) listIcons.add(iconBorrar)
listIcons.add(iconPrint) listIcons.add(iconPrint)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){ if (item == iconReload){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View") viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View")
}else if(item == iconEditar){ }else if(item == iconEditar){
onPalletClickListener!!.onPalletClickListener(itemExpeditionTruckVO!!,itemPallet!!) onPalletClickListener!!.onPalletClickListener(itemExpeditionTruckVO!!,itemPallet!!)
}else if(item == iconBorrar){ }else if(item == iconBorrar){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPalletDel(user,password,itemPallet!!.Pallet,"expeditionPallet_Del") viewModel.expeditionPalletDel(user,password,itemPallet!!.Pallet,"expeditionPallet_Del")
}else if(item == iconPrint){ }else if(item == iconPrint){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
(getString(R.string.Imprimiendo)+" por " +SectorDescription).toast(requireContext()) (getString(R.string.Imprimiendo)+" por " +SectorDescription).toast(requireContext())
viewModel.expeditionPalletPrintSet(user,password,itemPallet!!.Pallet,sectorFk,"expeditionPallet_PrintSet") viewModel.expeditionPalletPrintSet(user,password,itemPallet!!.Pallet,sectorFk,"expeditionPallet_PrintSet")
@ -128,7 +129,7 @@ class ExpeditionPalletDetailFragment(
} }
} }
}) })
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun getCURDATE(date:String):String{ private fun getCURDATE(date:String):String{
@ -158,11 +159,11 @@ class ExpeditionPalletDetailFragment(
} }
private fun printExpeditionList(it: ItemPalletViewListVO){ private fun printExpeditionList(it: ItemPalletViewListVO){
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionPalletViewAdapter(it.list) adapter = ExpeditionPalletViewAdapter(it.list)
expedition_pallet_recyclerview.adapter = adapter binding.expeditionPalletRecyclerview.adapter = adapter
expedition_pallet_recyclerview.layoutManager = lm binding.expeditionPalletRecyclerview.layoutManager = lm
} }
} }

View File

@ -1,11 +1,13 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
/*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_expedition_pallet.*
import kotlinx.android.synthetic.main.toolbar.**/
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.media.MediaPlayer import android.media.MediaPlayer
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
@ -29,9 +31,6 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionT
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletListVO import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletListVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanList import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanList
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_expedition_pallet.*
import kotlinx.android.synthetic.main.toolbar.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
@ -83,9 +82,10 @@ class ExpeditionPalletFragment(
override fun init() { override fun init() {
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar() setToolBar()
setEvents() setEvents()
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List") viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
@ -94,7 +94,7 @@ class ExpeditionPalletFragment(
} }
private fun setEvents(){ private fun setEvents(){
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
@ -106,17 +106,17 @@ class ExpeditionPalletFragment(
val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme()) val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
listIcons.add(iconReload) listIcons.add(iconReload)
listIcons.add(iconPlus) listIcons.add(iconPlus)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){ if (item == iconReload){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List") viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
}else if(item == iconPlus){ }else if(item == iconPlus){
expeditionScanAdd() expeditionScanAdd()
} }
} }
}) })
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun getCURDATE(date:String):String{ private fun getCURDATE(date:String):String{
@ -172,23 +172,23 @@ class ExpeditionPalletFragment(
} }
private fun printExpeditionList(it: ItemPalletListVO){ private fun printExpeditionList(it: ItemPalletListVO){
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionPalletAdapter(it.list,onPalletClickListener!!,onComprobarPalletViewClickListener!!,itemExpeditionTruckVO!!) adapter = ExpeditionPalletAdapter(it.list,onPalletClickListener!!,onComprobarPalletViewClickListener!!,itemExpeditionTruckVO!!)
expedition_pallet_recyclerview.adapter = adapter binding.expeditionPalletRecyclerview.adapter = adapter
expedition_pallet_recyclerview.layoutManager = lm binding.expeditionPalletRecyclerview.layoutManager = lm
} }
private fun expeditionScanAdd(){ private fun expeditionScanAdd(){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanAdd(usuario = user,password = password,vPalletFk = "0",vTruckFk = itemExpeditionTruckVO!!.truckFk,"expeditionScan_Add") viewModel.expeditionScanAdd(usuario = user,password = password,vPalletFk = "0",vTruckFk = itemExpeditionTruckVO!!.truckFk,"expeditionScan_Add")
} }
private fun showScanExpeditions(it:ItemScanList){ private fun showScanExpeditions(it:ItemScanList){
//Log.i("VERDNATURA:","VA A ESCANEAR EN PALLETFRAGMENT") //Log.i("VERDNATURA:","VA A ESCANEAR EN PALLETFRAGMENT")
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
listExpeditions = ArrayList() listExpeditions = ArrayList()
@ -197,7 +197,7 @@ class ExpeditionPalletFragment(
listExpeditions.add(BarcodeVO(code = it.expeditionFk)) listExpeditions.add(BarcodeVO(code = it.expeditionFk))
} }
customDialogList.setTitle("Expedition ("+toolbar_title.text+")").setOkButton("Comprobar"){ customDialogList.setTitle("Expedition ("+binding.mainToolbar.toolbarTitle.text+")").setOkButton("Comprobar"){
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) (activity as MainActivity).hideKeyboard(customDialogList.getEditText())
@ -215,7 +215,7 @@ class ExpeditionPalletFragment(
}.setKoButton("Cerrar"){ }.setKoButton("Cerrar"){
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) (activity as MainActivity).hideKeyboard(customDialogList.getEditText())
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List") viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
listExpeditions = ArrayList() listExpeditions = ArrayList()
customDialogList.dismiss() customDialogList.dismiss()

View File

@ -1,12 +1,13 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.app.Activity /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_expedition_scan.*
import kotlinx.android.synthetic.main.toolbar.**/
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.media.MediaPlayer import android.media.MediaPlayer
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
@ -14,7 +15,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentExpeditionScanBinding import es.verdnatura.databinding.FragmentExpeditionScanBinding
import es.verdnatura.domain.notNull import es.verdnatura.domain.notNull
import es.verdnatura.domain.toast
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.CustomDialog
@ -26,9 +26,6 @@ import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionScanAdapter import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionScanAdapter
import es.verdnatura.presentation.view.feature.paletizador.model.* import es.verdnatura.presentation.view.feature.paletizador.model.*
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_expedition_scan.*
import kotlinx.android.synthetic.main.toolbar.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
@ -82,10 +79,12 @@ class ExpeditionScanFragment (
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
customDialogTwoButtons = CustomDialogTwoButtons(requireContext()) customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
expedition_scan_detail_pallet.text = "Pallet "+itemPalletVO!!.Pallet binding.expeditionScanDetailPallet.text = "Pallet "+itemPalletVO!!.Pallet
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar() setToolBar()
setEvents() setEvents()
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet) viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
@ -93,7 +92,7 @@ class ExpeditionScanFragment (
} }
private fun setEvents(){ private fun setEvents(){
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
@ -105,10 +104,10 @@ class ExpeditionScanFragment (
val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme()) val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
listIcons.add(iconReload) listIcons.add(iconReload)
listIcons.add(iconPlus) listIcons.add(iconPlus)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){ if (item == iconReload){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet) viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
}else if(item == iconPlus){ }else if(item == iconPlus){
//Log.i("VERDNATURA:","ENTRAMOS A SCAN ADD") //Log.i("VERDNATURA:","ENTRAMOS A SCAN ADD")
@ -117,7 +116,7 @@ class ExpeditionScanFragment (
} }
} }
}) })
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun getCURDATE(date:String):String{ private fun getCURDATE(date:String):String{
@ -184,14 +183,14 @@ class ExpeditionScanFragment (
private fun printExpeditionList(it: ItemExpeditionScanList){ private fun printExpeditionList(it: ItemExpeditionScanList){
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionScanAdapter(it.list,object: OnScanLongClickListener{ adapter = ExpeditionScanAdapter(it.list,object: OnScanLongClickListener{
override fun onScanLongClickListener(itemExpeditionScanVO: ItemExpeditionScanVO) { override fun onScanLongClickListener(itemExpeditionScanVO: ItemExpeditionScanVO) {
customDialogTwoButtons.setTitle("Ticket: "+itemExpeditionScanVO.Ticket+" Pallet: "+itemPalletVO!!.Pallet) customDialogTwoButtons.setTitle("Ticket: "+itemExpeditionScanVO.Ticket+" Pallet: "+itemPalletVO!!.Pallet)
.setDescription("Expedition: "+itemExpeditionScanVO!!.expeditionFk) .setDescription("Expedition: "+itemExpeditionScanVO!!.expeditionFk)
.setOkButton("Borrar"){ .setOkButton("Borrar"){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanDel(user,password,itemExpeditionScanVO.id) viewModel.expeditionScanDel(user,password,itemExpeditionScanVO.id)
customDialogTwoButtons.dismiss() customDialogTwoButtons.dismiss()
}.setKoButton("Cancelar"){ }.setKoButton("Cancelar"){
@ -200,14 +199,14 @@ class ExpeditionScanFragment (
} }
}) })
expedition_pallet_recyclerview.adapter = adapter binding.expeditionPalletRecyclerview.adapter = adapter
expedition_pallet_recyclerview.layoutManager = lm binding.expeditionPalletRecyclerview.layoutManager = lm
} }
private fun expeditionScanAdd(){ private fun expeditionScanAdd(){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanAdd(usuario = user,password = password,vPalletFk = itemPalletVO!!.Pallet,vTruckFk = itemExpeditionTruckVO!!.truckFk) viewModel.expeditionScanAdd(usuario = user,password = password,vPalletFk = itemPalletVO!!.Pallet,vTruckFk = itemExpeditionTruckVO!!.truckFk)
//Log.i("VERDNATURA:","entramos a escanear ticket del pallet") //Log.i("VERDNATURA:","entramos a escanear ticket del pallet")
@ -217,13 +216,13 @@ class ExpeditionScanFragment (
//sergio para smarttags: //sergio para smarttags:
// Log.i("VERDNATURA:","muestra expediciones y a escanear") // Log.i("VERDNATURA:","muestra expediciones y a escanear")
listExpeditions = ArrayList() listExpeditions = ArrayList()
splash_progress.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 //sergio:Comprueba si el numero es mayor>0
customDialogList.setTitle("Pallet"+itemPalletVO!!.Pallet+" ("+toolbar_title.text+")").setOkButton("Comprobar"){ customDialogList.setTitle("Pallet"+itemPalletVO!!.Pallet+" ("+binding.mainToolbar.toolbarTitle.text+")").setOkButton("Comprobar"){
//Log.i("VERDNATURA:","Añadida etiqueta") //Log.i("VERDNATURA:","Añadida etiqueta")
(activity as MainActivity).hideKeyboard(customDialogList.getEditText()) (activity as MainActivity).hideKeyboard(customDialogList.getEditText())

View File

@ -2,6 +2,7 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Bundle 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.lifecycle.Observer
@ -15,16 +16,16 @@ import es.verdnatura.presentation.view.component.CustomDialogList
import es.verdnatura.presentation.view.feature.main.activity.MainActivity 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.adapter.SmartTagAdapter
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.component_custom_three_dialog.* import kotlinx.android.synthetic.main.component_custom_three_dialog.*
import kotlinx.android.synthetic.main.fragment_collection.* import kotlinx.android.synthetic.main.fragment_collection.*
import kotlinx.android.synthetic.main.fragment_controlador.* import kotlinx.android.synthetic.main.fragment_controlador.*
import kotlinx.android.synthetic.main.fragment_controlador.splash_progress import kotlinx.android.synthetic.main.fragment_controlador.binding.splashProgress
import kotlinx.android.synthetic.main.fragment_expedition_scan.* import kotlinx.android.synthetic.main.fragment_expedition_scan.*
import kotlinx.android.synthetic.main.fragment_login.* import kotlinx.android.synthetic.main.fragment_login.*
import kotlinx.android.synthetic.main.fragment_sacador.* import kotlinx.android.synthetic.main.fragment_sacador.*
import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.* import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
class ExpeditionScanSorterFragment( class ExpeditionScanSorterFragment(
var entryPoint: String = "" var entryPoint: String = ""
@ -52,8 +53,9 @@ class ExpeditionScanSorterFragment(
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
goBack = false goBack = false
requireActivity().main_bottom_navigation.visibility = GONE //requireActivity().main_bottom_navigation.visibility = GONE
splash_progress.visibility = GONE (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE
setEvents() setEvents()
setToolBar() setToolBar()
@ -68,13 +70,13 @@ class ExpeditionScanSorterFragment(
private fun setToolBar() { private fun setToolBar() {
toolbar_title.text = entryPoint binding.mainToolbar.toolbarTitle.text = entryPoint
} }
private fun expeditionscan(ExpeditionScan: String) { private fun expeditionscan(ExpeditionScan: String) {
splash_progress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.expedition_scan(user, password, ExpeditionScan,"expedition_scan") viewModel.expedition_scan(user, password, ExpeditionScan,"expedition_scan")
itemScaned = ExpeditionScan itemScaned = ExpeditionScan
@ -90,7 +92,7 @@ class ExpeditionScanSorterFragment(
private fun setEvents() { private fun setEvents() {
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
@ -101,7 +103,7 @@ class ExpeditionScanSorterFragment(
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
splash_progress.visibility = GONE binding.splashProgress.visibility = GONE
responsescan.observe(viewLifecycleOwner, Observer { responsescan.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
@ -118,7 +120,7 @@ class ExpeditionScanSorterFragment(
customDialogList.setValue("") customDialogList.setValue("")
} }
splash_progress.visibility = GONE binding.splashProgress.visibility = GONE
}) })
} }
@ -138,7 +140,7 @@ class ExpeditionScanSorterFragment(
} else {*/ } else {*/
customDialogList.dismiss() customDialogList.dismiss()
backButton.performClick() binding.mainToolbar.backButton.performClick()
// } // }

View File

@ -1,6 +1,15 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
/*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.buyers_fragment.*
import kotlinx.android.synthetic.main.fragment_item_card.*
import kotlinx.android.synthetic.main.fragment_item_card.binding.editItemFk
import kotlinx.android.synthetic.main.fragment_item_card.binding.itemcardImage
import kotlinx.android.synthetic.main.fragment_item_card. binding.itemcardLayout
import kotlinx.android.synthetic.main.fragment_item_card.binding.splashProgress
import kotlinx.android.synthetic.main.fragment_itemexpeditionstate_card.*
import kotlinx.android.synthetic.main.toolbar.**/
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.view.View import android.view.View
@ -17,16 +26,6 @@ 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
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.buyers_fragment.*
import kotlinx.android.synthetic.main.fragment_item_card.*
import kotlinx.android.synthetic.main.fragment_item_card.edit_itemFk
import kotlinx.android.synthetic.main.fragment_item_card.itemcard_image
import kotlinx.android.synthetic.main.fragment_item_card.itemcard_layout
import kotlinx.android.synthetic.main.fragment_item_card.splash_progress
import kotlinx.android.synthetic.main.fragment_itemexpeditionstate_card.*
import kotlinx.android.synthetic.main.toolbar.*
import timber.log.Timber.i
class ExpeditionStateFragment( class ExpeditionStateFragment(
var entryPoint: String = "" var entryPoint: String = ""
@ -50,7 +49,7 @@ class ExpeditionStateFragment(
override fun getLayoutId(): Int = R.layout.fragment_itemexpeditionstate_card override fun getLayoutId(): Int = R.layout.fragment_itemexpeditionstate_card
override fun init() { override fun init() {
itemcard_layout.visibility = View.GONE binding.itemcardLayout.visibility = View.GONE
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
setEvents() setEvents()
@ -60,30 +59,30 @@ class ExpeditionStateFragment(
private fun setToolBar(title: String) { private fun setToolBar(title: String) {
toolbar_title.text = title binding.mainToolbar.toolbarTitle.text = title
} }
private fun setEvents() { private fun setEvents() {
edit_itemFk.requestFocus() binding.editItemFk.requestFocus()
edit_itemFk.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 (!edit_itemFk.text.toString().isNullOrEmpty()) { if (!binding.editItemFk.text.toString().isNullOrEmpty()) {
getExpedtionState(edit_itemFk.text.toString()) getExpedtionState(binding.editItemFk.text.toString())
itemScan = edit_itemFk.text.toString() itemScan = binding.editItemFk.text.toString()
} }
edit_itemFk.setText("") binding.editItemFk.setText("")
(activity as MainActivity).hideKeyboard(edit_itemFk) (activity as MainActivity).hideKeyboard(binding.editItemFk)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
} }
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
itemcard_image.setOnClickListener { binding.itemcardImage.setOnClickListener {
val i: Intent = Intent(activity, ImageViewActivity::class.java) val i: Intent = Intent(activity, ImageViewActivity::class.java)
i.putExtra("url", urlLarge) i.putExtra("url", urlLarge)
i.putExtra("title", titleImage) i.putExtra("title", titleImage)
@ -98,7 +97,7 @@ class ExpeditionStateFragment(
password = prefs.getString(PASSWORD, "").toString() password = prefs.getString(PASSWORD, "").toString()
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString() warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
// this.itemFk = itemFk // this.itemFk = itemFk
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expedition_getStateJSON(expeditionFk, user, password,"expedition_getState") viewModel.expedition_getStateJSON(expeditionFk, user, password,"expedition_getState")
} }
@ -108,10 +107,10 @@ class ExpeditionStateFragment(
with(viewModel) { with(viewModel) {
// itemcard.observe(viewLifecycleOwner, Observer { // itemcard.observe(viewLifecycleOwner, Observer {
itemexpedition.observe(viewLifecycleOwner, Observer { itemexpedition.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
itemcard_layout.visibility = View.GONE binding.itemcardLayout.visibility = View.GONE
toolbar_title.text = "Estado de la expedición" binding.mainToolbar.toolbarTitle.text = "Estado de la expedición"
customDialog.setTitle("Error") customDialog.setTitle("Error")
.setDescription("No se ha podido obtener el estado de la expedición escaneada. ") .setDescription("No se ha podido obtener el estado de la expedición escaneada. ")
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
@ -120,14 +119,14 @@ class ExpeditionStateFragment(
} else { } else {
if (it != null) { if (it != null) {
itemcard_layout.visibility = View.VISIBLE binding.itemcardLayout.visibility = View.VISIBLE
setItemExpeditionState(it) setItemExpeditionState(it)
} else { } else {
itemcard_layout.visibility = View.GONE binding.itemcardLayout.visibility = View.GONE
toolbar_title.text = "Estado de la expedición" binding.mainToolbar.toolbarTitle.text = "Estado de la expedición"
customDialog.setTitle("Sin resultados") customDialog.setTitle("Sin resultados")
.setDescription("No hemos podido encontrar el estado de la expedición.") .setDescription("No hemos podido encontrar el estado de la expedición.")
.setOkButton("Cerrar") { .setOkButton("Cerrar") {
@ -163,8 +162,8 @@ class ExpeditionStateFragment(
} }
}) })
itemexpeditionstate_recyclerview.adapter = adapter binding.itemexpeditionstateRecyclerview.adapter = adapter
itemexpeditionstate_recyclerview.layoutManager = binding.itemexpeditionstateRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)

View File

@ -1,10 +1,11 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
/*import kotlinx.android.synthetic.main.fragment_expedition_truck_list.*
import kotlinx.android.synthetic.main.toolbar.**/
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
@ -15,15 +16,11 @@ import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnOptionsSelectedListener import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.OnTruckClickListener import es.verdnatura.presentation.common.OnTruckClickListener
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.view.component.CustomDialogHour import es.verdnatura.presentation.view.component.CustomDialogHour
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionListAdapter import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionListAdapter
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckList import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckList
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
import kotlinx.android.synthetic.main.fragment_expedition_truck_list.*
import kotlinx.android.synthetic.main.toolbar.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
@ -64,9 +61,9 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
override fun init() { override fun init() {
customDialogHor = CustomDialogHour(requireContext()) customDialogHor = CustomDialogHour(requireContext())
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
toolbar_title.text = "PScan: "+getCURDATE() binding.mainToolbar.toolbarTitle.text = "PScan: "+getCURDATE()
backButton.visibility = View.GONE binding.mainToolbar.backButton.visibility = View.GONE
setToolBar() setToolBar()
////Log.i("VERDNATURA:","1-cargamos expediciones") ////Log.i("VERDNATURA:","1-cargamos expediciones")
viewModel.expeditionTruckList(user,password,"expeditionTruck_List") viewModel.expeditionTruckList(user,password,"expeditionTruck_List")
@ -84,10 +81,10 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
listIcons.add(iconPlus) listIcons.add(iconPlus)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){ if (item == iconReload){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionTruckList(user,password,"expeditionTruck_List") viewModel.expeditionTruckList(user,password,"expeditionTruck_List")
}else if(item == iconPlus){ }else if(item == iconPlus){
addTruck() addTruck()
@ -97,7 +94,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
} }
} }
}) })
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun getCURDATE():String{ private fun getCURDATE():String{
@ -118,11 +115,11 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
} }
private fun printExpeditionList(it: ItemExpeditionTruckList){ private fun printExpeditionList(it: ItemExpeditionTruckList){
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionListAdapter(it.list,onTruckClickListener!!) adapter = ExpeditionListAdapter(it.list,onTruckClickListener!!)
expedition_truck_recyclerview.adapter = adapter binding.expeditionTruckRecyclerview.adapter = adapter
expedition_truck_recyclerview.layoutManager = lm binding.expeditionTruckRecyclerview.layoutManager = lm
////Log.i("VERDNATURA:","2-Rellenamos adapter") ////Log.i("VERDNATURA:","2-Rellenamos adapter")
} }
@ -131,7 +128,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
(activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText()) (activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText())
if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){ if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){
viewModel.expeditionTruckAdd(user,password,customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add") viewModel.expeditionTruckAdd(user,password,customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add")
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
customDialogHor.dismiss() customDialogHor.dismiss()
} }
(activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText()) (activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText())
@ -145,7 +142,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
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 (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){ if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){
viewModel.expeditionTruckAdd(user,password,customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add") viewModel.expeditionTruckAdd(user,password,customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add")
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
customDialogHor.dismiss() customDialogHor.dismiss()
} }

View File

@ -30,11 +30,11 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
*/ */
/* _pasillerositem.add( _pasillerositem.add(
PasillerosItemVO(7, PasillerosItemVO(7,
R.drawable.ic_streetview_black_24dp, R.drawable.ic_streetview_black_24dp,
"Pre Control",R.string.precontrolprevious) "Pre Control",R.string.precontrolprevious)
)*/ )
//sergio para que aparezca el nuevo menu //sergio para que aparezca el nuevo menu
@ -207,13 +207,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
) )
) )
_pasillerositem.add(
PasillerosItemVO(
45,
R.drawable.buffer_load,
"Cargar expedición en buffer", R.string.bufferload
)
)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
33, 33,
@ -258,6 +252,23 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
"Desactivado buffer", R.string.bufferoff "Desactivado buffer", R.string.bufferoff
) )
) )
_pasillerositem.add(
PasillerosItemVO(
31,
R.drawable.buffer_flejado,
"Flejado buffer", R.string.bufferfstrapping
)
)
_pasillerositem.add(
PasillerosItemVO(
45,
R.drawable.buffer_load,
"Cargar expedición en buffer", R.string.bufferload
)
)
} }
} }

View File

@ -32,12 +32,12 @@ import es.verdnatura.presentation.view.feature.presacador.adapter.PreSacadorAdap
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_pre_sacador.* import kotlinx.android.synthetic.main.fragment_pre_sacador.*
import kotlinx.android.synthetic.main.fragment_pre_sacador.fragment_sacador_collections import kotlinx.android.synthetic.main.fragment_pre_sacador.binding.fragmentSacadorCollections
import kotlinx.android.synthetic.main.fragment_pre_sacador.splash_progress import kotlinx.android.synthetic.main.fragment_pre_sacador.binding.splashProgress
import kotlinx.android.synthetic.main.fragment_sacador.* import kotlinx.android.synthetic.main.fragment_sacador.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorViewModel>(PreSacadorViewModel::class) { class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorViewModel>(PreSacadorViewModel::class) {
private var user = "" private var user = ""
@ -93,9 +93,9 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
toolbar_title.text = getString(R.string.getticketpre) binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
setToolBar() setToolBar()
setEvents() setEvents()
@ -104,34 +104,34 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
} }
private fun setEvents(){ private fun setEvents(){
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
//ESCANER ========= //ESCANER =========
hideKeyboards() hideKeyboards()
scan_input.requestFocus() binding.scanInput.requestFocus()
scan_input.setOnEditorActionListener { v, actionId, event -> binding.scanInput.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 (!scan_input.text.toString().isNullOrEmpty()){ if (!binding.scanInput.text.toString().isNullOrEmpty()){
if (scan_input.text.contains("-")){ if (binding.scanInput.text.contains("-")){
//es parking //es parking
parkingTicket(scan_input.text.toString()) parkingTicket(binding.scanInput.text.toString())
}else{ }else{
if (scan_input.text.length > 6){ if (binding.scanInput.text.length > 6){
//es ticket //es ticket
ticketFk = scan_input.text.toString() ticketFk = binding.scanInput.text.toString()
searchTicket(scan_input.text.toString()) searchTicket(binding.scanInput.text.toString())
}else{ }else{
//es sale //es sale
findSale(scan_input.text.toString()) findSale(binding.scanInput.text.toString())
} }
} }
} }
scan_input.setText("") binding.scanInput.setText("")
hideKeyboards() hideKeyboards()
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -141,22 +141,22 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
hideKeyboards() hideKeyboards()
//LISTA ========= //LISTA =========
collection_swipe.setOnRefreshListener { binding.collectionSwipe.setOnRefreshListener {
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
searchTicket(ticket) searchTicket(ticket)
collection_swipe.isRefreshing = false binding.collectionSwipe.isRefreshing = false
} }
} }
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel){ with(viewModel){
salesList.observe(viewLifecycleOwner, Observer { salesList.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
createSaleList(it) createSaleList(it)
}) })
placementSuppleyList.observe(viewLifecycleOwner, Observer { placementSuppleyList.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (!goBack) printShelvingResult(it) if (!goBack) printShelvingResult(it)
goBack = false goBack = false
}) })
@ -171,7 +171,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
}) })
responseCode.observe(viewLifecycleOwner, Observer { responseCode.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (!goBack2){ if (!goBack2){
if (it.isError){ if (it.isError){
customDialog.setTitle("Error").setDescription(it.errorMessage).setKoButton("Cerrar"){ customDialog.setTitle("Error").setDescription(it.errorMessage).setKoButton("Cerrar"){
@ -205,7 +205,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
private fun searchTicket(ticketFk:String){ private fun searchTicket(ticketFk:String){
Log.i(TAG,"Escaneamos ticket en previa") Log.i(TAG,"Escaneamos ticket en previa")
ticket = ticketFk ticket = ticketFk
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.ticketToPrePrepare( viewModel.ticketToPrePrepare(
usuario = user, usuario = user,
password = password, password = password,
@ -215,13 +215,13 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
} }
private fun createSaleList(salesList : List<PreSacadorItemVO>){ private fun createSaleList(salesList : List<PreSacadorItemVO>){
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (salesList.isNullOrEmpty()){ if (salesList.isNullOrEmpty()){
customDialog.setTitle("Pre Sacador").setDescription("No hemos podido obtener movimientos para el ticket escaneado").setKoButton("Cancelar"){ customDialog.setTitle("Pre Sacador").setDescription("No hemos podido obtener movimientos para el ticket escaneado").setKoButton("Cancelar"){
customDialog.dismiss() customDialog.dismiss()
}.show() }.show()
}else{ }else{
toolbar_title.text = ticket binding.mainToolbar.toolbarTitle.text = ticket
sales = ArrayList() sales = ArrayList()
salesList.forEach { salesList.forEach {
sales.add(it) sales.add(it)
@ -251,8 +251,8 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
} }
} }
}) })
fragment_sacador_collections.adapter = saleAdapter binding.fragmentSacadorCollections.adapter = saleAdapter
fragment_sacador_collections.layoutManager = lm binding.fragmentSacadorCollections.layoutManager = lm
setTotalLines() setTotalLines()
if (storedPosition != 0) if (storedPosition != 0)
@ -265,7 +265,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
} }
private fun setScrollListener(lm: LinearLayoutManager){ private fun setScrollListener(lm: LinearLayoutManager){
fragment_sacador_collections.addOnScrollListener(object : RecyclerView.OnScrollListener(){ binding.fragmentSacadorCollections.addOnScrollListener(object : RecyclerView.OnScrollListener(){
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
storedBackPosition = lm.findFirstVisibleItemPosition() storedBackPosition = lm.findFirstVisibleItemPosition()
super.onScrolled(recyclerView, dx, dy) super.onScrolled(recyclerView, dx, dy)
@ -279,8 +279,8 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
if (it.saldo == it.picked) if (it.saldo == it.picked)
totalMark += 1 totalMark += 1
} }
toolbar_title.text = ticket binding.mainToolbar.toolbarTitle.text = ticket
toolbar_subtitle.text = "" +totalMark + "/" + sales.size binding.mainToolbar.toolbarSubtitle.text = "" +totalMark + "/" + sales.size
if (totalMark == sales.size) { if (totalMark == sales.size) {
"Ticket completo".toast(this.context, Toast.LENGTH_SHORT) "Ticket completo".toast(this.context, Toast.LENGTH_SHORT)
} }
@ -289,7 +289,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
private fun setListPosition(position:Int){ private fun setListPosition(position:Int){
storedPosition = position storedPosition = position
fragment_sacador_collections.addViewObserver { binding.fragmentSacadorCollections.addViewObserver {
lm!!.scrollToPositionWithOffset(position,0) lm!!.scrollToPositionWithOffset(position,0)
} }
} }
@ -419,7 +419,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
private fun showShelving(position:Int,shelvingPosition:Int){ private fun showShelving(position:Int,shelvingPosition:Int){
storedShelvingPosition = shelvingPosition storedShelvingPosition = shelvingPosition
storedPosition = position storedPosition = position
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
var quantityGet = "0" var quantityGet = "0"
try{ try{
quantityGet = (sales[position].saldo - sales[position].picked).toString() quantityGet = (sales[position].saldo - sales[position].picked).toString()
@ -466,7 +466,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
customDialogList.dismiss() customDialogList.dismiss()
}else{ }else{
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode( viewModel.getIdFromCode(
usuario = user, usuario = user,
password = password, password = password,
@ -509,7 +509,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
customDialogList.dismiss() customDialogList.dismiss()
}else{ }else{
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode( viewModel.getIdFromCode(
usuario = user, usuario = user,
password = password, password = password,
@ -624,7 +624,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
//OTROS //OTROS
private fun setToolBar(){ private fun setToolBar(){
toolbar_subtitle.visibility = View.VISIBLE binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
val listIcons:ArrayList<Drawable> = ArrayList() val listIcons:ArrayList<Drawable> = ArrayList()
val iconPrint : Drawable = resources.getDrawable(R.drawable.ic_print_black_24dp,resources.newTheme()) val iconPrint : Drawable = resources.getDrawable(R.drawable.ic_print_black_24dp,resources.newTheme())
@ -639,7 +639,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
//listIcons.add(iconAdd) //listIcons.add(iconAdd)
//listIcons.add(iconTransferir) //listIcons.add(iconTransferir)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconPrint){ if (item == iconPrint){
print() print()
@ -648,12 +648,12 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
} }
} }
}) })
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun scanRequest(){ private fun scanRequest(){
if (scan_input != null) { if (binding.scanInput != null) {
scan_input.requestFocus() binding.scanInput.requestFocus()
} }
hideKeyboards() hideKeyboards()
} }

View File

@ -4,6 +4,7 @@ package es.verdnatura.presentation.view.feature.smarttag.register
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Bundle 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.activity.OnBackPressedCallback import androidx.activity.OnBackPressedCallback
@ -22,17 +23,16 @@ 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.adapter.SmartTagAdapter
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.SmartTagsViewModel import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.SmartTagsViewModel
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.component_custom_three_dialog.* import kotlinx.android.synthetic.main.component_custom_three_dialog.*
import kotlinx.android.synthetic.main.fragment_collection.* import kotlinx.android.synthetic.main.fragment_collection.*
import kotlinx.android.synthetic.main.fragment_controlador.* import kotlinx.android.synthetic.main.fragment_controlador.*
import kotlinx.android.synthetic.main.fragment_controlador.scan_input import kotlinx.android.synthetic.main.fragment_controlador.scan_input
import kotlinx.android.synthetic.main.fragment_controlador.splash_progress import kotlinx.android.synthetic.main.fragment_controlador.binding.splashProgress
import kotlinx.android.synthetic.main.fragment_expedition_scan.* import kotlinx.android.synthetic.main.fragment_expedition_scan.*
import kotlinx.android.synthetic.main.fragment_login.* import kotlinx.android.synthetic.main.fragment_login.*
import kotlinx.android.synthetic.main.fragment_sacador.* import kotlinx.android.synthetic.main.fragment_sacador.**/
//import kotlinx.android.synthetic.main.toolbar.*
import kotlinx.android.synthetic.main.toolbar.*
class RegisterSmartTagsFragment( class RegisterSmartTagsFragment(
var entryPoint: String = "" var entryPoint: String = ""
@ -91,8 +91,9 @@ class RegisterSmartTagsFragment(
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
goBack = false goBack = false
requireActivity().main_bottom_navigation.visibility = GONE //requireActivity().main_bottom_navigation.visibility = GONE
splash_progress.visibility = GONE (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE
setEvents() setEvents()
setToolBar() setToolBar()
@ -109,7 +110,7 @@ class RegisterSmartTagsFragment(
private fun setToolBar() { private fun setToolBar() {
// toolbar_title.text = getString(R.string.SmarttagAssociate) // toolbar_title.text = getString(R.string.SmarttagAssociate)
toolbar_title.text = entryPoint binding.mainToolbar.toolbarTitle.text = entryPoint
// Log.i("VERDNATURA:", "el entrypoint es ${entryPoint}") // Log.i("VERDNATURA:", "el entrypoint es ${entryPoint}")
} }
@ -117,7 +118,7 @@ class RegisterSmartTagsFragment(
private fun bindShelving_add(shelvingOrSmarttag: String) { private fun bindShelving_add(shelvingOrSmarttag: String) {
splash_progress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
//poner el bindshelving aqui //poner el bindshelving aqui
viewModel.workerShelving_add(user, password, shelvingOrSmarttag) viewModel.workerShelving_add(user, password, shelvingOrSmarttag)
@ -134,7 +135,7 @@ class RegisterSmartTagsFragment(
private fun bindShelving_remove() { private fun bindShelving_remove() {
// splash_progress.visibility = VISIBLE // binding.splashProgress.visibility = VISIBLE
//ponser el unbindshleving aqui //ponser el unbindshleving aqui
//sergio:esto se debe hacer en //sergio:esto se debe hacer en
@ -149,8 +150,8 @@ class RegisterSmartTagsFragment(
} }
private fun scanRequest() { private fun scanRequest() {
if (scan_input != null) { if (binding.scanInput != null) {
scan_input.requestFocus() binding.scanInput.requestFocus()
} }
hideKeyboards() hideKeyboards()
} }
@ -178,7 +179,7 @@ class RegisterSmartTagsFragment(
private fun setEvents() { private fun setEvents() {
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
// Log.i("VERDNATURA:","PULSADO") // Log.i("VERDNATURA:","PULSADO")
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
@ -190,7 +191,7 @@ class RegisterSmartTagsFragment(
with(viewModel) { with(viewModel) {
splash_progress.visibility = GONE binding.splashProgress.visibility = GONE
responseadd.observe(viewLifecycleOwner, Observer { responseadd.observe(viewLifecycleOwner, Observer {
// Log.i("VERDNATURA", "Revisar llamada de las etiquetas smarttags : ${it.response}") // Log.i("VERDNATURA", "Revisar llamada de las etiquetas smarttags : ${it.response}")
@ -217,7 +218,7 @@ class RegisterSmartTagsFragment(
customDialogList.setValue("") customDialogList.setValue("")
} }
splash_progress.visibility = GONE binding.splashProgress.visibility = GONE
}) })
} }

View File

@ -4,6 +4,7 @@ import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.View
import android.view.View.* import android.view.View.*
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.activity.OnBackPressedCallback import androidx.activity.OnBackPressedCallback
@ -24,17 +25,17 @@ 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.adapter.SmartTagAdapter
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.component_custom_three_dialog.* import kotlinx.android.synthetic.main.component_custom_three_dialog.*
import kotlinx.android.synthetic.main.fragment_collection.* import kotlinx.android.synthetic.main.fragment_collection.*
import kotlinx.android.synthetic.main.fragment_controlador.* import kotlinx.android.synthetic.main.fragment_controlador.*
import kotlinx.android.synthetic.main.fragment_controlador.scan_input import kotlinx.android.synthetic.main.fragment_controlador.scan_input
import kotlinx.android.synthetic.main.fragment_controlador.splash_progress import kotlinx.android.synthetic.main.fragment_controlador.binding.splashProgress
import kotlinx.android.synthetic.main.fragment_expedition_scan.* import kotlinx.android.synthetic.main.fragment_expedition_scan.*
import kotlinx.android.synthetic.main.fragment_login.* import kotlinx.android.synthetic.main.fragment_login.*
import kotlinx.android.synthetic.main.fragment_sacador.* import kotlinx.android.synthetic.main.fragment_sacador.*
import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.* import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
import timber.log.Timber import timber.log.Timber
class AssociateSmartTagsFragment( class AssociateSmartTagsFragment(
@ -90,8 +91,9 @@ class AssociateSmartTagsFragment(
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
goBack = false goBack = false
requireActivity().main_bottom_navigation.visibility = GONE //requireActivity().main_bottom_navigation.visibility = GONE
splash_progress.visibility = GONE (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE
setEvents() setEvents()
setToolBar() setToolBar()
@ -108,14 +110,14 @@ class AssociateSmartTagsFragment(
private fun setToolBar() { private fun setToolBar() {
// toolbar_title.text = getString(R.string.SmarttagAssociate) // toolbar_title.text = getString(R.string.SmarttagAssociate)
toolbar_title.text = entryPoint binding.mainToolbar.toolbarTitle.text = entryPoint
Timber.i("VERDNATURA:el entrypoint es ${entryPoint}") Timber.i("VERDNATURA:el entrypoint es ${entryPoint}")
} }
private fun bindShelving_add(shelvingOrSmarttag: String) { private fun bindShelving_add(shelvingOrSmarttag: String) {
splash_progress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
//poner el bindshelving aqui //poner el bindshelving aqui
viewModel.workerShelving_add(user, password, shelvingOrSmarttag) viewModel.workerShelving_add(user, password, shelvingOrSmarttag)
@ -132,7 +134,7 @@ class AssociateSmartTagsFragment(
private fun bindShelving_remove() { private fun bindShelving_remove() {
// splash_progress.visibility = VISIBLE // binding.splashProgress.visibility = VISIBLE
//ponser el unbindshleving aqui //ponser el unbindshleving aqui
//sergio:esto se debe hacer en //sergio:esto se debe hacer en
@ -145,8 +147,8 @@ class AssociateSmartTagsFragment(
} }
private fun scanRequest() { private fun scanRequest() {
if (scan_input != null) { if (binding.scanInput != null) {
scan_input.requestFocus() binding.scanInput.requestFocus()
} }
hideKeyboards() hideKeyboards()
} }
@ -171,7 +173,7 @@ class AssociateSmartTagsFragment(
private fun setEvents() { private fun setEvents() {
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
Log.i("VERDNATURA:", "PULSADO") Log.i("VERDNATURA:", "PULSADO")
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
@ -181,7 +183,7 @@ class AssociateSmartTagsFragment(
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
splash_progress.visibility = GONE binding.splashProgress.visibility = GONE
responseadd.observe(viewLifecycleOwner, Observer { responseadd.observe(viewLifecycleOwner, Observer {
// Log.i("VERDNATURA::", "Revisar llamada de las etiquetas smarttags : ${it.response}") // Log.i("VERDNATURA::", "Revisar llamada de las etiquetas smarttags : ${it.response}")
@ -216,7 +218,7 @@ class AssociateSmartTagsFragment(
// } // }
} }
splash_progress.visibility = GONE binding.splashProgress.visibility = GONE
}) })
responseremove.observe(viewLifecycleOwner, Observer { responseremove.observe(viewLifecycleOwner, Observer {
@ -249,7 +251,7 @@ class AssociateSmartTagsFragment(
} }
} }
splash_progress.visibility = GONE binding.splashProgress.visibility = GONE
}) })
} }

View File

@ -15,9 +15,9 @@ import es.verdnatura.presentation.view.component.CustomDialogUbicador
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapter import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapter
import es.verdnatura.presentation.view.feature.ubicador.model.ItemEscanerVO import es.verdnatura.presentation.view.feature.ubicador.model.ItemEscanerVO
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_automatic_add_item.* import kotlinx.android.synthetic.main.fragment_automatic_add_item.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
class AutomaticAddItemFragment( class AutomaticAddItemFragment(
var shelvingFk : String = "" var shelvingFk : String = ""
@ -51,8 +51,9 @@ class AutomaticAddItemFragment(
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogUbicador = CustomDialogUbicador(requireContext()) customDialogUbicador = CustomDialogUbicador(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE // requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = "itemShelvingMake" (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = "itemShelvingMake"
setEvents() setEvents()
setViews() setViews()
setToolBar() setToolBar()
@ -60,11 +61,11 @@ class AutomaticAddItemFragment(
} }
private fun setToolBar(){ private fun setToolBar(){
toolbar_subtitle.visibility = View.VISIBLE binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
} }
private fun setSubtitle(){ private fun setSubtitle(){
toolbar_subtitle.text = "Etiquetas: "+contador binding.mainToolbar.toolbarSubtitle.text = "Etiquetas: "+contador
} }
private fun setViews(){ private fun setViews(){
@ -79,39 +80,39 @@ class AutomaticAddItemFragment(
adapter!!.notifyDataSetChanged() adapter!!.notifyDataSetChanged()
} }
}) })
items_recyclerview.adapter = adapter binding.itemsRecyclerview.adapter = adapter
items_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) binding.itemsRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
} }
private fun setEvents(){ private fun setEvents(){
edit_matricula.requestFocus() binding.editMatricula.requestFocus()
edit_matricula.setOnEditorActionListener { v, actionId, event -> binding.editMatricula.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 (!edit_matricula.text.toString().isNullOrEmpty()){ if (!binding.editMatricula.text.toString().isNullOrEmpty()){
contador += 1 contador += 1
setSubtitle() setSubtitle()
listItems.add(0,ItemEscanerVO(edit_matricula.text.toString())) listItems.add(0,ItemEscanerVO(binding.editMatricula.text.toString()))
adapter!!.notifyDataSetChanged() adapter!!.notifyDataSetChanged()
} }
edit_matricula.setText("") binding.editMatricula.setText("")
(activity as MainActivity).hideKeyboard(edit_matricula) (activity as MainActivity).hideKeyboard(binding.editMatricula)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
return@setOnEditorActionListener false return@setOnEditorActionListener false
} }
button_finalizar.setOnClickListener { binding.buttonFinalizar.setOnClickListener {
val listString:ArrayList<String> = ArrayList() val listString:ArrayList<String> = ArrayList()
listItems.forEach { listItems.forEach {
listString.add(it.item) listString.add(it.item)
} }
listItems = ArrayList() listItems = ArrayList()
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingMake_multi(user,password,shelvingFk,listString,deep.toString(),warehouseFk,"1") viewModel.itemShelvingMake_multi(user,password,shelvingFk,listString,deep.toString(),warehouseFk,"1")
} }
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
} }
@ -119,7 +120,7 @@ class AutomaticAddItemFragment(
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel){ with(viewModel){
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError){ if (it.isError){
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){ customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss() customDialog.dismiss()

View File

@ -0,0 +1,8 @@
<!-- drawable/table_pivot.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="#F7931E" android:pathData="M22 15H20V18C20 19.11 19.11 20 18 20H15V22L12 19L15 16V18H18V15H16L19 12L22 15M22 4V8C22 9.1 21.1 10 20 10H10V20C10 21.1 9.1 22 8 22H4C2.9 22 2 21.1 2 20V4C2 2.9 2.9 2 4 2H20C21.1 2 22 2.9 22 4M4 8H8V4H4V8M4 10V14H8V10H4M8 20V16H4V20L8 20M14 8V4H10V8H14M20 4L20 4H16V8H20L20 4Z" />
</vector>

View File

@ -6,7 +6,7 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path android:pathData="M21 11.11V5C21 3.9 20.11 3 19 3H14.82C14.4 1.84 13.3 1 12 1S9.6 1.84 9.18 3H5C3.9 3 3 3.9 3 5V19C3 20.11 3.9 21 5 21H11.11C12.37 22.24 14.09 23 16 23C19.87 23 23 19.87 23 16C23 14.09 22.24 12.37 21 11.11M12 3C12.55 3 13 3.45 13 4S12.55 5 12 5 11 4.55 11 4 11.45 3 12 3M6 7H18V9H6V7M9.08 17H6V15H9.08" android:fillColor="#000"/> <path android:pathData="M21 11.11V5C21 3.9 20.11 3 19 3H14.82C14.4 1.84 13.3 1 12 1S9.6 1.84 9.18 3H5C3.9 3 3 3.9 3 5V19C3 20.11 3.9 21 5 21H11.11C12.37 22.24 14.09 23 16 23C19.87 23 23 19.87 23 16C23 14.09 22.24 12.37 21 11.11M12 3C12.55 3 13 3.45 13 4S12.55 5 12 5 11 4.55 11 4 11.45 3 12 3M6 7H18V9H6V7M9.08 17H6V15H9.08C9.03 15.33 9 15.66 9 16S9.03 16.67 9.08 17M6 13V11H11.11C10.5 11.57 10.04 12.25 9.68 13H6M16 21C13.24 21 11 18.76 11 16S13.24 11 16 11 21 13.24 21 16 18.76 21 16 21M16.5 16.25L19.36 17.94L18.61 19.16L15 17V12H16.5V16.25Z" android:fillColor="#000"/>

View File

@ -3,12 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -89,7 +84,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clipToPadding="false" android:clipToPadding="false"
tools:listitem="@layout/item_location_all_row"/> />
</LinearLayout> </LinearLayout>

View File

@ -52,7 +52,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
tools:listitem="@layout/item_article_row" /> tools:listitem="@layout/item_article_row" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout <LinearLayout
android:id="@+id/splash_progress" android:id="@+id/splash_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -70,7 +70,7 @@
app:lottie_rawRes="@raw/orange_loading" app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" /> app:lottie_speed="2" />
</LinearLayout> </LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<include <include

View File

@ -218,7 +218,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height" android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true" app:lottie_autoPlay="true"
app:lottie_loop="true" app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading" app:lottie_rawRes="@raw/orange_loading"
@ -226,6 +225,28 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/splash_progress_two"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -3,12 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="es.verdnatura.presentation.view.feature.articulo.model.ItemProposal" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -193,7 +193,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height" android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true" app:lottie_autoPlay="true"
app:lottie_loop="true" app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading" app:lottie_rawRes="@raw/orange_loading"
@ -201,6 +200,7 @@
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tool="http://schemas.android.com/tools">
<data>
<variable
name="item"
type="es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
style="@style/LayoutClickable">
<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:paddingLeft="@dimen/layout_margin_min"
android:paddingRight="@dimen/layout_margin_min"
android:paddingTop="@dimen/pasilleros_margin_main_menu"
android:paddingBottom="@dimen/pasilleros_margin_main_menu">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.parking}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.matricula}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.visible}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.created}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/verdnatura_black_9"/>
</LinearLayout>
</layout>

View File

@ -154,4 +154,6 @@
<string name="itemShelvingLog">Historico de ítems del carro</string> <string name="itemShelvingLog">Historico de ítems del carro</string>
<string name="shelvingLog">Histórico del carro</string> <string name="shelvingLog">Histórico del carro</string>
<string name="bufferload">Cargar expedición en buffer</string> <string name="bufferload">Cargar expedición en buffer</string>
<string name="bufferfstrapping">Flejado buffer</string>
<string name="Split">Split</string>
</resources> </resources>

View File

@ -152,5 +152,7 @@
<string name="itemShelvingLog">Item Log</string> <string name="itemShelvingLog">Item Log</string>
<string name="shelvingLog">Shelving Log</string> <string name="shelvingLog">Shelving Log</string>
<string name="bufferload">Load buffer</string> <string name="bufferload">Load buffer</string>
<string name="bufferfstrapping">Buffer strapping</string>
<string name="Split">Split</string>
</resources> </resources>