refs #6276: prepare Salixback

This commit is contained in:
Sergio De la torre 2024-01-03 14:16:31 +01:00
parent d6255b03be
commit e29ba01e51
3 changed files with 35 additions and 67 deletions

View File

@ -51,7 +51,6 @@ import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.sacador.model.*
import org.json.JSONObject
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class CollectionFragmentPreChecker(
var collection: CollectionVO = CollectionVO(0),
@ -185,7 +184,6 @@ class CollectionFragmentPreChecker(
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
}
val listIcons: ArrayList<ImageView> = ArrayList()
val iconPrint = ImageView(context)
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
@ -256,7 +254,6 @@ class CollectionFragmentPreChecker(
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
private fun updateScreen() {
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet(
@ -267,7 +264,6 @@ class CollectionFragmentPreChecker(
)
}
private fun markPrevia(saleGroupScanned: String): Boolean {
for (indice in sales.indices) {
@ -409,7 +405,6 @@ class CollectionFragmentPreChecker(
saleGroup = at.saleGroupFk
}
}
}
}
@ -459,7 +454,6 @@ class CollectionFragmentPreChecker(
}
}
private fun showKeyboards() {
try {
requireActivity().showKeyboard()
@ -732,7 +726,6 @@ class CollectionFragmentPreChecker(
responseSaleMistakeAdd.observe(viewLifecycleOwner, Observer {
if (!goBack) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, isError = true, true)
@ -852,7 +845,6 @@ class CollectionFragmentPreChecker(
}
}
/* responseDel.observe(viewLifecycleOwner, Observer {
if (it.isError) {
@ -999,7 +991,6 @@ class CollectionFragmentPreChecker(
}
} else {
goBack = false
}
@ -1019,11 +1010,9 @@ class CollectionFragmentPreChecker(
goBack = false
}
}
})
}
}
@ -1045,7 +1034,6 @@ class CollectionFragmentPreChecker(
private fun callPicker(extensionNumber: String) {
try {
val intent = Intent(Intent.ACTION_DIAL).apply {
data = Uri.parse("tel:$extensionNumber")
@ -1056,7 +1044,6 @@ class CollectionFragmentPreChecker(
// d("VERDNATURA::" + e.message)
}
}
private fun getSalePerson(ticketFk: Int): String {
@ -1120,7 +1107,6 @@ class CollectionFragmentPreChecker(
observations = observations + " " + ticket.observations
}//}
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
if (type == CONTROLADOR || type == PRECHECKER) {
@ -1269,7 +1255,6 @@ class CollectionFragmentPreChecker(
//SEARCH AND MARK
private fun findSale(txtscan: String) {
var index = 0
var isBreak = false
@ -1325,7 +1310,6 @@ class CollectionFragmentPreChecker(
if (txtscan.contains("-")) {
if (tickets.size > 0) {
viewModel.setParking(
ticketFk = tickets[0].toInt(),
parking = txtscan
@ -1369,7 +1353,6 @@ class CollectionFragmentPreChecker(
if (!isOk) {
if (txtscan.contains("-")) {
if (tickets.size > 0) {
ticketToParking = tickets[0]
@ -1544,7 +1527,6 @@ class CollectionFragmentPreChecker(
s.isPreControlled = "0"
}
}
}
@ -1597,7 +1579,6 @@ class CollectionFragmentPreChecker(
}
}
}
private fun saleTrackingReplace(position: Int, type: String) {
@ -1606,17 +1587,16 @@ class CollectionFragmentPreChecker(
//binding.splashProgress.visibility=VISIBLE
viewModel.saleTrackingReplace(
saleFk = sales[position].saleFk,
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
vOriginalQuantity = sales[position].pickedQuantity!!,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan!!,
vIsScanned = isScanned
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
originalQuantity = sales[position].pickedQuantity!!,
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
buyFk = originalItemScan!!,
isScanned = isScanned
)
}
//Tarea #4371 se quita para ver si funciona correctamente
private fun saleTracking_mark(position: Int, type: String) {
@ -1624,13 +1604,13 @@ class CollectionFragmentPreChecker(
viewModel.run {
saleTracking_mark(
saleFk = sales[position].saleFk,
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
vOriginalQuantity = sales[position].pickedQuantity!!,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan!!,
vItemShelvingFk = itemShelvingTracking_mark,
vQuantity = customDialogList.getValue().toInt(),
vIsScanned = isScanned
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
originalQuantity = sales[position].pickedQuantity!!,
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
buyFk = originalItemScan!!,
itemShelvingFk = itemShelvingTracking_mark,
quantity = customDialogList.getValue().toInt(),
isScanned = isScanned
)
}
@ -1650,7 +1630,6 @@ class CollectionFragmentPreChecker(
setListPosition(position, false)
if (type != PRECHECKER) {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelving_updateFromSale(
@ -1665,7 +1644,6 @@ class CollectionFragmentPreChecker(
"saleTracking_del"
)*/
}
setTotalLines()
scanRequest()
@ -1830,7 +1808,6 @@ class CollectionFragmentPreChecker(
).toString()
)
// Log.i("VERDNATURA:","Comprobando COGER-1")
if (customDialogList.getValueTwo().isNotEmpty()) {
try {
@ -1947,7 +1924,6 @@ class CollectionFragmentPreChecker(
setListPosition(storedPosition, isFromBack)
}
private fun checkItemScan(valueToCheck: String): Boolean {
d("VERDNATURA::", "Entramos a ver el checkItem")
if (storedPosition >= 0 && sales.size > storedPosition) {
@ -2019,7 +1995,6 @@ class CollectionFragmentPreChecker(
//OPTIONS
private fun print() {
if (ma.havePrinter() && ma.haveSector()) {
showDialogLabelCount()
@ -2110,7 +2085,6 @@ class CollectionFragmentPreChecker(
//hideKeyboards()
return@setOnEditorActionListener true
}
false
@ -2169,7 +2143,6 @@ class CollectionFragmentPreChecker(
customDialogList.getRecyclerView().layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
}
private fun toastDisponibility(item: ItemVO) {
@ -2228,14 +2201,11 @@ class CollectionFragmentPreChecker(
changeTicketState()
}
}
private fun ticketCollection_setUsedShelves() {
if (type.equals("CHECKER") && (isMarking && (getData(SECTORDESCRIP).uppercase() != getString(
R.string.sectorALGEMESI
) && getData(SECTORDESCRIP).uppercase() != getString(
@ -2244,7 +2214,6 @@ class CollectionFragmentPreChecker(
))
) {
customDialogInput.setTitle(getString(R.string.shlevesNumber))
.setDescription(getString(R.string.shlevesNumberTicket))
.setOkButton(getString(R.string.accept)) {
@ -2267,10 +2236,8 @@ class CollectionFragmentPreChecker(
false
}
}
}
private fun customDialogSetUsed() {
@ -2289,25 +2256,24 @@ class CollectionFragmentPreChecker(
hideKeyboards()
}
/* private fun customDialogInputPacking(itemFk: Int) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
/* private fun customDialogInputPacking(itemFk: Int) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
viewModel.item_updatePackingShelve(
vSelf = itemFk,
vPacking = customDialogInput.getValue().toInt()
)
binding.splashProgress.visibility = VISIBLE
viewModel.item_updatePackingShelve(
vSelf = itemFk,
vPacking = customDialogInput.getValue().toInt()
)
}
customDialogInput.setValue("")
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}*/
}
customDialogInput.setValue("")
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}*/
//FALTAS / BASURA / SPLIT
private fun showQuantityDialog(position: Int) {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
.setValue("")
@ -2345,7 +2311,6 @@ class CollectionFragmentPreChecker(
getString(R.string.Split)
)*/
.setOkButtonAdd(getString(R.string.Agregar)) {
/* checkAndCall(
position,
@ -2363,7 +2328,6 @@ class CollectionFragmentPreChecker(
customDialogThreeButtons.setFocusDialogValue()
}
private fun missingTrashSuccesful() {
var message = ""
@ -2426,7 +2390,6 @@ class CollectionFragmentPreChecker(
quantity = quantity.toString()
)
}
//ESTADOS
@ -2457,7 +2420,6 @@ class CollectionFragmentPreChecker(
}
}
//OTROS
private fun showScanner(index: Int, sale: SaleVO) {
customDialogInput.getEditText().inputType = TYPE_CLASS_TEXT
@ -2527,7 +2489,6 @@ class CollectionFragmentPreChecker(
}
}
private fun showMistakeList(list: List<MistakeTypeVO>) {
@ -2586,7 +2547,6 @@ class CollectionFragmentPreChecker(
}
}
private fun groupSaleGroup(salesList: ArrayList<SaleVO>): MutableList<SaleVO> {
var myMap = salesList.groupBy { it.saleGroupFk }
var myList: MutableList<SaleVO> = mutableListOf()
@ -2636,7 +2596,6 @@ class CollectionFragmentPreChecker(
}
}
}
}

View File

@ -127,7 +127,7 @@ class PackagingSummaryFragment(
WorkermistakeAdapter(listWorker, object : onMistakeWorkerClickListener {
override fun onMistakeWorkerClickListener(item: WorkerFromMistake) {
viewModel.workerMistakeType_get(
viewModel.workerMistakeTypeGet(
)
workerMistakeName =
WorkerFromMistake(

View File

@ -53,5 +53,14 @@ class departmentMistakeList(
class workerFromMistakeList(
var list: List<WorkerFromMistake> = listOf()
)
class MakeMultiSalix(
var shelvingFk: String,
var items: List<Long>,
var warehouseFk: Int
)
class SaleTrackingDelSalix(
var saleFk: Int,
var stateCodes: List<String>
)