Version 23.4Beta Buscar item, isScanned preparado, grouping y volver atrás solucionado, qr, ubicador orden reverso cuando se añade item
This commit is contained in:
parent
0436cb50bf
commit
d386374c90
|
@ -276,7 +276,7 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -83,14 +83,21 @@
|
|||
</select>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Version 23.3Beta Solucionada llamada Número de paquetes en balda al hacer ENTER">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Version 23.4Beta Buscar item, isScanned preparado">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/Extensions.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/Extensions.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/release/output-metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/app/release/output-metadata.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/itemScanned.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogList.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogList.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -879,61 +886,6 @@
|
|||
<line>123</line>
|
||||
<option name="timeStamp" value="4" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>526</line>
|
||||
<option name="timeStamp" value="5" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>569</line>
|
||||
<option name="timeStamp" value="6" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>572</line>
|
||||
<option name="timeStamp" value="7" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>573</line>
|
||||
<option name="timeStamp" value="8" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>582</line>
|
||||
<option name="timeStamp" value="9" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>616</line>
|
||||
<option name="timeStamp" value="10" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>619</line>
|
||||
<option name="timeStamp" value="11" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt</url>
|
||||
<line>622</line>
|
||||
<option name="timeStamp" value="12" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt</url>
|
||||
<line>83</line>
|
||||
<option name="timeStamp" value="28" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt</url>
|
||||
<line>82</line>
|
||||
<option name="timeStamp" value="29" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt</url>
|
||||
<line>64</line>
|
||||
<option name="timeStamp" value="30" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
<pin-to-top-manager>
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -215,7 +215,7 @@ interface VerdnaturaService {
|
|||
|
||||
@POST("almacennew/saleTracking_updateIsChecked")//NO SALIX
|
||||
fun saleTracking_updateIsChecked(
|
||||
@Body vararg params: Any
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
|
@ -281,7 +281,7 @@ interface VerdnaturaService {
|
|||
|
||||
@POST("almacennew/saleTracking_mark")//REVISADA
|
||||
fun saleTracking_mark(
|
||||
@Body vararg params: Any
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
|
|
|
@ -673,6 +673,13 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(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<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun saveData(name: String, value: Any) {
|
||||
|
|
|
@ -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<String, Any> =
|
||||
|
@ -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 {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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<BarcodeVO>
|
||||
|
||||
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)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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<List<ItemPackingType>> {
|
||||
override fun onFailure(call: Call<List<ItemPackingType>>, t: Throwable) {
|
||||
val listError: ArrayList<ItemPackingType> = ArrayList()
|
||||
listError.add(
|
||||
ItemPackingType(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_itemspackinglist.value = ItemPackingTypeList(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ItemPackingType>>,
|
||||
response: Response<List<ItemPackingType>>
|
||||
) {
|
||||
if (response.body() != null) {
|
||||
_itemspackinglist.value = response.body()?.let { ItemPackingTypeList(it) }
|
||||
|
||||
} else {
|
||||
val listError: ArrayList<ItemPackingType> = ArrayList()
|
||||
listError.add(
|
||||
ItemPackingType(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemspackinglist.value = ItemPackingTypeList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}*/
|
||||
|
||||
/* fun getItemPackingTypeSalix() {
|
||||
salix.get_ItemPackingType().enqueue(object :
|
||||
Callback<List<ItemPackingType>> {
|
||||
override fun onFailure(call: Call<List<ItemPackingType>>, t: Throwable) {
|
||||
val listError: ArrayList<ItemPackingType> = ArrayList()
|
||||
listError.add(
|
||||
ItemPackingType(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_itemspackinglist.value = ItemPackingTypeList(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ItemPackingType>>,
|
||||
response: Response<List<ItemPackingType>>
|
||||
) {
|
||||
if (response.body() != null) {
|
||||
_itemspackinglist.value = response.body()?.let { ItemPackingTypeList(it) }
|
||||
|
||||
} else {
|
||||
val listError: ArrayList<ItemPackingType> = ArrayList()
|
||||
listError.add(
|
||||
ItemPackingType(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemspackinglist.value = ItemPackingTypeList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}*/
|
||||
|
||||
|
||||
fun itemTrash(
|
||||
itemFk: Int,
|
||||
warehouseFk: Int,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -106,9 +106,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
get() = _responseCollectionUnchecked
|
||||
|
||||
|
||||
/* private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseMissingTrash: LiveData<ResponseItemVO>
|
||||
get() = _responseMissingTrash*/
|
||||
/* private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseMissingTrash: LiveData<ResponseItemVO>
|
||||
get() = _responseMissingTrash*/
|
||||
|
||||
private val _responseSplit by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSplit: LiveData<ResponseItemVO>
|
||||
|
@ -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<Any>(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<Any>(context) {
|
||||
salix.collectionIncreaseQuantitySalix(
|
||||
SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseIncQuantity.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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<Any>(context) {
|
||||
|
|
|
@ -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<ItemUbicadorVO> = ArrayList()
|
||||
private var listItems: MutableList<ItemUbicadorVO> = mutableListOf()
|
||||
private var listLocalItems: ArrayList<ItemUbicadorVO> = 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!!,
|
||||
|
|
Loading…
Reference in New Issue