refs #6810 feat:crashlytics
This commit is contained in:
parent
343d9434e1
commit
abf1dfd37b
|
@ -41,7 +41,23 @@ import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.*
|
import es.verdnatura.presentation.common.DataMessageSalix
|
||||||
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnTicketClickListener
|
||||||
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.common.addViewObserver
|
||||||
|
import es.verdnatura.presentation.common.hideKeyboard
|
||||||
|
import es.verdnatura.presentation.common.itemScanIsQr
|
||||||
|
import es.verdnatura.presentation.common.itemScanValue
|
||||||
|
import es.verdnatura.presentation.common.onPackingClickListener
|
||||||
|
import es.verdnatura.presentation.common.showKeyboard
|
||||||
|
import es.verdnatura.presentation.common.showKeyboardIn
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||||
|
@ -52,7 +68,12 @@ import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapter
|
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapter
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.*
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
|
@ -997,6 +1018,12 @@ class CollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if (type == CONTROLADOR) {
|
||||||
|
myGroupList.sortedByDescending{ it.isAdded }.sortedWith(
|
||||||
|
compareBy { it.picked })
|
||||||
|
} else {
|
||||||
|
myGroupList
|
||||||
|
},*/
|
||||||
saleAdapter =
|
saleAdapter =
|
||||||
SaleAdapter(
|
SaleAdapter(
|
||||||
myGroupList,
|
myGroupList,
|
||||||
|
@ -1201,43 +1228,48 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
} else if (type == CONTROLADOR || type == PRECHECKER) {
|
} else if (type == CONTROLADOR || type == PRECHECKER) {
|
||||||
|
|
||||||
for (saleVO in sales) {
|
try {
|
||||||
//0-Salegroup
|
|
||||||
|
|
||||||
if (saleVO.isControlled == "0") {
|
for (saleVO in sales) {
|
||||||
//1- Por itemFk
|
//0-Salegroup
|
||||||
if (txtscan == saleVO.itemFk.toString()) {
|
|
||||||
if (mpok != null) mpok!!.start()
|
|
||||||
isOk = true
|
|
||||||
//Tarea 6067
|
|
||||||
// if (saleVO.packingChecked == 1) {
|
|
||||||
markLine(index, type)
|
|
||||||
// } else {
|
|
||||||
// saleVO.packingChecked = saleVO.packingChecked - 1
|
|
||||||
//}
|
|
||||||
//saleAdapter!!.notifyDataSetChanged()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
//2- Por barcode
|
|
||||||
saleVO.Barcodes.forEach { barcode ->
|
|
||||||
|
|
||||||
if (txtscan == barcode) {
|
if (saleVO.isControlled == "0") {
|
||||||
|
//1- Por itemFk
|
||||||
|
if (txtscan == saleVO.itemFk.toString()) {
|
||||||
if (mpok != null) mpok!!.start()
|
if (mpok != null) mpok!!.start()
|
||||||
isOk = true
|
isOk = true
|
||||||
//Tarea 6067
|
//Tarea 6067
|
||||||
//if (saleVO.packingChecked == 1) {
|
// if (saleVO.packingChecked == 1) {
|
||||||
markLine(index, type)
|
markLine(index, type)
|
||||||
//} else {
|
// } else {
|
||||||
// saleVO.packingChecked = saleVO.packingChecked - 1
|
// saleVO.packingChecked = saleVO.packingChecked - 1
|
||||||
//}
|
//}
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
//saleAdapter!!.notifyDataSetChanged()
|
||||||
isBreak = true
|
break
|
||||||
}
|
}
|
||||||
}
|
//2- Por barcode
|
||||||
|
saleVO.Barcodes.forEach { barcode ->
|
||||||
|
|
||||||
if (isBreak) break
|
if (txtscan == barcode) {
|
||||||
|
if (mpok != null) mpok!!.start()
|
||||||
|
isOk = true
|
||||||
|
//Tarea 6067
|
||||||
|
//if (saleVO.packingChecked == 1) {
|
||||||
|
markLine(index, type)
|
||||||
|
//} else {
|
||||||
|
// saleVO.packingChecked = saleVO.packingChecked - 1
|
||||||
|
//}
|
||||||
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
isBreak = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBreak) break
|
||||||
|
}
|
||||||
|
index += 1
|
||||||
}
|
}
|
||||||
index += 1
|
} catch (ex: Exception) {
|
||||||
|
getString(R.string.errorInput).toast(requireContext())
|
||||||
}
|
}
|
||||||
//Lo escaneado no encontrado miramos si es parking o ticket
|
//Lo escaneado no encontrado miramos si es parking o ticket
|
||||||
if (!isOk) {
|
if (!isOk) {
|
||||||
|
@ -1254,42 +1286,51 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgress.visibility =
|
|
||||||
VISIBLE
|
|
||||||
storedPosition = 0
|
storedPosition = 0
|
||||||
storedBackPosition = 0
|
storedBackPosition = 0
|
||||||
// if (type != PRECHECKER) {
|
// if (type != PRECHECKER) {
|
||||||
isMarking = false
|
isMarking = false
|
||||||
|
|
||||||
try {
|
try {
|
||||||
viewModel.collectionTicketGet(
|
var myScan = txtscan.toInt()
|
||||||
txtscan.toInt(),
|
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
var hasItemSales = sales.any {
|
||||||
print = "0",
|
it.itemFk == txtscan.toInt()
|
||||||
type
|
}
|
||||||
)
|
if (!hasItemSales) {
|
||||||
|
binding.splashProgress.visibility =
|
||||||
|
VISIBLE
|
||||||
|
viewModel.collectionTicketGet(
|
||||||
|
myScan,
|
||||||
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
print = "0",
|
||||||
|
type
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if (type.equals(CONTROLADOR)) {
|
||||||
|
binding.splashProgress.visibility =
|
||||||
|
VISIBLE
|
||||||
|
viewModel.ticketIsOutClosureZone(
|
||||||
|
myScan
|
||||||
|
)
|
||||||
|
//Tarea 6458
|
||||||
|
viewModel.ticketState(myScan)
|
||||||
|
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
mperror!!.start()
|
||||||
|
}
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
ma.messageWithSound(
|
getString(R.string.errorInput).toast(requireContext())
|
||||||
getString(R.string.error),
|
|
||||||
isError = false,
|
|
||||||
isPlayed = false
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type.equals(CONTROLADOR)) {
|
|
||||||
viewModel.ticketIsOutClosureZone(
|
|
||||||
txtscan.toInt()
|
|
||||||
)
|
|
||||||
//Tarea 6458
|
|
||||||
viewModel.ticketState(txtscan.toInt())
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findSale(txtscan: String, position: Int) {
|
private fun findSale(txtscan: String, position: Int) {
|
||||||
|
@ -1539,7 +1580,11 @@ class CollectionFragment(
|
||||||
state = 0
|
state = 0
|
||||||
if (sales[position].isPrepared == "1") {
|
if (sales[position].isPrepared == "1") {
|
||||||
customDialog.setTitle(getString(R.string.unmarkLine))
|
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)) {
|
.setOkButton(getString(R.string.unmark)) {
|
||||||
sales[position].isPrepared = "0"
|
sales[position].isPrepared = "0"
|
||||||
sales[position].pickedQuantity = 0
|
sales[position].pickedQuantity = 0
|
||||||
|
@ -1966,7 +2011,9 @@ class CollectionFragment(
|
||||||
itemFk = customDialogList.getValue().toInt(),
|
itemFk = customDialogList.getValue().toInt(),
|
||||||
ticketFk = ticketSelected,
|
ticketFk = ticketSelected,
|
||||||
quantityFk = customDialogList.getValueTwo().toInt(),
|
quantityFk = customDialogList.getValueTwo().toInt(),
|
||||||
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
|
WAREHOUSEFK
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2194,18 +2241,23 @@ class CollectionFragment(
|
||||||
//FALTAS / BASURA / SPLIT
|
//FALTAS / BASURA / SPLIT
|
||||||
|
|
||||||
private fun showQuantityDialog(position: Int) {
|
private fun showQuantityDialog(position: Int) {
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
try {
|
||||||
.setValue("")
|
|
||||||
.setOkButtonAdd(getString(R.string.Agregar)) {
|
|
||||||
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
|
||||||
scanRequest()
|
|
||||||
customDialogThreeButtons.dismiss()
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
||||||
scanRequest()
|
.setValue("")
|
||||||
customDialogThreeButtons.dismiss()
|
.setOkButtonAdd(getString(R.string.Agregar)) {
|
||||||
}.show()
|
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
||||||
customDialogThreeButtons.setFocusDialogValue()
|
scanRequest()
|
||||||
|
customDialogThreeButtons.dismiss()
|
||||||
|
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtons.dismiss()
|
||||||
|
}.show()
|
||||||
|
customDialogThreeButtons.setFocusDialogValue()
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
getString(R.string.errorInput).toast(requireContext())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun missingTrashSuccesful() {
|
private fun missingTrashSuccesful() {
|
||||||
|
|
|
@ -63,10 +63,11 @@ class ReubicationCollectionFragment(
|
||||||
|
|
||||||
for (item in list) {
|
for (item in list) {
|
||||||
item.code = shelving.uppercase()
|
item.code = shelving.uppercase()
|
||||||
for (i in item.carros) {
|
if (!item.carros.isNullOrEmpty()) {
|
||||||
i.visible = "(" + i.visible + ")"
|
for (i in item.carros) {
|
||||||
|
i.visible = "(" + i.visible + ")"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = ReubicatorAdapter(list.sortedWith(compareBy { item ->
|
adapter = ReubicatorAdapter(list.sortedWith(compareBy { item ->
|
||||||
|
|
Loading…
Reference in New Issue