refs #3520 feat:silex→salix

This commit is contained in:
Sergio De la torre 2024-04-19 08:53:41 +02:00
parent 0ae481ee4a
commit 0044fcfaa9
23 changed files with 340 additions and 923 deletions

View File

@ -16,7 +16,6 @@ abstract class BaseViewModel : ViewModel, LifecycleObserver {
constructor() : super()
constructor(context: Context) : super() {
app = context as MobileApplication
silex = app.silex
salix = app.salix
}
}

View File

@ -14,7 +14,6 @@ import android.text.InputType.TYPE_CLASS_NUMBER
import android.text.InputType.TYPE_CLASS_TEXT
import android.view.KeyEvent
import android.view.KeyEvent.ACTION_DOWN
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.WindowManager
@ -183,7 +182,6 @@ class CollectionFragmentPreChecker(
customDialog = CustomDialog(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = VISIBLE
setEvents()
setToolBar()
if (collection.tickets.isNotEmpty()) {
@ -278,7 +276,6 @@ class CollectionFragmentPreChecker(
}
private fun updateScreen() {
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -342,30 +339,6 @@ class CollectionFragmentPreChecker(
hideKeyboard()
}
/* private fun getCollection() {
binding.splashProgress.visibility = VISIBLE
if (!buttonPushedGetCollection) {
//Tarea 3520
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() {
binding.scanInput.requestFocus()
@ -473,7 +446,7 @@ class CollectionFragmentPreChecker(
isMarking = false
binding.collectionSwipe.isRefreshing = false
// if (type != PRECHECKER) {
binding.splashProgress.visibility = VISIBLE
//
viewModel.collectionTicketGet(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -510,7 +483,7 @@ class CollectionFragmentPreChecker(
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
binding.splashProgress.visibility = GONE
//
collectionTicketList.observe(viewLifecycleOwner, Observer {
if (!it.isError) {
@ -533,7 +506,7 @@ class CollectionFragmentPreChecker(
})
responseUsedShelves.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
//
if (!goBack) {
ma.messageWithSound(
@ -544,10 +517,10 @@ class CollectionFragmentPreChecker(
})
responseParking.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
//
if (!goBack) {
binding.splashProgress.visibility = GONE
//
ma.messageWithSound(
if (it.isError) it.errorMessage else getString(R.string.Aparcado),
it.isError, true
@ -557,7 +530,7 @@ class CollectionFragmentPreChecker(
})
responsePrint.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
//
if (!goBack) {
@ -578,7 +551,7 @@ class CollectionFragmentPreChecker(
})
responseSplit.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE
//
if (!goBack) {
@ -605,7 +578,7 @@ class CollectionFragmentPreChecker(
ma.messageWithSound(it.errorMessage, true, true)
} else {
ma.messageWithSound(getString(R.string.previousCollected), false, true)
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -615,19 +588,17 @@ class CollectionFragmentPreChecker(
}
})
placementSuppleyList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) printShelvingResult(it)
goBack = false
})
item.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) toastDisponibility(it)
goBack = false
})
responseNew.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
// if (!goBack) {
if (it.isError) {
customDialog.setTitle(getString(R.string.disponibility))
@ -638,10 +609,6 @@ class CollectionFragmentPreChecker(
}.show()
} else {
binding.splashProgress.visibility =
VISIBLE
if (!goBack) {
viewModel.collectionTicketGet(
@ -660,7 +627,7 @@ class CollectionFragmentPreChecker(
})
responseCode.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
if (!goBack2) {
if (it.isError) {
customDialog.setTitle(getString(R.string.error))
@ -711,7 +678,7 @@ class CollectionFragmentPreChecker(
})*/
//Tarea 4280
responseTicketClosure.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
//
if (!goBack) {
if (it.response.toBoolean()) {
var customDialogWarning = CustomDialog(requireContext())
@ -771,7 +738,6 @@ class CollectionFragmentPreChecker(
})*/
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) {
if (!goMistakeBack)
@ -791,7 +757,7 @@ class CollectionFragmentPreChecker(
mistakeList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
/*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */
if (!goMistakeBack)
@ -801,7 +767,7 @@ class CollectionFragmentPreChecker(
//sergio: para si hay algun ticket por revisar antes de parkinear
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
//
if (it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, false)
@ -816,7 +782,7 @@ class CollectionFragmentPreChecker(
}
.setKoButton(getString(R.string.review)) {
binding.splashProgress.visibility = View.VISIBLE
//
viewModel.collectionTicketGet(
it.response.toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -839,9 +805,8 @@ class CollectionFragmentPreChecker(
loadResponseDel.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) {
binding.splashProgress.visibility = GONE
if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, false)
@ -863,7 +828,7 @@ class CollectionFragmentPreChecker(
/* responseDel.observe(viewLifecycleOwner, Observer {
if (it.isError) {
binding.splashProgress.visibility = GONE
//
if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, false)
@ -898,14 +863,13 @@ class CollectionFragmentPreChecker(
responseSaleReplace.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) {
if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true)
binding.splashProgress.visibility = VISIBLE
//
viewModel.collectionTicketGet(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -927,12 +891,12 @@ class CollectionFragmentPreChecker(
loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
if (it.isError) {
if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true)
binding.splashProgress.visibility = VISIBLE
//
viewModel.collectionTicketGet(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -1014,7 +978,6 @@ class CollectionFragmentPreChecker(
state = 0
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
binding.splashProgress.visibility = View.GONE
var salesList: ArrayList<SaleVO> = ArrayList()
tickets = ArrayList()
var observations = ""
@ -1100,7 +1063,7 @@ class CollectionFragmentPreChecker(
object : OnMistakeClickListener {
override fun onMistakeClickListener(sale: SaleVO) {
//Tarea #4969
binding.splashProgress.visibility = VISIBLE
viewModel.mistakeType()
mistakeSale = sale
goMistakeBack = false
@ -1299,8 +1262,6 @@ class CollectionFragmentPreChecker(
}
} else {
binding.splashProgress.visibility =
VISIBLE
storedPosition = 0
storedBackPosition = 0
// if (type != PRECHECKER) {
@ -1314,7 +1275,7 @@ class CollectionFragmentPreChecker(
)
} catch (ex: Exception) {
binding.splashProgress.visibility = GONE
ma.messageWithSound(
getString(R.string.error),
isError = false,
@ -1520,7 +1481,6 @@ class CollectionFragmentPreChecker(
}
private fun saleTrackingReplace(position: Int, type: String) {
//binding.splashProgress.visibility=VISIBLE
viewModel.saleTrackingReplace(
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",
@ -1536,7 +1496,7 @@ class CollectionFragmentPreChecker(
//Tarea #4371 se quita para ver si funciona correctamente
private fun saleTracking_mark(position: Int, type: String) {
binding.splashProgress.visibility = VISIBLE
viewModel.run {
saleTracking_mark(
saleFk = sales[position].saleFk,
@ -1566,7 +1526,7 @@ class CollectionFragmentPreChecker(
setListPosition(position, false)
if (type != PRECHECKER) {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingUpdateFromSale(
sales[position].saleFk
@ -1596,7 +1556,7 @@ class CollectionFragmentPreChecker(
private fun showShelving(position: Int, shelvingPosition: Int) {
storedShelvingPosition = shelvingPosition
storedPosition = position
binding.splashProgress.visibility = VISIBLE
var quantityGet = 0
try {
quantityGet =
@ -1675,9 +1635,6 @@ class CollectionFragmentPreChecker(
customDialogList.dismiss()
} else {
itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility =
VISIBLE
viewModel.getIdFromCodeSalix(
code = customDialogList.getValueTwo(),
)
@ -1760,7 +1717,7 @@ class CollectionFragmentPreChecker(
customDialogList.dismiss()
} else {
itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCodeSalix(
@ -1960,8 +1917,6 @@ class CollectionFragmentPreChecker(
) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else {
binding.splashProgress.visibility =
VISIBLE
//sergio datos para mensaje salix
@ -2028,8 +1983,6 @@ class CollectionFragmentPreChecker(
) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else {
binding.splashProgress.visibility =
VISIBLE
dataMessageSalix = DataMessageSalix(
ticket = ticketSelected,
@ -2176,7 +2129,7 @@ class CollectionFragmentPreChecker(
private fun customDialogSetUsed() {
if (!customDialogInput.getValue().isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
viewModel.ticketCollection_setUsedShelves(
ticketFk = collection.collectionFk,
usedShelves = customDialogInput.getValue().toInt()
@ -2262,7 +2215,7 @@ class CollectionFragmentPreChecker(
}
saleAdapter!!.notifyDataSetChanged()
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -2402,7 +2355,7 @@ class CollectionFragmentPreChecker(
private fun showMistakeList(list: List<MistakeTypeVO>) {
customDialogInput.dismiss()
binding.splashProgress.visibility = GONE
listPlacementSupply = ArrayList()
list.forEach {
listPlacementSupply.add(BarcodeVO(code = it.description))

View File

@ -199,6 +199,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
val loadResponseItemShelvingUpdate: LiveData<Event<ResponseItemVO>> =
_responseItemShelvingUpdate.map { Event(it) }
private val _responseSaleAddPrevOK by lazy { MutableLiveData<ResponseItemVO>() }
val responseSaleAddPrevOK: LiveData<ResponseItemVO>
get() = _responseSaleAddPrevOK
fun getSales(
collectionFk: Int,
print: String,
@ -233,48 +237,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
print: String,
type: String
) {
if (type == "PRECHECKER" || type == "PREPARED" || type == "CHECKER" || type == "SHOWTICKET") {
getSales(collectionFk, print, type)
} else {
silex.collection_getTickets(
collectionFk,
sectorFk,
print,
type
)
getSales(collectionFk, print, type)
.enqueue(object :
SilexCallback<CollectionVO>(context) {
override fun onError(t: Throwable) {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
}
override fun onSuccess(response: Response<CollectionVO>) {
if (response.body() != null) {
_collectionTicketList.value =
response.body()?.let { it.map(contextApp) }
} else {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}
}
//Tarea 6276 Salix collection_getTickets
@ -314,47 +279,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
})
}
/* fun collection_get(
collectionFk: Int,
sectorFk: Int,
print: String,
type: String
) {
//Falta back de Salix
// salix.collectionGet(params = arrayListOf(collectionFk, sectorFk, print, type).formatWithQuotes())
silex.collection_get(
collectionFk,
sectorFk,
print,
type
)
.enqueue(object :
SalixCallback<CollectionVO>(context) {
override fun onError(t: Throwable) {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<CollectionVO>) {
if (response.body() != null) {
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
} else {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}*/
fun collectionGetId(
ticketFk: Int,
@ -1119,76 +1044,40 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
})
}
/* fun collection_getUncheckedTicket(
collectionFk: Int
) {
silex.collection_getUncheckedTicket(
collectionFk
).enqueue(object :
SalixCallback<String>(context) {
override fun onError(t: Throwable) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<String>) {
if (response.body() != null) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = false,
response = response.body()!!,
errorMessage = ""
)
} else {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = true,
response = response.body()!!.toString(),
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}*/
fun hasUncheckedTicket(
collectionFk: Int
) {
salix.hasUncheckedTicket(collectionFk)
//silex.collection_getUncheckedTicket(collectionFk)
//silex.collection_getUncheckedTicket(collectionFk)
.enqueue(object :
SalixCallback<String>(context) {
override fun onError(t: Throwable) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<String>) {
if (response.body() != null) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = false,
response = response.body()!!,
errorMessage = ""
)
} else {
SalixCallback<String>(context) {
override fun onError(t: Throwable) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = true,
response = response.body()!!.toString(),
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
}
})
override fun onSuccess(response: Response<String>) {
if (response.body() != null) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = false,
response = response.body()!!,
errorMessage = ""
)
} else {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = true,
response = response.body()!!.toString(),
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}
fun collection_setState(
@ -1219,4 +1108,28 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun saleTrackingAddPrevOK(
sectorCollectionFk: Int
) {
salix.saleTrackingAddPrevOK(arrayListOf(sectorCollectionFk))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseSaleAddPrevOK.value = ResponseItemVO(
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), t.message!!
)
)
}
override fun onSuccess(response: Response<Any>) {
_responseSaleAddPrevOK.value = ResponseItemVO(
isError = false, errorMessage = "" + getMessageFromAllResponse(
nameofFunction(this), response.message()
)
)
}
})
}
}

View File

@ -1,7 +1,6 @@
package es.verdnatura.presentation.view.feature.controlador.fragment
import android.content.Context
import android.view.View
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
@ -34,7 +33,7 @@ class ControladorFragment :
override fun init() {
binding.splashProgress.visibility = View.GONE
binding.scanInput.visibility = VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
setEvents()
@ -58,7 +57,7 @@ class ControladorFragment :
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
goBack = false
if (!binding.scanInput.text.isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
//Tarea 6458 descomentar si ok
collectionViewModel = CollectionViewModel(mobileApplication)
@ -66,7 +65,7 @@ class ControladorFragment :
collectionViewModel!!.responseTicketState.observe(
viewLifecycleOwner,
Observer { it ->
binding.splashProgress.visibility = View.GONE
if ((it.code == "ON_CHECKING" || it.code == "CHECKED") && it.user.id != mobileApplication.userId) {
var customDialogWarning = CustomDialog(requireContext())
customDialogWarning.setTitle(getString(R.string.info))
@ -79,8 +78,6 @@ class ControladorFragment :
)
.setOkButton(getString(R.string.aware)) {
customDialogWarning.dismiss()
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet(
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(
ConstAndValues.SECTORFK
@ -88,7 +85,7 @@ class ControladorFragment :
collectionFk = binding.scanInput.text.toString()
.toInt(),
print = "0",
type = ConstAndValues.CONTROLADOR
type = ConstAndValues.ON_CHECKING
)
}.setKoButton(getString(R.string.cancel)){
binding.scanInput.setText("")
@ -103,7 +100,7 @@ class ControladorFragment :
),
collectionFk = binding.scanInput.text.toString().toInt(),
print = "0",
type = ConstAndValues.CONTROLADOR
type = ConstAndValues.ON_CHECKING
)
}
})
@ -120,7 +117,6 @@ class ControladorFragment :
override fun observeViewModel() {
with(viewModel) {
collectionTicketList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
binding.scanInput.setText("")
if (it.isError) {
ma.messageWithSound(it.errorMessage, isError = true, isPlayed = false)

View File

@ -115,7 +115,6 @@ class EndSacadorFragment(
customDialogInput = CustomDialogInput(requireContext())
customDialogInputParking = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
binding.splashProgress.visibility = GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
setToolBar()
setEvents()
@ -191,7 +190,6 @@ class EndSacadorFragment(
override fun observeViewModel() {
with(viewModel) {
salesList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
createSaleList(it)
})
@ -212,7 +210,6 @@ class EndSacadorFragment(
})
placementSuppleyList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) printShelvingResult(it)
goBack = false
})
@ -232,7 +229,6 @@ class EndSacadorFragment(
responseParkingAdd.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
@ -255,7 +251,6 @@ class EndSacadorFragment(
})
responseSplit.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, isError = true, true)
@ -271,7 +266,6 @@ class EndSacadorFragment(
loadResponseSaleGropAdd.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
if (!goBack) {
if (it.isError) {
@ -294,7 +288,6 @@ class EndSacadorFragment(
responseSaleAddPrevOK.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) {
if (it.isError) {
@ -312,7 +305,6 @@ class EndSacadorFragment(
goBack = false
})
response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) {
if (it.isError) {
@ -326,7 +318,6 @@ class EndSacadorFragment(
goBack = false
})
responseSaleupdateIsChecked.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) {
@ -351,7 +342,6 @@ class EndSacadorFragment(
})
responseItemShelvingSaleSupplyAdd.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) {
if (it.isError) {
@ -364,7 +354,7 @@ class EndSacadorFragment(
})
responseCode.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack2) {
if (it.isError) {
customDialog.setTitle(getString(R.string.error))
@ -427,7 +417,7 @@ class EndSacadorFragment(
//CREATE LIST
private fun searchSaleCollection() {
binding.splashProgress.visibility = VISIBLE
viewModel.sectorCollectionGetSale(
collection.collectionFk,
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK)
@ -439,7 +429,6 @@ class EndSacadorFragment(
ticket = ticketFk
if (ticketFk != 0)
binding.splashProgress.visibility = VISIBLE
viewModel.sectorCollectionSaleGroupAdd(
ticketFk,
collection.collectionFk
@ -447,7 +436,7 @@ class EndSacadorFragment(
}
private fun createSaleList(salesList: List<PreSacadorItemVO>) {
binding.splashProgress.visibility = GONE
if (salesList.isNullOrEmpty()) {
ma.messageWithSound(
@ -547,8 +536,6 @@ class EndSacadorFragment(
binding.mainToolbar.toolbarSubtitle.text = "" + totalMark + "/" + sales.size
if (totalMark == sales.size) {
getString(R.string.ticketCompleted).toast(this.context, Toast.LENGTH_SHORT)
binding.splashProgress.visibility = VISIBLE
viewModel.saleTrackingAddPrevOK(
sectorCollectionFk = collection.collectionFk
)
@ -684,7 +671,6 @@ class EndSacadorFragment(
private fun showShelving(position: Int, shelvingPosition: Int) {
storedShelvingPosition = shelvingPosition
storedPosition = position
binding.splashProgress.visibility = VISIBLE
var quantityGet = 0
try {
quantityGet = (sales[position].saldo!! - sales[position].picked!!)
@ -739,7 +725,6 @@ class EndSacadorFragment(
customDialogList.dismiss()
} else {
itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode(
code = customDialogList.getValueTwo()
)
@ -797,7 +782,6 @@ class EndSacadorFragment(
customDialogList.dismiss()
} else {
itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode(
code = customDialogList.getValueTwo()
)

View File

@ -70,7 +70,7 @@ class AutomaticAddItemFragment(
binding.editMatricula.requestFocus()
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE ||actionId == 0 || actionId == 5) {
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.editMatricula.text.toString().isNullOrEmpty()) {
contador += 1
setSubtitle()
@ -118,7 +118,6 @@ class AutomaticAddItemFragment(
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
)
} else {
binding.splashAnimation.visibility = View.VISIBLE
viewModel.itemShelvingMakeMulti(
shelvingFk,
listString,
@ -134,7 +133,6 @@ class AutomaticAddItemFragment(
override fun observeViewModel() {
with(viewModel) {
binding.splashAnimation.visibility = View.INVISIBLE
response.observe(viewLifecycleOwner, Observer {
ma.onMyBackPressed()
})

View File

@ -9,6 +9,7 @@ import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.workermistake.model.MakeMultiSalix
import retrofit2.Response
class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
@ -22,11 +23,8 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
items: List<Long>,
warehouseFk: Int
) {
//Tarea 6276 A MODIFICAR SI O SI. MAÑANA // Falta cambiar el
//salix.upsertItem(MakeMultiSalix(shelvingFk,items,warehouseFk))
//falta cambiar el procedimiento si no no coge bien las cantidades, no las multiplica si el packing es 2 por ejemplo.
// Escanear dos veces un 10 pero pone un dos = 2x20 cuando debería ser 40.
silex.itemShelvingMake_multi(shelvingFk, items, warehouseFk)
salix.upsertItem(MakeMultiSalix(shelvingFk, items, warehouseFk))
.enqueue(object :
SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
@ -44,6 +42,7 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
}
})
}
fun itemShelvingAddList(

View File

@ -51,7 +51,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:text="@string/Entrada"
android:text="@string/entry"
android:textColor="@color/verdnatura_pumpkin_orange"
android:textSize="@dimen/body1" />
@ -123,7 +123,7 @@
<LinearLayout
android:id="@+id/splash_progress"
android:id="@+id/splash_animation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"

View File

@ -84,28 +84,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_animation"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center"
>
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -1,17 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:clickable="false">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black"
>
android:background="@color/verdnatura_black">
<EditText
@ -19,27 +16,26 @@
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="name"
android:hint="@string/Escaner"
android:inputType="textVisiblePassword"
android:lines="1"
android:maxLines="1"
android:paddingStart="@dimen/default_layout_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/main_toolbar"
android:paddingStart="@dimen/default_layout_margin"
android:autofillHints="name"/>
app:layout_constraintTop_toTopOf="@+id/main_toolbar" />
<ImageView
android:id="@+id/previaButton"
android:layout_width="32dp"
android:layout_height="32dp"
android:visibility="invisible"
android:contentDescription="@string/error"
android:tooltipText="Permite marcar las líneas de previa escaneando ticket"
app:srcCompat="@drawable/ic_streetview_black_24dp"
android:visibility="invisible"
app:layout_constraintStart_toEndOf="@+id/scan_input"
app:layout_constraintTop_toTopOf="@+id/scan_input"
android:contentDescription="@string/error"
/>
app:srcCompat="@drawable/ic_streetview_black_24dp" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/collection_swipe"
@ -52,34 +48,14 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/fragment_sacador_collections"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
tools:listitem="@layout/item_article_row_fragment" />
android:id="@+id/fragment_sacador_collections"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
tools:listitem="@layout/item_article_row_fragment" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"

View File

@ -61,24 +61,6 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<include
android:id="@+id/main_toolbar"

View File

@ -30,27 +30,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -31,27 +31,5 @@
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -207,55 +207,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<LinearLayout
android:id="@+id/splash_progress_two"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -143,31 +143,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -85,26 +85,5 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -174,31 +174,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
android:textSize="@dimen/body2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -50,27 +50,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -47,23 +47,6 @@
tools:listitem="@layout/item_article_row_reubication_fragment" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<include
android:id="@+id/main_toolbar"

View File

@ -33,28 +33,5 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -64,27 +64,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -32,28 +32,5 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>