feat: refs #7920 itemShelvingGet
This commit is contained in:
parent
a1c01d1154
commit
f16bb64b49
|
@ -38,8 +38,6 @@ 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 org.json.JSONObject
|
||||||
import java.time.LocalDate
|
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
|
|
||||||
class ItemCardFragment(
|
class ItemCardFragment(
|
||||||
var itemFk: String = ""
|
var itemFk: String = ""
|
||||||
|
@ -59,7 +57,7 @@ class ItemCardFragment(
|
||||||
private var quantityToDiscard = 0
|
private var quantityToDiscard = 0
|
||||||
private var itemInfoG: ItemCardVO? = null
|
private var itemInfoG: ItemCardVO? = null
|
||||||
private var positionToReturnY = 0
|
private var positionToReturnY = 0
|
||||||
private var originalScan: String? = null
|
private var originalScan: Long? = null
|
||||||
private var buyToPrint: Long? = null
|
private var buyToPrint: Long? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -216,9 +214,9 @@ class ItemCardFragment(
|
||||||
try {
|
try {
|
||||||
originalScan = itemScanValue(
|
originalScan = itemScanValue(
|
||||||
binding.editItemFk.text.toString(), arrayOf("buy"), "more"
|
binding.editItemFk.text.toString(), arrayOf("buy"), "more"
|
||||||
).toString()
|
).toString().toLong()
|
||||||
getItemCard(
|
getItemCard(
|
||||||
originalScan!!
|
originalScan!!.toString()
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
|
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
|
||||||
|
@ -268,13 +266,11 @@ class ItemCardFragment(
|
||||||
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.buyGetLastWithoutInventory(
|
||||||
itemFk = it.id,
|
itemFk = it.id,
|
||||||
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
WAREHOUSEFK
|
WAREHOUSEFK
|
||||||
),
|
)
|
||||||
dated = LocalDate.now()
|
|
||||||
.format(DateTimeFormatter.ofPattern("yyyy-dd-MM"))
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
buyToPrint = originalScan!!.toLong()
|
buyToPrint = originalScan!!.toLong()
|
||||||
|
|
|
@ -239,10 +239,15 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buyUltimate(
|
fun buyGetLastWithoutInventory(
|
||||||
itemFk: Int, warehouseFk: Int, dated: String
|
itemFk: Int, warehouseFk: Int,
|
||||||
) {
|
) {
|
||||||
salix.buyUltimate(params = arrayListOf(itemFk, warehouseFk, dated).formatWithQuotes())
|
salix.buyGetLastWithoutInventory(
|
||||||
|
params = arrayListOf(
|
||||||
|
itemFk,
|
||||||
|
warehouseFk
|
||||||
|
).formatWithQuotes()
|
||||||
|
)
|
||||||
.enqueue(object : SalixCallback<Long>(context) {
|
.enqueue(object : SalixCallback<Long>(context) {
|
||||||
override fun onSuccess(response: Response<Long>) {
|
override fun onSuccess(response: Response<Long>) {
|
||||||
_buyUltimateResponse.value = response.body()
|
_buyUltimateResponse.value = response.body()
|
||||||
|
|
Loading…
Reference in New Issue