refs #4940
This commit is contained in:
parent
fae0d8a444
commit
491a4f8762
|
@ -1,7 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.packingHolland.fragment
|
package es.verdnatura.presentation.view.feature.packingHolland.fragment
|
||||||
|
|
||||||
import android.view.View.GONE
|
import android.view.View.*
|
||||||
import android.view.View.VISIBLE
|
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
||||||
|
@ -47,15 +46,11 @@ class PackingHollandFragment(var entrypoint: String) :
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
shelvingScaned = itemScanValue(
|
||||||
binding.scanInput.setText(
|
binding.scanInput.text.toString(),
|
||||||
itemScanValue(
|
"buy",
|
||||||
binding.scanInput.text.toString(),
|
"more"
|
||||||
"buy",
|
).toString().toInt()
|
||||||
"more"
|
|
||||||
).toString()
|
|
||||||
)
|
|
||||||
shelvingScaned = binding.scanInput.text.toString().toInt()
|
|
||||||
showQuantityPacking()
|
showQuantityPacking()
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ex.message!!.toast(requireActivity())
|
ex.message!!.toast(requireActivity())
|
||||||
|
@ -76,9 +71,9 @@ class PackingHollandFragment(var entrypoint: String) :
|
||||||
response.observe(viewLifecycleOwner) {
|
response.observe(viewLifecycleOwner) {
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
ma.messageWithSound(it.errorMessage, true, true)
|
||||||
} else {
|
} else {
|
||||||
showQuantityPacking()
|
ma.messageWithSound(it.errorMessage, false, true, isToasted = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -94,49 +89,48 @@ class PackingHollandFragment(var entrypoint: String) :
|
||||||
customDialogInput.setDescription(getString(R.string.packingQuantity) + shelvingScaned)
|
customDialogInput.setDescription(getString(R.string.packingQuantity) + shelvingScaned)
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setOkButton(getString(R.string.modify)) {
|
.setOkButton(getString(R.string.modify)) {
|
||||||
|
callPacking(customDialogInput.getValue())
|
||||||
if (customDialogInput.getValue().isNotEmpty()
|
|
||||||
) {
|
|
||||||
callPacking(customDialogInput.getValue())
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
customDialogInput.setFocusText()
|
customDialogInput.setFocusText()
|
||||||
|
|
||||||
|
|
||||||
customDialogInput.setFocusText()
|
|
||||||
ma.hideKeyboard(customDialogInput.getEditText())
|
ma.hideKeyboard(customDialogInput.getEditText())
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||||
|
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
callPacking(customDialogInput.getValue())
|
||||||
callPacking(customDialogInput.getValue())
|
|
||||||
}
|
|
||||||
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ma.hideKeyboard(customDialogInput.getEditText())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun callPacking(value: String) {
|
|
||||||
try {
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.travel_updatePacking(
|
|
||||||
itemFk = shelvingScaned,
|
|
||||||
packingFk = value.toInt()
|
|
||||||
)
|
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
private fun callPacking(value: String) {
|
||||||
getString(R.string.errorInput).toast(requireActivity())
|
if (customDialogInput.getValue().isNotEmpty()) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
ma.hideKeyboard(customDialogInput.getEditText())
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
viewModel.travel_updatePacking(
|
||||||
|
itemFk = shelvingScaned,
|
||||||
|
packingFk = value.toInt()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
binding.splashProgress.visibility = INVISIBLE
|
||||||
|
getString(R.string.errorInput).toast(requireActivity())
|
||||||
|
customDialogInput.setValue("")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
customDialogInput.setValue("")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
)
|
)
|
||||||
|
|
||||||
//Tarea 4940
|
//Tarea 4940
|
||||||
/* _pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
1,
|
1,
|
||||||
R.drawable.ic_packaging,
|
R.drawable.ic_packaging,
|
||||||
|
@ -130,21 +130,9 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
R.string.titleUbicatorDescrip
|
R.string.titleUbicatorDescrip
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)*/
|
|
||||||
|
|
||||||
//Tarea 5095
|
|
||||||
_pasillerositem.add(
|
|
||||||
PasillerosItemVO(
|
|
||||||
1,
|
|
||||||
R.drawable.ic_shopping_self,
|
|
||||||
contextApp.getString(R.string.selfConsumption),
|
|
||||||
R.string.titleSelfConsumption,
|
|
||||||
contextApp.getString(
|
|
||||||
R.string.titleSelfConsumption
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
//Tarea 4979
|
//Tarea 4979
|
||||||
/* _pasillerositem.add(
|
/* _pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
|
@ -252,6 +240,17 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
_pasillerositem.add(
|
||||||
|
PasillerosItemVO(
|
||||||
|
1,
|
||||||
|
R.drawable.ic_shopping_self,
|
||||||
|
contextApp.getString(R.string.selfConsumption),
|
||||||
|
R.string.titleSelfConsumption,
|
||||||
|
contextApp.getString(
|
||||||
|
R.string.titleSelfConsumption
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,7 +501,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
|
|
||||||
//#tarea4679
|
//#tarea4679
|
||||||
/* _pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
6,
|
6,
|
||||||
R.drawable.ic_delivery_truck,
|
R.drawable.ic_delivery_truck,
|
||||||
|
@ -510,7 +509,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
R.string.titleDelivery,
|
R.string.titleDelivery,
|
||||||
contextApp.getString(R.string.titleDeliveryDescrip)
|
contextApp.getString(R.string.titleDeliveryDescrip)
|
||||||
)
|
)
|
||||||
)*/
|
)
|
||||||
|
|
||||||
//#tarea4021
|
//#tarea4021
|
||||||
/* _pasillerositem.add(
|
/* _pasillerositem.add(
|
||||||
|
|
Loading…
Reference in New Issue