feat: refs #7920 itemShelvingGet
This commit is contained in:
parent
35fce7e656
commit
9306c6de4f
|
@ -37,6 +37,9 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemCardRowVO
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
class ItemCardFragment(
|
class ItemCardFragment(
|
||||||
var itemFk: String = ""
|
var itemFk: String = ""
|
||||||
|
@ -108,12 +111,12 @@ class ItemCardFragment(
|
||||||
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
||||||
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
|
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
|
||||||
// Tarea 7266
|
// Tarea 7266
|
||||||
// iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
||||||
|
|
||||||
listIcons.add(iconSalix)
|
listIcons.add(iconSalix)
|
||||||
listIcons.add(iconReload)
|
listIcons.add(iconReload)
|
||||||
listIcons.add(iconHistory)
|
listIcons.add(iconHistory)
|
||||||
// listIcons.add(iconPrint)
|
listIcons.add(iconPrint)
|
||||||
|
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
|
@ -128,7 +131,7 @@ class ItemCardFragment(
|
||||||
|
|
||||||
val printerDialogManager = PrinterDialogManager(requireContext())
|
val printerDialogManager = PrinterDialogManager(requireContext())
|
||||||
printerDialogManager.showPrintDialog(
|
printerDialogManager.showPrintDialog(
|
||||||
itemInfoG!!.id.toLong(),
|
buyToPrint ?: itemInfoG!!.id.toLong(),
|
||||||
itemInfoG?.longName ?: ""
|
itemInfoG?.longName ?: ""
|
||||||
) { id, labelType, copies, packing ->
|
) { id, labelType, copies, packing ->
|
||||||
printItem(id, labelType, copies, packing)
|
printItem(id, labelType, copies, packing)
|
||||||
|
@ -183,7 +186,6 @@ class ItemCardFragment(
|
||||||
private fun printItem(id: Long, labelType: String, packing: Int?, copies: Int?) {
|
private fun printItem(id: Long, labelType: String, packing: Int?, copies: Int?) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
viewModel.printItem(
|
viewModel.printItem(
|
||||||
reportName = "LabelBuy",
|
reportName = "LabelBuy",
|
||||||
printerFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
printerFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
|
@ -191,7 +193,12 @@ class ItemCardFragment(
|
||||||
),
|
),
|
||||||
userFk = mobileApplication.userId!!,
|
userFk = mobileApplication.userId!!,
|
||||||
priority = "normal",
|
priority = "normal",
|
||||||
params = """{'copies':$copies,'id':$id,'labelType':'$labelType','packing':$packing}"""
|
params = JSONObject().apply {
|
||||||
|
put("copies", copies)
|
||||||
|
put("id", id)
|
||||||
|
put("labelType", labelType)
|
||||||
|
put("packing", packing)
|
||||||
|
}.toString().replace("\"", "\\\"")
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ma.messageWithSound(message = ex.message.toString(), isError = true, isPlayed = true)
|
ma.messageWithSound(message = ex.message.toString(), isError = true, isPlayed = true)
|
||||||
|
@ -259,19 +266,19 @@ class ItemCardFragment(
|
||||||
binding.itemcardLayout.visibility = View.VISIBLE
|
binding.itemcardLayout.visibility = View.VISIBLE
|
||||||
setItemCard(it)
|
setItemCard(it)
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
/* Tarea 7266
|
// Tarea 7266
|
||||||
if (originalScan == null || it.id == originalScan!!.toInt()) {
|
if (originalScan == null || it.id == originalScan!!.toInt()) {
|
||||||
viewModel.buyUltimate(
|
viewModel.buyUltimate(
|
||||||
itemFk = it.id,
|
itemFk = it.id,
|
||||||
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
WAREHOUSEFK
|
WAREHOUSEFK
|
||||||
),
|
),
|
||||||
dated = LocalDate.now()
|
dated = LocalDate.now()
|
||||||
.format(DateTimeFormatter.ofPattern("yyyy-dd-MM"))
|
.format(DateTimeFormatter.ofPattern("yyyy-dd-MM"))
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
buyToPrint = originalScan!!.toLong()
|
buyToPrint = originalScan!!.toLong()
|
||||||
}*/
|
}
|
||||||
} else {
|
} else {
|
||||||
binding.itemcardLayout.visibility = GONE
|
binding.itemcardLayout.visibility = GONE
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
|
||||||
|
|
|
@ -28,6 +28,7 @@ import es.verdnatura.presentation.common.OnMoreClickListenerNew
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnVisibleClickListenerNew
|
import es.verdnatura.presentation.common.OnVisibleClickListenerNew
|
||||||
|
import es.verdnatura.presentation.common.PrinterDialogManager
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
import es.verdnatura.presentation.common.hideKeyboard
|
import es.verdnatura.presentation.common.hideKeyboard
|
||||||
import es.verdnatura.presentation.common.itemScanValue
|
import es.verdnatura.presentation.common.itemScanValue
|
||||||
|
@ -41,6 +42,9 @@ import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapterNew
|
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapterNew
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
|
@ -120,7 +124,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
if (shelvingFk.isNotEmpty()) {
|
if (shelvingFk.isNotEmpty()) {
|
||||||
isShelvinLogfromMainScreen = false
|
isShelvinLogfromMainScreen = false
|
||||||
setIconsActions(true)
|
setIconsActions(true)
|
||||||
setIcons()
|
//setIcons()
|
||||||
binding.mainToolbar.toolbarTitle.text = shelvingFk
|
binding.mainToolbar.toolbarTitle.text = shelvingFk
|
||||||
viewModel.itemShelvingListNew(shelvingFk)
|
viewModel.itemShelvingListNew(shelvingFk)
|
||||||
binding.mainToolbar.switchButton.visibility = VISIBLE
|
binding.mainToolbar.switchButton.visibility = VISIBLE
|
||||||
|
@ -128,7 +132,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
isShelvinLogfromMainScreen = true
|
isShelvinLogfromMainScreen = true
|
||||||
setIconsActions(false)
|
setIconsActions(false)
|
||||||
//Tarea 7805
|
//Tarea 7805
|
||||||
setIcons(true)
|
// setIcons(true)
|
||||||
}
|
}
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
@ -140,7 +144,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
} else {
|
} else {
|
||||||
GONE
|
GONE
|
||||||
}
|
}
|
||||||
|
setIcons(!showIcons)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setDialogs() {
|
private fun setDialogs() {
|
||||||
|
@ -287,7 +291,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
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) {
|
||||||
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
||||||
setIconsActions(true)
|
setIconsActions(true)
|
||||||
setIcons()
|
//setIcons()
|
||||||
if (!modeCheckUbication || (modeCheckUbication && (binding.editMatricula.text.toString()
|
if (!modeCheckUbication || (modeCheckUbication && (binding.editMatricula.text.toString()
|
||||||
.isShelving()) && !binding.editMatricula.text!![0].isDigit())
|
.isShelving()) && !binding.editMatricula.text!![0].isDigit())
|
||||||
) {
|
) {
|
||||||
|
@ -478,8 +482,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
viewModel.getShelvingFkFromCode(
|
viewModel.getShelvingFkFromCode(
|
||||||
listItems[0].shelvingFk!!,
|
listItems[0].shelvingFk!!, customDialogInput.getValue()
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
shelvingFk = customDialogInput.getValue()
|
shelvingFk = customDialogInput.getValue()
|
||||||
|
@ -597,6 +600,10 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
}
|
}
|
||||||
responseLogAdd.observe(viewLifecycleOwner) {
|
responseLogAdd.observe(viewLifecycleOwner) {
|
||||||
isShelvinLogfromMainScreen = false
|
isShelvinLogfromMainScreen = false
|
||||||
|
if (it == false) {
|
||||||
|
setIconsActions(false)
|
||||||
|
//setIcons()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
loadResponseCode.observe(viewLifecycleOwner) { event ->
|
loadResponseCode.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
|
@ -677,9 +684,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
loadBuyUltimateResponse.observe(viewLifecycleOwner) { event ->
|
loadBuyUltimateResponse.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.errorPrintBuy),
|
getString(R.string.errorPrintBuy), isError = true, isPlayed = true
|
||||||
isError = true,
|
|
||||||
isPlayed = true
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -792,8 +797,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
.setPackingValue(itemUbicador.packing.toString())
|
.setPackingValue(itemUbicador.packing.toString())
|
||||||
.setVisibleValue(itemUbicador.visible.toString())
|
.setVisibleValue(itemUbicador.visible.toString())
|
||||||
//.setEtiquetaValue((itemUbicador.visible / (itemUbicador.packing ?: 0)).toString())
|
//.setEtiquetaValue((itemUbicador.visible / (itemUbicador.packing ?: 0)).toString())
|
||||||
.setEtiquetaValue(itemUbicador.stickers.toString())
|
.setEtiquetaValue(itemUbicador.stickers.toString()).setUnits(
|
||||||
.setUnits(
|
|
||||||
if (itemUbicador.stickers != 0) {
|
if (itemUbicador.stickers != 0) {
|
||||||
(itemUbicador.visible % itemUbicador.stickers).toString()
|
(itemUbicador.visible % itemUbicador.stickers).toString()
|
||||||
} else {
|
} else {
|
||||||
|
@ -1083,44 +1087,44 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
}
|
}
|
||||||
customDialogConfirm.show()
|
customDialogConfirm.show()
|
||||||
}
|
}
|
||||||
//Tarea 7266
|
//Tarea 7266
|
||||||
/* .setOkButtonThree(getString(R.string.print)) {
|
.setOkButtonThree(getString(R.string.print)) {
|
||||||
val printerDialogManager = PrinterDialogManager(requireContext())
|
val printerDialogManager = PrinterDialogManager(requireContext())
|
||||||
printerDialogManager.showPrintDialog(
|
printerDialogManager.showPrintDialog(
|
||||||
item.item,
|
item.item,
|
||||||
item.description ?: ""
|
item.description ?: ""
|
||||||
) { id, labelType, packing, copies ->
|
) { id, labelType, packing, copies ->
|
||||||
|
|
||||||
if (item.buyFk == null) {
|
if (item.buyFk == null) {
|
||||||
viewModel.buyUltimate(
|
viewModel.buyUltimate(
|
||||||
itemFk = item.id,
|
itemFk = item.id,
|
||||||
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
WAREHOUSEFK
|
WAREHOUSEFK
|
||||||
),
|
),
|
||||||
dated = LocalDate.now()
|
dated = LocalDate.now()
|
||||||
.format(
|
.format(
|
||||||
DateTimeFormatter.ofPattern("yyyy-dd-MM")
|
DateTimeFormatter.ofPattern("yyyy-dd-MM")
|
||||||
),
|
),
|
||||||
reportName = "LabelBuy",
|
reportName = "LabelBuy",
|
||||||
printerFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
printerFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
ConstAndValues.PRINTERFK
|
ConstAndValues.PRINTERFK
|
||||||
),
|
),
|
||||||
userFk = mobileApplication.userId!!,
|
userFk = mobileApplication.userId!!,
|
||||||
priority = "normal",
|
priority = "normal",
|
||||||
copies = copies,
|
copies = copies,
|
||||||
labelType = labelType,
|
labelType = labelType,
|
||||||
packing = packing
|
packing = packing
|
||||||
)
|
)
|
||||||
customDialogTwoButtons.dismiss()
|
customDialogTwoButtons.dismiss()
|
||||||
} else {
|
} else {
|
||||||
printItem(
|
printItem(
|
||||||
item.buyFk!!, labelType, packing, copies
|
item.buyFk!!, labelType, packing, copies
|
||||||
)
|
)
|
||||||
customDialogTwoButtons.dismiss()
|
customDialogTwoButtons.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customDialogInput.getEditText().requestFocus()
|
customDialogInput.getEditText().requestFocus()
|
||||||
}*/
|
}
|
||||||
//Tarea 7763
|
//Tarea 7763
|
||||||
/*
|
/*
|
||||||
.setOkButtonThree(getString(R.string.rename)) {
|
.setOkButtonThree(getString(R.string.rename)) {
|
||||||
|
@ -1162,7 +1166,12 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
),
|
),
|
||||||
userFk = mobileApplication.userId!!,
|
userFk = mobileApplication.userId!!,
|
||||||
priority = "normal",
|
priority = "normal",
|
||||||
params = """{'copies':$copies,'id':$id,'labelType':'$labelType','packing':$packing}"""
|
params = JSONObject().apply {
|
||||||
|
put("copies", copies)
|
||||||
|
put("id", id)
|
||||||
|
put("labelType", labelType)
|
||||||
|
put("packing", packing)
|
||||||
|
}.toString().replace("\"", "\\\"")
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ma.messageWithSound(message = ex.message.toString(), isError = true, isPlayed = true)
|
ma.messageWithSound(message = ex.message.toString(), isError = true, isPlayed = true)
|
||||||
|
@ -1198,8 +1207,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun customDialogTransferAction(item: ItemUbicador) {
|
private fun customDialogTransferAction(item: ItemUbicador) {
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
if (customDialogInput.getValue().isNotEmpty()) {/*tearea 6964*//*
|
||||||
/*tearea 6964*//*
|
|
||||||
viewModel.hasItemOlder(
|
viewModel.hasItemOlder(
|
||||||
shelvingFkIn = shelvingFk,
|
shelvingFkIn = shelvingFk,
|
||||||
shelvingFkOut = customDialogInput.getValue(),
|
shelvingFkOut = customDialogInput.getValue(),
|
||||||
|
|
|
@ -21,7 +21,9 @@ import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewer
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewerList
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewerList
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorListNew
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorListNew
|
||||||
|
import es.verdnatura.presentation.view.feature.ubicador.model.ShelvingItem
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.MakeMultiSalix
|
import es.verdnatura.presentation.view.feature.workermistake.model.MakeMultiSalix
|
||||||
|
import org.json.JSONObject
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
|
@ -43,6 +45,14 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val loadShelvingListNew: LiveData<Event<ItemUbicadorListNew>> =
|
val loadShelvingListNew: LiveData<Event<ItemUbicadorListNew>> =
|
||||||
_shelvingListNew.map { Event(it) }
|
_shelvingListNew.map { Event(it) }
|
||||||
|
|
||||||
|
private val _shelvingGet by lazy { MutableLiveData<ShelvingItem>() }
|
||||||
|
val loadShelvingGet: LiveData<Event<ShelvingItem>> =
|
||||||
|
_shelvingGet.map { Event(it) }
|
||||||
|
|
||||||
|
private val _imageConfig by lazy { MutableLiveData<String>() }
|
||||||
|
val loadImageConfig: LiveData<Event<String>> =
|
||||||
|
_imageConfig.map { Event(it) }
|
||||||
|
|
||||||
private val _shelvingListItemNewer by lazy { MutableLiveData<ItemShelvingNewerList>() }
|
private val _shelvingListItemNewer by lazy { MutableLiveData<ItemShelvingNewerList>() }
|
||||||
val loadShelvingListItemNewer: LiveData<Event<ItemShelvingNewerList>> =
|
val loadShelvingListItemNewer: LiveData<Event<ItemShelvingNewerList>> =
|
||||||
_shelvingListItemNewer.map { Event(it) }
|
_shelvingListItemNewer.map { Event(it) }
|
||||||
|
@ -85,63 +95,44 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
//Tarea 6869
|
//Tarea 6869
|
||||||
fun itemShelvingGet(
|
fun itemShelvingGet(
|
||||||
shelvingFk: String
|
shelvingCode: String
|
||||||
) {
|
) {
|
||||||
salix.shelvingGet(
|
salix.shelvingGet(
|
||||||
filter = """{
|
filter = """{
|
||||||
"fields":[
|
"fields":
|
||||||
"priority",
|
["priority","parkingFk","code","id"],
|
||||||
"parkingFk",
|
|
||||||
"code"
|
|
||||||
],
|
|
||||||
"include":[
|
"include":[
|
||||||
{
|
{"relation":"parking",
|
||||||
"relation":"parking",
|
"scope":{"fields":["code"]}},
|
||||||
"scope":{
|
{"relation":"itemShelving",
|
||||||
"fields":[
|
"scope":{"fields":["id","itemFk","visible","packing","grouping","isChecked","available","buyFk","shelvingFk"],
|
||||||
"code"
|
"include":
|
||||||
]
|
{"relation":"item",
|
||||||
}
|
"scope":{"fields":["name","longName","size"]}}}}],
|
||||||
},
|
"where":{"code":"$shelvingCode"}}""".trim()
|
||||||
{
|
).enqueue(
|
||||||
"relation":"itemShelving",
|
object : SalixCallback<ShelvingItem>(context) {
|
||||||
"scope":{
|
override fun onSuccess(response: Response<ShelvingItem>) {
|
||||||
"fields":[
|
_shelvingGet.value = response.body()
|
||||||
"id",
|
}
|
||||||
"itemFk",
|
|
||||||
"visible",
|
|
||||||
"packing",
|
|
||||||
"grouping",
|
|
||||||
"isChecked",
|
|
||||||
"available",
|
|
||||||
"buyFk"
|
|
||||||
],
|
|
||||||
"include":{
|
|
||||||
"relation":"item",
|
|
||||||
"scope":{
|
|
||||||
"fields":[
|
|
||||||
"name",
|
|
||||||
"longName",
|
|
||||||
"size"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"where":{
|
|
||||||
"code":"$shelvingFk"
|
|
||||||
}
|
|
||||||
}""".trim()
|
|
||||||
)
|
|
||||||
.enqueue(
|
|
||||||
object : SalixCallback<List<ItemUbicador>>(context) {
|
|
||||||
override fun onSuccess(response: Response<List<ItemUbicador>>) {
|
|
||||||
_shelvingListNew.value = response.body()?.let { ItemUbicadorListNew(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getImageConfig(
|
||||||
|
) {
|
||||||
|
salix.getImageConfig(
|
||||||
|
).enqueue(
|
||||||
|
object : SalixCallback<JsonObject>(context) {
|
||||||
|
override fun onSuccess(response: Response<JsonObject>) {
|
||||||
|
|
||||||
|
_imageConfig.value =
|
||||||
|
response.body()!!.entrySet().first().value.asString
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shelvingPriorityUpdate(
|
fun shelvingPriorityUpdate(
|
||||||
|
@ -340,7 +331,12 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_responseLogAdd.value = response.message()
|
_responseLogAdd.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseLogAdd.value = false
|
||||||
|
super.onError(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -472,7 +468,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun itemShelvingSelfConsumption(shelvingFk: String, itemFk: Int, quantity: Int) {
|
fun itemShelvingSelfConsumption(shelvingFk: String, itemFk: Number, quantity: Int) {
|
||||||
salix.itemShelvingSelfConsumption(
|
salix.itemShelvingSelfConsumption(
|
||||||
arrayListOf(
|
arrayListOf(
|
||||||
shelvingFk, itemFk, quantity
|
shelvingFk, itemFk, quantity
|
||||||
|
@ -544,7 +540,12 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
if (response.body() == null) _buyUltimateResponse.value = false
|
if (response.body() == null) _buyUltimateResponse.value = false
|
||||||
else {
|
else {
|
||||||
val params =
|
val params =
|
||||||
"""{'copies':$copies,'id':${response.body()},'labelType':'$labelType','packing':$packing}"""
|
JSONObject().apply {
|
||||||
|
put("copies", copies)
|
||||||
|
put("id", response.body())
|
||||||
|
put("labelType", labelType)
|
||||||
|
put("packing", packing)
|
||||||
|
}.toString().replace("\"", "\\\"")
|
||||||
printItem(
|
printItem(
|
||||||
reportName = reportName,
|
reportName = reportName,
|
||||||
printerFk = printerFk,
|
printerFk = printerFk,
|
||||||
|
|
Loading…
Reference in New Issue