feat: refs #6861 reservas

This commit is contained in:
Sergio De la torre 2024-10-16 11:40:48 +02:00
parent 24ccf9ce2f
commit d7ca5c3e08
1 changed files with 36 additions and 16 deletions

View File

@ -344,18 +344,28 @@ class CollectionFragmentPickerNew(
}
}
responseExistsItemShelvingSale.observe(viewLifecycleOwner) {
if (!goBack) {
if (it.exists) {
markLine(it.position, it.quantity, true)
} else {
loadExistsResponse.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
getString(R.string.updateSalesReserve).toast(
requireContext()
)
viewModel.collectionTicketGetSalix(collection.collectionFk, false)
updateScreen()
}
}
loadFindItemShelvingResponse.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
if (it.shelvingFk != myGroupList[it.position].code) {
getString(R.string.updateSalesReserve).toast(
requireContext()
)
updateScreen()
} else {
markLine(it.position, it.quantity, true)
}
}
}
responseParking.observe(viewLifecycleOwner) {
@ -859,13 +869,22 @@ class CollectionFragmentPickerNew(
}.setOkButtonTwo(getString(R.string.no)) {
scanRequest()
customDialogThreeButtonsQuantity.dismiss()
if (quantity == 0) {
viewModel.itemShelvingSaleExists(
myGroupList[position].itemShelvingSaleFk, position, quantity
myGroupList[position].itemShelvingSaleFk,
myGroupList[position].itemShelvingFk,
position,
quantity
)
/* if (quantity == 0) {
viewModel.itemShelvingSaleExists(
myGroupList[position].itemShelvingSaleFk,
myGroupList[position].itemShelvingFk,
position,
quantity
)
} else {
markLine(position, quantity, true)
}
}*/
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtonsQuantity.dismiss()
@ -1143,7 +1162,8 @@ class CollectionFragmentPickerNew(
origin = value[0].origin,
size = value[0].size,
itemShelvingSaleFk = value[0].itemShelvingSaleFk,
longName = value[0].parkingCode ?: ""
longName = value[0].parkingCode ?: "",
itemShelvingFk = 0
)
//prime elemento//hay que hacer una copia si no queda la referencia