V5.0.9
This commit is contained in:
parent
56d84a2a86
commit
1228b24064
|
@ -12,8 +12,8 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 7
|
versionCode 9
|
||||||
versionName "5.0.7"
|
versionName "5.0.9"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
|
||||||
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
|
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
|
||||||
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasViewModel
|
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasViewModel
|
||||||
import es.verdnatura.presentation.view.feature.historico.fragment.HistoricoViewModel
|
import es.verdnatura.presentation.view.feature.historico.fragment.HistoricoViewModel
|
||||||
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
||||||
|
@ -100,4 +101,8 @@ val viewModelModule = module{
|
||||||
viewModel {
|
viewModel {
|
||||||
CollectionViewModel()
|
CollectionViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel {
|
||||||
|
ControladorViewModel()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class ApiUtils {
|
class ApiUtils {
|
||||||
companion object {
|
companion object {
|
||||||
const val BASE_URL:String = "http://192.168.1.107:8009/"
|
const val BASE_URL:String = "http://192.168.1.111:8008/"
|
||||||
//const val BASE_URL:String = "https://app.verdnatura.es/"
|
//const val BASE_URL:String = "https://app.verdnatura.es/"
|
||||||
fun getApiService():VerdnaturaService{
|
fun getApiService():VerdnaturaService{
|
||||||
val retrofit = Retrofit.Builder()
|
val retrofit = Retrofit.Builder()
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
package es.verdnatura.domain
|
package es.verdnatura.domain
|
||||||
|
|
||||||
object ConstAndValues {
|
object ConstAndValues {
|
||||||
const val SACADOR = 14
|
const val SACADOR = "PREPARED"
|
||||||
const val CONTROLADOR = 8
|
const val CONTROLADOR = "CHECKED"
|
||||||
const val OK = 3
|
const val OK = "OK"
|
||||||
|
const val PREPARED = "PREPARED"
|
||||||
|
const val ON_PREPARATION = "ON_PREPARATION"
|
||||||
|
const val CHECKED = "CHECKED"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,11 @@ import retrofit2.Call
|
||||||
|
|
||||||
class GetSacadorControladorUserCase : RestClient() {
|
class GetSacadorControladorUserCase : RestClient() {
|
||||||
|
|
||||||
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String) : Call<CollectionVO> {
|
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,print:String) : Call<CollectionVO> {
|
||||||
val params:ArrayList<String> = ArrayList();
|
val params:ArrayList<String> = ArrayList();
|
||||||
params.add(collectionFk)
|
params.add(collectionFk)
|
||||||
params.add(sectorFk)
|
params.add(sectorFk)
|
||||||
|
params.add(print)
|
||||||
return restClient!!.collectionTicketGet("json","1",usuario,password,"application/json",params)
|
return restClient!!.collectionTicketGet("json","1",usuario,password,"application/json",params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,4 +68,42 @@ class GetSacadorControladorUserCase : RestClient() {
|
||||||
return restClient!!.collectionAddItem("json","1",usuario,password,"application/json",params)
|
return restClient!!.collectionAddItem("json","1",usuario,password,"application/json",params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun saleMove(usuario:String,password:String,saleFk: String,quantity: String,originalQuantity:String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(quantity)
|
||||||
|
params.add(originalQuantity)
|
||||||
|
return restClient!!.saleMove("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionMissingTrash(usuario:String,password:String,saleFk: String,quantity: String,type:String,warehouseFk:String,originalQuantity: String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(quantity)
|
||||||
|
params.add(type)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
params.add(originalQuantity)
|
||||||
|
return restClient!!.collectionMissingTrash("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingDel(usuario:String,password:String,saleFk: String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
return restClient!!.saleTrackingDel("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionUpdateState(usuario:String,password:String,collectionFk: String,state : String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
params.add(state)
|
||||||
|
return restClient!!.collectionUpdateState("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getIdFromCode(usuario:String,password:String,code: String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList()
|
||||||
|
params.add(code)
|
||||||
|
return restClient!!.getIdFromCode("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,51 @@ interface VerdnaturaService {
|
||||||
@Body params: List<String>):
|
@Body params: List<String>):
|
||||||
Call<String>
|
Call<String>
|
||||||
|
|
||||||
|
@POST("almacennew/saleMove")
|
||||||
|
fun saleMove(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>):
|
||||||
|
Call<String>
|
||||||
|
|
||||||
|
@POST("almacennew/collectionMissingTrash")
|
||||||
|
fun collectionMissingTrash(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>):
|
||||||
|
Call<String>
|
||||||
|
|
||||||
|
@POST("almacennew/saleTrackingDel")
|
||||||
|
fun saleTrackingDel(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>):
|
||||||
|
Call<String>
|
||||||
|
|
||||||
|
@POST("almacennew/collectionUpdateState")
|
||||||
|
fun collectionUpdateState(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>):
|
||||||
|
Call<String>
|
||||||
|
|
||||||
|
@POST("almacennew/barcodeToItem")
|
||||||
|
fun getIdFromCode(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>):
|
||||||
|
Call<String>
|
||||||
|
|
||||||
//PASILLEROS ========================================================================>
|
//PASILLEROS ========================================================================>
|
||||||
|
|
||||||
//CONSULTAR ARTICULO ========================================================================>
|
//CONSULTAR ARTICULO ========================================================================>
|
||||||
|
@ -250,6 +295,8 @@ interface VerdnaturaService {
|
||||||
@Body params: List<String>):
|
@Body params: List<String>):
|
||||||
Call<List<ItemShelvingParkingVO>>
|
Call<List<ItemShelvingParkingVO>>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//UBICADOR ========================================================================>
|
//UBICADOR ========================================================================>
|
||||||
@POST("almacennew/itemShelvingList")
|
@POST("almacennew/itemShelvingList")
|
||||||
fun itemShelvingList(@Header("aplicacion") aplicacion: String,
|
fun itemShelvingList(@Header("aplicacion") aplicacion: String,
|
||||||
|
|
|
@ -13,6 +13,7 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
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.SaleVO
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
|
|
||||||
interface OnOptionsSelectedListener {
|
interface OnOptionsSelectedListener {
|
||||||
|
@ -81,5 +82,13 @@ interface OnScanLongClickListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnCollectionSelectedListener {
|
interface OnCollectionSelectedListener {
|
||||||
fun onCollectionSelected(collection: CollectionVO,type:Int)
|
fun onCollectionSelected(collection: CollectionVO,type:String)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnQuantityClickListener {
|
||||||
|
fun onQuantityClick(sale: SaleVO)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnSaleClickListener {
|
||||||
|
fun onSaleClick(sale: SaleVO)
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ class CustomDialogList (context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
|
|
||||||
fun setValue(value : String): CustomDialogList{
|
fun setValue(value : String): CustomDialogList{
|
||||||
custom_dialog_value.setText(value)
|
custom_dialog_value.setText(value)
|
||||||
custom_dialog_value.visibility = View.VISIBLE
|
textinputlayout_username.visibility = View.VISIBLE
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class CustomDialogList (context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
|
|
||||||
fun setValueTwo(value : String): CustomDialogList{
|
fun setValueTwo(value : String): CustomDialogList{
|
||||||
custom_dialog_value_two.setText(value)
|
custom_dialog_value_two.setText(value)
|
||||||
custom_dialog_value_two.visibility = View.VISIBLE
|
textinputlayout_two.visibility = View.VISIBLE
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,4 +78,9 @@ class CustomDialogList (context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setTextTwoGone():CustomDialogList{
|
||||||
|
textinputlayout_two.visibility = View.GONE
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package es.verdnatura.presentation.view.component
|
||||||
|
|
||||||
|
import android.app.Dialog
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.View
|
||||||
|
import es.verdnatura.R
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.*
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ko
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok_two
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_description
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_title
|
||||||
|
|
||||||
|
class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||||
|
|
||||||
|
init {
|
||||||
|
setContentView(R.layout.component_custom_three_dialog)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun setTitle(title: String): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_title.visibility = View.VISIBLE
|
||||||
|
custom_dialog_title.text = title
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setDescription(description: String): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_description.visibility = View.VISIBLE
|
||||||
|
custom_dialog_description.text = description
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||||
|
custom_dialog_button_ok.text = text
|
||||||
|
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun getValue() : String {
|
||||||
|
return custom_dialog_value.text.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setValue(value : String): CustomDialogThreeButtons{
|
||||||
|
custom_dialog_value.setText(value)
|
||||||
|
textinputlayout.visibility = View.VISIBLE
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setOkButtonTwo(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_button_ok_two.visibility = View.VISIBLE
|
||||||
|
custom_dialog_button_ok_two.text = text
|
||||||
|
custom_dialog_button_ok_two.setOnClickListener { onButtonClicked() }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setOkButtonThree(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_button_ok_three.visibility = View.VISIBLE
|
||||||
|
custom_dialog_button_ok_three.text = text
|
||||||
|
custom_dialog_button_ok_three.setOnClickListener { onButtonClicked() }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||||
|
custom_dialog_button_ko.text = text
|
||||||
|
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -4,7 +4,11 @@ import android.app.Dialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.*
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ko
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok_two
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_description
|
||||||
|
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_title
|
||||||
|
|
||||||
class CustomDialogTwoButtons (context: Context) : Dialog(context, R.style.DialogTheme) {
|
class CustomDialogTwoButtons (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,13 @@ import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.databinding.ItemPlacementRowBinding
|
import es.verdnatura.databinding.ItemPlacementRowBinding
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
||||||
|
|
||||||
class PlacementAdapter (
|
class PlacementAdapter (
|
||||||
private val items: List<PlacementVO>
|
private val items: List<PlacementVO>,
|
||||||
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
|
||||||
): RecyclerView.Adapter<PlacementAdapter.AjustesItemHolder> () {
|
): RecyclerView.Adapter<PlacementAdapter.AjustesItemHolder> () {
|
||||||
var context: Context? = null
|
var context: Context? = null
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||||
|
@ -30,6 +33,9 @@ class PlacementAdapter (
|
||||||
fun bind(placement: PlacementVO) {
|
fun bind(placement: PlacementVO) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
this.item = placement
|
this.item = placement
|
||||||
|
itemRootLayout.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = "Ubicador"),placement.shelving)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package es.verdnatura.presentation.view.feature.collection.adapter
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -9,14 +10,19 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ItemArticleRowBinding
|
import es.verdnatura.databinding.ItemArticleRowBinding
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
|
|
||||||
class SaleAdapter (
|
class SaleAdapter (
|
||||||
private val items: List<SaleVO>,
|
private val items: List<SaleVO>,
|
||||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||||
|
private val onQuantityClick: OnQuantityClickListener,
|
||||||
|
private val onSaleClickListener: OnSaleClickListener
|
||||||
): RecyclerView.Adapter<SaleAdapter.AjustesItemHolder> () {
|
): RecyclerView.Adapter<SaleAdapter.AjustesItemHolder> () {
|
||||||
var context:Context? = null
|
var context:Context? = null
|
||||||
|
var position:Int = 0
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||||
this.context = parent.context
|
this.context = parent.context
|
||||||
return AjustesItemHolder(
|
return AjustesItemHolder(
|
||||||
|
@ -27,6 +33,7 @@ class SaleAdapter (
|
||||||
override fun getItemCount() =items.size
|
override fun getItemCount() =items.size
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
|
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
|
||||||
|
this.position = position
|
||||||
holder.bind(items[position])
|
holder.bind(items[position])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,12 +44,17 @@ class SaleAdapter (
|
||||||
binding.apply {
|
binding.apply {
|
||||||
if (sale.startQuantity.isNullOrEmpty())
|
if (sale.startQuantity.isNullOrEmpty())
|
||||||
sale.startQuantity = "0"
|
sale.startQuantity = "0"
|
||||||
this.sale = sale
|
|
||||||
|
|
||||||
val childLayoutManager = LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
val childLayoutManager = LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
||||||
|
|
||||||
itemArticlePlacements.apply {
|
itemArticlePlacements.apply {
|
||||||
layoutManager = childLayoutManager
|
layoutManager = childLayoutManager
|
||||||
adapter = PlacementAdapter(sale.placements)
|
adapter = PlacementAdapter(sale.placements,onPasillerosItemClickListener)
|
||||||
|
}
|
||||||
|
|
||||||
|
//CLICK EVENTS
|
||||||
|
contentLayout.setOnClickListener {
|
||||||
|
onSaleClickListener.onSaleClick(sale)
|
||||||
}
|
}
|
||||||
|
|
||||||
itemArticleItemFk.setOnClickListener {
|
itemArticleItemFk.setOnClickListener {
|
||||||
|
@ -50,6 +62,38 @@ class SaleAdapter (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
itemArticleQuantity.setOnClickListener {
|
||||||
|
onQuantityClick.onQuantityClick(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
itemArticleQuantityPicked.setOnClickListener {
|
||||||
|
onQuantityClick.onQuantityClick(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
txtde.setOnClickListener {
|
||||||
|
onQuantityClick.onQuantityClick(sale)
|
||||||
|
}
|
||||||
|
|
||||||
|
//ERROR
|
||||||
|
if (sale.originalQuantity != sale.quantity){
|
||||||
|
layoutError.visibility = View.VISIBLE
|
||||||
|
txtError.text = "Cantidad original: "+sale.quantity
|
||||||
|
if (sale.isPrepared == "1" || sale.isControlled == "1")
|
||||||
|
sale.startQuantity = sale.originalQuantity
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sale.isNew){
|
||||||
|
layoutError.visibility = View.VISIBLE
|
||||||
|
txtError.text = "Artículo nuevo"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sale.isNew && sale.originalQuantity == sale.quantity){
|
||||||
|
layoutError.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//SEMAFORO
|
||||||
if (sale.isPreviousPrepared == "1"){
|
if (sale.isPreviousPrepared == "1"){
|
||||||
itemArticleRowSemaforoPre.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_dark_sky_blue))
|
itemArticleRowSemaforoPre.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_dark_sky_blue))
|
||||||
}else{
|
}else{
|
||||||
|
@ -78,6 +122,10 @@ class SaleAdapter (
|
||||||
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_black))
|
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_black))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//ASIGNAMOS VALOR A LA VSITA
|
||||||
|
this.sale = sale
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,20 +10,22 @@ import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentCollectionBinding
|
import es.verdnatura.databinding.FragmentCollectionBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.CHECKED
|
||||||
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
||||||
import es.verdnatura.domain.ConstAndValues.OK
|
import es.verdnatura.domain.ConstAndValues.OK
|
||||||
|
import es.verdnatura.domain.ConstAndValues.ON_PREPARATION
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PREPARED
|
||||||
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.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.*
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
|
||||||
import es.verdnatura.presentation.common.addViewObserver
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||||
|
@ -40,7 +42,7 @@ import kotlinx.android.synthetic.main.toolbar.*
|
||||||
|
|
||||||
class CollectionFragment(
|
class CollectionFragment(
|
||||||
var collection : CollectionVO = CollectionVO(),
|
var collection : CollectionVO = CollectionVO(),
|
||||||
var type:Int = SACADOR
|
var type:String = SACADOR
|
||||||
) : BaseFragment<FragmentCollectionBinding,CollectionViewModel>(CollectionViewModel::class){
|
) : BaseFragment<FragmentCollectionBinding,CollectionViewModel>(CollectionViewModel::class){
|
||||||
private var user = ""
|
private var user = ""
|
||||||
private var password = ""
|
private var password = ""
|
||||||
|
@ -56,14 +58,19 @@ class CollectionFragment(
|
||||||
private var listPlacementSupply:ArrayList<BarcodeVO> = ArrayList()
|
private var listPlacementSupply:ArrayList<BarcodeVO> = ArrayList()
|
||||||
private var storedShelvingPosition:Int = 0
|
private var storedShelvingPosition:Int = 0
|
||||||
private lateinit var customDialogInput: CustomDialogInput
|
private lateinit var customDialogInput: CustomDialogInput
|
||||||
|
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||||
private var ticketSelected:String = ""
|
private var ticketSelected:String = ""
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
private var goBack:Boolean = false
|
private var goBack:Boolean = false
|
||||||
|
private var goBack2:Boolean = false
|
||||||
var mperror: MediaPlayer? = null
|
var mperror: MediaPlayer? = null
|
||||||
var mpok: MediaPlayer? = null
|
var mpok: MediaPlayer? = null
|
||||||
|
private var itemShelvingFkStored : String = ""
|
||||||
|
private var storedBackPosition : Int = 0
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(collection:CollectionVO,type:Int) = CollectionFragment(collection,type)
|
fun newInstance(collection:CollectionVO,type:String) = CollectionFragment(collection,type)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
override fun onAttach(context: Context) {
|
||||||
|
@ -83,8 +90,6 @@ class CollectionFragment(
|
||||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||||
if (collection.tickets.isEmpty()){
|
if (collection.tickets.isEmpty()){
|
||||||
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)
|
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)
|
||||||
}else{
|
|
||||||
createCollectionList()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -94,20 +99,27 @@ class CollectionFragment(
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
|
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||||
activity!!.main_bottom_navigation.visibility = View.GONE
|
activity!!.main_bottom_navigation.visibility = View.GONE
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
toolbar_title.text = "collectionTicket_get"
|
toolbar_title.text = "collectionTicket_get"
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
if (collection.tickets.isNotEmpty()){
|
||||||
|
createCollectionList()
|
||||||
|
}
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
goBack = true
|
goBack = true
|
||||||
|
goBack2 = true
|
||||||
super.onPause()
|
super.onPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setToolBar(){
|
private fun setToolBar(){
|
||||||
|
toolbar_subtitle.visibility = View.VISIBLE
|
||||||
|
|
||||||
val listIcons:ArrayList<Drawable> = ArrayList()
|
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||||
val iconPrint : Drawable = resources.getDrawable(R.drawable.ic_print_black_24dp,resources.newTheme())
|
val iconPrint : Drawable = resources.getDrawable(R.drawable.ic_print_black_24dp,resources.newTheme())
|
||||||
val iconSearch : Drawable = resources.getDrawable(R.drawable.ic_visibility,resources.newTheme())
|
val iconSearch : Drawable = resources.getDrawable(R.drawable.ic_visibility,resources.newTheme())
|
||||||
|
@ -131,6 +143,11 @@ class CollectionFragment(
|
||||||
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun scanRequest(){
|
||||||
|
scan_input.requestFocus()
|
||||||
|
(activity as MainActivity).hideKeyboard(scan_input)
|
||||||
|
}
|
||||||
|
|
||||||
private fun setEvents(){
|
private fun setEvents(){
|
||||||
backButton.setOnClickListener {
|
backButton.setOnClickListener {
|
||||||
activity!!.onBackPressed()
|
activity!!.onBackPressed()
|
||||||
|
@ -159,22 +176,22 @@ class CollectionFragment(
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel){
|
with(viewModel){
|
||||||
|
scanRequest()
|
||||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||||
splash_progress.visibility = View.GONE
|
splash_progress.visibility = View.GONE
|
||||||
if(it.tickets.isEmpty()){
|
if(it.tickets.isNotEmpty()){
|
||||||
if (R.id.collection_empty_text == collection_switcher.nextView.id){
|
|
||||||
collection_switcher.showNext()
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
collection = it
|
collection = it
|
||||||
createCollectionList()
|
createCollectionList()
|
||||||
|
}else{
|
||||||
|
toolbar_subtitle.text = "0/0"
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||||
splash_progress.visibility = View.GONE
|
splash_progress.visibility = View.GONE
|
||||||
printShelvingResult(it)
|
if (!goBack) printShelvingResult(it)
|
||||||
|
goBack = false
|
||||||
})
|
})
|
||||||
|
|
||||||
item.observe(viewLifecycleOwner, Observer {
|
item.observe(viewLifecycleOwner, Observer {
|
||||||
|
@ -188,6 +205,7 @@ class CollectionFragment(
|
||||||
if (!goBack){
|
if (!goBack){
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage).setKoButton("Cerrar"){
|
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage).setKoButton("Cerrar"){
|
||||||
|
scanRequest()
|
||||||
customDialog.hide()
|
customDialog.hide()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
|
@ -198,7 +216,30 @@ class CollectionFragment(
|
||||||
|
|
||||||
goBack = false
|
goBack = false
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
responseCode.observe(viewLifecycleOwner, Observer {
|
||||||
|
splash_progress.visibility = View.GONE
|
||||||
|
if (!goBack2){
|
||||||
|
if (it.isError){
|
||||||
|
customDialog.setTitle("Error").setDescription(it.errorMessage).setKoButton("Cerrar"){
|
||||||
|
scanRequest()
|
||||||
|
customDialog.hide()
|
||||||
|
}.show()
|
||||||
|
}else{
|
||||||
|
if (checkItemScan(it.response)){
|
||||||
|
scanRequest()
|
||||||
|
customDialogList.hide()
|
||||||
|
mpok?.start()
|
||||||
|
onQuantityOfShelvingSelected(itemShelvingFkStored)
|
||||||
|
}else{
|
||||||
|
customDialogList.setValueTwo("")
|
||||||
|
mperror?.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack2 = false
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -217,13 +258,46 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||||
saleAdapter = SaleAdapter(sales,pasillerosItemClickListener!!)
|
saleAdapter = SaleAdapter(sales,pasillerosItemClickListener!!,object: OnQuantityClickListener{
|
||||||
|
override fun onQuantityClick(sale: SaleVO) {
|
||||||
|
sales.forEachIndexed { index, saleVO ->
|
||||||
|
if (saleVO.saleFk == sale.saleFk){
|
||||||
|
showQuantityDialog(index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},object : OnSaleClickListener{
|
||||||
|
override fun onSaleClick(sale: SaleVO) {
|
||||||
|
sales.forEachIndexed { index, saleVO ->
|
||||||
|
if (saleVO.saleFk == sale.saleFk){
|
||||||
|
if (type == CONTROLADOR) markLine(index,type)
|
||||||
|
else if (type == SACADOR) unMarkLine(index, OK)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
fragment_sacador_collections.adapter = saleAdapter
|
fragment_sacador_collections.adapter = saleAdapter
|
||||||
fragment_sacador_collections.layoutManager = lm
|
fragment_sacador_collections.layoutManager = lm
|
||||||
setTotalLines()
|
setTotalLines()
|
||||||
if (storedPosition != 0)
|
if (storedPosition != 0)
|
||||||
setListPosition(storedPosition)
|
setListPosition(storedPosition)
|
||||||
|
else if (storedBackPosition != 0)
|
||||||
|
setListPosition(storedBackPosition)
|
||||||
|
|
||||||
|
setScrollListener(lm!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setScrollListener(lm: LinearLayoutManager){
|
||||||
|
fragment_sacador_collections.addOnScrollListener(object : RecyclerView.OnScrollListener(){
|
||||||
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||||
|
storedBackPosition = lm.findFirstVisibleItemPosition()
|
||||||
|
super.onScrolled(recyclerView, dx, dy)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//SEARCH AND MARK
|
//SEARCH AND MARK
|
||||||
|
@ -273,12 +347,16 @@ class CollectionFragment(
|
||||||
if(saleVO.isControlled == "0"){
|
if(saleVO.isControlled == "0"){
|
||||||
//1- Por itemFk
|
//1- Por itemFk
|
||||||
if (txtscan == saleVO.itemFk){
|
if (txtscan == saleVO.itemFk){
|
||||||
|
mpok!!.start()
|
||||||
|
isOk = true
|
||||||
markLine(index,type)
|
markLine(index,type)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
//2- Por barcode
|
//2- Por barcode
|
||||||
saleVO.Barcodes.forEach { barcode ->
|
saleVO.Barcodes.forEach { barcode ->
|
||||||
if (txtscan == barcode){
|
if (txtscan == barcode){
|
||||||
|
mpok!!.start()
|
||||||
|
isOk = true
|
||||||
markLine(index,type)
|
markLine(index,type)
|
||||||
isBreak = true
|
isBreak = true
|
||||||
}
|
}
|
||||||
|
@ -287,17 +365,31 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
index += 1
|
index += 1
|
||||||
}
|
}
|
||||||
|
//Lo escaneado no encontrado miramos si es parking o ticket
|
||||||
|
if (!isOk){
|
||||||
|
if (txtscan.contains("-")){
|
||||||
|
viewModel.parking(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
ticketFk = collection.collectionFk,
|
||||||
|
parking = txtscan
|
||||||
|
)
|
||||||
|
mpok!!.start()
|
||||||
|
"Ticket aparcado".toast(requireContext())
|
||||||
|
}else{
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.collectionTicketGet(user,password,txtscan,sectorFk)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun markLine(position:Int,newType: Int){
|
private fun markLine(position:Int,newType: String){
|
||||||
if (type == SACADOR){
|
if (type == SACADOR){
|
||||||
sales[position].isPrepared = if (sales[position].isPrepared == "1") "0" else "1"
|
sales[position].isPrepared = if (sales[position].isPrepared == "1") "0" else "1"
|
||||||
if (sales[position].isPrepared == "1"){
|
if (sales[position].isPrepared == "1"){
|
||||||
sales[position].startQuantity = sales[position].quantity
|
sales[position].startQuantity = sales[position].originalQuantity
|
||||||
}else{
|
|
||||||
sales[position].startQuantity = if(sales[position].startQuantity == sales[position].quantity) "0" else sales[position].startQuantity
|
|
||||||
}
|
}
|
||||||
}else if (type == CONTROLADOR)
|
}else if (type == CONTROLADOR)
|
||||||
sales[position].isControlled = if (sales[position].isControlled == "1") "0" else "1"
|
sales[position].isControlled = if (sales[position].isControlled == "1") "0" else "1"
|
||||||
|
@ -311,36 +403,52 @@ class CollectionFragment(
|
||||||
|
|
||||||
private fun setListPosition(position:Int){
|
private fun setListPosition(position:Int){
|
||||||
storedPosition = position
|
storedPosition = position
|
||||||
fragment_sacador_collections.addViewObserver {
|
if (type == SACADOR){
|
||||||
lm!!.scrollToPositionWithOffset(position,0)
|
fragment_sacador_collections.addViewObserver {
|
||||||
|
lm!!.scrollToPositionWithOffset(position,0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun saleTrackingReplace(position: Int,type: Int){
|
private fun saleTrackingReplace(position: Int,type: String){
|
||||||
viewModel.saleTrackingReplace(
|
viewModel.saleTrackingReplace(
|
||||||
usuario = user,
|
usuario = user,
|
||||||
password = password,
|
password = password,
|
||||||
saleFk = sales[position].saleFk,
|
saleFk = sales[position].saleFk,
|
||||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else sales[position].isControlled,
|
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if(type == CONTROLADOR) sales[position].isControlled else "1",
|
||||||
vOriginalQuantity = sales[position].startQuantity,
|
vOriginalQuantity = sales[position].startQuantity,
|
||||||
vStateFk = type.toString()
|
vStateFk = type.toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setTotalLines(){
|
private fun unMarkLine(position: Int,newType: String){
|
||||||
var totalMark = 0
|
|
||||||
sales.forEach {
|
if (sales[position].isPrepared == "1"){
|
||||||
if (type == SACADOR)
|
customDialog.setTitle("Desmarcar linea").setDescription("Vas a desmarcar la linea: "+sales[position].itemFk+ " ¿Estás seguro?").setOkButton("Desmarcar"){
|
||||||
if (it.isPrepared == "1" || it.isControlled == "1" || it.isPreviousPrepared == "1")
|
sales[position].isPrepared = "0"
|
||||||
totalMark += 1
|
sales[position].startQuantity = "0"
|
||||||
else if (type == CONTROLADOR)
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
if (it.isControlled == "1")
|
setListPosition(position)
|
||||||
totalMark += 1
|
viewModel.saleTrackingDel(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
saleFk = sales[position].saleFk
|
||||||
|
)
|
||||||
|
setTotalLines()
|
||||||
|
scanRequest()
|
||||||
|
customDialog.hide()
|
||||||
|
}.setKoButton("Cancelar"){
|
||||||
|
scanRequest()
|
||||||
|
customDialog.hide()
|
||||||
|
}.show()
|
||||||
}
|
}
|
||||||
toolbar_title.text = "" + totalMark + "/" + sales.size
|
|
||||||
if (totalMark == sales.size) "Colección completa".toast(this.context,Toast.LENGTH_SHORT)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//SHELVINGS
|
//SHELVINGS
|
||||||
private fun showShelving(position:Int,shelvingPosition:Int){
|
private fun showShelving(position:Int,shelvingPosition:Int){
|
||||||
storedShelvingPosition = shelvingPosition
|
storedShelvingPosition = shelvingPosition
|
||||||
|
@ -348,7 +456,7 @@ class CollectionFragment(
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
var quantityGet = "0"
|
var quantityGet = "0"
|
||||||
try{
|
try{
|
||||||
quantityGet = (sales[position].quantity.toInt() - sales[position].startQuantity.toInt()).toString()
|
quantityGet = (sales[position].originalQuantity.toInt() - sales[position].startQuantity.toInt()).toString()
|
||||||
}catch (e:Exception){}
|
}catch (e:Exception){}
|
||||||
viewModel.itemPlacementSupplyAiming(
|
viewModel.itemPlacementSupplyAiming(
|
||||||
usuario = user,
|
usuario = user,
|
||||||
|
@ -378,27 +486,65 @@ class CollectionFragment(
|
||||||
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
||||||
}
|
}
|
||||||
|
|
||||||
customDialogList.setTitle(""+shelving+ "("+item+")"+" "+total+" de "+longName).setOkButton("Coger"){
|
customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton("Coger"){
|
||||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
if (customDialogList.getValueTwo().isNotEmpty()){
|
||||||
customDialogList.hide()
|
if (checkItemScan(customDialogList.getValueTwo())){
|
||||||
|
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||||
|
mpok?.start()
|
||||||
|
scanRequest()
|
||||||
|
customDialogList.hide()
|
||||||
|
}else{
|
||||||
|
itemShelvingFkStored = itemShelvingFk
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.getIdFromCode(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
code = customDialogList.getValueTwo()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
"Escanea item para validar".toast(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar"){
|
}.setKoButton("Cerrar"){
|
||||||
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.hide()
|
||||||
}.setHintValue("Cantidad que coges:").setValue(total).show()
|
}.setHintValue("Cantidad que coges:").setValue(total).setHintValueTwo("Escanea item").setValueTwo("").show()
|
||||||
|
|
||||||
|
|
||||||
customDialogList.getEditText().requestFocus()
|
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
|
||||||
|
|
||||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogList.getEditTextTwo().requestFocus()
|
||||||
|
(activity as MainActivity).hideKeyboard(customDialogList.getEditTextTwo())
|
||||||
|
|
||||||
|
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) {
|
||||||
if (!customDialogList.getValue().isNullOrEmpty()){
|
if (customDialogList.getValueTwo().isNotEmpty()){
|
||||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
if (checkItemScan(customDialogList.getValueTwo())){
|
||||||
|
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||||
|
mpok?.start()
|
||||||
|
scanRequest()
|
||||||
|
customDialogList.hide()
|
||||||
|
}else{
|
||||||
|
itemShelvingFkStored = itemShelvingFk
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.getIdFromCode(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
code = customDialogList.getValueTwo()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
"Escanea item para validar".toast(requireContext())
|
||||||
}
|
}
|
||||||
customDialogList.setValue("")
|
(activity as MainActivity).hideKeyboard(customDialogList.getEditTextTwo())
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
customDialogList.hide()
|
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -421,10 +567,24 @@ class CollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkItemScan(valueToCheck:String):Boolean{
|
||||||
|
val saleToCheck = sales[storedPosition]
|
||||||
|
if (saleToCheck.itemFk == valueToCheck)
|
||||||
|
return true
|
||||||
|
else{
|
||||||
|
saleToCheck.Barcodes.forEach { barcode ->
|
||||||
|
if (barcode == valueToCheck)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
private fun onQuantityOfShelvingSelected(itemShelvingFk:String){
|
private fun onQuantityOfShelvingSelected(itemShelvingFk:String){
|
||||||
//1 - MODIFICAR CANTIDAD DEL CARRO
|
//1 - MODIFICAR CANTIDAD DEL CARRO
|
||||||
try {
|
try {
|
||||||
val shelvingVisible = sales[storedPosition].placements[storedShelvingPosition].visible.substring(1,sales[storedPosition].placements[storedShelvingPosition].visible.indexOf(")"))
|
val shelvingVisible = sales[storedPosition].placements[storedShelvingPosition].visible.substring(1,sales[storedPosition].placements[storedShelvingPosition].visible.indexOf(")"))
|
||||||
|
|
||||||
sales[storedPosition].placements[storedShelvingPosition].visible =
|
sales[storedPosition].placements[storedShelvingPosition].visible =
|
||||||
"("+(shelvingVisible.toInt() - customDialogList.getValue().toInt()).toString()+")"
|
"("+(shelvingVisible.toInt() - customDialogList.getValue().toInt()).toString()+")"
|
||||||
|
|
||||||
|
@ -444,7 +604,7 @@ class CollectionFragment(
|
||||||
}catch (e:Exception){}
|
}catch (e:Exception){}
|
||||||
|
|
||||||
//3- MARCAR LINEA
|
//3- MARCAR LINEA
|
||||||
if (sales[storedPosition].startQuantity != sales[storedPosition].quantity){
|
if (sales[storedPosition].startQuantity != sales[storedPosition].originalQuantity){
|
||||||
sales[storedPosition].isPrepared = "1"
|
sales[storedPosition].isPrepared = "1"
|
||||||
markLine(storedPosition, OK)
|
markLine(storedPosition, OK)
|
||||||
}else{
|
}else{
|
||||||
|
@ -489,11 +649,13 @@ class CollectionFragment(
|
||||||
quantityFk = customDialogList.getValueTwo(),
|
quantityFk = customDialogList.getValueTwo(),
|
||||||
warehouseFk = warehouseFk
|
warehouseFk = warehouseFk
|
||||||
)
|
)
|
||||||
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar"){
|
}.setKoButton("Cerrar"){
|
||||||
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.hide()
|
||||||
}.setHintValue("Artículo:").setValue("").setHintValueTwo("Cantidad:").setValueTwo("").show()
|
}.setHintValue("Artículo:").setValue("").setHintValueTwo("Cantidad:").setValueTwo("").show()
|
||||||
|
|
||||||
|
@ -528,11 +690,13 @@ class CollectionFragment(
|
||||||
quantityFk = customDialogList.getValueTwo(),
|
quantityFk = customDialogList.getValueTwo(),
|
||||||
warehouseFk = warehouseFk
|
warehouseFk = warehouseFk
|
||||||
)
|
)
|
||||||
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditTextTwo())
|
(activity as MainActivity).hideKeyboard(customDialogList.getEditTextTwo())
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.hide()
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -564,11 +728,13 @@ class CollectionFragment(
|
||||||
itemFk = customDialogInput.getValue(),
|
itemFk = customDialogInput.getValue(),
|
||||||
warehouseFk = warehouseFk
|
warehouseFk = warehouseFk
|
||||||
)
|
)
|
||||||
|
scanRequest()
|
||||||
customDialogInput.hide()
|
customDialogInput.hide()
|
||||||
|
|
||||||
}.setKoButton("Cancelar"){
|
}.setKoButton("Cancelar"){
|
||||||
splash_progress.visibility = View.GONE
|
splash_progress.visibility = View.GONE
|
||||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||||
|
scanRequest()
|
||||||
customDialogInput.hide()
|
customDialogInput.hide()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
customDialogInput.getEditText().requestFocus()
|
customDialogInput.getEditText().requestFocus()
|
||||||
|
@ -584,6 +750,7 @@ class CollectionFragment(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
customDialogInput.setValue("")
|
customDialogInput.setValue("")
|
||||||
|
scanRequest()
|
||||||
customDialogInput.hide()
|
customDialogInput.hide()
|
||||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
|
@ -598,10 +765,160 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
customDialog.setTitle("Artículo: "+item.id).setDescription("Disponible: "+item.available).setOkButton("Aceptar"){
|
customDialog.setTitle("Artículo: "+item.id).setDescription("Disponible: "+item.available).setOkButton("Aceptar"){
|
||||||
|
scanRequest()
|
||||||
customDialog.hide()
|
customDialog.hide()
|
||||||
}.show()
|
}.show()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setTotalLines(){
|
||||||
|
var totalMark = 0
|
||||||
|
sales.forEach {
|
||||||
|
if (type == SACADOR){
|
||||||
|
if (it.isPrepared == "1" || it.isControlled == "1" || it.isPreviousPrepared == "1")
|
||||||
|
totalMark += 1
|
||||||
|
}else if (type == CONTROLADOR){
|
||||||
|
if (it.isControlled == "1")
|
||||||
|
totalMark += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//toolbar_title.text = "" + totalMark + "/" + sales.size
|
||||||
|
toolbar_title.text = collection.collectionFk
|
||||||
|
toolbar_subtitle.text = "" +totalMark + "/" + sales.size
|
||||||
|
if (totalMark == sales.size) {
|
||||||
|
"Colección completa".toast(this.context,Toast.LENGTH_SHORT)
|
||||||
|
changeTicketState()
|
||||||
|
}else if(totalMark == 0){
|
||||||
|
setPreparedTicket()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//FALTAS / BASURA / SPLIT
|
||||||
|
private fun showQuantityDialog(position:Int) {
|
||||||
|
customDialogThreeButtons.setTitle("Nueva cantidad").setDescription("Indica la nueva cantidad y la acción que quieres realizar con el resto.").setValue("")
|
||||||
|
.setOkButton("Faltas"){
|
||||||
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
|
"Indica nueva cantidad".toast(requireContext())
|
||||||
|
}else{
|
||||||
|
trash(position,customDialogThreeButtons.getValue())
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtons.hide()
|
||||||
|
}
|
||||||
|
}.setOkButtonTwo("Basura"){
|
||||||
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
|
"Indica nueva cantidad".toast(requireContext())
|
||||||
|
}else{
|
||||||
|
missing(position,customDialogThreeButtons.getValue())
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtons.hide()
|
||||||
|
}
|
||||||
|
}.setOkButtonThree("Split"){
|
||||||
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
|
"Indica nueva cantidad".toast(requireContext())
|
||||||
|
}else{
|
||||||
|
split(position,customDialogThreeButtons.getValue())
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtons.hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
}.setKoButton("Cancelar"){
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtons.hide()
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun split(position: Int,quantity:String){
|
||||||
|
var totalQuantity: Int = 0
|
||||||
|
try {
|
||||||
|
totalQuantity = sales[position].originalQuantity.toInt() - quantity.toInt()
|
||||||
|
}catch (e:Exception){}
|
||||||
|
viewModel.saleMove(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
saleFk = sales[position].saleFk,
|
||||||
|
quantity = totalQuantity.toString(),
|
||||||
|
originalQuantity = quantity
|
||||||
|
)
|
||||||
|
sales[position].originalQuantity = quantity
|
||||||
|
sales[position].quantity = quantity
|
||||||
|
//sales[position].startQuantity = quantity
|
||||||
|
|
||||||
|
if (quantity == "0")
|
||||||
|
markLine(position,type)
|
||||||
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun trash(position: Int,quantity:String){
|
||||||
|
var totalQuantity: Int = 0
|
||||||
|
try {
|
||||||
|
totalQuantity = sales[position].originalQuantity.toInt() - quantity.toInt()
|
||||||
|
}catch (e:Exception){}
|
||||||
|
viewModel.collectionMissingTrash(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
saleFk = sales[position].saleFk,
|
||||||
|
quantity = totalQuantity.toString(),
|
||||||
|
warehouseFk = warehouseFk,
|
||||||
|
type = "FALSE",
|
||||||
|
originalQuantity = quantity
|
||||||
|
)
|
||||||
|
sales[position].originalQuantity = quantity
|
||||||
|
sales[position].quantity = quantity
|
||||||
|
//sales[position].startQuantity = quantity
|
||||||
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
if (quantity == "0")
|
||||||
|
markLine(position,type)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun missing(position: Int,quantity:String){
|
||||||
|
var totalQuantity: Int = 0
|
||||||
|
try {
|
||||||
|
totalQuantity = sales[position].originalQuantity.toInt() - quantity.toInt()
|
||||||
|
}catch (e:Exception){}
|
||||||
|
viewModel.collectionMissingTrash(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
saleFk = sales[position].saleFk,
|
||||||
|
quantity = totalQuantity.toString(),
|
||||||
|
warehouseFk = warehouseFk,
|
||||||
|
type = "TRUE",
|
||||||
|
originalQuantity = quantity
|
||||||
|
)
|
||||||
|
sales[position].originalQuantity = quantity
|
||||||
|
sales[position].quantity = quantity
|
||||||
|
//sales[position].startQuantity = quantity
|
||||||
|
|
||||||
|
if (quantity == "0")
|
||||||
|
markLine(position,type)
|
||||||
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
//ESTADOS
|
||||||
|
|
||||||
|
private fun changeTicketState(){
|
||||||
|
if (type == CONTROLADOR){
|
||||||
|
viewModel.collectionUpdateState(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
collectionFk = collection.collectionFk,
|
||||||
|
state = CHECKED
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setPreparedTicket(){
|
||||||
|
if (type == CONTROLADOR){
|
||||||
|
viewModel.collectionUpdateState(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
collectionFk = collection.collectionFk,
|
||||||
|
state = PREPARED
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||||
|
import es.verdnatura.domain.GetShelvingParkingUserCase
|
||||||
|
import es.verdnatura.domain.GetUbicadorUserCase
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||||
|
@ -19,6 +21,7 @@ class CollectionViewModel : BaseViewModel() {
|
||||||
val emptyMessage = "La colección no tiene tickets";
|
val emptyMessage = "La colección no tiene tickets";
|
||||||
|
|
||||||
private val getSacadorControladorUserCase: GetSacadorControladorUserCase = GetSacadorControladorUserCase()
|
private val getSacadorControladorUserCase: GetSacadorControladorUserCase = GetSacadorControladorUserCase()
|
||||||
|
private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase()
|
||||||
|
|
||||||
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
||||||
val collectionTicketList: LiveData<CollectionVO>
|
val collectionTicketList: LiveData<CollectionVO>
|
||||||
|
@ -36,6 +39,11 @@ class CollectionViewModel : BaseViewModel() {
|
||||||
val responseNew: LiveData<ResponseItemVO>
|
val responseNew: LiveData<ResponseItemVO>
|
||||||
get() = _responseNew
|
get() = _responseNew
|
||||||
|
|
||||||
|
private val _responseCode by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseCode: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseCode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private val _item by lazy { MutableLiveData<ItemVO>() }
|
private val _item by lazy { MutableLiveData<ItemVO>() }
|
||||||
val item: LiveData<ItemVO>
|
val item: LiveData<ItemVO>
|
||||||
|
@ -43,7 +51,7 @@ class CollectionViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
|
||||||
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String){
|
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String){
|
||||||
getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk).enqueue(object :
|
getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0").enqueue(object :
|
||||||
Callback<CollectionVO> {
|
Callback<CollectionVO> {
|
||||||
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||||
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = t.message!!)
|
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = t.message!!)
|
||||||
|
@ -156,11 +164,108 @@ class CollectionViewModel : BaseViewModel() {
|
||||||
|
|
||||||
override fun onResponse(call: Call<String>, response: Response<String>) {
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
if (response.body() == null){
|
if (response.body() == null){
|
||||||
_responseNew.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionStickerPrint")
|
_responseNew.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionAddItem")
|
||||||
}else{
|
}else{
|
||||||
_responseNew.value = ResponseItemVO(isError = false,response = response.body()!!)
|
_responseNew.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun saleMove(usuario:String,password:String,saleFk: String,quantity: String,originalQuantity : String){
|
||||||
|
getSacadorControladorUserCase.saleMove(usuario,password,saleFk,quantity,originalQuantity).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada saleMove")
|
||||||
|
}else{
|
||||||
|
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionMissingTrash(usuario:String,password:String,saleFk: String,quantity: String,type:String,warehouseFk:String,originalQuantity: String){
|
||||||
|
getSacadorControladorUserCase.collectionMissingTrash(usuario,password,saleFk,quantity,type,warehouseFk,originalQuantity).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionMissingTrash")
|
||||||
|
}else{
|
||||||
|
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun saleTrackingDel(usuario:String,password:String,saleFk: String){
|
||||||
|
getSacadorControladorUserCase.saleTrackingDel(usuario,password,saleFk).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionMissingTrash")
|
||||||
|
}else{
|
||||||
|
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun parking(usuario: String,password: String,ticketFk: String,parking:String){
|
||||||
|
getUbicadorUserCase.shelvingPark(usuario,password,ticketFk,parking).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada shelvingPark")
|
||||||
|
}else{
|
||||||
|
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionUpdateState(usuario:String,password:String,collectionFk: String,state : String){
|
||||||
|
getSacadorControladorUserCase.collectionUpdateState(usuario,password,collectionFk,state).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionUpdateState")
|
||||||
|
}else{
|
||||||
|
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getIdFromCode(usuario:String,password:String,code: String){
|
||||||
|
getSacadorControladorUserCase.getIdFromCode(usuario,password,code).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_responseCode.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_responseCode.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada barcodeToItem")
|
||||||
|
}else{
|
||||||
|
_responseCode.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,17 +13,25 @@ fun CollectionVO.map() : CollectionVO{
|
||||||
it.level = ticket.level
|
it.level = ticket.level
|
||||||
it.agencyName = ticket.agencyName
|
it.agencyName = ticket.agencyName
|
||||||
it.quantity = it.quantity.substring(0,it.quantity.indexOf("."))
|
it.quantity = it.quantity.substring(0,it.quantity.indexOf("."))
|
||||||
if (it.placements.isNotEmpty()){
|
it.isNew = it.isAdded == "1"
|
||||||
try{
|
it.originalQuantity = if (it.originalQuantity != "-1") it.originalQuantity.substring(0,it.originalQuantity.indexOf(".")) else it.quantity
|
||||||
it.saleOrder = it.placements[0].saleOrder.toInt()
|
it.startQuantity = if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.startQuantity
|
||||||
}catch (e:NumberFormatException){
|
if (!it.placements.isNullOrEmpty()){
|
||||||
it.saleOrder = 9999
|
it.placements.forEachIndexed { index, placement ->
|
||||||
|
if (index == 0){
|
||||||
|
try{
|
||||||
|
it.saleOrder = placement.saleOrder.toInt()
|
||||||
|
}catch (e:NumberFormatException){
|
||||||
|
it.saleOrder = 9999
|
||||||
|
}
|
||||||
|
}
|
||||||
|
placement.created = getCalendarFromDate(placement.created).convertToDateString()
|
||||||
|
placement.visible = "("+placement.visible+")"
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
it.placements = listOf()
|
||||||
}
|
}
|
||||||
it.placements.forEach { placement ->
|
|
||||||
placement.created = getCalendarFromDate(placement.created).convertToDateString()
|
|
||||||
placement.visible = "("+placement.visible+")"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.controlador.fragment
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
|
import androidx.lifecycle.Observer
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.databinding.FragmentControladorBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues
|
||||||
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||||
|
import kotlinx.android.synthetic.main.toolbar.*
|
||||||
|
|
||||||
|
class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorViewModel>(ControladorViewModel::class) {
|
||||||
|
|
||||||
|
private var user = ""
|
||||||
|
private var password = ""
|
||||||
|
private var sectorFk = ""
|
||||||
|
private var warehouseFk = ""
|
||||||
|
private var goBack:Boolean = false
|
||||||
|
private var onCollectionSelectedListener : OnCollectionSelectedListener? = null
|
||||||
|
override fun getLayoutId(): Int = R.layout.fragment_controlador
|
||||||
|
private lateinit var customDialog: CustomDialog
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance() = ControladorFragment()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAttach(context: Context) {
|
||||||
|
super.onAttach(context)
|
||||||
|
if (context is OnCollectionSelectedListener) onCollectionSelectedListener = context
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
splash_progress.visibility = View.GONE
|
||||||
|
customDialog = CustomDialog(requireContext())
|
||||||
|
toolbar_title.text = "collection_get"
|
||||||
|
setEvents()
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
goBack = true
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
val prefs: SharedPreferences = activity!!.getSharedPreferences(PREFS_USER,0)
|
||||||
|
user = prefs.getString(USER,"").toString()
|
||||||
|
password = prefs.getString(PASSWORD,"").toString()
|
||||||
|
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||||
|
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setEvents(){
|
||||||
|
scan_input.requestFocus()
|
||||||
|
scan_input.setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
|
if (!scan_input.text.isNullOrEmpty()) {
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.collectionTicketGet(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
sectorFk = sectorFk,
|
||||||
|
collectionFk = scan_input.text.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
scan_input.setText("")
|
||||||
|
(activity as MainActivity).hideKeyboard(scan_input)
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun observeViewModel() {
|
||||||
|
with(viewModel){
|
||||||
|
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||||
|
splash_progress.visibility = View.GONE
|
||||||
|
if (it.isError){
|
||||||
|
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||||
|
customDialog.hide()
|
||||||
|
}.show()
|
||||||
|
}else{
|
||||||
|
if (!goBack)navigateToCollectionList(it)
|
||||||
|
goBack = false
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun navigateToCollectionList(collection: CollectionVO){
|
||||||
|
onCollectionSelectedListener?.onCollectionSelected(collection, ConstAndValues.CONTROLADOR)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.controlador.fragment
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||||
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import retrofit2.Call
|
||||||
|
import retrofit2.Callback
|
||||||
|
import retrofit2.Response
|
||||||
|
|
||||||
|
class ControladorViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
||||||
|
private val getSacadorControladorUserCase: GetSacadorControladorUserCase = GetSacadorControladorUserCase()
|
||||||
|
|
||||||
|
val collectionTicketList: LiveData<CollectionVO>
|
||||||
|
get() = _collectionTicketList
|
||||||
|
|
||||||
|
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String){
|
||||||
|
getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0").enqueue(object :
|
||||||
|
Callback<CollectionVO> {
|
||||||
|
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||||
|
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = t.message!!)
|
||||||
|
}
|
||||||
|
override fun onResponse(
|
||||||
|
call: Call<CollectionVO>,
|
||||||
|
response: Response<CollectionVO>
|
||||||
|
) {
|
||||||
|
if (response.body() != null){
|
||||||
|
_collectionTicketList.value = response.body()?.let { it.map() }
|
||||||
|
}else{
|
||||||
|
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = "No hay tickets para sacar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesFragment
|
||||||
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardFragment
|
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardFragment
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFragment
|
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFragment
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
|
||||||
|
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorFragment
|
||||||
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasFragment
|
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasFragment
|
||||||
import es.verdnatura.presentation.view.feature.historico.fragment.HistoricoFragment
|
import es.verdnatura.presentation.view.feature.historico.fragment.HistoricoFragment
|
||||||
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryFragment
|
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryFragment
|
||||||
|
@ -134,7 +135,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClick
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
"Controladores" -> {
|
"Controladores" -> {
|
||||||
"Función Controladores desactivada".toast(this@MainActivity)
|
fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||||
|
addFragment(ControladorFragment.newInstance(),R.id.main_frame_layout, ControladorFragment.TAG,false)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
"Paletizadores" -> {
|
"Paletizadores" -> {
|
||||||
|
@ -229,7 +231,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClick
|
||||||
addFragmentOnTop(ExpeditionPalletDetailFragment.newInstance(itemTruck,itemPallet))
|
addFragmentOnTop(ExpeditionPalletDetailFragment.newInstance(itemTruck,itemPallet))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCollectionSelected(collection: CollectionVO,type:Int) {
|
override fun onCollectionSelected(collection: CollectionVO,type:String) {
|
||||||
addFragmentOnTop(CollectionFragment.newInstance(collection,type))
|
addFragmentOnTop(CollectionFragment.newInstance(collection,type))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||||
import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter
|
import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
@ -29,6 +30,11 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
||||||
private var sectorFk = ""
|
private var sectorFk = ""
|
||||||
private var warehouseFk = ""
|
private var warehouseFk = ""
|
||||||
private var onCollectionSelectedListener : OnCollectionSelectedListener? = null
|
private var onCollectionSelectedListener : OnCollectionSelectedListener? = null
|
||||||
|
private var goBack:Boolean = false
|
||||||
|
private var goBack2:Boolean = false
|
||||||
|
private lateinit var customDialog: CustomDialog
|
||||||
|
private var collectionsList:ArrayList<CollectionVO> = ArrayList()
|
||||||
|
private var adapter: CollectionAdapter? = null
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -47,75 +53,89 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
||||||
password = prefs.getString(PASSWORD,"").toString()
|
password = prefs.getString(PASSWORD,"").toString()
|
||||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||||
viewModel.collectionGet(user,password)
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
customDialog = CustomDialog(requireContext())
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
toolbar_title.text = "collection_get"
|
toolbar_title.text = "collection_get"
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
viewModel.collectionGet(user,password)
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
goBack = true
|
||||||
|
goBack2 = true
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
private fun setToolBar(){
|
private fun setToolBar(){
|
||||||
backButton.visibility = View.GONE
|
backButton.visibility = View.GONE
|
||||||
val listIcons:ArrayList<Drawable> = ArrayList()
|
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||||
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
|
||||||
val iconAdd : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
|
val iconAdd : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
|
||||||
listIcons.add(iconReload)
|
|
||||||
listIcons.add(iconAdd)
|
listIcons.add(iconAdd)
|
||||||
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
if (item == iconReload){
|
if(item == iconAdd){
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
viewModel.collectionGet(user,password)
|
viewModel.collectionTicketGet(user,password,"",sectorFk,"1")
|
||||||
}else if(item == iconAdd){
|
|
||||||
splash_progress.visibility = View.VISIBLE
|
|
||||||
viewModel.collectionTicketGet(user,password,"",sectorFk)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setEvents(){
|
private fun setEvents(){
|
||||||
|
sacador_swipe.setOnRefreshListener {
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.collectionGet(user,password)
|
||||||
|
sacador_swipe.isRefreshing = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel){
|
with(viewModel){
|
||||||
collectionList.observe(viewLifecycleOwner, Observer {
|
collectionList.observe(viewLifecycleOwner, Observer {
|
||||||
splash_progress.visibility = View.GONE
|
if (!goBack2)splash_progress.visibility = View.GONE
|
||||||
if(it.list.isEmpty()){
|
createCollectionList(it.list)
|
||||||
if (R.id.sacador_empty_text == sacador_switcher.nextView.id){
|
goBack2 = false
|
||||||
sacador_switcher.showNext()
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
createCollectionList(it.list)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||||
navigateToCollectionList(it)
|
splash_progress.visibility = View.GONE
|
||||||
|
if (it.isError){
|
||||||
|
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||||
|
customDialog.hide()
|
||||||
|
}.show()
|
||||||
|
}else{
|
||||||
|
if (!goBack)navigateToCollectionList(it)
|
||||||
|
|
||||||
|
}
|
||||||
|
goBack = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createCollectionList(collections:List<CollectionVO>){
|
private fun createCollectionList(collections:List<CollectionVO>){
|
||||||
|
collectionsList = ArrayList()
|
||||||
|
collections.forEach {
|
||||||
|
collectionsList.add(it)
|
||||||
|
}
|
||||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
val adapter = CollectionAdapter(collections,onCollectionSelectedListener!!)
|
adapter = CollectionAdapter(collectionsList,onCollectionSelectedListener!!)
|
||||||
fragment_sacador_collections.layoutManager = lm
|
fragment_sacador_collections.layoutManager = lm
|
||||||
fragment_sacador_collections.adapter = adapter
|
fragment_sacador_collections.adapter = adapter
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun navigateToCollectionList(collection:CollectionVO){
|
private fun navigateToCollectionList(collection:CollectionVO){
|
||||||
viewModel.collectionGet(user,password)
|
collectionsList.add(collection)
|
||||||
|
adapter?.notifyDataSetChanged()
|
||||||
|
onCollectionSelectedListener?.onCollectionSelected(collection, SACADOR)
|
||||||
|
//viewModel.collectionGet(user,password)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
import es.verdnatura.presentation.view.feature.sacador.mapper.toDateFormat
|
import es.verdnatura.presentation.view.feature.sacador.mapper.toDateFormat
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionListVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionListVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
@ -27,8 +28,8 @@ class SacadorViewModel : BaseViewModel() {
|
||||||
get() = _collectionTicketList
|
get() = _collectionTicketList
|
||||||
|
|
||||||
|
|
||||||
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String){
|
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,print:String){
|
||||||
getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk).enqueue(object :
|
getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,print).enqueue(object :
|
||||||
Callback<CollectionVO> {
|
Callback<CollectionVO> {
|
||||||
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||||
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = t.message!!)
|
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = t.message!!)
|
||||||
|
@ -38,9 +39,9 @@ class SacadorViewModel : BaseViewModel() {
|
||||||
response: Response<CollectionVO>
|
response: Response<CollectionVO>
|
||||||
) {
|
) {
|
||||||
if (response.body() != null){
|
if (response.body() != null){
|
||||||
_collectionTicketList.value = response.body()?.let { it }
|
_collectionTicketList.value = response.body()?.let { it.map() }
|
||||||
}else{
|
}else{
|
||||||
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = "Error en la llamada de collection_get")
|
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = "No hay tickets para sacar")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -48,7 +48,8 @@ class SaleVO(
|
||||||
var startQuantity : String = "",
|
var startQuantity : String = "",
|
||||||
var workerFk : String = "",
|
var workerFk : String = "",
|
||||||
var placements : List<PlacementVO> = listOf(),
|
var placements : List<PlacementVO> = listOf(),
|
||||||
var Barcodes : List<String> = listOf()
|
var Barcodes : List<String> = listOf(),
|
||||||
|
var isNew : Boolean = false
|
||||||
)
|
)
|
||||||
|
|
||||||
class PlacementVO(
|
class PlacementVO(
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
style="@style/InputLineTextSearch"
|
style="@style/InputLineTextSearch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:backgroundTint="@android:color/white"
|
android:backgroundTint="@android:color/white"
|
||||||
android:hint="Nuevo valor"
|
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
@ -66,7 +65,6 @@
|
||||||
style="@style/InputLineTextSearch"
|
style="@style/InputLineTextSearch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:backgroundTint="@android:color/white"
|
android:backgroundTint="@android:color/white"
|
||||||
android:hint="Cantidad"
|
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
style="@style/DialogTheme"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/layout_margin_1"
|
||||||
|
app:cardBackgroundColor="@color/verdnatura_black_8"
|
||||||
|
app:cardCornerRadius="@dimen/dialog_radius">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/default_layout_margin">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/custom_dialog_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/layout_margin_3"
|
||||||
|
android:layout_marginBottom="@dimen/default_layout_margin"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h6"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="¿Estás seguro de que deseas eliminar el dispositivo de celia?"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/custom_dialog_description"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/body1"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Este cambio no podrá deshacerse a no ser que vuelvas a vincular el dispositivo"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/textinputlayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColorHint="@android:color/darker_gray"
|
||||||
|
android:layout_marginTop="@dimen/layout_margin_min">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/custom_dialog_value"
|
||||||
|
style="@style/InputLineTextSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:hint="Nueva cantidad"
|
||||||
|
android:inputType="number"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/custom_dialog_button_ok"
|
||||||
|
style="@style/DefaultButton.NormalButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/default_layout_margin"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Falta"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/custom_dialog_button_ok_two"
|
||||||
|
style="@style/DefaultButton.NormalButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/default_layout_margin"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Basura"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/custom_dialog_button_ok_three"
|
||||||
|
style="@style/DefaultButton.NormalButtonTwo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/default_layout_margin"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Split"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/custom_dialog_button_ko"
|
||||||
|
style="@style/DefaultButton.TransparentButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/default_layout_margin"
|
||||||
|
android:layout_marginBottom="@dimen/default_layout_margin"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Cancelar"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
|
@ -16,62 +16,42 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<EditText
|
||||||
android:id="@+id/scan"
|
android:id="@+id/scan_input"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:hint="Escaner"
|
||||||
|
android:inputType="text"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textColorHint="@android:color/darker_gray"
|
android:textColorHint="@android:color/darker_gray"
|
||||||
|
android:textSize="@dimen/body2"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/main_toolbar">
|
app:layout_constraintTop_toBottomOf="@+id/main_toolbar"
|
||||||
|
android:paddingLeft="@dimen/default_layout_margin"/>
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:id="@+id/scan_input"
|
|
||||||
style="@style/InputLineTextSearch"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:backgroundTint="@android:color/white"
|
|
||||||
android:hint="Escaner"
|
|
||||||
android:inputType="text"
|
|
||||||
android:lines="1"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textColorHint="@android:color/darker_gray" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<ViewSwitcher
|
|
||||||
android:id="@+id/collection_switcher"
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/collection_swipe"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/scan">
|
app:layout_constraintTop_toBottomOf="@+id/scan_input">
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/collection_swipe"
|
android:id="@+id/fragment_sacador_collections"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="8dp">
|
android:layout_marginTop="8dp"
|
||||||
|
tools:listitem="@layout/item_article_row" />
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/fragment_sacador_collections"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
tools:listitem="@layout/item_article_row" />
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/sacador_empty_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/navigation_item_height"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@{viewModel.emptyMessage}"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1" />
|
|
||||||
|
|
||||||
</ViewSwitcher>
|
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/main_toolbar"
|
android:id="@+id/main_toolbar"
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="viewModel"
|
||||||
|
type="es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/verdnatura_black">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/scan"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColorHint="@android:color/darker_gray"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/main_toolbar">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/scan_input"
|
||||||
|
style="@style/InputLineTextSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:hint="Escanea etiqueta"
|
||||||
|
android:inputType="text"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/main_toolbar"
|
||||||
|
layout="@layout/toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/splash_progress"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@color/verdnatura_black_8_alpha_6"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<com.airbnb.lottie.LottieAnimationView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/verdnatura_logo_large_height"
|
||||||
|
app:lottie_autoPlay="true"
|
||||||
|
app:lottie_loop="true"
|
||||||
|
app:lottie_rawRes="@raw/orange_loading"
|
||||||
|
app:lottie_speed="2" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
|
@ -14,34 +14,23 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/verdnatura_black">
|
android:background="@color/verdnatura_black">
|
||||||
|
|
||||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
<ViewSwitcher
|
android:id="@+id/sacador_swipe"
|
||||||
android:id="@+id/sacador_switcher"
|
android:layout_width="0dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="0dp"
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toBottomOf="@+id/main_toolbar">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/fragment_sacador_collections"
|
android:id="@+id/fragment_sacador_collections"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:paddingTop="@dimen/toolbar_height"
|
|
||||||
tools:listitem="@layout/item_collection_row" />
|
tools:listitem="@layout/item_collection_row" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/collection_empty_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/navigation_item_height"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@{viewModel.emptyMessage}"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1" />
|
|
||||||
|
|
||||||
</ViewSwitcher>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/main_toolbar"
|
android:id="@+id/main_toolbar"
|
||||||
|
|
|
@ -97,7 +97,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/layout_margin_min"
|
android:paddingTop="@dimen/layout_margin_min"
|
||||||
android:paddingBottom="@dimen/layout_margin_min"
|
android:paddingBottom="@dimen/layout_margin_min"
|
||||||
android:background="@color/verdnatura_black">
|
android:background="@color/verdnatura_black"
|
||||||
|
style="@style/LayoutClickable">
|
||||||
<!--SEMAFORO=================================================-->
|
<!--SEMAFORO=================================================-->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayout3"
|
android:id="@+id/linearLayout3"
|
||||||
|
@ -144,7 +145,8 @@
|
||||||
app:layout_constraintEnd_toStartOf="@+id/item_article_quantity_picked"
|
app:layout_constraintEnd_toStartOf="@+id/item_article_quantity_picked"
|
||||||
app:layout_constraintStart_toEndOf="@+id/linearLayout3"
|
app:layout_constraintStart_toEndOf="@+id/linearLayout3"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:maxLines="1"/>
|
android:maxLines="1"
|
||||||
|
style="@style/LayoutClickable"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_article_quantity_picked"
|
android:id="@+id/item_article_quantity_picked"
|
||||||
|
@ -175,13 +177,14 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||||
android:text="@{sale.quantity}"
|
android:text="@{sale.originalQuantity}"
|
||||||
tool:text="10"
|
tool:text="10"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/h6"
|
android:textSize="@dimen/h6"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
style="@style/LayoutClickable"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_article_quantity_line1"
|
android:id="@+id/item_article_quantity_line1"
|
||||||
|
@ -229,6 +232,19 @@
|
||||||
app:layout_constraintTop_toBottomOf="@+id/item_article_quantity_line2" />
|
app:layout_constraintTop_toBottomOf="@+id/item_article_quantity_line2" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_error"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_error"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
tool:text="Cantidad original 100"/>
|
||||||
|
</LinearLayout>
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/item_article_placements"
|
android:id="@+id/item_article_placements"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
|
|
|
@ -10,12 +10,14 @@
|
||||||
type="es.verdnatura.presentation.view.feature.sacador.model.PlacementVO" />
|
type="es.verdnatura.presentation.view.feature.sacador.model.PlacementVO" />
|
||||||
</data>
|
</data>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/item_root_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="@dimen/layout_margin_1"
|
android:padding="@dimen/layout_margin_1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min">
|
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||||
|
style="@style/LayoutClickable">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -23,32 +23,56 @@
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/toolbar_title_separator"
|
android:id="@+id/toolbar_title_separator"
|
||||||
android:layout_width="2dp"
|
android:layout_width="1dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/default_layout_margin"
|
android:layout_marginTop="@dimen/default_layout_margin"
|
||||||
android:layout_marginBottom="@dimen/default_layout_margin"
|
android:layout_marginBottom="@dimen/default_layout_margin"
|
||||||
android:background="@color/verdnatura_pumpkin_orange" />
|
android:background="@color/verdnatura_pumpkin_orange" />
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/toolbar_title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:maxLines="1"
|
android:orientation="vertical"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:padding="@dimen/layout_margin_min">
|
||||||
android:textSize="@dimen/h8"
|
<TextView
|
||||||
android:textStyle="bold"
|
android:id="@+id/toolbar_title"
|
||||||
android:text="Title fragment"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginLeft="@dimen/layout_margin_1"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical"/>
|
android:layout_weight="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h8"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="Title fragment"
|
||||||
|
android:layout_marginLeft="@dimen/layout_margin_min"
|
||||||
|
android:gravity="center_vertical"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/toolbar_subtitle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/body2"
|
||||||
|
android:text=""
|
||||||
|
android:layout_marginLeft="@dimen/layout_margin_min"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
tool:visibility="visible"
|
||||||
|
tool:text = "10/20"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/toolbar_icons"
|
android:id="@+id/toolbar_icons"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_1"
|
|
||||||
tool:listitem="@layout/item_toolbar_row"
|
tool:listitem="@layout/item_toolbar_row"
|
||||||
android:layout_marginRight="@dimen/layout_margin_1" />
|
tool:visibility="visible"/>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in New Issue