feat reservas refs #6861

This commit is contained in:
Sergio De la torre 2024-08-07 11:53:21 +02:00
parent cf5d2e622c
commit 60bdd285bf
11 changed files with 111 additions and 186 deletions

View File

@ -41,7 +41,8 @@ data class ItemShelvingSaleSalix(
data class ItemShelvingSalix( data class ItemShelvingSalix(
var visible: Int, var visible: Int,
var packing: Int?, var packing: Int?,
var grouping: Int? var grouping: Int?,
var available : Int?
) )

View File

@ -13,6 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.SaleRowFragmentBinding import es.verdnatura.databinding.SaleRowFragmentBinding
import es.verdnatura.domain.ConstAndValues.PREITEMPICKERTEST
import es.verdnatura.domain.ConstAndValues.SACADOR import es.verdnatura.domain.ConstAndValues.SACADOR
import es.verdnatura.domain.toast import es.verdnatura.domain.toast
import es.verdnatura.presentation.common.OnMistakeClickListener import es.verdnatura.presentation.common.OnMistakeClickListener
@ -315,8 +316,9 @@ class SaleAdapterNew(
if (sale.isPicked == 1) { if (sale.isPicked == 1) {
contentLayout.setBackgroundColor( contentLayout.setBackgroundColor(
//lolass
getColor( getColor(
context!!, R.color.verdnatura_pumpkin_orange context!!, R.color.verdnatura_dark_sky_blue
) )
) )
} else { } else {
@ -328,6 +330,10 @@ class SaleAdapterNew(
} }
binding.itemParkingCode.text = if (type == PREITEMPICKERTEST)
sale.parkingCodePrevia else sale.parkingCode
this.sale = sale this.sale = sale
} }

View File

@ -19,8 +19,8 @@ import com.google.gson.Gson
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentCollectionNewBinding import es.verdnatura.databinding.FragmentCollectionNewBinding
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
import es.verdnatura.domain.ConstAndValues.PRESACADOR
import es.verdnatura.domain.ConstAndValues.PRINTERNAME import es.verdnatura.domain.ConstAndValues.PRINTERNAME
import es.verdnatura.domain.ConstAndValues.SACADOR
import es.verdnatura.domain.ConstAndValues.SECTORFK import es.verdnatura.domain.ConstAndValues.SECTORFK
import es.verdnatura.domain.notNull import es.verdnatura.domain.notNull
import es.verdnatura.domain.toast import es.verdnatura.domain.toast
@ -58,7 +58,7 @@ import org.json.JSONObject
@Suppress("UNUSED_ANONYMOUS_PARAMETER") @Suppress("UNUSED_ANONYMOUS_PARAMETER")
class CollectionFragmentPickerPreviousNew( class CollectionFragmentPickerPreviousNew(
var collection: CollectionTicket, var collection: CollectionTicket,
var type: String = SACADOR, var type: String = PRESACADOR,
private var hasPickingOrder: Boolean = false private var hasPickingOrder: Boolean = false
) : BaseFragment<FragmentCollectionNewBinding, CollectionViewModel>( ) : BaseFragment<FragmentCollectionNewBinding, CollectionViewModel>(
CollectionViewModel::class CollectionViewModel::class
@ -520,11 +520,11 @@ class CollectionFragmentPickerPreviousNew(
} }
} }
sales = salesList.sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk }) sales = salesList.sortedWith(compareBy<Sale> { it.pickingOrderPrevia }.thenBy { it.itemFk })
//quitar comentarios FALTA AGRUPAR LAS PREVIAS //quitar comentarios FALTA AGRUPAR LAS PREVIAS
myGroupList = myGroupList =
salesList.sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk }) salesList.sortedWith(compareBy<Sale> { it.pickingOrderPrevia }.thenBy { it.itemFk })
// sales //sales porque no se ggrupan las previas hay que cambiar los estados. // sales //sales porque no se ggrupan las previas hay que cambiar los estados.
saleAdapter = SaleAdapterNew( saleAdapter = SaleAdapterNew(

View File

@ -7,7 +7,7 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.Calendar
fun CollectionVO.map(context: Context): CollectionVO { fun CollectionVO.map(context: Context): CollectionVO {
try { try {
@ -69,8 +69,9 @@ fun CollectionTicket.map(context: Context): CollectionTicket {
this.tickets.forEach { ticket -> this.tickets.forEach { ticket ->
ticket.sales.forEach { ticket.sales.forEach {
it.level = ticket.level it.level = ticket.level?:""
it.rgb = ticket.rgb}} it.rgb = ticket.rgb?:""}
}
} catch (e: Exception) { } catch (e: Exception) {
this.isError = true this.isError = true
@ -79,7 +80,7 @@ fun CollectionTicket.map(context: Context): CollectionTicket {
} else { } else {
this.errorMessage = this.errorMessage =
context.getString(R.string.collectionErrorBuilding) + e.message.toString() context.getString(R.string.collectionErrorBuilding) + ".Revisa el sector por si acaso"
} }
} }

View File

@ -76,8 +76,8 @@ class InitPreSacadorFragment(
iconPrint.setImageResource(R.drawable.ic_print_black_24dp) iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
iconAdd.setImageResource(R.drawable.ic_add_black_24dp) iconAdd.setImageResource(R.drawable.ic_add_black_24dp)
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp) iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp) iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
listIcons.add(iconAdd) listIcons.add(iconAdd)
@ -87,7 +87,19 @@ class InitPreSacadorFragment(
when (item) { when (item) {
iconAdd.drawable -> { iconAdd.drawable -> {
viewModel.sectorCollection_new(mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK)) if (mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK) != -1) {
viewModel.sectorCollection_new(
mobileApplication.dataStoreApp.readDataStoreKey(
SECTORFK
)
)
} else {
ma.messageWithSound(
message = getString(R.string.errorSector),
isError = true,
isPlayed = true
)
}
} }
iconPrint.drawable -> { iconPrint.drawable -> {
@ -103,7 +115,9 @@ class InitPreSacadorFragment(
private fun print() { private fun print() {
if (ma.havePrinter()) { if (ma.havePrinter()) {
viewModel.ticketPrintLabelPrevious(customDialogInput.getValue().toInt()) viewModel.ticketPrintLabelPrevious(customDialogInput.getValue().toInt())
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(PRINTERNAME)).toast( (getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
PRINTERNAME
)).toast(
requireContext() requireContext()
) )
} else { } else {

View File

@ -179,9 +179,9 @@ class SectorCollectionReserveFragment(
).toString() ).toString()
) )
if (listSalesGroup.firstOrNull { it.code == customDialogList.getValue() } == null) { if (listSalesGroup.firstOrNull { it.code == customDialogList.getValue() } == null) {
listSalesGroup.add(BarcodeVO(code = customDialogList.getValue()))
viewModel.sectorCollectionSaleGroupAdd( viewModel.sectorCollectionSaleGroupAdd(
customDialogList.getValue().toInt(), collectionFk customDialogList.getValue().toInt(), collectionFk,
) )
} else { } else {
throw Exception(getString(R.string.ticketScanned)) throw Exception(getString(R.string.ticketScanned))
@ -265,7 +265,7 @@ class SectorCollectionReserveFragment(
with(viewModel) { with(viewModel) {
loadResponseSaleGropAdd.observe(viewLifecycleOwner) { event -> loadResponseSaleGroupAdd.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
if (it.isError) { if (it.isError) {
@ -296,6 +296,15 @@ class SectorCollectionReserveFragment(
} }
} }
} }
loadResponseSaleGropAdded.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
ma.messageWithSound(
message = "", isError = false, isPlayed = true, isToasted = false
)
listSalesGroup.add(BarcodeVO(code = it.toString()))
listSaleGroupAdapter!!.notifyItemInserted(listSalesGroup.size -1 )
}
}
loadResponseReserveSectorCollection.observe(viewLifecycleOwner) { event -> loadResponseReserveSectorCollection.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {

View File

@ -51,7 +51,9 @@ data class Sale(
var reservedQuantity: Int = 0, var reservedQuantity: Int = 0,
val code: String? = null, val code: String? = null,
val parkingCode: String? = null, val parkingCode: String? = null,
val parkingCodePrevia: String? = null,
val pickingOrder: Int? = null, val pickingOrder: Int? = null,
val pickingOrderPrevia: Int? = null,
var sonSales: MutableList<Sale> = mutableListOf(), var sonSales: MutableList<Sale> = mutableListOf(),
var placements: List<PlacementVO> = listOf(), var placements: List<PlacementVO> = listOf(),
var Barcodes: List<String> = listOf(), var Barcodes: List<String> = listOf(),
@ -278,109 +280,6 @@ class MistakeTypeListVO(
var list: List<MistakeTypeVO> = listOf() var list: List<MistakeTypeVO> = listOf()
) )
val barcodes = listOf("12345678", "87654321", "11111111", "00000000")
val sale1 = Sale(
13421890, 4475590, null, 42272072, 24460, "Lilium Oriental Signum 4", 90, null,
"Blanco", "Bakker Lilies", "NLD", "LO Signum 4", 120, 10, 0, 24981,
false, 10, 100, 10, null, null, 6,
)
val sale2 = Sale(
13421889, 4474654, null, 42263590, 61148, "Paniculata Rainbow MA 40 gr", 75, null,
"Mixto", "Malima", "ECU", "PAN Rainbow MA 40 gr", 250, 25, 0, 24981,
false, 25, 250, 30, null, null, 5
)
val sale3 = Sale(
13421888, 4475611, null, 42272185, 56628, "Lilium Oriental A2 Roselily 2", 70, null,
"Mixto", "Moerman Lilium BV", "NLD", "LO A2 Roselily 2", 40, 10, 0, 24981,
false, 80, 800, 20, null, null, 4
)
val sale4 = Sale(
13421887, 4475611, null, 42272186, 34087, "Lilium Asiatico Brindisi 4-5", 95, null,
"Rosa", "Double Check Lily", "NLD", "LA Brindisi 4-5", 60, 10, 0, 24981,
false, 60, 600, 10, null, null, 3
)
val sale5 = Sale(
13421886, 4474654, null, 42263585, 77582, "Clavel Red Fancy", 60, "2",
"Rojo", "Daliaflora", "COL", "CL Red FCY", 15, 25, 0, 24981,
true, 250, 250, 30, "KQS", "GA-24-3", 1, Barcodes = barcodes
)
val sale6 = Sale(
13421885, 4474654, null, 42263588, 117832, "Rosa Freedom", 50, "1",
"Rojo", "Multiflora", "COL", "RS Freedom", 200, 25, 0, 24981,
true, 25, 250, 25, "IXF", "B-29-1", 2
)
val sale7 = Sale(
13421898, 4475590, 222154, 42272074, 10067, "Brillo Floralife", 10, "3",
"Negro", null, "---", "Brillo Floralife", 12, 1, 0, 24981,
false, 3, 30, 30, null, "CH--43", 121930
)
val sale8 = Sale(
13421883, 4475557, 222152, 42271653, 103803, "Bolsa Kraft Blanco", 1, null,
"Blanco", null, "NLD", "Bolsa Kraft Blanco", 250, 25, 0, 24981,
false, 25, 250, 250, null, "CH--43", 121930
)
val listaDeSales: MutableList<Sale> = mutableListOf(sale1, sale7) // 4475590
val listaDeSales2: MutableList<Sale> = mutableListOf(sale2, sale5, sale6) //4474654
val listaDeSales3: MutableList<Sale> = mutableListOf(sale3, sale4) //4475611
val listaDeSales4: MutableList<Sale> = mutableListOf(sale8) //4475557
var ticketLocal = mutableListOf(
Ticket(
4475590,
"ROJO",
"#ff0000",
"VIAEXPRESS Interdia",
4994,
"",
60,
sales = listaDeSales
),
Ticket(
4474654,
"AMARILLO",
"#ffce30",
"MRW ECOM-TARDE",
4994,
"En agua",
60,
sales = listaDeSales2
),
Ticket(
4475611,
"VERDE",
"#008000",
"MRW ECOM-TARDE",
6264,
"En seco",
60,
sales = listaDeSales3
),
Ticket(
4475557,
"ROJO",
"#ff0000",
"VIAEXPRESS Interdia",
4994,
"",
60,
sales = listaDeSales4
),
)
var collectionLocal = CollectionTicket(
895071,
"2023-09-20",
3,
tickets = ticketLocal
)
class TicketStateList( class TicketStateList(
var list: List<TicketStateSalix> = listOf() var list: List<TicketStateSalix> = listOf()
) )

View File

@ -127,7 +127,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()
} }
@ -204,7 +204,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
if (!isOnlyIconAdd) { if (!isOnlyIconAdd) {
listIcons.add(iconReload) listIcons.add(iconReload)
} }
//Tarea7805 //Tarea7805
// locateMultipleShelvings = isOnlyIconAdd // locateMultipleShelvings = isOnlyIconAdd
binding.mainToolbar.toolbarIcons.adapter = binding.mainToolbar.toolbarIcons.adapter =
@ -272,9 +272,8 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
if (binding.editMatricula.text.toString().isNotEmpty()) { if (binding.editMatricula.text.toString().isNotEmpty()) {
setIconsActions(true) setIconsActions(true)
setIcons() setIcons()
if (!modeCheckUbication || (modeCheckUbication if (!modeCheckUbication || (modeCheckUbication && (binding.editMatricula.text.toString()
&& (binding.editMatricula.text.toString().isShelving()) .isShelving()) && !binding.editMatricula.text!![0].isDigit())
&& !binding.editMatricula.text!![0].isDigit())
) { ) {
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text =
binding.editMatricula.text.toString() binding.editMatricula.text.toString()
@ -295,9 +294,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
) )
} catch (ex: Exception) { } catch (ex: Exception) {
ma.messageWithSound( ma.messageWithSound(
ex.message.toString(), ex.message.toString(), isError = true, isPlayed = true
isError = true,
isPlayed = true
) )
} }
@ -331,10 +328,9 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
binding.automaticImg.setOnClickListener { binding.automaticImg.setOnClickListener {
if (shelvingFk.isNotBlank()) if (shelvingFk.isNotBlank()) ma.onPasillerosItemClickListener(
ma.onPasillerosItemClickListener( PasillerosItemVO(title = getString(R.string.titleAuto)), entryPoint = shelvingFk
PasillerosItemVO(title = getString(R.string.titleAuto)), entryPoint = shelvingFk )
)
else getString(R.string.scanShelving).toast( else getString(R.string.scanShelving).toast(
requireActivity(), Toast.LENGTH_SHORT requireActivity(), Toast.LENGTH_SHORT
) )
@ -420,7 +416,10 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
listItems.forEach { listItems.forEach {
it.stickers = 0 it.stickers = 0
it.visible = 0 it.visible = 0
it.available = 0
} }
if (adapter != null) { if (adapter != null) {
adapter!!.notifyDataSetChanged() adapter!!.notifyDataSetChanged()
} }
@ -475,11 +474,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
item.checked = true item.checked = true
listInt.add(item.item) listInt.add(item.item)
ma.messageWithSound( ma.messageWithSound(
"", "", isError = false, isPlayed = true, titleWithError = "", false
isError = false,
isPlayed = true,
titleWithError = "",
false
) )
} }
} }
@ -585,20 +580,15 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
} }
val resultString = formattedList.joinToString(separator = "\n") val resultString = formattedList.joinToString(separator = "\n")
val finalOutput = "\n$resultString" val finalOutput = "\n$resultString"
customDialogOlder.setTitle(getString(R.string.info)) customDialogOlder.setTitle(getString(R.string.info)).setDescription(
.setDescription(
getString( getString(
R.string.itemOlderInfo, R.string.itemOlderInfo, Action.PARKINEAR
Action.PARKINEAR ) + getString(R.string.listItems) + finalOutput
) ).setOkButton(
+ getString(R.string.listItems) + finalOutput
)
.setOkButton(
getString(R.string.ok) getString(R.string.ok)
) { ) {
viewModel.setParking( viewModel.setParking(
it.originalShelvingFk, it.originalShelvingFk, it.originalParking
it.originalParking
) )
customDialogOlder.dismiss() customDialogOlder.dismiss()
@ -614,20 +604,16 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
loadResponseHasOlder.observe(viewLifecycleOwner) { event -> loadResponseHasOlder.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
customDialogOlder.setTitle(getString(R.string.info)) customDialogOlder.setTitle(getString(R.string.info)).setDescription(
.setDescription(
getString( getString(
R.string.itemOlderInfo, R.string.itemOlderInfo, responseHasOlder.value!!.action
responseHasOlder.value!!.action
) )
) ).setOkButton(
.setOkButton(
getString(R.string.ok) getString(R.string.ok)
) { ) {
when (responseHasOlder.value!!.action) { when (responseHasOlder.value!!.action) {
Action.PARKINEAR -> viewModel.setParking( Action.PARKINEAR -> viewModel.setParking(
responseHasOlder.value!!.shelvingFkIn, responseHasOlder.value!!.shelvingFkIn, parking
parking
) )
Action.TRANSFERIR -> viewModel.itemShelvingTransfer( Action.TRANSFERIR -> viewModel.itemShelvingTransfer(
@ -758,8 +744,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
} else { } else {
"0" "0"
} }
) ).setOkButton(getString(R.string.save)) {
.setOkButton(getString(R.string.save)) {
setShowAddItemAction(itemUbicador) setShowAddItemAction(itemUbicador)
}.setKoButton(getString(R.string.close)) { }.setKoButton(getString(R.string.close)) {
customDialogUbicador.dismiss() customDialogUbicador.dismiss()
@ -773,8 +758,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
}.show() }.show()
} }
customDialogUbicador.getEditItem() customDialogUbicador.getEditItem().setOnEditorActionListener { v, actionId, event ->
.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (customDialogUbicador.getItemValue().isNotEmpty()) { if (customDialogUbicador.getItemValue().isNotEmpty()) {
@ -782,17 +766,13 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
customDialogUbicador.setItemValue( customDialogUbicador.setItemValue(
itemScanValue( itemScanValue(
customDialogUbicador.getItemValue(), customDialogUbicador.getItemValue(), arrayOf("buy"), "more"
arrayOf("buy"),
"more"
).toString() ).toString()
) )
} catch (ex: Exception) { } catch (ex: Exception) {
ma.messageWithSound( ma.messageWithSound(
ex.message.toString(), ex.message.toString(), isError = true, isPlayed = true
isError = true,
isPlayed = true
) )
customDialogUbicador.setItemValue("") customDialogUbicador.setItemValue("")
} }
@ -836,13 +816,12 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
if (itemUbicador?.id == null) { if (itemUbicador?.id == null) {
//item nuevo sin shelving //item nuevo sin shelving
try { try {
if (locateMultipleShelvings) if (locateMultipleShelvings) insertShelvingsForUbicator(
insertShelvingsForUbicator( customDialogUbicador.getItemValue().toLong(),
customDialogUbicador.getItemValue().toLong(), customDialogUbicador.getVisibleValue().toInt(),
customDialogUbicador.getVisibleValue().toInt(), customDialogUbicador.getPackingValue().toIntOrNull()
customDialogUbicador.getPackingValue().toIntOrNull()
) else { ) else {
viewModel.itemShelvingAdd( viewModel.itemShelvingAdd(
shelving = shelvingFk, shelving = shelvingFk,
item = customDialogUbicador.getItemValue().toLong(), item = customDialogUbicador.getItemValue().toLong(),
@ -866,12 +845,25 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
customDialogUbicador.getVisibleValue().toIntOrNull()!!, customDialogUbicador.getVisibleValue().toIntOrNull()!!,
customDialogUbicador.getPackingValue().toInt(), customDialogUbicador.getPackingValue().toInt(),
itemUbicador.id, itemUbicador.id,
itemUbicador.grouping itemUbicador.grouping,
updateAvailable(
itemUbicador.available,
customDialogUbicador.getVisibleValue().toIntOrNull(),
itemUbicador.visible
)
) )
} }
} }
private fun updateAvailable(newAvailable: Int?, newVisible: Int?, oldVisible: Int?): Int {
val available = newAvailable ?: 0
val visible = newVisible ?: 0
val old = oldVisible ?: 0
return maxOf(available + visible - old, 0)
}
private fun insertShelvingsForUbicator(barCode: Number, visible: Int, packing: Int?) { private fun insertShelvingsForUbicator(barCode: Number, visible: Int, packing: Int?) {
customDialogList = CustomDialogList(requireContext()) customDialogList = CustomDialogList(requireContext())
@ -910,15 +902,12 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
try { try {
customDialogList.setValue( customDialogList.setValue(
itemScanValue( itemScanValue(
customDialogList.getValue(), customDialogList.getValue(), arrayOf("saleGroup"), field = "id"
arrayOf("saleGroup"),
field = "id"
).toString() ).toString()
) )
if (customDialogList.getValue().isShelving()) { if (customDialogList.getValue().isShelving()) {
if (listShelvings.firstOrNull { it.code == customDialogList.getValue() } == null) { if (listShelvings.firstOrNull { it.code == customDialogList.getValue() } == null) {
listShelvings.add(BarcodeVO(code = customDialogList.getValue())) listShelvings.add(BarcodeVO(code = customDialogList.getValue()))/*viewModel.sectorCollectionSaleGroupAdd(
/*viewModel.sectorCollectionSaleGroupAdd(
customDialogList.getValue().toInt(), collectionFk customDialogList.getValue().toInt(), collectionFk
)*/ )*/
} else { } else {
@ -1104,9 +1093,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*//*viewModel.hasItemOlder(
/*tearea 6964*/
/*viewModel.hasItemOlder(
shelvingFkIn = shelvingFk, shelvingFkIn = shelvingFk,
shelvingFkOut = customDialogInput.getValue(), shelvingFkOut = customDialogInput.getValue(),
itemFk = item.id, itemFk = item.id,

View File

@ -57,6 +57,7 @@ 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 _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) }
@ -204,11 +205,11 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
} }
fun itemShelvingMakeEdit( fun itemShelvingMakeEdit(
quantity: Int, packing: Int?, itemShelvingFk: Int, grouping: Int? quantity: Int, packing: Int?, itemShelvingFk: Int, grouping: Int?, available : Int?
) { ) {
salix.itemShelvingUpdate( salix.itemShelvingUpdate(
params = ItemShelvingSalix(visible = quantity, packing = packing, grouping = grouping), params = ItemShelvingSalix(visible = quantity, packing = packing, grouping = grouping, available = available),
id = itemShelvingFk, id = itemShelvingFk,
).enqueue(object : SalixCallback<ItemUbicador?>(context) { ).enqueue(object : SalixCallback<ItemUbicador?>(context) {
override fun onSuccess(response: Response<ItemUbicador?>) { override fun onSuccess(response: Response<ItemUbicador?>) {
@ -227,7 +228,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
params = ItemShelvingSalix( params = ItemShelvingSalix(
visible = 0, visible = 0,
packing = item.packing, packing = item.packing,
grouping = item.grouping grouping = item.grouping,
available = item.available
), ),
id = item.id, id = item.id,
).enqueue(object : SalixCallback<ItemUbicador?>(context) { ).enqueue(object : SalixCallback<ItemUbicador?>(context) {
@ -363,13 +365,16 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
} }
fun clearShelvingList( fun clearShelvingList(
shelvingFk: String shelvingFk: String,
) { ) {
salix.itemShelvingsUpdate( salix.itemShelvingsUpdate(
where = JsonObject().apply { addProperty("shelvingFk", shelvingFk) }, where = JsonObject().apply { addProperty("shelvingFk", shelvingFk) },
hashMapOf("visible" to 0) JsonObject().apply {
addProperty("visible", 0)
addProperty("available", 0)
}
).enqueue(object : SalixCallback<Any>(context) { ).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) { override fun onSuccess(response: Response<Any>) {
@ -379,6 +384,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}) })
} }
fun updateIsChecked( fun updateIsChecked(
itemShelvingFk: Int itemShelvingFk: Int

View File

@ -27,6 +27,7 @@ class ItemUbicador(
var stickers: Int = 0, var stickers: Int = 0,
var packing: Int? = null, var packing: Int? = null,
var grouping: Int? = null, var grouping: Int? = null,
var available: Int? = null,
var code: String? = "", var code: String? = "",
var created:String? = null, var created:String? = null,
var shelvingFk: String? = null, var shelvingFk: String? = null,

View File

@ -185,7 +185,7 @@
android:layout_marginEnd="@dimen/layout_margin_min" android:layout_marginEnd="@dimen/layout_margin_min"
android:layout_weight="0.5" android:layout_weight="0.5"
android:maxLines="1" android:maxLines="1"
android:text="@{sale.parkingCode}" android:text=""
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/bodyPicker" android:textSize="@dimen/bodyPicker"
android:textStyle="bold" android:textStyle="bold"