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:
Sergio De la torre 2022-07-04 12:21:36 +02:00
parent bafe1f8c03
commit e41a12e7a9
25 changed files with 570 additions and 489 deletions

View File

@ -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

View File

@ -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.

View File

@ -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,

View File

@ -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,

View File

@ -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 {

View File

@ -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()
}
} }

View File

@ -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
@ -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
@ -622,15 +625,12 @@ class CollectionFragment(
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
} }
@ -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 {
@ -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(PASSWORD),
collectionFk = tickets[0]
)
Log.d("VERDNATURA::", "LA COLECTION ES ${tickets[0]}")
/* viewModel.parking(
getData(USER), getData(USER),
getData(PASSWORD), getData(PASSWORD),
ticketFk = tickets[0], ticketFk = tickets[0],
parking = txtscan 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) {
@ -1823,7 +1890,9 @@ class CollectionFragment(
}//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,8 +1918,9 @@ 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)
) ) ) )
) { ) {

View File

@ -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()))
}
}
})
}
} }

View File

@ -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))

View File

@ -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

View File

@ -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(

View File

@ -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()

View File

@ -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
@ -66,6 +65,7 @@ class PreSacadorFragment :
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 = ""
@ -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
)
} }
}) })
@ -204,7 +208,7 @@ class PreSacadorFragment :
}.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())
} }
}) })
@ -214,9 +218,7 @@ class PreSacadorFragment :
try { try {
sales.clear() sales.clear()
} } catch (e: Exception) {
catch(e:Exception)
{
} }
@ -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()
@ -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,7 +352,6 @@ class PreSacadorFragment :
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
var message = "" var message = ""
val ticket = val ticket =
@ -357,19 +360,23 @@ class PreSacadorFragment :
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 = "Se ha modificado desde previa la cantidad de " +quantityOriginal+ " del artículo " + sales[positionCollectionMissing].itemFk + " a nueva cantidad: " + quantityCollectionMissing+ " del ticket " + ticket message =
"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,7 +415,12 @@ 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")
@ -424,8 +438,8 @@ 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
@ -433,7 +447,7 @@ class PreSacadorFragment :
} }
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 }))
@ -685,7 +699,8 @@ 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()) {
@ -719,7 +734,8 @@ class PreSacadorFragment :
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()
@ -893,7 +909,8 @@ 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")
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) { if (!customDialogInput.getValue().isNullOrEmpty()) {
findSale(customDialogInput.getValue(), index) findSale(customDialogInput.getValue(), index)
} }
@ -990,7 +1007,6 @@ class PreSacadorFragment :
} }
companion object { companion object {
fun newInstance() = PreSacadorFragment() fun newInstance() = PreSacadorFragment()
} }
@ -1074,6 +1090,7 @@ class PreSacadorFragment :
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
} }
} }
private fun TrashMissingReject( private fun TrashMissingReject(
position: Int, position: Int,
quantity: String, quantity: String,
@ -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

View File

@ -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(),

View File

@ -5,12 +5,13 @@ 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 picked: Int = 0,
var idMovimiento: String = "", var idMovimiento: String = "",
var trabajador: String = "", var trabajador: String = "",
var carros: List<PlacementVO> = listOf(), var carros: List<PlacementVO> = listOf(),

View File

@ -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

View File

@ -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,27 +61,35 @@ 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 },
pasillerosItemClickListener!!,
object :
OnReubicationClickListener { OnReubicationClickListener {
override fun onReubicationClick(reubication: Reubication) { override fun onReubicationClick(reubication: Reubication) {
binding.splashProgress.visibility = VISIBLE //binding.splashProgress.visibility = VISIBLE
Log.d("VERDNATURA::", "el click en reubication") showLeaveItemDialog(reubication)
showLeaveItemDialog(reubication, "")
} }
@ -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()) {
if (list.isNotEmpty()) {
scanPlate(binding.scanInput.text.toString().uppercase()) 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, placements.plate) showLeaveItemDialog(items)
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,
private fun showLeaveItemDialog(itemReubication: Reubication, placementReubication: String) { isToasted = true
if (placementReubication.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)) { private fun showLeaveItemDialog(itemReubication: Reubication) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
} else {
val messageDescrip = val messageDescrip =
getString(R.string.scanPlateToLeave) + itemReubication.itemFk + "-" + itemReubication.longName getString(R.string.scanPlateToLeave) + itemReubication.itemFk + "-" + itemReubication.longName
customDialogInputTwoValues.setDescription(messageDescrip) customDialogInputTwoValues.setDescription(messageDescrip)
.setValue(itemReubication.visible) .setValue(itemReubication.quantity)
.setOkButton(getString(R.string.leaveItem)) { .setOkButton(getString(R.string.leaveItem)) {
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
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)) { }.setKoButton(getString(R.string.cancel)) {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
customDialogInputTwoValues.setValueTwo("") customDialogInputTwoValues.setValueTwo("")
scanRequest() scanRequest()
customDialogInputTwoValues.dismiss() customDialogInputTwoValues.dismiss()
}.show() }.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) {
@ -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,40 +296,9 @@ 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>()
for (item in list){
Log.d("VERDNATURA::", "itemFk"+item.shelvingFk)
Log.d("VERDNATURA::", "escaneado"+shelving)
if (item.shelvingFk.uppercase()==shelving.uppercase()){
//listItems.add(item.itemFk)
Log.d("VERDNATURA::", "añadiendo")
reubication.add(Reubication(itemFk =item.itemFk, id=item.id,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))
}
}
}
// ma.openFragmentReubications(reubication,shelving)
}
private fun createReubications(list: List<Reubication>) {
val listItems = mutableListOf<String>()
val reubication = mutableListOf<Reubication>() val reubication = mutableListOf<Reubication>()
for (item in list) { for (item in list) {
@ -354,7 +320,7 @@ class ReubicationCollectionFragment(
if (item.itemFk == r.itemFk) { if (item.itemFk == r.itemFk) {
if (item.shelvingFk.uppercase() != shelving.uppercase()) if (item.shelvingFk.uppercase() != shelving.uppercase())
r.placements.add( r.carros.add(
PlacementReubication( PlacementReubication(
code = item.code, code = item.code,
plate = item.shelvingFk, plate = item.shelvingFk,
@ -368,7 +334,7 @@ class ReubicationCollectionFragment(
for (item in list) { for (item in list) {
Log.d("VERDNATURA::", "el item es " + item.itemFk + "-" + item.id + "-" + item.visible) Log.d("VERDNATURA::", "el item es " + item.itemFk + "-" + item.id + "-" + item.visible)
for (r in item.placements) { for (r in item.carros) {
Log.d( Log.d(
"VERDNATURA::", "VERDNATURA::",
"la reubic es" + r.idItemShelving + "-" + r.plate + "-" + r.code "la reubic es" + r.idItemShelving + "-" + r.plate + "-" + r.code
@ -376,8 +342,8 @@ class ReubicationCollectionFragment(
} }
} }
//ma.openFragmentReubications(reubication,shelving) //ma.openFragmentReubications(reubication,shelving)
*//*
showList(list) showList(list)
} }*/
} }

View File

@ -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)
} }

View File

@ -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
) )

View File

@ -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:inputType="number" android:background="@drawable/background_round"
android:enabled="false"
android:hint="@string/quantity" android:hint="@string/quantity"
android:inputType="number"
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"

View File

@ -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"

View File

@ -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"

View File

@ -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>

View File

@ -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>