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_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_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_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/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/component_progress.xml" value="0.11979166666666667" />
<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_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_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_controlador.xml" value="0.20153985507246377" />
<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_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_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_shelvinglog.xml" value="0.13269927536231885" />
<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_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/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_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_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_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_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" />

View File

@ -1,6 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'//deprecated:sergio
//apply plugin: 'kotlin-android-extensions'//deprecated:sergio
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
@ -14,8 +14,9 @@ android {
applicationId "es.verdnatura"
minSdkVersion 21
targetSdkVersion 29
versionCode 83
versionName "6.3" //VERSION CODE 83 Nueva funcionalidad Cargar expedición en buffer
versionCode 84
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" //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.

View File

@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 83,
"versionName": "6.3",
"versionCode": 84,
"versionName": "6.4",
"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.buffer.fragment.BufferFragmentViewModel
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.QaualityViewModel
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
@ -65,9 +64,6 @@ val viewModelModule = module {
}
// Pasilleros / Buscar Item 2
viewModel {
BuscarItemAllViewModel(androidContext())
}
viewModel {
PreControladorViewModel(androidContext())

View File

@ -1,12 +1,12 @@
package es.verdnatura.domain
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
class GetBuscarItemAllUserCase(context: Context) : RestClient(context) {
fun searchItemsUbicadorAll(
/* fun searchItemsUbicadorAll(
usuario: String,
password: String,
itemFk: String
@ -21,6 +21,6 @@ class GetBuscarItemAllUserCase(context: Context) : RestClient(context) {
"application/json",
params = params
)
}
}*/
}

View File

@ -88,13 +88,13 @@ class GetLoginUserCase(context: Context) : RestClient(context)
//SALIX MENSAJE :SERGIO: PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO.
*/
fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message))
}
// SERGIO: PARA DESARROLLO Y PRUEBAS SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA
/* fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>
/* fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>
{
return salixClient!!.sendGroup(
content_type = "application/json",

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.ItemProposal
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.ItemBuyerVO
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
@ -526,7 +526,7 @@ interface VerdnaturaService {
Call<List<ItemLocationVO>>
// BUSCAR ITEM ALL
@POST("almacennew/getItemUbication")//REVISADA
/* @POST("almacennew/getItemUbication")//REVISADA
fun searchItemsUbicadorAll(
@Header("aplicacion") aplicacion: String,
@Header("version") version: String,
@ -535,7 +535,7 @@ interface VerdnaturaService {
@Header("Content-Type") content_type: String,
@Body params: List<String>
):
Call<List<ItemLocationAll>>
Call<List<ItemLocationAll>>*/
//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.content.Context
import android.view.View
import android.widget.TextView
import es.verdnatura.R
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 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) {
@ -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
// con el viewbinding del customDialog
setContentView(R.layout.component_custom_dialog)
/* setContentView(R.layout.component_custom_dialog)
/* binding = ComponentCustomDialogBinding.inflate(layoutInflater)
setContentView(binding.root)*/
custom_dialog_title = findViewById(R.id.custom_dialog_title)
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 {
custom_dialog_title.visibility = View.VISIBLE
custom_dialog_title.text = title
/* binding.customDialogTitle.visibility = View.VISIBLE
binding.customDialogTitle.text = title*/
/* custom_dialog_title.visibility = View.VISIBLE
custom_dialog_title.text = title*/
binding.customDialogTitle.visibility = View.VISIBLE
binding.customDialogTitle.text = title
return this
}
fun setDescription(description: String): CustomDialogMainActivity {
custom_dialog_description.visibility = View.VISIBLE
/* custom_dialog_description.visibility = View.VISIBLE
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
}
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity {
custom_dialog_button_ok.visibility = View.VISIBLE
custom_dialog_button_ok.text = text
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
/* binding.customDialogButtonOk.visibility = View.VISIBLE
binding.customDialogButtonOk.text = text
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }*/
/* custom_dialog_button_ok.visibility = View.VISIBLE
custom_dialog_button_ok.text = text
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
binding.customDialogButtonOk.visibility = View.VISIBLE
binding.customDialogButtonOk.text = text
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
return this
}
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity {
custom_dialog_button_ko.visibility = View.VISIBLE
custom_dialog_button_ko.text = text
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
/* binding.customDialogButtonKo.visibility = View.VISIBLE
binding.customDialogButtonKo.text = text
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }*/
/* custom_dialog_button_ko.visibility = View.VISIBLE
custom_dialog_button_ko.text = text
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
binding.customDialogButtonKo.visibility = View.VISIBLE
binding.customDialogButtonKo.text = text
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
return this
}

View File

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

View File

@ -11,7 +11,9 @@ import android.app.AlertDialog
import android.content.Intent
import android.content.SharedPreferences
import android.graphics.drawable.Drawable
import android.util.Log
import android.view.View
import android.view.View.GONE
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
@ -143,13 +145,11 @@ class ItemCardFragment(
false
}
//backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
//itemcard_image.setOnClickListener {
binding.itemcardImage.setOnClickListener{
val i = Intent(activity,ImageViewActivity::class.java)
@ -165,9 +165,12 @@ class ItemCardFragment(
password = prefs.getString(PASSWORD,"").toString()
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
this.itemFk = itemFk
binding.splashProgress.visibility = View.VISIBLE
binding.splashProgressTwo.visibility = View.VISIBLE
viewModel.getItemCard(itemFk,warehouseFk,user,password,"item_card")
binding.splashProgress.visibility = View.VISIBLE
viewModel.getItemPackingType(user,password,"get_ItemPackingType")
}
override fun observeViewModel() {
@ -175,7 +178,8 @@ class ItemCardFragment(
itemcard.observe(viewLifecycleOwner, Observer {
if (it.isError){
binding.itemcardLayout.visibility = View.GONE
binding.itemcardLayout.visibility = GONE
binding.splashProgressTwo.visibility=GONE
binding.mainToolbar.toolbarTitle.text = "ItemCard"
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.dismiss()
@ -185,6 +189,7 @@ class ItemCardFragment(
binding.itemcardLayout.visibility = View.VISIBLE
setItemCard(it)
}else{
binding.splashProgressTwo.visibility=GONE
binding.itemcardLayout.visibility = View.GONE
binding.mainToolbar.toolbarTitle.text = "ItemCard"
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 {
binding.splashProgress.visibility = View.GONE
// //Log.i("VERDNATURA:","el code es $it.code")
// //Log.i("VERDNATURA:","la descrip es $it.description")
binding.splashProgress.visibility = GONE
createItemTypeTypeList(it.list)
})
@ -385,7 +388,7 @@ class ItemCardFragment(
binding.scrollView.scrollTo(0, position[1])
}
}
binding.splashProgress.visibility = View.GONE
binding.splashProgressTwo.visibility=GONE
}
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.SharedPreferences
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.view.Gravity
import android.view.View
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.appcompat.widget.TooltipCompat
import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat.getColor
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentInventaryBinding
import es.verdnatura.databinding.FragmentItemproposalBinding
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnItemProposalClickListener
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.model.ItemProposal
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchBuyerModel
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_buscar_item.*
import kotlinx.android.synthetic.main.toolbar.*
import kotlinx.android.synthetic.main.toolbar.**/
import java.text.SimpleDateFormat
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*
import kotlin.collections.ArrayList
class ItemProposalFragment(
var itemFk: String = ""
) : BaseFragment<FragmentInventaryBinding, ItemCardViewModel>(
) : BaseFragment<FragmentItemproposalBinding, ItemCardViewModel>(
ItemCardViewModel::class
) {
@ -106,9 +100,10 @@ class ItemProposalFragment(
customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE
splash_progress.visibility = View.VISIBLE
toolbar_title.text = getString(R.string.ArticleSimilar) + ":" + itemFk
//requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.ArticleSimilar) + ":" + itemFk
setToolBar()
setEvents()
@ -125,10 +120,10 @@ class ItemProposalFragment(
listIcons.add(iconFilter)
toolbar_icons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload) {
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
viewModel.item_getSimilar(
itemFk,
@ -142,7 +137,7 @@ class ItemProposalFragment(
}
if (item == iconFilter) {
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
@ -179,7 +174,7 @@ class ItemProposalFragment(
}
})
toolbar_icons.layoutManager =
binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
@ -194,7 +189,7 @@ class ItemProposalFragment(
mytoast.show()
}
private fun setEvents() {
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
@ -207,9 +202,9 @@ class ItemProposalFragment(
override fun onResume() {
super.onResume()
if (location_recyclerview.layoutManager != null) {
if (binding.locationRecyclerview.layoutManager != null) {
if (firstVisiblePosition <= listInvetory.size) {
location_recyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
binding.locationRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
}
}
}
@ -219,7 +214,7 @@ class ItemProposalFragment(
itemProposallist.observe(viewLifecycleOwner, Observer {
if (hideLoad) {
splash_progress.visibility = View.GONE
binding.splashProgress.visibility = View.GONE
} else {
hideLoad = true
}
@ -249,13 +244,13 @@ class ItemProposalFragment(
}
}, onPasillerosItemClickListener = pasillerosItemClickListener!!)
location_recyclerview.adapter = adapter
binding.locationRecyclerview.adapter = adapter
layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
location_recyclerview.layoutManager = layoutManager
binding.locationRecyclerview.layoutManager = layoutManager
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()) {
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")
}
if (entryPoint.equals("Llenado buffer")){
@ -89,7 +107,8 @@ class BufferFragment(
}
if (entryPoint.equals("Desactivado buffer")){
viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"DISABLED","buffer_setTypeByName")
}
}*/
}
binding.scanInput.setText("")
@ -106,18 +125,14 @@ class BufferFragment(
itembuffertype.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
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")
.setOkButton("Aceptar") {
customDialog.dismiss()
binding.mainToolbar.backButton.performClick()
}.show()
(activity as MainActivity).messageWithSound(
it.errorMessage,false)
} else {
(activity as MainActivity).messageWithSound("Operación "+entryPoint.lowercase() + " buffer realizada correctamente",true)
binding.mainToolbar.backButton.performClick()
}

View File

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

View File

@ -8,6 +8,8 @@ import android.os.Bundle
import android.speech.SpeechRecognizer
import android.util.Log
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
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.toolbar.**/
import timber.log.Timber
import timber.log.Timber.d
class CollectionFragment(
var collection: CollectionVO = CollectionVO(),
@ -75,6 +78,8 @@ class CollectionFragment(
private var storedBackPosition: Int = 0
private var tickets: ArrayList<String> = ArrayList()
private var mistakeSale: SaleVO? = null
private var positionIncreaseQuantity=0
private var quantityIncrease=""
//private var myKM: KeyguardManager? = null
@ -142,9 +147,7 @@ class CollectionFragment(
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
//requireActivity().main_bottom_navigation.visibility = 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()
@ -176,12 +179,15 @@ class CollectionFragment(
private fun setToolBar() {
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
if (!collection.collectionFk.isNullOrEmpty()){
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
}
val listIcons: ArrayList<Drawable> = ArrayList()
val iconPrint: Drawable =
resources.getDrawable(R.drawable.ic_print_black_24dp, resources.newTheme())
val iconSearch: Drawable =
resources.getDrawable(R.drawable.ic_visibility, resources.newTheme())
/*val iconSearch: Drawable =
resources.getDrawable(R.drawable.ic_visibility, resources.newTheme())*/
val iconAdd: Drawable =
resources.getDrawable(R.drawable.ic_playlist_add_black_24dp, resources.newTheme())
val iconFace: Drawable =
@ -190,7 +196,6 @@ class CollectionFragment(
listIcons.add(iconFace)
listIcons.add(iconPrint)
// listIcons.add(iconSearch)
listIcons.add(iconAdd)
@ -243,7 +248,7 @@ class CollectionFragment(
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 (!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())
@ -263,7 +268,7 @@ class CollectionFragment(
binding.collectionSwipe.isRefreshing = false
if (type != PRECHECKER) {
if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
if (binding.splashProgress != null) binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet(
user,
password,
@ -285,9 +290,9 @@ class CollectionFragment(
override fun observeViewModel() {
with(viewModel) {
binding.splashProgress.visibility=GONE
collectionTicketList.observe(viewLifecycleOwner, Observer {
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!it.isError) {
if (it.tickets.isNotEmpty()) {
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
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 {
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!goBack) showMistakeList(it.list)
@ -1460,53 +1496,78 @@ class CollectionFragment(
// //Log.i("VERDNATURA:","Aparece CustomDialog")
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("")
.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())
} else {
trash(position, customDialogThreeButtons.getValue())
scanRequest()
customDialogThreeButtons.dismiss()
}
}*/
}.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())
} else {
missing(position, customDialogThreeButtons.getValue())
scanRequest()
customDialogThreeButtons.dismiss()
}
}*/
}.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())
} else {
reject(position, customDialogThreeButtons.getValue())
scanRequest()
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())
} else {
split(position, customDialogThreeButtons.getValue())
scanRequest()
customDialogThreeButtons.dismiss()
}
}*/
}.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())
} else {
increaseQuantity(position, customDialogThreeButtons.getValue())
scanRequest()
customDialogThreeButtons.dismiss()
}
}*/
}.setKoButton("Cancelar") {
scanRequest()
customDialogThreeButtons.dismiss()
}.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) {
var totalQuantity: Int = 0
try {
@ -1647,35 +1708,42 @@ class CollectionFragment(
message = message,"sendChekingPresence"
)
}
private fun increaseQuantity(position: Int, quantity: String) {
viewModel.collectionIncreaseQuantity(
usuario = user,
password = password,
saleFk = sales[position].saleFk,
quantity = quantity,"collection_increaseQuantity"
)
private fun incresaseSuccesful(){
try {
//val quantityPicked = (quantity.toInt() - sales[position].quantity.toInt()).toString()
//sales[position].originalQuantity = quantity
sales[position].quantity = quantity
sales[positionIncreaseQuantity].quantity = quantityIncrease
/*if (type == CONTROLADOR){
showShelving(position,0,quantityPicked)
}*/
} catch (e: Exception) {
}
saleAdapter?.notifyDataSetChanged()
//enviar mensaje a salix
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 =
"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(
token = token,
workerId = sales[position].salePersonFk,
workerId = sales[positionIncreaseQuantity].salePersonFk,
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

View File

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

View File

@ -6,30 +6,43 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import java.text.SimpleDateFormat
import java.util.*
fun CollectionVO.map() : CollectionVO{
fun CollectionVO.map(): CollectionVO {
try {
this.tickets.forEach {
ticket -> ticket.sales.forEach {
this.tickets.forEach { ticket ->
ticket.sales.forEach {
it.ticketFk = ticket.ticketFk
it.level = ticket.level
it.salePersonFk = ticket.salesPersonFk
it.agencyName = ticket.agencyName
it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))
it.isNew = it.isAdded == "1"
// Log.d("VERDNATURA:","ORIGINAL QUANT"+it.originalQuantity)
it.originalQuantity =
if (it.originalQuantity != "-1") it.originalQuantity.substring(
0,
it.originalQuantity.indexOf(".")
) else it.quantity
it.isNew = it.isAdded == "1"
// 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(
0,
it.originalQuantity.indexOf(".")
) else it.quantity*/
// it.originalQuantity=it.originalQuantity.toInt().toString()
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()) {
it.placements.forEachIndexed { index, placement ->
if (index == 0) {
try {
@ -40,7 +53,8 @@ fun CollectionVO.map() : CollectionVO{
}
placement.created =
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 {
it.placements = listOf()
@ -48,20 +62,21 @@ fun CollectionVO.map() : CollectionVO{
}
}
}catch (e:Exception){
} catch (e: Exception) {
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"
}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
}
private fun getCalendarFromDate(date:String): Calendar {
private fun getCalendarFromDate(date: String): Calendar {
val sdf = SimpleDateFormat("yyyy-MM-dd")
val cal = Calendar.getInstance()
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.feature.main.activity.MainActivity
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.*
@ -79,7 +81,8 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
binding.scanInput.requestFocus()
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
if (!binding.scanInput.text.isNullOrEmpty()) {
binding.splashProgress.visibility = View.VISIBLE

View File

@ -5,12 +5,10 @@ import android.os.Bundle
import android.view.View.*
import androidx.lifecycle.Observer
import es.verdnatura.R
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.loadUrl
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_vehiclecontrol_user.*

View File

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

View File

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

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.main.activity.MainActivity
import java.lang.Boolean.TRUE
import kotlin.system.exitProcess
class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
@ -44,18 +45,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
checkUser()
binding.buttonLogin.setOnClickListener(View.OnClickListener {
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.edittextPassword.text.toString(),
getANDROIDID(),callFunction = "device_checkLogin"
)
getANDROIDID(), callFunction = "device_checkLogin"
)
})
@ -68,12 +62,17 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
binding.edittextServer.setText(this.getDefaults("base_url", this.requireContext()))
binding.edittextServer.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
binding.edittextServer.setText(this.getDefaults("base_url", this.requireContext()))
binding.edittextServer.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
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()
//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()
return@OnKeyListener false
@ -88,8 +87,8 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
}
//NODEJS TEST
// Log.i("VERDNATURA:","NODEJS in")
// viewModel.nodeJsTest("A0A3B8224DBF","ABC","1")
// Log.i("VERDNATURA:","NODEJS in")
// viewModel.nodeJsTest("A0A3B8224DBF","ABC","1")
}
@ -124,16 +123,16 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
with(viewModel) {
versionappitem.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) {
binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") {
customDialog.dismiss()
}.show()
} else {
binding.splashProgress.visibility = View.VISIBLE
if (it.version.equals(getInfoVersionNameApp())) {
binding.splashProgress.visibility = View.INVISIBLE
goToMain()
} else {
@ -165,21 +164,20 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
})
logindevice.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) {
binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Cerrar") {
customDialog.dismiss()
}.show()
} else {
binding.splashProgress.visibility = View.VISIBLE
if (it.vIsAuthorized.equals("0")) {
binding.splashProgress.visibility = View.INVISIBLE
// Log.i("VERDNATURA:",it.vMessage)
customDialog.setTitle("Error").setDescription(it.vMessage!!)
.setOkButton("Cerrar") {
customDialog.dismiss()
binding.splashProgress.visibility = View.INVISIBLE
// goToMain()
}.show()
@ -195,10 +193,9 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
binding.edittextPassword.text.toString(),
"warehouse",
getInfoVersionNameApp(),
getANDROIDID(),"deviceLog_add"
getANDROIDID(), "deviceLog_add"
)
binding.splashProgress.visibility = View.INVISIBLE
//saveUserFkPref(it)
if (binding.switchRemember.isChecked) {
saveRemember(true)
@ -213,8 +210,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
if (it.vIsAuthorized.equals("1") && it.vMessage.isNullOrEmpty()) {
// Log.i("VERDNATURA", "Sin mensaje")
binding.splashProgress.visibility = View.VISIBLE
loginSalix(
user = binding.edittextUsername.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()) {
binding.splashProgress.visibility = View.GONE
customDialog.setTitle("Mensaje").setDescription(it.vMessage)
.setOkButton("Cerrar") {
customDialog.dismiss()
binding.splashProgress.visibility = View.VISIBLE
loginSalix(
user = binding.edittextUsername.text.toString(),
password = binding.edittextPassword.text.toString(),"login de Salix"
password = binding.edittextPassword.text.toString(),
"login de Salix"
)
}.show()
@ -245,17 +242,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
workerId.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (!it.isError) {
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 {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) {
customDialog.setTitle("Error")
.setDescription(it.errorMessage)
@ -300,13 +291,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
customDialog.dismiss()
getVersion()
}.show()
} else {
}
})
loginsalixitem.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) {
saveTokenPref("")
customDialog.setTitle("Error")
@ -323,33 +312,30 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
}
})
version.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
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"){
goToMain()
customDialog.dismiss()
}.setKoButton("Cancelar"){
customDialog.dismiss()
}.show()*/
goToMain()
/* version.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.INVISIBLE
if (it) {
binding.constrainlayoutLogin.visibility=INVISIBLE
goToMain()
binding.splashProgress.visibility = View.INVISIBLE
} else {
customDialog.setTitle(getString(R.string.Actualizar))
.setDescription(getString(R.string.updatemng)).setOkButton(
getString(
R.string.Actualizar
)
) {
val openURL = Intent(Intent.ACTION_VIEW)
openURL.data = Uri.parse("https://app.verdnatura.es/bin/vn-picking.apk")
startActivity(openURL)
}.setKoButton("Cancelar") {
customDialog.dismiss()
goToMain()
}.show()
}
})
} else {
binding.splashProgress.visibility = View.INVISIBLE
customDialog.setTitle(getString(R.string.Actualizar))
.setDescription(getString(R.string.updatemng)).setOkButton(
getString(
R.string.Actualizar
)
) {
val openURL = Intent(Intent.ACTION_VIEW)
openURL.data = Uri.parse("https://app.verdnatura.es/bin/vn-picking.apk")
startActivity(openURL)
}.setKoButton("Cancelar") {
customDialog.dismiss()
goToMain()
}.show()
}
})*/
}
super.observeViewModel()
}
@ -408,7 +394,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
viewModel.checkVersion(
user = binding.edittextUsername.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
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>
get() = _loginsalixitem
private val _version by lazy { MutableLiveData<Boolean>() }
/* private val _version by lazy { MutableLiveData<Boolean>() }
val version: LiveData<Boolean>
get() = _version
get() = _version*/
private val _devicelogresponse by lazy { MutableLiveData<ResponseItemVO>() }
val devicelogresponse: LiveData<ResponseItemVO>
@ -165,10 +165,6 @@ class LoginViewModel(context: Context) : BaseViewModel()
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)
{

View File

@ -2,7 +2,9 @@ package es.verdnatura.presentation.view.feature.main.activity
//import kotlinx.android.synthetic.main.activity_main.*
import android.content.SharedPreferences
import android.media.MediaPlayer
import android.view.Menu
import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
@ -10,6 +12,7 @@ import es.verdnatura.BuildConfig
import es.verdnatura.R
import es.verdnatura.databinding.ActivityMainBinding
import es.verdnatura.domain.ConstAndValues.MAINACTIVITY
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseActivity
import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.CustomDialogMainActivity
@ -66,10 +69,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
var firstItem: ItemMenuVO? = null
var fm = supportFragmentManager
var TAG = "MainActivity"
var mperror: MediaPlayer? = null
var mpok: MediaPlayer? = null
override fun getLayoutId(): Int = R.layout.activity_main
override fun init() {
mperror = MediaPlayer.create((this),R.raw.error)
mpok = MediaPlayer.create((this),R.raw.ok)
customDialog = CustomDialogMainActivity(this)
setBottomMenu()
if (haveSector()) addFragment(
@ -393,21 +401,23 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
//Menu buffer
"Vaciado buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Vaciado buffer"))
addFragmentOnTop(BufferFragment.newInstance(item.title))
}
"Llenado buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Llenado buffer"))
addFragmentOnTop(BufferFragment.newInstance(item.title))
}
"Acumulación buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Acumulación buffer"))
addFragmentOnTop(BufferFragment.newInstance(item.title))
}
"Desactivado buffer" -> {
addFragmentOnTop(BufferFragment.newInstance("Desactivado buffer"))
addFragmentOnTop(BufferFragment.newInstance(item.title))
}
"Cargar expedición en buffer"->{
addFragmentOnTop(BufferLoadFragment.newInstance("Cargar expedición en buffer"))
}
"Flejado buffer"->{
addFragmentOnTop(BufferFragment.newInstance(item.title))
}
/*sergio:pruebas*/
"Pre Control" -> {
addFragmentOnTop(PreControladorFragment.newInstance())
@ -523,4 +533,22 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
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
/*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.SharedPreferences
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.lifecycle.Observer
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.ItemPalletVO
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.util.*
import kotlin.collections.ArrayList
@ -75,10 +74,12 @@ class ExpeditionPalletDetailFragment(
override fun init() {
customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext())
expedition_pallet_detail_pallet.text = "Pallet "+itemPallet!!.Pallet
splash_progress.visibility = View.VISIBLE
requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
binding.expeditionPalletDetailPallet.text = "Pallet "+itemPallet!!.Pallet
binding.splashProgress.visibility = View.VISIBLE
//requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar()
setEvents()
viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View")
@ -86,11 +87,11 @@ class ExpeditionPalletDetailFragment(
}
private fun setEvents(){
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
button_ok.setOnClickListener {
binding.buttonOk.setOnClickListener {
requireActivity().onBackPressed()
// sergio: en caso de que hay problemas habrá que cambiar aquí la llamada
// MainActivity.addFragmentOnTop(ExpeditionPalletDetailFragment.newInstance(itemTruck,itemPallet))
@ -109,18 +110,18 @@ class ExpeditionPalletDetailFragment(
listIcons.add(iconEditar)
listIcons.add(iconBorrar)
listIcons.add(iconPrint)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View")
}else if(item == iconEditar){
onPalletClickListener!!.onPalletClickListener(itemExpeditionTruckVO!!,itemPallet!!)
}else if(item == iconBorrar){
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPalletDel(user,password,itemPallet!!.Pallet,"expeditionPallet_Del")
}else if(item == iconPrint){
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
(getString(R.string.Imprimiendo)+" por " +SectorDescription).toast(requireContext())
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{
@ -158,11 +159,11 @@ class ExpeditionPalletDetailFragment(
}
private fun printExpeditionList(it: ItemPalletViewListVO){
splash_progress.visibility = View.GONE
binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionPalletViewAdapter(it.list)
expedition_pallet_recyclerview.adapter = adapter
expedition_pallet_recyclerview.layoutManager = lm
binding.expeditionPalletRecyclerview.adapter = adapter
binding.expeditionPalletRecyclerview.layoutManager = lm
}
}

View File

@ -1,11 +1,13 @@
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.SharedPreferences
import android.graphics.drawable.Drawable
import android.media.MediaPlayer
import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.inputmethod.EditorInfo
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.ItemPalletVO
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.util.*
import kotlin.collections.ArrayList
@ -83,9 +82,10 @@ class ExpeditionPalletFragment(
override fun init() {
customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext())
splash_progress.visibility = View.VISIBLE
requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
binding.splashProgress.visibility = View.VISIBLE
//requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar()
setEvents()
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
@ -94,7 +94,7 @@ class ExpeditionPalletFragment(
}
private fun setEvents(){
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
@ -106,17 +106,17 @@ class ExpeditionPalletFragment(
val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
listIcons.add(iconReload)
listIcons.add(iconPlus)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
}else if(item == iconPlus){
expeditionScanAdd()
}
}
})
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
private fun getCURDATE(date:String):String{
@ -172,23 +172,23 @@ class ExpeditionPalletFragment(
}
private fun printExpeditionList(it: ItemPalletListVO){
splash_progress.visibility = View.GONE
binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionPalletAdapter(it.list,onPalletClickListener!!,onComprobarPalletViewClickListener!!,itemExpeditionTruckVO!!)
expedition_pallet_recyclerview.adapter = adapter
expedition_pallet_recyclerview.layoutManager = lm
binding.expeditionPalletRecyclerview.adapter = adapter
binding.expeditionPalletRecyclerview.layoutManager = lm
}
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")
}
private fun showScanExpeditions(it:ItemScanList){
//Log.i("VERDNATURA:","VA A ESCANEAR EN PALLETFRAGMENT")
splash_progress.visibility = View.GONE
binding.splashProgress.visibility = View.GONE
listExpeditions = ArrayList()
@ -197,7 +197,7 @@ class ExpeditionPalletFragment(
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())
@ -215,7 +215,7 @@ class ExpeditionPalletFragment(
}.setKoButton("Cerrar"){
(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")
listExpeditions = ArrayList()
customDialogList.dismiss()

View File

@ -1,12 +1,13 @@
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.SharedPreferences
import android.graphics.drawable.Drawable
import android.media.MediaPlayer
import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
@ -14,7 +15,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentExpeditionScanBinding
import es.verdnatura.domain.notNull
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.*
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.paletizador.adapter.ExpeditionScanAdapter
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.util.*
import kotlin.collections.ArrayList
@ -82,10 +79,12 @@ class ExpeditionScanFragment (
customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext())
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
expedition_scan_detail_pallet.text = "Pallet "+itemPalletVO!!.Pallet
splash_progress.visibility = View.VISIBLE
requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
binding.expeditionScanDetailPallet.text = "Pallet "+itemPalletVO!!.Pallet
binding.splashProgress.visibility = View.VISIBLE
//requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
setToolBar()
setEvents()
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
@ -93,7 +92,7 @@ class ExpeditionScanFragment (
}
private fun setEvents(){
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
@ -105,10 +104,10 @@ class ExpeditionScanFragment (
val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
listIcons.add(iconReload)
listIcons.add(iconPlus)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
}else if(item == iconPlus){
//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{
@ -184,14 +183,14 @@ class ExpeditionScanFragment (
private fun printExpeditionList(it: ItemExpeditionScanList){
splash_progress.visibility = View.GONE
binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionScanAdapter(it.list,object: OnScanLongClickListener{
override fun onScanLongClickListener(itemExpeditionScanVO: ItemExpeditionScanVO) {
customDialogTwoButtons.setTitle("Ticket: "+itemExpeditionScanVO.Ticket+" Pallet: "+itemPalletVO!!.Pallet)
.setDescription("Expedition: "+itemExpeditionScanVO!!.expeditionFk)
.setOkButton("Borrar"){
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanDel(user,password,itemExpeditionScanVO.id)
customDialogTwoButtons.dismiss()
}.setKoButton("Cancelar"){
@ -200,14 +199,14 @@ class ExpeditionScanFragment (
}
})
expedition_pallet_recyclerview.adapter = adapter
expedition_pallet_recyclerview.layoutManager = lm
binding.expeditionPalletRecyclerview.adapter = adapter
binding.expeditionPalletRecyclerview.layoutManager = lm
}
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)
//Log.i("VERDNATURA:","entramos a escanear ticket del pallet")
@ -217,13 +216,13 @@ class ExpeditionScanFragment (
//sergio para smarttags:
// Log.i("VERDNATURA:","muestra expediciones y a escanear")
listExpeditions = ArrayList()
splash_progress.visibility = View.GONE
binding.splashProgress.visibility = View.GONE
it.list.forEach {
if(it.expeditionFk != "0")
listExpeditions.add(BarcodeVO(code = it.expeditionFk))
}
//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")
(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.os.Bundle
import android.view.View
import android.view.View.*
import android.view.inputmethod.EditorInfo
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.smarttag.adapter.SmartTagAdapter
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.fragment_collection.*
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_login.*
import kotlinx.android.synthetic.main.fragment_sacador.*
import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.*
import kotlinx.android.synthetic.main.toolbar.*
import kotlinx.android.synthetic.main.toolbar.**/
class ExpeditionScanSorterFragment(
var entryPoint: String = ""
@ -52,8 +53,9 @@ class ExpeditionScanSorterFragment(
customDialogList = CustomDialogList(requireContext())
goBack = false
requireActivity().main_bottom_navigation.visibility = GONE
splash_progress.visibility = GONE
//requireActivity().main_bottom_navigation.visibility = GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE
setEvents()
setToolBar()
@ -68,13 +70,13 @@ class ExpeditionScanSorterFragment(
private fun setToolBar() {
toolbar_title.text = entryPoint
binding.mainToolbar.toolbarTitle.text = entryPoint
}
private fun expeditionscan(ExpeditionScan: String) {
splash_progress.visibility = VISIBLE
binding.splashProgress.visibility = VISIBLE
viewModel.expedition_scan(user, password, ExpeditionScan,"expedition_scan")
itemScaned = ExpeditionScan
@ -90,7 +92,7 @@ class ExpeditionScanSorterFragment(
private fun setEvents() {
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
@ -101,7 +103,7 @@ class ExpeditionScanSorterFragment(
override fun observeViewModel() {
with(viewModel) {
splash_progress.visibility = GONE
binding.splashProgress.visibility = GONE
responsescan.observe(viewLifecycleOwner, Observer {
if (it.isError) {
@ -118,7 +120,7 @@ class ExpeditionScanSorterFragment(
customDialogList.setValue("")
}
splash_progress.visibility = GONE
binding.splashProgress.visibility = GONE
})
}
@ -138,7 +140,7 @@ class ExpeditionScanSorterFragment(
} else {*/
customDialogList.dismiss()
backButton.performClick()
binding.mainToolbar.backButton.performClick()
// }

View File

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

View File

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

View File

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

View File

@ -4,6 +4,7 @@ package es.verdnatura.presentation.view.feature.smarttag.register
import android.content.Context
import android.content.SharedPreferences
import android.os.Bundle
import android.view.View
import android.view.View.*
import android.view.inputmethod.EditorInfo
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.model.SmartTag
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.fragment_collection.*
import kotlinx.android.synthetic.main.fragment_controlador.*
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_login.*
import kotlinx.android.synthetic.main.fragment_sacador.*
import kotlinx.android.synthetic.main.toolbar.*
import kotlinx.android.synthetic.main.fragment_sacador.**/
//import kotlinx.android.synthetic.main.toolbar.*
class RegisterSmartTagsFragment(
var entryPoint: String = ""
@ -91,8 +91,9 @@ class RegisterSmartTagsFragment(
customDialogInput = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
goBack = false
requireActivity().main_bottom_navigation.visibility = GONE
splash_progress.visibility = GONE
//requireActivity().main_bottom_navigation.visibility = GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE
setEvents()
setToolBar()
@ -109,7 +110,7 @@ class RegisterSmartTagsFragment(
private fun setToolBar() {
// toolbar_title.text = getString(R.string.SmarttagAssociate)
toolbar_title.text = entryPoint
binding.mainToolbar.toolbarTitle.text = entryPoint
// Log.i("VERDNATURA:", "el entrypoint es ${entryPoint}")
}
@ -117,7 +118,7 @@ class RegisterSmartTagsFragment(
private fun bindShelving_add(shelvingOrSmarttag: String) {
splash_progress.visibility = VISIBLE
binding.splashProgress.visibility = VISIBLE
//poner el bindshelving aqui
viewModel.workerShelving_add(user, password, shelvingOrSmarttag)
@ -134,7 +135,7 @@ class RegisterSmartTagsFragment(
private fun bindShelving_remove() {
// splash_progress.visibility = VISIBLE
// binding.splashProgress.visibility = VISIBLE
//ponser el unbindshleving aqui
//sergio:esto se debe hacer en
@ -149,8 +150,8 @@ class RegisterSmartTagsFragment(
}
private fun scanRequest() {
if (scan_input != null) {
scan_input.requestFocus()
if (binding.scanInput != null) {
binding.scanInput.requestFocus()
}
hideKeyboards()
}
@ -178,7 +179,7 @@ class RegisterSmartTagsFragment(
private fun setEvents() {
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
// Log.i("VERDNATURA:","PULSADO")
requireActivity().onBackPressed()
}
@ -190,7 +191,7 @@ class RegisterSmartTagsFragment(
with(viewModel) {
splash_progress.visibility = GONE
binding.splashProgress.visibility = GONE
responseadd.observe(viewLifecycleOwner, Observer {
// Log.i("VERDNATURA", "Revisar llamada de las etiquetas smarttags : ${it.response}")
@ -217,7 +218,7 @@ class RegisterSmartTagsFragment(
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.os.Bundle
import android.util.Log
import android.view.View
import android.view.View.*
import android.view.inputmethod.EditorInfo
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.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.fragment_collection.*
import kotlinx.android.synthetic.main.fragment_controlador.*
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_login.*
import kotlinx.android.synthetic.main.fragment_sacador.*
import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.*
import kotlinx.android.synthetic.main.toolbar.*
import kotlinx.android.synthetic.main.toolbar.**/
import timber.log.Timber
class AssociateSmartTagsFragment(
@ -90,8 +91,9 @@ class AssociateSmartTagsFragment(
customDialogInput = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
goBack = false
requireActivity().main_bottom_navigation.visibility = GONE
splash_progress.visibility = GONE
//requireActivity().main_bottom_navigation.visibility = GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = GONE
setEvents()
setToolBar()
@ -108,14 +110,14 @@ class AssociateSmartTagsFragment(
private fun setToolBar() {
// toolbar_title.text = getString(R.string.SmarttagAssociate)
toolbar_title.text = entryPoint
binding.mainToolbar.toolbarTitle.text = entryPoint
Timber.i("VERDNATURA:el entrypoint es ${entryPoint}")
}
private fun bindShelving_add(shelvingOrSmarttag: String) {
splash_progress.visibility = VISIBLE
binding.splashProgress.visibility = VISIBLE
//poner el bindshelving aqui
viewModel.workerShelving_add(user, password, shelvingOrSmarttag)
@ -132,7 +134,7 @@ class AssociateSmartTagsFragment(
private fun bindShelving_remove() {
// splash_progress.visibility = VISIBLE
// binding.splashProgress.visibility = VISIBLE
//ponser el unbindshleving aqui
//sergio:esto se debe hacer en
@ -145,8 +147,8 @@ class AssociateSmartTagsFragment(
}
private fun scanRequest() {
if (scan_input != null) {
scan_input.requestFocus()
if (binding.scanInput != null) {
binding.scanInput.requestFocus()
}
hideKeyboards()
}
@ -171,7 +173,7 @@ class AssociateSmartTagsFragment(
private fun setEvents() {
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
Log.i("VERDNATURA:", "PULSADO")
requireActivity().onBackPressed()
}
@ -181,7 +183,7 @@ class AssociateSmartTagsFragment(
override fun observeViewModel() {
with(viewModel) {
splash_progress.visibility = GONE
binding.splashProgress.visibility = GONE
responseadd.observe(viewLifecycleOwner, Observer {
// 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 {
@ -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.ubicador.adapter.AutomaticAdapter
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.toolbar.*
import kotlinx.android.synthetic.main.toolbar.**/
class AutomaticAddItemFragment(
var shelvingFk : String = ""
@ -51,8 +51,9 @@ class AutomaticAddItemFragment(
customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext())
customDialogUbicador = CustomDialogUbicador(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = "itemShelvingMake"
// requireActivity().main_bottom_navigation.visibility = View.GONE
(activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = "itemShelvingMake"
setEvents()
setViews()
setToolBar()
@ -60,11 +61,11 @@ class AutomaticAddItemFragment(
}
private fun setToolBar(){
toolbar_subtitle.visibility = View.VISIBLE
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
}
private fun setSubtitle(){
toolbar_subtitle.text = "Etiquetas: "+contador
binding.mainToolbar.toolbarSubtitle.text = "Etiquetas: "+contador
}
private fun setViews(){
@ -79,39 +80,39 @@ class AutomaticAddItemFragment(
adapter!!.notifyDataSetChanged()
}
})
items_recyclerview.adapter = adapter
items_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.itemsRecyclerview.adapter = adapter
binding.itemsRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
}
private fun setEvents(){
edit_matricula.requestFocus()
edit_matricula.setOnEditorActionListener { v, actionId, event ->
binding.editMatricula.requestFocus()
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
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
setSubtitle()
listItems.add(0,ItemEscanerVO(edit_matricula.text.toString()))
listItems.add(0,ItemEscanerVO(binding.editMatricula.text.toString()))
adapter!!.notifyDataSetChanged()
}
edit_matricula.setText("")
(activity as MainActivity).hideKeyboard(edit_matricula)
binding.editMatricula.setText("")
(activity as MainActivity).hideKeyboard(binding.editMatricula)
return@setOnEditorActionListener true
}
return@setOnEditorActionListener false
}
button_finalizar.setOnClickListener {
binding.buttonFinalizar.setOnClickListener {
val listString:ArrayList<String> = ArrayList()
listItems.forEach {
listString.add(it.item)
}
listItems = ArrayList()
splash_progress.visibility = View.VISIBLE
binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingMake_multi(user,password,shelvingFk,listString,deep.toString(),warehouseFk,"1")
}
backButton.setOnClickListener {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
}
@ -119,7 +120,7 @@ class AutomaticAddItemFragment(
override fun observeViewModel() {
with(viewModel){
response.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE
binding.splashProgress.visibility = View.GONE
if (it.isError){
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
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: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: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
android:layout_width="match_parent"
@ -89,7 +84,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
tools:listitem="@layout/item_location_all_row"/>
/>
</LinearLayout>

View File

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

View File

@ -218,7 +218,6 @@
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"
@ -226,6 +225,28 @@
</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>

View File

@ -3,12 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
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
android:layout_width="match_parent"

View File

@ -193,7 +193,6 @@
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"
@ -201,6 +200,7 @@
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</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="shelvingLog">Histórico del carro</string>
<string name="bufferload">Cargar expedición en buffer</string>
<string name="bufferfstrapping">Flejado buffer</string>
<string name="Split">Split</string>
</resources>

View File

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