Version 8.7 Reubicación, sector = SACADOR V, controlador no puede hacer parking si no están revisados todos los tickets,
This commit is contained in:
parent
bafe1f8c03
commit
e41a12e7a9
|
@ -13,8 +13,9 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21 //21
|
minSdkVersion 21 //21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 126
|
versionCode 127
|
||||||
versionName = "8.6.1Beta"
|
versionName = "8.7Beta"
|
||||||
|
//versionName = "8.6.1Beta" versionCode 126
|
||||||
//versionName = "8.5.1Beta" versionCode 122
|
//versionName = "8.5.1Beta" versionCode 122
|
||||||
//versionName = "8.5Beta" //versionCode 121
|
//versionName = "8.5Beta" //versionCode 121
|
||||||
//versionName = "8.4"// versionCode 120
|
//versionName = "8.4"// versionCode 120
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 126,
|
"versionCode": 127,
|
||||||
"versionName": "8.6.1Beta",
|
"versionName": "8.7Beta",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
Binary file not shown.
|
@ -90,6 +90,24 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
||||||
params
|
params
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun collection_getUncheckedTicket(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
collectionFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
return restClient!!.collection_getUncheckedTicket(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun collectionNew(
|
fun collectionNew(
|
||||||
usuario: String,
|
usuario: String,
|
||||||
password: String,
|
password: String,
|
||||||
|
|
|
@ -315,6 +315,17 @@ interface VerdnaturaService {
|
||||||
):
|
):
|
||||||
Call<String>
|
Call<String>
|
||||||
|
|
||||||
|
@POST("almacennew/collection_getUncheckedTicket")//NO SALIX
|
||||||
|
fun collection_getUncheckedTicket(
|
||||||
|
@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>
|
||||||
|
):
|
||||||
|
Call<String>
|
||||||
|
|
||||||
@POST("almacennew/sip_getExtension")//REVISADA
|
@POST("almacennew/sip_getExtension")//REVISADA
|
||||||
fun sip_getExtension(
|
fun sip_getExtension(
|
||||||
@Header("aplicacion") aplicacion: String,
|
@Header("aplicacion") aplicacion: String,
|
||||||
|
|
|
@ -20,6 +20,7 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
setInputText()
|
setInputText()
|
||||||
setInputTextTwoVisibility()
|
setInputTextTwoVisibility()
|
||||||
|
setFocusTextTwo()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getEditText(): TextInputEditText {
|
fun getEditText(): TextInputEditText {
|
||||||
|
|
|
@ -130,4 +130,7 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
|
||||||
fun setCustomDialogValue(visibility:Int){
|
fun setCustomDialogValue(visibility:Int){
|
||||||
binding.customDialogValue.visibility=visibility
|
binding.customDialogValue.visibility=visibility
|
||||||
}
|
}
|
||||||
|
fun setFocusDialogValue(){
|
||||||
|
binding.customDialogValue.requestFocus()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -65,7 +65,7 @@ class CollectionFragment(
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
private var goBack: Boolean = false
|
private var goBack: Boolean = false
|
||||||
private var goBack2: Boolean = false
|
private var goBack2: Boolean = false
|
||||||
private var goMistakeBack:Boolean=false
|
private var goMistakeBack: Boolean = false
|
||||||
var mperror: MediaPlayer? = null
|
var mperror: MediaPlayer? = null
|
||||||
var mpok: MediaPlayer? = null
|
var mpok: MediaPlayer? = null
|
||||||
private var itemShelvingFkStored: String = ""
|
private var itemShelvingFkStored: String = ""
|
||||||
|
@ -82,6 +82,8 @@ class CollectionFragment(
|
||||||
private var isMarking = false
|
private var isMarking = false
|
||||||
private var positionCollectionSplit = 0
|
private var positionCollectionSplit = 0
|
||||||
private var quantityCollectionSplit = ""
|
private var quantityCollectionSplit = ""
|
||||||
|
private lateinit var ticketToParking: String
|
||||||
|
private lateinit var ticketScanTxt: String
|
||||||
|
|
||||||
//private var myKM: KeyguardManager? = null
|
//private var myKM: KeyguardManager? = null
|
||||||
private var positionUnmarked = -1
|
private var positionUnmarked = -1
|
||||||
|
@ -250,7 +252,7 @@ class CollectionFragment(
|
||||||
/* var working_in_test = true // sergio: en proves app
|
/* var working_in_test = true // sergio: en proves app
|
||||||
|
|
||||||
if (working_in_test) {*/
|
if (working_in_test) {*/
|
||||||
goMistakeBack=false
|
goMistakeBack = false
|
||||||
viewModel.sip_getExtensionSalix(getData(TOKEN), workerFkFromTicket)
|
viewModel.sip_getExtensionSalix(getData(TOKEN), workerFkFromTicket)
|
||||||
/* } else {
|
/* } else {
|
||||||
viewModel.sip_getExtension(
|
viewModel.sip_getExtension(
|
||||||
|
@ -387,6 +389,7 @@ class CollectionFragment(
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
|
binding.splashProgress.visibility = 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
|
||||||
|
@ -485,7 +488,7 @@ class CollectionFragment(
|
||||||
// if (!goBack) {
|
// if (!goBack) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle(getString(R.string.disponibility))
|
customDialog.setTitle(getString(R.string.disponibility))
|
||||||
.setDescription(getString(R.string.errorCollectionNew)+it.errorMessage)
|
.setDescription(getString(R.string.errorCollectionNew) + it.errorMessage)
|
||||||
.setKoButton(getString(R.string.close)) {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
|
@ -610,7 +613,7 @@ class CollectionFragment(
|
||||||
callPicker(it.response)
|
callPicker(it.response)
|
||||||
|
|
||||||
}
|
}
|
||||||
goMistakeBack=true
|
goMistakeBack = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -620,17 +623,14 @@ class CollectionFragment(
|
||||||
|
|
||||||
if (!goMistakeBack)
|
if (!goMistakeBack)
|
||||||
showMistakeList(it.list)
|
showMistakeList(it.list)
|
||||||
goMistakeBack=true
|
goMistakeBack = true
|
||||||
})
|
})
|
||||||
//sergio: para si hay algun ticket por revisar
|
//sergio: para si hay algun ticket por revisar antes de parkinear
|
||||||
responsecheckfully.observe(viewLifecycleOwner, Observer {
|
responsecheckfully.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
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)
|
||||||
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
|
||||||
.setOkButton(getString(R.string.accept)) {
|
|
||||||
customDialog.dismiss()
|
|
||||||
}.show()*/
|
|
||||||
} else {
|
} else {
|
||||||
//sergio: devuelve false si no hay para revisar y <> false.
|
//sergio: devuelve false si no hay para revisar y <> false.
|
||||||
if (it.response != "false") {
|
if (it.response != "false") {
|
||||||
|
@ -658,7 +658,45 @@ class CollectionFragment(
|
||||||
//goBack = false
|
//goBack = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
|
||||||
|
binding.splashProgress.visibility = View.GONE
|
||||||
|
if (it.isError) {
|
||||||
|
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//sergio: devuelve false si no hay para revisar y <> false.
|
||||||
|
if (it.response != "false") {
|
||||||
|
|
||||||
|
customDialog.setTitle(getString(R.string.warning))
|
||||||
|
.setDescription(getString(R.string.pendingReviewParking) + (it.response))
|
||||||
|
.setOkButton(getString(R.string.accept)) {
|
||||||
|
customDialog.dismiss()
|
||||||
|
|
||||||
|
}
|
||||||
|
.setKoButton(getString(R.string.review)) {
|
||||||
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
|
viewModel.collectionTicketGet(
|
||||||
|
getData(USER),
|
||||||
|
getData(PASSWORD),
|
||||||
|
it.response,
|
||||||
|
getData(SECTORFK),
|
||||||
|
type
|
||||||
|
)
|
||||||
|
customDialog.dismiss()
|
||||||
|
}
|
||||||
|
customDialog.show()
|
||||||
|
} else {
|
||||||
|
viewModel.parking(
|
||||||
|
getData(USER),
|
||||||
|
getData(PASSWORD),
|
||||||
|
ticketFk = tickets[0],
|
||||||
|
parking = ticketScanTxt
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// if (!goBack)navigateToCollectionList(it)
|
||||||
|
//goBack = false
|
||||||
|
}
|
||||||
|
})
|
||||||
responseDel.observe(viewLifecycleOwner, Observer {
|
responseDel.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
|
|
||||||
|
@ -710,7 +748,11 @@ class CollectionFragment(
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
ma.messageWithSound( getString(R.string.rocketKO) + it.errorMessage, it.isError, false)
|
ma.messageWithSound(
|
||||||
|
getString(R.string.rocketKO) + it.errorMessage,
|
||||||
|
it.isError,
|
||||||
|
false
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
goBack = false
|
goBack = false
|
||||||
}
|
}
|
||||||
|
@ -817,8 +859,8 @@ class CollectionFragment(
|
||||||
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
|
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
|
||||||
tickets.add(saleVO.ticketFk)
|
tickets.add(saleVO.ticketFk)
|
||||||
}//Refactor #4030//
|
}//Refactor #4030//
|
||||||
else if (type==PRECHECKER){
|
else if (type == PRECHECKER) {
|
||||||
if (saleVO.saleGroupFk!=""){
|
if (saleVO.saleGroupFk != "") {
|
||||||
salesList.add(saleVO)
|
salesList.add(saleVO)
|
||||||
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
|
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
|
||||||
tickets.add(saleVO.ticketFk)
|
tickets.add(saleVO.ticketFk)
|
||||||
|
@ -832,17 +874,22 @@ class CollectionFragment(
|
||||||
|
|
||||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||||
|
|
||||||
|
|
||||||
if (type == CONTROLADOR) {
|
if (type == CONTROLADOR) {
|
||||||
sales = salesList.sortedWith(compareBy({ it.picked }))
|
sales = salesList.sortedWith(compareBy({ it.picked }))
|
||||||
/* for (s in sales){
|
|
||||||
Log.d("VERDNATURA::","El item es ${s.itemFk} y su picked ${s.picked} y saleorder ${s.saleOrder}")
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
//pruebas sergio
|
//pruebas sergio
|
||||||
// sales = salesList.sortedWith(compareBy({it.placements.get(0).created}))
|
// sales = salesList.sortedWith(compareBy({it.placements.get(0).created}))
|
||||||
//sales = salesList.sortedWith(compareBy({it.placements.get(0).placement}))
|
//sales = salesList.sortedWith(compareBy({it.placements.get(0).placement}))
|
||||||
// SalesSorter()
|
// SalesSorter()
|
||||||
|
|
||||||
|
for (s in sales) {
|
||||||
|
Log.d(
|
||||||
|
"VERDNATURA::",
|
||||||
|
"El item es ${s.itemFk} y su picked ${s.picked} y saleorder ${s.saleOrder}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
saleAdapter =
|
saleAdapter =
|
||||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
||||||
|
@ -888,7 +935,7 @@ class CollectionFragment(
|
||||||
binding.splashProgress.visibility =
|
binding.splashProgress.visibility =
|
||||||
VISIBLE
|
VISIBLE
|
||||||
mistakeSale = sale
|
mistakeSale = sale
|
||||||
goMistakeBack=false
|
goMistakeBack = false
|
||||||
viewModel.mistakeType(
|
viewModel.mistakeType(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
getData(PASSWORD)
|
getData(PASSWORD)
|
||||||
|
@ -1013,12 +1060,15 @@ class CollectionFragment(
|
||||||
if (!isOk) {
|
if (!isOk) {
|
||||||
if (txtscan.contains("-")) {
|
if (txtscan.contains("-")) {
|
||||||
if (tickets.size > 0) {
|
if (tickets.size > 0) {
|
||||||
|
|
||||||
|
|
||||||
viewModel.parking(
|
viewModel.parking(
|
||||||
getData(USER),
|
getData(USER),
|
||||||
getData(PASSWORD),
|
getData(PASSWORD),
|
||||||
ticketFk = tickets[0],
|
ticketFk = tickets[0],
|
||||||
parking = txtscan
|
parking = txtscan
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
Timber.i("La coleccion es %s", tickets[0])
|
Timber.i("La coleccion es %s", tickets[0])
|
||||||
/* if (mpok != null) mpok!!.start()
|
/* if (mpok != null) mpok!!.start()
|
||||||
|
@ -1055,13 +1105,28 @@ class CollectionFragment(
|
||||||
//Lo escaneado no encontrado miramos si es parking o ticket
|
//Lo escaneado no encontrado miramos si es parking o ticket
|
||||||
if (!isOk) {
|
if (!isOk) {
|
||||||
if (txtscan.contains("-")) {
|
if (txtscan.contains("-")) {
|
||||||
|
|
||||||
|
Log.d("VERDNATURA::", "VAMOS A PARKING DESDE PANTALLA CONTROLADOR")
|
||||||
|
|
||||||
if (tickets.size > 0) {
|
if (tickets.size > 0) {
|
||||||
viewModel.parking(
|
|
||||||
|
ticketToParking = tickets[0]
|
||||||
|
ticketScanTxt = txtscan
|
||||||
|
//#tarea4107
|
||||||
|
viewModel.collection_getUncheckedTicket(
|
||||||
getData(USER),
|
getData(USER),
|
||||||
getData(PASSWORD),
|
getData(PASSWORD),
|
||||||
ticketFk = tickets[0],
|
collectionFk = tickets[0]
|
||||||
parking = txtscan
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Log.d("VERDNATURA::", "LA COLECTION ES ${tickets[0]}")
|
||||||
|
|
||||||
|
/* viewModel.parking(
|
||||||
|
getData(USER),
|
||||||
|
getData(PASSWORD),
|
||||||
|
ticketFk = tickets[0],
|
||||||
|
parking = txtscan
|
||||||
|
)*/
|
||||||
}
|
}
|
||||||
/* if (mpok != null) mpok!!.start()
|
/* if (mpok != null) mpok!!.start()
|
||||||
getString(R.string.Ticketaparcado).toast(requireContext())*/
|
getString(R.string.Ticketaparcado).toast(requireContext())*/
|
||||||
|
@ -1201,6 +1266,8 @@ class CollectionFragment(
|
||||||
storedPosition = position
|
storedPosition = position
|
||||||
if (type == SACADOR || (type == CONTROLADOR && (getData(SECTORDESCRIP).uppercase() == getString(
|
if (type == SACADOR || (type == CONTROLADOR && (getData(SECTORDESCRIP).uppercase() == getString(
|
||||||
R.string.sectorALGEMESI
|
R.string.sectorALGEMESI
|
||||||
|
) || getData(SECTORDESCRIP).uppercase() == getString(
|
||||||
|
R.string.sectorALGEMESINEW
|
||||||
)))
|
)))
|
||||||
) {
|
) {
|
||||||
if (binding.fragmentSacadorCollections != null) {
|
if (binding.fragmentSacadorCollections != null) {
|
||||||
|
@ -1639,7 +1706,7 @@ class CollectionFragment(
|
||||||
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgress.visibility =
|
binding.splashProgress.visibility =
|
||||||
VISIBLE
|
VISIBLE
|
||||||
|
|
||||||
//sergio datos para mensaje salix
|
//sergio datos para mensaje salix
|
||||||
|
|
||||||
|
@ -1695,7 +1762,7 @@ class CollectionFragment(
|
||||||
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgress.visibility =
|
binding.splashProgress.visibility =
|
||||||
VISIBLE
|
VISIBLE
|
||||||
|
|
||||||
dataMessageSalix = DataMessageSalix(
|
dataMessageSalix = DataMessageSalix(
|
||||||
ticket = ticketSelected,
|
ticket = ticketSelected,
|
||||||
|
@ -1799,7 +1866,7 @@ class CollectionFragment(
|
||||||
item.available = "0"
|
item.available = "0"
|
||||||
}
|
}
|
||||||
customDialog.setTitle(getString(R.string.itemPoints) + item.id)
|
customDialog.setTitle(getString(R.string.itemPoints) + item.id)
|
||||||
.setDescription(getString(R.string.available)+":" + item.available)
|
.setDescription(getString(R.string.available) + ":" + item.available)
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
|
@ -1817,13 +1884,15 @@ class CollectionFragment(
|
||||||
} else if (it.quantity == "0") {
|
} else if (it.quantity == "0") {
|
||||||
totalMark += 1
|
totalMark += 1
|
||||||
}
|
}
|
||||||
} else if (type == CONTROLADOR ) {
|
} else if (type == CONTROLADOR) {
|
||||||
if (it.isControlled == "1" || it.isControlled == "2")
|
if (it.isControlled == "1" || it.isControlled == "2")
|
||||||
totalMark += 1
|
totalMark += 1
|
||||||
|
|
||||||
}//Refactor #4030
|
}//Refactor #4030
|
||||||
else if(type==PRECHECKER){
|
else if (type == PRECHECKER) {
|
||||||
if (it.isPreControlled == "1"){totalMark += 1}
|
if (it.isPreControlled == "1") {
|
||||||
|
totalMark += 1
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1849,9 +1918,10 @@ class CollectionFragment(
|
||||||
private fun ticketCollection_setUsedShelves() {
|
private fun ticketCollection_setUsedShelves() {
|
||||||
|
|
||||||
|
|
||||||
if (type.equals("CHECKER") && (isMarking && getData(SECTORDESCRIP).uppercase() != getString(
|
if (type.equals("CHECKER") && (isMarking && (getData(SECTORDESCRIP).uppercase() != getString(
|
||||||
R.string.sectorALGEMESI
|
R.string.sectorALGEMESI) && getData(SECTORDESCRIP).uppercase() != getString(
|
||||||
))
|
R.string.sectorALGEMESINEW)
|
||||||
|
) )
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -2529,13 +2599,13 @@ class CollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
REPITE -> {
|
REPITE -> {
|
||||||
// speakOrder()
|
// speakOrder()
|
||||||
}
|
}
|
||||||
OTRO -> {
|
OTRO -> {
|
||||||
// speak("Orden no registrada")
|
// speak("Orden no registrada")
|
||||||
}
|
}
|
||||||
FALTA -> {
|
FALTA -> {
|
||||||
// speak("Orden no registrada")
|
// speak("Orden no registrada")
|
||||||
}
|
}
|
||||||
//else -> speak("Orden no registrada")
|
//else -> speak("Orden no registrada")
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,11 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
||||||
val responsecheckfully: LiveData<ResponseItemVO>
|
val responsecheckfully: LiveData<ResponseItemVO>
|
||||||
get() = _responsecheckfully
|
get() = _responsecheckfully
|
||||||
|
|
||||||
|
private val _responseCollectionUnchecked by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseCollectionUnchecked: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseCollectionUnchecked
|
||||||
|
|
||||||
|
|
||||||
private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseMissingTrash: LiveData<ResponseItemVO>
|
val responseMissingTrash: LiveData<ResponseItemVO>
|
||||||
get() = _responseMissingTrash
|
get() = _responseMissingTrash
|
||||||
|
@ -1097,5 +1102,44 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
fun collection_getUncheckedTicket(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
collectionFk: String
|
||||||
|
) {
|
||||||
|
getSacadorControladorUserCase.collection_getUncheckedTicket(
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
collectionFk
|
||||||
|
).enqueue(object :
|
||||||
|
Callback<String> {
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_responseCollectionUnchecked.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(
|
||||||
|
call: Call<String>,
|
||||||
|
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()!!,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), response.message()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -634,7 +634,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun openFragmentReubications(list: List<Reubication>,shelving:String) {
|
fun openFragmentReubications(list: MutableList<Reubication>, shelving:String) {
|
||||||
|
|
||||||
addFragmentOnTop(ReubicationCollectionFragment.newInstance(list,shelving))
|
addFragmentOnTop(ReubicationCollectionFragment.newInstance(list,shelving))
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ class ExpeditionPalletDetailFragment(
|
||||||
responsePrintPallet.observe(viewLifecycleOwner, Observer {
|
responsePrintPallet.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
ma.messageWithSound(it.errorMessage, true, true, isToasted = false)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
|
|
|
@ -119,8 +119,8 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
//Tarea #3754 --> Falta arreglar la colección que se le pasa a ReubicationCollectionFragment y diseño más visual
|
//Tarea #3754 --> Falta arreglar la colección que se le pasa a ReubicationCollectionFragment
|
||||||
/* _pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
1,
|
1,
|
||||||
R.drawable.ic_reubication,
|
R.drawable.ic_reubication,
|
||||||
|
@ -130,7 +130,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
||||||
R.string.titleReubicatorDescrip
|
R.string.titleReubicatorDescrip
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)*/
|
)
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
|
|
|
@ -105,7 +105,7 @@ class EndSacadorFragment(
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialogInputParking = CustomDialogInput(requireContext())
|
customDialogInputParking = CustomDialogInput(requireContext())
|
||||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility =GONE
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -172,7 +172,7 @@ class EndSacadorFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
salesList.observe(viewLifecycleOwner, Observer {
|
salesList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility =GONE
|
||||||
createSaleList(it)
|
createSaleList(it)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ class EndSacadorFragment(
|
||||||
})
|
})
|
||||||
|
|
||||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility =GONE
|
||||||
if (!goBack) printShelvingResult(it)
|
if (!goBack) printShelvingResult(it)
|
||||||
goBack = false
|
goBack = false
|
||||||
})
|
})
|
||||||
|
@ -394,7 +394,7 @@ class EndSacadorFragment(
|
||||||
})
|
})
|
||||||
|
|
||||||
responseCode.observe(viewLifecycleOwner, Observer {
|
responseCode.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility =GONE
|
||||||
if (!goBack2) {
|
if (!goBack2) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle(getString(R.string.error))
|
customDialog.setTitle(getString(R.string.error))
|
||||||
|
@ -625,7 +625,7 @@ class EndSacadorFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var sortedSales = sales.sortedBy { it.pickingOrder }
|
// var sortedSales = sales.sortedBy { it.pickingOrder }
|
||||||
|
|
||||||
//sergio: Se ordena las sales por ellas mismas con With
|
//sergio: Se ordena las sales por ellas mismas con With
|
||||||
sales.sortWith(compareBy({ it.pickingOrder }))
|
sales.sortWith(compareBy({ it.pickingOrder }))
|
||||||
|
@ -938,7 +938,7 @@ class EndSacadorFragment(
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
} else {
|
} else {
|
||||||
"getString(R.string.scanItemValidate) validar".toast(requireContext())
|
getString(R.string.scanItemValidate).toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -984,7 +984,7 @@ class EndSacadorFragment(
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
"getString(R.string.scanItemValidate) validar".toast(requireContext())
|
getString(R.string.scanItemValidate) .toast(requireContext())
|
||||||
}
|
}
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
|
|
|
@ -5,8 +5,6 @@ import android.graphics.drawable.Drawable
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
|
||||||
import android.util.Log.d
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
|
@ -41,6 +39,7 @@ class PreSacadorFragment :
|
||||||
BaseFragment<FragmentPreSacadorBinding, PreSacadorViewModel>(PreSacadorViewModel::class) {
|
BaseFragment<FragmentPreSacadorBinding, PreSacadorViewModel>(PreSacadorViewModel::class) {
|
||||||
var mperror: MediaPlayer? = null
|
var mperror: MediaPlayer? = null
|
||||||
var mpok: MediaPlayer? = null
|
var mpok: MediaPlayer? = null
|
||||||
|
|
||||||
//private var sales: ArrayList<PreSacadorItemVO> = ArrayList()
|
//private var sales: ArrayList<PreSacadorItemVO> = ArrayList()
|
||||||
private lateinit var sales: MutableList<PreSacadorItemVO>
|
private lateinit var sales: MutableList<PreSacadorItemVO>
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
|
@ -63,9 +62,10 @@ class PreSacadorFragment :
|
||||||
private var ticketFk = ""
|
private var ticketFk = ""
|
||||||
private var originalScanned = ""
|
private var originalScanned = ""
|
||||||
|
|
||||||
fun changevariables(){
|
fun changevariables() {
|
||||||
TODO("Refactor llevar variables i deixar soles una com positionToChange i quantityToChange")
|
TODO("Refactor llevar variables i deixar soles una com positionToChange i quantityToChange")
|
||||||
}
|
}
|
||||||
|
|
||||||
private var typeCollectionMissing = ""
|
private var typeCollectionMissing = ""
|
||||||
private var positionCollectionMissing = 0
|
private var positionCollectionMissing = 0
|
||||||
private var quantityCollectionMissing = ""
|
private var quantityCollectionMissing = ""
|
||||||
|
@ -74,7 +74,7 @@ class PreSacadorFragment :
|
||||||
private var quantityCollectionSplit = ""
|
private var quantityCollectionSplit = ""
|
||||||
private var positionCollectionSplit = 0
|
private var positionCollectionSplit = 0
|
||||||
|
|
||||||
// private val listIcons:ArrayList<ImageView> = ArrayList()
|
// private val listIcons:ArrayList<ImageView> = ArrayList()
|
||||||
|
|
||||||
//sergio: se añada para leer el articulo leido que era el buyFk
|
//sergio: se añada para leer el articulo leido que era el buyFk
|
||||||
private var originalItemScan: String = ""
|
private var originalItemScan: String = ""
|
||||||
|
@ -99,7 +99,7 @@ class PreSacadorFragment :
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialogInputParking = CustomDialogInput(requireContext())
|
customDialogInputParking = CustomDialogInput(requireContext())
|
||||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = GONE
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -129,10 +129,10 @@ class PreSacadorFragment :
|
||||||
pasillerosItemClickListener?.onPasillerosItemClickListener(
|
pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
title = getString(R.string.Parking)
|
title = getString(R.string.Parking)
|
||||||
), "")
|
), ""
|
||||||
// parkingTicket(binding.scanInput.text.toString())
|
)
|
||||||
|
// parkingTicket(binding.scanInput.text.toString())
|
||||||
} else {
|
} else {
|
||||||
//if (binding.scanInput.text.length > 6){
|
|
||||||
// miramos si el primer digito es un numero de esta manera sabemos que no es una matrícula que sería el findsale
|
// miramos si el primer digito es un numero de esta manera sabemos que no es una matrícula que sería el findsale
|
||||||
if (binding.scanInput.text.first().isDigit()) {
|
if (binding.scanInput.text.first().isDigit()) {
|
||||||
//es ticket
|
//es ticket
|
||||||
|
@ -166,19 +166,23 @@ class PreSacadorFragment :
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
salesList.observe(viewLifecycleOwner, Observer {
|
salesList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = GONE
|
||||||
createSaleList(it)
|
createSaleList(it)
|
||||||
})
|
})
|
||||||
|
|
||||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (!goBack) printShelvingResult(it)
|
if (!goBack) printShelvingResult(it)
|
||||||
goBack = false
|
goBack = false
|
||||||
})
|
})
|
||||||
|
|
||||||
responseSalixMessage.observe(viewLifecycleOwner, Observer {
|
responseSalixMessage.observe(viewLifecycleOwner, Observer {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound( getString(R.string.rocketKO) + it.errorMessage, it.isError, false)
|
ma.messageWithSound(
|
||||||
|
getString(R.string.rocketKO) + it.errorMessage,
|
||||||
|
it.isError,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -186,7 +190,7 @@ class PreSacadorFragment :
|
||||||
responseIncQuantity.observe(viewLifecycleOwner, Observer {
|
responseIncQuantity.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, isError = true,true)
|
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||||
} else {
|
} else {
|
||||||
incresaseSuccesful()
|
incresaseSuccesful()
|
||||||
}
|
}
|
||||||
|
@ -197,26 +201,24 @@ class PreSacadorFragment :
|
||||||
responseParkingAdd.observe(viewLifecycleOwner, Observer {
|
responseParkingAdd.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,false)
|
ma.messageWithSound(it.errorMessage, true, false)
|
||||||
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
} else {
|
} else {
|
||||||
if (mpok != null) mpok!!.start()
|
if (mpok != null) mpok!!.start()
|
||||||
"Sale/s aparcada/s".toast(requireContext())
|
getString(R.string.saleParked).toast(requireContext())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
responseSaleTrackingUpdate.observe(viewLifecycleOwner, Observer {
|
responseSaleTrackingUpdate.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
ma.messageWithSound(it.errorMessage, isError = it.isError,true)
|
ma.messageWithSound(it.errorMessage, isError = it.isError, true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sales.clear()
|
sales.clear()
|
||||||
}
|
} catch (e: Exception) {
|
||||||
catch(e:Exception)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,17 +228,17 @@ class PreSacadorFragment :
|
||||||
responseSaleMove.observe(viewLifecycleOwner, Observer {
|
responseSaleMove.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, isError = true,true)
|
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
responseSaleMoveSuccesful()
|
responseSaleMoveSuccesful()
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
responseMissingTrash.observe(viewLifecycleOwner, Observer {
|
responseMissingTrash.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, isError = true,true)
|
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
missingTrashSuccesful()
|
missingTrashSuccesful()
|
||||||
|
@ -244,10 +246,11 @@ class PreSacadorFragment :
|
||||||
})
|
})
|
||||||
|
|
||||||
responseCode.observe(viewLifecycleOwner, Observer {
|
responseCode.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (!goBack2) {
|
if (!goBack2) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
customDialog.setTitle(getString(R.string.error))
|
||||||
|
.setDescription(it.errorMessage)
|
||||||
.setKoButton(getString(R.string.close)) {
|
.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
|
@ -292,14 +295,14 @@ class PreSacadorFragment :
|
||||||
val ticket =
|
val ticket =
|
||||||
"[" + sales[positionCollectionSplit].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].id + "/summary)"
|
"[" + sales[positionCollectionSplit].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].id + "/summary)"
|
||||||
val message =
|
val message =
|
||||||
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + " getString(R.string.fromTicket) " + ticket
|
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + " getString(R.string.fromTicket) " + ticket
|
||||||
/* viewModel.sendChekingPresence(
|
/* viewModel.sendChekingPresence(
|
||||||
token = getData(TOKEN),
|
token = getData(TOKEN),
|
||||||
workerId = sales[positionCollectionSplit].salesPersonFk,
|
workerId = sales[positionCollectionSplit].salesPersonFk,
|
||||||
message = message,
|
message = message,
|
||||||
"sendChekingPresence"
|
"sendChekingPresence"
|
||||||
)*/
|
)*/
|
||||||
sendSalixMessageNew(message,sales[positionCollectionSplit].salesPersonFk)
|
sendSalixMessageNew(message, sales[positionCollectionSplit].salesPersonFk)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,11 +319,11 @@ class PreSacadorFragment :
|
||||||
saleAdapter?.notifyDataSetChanged()
|
saleAdapter?.notifyDataSetChanged()
|
||||||
|
|
||||||
val ticket =
|
val ticket =
|
||||||
"[" + sales[positionIncreaseQuantity].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].id + "/summary)"
|
"[" + sales[positionIncreaseQuantity].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].id + "/summary)"
|
||||||
val message =
|
val message =
|
||||||
"Se ha modificado desde previa la cantidad original " + sales[positionIncreaseQuantity].quantity + " del artículo " + sales[positionIncreaseQuantity].itemFk + " a nueva cantidad: " + quantityIncrease + " del ticket " + ticket
|
"Se ha modificado desde previa la cantidad original " + sales[positionIncreaseQuantity].quantity + " del artículo " + sales[positionIncreaseQuantity].itemFk + " a nueva cantidad: " + quantityIncrease + " del ticket " + ticket
|
||||||
|
|
||||||
sendSalixMessageNew(message, sales[positionIncreaseQuantity].salesPersonFk)
|
sendSalixMessageNew(message, sales[positionIncreaseQuantity].salesPersonFk)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -328,7 +331,8 @@ class PreSacadorFragment :
|
||||||
|
|
||||||
var totalQuantity: Int = 0
|
var totalQuantity: Int = 0
|
||||||
try {
|
try {
|
||||||
totalQuantity = sales[positionCollectionMissing].saldo.toInt() - quantityCollectionMissing.toInt()
|
totalQuantity =
|
||||||
|
sales[positionCollectionMissing].saldo.toInt() - quantityCollectionMissing.toInt()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,28 +352,31 @@ class PreSacadorFragment :
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
|
|
||||||
|
var message = ""
|
||||||
var message=""
|
|
||||||
|
|
||||||
val ticket =
|
val ticket =
|
||||||
"[" + sales[positionCollectionMissing].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionMissing].id + "/summary)"
|
"[" + sales[positionCollectionMissing].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionMissing].id + "/summary)"
|
||||||
|
|
||||||
when (typeCollectionMissing){
|
when (typeCollectionMissing) {
|
||||||
|
|
||||||
"TRUE"->{
|
"TRUE" -> {
|
||||||
message = "Se ha enviado desde previa a Basura " + totalQuantity + getString(R.string.fromItem) + sales[positionCollectionMissing].itemFk + " ticket " + ticket
|
message =
|
||||||
|
"Se ha enviado desde previa a Basura " + totalQuantity + getString(R.string.fromItem) + sales[positionCollectionMissing].itemFk + " ticket " + ticket
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
"FALSE"->{
|
"FALSE" -> {
|
||||||
message= "Se ha enviado desde previa a Faltas la cantidad de " + totalQuantity + getString(R.string.fromItem) + sales[positionCollectionMissing].itemFk + " ticket " + ticket
|
message =
|
||||||
|
"Se ha enviado desde previa a Faltas la cantidad de " + totalQuantity + getString(
|
||||||
|
R.string.fromItem
|
||||||
|
) + sales[positionCollectionMissing].itemFk + " ticket " + ticket
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
"reject" -> {
|
||||||
"reject"->{
|
var quantityOriginal = totalQuantity.toInt() + quantityCollectionMissing.toInt()
|
||||||
var quantityOriginal=totalQuantity.toInt()+quantityCollectionMissing.toInt()
|
message =
|
||||||
message = "Se ha modificado desde previa la cantidad de " +quantityOriginal+ " del artículo " + sales[positionCollectionMissing].itemFk + " a nueva cantidad: " + quantityCollectionMissing+ " del ticket " + ticket
|
"Se ha modificado desde previa la cantidad de " + quantityOriginal + " del artículo " + sales[positionCollectionMissing].itemFk + " a nueva cantidad: " + quantityCollectionMissing + " del ticket " + ticket
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -379,6 +386,7 @@ class PreSacadorFragment :
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun sendSalixMessageNew(message: String, workerId: String) {
|
private fun sendSalixMessageNew(message: String, workerId: String) {
|
||||||
|
|
||||||
viewModel.sendChekingPresence(
|
viewModel.sendChekingPresence(
|
||||||
|
@ -387,6 +395,7 @@ class PreSacadorFragment :
|
||||||
message = message
|
message = message
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//CREATE LIST
|
//CREATE LIST
|
||||||
private fun searchTicket(ticketFk: String) {
|
private fun searchTicket(ticketFk: String) {
|
||||||
//Log.i(TAG, "Escaneamos ticket en previa")
|
//Log.i(TAG, "Escaneamos ticket en previa")
|
||||||
|
@ -406,13 +415,18 @@ class PreSacadorFragment :
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
if (salesList.isNullOrEmpty()) {
|
if (salesList.isNullOrEmpty()) {
|
||||||
|
|
||||||
ma.messageWithSound("No hemos podido obtener movimientos para el ticket escaneado",true,false,"Pre Sacador")
|
ma.messageWithSound(
|
||||||
|
"No hemos podido obtener movimientos para el ticket escaneado",
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
"Pre Sacador"
|
||||||
|
)
|
||||||
|
|
||||||
/* customDialog.setTitle("Pre Sacador")
|
/* customDialog.setTitle("Pre Sacador")
|
||||||
.setDescription("No hemos podido obtener movimientos para el ticket escaneado")
|
.setDescription("No hemos podido obtener movimientos para el ticket escaneado")
|
||||||
.setKoButton(getString(R.string.cancel)) {
|
.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()*/
|
}.show()*/
|
||||||
} else {
|
} else {
|
||||||
binding.mainToolbar.toolbarTitle.text = ticket
|
binding.mainToolbar.toolbarTitle.text = ticket
|
||||||
sales = ArrayList()
|
sales = ArrayList()
|
||||||
|
@ -423,20 +437,20 @@ class PreSacadorFragment :
|
||||||
|
|
||||||
//sergio: se tiene que ordenar por el pickingOrder del primer carro (Pako)
|
//sergio: se tiene que ordenar por el pickingOrder del primer carro (Pako)
|
||||||
|
|
||||||
for (s in sales){
|
for (s in sales) {
|
||||||
Log.d("VERDNATURA::","sales "+s.longName)
|
// Log.d("VERDNATURA::","sales "+s.longName)
|
||||||
Log.d("VERDNATURA::","sales "+s.salesPersonFk)
|
// Log.d("VERDNATURA::","sales "+s.salesPersonFk)
|
||||||
//sergio: para que no de error si no hay carros. Ya está asignado a 0 el pickingorder si no hay item en el carro
|
//sergio: para que no de error si no hay carros. Ya está asignado a 0 el pickingorder si no hay item en el carro
|
||||||
if (!s.carros.isNullOrEmpty()){
|
if (!s.carros.isNullOrEmpty()) {
|
||||||
s.pickingOrder=s.carros.get(0).pickingOrder
|
s.pickingOrder = s.carros.get(0).pickingOrder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var sortedSales=sales.sortedBy{ it.pickingOrder }
|
// var sortedSales = sales.sortedBy { it.pickingOrder }
|
||||||
|
|
||||||
//sergio: Se ordena las sales por ellas mismas con With
|
//sergio: Se ordena las sales por ellas mismas con With
|
||||||
sales.sortWith(compareBy({it.pickingOrder}))
|
sales.sortWith(compareBy({ it.pickingOrder }))
|
||||||
|
|
||||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
|
||||||
|
@ -630,7 +644,7 @@ class PreSacadorFragment :
|
||||||
setListPosition(position)
|
setListPosition(position)
|
||||||
|
|
||||||
viewModel.saleTrackingDel(
|
viewModel.saleTrackingDel(
|
||||||
usuario =getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
saleFk = sales[position].idMovimiento
|
saleFk = sales[position].idMovimiento
|
||||||
)
|
)
|
||||||
|
@ -638,9 +652,9 @@ class PreSacadorFragment :
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -685,41 +699,43 @@ class PreSacadorFragment :
|
||||||
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
||||||
}
|
}
|
||||||
|
|
||||||
customDialogList.setTitle("$shelving($item) $total del $longName").setOkButton(getString( R.string.take)) {
|
customDialogList.setTitle("$shelving($item) $total del $longName")
|
||||||
|
.setOkButton(getString(R.string.take)) {
|
||||||
|
|
||||||
|
|
||||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||||
|
|
||||||
|
|
||||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||||
mpok?.start()
|
mpok?.start()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
} else {
|
||||||
|
itemShelvingFkStored = itemShelvingFk
|
||||||
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
|
||||||
|
viewModel.getIdFromCode(
|
||||||
|
usuario = getData(USER),
|
||||||
|
password = getData(PASSWORD),
|
||||||
|
code = customDialogList.getValueTwo()
|
||||||
|
)
|
||||||
|
|
||||||
|
customDialogList.dismiss()
|
||||||
|
}
|
||||||
|
scanRequest()
|
||||||
|
hideKeyboards()
|
||||||
} else {
|
} else {
|
||||||
itemShelvingFkStored = itemShelvingFk
|
"getString(R.string.scanItemValidate) validar".toast(requireContext())
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
|
|
||||||
|
|
||||||
viewModel.getIdFromCode(
|
|
||||||
usuario = getData(USER),
|
|
||||||
password = getData(PASSWORD),
|
|
||||||
code = customDialogList.getValueTwo()
|
|
||||||
)
|
|
||||||
|
|
||||||
customDialogList.dismiss()
|
|
||||||
}
|
}
|
||||||
scanRequest()
|
|
||||||
hideKeyboards()
|
|
||||||
} else {
|
|
||||||
"getString(R.string.scanItemValidate) validar".toast(requireContext())
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.close)) {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.setHintValue("getString(R.string.quantitySelect))").setValue(total).setHintValueTwo(getString(R.string.scanItem))
|
}.setHintValue("getString(R.string.quantitySelect))").setValue(total)
|
||||||
|
.setHintValueTwo(getString(R.string.scanItem))
|
||||||
.setValueTwo("").show()
|
.setValueTwo("").show()
|
||||||
|
|
||||||
|
|
||||||
|
@ -824,38 +840,38 @@ class PreSacadorFragment :
|
||||||
return saleToCheck.itemFk == valueToCheck
|
return saleToCheck.itemFk == valueToCheck
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private fun showScannerParking(ticket: String) {
|
/* private fun showScannerParking(ticket: String) {
|
||||||
|
|
||||||
customDialogInputParking.setTitle("Parking").setDescription("Escanea el parking")
|
customDialogInputParking.setTitle("Parking").setDescription("Escanea el parking")
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (!customDialogInputParking.getValue().isNullOrEmpty()) {
|
if (!customDialogInputParking.getValue().isNullOrEmpty()) {
|
||||||
//findSale(customDialogInput.getValue(),index)
|
//findSale(customDialogInput.getValue(),index)
|
||||||
parkingTicket(ticket, customDialogInputParking.getValue())
|
parkingTicket(ticket, customDialogInputParking.getValue())
|
||||||
|
|
||||||
}
|
}
|
||||||
customDialogInputParking.setValue("")
|
customDialogInputParking.setValue("")
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInputParking.dismiss()
|
customDialogInputParking.dismiss()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInputParking.dismiss()
|
customDialogInputParking.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
customDialogInputParking.getEditText().requestFocus()
|
customDialogInputParking.getEditText().requestFocus()
|
||||||
customDialogInputParking.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInputParking.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
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 (!customDialogInputParking.getValue().isNullOrEmpty()) {
|
if (!customDialogInputParking.getValue().isNullOrEmpty()) {
|
||||||
parkingTicket(ticket, customDialogInputParking.getValue())
|
parkingTicket(ticket, customDialogInputParking.getValue())
|
||||||
}
|
}
|
||||||
customDialogInputParking.setValue("")
|
customDialogInputParking.setValue("")
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInputParking.dismiss()
|
customDialogInputParking.dismiss()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/*private fun showScannerTicket() {
|
/*private fun showScannerTicket() {
|
||||||
|
|
||||||
|
@ -893,17 +909,18 @@ class PreSacadorFragment :
|
||||||
private fun showScanner(index: Int, sale: PreSacadorItemVO) {
|
private fun showScanner(index: Int, sale: PreSacadorItemVO) {
|
||||||
|
|
||||||
customDialogInput.setTitle("" + sale.itemFk)
|
customDialogInput.setTitle("" + sale.itemFk)
|
||||||
.setDescription("Escanea el carro para el item seleccionado").setOkButton(getString(R.string.accept)) {
|
.setDescription("Escanea el carro para el item seleccionado")
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
findSale(customDialogInput.getValue(), index)
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
}
|
findSale(customDialogInput.getValue(), index)
|
||||||
customDialogInput.setValue("")
|
}
|
||||||
scanRequest()
|
customDialogInput.setValue("")
|
||||||
customDialogInput.dismiss()
|
scanRequest()
|
||||||
hideKeyboards()
|
customDialogInput.dismiss()
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
hideKeyboards()
|
||||||
customDialogInput.dismiss()
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
}.setValue("").show()
|
customDialogInput.dismiss()
|
||||||
|
}.setValue("").show()
|
||||||
customDialogInput.getEditText().requestFocus()
|
customDialogInput.getEditText().requestFocus()
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
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) {
|
||||||
|
@ -939,7 +956,7 @@ class PreSacadorFragment :
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
||||||
|
|
||||||
val listIcons:ArrayList<ImageView> = ArrayList()
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
|
|
||||||
val iconParking = ImageView(context)
|
val iconParking = ImageView(context)
|
||||||
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
|
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
|
||||||
|
@ -948,8 +965,8 @@ class PreSacadorFragment :
|
||||||
iconEraser.setImageResource(R.drawable.previous_delete)
|
iconEraser.setImageResource(R.drawable.previous_delete)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
iconParking.tooltipText=getTooltip(R.drawable.ic_local_parking_black_24dp)
|
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
|
||||||
iconEraser.tooltipText=getTooltip(R.drawable.previous_delete)
|
iconEraser.tooltipText = getTooltip(R.drawable.previous_delete)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -961,12 +978,12 @@ class PreSacadorFragment :
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
when (item){
|
when (item) {
|
||||||
iconParking.drawable-> pasillerosItemClickListener?.onPasillerosItemClickListener(
|
iconParking.drawable -> pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
title = "Parking"
|
title = "Parking"
|
||||||
), ""
|
), ""
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -990,7 +1007,6 @@ class PreSacadorFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance() = PreSacadorFragment()
|
fun newInstance() = PreSacadorFragment()
|
||||||
}
|
}
|
||||||
|
@ -1063,9 +1079,9 @@ class PreSacadorFragment :
|
||||||
|
|
||||||
when (action) {
|
when (action) {
|
||||||
getString(R.string.Agregar) -> increaseQuantity(position, value)
|
getString(R.string.Agregar) -> increaseQuantity(position, value)
|
||||||
getString(R.string.BasuraRechazar) -> TrashMissingReject(position, value,"TRUE")
|
getString(R.string.BasuraRechazar) -> TrashMissingReject(position, value, "TRUE")
|
||||||
getString(R.string.titleFaults) -> TrashMissingReject(position, value,"FALSE")
|
getString(R.string.titleFaults) -> TrashMissingReject(position, value, "FALSE")
|
||||||
getString(R.string.Reject) -> TrashMissingReject(position, value,"reject")
|
getString(R.string.Reject) -> TrashMissingReject(position, value, "reject")
|
||||||
getString(R.string.Split) -> split(position, value)
|
getString(R.string.Split) -> split(position, value)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1074,6 +1090,7 @@ class PreSacadorFragment :
|
||||||
customDialogThreeButtons.dismiss()
|
customDialogThreeButtons.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun TrashMissingReject(
|
private fun TrashMissingReject(
|
||||||
position: Int,
|
position: Int,
|
||||||
quantity: String,
|
quantity: String,
|
||||||
|
@ -1154,8 +1171,8 @@ class PreSacadorFragment :
|
||||||
|
|
||||||
private fun split(position: Int, quantity: String) {
|
private fun split(position: Int, quantity: String) {
|
||||||
|
|
||||||
positionCollectionSplit=position
|
positionCollectionSplit = position
|
||||||
quantityCollectionSplit=quantity
|
quantityCollectionSplit = quantity
|
||||||
|
|
||||||
var totalQuantity: Int = 0
|
var totalQuantity: Int = 0
|
||||||
try {
|
try {
|
||||||
|
@ -1164,36 +1181,36 @@ class PreSacadorFragment :
|
||||||
}
|
}
|
||||||
viewModel.saleMove(
|
viewModel.saleMove(
|
||||||
usuario = getData(USER),
|
usuario = getData(USER),
|
||||||
password = getData(PASSWORD),
|
password = getData(PASSWORD),
|
||||||
saleFk = sales[position].idMovimiento,
|
saleFk = sales[position].idMovimiento,
|
||||||
quantity = totalQuantity.toString(),
|
quantity = totalQuantity.toString(),
|
||||||
originalQuantity = sales[position].quantity.toString()
|
originalQuantity = sales[position].quantity.toString()
|
||||||
)
|
)
|
||||||
/*
|
/*
|
||||||
try {
|
try {
|
||||||
sales[position].saldo = quantity.toInt()
|
sales[position].saldo = quantity.toInt()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
sales[position].saldo = 0
|
sales[position].saldo = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (quantity == "0")
|
if (quantity == "0")
|
||||||
markLine(position)
|
markLine(position)
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
|
|
||||||
//enviar mensaje a salix
|
//enviar mensaje a salix
|
||||||
val ticket =
|
val ticket =
|
||||||
"[" + sales[position].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].id + "/summary)"
|
"[" + sales[position].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].id + "/summary)"
|
||||||
val message =
|
val message =
|
||||||
"Se ha enviado a Split el articulo " + sales[position].itemFk + " del ticket " + ticket
|
"Se ha enviado a Split el articulo " + sales[position].itemFk + " del ticket " + ticket
|
||||||
viewModel.sendChekingPresence(
|
viewModel.sendChekingPresence(
|
||||||
token = getData(TOKEN),
|
token = getData(TOKEN),
|
||||||
workerId = sales[position].salesPersonFk,
|
workerId = sales[position].salesPersonFk,
|
||||||
message = message,
|
message = message,
|
||||||
"sendChekingPresence"
|
"sendChekingPresence"
|
||||||
)
|
)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1337,7 +1354,7 @@ class PreSacadorFragment :
|
||||||
message = message
|
message = message
|
||||||
)
|
)
|
||||||
|
|
||||||
Log.d("VERDNATURA","el trabajador es "+sales[position].salesPersonFk)
|
//Log.d("VERDNATURA","el trabajador es "+sales[position].salesPersonFk)
|
||||||
try {
|
try {
|
||||||
sales[position].saldo = quantity.toInt()
|
sales[position].saldo = quantity.toInt()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -1349,6 +1366,7 @@ class PreSacadorFragment :
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun increaseQuantity(position: Int, quantity: String) {
|
private fun increaseQuantity(position: Int, quantity: String) {
|
||||||
positionIncreaseQuantity = position
|
positionIncreaseQuantity = position
|
||||||
quantityIncrease = quantity
|
quantityIncrease = quantity
|
||||||
|
|
|
@ -13,7 +13,7 @@ fun PreSacadorItemVO.toSale() : SaleVO {
|
||||||
longName = if (longName != null) longName else "",
|
longName = if (longName != null) longName else "",
|
||||||
isPreviousPrepared = if (quantity == picked) "1" else "0",
|
isPreviousPrepared = if (quantity == picked) "1" else "0",
|
||||||
line1 = longName,
|
line1 = longName,
|
||||||
line2 = if (subName.isNullOrEmpty()) "" else subName,
|
line2 = if (subName.isNullOrEmpty()) "" else subName,//sergio:cuando subida versión de tarea #3510 se puede quitar isNullOrEmpty
|
||||||
pickedQuantity = picked.toString(),
|
pickedQuantity = picked.toString(),
|
||||||
workerFk = if (trabajador.isNullOrEmpty()) { "0" } else trabajador,
|
workerFk = if (trabajador.isNullOrEmpty()) { "0" } else trabajador,
|
||||||
originalQuantity = quantity.toString(),
|
originalQuantity = quantity.toString(),
|
||||||
|
|
|
@ -2,23 +2,24 @@ package es.verdnatura.presentation.view.feature.presacador.model
|
||||||
|
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
||||||
|
|
||||||
class PreSacadorItemVO (
|
class PreSacadorItemVO(
|
||||||
var id : String = "",
|
var id: String = "",
|
||||||
var itemFk : String = "",
|
var itemFk: String = "",
|
||||||
var packingType: String?="",
|
var packingType: String? = "",//sergio:cuando subida versión de tarea #3510 se puede quitar incialización
|
||||||
var longName : String = "",
|
var longName: String = "",
|
||||||
var subName : String? = "",
|
var subName: String? = "",//sergio:cuando subida versión de tarea #3510 se puede quitar incialización
|
||||||
var quantity : Int = 0,
|
var quantity: Int = 0,
|
||||||
var saldo : Int = 0,
|
var saldo: Int = 0,
|
||||||
var picked : Int = 45,
|
//var picked : Int = 45,
|
||||||
var idMovimiento : String = "",
|
var picked: Int = 0,
|
||||||
var trabajador : String = "",
|
var idMovimiento: String = "",
|
||||||
var carros : List<PlacementVO> = listOf(),
|
var trabajador: String = "",
|
||||||
|
var carros: List<PlacementVO> = listOf(),
|
||||||
//var priority:Int =0, 7-1-2022
|
//var priority:Int =0, 7-1-2022
|
||||||
var pickingOrder:Int =0,
|
var pickingOrder: Int = 0,
|
||||||
var salesPersonFk:String= "",
|
var salesPersonFk: String = "",
|
||||||
|
|
||||||
var reference:String=""
|
var reference: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class ReubicatorAdapter(
|
||||||
|
|
||||||
itemArticlePlacements.apply {
|
itemArticlePlacements.apply {
|
||||||
layoutManager = childLayoutManager
|
layoutManager = childLayoutManager
|
||||||
adapter = reubication.placements.let { ReubicatorPlacementAdapter(it, onPasillerosItemClickListener) }
|
adapter = reubication.carros.let { ReubicatorPlacementAdapter(it, onPasillerosItemClickListener) }
|
||||||
}
|
}
|
||||||
|
|
||||||
//CLICK EVENTS
|
//CLICK EVENTS
|
||||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.reubication.fragment
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
|
||||||
import android.view.View.GONE
|
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
|
||||||
|
@ -16,7 +15,6 @@ import es.verdnatura.presentation.common.OnReubicationClickListener
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
|
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||||
import es.verdnatura.presentation.view.feature.reubication.adapter.ReubicatorAdapter
|
import es.verdnatura.presentation.view.feature.reubication.adapter.ReubicatorAdapter
|
||||||
import es.verdnatura.presentation.view.feature.reubication.model.PlacementReubication
|
|
||||||
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
||||||
|
|
||||||
|
@ -24,7 +22,7 @@ import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewMod
|
||||||
//Tarea #3754
|
//Tarea #3754
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class ReubicationCollectionFragment(
|
class ReubicationCollectionFragment(
|
||||||
var list: List<Reubication>,
|
var list: MutableList<Reubication>,
|
||||||
var shelving: String
|
var shelving: String
|
||||||
) : BaseFragment<FragmentReubicationCollectionBinding, UbicadorViewModel>(
|
) : BaseFragment<FragmentReubicationCollectionBinding, UbicadorViewModel>(
|
||||||
UbicadorViewModel::class
|
UbicadorViewModel::class
|
||||||
|
@ -33,10 +31,11 @@ class ReubicationCollectionFragment(
|
||||||
private var adapter: ReubicatorAdapter? = null
|
private var adapter: ReubicatorAdapter? = null
|
||||||
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||||
private lateinit var customDialogInputTwoValues: CustomDialogInputTwoValues
|
private lateinit var customDialogInputTwoValues: CustomDialogInputTwoValues
|
||||||
|
private lateinit var listItems: ArrayList<Reubication>
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(
|
fun newInstance(
|
||||||
entryPoint: List<Reubication>,
|
entryPoint: MutableList<Reubication>,
|
||||||
shelving: String
|
shelving: String
|
||||||
): ReubicationCollectionFragment {
|
): ReubicationCollectionFragment {
|
||||||
|
|
||||||
|
@ -54,7 +53,7 @@ class ReubicationCollectionFragment(
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
override fun init() {
|
override fun init() {
|
||||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
// customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||||
customDialogInputTwoValues = CustomDialogInputTwoValues(requireContext())
|
customDialogInputTwoValues = CustomDialogInputTwoValues(requireContext())
|
||||||
ma.hideBottomNavigation(GONE)
|
ma.hideBottomNavigation(GONE)
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
|
@ -62,32 +61,40 @@ class ReubicationCollectionFragment(
|
||||||
"${getString(R.string.wagoon)}:${shelving.uppercase()}"
|
"${getString(R.string.wagoon)}:${shelving.uppercase()}"
|
||||||
setEvents()
|
setEvents()
|
||||||
|
|
||||||
// showList(list)
|
showList(list.sortedBy { it.pickingOrder } as MutableList<Reubication>)
|
||||||
// createReubicationsTwo(list)
|
|
||||||
//createReubications(list)
|
|
||||||
showList(list.sortedBy { it.pickingOrder })
|
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun showList(list: List<Reubication>) {
|
private fun showList(list: MutableList<Reubication>) {
|
||||||
|
|
||||||
|
//sergio:ponemos paréntesis y la matrícula
|
||||||
|
//sergio: mirar de ordenar no solo por el picking order de un elemento si no de todos*/
|
||||||
|
|
||||||
for (l in list){
|
for (item in list) {
|
||||||
Log.d("VERDNATURA:::","El item es "+l.itemFk+":"+l.pickingOrder)
|
item.code = shelving.uppercase()
|
||||||
|
for (i in item.carros) {
|
||||||
|
i.visible = "(" + i.visible + ")"
|
||||||
|
}
|
||||||
|
if (item.carros.size == 0) {
|
||||||
|
item.pickingOrder = 0
|
||||||
|
} else {
|
||||||
|
item.pickingOrder = item.carros[0].pickingOrder
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = ReubicatorAdapter(list, pasillerosItemClickListener!!, object :
|
adapter = ReubicatorAdapter(list.sortedBy { it.pickingOrder },
|
||||||
OnReubicationClickListener {
|
pasillerosItemClickListener!!,
|
||||||
override fun onReubicationClick(reubication: Reubication) {
|
object :
|
||||||
binding.splashProgress.visibility = VISIBLE
|
OnReubicationClickListener {
|
||||||
Log.d("VERDNATURA::", "el click en reubication")
|
override fun onReubicationClick(reubication: Reubication) {
|
||||||
showLeaveItemDialog(reubication, "")
|
//binding.splashProgress.visibility = VISIBLE
|
||||||
|
showLeaveItemDialog(reubication)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
binding.reubicatorCollectionsRecycler.adapter = adapter
|
binding.reubicatorCollectionsRecycler.adapter = adapter
|
||||||
binding.reubicatorCollectionsRecycler.layoutManager =
|
binding.reubicatorCollectionsRecycler.layoutManager =
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
@ -111,7 +118,12 @@ class ReubicationCollectionFragment(
|
||||||
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.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
scanPlate(binding.scanInput.text.toString().uppercase())
|
if (list.isNotEmpty()) {
|
||||||
|
scanPlate(binding.scanInput.text.toString().uppercase())
|
||||||
|
} else {
|
||||||
|
shelving = binding.scanInput.text.toString().uppercase()
|
||||||
|
callItemShelvingReturn()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
|
@ -129,76 +141,65 @@ class ReubicationCollectionFragment(
|
||||||
var found = false
|
var found = false
|
||||||
all_list@ for (items in list) {
|
all_list@ for (items in list) {
|
||||||
|
|
||||||
for (placements in items.placements) {
|
for (placements in items.carros) {
|
||||||
|
|
||||||
|
|
||||||
if (placements.plate == plate ) {
|
if (placements.shelvingFk == plate) {
|
||||||
Log.d("VERDNATURA::", "Encontrada matrícula")
|
found = true
|
||||||
found = true
|
showLeaveItemDialog(items)
|
||||||
showLeaveItemDialog(items, placements.plate)
|
break@all_list
|
||||||
break@all_list
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
ma.messageWithSound(getString(R.string.itemScanetNotFound), true, true, isToasted = true)
|
ma.messageWithSound(
|
||||||
|
getString(R.string.itemScanetNotFound),
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
isToasted = true
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showLeaveItemDialog(itemReubication: Reubication, placementReubication: String) {
|
private fun showLeaveItemDialog(itemReubication: Reubication) {
|
||||||
|
|
||||||
|
val messageDescrip =
|
||||||
|
getString(R.string.scanPlateToLeave) + itemReubication.itemFk + "-" + itemReubication.longName
|
||||||
|
|
||||||
|
customDialogInputTwoValues.setDescription(messageDescrip)
|
||||||
|
.setValue(itemReubication.quantity)
|
||||||
|
.setOkButton(getString(R.string.leaveItem)) {
|
||||||
|
|
||||||
|
|
||||||
if (placementReubication.isNotEmpty()) {
|
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
|
||||||
val messageDescrip =
|
|
||||||
"¿ Dejar item: ${itemReubication.itemFk}-" + itemReubication.longName + " en el carro :" + placementReubication + "?"
|
|
||||||
customDialogThreeButtons.setDescription(messageDescrip)
|
|
||||||
.setValue(itemReubication.visible)
|
|
||||||
.setOkButton(getString(R.string.leaveItem)) {
|
|
||||||
|
|
||||||
if (customDialogThreeButtons.getValue() == itemReubication.visible) {
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelving_merge(
|
|
||||||
getData(USER),
|
|
||||||
getData(PASSWORD),
|
|
||||||
itemReubication.id,
|
|
||||||
placementReubication
|
|
||||||
)
|
|
||||||
}
|
|
||||||
customDialogThreeButtons.dismiss()
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
|
||||||
scanRequest()
|
|
||||||
customDialogThreeButtons.dismiss()
|
|
||||||
}.show()
|
|
||||||
|
|
||||||
} else {
|
|
||||||
val messageDescrip =
|
|
||||||
getString(R.string.scanPlateToLeave)+itemReubication.itemFk+"-" + itemReubication.longName
|
|
||||||
|
|
||||||
customDialogInputTwoValues.setDescription(messageDescrip)
|
|
||||||
.setValue(itemReubication.visible)
|
|
||||||
.setOkButton(getString(R.string.leaveItem)) {
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.itemShelving_merge(
|
viewModel.itemShelving_merge(
|
||||||
getData(USER),
|
getData(USER),
|
||||||
getData(PASSWORD),
|
getData(PASSWORD),
|
||||||
itemReubication.id,
|
itemReubication.id,
|
||||||
placementReubication.uppercase()
|
customDialogInputTwoValues.getValueTwo().uppercase()
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
ma.messageWithSound(
|
||||||
|
getString(R.string.returnScan),
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
isToasted = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
customDialogInputTwoValues.setValueTwo("")
|
||||||
|
customDialogInputTwoValues.dismiss()
|
||||||
|
|
||||||
customDialogInputTwoValues.dismiss()
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
binding.splashProgress.visibility = GONE
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
customDialogInputTwoValues.setValueTwo("")
|
||||||
binding.splashProgress.visibility = GONE
|
scanRequest()
|
||||||
customDialogInputTwoValues.setValueTwo("")
|
customDialogInputTwoValues.dismiss()
|
||||||
scanRequest()
|
}.show()
|
||||||
|
//}
|
||||||
customDialogInputTwoValues.dismiss()
|
|
||||||
}.show()
|
|
||||||
}
|
|
||||||
customDialogInputTwoValues.getEditTextTwo()
|
customDialogInputTwoValues.getEditTextTwo()
|
||||||
.setOnEditorActionListener { v, actionId, event ->
|
.setOnEditorActionListener { v, actionId, event ->
|
||||||
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) {
|
||||||
|
@ -215,14 +216,14 @@ class ReubicationCollectionFragment(
|
||||||
}
|
}
|
||||||
customDialogInputTwoValues.setValue("")
|
customDialogInputTwoValues.setValue("")
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInputTwoValues.dismiss()
|
customDialogInputTwoValues.dismiss()
|
||||||
//hideKeyboards()
|
//hideKeyboards()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
customDialogInputTwoValues.setFocusTextTwo()
|
customDialogInputTwoValues.setFocusTextTwo()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,11 +243,13 @@ class ReubicationCollectionFragment(
|
||||||
|
|
||||||
|
|
||||||
if (it.list.isEmpty()) {
|
if (it.list.isEmpty()) {
|
||||||
|
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.errorReubication), true, true, getString(
|
getString(R.string.successReubication), false, true, getString(
|
||||||
R.string.info
|
R.string.info
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
ma.onBackPressed()
|
||||||
} else {
|
} else {
|
||||||
if (it.list[0].isError) {
|
if (it.list[0].isError) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
|
@ -255,8 +258,7 @@ class ReubicationCollectionFragment(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// createReubications(it.list)
|
showList(it.list)
|
||||||
createReubicationsTwo(it.list)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,12 +276,7 @@ class ReubicationCollectionFragment(
|
||||||
|
|
||||||
ma.messageWithSound(it.response, false, false, "", false)
|
ma.messageWithSound(it.response, false, false, "", false)
|
||||||
|
|
||||||
if (!list.isEmpty())
|
callItemShelvingReturn()
|
||||||
{
|
|
||||||
callItemShelvingReturn()
|
|
||||||
}else{
|
|
||||||
ma.onBackPressed()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,85 +296,54 @@ class ReubicationCollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createReubicationsTwo(list: List<Reubication>) {
|
/* private fun createReubications(list: MutableList<Reubication>) {
|
||||||
|
|
||||||
//var listItems= mutableListOf<String>()
|
*//* val listItems = mutableListOf<String>()
|
||||||
val reubication=mutableListOf<Reubication>()
|
val reubication = mutableListOf<Reubication>()
|
||||||
|
|
||||||
for (item in list){
|
for (item in list) {
|
||||||
Log.d("VERDNATURA::", "itemFk"+item.shelvingFk)
|
if (!listItems.contains(item.itemFk)) {
|
||||||
Log.d("VERDNATURA::", "escaneado"+shelving)
|
listItems.add(item.itemFk)
|
||||||
if (item.shelvingFk.uppercase()==shelving.uppercase()){
|
reubication.add(
|
||||||
//listItems.add(item.itemFk)
|
Reubication(
|
||||||
Log.d("VERDNATURA::", "añadiendo")
|
itemFk = item.itemFk,
|
||||||
reubication.add(Reubication(itemFk =item.itemFk, id=item.id,longName = item.longName, visible = item.visible, shelvingFk = item.shelvingFk))
|
longName = item.longName,
|
||||||
}
|
visible = item.visible,
|
||||||
}
|
shelvingFk = item.shelvingFk
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (item in list) {
|
||||||
|
for (r in reubication) {
|
||||||
|
if (item.itemFk == r.itemFk) {
|
||||||
|
|
||||||
for (item in list){
|
if (item.shelvingFk.uppercase() != shelving.uppercase())
|
||||||
for (r in reubication){
|
r.carros.add(
|
||||||
if (item.itemFk==r.itemFk){
|
PlacementReubication(
|
||||||
|
code = item.code,
|
||||||
if (item.shelvingFk.uppercase()!=shelving.uppercase())
|
plate = item.shelvingFk,
|
||||||
r.placements.add(PlacementReubication(code=item.code,plate=item.shelvingFk,visible="("+item.visible+")", idItemShelving = item.id))
|
visible = "(" + item.visible + ")",
|
||||||
}
|
idItemShelving = item.id
|
||||||
}
|
)
|
||||||
}
|
)
|
||||||
|
}
|
||||||
// ma.openFragmentReubications(reubication,shelving)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun createReubications(list: List<Reubication>) {
|
|
||||||
|
|
||||||
val listItems = mutableListOf<String>()
|
|
||||||
val reubication = mutableListOf<Reubication>()
|
|
||||||
|
|
||||||
for (item in list) {
|
|
||||||
if (!listItems.contains(item.itemFk)) {
|
|
||||||
listItems.add(item.itemFk)
|
|
||||||
reubication.add(
|
|
||||||
Reubication(
|
|
||||||
itemFk = item.itemFk,
|
|
||||||
longName = item.longName,
|
|
||||||
visible = item.visible,
|
|
||||||
shelvingFk = item.shelvingFk
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (item in list) {
|
|
||||||
for (r in reubication) {
|
|
||||||
if (item.itemFk == r.itemFk) {
|
|
||||||
|
|
||||||
if (item.shelvingFk.uppercase() != shelving.uppercase())
|
|
||||||
r.placements.add(
|
|
||||||
PlacementReubication(
|
|
||||||
code = item.code,
|
|
||||||
plate = item.shelvingFk,
|
|
||||||
visible = "(" + item.visible + ")",
|
|
||||||
idItemShelving = item.id
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (item in list) {
|
|
||||||
Log.d("VERDNATURA::", "el item es " + item.itemFk + "-" + item.id + "-" + item.visible)
|
|
||||||
for (r in item.placements) {
|
|
||||||
Log.d(
|
|
||||||
"VERDNATURA::",
|
|
||||||
"la reubic es" + r.idItemShelving + "-" + r.plate + "-" + r.code
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//ma.openFragmentReubications(reubication,shelving)
|
|
||||||
|
|
||||||
|
for (item in list) {
|
||||||
|
Log.d("VERDNATURA::", "el item es " + item.itemFk + "-" + item.id + "-" + item.visible)
|
||||||
|
for (r in item.carros) {
|
||||||
|
Log.d(
|
||||||
|
"VERDNATURA::",
|
||||||
|
"la reubic es" + r.idItemShelving + "-" + r.plate + "-" + r.code
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//ma.openFragmentReubications(reubication,shelving)
|
||||||
|
*//*
|
||||||
showList(list)
|
showList(list)
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.reubication.fragment
|
package es.verdnatura.presentation.view.feature.reubication.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
|
@ -10,7 +9,6 @@ import es.verdnatura.databinding.FragmentControladorBinding
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||||
import es.verdnatura.presentation.view.feature.reubication.model.PlacementReubication
|
|
||||||
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
||||||
|
|
||||||
|
@ -101,10 +99,6 @@ class ReubicationFragment(var entrypoint: String) :
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
/* for (item in it.list){
|
|
||||||
Log.d("VERDNATURA::", "Listando itemFk"+item.itemFk+":"+item.shelvingFk+":"+item.code)
|
|
||||||
}*/
|
|
||||||
createReubications(it.list)
|
createReubications(it.list)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -121,63 +115,7 @@ class ReubicationFragment(var entrypoint: String) :
|
||||||
|
|
||||||
private fun createReubications(list: List<Reubication>) {
|
private fun createReubications(list: List<Reubication>) {
|
||||||
|
|
||||||
|
ma.openFragmentReubications(list as MutableList<Reubication>, shelvingScaned)
|
||||||
// var listItems = mutableListOf<String>()
|
|
||||||
|
|
||||||
val reubication = mutableListOf<Reubication>() as ArrayList
|
|
||||||
Log.d("VERDNATURA::", "Iniciem llistat")
|
|
||||||
|
|
||||||
for (item in list.sortedBy { it.pickingOrder }) {
|
|
||||||
if (item.shelvingFk.uppercase() == shelvingScaned.uppercase()) {
|
|
||||||
Log.d("VERDNATURA::", "añadiendo" + item.itemFk + ":" + item.shelvingFk)
|
|
||||||
reubication.add(
|
|
||||||
Reubication(
|
|
||||||
itemFk = item.itemFk,
|
|
||||||
id = item.id,
|
|
||||||
longName = item.longName,
|
|
||||||
visible = item.visible,
|
|
||||||
shelvingFk = item.shelvingFk,
|
|
||||||
pickingOrder = item.pickingOrder
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (item in list.sortedBy { it.pickingOrder }) {
|
|
||||||
for (r in reubication) {
|
|
||||||
if (item.itemFk == r.itemFk) {
|
|
||||||
if (item.shelvingFk.uppercase() != shelvingScaned.uppercase())
|
|
||||||
r.placements.add(
|
|
||||||
PlacementReubication(
|
|
||||||
code = item.code,
|
|
||||||
plate = item.shelvingFk,
|
|
||||||
visible = "(" + item.visible + ")",
|
|
||||||
idItemShelving = item.id
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (item in reubication) {
|
|
||||||
if (item.placements.isEmpty()) {
|
|
||||||
item.pickingOrder = 0
|
|
||||||
}else{
|
|
||||||
//item.pickingOrder=
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
for (item in reubication) {
|
|
||||||
Log.d(
|
|
||||||
"VERDNATURA::",
|
|
||||||
"Item:" + item.itemFk + ":" + item.shelvingFk + " pickingORder:" + item.pickingOrder
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
ma.openFragmentReubications(reubication.sortedBy { it.pickingOrder }, shelvingScaned)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,31 @@
|
||||||
package es.verdnatura.presentation.view.feature.reubication.model
|
package es.verdnatura.presentation.view.feature.reubication.model
|
||||||
|
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
|
||||||
|
|
||||||
|
|
||||||
class ReubicationList(
|
class ReubicationList(
|
||||||
var list: ArrayList<Reubication> = arrayListOf()
|
var list: ArrayList<Reubication> = arrayListOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
class Reubication(
|
class Reubication(
|
||||||
var id: String = "",
|
var id: String = "", //ok
|
||||||
var shelvingFk: String = "",
|
var shelvingFk: String = "", //ok
|
||||||
var code: String = "",
|
var code: String = "", // no
|
||||||
var itemFk: String = "",
|
var itemFk: String = "",//ok
|
||||||
var longName: String = "",
|
var longName: String = "",//ok
|
||||||
var visible: String = "",
|
var quantity: String = "", //=quantity
|
||||||
var placements: MutableList<PlacementReubication> = mutableListOf(),
|
var carros: MutableList<PlacementReubication> = mutableListOf(),//placements
|
||||||
var pickingOrder:Int=0,
|
var pickingOrder:Int=0,//no
|
||||||
var isError: Boolean=false,
|
var isError: Boolean=false,
|
||||||
var errorMessage: String=""
|
var errorMessage: String=""
|
||||||
)
|
)
|
||||||
|
|
||||||
class PlacementReubication(
|
class PlacementReubication(
|
||||||
var code:String ="",
|
var code:String ="",//ok =parking
|
||||||
var plate: String = "",
|
var plate: String = "",
|
||||||
var visible: String = "",
|
var visible: String= "",//ok
|
||||||
var idItemShelving:String=""
|
var idItemShelving:String="",
|
||||||
|
var id: Int=0,//ok
|
||||||
|
var shelvingFk:String ="",//ok=matricula del carro
|
||||||
|
var itemFk: Int=0,//ok
|
||||||
|
var pickingOrder:Int=0//ok
|
||||||
|
|
||||||
)
|
)
|
|
@ -32,9 +32,9 @@
|
||||||
android:id="@+id/custom_dialog_description"
|
android:id="@+id/custom_dialog_description"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/layout_margin_1"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:layout_marginBottom="@dimen/layout_margin_1"
|
|
||||||
android:textSize="@dimen/body1"
|
android:textSize="@dimen/body1"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Este cambio no podrá deshacerse a no ser que vuelvas a vincular el dispositivo"
|
tools:text="Este cambio no podrá deshacerse a no ser que vuelvas a vincular el dispositivo"
|
||||||
|
@ -43,46 +43,47 @@
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/textinputlayout_username"
|
android:id="@+id/textinputlayout_username"
|
||||||
android:layout_margin="@dimen/layout_margin_min"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColorHint="@android:color/darker_gray"
|
android:layout_margin="@dimen/layout_margin_min"
|
||||||
>
|
android:textColorHint="@android:color/darker_gray">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/custom_dialog_value"
|
android:id="@+id/custom_dialog_value"
|
||||||
style="@style/DefaultButton.NormalButton"
|
style="@style/DefaultButton.NormalButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/background_round"
|
||||||
|
android:enabled="false"
|
||||||
|
android:hint="@string/quantity"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:hint="@string/quantity"
|
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:background="@drawable/background_round"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textColorHint="@android:color/darker_gray" />
|
android:textColorHint="@android:color/darker_gray"
|
||||||
|
android:visibility="gone" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/textinputlayout_two"
|
android:id="@+id/textinputlayout_two"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_margin="@dimen/layout_margin_min"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/layout_margin_min"
|
||||||
android:hint="@string/scanShelving"
|
android:hint="@string/scanShelving"
|
||||||
android:visibility="visible"
|
|
||||||
android:textColorHint="@android:color/darker_gray"
|
android:textColorHint="@android:color/darker_gray"
|
||||||
>
|
android:visibility="visible">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/custom_dialog_value_two"
|
android:id="@+id/custom_dialog_value_two"
|
||||||
style="@style/DefaultButton.NormalButton"
|
style="@style/DefaultButton.NormalButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/background_round"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:background="@drawable/background_round"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textColorHint="@android:color/darker_gray" />
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/custom_dialog_button_ok"
|
android:id="@+id/custom_dialog_button_ok"
|
||||||
style="@style/DefaultButton.NormalButton"
|
style="@style/DefaultButton.NormalButton"
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{reubication.shelvingFk}"
|
android:text="@{reubication.code}"
|
||||||
android:layout_marginRight="@dimen/layout_margin_min"
|
android:layout_marginRight="@dimen/layout_margin_min"
|
||||||
android:textColor="@color/verdnatura_black"
|
android:textColor="@color/verdnatura_black"
|
||||||
android:textSize="@dimen/h8"
|
android:textSize="@dimen/h8"
|
||||||
|
@ -233,10 +233,10 @@
|
||||||
android:id="@+id/item_article_quantity"
|
android:id="@+id/item_article_quantity"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_1"
|
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:text="@{reubication.visible}"
|
android:text="@{reubication.quantity}"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/body1"
|
android:textSize="@dimen/body1"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{item.plate}"
|
android:text="@{item.shelvingFk}"
|
||||||
tool:text="XXX"
|
tool:text="XXX"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|
|
@ -353,7 +353,7 @@
|
||||||
<string name="titlePreControl">Pre Control</string>
|
<string name="titlePreControl">Pre Control</string>
|
||||||
<string name="titleShelvingHistorical">Histórico ítems del carro</string>
|
<string name="titleShelvingHistorical">Histórico ítems del carro</string>
|
||||||
<string name="titleLogShelving">Histórico del carro</string>
|
<string name="titleLogShelving">Histórico del carro</string>
|
||||||
<string name="itemScanetNotFound">Elemento escaneado no encontrado: </string>
|
<string name="itemScanetNotFound">Elemento escaneado no encontrado </string>
|
||||||
<string name="NotOrderReplacement">No existen pedidos para reponer</string>
|
<string name="NotOrderReplacement">No existen pedidos para reponer</string>
|
||||||
<string name="orderCompleted">Pedido completado</string>
|
<string name="orderCompleted">Pedido completado</string>
|
||||||
<string name="shelvingSure">Asegúrate de escanear una matrícula.</string>
|
<string name="shelvingSure">Asegúrate de escanear una matrícula.</string>
|
||||||
|
@ -441,12 +441,15 @@
|
||||||
<string name="saleParked">Sale/s aparcada/s</string>
|
<string name="saleParked">Sale/s aparcada/s</string>
|
||||||
<string name="modifiedOriginalQuantityPrevious">Se ha modificado desde previa la cantidad de </string>
|
<string name="modifiedOriginalQuantityPrevious">Se ha modificado desde previa la cantidad de </string>
|
||||||
<string name="url">url</string>
|
<string name="url">url</string>
|
||||||
<string name="title">title</string>
|
<string name="title">título</string>
|
||||||
<string name="titleReUbicator">Reubicación</string>
|
<string name="titleReUbicator">Reubicación</string>
|
||||||
<string name="errorReubication">No aparecen item para el carro escaneado</string>
|
<string name="errorReubication">No aparecen item para el carro escaneado</string>
|
||||||
|
<string name="successReubication">Reubicación finalizada</string>
|
||||||
<string name="leaveItem">Dejar item</string>
|
<string name="leaveItem">Dejar item</string>
|
||||||
<string name="toReubication">Reubicación</string>
|
<string name="toReubication">Reubicación</string>
|
||||||
<string name="quantity">Cantidad</string>
|
<string name="quantity">Cantidad</string>
|
||||||
<string name="scanPlateToLeave">Escanea la matrícula donde quieres dejar el item :</string>
|
<string name="scanPlateToLeave">Escanea la matrícula donde quieres dejar el item :</string>
|
||||||
<string name="in_shelve">En balda:</string>
|
<string name="in_shelve">En balda:</string>
|
||||||
|
<string name="pendingReviewParking">No es posible aparcar el ticket porque hay un ticket pendiente:</string>
|
||||||
|
<string name="sectorALGEMESINEW">SACADOR V</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -242,6 +242,7 @@
|
||||||
<string name="sure">are you sure?</string>
|
<string name="sure">are you sure?</string>
|
||||||
<string name="unmark">Unmark</string>
|
<string name="unmark">Unmark</string>
|
||||||
<string name="sectorALGEMESI">ALGEMESI V</string>
|
<string name="sectorALGEMESI">ALGEMESI V</string>
|
||||||
|
<string name="sectorALGEMESINEW">SACADOR V</string>
|
||||||
<string name="take">Take</string>
|
<string name="take">Take</string>
|
||||||
<string name="errorRegistered">Cause of error registered</string>
|
<string name="errorRegistered">Cause of error registered</string>
|
||||||
<string name="printerFault">Select printer</string>
|
<string name="printerFault">Select printer</string>
|
||||||
|
@ -306,6 +307,7 @@
|
||||||
<string name="showParking">Scan Parking</string>
|
<string name="showParking">Scan Parking</string>
|
||||||
<string name="lineNotExist">The purchase line of the scanned label does not exist.</string>
|
<string name="lineNotExist">The purchase line of the scanned label does not exist.</string>
|
||||||
<string name="pendingReview">Pending review : </string>
|
<string name="pendingReview">Pending review : </string>
|
||||||
|
<string name="pendingReviewParking">Its not possible parking because there is a ticket pending of review: </string>
|
||||||
<string name="review">Review</string>
|
<string name="review">Review</string>
|
||||||
<string name="splitSent">The article has been sent to Split </string>
|
<string name="splitSent">The article has been sent to Split </string>
|
||||||
<string name="fromTicket">" \\u0020from ticket\\u0020"</string>
|
<string name="fromTicket">" \\u0020from ticket\\u0020"</string>
|
||||||
|
@ -355,7 +357,8 @@
|
||||||
<string name="titleShelvingHistorical">Shelving historical</string>
|
<string name="titleShelvingHistorical">Shelving historical</string>
|
||||||
<string name="titleLogShelving">Log Shelving</string>
|
<string name="titleLogShelving">Log Shelving</string>
|
||||||
<string name="titlePickers">Pickers</string>
|
<string name="titlePickers">Pickers</string>
|
||||||
<string name="itemScanetNotFound">"Scanned element not found: "</string>
|
<string name="itemScanetNotFound">"Scanned element not found "</string>
|
||||||
|
|
||||||
<string name="NotOrderReplacement">There are no requests to replace</string>
|
<string name="NotOrderReplacement">There are no requests to replace</string>
|
||||||
<string name="orderCompleted">Completed order</string>
|
<string name="orderCompleted">Completed order</string>
|
||||||
<string name="shelvingSure">Make sure to scan a plate.</string>
|
<string name="shelvingSure">Make sure to scan a plate.</string>
|
||||||
|
@ -448,6 +451,7 @@
|
||||||
<string name="leaveItem">Dejar item</string>
|
<string name="leaveItem">Dejar item</string>
|
||||||
<string name="scanPlateToLeave">Scan the plate where you want to leave the item :</string>
|
<string name="scanPlateToLeave">Scan the plate where you want to leave the item :</string>
|
||||||
<string name="in_shelve">In shelve:</string>
|
<string name="in_shelve">In shelve:</string>
|
||||||
|
<string name="successReubication">Reubication ended</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue