v5.0.16
This commit is contained in:
parent
1228b24064
commit
42bcd8cebd
|
@ -12,8 +12,8 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 9
|
versionCode 16
|
||||||
versionName "5.0.9"
|
versionName "5.0.16"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
android:screenOrientation="portrait"/>
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".presentation.view.feature.main.activity.MainActivity"
|
android:name=".presentation.view.feature.main.activity.MainActivity"
|
||||||
android:windowSoftInputMode="stateHidden"
|
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait"/>
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
|
|
|
@ -8,8 +8,8 @@ import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class ApiUtils {
|
class ApiUtils {
|
||||||
companion object {
|
companion object {
|
||||||
const val BASE_URL:String = "http://192.168.1.111:8008/"
|
//const val BASE_URL:String = "http://192.168.1.101:8009/"
|
||||||
//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()
|
||||||
.baseUrl(BASE_URL)
|
.baseUrl(BASE_URL)
|
||||||
|
@ -29,5 +29,4 @@ class ApiUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -105,5 +105,12 @@ class GetSacadorControladorUserCase : RestClient() {
|
||||||
return restClient!!.getIdFromCode("json","1",usuario,password,"application/json",params)
|
return restClient!!.getIdFromCode("json","1",usuario,password,"application/json",params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun collectionIncreaseQuantity(usuario:String,password:String,saleFk: String, quantity: String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(quantity)
|
||||||
|
return restClient!!.collectionIncreaseQuantity("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,6 +171,15 @@ interface VerdnaturaService {
|
||||||
@Body params: List<String>):
|
@Body params: List<String>):
|
||||||
Call<String>
|
Call<String>
|
||||||
|
|
||||||
|
@POST("almacennew/collectionIncreaseQuantity")
|
||||||
|
fun collectionIncreaseQuantity(@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 ========================================================================>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package es.verdnatura.presentation.common
|
package es.verdnatura.presentation.common
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
|
@ -8,6 +9,7 @@ import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
@ -125,4 +127,17 @@ fun RecyclerView.addViewObserver(function: () -> Unit) {
|
||||||
function.invoke()
|
function.invoke()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Fragment.hideKeyboard() {
|
||||||
|
view?.let { activity?.hideKeyboard(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Activity.hideKeyboard() {
|
||||||
|
hideKeyboard(currentFocus ?: View(this))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Context.hideKeyboard(view: View) {
|
||||||
|
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
|
val hideSoftInputFromWindow = inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
||||||
}
|
}
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.component
|
||||||
import android.app.Dialog
|
import android.app.Dialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import com.google.android.material.textfield.TextInputEditText
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
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.*
|
||||||
|
@ -43,6 +44,9 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
|
||||||
return custom_dialog_value.text.toString()
|
return custom_dialog_value.text.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getEditText() : TextInputEditText {
|
||||||
|
return custom_dialog_value
|
||||||
|
}
|
||||||
fun setValue(value : String): CustomDialogThreeButtons{
|
fun setValue(value : String): CustomDialogThreeButtons{
|
||||||
custom_dialog_value.setText(value)
|
custom_dialog_value.setText(value)
|
||||||
textinputlayout.visibility = View.VISIBLE
|
textinputlayout.visibility = View.VISIBLE
|
||||||
|
@ -63,6 +67,13 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setOkButtonAdd(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_button_add.visibility = View.VISIBLE
|
||||||
|
custom_dialog_button_add.text = text
|
||||||
|
custom_dialog_button_add.setOnClickListener { onButtonClicked() }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||||
custom_dialog_button_ko.text = text
|
custom_dialog_button_ko.text = text
|
||||||
|
|
|
@ -42,8 +42,8 @@ class SaleAdapter (
|
||||||
) : RecyclerView.ViewHolder(binding.root){
|
) : RecyclerView.ViewHolder(binding.root){
|
||||||
fun bind(sale: SaleVO) {
|
fun bind(sale: SaleVO) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
if (sale.startQuantity.isNullOrEmpty())
|
if (sale.pickedQuantity.isNullOrEmpty())
|
||||||
sale.startQuantity = "0"
|
sale.pickedQuantity = "0"
|
||||||
|
|
||||||
val childLayoutManager = LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
val childLayoutManager = LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ class SaleAdapter (
|
||||||
layoutError.visibility = View.VISIBLE
|
layoutError.visibility = View.VISIBLE
|
||||||
txtError.text = "Cantidad original: "+sale.quantity
|
txtError.text = "Cantidad original: "+sale.quantity
|
||||||
if (sale.isPrepared == "1" || sale.isControlled == "1")
|
if (sale.isPrepared == "1" || sale.isControlled == "1")
|
||||||
sale.startQuantity = sale.originalQuantity
|
sale.pickedQuantity = sale.originalQuantity
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sale.isNew){
|
if (sale.isNew){
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.media.MediaPlayer
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
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
|
||||||
|
@ -16,7 +17,6 @@ import es.verdnatura.databinding.FragmentCollectionBinding
|
||||||
import es.verdnatura.domain.ConstAndValues.CHECKED
|
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.PREPARED
|
||||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
|
@ -37,7 +37,6 @@ import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyList
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
import kotlinx.android.synthetic.main.activity_main.*
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||||
import kotlinx.android.synthetic.main.fragment_collection.splash_progress
|
|
||||||
import kotlinx.android.synthetic.main.toolbar.*
|
import kotlinx.android.synthetic.main.toolbar.*
|
||||||
|
|
||||||
class CollectionFragment(
|
class CollectionFragment(
|
||||||
|
@ -145,14 +144,15 @@ class CollectionFragment(
|
||||||
|
|
||||||
private fun scanRequest(){
|
private fun scanRequest(){
|
||||||
scan_input.requestFocus()
|
scan_input.requestFocus()
|
||||||
(activity as MainActivity).hideKeyboard(scan_input)
|
hideKeyboards()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setEvents(){
|
private fun setEvents(){
|
||||||
backButton.setOnClickListener {
|
backButton.setOnClickListener {
|
||||||
activity!!.onBackPressed()
|
activity!!.onBackPressed()
|
||||||
}
|
}
|
||||||
|
//ESCANER =========
|
||||||
|
hideKeyboards()
|
||||||
scan_input.requestFocus()
|
scan_input.requestFocus()
|
||||||
scan_input.setOnEditorActionListener { v, actionId, event ->
|
scan_input.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) {
|
||||||
|
@ -160,13 +160,15 @@ class CollectionFragment(
|
||||||
findSale(scan_input.text.toString())
|
findSale(scan_input.text.toString())
|
||||||
}
|
}
|
||||||
scan_input.setText("")
|
scan_input.setText("")
|
||||||
(activity as MainActivity).hideKeyboard(scan_input)
|
hideKeyboards()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
(activity as MainActivity).hideKeyboard(scan_input)
|
|
||||||
|
|
||||||
|
hideKeyboards()
|
||||||
|
|
||||||
|
//LISTA =========
|
||||||
collection_swipe.setOnRefreshListener {
|
collection_swipe.setOnRefreshListener {
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)
|
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)
|
||||||
|
@ -174,18 +176,30 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun hideKeyboards(){
|
||||||
|
requireActivity().hideKeyboard()
|
||||||
|
}
|
||||||
|
|
||||||
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.isNotEmpty()){
|
if (!it.isError){
|
||||||
collection = it
|
if(it.tickets.isNotEmpty()){
|
||||||
createCollectionList()
|
collection = it
|
||||||
|
createCollectionList()
|
||||||
|
}else{
|
||||||
|
toolbar_subtitle.text = "0/0"
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
toolbar_subtitle.text = "0/0"
|
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||||
|
customDialog.dismiss()
|
||||||
|
activity!!.onBackPressed()
|
||||||
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||||
|
@ -206,7 +220,7 @@ class CollectionFragment(
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage).setKoButton("Cerrar"){
|
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage).setKoButton("Cerrar"){
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.hide()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
@ -224,12 +238,12 @@ class CollectionFragment(
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setKoButton("Cerrar"){
|
customDialog.setTitle("Error").setDescription(it.errorMessage).setKoButton("Cerrar"){
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.hide()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
if (checkItemScan(it.response)){
|
if (checkItemScan(it.response)){
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.dismiss()
|
||||||
mpok?.start()
|
mpok?.start()
|
||||||
onQuantityOfShelvingSelected(itemShelvingFkStored)
|
onQuantityOfShelvingSelected(itemShelvingFkStored)
|
||||||
}else{
|
}else{
|
||||||
|
@ -243,6 +257,11 @@ class CollectionFragment(
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
responseIncQuantity.observe(viewLifecycleOwner, Observer {
|
||||||
|
/* splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,8 +291,17 @@ class CollectionFragment(
|
||||||
override fun onSaleClick(sale: SaleVO) {
|
override fun onSaleClick(sale: SaleVO) {
|
||||||
sales.forEachIndexed { index, saleVO ->
|
sales.forEachIndexed { index, saleVO ->
|
||||||
if (saleVO.saleFk == sale.saleFk){
|
if (saleVO.saleFk == sale.saleFk){
|
||||||
if (type == CONTROLADOR) markLine(index,type)
|
if (type == CONTROLADOR) {
|
||||||
else if (type == SACADOR) unMarkLine(index, OK)
|
markLine(index,type)
|
||||||
|
} else if (type == SACADOR){
|
||||||
|
if (sale.isPrepared == "0"){
|
||||||
|
showScanner(index,sale)
|
||||||
|
}else{
|
||||||
|
unMarkLine(index, OK)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,7 +335,7 @@ class CollectionFragment(
|
||||||
var isOk = false
|
var isOk = false
|
||||||
if (type == SACADOR){
|
if (type == SACADOR){
|
||||||
for (saleVO in sales) {
|
for (saleVO in sales) {
|
||||||
if(saleVO.startQuantity != saleVO.quantity){
|
if(saleVO.isPrepared != "1"){
|
||||||
//1- Por itemFk
|
//1- Por itemFk
|
||||||
if (txtscan == saleVO.itemFk){
|
if (txtscan == saleVO.itemFk){
|
||||||
mpok!!.start()
|
mpok!!.start()
|
||||||
|
@ -385,11 +413,54 @@ class CollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun findSale(txtscan:String,position: Int){
|
||||||
|
var isOk = false
|
||||||
|
if (type == SACADOR){
|
||||||
|
var saleVO = sales[position]
|
||||||
|
|
||||||
|
if(saleVO.isPrepared != "1"){
|
||||||
|
//1- Por itemFk
|
||||||
|
if (txtscan == saleVO.itemFk){
|
||||||
|
mpok!!.start()
|
||||||
|
isOk = true
|
||||||
|
markLine(position,type)
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!isOk){
|
||||||
|
//2- Por carro
|
||||||
|
var shelvingIndex = 0
|
||||||
|
for (placementVO in saleVO.placements){
|
||||||
|
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
||||||
|
mpok!!.start()
|
||||||
|
isOk = true
|
||||||
|
showShelving(position,shelvingIndex)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
shelvingIndex+=1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isOk){
|
||||||
|
//3- Por barcode
|
||||||
|
saleVO.Barcodes.forEach { barcode ->
|
||||||
|
if (txtscan == barcode){
|
||||||
|
mpok!!.start()
|
||||||
|
isOk = true
|
||||||
|
markLine(position,type)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isOk) mperror!!.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun markLine(position:Int,newType: String){
|
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].originalQuantity
|
sales[position].pickedQuantity = sales[position].originalQuantity
|
||||||
}
|
}
|
||||||
}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"
|
||||||
|
@ -417,7 +488,7 @@ class CollectionFragment(
|
||||||
password = password,
|
password = password,
|
||||||
saleFk = sales[position].saleFk,
|
saleFk = sales[position].saleFk,
|
||||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if(type == CONTROLADOR) sales[position].isControlled else "1",
|
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if(type == CONTROLADOR) sales[position].isControlled else "1",
|
||||||
vOriginalQuantity = sales[position].startQuantity,
|
vOriginalQuantity = sales[position].pickedQuantity,
|
||||||
vStateFk = type.toString()
|
vStateFk = type.toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -427,7 +498,7 @@ class CollectionFragment(
|
||||||
if (sales[position].isPrepared == "1"){
|
if (sales[position].isPrepared == "1"){
|
||||||
customDialog.setTitle("Desmarcar linea").setDescription("Vas a desmarcar la linea: "+sales[position].itemFk+ " ¿Estás seguro?").setOkButton("Desmarcar"){
|
customDialog.setTitle("Desmarcar linea").setDescription("Vas a desmarcar la linea: "+sales[position].itemFk+ " ¿Estás seguro?").setOkButton("Desmarcar"){
|
||||||
sales[position].isPrepared = "0"
|
sales[position].isPrepared = "0"
|
||||||
sales[position].startQuantity = "0"
|
sales[position].pickedQuantity = "0"
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
setListPosition(position)
|
setListPosition(position)
|
||||||
viewModel.saleTrackingDel(
|
viewModel.saleTrackingDel(
|
||||||
|
@ -437,10 +508,10 @@ class CollectionFragment(
|
||||||
)
|
)
|
||||||
setTotalLines()
|
setTotalLines()
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.hide()
|
customDialog.dismiss()
|
||||||
}.setKoButton("Cancelar"){
|
}.setKoButton("Cancelar"){
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialog.hide()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,7 +527,24 @@ class CollectionFragment(
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
var quantityGet = "0"
|
var quantityGet = "0"
|
||||||
try{
|
try{
|
||||||
quantityGet = (sales[position].originalQuantity.toInt() - sales[position].startQuantity.toInt()).toString()
|
quantityGet = (sales[position].originalQuantity.toInt() - sales[position].pickedQuantity.toInt()).toString()
|
||||||
|
}catch (e:Exception){}
|
||||||
|
viewModel.itemPlacementSupplyAiming(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
itemFk = sales[position].itemFk,
|
||||||
|
quantity = quantityGet,
|
||||||
|
shelvingFk = sales[position].placements[shelvingPosition].shelving
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showShelving(position:Int,shelvingPosition:Int,quantity:String){
|
||||||
|
storedShelvingPosition = shelvingPosition
|
||||||
|
storedPosition = position
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
var quantityGet = "0"
|
||||||
|
try{
|
||||||
|
quantityGet = quantity
|
||||||
}catch (e:Exception){}
|
}catch (e:Exception){}
|
||||||
viewModel.itemPlacementSupplyAiming(
|
viewModel.itemPlacementSupplyAiming(
|
||||||
usuario = user,
|
usuario = user,
|
||||||
|
@ -491,8 +579,7 @@ class CollectionFragment(
|
||||||
if (checkItemScan(customDialogList.getValueTwo())){
|
if (checkItemScan(customDialogList.getValueTwo())){
|
||||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||||
mpok?.start()
|
mpok?.start()
|
||||||
scanRequest()
|
customDialogList.dismiss()
|
||||||
customDialogList.hide()
|
|
||||||
}else{
|
}else{
|
||||||
itemShelvingFkStored = itemShelvingFk
|
itemShelvingFkStored = itemShelvingFk
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
@ -501,9 +588,10 @@ class CollectionFragment(
|
||||||
password = password,
|
password = password,
|
||||||
code = customDialogList.getValueTwo()
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
scanRequest()
|
||||||
|
hideKeyboards()
|
||||||
}else{
|
}else{
|
||||||
"Escanea item para validar".toast(requireContext())
|
"Escanea item para validar".toast(requireContext())
|
||||||
}
|
}
|
||||||
|
@ -511,13 +599,17 @@ class CollectionFragment(
|
||||||
|
|
||||||
}.setKoButton("Cerrar"){
|
}.setKoButton("Cerrar"){
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.hide()
|
hideKeyboards()
|
||||||
|
customDialogList.dismiss()
|
||||||
}.setHintValue("Cantidad que coges:").setValue(total).setHintValueTwo("Escanea item").setValueTwo("").show()
|
}.setHintValue("Cantidad que coges:").setValue(total).setHintValueTwo("Escanea item").setValueTwo("").show()
|
||||||
|
|
||||||
|
|
||||||
|
customDialogList.getEditTextTwo().post(Runnable {
|
||||||
customDialogList.getEditTextTwo().requestFocus()
|
customDialogList.getEditTextTwo().requestFocusFromTouch()
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditTextTwo())
|
val lManager: InputMethodManager =
|
||||||
|
activity!!.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
|
lManager.hideSoftInputFromWindow(customDialogList.getEditTextTwo().windowToken, InputMethodManager.SHOW_FORCED)
|
||||||
|
})
|
||||||
|
|
||||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
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) {
|
||||||
|
@ -525,8 +617,7 @@ class CollectionFragment(
|
||||||
if (checkItemScan(customDialogList.getValueTwo())){
|
if (checkItemScan(customDialogList.getValueTwo())){
|
||||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||||
mpok?.start()
|
mpok?.start()
|
||||||
scanRequest()
|
customDialogList.dismiss()
|
||||||
customDialogList.hide()
|
|
||||||
}else{
|
}else{
|
||||||
itemShelvingFkStored = itemShelvingFk
|
itemShelvingFkStored = itemShelvingFk
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
@ -535,14 +626,13 @@ class CollectionFragment(
|
||||||
password = password,
|
password = password,
|
||||||
code = customDialogList.getValueTwo()
|
code = customDialogList.getValueTwo()
|
||||||
)
|
)
|
||||||
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
"Escanea item para validar".toast(requireContext())
|
"Escanea item para validar".toast(requireContext())
|
||||||
}
|
}
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditTextTwo())
|
scanRequest()
|
||||||
|
hideKeyboards()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -561,6 +651,7 @@ class CollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
},showDelete = false)
|
},showDelete = false)
|
||||||
|
|
||||||
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
|
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
|
||||||
|
|
||||||
customDialogList.getRecyclerView().layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
customDialogList.getRecyclerView().layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
@ -600,11 +691,11 @@ class CollectionFragment(
|
||||||
|
|
||||||
//2- MODIFICAR EL PICKED DEL SALE
|
//2- MODIFICAR EL PICKED DEL SALE
|
||||||
try{
|
try{
|
||||||
sales[storedPosition].startQuantity = (sales[storedPosition].startQuantity.toInt() + customDialogList.getValue().toInt()).toString()
|
sales[storedPosition].pickedQuantity = (sales[storedPosition].pickedQuantity.toInt() + customDialogList.getValue().toInt()).toString()
|
||||||
}catch (e:Exception){}
|
}catch (e:Exception){}
|
||||||
|
|
||||||
//3- MARCAR LINEA
|
//3- MARCAR LINEA
|
||||||
if (sales[storedPosition].startQuantity != sales[storedPosition].originalQuantity){
|
if (sales[storedPosition].pickedQuantity != sales[storedPosition].originalQuantity){
|
||||||
sales[storedPosition].isPrepared = "1"
|
sales[storedPosition].isPrepared = "1"
|
||||||
markLine(storedPosition, OK)
|
markLine(storedPosition, OK)
|
||||||
}else{
|
}else{
|
||||||
|
@ -650,24 +741,24 @@ class CollectionFragment(
|
||||||
warehouseFk = warehouseFk
|
warehouseFk = warehouseFk
|
||||||
)
|
)
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton("Cerrar"){
|
}.setKoButton("Cerrar"){
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.dismiss()
|
||||||
}.setHintValue("Artículo:").setValue("").setHintValueTwo("Cantidad:").setValueTwo("").show()
|
}.setHintValue("Artículo:").setValue("").setHintValueTwo("Cantidad:").setValueTwo("").show()
|
||||||
|
|
||||||
customDialogList.getEditText().requestFocus()
|
customDialogList.getEditText().requestFocus()
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
hideKeyboards()
|
||||||
|
|
||||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogList.getEditText().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.getValue().isNullOrEmpty()){
|
||||||
customDialogList.getEditTextTwo().requestFocus()
|
customDialogList.getEditTextTwo().requestFocus()
|
||||||
}
|
}
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
hideKeyboards()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -691,13 +782,13 @@ class CollectionFragment(
|
||||||
warehouseFk = warehouseFk
|
warehouseFk = warehouseFk
|
||||||
)
|
)
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditTextTwo())
|
hideKeyboards()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogList.hide()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -721,7 +812,7 @@ class CollectionFragment(
|
||||||
|
|
||||||
customDialogInput.setTitle("Ver disponible").setDescription("Escanea etiqueta: ").setOkButton("Buscar"){
|
customDialogInput.setTitle("Ver disponible").setDescription("Escanea etiqueta: ").setOkButton("Buscar"){
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
hideKeyboards()
|
||||||
viewModel.itemGetAvailable(
|
viewModel.itemGetAvailable(
|
||||||
usuario = user,
|
usuario = user,
|
||||||
password = password,
|
password = password,
|
||||||
|
@ -729,13 +820,13 @@ class CollectionFragment(
|
||||||
warehouseFk = warehouseFk
|
warehouseFk = warehouseFk
|
||||||
)
|
)
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInput.hide()
|
customDialogInput.dismiss()
|
||||||
|
|
||||||
}.setKoButton("Cancelar"){
|
}.setKoButton("Cancelar"){
|
||||||
splash_progress.visibility = View.GONE
|
splash_progress.visibility = View.GONE
|
||||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
hideKeyboards()
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInput.hide()
|
customDialogInput.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
customDialogInput.getEditText().requestFocus()
|
customDialogInput.getEditText().requestFocus()
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
|
@ -751,8 +842,8 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
customDialogInput.setValue("")
|
customDialogInput.setValue("")
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInput.hide()
|
customDialogInput.dismiss()
|
||||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
hideKeyboards()
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -766,7 +857,7 @@ 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()
|
scanRequest()
|
||||||
customDialog.hide()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -802,15 +893,15 @@ class CollectionFragment(
|
||||||
}else{
|
}else{
|
||||||
trash(position,customDialogThreeButtons.getValue())
|
trash(position,customDialogThreeButtons.getValue())
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtons.hide()
|
customDialogThreeButtons.dismiss()
|
||||||
}
|
}
|
||||||
}.setOkButtonTwo("Basura"){
|
}.setOkButtonTwo("Basura / Rechazar"){
|
||||||
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
"Indica nueva cantidad".toast(requireContext())
|
"Indica nueva cantidad".toast(requireContext())
|
||||||
}else{
|
}else{
|
||||||
missing(position,customDialogThreeButtons.getValue())
|
missing(position,customDialogThreeButtons.getValue())
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtons.hide()
|
customDialogThreeButtons.dismiss()
|
||||||
}
|
}
|
||||||
}.setOkButtonThree("Split"){
|
}.setOkButtonThree("Split"){
|
||||||
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
|
@ -818,12 +909,20 @@ class CollectionFragment(
|
||||||
}else{
|
}else{
|
||||||
split(position,customDialogThreeButtons.getValue())
|
split(position,customDialogThreeButtons.getValue())
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtons.hide()
|
customDialogThreeButtons.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}.setOkButtonAdd("Agregar"){
|
||||||
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
|
"Indica nueva cantidad".toast(requireContext())
|
||||||
|
}else{
|
||||||
|
increaseQuantity(position,customDialogThreeButtons.getValue())
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtons.dismiss()
|
||||||
|
}
|
||||||
}.setKoButton("Cancelar"){
|
}.setKoButton("Cancelar"){
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtons.hide()
|
customDialogThreeButtons.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -895,6 +994,25 @@ class CollectionFragment(
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun increaseQuantity(position:Int,quantity:String){
|
||||||
|
viewModel.collectionIncreaseQuantity(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
saleFk = sales[position].saleFk,
|
||||||
|
quantity = quantity
|
||||||
|
)
|
||||||
|
try {
|
||||||
|
val quantityPicked = (quantity.toInt() - sales[position].quantity.toInt()).toString()
|
||||||
|
sales[position].originalQuantity = quantity
|
||||||
|
sales[position].quantity = quantity
|
||||||
|
if (type == CONTROLADOR){
|
||||||
|
showShelving(position,0,quantityPicked)
|
||||||
|
}
|
||||||
|
}catch (e:Exception){}
|
||||||
|
saleAdapter?.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//ESTADOS
|
//ESTADOS
|
||||||
|
|
||||||
private fun changeTicketState(){
|
private fun changeTicketState(){
|
||||||
|
@ -918,6 +1036,36 @@ class CollectionFragment(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//OTROS
|
||||||
|
private fun showScanner(index:Int, sale:SaleVO){
|
||||||
|
customDialogInput.setTitle(""+sale.itemFk).setDescription("Escanea el carro para el item seleccionado").setOkButton("Aceptar"){
|
||||||
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
|
findSale(customDialogInput.getValue(),index)
|
||||||
|
}
|
||||||
|
customDialogInput.setValue("")
|
||||||
|
scanRequest()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
hideKeyboards()
|
||||||
|
}.setKoButton("Cancelar"){
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
}.setValue("").show()
|
||||||
|
customDialogInput.getEditText().requestFocus()
|
||||||
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
|
findSale(customDialogInput.getValue(),index)
|
||||||
|
}
|
||||||
|
customDialogInput.setValue("")
|
||||||
|
scanRequest()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
hideKeyboards()
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,10 @@ class CollectionViewModel : BaseViewModel() {
|
||||||
val responseCode: LiveData<ResponseItemVO>
|
val responseCode: LiveData<ResponseItemVO>
|
||||||
get() = _responseCode
|
get() = _responseCode
|
||||||
|
|
||||||
|
private val _responseIncQuantity by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseIncQuantity: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseIncQuantity
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private val _item by lazy { MutableLiveData<ItemVO>() }
|
private val _item by lazy { MutableLiveData<ItemVO>() }
|
||||||
|
@ -268,4 +272,20 @@ class CollectionViewModel : BaseViewModel() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun collectionIncreaseQuantity(usuario:String,password:String,saleFk: String,quantity: String){
|
||||||
|
getSacadorControladorUserCase.collectionIncreaseQuantity(usuario,password,saleFk,quantity).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_responseIncQuantity.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_responseIncQuantity.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionIncreaseQuantity")
|
||||||
|
}else{
|
||||||
|
_responseIncQuantity.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,32 +7,43 @@ import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
fun CollectionVO.map() : CollectionVO{
|
fun CollectionVO.map() : CollectionVO{
|
||||||
this.tickets.forEach {ticket ->
|
try {
|
||||||
ticket.sales.forEach {
|
this.tickets.forEach { ticket ->
|
||||||
it.ticketFk = ticket.ticketFk
|
ticket.sales.forEach {
|
||||||
it.level = ticket.level
|
it.ticketFk = ticket.ticketFk
|
||||||
it.agencyName = ticket.agencyName
|
it.level = ticket.level
|
||||||
it.quantity = it.quantity.substring(0,it.quantity.indexOf("."))
|
it.agencyName = ticket.agencyName
|
||||||
it.isNew = it.isAdded == "1"
|
it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))
|
||||||
it.originalQuantity = if (it.originalQuantity != "-1") it.originalQuantity.substring(0,it.originalQuantity.indexOf(".")) else it.quantity
|
it.isNew = it.isAdded == "1"
|
||||||
it.startQuantity = if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.startQuantity
|
it.originalQuantity =
|
||||||
if (!it.placements.isNullOrEmpty()){
|
if (it.originalQuantity != "-1") it.originalQuantity.substring(
|
||||||
it.placements.forEachIndexed { index, placement ->
|
0,
|
||||||
if (index == 0){
|
it.originalQuantity.indexOf(".")
|
||||||
try{
|
) else it.quantity
|
||||||
it.saleOrder = placement.saleOrder.toInt()
|
it.pickedQuantity =
|
||||||
}catch (e:NumberFormatException){
|
if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.pickedQuantity
|
||||||
it.saleOrder = 9999
|
if (!it.placements.isNullOrEmpty()) {
|
||||||
|
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 + ")"
|
||||||
}
|
}
|
||||||
placement.created = getCalendarFromDate(placement.created).convertToDateString()
|
} else {
|
||||||
placement.visible = "("+placement.visible+")"
|
it.placements = listOf()
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
it.placements = listOf()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}catch (e:Exception){
|
||||||
|
this.isError = true
|
||||||
|
this.errorMessage = "La colección no tiene tickets"
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
||||||
super.onAttach(context)
|
super.onAttach(context)
|
||||||
if (context is OnCollectionSelectedListener) onCollectionSelectedListener = context
|
if (context is OnCollectionSelectedListener) onCollectionSelectedListener = context
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_sacador
|
override fun getLayoutId(): Int = R.layout.fragment_sacador
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
@ -60,6 +61,7 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
||||||
override fun init() {
|
override fun init() {
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
splash_progress_two.visibility = View.GONE
|
||||||
toolbar_title.text = "collection_get"
|
toolbar_title.text = "collection_get"
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -81,7 +83,7 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
||||||
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 == iconAdd){
|
if(item == iconAdd){
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress_two.visibility = View.VISIBLE
|
||||||
viewModel.collectionTicketGet(user,password,"",sectorFk,"1")
|
viewModel.collectionTicketGet(user,password,"",sectorFk,"1")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,14 +107,13 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
||||||
goBack2 = false
|
goBack2 = false
|
||||||
})
|
})
|
||||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||||
splash_progress.visibility = View.GONE
|
splash_progress_two.visibility = View.GONE
|
||||||
if (it.isError){
|
if (it.isError){
|
||||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||||
customDialog.hide()
|
customDialog.hide()
|
||||||
}.show()
|
}.show()
|
||||||
}else{
|
}else{
|
||||||
if (!goBack)navigateToCollectionList(it)
|
if (!goBack)navigateToCollectionList(it)
|
||||||
|
|
||||||
}
|
}
|
||||||
goBack = false
|
goBack = false
|
||||||
})
|
})
|
||||||
|
@ -135,7 +136,6 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
||||||
collectionsList.add(collection)
|
collectionsList.add(collection)
|
||||||
adapter?.notifyDataSetChanged()
|
adapter?.notifyDataSetChanged()
|
||||||
onCollectionSelectedListener?.onCollectionSelected(collection, SACADOR)
|
onCollectionSelectedListener?.onCollectionSelected(collection, SACADOR)
|
||||||
//viewModel.collectionGet(user,password)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class SaleVO(
|
||||||
var line2 : String = "",
|
var line2 : String = "",
|
||||||
var line3 : String = "",
|
var line3 : String = "",
|
||||||
var isAdded : String = "",
|
var isAdded : String = "",
|
||||||
var startQuantity : String = "",
|
var pickedQuantity : 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(),
|
||||||
|
|
|
@ -104,7 +104,7 @@ class UbicadorFragment(
|
||||||
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 == iconAdd){
|
if (item == iconAdd){
|
||||||
showAddItem("","","","")
|
showAddItem("","","","",false,null)
|
||||||
}else if(item == iconReload){
|
}else if(item == iconReload){
|
||||||
splash_progress.visibility = View.VISIBLE
|
splash_progress.visibility = View.VISIBLE
|
||||||
viewModel.itemShelvingList(user,password,shelvingFk)
|
viewModel.itemShelvingList(user,password,shelvingFk)
|
||||||
|
@ -238,7 +238,7 @@ class UbicadorFragment(
|
||||||
adapter = UbicadorAdapter(listItems,onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
adapter = UbicadorAdapter(listItems,onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
||||||
onVisibleClickListener = object: OnVisibleClickListener{
|
onVisibleClickListener = object: OnVisibleClickListener{
|
||||||
override fun onVisibleClickListener(item: ItemUbicadorVO) {
|
override fun onVisibleClickListener(item: ItemUbicadorVO) {
|
||||||
showAddItem(item.item,item.packing,item.stickers,item.visible)
|
showAddItem(item.item,item.packing,item.stickers,item.visible,true,item)
|
||||||
}
|
}
|
||||||
|
|
||||||
},onMoreClickListener = object: OnMoreClickListener{
|
},onMoreClickListener = object: OnMoreClickListener{
|
||||||
|
@ -291,12 +291,31 @@ class UbicadorFragment(
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
responseMake.observe(viewLifecycleOwner, Observer {
|
||||||
|
if (!shelvingFk.isNullOrEmpty()){
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
toolbar_title.text = shelvingFk
|
||||||
|
viewModel.itemShelvingList(user,password,shelvingFk)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showAddItem(itemFk:String,packing: String,etiquetas: String,visible: String){
|
private fun showAddItem(itemFk:String,packing: String,etiquetas: String,visible: String, delete:Boolean,itemUbicador:ItemUbicadorVO?){
|
||||||
customDialogUbicador.setTitle("Nuevo item").setItemValue(itemFk).setPackingValue(packing).setEtiquetaValue(etiquetas).setVisibleValue(visible).setOkButton("Guardar"){
|
var title = "Nuevo Item"
|
||||||
saveNewItem(customDialogUbicador.getItemValue(),customDialogUbicador.getEtiquetaValue(),customDialogUbicador.getPackingValue(),customDialogUbicador.getVisibleValue())
|
if (delete) title = "Editar item "+itemFk
|
||||||
|
customDialogUbicador.setTitle(title).setItemValue(itemFk).setPackingValue(packing).setEtiquetaValue(etiquetas).setVisibleValue(visible).setOkButton("Guardar"){
|
||||||
|
if (delete){
|
||||||
|
listItems.remove(itemUbicador)
|
||||||
|
adapter!!.notifyDataSetChanged()
|
||||||
|
itemUbicador?.id?.let { viewModel.itemShelvingDelete(user,password, it) }
|
||||||
|
}
|
||||||
|
var packingUpdate = false
|
||||||
|
if (packing != customDialogUbicador.getPackingValue() || etiquetas != customDialogUbicador.getEtiquetaValue()){
|
||||||
|
packingUpdate = true
|
||||||
|
}
|
||||||
|
saveNewItem(customDialogUbicador.getItemValue(),customDialogUbicador.getEtiquetaValue(),customDialogUbicador.getPackingValue(),customDialogUbicador.getVisibleValue(),if (delete)packingUpdate else null)
|
||||||
}.setKoButton("Cerrar"){
|
}.setKoButton("Cerrar"){
|
||||||
customDialogUbicador.hide()
|
customDialogUbicador.hide()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -306,7 +325,16 @@ class UbicadorFragment(
|
||||||
|
|
||||||
customDialogUbicador.getVisibleItem().setOnEditorActionListener { v, actionId, event ->
|
customDialogUbicador.getVisibleItem().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
saveNewItem(customDialogUbicador.getItemValue(),customDialogUbicador.getEtiquetaValue(),customDialogUbicador.getPackingValue(),customDialogUbicador.getVisibleValue())
|
if (delete){
|
||||||
|
listItems.remove(itemUbicador)
|
||||||
|
adapter!!.notifyDataSetChanged()
|
||||||
|
itemUbicador?.id?.let { viewModel.itemShelvingDelete(user,password, it) }
|
||||||
|
}
|
||||||
|
var packingUpdate = false
|
||||||
|
if (packing != customDialogUbicador.getPackingValue() || etiquetas != customDialogUbicador.getEtiquetaValue()){
|
||||||
|
packingUpdate = true
|
||||||
|
}
|
||||||
|
saveNewItem(customDialogUbicador.getItemValue(),customDialogUbicador.getEtiquetaValue(),customDialogUbicador.getPackingValue(),customDialogUbicador.getVisibleValue(),if (delete)packingUpdate else null)
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -314,38 +342,97 @@ class UbicadorFragment(
|
||||||
|
|
||||||
customDialogUbicador.getEtiquetaItem().setOnEditorActionListener { v, actionId, event ->
|
customDialogUbicador.getEtiquetaItem().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
saveNewItem(customDialogUbicador.getItemValue(),customDialogUbicador.getEtiquetaValue(),customDialogUbicador.getPackingValue(),customDialogUbicador.getVisibleValue())
|
if (delete){
|
||||||
|
listItems.remove(itemUbicador)
|
||||||
|
adapter!!.notifyDataSetChanged()
|
||||||
|
itemUbicador?.id?.let { viewModel.itemShelvingDelete(user,password, it) }
|
||||||
|
}
|
||||||
|
var packingUpdate = false
|
||||||
|
if (packing != customDialogUbicador.getPackingValue() || etiquetas != customDialogUbicador.getEtiquetaValue()){
|
||||||
|
packingUpdate = true
|
||||||
|
}
|
||||||
|
saveNewItem(customDialogUbicador.getItemValue(),customDialogUbicador.getEtiquetaValue(),customDialogUbicador.getPackingValue(),customDialogUbicador.getVisibleValue(),if (delete)packingUpdate else null)
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun saveNewItem(itemFk:String,etiquetas:String,packing:String,visible:String){
|
private fun saveNewItem(itemFk:String,etiquetas:String,packing:String,visible:String,updatePacking:Boolean? = null){
|
||||||
if (!packing.isNullOrEmpty()){
|
if (!packing.isNullOrEmpty()){
|
||||||
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty()){
|
if (updatePacking == null){
|
||||||
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible,packing,warehouseFk,"1")
|
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty()){
|
||||||
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible,packing = packing))
|
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible,packing,warehouseFk,"1")
|
||||||
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible,packing = packing))
|
||||||
customDialogUbicador.getEditItem().requestFocus()
|
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||||
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
customDialogUbicador.getEditItem().requestFocus()
|
||||||
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()){
|
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||||
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
customDialogUbicador.hide()
|
||||||
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1")
|
|
||||||
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
|
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()){
|
||||||
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
||||||
customDialogUbicador.getEditItem().requestFocus()
|
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1")
|
||||||
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
|
||||||
|
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||||
|
customDialogUbicador.getEditItem().requestFocus()
|
||||||
|
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||||
|
customDialogUbicador.hide()
|
||||||
|
|
||||||
|
}else{
|
||||||
|
"Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
"Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty() && !updatePacking){
|
||||||
|
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible,packing,warehouseFk,"1")
|
||||||
|
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible,packing = packing))
|
||||||
|
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||||
|
customDialogUbicador.getEditItem().requestFocus()
|
||||||
|
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||||
|
customDialogUbicador.hide()
|
||||||
|
|
||||||
|
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty() && updatePacking){
|
||||||
|
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
||||||
|
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1")
|
||||||
|
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
|
||||||
|
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||||
|
customDialogUbicador.getEditItem().requestFocus()
|
||||||
|
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||||
|
customDialogUbicador.hide()
|
||||||
|
|
||||||
|
}else{
|
||||||
|
"Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
"Packing obligatorio".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
"Packing obligatorio".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun editItem(itemFk:String,etiquetas:String,packing:String,visible:String){
|
||||||
|
if (!packing.isNullOrEmpty()){
|
||||||
|
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty()){
|
||||||
|
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible,packing,warehouseFk,"1")
|
||||||
|
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible,packing = packing))
|
||||||
|
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||||
|
customDialogUbicador.getEditItem().requestFocus()
|
||||||
|
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||||
|
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()){
|
||||||
|
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
||||||
|
viewModel.itemShelvingMake(user,password,shelvingFk,itemFk,deep.toString(),visible_calc,packing,warehouseFk,"1")
|
||||||
|
changeOfflineValue(ItemUbicadorVO(item = itemFk,visible = visible_calc,packing = packing,stickers = etiquetas))
|
||||||
|
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||||
|
customDialogUbicador.getEditItem().requestFocus()
|
||||||
|
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||||
|
}else{
|
||||||
|
"Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
"Packing obligatorio".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun changeOfflineValue(item:ItemUbicadorVO){
|
private fun changeOfflineValue(item:ItemUbicadorVO){
|
||||||
listItems.add(item)
|
listItems.add(item)
|
||||||
adapter?.notifyDataSetChanged()
|
adapter?.notifyDataSetChanged()
|
||||||
|
|
|
@ -24,6 +24,10 @@ class UbicadorViewModel : BaseViewModel() {
|
||||||
val response: LiveData<ResponseItemVO>
|
val response: LiveData<ResponseItemVO>
|
||||||
get() = _response
|
get() = _response
|
||||||
|
|
||||||
|
private val _responseMake by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseMake: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseMake
|
||||||
|
|
||||||
|
|
||||||
val loadShelvingList = Transformations.map(_shelvingList) { Event(it) }
|
val loadShelvingList = Transformations.map(_shelvingList) { Event(it) }
|
||||||
|
|
||||||
|
@ -57,14 +61,14 @@ class UbicadorViewModel : BaseViewModel() {
|
||||||
fun itemShelvingMake(usuario:String,password:String,shelving:String,item:String,deep:String,quantity:String,packing:String,warehouse:String,level:String){
|
fun itemShelvingMake(usuario:String,password:String,shelving:String,item:String,deep:String,quantity:String,packing:String,warehouse:String,level:String){
|
||||||
getUbicadorUserCase.itemShelvingMake(usuario,password,shelving,item,deep,quantity,packing,warehouse,level).enqueue(object : Callback<String>{
|
getUbicadorUserCase.itemShelvingMake(usuario,password,shelving,item,deep,quantity,packing,warehouse,level).enqueue(object : Callback<String>{
|
||||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
_response.value = ResponseItemVO(isError = true,errorMessage ="Error al guardar item: "+item+ " Respuesta:"+t.message!!)
|
_responseMake.value = ResponseItemVO(isError = true,errorMessage ="Error al guardar item: "+item+ " Respuesta:"+t.message!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
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){
|
||||||
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelvingMake")
|
_responseMake.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelvingMake")
|
||||||
}else{
|
}else{
|
||||||
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
_responseMake.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@color/verdnatura_dark_mint" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="@dimen/btn_radius"
|
||||||
|
android:bottomRightRadius="@dimen/btn_radius"
|
||||||
|
android:topLeftRadius="@dimen/btn_radius"
|
||||||
|
android:topRightRadius="@dimen/btn_radius" />
|
||||||
|
</shape>
|
|
@ -48,7 +48,7 @@
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textColorHint="@android:color/darker_gray" />
|
android:textColorHint="@android:color/darker_gray"/>
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +59,6 @@
|
||||||
android:textColorHint="@android:color/darker_gray"
|
android:textColorHint="@android:color/darker_gray"
|
||||||
android:layout_marginTop="@dimen/layout_margin_min"
|
android:layout_marginTop="@dimen/layout_margin_min"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/custom_dialog_value_two"
|
android:id="@+id/custom_dialog_value_two"
|
||||||
style="@style/InputLineTextSearch"
|
style="@style/InputLineTextSearch"
|
||||||
|
|
|
@ -59,6 +59,15 @@
|
||||||
android:textColorHint="@android:color/darker_gray" />
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/custom_dialog_button_add"
|
||||||
|
style="@style/DefaultButton.NormalButtonThree"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/default_layout_margin"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Agregar"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/custom_dialog_button_ok"
|
android:id="@+id/custom_dialog_button_ok"
|
||||||
style="@style/DefaultButton.NormalButton"
|
style="@style/DefaultButton.NormalButton"
|
||||||
|
|
|
@ -61,5 +61,28 @@
|
||||||
app:lottie_speed="2" />
|
app:lottie_speed="2" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/splash_progress_two"
|
||||||
|
android:visibility="gone"
|
||||||
|
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>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
|
@ -153,7 +153,7 @@
|
||||||
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.startQuantity}"
|
android:text="@{sale.pickedQuantity}"
|
||||||
tool:text="0"
|
tool:text="0"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/h6"
|
android:textSize="@dimen/h6"
|
||||||
|
|
|
@ -39,6 +39,11 @@
|
||||||
<item name="android:textColor">@color/verdnatura_white</item>
|
<item name="android:textColor">@color/verdnatura_white</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="DefaultButton.NormalButtonThree" parent="DefaultButton">
|
||||||
|
<item name="android:background">@drawable/btn_green</item>
|
||||||
|
<item name="android:textColor">@color/verdnatura_white</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="DefaultButton.TransparentButton" parent="DefaultButton">
|
<style name="DefaultButton.TransparentButton" parent="DefaultButton">
|
||||||
<item name="android:background">@drawable/btn_white_transparent</item>
|
<item name="android:background">@drawable/btn_white_transparent</item>
|
||||||
<item name="android:textColor">@color/verdnatura_white</item>
|
<item name="android:textColor">@color/verdnatura_white</item>
|
||||||
|
|
Loading…
Reference in New Issue