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>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -83,14 +83,21 @@
|
||||||
</select>
|
</select>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<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$/.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/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/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/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/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/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" />
|
<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>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
@ -879,61 +886,6 @@
|
||||||
<line>123</line>
|
<line>123</line>
|
||||||
<option name="timeStamp" value="4" />
|
<option name="timeStamp" value="4" />
|
||||||
</line-breakpoint>
|
</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>
|
</breakpoints>
|
||||||
</breakpoint-manager>
|
</breakpoint-manager>
|
||||||
<pin-to-top-manager>
|
<pin-to-top-manager>
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
"type": "APK",
|
"type": "APK",
|
||||||
"kind": "Directory"
|
"kind": "Directory"
|
||||||
},
|
},
|
||||||
"applicationId": "es.verdnatura",
|
"applicationId": "es.verdnatura.sfusion",
|
||||||
"variantName": "release",
|
"variantName": "release",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 157,
|
"versionCode": 160,
|
||||||
"versionName": "23.2",
|
"versionName": "23.3Beta",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -215,7 +215,7 @@ interface VerdnaturaService {
|
||||||
|
|
||||||
@POST("almacennew/saleTracking_updateIsChecked")//NO SALIX
|
@POST("almacennew/saleTracking_updateIsChecked")//NO SALIX
|
||||||
fun saleTracking_updateIsChecked(
|
fun saleTracking_updateIsChecked(
|
||||||
@Body vararg params: Any
|
@Body vararg params: Any?
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ interface VerdnaturaService {
|
||||||
|
|
||||||
@POST("almacennew/saleTracking_mark")//REVISADA
|
@POST("almacennew/saleTracking_mark")//REVISADA
|
||||||
fun saleTracking_mark(
|
fun saleTracking_mark(
|
||||||
@Body vararg params: Any
|
@Body vararg params: Any?
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
|
|
|
@ -673,6 +673,13 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"TestLOCAL",
|
"TestLOCAL",
|
||||||
|
"http://10.1.4.42:9000",
|
||||||
|
urlSalix = "http://localhost:3000/api/"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
saveWorkForm(
|
||||||
|
WorkForms(
|
||||||
|
"TestLOCALHOME",
|
||||||
"http://192.168.1.128:9000",
|
"http://192.168.1.128:9000",
|
||||||
urlSalix = "http://localhost:3000/api/"
|
urlSalix = "http://localhost:3000/api/"
|
||||||
)
|
)
|
||||||
|
@ -688,6 +695,8 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun saveData(name: String, value: Any) {
|
fun saveData(name: String, value: Any) {
|
||||||
|
|
|
@ -56,12 +56,38 @@ fun itemScanIsQr(value: String): Boolean {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun itemScanValue(value: String, table: String, field: String): Any {
|
fun itemScanValue(value: String, table: String, field: String): Any {
|
||||||
val gson = Gson()
|
var item: itemScanned
|
||||||
|
|
||||||
return try {
|
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) {
|
if (item.company == "vnl" && item.table == table) {
|
||||||
|
|
||||||
var valueToReturn: Map<String, Any> =
|
var valueToReturn: Map<String, Any> =
|
||||||
|
@ -69,9 +95,9 @@ fun itemScanValue(value: String, table: String, field: String): Any {
|
||||||
valueToReturn.forEach {
|
valueToReturn.forEach {
|
||||||
|
|
||||||
if (it.key == field) {
|
if (it.key == field) {
|
||||||
|
|
||||||
// return it.value.toString() /*si no li pose toString torna error double to string*/
|
// 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")
|
throw Exception("QR no válido")
|
||||||
|
|
||||||
} catch (Ex: Exception) {
|
} catch (Ex: Exception) {
|
||||||
|
|
||||||
if (Ex.message!!.contains("QR")) {
|
if (Ex.message!!.contains("QR")) {
|
||||||
throw Ex
|
throw Ex
|
||||||
} else {
|
} else {
|
||||||
|
@ -87,4 +114,4 @@ fun itemScanValue(value: String, table: String, field: String): Any {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -124,9 +124,6 @@ class ItemCardFragment(
|
||||||
}
|
}
|
||||||
iconSalix.drawable -> {
|
iconSalix.drawable -> {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
//getItemCard(itemFk)
|
|
||||||
|
|
||||||
// ma.openFragmentWeb(itemInfoG!!.id)
|
|
||||||
var itemId = itemInfoG!!.id
|
var itemId = itemInfoG!!.id
|
||||||
var entryPoint = Gson().toJson(
|
var entryPoint = Gson().toJson(
|
||||||
mutableMapOf(
|
mutableMapOf(
|
||||||
|
@ -194,13 +191,13 @@ class ItemCardFragment(
|
||||||
warehouseFk = getDataInt(WAREHOUSEFK)
|
warehouseFk = getDataInt(WAREHOUSEFK)
|
||||||
binding.splashProgressTwo.visibility = View.VISIBLE
|
binding.splashProgressTwo.visibility = View.VISIBLE
|
||||||
viewModel.getItemCard(itemFk, warehouseFk!!)
|
viewModel.getItemCard(itemFk, warehouseFk!!)
|
||||||
//binding.splashProgress.visibility = View.VISIBLE
|
this.itemFk = itemFk
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
itemcard.observe(viewLifecycleOwner, Observer {
|
itemcard.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.itemcardLayout.visibility = GONE
|
binding.itemcardLayout.visibility = GONE
|
||||||
|
@ -274,14 +271,6 @@ class ItemCardFragment(
|
||||||
binding.itemcardBuyer.text = itemInfo.buyer
|
binding.itemcardBuyer.text = itemInfo.buyer
|
||||||
listItemsRow = ArrayList()
|
listItemsRow = ArrayList()
|
||||||
|
|
||||||
//sergio itemcard por item_getInfo
|
|
||||||
/* listItemsRow.add(
|
|
||||||
ItemCardRowVO(
|
|
||||||
title = getString(R.string.total),
|
|
||||||
value = itemInfo.total,
|
|
||||||
isEditable = false
|
|
||||||
)
|
|
||||||
)*/
|
|
||||||
listItemsRow.add(
|
listItemsRow.add(
|
||||||
ItemCardRowVO(
|
ItemCardRowVO(
|
||||||
title = getString(R.string.total),
|
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(
|
listItemsRow.add(
|
||||||
ItemCardRowVO(
|
ItemCardRowVO(
|
||||||
title = getString(R.string.Ubicado),
|
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(
|
listItemsRow.add(
|
||||||
ItemCardRowVO(
|
ItemCardRowVO(
|
||||||
title = getString(R.string.SINUBICAR),
|
title = getString(R.string.SINUBICAR),
|
||||||
|
@ -373,8 +345,6 @@ class ItemCardFragment(
|
||||||
action = "buscarItem"
|
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(
|
listItemsRow.add(
|
||||||
ItemCardRowVO(
|
ItemCardRowVO(
|
||||||
title = getString(R.string.Grouping),
|
title = getString(R.string.Grouping),
|
||||||
|
@ -416,19 +386,6 @@ class ItemCardFragment(
|
||||||
action = "toBarcode"
|
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>
|
listBarcodes = itemInfo.barcodes as ArrayList<BarcodeVO>
|
||||||
|
|
||||||
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
|
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
|
||||||
|
@ -565,34 +522,25 @@ class ItemCardFragment(
|
||||||
private fun editItemCardRow(item: ItemCardRowVO, value: Int) {
|
private fun editItemCardRow(item: ItemCardRowVO, value: Int) {
|
||||||
|
|
||||||
when (item.action) {
|
when (item.action) {
|
||||||
// cau:sergio itemTrash x itemStock Update . No se utiliza esta funicón
|
|
||||||
// "itemStockUpdate" -> prepareItemStockUpdate(item,value)
|
|
||||||
"itemStockUpdateAdd" -> prepareItemStockUpdate2(item, value)
|
"itemStockUpdateAdd" -> prepareItemStockUpdate2(item, value)
|
||||||
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value)
|
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value)
|
||||||
/* "itemPlacementSave" -> viewModel.itemPlacementSave(
|
"updateGrouping" ->
|
||||||
itemFk = itemFk,
|
viewModel.updateGrouping(
|
||||||
warehouseFk = warehouseFk,
|
itemFk = itemInfoG!!.id,
|
||||||
user = user,
|
|
||||||
password = password,
|
|
||||||
value = value,
|
|
||||||
"itemPlacementSave"
|
|
||||||
)*/
|
|
||||||
"updateGrouping" -> viewModel.updateGrouping(
|
|
||||||
itemFk = itemFk.toInt(),
|
|
||||||
value = value,
|
value = value,
|
||||||
warehouseFk = warehouseFk!!
|
warehouseFk = warehouseFk!!
|
||||||
)
|
)
|
||||||
"updatePacking" -> viewModel.updatePacking(
|
"updatePacking" -> viewModel.updatePacking(
|
||||||
itemFk = itemFk.toInt(),
|
itemFk = itemInfoG!!.id,
|
||||||
value = value,
|
value = value,
|
||||||
warehouseFk = warehouseFk!!
|
warehouseFk = warehouseFk!!
|
||||||
)
|
)
|
||||||
"itemSaveStem" -> viewModel.item_saveStems(
|
"itemSaveStem" -> viewModel.item_saveStems(
|
||||||
itemFk = itemFk.toInt(),
|
itemFk = itemInfoG!!.id,
|
||||||
value = value
|
value = value
|
||||||
)
|
)
|
||||||
"item_saveReference" -> viewModel.item_saveReference(
|
"item_saveReference" -> viewModel.item_saveReference(
|
||||||
itemFk = itemFk.toInt(),
|
itemFk = itemInfoG!!.id,
|
||||||
value = value
|
value = value
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -755,7 +703,7 @@ class ItemCardFragment(
|
||||||
private fun updateItemPackingType(itemPackingType: String) {
|
private fun updateItemPackingType(itemPackingType: String) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.updatePackingTypeSalix(
|
viewModel.updatePackingTypeSalix(
|
||||||
this.itemFk,
|
itemInfoG!!.id.toString(),
|
||||||
itemPackingTypeSalix(itemPackingType)
|
itemPackingTypeSalix(itemPackingType)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,12 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.Transformations
|
||||||
import es.verdnatura.domain.SilexCallback
|
import es.verdnatura.domain.SilexCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
|
import es.verdnatura.presentation.common.Event
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
import es.verdnatura.presentation.common.itemBarCodeSalix
|
import es.verdnatura.presentation.common.itemBarCodeSalix
|
||||||
import es.verdnatura.presentation.common.itemPackingTypeSalix
|
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(
|
fun itemTrash(
|
||||||
itemFk: Int,
|
itemFk: Int,
|
||||||
warehouseFk: Int,
|
warehouseFk: Int,
|
||||||
|
|
|
@ -60,7 +60,13 @@ class BuscarItemFragment(
|
||||||
/* #Tarea 5109*/
|
/* #Tarea 5109*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getLocations(itemScanValue(binding.editItemFk.text.toString(), "buy", "more"))
|
getLocations(
|
||||||
|
itemScanValue(
|
||||||
|
binding.editItemFk.text.toString(),
|
||||||
|
"buy",
|
||||||
|
"more"
|
||||||
|
)
|
||||||
|
)
|
||||||
} catch (Ex: Exception) {
|
} catch (Ex: Exception) {
|
||||||
ma.messageWithSound(Ex.message.toString(), true, true)
|
ma.messageWithSound(Ex.message.toString(), true, true)
|
||||||
}
|
}
|
||||||
|
@ -79,7 +85,7 @@ class BuscarItemFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getLocations(itemFk: Any) {
|
private fun getLocations(itemFk: Any) {
|
||||||
// this.itemFk = itemFk
|
this.itemFk = itemFk
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.getLocations(itemFk)
|
viewModel.getLocations(itemFk)
|
||||||
}
|
}
|
||||||
|
@ -101,11 +107,7 @@ class BuscarItemFragment(
|
||||||
totalVisible += it.visible.toInt()
|
totalVisible += it.visible.toInt()
|
||||||
}
|
}
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
getString(R.string.item) + if (it.list.isNotEmpty()) {
|
getString(R.string.item) + itemFk + " " +getString(R.string.visibleTotal) + totalVisible
|
||||||
it.list.get(0).itemFk
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
} + getString(R.string.visibleTotal) + totalVisible
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import android.os.Bundle
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.util.Log.d
|
import android.util.Log.d
|
||||||
|
import android.view.KeyEvent
|
||||||
|
import android.view.KeyEvent.ACTION_DOWN
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
|
@ -99,6 +101,7 @@ class CollectionFragment(
|
||||||
private var workerFkFromTicket: String? = null
|
private var workerFkFromTicket: String? = null
|
||||||
private var itemShelvingTracking_mark: Int = 0
|
private var itemShelvingTracking_mark: Int = 0
|
||||||
private var recylerViewState: Parcelable? = null
|
private var recylerViewState: Parcelable? = null
|
||||||
|
private var isScanned: Boolean? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(collection: CollectionVO, type: String) =
|
fun newInstance(collection: CollectionVO, type: String) =
|
||||||
|
@ -1421,7 +1424,6 @@ class CollectionFragment(
|
||||||
private fun saleTracking_mark(position: Int, type: String) {
|
private fun saleTracking_mark(position: Int, type: String) {
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
|
||||||
viewModel.saleTracking_mark(
|
viewModel.saleTracking_mark(
|
||||||
saleFk = sales[position].saleFk,
|
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",
|
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(),
|
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||||
vBuyFk = originalItemScan!!,
|
vBuyFk = originalItemScan!!,
|
||||||
vItemShelvingFk = itemShelvingTracking_mark,
|
vItemShelvingFk = itemShelvingTracking_mark,
|
||||||
vQuantity = customDialogList.getValue().toInt()
|
vQuantity = customDialogList.getValue().toInt(),
|
||||||
|
vIsScanned = isScanned
|
||||||
|
|
||||||
)
|
)
|
||||||
|
isScanned = null
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1531,60 +1534,61 @@ class CollectionFragment(
|
||||||
R.string.take
|
R.string.take
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||||
|
isScanned = false
|
||||||
/*Tarea #5109*/
|
/*Tarea #5109*/
|
||||||
|
customDialogList.setValueTwo(
|
||||||
customDialogList.setValue(
|
itemScanValue(
|
||||||
itemScanValue(
|
customDialogList.getValueTwo(),
|
||||||
customDialogList.getValue(),
|
"buy",
|
||||||
"buy",
|
"more"
|
||||||
"more"
|
).toString()
|
||||||
).toString()
|
)
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue()
|
if (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue()
|
||||||
.toInt() > total.toInt()
|
.toInt() > total.toInt()
|
||||||
) {
|
) {
|
||||||
getString(R.string.quantityHigh).toast(requireContext())
|
getString(R.string.quantityHigh).toast(requireContext())
|
||||||
} else if (isNumber(customDialogList.getValue())) {
|
} else if (isNumber(customDialogList.getValue())) {
|
||||||
originalItemScan = customDialogList.getValueTwo().toInt()
|
originalItemScan = customDialogList.getValueTwo().toInt()
|
||||||
// Log.i("VERDATURA","Le pasamos el siguiente item $originalItemScan que es el escaneado")
|
// Log.i("VERDATURA","Le pasamos el siguiente item $originalItemScan que es el escaneado")
|
||||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||||
//Log.i("VERDNATURA:","Cantidad seleccionada")
|
//Log.i("VERDNATURA:","Cantidad seleccionada")
|
||||||
mpok?.start()
|
mpok?.start()
|
||||||
/* Se quita para comprobar al final de saleTracking_mark
|
/* Se quita para comprobar al final de saleTracking_mark
|
||||||
ReviewQuantityForRefreshingAndSorting(
|
ReviewQuantityForRefreshingAndSorting(
|
||||||
customDialogList.getValue().toInt(),
|
customDialogList.getValue().toInt(),
|
||||||
sales[storedPosition].quantity!!.toInt(),
|
sales[storedPosition].quantity!!.toInt(),
|
||||||
sales[storedPosition].pickedQuantity.toInt()
|
sales[storedPosition].pickedQuantity.toInt()
|
||||||
)*/
|
)*/
|
||||||
customDialogList.dismiss()
|
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()
|
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
getString(R.string.scanItemValidate).toast(requireContext())
|
getString(R.string.scanItemValidate).toast(requireContext())
|
||||||
|
@ -1615,15 +1619,19 @@ class CollectionFragment(
|
||||||
})
|
})
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
}
|
}
|
||||||
try {/*Tarea 5109 el catch no tenia error*/
|
try {
|
||||||
|
|
||||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
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(
|
itemScanValue(
|
||||||
customDialogList.getValue(),
|
customDialogList.getValueTwo(),
|
||||||
"buy",
|
"buy",
|
||||||
"id"
|
"more"
|
||||||
).toString()
|
).toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1691,18 +1699,21 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
placementSupplyAdapter =
|
placementSupplyAdapter =
|
||||||
BarcodeAdapter(listPlacementSupply, object : OnBarcodeRowClickListener {
|
BarcodeAdapter(
|
||||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
listPlacementSupply,
|
||||||
placementSupplyListVO.list.forEach {
|
object : OnBarcodeRowClickListener {
|
||||||
if (it.proposal == item.code) {
|
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||||
customDialogList.setValue(it.total)
|
placementSupplyListVO.list.forEach {
|
||||||
total = it.total
|
if (it.proposal == item.code) {
|
||||||
itemShelvingFk = it.itemShelvingFk
|
customDialogList.setValue(it.total)
|
||||||
|
total = it.total
|
||||||
|
itemShelvingFk = it.itemShelvingFk
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}, showDelete = false)
|
}, showDelete = false
|
||||||
|
)
|
||||||
|
|
||||||
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
|
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
|
||||||
|
|
||||||
|
@ -1946,59 +1957,59 @@ class CollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private fun showDisponibility() {
|
/* private fun showDisponibility() {
|
||||||
|
|
||||||
customDialogInput.setTitle(getString(R.string.Verdisponible))
|
customDialogInput.setTitle(getString(R.string.Verdisponible))
|
||||||
.setDescription(getString(R.string.Escaneaetiqueta))
|
.setDescription(getString(R.string.Escaneaetiqueta))
|
||||||
.setOkButton(getString(R.string.Buscar)) {
|
.setOkButton(getString(R.string.Buscar)) {
|
||||||
try {
|
try {
|
||||||
if (binding.splashProgress != null) {
|
if (binding.splashProgress != null) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
}
|
|
||||||
|
|
||||||
} catch (e: Exception) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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(
|
viewModel.itemGetAvailable(
|
||||||
usuario = user,
|
usuario = user,
|
||||||
password = password,
|
password = password,
|
||||||
itemFk = customDialogInput.getValue(),
|
itemFk = customDialogInput.getValue(),
|
||||||
warehouseFk = warehouseFk,
|
warehouseFk = warehouseFk
|
||||||
"item_GetVisibleAvailable"
|
,"item_GetVisibleAvailable")
|
||||||
)
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
|
||||||
if (binding.splashProgress != null) {
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
}
|
}
|
||||||
hideKeyboards()
|
customDialogInput.setValue("")
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.setValue("").show()
|
hideKeyboards()
|
||||||
customDialogInput.getEditText().requestFocus()
|
return@setOnEditorActionListener true
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}*/
|
false
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
private fun toastDisponibility(item: ItemVO) {
|
private fun toastDisponibility(item: ItemVO) {
|
||||||
if (item.available.isNullOrEmpty()) {
|
if (item.available.isNullOrEmpty()) {
|
||||||
|
@ -2182,7 +2193,7 @@ class CollectionFragment(
|
||||||
//requireActivity().main_bottom_navigation.visibility = visibilitiy
|
//requireActivity().main_bottom_navigation.visibility = visibilitiy
|
||||||
}
|
}
|
||||||
|
|
||||||
//FALTAS / BASURA / SPLIT
|
//FALTAS / BASURA / SPLIT
|
||||||
|
|
||||||
|
|
||||||
private fun showQuantityDialog(position: Int) {
|
private fun showQuantityDialog(position: Int) {
|
||||||
|
@ -2240,83 +2251,83 @@ class CollectionFragment(
|
||||||
customDialogThreeButtons.setFocusDialogValue()
|
customDialogThreeButtons.setFocusDialogValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private fun checkAndCall(position: Int, value: String, action: String) {
|
/* private fun checkAndCall(position: Int, value: String, action: String) {
|
||||||
if (value.trim().isNullOrEmpty()) {
|
if (value.trim().isNullOrEmpty()) {
|
||||||
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
when (action) {
|
when (action) {
|
||||||
getString(R.string.Agregar) -> increaseQuantity(position, value.toInt())
|
getString(R.string.Agregar) -> increaseQuantity(position, value.toInt())
|
||||||
getString(R.string.BasuraRechazar) -> TrashMissingReject(
|
getString(R.string.BasuraRechazar) -> TrashMissingReject(
|
||||||
position,
|
position,
|
||||||
value.toInt(),
|
value.toInt(),
|
||||||
"TRUE"
|
"TRUE"
|
||||||
)
|
)
|
||||||
getString(R.string.titleFaults) -> TrashMissingReject(
|
getString(R.string.titleFaults) -> TrashMissingReject(
|
||||||
position,
|
position,
|
||||||
value.toInt(),
|
value.toInt(),
|
||||||
"FALSE"
|
"FALSE"
|
||||||
)
|
)
|
||||||
getString(R.string.Reject) -> TrashMissingReject(
|
getString(R.string.Reject) -> TrashMissingReject(
|
||||||
position,
|
position,
|
||||||
value.toInt(),
|
value.toInt(),
|
||||||
"reject"
|
"reject"
|
||||||
)
|
)
|
||||||
getString(R.string.Split) -> split(position, value.toInt())
|
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(
|
scanRequest()
|
||||||
saleFk = sales[position].saleFk,
|
customDialogThreeButtons.dismiss()
|
||||||
quantity = totalQuantity.toString(),
|
}
|
||||||
warehouseFk = getData(WAREHOUSEFK),
|
}*/
|
||||||
type = typeCollectionTrashMissingReject,
|
|
||||||
originalQuantity = quantity
|
|
||||||
)
|
|
||||||
|
|
||||||
}*/
|
/* 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() {
|
private fun missingTrashSuccesful() {
|
||||||
|
@ -2417,6 +2428,7 @@ class CollectionFragment(
|
||||||
quantity = quantity.toString()
|
quantity = quantity.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//ESTADOS
|
//ESTADOS
|
||||||
|
|
|
@ -106,9 +106,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
get() = _responseCollectionUnchecked
|
get() = _responseCollectionUnchecked
|
||||||
|
|
||||||
|
|
||||||
/* private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
/* private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseMissingTrash: LiveData<ResponseItemVO>
|
val responseMissingTrash: LiveData<ResponseItemVO>
|
||||||
get() = _responseMissingTrash*/
|
get() = _responseMissingTrash*/
|
||||||
|
|
||||||
private val _responseSplit by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseSplit by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseSplit: LiveData<ResponseItemVO>
|
val responseSplit: LiveData<ResponseItemVO>
|
||||||
|
@ -255,7 +255,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
vIsChecked: String,
|
vIsChecked: String,
|
||||||
vBuyFk: Int,
|
vBuyFk: Int,
|
||||||
vItemShelvingFk: Int,
|
vItemShelvingFk: Int,
|
||||||
vQuantity: Int
|
vQuantity: Int,
|
||||||
|
vIsScanned: Boolean?
|
||||||
) {
|
) {
|
||||||
silex.saleTracking_mark(
|
silex.saleTracking_mark(
|
||||||
saleFk,
|
saleFk,
|
||||||
|
@ -264,7 +265,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
vIsChecked != "0",
|
vIsChecked != "0",
|
||||||
vBuyFk,
|
vBuyFk,
|
||||||
vItemShelvingFk,
|
vItemShelvingFk,
|
||||||
vQuantity
|
vQuantity,
|
||||||
|
vIsScanned
|
||||||
).enqueue(object : SilexCallback<Any>(context) {
|
).enqueue(object : SilexCallback<Any>(context) {
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
_responseSaleTracking_mark.value = ResponseItemVO(
|
_responseSaleTracking_mark.value = ResponseItemVO(
|
||||||
|
@ -753,9 +755,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
saleFk: Int,
|
saleFk: Int,
|
||||||
quantity: String
|
quantity: String
|
||||||
) {
|
) {
|
||||||
salix.collectionIncreaseQuantitySalix(
|
salix.collectionIncreaseQuantitySalix(
|
||||||
SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
|
SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
|
||||||
).enqueue(object : SilexCallback<Any>(context) {
|
).enqueue(object : SilexCallback<Any>(context) {
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
_responseIncQuantity.value = ResponseItemVO(
|
_responseIncQuantity.value = ResponseItemVO(
|
||||||
isError = true,
|
isError = true,
|
||||||
|
|
|
@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.KeyEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
|
@ -84,6 +85,7 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
//sergio: se añada para leer el articulo leido que era el buyFk
|
//sergio: se añada para leer el articulo leido que era el buyFk
|
||||||
private var originalItemScan: String = ""
|
private var originalItemScan: String = ""
|
||||||
|
private var isScanned: Boolean? = null
|
||||||
|
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
override fun onAttach(context: Context) {
|
||||||
|
@ -796,22 +798,23 @@ class EndSacadorFragment(
|
||||||
private fun saleTrackingReplace(position: Int) {
|
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(
|
viewModel.saleTracking_updateIsChecked(
|
||||||
vSaleFk = sales[position].idMovimiento.toInt(),
|
vSaleFk = sales[position].idMovimiento.toInt(),
|
||||||
vIsChecked = sales[position].picked == sales[position].quantity
|
vIsChecked = sales[position].picked == sales[position].quantity
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}*/
|
||||||
if (sales[position].picked == 0) {
|
isScanned = null
|
||||||
viewModel.saleTracking_updateIsChecked(
|
|
||||||
vSaleFk = sales[position].idMovimiento.toInt(),
|
|
||||||
vIsChecked = sales[position].picked == sales[position].quantity
|
|
||||||
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unMarkLine(position: Int) {
|
private fun unMarkLine(position: Int) {
|
||||||
|
@ -887,7 +890,7 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
customDialogList.setTitle("$shelving($item) $total del $longName")
|
customDialogList.setTitle("$shelving($item) $total del $longName")
|
||||||
.setOkButton(getString(R.string.take)) {
|
.setOkButton(getString(R.string.take)) {
|
||||||
|
isScanned = false
|
||||||
|
|
||||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||||
/*Tarea 5109*/
|
/*Tarea 5109*/
|
||||||
|
@ -946,6 +949,8 @@ class EndSacadorFragment(
|
||||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
try {
|
try {
|
||||||
|
isScanned = event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
|
|
||||||
customDialogList.setValueTwo(
|
customDialogList.setValueTwo(
|
||||||
itemScanValue(
|
itemScanValue(
|
||||||
customDialogList.getValueTwo(),
|
customDialogList.getValueTwo(),
|
||||||
|
|
|
@ -621,9 +621,10 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
fun saleTracking_updateIsChecked(
|
fun saleTracking_updateIsChecked(
|
||||||
vSaleFk: Int,
|
vSaleFk: Int,
|
||||||
vIsChecked: Boolean
|
vIsChecked: Boolean,
|
||||||
|
vIsScanned:Boolean?
|
||||||
) {
|
) {
|
||||||
silex.saleTracking_updateIsChecked(vSaleFk, vIsChecked)
|
silex.saleTracking_updateIsChecked(vSaleFk, vIsChecked,vIsScanned)
|
||||||
.enqueue(
|
.enqueue(
|
||||||
object :
|
object :
|
||||||
SilexCallback<Any>(context) {
|
SilexCallback<Any>(context) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ class UbicadorFragment(
|
||||||
private lateinit var customDialogInput: CustomDialogInput
|
private lateinit var customDialogInput: CustomDialogInput
|
||||||
private lateinit var customDialogUbicador: CustomDialogUbicador
|
private lateinit var customDialogUbicador: CustomDialogUbicador
|
||||||
private lateinit var customDialogTwoButtons: CustomDialogTwoButtons
|
private lateinit var customDialogTwoButtons: CustomDialogTwoButtons
|
||||||
private var listItems: ArrayList<ItemUbicadorVO> = ArrayList()
|
private var listItems: MutableList<ItemUbicadorVO> = mutableListOf()
|
||||||
private var listLocalItems: ArrayList<ItemUbicadorVO> = ArrayList()
|
private var listLocalItems: ArrayList<ItemUbicadorVO> = ArrayList()
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
private var deep: Int = 1
|
private var deep: Int = 1
|
||||||
|
@ -492,6 +492,10 @@ class UbicadorFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!binding.mainToolbar.switchButton.isChecked && listItems.isNotEmpty()){
|
||||||
|
|
||||||
|
listItems= listItems.asReversed()
|
||||||
|
}
|
||||||
adapter = UbicadorAdapter(
|
adapter = UbicadorAdapter(
|
||||||
listItems.sortedBy { it.isChecked },
|
listItems.sortedBy { it.isChecked },
|
||||||
onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
||||||
|
|
Loading…
Reference in New Issue