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

View File

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

View File

@ -53,5 +53,14 @@ class departmentMistakeList(
class workerFromMistakeList( class workerFromMistakeList(
var list: List<WorkerFromMistake> = listOf() 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>
)