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