diff --git a/.idea/misc.xml b/.idea/misc.xml
index 63d3027a..97b3f254 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -276,7 +276,7 @@
-
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 08353949..cc5f443d 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -83,14 +83,21 @@
-
+
+
-
+
+
+
+
+
+
+
@@ -879,61 +886,6 @@
123
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 526
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 569
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 572
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 573
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 582
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 616
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 619
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
- 622
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
- 83
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
- 82
-
-
-
- file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
- 64
-
-
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
index c9798366..26dcfcf8 100644
--- a/app/release/output-metadata.json
+++ b/app/release/output-metadata.json
@@ -4,15 +4,15 @@
"type": "APK",
"kind": "Directory"
},
- "applicationId": "es.verdnatura",
+ "applicationId": "es.verdnatura.sfusion",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
- "versionCode": 157,
- "versionName": "23.2",
+ "versionCode": 160,
+ "versionName": "23.3Beta",
"outputFile": "app-release.apk"
}
],
diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
index efeaa211..1adf6cff 100644
--- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
+++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
@@ -215,7 +215,7 @@ interface VerdnaturaService {
@POST("almacennew/saleTracking_updateIsChecked")//NO SALIX
fun saleTracking_updateIsChecked(
- @Body vararg params: Any
+ @Body vararg params: Any?
):
Call
@@ -281,7 +281,7 @@ interface VerdnaturaService {
@POST("almacennew/saleTracking_mark")//REVISADA
fun saleTracking_mark(
- @Body vararg params: Any
+ @Body vararg params: Any?
):
Call
diff --git a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt
index 4dda29f8..e4531375 100644
--- a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt
@@ -673,6 +673,13 @@ abstract class BaseFragment(viewModelCla
saveWorkForm(
WorkForms(
"TestLOCAL",
+ "http://10.1.4.42:9000",
+ urlSalix = "http://localhost:3000/api/"
+ )
+ )
+ saveWorkForm(
+ WorkForms(
+ "TestLOCALHOME",
"http://192.168.1.128:9000",
urlSalix = "http://localhost:3000/api/"
)
@@ -688,6 +695,8 @@ abstract class BaseFragment(viewModelCla
)
)
+
+
}
fun saveData(name: String, value: Any) {
diff --git a/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt b/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt
index aa9c3e34..2a6a73e5 100644
--- a/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt
+++ b/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt
@@ -56,12 +56,38 @@ fun itemScanIsQr(value: String): Boolean {
}
fun itemScanValue(value: String, table: String, field: String): Any {
- val gson = Gson()
-
+ var item: itemScanned
return try {
- var item = itemScanned(JSONObject(value))
+ try {
+ item = itemScanned(JSONObject(value))
+ } catch (Ex: Exception) {
+ return value
+ }
+ if (item.company == "vnl" && item.table == table) {
+
+ when (field) {
+ "id" -> return item.id
+ "more" -> return item.more
+
+ }
+
+ }
+ throw Exception("QR no válido")
+
+
+ } catch (Ex: Exception) {
+ throw Ex
+ }
+
+}
+
+fun itemScanValueOld(value: String, table: String, field: String): Any {
+ val gson = Gson()
+ var item = itemScanned(JSONObject(value))
+
+ try {
if (item.company == "vnl" && item.table == table) {
var valueToReturn: Map =
@@ -69,9 +95,9 @@ fun itemScanValue(value: String, table: String, field: String): Any {
valueToReturn.forEach {
if (it.key == field) {
-
// return it.value.toString() /*si no li pose toString torna error double to string*/
- return (it.value as Double).toInt()
+ /*return (it.value as Double).toInt()*/
+ item.more
}
}
@@ -80,6 +106,7 @@ fun itemScanValue(value: String, table: String, field: String): Any {
throw Exception("QR no válido")
} catch (Ex: Exception) {
+
if (Ex.message!!.contains("QR")) {
throw Ex
} else {
@@ -87,4 +114,4 @@ fun itemScanValue(value: String, table: String, field: String): Any {
}
}
-}
+}
\ No newline at end of file
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 8e61c234..07b09f97 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
@@ -124,9 +124,6 @@ class ItemCardFragment(
}
iconSalix.drawable -> {
binding.splashProgress.visibility = View.VISIBLE
- //getItemCard(itemFk)
-
- // ma.openFragmentWeb(itemInfoG!!.id)
var itemId = itemInfoG!!.id
var entryPoint = Gson().toJson(
mutableMapOf(
@@ -194,13 +191,13 @@ class ItemCardFragment(
warehouseFk = getDataInt(WAREHOUSEFK)
binding.splashProgressTwo.visibility = View.VISIBLE
viewModel.getItemCard(itemFk, warehouseFk!!)
- //binding.splashProgress.visibility = View.VISIBLE
+ this.itemFk = itemFk
}
override fun observeViewModel() {
with(viewModel) {
- itemcard.observe(viewLifecycleOwner, Observer {
+ itemcard.observe(viewLifecycleOwner, Observer {
if (it.isError) {
binding.itemcardLayout.visibility = GONE
@@ -274,14 +271,6 @@ class ItemCardFragment(
binding.itemcardBuyer.text = itemInfo.buyer
listItemsRow = ArrayList()
- //sergio itemcard por item_getInfo
- /* listItemsRow.add(
- ItemCardRowVO(
- title = getString(R.string.total),
- value = itemInfo.total,
- isEditable = false
- )
- )*/
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.total),
@@ -298,14 +287,6 @@ class ItemCardFragment(
)
)
- //sergio itemcard por item_getInfo
- /* listItemsRow.add(
- ItemCardRowVO(
- title = getString(R.string.Ubicado),
- value = itemInfo.enAltillo,
- isEditable = false
- )
- )*/
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Ubicado),
@@ -314,15 +295,6 @@ class ItemCardFragment(
)
)
- //sergio itemcard por item_getInfo
- /* listItemsRow.add(
- ItemCardRowVO(
- title = getString(R.string.SINUBICAR),
- value = itemInfo.enNicho,
- isEditable = false,
- action = "itemStockUpdate"
- )
- )*/
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.SINUBICAR),
@@ -373,8 +345,6 @@ class ItemCardFragment(
action = "buscarItem"
)
)
- //listItemsRow.add(ItemCardRowVO(title = "NICHO",value = itemInfo.nicho,isEditable = true, action = "itemPlacementSave"))
- // listItemsRow.add(ItemCardRowVO(title = "RESERVA",value = itemInfo.reserva,isEditable = true, action = "itemPlacementSave"))
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Grouping),
@@ -416,19 +386,6 @@ class ItemCardFragment(
action = "toBarcode"
)
)
-
- //sergio para itemTypePacking
- /* listItemsRow.add(
- ItemCardRowVO(
- title = getString(R.string.tipodeencajado),
- value = itemInfo.itemPackingTypeFk,
- isEditable = true,
- action = "updateSector"
- )
- )*/
- // listItemsRow.add(ItemCardRowVO(title = "Artículos similares",value = itemInfo.itemPackingTypeFk,isEditable = true, action = "itemProposal"))
-
-
listBarcodes = itemInfo.barcodes as ArrayList
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
@@ -565,34 +522,25 @@ class ItemCardFragment(
private fun editItemCardRow(item: ItemCardRowVO, value: Int) {
when (item.action) {
- // cau:sergio itemTrash x itemStock Update . No se utiliza esta funicón
- // "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"
- )*/
- "updateGrouping" -> viewModel.updateGrouping(
- itemFk = itemFk.toInt(),
+ "updateGrouping" ->
+ viewModel.updateGrouping(
+ itemFk = itemInfoG!!.id,
value = value,
warehouseFk = warehouseFk!!
)
"updatePacking" -> viewModel.updatePacking(
- itemFk = itemFk.toInt(),
+ itemFk = itemInfoG!!.id,
value = value,
warehouseFk = warehouseFk!!
)
"itemSaveStem" -> viewModel.item_saveStems(
- itemFk = itemFk.toInt(),
+ itemFk = itemInfoG!!.id,
value = value
)
"item_saveReference" -> viewModel.item_saveReference(
- itemFk = itemFk.toInt(),
+ itemFk = itemInfoG!!.id,
value = value
)
@@ -755,7 +703,7 @@ class ItemCardFragment(
private fun updateItemPackingType(itemPackingType: String) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.updatePackingTypeSalix(
- this.itemFk,
+ itemInfoG!!.id.toString(),
itemPackingTypeSalix(itemPackingType)
)
}
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 021f1b03..b59aecaf 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
@@ -3,10 +3,12 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.Transformations
import es.verdnatura.domain.SilexCallback
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.common.itemBarCodeSalix
import es.verdnatura.presentation.common.itemPackingTypeSalix
@@ -124,86 +126,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
})
}
-
- /* fun getItemPackingType() {
- silex.getItemPackingType().enqueue(object :
- Callback> {
- override fun onFailure(call: Call>, t: Throwable) {
- val listError: ArrayList = ArrayList()
- listError.add(
- ItemPackingType(
- isError = true,
- errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
- )
- )
- _itemspackinglist.value = ItemPackingTypeList(listError)
- }
-
- override fun onResponse(
- call: Call>,
- response: Response>
- ) {
- if (response.body() != null) {
- _itemspackinglist.value = response.body()?.let { ItemPackingTypeList(it) }
-
- } else {
- val listError: ArrayList = ArrayList()
- listError.add(
- ItemPackingType(
- isError = true,
- errorMessage = getMessageFromAllResponse(
- nameofFunction(this),
- response.message()
- )
- )
- )
- _itemspackinglist.value = ItemPackingTypeList(listError)
- }
- }
-
- })
- }*/
-
- /* fun getItemPackingTypeSalix() {
- salix.get_ItemPackingType().enqueue(object :
- Callback> {
- override fun onFailure(call: Call>, t: Throwable) {
- val listError: ArrayList = ArrayList()
- listError.add(
- ItemPackingType(
- isError = true,
- errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
- )
- )
- _itemspackinglist.value = ItemPackingTypeList(listError)
- }
-
- override fun onResponse(
- call: Call>,
- response: Response>
- ) {
- if (response.body() != null) {
- _itemspackinglist.value = response.body()?.let { ItemPackingTypeList(it) }
-
- } else {
- val listError: ArrayList = ArrayList()
- listError.add(
- ItemPackingType(
- isError = true,
- errorMessage = getMessageFromAllResponse(
- nameofFunction(this),
- response.message()
- )
- )
- )
- _itemspackinglist.value = ItemPackingTypeList(listError)
- }
- }
-
- })
- }*/
-
-
fun itemTrash(
itemFk: Int,
warehouseFk: Int,
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
index 0795fbc7..e41f617f 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
@@ -60,7 +60,13 @@ class BuscarItemFragment(
/* #Tarea 5109*/
try {
- getLocations(itemScanValue(binding.editItemFk.text.toString(), "buy", "more"))
+ getLocations(
+ itemScanValue(
+ binding.editItemFk.text.toString(),
+ "buy",
+ "more"
+ )
+ )
} catch (Ex: Exception) {
ma.messageWithSound(Ex.message.toString(), true, true)
}
@@ -79,7 +85,7 @@ class BuscarItemFragment(
}
private fun getLocations(itemFk: Any) {
- // this.itemFk = itemFk
+ this.itemFk = itemFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getLocations(itemFk)
}
@@ -101,11 +107,7 @@ class BuscarItemFragment(
totalVisible += it.visible.toInt()
}
binding.mainToolbar.toolbarTitle.text =
- getString(R.string.item) + if (it.list.isNotEmpty()) {
- it.list.get(0).itemFk
- } else {
- ""
- } + getString(R.string.visibleTotal) + totalVisible
+ getString(R.string.item) + itemFk + " " +getString(R.string.visibleTotal) + totalVisible
}
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 a81aa4ab..d9a46284 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
@@ -11,6 +11,8 @@ import android.os.Bundle
import android.os.Parcelable
import android.text.InputType
import android.util.Log.d
+import android.view.KeyEvent
+import android.view.KeyEvent.ACTION_DOWN
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
@@ -99,6 +101,7 @@ class CollectionFragment(
private var workerFkFromTicket: String? = null
private var itemShelvingTracking_mark: Int = 0
private var recylerViewState: Parcelable? = null
+ private var isScanned: Boolean? = null
companion object {
fun newInstance(collection: CollectionVO, type: String) =
@@ -1421,7 +1424,6 @@ class CollectionFragment(
private fun saleTracking_mark(position: Int, type: String) {
binding.splashProgress.visibility = VISIBLE
-
viewModel.saleTracking_mark(
saleFk = sales[position].saleFk,
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
@@ -1429,10 +1431,11 @@ class CollectionFragment(
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan!!,
vItemShelvingFk = itemShelvingTracking_mark,
- vQuantity = customDialogList.getValue().toInt()
-
+ vQuantity = customDialogList.getValue().toInt(),
+ vIsScanned = isScanned
)
+ isScanned = null
}
@@ -1531,60 +1534,61 @@ class CollectionFragment(
R.string.take
)
) {
+
if (customDialogList.getValueTwo().isNotEmpty()) {
+ isScanned = false
/*Tarea #5109*/
-
- customDialogList.setValue(
- itemScanValue(
- customDialogList.getValue(),
- "buy",
- "more"
- ).toString()
- )
+ customDialogList.setValueTwo(
+ itemScanValue(
+ customDialogList.getValueTwo(),
+ "buy",
+ "more"
+ ).toString()
+ )
- if (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue()
- .toInt() > total.toInt()
- ) {
- getString(R.string.quantityHigh).toast(requireContext())
- } else if (isNumber(customDialogList.getValue())) {
- originalItemScan = customDialogList.getValueTwo().toInt()
- // Log.i("VERDATURA","Le pasamos el siguiente item $originalItemScan que es el escaneado")
- if (checkItemScan(customDialogList.getValueTwo())) {
- onQuantityOfShelvingSelected(itemShelvingFk)
- //Log.i("VERDNATURA:","Cantidad seleccionada")
- mpok?.start()
- /* Se quita para comprobar al final de saleTracking_mark
- ReviewQuantityForRefreshingAndSorting(
- customDialogList.getValue().toInt(),
- sales[storedPosition].quantity!!.toInt(),
- sales[storedPosition].pickedQuantity.toInt()
- )*/
- customDialogList.dismiss()
- } else {
- itemShelvingFkStored = itemShelvingFk
- binding.splashProgress.visibility =
- VISIBLE
-
- viewModel.getIdFromCodeSalix(
- code = customDialogList.getValueTwo(),
- )
- /* } else {
- viewModel.getIdFromCode(
- usuario = getData(USER),
- password = getData(PASSWORD),
- code = customDialogList.getValueTwo(), "barcodeToItem"
- )
- }*/
-
- customDialogList.dismiss()
- }
- scanRequest()
- hideKeyboards()
+ if (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue()
+ .toInt() > total.toInt()
+ ) {
+ getString(R.string.quantityHigh).toast(requireContext())
+ } else if (isNumber(customDialogList.getValue())) {
+ originalItemScan = customDialogList.getValueTwo().toInt()
+ // Log.i("VERDATURA","Le pasamos el siguiente item $originalItemScan que es el escaneado")
+ if (checkItemScan(customDialogList.getValueTwo())) {
+ onQuantityOfShelvingSelected(itemShelvingFk)
+ //Log.i("VERDNATURA:","Cantidad seleccionada")
+ mpok?.start()
+ /* Se quita para comprobar al final de saleTracking_mark
+ ReviewQuantityForRefreshingAndSorting(
+ customDialogList.getValue().toInt(),
+ sales[storedPosition].quantity!!.toInt(),
+ sales[storedPosition].pickedQuantity.toInt()
+ )*/
+ customDialogList.dismiss()
} else {
- getString(R.string.quantityError).toast(requireContext())
+ itemShelvingFkStored = itemShelvingFk
+ binding.splashProgress.visibility =
+ VISIBLE
+
+ viewModel.getIdFromCodeSalix(
+ code = customDialogList.getValueTwo(),
+ )
+ /* } else {
+ viewModel.getIdFromCode(
+ usuario = getData(USER),
+ password = getData(PASSWORD),
+ code = customDialogList.getValueTwo(), "barcodeToItem"
+ )
+ }*/
+
+ customDialogList.dismiss()
}
+ scanRequest()
+ hideKeyboards()
+ } else {
+ getString(R.string.quantityError).toast(requireContext())
+ }
} else {
getString(R.string.scanItemValidate).toast(requireContext())
@@ -1615,15 +1619,19 @@ class CollectionFragment(
})
} catch (e: Exception) {
}
- try {/*Tarea 5109 el catch no tenia error*/
+ try {
+
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
- customDialogList.setValue(
+ /*Tarea 4729*/
+ isScanned = event != null && event.action == ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
+
+ customDialogList.setValueTwo(
itemScanValue(
- customDialogList.getValue(),
+ customDialogList.getValueTwo(),
"buy",
- "id"
+ "more"
).toString()
)
@@ -1691,18 +1699,21 @@ class CollectionFragment(
}
placementSupplyAdapter =
- BarcodeAdapter(listPlacementSupply, object : OnBarcodeRowClickListener {
- override fun onBarcodeRowClickListener(item: BarcodeVO) {
- placementSupplyListVO.list.forEach {
- if (it.proposal == item.code) {
- customDialogList.setValue(it.total)
- total = it.total
- itemShelvingFk = it.itemShelvingFk
+ BarcodeAdapter(
+ listPlacementSupply,
+ object : OnBarcodeRowClickListener {
+ override fun onBarcodeRowClickListener(item: BarcodeVO) {
+ placementSupplyListVO.list.forEach {
+ if (it.proposal == item.code) {
+ customDialogList.setValue(it.total)
+ total = it.total
+ itemShelvingFk = it.itemShelvingFk
+ }
}
- }
- }
- }, showDelete = false)
+ }
+ }, showDelete = false
+ )
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
@@ -1946,59 +1957,59 @@ class CollectionFragment(
}
- /* private fun showDisponibility() {
+/* private fun showDisponibility() {
- customDialogInput.setTitle(getString(R.string.Verdisponible))
- .setDescription(getString(R.string.Escaneaetiqueta))
- .setOkButton(getString(R.string.Buscar)) {
- try {
- if (binding.splashProgress != null) {
- binding.splashProgress.visibility = View.VISIBLE
- }
-
- } catch (e: Exception) {
+ customDialogInput.setTitle(getString(R.string.Verdisponible))
+ .setDescription(getString(R.string.Escaneaetiqueta))
+ .setOkButton(getString(R.string.Buscar)) {
+ try {
+ if (binding.splashProgress != null) {
+ binding.splashProgress.visibility = View.VISIBLE
}
- hideKeyboards()
+ } catch (e: Exception) {
+ }
+
+ hideKeyboards()
+ viewModel.itemGetAvailable(
+ usuario = user,
+ password = password,
+ itemFk = customDialogInput.getValue(),
+ warehouseFk = warehouseFk,
+ "item_GetVisibleAvailable"
+ )
+ scanRequest()
+ customDialogInput.dismiss()
+
+ }.setKoButton(getString(R.string.cancel)) {
+ if (binding.splashProgress != null) {
+ binding.splashProgress.visibility = View.GONE
+ }
+ hideKeyboards()
+ scanRequest()
+ customDialogInput.dismiss()
+ }.setValue("").show()
+ customDialogInput.getEditText().requestFocus()
+ customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
+ if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
+ if (!customDialogInput.getValue().isNullOrEmpty()) {
+ if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
viewModel.itemGetAvailable(
usuario = user,
password = password,
itemFk = customDialogInput.getValue(),
- warehouseFk = warehouseFk,
- "item_GetVisibleAvailable"
- )
- scanRequest()
- customDialogInput.dismiss()
-
- }.setKoButton(getString(R.string.cancel)) {
- if (binding.splashProgress != null) {
- binding.splashProgress.visibility = View.GONE
+ warehouseFk = warehouseFk
+ ,"item_GetVisibleAvailable")
}
- hideKeyboards()
+ customDialogInput.setValue("")
scanRequest()
customDialogInput.dismiss()
- }.setValue("").show()
- customDialogInput.getEditText().requestFocus()
- customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
- if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
- if (!customDialogInput.getValue().isNullOrEmpty()) {
- if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
- viewModel.itemGetAvailable(
- usuario = user,
- password = password,
- itemFk = customDialogInput.getValue(),
- warehouseFk = warehouseFk
- ,"item_GetVisibleAvailable")
- }
- customDialogInput.setValue("")
- scanRequest()
- customDialogInput.dismiss()
- hideKeyboards()
- return@setOnEditorActionListener true
- }
- false
+ hideKeyboards()
+ return@setOnEditorActionListener true
}
- }*/
+ false
+ }
+ }*/
private fun toastDisponibility(item: ItemVO) {
if (item.available.isNullOrEmpty()) {
@@ -2182,7 +2193,7 @@ class CollectionFragment(
//requireActivity().main_bottom_navigation.visibility = visibilitiy
}
- //FALTAS / BASURA / SPLIT
+//FALTAS / BASURA / SPLIT
private fun showQuantityDialog(position: Int) {
@@ -2240,83 +2251,83 @@ class CollectionFragment(
customDialogThreeButtons.setFocusDialogValue()
}
- /* private fun checkAndCall(position: Int, value: String, action: String) {
- if (value.trim().isNullOrEmpty()) {
- getString(R.string.Indicanuevacantidad).toast(requireContext())
- } else {
+/* private fun checkAndCall(position: Int, value: String, action: String) {
+ if (value.trim().isNullOrEmpty()) {
+ getString(R.string.Indicanuevacantidad).toast(requireContext())
+ } else {
- when (action) {
- getString(R.string.Agregar) -> increaseQuantity(position, value.toInt())
- getString(R.string.BasuraRechazar) -> TrashMissingReject(
- position,
- value.toInt(),
- "TRUE"
- )
- getString(R.string.titleFaults) -> TrashMissingReject(
- position,
- value.toInt(),
- "FALSE"
- )
- getString(R.string.Reject) -> TrashMissingReject(
- position,
- value.toInt(),
- "reject"
- )
- getString(R.string.Split) -> split(position, value.toInt())
+ when (action) {
+ getString(R.string.Agregar) -> increaseQuantity(position, value.toInt())
+ getString(R.string.BasuraRechazar) -> TrashMissingReject(
+ position,
+ value.toInt(),
+ "TRUE"
+ )
+ getString(R.string.titleFaults) -> TrashMissingReject(
+ position,
+ value.toInt(),
+ "FALSE"
+ )
+ getString(R.string.Reject) -> TrashMissingReject(
+ position,
+ value.toInt(),
+ "reject"
+ )
+ getString(R.string.Split) -> split(position, value.toInt())
- }
-
- scanRequest()
- customDialogThreeButtons.dismiss()
- }
- }*/
-
- /* private fun split(position: Int, quantity: Int) {
-
- //sergio: SPLIT SALIX
-
- quantityCollectionSplit = quantity
- positionCollectionSplit = position
-
- var totalQuantity: Int = 0
- try {
- totalQuantity = sales[position].quantity!!.toInt() - quantity.toInt()
- } catch (e: Exception) {
- }
-
-
- viewModel.transferSalesSalix(
- ticketFk = sales[position].ticketFk,
- saleFk = sales[position].saleFk,
- quantity = totalQuantity.toString()
- )
-
- }*/
-
- /* private fun TrashMissingReject(
- position: Int,
- quantity: Int,
- typeCollectionTrashMissingReject: String
- ) {
- typeCollectionMissing = typeCollectionTrashMissingReject
- positionCollectionMissing = position
- quantityCollectionMissing = quantity
-
- var totalQuantity: Int = 0
- try {
- totalQuantity = sales[position].quantity!!.toInt() - quantity.toInt()
- } catch (e: Exception) {
}
- viewModel.collectionMissingTrash(
- saleFk = sales[position].saleFk,
- quantity = totalQuantity.toString(),
- warehouseFk = getData(WAREHOUSEFK),
- type = typeCollectionTrashMissingReject,
- originalQuantity = quantity
- )
+ scanRequest()
+ customDialogThreeButtons.dismiss()
+ }
+ }*/
- }*/
+/* private fun split(position: Int, quantity: Int) {
+
+ //sergio: SPLIT SALIX
+
+ quantityCollectionSplit = quantity
+ positionCollectionSplit = position
+
+ var totalQuantity: Int = 0
+ try {
+ totalQuantity = sales[position].quantity!!.toInt() - quantity.toInt()
+ } catch (e: Exception) {
+ }
+
+
+ viewModel.transferSalesSalix(
+ ticketFk = sales[position].ticketFk,
+ saleFk = sales[position].saleFk,
+ quantity = totalQuantity.toString()
+ )
+
+ }*/
+
+/* private fun TrashMissingReject(
+ position: Int,
+ quantity: Int,
+ typeCollectionTrashMissingReject: String
+ ) {
+ typeCollectionMissing = typeCollectionTrashMissingReject
+ positionCollectionMissing = position
+ quantityCollectionMissing = quantity
+
+ var totalQuantity: Int = 0
+ try {
+ totalQuantity = sales[position].quantity!!.toInt() - quantity.toInt()
+ } catch (e: Exception) {
+ }
+
+ viewModel.collectionMissingTrash(
+ saleFk = sales[position].saleFk,
+ quantity = totalQuantity.toString(),
+ warehouseFk = getData(WAREHOUSEFK),
+ type = typeCollectionTrashMissingReject,
+ originalQuantity = quantity
+ )
+
+ }*/
private fun missingTrashSuccesful() {
@@ -2417,6 +2428,7 @@ class CollectionFragment(
quantity = quantity.toString()
)
+
}
//ESTADOS
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt
index e1feb798..fb6099f8 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt
@@ -106,9 +106,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
get() = _responseCollectionUnchecked
- /* private val _responseMissingTrash by lazy { MutableLiveData() }
- val responseMissingTrash: LiveData
- get() = _responseMissingTrash*/
+ /* private val _responseMissingTrash by lazy { MutableLiveData() }
+ val responseMissingTrash: LiveData
+ get() = _responseMissingTrash*/
private val _responseSplit by lazy { MutableLiveData() }
val responseSplit: LiveData
@@ -255,7 +255,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
vIsChecked: String,
vBuyFk: Int,
vItemShelvingFk: Int,
- vQuantity: Int
+ vQuantity: Int,
+ vIsScanned: Boolean?
) {
silex.saleTracking_mark(
saleFk,
@@ -264,7 +265,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
vIsChecked != "0",
vBuyFk,
vItemShelvingFk,
- vQuantity
+ vQuantity,
+ vIsScanned
).enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseSaleTracking_mark.value = ResponseItemVO(
@@ -753,9 +755,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
saleFk: Int,
quantity: String
) {
- salix.collectionIncreaseQuantitySalix(
- SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
- ).enqueue(object : SilexCallback(context) {
+ salix.collectionIncreaseQuantitySalix(
+ SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
+ ).enqueue(object : SilexCallback(context) {
override fun onError(t: Throwable) {
_responseIncQuantity.value = ResponseItemVO(
isError = true,
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt
index a69096da..dffe0d35 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt
@@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable
import android.media.MediaPlayer
import android.os.Build
import android.os.Bundle
+import android.view.KeyEvent
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
@@ -84,6 +85,7 @@ class EndSacadorFragment(
//sergio: se añada para leer el articulo leido que era el buyFk
private var originalItemScan: String = ""
+ private var isScanned: Boolean? = null
override fun onAttach(context: Context) {
@@ -796,22 +798,23 @@ class EndSacadorFragment(
private fun saleTrackingReplace(position: Int) {
- if (sales[position].picked == sales[position].quantity) {
+ if (sales[position].picked == sales[position].quantity || sales[position].picked == 0) {
+ viewModel.saleTracking_updateIsChecked(
+ vSaleFk = sales[position].idMovimiento.toInt(),
+ vIsChecked = sales[position].picked == sales[position].quantity,
+ vIsScanned = isScanned
+
+ )
+ }
+ /* if (sales[position].picked == 0) {
viewModel.saleTracking_updateIsChecked(
vSaleFk = sales[position].idMovimiento.toInt(),
vIsChecked = sales[position].picked == sales[position].quantity
)
- }
- if (sales[position].picked == 0) {
- viewModel.saleTracking_updateIsChecked(
- vSaleFk = sales[position].idMovimiento.toInt(),
- vIsChecked = sales[position].picked == sales[position].quantity
-
- )
- }
-
+ }*/
+ isScanned = null
}
private fun unMarkLine(position: Int) {
@@ -887,7 +890,7 @@ class EndSacadorFragment(
customDialogList.setTitle("$shelving($item) $total del $longName")
.setOkButton(getString(R.string.take)) {
-
+ isScanned = false
if (customDialogList.getValueTwo().isNotEmpty()) {
/*Tarea 5109*/
@@ -946,6 +949,8 @@ class EndSacadorFragment(
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
try {
+ isScanned = event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
+
customDialogList.setValueTwo(
itemScanValue(
customDialogList.getValueTwo(),
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt
index fbac48aa..635c71df 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt
@@ -621,9 +621,10 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
fun saleTracking_updateIsChecked(
vSaleFk: Int,
- vIsChecked: Boolean
+ vIsChecked: Boolean,
+ vIsScanned:Boolean?
) {
- silex.saleTracking_updateIsChecked(vSaleFk, vIsChecked)
+ silex.saleTracking_updateIsChecked(vSaleFk, vIsChecked,vIsScanned)
.enqueue(
object :
SilexCallback(context) {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt
index c55f5577..492f4cdc 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt
@@ -44,7 +44,7 @@ class UbicadorFragment(
private lateinit var customDialogInput: CustomDialogInput
private lateinit var customDialogUbicador: CustomDialogUbicador
private lateinit var customDialogTwoButtons: CustomDialogTwoButtons
- private var listItems: ArrayList = ArrayList()
+ private var listItems: MutableList = mutableListOf()
private var listLocalItems: ArrayList = ArrayList()
private lateinit var customDialog: CustomDialog
private var deep: Int = 1
@@ -492,6 +492,10 @@ class UbicadorFragment(
}
}
+ if (!binding.mainToolbar.switchButton.isChecked && listItems.isNotEmpty()){
+
+ listItems= listItems.asReversed()
+ }
adapter = UbicadorAdapter(
listItems.sortedBy { it.isChecked },
onPasillerosItemClickListener = pasillerosItemClickListener!!,