refs #3520 feat:silex→salix
This commit is contained in:
parent
0044fcfaa9
commit
5f39620f69
|
@ -59,12 +59,7 @@ class CollectionShowTicketFragment(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
if (collection.tickets.isEmpty()) {/* viewModel.collectionTicketGet(
|
||||
collection.collectionFk,
|
||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||
print = "0",
|
||||
type
|
||||
)*/
|
||||
if (collection.tickets.isEmpty()) {
|
||||
viewModel.getSales(collection.collectionFk, print = "0", type)
|
||||
}
|
||||
|
||||
|
@ -73,8 +68,7 @@ class CollectionShowTicketFragment(
|
|||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
//84ma.hideBottomNavigation(GONE)
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
||||
setEvents()
|
||||
setToolBarIcon()
|
||||
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
||||
|
@ -115,25 +109,16 @@ class CollectionShowTicketFragment(
|
|||
|
||||
private fun getCollection() {
|
||||
|
||||
//binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
if (!buttonPushedGetCollection) {
|
||||
//Tarea 3520
|
||||
viewModel.collectionGetId(
|
||||
collection.collectionFk,
|
||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||
print = "0",
|
||||
type
|
||||
)
|
||||
/*viewModel.collection_get(
|
||||
|
||||
viewModel.collectionGetId(
|
||||
collection.collectionFk,
|
||||
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
|
||||
print = "0",
|
||||
type
|
||||
)*/
|
||||
)
|
||||
buttonPushedGetCollection = true
|
||||
} else {
|
||||
//Tarea 6276
|
||||
viewModel.getSales(
|
||||
lastScanned, print = "0", type
|
||||
|
||||
|
@ -184,11 +169,9 @@ class CollectionShowTicketFragment(
|
|||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||
|
||||
try {
|
||||
//tarea 6276
|
||||
viewModel.getSales(
|
||||
binding.scanInput.text.toString().toInt(), print = "0", type
|
||||
)
|
||||
//binding.splashProgress.visibility = VISIBLE
|
||||
} catch (ex: Exception) {
|
||||
getString(R.string.scanLabelTicket).toast(requireContext())
|
||||
}
|
||||
|
@ -208,8 +191,6 @@ class CollectionShowTicketFragment(
|
|||
binding.collectionSwipe.setOnRefreshListener {
|
||||
|
||||
binding.collectionSwipe.isRefreshing = false
|
||||
//binding.splashProgress.visibility = VISIBLE
|
||||
//Tarea 6276
|
||||
viewModel.getSales(
|
||||
collection.collectionFk, print = "0", type
|
||||
)
|
||||
|
@ -228,7 +209,6 @@ class CollectionShowTicketFragment(
|
|||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
//binding.splashProgress.visibility = GONE
|
||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (!it.isError) {
|
||||
|
@ -250,7 +230,6 @@ class CollectionShowTicketFragment(
|
|||
})
|
||||
|
||||
responsePrint.observe(viewLifecycleOwner, Observer {
|
||||
// binding.splashProgress.visibility = GONE
|
||||
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(
|
||||
|
@ -269,7 +248,6 @@ class CollectionShowTicketFragment(
|
|||
private fun createCollectionList() {
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
||||
//binding.splashProgress.visibility = GONE
|
||||
val salesList: ArrayList<SaleVO> = ArrayList()
|
||||
tickets = ArrayList()
|
||||
var observations = ""
|
||||
|
@ -290,7 +268,8 @@ class CollectionShowTicketFragment(
|
|||
}
|
||||
}
|
||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||
|
||||
/*salesList.sortedWith(compareBy<SaleVO> { it.isPrepared == "0" }
|
||||
.thenBy { it.isControlled == "0" }*/
|
||||
|
||||
saleAdapter =
|
||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
||||
|
@ -314,10 +293,17 @@ class CollectionShowTicketFragment(
|
|||
binding.fragmentSacadorCollections.adapter = saleAdapter
|
||||
binding.fragmentSacadorCollections.layoutManager = lm
|
||||
setTotalLines()
|
||||
setPosition()
|
||||
printObservations(observations)
|
||||
binding.scanInput.requestFocus()
|
||||
}
|
||||
|
||||
private fun setPosition() {
|
||||
val firstIndex =
|
||||
sales.indexOfFirst { it.isPreviousPrepared == "0" && (it.isPrepared == "0" || it.isControlled == "0") }
|
||||
lm!!.scrollToPositionWithOffset(firstIndex, 0)
|
||||
}
|
||||
|
||||
private fun printObservations(observations: String) {
|
||||
if (observations.trim().isNotEmpty()) {
|
||||
customDialog.setTitle(getString(R.string.observations)).setDescription(observations)
|
||||
|
|
|
@ -293,7 +293,7 @@ class SignedActivity : BaseActivity<ActivitySignBinding>(), LocationUpdateCallba
|
|||
}
|
||||
|
||||
override fun onApplicationEventAnimation(visibility: Int) {
|
||||
binding.splashProgress.visibility = visibility
|
||||
binding.splashAnimation.visibility = visibility
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -89,8 +89,6 @@ class SupplierFragment(
|
|||
}
|
||||
|
||||
override fun init() {
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.filterSupplier.setOnClickListener {
|
||||
SimpleSearchDialogCompat(
|
||||
context,
|
||||
|
@ -190,11 +188,9 @@ class SupplierFragment(
|
|||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
supplierList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createSupplierList(it.list)
|
||||
}
|
||||
entryList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createEntryList(it.list)
|
||||
}
|
||||
|
||||
|
@ -207,7 +203,6 @@ class SupplierFragment(
|
|||
|
||||
loadEntryAdd.observe(viewLifecycleOwner) { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
|
||||
|
@ -242,7 +237,6 @@ class SupplierFragment(
|
|||
}*/
|
||||
|
||||
entry.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
|
||||
|
@ -304,7 +298,6 @@ class SupplierFragment(
|
|||
) {
|
||||
customDialog.cancel()
|
||||
customDialog.dismiss()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.entry_addFromPackaging(
|
||||
mobileApplication.dataStoreApp.readDataStoreKey("SUPPLIERID"),
|
||||
mobileApplication.dataStoreApp.readDataStoreKey<String>("ENTRYTYPE") == "Rec"
|
||||
|
|
|
@ -37,7 +37,6 @@ class ShowTicketFragment(var menuOrigin: String) :
|
|||
}
|
||||
|
||||
override fun init() {
|
||||
|
||||
binding.scanInput.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.verticket)
|
||||
ma.hideBottomNavigation(View.VISIBLE)
|
||||
|
@ -89,7 +88,7 @@ class ShowTicketFragment(var menuOrigin: String) :
|
|||
source= type
|
||||
)
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
} catch (ex: Exception) {
|
||||
ma.messageWithSound(
|
||||
getString(R.string.errorReviewItem),
|
||||
|
@ -119,7 +118,6 @@ class ShowTicketFragment(var menuOrigin: String) :
|
|||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
collectionTicketList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue