refs #5675 fix parking

This commit is contained in:
Sergio De la torre 2023-10-31 16:37:31 +01:00
parent 1f1b901047
commit f802a1e7a1
1 changed files with 2405 additions and 2386 deletions

View File

@ -391,6 +391,7 @@ import org.json.JSONObject
findSale(binding.scanInput.text.toString())
}
}
"buy" -> binding.scanInput.setText(myQr.more)
}
@ -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(),
@ -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
@ -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())
}
@ -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()