refs #5675 fix parking
This commit is contained in:
parent
1f1b901047
commit
f802a1e7a1
|
@ -48,11 +48,11 @@ import es.verdnatura.presentation.view.feature.sacador.model.*
|
|||
import org.json.JSONObject
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class CollectionFragmentPicker(
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class CollectionFragmentPicker(
|
||||
var collection: CollectionVO = CollectionVO(0),
|
||||
var type: String = SACADOR
|
||||
) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) {
|
||||
) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) {
|
||||
|
||||
private lateinit var dataMessageSalix: DataMessageSalix
|
||||
private var sales: List<SaleVO> = listOf()
|
||||
|
@ -152,7 +152,7 @@ import org.json.JSONObject
|
|||
}
|
||||
|
||||
override fun init() {
|
||||
d("VERDNATURA::","ENTRAMOS EN EL NUEVO FRAGMENT SACADOR")
|
||||
d("VERDNATURA::", "ENTRAMOS EN EL NUEVO FRAGMENT SACADOR")
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
|
@ -391,6 +391,7 @@ import org.json.JSONObject
|
|||
findSale(binding.scanInput.text.toString())
|
||||
}
|
||||
}
|
||||
|
||||
"buy" -> binding.scanInput.setText(myQr.more)
|
||||
|
||||
}
|
||||
|
@ -1250,7 +1251,7 @@ import org.json.JSONObject
|
|||
RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
storedBackPosition = lm.findFirstVisibleItemPosition()
|
||||
d("VERDNATURA::","La pos es"+storedBackPosition)
|
||||
d("VERDNATURA::", "La pos es" + storedBackPosition)
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
}
|
||||
})
|
||||
|
@ -1300,12 +1301,12 @@ import org.json.JSONObject
|
|||
//////Log.i("VERDNATURA:","encontrado producto")
|
||||
showShelving(index, shelvingIndex)
|
||||
//nuevo
|
||||
d("VERDNATURA::","el index de la sale es"+index)
|
||||
d("VERDNATURA::", "el index de la sale es" + index)
|
||||
var mySale = sales[index].saleFk
|
||||
for (indice in myGroupList.indices){
|
||||
for (indice in myGroupList.indices) {
|
||||
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk==mySale){
|
||||
d("VERDNATURA::","la pos del index de la sale es"+indice)
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||
d("VERDNATURA::", "la pos del index de la sale es" + indice)
|
||||
storedBackPosition = indice
|
||||
// setListPosition(storedBackPosition,false)
|
||||
}
|
||||
|
@ -1429,7 +1430,7 @@ import org.json.JSONObject
|
|||
|
||||
}
|
||||
|
||||
private fun findSale(txtscan: String, position: Int) {
|
||||
private fun findSale(txtscan: String, position: Int, checkParking: Boolean = true) {
|
||||
|
||||
var isOk = false
|
||||
if (type == SACADOR) {
|
||||
|
@ -1469,7 +1470,7 @@ import org.json.JSONObject
|
|||
}*/
|
||||
}
|
||||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
if (txtscan.contains("-") && checkParking) {
|
||||
tickets.forEach {
|
||||
viewModel.parking(
|
||||
ticketFk = it.toInt(),
|
||||
|
@ -1519,10 +1520,10 @@ import org.json.JSONObject
|
|||
saleTracking_mark(position, newType)
|
||||
//nuevo
|
||||
var mySale = sales[position].saleFk
|
||||
for (indice in myGroupList.indices){
|
||||
for (indice in myGroupList.indices) {
|
||||
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk==mySale){
|
||||
d("VERDNATURA::","la pos del index de la sale es"+indice)
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||
d("VERDNATURA::", "la pos del index de la sale es" + indice)
|
||||
storedBackPosition = indice
|
||||
// setListPosition(storedBackPosition,false)
|
||||
}
|
||||
|
@ -1574,7 +1575,7 @@ import org.json.JSONObject
|
|||
}
|
||||
|
||||
private fun setListPosition(position: Int, isFromBack: Boolean) {
|
||||
d("VERDNATURA::","Vamos a la pos" + storedBackPosition)
|
||||
d("VERDNATURA::", "Vamos a la pos" + storedBackPosition)
|
||||
lm!!.scrollToPositionWithOffset(storedBackPosition, 0)
|
||||
// lm!!.scrollToPositionWithOffset(position, 0)
|
||||
|
||||
|
@ -1668,8 +1669,11 @@ import org.json.JSONObject
|
|||
state = 0
|
||||
if ((sales[position].isPrepared == "1") || (sales[position].quantity!! > 0)) {
|
||||
customDialog.setTitle(getString(R.string.unmarkLine))
|
||||
.setDescription(getString(R.string.goUnmark) + sales[position].itemFk + getString(
|
||||
R.string.sure))
|
||||
.setDescription(
|
||||
getString(R.string.goUnmark) + sales[position].itemFk + getString(
|
||||
R.string.sure
|
||||
)
|
||||
)
|
||||
.setOkButton(getString(R.string.unmark)) {
|
||||
sales[position].isPrepared = "0"
|
||||
sales[position].pickedQuantity = 0
|
||||
|
@ -1677,15 +1681,15 @@ import org.json.JSONObject
|
|||
saleAdapter!!.notifyDataSetChanged()
|
||||
//nuevo
|
||||
var mySale = sales[position].saleFk
|
||||
for (indice in myGroupList.indices){
|
||||
for (indice in myGroupList.indices) {
|
||||
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk==mySale){
|
||||
d("VERDNATURA::","la pos del index de la sale es"+indice)
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||
d("VERDNATURA::", "la pos del index de la sale es" + indice)
|
||||
storedBackPosition = indice
|
||||
// setListPosition(storedBackPosition,false)
|
||||
}
|
||||
}
|
||||
storedBackPosition= position
|
||||
storedBackPosition = position
|
||||
setListPosition(position, false)
|
||||
if (type != PRECHECKER) {
|
||||
|
||||
|
@ -1794,18 +1798,13 @@ import org.json.JSONObject
|
|||
) {
|
||||
getString(R.string.quantityHigh).toast(requireContext())
|
||||
} else if (isNumber(customDialogList.getValue())) {
|
||||
try {
|
||||
originalItemScan = customDialogList.getValueTwo().toLong()
|
||||
// Log.i("VERDATURA","Le pasamos el siguiente item $originalItemScan que es el escaneado")
|
||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
//Log.i("VERDNATURA:","Cantidad seleccionada")
|
||||
mpok?.start()
|
||||
/* Se quita para comprobar al final de saleTracking_mark
|
||||
ReviewQuantityForRefreshingAndSorting(
|
||||
customDialogList.getValue().toInt(),
|
||||
sales[storedPosition].quantity!!.toInt(),
|
||||
sales[storedPosition].pickedQuantity.toInt()
|
||||
)*/
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
|
@ -1820,6 +1819,15 @@ import org.json.JSONObject
|
|||
}
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
|
||||
} catch (ex: Exception) {
|
||||
ma.messageWithSound(
|
||||
getString(R.string.errorReviewItem),
|
||||
true,
|
||||
isPlayed = true,
|
||||
isToasted = true
|
||||
)
|
||||
}
|
||||
} else {
|
||||
getString(R.string.quantityError).toast(requireContext())
|
||||
}
|
||||
|
@ -1880,18 +1888,12 @@ import org.json.JSONObject
|
|||
) {
|
||||
getString(R.string.quantityHigh).toast(requireContext())
|
||||
} else if (isNumber(customDialogList.getValue())) {
|
||||
try {
|
||||
originalItemScan = customDialogList.getValueTwo().toLong()
|
||||
|
||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
mpok?.start()
|
||||
/* ReviewQuantityForRefreshingAndSorting(
|
||||
customDialogList.getValue().toInt(),
|
||||
sales[storedPosition].quantity!!.toInt(),
|
||||
sales[storedPosition].pickedQuantity.toInt()
|
||||
)*/
|
||||
// SalesSorter(sales)
|
||||
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
|
@ -1905,6 +1907,15 @@ import org.json.JSONObject
|
|||
customDialogList.dismiss()
|
||||
scanRequest()
|
||||
}
|
||||
} catch (ex: Exception) {
|
||||
ma.messageWithSound(
|
||||
getString(R.string.errorReviewItem),
|
||||
true,
|
||||
isPlayed = true,
|
||||
isToasted = true
|
||||
)
|
||||
getString(R.string.errorReviewItem).toast(requireContext())
|
||||
}
|
||||
} else {
|
||||
getString(R.string.quantityError).toast(requireContext())
|
||||
}
|
||||
|
@ -2224,7 +2235,7 @@ import org.json.JSONObject
|
|||
|
||||
}
|
||||
|
||||
/* private fun showDisponibility() {
|
||||
/* private fun showDisponibility() {
|
||||
|
||||
customDialogInput.setTitle(getString(R.string.Verdisponible))
|
||||
.setDescription(getString(R.string.Escaneaetiqueta))
|
||||
|
@ -2542,7 +2553,7 @@ import org.json.JSONObject
|
|||
}
|
||||
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
/*
|
||||
/*
|
||||
val ticket =
|
||||
"[" + sales[positionCollectionMissing].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionMissing].ticketFk + "/summary)"
|
||||
|
||||
|
@ -2661,13 +2672,20 @@ import org.json.JSONObject
|
|||
customDialogInput.setTitle("" + sale.itemFk)
|
||||
.setDescription(getString(R.string.scanWagonForItem))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
if (!customDialogInput.getValue()
|
||||
.isNullOrEmpty()
|
||||
) {
|
||||
//Tarea 5675
|
||||
// if (!customDialogInput.getValue().contains("-")){
|
||||
findSale(customDialogInput.getValue(), index)
|
||||
//}else{
|
||||
// ma.messageWithSound(getString(R.string.shelvingError),true,true,"Error",true)
|
||||
//}
|
||||
findSale(customDialogInput.getValue(), index,false)
|
||||
|
||||
} else {
|
||||
ma.messageWithSound(
|
||||
getString(R.string.shelvingError),
|
||||
true,
|
||||
true,
|
||||
"Error",
|
||||
true
|
||||
)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
|
@ -2680,7 +2698,8 @@ import org.json.JSONObject
|
|||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
findSale(customDialogInput.getValue(), index)
|
||||
//Tarea 5675
|
||||
findSale(customDialogInput.getValue(), index, false)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
|
@ -2847,6 +2866,6 @@ import org.json.JSONObject
|
|||
return myList
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue