Version 8.4.1Beta,Tarea #3958

This commit is contained in:
Sergio De la torre 2022-05-27 17:03:10 +02:00
parent 575bfd06be
commit da7121aa50
30 changed files with 451 additions and 321 deletions

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="21114523025303" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-05-27T04:55:50.268970300Z" />
</component>
</project>

View File

@ -16,20 +16,20 @@ class ApiSalixUtils {
val salixRetrofit = Retrofit.Builder().baseUrl(getBaseUrlLocal(context = context)).addConverterFactory( val salixRetrofit = Retrofit.Builder().baseUrl(getBaseUrlLocal(context = context)).addConverterFactory(
GsonConverterFactory.create() GsonConverterFactory.create()
).build() ).build()
d("VERDNATURA::","El server Salix es "+getBaseUrlLocal(context = context)) //d("VERDNATURA::","El server Salix es "+getBaseUrlLocal(context = context))
return salixRetrofit.create(SalixService::class.java) return salixRetrofit.create(SalixService::class.java)
} }
fun getBaseUrlLocal(context: Context): String { fun getBaseUrlLocal(context: Context): String {
var url = this.getDefaults("base_urlSalix", context) var url = this.getDefaults("base_urlSalix", context)
if (url.isNullOrEmpty()) { if (url.isNullOrEmpty()) {
ApiUtils.setDefaults("base_urlSalix", ApiSalixUtils.BASE_URL, context) ApiUtils.setDefaults("base_urlSalix", BASE_URL, context)
} else { } else {
if (!url.contains("http")) { if (!url.contains("http")) {
url = "https://" + url url = "https://" + url
} }
} }
return if (url.isNullOrEmpty()) ApiSalixUtils.BASE_URL else url return if (url.isNullOrEmpty()) BASE_URL else url
} }
fun getDefaults(key: String?, context: Context?): String? { fun getDefaults(key: String?, context: Context?): String? {

View File

@ -4,6 +4,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemProposalRowBinding import es.verdnatura.databinding.ItemProposalRowBinding
import es.verdnatura.presentation.common.OnItemProposalClickListener import es.verdnatura.presentation.common.OnItemProposalClickListener
import es.verdnatura.presentation.common.OnPasillerosItemClickListener import es.verdnatura.presentation.common.OnPasillerosItemClickListener
@ -50,21 +51,21 @@ class ItemProposalAdapter(
itemFk.setOnClickListener { itemFk.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener( onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Consultar artículo" title = res.getString(R.string.itemSearch)
), item.itemFk ), item.itemFk
) )
} }
itemUp.setOnClickListener { itemUp.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener( onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Buscar item" title = res.getString(R.string.titleItemSearch)
), item.itemFk ), item.itemFk
) )
} }
itemDown.setOnClickListener { itemDown.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener( onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Buscar item" title = res.getString(R.string.titleItemSearch)
), item.itemFk ), item.itemFk
) )
} }

View File

@ -16,8 +16,6 @@ import es.verdnatura.databinding.FragmentItemCardBinding
import es.verdnatura.domain.toast import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.common.ToolBarAdapterTooltip.*
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.component.CustomDialogList import es.verdnatura.presentation.view.component.CustomDialogList
import es.verdnatura.presentation.view.component.CustomDialogTwoButtons import es.verdnatura.presentation.view.component.CustomDialogTwoButtons
@ -28,9 +26,7 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemCardRowVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.imageview.activity.ImageViewActivity import es.verdnatura.presentation.view.feature.imageview.activity.ImageViewActivity
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import timber.log.Timber.d
class ItemCardFragment( class ItemCardFragment(
var itemFk: String = "" var itemFk: String = ""
@ -54,7 +50,7 @@ class ItemCardFragment(
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint) fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
} }
// private lateinit var customDialog: CustomDialog // private lateinit var customDialog: CustomDialog
private lateinit var customDialogInput: CustomDialogInput private lateinit var customDialogInput: CustomDialogInput
private lateinit var customDialogList: CustomDialogList private lateinit var customDialogList: CustomDialogList
private lateinit var customDialogTwo: CustomDialogTwoButtons private lateinit var customDialogTwo: CustomDialogTwoButtons
@ -89,7 +85,7 @@ class ItemCardFragment(
private fun setToolBar() { private fun setToolBar() {
binding.mainToolbar.toolbarIcons.visibility=View.VISIBLE binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
val listIcons: ArrayList<ImageView> = ArrayList() val listIcons: ArrayList<ImageView> = ArrayList()
@ -118,10 +114,10 @@ class ItemCardFragment(
} }
iconHistory.drawable -> { iconHistory.drawable -> {
if (itemFk.isNullOrEmpty()) { if (itemFk.isNullOrEmpty()) {
"Escanea un item".toast(requireActivity()) getString(R.string.scanItem).toast(requireActivity())
} else { } else {
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = "Historico"), PasillerosItemVO(title = getString(R.string.titleHistorical)),
itemInfoG!!.id itemInfoG!!.id
) )
@ -183,11 +179,11 @@ class ItemCardFragment(
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
var working_in_test=false //sergio:No posar a true fins que Salix puje versió 8.3 var working_in_test = false //sergio:No posar a true fins que Salix puje versió 8.3
if (working_in_test){ if (working_in_test) {
viewModel.getItemPackingTypeSalix(getData(TOKEN)) viewModel.getItemPackingTypeSalix(getData(TOKEN))
}else { } else {
viewModel.getItemPackingType(getData(USER), getData(PASSWORD)) viewModel.getItemPackingType(getData(USER), getData(PASSWORD))
} }
} }
@ -200,7 +196,7 @@ class ItemCardFragment(
binding.itemcardLayout.visibility = GONE binding.itemcardLayout.visibility = GONE
binding.splashProgressTwo.visibility = GONE binding.splashProgressTwo.visibility = GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard) binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
ma.messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage, true, false)
} else { } else {
if (it.id != "0") { if (it.id != "0") {
@ -209,8 +205,13 @@ class ItemCardFragment(
} else { } else {
binding.splashProgressTwo.visibility = GONE binding.splashProgressTwo.visibility = GONE
binding.itemcardLayout.visibility = View.GONE binding.itemcardLayout.visibility = View.GONE
binding.mainToolbar.toolbarTitle.text =getString(R.string.itemCard) binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
ma.messageWithSound("No hemos podido encontrar el articulo. Revisa el sector.",true,false,getString(R.string.noResults)) ma.messageWithSound(
getString(R.string.itemNotFound),
true,
false,
getString(R.string.noResults)
)
} }
@ -226,7 +227,7 @@ class ItemCardFragment(
response.observe(viewLifecycleOwner, Observer { response.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, false)
} else { } else {
getItemCard(itemFk) getItemCard(itemFk)
} }
@ -263,14 +264,20 @@ class ItemCardFragment(
listItemsRow = ArrayList() listItemsRow = ArrayList()
//sergio itemcard por item_getInfo //sergio itemcard por item_getInfo
/* listItemsRow.add( /* listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.total),
value = itemInfo.total,
isEditable = false
)
)*/
listItemsRow.add(
ItemCardRowVO( ItemCardRowVO(
title = getString(R.string.total), title = getString(R.string.total),
value = itemInfo.total, value = itemInfo.visible,
isEditable = false isEditable = false
) )
)*/ )
listItemsRow.add(ItemCardRowVO(title = getString(R.string.total),value = itemInfo.visible,isEditable = false))
listItemsRow.add( listItemsRow.add(
ItemCardRowVO( ItemCardRowVO(
@ -281,31 +288,44 @@ class ItemCardFragment(
) )
//sergio itemcard por item_getInfo //sergio itemcard por item_getInfo
/* listItemsRow.add( /* listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Ubicado),
value = itemInfo.enAltillo,
isEditable = false
)
)*/
listItemsRow.add(
ItemCardRowVO( ItemCardRowVO(
title = getString(R.string.Ubicado), title = getString(R.string.Ubicado),
value = itemInfo.enAltillo, value = itemInfo.vVisibleItemShelving,
isEditable = false isEditable = false
) )
)*/ )
listItemsRow.add(ItemCardRowVO(title = getString(R.string.Ubicado),value = itemInfo.vVisibleItemShelving,isEditable = false))
//sergio itemcard por item_getInfo //sergio itemcard por item_getInfo
/* listItemsRow.add( /* listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.SINUBICAR),
value = itemInfo.enNicho,
isEditable = false,
action = "itemStockUpdate"
)
)*/
listItemsRow.add(
ItemCardRowVO( ItemCardRowVO(
title = getString(R.string.SINUBICAR), title = getString(R.string.SINUBICAR),
value = itemInfo.enNicho, value = itemInfo.unlocated,
isEditable = false, isEditable = false,
action = "itemStockUpdate" action = "itemStockUpdate"
) )
)*/ )
listItemsRow.add(ItemCardRowVO(title = getString(R.string.SINUBICAR),value = itemInfo.unlocated,isEditable = false, action = "itemStockUpdate"))
//EDITABLES //EDITABLES
listItemsRow.add( listItemsRow.add(
ItemCardRowVO( ItemCardRowVO(
title = "Artículos similares", title = getString(R.string.titleSimilarItems),
isEditable = true, isEditable = true,
action = "itemProposal" action = "itemProposal"
) )
@ -398,7 +418,7 @@ class ItemCardFragment(
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Buscar artículos similares" title = getString(R.string.titleSearchSimilarItems)
), itemFk ), itemFk
) )
@ -408,7 +428,7 @@ class ItemCardFragment(
} else { } else {
if (item.action != "toBarcode" && item.action != "buscarItem" && item.action != "itemStockUpdateAdd" && item.action != "itemStockUpdateRemove") { if (item.action != "toBarcode" && item.action != "buscarItem" && item.action != "itemStockUpdateAdd" && item.action != "itemStockUpdateRemove") {
customDialogInput.setTitle(item.title!!) customDialogInput.setTitle(item.title!!)
.setDescription("Valor actual: " + item.value!!) .setDescription(getString(R.string.currentVAlue) + item.value!!)
.setOkButton(getString(R.string.save)) { .setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
@ -437,12 +457,12 @@ class ItemCardFragment(
} else if (item.action == "buscarItem") { } else if (item.action == "buscarItem") {
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Buscar item" title = getString(R.string.titleItemSearch)
), itemFk ), itemFk
) )
} else if (item.action == "itemStockUpdateAdd") { } else if (item.action == "itemStockUpdateAdd") {
customDialogInput.setTitle(item.title!!) customDialogInput.setTitle(item.title!!)
.setDescription("Indica la cantidad a dar de alta") .setDescription(getString(R.string.quantityToRegister))
.setOkButton(getString(R.string.save)) { .setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
@ -467,7 +487,7 @@ class ItemCardFragment(
} }
} else if (item.action == "itemStockUpdateRemove") { } else if (item.action == "itemStockUpdateRemove") {
customDialogInput.setTitle(item.title!!) customDialogInput.setTitle(item.title!!)
.setDescription("Indica la cantidad a dar de baja ") .setDescription(getString(R.string.quantityToUnregister))
.setOkButton(getString(R.string.save)) { .setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue()) editItemCardRow(item, customDialogInput.getValue())
@ -517,14 +537,14 @@ class ItemCardFragment(
// "itemStockUpdate" -> prepareItemStockUpdate(item,value) // "itemStockUpdate" -> prepareItemStockUpdate(item,value)
"itemStockUpdateAdd" -> prepareItemStockUpdate2(item, value) "itemStockUpdateAdd" -> prepareItemStockUpdate2(item, value)
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value) "itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value)
/* "itemPlacementSave" -> viewModel.itemPlacementSave( /* "itemPlacementSave" -> viewModel.itemPlacementSave(
itemFk = itemFk, itemFk = itemFk,
warehouseFk = warehouseFk, warehouseFk = warehouseFk,
user = user, user = user,
password = password, password = password,
value = value, value = value,
"itemPlacementSave" "itemPlacementSave"
)*/ )*/
"updateGrouping" -> viewModel.updateGrouping( "updateGrouping" -> viewModel.updateGrouping(
itemFk = itemFk, itemFk = itemFk,
user = user, user = user,
@ -554,7 +574,7 @@ class ItemCardFragment(
} }
if (item.action != "itemStockUpdate" && item.action != "itemStockUpdateRemove" && item.action !="itemStockUpdateAdd") if (item.action != "itemStockUpdate" && item.action != "itemStockUpdateRemove" && item.action != "itemStockUpdateAdd")
// changeOfflineValue(item,value, listBarcodes) // changeOfflineValue(item,value, listBarcodes)
showProgress() showProgress()
} }
@ -618,42 +638,43 @@ class ItemCardFragment(
private fun prepareItemStockUpdate2(itemB: ItemCardRowVO, value: String) { private fun prepareItemStockUpdate2(itemB: ItemCardRowVO, value: String) {
try { try {
value.toInt() value.toInt()
if (itemB.action == "itemStockUpdateRemove") { if (itemB.action == "itemStockUpdateRemove") {
customDialogTwo.setTitle(itemB.title!!) customDialogTwo.setTitle(itemB.title!!)
.setDescription("Indica la causa de eliminar stock:").setOkButton("Falta") { .setDescription(getString(R.string.deleteStock))
viewModel.itemTrash( .setOkButton(getString(R.string.fault)) {
itemFk = itemFk, viewModel.itemTrash(
warehouseFk = warehouseFk, itemFk = itemFk,
user = user, warehouseFk = warehouseFk,
password = password, user = user,
newValue = value, password = password,
isTrash = "0" newValue = value,
isTrash = "0"
) )
//changeOfflineValue(itemB,value, listBarcodes) //changeOfflineValue(itemB,value, listBarcodes)
showProgress() showProgress()
customDialogTwo.dismiss() customDialogTwo.dismiss()
}.setOkButtonTwo("Basura") { }.setOkButtonTwo(getString(R.string.trash)) {
viewModel.itemTrash( viewModel.itemTrash(
itemFk = itemFk, itemFk = itemFk,
warehouseFk = warehouseFk, warehouseFk = warehouseFk,
user = user, user = user,
password = password, password = password,
newValue = value, newValue = value,
isTrash = "1" isTrash = "1"
) )
//changeOfflineValue(itemB,value, listBarcodes) //changeOfflineValue(itemB,value, listBarcodes)
showProgress() showProgress()
customDialogTwo.dismiss() customDialogTwo.dismiss()
}.setKoButton(getString(R.string.cancel)) { }.setKoButton(getString(R.string.cancel)) {
customDialogTwo.dismiss() customDialogTwo.dismiss()
}.show() }.show()
} else { } else {
//changeOfflineValue(itemB,value, listBarcodes) //changeOfflineValue(itemB,value, listBarcodes)
showProgress() showProgress()
@ -668,8 +689,8 @@ class ItemCardFragment(
) )
} }
} catch (e: Exception) { } catch (e: Exception) {
// binding.itemcardLayout.visibility = View.GONE // binding.itemcardLayout.visibility = View.GONE
ma.messageWithSound("El elemento introducido no es un número",true,true) ma.messageWithSound(getString(R.string.errorNotNumber), true, true)
} }
} }
@ -726,27 +747,25 @@ class ItemCardFragment(
listBarcodes.add(BarcodeVO(code)) listBarcodes.add(BarcodeVO(code))
} }
// var working_in_test=false //sergio:Revisar como borrar directamente en Salix o crear proc en back para borrar. // var working_in_test=false //sergio:Revisar como borrar directamente en Salix o crear proc en back para borrar.
if (delete=="0") { if (delete == "0") {
viewModel.barcodesEditSalix( viewModel.barcodesEditSalix(
token=getData(TOKEN), token = getData(TOKEN),
itemFk = itemInfoG!!.id, itemFk = itemInfoG!!.id,
barCodeValue = code, barCodeValue = code,
) )
} } else {
else{
viewModel.barcodesEdit( viewModel.barcodesEdit(
itemFk = itemInfoG!!.id, itemFk = itemInfoG!!.id,
user = user, user = user,
password = password, password = password,
value = code, value = code,
delete = delete, delete = delete,
) )
} }
barcodeAdapter!!.notifyDataSetChanged() barcodeAdapter!!.notifyDataSetChanged()
showProgress() showProgress()
} }
@ -764,7 +783,7 @@ class ItemCardFragment(
array array
) { _, position -> ) { _, position ->
updateItemPackingType(itemsPackingType[position].code.toString()) updateItemPackingType(itemsPackingType[position].code.toString())
} }
@ -774,8 +793,8 @@ class ItemCardFragment(
private fun updateItemPackingType(itemPackingType: String) { private fun updateItemPackingType(itemPackingType: String) {
binding.splashProgress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
/* var working_in_test=true //sergio: en proves app /* var working_in_test=true //sergio: en proves app
if (working_in_test){*/ if (working_in_test){*/
viewModel.updatePackingTypeSalix( viewModel.updatePackingTypeSalix(
getData(TOKEN), getData(TOKEN),
this.itemFk, this.itemFk,

View File

@ -308,7 +308,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
) )
} else { } else {
_response.value = _response.value =
ResponseItemVO(isError = false, response = "Actualizado grouping") ResponseItemVO(isError = false, response = response.message())
} }
} }
@ -344,7 +344,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
) )
} else { } else {
_response.value = _response.value =
ResponseItemVO(isError = false, response = "Actualizado packing") ResponseItemVO(isError = false, response = response.message())
} }
} }

View File

@ -91,7 +91,7 @@ class BufferFragment(
if (it.isError) { if (it.isError) {
ma.messageWithSound( ma.messageWithSound(
it.errorMessage,true,isPlayed = true) getString(R.string.errorOperation)+ it.errorMessage,it.isError,isPlayed = true)
} else { } else {

View File

@ -57,7 +57,7 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() {
//_bufferresponse.value = false //_bufferresponse.value = false
_itembuffertype.value = ResponseItemVO( _itembuffertype.value = ResponseItemVO(
isError = true, isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this),"Error al realizar la operación")) errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
} }

View File

@ -142,8 +142,8 @@ class BufferLoadFragment(
private fun getTextScaned(TagScaned: Int): String { private fun getTextScaned(TagScaned: Int): String {
return when (TagScaned) { return when (TagScaned) {
1 -> "Expedición:" 1 -> getString(R.string.expedition)
2 -> "Buffer:" 2 -> getString(R.string.buffer)
else -> { ""} else -> { ""}
} }
@ -153,7 +153,7 @@ class BufferLoadFragment(
private fun showExpeditionOrBufferScan() { private fun showExpeditionOrBufferScan() {
customDialogList.setTitle("Escanea etiqueta de la expedición.") customDialogList.setTitle(getString(R.string.scanLabelExpedition))
.setOkButton(getString(R.string.close)) { .setOkButton(getString(R.string.close)) {
ma.hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())

View File

@ -354,7 +354,7 @@ class SaleAdapter(
itemView.background.colorFilter = itemView.background.colorFilter =
BlendModeColorFilter(0xFF4c2882.toInt(), BlendMode.SRC_ATOP) BlendModeColorFilter(0xFF4c2882.toInt(), BlendMode.SRC_ATOP)
// BlendModeColorFilter(Color.YELLOW, BlendMode.SRC_ATOP) // BlendModeColorFilter(Color.YELLOW, BlendMode.SRC_ATOP)
Log.d("VERDNATURA::", "EL COLOR ES " + color) //Log.d("VERDNATURA::", "EL COLOR ES " + color)
} else { } else {
itemView.background.setColorFilter(0xFF4c2882.toInt(), PorterDuff.Mode.SRC_ATOP) itemView.background.setColorFilter(0xFF4c2882.toInt(), PorterDuff.Mode.SRC_ATOP)
} }

View File

@ -232,7 +232,7 @@ class CollectionFragment(
iconPhone.drawable -> getExtensionFromUser() iconPhone.drawable -> getExtensionFromUser()
iconParking.drawable->pasillerosItemClickListener?.onPasillerosItemClickListener( iconParking.drawable->pasillerosItemClickListener?.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Parking" title = getString(R.string.Parking)
), "" ), ""
) )
} }
@ -272,7 +272,7 @@ class CollectionFragment(
private fun showUser() { private fun showUser() {
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = "Control de usuario de vehículo"), PasillerosItemVO(title = getString(R.string.userVehicleControl)),
workerFkFromTicket workerFkFromTicket
) )
@ -432,7 +432,7 @@ class CollectionFragment(
responseItem_updatePackingShelve.observe(viewLifecycleOwner, Observer { responseItem_updatePackingShelve.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
ma.messageWithSound( ma.messageWithSound(
if (it.isError) it.errorMessage else "Packing guardado", if (it.isError) it.errorMessage else getString(R.string.packingSave),
it.isError, !it.isError it.isError, !it.isError
) )
if (!it.isError) { if (!it.isError) {
@ -453,7 +453,7 @@ class CollectionFragment(
ma.messageWithSound(it.errorMessage, true, true) ma.messageWithSound(it.errorMessage, true, true)
} else { } else {
ma.messageWithSound("Previa recogida", false, true) ma.messageWithSound(getString(R.string.previousCollected), false, true)
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
getData(USER), getData(USER),
@ -480,7 +480,7 @@ class CollectionFragment(
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
// if (!goBack) { // if (!goBack) {
if (it.isError) { if (it.isError) {
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage) customDialog.setTitle(getString(R.string.disponibility)).setDescription(it.errorMessage)
.setKoButton(getString(R.string.close)) { .setKoButton(getString(R.string.close)) {
scanRequest() scanRequest()
customDialog.dismiss() customDialog.dismiss()
@ -1214,7 +1214,8 @@ class CollectionFragment(
private fun setListPosition(position: Int, isFromBack: Boolean) { private fun setListPosition(position: Int, isFromBack: Boolean) {
storedPosition = position storedPosition = position
if (type == SACADOR || (type == CONTROLADOR && (getData(SECTORDESCRIP).uppercase() == "ALGEMESI V"))) { if (type == SACADOR || (type == CONTROLADOR && (getData(SECTORDESCRIP).uppercase() == getString(
R.string.sectorALGEMESI)))) {
if (binding.fragmentSacadorCollections != null) { if (binding.fragmentSacadorCollections != null) {
binding.fragmentSacadorCollections.addViewObserver { binding.fragmentSacadorCollections.addViewObserver {
lm!!.scrollToPositionWithOffset(position, 0) lm!!.scrollToPositionWithOffset(position, 0)
@ -1249,9 +1250,9 @@ class CollectionFragment(
private fun unMarkLine(position: Int, newType: String) { private fun unMarkLine(position: Int, newType: String) {
state = 0 state = 0
if (sales[position].isPrepared == "1") { if (sales[position].isPrepared == "1") {
customDialog.setTitle("Desmarcar linea") customDialog.setTitle(getString(R.string.unmarkLine))
.setDescription("Vas a desmarcar la linea: " + sales[position].itemFk + " ¿Estás seguro?") .setDescription(getString(R.string.goUnmark) + sales[position].itemFk + getString(R.string.sure))
.setOkButton("Desmarcar") { .setOkButton(getString(R.string.unmark)) {
sales[position].isPrepared = "0" sales[position].isPrepared = "0"
sales[position].pickedQuantity = "0" sales[position].pickedQuantity = "0"
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
@ -1340,7 +1341,8 @@ class CollectionFragment(
} }
try { try {
// Log.i("VERDNATURA:","Pulso COGER-1") // Log.i("VERDNATURA:","Pulso COGER-1")
customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton("Coger") { customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton(getString(
R.string.take)) {
if (customDialogList.getValueTwo().isNotEmpty()) { if (customDialogList.getValueTwo().isNotEmpty()) {
if (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue() if (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue()
.toInt() > total.toInt() .toInt() > total.toInt()
@ -1868,7 +1870,7 @@ class CollectionFragment(
private fun ticketCollection_setUsedShelves() { private fun ticketCollection_setUsedShelves() {
if (type.equals("CHECKER") && (isMarking && getData(SECTORDESCRIP).uppercase() != "ALGEMESI V") if (type.equals("CHECKER") && (isMarking && getData(SECTORDESCRIP).uppercase() != getString(R.string.sectorALGEMESI))
) { ) {
@ -2493,7 +2495,7 @@ class CollectionFragment(
vSaleFk = mistakeSale?.saleFk!!, vSaleFk = mistakeSale?.saleFk!!,
vUserFk = mistakeSale?.workerFk!!, vUserFk = mistakeSale?.workerFk!!,
vTypeFk = it.id) vTypeFk = it.id)
"Causa del error registrado".toast(requireContext()) getString(R.string.errorRegistered).toast(requireContext())
customDialogList.dismiss() customDialogList.dismiss()
} }
} }

View File

@ -117,7 +117,7 @@ class CollectionShowTicketFragment(
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(requireContext()) (getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(requireContext())
}else{ }else{
ma.messageWithSound("Falta seleccionar impresora",isError = true,true,"Error al imprimir",false) ma.messageWithSound(getString(R.string.printerFault),isError = true,true,getString(R.string.error),false)
} }
} }
@ -252,7 +252,7 @@ class CollectionShowTicketFragment(
private fun printObservations(observations: String) { private fun printObservations(observations: String) {
if (observations.trim().isNotEmpty()) { if (observations.trim().isNotEmpty()) {
customDialog.setTitle("Observaciones").setDescription(observations) customDialog.setTitle(getString(R.string.observations)).setDescription(observations)
.setOkButton(getString(R.string.accept)) { .setOkButton(getString(R.string.accept)) {
customDialog.hide() customDialog.hide()
customDialog.dismiss() customDialog.dismiss()

View File

@ -4,7 +4,8 @@ import android.content.Context
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Build import android.os.Build
import android.util.TypedValue import android.util.TypedValue
import android.view.View.* import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.ImageView import android.widget.ImageView
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
@ -19,9 +20,6 @@ import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
import java.text.SimpleDateFormat
import java.util.*
import kotlin.collections.ArrayList
class ControlVehiculoFragment( class ControlVehiculoFragment(
var tagName: String = "" var tagName: String = ""
@ -35,7 +33,7 @@ class ControlVehiculoFragment(
private lateinit var customDialog: CustomDialog private lateinit var customDialog: CustomDialog
private var isWorkedTimed = "UNREGISTERED" private var isWorkedTimed = "UNREGISTERED"
private lateinit var customDialogInput: CustomDialogInput private lateinit var customDialogInput: CustomDialogInput
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
companion object { companion object {
fun newInstance(tagName: String) = ControlVehiculoFragment(tagName) fun newInstance(tagName: String) = ControlVehiculoFragment(tagName)
@ -63,7 +61,7 @@ class ControlVehiculoFragment(
if (tagName.equals(HistoricoVehiculoFragment.TAG)) { if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
setToolBar("HISTORY") setToolBar("HISTORY")
showScanner("Escanea matrícula para ver histórico", "HISTORY") showScanner(getString(R.string.scanShelvingHistorical), "HISTORY")
} else { } else {
checkControlTimeVehicle() checkControlTimeVehicle()
@ -76,7 +74,6 @@ class ControlVehiculoFragment(
} }
override fun onPause() { override fun onPause() {
goBack = true goBack = true
super.onPause() super.onPause()
@ -98,36 +95,43 @@ class ControlVehiculoFragment(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconHistory.tooltipText=getTooltip(R.drawable.ic_history_black_24dp) iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
iconVehicleIn.tooltipText=getTooltip(R.drawable.car) iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
iconVehicleOut.tooltipText=getTooltip(R.drawable.car_off) iconVehicleOut.tooltipText = getTooltip(R.drawable.car_off)
} }
when (direction){ when (direction) {
"OUT"-> { "OUT" -> {
listIcons.remove(iconVehicleIn) listIcons.remove(iconVehicleIn)
listIcons.add(iconVehicleOut) listIcons.add(iconVehicleOut)
listIcons.add(iconHistory) listIcons.add(iconHistory)
} }
"IN"->{ "IN" -> {
listIcons.remove(iconVehicleOut) listIcons.remove(iconVehicleOut)
listIcons.add(iconVehicleIn) listIcons.add(iconVehicleIn)
listIcons.add(iconHistory) listIcons.add(iconHistory)
} }
} }
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter =
override fun onOptionsItemSelected(item: Drawable) { ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
when (item){ when (item) {
iconHistory.drawable-> showScanner("Escanea matrícula para ver histórico", "HISTORY") iconHistory.drawable -> showScanner(
iconVehicleIn.drawable-> showScanner("Escanea matrícula del vehículo", "IN") getString(R.string.scanShelvingHistorical),
iconVehicleOut.drawable-> showScanner("Escanea matrícula para dejar vehículo", "OUT") "HISTORY"
)
iconVehicleIn.drawable -> showScanner(getString(R.string.scanPlate), "IN")
iconVehicleOut.drawable -> showScanner(
getString(R.string.scanPlateTakeoff),
"OUT"
)
}
} }
} })
})
binding.mainToolbar.toolbarIcons.layoutManager = binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
@ -149,7 +153,7 @@ class ControlVehiculoFragment(
.setKoButton(getString(R.string.cancel)) { .setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss() customDialogInput.dismiss()
if (tagName.equals(HistoricoVehiculoFragment.TAG)) { if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
ma.onBackPressed() ma.onBackPressed()
} }
}.setValue("").show() }.setValue("").show()
@ -177,13 +181,10 @@ class ControlVehiculoFragment(
private fun checkControlTimeVehicle() { private fun checkControlTimeVehicle() {
if (!goBack) { if (!goBack) {
// d("la fecha es "+getData("DATENOVEHICLE"))
//if (!IsNoVehicleDataToday()){
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.workerMachinery_isRegistered(getData(USER),getData(PASSWORD)) viewModel.workerMachinery_isRegistered(getData(USER), getData(PASSWORD))
/*}else{
ma.openFragmentPickers()
}*/
} }
} }
@ -196,10 +197,10 @@ class ControlVehiculoFragment(
) )
} else if (direction.equals("IN")) { } else if (direction.equals("IN")) {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.machineWorker_add(getData(USER),getData(PASSWORD), plateNumber,"machineWorker_add") viewModel.machineWorker_add(getData(USER), getData(PASSWORD), plateNumber)
} else if (direction.equals("OUT")) { } else if (direction.equals("OUT")) {
viewModel.machineWorker_update(getData(USER),getData(PASSWORD), plateNumber,"machineWorker_update") viewModel.machineWorker_update(getData(USER), getData(PASSWORD), plateNumber)
} else if (direction.equals("")) { } else if (direction.equals("")) {
ma.openFragmentPickers(true) ma.openFragmentPickers(true)
@ -208,8 +209,8 @@ class ControlVehiculoFragment(
} }
private fun scanRequest() { private fun scanRequest() {
// if (binding.scanInput != null) { // if (binding.scanInput != null) {
binding.scanInput.requestFocus() binding.scanInput.requestFocus()
//} //}
hideKeyboards() hideKeyboards()
} }
@ -253,12 +254,12 @@ class ControlVehiculoFragment(
customDialogThreeButtons.setCustomDialogValue(GONE) customDialogThreeButtons.setCustomDialogValue(GONE)
customDialogThreeButtons.setDescription("¿Qué desea hacer con el vehículo de matrícula $plate") customDialogThreeButtons.setDescription(getString(R.string.doVehiclePlate) + plate + "?")
.setValue(plate) .setValue(plate)
if (isWorkedTimed.equals("UNREGISTERED")) { if (isWorkedTimed.equals("UNREGISTERED")) {
customDialogThreeButtons.setOkButtonTwo("COGER") { customDialogThreeButtons.setOkButtonTwo("COGER") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) getString(R.string.returnScan).toast(requireContext())
} else { } else {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
@ -269,7 +270,7 @@ class ControlVehiculoFragment(
customDialogThreeButtons.setOkButtonThree("DEJAR") { customDialogThreeButtons.setOkButtonThree("DEJAR") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) getString(R.string.returnScan).toast(requireContext())
} else { } else {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
@ -278,7 +279,7 @@ class ControlVehiculoFragment(
} }
}.setOkButtonFour("HISTÓRICO") { }.setOkButtonFour("HISTÓRICO") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) getString(R.string.returnScan).toast(requireContext())
} else { } else {
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY") insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY")
@ -295,12 +296,13 @@ class ControlVehiculoFragment(
customDialogThreeButtons.setCustomDialogValue(GONE) customDialogThreeButtons.setCustomDialogValue(GONE)
customDialogThreeButtons.setDescription("¿Qué desea hacer con el vehículo de matrícula $plate") customDialogThreeButtons.setDescription(getString(R.string.doVehiclePlate) + plate + "?")
.setValue(plate) .setValue(plate)
.setOkButtonFour("HISTÓRICO") { .setOkButtonFour("HISTÓRICO") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) { if (customDialogThreeButtons.getValue().trim().isEmpty()) {
"Vuelva a escanear".toast(requireContext()) getString(R.string.returnScan).toast(requireContext())
} else { } else {
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY") insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY")
@ -317,10 +319,10 @@ class ControlVehiculoFragment(
with(viewModel) { with(viewModel) {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
responseinsert.observe(viewLifecycleOwner, { responseinsert.observe(viewLifecycleOwner, {
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage, true, false)
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton(getString(R.string.close)) { .setOkButton(getString(R.string.close)) {
customDialog.dismiss() customDialog.dismiss()
@ -353,11 +355,11 @@ class ControlVehiculoFragment(
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
}) })
responsecontrol.observe(viewLifecycleOwner, { responsecontrol.observe(viewLifecycleOwner, {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
// Log.i("VERDNATURA:","${it.response}") // Log.i("VERDNATURA:","${it.response}")
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage,true,false) ma.messageWithSound(it.errorMessage, true, false)
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage) /*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton(getString(R.string.close)) { .setOkButton(getString(R.string.close)) {
customDialog.dismiss() customDialog.dismiss()
@ -379,19 +381,20 @@ class ControlVehiculoFragment(
if (it.response.equals("0")) { if (it.response.equals("0")) {
setToolBar("IN") setToolBar("IN")
/* customDialog.setTitle("Control de vehículos") /* customDialog.setTitle("Control de vehículos")
.setDescription("Escanea la matrícula del vehículo o elige sin vehículo") .setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
.setOkButton("Escanear vehículo") { .setOkButton("Escanear vehículo") {
customDialog.dismiss() customDialog.dismiss()
showScanner("Escanea matrícula del vehículo", "IN") showScanner("Escanea matrícula del vehículo", "IN")
} }
.setKoButton("SIN VEHÍCULO") { .setKoButton("SIN VEHÍCULO") {
customDialog.dismiss() customDialog.dismiss()
saveData(DATENOVEHICLE, SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()).toString()) saveData(DATENOVEHICLE, SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()).toString())
ma.openFragmentPickers(true) ma.openFragmentPickers(true)
}.show()*/ }.show()*/
customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription("Escanea la matrícula del vehículo o elige sin vehículo") customDialogInput.setTitle(getString(R.string.vehiclecontrol))
.setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
.setOkButton("Coger vehículo") { .setOkButton("Coger vehículo") {
if (customDialogInput.getValue().isNotEmpty()) { if (customDialogInput.getValue().isNotEmpty()) {
// "$description ${customDialogInput.getValue()} OK".toast(requireContext()) // "$description ${customDialogInput.getValue()} OK".toast(requireContext())
@ -406,13 +409,13 @@ class ControlVehiculoFragment(
.setKoButton("Sin vehículo") { .setKoButton("Sin vehículo") {
customDialogInput.dismiss() customDialogInput.dismiss()
ma.openFragmentPickers(true) ma.openFragmentPickers(true)
/* if (tagName.equals(HistoricoVehiculoFragment.TAG)) { /* if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
ma.onBackPressed() ma.onBackPressed()
}*/ }*/
}.setValue("").show() }.setValue("").show()
customDialogInput.setFocusText() customDialogInput.setFocusText()
} }
} }
@ -423,11 +426,6 @@ class ControlVehiculoFragment(
} }
private fun IsNoVehicleDataToday(): Boolean {
return (getData(DATENOVEHICLE)==SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()))
}
} }

View File

@ -33,7 +33,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
fun machineWorker_add( fun machineWorker_add(
usuario: String, usuario: String,
password: String, password: String,
PlateNumber: String,callFunction:String PlateNumber: String
) { ) {
getVehicleControlTimeUserCase.machineWorker_add(usuario, password, PlateNumber) getVehicleControlTimeUserCase.machineWorker_add(usuario, password, PlateNumber)
.enqueue(object : Callback<Boolean> { .enqueue(object : Callback<Boolean> {
@ -65,7 +65,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
fun machineWorker_update( fun machineWorker_update(
usuario: String, usuario: String,
password: String, password: String,
PlateNumber: String,callFunction:String PlateNumber: String
) { ) {
getVehicleControlTimeUserCase.machineWorker_update(usuario, password, PlateNumber) getVehicleControlTimeUserCase.machineWorker_update(usuario, password, PlateNumber)
.enqueue(object : Callback<Boolean> { .enqueue(object : Callback<Boolean> {

View File

@ -140,8 +140,8 @@ class FaltasFragment :
adapter = FaltasAdapter(listInvetory, object : OnFaltasNichoClickListener { adapter = FaltasAdapter(listInvetory, object : OnFaltasNichoClickListener {
override fun onFaltasNichoClickListener(item: ItemFaltasVO) { override fun onFaltasNichoClickListener(item: ItemFaltasVO) {
customDialogInput.setTitle(item.itemFk + "\n" + item.longName + " " + item.size) customDialogInput.setTitle(item.itemFk + "\n" + item.longName + " " + item.size)
.setDescription("Cantidad real(" + item.nicho + ")") .setDescription(getString(R.string.quantityReal) + item.nicho + ")")
.setOkButton("Tirar") { .setOkButton(getString(R.string.pull)) {
viewModel.itemStockUpdate( viewModel.itemStockUpdate(
item.itemFk, item.itemFk,
getData(WAREHOUSEFK), getData(WAREHOUSEFK),

View File

@ -3,13 +3,11 @@ package es.verdnatura.presentation.view.feature.faltas.fragment
import android.content.Context import android.content.Context
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.GetInventaryUserCase import es.verdnatura.domain.GetInventaryUserCase
import es.verdnatura.domain.GetItemCardUserCase import es.verdnatura.domain.GetItemCardUserCase
import es.verdnatura.presentation.base.BaseViewModel import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasListVO import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasListVO
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
@ -33,15 +31,20 @@ class FaltasViewModel(context: Context) : BaseViewModel() {
get() = _response get() = _response
val loadFaltasList = Transformations.map(_faltasList) { Event(it) } //val loadFaltasList = Transformations.map(_faltasList) { Event(it) }
fun getFaltas(user:String,password:String,warehouseFk:String){ fun getFaltas(user: String, password: String, warehouseFk: String) {
getInventaryUserCase.faultsReview(user,password,warehouseFk).enqueue(object : getInventaryUserCase.faultsReview(user, password, warehouseFk).enqueue(object :
Callback<List<ItemFaltasVO>> { Callback<List<ItemFaltasVO>> {
override fun onFailure(call: Call<List<ItemFaltasVO>>, t: Throwable) { override fun onFailure(call: Call<List<ItemFaltasVO>>, t: Throwable) {
val listError:ArrayList<ItemFaltasVO> = ArrayList() val listError: ArrayList<ItemFaltasVO> = ArrayList()
listError.add(ItemFaltasVO(isError = true,errorMessage ="Error en la llamada faultsReview."+ t.message!!)) listError.add(
ItemFaltasVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
)
_faltasList.value = ItemFaltasListVO(listError) _faltasList.value = ItemFaltasListVO(listError)
} }
@ -49,11 +52,19 @@ class FaltasViewModel(context: Context) : BaseViewModel() {
call: Call<List<ItemFaltasVO>>, call: Call<List<ItemFaltasVO>>,
response: Response<List<ItemFaltasVO>> response: Response<List<ItemFaltasVO>>
) { ) {
if (response.body() != null){ if (response.body() != null) {
_faltasList.value = response.body()?.let { ItemFaltasListVO(it) } _faltasList.value = response.body()?.let { ItemFaltasListVO(it) }
}else{ } else {
val listError:ArrayList<ItemFaltasVO> = ArrayList() val listError: ArrayList<ItemFaltasVO> = ArrayList()
listError.add(ItemFaltasVO(isError = true,errorMessage = "Error en la llamada faultsReview")) listError.add(
ItemFaltasVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_faltasList.value = ItemFaltasListVO(listError) _faltasList.value = ItemFaltasListVO(listError)
} }
} }
@ -61,40 +72,75 @@ class FaltasViewModel(context: Context) : BaseViewModel() {
}) })
} }
fun itemStockUpdate(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String){ fun itemStockUpdate(
getItemCardUserCase.itemStockUpdate(user,password,itemFk,warehouseFk,newValue,isTrash).enqueue(object : itemFk: String,
Callback<Any> { warehouseFk: String,
override fun onFailure(call: Call<Any>, t: Throwable) { user: String,
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) password: String,
} newValue: String,
isTrash: String
override fun onResponse(call: Call<Any>, response: Response<Any>) { ) {
if (response.isSuccessful()){ getItemCardUserCase.itemStockUpdate(user, password, itemFk, warehouseFk, newValue, isTrash)
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())) .enqueue(object :
}else{ Callback<Any> {
_response.value = ResponseItemVO(isError = false,response = response.message()) override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
} }
} override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (response.isSuccessful()) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_response.value =
ResponseItemVO(isError = false, response = response.message())
}
}) }
})
} }
fun faultsReview_isChecked(user:String,password:String,itemFk:String,warehouseFk:String){ fun faultsReview_isChecked(
getInventaryUserCase.faultsReview_isChecked(user,password,itemFk,warehouseFk).enqueue(object : user: String,
Callback<Any> { password: String,
override fun onFailure(call: Call<Any>, t: Throwable) { itemFk: String,
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)) warehouseFk: String
} ) {
override fun onResponse(call: Call<Any>, response: Response<Any>) { getInventaryUserCase.faultsReview_isChecked(user, password, itemFk, warehouseFk)
if (!response.isSuccessful){ .enqueue(object :
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())) Callback<Any> {
}else{ override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(isError = false,response = response.message()) _response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
} }
} override fun onResponse(call: Call<Any>, response: Response<Any>) {
}) if (!response.isSuccessful) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_response.value =
ResponseItemVO(isError = false, response = response.message())
}
}
})
} }
} }

View File

@ -1,6 +1,5 @@
package es.verdnatura.presentation.view.feature.historicoarticulo.fragment package es.verdnatura.presentation.view.feature.historicoarticulo.fragment
import android.graphics.Color.*
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Build import android.os.Build
import android.view.View import android.view.View
@ -16,12 +15,9 @@ import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnOptionsSelectedListener import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.ToolBarAdapterTooltip import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.feature.historicoarticulo.adapter.HistoricoAdapter import es.verdnatura.presentation.view.feature.historicoarticulo.adapter.HistoricoAdapter
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoListVO import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoListVO
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
@ -32,8 +28,9 @@ class HistoricoArticuloFragment(
HistoricoArticuloViewModel::class HistoricoArticuloViewModel::class
) { ) {
private var adapter: HistoricoAdapter? = null private var adapter: HistoricoAdapter? = null
// private lateinit var customDialogInput: CustomDialogInput
// private lateinit var customDialog: CustomDialog // private lateinit var customDialogInput: CustomDialogInput
// private lateinit var customDialog: CustomDialog
private var listHistoric: ArrayList<ItemHistoricoVO> = ArrayList() private var listHistoric: ArrayList<ItemHistoricoVO> = ArrayList()
private var listHistoryAux: ArrayList<ItemHistoricoVO> = ArrayList() private var listHistoryAux: ArrayList<ItemHistoricoVO> = ArrayList()
private var filter: String = "" private var filter: String = ""
@ -46,9 +43,9 @@ class HistoricoArticuloFragment(
override fun init() { override fun init() {
// customDialogInput = CustomDialogInput(requireContext()) // customDialogInput = CustomDialogInput(requireContext())
// customDialog = CustomDialog(requireContext()) // customDialog = CustomDialog(requireContext())
ma.hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
filter = "all" filter = "all"
viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK)) viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK))
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk
@ -80,29 +77,31 @@ class HistoricoArticuloFragment(
listIcons.add(iconReload) listIcons.add(iconReload)
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
when (item){ when (item) {
iconReload.drawable->viewModelwithFilter("all") iconReload.drawable -> viewModelwithFilter("all")
iconGargabe.drawable->{ iconGargabe.drawable -> {
viewModelwithFilter("contenedor") viewModelwithFilter("contenedor")
item.setTint(getColor(context!!, verdnatura_pumpkin_orange))} item.setTint(getColor(context!!, verdnatura_pumpkin_orange))
iconFault.drawable->viewModelwithFilter("falta") }
} iconFault.drawable -> viewModelwithFilter("falta")
for (it in listIcons) {
if (it != item) {
it.drawable.setTint(getColor(context!!, verdnatura_white))
} }
for (it in listIcons) {
if (it != item) {
it.drawable.setTint(getColor(context!!, verdnatura_white))
}
}
item.setTint(getColor(context!!, verdnatura_pumpkin_orange))
view?.performLongClick()
} }
item.setTint(getColor(context!!, verdnatura_pumpkin_orange))
view?.performLongClick() })
}
})
binding.mainToolbar.toolbarIcons.layoutManager = binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
@ -159,9 +158,9 @@ class HistoricoArticuloFragment(
loadHistoricoList.observe(viewLifecycleOwner, Observer { event -> loadHistoricoList.observe(viewLifecycleOwner, Observer { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
listToAdapter(it.list, filter) listToAdapter(it.list, filter)
navigateToToday(it) navigateToToday(it)
} }
}) })

View File

@ -212,8 +212,8 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
override fun onInvetoryNichoClickListener(item: ItemInventaryVO) { override fun onInvetoryNichoClickListener(item: ItemInventaryVO) {
//sergio: cambiado customdialogInput pòr customdialog 6.1.4 //sergio: cambiado customdialogInput pòr customdialog 6.1.4
customDialog.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){ customDialog.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription(getString(R.string.quantityReal)+item.nicho+")").setOkButton(getString(R.string.pull)){
//customDialogInput.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){ //customDialogInput.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton(getString(R.string.pull)){
viewModel.itemTrash(item.itemFk,getData(WAREHOUSEFK),getData(USER),getData(PASSWORD),item.nicho,"0") viewModel.itemTrash(item.itemFk,getData(WAREHOUSEFK),getData(USER),getData(PASSWORD),item.nicho,"0")
//viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,"0","0") //viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,"0","0")
// viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0") // viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0")

View File

@ -29,7 +29,7 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
holder.bind(items[position]) holder.bind(items[position])
holder.binding.root.setOnClickListener { holder.binding.root.setOnClickListener {
onCollectionSelected.onCollectionSelected(items[position],PREITEMPICKER) onCollectionSelected.onCollectionSelected(items[position],PREITEMPICKER)
Log.d("VERDNATURA::","2-Click item ${items[position].collectionFk}+PREITEMPICKER") // Log.d("VERDNATURA::","2-Click item ${items[position].collectionFk}+PREITEMPICKER")
} }
} }

View File

@ -110,7 +110,7 @@ class EndSacadorFragment(
setToolBar() setToolBar()
setEvents() setEvents()
Log.d("VERDNATURA","La col "+collection.collectionFk+ " y el type "+type) //Log.d("VERDNATURA","La col "+collection.collectionFk+ " y el type "+type)
searchSaleCollection() searchSaleCollection()
super.init() super.init()
@ -136,7 +136,7 @@ class EndSacadorFragment(
//es parking //es parking
pasillerosItemClickListener?.onPasillerosItemClickListener( pasillerosItemClickListener?.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Parking" title = getString(R.string.Parking)
), "" ), ""
) )
// parkingTicket(binding.scanInput.text.toString()) // parkingTicket(binding.scanInput.text.toString())
@ -695,7 +695,7 @@ class EndSacadorFragment(
var index = 0 var index = 0
var isBreak = false var isBreak = false
var isOk = false var isOk = false
Log.d("VERDNATURA::", "Entramos a buscar")
for (saleVO in sales) { for (saleVO in sales) {
Log.d("VERDNATURA::", "El item buscado es " + saleVO.itemFk) Log.d("VERDNATURA::", "El item buscado es " + saleVO.itemFk)
if (saleVO.quantity != saleVO.picked) { if (saleVO.quantity != saleVO.picked) {
@ -880,7 +880,7 @@ class EndSacadorFragment(
listPlacementSupply.add(BarcodeVO(code = it.proposal)) listPlacementSupply.add(BarcodeVO(code = it.proposal))
} }
customDialogList.setTitle("$shelving($item) $total del $longName").setOkButton("Coger") { customDialogList.setTitle("$shelving($item) $total del $longName").setOkButton(getString( R.string.take)) {
if (customDialogList.getValueTwo().isNotEmpty()) { if (customDialogList.getValueTwo().isNotEmpty()) {

View File

@ -127,7 +127,7 @@ class PreSacadorFragment :
//es parking //es parking
pasillerosItemClickListener?.onPasillerosItemClickListener( pasillerosItemClickListener?.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = "Parking" title = getString(R.string.Parking)
), "") ), "")
// parkingTicket(binding.scanInput.text.toString()) // parkingTicket(binding.scanInput.text.toString())
} else { } else {
@ -523,7 +523,7 @@ class PreSacadorFragment :
var index = 0 var index = 0
var isBreak = false var isBreak = false
var isOk = false var isOk = false
d("VERDNATURA::", "Entramos a buscar") //Timber.tag("VERDNATURA::").d("Entramos a buscar")
for (saleVO in sales) { for (saleVO in sales) {
d("VERDNATURA::", "El item buscado es " + saleVO.itemFk) d("VERDNATURA::", "El item buscado es " + saleVO.itemFk)
if (saleVO.quantity != saleVO.picked) { if (saleVO.quantity != saleVO.picked) {
@ -688,7 +688,7 @@ class PreSacadorFragment :
listPlacementSupply.add(BarcodeVO(code = it.proposal)) listPlacementSupply.add(BarcodeVO(code = it.proposal))
} }
customDialogList.setTitle("$shelving($item) $total del $longName").setOkButton("Coger") { customDialogList.setTitle("$shelving($item) $total del $longName").setOkButton(getString( R.string.take)) {
if (customDialogList.getValueTwo().isNotEmpty()) { if (customDialogList.getValueTwo().isNotEmpty()) {

View File

@ -379,7 +379,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
listPlacementSupply.add(BarcodeVO(code = it.proposal)) listPlacementSupply.add(BarcodeVO(code = it.proposal))
} }
customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton("Coger") { customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton(getString( R.string.take)) {
if (customDialogList.getValueTwo().isNotEmpty()) { if (customDialogList.getValueTwo().isNotEmpty()) {
if (checkItemScan(customDialogList.getValueTwo())) { if (checkItemScan(customDialogList.getValueTwo())) {
onQuantityOfShelvingSelected(itemShelvingFk) onQuantityOfShelvingSelected(itemShelvingFk)

View File

@ -27,7 +27,7 @@ class CollectionAdapter (
holder.bind(items[position]) holder.bind(items[position])
holder.binding.root.setOnClickListener { holder.binding.root.setOnClickListener {
onCollectionSelected.onCollectionSelected(items[position],SACADOR) onCollectionSelected.onCollectionSelected(items[position],SACADOR)
Log.d("VERDNATURA::","2-Click item ${items[position].collectionFk}") //Log.d("VERDNATURA::","2-Click item ${items[position].collectionFk}")
} }
} }

View File

@ -41,9 +41,10 @@ class UbicadorAdapter (
binding.apply { binding.apply {
this.item = item this.item = item
multiText.text = item.stickers+"x"+item.packing multiText.text = item.stickers+"x"+item.packing
imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/"+item.item); imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/"+item.item)
imgItem.setOnClickListener { imgItem.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = "Consultar artículo"),item.item) onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = res.getString(
R.string.itemSearch)),item.item)
} }
layerVisible.setOnClickListener { layerVisible.setOnClickListener {

View File

@ -198,7 +198,7 @@ class UbicadorFragment(
) )
parking = customDialogInput.getValue() parking = customDialogInput.getValue()
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text =
shelvingFk.uppercase() + " P: " + parking + " E: " + etiquetas shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(R.string.label) + etiquetas
if (mpok != null) mpok!!.start() if (mpok != null) mpok!!.start()
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton(getString(R.string.cancel)) { }.setKoButton(getString(R.string.cancel)) {
@ -220,7 +220,7 @@ class UbicadorFragment(
parking = customDialogInput.getValue() parking = customDialogInput.getValue()
if (binding.mainToolbar.toolbarTitle != null && shelvingFk != null && parking != null && etiquetas != null) { if (binding.mainToolbar.toolbarTitle != null && shelvingFk != null && parking != null && etiquetas != null) {
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text =
shelvingFk.uppercase() + " P: " + parking + " E: " + etiquetas shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(R.string.label) + etiquetas
} else { } else {
binding.mainToolbar.toolbarTitle.text = "" binding.mainToolbar.toolbarTitle.text = ""
} }
@ -245,7 +245,7 @@ class UbicadorFragment(
) )
shelvingFk = customDialogInput.getValue() shelvingFk = customDialogInput.getValue()
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text =
shelvingFk.uppercase() + " P: " + parking + " E: " + etiquetas shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(R.string.label) + etiquetas
if (mpok != null) mpok!!.start() if (mpok != null) mpok!!.start()
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton(getString(R.string.cancel)) { }.setKoButton(getString(R.string.cancel)) {
@ -265,7 +265,7 @@ class UbicadorFragment(
) )
shelvingFk = customDialogInput.getValue() shelvingFk = customDialogInput.getValue()
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text =
shelvingFk.uppercase() + " P: " + parking + " E: " + etiquetas shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(R.string.label) + etiquetas
if (mpok != null) mpok!!.start() if (mpok != null) mpok!!.start()
customDialogInput.dismiss() customDialogInput.dismiss()
return@setOnEditorActionListener true return@setOnEditorActionListener true
@ -276,8 +276,8 @@ class UbicadorFragment(
} }
binding.deleteImg.setOnClickListener { binding.deleteImg.setOnClickListener {
customDialog.setTitle("Vaciar carro") customDialog.setTitle(getString(R.string.empty))
.setDescription("Esta operación no se puede rectificar.").setOkButton("Vaciar") { .setDescription(getString(R.string.operationNoReturn)).setOkButton(getString(R.string.empty)) {
viewModel.clearShelvingList( viewModel.clearShelvingList(
getData(USER), getData(USER),
getData(PASSWORD), shelvingFk getData(PASSWORD), shelvingFk
@ -330,7 +330,7 @@ class UbicadorFragment(
} }
etiquetas = contEtiquetas.toString() etiquetas = contEtiquetas.toString()
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text =
shelvingFk.uppercase() + " P: " + parking + " E: " + etiquetas shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(R.string.label) + etiquetas
if (it.list.size > 0) if (it.list.size > 0)
binding.editPrioridad.setText(it.list[0].priority) binding.editPrioridad.setText(it.list[0].priority)
binding.splashProgress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
@ -390,19 +390,10 @@ class UbicadorFragment(
ma.messageWithSound( ma.messageWithSound(
if (it.isError) it.errorMessage else { if (it.isError) it.errorMessage else {
it.response getString(R.string.priorityChanged)
}, it.isError, true }, it.isError, true
) )
/* if (it.isError) {
mperror!!.start()
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
} else {
(it.response).toast(requireContext())
}*/
}) })
responseMake.observe(viewLifecycleOwner, Observer { responseMake.observe(viewLifecycleOwner, Observer {
@ -672,10 +663,10 @@ class UbicadorFragment(
private fun showMoreOptions(item: ItemUbicadorVO) { private fun showMoreOptions(item: ItemUbicadorVO) {
customDialogTwoButtons.setTitle(item.item).setDescription(getString(R.string.selectAction)) customDialogTwoButtons.setTitle(item.item).setDescription(getString(R.string.selectAction))
.setOkButton("Transferir") { .setOkButton(getString(R.string.transfer)) {
customDialogInput.setTitle("Nueva matrícula") customDialogInput.setTitle(getString(R.string.shelvingNew))
.setDescription("Introduce el destino para item: " + item.item).setValue("") .setDescription(getString(R.string.selectDestiny) + item.item).setValue("")
.setOkButton("Transferir") { .setOkButton(getString(R.string.transfer)) {
if (customDialogInput.getValue().isNotEmpty()) { if (customDialogInput.getValue().isNotEmpty()) {
viewModel.itemShelvingTransfer( viewModel.itemShelvingTransfer(
getData(USER), getData(USER),
@ -687,7 +678,9 @@ class UbicadorFragment(
adapter!!.notifyDataSetChanged() adapter!!.notifyDataSetChanged()
customDialogInput.dismiss() customDialogInput.dismiss()
} else { } else {
"Carro incorrecto".toast(requireContext()) getString(R.string.wagonIncorrect).toast(requireContext())
} }
@ -714,7 +707,7 @@ class UbicadorFragment(
customDialogTwoButtons.dismiss() customDialogTwoButtons.dismiss()
}.setOkButtonTwo(getString(R.string.delete)) { }.setOkButtonTwo(getString(R.string.delete)) {
customDialog.setTitle(getString(R.string.confirm)) customDialog.setTitle(getString(R.string.confirm))
.setDescription("Confirmas eliminar el artículo: " + item.item + "?") .setDescription(getString(R.string.itemDeleteConfirm) + item.item + "?")
.setOkButton(getString(R.string.delete)) { .setOkButton(getString(R.string.delete)) {
listItems.remove(item) listItems.remove(item)
adapter!!.notifyDataSetChanged() adapter!!.notifyDataSetChanged()

View File

@ -115,7 +115,7 @@ class UbicadorViewModel(context: Context) : BaseViewModel() {
) )
} else { } else {
_responsepriority.value = _responsepriority.value =
ResponseItemVO(isError = false, response = "Prioridad modificada") ResponseItemVO(isError = false, response = response.message())
} }
} }

View File

@ -226,7 +226,7 @@ class WorkermistakeFragment( var entryPoint: String = ""
vUserFk = workerMistakeName!!.id, vUserFk = workerMistakeName!!.id,
vTypeFk = it.code vTypeFk = it.code
) )
// "Causa del error registrado".toast(requireContext()) // getString(R.string.errorRegistered).toast(requireContext())
customDialogList.dismiss() customDialogList.dismiss()
} }
} }

View File

@ -20,7 +20,6 @@
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/darker_gray"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View File

@ -106,7 +106,7 @@
android:id="@+id/button15" android:id="@+id/button15"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/Transferir" android:text="@string/transfer"
android:background="@drawable/btn_orange" android:background="@drawable/btn_orange"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"

View File

@ -42,9 +42,7 @@
<string name="cantidad">cantidad</string> <string name="cantidad">cantidad</string>
<string name="carrodeorigen">carro de origen</string> <string name="carrodeorigen">carro de origen</string>
<string name="Carrodestino">Carro destino</string> <string name="Carrodestino">Carro destino</string>
<string name="Transferir">Transferir</string>
<string name="Sinsector">Sin sector</string> <string name="Sinsector">Sin sector</string>
<string name="Close">Cerrar</string> <string name="Close">Cerrar</string>
<string name="Noexistessectores">No existes sectores.</string> <string name="Noexistessectores">No existes sectores.</string>
<string name="Seleccionaunsector">Selecciona un sector</string> <string name="Seleccionaunsector">Selecciona un sector</string>
@ -191,7 +189,7 @@
<string name="deletedLabel">Carro/etiqueta borrada</string> <string name="deletedLabel">Carro/etiqueta borrada</string>
<string name="end">Finalizar</string> <string name="end">Finalizar</string>
<string name="undone">Deshacer</string> <string name="undone">Deshacer</string>
<string name="labels">\"Etiquetas: \"</string> <string name="labels">Etiquetas: </string>
<string name="nameApp">warehouse</string> <string name="nameApp">warehouse</string>
<string name="scanSmarttagOrShelving">Escanea etiqueta/s electrónica/s o matrícula/s</string> <string name="scanSmarttagOrShelving">Escanea etiqueta/s electrónica/s o matrícula/s</string>
<string name="scanHighLabel">Escanea etiqueta superior</string> <string name="scanHighLabel">Escanea etiqueta superior</string>
@ -203,7 +201,7 @@
<string name="allowParking">Permite aparcar ticket/carro</string> <string name="allowParking">Permite aparcar ticket/carro</string>
<string name="allowTakeoffVehicle">Permite dejar el vehículo</string> <string name="allowTakeoffVehicle">Permite dejar el vehículo</string>
<string name="newCollection">Genera colección para sacar</string> <string name="newCollection">Genera colección para sacar</string>
<string name="showFilter">\"Ver filtro \"</string> <string name="showFilter">Ver filtro </string>
<string name="showFaults">Ver movimientos de Faltas</string> <string name="showFaults">Ver movimientos de Faltas</string>
<string name="showTrash">Ver movimientos de Basura</string> <string name="showTrash">Ver movimientos de Basura</string>
<string name="filterFlower">Filtra por tipo de flor</string> <string name="filterFlower">Filtra por tipo de flor</string>
@ -221,7 +219,7 @@
<string name="changePriority">Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.</string> <string name="changePriority">Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.</string>
<string name="allowAutomaticAddItem">Permite añadir items al carro de manera continuada. No uno a uno</string> <string name="allowAutomaticAddItem">Permite añadir items al carro de manera continuada. No uno a uno</string>
<string name="newItem">Nuevo Item</string> <string name="newItem">Nuevo Item</string>
<string name="editItem">\"Editar item \"</string> <string name="editItem">Editar item </string>
<string name="fillFields">Rellena campos obligatorios</string> <string name="fillFields">Rellena campos obligatorios</string>
<string name="mandatoryPacking">Packing obligatorio</string> <string name="mandatoryPacking">Packing obligatorio</string>
<string name="selectAction">Selecciona una acción</string> <string name="selectAction">Selecciona una acción</string>
@ -231,9 +229,55 @@
<string name="accept">Aceptar</string> <string name="accept">Aceptar</string>
<string name="selectPrinter">Tiene que seleccionar impresora.</string> <string name="selectPrinter">Tiene que seleccionar impresora.</string>
<string name="newTruck">Nuevo Camión</string> <string name="newTruck">Nuevo Camión</string>
<string name="psScan">\"PScan: \"</string> <string name="psScan">PScan: </string>
<string name="savedShelves">Baldas guardadas</string> <string name="savedShelves">Baldas guardadas</string>
<string name="operation">\"Operación \"</string> <string name="operation">Operación </string>
<string name="closeOdrder">¿Estás seguro de cerrar el pedido?</string> <string name="closeOdrder">¿Estás seguro de cerrar el pedido?</string>
<string name="confirm">Confirmar</string> <string name="confirm">Confirmar</string>
<string name="scanItem">Escanea un item</string>
<string name="itemNotFound">No hemos podido encontrar el articulo. Revisa el sector.</string>
<string name="errorOperation">Error al realizar la operación</string>
<string name="scanLabelExpedition">Escanea etiqueta de la expedición.</string>
<string name="buffer">Buffer:</string>
<string name="packingSave">Packing guardado</string>
<string name="previousCollected">Previa recogida</string>
<string name="disponibility">Disponibilidad</string>
<string name="unmarkLine">Desmarcar línea</string>
<string name="goUnmark">Vas a desmarcar la línea: </string>
<string name="sure"> ¿Estás seguro?\</string>
<string name="unmark">Desmarcar</string>
<string name="sectorALGEMESI">ALGEMESI V</string>
<string name="take">Coger</string>
<string name="errorRegistered">Causa del error registrado</string>
<string name="printerFault">Falta seleccionar impresora</string>
<string name="observations">Observaciones</string>
<string name="scanShelvingHistorical">Escanea matrícula para ver histórico</string>
<string name="scanPlate">Escanea matrícula del vehículo</string>
<string name="scanPlateTakeoff">Escanea matrícula para dejar vehículo</string>
<string name="returnScan">Vuelva a escanear</string>
<string name="doVehiclePlate">¿Qué desea hacer con el vehículo de matrícula</string>
<string name="priorityChanged">Prioridad modificada</string>
<string name="itemDeleteConfirm">Confirmas eliminar el artículo: </string>
<string name="wagonIncorrect">Carro incorrecto</string>
<string name="transfer">Transferir</string>
<string name="shelvingNew">Nueva matrícula</string>
<string name="selectDestiny">Introduce el destino para item: </string>
<string name="empty">Vaciar carro</string>
<string name="operationNoReturn">Esta operación no se puede rectificar.</string>
<string name="label"> E: </string>
<string name="pUppercase"> P: </string>
<string name="itemSearch">Consultar artículo</string>
<string name="quantityReal">Cantidad real(</string>
<string name="pull">Tirar</string>
<string name="titleItemSearch">Buscar item</string>
<string name="titleHistorical">Historico</string>
<string name="titleSimilarItems">Artículos similares</string>
<string name="currentVAlue">Valor actual: </string>
<string name="titleSearchSimilarItems">Buscar artículos similares</string>
<string name="deleteStock">Indica la causa de eliminar stock:</string>
<string name="quantityToRegister">Indica la cantidad a dar de alta</string>
<string name="quantityToUnregister">\"Indica la cantidad a dar de baja \"</string>
<string name="fault">Falta</string>
<string name="trash">Basura</string>
<string name="errorNotNumber">El elemento introducido no es un número</string>
</resources> </resources>

View File

@ -41,7 +41,6 @@
<string name="cantidad">quantity</string> <string name="cantidad">quantity</string>
<string name="carrodeorigen">origin car</string> <string name="carrodeorigen">origin car</string>
<string name="Carrodestino">Destination car</string> <string name="Carrodestino">Destination car</string>
<string name="Transferir">To transfer</string>
<string name="Sinsector">Without sector</string> <string name="Sinsector">Without sector</string>
<string name="Close">Close</string> <string name="Close">Close</string>
<string name="Noexistessectores">There are no sectors.</string> <string name="Noexistessectores">There are no sectors.</string>
@ -189,7 +188,7 @@
<string name="deletedLabel">Carro/etiqueta borrada</string> <string name="deletedLabel">Carro/etiqueta borrada</string>
<string name="end">Finalizar</string> <string name="end">Finalizar</string>
<string name="undone">Deshacer</string> <string name="undone">Deshacer</string>
<string name="labels">\"Etiquetas: \"</string> <string name="labels">Etiquetas: </string>
<string name="nameApp">warehouse</string> <string name="nameApp">warehouse</string>
<string name="scanSmarttagOrShelving">Escanea etiqueta/s electrónica/s o matrícula/s</string> <string name="scanSmarttagOrShelving">Escanea etiqueta/s electrónica/s o matrícula/s</string>
<string name="scanHighLabel">Escanea etiqueta superior</string> <string name="scanHighLabel">Escanea etiqueta superior</string>
@ -219,7 +218,7 @@
<string name="changePriority">Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.</string> <string name="changePriority">Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.</string>
<string name="allowAutomaticAddItem">Permite añadir items al carro de manera continuada. No uno a uno</string> <string name="allowAutomaticAddItem">Permite añadir items al carro de manera continuada. No uno a uno</string>
<string name="newItem">Nuevo Item</string> <string name="newItem">Nuevo Item</string>
<string name="editItem">\"Editar item \"</string> <string name="editItem">Editar item </string>
<string name="fillFields">Rellena campos obligatorios</string> <string name="fillFields">Rellena campos obligatorios</string>
<string name="mandatoryPacking">Packing obligatorio</string> <string name="mandatoryPacking">Packing obligatorio</string>
<string name="selectAction">Selecciona una acción</string> <string name="selectAction">Selecciona una acción</string>
@ -229,10 +228,56 @@
<string name="accept">Aceptar</string> <string name="accept">Aceptar</string>
<string name="selectPrinter">Tiene que seleccionar impresora.</string> <string name="selectPrinter">Tiene que seleccionar impresora.</string>
<string name="newTruck">Nuevo Camión</string> <string name="newTruck">Nuevo Camión</string>
<string name="psScan">\"PScan: \"</string> <string name="psScan">PScan: </string>
<string name="savedShelves">Baldas guardadas</string> <string name="savedShelves">Baldas guardadas</string>
<string name="operation">\"Operación \"</string> <string name="operation">Operación </string>
<string name="closeOdrder">¿Estás seguro de cerrar el pedido?</string> <string name="closeOdrder">¿Estás seguro de cerrar el pedido?</string>
<string name="confirm">Confirmar</string> <string name="confirm">Confirmar</string>
<string name="scanItem">Escanea un item</string>
<string name="itemNotFound">No hemos podido encontrar el articulo. Revisa el sector.</string>
<string name="errorOperation">Error al realizar la operación</string>
<string name="scanLabelExpedition">Escanea etiqueta de la expedición.</string>
<string name="buffer">Buffer:</string>
<string name="packingSave">Packing guardado</string>
<string name="previousCollected">Previa recogida</string>
<string name="disponibility">availability</string>
<string name="unmarkLine">Desmarcar linea</string>
<string name="goUnmark">Vas a desmarcar la linea: </string>
<string name="sure">¿Estás seguro?</string>
<string name="unmark">Desmarcar</string>
<string name="sectorALGEMESI">ALGEMESI V</string>
<string name="take">Coger</string>
<string name="errorRegistered">Causa del error registrado</string>
<string name="printerFault">Falta seleccionar impresora</string>
<string name="observations">Observaciones</string>
<string name="scanShelvingHistorical">Escanea matrícula para ver histórico</string>
<string name="scanPlate">Escanea matrícula del vehículo</string>
<string name="scanPlateTakeoff">Escanea matrícula para dejar vehículo</string>
<string name="returnScan">Vuelva a escanear</string>
<string name="doVehiclePlate">¿Qué desea hacer con el vehículo de matrícula</string>
<string name="priorityChanged">Prioridad modificada</string>
<string name="itemDeleteConfirm">Confirmas eliminar el artículo: </string>
<string name="wagonIncorrect">Carro incorrecto</string>
<string name="transfer">Transferir</string>
<string name="shelvingNew">Nueva matrícula</string>
<string name="selectDestiny">Introduce el destino para item: </string>
<string name="empty">Vaciar carro</string>
<string name="operationNoReturn">Esta operación no se puede rectificar.</string>
<string name="label"> L: </string>
<string name="pUppercase"> P: </string>
<string name="itemSearch">Consultar artículo</string>
<string name="quantityReal">Cantidad real(</string>
<string name="pull">Tirar</string>
<string name="titleItemSearch">Buscar item</string>
<string name="titleHistorical">Historico</string>
<string name="titleSimilarItems">Artículos similares</string>
<string name="currentVAlue">\"Valor actual: \"</string>
<string name="titleSearchSimilarItems">Buscar artículos similares</string>
<string name="deleteStock">Indica la causa de eliminar stock:</string>
<string name="quantityToRegister">Indica la cantidad a dar de alta</string>
<string name="quantityToUnregister">\"Indica la cantidad a dar de baja \"</string>
<string name="fault">Falta</string>
<string name="trash">Basura</string>
<string name="errorNotNumber">El elemento introducido no es un número</string>
</resources> </resources>