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"
|
||||
minSdkVersion 21 //21
|
||||
targetSdkVersion 30
|
||||
versionCode 126
|
||||
versionName = "8.6.1Beta"
|
||||
versionCode 127
|
||||
versionName = "8.7Beta"
|
||||
//versionName = "8.6.1Beta" versionCode 126
|
||||
//versionName = "8.5.1Beta" versionCode 122
|
||||
//versionName = "8.5Beta" //versionCode 121
|
||||
//versionName = "8.4"// versionCode 120
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 126,
|
||||
"versionName": "8.6.1Beta",
|
||||
"versionCode": 127,
|
||||
"versionName": "8.7Beta",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
|
Binary file not shown.
|
@ -90,6 +90,24 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
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(
|
||||
usuario: String,
|
||||
password: String,
|
||||
|
|
|
@ -315,6 +315,17 @@ interface VerdnaturaService {
|
|||
):
|
||||
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
|
||||
fun sip_getExtension(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
|
|
@ -20,6 +20,7 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
|
|||
setContentView(binding.root)
|
||||
setInputText()
|
||||
setInputTextTwoVisibility()
|
||||
setFocusTextTwo()
|
||||
}
|
||||
|
||||
fun getEditText(): TextInputEditText {
|
||||
|
|
|
@ -130,4 +130,7 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
|
|||
fun setCustomDialogValue(visibility:Int){
|
||||
binding.customDialogValue.visibility=visibility
|
||||
}
|
||||
fun setFocusDialogValue(){
|
||||
binding.customDialogValue.requestFocus()
|
||||
}
|
||||
}
|
|
@ -82,6 +82,8 @@ class CollectionFragment(
|
|||
private var isMarking = false
|
||||
private var positionCollectionSplit = 0
|
||||
private var quantityCollectionSplit = ""
|
||||
private lateinit var ticketToParking: String
|
||||
private lateinit var ticketScanTxt: String
|
||||
|
||||
//private var myKM: KeyguardManager? = null
|
||||
private var positionUnmarked = -1
|
||||
|
@ -387,6 +389,7 @@ class CollectionFragment(
|
|||
binding.splashProgress.visibility = GONE
|
||||
|
||||
if (!goBack) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
ma.messageWithSound(
|
||||
if (it.isError) it.errorMessage else getString(R.string.Aparcado),
|
||||
it.isError, true
|
||||
|
@ -622,15 +625,12 @@ class CollectionFragment(
|
|||
showMistakeList(it.list)
|
||||
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 {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
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 {
|
||||
//sergio: devuelve false si no hay para revisar y <> false.
|
||||
if (it.response != "false") {
|
||||
|
@ -658,7 +658,45 @@ class CollectionFragment(
|
|||
//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 {
|
||||
|
||||
|
||||
|
@ -710,7 +748,11 @@ class CollectionFragment(
|
|||
if (it.isError) {
|
||||
|
||||
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 {
|
||||
goBack = false
|
||||
}
|
||||
|
@ -832,17 +874,22 @@ class CollectionFragment(
|
|||
|
||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||
|
||||
|
||||
if (type == CONTROLADOR) {
|
||||
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
|
||||
// sales = salesList.sortedWith(compareBy({it.placements.get(0).created}))
|
||||
//sales = salesList.sortedWith(compareBy({it.placements.get(0).placement}))
|
||||
// SalesSorter()
|
||||
|
||||
for (s in sales) {
|
||||
Log.d(
|
||||
"VERDNATURA::",
|
||||
"El item es ${s.itemFk} y su picked ${s.picked} y saleorder ${s.saleOrder}"
|
||||
)
|
||||
}
|
||||
|
||||
saleAdapter =
|
||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
||||
|
@ -1013,12 +1060,15 @@ class CollectionFragment(
|
|||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
if (tickets.size > 0) {
|
||||
|
||||
|
||||
viewModel.parking(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = tickets[0],
|
||||
parking = txtscan
|
||||
)
|
||||
|
||||
}
|
||||
Timber.i("La coleccion es %s", tickets[0])
|
||||
/* if (mpok != null) mpok!!.start()
|
||||
|
@ -1055,13 +1105,28 @@ class CollectionFragment(
|
|||
//Lo escaneado no encontrado miramos si es parking o ticket
|
||||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
|
||||
Log.d("VERDNATURA::", "VAMOS A PARKING DESDE PANTALLA CONTROLADOR")
|
||||
|
||||
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(PASSWORD),
|
||||
ticketFk = tickets[0],
|
||||
parking = txtscan
|
||||
)
|
||||
)*/
|
||||
}
|
||||
/* if (mpok != null) mpok!!.start()
|
||||
getString(R.string.Ticketaparcado).toast(requireContext())*/
|
||||
|
@ -1201,6 +1266,8 @@ class CollectionFragment(
|
|||
storedPosition = position
|
||||
if (type == SACADOR || (type == CONTROLADOR && (getData(SECTORDESCRIP).uppercase() == getString(
|
||||
R.string.sectorALGEMESI
|
||||
) || getData(SECTORDESCRIP).uppercase() == getString(
|
||||
R.string.sectorALGEMESINEW
|
||||
)))
|
||||
) {
|
||||
if (binding.fragmentSacadorCollections != null) {
|
||||
|
@ -1823,7 +1890,9 @@ class CollectionFragment(
|
|||
|
||||
}//Refactor #4030
|
||||
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() {
|
||||
|
||||
|
||||
if (type.equals("CHECKER") && (isMarking && getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESI
|
||||
if (type.equals("CHECKER") && (isMarking && (getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESI) && getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESINEW)
|
||||
) )
|
||||
) {
|
||||
|
||||
|
|
|
@ -85,6 +85,11 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
val responsecheckfully: LiveData<ResponseItemVO>
|
||||
get() = _responsecheckfully
|
||||
|
||||
private val _responseCollectionUnchecked by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseCollectionUnchecked: LiveData<ResponseItemVO>
|
||||
get() = _responseCollectionUnchecked
|
||||
|
||||
|
||||
private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseMissingTrash: LiveData<ResponseItemVO>
|
||||
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))
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ class ExpeditionPalletDetailFragment(
|
|||
responsePrintPallet.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
ma.messageWithSound(it.errorMessage, true, true, isToasted = false)
|
||||
|
||||
} else {
|
||||
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
|
||||
/* _pasillerositem.add(
|
||||
//Tarea #3754 --> Falta arreglar la colección que se le pasa a ReubicationCollectionFragment
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
1,
|
||||
R.drawable.ic_reubication,
|
||||
|
@ -130,7 +130,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
|||
R.string.titleReubicatorDescrip
|
||||
)
|
||||
)
|
||||
)*/
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
|
|
|
@ -105,7 +105,7 @@ class EndSacadorFragment(
|
|||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogInputParking = CustomDialogInput(requireContext())
|
||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility =GONE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
@ -172,7 +172,7 @@ class EndSacadorFragment(
|
|||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
salesList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility =GONE
|
||||
createSaleList(it)
|
||||
})
|
||||
|
||||
|
@ -200,7 +200,7 @@ class EndSacadorFragment(
|
|||
})
|
||||
|
||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility =GONE
|
||||
if (!goBack) printShelvingResult(it)
|
||||
goBack = false
|
||||
})
|
||||
|
@ -394,7 +394,7 @@ class EndSacadorFragment(
|
|||
})
|
||||
|
||||
responseCode.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility =GONE
|
||||
if (!goBack2) {
|
||||
if (it.isError) {
|
||||
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
|
||||
sales.sortWith(compareBy({ it.pickingOrder }))
|
||||
|
@ -938,7 +938,7 @@ class EndSacadorFragment(
|
|||
scanRequest()
|
||||
hideKeyboards()
|
||||
} else {
|
||||
"getString(R.string.scanItemValidate) validar".toast(requireContext())
|
||||
getString(R.string.scanItemValidate).toast(requireContext())
|
||||
}
|
||||
|
||||
|
||||
|
@ -984,7 +984,7 @@ class EndSacadorFragment(
|
|||
customDialogList.dismiss()
|
||||
}
|
||||
} else {
|
||||
"getString(R.string.scanItemValidate) validar".toast(requireContext())
|
||||
getString(R.string.scanItemValidate) .toast(requireContext())
|
||||
}
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
|
|
|
@ -5,8 +5,6 @@ import android.graphics.drawable.Drawable
|
|||
import android.media.MediaPlayer
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.util.Log.d
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
@ -41,6 +39,7 @@ class PreSacadorFragment :
|
|||
BaseFragment<FragmentPreSacadorBinding, PreSacadorViewModel>(PreSacadorViewModel::class) {
|
||||
var mperror: MediaPlayer? = null
|
||||
var mpok: MediaPlayer? = null
|
||||
|
||||
//private var sales: ArrayList<PreSacadorItemVO> = ArrayList()
|
||||
private lateinit var sales: MutableList<PreSacadorItemVO>
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
@ -66,6 +65,7 @@ class PreSacadorFragment :
|
|||
fun changevariables() {
|
||||
TODO("Refactor llevar variables i deixar soles una com positionToChange i quantityToChange")
|
||||
}
|
||||
|
||||
private var typeCollectionMissing = ""
|
||||
private var positionCollectionMissing = 0
|
||||
private var quantityCollectionMissing = ""
|
||||
|
@ -99,7 +99,7 @@ class PreSacadorFragment :
|
|||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogInputParking = CustomDialogInput(requireContext())
|
||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
@ -129,10 +129,10 @@ class PreSacadorFragment :
|
|||
pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = getString(R.string.Parking)
|
||||
), "")
|
||||
), ""
|
||||
)
|
||||
// parkingTicket(binding.scanInput.text.toString())
|
||||
} 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
|
||||
if (binding.scanInput.text.first().isDigit()) {
|
||||
//es ticket
|
||||
|
@ -166,19 +166,23 @@ class PreSacadorFragment :
|
|||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
salesList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
createSaleList(it)
|
||||
})
|
||||
|
||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) printShelvingResult(it)
|
||||
goBack = false
|
||||
})
|
||||
|
||||
responseSalixMessage.observe(viewLifecycleOwner, Observer {
|
||||
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()*/
|
||||
} else {
|
||||
if (mpok != null) mpok!!.start()
|
||||
"Sale/s aparcada/s".toast(requireContext())
|
||||
getString(R.string.saleParked).toast(requireContext())
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -214,9 +218,7 @@ class PreSacadorFragment :
|
|||
|
||||
try {
|
||||
sales.clear()
|
||||
}
|
||||
catch(e:Exception)
|
||||
{
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -244,10 +246,11 @@ class PreSacadorFragment :
|
|||
})
|
||||
|
||||
responseCode.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack2) {
|
||||
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)) {
|
||||
scanRequest()
|
||||
customDialog.dismiss()
|
||||
|
@ -328,7 +331,8 @@ class PreSacadorFragment :
|
|||
|
||||
var totalQuantity: Int = 0
|
||||
try {
|
||||
totalQuantity = sales[positionCollectionMissing].saldo.toInt() - quantityCollectionMissing.toInt()
|
||||
totalQuantity =
|
||||
sales[positionCollectionMissing].saldo.toInt() - quantityCollectionMissing.toInt()
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
||||
|
@ -348,7 +352,6 @@ class PreSacadorFragment :
|
|||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
|
||||
|
||||
var message = ""
|
||||
|
||||
val ticket =
|
||||
|
@ -357,19 +360,23 @@ class PreSacadorFragment :
|
|||
when (typeCollectionMissing) {
|
||||
|
||||
"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" -> {
|
||||
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" -> {
|
||||
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) {
|
||||
|
||||
viewModel.sendChekingPresence(
|
||||
|
@ -387,6 +395,7 @@ class PreSacadorFragment :
|
|||
message = message
|
||||
)
|
||||
}
|
||||
|
||||
//CREATE LIST
|
||||
private fun searchTicket(ticketFk: String) {
|
||||
//Log.i(TAG, "Escaneamos ticket en previa")
|
||||
|
@ -406,7 +415,12 @@ class PreSacadorFragment :
|
|||
binding.splashProgress.visibility = GONE
|
||||
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")
|
||||
.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)
|
||||
|
||||
for (s in sales) {
|
||||
Log.d("VERDNATURA::","sales "+s.longName)
|
||||
Log.d("VERDNATURA::","sales "+s.salesPersonFk)
|
||||
// Log.d("VERDNATURA::","sales "+s.longName)
|
||||
// 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
|
||||
if (!s.carros.isNullOrEmpty()) {
|
||||
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
|
||||
sales.sortWith(compareBy({ it.pickingOrder }))
|
||||
|
@ -685,7 +699,8 @@ class PreSacadorFragment :
|
|||
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()) {
|
||||
|
@ -719,7 +734,8 @@ class PreSacadorFragment :
|
|||
scanRequest()
|
||||
hideKeyboards()
|
||||
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()
|
||||
|
||||
|
||||
|
@ -893,7 +909,8 @@ class PreSacadorFragment :
|
|||
private fun showScanner(index: Int, sale: PreSacadorItemVO) {
|
||||
|
||||
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()) {
|
||||
findSale(customDialogInput.getValue(), index)
|
||||
}
|
||||
|
@ -990,7 +1007,6 @@ class PreSacadorFragment :
|
|||
}
|
||||
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance() = PreSacadorFragment()
|
||||
}
|
||||
|
@ -1074,6 +1090,7 @@ class PreSacadorFragment :
|
|||
customDialogThreeButtons.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
private fun TrashMissingReject(
|
||||
position: Int,
|
||||
quantity: String,
|
||||
|
@ -1337,7 +1354,7 @@ class PreSacadorFragment :
|
|||
message = message
|
||||
)
|
||||
|
||||
Log.d("VERDNATURA","el trabajador es "+sales[position].salesPersonFk)
|
||||
//Log.d("VERDNATURA","el trabajador es "+sales[position].salesPersonFk)
|
||||
try {
|
||||
sales[position].saldo = quantity.toInt()
|
||||
} catch (e: Exception) {
|
||||
|
@ -1349,6 +1366,7 @@ class PreSacadorFragment :
|
|||
|
||||
|
||||
}
|
||||
|
||||
private fun increaseQuantity(position: Int, quantity: String) {
|
||||
positionIncreaseQuantity = position
|
||||
quantityIncrease = quantity
|
||||
|
|
|
@ -13,7 +13,7 @@ fun PreSacadorItemVO.toSale() : SaleVO {
|
|||
longName = if (longName != null) longName else "",
|
||||
isPreviousPrepared = if (quantity == picked) "1" else "0",
|
||||
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(),
|
||||
workerFk = if (trabajador.isNullOrEmpty()) { "0" } else trabajador,
|
||||
originalQuantity = quantity.toString(),
|
||||
|
|
|
@ -5,12 +5,13 @@ import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
|||
class PreSacadorItemVO(
|
||||
var id: 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 subName : String? = "",
|
||||
var subName: String? = "",//sergio:cuando subida versión de tarea #3510 se puede quitar incialización
|
||||
var quantity: Int = 0,
|
||||
var saldo: Int = 0,
|
||||
var picked : Int = 45,
|
||||
//var picked : Int = 45,
|
||||
var picked: Int = 0,
|
||||
var idMovimiento: String = "",
|
||||
var trabajador: String = "",
|
||||
var carros: List<PlacementVO> = listOf(),
|
||||
|
|
|
@ -76,7 +76,7 @@ class ReubicatorAdapter(
|
|||
|
||||
itemArticlePlacements.apply {
|
||||
layoutManager = childLayoutManager
|
||||
adapter = reubication.placements.let { ReubicatorPlacementAdapter(it, onPasillerosItemClickListener) }
|
||||
adapter = reubication.carros.let { ReubicatorPlacementAdapter(it, onPasillerosItemClickListener) }
|
||||
}
|
||||
|
||||
//CLICK EVENTS
|
||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.reubication.fragment
|
|||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
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.CustomDialogThreeButtons
|
||||
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.ubicador.fragment.UbicadorViewModel
|
||||
|
||||
|
@ -24,7 +22,7 @@ import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewMod
|
|||
//Tarea #3754
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class ReubicationCollectionFragment(
|
||||
var list: List<Reubication>,
|
||||
var list: MutableList<Reubication>,
|
||||
var shelving: String
|
||||
) : BaseFragment<FragmentReubicationCollectionBinding, UbicadorViewModel>(
|
||||
UbicadorViewModel::class
|
||||
|
@ -33,10 +31,11 @@ class ReubicationCollectionFragment(
|
|||
private var adapter: ReubicatorAdapter? = null
|
||||
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||
private lateinit var customDialogInputTwoValues: CustomDialogInputTwoValues
|
||||
private lateinit var listItems: ArrayList<Reubication>
|
||||
|
||||
companion object {
|
||||
fun newInstance(
|
||||
entryPoint: List<Reubication>,
|
||||
entryPoint: MutableList<Reubication>,
|
||||
shelving: String
|
||||
): ReubicationCollectionFragment {
|
||||
|
||||
|
@ -54,7 +53,7 @@ class ReubicationCollectionFragment(
|
|||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun init() {
|
||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
// customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
customDialogInputTwoValues = CustomDialogInputTwoValues(requireContext())
|
||||
ma.hideBottomNavigation(GONE)
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
@ -62,27 +61,35 @@ class ReubicationCollectionFragment(
|
|||
"${getString(R.string.wagoon)}:${shelving.uppercase()}"
|
||||
setEvents()
|
||||
|
||||
// showList(list)
|
||||
// createReubicationsTwo(list)
|
||||
//createReubications(list)
|
||||
showList(list.sortedBy { it.pickingOrder })
|
||||
showList(list.sortedBy { it.pickingOrder } as MutableList<Reubication>)
|
||||
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){
|
||||
Log.d("VERDNATURA:::","El item es "+l.itemFk+":"+l.pickingOrder)
|
||||
for (item in list) {
|
||||
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 {
|
||||
override fun onReubicationClick(reubication: Reubication) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
Log.d("VERDNATURA::", "el click en reubication")
|
||||
showLeaveItemDialog(reubication, "")
|
||||
//binding.splashProgress.visibility = VISIBLE
|
||||
showLeaveItemDialog(reubication)
|
||||
|
||||
|
||||
}
|
||||
|
@ -111,7 +118,12 @@ class ReubicationCollectionFragment(
|
|||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
if (list.isNotEmpty()) {
|
||||
scanPlate(binding.scanInput.text.toString().uppercase())
|
||||
} else {
|
||||
shelving = binding.scanInput.text.toString().uppercase()
|
||||
callItemShelvingReturn()
|
||||
}
|
||||
}
|
||||
|
||||
binding.scanInput.setText("")
|
||||
|
@ -129,76 +141,65 @@ class ReubicationCollectionFragment(
|
|||
var found = false
|
||||
all_list@ for (items in list) {
|
||||
|
||||
for (placements in items.placements) {
|
||||
for (placements in items.carros) {
|
||||
|
||||
|
||||
if (placements.plate == plate ) {
|
||||
Log.d("VERDNATURA::", "Encontrada matrícula")
|
||||
if (placements.shelvingFk == plate) {
|
||||
found = true
|
||||
showLeaveItemDialog(items, placements.plate)
|
||||
showLeaveItemDialog(items)
|
||||
break@all_list
|
||||
|
||||
}
|
||||
|
||||
|
||||
}}
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
ma.messageWithSound(getString(R.string.itemScanetNotFound), true, true, isToasted = true)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showLeaveItemDialog(itemReubication: Reubication, placementReubication: String) {
|
||||
|
||||
|
||||
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
|
||||
ma.messageWithSound(
|
||||
getString(R.string.itemScanetNotFound),
|
||||
true,
|
||||
true,
|
||||
isToasted = true
|
||||
)
|
||||
}
|
||||
customDialogThreeButtons.dismiss()
|
||||
}
|
||||
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
scanRequest()
|
||||
customDialogThreeButtons.dismiss()
|
||||
}.show()
|
||||
private fun showLeaveItemDialog(itemReubication: Reubication) {
|
||||
|
||||
} else {
|
||||
val messageDescrip =
|
||||
getString(R.string.scanPlateToLeave) + itemReubication.itemFk + "-" + itemReubication.longName
|
||||
|
||||
customDialogInputTwoValues.setDescription(messageDescrip)
|
||||
.setValue(itemReubication.visible)
|
||||
.setValue(itemReubication.quantity)
|
||||
.setOkButton(getString(R.string.leaveItem)) {
|
||||
|
||||
|
||||
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.itemShelving_merge(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemReubication.id,
|
||||
placementReubication.uppercase()
|
||||
customDialogInputTwoValues.getValueTwo().uppercase()
|
||||
)
|
||||
|
||||
} else {
|
||||
ma.messageWithSound(
|
||||
getString(R.string.returnScan),
|
||||
true,
|
||||
true,
|
||||
isToasted = true
|
||||
)
|
||||
}
|
||||
customDialogInputTwoValues.setValueTwo("")
|
||||
customDialogInputTwoValues.dismiss()
|
||||
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
customDialogInputTwoValues.setValueTwo("")
|
||||
scanRequest()
|
||||
|
||||
customDialogInputTwoValues.dismiss()
|
||||
}.show()
|
||||
}
|
||||
//}
|
||||
customDialogInputTwoValues.getEditTextTwo()
|
||||
.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
|
@ -242,11 +243,13 @@ class ReubicationCollectionFragment(
|
|||
|
||||
|
||||
if (it.list.isEmpty()) {
|
||||
|
||||
ma.messageWithSound(
|
||||
getString(R.string.errorReubication), true, true, getString(
|
||||
getString(R.string.successReubication), false, true, getString(
|
||||
R.string.info
|
||||
)
|
||||
)
|
||||
ma.onBackPressed()
|
||||
} else {
|
||||
if (it.list[0].isError) {
|
||||
ma.messageWithSound(
|
||||
|
@ -255,8 +258,7 @@ class ReubicationCollectionFragment(
|
|||
)
|
||||
)
|
||||
} else {
|
||||
// createReubications(it.list)
|
||||
createReubicationsTwo(it.list)
|
||||
showList(it.list)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -274,12 +276,7 @@ class ReubicationCollectionFragment(
|
|||
|
||||
ma.messageWithSound(it.response, false, false, "", false)
|
||||
|
||||
if (!list.isEmpty())
|
||||
{
|
||||
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 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 listItems = mutableListOf<String>()
|
||||
val reubication = mutableListOf<Reubication>()
|
||||
|
||||
for (item in list) {
|
||||
|
@ -354,7 +320,7 @@ class ReubicationCollectionFragment(
|
|||
if (item.itemFk == r.itemFk) {
|
||||
|
||||
if (item.shelvingFk.uppercase() != shelving.uppercase())
|
||||
r.placements.add(
|
||||
r.carros.add(
|
||||
PlacementReubication(
|
||||
code = item.code,
|
||||
plate = item.shelvingFk,
|
||||
|
@ -368,7 +334,7 @@ class ReubicationCollectionFragment(
|
|||
|
||||
for (item in list) {
|
||||
Log.d("VERDNATURA::", "el item es " + item.itemFk + "-" + item.id + "-" + item.visible)
|
||||
for (r in item.placements) {
|
||||
for (r in item.carros) {
|
||||
Log.d(
|
||||
"VERDNATURA::",
|
||||
"la reubic es" + r.idItemShelving + "-" + r.plate + "-" + r.code
|
||||
|
@ -376,8 +342,8 @@ class ReubicationCollectionFragment(
|
|||
}
|
||||
}
|
||||
//ma.openFragmentReubications(reubication,shelving)
|
||||
|
||||
*//*
|
||||
showList(list)
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.reubication.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
@ -10,7 +9,6 @@ import es.verdnatura.databinding.FragmentControladorBinding
|
|||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
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.ubicador.fragment.UbicadorViewModel
|
||||
|
||||
|
@ -101,10 +99,6 @@ class ReubicationFragment(var entrypoint: String) :
|
|||
)
|
||||
} else {
|
||||
|
||||
|
||||
/* for (item in it.list){
|
||||
Log.d("VERDNATURA::", "Listando itemFk"+item.itemFk+":"+item.shelvingFk+":"+item.code)
|
||||
}*/
|
||||
createReubications(it.list)
|
||||
|
||||
}
|
||||
|
@ -121,63 +115,7 @@ class ReubicationFragment(var entrypoint: String) :
|
|||
|
||||
private fun createReubications(list: List<Reubication>) {
|
||||
|
||||
|
||||
// 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)
|
||||
ma.openFragmentReubications(list as MutableList<Reubication>, shelvingScaned)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,29 +1,31 @@
|
|||
package es.verdnatura.presentation.view.feature.reubication.model
|
||||
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
||||
|
||||
|
||||
class ReubicationList(
|
||||
var list: ArrayList<Reubication> = arrayListOf()
|
||||
)
|
||||
|
||||
class Reubication(
|
||||
var id: String = "",
|
||||
var shelvingFk: String = "",
|
||||
var code: String = "",
|
||||
var itemFk: String = "",
|
||||
var longName: String = "",
|
||||
var visible: String = "",
|
||||
var placements: MutableList<PlacementReubication> = mutableListOf(),
|
||||
var pickingOrder:Int=0,
|
||||
var id: String = "", //ok
|
||||
var shelvingFk: String = "", //ok
|
||||
var code: String = "", // no
|
||||
var itemFk: String = "",//ok
|
||||
var longName: String = "",//ok
|
||||
var quantity: String = "", //=quantity
|
||||
var carros: MutableList<PlacementReubication> = mutableListOf(),//placements
|
||||
var pickingOrder:Int=0,//no
|
||||
var isError: Boolean=false,
|
||||
var errorMessage: String=""
|
||||
)
|
||||
|
||||
class PlacementReubication(
|
||||
var code:String ="",
|
||||
var code:String ="",//ok =parking
|
||||
var plate: String = "",
|
||||
var visible: String = "",
|
||||
var idItemShelving:String=""
|
||||
var visible: String= "",//ok
|
||||
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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/layout_margin_1"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_marginBottom="@dimen/layout_margin_1"
|
||||
android:textSize="@dimen/body1"
|
||||
android:visibility="gone"
|
||||
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
|
||||
android:id="@+id/textinputlayout_username"
|
||||
android:layout_margin="@dimen/layout_margin_min"
|
||||
android:layout_width="match_parent"
|
||||
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
|
||||
android:id="@+id/custom_dialog_value"
|
||||
style="@style/DefaultButton.NormalButton"
|
||||
android:layout_width="match_parent"
|
||||
android:inputType="number"
|
||||
android:background="@drawable/background_round"
|
||||
android:enabled="false"
|
||||
android:hint="@string/quantity"
|
||||
android:inputType="number"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:background="@drawable/background_round"
|
||||
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
|
||||
android:id="@+id/textinputlayout_two"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="@dimen/layout_margin_min"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/layout_margin_min"
|
||||
android:hint="@string/scanShelving"
|
||||
android:visibility="visible"
|
||||
android:textColorHint="@android:color/darker_gray"
|
||||
>
|
||||
android:visibility="visible">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/custom_dialog_value_two"
|
||||
style="@style/DefaultButton.NormalButton"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/background_round"
|
||||
android:inputType="text"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:background="@drawable/background_round"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textColorHint="@android:color/darker_gray" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/custom_dialog_button_ok"
|
||||
style="@style/DefaultButton.NormalButton"
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{reubication.shelvingFk}"
|
||||
android:text="@{reubication.code}"
|
||||
android:layout_marginRight="@dimen/layout_margin_min"
|
||||
android:textColor="@color/verdnatura_black"
|
||||
android:textSize="@dimen/h8"
|
||||
|
@ -233,10 +233,10 @@
|
|||
android:id="@+id/item_article_quantity"
|
||||
android:layout_width="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:paddingRight="10dp"
|
||||
android:text="@{reubication.visible}"
|
||||
android:text="@{reubication.quantity}"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body1"
|
||||
android:textStyle="bold"
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.plate}"
|
||||
android:text="@{item.shelvingFk}"
|
||||
tool:text="XXX"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textStyle="bold"
|
||||
|
|
|
@ -353,7 +353,7 @@
|
|||
<string name="titlePreControl">Pre Control</string>
|
||||
<string name="titleShelvingHistorical">Histórico ítems 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="orderCompleted">Pedido completado</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="modifiedOriginalQuantityPrevious">Se ha modificado desde previa la cantidad de </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="errorReubication">No aparecen item para el carro escaneado</string>
|
||||
<string name="successReubication">Reubicación finalizada</string>
|
||||
<string name="leaveItem">Dejar item</string>
|
||||
<string name="toReubication">Reubicación</string>
|
||||
<string name="quantity">Cantidad</string>
|
||||
<string name="scanPlateToLeave">Escanea la matrícula donde quieres dejar el item :</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>
|
||||
|
|
|
@ -242,6 +242,7 @@
|
|||
<string name="sure">are you sure?</string>
|
||||
<string name="unmark">Unmark</string>
|
||||
<string name="sectorALGEMESI">ALGEMESI V</string>
|
||||
<string name="sectorALGEMESINEW">SACADOR V</string>
|
||||
<string name="take">Take</string>
|
||||
<string name="errorRegistered">Cause of error registered</string>
|
||||
<string name="printerFault">Select printer</string>
|
||||
|
@ -306,6 +307,7 @@
|
|||
<string name="showParking">Scan Parking</string>
|
||||
<string name="lineNotExist">The purchase line of the scanned label does not exist.</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="splitSent">The article has been sent to Split </string>
|
||||
<string name="fromTicket">" \\u0020from ticket\\u0020"</string>
|
||||
|
@ -355,7 +357,8 @@
|
|||
<string name="titleShelvingHistorical">Shelving historical</string>
|
||||
<string name="titleLogShelving">Log Shelving</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="orderCompleted">Completed order</string>
|
||||
<string name="shelvingSure">Make sure to scan a plate.</string>
|
||||
|
@ -448,6 +451,7 @@
|
|||
<string name="leaveItem">Dejar 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="successReubication">Reubication ended</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue