v5.3.4
This commit is contained in:
parent
d45e713166
commit
cc596b589b
|
@ -14,8 +14,8 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 42
|
versionCode 44
|
||||||
versionName "5.3.2"
|
versionName "5.3.4"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,12 @@ class CustomDialogList (context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setDescription(title: String): CustomDialogList {
|
||||||
|
custom_dialog_description.visibility = View.VISIBLE
|
||||||
|
custom_dialog_description.text = title
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
||||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||||
|
|
|
@ -1047,7 +1047,7 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
//toolbar_title.text = "" + totalMark + "/" + sales.size
|
//toolbar_title.text = "" + totalMark + "/" + sales.size
|
||||||
if (toolbar_title != null) toolbar_title.text = if (collection.collectionFk != null )collection.collectionFk else ""
|
if (toolbar_title != null) toolbar_title.text = if (collection.collectionFk != null )collection.collectionFk else ""
|
||||||
toolbar_subtitle.text = "" +totalMark + "/" + sales.size
|
if (toolbar_subtitle != null && totalMark != null && sales != null) toolbar_subtitle.text = "" +totalMark + "/" + sales.size
|
||||||
if (totalMark == sales.size) {
|
if (totalMark == sales.size) {
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context,Toast.LENGTH_SHORT)
|
getString(R.string.Coleccióncompleta).toast(this.context,Toast.LENGTH_SHORT)
|
||||||
changeTicketState()
|
changeTicketState()
|
||||||
|
|
|
@ -43,7 +43,12 @@ fun CollectionVO.map() : CollectionVO{
|
||||||
}
|
}
|
||||||
}catch (e:Exception){
|
}catch (e:Exception){
|
||||||
this.isError = true
|
this.isError = true
|
||||||
this.errorMessage = "Error al construir la colección"
|
if (this.tickets == null || this.tickets.isEmpty()){
|
||||||
|
this.errorMessage = "La colección no tiene tickets"
|
||||||
|
}else{
|
||||||
|
this.errorMessage = "Error al construir la colección"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
private var reload = false
|
private var reload = false
|
||||||
private var hideLoad = true
|
private var hideLoad = true
|
||||||
|
private var layoutManager : LinearLayoutManager? = null
|
||||||
|
private var firstVisiblePosition = 0
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance() = InventaryFragment()
|
fun newInstance() = InventaryFragment()
|
||||||
|
@ -130,6 +132,19 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
if (location_recyclerview.layoutManager != null){
|
||||||
|
if (firstVisiblePosition <= listInvetory.size){
|
||||||
|
location_recyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel){
|
with(viewModel){
|
||||||
|
@ -179,7 +194,12 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
||||||
}
|
}
|
||||||
},onPasillerosItemClickListener = pasillerosItemClickListener!!)
|
},onPasillerosItemClickListener = pasillerosItemClickListener!!)
|
||||||
location_recyclerview.adapter = adapter
|
location_recyclerview.adapter = adapter
|
||||||
location_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
location_recyclerview.layoutManager = layoutManager
|
||||||
|
|
||||||
|
if (firstVisiblePosition <= listInvetory.size){
|
||||||
|
location_recyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -208,7 +208,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClick
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.main_frame_layout, fragment!!)
|
.replace(R.id.main_frame_layout, fragment!!)
|
||||||
.addToBackStack(null)
|
.addToBackStack(null)
|
||||||
.commit()
|
.commitAllowingStateLoss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.media.MediaPlayer
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
|
@ -50,7 +51,8 @@ class ExpeditionPalletFragment(
|
||||||
private var listExpeditions:ArrayList<BarcodeVO> = ArrayList()
|
private var listExpeditions:ArrayList<BarcodeVO> = ArrayList()
|
||||||
private var expeditionAdapter : BarcodeAdapter? = null
|
private var expeditionAdapter : BarcodeAdapter? = null
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
|
var mperror: MediaPlayer? = null
|
||||||
|
var mpok: MediaPlayer? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(item: ItemExpeditionTruckVO) =
|
fun newInstance(item: ItemExpeditionTruckVO) =
|
||||||
|
@ -71,7 +73,8 @@ class ExpeditionPalletFragment(
|
||||||
password = prefs.getString(PASSWORD,"").toString()
|
password = prefs.getString(PASSWORD,"").toString()
|
||||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||||
|
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||||
|
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +159,9 @@ class ExpeditionPalletFragment(
|
||||||
|
|
||||||
private fun showScanExpeditions(it:ItemScanList){
|
private fun showScanExpeditions(it:ItemScanList){
|
||||||
splash_progress.visibility = View.GONE
|
splash_progress.visibility = View.GONE
|
||||||
|
|
||||||
|
listExpeditions = ArrayList()
|
||||||
|
|
||||||
it.list.forEach {
|
it.list.forEach {
|
||||||
if(it.expeditionFk != "0")
|
if(it.expeditionFk != "0")
|
||||||
listExpeditions.add(BarcodeVO(code = it.expeditionFk))
|
listExpeditions.add(BarcodeVO(code = it.expeditionFk))
|
||||||
|
@ -191,8 +197,19 @@ class ExpeditionPalletFragment(
|
||||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
if (!customDialogList.getValue().isNullOrEmpty()){
|
if (!customDialogList.getValue().isNullOrEmpty()){
|
||||||
listExpeditions.add(BarcodeVO(code = customDialogList.getValue()))
|
try{
|
||||||
viewModel.expeditionScanPut(user,password,it.list.get(0).palletFk,customDialogList.getValue())
|
val numExpedition = customDialogList.getValue().toDouble()
|
||||||
|
if(customDialogList.getValue().length >= 7){
|
||||||
|
listExpeditions.add(0,BarcodeVO(code = customDialogList.getValue()))
|
||||||
|
customDialogList.setDescription("Total: "+listExpeditions.size)
|
||||||
|
viewModel.expeditionScanPut(user,password,it.list.get(0).palletFk,customDialogList.getValue())
|
||||||
|
}else{
|
||||||
|
if (mperror != null) mperror!!.start()
|
||||||
|
}
|
||||||
|
}catch (e:Exception){
|
||||||
|
if (mperror != null) mperror!!.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
expeditionAdapter!!.notifyDataSetChanged()
|
expeditionAdapter!!.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,7 +280,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
||||||
var shelvingIndex = 0
|
var shelvingIndex = 0
|
||||||
for (placementVO in saleVO.carros){
|
for (placementVO in saleVO.carros){
|
||||||
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
||||||
mpok!!.start()
|
if (mpok != null) mpok!!.start()
|
||||||
isOk = true
|
isOk = true
|
||||||
showShelving(index,shelvingIndex)
|
showShelving(index,shelvingIndex)
|
||||||
isBreak = true
|
isBreak = true
|
||||||
|
@ -312,7 +312,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
||||||
var shelvingIndex = 0
|
var shelvingIndex = 0
|
||||||
for (placementVO in saleVO.carros){
|
for (placementVO in saleVO.carros){
|
||||||
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
||||||
mpok!!.start()
|
if (mpok != null) mpok!!.start()
|
||||||
isOk = true
|
isOk = true
|
||||||
showShelving(position,shelvingIndex)
|
showShelving(position,shelvingIndex)
|
||||||
isBreak = true
|
isBreak = true
|
||||||
|
@ -612,7 +612,7 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
||||||
ticketFk = ticket,
|
ticketFk = ticket,
|
||||||
parking = parking
|
parking = parking
|
||||||
)
|
)
|
||||||
mpok!!.start()
|
if (mpok != null) mpok!!.start()
|
||||||
"Ticket aparcado".toast(requireContext())
|
"Ticket aparcado".toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
||||||
var shelvingIndex = 0
|
var shelvingIndex = 0
|
||||||
for (placementVO in saleVO.carros){
|
for (placementVO in saleVO.carros){
|
||||||
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
||||||
mpok!!.start()
|
if(mpok != null) mpok!!.start()
|
||||||
isOk = true
|
isOk = true
|
||||||
showShelving(position,shelvingIndex)
|
showShelving(position,shelvingIndex)
|
||||||
isBreak = true
|
isBreak = true
|
||||||
|
|
|
@ -75,7 +75,10 @@ class AutomaticAddItemFragment(
|
||||||
override fun onAutomaticItemClickListener(position: Int) {
|
override fun onAutomaticItemClickListener(position: Int) {
|
||||||
contador -= 1
|
contador -= 1
|
||||||
setSubtitle()
|
setSubtitle()
|
||||||
listItems.removeAt(position)
|
if (listItems.size > position){
|
||||||
|
listItems.removeAt(position)
|
||||||
|
}
|
||||||
|
|
||||||
adapter!!.notifyDataSetChanged()
|
adapter!!.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -166,7 +166,7 @@ class UbicadorFragment(
|
||||||
viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue())
|
viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue())
|
||||||
parking = customDialogInput.getValue()
|
parking = customDialogInput.getValue()
|
||||||
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking + " E: "+etiquetas
|
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking + " E: "+etiquetas
|
||||||
mpok!!.start()
|
if(mpok != null) mpok!!.start()
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.setKoButton("Cancelar"){
|
}.setKoButton("Cancelar"){
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
|
@ -201,7 +201,7 @@ class UbicadorFragment(
|
||||||
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue())
|
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue())
|
||||||
shelvingFk = customDialogInput.getValue()
|
shelvingFk = customDialogInput.getValue()
|
||||||
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas
|
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas
|
||||||
mpok!!.start()
|
if(mpok != null) mpok!!.start()
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.setKoButton("Cancelar"){
|
}.setKoButton("Cancelar"){
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
|
@ -215,7 +215,7 @@ class UbicadorFragment(
|
||||||
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue())
|
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue())
|
||||||
shelvingFk = customDialogInput.getValue()
|
shelvingFk = customDialogInput.getValue()
|
||||||
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas
|
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas
|
||||||
mpok!!.start()
|
if(mpok != null) mpok!!.start()
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,10 @@ class UbicadorFragment(
|
||||||
customDialogUbicador.dismiss()
|
customDialogUbicador.dismiss()
|
||||||
|
|
||||||
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty() && updatePacking){
|
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty() && updatePacking){
|
||||||
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
var visible_calc = "0"
|
||||||
|
try{
|
||||||
|
visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
||||||
|
}catch (e:Exception){}
|
||||||
viewModel.itemShelvingMakeEdit(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1",itemShelvingFk)
|
viewModel.itemShelvingMakeEdit(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1",itemShelvingFk)
|
||||||
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
|
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
|
||||||
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||||
|
|
|
@ -17,17 +17,30 @@
|
||||||
android:focusableInTouchMode="true">
|
android:focusableInTouchMode="true">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/custom_dialog_title"
|
android:id="@+id/custom_dialog_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
|
android:layout_marginBottom="@dimen/layout_margin_min"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h6"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="¿Estás seguro de que deseas eliminar el dispositivo de celia?"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/custom_dialog_description"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/layout_margin_1"
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
android:layout_marginBottom="@dimen/layout_margin_min"
|
android:layout_marginBottom="@dimen/layout_margin_min"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/h6"
|
android:textSize="@dimen/body1"
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="¿Estás seguro de que deseas eliminar el dispositivo de celia?"
|
tools:text="Total: 25"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue