diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
deleted file mode 100644
index bbf7051a..00000000
--- a/.idea/deploymentTargetDropDown.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt b/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt
index a4047c7b..d8e28061 100644
--- a/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt
+++ b/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt
@@ -16,20 +16,20 @@ class ApiSalixUtils {
val salixRetrofit = Retrofit.Builder().baseUrl(getBaseUrlLocal(context = context)).addConverterFactory(
GsonConverterFactory.create()
).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)
}
fun getBaseUrlLocal(context: Context): String {
var url = this.getDefaults("base_urlSalix", context)
if (url.isNullOrEmpty()) {
- ApiUtils.setDefaults("base_urlSalix", ApiSalixUtils.BASE_URL, context)
+ ApiUtils.setDefaults("base_urlSalix", BASE_URL, context)
} else {
if (!url.contains("http")) {
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? {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt
index 9012546f..9ec860c6 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt
@@ -4,6 +4,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
+import es.verdnatura.R
import es.verdnatura.databinding.ItemProposalRowBinding
import es.verdnatura.presentation.common.OnItemProposalClickListener
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
@@ -50,21 +51,21 @@ class ItemProposalAdapter(
itemFk.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
- title = "Consultar artículo"
+ title = res.getString(R.string.itemSearch)
), item.itemFk
)
}
itemUp.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
- title = "Buscar item"
+ title = res.getString(R.string.titleItemSearch)
), item.itemFk
)
}
itemDown.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
- title = "Buscar item"
+ title = res.getString(R.string.titleItemSearch)
), item.itemFk
)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
index 84204d15..db21059d 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
@@ -16,8 +16,6 @@ import es.verdnatura.databinding.FragmentItemCardBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
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.CustomDialogList
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.ItemPackingType
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 timber.log.Timber.d
class ItemCardFragment(
var itemFk: String = ""
@@ -54,7 +50,7 @@ class ItemCardFragment(
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
}
- // private lateinit var customDialog: CustomDialog
+ // private lateinit var customDialog: CustomDialog
private lateinit var customDialogInput: CustomDialogInput
private lateinit var customDialogList: CustomDialogList
private lateinit var customDialogTwo: CustomDialogTwoButtons
@@ -89,7 +85,7 @@ class ItemCardFragment(
private fun setToolBar() {
- binding.mainToolbar.toolbarIcons.visibility=View.VISIBLE
+ binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
val listIcons: ArrayList = ArrayList()
@@ -118,10 +114,10 @@ class ItemCardFragment(
}
iconHistory.drawable -> {
if (itemFk.isNullOrEmpty()) {
- "Escanea un item".toast(requireActivity())
+ getString(R.string.scanItem).toast(requireActivity())
} else {
ma.onPasillerosItemClickListener(
- PasillerosItemVO(title = "Historico"),
+ PasillerosItemVO(title = getString(R.string.titleHistorical)),
itemInfoG!!.id
)
@@ -183,11 +179,11 @@ class ItemCardFragment(
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))
- }else {
+ } else {
viewModel.getItemPackingType(getData(USER), getData(PASSWORD))
}
}
@@ -200,7 +196,7 @@ class ItemCardFragment(
binding.itemcardLayout.visibility = GONE
binding.splashProgressTwo.visibility = GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
- ma.messageWithSound(it.errorMessage,true,false)
+ ma.messageWithSound(it.errorMessage, true, false)
} else {
if (it.id != "0") {
@@ -209,8 +205,13 @@ class ItemCardFragment(
} else {
binding.splashProgressTwo.visibility = GONE
binding.itemcardLayout.visibility = View.GONE
- 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))
+ binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
+ ma.messageWithSound(
+ getString(R.string.itemNotFound),
+ true,
+ false,
+ getString(R.string.noResults)
+ )
}
@@ -226,7 +227,7 @@ class ItemCardFragment(
response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
if (it.isError) {
- ma.messageWithSound(it.errorMessage,true,false)
+ ma.messageWithSound(it.errorMessage, true, false)
} else {
getItemCard(itemFk)
}
@@ -263,14 +264,20 @@ class ItemCardFragment(
listItemsRow = ArrayList()
//sergio itemcard por item_getInfo
- /* listItemsRow.add(
+ /* listItemsRow.add(
+ ItemCardRowVO(
+ title = getString(R.string.total),
+ value = itemInfo.total,
+ isEditable = false
+ )
+ )*/
+ listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.total),
- value = itemInfo.total,
+ value = itemInfo.visible,
isEditable = false
)
- )*/
- listItemsRow.add(ItemCardRowVO(title = getString(R.string.total),value = itemInfo.visible,isEditable = false))
+ )
listItemsRow.add(
ItemCardRowVO(
@@ -281,31 +288,44 @@ class ItemCardFragment(
)
//sergio itemcard por item_getInfo
- /* listItemsRow.add(
+ /* listItemsRow.add(
+ ItemCardRowVO(
+ title = getString(R.string.Ubicado),
+ value = itemInfo.enAltillo,
+ isEditable = false
+ )
+ )*/
+ listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Ubicado),
- value = itemInfo.enAltillo,
+ value = itemInfo.vVisibleItemShelving,
isEditable = false
)
- )*/
- listItemsRow.add(ItemCardRowVO(title = getString(R.string.Ubicado),value = itemInfo.vVisibleItemShelving,isEditable = false))
+ )
//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(
title = getString(R.string.SINUBICAR),
- value = itemInfo.enNicho,
+ value = itemInfo.unlocated,
isEditable = false,
action = "itemStockUpdate"
)
- )*/
- listItemsRow.add(ItemCardRowVO(title = getString(R.string.SINUBICAR),value = itemInfo.unlocated,isEditable = false, action = "itemStockUpdate"))
+ )
//EDITABLES
listItemsRow.add(
ItemCardRowVO(
- title = "Artículos similares",
+ title = getString(R.string.titleSimilarItems),
isEditable = true,
action = "itemProposal"
)
@@ -398,7 +418,7 @@ class ItemCardFragment(
ma.onPasillerosItemClickListener(
PasillerosItemVO(
- title = "Buscar artículos similares"
+ title = getString(R.string.titleSearchSimilarItems)
), itemFk
)
@@ -408,7 +428,7 @@ class ItemCardFragment(
} else {
if (item.action != "toBarcode" && item.action != "buscarItem" && item.action != "itemStockUpdateAdd" && item.action != "itemStockUpdateRemove") {
customDialogInput.setTitle(item.title!!)
- .setDescription("Valor actual: " + item.value!!)
+ .setDescription(getString(R.string.currentVAlue) + item.value!!)
.setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue())
@@ -437,12 +457,12 @@ class ItemCardFragment(
} else if (item.action == "buscarItem") {
ma.onPasillerosItemClickListener(
PasillerosItemVO(
- title = "Buscar item"
+ title = getString(R.string.titleItemSearch)
), itemFk
)
} else if (item.action == "itemStockUpdateAdd") {
customDialogInput.setTitle(item.title!!)
- .setDescription("Indica la cantidad a dar de alta")
+ .setDescription(getString(R.string.quantityToRegister))
.setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue())
@@ -467,7 +487,7 @@ class ItemCardFragment(
}
} else if (item.action == "itemStockUpdateRemove") {
customDialogInput.setTitle(item.title!!)
- .setDescription("Indica la cantidad a dar de baja ")
+ .setDescription(getString(R.string.quantityToUnregister))
.setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue())
@@ -517,14 +537,14 @@ class ItemCardFragment(
// "itemStockUpdate" -> prepareItemStockUpdate(item,value)
"itemStockUpdateAdd" -> prepareItemStockUpdate2(item, value)
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value)
- /* "itemPlacementSave" -> viewModel.itemPlacementSave(
- itemFk = itemFk,
- warehouseFk = warehouseFk,
- user = user,
- password = password,
- value = value,
- "itemPlacementSave"
- )*/
+ /* "itemPlacementSave" -> viewModel.itemPlacementSave(
+ itemFk = itemFk,
+ warehouseFk = warehouseFk,
+ user = user,
+ password = password,
+ value = value,
+ "itemPlacementSave"
+ )*/
"updateGrouping" -> viewModel.updateGrouping(
itemFk = itemFk,
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)
showProgress()
}
@@ -618,42 +638,43 @@ class ItemCardFragment(
private fun prepareItemStockUpdate2(itemB: ItemCardRowVO, value: String) {
try {
- value.toInt()
+ value.toInt()
if (itemB.action == "itemStockUpdateRemove") {
customDialogTwo.setTitle(itemB.title!!)
- .setDescription("Indica la causa de eliminar stock:").setOkButton("Falta") {
- viewModel.itemTrash(
- itemFk = itemFk,
- warehouseFk = warehouseFk,
- user = user,
- password = password,
- newValue = value,
- isTrash = "0"
+ .setDescription(getString(R.string.deleteStock))
+ .setOkButton(getString(R.string.fault)) {
+ viewModel.itemTrash(
+ itemFk = itemFk,
+ warehouseFk = warehouseFk,
+ user = user,
+ password = password,
+ newValue = value,
+ isTrash = "0"
- )
- //changeOfflineValue(itemB,value, listBarcodes)
- showProgress()
- customDialogTwo.dismiss()
+ )
+ //changeOfflineValue(itemB,value, listBarcodes)
+ showProgress()
+ customDialogTwo.dismiss()
- }.setOkButtonTwo("Basura") {
- viewModel.itemTrash(
- itemFk = itemFk,
- warehouseFk = warehouseFk,
- user = user,
- password = password,
- newValue = value,
- isTrash = "1"
+ }.setOkButtonTwo(getString(R.string.trash)) {
+ viewModel.itemTrash(
+ itemFk = itemFk,
+ warehouseFk = warehouseFk,
+ user = user,
+ password = password,
+ newValue = value,
+ isTrash = "1"
- )
- //changeOfflineValue(itemB,value, listBarcodes)
- showProgress()
- customDialogTwo.dismiss()
+ )
+ //changeOfflineValue(itemB,value, listBarcodes)
+ showProgress()
+ customDialogTwo.dismiss()
- }.setKoButton(getString(R.string.cancel)) {
+ }.setKoButton(getString(R.string.cancel)) {
- customDialogTwo.dismiss()
- }.show()
+ customDialogTwo.dismiss()
+ }.show()
} else {
//changeOfflineValue(itemB,value, listBarcodes)
showProgress()
@@ -668,8 +689,8 @@ class ItemCardFragment(
)
}
} catch (e: Exception) {
- // binding.itemcardLayout.visibility = View.GONE
- ma.messageWithSound("El elemento introducido no es un número",true,true)
+ // binding.itemcardLayout.visibility = View.GONE
+ ma.messageWithSound(getString(R.string.errorNotNumber), true, true)
}
}
@@ -726,27 +747,25 @@ class ItemCardFragment(
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(
- token=getData(TOKEN),
+ token = getData(TOKEN),
itemFk = itemInfoG!!.id,
barCodeValue = code,
- )
- }
-
- else{
+ )
+ } else {
viewModel.barcodesEdit(
itemFk = itemInfoG!!.id,
user = user,
password = password,
value = code,
delete = delete,
- )
+ )
}
- barcodeAdapter!!.notifyDataSetChanged()
+ barcodeAdapter!!.notifyDataSetChanged()
showProgress()
}
@@ -764,7 +783,7 @@ class ItemCardFragment(
array
) { _, position ->
- updateItemPackingType(itemsPackingType[position].code.toString())
+ updateItemPackingType(itemsPackingType[position].code.toString())
}
@@ -774,8 +793,8 @@ class ItemCardFragment(
private fun updateItemPackingType(itemPackingType: String) {
binding.splashProgress.visibility = View.VISIBLE
- /* var working_in_test=true //sergio: en proves app
- if (working_in_test){*/
+ /* var working_in_test=true //sergio: en proves app
+ if (working_in_test){*/
viewModel.updatePackingTypeSalix(
getData(TOKEN),
this.itemFk,
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
index 8e742479..4f092a35 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
@@ -308,7 +308,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
)
} else {
_response.value =
- ResponseItemVO(isError = false, response = "Actualizado grouping")
+ ResponseItemVO(isError = false, response = response.message())
}
}
@@ -344,7 +344,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
)
} else {
_response.value =
- ResponseItemVO(isError = false, response = "Actualizado packing")
+ ResponseItemVO(isError = false, response = response.message())
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt
index 82af3de0..4c4b3358 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt
@@ -91,7 +91,7 @@ class BufferFragment(
if (it.isError) {
ma.messageWithSound(
- it.errorMessage,true,isPlayed = true)
+ getString(R.string.errorOperation)+ it.errorMessage,it.isError,isPlayed = true)
} else {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt
index a9dcfa14..61f85ec1 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt
@@ -57,7 +57,7 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() {
//_bufferresponse.value = false
_itembuffertype.value = ResponseItemVO(
isError = true,
- errorMessage = getMessageFromAllResponse(nameofFunction(this),"Error al realizar la operación"))
+ errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt
index 939b49bb..3c7a875f 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt
@@ -142,8 +142,8 @@ class BufferLoadFragment(
private fun getTextScaned(TagScaned: Int): String {
return when (TagScaned) {
- 1 -> "Expedición:"
- 2 -> "Buffer:"
+ 1 -> getString(R.string.expedition)
+ 2 -> getString(R.string.buffer)
else -> { ""}
}
@@ -153,7 +153,7 @@ class BufferLoadFragment(
private fun showExpeditionOrBufferScan() {
- customDialogList.setTitle("Escanea etiqueta de la expedición.")
+ customDialogList.setTitle(getString(R.string.scanLabelExpedition))
.setOkButton(getString(R.string.close)) {
ma.hideKeyboard(customDialogList.getEditText())
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt
index 9cf75e4b..eabab596 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt
@@ -354,7 +354,7 @@ class SaleAdapter(
itemView.background.colorFilter =
BlendModeColorFilter(0xFF4c2882.toInt(), BlendMode.SRC_ATOP)
// BlendModeColorFilter(Color.YELLOW, BlendMode.SRC_ATOP)
- Log.d("VERDNATURA::", "EL COLOR ES " + color)
+ //Log.d("VERDNATURA::", "EL COLOR ES " + color)
} else {
itemView.background.setColorFilter(0xFF4c2882.toInt(), PorterDuff.Mode.SRC_ATOP)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
index f5699ec9..daa4727e 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
@@ -232,7 +232,7 @@ class CollectionFragment(
iconPhone.drawable -> getExtensionFromUser()
iconParking.drawable->pasillerosItemClickListener?.onPasillerosItemClickListener(
PasillerosItemVO(
- title = "Parking"
+ title = getString(R.string.Parking)
), ""
)
}
@@ -272,7 +272,7 @@ class CollectionFragment(
private fun showUser() {
ma.onPasillerosItemClickListener(
- PasillerosItemVO(title = "Control de usuario de vehículo"),
+ PasillerosItemVO(title = getString(R.string.userVehicleControl)),
workerFkFromTicket
)
@@ -432,7 +432,7 @@ class CollectionFragment(
responseItem_updatePackingShelve.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
ma.messageWithSound(
- if (it.isError) it.errorMessage else "Packing guardado",
+ if (it.isError) it.errorMessage else getString(R.string.packingSave),
it.isError, !it.isError
)
if (!it.isError) {
@@ -453,7 +453,7 @@ class CollectionFragment(
ma.messageWithSound(it.errorMessage, true, true)
} else {
- ma.messageWithSound("Previa recogida", false, true)
+ ma.messageWithSound(getString(R.string.previousCollected), false, true)
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet(
getData(USER),
@@ -480,7 +480,7 @@ class CollectionFragment(
if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
// if (!goBack) {
if (it.isError) {
- customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage)
+ customDialog.setTitle(getString(R.string.disponibility)).setDescription(it.errorMessage)
.setKoButton(getString(R.string.close)) {
scanRequest()
customDialog.dismiss()
@@ -1214,7 +1214,8 @@ class CollectionFragment(
private fun setListPosition(position: Int, isFromBack: Boolean) {
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) {
binding.fragmentSacadorCollections.addViewObserver {
lm!!.scrollToPositionWithOffset(position, 0)
@@ -1249,9 +1250,9 @@ class CollectionFragment(
private fun unMarkLine(position: Int, newType: String) {
state = 0
if (sales[position].isPrepared == "1") {
- customDialog.setTitle("Desmarcar linea")
- .setDescription("Vas a desmarcar la linea: " + sales[position].itemFk + " ¿Estás seguro?")
- .setOkButton("Desmarcar") {
+ customDialog.setTitle(getString(R.string.unmarkLine))
+ .setDescription(getString(R.string.goUnmark) + sales[position].itemFk + getString(R.string.sure))
+ .setOkButton(getString(R.string.unmark)) {
sales[position].isPrepared = "0"
sales[position].pickedQuantity = "0"
saleAdapter!!.notifyDataSetChanged()
@@ -1340,7 +1341,8 @@ class CollectionFragment(
}
try {
// 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 (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue()
.toInt() > total.toInt()
@@ -1868,7 +1870,7 @@ class CollectionFragment(
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!!,
vUserFk = mistakeSale?.workerFk!!,
vTypeFk = it.id)
- "Causa del error registrado".toast(requireContext())
+ getString(R.string.errorRegistered).toast(requireContext())
customDialogList.dismiss()
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt
index 8c12cacc..b6d36bd6 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt
@@ -117,7 +117,7 @@ class CollectionShowTicketFragment(
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(requireContext())
}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) {
if (observations.trim().isNotEmpty()) {
- customDialog.setTitle("Observaciones").setDescription(observations)
+ customDialog.setTitle(getString(R.string.observations)).setDescription(observations)
.setOkButton(getString(R.string.accept)) {
customDialog.hide()
customDialog.dismiss()
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt
index 9a27aacf..52b1ca31 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt
@@ -4,7 +4,8 @@ import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
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.widget.ImageView
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.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
-import java.text.SimpleDateFormat
-import java.util.*
-import kotlin.collections.ArrayList
class ControlVehiculoFragment(
var tagName: String = ""
@@ -35,7 +33,7 @@ class ControlVehiculoFragment(
private lateinit var customDialog: CustomDialog
private var isWorkedTimed = "UNREGISTERED"
private lateinit var customDialogInput: CustomDialogInput
- private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
+ private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
companion object {
fun newInstance(tagName: String) = ControlVehiculoFragment(tagName)
@@ -63,7 +61,7 @@ class ControlVehiculoFragment(
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
setToolBar("HISTORY")
- showScanner("Escanea matrícula para ver histórico", "HISTORY")
+ showScanner(getString(R.string.scanShelvingHistorical), "HISTORY")
} else {
checkControlTimeVehicle()
@@ -76,7 +74,6 @@ class ControlVehiculoFragment(
}
-
override fun onPause() {
goBack = true
super.onPause()
@@ -98,36 +95,43 @@ class ControlVehiculoFragment(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- iconHistory.tooltipText=getTooltip(R.drawable.ic_history_black_24dp)
- iconVehicleIn.tooltipText=getTooltip(R.drawable.car)
- iconVehicleOut.tooltipText=getTooltip(R.drawable.car_off)
+ iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
+ iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
+ iconVehicleOut.tooltipText = getTooltip(R.drawable.car_off)
}
- when (direction){
- "OUT"-> {
- listIcons.remove(iconVehicleIn)
- listIcons.add(iconVehicleOut)
- listIcons.add(iconHistory)
- }
- "IN"->{
+ when (direction) {
+ "OUT" -> {
+ listIcons.remove(iconVehicleIn)
+ listIcons.add(iconVehicleOut)
+ listIcons.add(iconHistory)
+ }
+ "IN" -> {
listIcons.remove(iconVehicleOut)
listIcons.add(iconVehicleIn)
listIcons.add(iconHistory)
}
- }
+ }
- binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
- override fun onOptionsItemSelected(item: Drawable) {
+ binding.mainToolbar.toolbarIcons.adapter =
+ ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
+ override fun onOptionsItemSelected(item: Drawable) {
- when (item){
- iconHistory.drawable-> showScanner("Escanea matrícula para ver histórico", "HISTORY")
- iconVehicleIn.drawable-> showScanner("Escanea matrícula del vehículo", "IN")
- iconVehicleOut.drawable-> showScanner("Escanea matrícula para dejar vehículo", "OUT")
+ when (item) {
+ iconHistory.drawable -> showScanner(
+ getString(R.string.scanShelvingHistorical),
+ "HISTORY"
+ )
+ iconVehicleIn.drawable -> showScanner(getString(R.string.scanPlate), "IN")
+ iconVehicleOut.drawable -> showScanner(
+ getString(R.string.scanPlateTakeoff),
+ "OUT"
+ )
+ }
}
- }
- })
+ })
binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
@@ -149,7 +153,7 @@ class ControlVehiculoFragment(
.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
- ma.onBackPressed()
+ ma.onBackPressed()
}
}.setValue("").show()
@@ -177,13 +181,10 @@ class ControlVehiculoFragment(
private fun checkControlTimeVehicle() {
if (!goBack) {
- // d("la fecha es "+getData("DATENOVEHICLE"))
- //if (!IsNoVehicleDataToday()){
+
binding.splashProgress.visibility = VISIBLE
- viewModel.workerMachinery_isRegistered(getData(USER),getData(PASSWORD))
- /*}else{
- ma.openFragmentPickers()
- }*/
+ viewModel.workerMachinery_isRegistered(getData(USER), getData(PASSWORD))
+
}
}
@@ -196,10 +197,10 @@ class ControlVehiculoFragment(
)
} else if (direction.equals("IN")) {
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")) {
- viewModel.machineWorker_update(getData(USER),getData(PASSWORD), plateNumber,"machineWorker_update")
+ viewModel.machineWorker_update(getData(USER), getData(PASSWORD), plateNumber)
} else if (direction.equals("")) {
ma.openFragmentPickers(true)
@@ -208,8 +209,8 @@ class ControlVehiculoFragment(
}
private fun scanRequest() {
- // if (binding.scanInput != null) {
- binding.scanInput.requestFocus()
+ // if (binding.scanInput != null) {
+ binding.scanInput.requestFocus()
//}
hideKeyboards()
}
@@ -253,12 +254,12 @@ class ControlVehiculoFragment(
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)
if (isWorkedTimed.equals("UNREGISTERED")) {
customDialogThreeButtons.setOkButtonTwo("COGER") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
- "Vuelva a escanear".toast(requireContext())
+ getString(R.string.returnScan).toast(requireContext())
} else {
binding.splashProgress.visibility = VISIBLE
customDialogThreeButtons.dismiss()
@@ -269,7 +270,7 @@ class ControlVehiculoFragment(
customDialogThreeButtons.setOkButtonThree("DEJAR") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
- "Vuelva a escanear".toast(requireContext())
+ getString(R.string.returnScan).toast(requireContext())
} else {
binding.splashProgress.visibility = VISIBLE
customDialogThreeButtons.dismiss()
@@ -278,7 +279,7 @@ class ControlVehiculoFragment(
}
}.setOkButtonFour("HISTÓRICO") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
- "Vuelva a escanear".toast(requireContext())
+ getString(R.string.returnScan).toast(requireContext())
} else {
customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY")
@@ -295,12 +296,13 @@ class ControlVehiculoFragment(
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)
.setOkButtonFour("HISTÓRICO") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
- "Vuelva a escanear".toast(requireContext())
+ getString(R.string.returnScan).toast(requireContext())
} else {
customDialogThreeButtons.dismiss()
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "HISTORY")
@@ -317,10 +319,10 @@ class ControlVehiculoFragment(
with(viewModel) {
binding.splashProgress.visibility = GONE
- responseinsert.observe(viewLifecycleOwner, {
+ responseinsert.observe(viewLifecycleOwner, {
if (it.isError) {
- ma.messageWithSound(it.errorMessage,true,false)
+ ma.messageWithSound(it.errorMessage, true, false)
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
@@ -353,11 +355,11 @@ class ControlVehiculoFragment(
binding.splashProgress.visibility = GONE
})
- responsecontrol.observe(viewLifecycleOwner, {
+ responsecontrol.observe(viewLifecycleOwner, {
binding.splashProgress.visibility = GONE
// Log.i("VERDNATURA:","${it.response}")
if (it.isError) {
- ma.messageWithSound(it.errorMessage,true,false)
+ ma.messageWithSound(it.errorMessage, true, false)
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
@@ -379,19 +381,20 @@ class ControlVehiculoFragment(
if (it.response.equals("0")) {
setToolBar("IN")
- /* customDialog.setTitle("Control de vehículos")
- .setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
- .setOkButton("Escanear vehículo") {
- customDialog.dismiss()
- showScanner("Escanea matrícula del vehículo", "IN")
- }
- .setKoButton("SIN VEHÍCULO") {
- customDialog.dismiss()
- saveData(DATENOVEHICLE, SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()).toString())
- ma.openFragmentPickers(true)
+ /* customDialog.setTitle("Control de vehículos")
+ .setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
+ .setOkButton("Escanear vehículo") {
+ customDialog.dismiss()
+ showScanner("Escanea matrícula del vehículo", "IN")
+ }
+ .setKoButton("SIN VEHÍCULO") {
+ customDialog.dismiss()
+ saveData(DATENOVEHICLE, SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()).toString())
+ ma.openFragmentPickers(true)
- }.show()*/
- customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
+ }.show()*/
+ customDialogInput.setTitle(getString(R.string.vehiclecontrol))
+ .setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
.setOkButton("Coger vehículo") {
if (customDialogInput.getValue().isNotEmpty()) {
// "$description ${customDialogInput.getValue()} OK".toast(requireContext())
@@ -406,13 +409,13 @@ class ControlVehiculoFragment(
.setKoButton("Sin vehículo") {
customDialogInput.dismiss()
ma.openFragmentPickers(true)
- /* if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
- ma.onBackPressed()
- }*/
+ /* if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
+ ma.onBackPressed()
+ }*/
}.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()))
- }
-
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
index 258cd669..fcc4d9bc 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
@@ -33,7 +33,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
fun machineWorker_add(
usuario: String,
password: String,
- PlateNumber: String,callFunction:String
+ PlateNumber: String
) {
getVehicleControlTimeUserCase.machineWorker_add(usuario, password, PlateNumber)
.enqueue(object : Callback {
@@ -65,7 +65,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
fun machineWorker_update(
usuario: String,
password: String,
- PlateNumber: String,callFunction:String
+ PlateNumber: String
) {
getVehicleControlTimeUserCase.machineWorker_update(usuario, password, PlateNumber)
.enqueue(object : Callback {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt
index 14f7ecc8..da3d8c12 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasFragment.kt
@@ -140,8 +140,8 @@ class FaltasFragment :
adapter = FaltasAdapter(listInvetory, object : OnFaltasNichoClickListener {
override fun onFaltasNichoClickListener(item: ItemFaltasVO) {
customDialogInput.setTitle(item.itemFk + "\n" + item.longName + " " + item.size)
- .setDescription("Cantidad real(" + item.nicho + ")")
- .setOkButton("Tirar") {
+ .setDescription(getString(R.string.quantityReal) + item.nicho + ")")
+ .setOkButton(getString(R.string.pull)) {
viewModel.itemStockUpdate(
item.itemFk,
getData(WAREHOUSEFK),
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt
index f0459e58..617de408 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt
@@ -3,13 +3,11 @@ package es.verdnatura.presentation.view.feature.faltas.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
-import androidx.lifecycle.Transformations
import es.verdnatura.domain.GetInventaryUserCase
import es.verdnatura.domain.GetItemCardUserCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
-import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasListVO
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
@@ -33,15 +31,20 @@ class FaltasViewModel(context: Context) : BaseViewModel() {
get() = _response
- val loadFaltasList = Transformations.map(_faltasList) { Event(it) }
+ //val loadFaltasList = Transformations.map(_faltasList) { Event(it) }
- fun getFaltas(user:String,password:String,warehouseFk:String){
- getInventaryUserCase.faultsReview(user,password,warehouseFk).enqueue(object :
+ fun getFaltas(user: String, password: String, warehouseFk: String) {
+ getInventaryUserCase.faultsReview(user, password, warehouseFk).enqueue(object :
Callback> {
override fun onFailure(call: Call>, t: Throwable) {
- val listError:ArrayList = ArrayList()
- listError.add(ItemFaltasVO(isError = true,errorMessage ="Error en la llamada faultsReview."+ t.message!!))
+ val listError: ArrayList = ArrayList()
+ listError.add(
+ ItemFaltasVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
+ )
+ )
_faltasList.value = ItemFaltasListVO(listError)
}
@@ -49,11 +52,19 @@ class FaltasViewModel(context: Context) : BaseViewModel() {
call: Call>,
response: Response>
) {
- if (response.body() != null){
+ if (response.body() != null) {
_faltasList.value = response.body()?.let { ItemFaltasListVO(it) }
- }else{
- val listError:ArrayList = ArrayList()
- listError.add(ItemFaltasVO(isError = true,errorMessage = "Error en la llamada faultsReview"))
+ } else {
+ val listError: ArrayList = ArrayList()
+ listError.add(
+ ItemFaltasVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ response.message()
+ )
+ )
+ )
_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){
- getItemCardUserCase.itemStockUpdate(user,password,itemFk,warehouseFk,newValue,isTrash).enqueue(object :
- Callback {
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.isSuccessful()){
- _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.message())
+ fun itemStockUpdate(
+ itemFk: String,
+ warehouseFk: String,
+ user: String,
+ password: String,
+ newValue: String,
+ isTrash: String
+ ) {
+ getItemCardUserCase.itemStockUpdate(user, password, itemFk, warehouseFk, newValue, isTrash)
+ .enqueue(object :
+ Callback {
+ override fun onFailure(call: Call, t: Throwable) {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
+ )
}
- }
+ override fun onResponse(call: Call, response: Response) {
+ 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){
- getInventaryUserCase.faultsReview_isChecked(user,password,itemFk,warehouseFk).enqueue(object :
- Callback {
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
- }
- override fun onResponse(call: Call, response: Response) {
- 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
+ ) {
+ getInventaryUserCase.faultsReview_isChecked(user, password, itemFk, warehouseFk)
+ .enqueue(object :
+ Callback {
+ override fun onFailure(call: Call, t: Throwable) {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
+ )
}
- }
- })
+ override fun onResponse(call: Call, response: Response) {
+ if (!response.isSuccessful) {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(
+ nameofFunction(this),
+ response.message()
+ )
+ )
+ } else {
+ _response.value =
+ ResponseItemVO(isError = false, response = response.message())
+ }
+
+ }
+ })
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt
index f8cff1eb..cb1ce148 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt
@@ -1,6 +1,5 @@
package es.verdnatura.presentation.view.feature.historicoarticulo.fragment
-import android.graphics.Color.*
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
@@ -16,12 +15,9 @@ import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnOptionsSelectedListener
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.model.ItemHistoricoListVO
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
-import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import java.text.SimpleDateFormat
import java.util.*
@@ -32,8 +28,9 @@ class HistoricoArticuloFragment(
HistoricoArticuloViewModel::class
) {
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 = ArrayList()
private var listHistoryAux: ArrayList = ArrayList()
private var filter: String = ""
@@ -46,9 +43,9 @@ class HistoricoArticuloFragment(
override fun init() {
- // customDialogInput = CustomDialogInput(requireContext())
- // customDialog = CustomDialog(requireContext())
- ma.hideBottomNavigation(View.GONE)
+ // customDialogInput = CustomDialogInput(requireContext())
+ // customDialog = CustomDialog(requireContext())
+ ma.hideBottomNavigation(View.GONE)
filter = "all"
viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK))
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk
@@ -80,29 +77,31 @@ class HistoricoArticuloFragment(
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){
- iconReload.drawable->viewModelwithFilter("all")
- iconGargabe.drawable->{
- viewModelwithFilter("contenedor")
- item.setTint(getColor(context!!, verdnatura_pumpkin_orange))}
- iconFault.drawable->viewModelwithFilter("falta")
- }
-
- for (it in listIcons) {
- if (it != item) {
- it.drawable.setTint(getColor(context!!, verdnatura_white))
+ when (item) {
+ iconReload.drawable -> viewModelwithFilter("all")
+ iconGargabe.drawable -> {
+ viewModelwithFilter("contenedor")
+ item.setTint(getColor(context!!, verdnatura_pumpkin_orange))
+ }
+ iconFault.drawable -> viewModelwithFilter("falta")
}
+
+ 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 =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
@@ -159,9 +158,9 @@ class HistoricoArticuloFragment(
loadHistoricoList.observe(viewLifecycleOwner, Observer { event ->
event.getContentIfNotHandled().notNull {
- binding.splashProgress.visibility = View.GONE
+ binding.splashProgress.visibility = View.GONE
listToAdapter(it.list, filter)
- navigateToToday(it)
+ navigateToToday(it)
}
})
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt
index a913097e..630b1e75 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt
@@ -212,8 +212,8 @@ class InventaryFragment : BaseFragment 0)
binding.editPrioridad.setText(it.list[0].priority)
binding.splashProgress.visibility = View.GONE
@@ -390,19 +390,10 @@ class UbicadorFragment(
ma.messageWithSound(
if (it.isError) it.errorMessage else {
- it.response
+ getString(R.string.priorityChanged)
}, 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 {
@@ -672,10 +663,10 @@ class UbicadorFragment(
private fun showMoreOptions(item: ItemUbicadorVO) {
customDialogTwoButtons.setTitle(item.item).setDescription(getString(R.string.selectAction))
- .setOkButton("Transferir") {
- customDialogInput.setTitle("Nueva matrícula")
- .setDescription("Introduce el destino para item: " + item.item).setValue("")
- .setOkButton("Transferir") {
+ .setOkButton(getString(R.string.transfer)) {
+ customDialogInput.setTitle(getString(R.string.shelvingNew))
+ .setDescription(getString(R.string.selectDestiny) + item.item).setValue("")
+ .setOkButton(getString(R.string.transfer)) {
if (customDialogInput.getValue().isNotEmpty()) {
viewModel.itemShelvingTransfer(
getData(USER),
@@ -687,7 +678,9 @@ class UbicadorFragment(
adapter!!.notifyDataSetChanged()
customDialogInput.dismiss()
} else {
- "Carro incorrecto".toast(requireContext())
+ getString(R.string.wagonIncorrect).toast(requireContext())
+
+
}
@@ -714,7 +707,7 @@ class UbicadorFragment(
customDialogTwoButtons.dismiss()
}.setOkButtonTwo(getString(R.string.delete)) {
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)) {
listItems.remove(item)
adapter!!.notifyDataSetChanged()
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt
index c4dc0111..433699bf 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt
@@ -115,7 +115,7 @@ class UbicadorViewModel(context: Context) : BaseViewModel() {
)
} else {
_responsepriority.value =
- ResponseItemVO(isError = false, response = "Prioridad modificada")
+ ResponseItemVO(isError = false, response = response.message())
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt
index cddff3e3..ed239c8d 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt
@@ -226,7 +226,7 @@ class WorkermistakeFragment( var entryPoint: String = ""
vUserFk = workerMistakeName!!.id,
vTypeFk = it.code
)
- // "Causa del error registrado".toast(requireContext())
+ // getString(R.string.errorRegistered).toast(requireContext())
customDialogList.dismiss()
}
}
diff --git a/app/src/main/res/layout/fragment_pre_sacador.xml b/app/src/main/res/layout/fragment_pre_sacador.xml
index 20606d49..3520dcf9 100644
--- a/app/src/main/res/layout/fragment_pre_sacador.xml
+++ b/app/src/main/res/layout/fragment_pre_sacador.xml
@@ -20,7 +20,6 @@
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
- android:textColorHint="@android:color/darker_gray"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
diff --git a/app/src/main/res/layout/fragment_transferencia.xml b/app/src/main/res/layout/fragment_transferencia.xml
index 58b60727..20a8ff9e 100644
--- a/app/src/main/res/layout/fragment_transferencia.xml
+++ b/app/src/main/res/layout/fragment_transferencia.xml
@@ -106,7 +106,7 @@
android:id="@+id/button15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/Transferir"
+ android:text="@string/transfer"
android:background="@drawable/btn_orange"
android:layout_marginTop="20dp"
android:textColor="@color/verdnatura_white"
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 68d15bc4..08a8856f 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -42,9 +42,7 @@
cantidad
carro de origen
Carro destino
- Transferir
Sin sector
-
Cerrar
No existes sectores.
Selecciona un sector
@@ -191,7 +189,7 @@
Carro/etiqueta borrada
Finalizar
Deshacer
- \"Etiquetas: \"
+ Etiquetas:
warehouse
Escanea etiqueta/s electrónica/s o matrícula/s
Escanea etiqueta superior
@@ -203,7 +201,7 @@
Permite aparcar ticket/carro
Permite dejar el vehículo
Genera colección para sacar
- \"Ver filtro \"
+ Ver filtro
Ver movimientos de Faltas
Ver movimientos de Basura
Filtra por tipo de flor
@@ -221,7 +219,7 @@
Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.
Permite añadir items al carro de manera continuada. No uno a uno
Nuevo Item
- \"Editar item \"
+ Editar item
Rellena campos obligatorios
Packing obligatorio
Selecciona una acción
@@ -231,9 +229,55 @@
Aceptar
Tiene que seleccionar impresora.
Nuevo Camión
- \"PScan: \"
+ PScan:
Baldas guardadas
- \"Operación \"
+ Operación
¿Estás seguro de cerrar el pedido?
Confirmar
+ Escanea un item
+ No hemos podido encontrar el articulo. Revisa el sector.
+ Error al realizar la operación
+ Escanea etiqueta de la expedición.
+ Buffer:
+ Packing guardado
+ Previa recogida
+ Disponibilidad
+ Desmarcar línea
+ Vas a desmarcar la línea:
+ ¿Estás seguro?\
+ Desmarcar
+ ALGEMESI V
+ Coger
+ Causa del error registrado
+ Falta seleccionar impresora
+ Observaciones
+ Escanea matrícula para ver histórico
+ Escanea matrícula del vehículo
+ Escanea matrícula para dejar vehículo
+ Vuelva a escanear
+ ¿Qué desea hacer con el vehículo de matrícula
+ Prioridad modificada
+ Confirmas eliminar el artículo:
+ Carro incorrecto
+ Transferir
+ Nueva matrícula
+ Introduce el destino para item:
+ Vaciar carro
+ Esta operación no se puede rectificar.
+ E:
+ P:
+ Consultar artículo
+ Cantidad real(
+ Tirar
+ Buscar item
+ Historico
+ Artículos similares
+ Valor actual:
+ Buscar artículos similares
+ Indica la causa de eliminar stock:
+ Indica la cantidad a dar de alta
+ \"Indica la cantidad a dar de baja \"
+ Falta
+ Basura
+ El elemento introducido no es un número
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 5f44aad0..02a7d7c5 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -41,7 +41,6 @@
quantity
origin car
Destination car
- To transfer
Without sector
Close
There are no sectors.
@@ -189,7 +188,7 @@
Carro/etiqueta borrada
Finalizar
Deshacer
- \"Etiquetas: \"
+ Etiquetas:
warehouse
Escanea etiqueta/s electrónica/s o matrícula/s
Escanea etiqueta superior
@@ -219,7 +218,7 @@
Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.
Permite añadir items al carro de manera continuada. No uno a uno
Nuevo Item
- \"Editar item \"
+ Editar item
Rellena campos obligatorios
Packing obligatorio
Selecciona una acción
@@ -229,10 +228,56 @@
Aceptar
Tiene que seleccionar impresora.
Nuevo Camión
- \"PScan: \"
+ PScan:
Baldas guardadas
- \"Operación \"
+ Operación
¿Estás seguro de cerrar el pedido?
Confirmar
+ Escanea un item
+ No hemos podido encontrar el articulo. Revisa el sector.
+ Error al realizar la operación
+ Escanea etiqueta de la expedición.
+ Buffer:
+ Packing guardado
+ Previa recogida
+ availability
+ Desmarcar linea
+ Vas a desmarcar la linea:
+ ¿Estás seguro?
+ Desmarcar
+ ALGEMESI V
+ Coger
+ Causa del error registrado
+ Falta seleccionar impresora
+ Observaciones
+ Escanea matrícula para ver histórico
+ Escanea matrícula del vehículo
+ Escanea matrícula para dejar vehículo
+ Vuelva a escanear
+ ¿Qué desea hacer con el vehículo de matrícula
+ Prioridad modificada
+ Confirmas eliminar el artículo:
+ Carro incorrecto
+ Transferir
+ Nueva matrícula
+ Introduce el destino para item:
+ Vaciar carro
+ Esta operación no se puede rectificar.
+ L:
+ P:
+ Consultar artículo
+ Cantidad real(
+ Tirar
+ Buscar item
+ Historico
+ Artículos similares
+ \"Valor actual: \"
+ Buscar artículos similares
+ Indica la causa de eliminar stock:
+ Indica la cantidad a dar de alta
+ \"Indica la cantidad a dar de baja \"
+ Falta
+ Basura
+ El elemento introducido no es un número