feat issues refs #7636
This commit is contained in:
parent
a2aae3bd73
commit
1bd592db0f
|
@ -274,7 +274,7 @@ class EndSacadorFragment(
|
|||
}
|
||||
})
|
||||
|
||||
loadResponseSaleGropAdd.observe(viewLifecycleOwner) { event ->
|
||||
loadResponseSaleGroupAdd.observe(viewLifecycleOwner) { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
|
||||
if (!goBack) {
|
||||
|
|
|
@ -83,9 +83,15 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
private val _responseSaleGroupAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleGroupAdd: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleGroupAdd
|
||||
val loadResponseSaleGropAdd: LiveData<Event<ResponseItemVO>> =
|
||||
val loadResponseSaleGroupAdd: LiveData<Event<ResponseItemVO>> =
|
||||
_responseSaleGroupAdd.map { Event(it) }
|
||||
|
||||
private val _responseSaleGroupAdded by lazy { MutableLiveData<Int>() }
|
||||
val responseSaleGroupAdded: LiveData<Int>
|
||||
get() = _responseSaleGroupAdded
|
||||
val loadResponseSaleGropAdded: LiveData<Event<Int>> =
|
||||
_responseSaleGroupAdded.map { Event(it) }
|
||||
|
||||
private val _responseReserveSectorCollection by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseReserveSectorCollection: LiveData<ResponseItemVO>
|
||||
get() = _responseReserveSectorCollection
|
||||
|
@ -311,7 +317,7 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun sectorCollectionSaleGroupAdd(
|
||||
vSaleGroupFk: Int, vSectorCollectionFk: Int
|
||||
vSaleGroupFk: Int, vSectorCollectionFk: Int,
|
||||
) {
|
||||
salix.sectorCollectionSaleGroupAdd(
|
||||
arrayListOf(
|
||||
|
@ -324,6 +330,7 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
_responseSaleGroupAdded.value = vSaleGroupFk
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
|
|
|
@ -115,9 +115,12 @@ class SacadorFragment(
|
|||
|
||||
iconAdd.drawable -> {
|
||||
if (type == "PREPARED") {
|
||||
if (hasSector()) {
|
||||
viewModel.collection_assign(
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (hasSector()) {
|
||||
viewModel.sectorCollectionNew(
|
||||
mobileApplication.dataStoreApp.readDataStoreKey(
|
||||
SECTORFK
|
||||
|
@ -127,6 +130,8 @@ class SacadorFragment(
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
|
||||
iconPrint.drawable -> {
|
||||
showPrintPrevious()
|
||||
|
@ -138,6 +143,21 @@ class SacadorFragment(
|
|||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun hasSector(): Boolean {
|
||||
return if (ma.haveSector()) {
|
||||
true
|
||||
} else {
|
||||
ma.messageWithSound(
|
||||
message = getString(R.string.errorSector),
|
||||
isError = true,
|
||||
isPlayed = true,
|
||||
isToasted = false
|
||||
)
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun showPrintPrevious() {
|
||||
|
||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||
|
|
|
@ -122,9 +122,11 @@ class SacadorFragmentNew(
|
|||
iconAdd.drawable -> {
|
||||
|
||||
if (type == "PREPARED") {
|
||||
if (hasSector())
|
||||
viewModel.collection_assignNew(
|
||||
)
|
||||
} else {
|
||||
if (hasSector())
|
||||
viewModel.sectorCollectionNew(
|
||||
mobileApplication.dataStoreApp.readDataStoreKey(
|
||||
SECTORFK
|
||||
|
@ -317,4 +319,18 @@ class SacadorFragmentNew(
|
|||
}
|
||||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
private fun hasSector(): Boolean {
|
||||
return if (ma.haveSector()) {
|
||||
true
|
||||
} else {
|
||||
ma.messageWithSound(
|
||||
message = getString(R.string.errorSector),
|
||||
isError = true,
|
||||
isPlayed = true,
|
||||
isToasted = false
|
||||
)
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue