refs #5890 feat:itemShelving
This commit is contained in:
parent
24d1ccdd9b
commit
b759d8a3dd
|
@ -30,7 +30,7 @@ class SaleAdapterNew(
|
||||||
private val onMistakeClickListener: OnMistakeClickListener,
|
private val onMistakeClickListener: OnMistakeClickListener,
|
||||||
private val onPackingClick: OnPackingClickSaleListener,
|
private val onPackingClick: OnPackingClickSaleListener,
|
||||||
private var onTicketClick: OnTicketClickSaleListener? = null,
|
private var onTicketClick: OnTicketClickSaleListener? = null,
|
||||||
private var SaleAdapter: SaleAdapterNew? = null,
|
private var saleAdapter: SaleAdapterNew? = null,
|
||||||
private var type: String? = null,
|
private var type: String? = null,
|
||||||
|
|
||||||
) : RecyclerView.Adapter<SaleAdapterNew.AjustesItemHolder>() {
|
) : RecyclerView.Adapter<SaleAdapterNew.AjustesItemHolder>() {
|
||||||
|
@ -46,9 +46,7 @@ class SaleAdapterNew(
|
||||||
return AjustesItemHolder(
|
return AjustesItemHolder(
|
||||||
|
|
||||||
SaleRowFragmentBinding.inflate(
|
SaleRowFragmentBinding.inflate(
|
||||||
LayoutInflater.from(parent.context),
|
LayoutInflater.from(parent.context), parent, false
|
||||||
parent,
|
|
||||||
false
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -65,8 +63,7 @@ class SaleAdapterNew(
|
||||||
) : RecyclerView.ViewHolder(binding.root) {
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
fun bind(sale: Sale) {
|
fun bind(sale: Sale) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
if (sale.reservedQuantity == null)
|
if (sale.reservedQuantity == null) sale.reservedQuantity = 0
|
||||||
sale.reservedQuantity = 0
|
|
||||||
|
|
||||||
val childLayoutManager =
|
val childLayoutManager =
|
||||||
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
||||||
|
@ -88,7 +85,8 @@ class SaleAdapterNew(
|
||||||
|
|
||||||
|
|
||||||
packingTopicker.setOnClickListener {
|
packingTopicker.setOnClickListener {
|
||||||
//onQuantityClick.onQuantityClick(sale)
|
// Solo se cambia la cantidad al cogerla no al pulsar !!
|
||||||
|
// onQuantityClick.onQuantityClick(sale)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,17 +126,20 @@ class SaleAdapterNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
//ERROR
|
//ERROR
|
||||||
if (sale.originalQuantity != sale.saleQuantity && sale.originalQuantity != null) {
|
println("Sacador sale item ${sale.itemFk} sale ${sale.saleFk} cantidad ${sale.saleQuantity} original ${sale.originalQuantity}")
|
||||||
|
|
||||||
|
if (sale.originalQuantity != sale.saleQuantity && sale.originalQuantity != null && !sale.isParent) {
|
||||||
layoutError.visibility = View.VISIBLE
|
layoutError.visibility = View.VISIBLE
|
||||||
txtError.text =
|
txtError.text =
|
||||||
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity!!
|
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity!!
|
||||||
|
|
||||||
|
}else{
|
||||||
|
layoutError.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sale.isAdded == 1) {
|
if (sale.isAdded == 1) {
|
||||||
layoutError.visibility = View.VISIBLE
|
layoutError.visibility = View.VISIBLE
|
||||||
txtError.text = binding.root.context.getString(R.string.newItem)
|
txtError.text = binding.root.context.getString(R.string.newItem)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paintTicketcolor(sale.rgb, itemTicketColor, sale.isPicked)
|
paintTicketcolor(sale.rgb, itemTicketColor, sale.isPicked)
|
||||||
|
@ -148,8 +149,6 @@ class SaleAdapterNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isExpanded) {
|
if (isExpanded) {
|
||||||
itemArticlePlacements.visibility = View.VISIBLE
|
itemArticlePlacements.visibility = View.VISIBLE
|
||||||
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
||||||
|
@ -163,8 +162,7 @@ class SaleAdapterNew(
|
||||||
View.GONE
|
View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sale.isParent) {
|
if (sale.isParent) {/* itemArticleItemFk.visibility = View.INVISIBLE
|
||||||
/* itemArticleItemFk.visibility = View.INVISIBLE
|
|
||||||
itemPackingText.visibility = View.INVISIBLE
|
itemPackingText.visibility = View.INVISIBLE
|
||||||
itemPackingItemFk.visibility = View.INVISIBLE
|
itemPackingItemFk.visibility = View.INVISIBLE
|
||||||
itemArticleCel1.visibility = View.INVISIBLE
|
itemArticleCel1.visibility = View.INVISIBLE
|
||||||
|
@ -174,11 +172,14 @@ class SaleAdapterNew(
|
||||||
txtdeNew.visibility = View.INVISIBLE
|
txtdeNew.visibility = View.INVISIBLE
|
||||||
itemArticleQuantityPicked.visibility = View.INVISIBLE
|
itemArticleQuantityPicked.visibility = View.INVISIBLE
|
||||||
itemArticleQuantityLine3.visibility = View.VISIBLE*/
|
itemArticleQuantityLine3.visibility = View.VISIBLE*/
|
||||||
|
packingTopicker.visibility = View.INVISIBLE
|
||||||
|
quantityReserved.visibility = View.INVISIBLE
|
||||||
|
itemArticleItemFkNew.visibility = View.INVISIBLE
|
||||||
|
|
||||||
imageErrorMessage.visibility = View.INVISIBLE
|
imageErrorMessage.visibility = View.INVISIBLE
|
||||||
ivArrow.visibility = View.VISIBLE
|
ivArrow.visibility = View.VISIBLE
|
||||||
|
|
||||||
} else {
|
} else {/*itemArticleItemFk.visibility = View.VISIBLE
|
||||||
/*itemArticleItemFk.visibility = View.VISIBLE
|
|
||||||
itemPackingText.visibility = View.VISIBLE
|
itemPackingText.visibility = View.VISIBLE
|
||||||
itemPackingItemFk.visibility = View.VISIBLE
|
itemPackingItemFk.visibility = View.VISIBLE
|
||||||
itemArticleCel1.visibility = View.VISIBLE
|
itemArticleCel1.visibility = View.VISIBLE
|
||||||
|
@ -236,7 +237,8 @@ class SaleAdapterNew(
|
||||||
previous.visibility = View.INVISIBLE
|
previous.visibility = View.INVISIBLE
|
||||||
} else {
|
} else {
|
||||||
previous.visibility = View.VISIBLE
|
previous.visibility = View.VISIBLE
|
||||||
previous.text = "${previous.text} ${sale.saleGroupFk}"
|
// previous.text =""
|
||||||
|
previous.text = "PREV:"+ sale.saleGroupFk
|
||||||
}
|
}
|
||||||
|
|
||||||
var result: Int
|
var result: Int
|
||||||
|
@ -303,15 +305,13 @@ class SaleAdapterNew(
|
||||||
if (sale.isPicked == 1) {
|
if (sale.isPicked == 1) {
|
||||||
contentLayout.setBackgroundColor(
|
contentLayout.setBackgroundColor(
|
||||||
getColor(
|
getColor(
|
||||||
context!!,
|
context!!, R.color.verdnatura_pumpkin_orange
|
||||||
R.color.verdnatura_pumpkin_orange
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
contentLayout.setBackgroundColor(
|
contentLayout.setBackgroundColor(
|
||||||
getColor(
|
getColor(
|
||||||
context!!,
|
context!!, R.color.verdnatura_black
|
||||||
R.color.verdnatura_black
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.gson.Gson
|
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
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
||||||
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
||||||
import es.verdnatura.domain.ConstAndValues.PRINTERNAME
|
import es.verdnatura.domain.ConstAndValues.PRINTERNAME
|
||||||
|
@ -563,6 +562,9 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
sales = salesList.sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
sales = salesList.sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
||||||
|
|
||||||
|
for (s in sales) {
|
||||||
|
println("Sacador sale: ${s.saleFk} saleGRoup: ${s.saleGroupFk} item : ${s.itemFk}")
|
||||||
|
}
|
||||||
//quitar comentarios FALTA AGRUPAR LAS PREVIAS
|
//quitar comentarios FALTA AGRUPAR LAS PREVIAS
|
||||||
myGroupList =
|
myGroupList =
|
||||||
groupSaleGroup(salesList).sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
groupSaleGroup(salesList).sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
||||||
|
@ -642,9 +644,11 @@ class CollectionFragmentPickerNew(
|
||||||
var entryPoint = Gson().toJson(
|
var entryPoint = Gson().toJson(
|
||||||
mutableMapOf(
|
mutableMapOf(
|
||||||
"entryPoint" to sale.ticketFk,
|
"entryPoint" to sale.ticketFk,
|
||||||
"web" to "${ mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
"web" to "${
|
||||||
BASEURLSALIX
|
mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
)}/#!/ticket/${sale.ticketFk}/sale"
|
BASEURLSALIX
|
||||||
|
)
|
||||||
|
}/#!/ticket/${sale.ticketFk}/sale"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
ma.onPasillerosItemClickListener(
|
ma.onPasillerosItemClickListener(
|
||||||
|
@ -674,7 +678,6 @@ class CollectionFragmentPickerNew(
|
||||||
RecyclerView.OnScrollListener() {
|
RecyclerView.OnScrollListener() {
|
||||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||||
storedBackPosition = lm.findFirstVisibleItemPosition()
|
storedBackPosition = lm.findFirstVisibleItemPosition()
|
||||||
|
|
||||||
super.onScrolled(recyclerView, dx, dy)
|
super.onScrolled(recyclerView, dx, dy)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -923,6 +926,7 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
if (quantityToReserve == totalReserved) {
|
if (quantityToReserve == totalReserved) {
|
||||||
originalItemScan = customDialogList.getValueTwo().toLong()
|
originalItemScan = customDialogList.getValueTwo().toLong()
|
||||||
|
println("Sacador a checkItemScan")
|
||||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||||
|
|
||||||
onQuantityOfShelvingSelected(
|
onQuantityOfShelvingSelected(
|
||||||
|
@ -954,9 +958,10 @@ class CollectionFragmentPickerNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkItemScan(valueToCheck: String): Boolean {
|
private fun checkItemScan(valueToCheck: String): Boolean {
|
||||||
|
println("Sacador valor a checkear ${valueToCheck}")
|
||||||
if (storedPosition >= 0 && sales.size > storedPosition) {
|
if (storedPosition >= 0 && sales.size > storedPosition) {
|
||||||
val saleToCheck = sales[storedPosition]
|
val saleToCheck = myGroupList[storedPosition]
|
||||||
|
println("Sacador valor de la sale a checkear ${saleToCheck}")
|
||||||
if (saleToCheck.itemFk.toString() == valueToCheck) return true
|
if (saleToCheck.itemFk.toString() == valueToCheck) return true
|
||||||
else {
|
else {
|
||||||
saleToCheck.Barcodes.forEach { barcode ->
|
saleToCheck.Barcodes.forEach { barcode ->
|
||||||
|
@ -1269,25 +1274,27 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
/*crea padre*/
|
/*crea padre*/
|
||||||
if (value.size > 1) {
|
if (value.size > 1) {
|
||||||
var mySale = value[0]
|
var mySale = //= value[0]
|
||||||
Sale(
|
Sale(
|
||||||
pickingOrder = value[0].pickingOrder,
|
level = value[0].level,
|
||||||
workerFk = value[0].workerFk,
|
isPicked = value[0].isPicked,
|
||||||
originalQuantity = value[0].originalQuantity,
|
parkingCode = "Líneas : ${value.size}",
|
||||||
saleQuantity = 0,
|
pickingOrder = value[0].pickingOrder,
|
||||||
saleFk = value[0].saleFk,
|
workerFk = value[0].workerFk,
|
||||||
saleGroupFk = value[0].saleGroupFk,
|
originalQuantity = value[0].originalQuantity,
|
||||||
semaphore = value[0].semaphore,
|
saleQuantity = 0,
|
||||||
ticketFk = value[0].ticketFk,
|
saleFk = value[0].saleFk,
|
||||||
itemFk = value[0].saleGroupFk!!,
|
saleGroupFk = value[0].saleGroupFk,
|
||||||
isAdded = value[0].isAdded,
|
semaphore = value[0].semaphore,
|
||||||
hasMistake = value[0].hasMistake,
|
ticketFk = value[0].ticketFk,
|
||||||
origin = value[0].origin,
|
itemFk = value[0].saleGroupFk!!,
|
||||||
size = value[0].size,
|
isAdded = value[0].isAdded,
|
||||||
itemShelvingSaleFk = value[0].itemShelvingSaleFk,
|
hasMistake = value[0].hasMistake,
|
||||||
longName = value[0].longName
|
origin = value[0].origin,
|
||||||
|
size = value[0].size,
|
||||||
)
|
itemShelvingSaleFk = value[0].itemShelvingSaleFk,
|
||||||
|
longName = value[0].parkingCode ?: ""
|
||||||
|
)
|
||||||
|
|
||||||
//prime elemento//hay que hacer una copia si no queda la referencia
|
//prime elemento//hay que hacer una copia si no queda la referencia
|
||||||
mySale.totalSales = value.size //total líneas
|
mySale.totalSales = value.size //total líneas
|
||||||
|
|
|
@ -262,7 +262,6 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
salix.getRoutes().enqueue(object : SalixCallback<MutableList<RouteInfo>>(context) {
|
salix.getRoutes().enqueue(object : SalixCallback<MutableList<RouteInfo>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<MutableList<RouteInfo>>) {
|
override fun onSuccess(response: Response<MutableList<RouteInfo>>) {
|
||||||
println()
|
|
||||||
_routeList.value = response.body()?.let { RouteList(it) }
|
_routeList.value = response.body()?.let { RouteList(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,7 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun collection_assignNew() {
|
fun collection_assignNew() {
|
||||||
|
// salix.collectionAssign()
|
||||||
silex.collection_assign().enqueue(
|
silex.collection_assign().enqueue(
|
||||||
object :
|
object :
|
||||||
SalixCallback<Int>(context) {
|
SalixCallback<Int>(context) {
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/levelTxt"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="@dimen/layout_margin_min"
|
android:layout_marginRight="@dimen/layout_margin_min"
|
||||||
|
@ -94,8 +95,8 @@
|
||||||
android:id="@+id/previous"
|
android:id="@+id/previous"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="PREVIA"
|
android:text=""
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="4dp"
|
||||||
android:textColor="@color/verdnatura_black"
|
android:textColor="@color/verdnatura_black"
|
||||||
android:textSize="@dimen/h8"
|
android:textSize="@dimen/h8"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|
Loading…
Reference in New Issue