refs #7009 feat:verifyCollection
This commit is contained in:
parent
30ca458048
commit
eab544feef
|
@ -130,6 +130,7 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
private lateinit var myGroupList: List<SaleVO>
|
private lateinit var myGroupList: List<SaleVO>
|
||||||
private var canChangeState = true
|
private var canChangeState = true
|
||||||
|
private var isVerifiedCollection = false
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(collection: CollectionVO, type: String) =
|
fun newInstance(collection: CollectionVO, type: String) =
|
||||||
|
@ -174,15 +175,14 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
d("VERDNATURA::", "ENTRAMOS EN EL NUEVO FRAGMENT SACADOR")
|
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
setEvents()
|
setEvents()
|
||||||
setToolBar()
|
setToolBar()
|
||||||
|
binding.fragmentSacadorCollections.visibility = View.VISIBLE
|
||||||
if (collection.tickets.isNotEmpty()) {
|
if (collection.tickets.isNotEmpty()) {
|
||||||
createCollectionList()
|
createCollectionList()
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,6 @@ class CollectionFragmentPicker(
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
when (item) {
|
when (item) {
|
||||||
// iconViewCollection.drawable -> getCollection()
|
|
||||||
iconPrint.drawable -> print()
|
iconPrint.drawable -> print()
|
||||||
iconAdd.drawable -> addItem()
|
iconAdd.drawable -> addItem()
|
||||||
iconWorker.drawable -> showUser()
|
iconWorker.drawable -> showUser()
|
||||||
|
@ -277,7 +276,6 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
private fun updateScreen() {
|
private fun updateScreen() {
|
||||||
canChangeState = false
|
canChangeState = false
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
@ -341,30 +339,6 @@ class CollectionFragmentPicker(
|
||||||
hideKeyboard()
|
hideKeyboard()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private fun getCollection() {
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
if (!buttonPushedGetCollection) {
|
|
||||||
viewModel.collection_get(
|
|
||||||
collection.collectionFk,
|
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
|
||||||
print = "0",
|
|
||||||
type
|
|
||||||
)
|
|
||||||
buttonPushedGetCollection = true
|
|
||||||
} else {
|
|
||||||
viewModel.collectionTicketGet(
|
|
||||||
lastScanned,
|
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
|
||||||
print = "0",
|
|
||||||
type
|
|
||||||
|
|
||||||
)
|
|
||||||
buttonPushedGetCollection = false
|
|
||||||
}
|
|
||||||
lastScanned = collection.collectionFk
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private fun scanRequest() {
|
private fun scanRequest() {
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
|
@ -438,7 +412,6 @@ class CollectionFragmentPicker(
|
||||||
isMarking = false
|
isMarking = false
|
||||||
binding.collectionSwipe.isRefreshing = false
|
binding.collectionSwipe.isRefreshing = false
|
||||||
// if (type != PRECHECKER) {
|
// if (type != PRECHECKER) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
@ -475,7 +448,6 @@ class CollectionFragmentPicker(
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (!it.isError) {
|
if (!it.isError) {
|
||||||
|
@ -498,7 +470,6 @@ class CollectionFragmentPicker(
|
||||||
})
|
})
|
||||||
|
|
||||||
responseUsedShelves.observe(viewLifecycleOwner, Observer {
|
responseUsedShelves.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
|
@ -509,10 +480,9 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
})
|
})
|
||||||
responseParking.observe(viewLifecycleOwner, Observer {
|
responseParking.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
if (it.isError) it.errorMessage else getString(R.string.Aparcado),
|
if (it.isError) it.errorMessage else getString(R.string.Aparcado),
|
||||||
it.isError, true
|
it.isError, true
|
||||||
|
@ -522,7 +492,6 @@ class CollectionFragmentPicker(
|
||||||
})
|
})
|
||||||
|
|
||||||
responsePrint.observe(viewLifecycleOwner, Observer {
|
responsePrint.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
|
|
||||||
|
@ -543,7 +512,6 @@ class CollectionFragmentPicker(
|
||||||
})
|
})
|
||||||
|
|
||||||
responseSplit.observe(viewLifecycleOwner) {
|
responseSplit.observe(viewLifecycleOwner) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
|
|
||||||
|
@ -571,7 +539,6 @@ class CollectionFragmentPicker(
|
||||||
ma.messageWithSound(it.errorMessage, true, true)
|
ma.messageWithSound(it.errorMessage, true, true)
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(getString(R.string.previousCollected), false, true)
|
ma.messageWithSound(getString(R.string.previousCollected), false, true)
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
@ -581,19 +548,16 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (!goBack) printShelvingResult(it)
|
if (!goBack) printShelvingResult(it)
|
||||||
goBack = false
|
goBack = false
|
||||||
})
|
})
|
||||||
|
|
||||||
item.observe(viewLifecycleOwner, Observer {
|
item.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (!goBack) toastDisponibility(it)
|
if (!goBack) toastDisponibility(it)
|
||||||
goBack = false
|
goBack = false
|
||||||
})
|
})
|
||||||
|
|
||||||
responseNew.observe(viewLifecycleOwner, Observer {
|
responseNew.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
// if (!goBack) {
|
// if (!goBack) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle(getString(R.string.disponibility))
|
customDialog.setTitle(getString(R.string.disponibility))
|
||||||
|
@ -604,10 +568,6 @@ class CollectionFragmentPicker(
|
||||||
}.show()
|
}.show()
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
binding.splashProgress.visibility =
|
|
||||||
View.VISIBLE
|
|
||||||
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
|
@ -625,7 +585,7 @@ class CollectionFragmentPicker(
|
||||||
})
|
})
|
||||||
|
|
||||||
responseCode.observe(viewLifecycleOwner, Observer {
|
responseCode.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (!goBack2) {
|
if (!goBack2) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle(getString(R.string.error))
|
customDialog.setTitle(getString(R.string.error))
|
||||||
|
@ -676,7 +636,6 @@ class CollectionFragmentPicker(
|
||||||
})*/
|
})*/
|
||||||
//Tarea 4280
|
//Tarea 4280
|
||||||
responseTicketClosure.observe(viewLifecycleOwner, Observer {
|
responseTicketClosure.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
if (it.response.toBoolean()) {
|
if (it.response.toBoolean()) {
|
||||||
var customDialogWarning = CustomDialog(requireContext())
|
var customDialogWarning = CustomDialog(requireContext())
|
||||||
|
@ -736,8 +695,6 @@ class CollectionFragmentPicker(
|
||||||
})*/
|
})*/
|
||||||
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
|
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
if (!goMistakeBack)
|
if (!goMistakeBack)
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
|
@ -756,7 +713,6 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
|
|
||||||
mistakeList.observe(viewLifecycleOwner, Observer {
|
mistakeList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
/*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */
|
/*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */
|
||||||
|
|
||||||
if (!goMistakeBack)
|
if (!goMistakeBack)
|
||||||
|
@ -766,7 +722,6 @@ class CollectionFragmentPicker(
|
||||||
//sergio: para si hay algun ticket por revisar antes de parkinear
|
//sergio: para si hay algun ticket por revisar antes de parkinear
|
||||||
|
|
||||||
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
|
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||||
|
|
||||||
|
@ -781,7 +736,6 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
}
|
}
|
||||||
.setKoButton(getString(R.string.review)) {
|
.setKoButton(getString(R.string.review)) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
it.response.toInt(),
|
it.response.toInt(),
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
@ -804,9 +758,8 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
loadResponseDel.observe(viewLifecycleOwner) { event ->
|
loadResponseDel.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
binding.splashProgress.visibility = View.INVISIBLE
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||||
|
@ -829,7 +782,7 @@ class CollectionFragmentPicker(
|
||||||
/* responseDel.observe(viewLifecycleOwner, Observer {
|
/* responseDel.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.splashProgress.visibility = GONE
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||||
|
@ -863,14 +816,12 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
|
|
||||||
responseSaleReplace.observe(viewLifecycleOwner, Observer {
|
responseSaleReplace.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
|
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
@ -892,12 +843,11 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event ->
|
loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
@ -967,7 +917,7 @@ class CollectionFragmentPicker(
|
||||||
var salePerson = ""
|
var salePerson = ""
|
||||||
for (it in sales) {
|
for (it in sales) {
|
||||||
if (it.ticketFk.equals(ticketFk)) {
|
if (it.ticketFk.equals(ticketFk)) {
|
||||||
salePerson = it.salePersonFk?:""
|
salePerson = it.salePersonFk ?: ""
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -980,7 +930,6 @@ class CollectionFragmentPicker(
|
||||||
state = 0
|
state = 0
|
||||||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
var salesList: ArrayList<SaleVO> = ArrayList()
|
var salesList: ArrayList<SaleVO> = ArrayList()
|
||||||
tickets = ArrayList()
|
tickets = ArrayList()
|
||||||
var observations = ""
|
var observations = ""
|
||||||
|
@ -1004,8 +953,9 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
observations = observations.takeIf { !it.isNullOrBlank() }?.plus(" ${ticket.observations}") ?: ""
|
observations =
|
||||||
}//}
|
observations.takeIf { !it.isNullOrBlank() }?.plus(" ${ticket.observations}") ?: ""
|
||||||
|
}
|
||||||
|
|
||||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||||
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder }))
|
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder }))
|
||||||
|
@ -1063,7 +1013,6 @@ class CollectionFragmentPicker(
|
||||||
object : OnMistakeClickListener {
|
object : OnMistakeClickListener {
|
||||||
override fun onMistakeClickListener(sale: SaleVO) {
|
override fun onMistakeClickListener(sale: SaleVO) {
|
||||||
//Tarea #4969
|
//Tarea #4969
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.mistakeType()
|
viewModel.mistakeType()
|
||||||
mistakeSale = sale
|
mistakeSale = sale
|
||||||
goMistakeBack = false
|
goMistakeBack = false
|
||||||
|
@ -1130,6 +1079,75 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
|
|
||||||
printObservations(observations)
|
printObservations(observations)
|
||||||
|
if (!isVerifiedCollection) {
|
||||||
|
binding.fragmentSacadorCollections.visibility = View.INVISIBLE
|
||||||
|
verifyCollection()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun verifyCollection() {
|
||||||
|
|
||||||
|
customDialogList.setTitle(
|
||||||
|
getString(R.string.verifyCollection)
|
||||||
|
)
|
||||||
|
customDialogList.setDescription(
|
||||||
|
|
||||||
|
getString(R.string.scanTicketsVerifyCollection, collection.collectionFk)
|
||||||
|
).setKoButton(getString(R.string.cancel)) {
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
customDialogList.dismiss()
|
||||||
|
ma.onMyBackPressed()
|
||||||
|
}.setValue("")
|
||||||
|
|
||||||
|
.setOkButton(getString(R.string.print)) {
|
||||||
|
print()
|
||||||
|
}
|
||||||
|
.show()
|
||||||
|
|
||||||
|
customDialogList.getEditText().requestFocus()
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
|
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
if (customDialogList.getValue().isNotEmpty()) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
var foundTicketInCollection =
|
||||||
|
collection.tickets.find { it.ticketFk == customDialogList.getValue() }
|
||||||
|
if (foundTicketInCollection != null) {
|
||||||
|
isVerifiedCollection = true
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
binding.fragmentSacadorCollections.visibility = View.VISIBLE
|
||||||
|
customDialogList.dismiss()
|
||||||
|
binding.scanInput.requestFocus()
|
||||||
|
} else {
|
||||||
|
|
||||||
|
throw Exception(getString(R.string.ticketErrorCollection))
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ma.messageWithSound(
|
||||||
|
ex.message.toString(),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true,
|
||||||
|
isToasted = true
|
||||||
|
)
|
||||||
|
//listSalesGroup.removeAt(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// listSaleGroupAdapter!!.notifyItemChanged(0)
|
||||||
|
}
|
||||||
|
customDialogList.setValue("")
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
customDialogList.getRecyclerView().layoutManager =
|
||||||
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setScrollListener(lm: LinearLayoutManager) {
|
private fun setScrollListener(lm: LinearLayoutManager) {
|
||||||
|
@ -1138,7 +1156,6 @@ class CollectionFragmentPicker(
|
||||||
RecyclerView.OnScrollListener() {
|
RecyclerView.OnScrollListener() {
|
||||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||||
storedBackPosition = lm.findFirstVisibleItemPosition()
|
storedBackPosition = lm.findFirstVisibleItemPosition()
|
||||||
d("VERDNATURA::", "La pos es" + storedBackPosition)
|
|
||||||
super.onScrolled(recyclerView, dx, dy)
|
super.onScrolled(recyclerView, dx, dy)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1277,8 +1294,7 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgress.visibility =
|
|
||||||
View.VISIBLE
|
|
||||||
storedPosition = 0
|
storedPosition = 0
|
||||||
storedBackPosition = 0
|
storedBackPosition = 0
|
||||||
// if (type != PRECHECKER) {
|
// if (type != PRECHECKER) {
|
||||||
|
@ -1292,7 +1308,7 @@ class CollectionFragmentPicker(
|
||||||
)
|
)
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.error),
|
getString(R.string.error),
|
||||||
isError = false,
|
isError = false,
|
||||||
|
@ -1507,7 +1523,6 @@ class CollectionFragmentPicker(
|
||||||
private fun saleTrackingReplace(position: Int, type: String) {
|
private fun saleTrackingReplace(position: Int, type: String) {
|
||||||
|
|
||||||
//Tarea #4371 se quita para ver si funciona correctamente
|
//Tarea #4371 se quita para ver si funciona correctamente
|
||||||
//binding.splashProgress.visibility=VISIBLE
|
|
||||||
viewModel.saleTrackingReplace(
|
viewModel.saleTrackingReplace(
|
||||||
saleFk = sales[position].saleFk,
|
saleFk = sales[position].saleFk,
|
||||||
isChecked = 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",
|
||||||
|
@ -1523,7 +1538,6 @@ class CollectionFragmentPicker(
|
||||||
//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) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.run {
|
viewModel.run {
|
||||||
saleTracking_mark(
|
saleTracking_mark(
|
||||||
saleFk = sales[position].saleFk,
|
saleFk = sales[position].saleFk,
|
||||||
|
@ -1568,8 +1582,6 @@ class CollectionFragmentPicker(
|
||||||
setListPosition(position, false)
|
setListPosition(position, false)
|
||||||
if (type != PRECHECKER) {
|
if (type != PRECHECKER) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
|
|
||||||
viewModel.itemShelvingUpdateFromSale(
|
viewModel.itemShelvingUpdateFromSale(
|
||||||
sales[position].saleFk
|
sales[position].saleFk
|
||||||
)
|
)
|
||||||
|
@ -1591,7 +1603,7 @@ class CollectionFragmentPicker(
|
||||||
private fun showShelving(position: Int, shelvingPosition: Int) {
|
private fun showShelving(position: Int, shelvingPosition: Int) {
|
||||||
storedShelvingPosition = shelvingPosition
|
storedShelvingPosition = shelvingPosition
|
||||||
storedPosition = position
|
storedPosition = position
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
var quantityGet = 0
|
var quantityGet = 0
|
||||||
try {
|
try {
|
||||||
quantityGet =
|
quantityGet =
|
||||||
|
@ -1673,8 +1685,7 @@ class CollectionFragmentPicker(
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
} else {
|
} else {
|
||||||
itemShelvingFkStored = itemShelvingFk
|
itemShelvingFkStored = itemShelvingFk
|
||||||
binding.splashProgress.visibility =
|
|
||||||
View.VISIBLE
|
|
||||||
|
|
||||||
viewModel.getIdFromCodeSalix(
|
viewModel.getIdFromCodeSalix(
|
||||||
code = customDialogList.getValueTwo(),
|
code = customDialogList.getValueTwo(),
|
||||||
|
@ -1762,7 +1773,6 @@ class CollectionFragmentPicker(
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
} else {
|
} else {
|
||||||
itemShelvingFkStored = itemShelvingFk
|
itemShelvingFkStored = itemShelvingFk
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
|
|
||||||
|
|
||||||
viewModel.getIdFromCodeSalix(
|
viewModel.getIdFromCodeSalix(
|
||||||
|
@ -1973,8 +1983,6 @@ class CollectionFragmentPicker(
|
||||||
) {
|
) {
|
||||||
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgress.visibility =
|
|
||||||
View.VISIBLE
|
|
||||||
|
|
||||||
//sergio datos para mensaje salix
|
//sergio datos para mensaje salix
|
||||||
|
|
||||||
|
@ -2041,8 +2049,6 @@ class CollectionFragmentPicker(
|
||||||
) {
|
) {
|
||||||
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgress.visibility =
|
|
||||||
View.VISIBLE
|
|
||||||
|
|
||||||
dataMessageSalix = DataMessageSalix(
|
dataMessageSalix = DataMessageSalix(
|
||||||
ticket = ticketSelected,
|
ticket = ticketSelected,
|
||||||
|
@ -2165,7 +2171,6 @@ class CollectionFragmentPicker(
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.ticketCollection_setUsedShelves(
|
viewModel.ticketCollection_setUsedShelves(
|
||||||
ticketFk = collection.collectionFk,
|
ticketFk = collection.collectionFk,
|
||||||
usedShelves = customDialogInput.getValue().toInt()
|
usedShelves = customDialogInput.getValue().toInt()
|
||||||
|
@ -2194,7 +2199,6 @@ class CollectionFragmentPicker(
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.ticketCollection_setUsedShelves(
|
viewModel.ticketCollection_setUsedShelves(
|
||||||
ticketFk = collection.collectionFk,
|
ticketFk = collection.collectionFk,
|
||||||
usedShelves = customDialogInput.getValue().toInt()
|
usedShelves = customDialogInput.getValue().toInt()
|
||||||
|
@ -2263,7 +2267,6 @@ class CollectionFragmentPicker(
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||||
|
@ -2418,7 +2421,6 @@ class CollectionFragmentPicker(
|
||||||
private fun showMistakeList(list: List<MistakeTypeVO>) {
|
private fun showMistakeList(list: List<MistakeTypeVO>) {
|
||||||
|
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
listPlacementSupply = ArrayList()
|
listPlacementSupply = ArrayList()
|
||||||
list.forEach {
|
list.forEach {
|
||||||
listPlacementSupply.add(BarcodeVO(code = it.description))
|
listPlacementSupply.add(BarcodeVO(code = it.description))
|
||||||
|
@ -2496,7 +2498,7 @@ class CollectionFragmentPicker(
|
||||||
isPrepared = value[0].isPrepared,
|
isPrepared = value[0].isPrepared,
|
||||||
isPreviousPrepared = value[0].isPreviousPrepared,
|
isPreviousPrepared = value[0].isPreviousPrepared,
|
||||||
isControlled = value[0].isControlled,
|
isControlled = value[0].isControlled,
|
||||||
line3 = value[0].code?:"", //6276
|
line3 = value[0].code ?: "", //6276
|
||||||
picked = value[0].picked,
|
picked = value[0].picked,
|
||||||
ticketFk = value[0].ticketFk,
|
ticketFk = value[0].ticketFk,
|
||||||
level = value[0].level
|
level = value[0].level
|
||||||
|
@ -2510,8 +2512,8 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
mySale.line1 = "Previa :${mySale.saleGroupFk}"
|
mySale.line1 = "Previa :${mySale.saleGroupFk}"
|
||||||
mySale.line2 = "Líneas: ${value.size}"
|
mySale.line2 = "Líneas: ${value.size}"
|
||||||
mySale.line3 = value[0].code?:""//6276
|
mySale.line3 = value[0].code ?: ""//6276
|
||||||
mySale.placements = listOf(PlacementVO(shelving = value[0].code?:""))//6276
|
mySale.placements = listOf(PlacementVO(shelving = value[0].code ?: ""))//6276
|
||||||
|
|
||||||
myList.add(mySale)
|
myList.add(mySale)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -6,8 +6,6 @@ import android.media.MediaPlayer
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.View
|
|
||||||
import android.view.View.GONE
|
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
|
@ -429,10 +427,10 @@ class EndSacadorFragment(
|
||||||
ticket = ticketFk
|
ticket = ticketFk
|
||||||
|
|
||||||
if (ticketFk != 0)
|
if (ticketFk != 0)
|
||||||
viewModel.sectorCollectionSaleGroupAdd(
|
viewModel.sectorCollectionSaleGroupAdd(
|
||||||
ticketFk,
|
ticketFk,
|
||||||
collection.collectionFk
|
collection.collectionFk
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createSaleList(salesList: List<PreSacadorItemVO>) {
|
private fun createSaleList(salesList: List<PreSacadorItemVO>) {
|
||||||
|
|
Loading…
Reference in New Issue