refs #5200 duplicate code
This commit is contained in:
parent
97d981fe89
commit
8df86a326b
|
@ -14,15 +14,18 @@ import es.verdnatura.presentation.common.OnClickDynamic
|
||||||
import es.verdnatura.presentation.common.setMargins
|
import es.verdnatura.presentation.common.setMargins
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
|
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
|
||||||
|
|
||||||
class CustomDialogDynamicButtons(context: Context, private val onClickDynamic: OnClickDynamic) : Dialog(context, R.style.DialogTheme) {
|
class CustomDialogDynamicButtons(
|
||||||
|
context: Context,
|
||||||
|
private val onClickDynamic: OnClickDynamic
|
||||||
|
) : Dialog(context, R.style.DialogTheme) {
|
||||||
|
|
||||||
private var binding: ComponentCustomDynamicDialogBinding =
|
private var binding: ComponentCustomDynamicDialogBinding =
|
||||||
ComponentCustomDynamicDialogBinding.inflate(layoutInflater)
|
ComponentCustomDynamicDialogBinding.inflate(layoutInflater)
|
||||||
|
|
||||||
|
private val buttonContainer = binding.layoutButtons
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTitle(title: String): CustomDialogDynamicButtons {
|
fun setTitle(title: String): CustomDialogDynamicButtons {
|
||||||
|
@ -41,8 +44,9 @@ class CustomDialogDynamicButtons(context: Context, private val onClickDynamic: O
|
||||||
|
|
||||||
|
|
||||||
fun createDynamicButtons(buttonInfoList: List<AddressLoses>) {
|
fun createDynamicButtons(buttonInfoList: List<AddressLoses>) {
|
||||||
|
buttonContainer.removeAllViews()
|
||||||
for (buttonInfo in buttonInfoList) {
|
for (buttonInfo in buttonInfoList) {
|
||||||
setDynamicButton(buttonInfo.nickname,buttonInfo.id)
|
setDynamicButton(buttonInfo.address!!.nickname, buttonInfo.addressFk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,14 +81,20 @@ class CustomDialogDynamicButtons(context: Context, private val onClickDynamic: O
|
||||||
button.setBackgroundResource(typedArray.getResourceId(1, 0))
|
button.setBackgroundResource(typedArray.getResourceId(1, 0))
|
||||||
|
|
||||||
typedArray.recycle()
|
typedArray.recycle()
|
||||||
|
|
||||||
|
buttonContainer.addView(button)
|
||||||
|
|
||||||
button.setOnClickListener {
|
button.setOnClickListener {
|
||||||
onClickDynamic.onClickDynamic(addressFk)
|
onClickDynamic.onClickDynamic(addressFk)
|
||||||
|
|
||||||
}
|
}
|
||||||
val buttonContainer = binding.layoutButtons
|
|
||||||
buttonContainer.addView(button)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
fun removeViewsDialog(
|
||||||
|
){
|
||||||
|
buttonContainer.removeAllViews()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -81,6 +81,8 @@ class CustomDialogInput(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
binding.customDialogButtonKo.text = text
|
binding.customDialogButtonKo.text = text
|
||||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||||
|
|
||||||
|
// binding.customDialogButtonKo.setOnClickListener { dismiss() }
|
||||||
|
|
||||||
/*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
|
||||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
||||||
|
|
|
@ -20,6 +20,7 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
init {
|
init {
|
||||||
|
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
getEditText().requestFocus()
|
||||||
//setContentView(R.layout.component_custom_list_dialog)
|
//setContentView(R.layout.component_custom_list_dialog)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
fun setValue(value: String): CustomDialogList {
|
fun setValue(value: String): CustomDialogList {
|
||||||
binding.customDialogValue.setText(value)
|
binding.customDialogValue.setText(value)
|
||||||
binding.textinputlayoutUsername.visibility = View.VISIBLE
|
binding.textinputlayoutUsername.visibility = View.VISIBLE
|
||||||
|
|
||||||
/*custom_dialog_value.setText(value)
|
/*custom_dialog_value.setText(value)
|
||||||
textinputlayout_username.visibility = View.VISIBLE*/
|
textinputlayout_username.visibility = View.VISIBLE*/
|
||||||
return this
|
return this
|
||||||
|
@ -107,8 +109,11 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
binding.customDialogButtonKo.text = text
|
binding.customDialogButtonKo.text = text
|
||||||
/*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*/
|
||||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
binding.customDialogButtonKo.setOnClickListener {
|
||||||
// custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
onButtonClicked()
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +141,7 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
//custom_dialog_value.visibility = View.GONE
|
//custom_dialog_value.visibility = View.GONE
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideDescription(): CustomDialogList {
|
fun hideDescription(): CustomDialogList {
|
||||||
binding.customDialogDescription.visibility = View.GONE
|
binding.customDialogDescription.visibility = View.GONE
|
||||||
|
|
||||||
|
@ -147,5 +153,4 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ class ItemProposal(
|
||||||
|
|
||||||
var itemFk: Int? = null,
|
var itemFk: Int? = null,
|
||||||
var longName: String? = null,
|
var longName: String? = null,
|
||||||
var subName:String? = null,
|
var subName: String? = null,
|
||||||
var tag5: String? = null,
|
var tag5: String? = null,
|
||||||
var value5: String? = null,
|
var value5: String? = null,
|
||||||
var match5: String? = null,
|
var match5: String? = null,
|
||||||
|
@ -35,10 +35,26 @@ class AddressLosesList(
|
||||||
)
|
)
|
||||||
|
|
||||||
data class AddressLoses(
|
data class AddressLoses(
|
||||||
val id: Int = 0,
|
val addressFk: Int = 0,
|
||||||
val nickname: String = "",
|
val address: Address? = null,
|
||||||
val name: String = "",
|
|
||||||
var isError: Boolean = false,
|
var isError: Boolean = false,
|
||||||
var errorMessage: String = ""
|
var errorMessage: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data class Address(
|
||||||
|
val nickname: String = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
//Tarea 5652
|
||||||
|
/*data class AddressLosesTest(
|
||||||
|
val id: Int = 0,
|
||||||
|
val nickname: String = "",
|
||||||
|
val name: String = "",
|
||||||
|
val client: ClientTest? = null ,
|
||||||
|
var isError: Boolean = false,
|
||||||
|
var errorMessage: String = ""
|
||||||
|
)
|
||||||
|
data class ClientTest(
|
||||||
|
val id: Int,
|
||||||
|
val name :String
|
||||||
|
)*/
|
||||||
|
|
|
@ -2,7 +2,8 @@ package es.verdnatura.presentation.view.feature.buffer.fragment
|
||||||
|
|
||||||
|
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.view.View.*
|
import android.view.View.GONE
|
||||||
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -10,10 +11,10 @@ import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
|
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
|
||||||
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.*
|
import es.verdnatura.presentation.common.OnSmartTagRowClickListener
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import es.verdnatura.presentation.view.feature.smarttag.adapter.SmartTagAdapter
|
import es.verdnatura.presentation.view.feature.smarttag.adapter.BufferAdapter
|
||||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||||
|
|
||||||
class BufferLoadFragment(
|
class BufferLoadFragment(
|
||||||
|
@ -26,7 +27,7 @@ class BufferLoadFragment(
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_buffer_loadexpedition
|
override fun getLayoutId(): Int = R.layout.fragment_buffer_loadexpedition
|
||||||
private lateinit var customDialogList: CustomDialogList
|
private lateinit var customDialogList: CustomDialogList
|
||||||
private var listTags: ArrayList<SmartTag> = ArrayList()
|
private var listTags: ArrayList<SmartTag> = ArrayList()
|
||||||
private var tagsAdapter: SmartTagAdapter? = null
|
private var tagsAdapter: BufferAdapter? = null
|
||||||
private var itemScaned: Int = 0
|
private var itemScaned: Int = 0
|
||||||
var mperror: MediaPlayer? = null
|
var mperror: MediaPlayer? = null
|
||||||
var mpok: MediaPlayer? = null
|
var mpok: MediaPlayer? = null
|
||||||
|
@ -66,10 +67,10 @@ class BufferLoadFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun checkLoadExpedition(ExpeditionOrBuffer: Int) {
|
private fun checkLoadExpedition(expeditionOrBuffer: Int) {
|
||||||
|
|
||||||
listTags.add(SmartTag(ExpeditionOrBuffer.toString(), getTextScaned(listTags.size + 1) + ExpeditionOrBuffer))
|
listTags.add(SmartTag(expeditionOrBuffer.toString(), getTextScaned(listTags.size + 1) + " $expeditionOrBuffer"))
|
||||||
customDialogList.setTitle(getTextToPosition(listTags.size + 1))
|
customDialogList.setTitle(getString(R.string.scanBuffer))
|
||||||
|
|
||||||
tagsAdapter!!.notifyDataSetChanged()
|
tagsAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
|
@ -77,12 +78,12 @@ class BufferLoadFragment(
|
||||||
if (listTags.size==2) {
|
if (listTags.size==2) {
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.expeditionLoading_add(
|
viewModel.expeditionLoading_add(
|
||||||
vBufferFk = ExpeditionOrBuffer,
|
vBufferFk = expeditionOrBuffer,
|
||||||
vExpeditionFk = listTags.first().code.toString().toInt())
|
vExpeditionFk = listTags.first().code.toString().toInt())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemScaned = ExpeditionOrBuffer
|
itemScaned = expeditionOrBuffer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +108,8 @@ class BufferLoadFragment(
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,it.isError,true)
|
ma.messageWithSound(it.errorMessage,it.isError,true)
|
||||||
} else {
|
} else {
|
||||||
// sergio: viene de la bbdd así
|
|
||||||
if (it.response.equals(getString(R.string.registerAdded))){
|
if (it.response == getString(R.string.registerAdded)){
|
||||||
|
|
||||||
it.response?.let { it1 -> ma.messageWithSound(it1,false,true) }
|
it.response?.let { it1 -> ma.messageWithSound(it1,false,true) }
|
||||||
}else{
|
}else{
|
||||||
|
@ -129,19 +130,9 @@ class BufferLoadFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getTextToPosition(TagsScaned: Int): String {
|
private fun getTextScaned(tagScaned: Int): String {
|
||||||
|
|
||||||
return getString(R.string.scanBuffer)
|
return when (tagScaned) {
|
||||||
/* when (TagsScaned) {
|
|
||||||
1 -> getString(R.string.scanBuffer)
|
|
||||||
else -> {getString(R.string.scanBuffer)}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getTextScaned(TagScaned: Int): String {
|
|
||||||
|
|
||||||
return when (TagScaned) {
|
|
||||||
1 -> getString(R.string.expedition)
|
1 -> getString(R.string.expedition)
|
||||||
2 -> getString(R.string.buffer)
|
2 -> getString(R.string.buffer)
|
||||||
else -> { ""}
|
else -> { ""}
|
||||||
|
@ -157,13 +148,10 @@ class BufferLoadFragment(
|
||||||
.setOkButton(getString(R.string.close)) {
|
.setOkButton(getString(R.string.close)) {
|
||||||
|
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
|
|
||||||
listTags.clear()
|
listTags.clear()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
requireActivity().onBackPressed()
|
requireActivity().onBackPressed()
|
||||||
|
|
||||||
|
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,9 +162,7 @@ class BufferLoadFragment(
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||||
if (!customDialogList.getValue().isNullOrEmpty()) {
|
if (!customDialogList.getValue().isNullOrEmpty()) {
|
||||||
|
|
||||||
|
|
||||||
checkLoadExpedition(customDialogList.getValue().toInt())
|
checkLoadExpedition(customDialogList.getValue().toInt())
|
||||||
|
|
||||||
}
|
}
|
||||||
customDialogList.setValue("")
|
customDialogList.setValue("")
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
@ -186,7 +172,7 @@ class BufferLoadFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tagsAdapter = SmartTagAdapter(listTags, object : OnSmartTagRowClickListener {
|
tagsAdapter = BufferAdapter(listTags, object : OnSmartTagRowClickListener {
|
||||||
override fun OnSmartTagRowClickListener(item: SmartTag) {
|
override fun OnSmartTagRowClickListener(item: SmartTag) {
|
||||||
}
|
}
|
||||||
}, showDelete = false)
|
}, showDelete = false)
|
||||||
|
|
|
@ -1,180 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.feature.category
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import android.view.inputmethod.EditorInfo
|
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
|
||||||
import es.verdnatura.domain.toast
|
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
|
||||||
import es.verdnatura.presentation.common.itemScanValue
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
|
||||||
import es.verdnatura.presentation.view.feature.packingHolland.fragment.PackingHollandViewModel
|
|
||||||
|
|
||||||
|
|
||||||
//Tarea #4940
|
|
||||||
class ChangeCategoryFragment(var entrypoint: String) :
|
|
||||||
BaseFragment<FragmentGeneralBlackBinding, PackingHollandViewModel>(
|
|
||||||
PackingHollandViewModel::class
|
|
||||||
) {
|
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_general_black
|
|
||||||
private var itemScaned: Int = 0
|
|
||||||
private lateinit var customDialogInput: CustomDialogInput
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
fun newInstance(entrypoint: String) = ChangeCategoryFragment(entrypoint = entrypoint)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
|
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
|
||||||
binding.mainToolbar.toolbarTitle.text = entrypoint
|
|
||||||
binding.scanInput.hint = "Escanear item"
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
binding.scanInput.visibility = View.VISIBLE
|
|
||||||
setEvents()
|
|
||||||
|
|
||||||
super.init()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setEvents() {
|
|
||||||
|
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
|
||||||
requireActivity().onBackPressed()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.scanInput.requestFocus()
|
|
||||||
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
binding.scanInput.setText(
|
|
||||||
itemScanValue(
|
|
||||||
binding.scanInput.text.toString(),
|
|
||||||
"buy",
|
|
||||||
"more"
|
|
||||||
).toString()
|
|
||||||
)
|
|
||||||
itemScaned = binding.scanInput.text.toString().toInt()
|
|
||||||
showQuantityPacking()
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
ex.message!!.toast(requireActivity())
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.scanInput.setText("")
|
|
||||||
ma.hideKeyboard(binding.scanInput)
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun observeViewModel() {
|
|
||||||
with(viewModel) {
|
|
||||||
response.observe(viewLifecycleOwner) {
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
|
||||||
} else {
|
|
||||||
showQuantityPacking()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private fun showQuantityPacking() {
|
|
||||||
|
|
||||||
|
|
||||||
customDialogInput.setTitle(getString(R.string.titleChangeCategory))
|
|
||||||
customDialogInput.setDescription(getString(R.string.ubication) + itemScaned)
|
|
||||||
.setValue("")
|
|
||||||
.setOkButton(getString(R.string.modify)) {
|
|
||||||
|
|
||||||
if (customDialogInput.getValue().isNotEmpty()
|
|
||||||
) {
|
|
||||||
callPacking(customDialogInput.getValue())
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
}.show()
|
|
||||||
|
|
||||||
//ma.hideKeyboard(customDialogInput.getEditText())
|
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
|
||||||
|
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
|
||||||
//callPacking(customDialogInput.getValue())
|
|
||||||
getNewPrice(customDialogInput.getValue(), itemScaned, 5.51)
|
|
||||||
}
|
|
||||||
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
customDialogInput.setFocusText()
|
|
||||||
ma.hideKeyboard(customDialogInput.getEditText())
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getNewPrice(shelving:String,item:Int,price:Double) {
|
|
||||||
customDialogInput.setTitle(getString(R.string.titleChangeCategory))
|
|
||||||
customDialogInput.setDescription(getString(R.string.itemChangePrice) + item + "-" + "Matrícula:"+shelving)
|
|
||||||
.setValue(price.toString())
|
|
||||||
.setOkButton(getString(R.string.modify)) {
|
|
||||||
|
|
||||||
if (customDialogInput.getValue().isNotEmpty()
|
|
||||||
) {
|
|
||||||
callPacking(customDialogInput.getValue())
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
}.show()
|
|
||||||
|
|
||||||
//ma.hideKeyboard(customDialogInput.getEditText())
|
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
|
||||||
|
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
|
||||||
//callPacking(customDialogInput.getValue())
|
|
||||||
//getNewPrice(customDialogInput.getValue().toInt(), 5.51)
|
|
||||||
}
|
|
||||||
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
customDialogInput.setFocusText()
|
|
||||||
ma.hideKeyboard(customDialogInput.getEditText())
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun callPacking(value: String) {
|
|
||||||
try {
|
|
||||||
// binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
/* viewModel.travel_updatePacking(
|
|
||||||
itemFk = shelvingScaned,
|
|
||||||
packingFk = value.toInt()
|
|
||||||
)*/
|
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
getString(R.string.errorInput).toast(requireActivity())
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,6 @@ class ClaimFragment(
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||||
if (!customDialogList.getValue().isEmpty()) {
|
if (!customDialogList.getValue().isEmpty()) {
|
||||||
|
|
||||||
//listClaims.add(GeneralItem(customDialogList.getValue(),customDialogList.getValue()))
|
|
||||||
add_item(customDialogList.getValue())
|
add_item(customDialogList.getValue())
|
||||||
|
|
||||||
if (listClaims.size > 1) {
|
if (listClaims.size > 1) {
|
||||||
|
|
|
@ -382,7 +382,7 @@ class CollectionFragment(
|
||||||
|
|
||||||
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
||||||
|
|
||||||
var myQr = itemScanned(JSONObject(binding.scanInput.text.toString()))
|
var myQr = ItemScanned(JSONObject(binding.scanInput.text.toString()))
|
||||||
|
|
||||||
when (myQr.table) {
|
when (myQr.table) {
|
||||||
"saleGroup" -> {
|
"saleGroup" -> {
|
||||||
|
|
|
@ -380,7 +380,7 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
||||||
|
|
||||||
var myQr = itemScanned(JSONObject(binding.scanInput.text.toString()))
|
var myQr = ItemScanned(JSONObject(binding.scanInput.text.toString()))
|
||||||
|
|
||||||
when (myQr.table) {
|
when (myQr.table) {
|
||||||
"saleGroup" -> {
|
"saleGroup" -> {
|
||||||
|
|
|
@ -16,6 +16,7 @@ import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
|
import android.widget.EditText
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
|
@ -53,7 +54,6 @@ class CollectionFragmentPickerNew(
|
||||||
var type: String = SACADOR
|
var type: String = SACADOR
|
||||||
) : BaseFragment<FragmentCollectionNewBinding, CollectionViewModel>(CollectionViewModel::class) {
|
) : BaseFragment<FragmentCollectionNewBinding, CollectionViewModel>(CollectionViewModel::class) {
|
||||||
|
|
||||||
private lateinit var dataMessageSalix: DataMessageSalix
|
|
||||||
private var sales: List<Sale> = listOf()
|
private var sales: List<Sale> = listOf()
|
||||||
private var salesParent: List<SaleVO> = listOf()
|
private var salesParent: List<SaleVO> = listOf()
|
||||||
private var saleAdapter: SaleAdapterNew? = null
|
private var saleAdapter: SaleAdapterNew? = null
|
||||||
|
@ -122,32 +122,13 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
||||||
|
|
||||||
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
||||||
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
||||||
|
|
||||||
|
|
||||||
viewModel.collectionTicketGetSalix(
|
viewModel.collectionTicketGetSalix(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
print = false
|
print = false
|
||||||
)
|
)
|
||||||
|
|
||||||
/* if (collection.tickets.isEmpty()) {
|
|
||||||
viewModel.collectionTicketGet(
|
|
||||||
collection.collectionFk,
|
|
||||||
getDataInt(SECTORFK),
|
|
||||||
print = "0",
|
|
||||||
type
|
|
||||||
)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
viewModel.collectionTicketGetLocal(
|
|
||||||
collection.collectionFk,
|
|
||||||
getDataInt(SECTORFK),
|
|
||||||
print = "0",
|
|
||||||
type
|
|
||||||
)
|
|
||||||
}*/
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,12 +231,6 @@ class CollectionFragmentPickerNew(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
print = false
|
print = false
|
||||||
)
|
)
|
||||||
/* viewModel.collectionTicketGet(
|
|
||||||
collection.collectionFk,
|
|
||||||
getDataInt(SECTORFK),
|
|
||||||
print = "0",
|
|
||||||
type
|
|
||||||
)*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -267,6 +242,8 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
if (sales[indice].saleGroupFk != null && sales[indice].saleGroupFk == saleGroupScanned.toInt()) {
|
if (sales[indice].saleGroupFk != null && sales[indice].saleGroupFk == saleGroupScanned.toInt()) {
|
||||||
println("Sacador saleGroup ${sales[indice].itemShelvingSaleFk}")
|
println("Sacador saleGroup ${sales[indice].itemShelvingSaleFk}")
|
||||||
|
|
||||||
|
//Sera el nuevo procedimiento confirmarSAleGroup
|
||||||
viewModel.confirmItemShelvingReserved(
|
viewModel.confirmItemShelvingReserved(
|
||||||
sales[indice].itemShelvingSaleFk,
|
sales[indice].itemShelvingSaleFk,
|
||||||
sales[indice].reservedQuantity,
|
sales[indice].reservedQuantity,
|
||||||
|
@ -276,7 +253,6 @@ class CollectionFragmentPickerNew(
|
||||||
saleGroupScanned.toInt()
|
saleGroupScanned.toInt()
|
||||||
)*/
|
)*/
|
||||||
return true
|
return true
|
||||||
|
|
||||||
mpok!!.start()
|
mpok!!.start()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -376,7 +352,7 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
||||||
|
|
||||||
var myQr = itemScanned(JSONObject(binding.scanInput.text.toString()))
|
var myQr = ItemScanned(JSONObject(binding.scanInput.text.toString()))
|
||||||
|
|
||||||
when (myQr.table) {
|
when (myQr.table) {
|
||||||
"saleGroup" -> {
|
"saleGroup" -> {
|
||||||
|
@ -617,11 +593,11 @@ class CollectionFragmentPickerNew(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
/* placementSuppleyList.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (!goBack) printShelvingResult(it)
|
if (!goBack) printShelvingResult(it)
|
||||||
goBack = false
|
goBack = false
|
||||||
})
|
})*/
|
||||||
|
|
||||||
item.observe(viewLifecycleOwner, Observer {
|
item.observe(viewLifecycleOwner, Observer {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
|
@ -646,12 +622,7 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
/* sendSalixMessage(
|
|
||||||
item = dataMessageSalix.item,
|
|
||||||
ticketFk = dataMessageSalix.ticket,
|
|
||||||
quantity = dataMessageSalix.quantity,
|
|
||||||
salePerson = dataMessageSalix.personSale
|
|
||||||
)*/
|
|
||||||
// TODO()→ LLAMAR Al procedimiento bySale o
|
// TODO()→ LLAMAR Al procedimiento bySale o
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
|
@ -660,7 +631,7 @@ class CollectionFragmentPickerNew(
|
||||||
type
|
type
|
||||||
)
|
)
|
||||||
|
|
||||||
// //Log.i("VERDNATURA:","La collection es ${collection.collectionFk}")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
@ -739,7 +710,6 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
responseSaleMistakeAdd.observe(viewLifecycleOwner, Observer {
|
responseSaleMistakeAdd.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||||
|
@ -776,15 +746,6 @@ class CollectionFragmentPickerNew(
|
||||||
goMistakeBack = true
|
goMistakeBack = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mistakeList.observe(viewLifecycleOwner, Observer {
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
/*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */
|
|
||||||
|
|
||||||
if (!goMistakeBack)
|
|
||||||
showMistakeList(it.list)
|
|
||||||
goMistakeBack = true
|
|
||||||
})
|
|
||||||
//sergio: para si hay algun ticket por revisar antes de parkinear
|
//sergio: para si hay algun ticket por revisar antes de parkinear
|
||||||
|
|
||||||
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
|
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
|
||||||
|
@ -815,7 +776,7 @@ class CollectionFragmentPickerNew(
|
||||||
customDialog.show()
|
customDialog.show()
|
||||||
} else {
|
} else {
|
||||||
viewModel.parking(
|
viewModel.parking(
|
||||||
ticketFk = tickets[0],
|
ticketFk = tickets[0].toInt(),
|
||||||
parking = ticketScanTxt
|
parking = ticketScanTxt
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1000,14 +961,9 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println("Sacador esta vacia las sales: ${salesList.isEmpty()}")
|
|
||||||
for (s in salesList) {
|
|
||||||
// println("Sacador la saleeeee es ${s.saleFk} cantidad: ${s.saleQuantity} y ${s.pickingOrder}")
|
|
||||||
}
|
|
||||||
sales = salesList.sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
sales = salesList.sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
||||||
for (s in sales) {
|
|
||||||
// println("Sacador la sale es ${s.saleFk} cantidad: ${s.saleQuantity} y ${s.pickingOrder}")
|
|
||||||
}
|
|
||||||
//quitar comentarios FALTA AGRUPAR LAS PREVIAS
|
//quitar comentarios FALTA AGRUPAR LAS PREVIAS
|
||||||
myGroupList =
|
myGroupList =
|
||||||
groupSaleGroup(salesList).sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
groupSaleGroup(salesList).sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
||||||
|
@ -1037,8 +993,6 @@ class CollectionFragmentPickerNew(
|
||||||
},
|
},
|
||||||
object : OnSaleClickSaleListener {
|
object : OnSaleClickSaleListener {
|
||||||
override fun onSaleClick(mysale: Sale) {
|
override fun onSaleClick(mysale: Sale) {
|
||||||
println("Sacador onSaleClickListener")
|
|
||||||
|
|
||||||
|
|
||||||
sales.forEachIndexed { index, sale ->
|
sales.forEachIndexed { index, sale ->
|
||||||
println("Sacador la sale es ${sale.saleFk}")
|
println("Sacador la sale es ${sale.saleFk}")
|
||||||
|
@ -1066,11 +1020,6 @@ class CollectionFragmentPickerNew(
|
||||||
},
|
},
|
||||||
object : OnMistakeClickListener {
|
object : OnMistakeClickListener {
|
||||||
override fun onMistakeClickListener(sale: SaleVO) {
|
override fun onMistakeClickListener(sale: SaleVO) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.mistakeType()
|
|
||||||
mistakeSale = sale
|
|
||||||
goMistakeBack = false
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
object : OnPackingClickSaleListener {
|
object : OnPackingClickSaleListener {
|
||||||
|
@ -1086,9 +1035,6 @@ class CollectionFragmentPickerNew(
|
||||||
},
|
},
|
||||||
object : OnTicketClickSaleListener {
|
object : OnTicketClickSaleListener {
|
||||||
override fun onTicketClickListener(sale: Sale) {
|
override fun onTicketClickListener(sale: Sale) {
|
||||||
if (type == CONTROLADOR) {
|
|
||||||
//var ticketFk = sale.ticketFk
|
|
||||||
|
|
||||||
var entryPoint = Gson().toJson(
|
var entryPoint = Gson().toJson(
|
||||||
mutableMapOf(
|
mutableMapOf(
|
||||||
"entryPoint" to sale.ticketFk,
|
"entryPoint" to sale.ticketFk,
|
||||||
|
@ -1100,7 +1046,6 @@ class CollectionFragmentPickerNew(
|
||||||
title = getString(R.string.titleWebViewer),
|
title = getString(R.string.titleWebViewer),
|
||||||
), entryPoint = entryPoint
|
), entryPoint = entryPoint
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, type = type
|
}, type = type
|
||||||
)
|
)
|
||||||
|
@ -1113,7 +1058,6 @@ class CollectionFragmentPickerNew(
|
||||||
setTotalLines()
|
setTotalLines()
|
||||||
setStoredPosition(true)
|
setStoredPosition(true)
|
||||||
setScrollListener(lm!!)
|
setScrollListener(lm!!)
|
||||||
|
|
||||||
printObservations(observations)
|
printObservations(observations)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1161,7 +1105,7 @@ class CollectionFragmentPickerNew(
|
||||||
//Si no es previa ni está cogiendo nada se comprueba si es un parking
|
//Si no es previa ni está cogiendo nada se comprueba si es un parking
|
||||||
if (txtscan.contains("-")) {
|
if (txtscan.contains("-")) {
|
||||||
viewModel.parking(
|
viewModel.parking(
|
||||||
ticketFk = collection.collectionFk.toString(),
|
ticketFk = collection.collectionFk,
|
||||||
parking = txtscan
|
parking = txtscan
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1170,69 +1114,7 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
var index = 0
|
|
||||||
var isBreak = false
|
|
||||||
var isOk = false
|
|
||||||
goBack = false
|
|
||||||
goBack2 = false
|
|
||||||
|
|
||||||
if (type == SACADOR) {
|
|
||||||
isOk = markPrevia(txtscan)
|
|
||||||
for (saleVO in sales) {
|
|
||||||
if (isOk) break
|
|
||||||
|
|
||||||
if (saleVO.semaphore != "2" && saleVO.semaphore != "1") {
|
|
||||||
//if (saleVO.isPrepared != "1" && saleVO.isPreviousPrepared != "1") {
|
|
||||||
//2- Por carro
|
|
||||||
if (saleVO.placements != null) {
|
|
||||||
var shelvingIndex = 0
|
|
||||||
for (placementVO in saleVO.placements) {
|
|
||||||
// para comprobar si es igual a una matricula
|
|
||||||
if (placementVO.shelving != null && placementVO.visible != null && txtscan.uppercase() == placementVO.shelving.uppercase() && placementVO.visible != "(0)") {
|
|
||||||
if (mpok != null) mpok!!.start()
|
|
||||||
isOk = true
|
|
||||||
//////Log.i("VERDNATURA:","encontrado producto")
|
|
||||||
showShelving(index, shelvingIndex)
|
|
||||||
//nuevo
|
|
||||||
var mySale = sales[index].saleFk
|
|
||||||
for (indice in myGroupList.indices) {
|
|
||||||
|
|
||||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
|
||||||
d("VERDNATURA::", "la pos del index de la sale es" + indice)
|
|
||||||
storedBackPosition = indice
|
|
||||||
// setListPosition(storedBackPosition,false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
isBreak = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
shelvingIndex += 1
|
|
||||||
}
|
|
||||||
if (isBreak) break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index += 1
|
|
||||||
}
|
|
||||||
if (!isOk) {
|
|
||||||
if (txtscan.contains("-")) {
|
|
||||||
if (tickets.size > 0) {
|
|
||||||
|
|
||||||
|
|
||||||
viewModel.parking(
|
|
||||||
ticketFk = tickets[0],
|
|
||||||
parking = txtscan
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (mperror != null) mperror!!.start()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findSale(txtscan: String, position: Int, sale: Sale) {
|
private fun findSale(txtscan: String, position: Int, sale: Sale) {
|
||||||
|
@ -1243,16 +1125,16 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
if (sale.code!!.uppercase() == txtscan.uppercase()) {
|
if (sale.code!!.uppercase() == txtscan.uppercase()) {
|
||||||
mpok!!.start()
|
mpok!!.start()
|
||||||
//showShelving(position)
|
showShelving(position)
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
/* binding.splashProgress.visibility = View.VISIBLE
|
||||||
|
|
||||||
viewModel.itemPlacementSupplyAiming(
|
viewModel.itemPlacementSupplyAiming(
|
||||||
itemFk = sales[position].itemFk,
|
itemFk = sales[position].itemFk,
|
||||||
quantity = sales[position].reservedQuantity,
|
quantity = sales[position].reservedQuantity,
|
||||||
shelvingFk = sales[position].code!!
|
shelvingFk = sales[position].code!!
|
||||||
|
|
||||||
)
|
)*/
|
||||||
/* viewModel.confirmItemShelvingReserved(
|
/* viewModel.confirmItemShelvingReserved(
|
||||||
sale.itemShelvingSaleFk,
|
sale.itemShelvingSaleFk,
|
||||||
sale.reservedQuantity!!,
|
sale.reservedQuantity!!,
|
||||||
|
@ -1282,7 +1164,7 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
//nuevo tema agrupacion sales
|
//nuevo tema agrupacion sales
|
||||||
checkStateParent()
|
checkStateParent()
|
||||||
// var mySale = sales[position].saleFk Ordenar setPosition
|
// var mySale = sales[position].saleFk Ordenar setPosition
|
||||||
var mySale = sales[position].itemShelvingSaleFk
|
var mySale = sales[position].itemShelvingSaleFk
|
||||||
for (indice in myGroupList.indices) {
|
for (indice in myGroupList.indices) {
|
||||||
if (!myGroupList[indice].isParent && myGroupList[indice].itemShelvingSaleFk == mySale) {
|
if (!myGroupList[indice].isParent && myGroupList[indice].itemShelvingSaleFk == mySale) {
|
||||||
|
@ -1369,7 +1251,7 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
private fun setListPosition(position: Int, isFromBack: Boolean) {
|
private fun setListPosition(position: Int, isFromBack: Boolean) {
|
||||||
d("VERDNATURA::", "Vamos a la pos" + storedBackPosition)
|
d("VERDNATURA::", "Vamos a la pos" + storedBackPosition)
|
||||||
if (storedPosition == 0 && storedBackPosition == 0) { // se inicia lista, se busca porqué item vamos.
|
if (storedPosition == 0 && storedBackPosition == 0) { // se inicia lista, se busca porqué item vamos.
|
||||||
for (indice in myGroupList.indices) {
|
for (indice in myGroupList.indices) {
|
||||||
if (myGroupList[indice].isPicked == 0) {
|
if (myGroupList[indice].isPicked == 0) {
|
||||||
//storedPosition = indice
|
//storedPosition = indice
|
||||||
|
@ -1474,56 +1356,24 @@ class CollectionFragmentPickerNew(
|
||||||
//SHELVINGS
|
//SHELVINGS
|
||||||
private fun showShelving(position: Int) {
|
private fun showShelving(position: Int) {
|
||||||
storedPosition = position
|
storedPosition = position
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
printShelvingResult(position)
|
||||||
try {
|
|
||||||
var quantityGet =
|
|
||||||
(sales[position].reservedQuantity!!)
|
|
||||||
|
|
||||||
viewModel.itemPlacementSupplyAiming(
|
|
||||||
itemFk = sales[position].itemFk,
|
|
||||||
quantity = quantityGet,
|
|
||||||
shelvingFk = sales[position].code!!
|
|
||||||
|
|
||||||
)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
private fun printShelvingResult(pos: Int) {
|
||||||
private fun printShelvingResult(placementSupplyListVO: PlacementSupplyListVO) {
|
|
||||||
customDialogList.getEditTextTwo().inputType = InputType.TYPE_CLASS_TEXT
|
customDialogList.getEditTextTwo().inputType = InputType.TYPE_CLASS_TEXT
|
||||||
|
customDialogList.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||||
|
|
||||||
|
var shelving = myGroupList[pos].code
|
||||||
|
var item = myGroupList[pos].itemFk
|
||||||
|
var longName = myGroupList[pos].longName
|
||||||
|
var totalReserved = myGroupList[pos].reservedQuantity
|
||||||
|
var itemShelvingFk = myGroupList[pos].itemShelvingSaleFk
|
||||||
|
|
||||||
var shelving = ""
|
|
||||||
var item = ""
|
|
||||||
var longName = ""
|
|
||||||
var total = "0"
|
|
||||||
var itemShelvingFk = 0
|
|
||||||
if (!placementSupplyListVO.list.isEmpty()) {
|
|
||||||
var placement: PlacementSupplyVO? = null
|
|
||||||
placementSupplyListVO.list.forEach { placementVO ->
|
|
||||||
if (placementVO.stock != "0" && placement == null)
|
|
||||||
placement = placementVO
|
|
||||||
}
|
|
||||||
if (placement != null) {
|
|
||||||
shelving = placement!!.shelving
|
|
||||||
item = placement!!.itemFk
|
|
||||||
longName = placement!!.longName
|
|
||||||
total = placement!!.total
|
|
||||||
itemShelvingFk = placement!!.itemShelvingFk
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
listPlacementSupply = ArrayList()
|
|
||||||
placementSupplyListVO.list.forEach {
|
|
||||||
if (it.stock != "0")
|
|
||||||
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
|
||||||
//////Log.i("VERDNATURA:","Array de placementsupply")
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// Log.i("VERDNATURA:","Pulso COGER-1")
|
// Log.i("VERDNATURA:","Pulso COGER-1")
|
||||||
// customDialogList.getEditTextTwo().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
customDialogList.setTitle("$shelving($item) $totalReserved de $longName").setOkButton(
|
||||||
customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton(
|
|
||||||
getString(
|
getString(
|
||||||
R.string.take
|
R.string.take
|
||||||
)
|
)
|
||||||
|
@ -1539,10 +1389,21 @@ class CollectionFragmentPickerNew(
|
||||||
"more"
|
"more"
|
||||||
).toString()
|
).toString()
|
||||||
)
|
)
|
||||||
|
var quantityToReserve = customDialogList.getValue().toInt()
|
||||||
|
|
||||||
if (isNumber(customDialogList.getValue()) && isNumber(total) && customDialogList.getValue()
|
if (quantityToReserve > totalReserved) {
|
||||||
.toInt() > total.toInt()
|
customDialogList.setValue(totalReserved.toString())
|
||||||
|
getString(R.string.quantityHigh).toast(requireContext())
|
||||||
|
} else {
|
||||||
|
showQuestionUbicationEmpty(pos)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isNumber(customDialogList.getValue()) && customDialogList.getValue()
|
||||||
|
.toInt() > totalReserved
|
||||||
) {
|
) {
|
||||||
|
customDialogList.setValue(totalReserved.toString())
|
||||||
getString(R.string.quantityHigh).toast(requireContext())
|
getString(R.string.quantityHigh).toast(requireContext())
|
||||||
} else if (isNumber(customDialogList.getValue())) {
|
} else if (isNumber(customDialogList.getValue())) {
|
||||||
originalItemScan = customDialogList.getValueTwo().toLong()
|
originalItemScan = customDialogList.getValueTwo().toLong()
|
||||||
|
@ -1602,7 +1463,7 @@ class CollectionFragmentPickerNew(
|
||||||
scanRequest()
|
scanRequest()
|
||||||
hideKeyboards()
|
hideKeyboards()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.setHintValue(getString(R.string.quantitySelect)).setValue(total)
|
}.setHintValue(getString(R.string.quantitySelect)).setValue(totalReserved.toString())
|
||||||
.setHintValueTwo(getString(R.string.scanItem))
|
.setHintValueTwo(getString(R.string.scanItem))
|
||||||
.setValueTwo("").show()
|
.setValueTwo("").show()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -1646,7 +1507,7 @@ class CollectionFragmentPickerNew(
|
||||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||||
try {
|
try {
|
||||||
if (isNumber(customDialogList.getValue()) && customDialogList.getValue()
|
if (isNumber(customDialogList.getValue()) && customDialogList.getValue()
|
||||||
.toInt() > total.toInt()
|
.toInt() > totalReserved.toInt()
|
||||||
) {
|
) {
|
||||||
getString(R.string.quantityHigh).toast(requireContext())
|
getString(R.string.quantityHigh).toast(requireContext())
|
||||||
} else if (isNumber(customDialogList.getValue())) {
|
} else if (isNumber(customDialogList.getValue())) {
|
||||||
|
@ -1696,13 +1557,13 @@ class CollectionFragmentPickerNew(
|
||||||
listPlacementSupply,
|
listPlacementSupply,
|
||||||
object : OnBarcodeRowClickListener {
|
object : OnBarcodeRowClickListener {
|
||||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||||
placementSupplyListVO.list.forEach {
|
/*placementSupplyListVO.list.forEach {
|
||||||
if (it.proposal == item.code) {
|
if (it.proposal == item.code) {
|
||||||
customDialogList.setValue(it.total)
|
customDialogList.setValue(it.total)
|
||||||
total = it.total
|
total = it.total
|
||||||
itemShelvingFk = it.itemShelvingFk
|
itemShelvingFk = it.itemShelvingFk
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}, showDelete = false
|
}, showDelete = false
|
||||||
|
@ -1774,20 +1635,20 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showQuestionUbicationEmpty(position: Int) {
|
private fun showQuestionUbicationEmpty(position: Int, quantity: Int = 0) {
|
||||||
customDialogThreeButtonsQuantity
|
customDialogThreeButtonsQuantity
|
||||||
.setTitle("Cambio de cantidad a 0")
|
.setTitle("Cambio de cantidad a $quantity")
|
||||||
.setDescription("¿Hay unidades del artículo ${sales[position].itemFk} en el carro escaneado?")
|
.setDescription("¿Hay unidades del artículo ${sales[position].itemFk} en el carro escaneado?")
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setCustomDialogValue(View.GONE)
|
.setCustomDialogValue(View.GONE)
|
||||||
customDialogThreeButtonsQuantity.setOkButtonAdd("SI") {
|
customDialogThreeButtonsQuantity.setOkButtonAdd("SI") {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtonsQuantity.dismiss()
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
markLine(storedPosition, 0, false)
|
markLine(storedPosition, quantity, false)
|
||||||
}.setOkButtonTwo("NO") {
|
}.setOkButtonTwo("NO") {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtonsQuantity.dismiss()
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
markLine(storedPosition, 0, true)
|
markLine(storedPosition, quantity, true)
|
||||||
}
|
}
|
||||||
.setKoButton("CANCELAR") {
|
.setKoButton("CANCELAR") {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
|
@ -1975,9 +1836,6 @@ class CollectionFragmentPickerNew(
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
if (!goBack)
|
|
||||||
ticketCollection_setUsedShelves()
|
|
||||||
goBack = false
|
|
||||||
|
|
||||||
changeTicketState()
|
changeTicketState()
|
||||||
|
|
||||||
|
@ -1986,131 +1844,6 @@ class CollectionFragmentPickerNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun ticketCollection_setUsedShelves() {
|
|
||||||
|
|
||||||
|
|
||||||
if (type.equals("CHECKER") && (isMarking && (getData(SECTORDESCRIP).uppercase() != getString(
|
|
||||||
R.string.sectorALGEMESI
|
|
||||||
) && getData(SECTORDESCRIP).uppercase() != getString(
|
|
||||||
R.string.sectorALGEMESINEW
|
|
||||||
)
|
|
||||||
))
|
|
||||||
) {
|
|
||||||
|
|
||||||
|
|
||||||
customDialogInput.setTitle(getString(R.string.shlevesNumber))
|
|
||||||
.setDescription(getString(R.string.shlevesNumberTicket))
|
|
||||||
.setOkButton(getString(R.string.accept)) {
|
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.ticketCollection_setUsedShelves(
|
|
||||||
ticketFk = collection.collectionFk,
|
|
||||||
usedShelves = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
hideKeyboards()
|
|
||||||
// showKeyboards()
|
|
||||||
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
showKeyboards()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
showKeyboards()
|
|
||||||
}.setValue("").show()
|
|
||||||
|
|
||||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
|
||||||
// customDialogInput.currentFocus
|
|
||||||
customDialogInput.setFocusText()
|
|
||||||
showKeyboards()
|
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.ticketCollection_setUsedShelves(
|
|
||||||
ticketFk = collection.collectionFk,
|
|
||||||
usedShelves = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
hideKeyboards()
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun item_updatePackingShelve(itemFk: Int) {
|
|
||||||
|
|
||||||
|
|
||||||
isMarking = false
|
|
||||||
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
|
||||||
.setDescription(getString(R.string.packetIndicate))
|
|
||||||
.setOkButton(getString(R.string.accept)) {
|
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.item_updatePackingShelve(
|
|
||||||
vSelf = itemFk,
|
|
||||||
vPacking = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
hideKeyboards()
|
|
||||||
//showKeyboards()
|
|
||||||
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
// hideKeyboards()
|
|
||||||
showKeyboards()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
|
||||||
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
//hideKeyboards()
|
|
||||||
showKeyboards()
|
|
||||||
}.setValue("").show()
|
|
||||||
|
|
||||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
|
||||||
customDialogInput.currentFocus
|
|
||||||
customDialogInput.setFocusText()
|
|
||||||
showKeyboards()
|
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
viewModel.item_updatePackingShelve(
|
|
||||||
vSelf = itemFk,
|
|
||||||
vPacking = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showBottomNavigation(visibilitiy: Int) {
|
|
||||||
//requireActivity().main_bottom_navigation.visibility = visibilitiy
|
|
||||||
}
|
|
||||||
|
|
||||||
//FALTAS / BASURA / SPLIT
|
//FALTAS / BASURA / SPLIT
|
||||||
|
|
||||||
|
|
||||||
|
@ -2124,13 +1857,13 @@ class CollectionFragmentPickerNew(
|
||||||
if (customDialogThreeButtons.getValue().toInt() == 0) {
|
if (customDialogThreeButtons.getValue().toInt() == 0) {
|
||||||
showQuestionUbicationEmpty(position)
|
showQuestionUbicationEmpty(position)
|
||||||
} else {
|
} else {
|
||||||
println("Sacador reservedQuantity ${sales[position].reservedQuantity}")
|
println("Sacador reservedQuantity ${myGroupList[position].reservedQuantity}")
|
||||||
println("Sacador item ${sales[position].itemFk}")
|
println("Sacador item ${myGroupList[position].itemFk}")
|
||||||
println("Sacador cantidad introducida ${customDialogThreeButtons.getValue()}")
|
println("Sacador cantidad introducida ${customDialogThreeButtons.getValue()}")
|
||||||
|
|
||||||
|
|
||||||
if (customDialogThreeButtons.getValue()
|
if (customDialogThreeButtons.getValue()
|
||||||
.toInt() != sales[position].reservedQuantity
|
.toInt() != myGroupList[position].reservedQuantity
|
||||||
) {
|
) {
|
||||||
markLine(position, customDialogThreeButtons.getValue().toInt(), false)
|
markLine(position, customDialogThreeButtons.getValue().toInt(), false)
|
||||||
} else {
|
} else {
|
||||||
|
@ -2191,33 +1924,36 @@ class CollectionFragmentPickerNew(
|
||||||
//OTROS
|
//OTROS
|
||||||
private fun showScanner(index: Int, sale: Sale) {
|
private fun showScanner(index: Int, sale: Sale) {
|
||||||
customDialogInput.getEditText().inputType = InputType.TYPE_CLASS_TEXT
|
customDialogInput.getEditText().inputType = InputType.TYPE_CLASS_TEXT
|
||||||
customDialogInput.setTitle("" + sale.itemFk)
|
customDialogInput.setTitle(""+sale.itemFk)
|
||||||
.setDescription(getString(R.string.scanWagonForItem))
|
.setDescription(getString(R.string.scanWagonForItem))
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
findSale(customDialogInput.getValue(), index, sale)
|
findSale(customDialogInput.getValue(), index, sale)
|
||||||
}
|
}
|
||||||
customDialogInput.setValue("")
|
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
customDialogInput.getEditText().requestFocus()
|
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
findSale(customDialogInput.getValue(), index, sale)
|
findSale(customDialogInput.getValue(), index, sale)
|
||||||
}
|
}
|
||||||
customDialogInput.setValue("")
|
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||||
scanRequest()
|
return@setOnEditorActionListener false
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
customDialogInput.getEditText().requestFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun closeCustomDialog(scanInput: EditText, customDialogInput: CustomDialogInput) {
|
||||||
|
requireContext().hideKeyboard(customDialogInput.getEditText())
|
||||||
|
scanInput.requestFocus()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
scanInput.requestFocus()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2261,52 +1997,6 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showMistakeList(list: List<MistakeTypeVO>) {
|
|
||||||
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
|
||||||
listPlacementSupply = ArrayList()
|
|
||||||
list.forEach {
|
|
||||||
listPlacementSupply.add(BarcodeVO(code = it.description))
|
|
||||||
}
|
|
||||||
|
|
||||||
customDialogList.setTitle(getString(R.string.errorCause))
|
|
||||||
customDialogList.hideTextInput()
|
|
||||||
.setKoButton(getString(R.string.cancel)) {
|
|
||||||
scanRequest()
|
|
||||||
hideKeyboards()
|
|
||||||
listPlacementSupply.clear()
|
|
||||||
customDialogList.dismiss()
|
|
||||||
|
|
||||||
}.show()
|
|
||||||
|
|
||||||
|
|
||||||
placementSupplyAdapter =
|
|
||||||
BarcodeAdapter(listPlacementSupply, object : OnBarcodeRowClickListener {
|
|
||||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
|
||||||
list.forEach {
|
|
||||||
if (it.description == item.code) {
|
|
||||||
|
|
||||||
viewModel.saleMistakeAdd(
|
|
||||||
saleFk = mistakeSale?.saleFk!!,
|
|
||||||
typeFk = it.id
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
getString(R.string.errorRegistered).toast(requireContext())
|
|
||||||
customDialogList.dismiss()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}, showDelete = false)
|
|
||||||
|
|
||||||
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
|
|
||||||
|
|
||||||
customDialogList.getRecyclerView().layoutManager =
|
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun isNumber(num: String): Boolean {
|
fun isNumber(num: String): Boolean {
|
||||||
var numberInt = 0
|
var numberInt = 0
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -382,7 +382,7 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
||||||
|
|
||||||
var myQr = itemScanned(JSONObject(binding.scanInput.text.toString()))
|
var myQr = ItemScanned(JSONObject(binding.scanInput.text.toString()))
|
||||||
|
|
||||||
when (myQr.table) {
|
when (myQr.table) {
|
||||||
"saleGroup" -> {
|
"saleGroup" -> {
|
||||||
|
@ -393,6 +393,7 @@ class CollectionFragmentPreChecker(
|
||||||
findSale(binding.scanInput.text.toString())
|
findSale(binding.scanInput.text.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"buy" -> binding.scanInput.setText(myQr.more)
|
"buy" -> binding.scanInput.setText(myQr.more)
|
||||||
"parking" -> {
|
"parking" -> {
|
||||||
|
|
||||||
|
@ -403,7 +404,7 @@ class CollectionFragmentPreChecker(
|
||||||
if (at.saleGroupFk != saleGroup) {
|
if (at.saleGroupFk != saleGroup) {
|
||||||
viewModel.parking(
|
viewModel.parking(
|
||||||
ticketFk = at.saleGroupFk.toInt(),
|
ticketFk = at.saleGroupFk.toInt(),
|
||||||
parking = myQr.more
|
parking = myQr.more!!
|
||||||
)
|
)
|
||||||
saleGroup = at.saleGroupFk
|
saleGroup = at.saleGroupFk
|
||||||
}
|
}
|
||||||
|
@ -626,12 +627,12 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
|
|
||||||
if (!goBack) {
|
if (!goBack) {
|
||||||
/* sendSalixMessage(
|
/* sendSalixMessage(
|
||||||
item = dataMessageSalix.item,
|
item = dataMessageSalix.item,
|
||||||
ticketFk = dataMessageSalix.ticket,
|
ticketFk = dataMessageSalix.ticket,
|
||||||
quantity = dataMessageSalix.quantity,
|
quantity = dataMessageSalix.quantity,
|
||||||
salePerson = dataMessageSalix.personSale
|
salePerson = dataMessageSalix.personSale
|
||||||
)*/
|
)*/
|
||||||
viewModel.collectionTicketGet(
|
viewModel.collectionTicketGet(
|
||||||
collection.collectionFk,
|
collection.collectionFk,
|
||||||
getDataInt(SECTORFK),
|
getDataInt(SECTORFK),
|
||||||
|
@ -1053,12 +1054,12 @@ class CollectionFragmentPreChecker(
|
||||||
markLine(positionCollectionSplit, type)
|
markLine(positionCollectionSplit, type)
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
/* val ticket =
|
/* val ticket =
|
||||||
"[" + sales[positionCollectionSplit].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].ticketFk + "/summary)"
|
"[" + sales[positionCollectionSplit].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].ticketFk + "/summary)"
|
||||||
val message =
|
val message =
|
||||||
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + getString(R.string.fromTicket) + ticket
|
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + getString(R.string.fromTicket) + ticket
|
||||||
|
|
||||||
sendSalixMessageNew(message, sales[positionCollectionSplit].salePersonFk)*/
|
sendSalixMessageNew(message, sales[positionCollectionSplit].salePersonFk)*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1089,22 +1090,22 @@ class CollectionFragmentPreChecker(
|
||||||
return salePerson
|
return salePerson
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private fun sendSalixMessage(
|
/* private fun sendSalixMessage(
|
||||||
item: String,
|
item: String,
|
||||||
ticketFk: Int,
|
ticketFk: Int,
|
||||||
quantity: String,
|
quantity: String,
|
||||||
salePerson: String
|
salePerson: String
|
||||||
) {
|
) {
|
||||||
val ticket =
|
val ticket =
|
||||||
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
||||||
val message =
|
val message =
|
||||||
getString(R.string.itemAdded) + item + getString(R.string.with) + quantity + getString(R.string.unityTicket) + ticket
|
getString(R.string.itemAdded) + item + getString(R.string.with) + quantity + getString(R.string.unityTicket) + ticket
|
||||||
|
|
||||||
viewModel.sendChekingPresence(
|
viewModel.sendChekingPresence(
|
||||||
workerId = salePerson,
|
workerId = salePerson,
|
||||||
message = message
|
message = message
|
||||||
)
|
)
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
//CREATE LIST
|
//CREATE LIST
|
||||||
private fun createCollectionList() {
|
private fun createCollectionList() {
|
||||||
|
@ -1502,19 +1503,19 @@ class CollectionFragmentPreChecker(
|
||||||
if (sales[position].isPrepared == "1") {
|
if (sales[position].isPrepared == "1") {
|
||||||
sales[position].pickedQuantity = sales[position].quantity!!
|
sales[position].pickedQuantity = sales[position].quantity!!
|
||||||
}
|
}
|
||||||
// checkStateParent()
|
// checkStateParent()
|
||||||
} 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"
|
||||||
//En primera instancia coge el primer elemento hijo para realizar la copia y según se va interactuando con las sales ya se actualiza el
|
//En primera instancia coge el primer elemento hijo para realizar la copia y según se va interactuando con las sales ya se actualiza el
|
||||||
// estado del padre
|
// estado del padre
|
||||||
// checkStateParent()
|
// checkStateParent()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == PRECHECKER) {
|
if (type == PRECHECKER) {
|
||||||
sales[position].isPreControlled =
|
sales[position].isPreControlled =
|
||||||
if (sales[position].isPreControlled == "1") "0" else "1"
|
if (sales[position].isPreControlled == "1") "0" else "1"
|
||||||
// checkStateParent()
|
// checkStateParent()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2277,48 +2278,20 @@ class CollectionFragmentPreChecker(
|
||||||
customDialogInput.setTitle(getString(R.string.shlevesNumber))
|
customDialogInput.setTitle(getString(R.string.shlevesNumber))
|
||||||
.setDescription(getString(R.string.shlevesNumberTicket))
|
.setDescription(getString(R.string.shlevesNumberTicket))
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogSetUsed()
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.ticketCollection_setUsedShelves(
|
|
||||||
ticketFk = collection.collectionFk,
|
|
||||||
usedShelves = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
hideKeyboards()
|
|
||||||
// showKeyboards()
|
|
||||||
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
showKeyboards()
|
|
||||||
//hideKeyboards()
|
|
||||||
//showKeyboards()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
// hideKeyboards()
|
|
||||||
showKeyboards()
|
showKeyboards()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
|
|
||||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||||
// customDialogInput.currentFocus
|
|
||||||
customDialogInput.setFocusText()
|
customDialogInput.setFocusText()
|
||||||
showKeyboards()
|
showKeyboards()
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogSetUsed()
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.ticketCollection_setUsedShelves(
|
|
||||||
ticketFk = collection.collectionFk,
|
|
||||||
usedShelves = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
hideKeyboards()
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -2330,6 +2303,22 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun customDialogSetUsed() {
|
||||||
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
|
|
||||||
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
viewModel.ticketCollection_setUsedShelves(
|
||||||
|
ticketFk = collection.collectionFk,
|
||||||
|
usedShelves = customDialogInput.getValue().toInt()
|
||||||
|
)
|
||||||
|
hideKeyboards()
|
||||||
|
}
|
||||||
|
customDialogInput.setValue("")
|
||||||
|
scanRequest()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
hideKeyboards()
|
||||||
|
}
|
||||||
|
|
||||||
private fun item_updatePackingShelve(itemFk: Int) {
|
private fun item_updatePackingShelve(itemFk: Int) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -2337,25 +2326,11 @@ class CollectionFragmentPreChecker(
|
||||||
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
||||||
.setDescription(getString(R.string.packetIndicate))
|
.setDescription(getString(R.string.packetIndicate))
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogInputPacking(itemFk)
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.item_updatePackingShelve(
|
|
||||||
vSelf = itemFk,
|
|
||||||
vPacking = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
hideKeyboards()
|
|
||||||
//showKeyboards()
|
|
||||||
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
// hideKeyboards()
|
|
||||||
showKeyboards()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
//hideKeyboards()
|
|
||||||
showKeyboards()
|
showKeyboards()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
|
|
||||||
|
@ -2366,19 +2341,7 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogInputPacking(itemFk)
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.item_updatePackingShelve(
|
|
||||||
vSelf = itemFk,
|
|
||||||
vPacking = customDialogInput.getValue().toInt()
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -2386,8 +2349,20 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showBottomNavigation(visibilitiy: Int) {
|
private fun customDialogInputPacking(itemFk: Int) {
|
||||||
//requireActivity().main_bottom_navigation.visibility = visibilitiy
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
|
|
||||||
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
viewModel.item_updatePackingShelve(
|
||||||
|
vSelf = itemFk,
|
||||||
|
vPacking = customDialogInput.getValue().toInt()
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
customDialogInput.setValue("")
|
||||||
|
scanRequest()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
hideKeyboards()
|
||||||
}
|
}
|
||||||
|
|
||||||
//FALTAS / BASURA / SPLIT
|
//FALTAS / BASURA / SPLIT
|
||||||
|
@ -2501,6 +2476,7 @@ class CollectionFragmentPreChecker(
|
||||||
sales[positionIncreaseQuantity].originalQuantity = quantityIncrease
|
sales[positionIncreaseQuantity].originalQuantity = quantityIncrease
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun increaseQuantity(position: Int, quantity: Int) {
|
private fun increaseQuantity(position: Int, quantity: Int) {
|
||||||
positionIncreaseQuantity = position
|
positionIncreaseQuantity = position
|
||||||
quantityIncrease = quantity
|
quantityIncrease = quantity
|
||||||
|
@ -2548,26 +2524,14 @@ class CollectionFragmentPreChecker(
|
||||||
customDialogInput.setTitle("" + sale.itemFk)
|
customDialogInput.setTitle("" + sale.itemFk)
|
||||||
.setDescription(getString(R.string.scanWagonForItem))
|
.setDescription(getString(R.string.scanWagonForItem))
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogActionFind(index)
|
||||||
findSale(customDialogInput.getValue(), index)
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
customDialogInput.getEditText().requestFocus()
|
customDialogInput.getEditText().requestFocus()
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogActionFind(index)
|
||||||
findSale(customDialogInput.getValue(), index)
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -2575,6 +2539,17 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun customDialogActionFind(index: Int) {
|
||||||
|
|
||||||
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
|
findSale(customDialogInput.getValue(), index)
|
||||||
|
}
|
||||||
|
customDialogInput.setValue("")
|
||||||
|
scanRequest()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
hideKeyboards()
|
||||||
|
}
|
||||||
|
|
||||||
private fun showErrorMessage(text: String) {
|
private fun showErrorMessage(text: String) {
|
||||||
customDialog.setTitle(getString(R.string.errorMarkLine)).setDescription(text)
|
customDialog.setTitle(getString(R.string.errorMarkLine)).setDescription(text)
|
||||||
.setKoButton(getString(R.string.close)) {
|
.setKoButton(getString(R.string.close)) {
|
||||||
|
|
|
@ -19,7 +19,6 @@ class ControladorFragment :
|
||||||
private var goBack: Boolean = false
|
private var goBack: Boolean = false
|
||||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_general_black
|
override fun getLayoutId(): Int = R.layout.fragment_general_black
|
||||||
//private lateinit var customDialog: CustomDialog
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance() = ControladorFragment()
|
fun newInstance() = ControladorFragment()
|
||||||
|
@ -55,12 +54,10 @@ class ControladorFragment :
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
binding.scanInput.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) {
|
||||||
// d("Action id "+actionId)
|
|
||||||
goBack = false
|
goBack = false
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
|
||||||
|
|
||||||
//sergio: para ver si ha marcado dos veces el mismo ticket. El laser falla
|
//sergio: para ver si ha marcado dos veces el mismo ticket. El laser falla
|
||||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
||||||
|
|
||||||
|
@ -86,10 +83,6 @@ class ControladorFragment :
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage, isError = true, isPlayed = false)
|
ma.messageWithSound(it.errorMessage, isError = true, isPlayed = false)
|
||||||
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
|
||||||
.setOkButton(getString(R.string.accept)) {
|
|
||||||
customDialog.dismiss()
|
|
||||||
}.show()*/
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!goBack) navigateToCollectionList(it)
|
if (!goBack) navigateToCollectionList(it)
|
||||||
|
|
|
@ -137,13 +137,8 @@ class ControlVehiculoFragment(
|
||||||
customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription(description)
|
customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription(description)
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
if (customDialogInput.getValue().isNotEmpty()) {
|
||||||
// "$description ${customDialogInput.getValue()} OK".toast(requireContext())
|
|
||||||
insertControlTimeVehicle(customDialogInput.getValue(), action)
|
insertControlTimeVehicle(customDialogInput.getValue(), action)
|
||||||
}
|
}
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.setKoButton(getString(R.string.cancel)) {
|
.setKoButton(getString(R.string.cancel)) {
|
||||||
|
@ -160,13 +155,8 @@ class ControlVehiculoFragment(
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
|
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
if (customDialogInput.getValue().isNotEmpty()) {
|
||||||
|
|
||||||
insertControlTimeVehicle(customDialogInput.getValue(), action)
|
insertControlTimeVehicle(customDialogInput.getValue(), action)
|
||||||
}
|
}
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -204,6 +194,10 @@ class ControlVehiculoFragment(
|
||||||
ma.openFragmentPickers(true)
|
ma.openFragmentPickers(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
customDialogInput.setValue("")
|
||||||
|
scanRequest()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
hideKeyboards()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun scanRequest() {
|
private fun scanRequest() {
|
||||||
|
|
|
@ -125,7 +125,7 @@ class LogExpeditionFragment(
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
"""${getString(R.string.expedition)} ${binding.scanInput.text}"""
|
"""${getString(R.string.expedition)} ${binding.scanInput.text}"""
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
"Error al escanear expedición".toast(context, Toast.LENGTH_SHORT)
|
getString(R.string.errorScanExpedition).toast(context, Toast.LENGTH_SHORT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,6 @@ class DayOfSaleFragment(
|
||||||
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 (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||||
getItemsSaleDate(binding.scanInput.text.toString())
|
getItemsSaleDate(binding.scanInput.text.toString())
|
||||||
|
|
||||||
itemScan = binding.scanInput.text.toString()
|
itemScan = binding.scanInput.text.toString()
|
||||||
}
|
}
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
|
|
|
@ -612,9 +612,6 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
private fun createListInventoryParking(
|
private fun createListInventoryParking(
|
||||||
) {
|
) {
|
||||||
println("El filtro es " + filterActivated)
|
|
||||||
println("El filtro shelving es " + positionShelvingChecking)
|
|
||||||
println("El filtro shelving guardado " + shelvingSaved)
|
|
||||||
|
|
||||||
adapter = InventoryParkingAdapter(
|
adapter = InventoryParkingAdapter(
|
||||||
(if (filterActivated) {
|
(if (filterActivated) {
|
||||||
|
@ -630,7 +627,7 @@ class InventaryParkingFragment(
|
||||||
} else {
|
} else {
|
||||||
myListInventory
|
myListInventory
|
||||||
}
|
}
|
||||||
}) as List<ItemInventoryParking>,
|
}),
|
||||||
onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
onPasillerosItemClickListener = pasillerosItemClickListener!!,
|
||||||
onVisibleInventoryClickListener = object : OnVisibleInventoryClickListener {
|
onVisibleInventoryClickListener = object : OnVisibleInventoryClickListener {
|
||||||
override fun onVisibleInventoryClickListener(item: ItemInventoryParking) {
|
override fun onVisibleInventoryClickListener(item: ItemInventoryParking) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import android.view.inputmethod.EditorInfo
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentExpeditionscanSorterBinding
|
import es.verdnatura.databinding.FragmentExpeditionscanSorterBinding
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.itemScanned
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
|
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ class CmrExpeditionPalletFragment(
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_expeditionscan_sorter
|
override fun getLayoutId(): Int = R.layout.fragment_expeditionscan_sorter
|
||||||
private lateinit var customDialogList: CustomDialogInputTwoValues
|
private lateinit var customDialogList: CustomDialogInputTwoValues
|
||||||
private var itemScaned: String = ""
|
private var itemScaned: String = ""
|
||||||
private var dataScanned: itemScanned? = null
|
private var dataScanned: ItemScanned? = null
|
||||||
private var dataScannedTwo: itemScanned? = null
|
private var dataScannedTwo: ItemScanned? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(title: String) = CmrExpeditionPalletFragment(title)
|
fun newInstance(title: String) = CmrExpeditionPalletFragment(title)
|
||||||
|
@ -111,23 +111,11 @@ class CmrExpeditionPalletFragment(
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||||
// var action = true
|
|
||||||
if (customDialogList.getValue().isNotEmpty()) {
|
if (customDialogList.getValue().isNotEmpty()) {
|
||||||
dataScanned = itemScan(customDialogList.getValue())
|
dataScanned = itemScan(customDialogList.getValue())
|
||||||
|
|
||||||
if (dataScanned == null) {
|
if (dataScanned != null) {
|
||||||
// action = false
|
|
||||||
/*ma.messageWithSound(
|
|
||||||
getString(R.string.errorPalletCmrNotScanned),
|
|
||||||
isError = true,
|
|
||||||
isPlayed = true,
|
|
||||||
titleWithError = getString(R.string.warning),
|
|
||||||
isToasted = true
|
|
||||||
)
|
|
||||||
customDialogList.setValue("")*/
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// action = false
|
|
||||||
customDialogList.setValue(dataScanned!!.id.toString())
|
customDialogList.setValue(dataScanned!!.id.toString())
|
||||||
customDialogList.setHint(true)
|
customDialogList.setHint(true)
|
||||||
if (dataScanned!!.table == "cmr") {
|
if (dataScanned!!.table == "cmr") {
|
||||||
|
@ -158,28 +146,6 @@ class CmrExpeditionPalletFragment(
|
||||||
customDialogList.getValueTwo().toInt()
|
customDialogList.getValueTwo().toInt()
|
||||||
)
|
)
|
||||||
|
|
||||||
/* var messageLabel = ""
|
|
||||||
when (dataScanned!!.table) {
|
|
||||||
"cmr" -> {
|
|
||||||
messageLabel = "CMR"
|
|
||||||
}
|
|
||||||
"expeditionPallet" -> {
|
|
||||||
messageLabel = "Pallet"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ma.messageWithSound(
|
|
||||||
String.format(
|
|
||||||
getString(R.string.labelPalletOrCmrNotValid),
|
|
||||||
messageLabel
|
|
||||||
),
|
|
||||||
isError = true,
|
|
||||||
isPlayed = true,
|
|
||||||
titleWithError = getString(R.string.warning),
|
|
||||||
isToasted = true
|
|
||||||
)
|
|
||||||
customDialogList.setValueTwo("")*/
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (dataScanned != null) {
|
if (dataScanned != null) {
|
||||||
|
|
||||||
|
@ -189,7 +155,7 @@ class CmrExpeditionPalletFragment(
|
||||||
getString(R.string.errorSameType),
|
getString(R.string.errorSameType),
|
||||||
isError = true,
|
isError = true,
|
||||||
isPlayed = true,
|
isPlayed = true,
|
||||||
titleWithError = "Aviso",
|
titleWithError = getString(R.string.info),
|
||||||
isToasted = true
|
isToasted = true
|
||||||
)
|
)
|
||||||
customDialogList.setValueTwo("")
|
customDialogList.setValueTwo("")
|
||||||
|
@ -226,10 +192,10 @@ class CmrExpeditionPalletFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun itemScan(value: String): itemScanned? {
|
private fun itemScan(value: String): ItemScanned? {
|
||||||
|
|
||||||
return try {
|
return try {
|
||||||
val valueScanned = itemScanned(JSONObject(value))
|
val valueScanned = ItemScanned(JSONObject(value))
|
||||||
|
|
||||||
if (valueScanned.table == "cmr" || valueScanned.table == "expeditionPallet") {
|
if (valueScanned.table == "cmr" || valueScanned.table == "expeditionPallet") {
|
||||||
valueScanned
|
valueScanned
|
||||||
|
|
|
@ -79,12 +79,13 @@ class ExpeditionPalletFragment(
|
||||||
itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
||||||
itemExpeditionTruckVO!!.description
|
itemExpeditionTruckVO!!.description
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
itemExpeditionTruckVO!!.Destino
|
itemExpeditionTruckVO!!.Destino
|
||||||
}
|
}
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
viewModel.expeditionPallet_List(itemExpeditionTruckVO!!.truckFk
|
viewModel.expeditionPallet_List(
|
||||||
|
itemExpeditionTruckVO!!.truckFk
|
||||||
)
|
)
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
@ -111,7 +112,7 @@ class ExpeditionPalletFragment(
|
||||||
if (item == iconReload) {
|
if (item == iconReload) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionPallet_List(
|
viewModel.expeditionPallet_List(
|
||||||
itemExpeditionTruckVO!!.truckFk
|
itemExpeditionTruckVO!!.truckFk
|
||||||
)
|
)
|
||||||
} else if (item == iconPlus) {
|
} else if (item == iconPlus) {
|
||||||
expeditionScanAdd()
|
expeditionScanAdd()
|
||||||
|
@ -154,15 +155,8 @@ class ExpeditionPalletFragment(
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (it.response == "0") {
|
|
||||||
|
|
||||||
//"Rutas iguales ${it.response}".toast(requireActivity())
|
|
||||||
////Log.i("VERDNATURA:","Rutas iguales")
|
|
||||||
}
|
|
||||||
if (it.response == "1") {
|
if (it.response == "1") {
|
||||||
mperror?.start()
|
mperror?.start()
|
||||||
// "Resultado llamada $it.response".toast(requireActivity())
|
|
||||||
////Log.i("VERDNATURA:","Rutas distintas")
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,7 +184,7 @@ class ExpeditionPalletFragment(
|
||||||
private fun expeditionScanAdd() {
|
private fun expeditionScanAdd() {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionScanAdd(
|
viewModel.expeditionScanAdd(
|
||||||
vPalletFk = 0, vTruckFk = itemExpeditionTruckVO!!.truckFk
|
vPalletFk = 0, vTruckFk = itemExpeditionTruckVO!!.truckFk
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,14 +225,14 @@ class ExpeditionPalletFragment(
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.close)) {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionPallet_List(
|
viewModel.expeditionPallet_List(
|
||||||
itemExpeditionTruckVO!!.truckFk
|
itemExpeditionTruckVO!!.truckFk
|
||||||
)
|
)
|
||||||
listExpeditions = ArrayList()
|
listExpeditions = ArrayList()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
|
|
||||||
customDialogList.getEditText().requestFocus()
|
customDialogList.getEditText().requestFocus()
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
@ -247,7 +241,7 @@ class ExpeditionPalletFragment(
|
||||||
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()) {
|
||||||
try {
|
try {
|
||||||
// val numExpedition = customDialogList.getValue().toDouble()
|
|
||||||
if (customDialogList.getValue().length >= 7) {
|
if (customDialogList.getValue().length >= 7) {
|
||||||
listExpeditions.add(0, BarcodeVO(code = customDialogList.getValue()))
|
listExpeditions.add(0, BarcodeVO(code = customDialogList.getValue()))
|
||||||
customDialogList.setDescription(getString(R.string.total) + listExpeditions.size)
|
customDialogList.setDescription(getString(R.string.total) + listExpeditions.size)
|
||||||
|
@ -255,7 +249,6 @@ class ExpeditionPalletFragment(
|
||||||
it.list.get(0).palletFk,
|
it.list.get(0).palletFk,
|
||||||
customDialogList.getValue().toInt()
|
customDialogList.getValue().toInt()
|
||||||
)
|
)
|
||||||
////Log.i("VERDNATURA:"," palletizando ${it.list.get(0).palletFk} expedi: ${customDialogList.getValue()}")
|
|
||||||
viewModel.checkRouteExpeditionScanPut(
|
viewModel.checkRouteExpeditionScanPut(
|
||||||
it.list[0].palletFk,
|
it.list[0].palletFk,
|
||||||
customDialogList.getValue().toInt()
|
customDialogList.getValue().toInt()
|
||||||
|
|
|
@ -83,7 +83,7 @@ class ExpeditionScanFragment(
|
||||||
setToolBar()
|
setToolBar()
|
||||||
setEvents()
|
setEvents()
|
||||||
viewModel.expeditionScanList(
|
viewModel.expeditionScanList(
|
||||||
itemPalletVO!!.Pallet
|
itemPalletVO!!.Pallet
|
||||||
)
|
)
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ class ExpeditionScanFragment(
|
||||||
.setOkButton(getString(R.string.delete)) {
|
.setOkButton(getString(R.string.delete)) {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
viewModel.expeditionScanDel(
|
viewModel.expeditionScanDel(
|
||||||
itemExpeditionScan.id
|
itemExpeditionScan.id
|
||||||
)
|
)
|
||||||
customDialogTwoButtons.dismiss()
|
customDialogTwoButtons.dismiss()
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
@ -226,27 +226,28 @@ class ExpeditionScanFragment(
|
||||||
|
|
||||||
onComprobarPalletViewClickListener!!.onComprobarPalletViewClickListener(
|
onComprobarPalletViewClickListener!!.onComprobarPalletViewClickListener(
|
||||||
itemExpeditionTruckVO!!,
|
itemExpeditionTruckVO!!,
|
||||||
ItemPalletVO(Pallet = it.list.get(0).palletFk))
|
ItemPalletVO(Pallet = it.list.get(0).palletFk)
|
||||||
|
)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
customDialog.setTitle(getString(R.string.info))
|
customDialog.setTitle(getString(R.string.info))
|
||||||
.setDescription(getString(R.string.expeditionsError)).setOkButton(
|
.setDescription(getString(R.string.expeditionsError)).setOkButton(
|
||||||
getString(
|
getString(
|
||||||
R.string.ok
|
R.string.ok
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.close)) {
|
}.setKoButton(getString(R.string.close)) {
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
listExpeditions = ArrayList()
|
listExpeditions = ArrayList()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
|
|
||||||
customDialogList.getEditText().requestFocus()
|
customDialogList.getEditText().requestFocus()
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
@ -254,19 +255,22 @@ class ExpeditionScanFragment(
|
||||||
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()) {
|
||||||
|
try {
|
||||||
|
listExpeditions.add(BarcodeVO(code = customDialogList.getValue()))
|
||||||
|
viewModel.expeditionScanPut(
|
||||||
|
it.list[0].palletFk,
|
||||||
|
customDialogList.getValue().toInt()
|
||||||
|
)
|
||||||
|
checkRouteExpeditionScanPut(
|
||||||
|
it.list[0].palletFk,
|
||||||
|
customDialogList.getValue().toInt()
|
||||||
|
)
|
||||||
|
|
||||||
listExpeditions.add(BarcodeVO(code = customDialogList.getValue()))
|
expeditionAdapter!!.notifyDataSetChanged()
|
||||||
viewModel.expeditionScanPut(
|
} catch (ex: Exception) {
|
||||||
it.list.get(0).palletFk,
|
getString(R.string.errorInput)
|
||||||
customDialogList.getValue().toInt()
|
}
|
||||||
)
|
|
||||||
|
|
||||||
checkRouteExpeditionScanPut(
|
|
||||||
it.list.get(0).palletFk,
|
|
||||||
customDialogList.getValue().toInt()
|
|
||||||
)
|
|
||||||
|
|
||||||
expeditionAdapter!!.notifyDataSetChanged()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
customDialogList.setValue("")
|
customDialogList.setValue("")
|
||||||
|
|
|
@ -126,9 +126,8 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
||||||
customDialogHor.setTitle(getString(R.string.newTruck)).setOkButton(getString(R.string.save)){
|
customDialogHor.setTitle(getString(R.string.newTruck)).setOkButton(getString(R.string.save)){
|
||||||
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
||||||
if (customDialogHor.getDestinoValue().isNotEmpty() && customDialogHor.getHoraValue().isNotEmpty()){
|
if (customDialogHor.getDestinoValue().isNotEmpty() && customDialogHor.getHoraValue().isNotEmpty()){
|
||||||
viewModel.expeditionTruckAdd(customDialogHor.getHoraValue(),customDialogHor.getDestinoValue())
|
customDialogActionTruck()
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
customDialogHor.dismiss()
|
|
||||||
}
|
}
|
||||||
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
||||||
customDialogHor.dismiss()
|
customDialogHor.dismiss()
|
||||||
|
@ -141,9 +140,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (customDialogHor.getDestinoValue().isNotEmpty() && customDialogHor.getHoraValue()
|
if (customDialogHor.getDestinoValue().isNotEmpty() && customDialogHor.getHoraValue()
|
||||||
.isNotEmpty()){
|
.isNotEmpty()){
|
||||||
viewModel.expeditionTruckAdd(customDialogHor.getHoraValue(),customDialogHor.getDestinoValue())
|
customDialogActionTruck()
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
|
||||||
customDialogHor.dismiss()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
|
@ -153,7 +150,12 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
private fun customDialogActionTruck() {
|
||||||
|
viewModel.expeditionTruckAdd(customDialogHor.getHoraValue(),customDialogHor.getDestinoValue())
|
||||||
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
|
customDialogHor.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import es.verdnatura.presentation.common.hideKeyboard
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import es.verdnatura.presentation.view.feature.parking.adapter.ParkingAdapter
|
import es.verdnatura.presentation.view.feature.parking.adapter.ParkingAdapter
|
||||||
import org.koin.android.ext.android.bind
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBinding,ParkingViewModel>(ParkingViewModel::class) {
|
class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBinding,ParkingViewModel>(ParkingViewModel::class) {
|
||||||
|
@ -76,14 +75,9 @@ class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBindi
|
||||||
ma.messageWithSound(message=getString(R.string.Aparcado), isError = false,isPlayed = false, isToasted = true)
|
ma.messageWithSound(message=getString(R.string.Aparcado), isError = false,isPlayed = false, isToasted = true)
|
||||||
numParking -= 1
|
numParking -= 1
|
||||||
if (numParking <= 0) {
|
if (numParking <= 0) {
|
||||||
// binding.splashProgress.visibility = View.GONE
|
|
||||||
//viewModel.hideProgressLoading()
|
|
||||||
mpok?.start()
|
mpok?.start()
|
||||||
setList()
|
setList()
|
||||||
|
|
||||||
//Tarea #4711 Jordi parking canviat
|
|
||||||
//requireActivity().onBackPressed()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -273,7 +273,7 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// responseSaleMoveSuccesful()
|
// responseSaleMoveSuccesful()
|
||||||
ma.messageWithSound(getString(R.string.splitOk), isError = false, true)
|
ma.messageWithSound(getString(R.string.splitOk), isError = false, true)
|
||||||
setTotalLines()
|
setTotalLines()
|
||||||
}
|
}
|
||||||
|
@ -421,10 +421,10 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
|
|
||||||
//enviar mensaje a salix
|
//enviar mensaje a salix
|
||||||
/* val ticket =
|
/* val ticket =
|
||||||
"[" + sales[positionCollectionSplit].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].id + "/summary)"
|
"[" + sales[positionCollectionSplit].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].id + "/summary)"
|
||||||
val message =
|
val message =
|
||||||
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + getString(R.string.fromTicket) + ticket*/
|
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + getString(R.string.fromTicket) + ticket*/
|
||||||
|
|
||||||
|
|
||||||
/* viewModel.sendChekingPresence(
|
/* viewModel.sendChekingPresence(
|
||||||
|
@ -433,7 +433,7 @@ class EndSacadorFragment(
|
||||||
message = message,
|
message = message,
|
||||||
"sendChekingPresence"
|
"sendChekingPresence"
|
||||||
)*/
|
)*/
|
||||||
/* sendSalixMessageNew(message, sales[positionCollectionSplit].salesPersonFk)*/
|
/* sendSalixMessageNew(message, sales[positionCollectionSplit].salesPersonFk)*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,18 +449,18 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
saleAdapter?.notifyDataSetChanged()
|
saleAdapter?.notifyDataSetChanged()
|
||||||
|
|
||||||
/* val ticket =
|
/* val ticket =
|
||||||
"[" + sales[positionIncreaseQuantity].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].id + "/summary)"
|
"[" + sales[positionIncreaseQuantity].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].id + "/summary)"
|
||||||
val message =
|
val message =
|
||||||
getString(R.string.modifiedQuantityPrevious) + sales[positionIncreaseQuantity].quantity + getString(
|
getString(R.string.modifiedQuantityPrevious) + sales[positionIncreaseQuantity].quantity + getString(
|
||||||
R.string.fromItem
|
R.string.fromItem
|
||||||
) + sales[positionIncreaseQuantity].itemFk + getString(R.string.toNewQuantity) + quantityIncrease + getString(
|
) + sales[positionIncreaseQuantity].itemFk + getString(R.string.toNewQuantity) + quantityIncrease + getString(
|
||||||
R.string.fromTicket
|
R.string.fromTicket
|
||||||
) + ticket
|
) + ticket
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sendSalixMessageNew(message, sales[positionIncreaseQuantity].salesPersonFk)*/
|
sendSalixMessageNew(message, sales[positionIncreaseQuantity].salesPersonFk)*/
|
||||||
searchSaleCollection()
|
searchSaleCollection()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -514,8 +514,8 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
//sergio: para que no de error si no hay carros. Ya está asignado a 0 el pickingorder si no hay item en el carro
|
//sergio: para que no de error si no hay carros. Ya está asignado a 0 el pickingorder si no hay item en el carro
|
||||||
if (!s.carros.isNullOrEmpty()) {
|
if (!s.carros.isNullOrEmpty()) {
|
||||||
/* s.carros = s.carros.sortedWith(compareBy{it.pickingOrder}).sortedWith(
|
/* s.carros = s.carros.sortedWith(compareBy{it.pickingOrder}).sortedWith(
|
||||||
compareByDescending{it.priority})*/
|
compareByDescending{it.priority})*/
|
||||||
s.pickingOrder = s.carros.get(0).pickingOrder
|
s.pickingOrder = s.carros.get(0).pickingOrder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -705,13 +705,13 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/* if (sales[position].picked == 0) {
|
/* if (sales[position].picked == 0) {
|
||||||
viewModel.saleTracking_updateIsChecked(
|
viewModel.saleTracking_updateIsChecked(
|
||||||
vSaleFk = sales[position].idMovimiento.toInt(),
|
vSaleFk = sales[position].idMovimiento.toInt(),
|
||||||
vIsChecked = sales[position].picked == sales[position].quantity
|
vIsChecked = sales[position].picked == sales[position].quantity
|
||||||
|
|
||||||
)
|
)
|
||||||
}*/
|
}*/
|
||||||
isScanned = null
|
isScanned = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -847,7 +847,8 @@ class EndSacadorFragment(
|
||||||
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) {
|
||||||
try {
|
try {
|
||||||
isScanned = event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
isScanned =
|
||||||
|
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
|
|
||||||
customDialogList.setValueTwo(
|
customDialogList.setValueTwo(
|
||||||
itemScanValue(
|
itemScanValue(
|
||||||
|
@ -957,26 +958,14 @@ class EndSacadorFragment(
|
||||||
customDialogInput.setTitle("" + sale.itemFk)
|
customDialogInput.setTitle("" + sale.itemFk)
|
||||||
.setDescription(getString(R.string.scanWagonForItem))
|
.setDescription(getString(R.string.scanWagonForItem))
|
||||||
.setOkButton(getString(R.string.accept)) {
|
.setOkButton(getString(R.string.accept)) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogInputAction(index)
|
||||||
findSale(customDialogInput.getValue(), index)
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
customDialogInput.getEditText().requestFocus()
|
customDialogInput.getEditText().requestFocus()
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
customDialogInputAction(index)
|
||||||
findSale(customDialogInput.getValue(), index)
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -984,18 +973,14 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//OPTIONS
|
private fun customDialogInputAction(index: Int) {
|
||||||
private fun print() {
|
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||||
/* viewModel.collectionStickerPrint(
|
findSale(customDialogInput.getValue(), index)
|
||||||
usuario = user,
|
customDialogInput.setValue("")
|
||||||
password = password,
|
scanRequest()
|
||||||
collectionFk = ticket,
|
customDialogInput.dismiss()
|
||||||
sectorFk = sectorFk,"collectionSticker_print"
|
hideKeyboards()
|
||||||
)
|
}
|
||||||
////Log.i("VERDNATURA:","La collection es $ticket, sectorFk $sectorFk, user $user i pass $password")
|
|
||||||
(getString(R.string.Imprimiendo) + SectorDescription).toast(requireContext())*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//OTROS
|
//OTROS
|
||||||
|
|
|
@ -72,7 +72,6 @@ class QrFragment(
|
||||||
ma.hideKeyboard(binding.scanInput)
|
ma.hideKeyboard(binding.scanInput)
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
// false
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,23 +164,7 @@ class ReubicationCollectionFragment(
|
||||||
.setValue(itemReubication.quantity.toString())
|
.setValue(itemReubication.quantity.toString())
|
||||||
.setOkButton(getString(R.string.leaveItem)) {
|
.setOkButton(getString(R.string.leaveItem)) {
|
||||||
|
|
||||||
|
customDialogMerge(itemReubication)
|
||||||
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelving_merge(
|
|
||||||
itemReubication.id,
|
|
||||||
customDialogInputTwoValues.getValueTwo().uppercase()
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
ma.messageWithSound(
|
|
||||||
getString(R.string.returnScan),
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
isToasted = true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
customDialogInputTwoValues.setValueTwo("")
|
|
||||||
customDialogInputTwoValues.dismiss()
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
|
@ -188,23 +172,13 @@ class ReubicationCollectionFragment(
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogInputTwoValues.dismiss()
|
customDialogInputTwoValues.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
//}
|
|
||||||
customDialogInputTwoValues.getEditTextTwo()
|
customDialogInputTwoValues.getEditTextTwo()
|
||||||
.setOnEditorActionListener { v, actionId, event ->
|
.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
|
|
||||||
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
|
customDialogMerge(itemReubication)
|
||||||
|
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelving_merge(
|
|
||||||
itemReubication.id,
|
|
||||||
customDialogInputTwoValues.getValueTwo().uppercase()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
customDialogInputTwoValues.setValue("")
|
|
||||||
scanRequest()
|
|
||||||
customDialogInputTwoValues.dismiss()
|
|
||||||
//hideKeyboards()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -214,6 +188,28 @@ class ReubicationCollectionFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun customDialogMerge(itemReubication: Reubication) {
|
||||||
|
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
|
||||||
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
viewModel.itemShelving_merge(
|
||||||
|
itemReubication.id,
|
||||||
|
customDialogInputTwoValues.getValueTwo().uppercase()
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
ma.messageWithSound(
|
||||||
|
getString(R.string.returnScan),
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
isToasted = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
customDialogInputTwoValues.setValue("")
|
||||||
|
customDialogInputTwoValues.setValueTwo("")
|
||||||
|
customDialogInputTwoValues.dismiss()
|
||||||
|
scanRequest()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun scanRequest() {
|
private fun scanRequest() {
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
|
|
|
@ -64,9 +64,11 @@ class SacadorFragment(
|
||||||
"PREPARED" -> {
|
"PREPARED" -> {
|
||||||
viewModel.collectionGetSalix()
|
viewModel.collectionGetSalix()
|
||||||
}
|
}
|
||||||
|
|
||||||
"PREITEMPICKER" -> {
|
"PREITEMPICKER" -> {
|
||||||
viewModel.sectorCollection_get()
|
viewModel.sectorCollection_get()
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
@ -126,6 +128,7 @@ class SacadorFragment(
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
|
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
|
||||||
|
|
||||||
iconPrint.drawable -> {
|
iconPrint.drawable -> {
|
||||||
|
@ -145,32 +148,19 @@ class SacadorFragment(
|
||||||
customDialogInput.setDescription(getString(R.string.printPreviousGroup))
|
customDialogInput.setDescription(getString(R.string.printPreviousGroup))
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setOkButton(getString(R.string.print)) {
|
.setOkButton(getString(R.string.print)) {
|
||||||
try {
|
printAction()
|
||||||
if (customDialogInput.getValue().isNotEmpty()
|
|
||||||
) {
|
|
||||||
print()
|
|
||||||
}
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
getString(R.string.errorInput)
|
|
||||||
}
|
|
||||||
customDialogInput.setValue("")
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
customDialogInput.setFocusText()
|
customDialogInput.setFocusText()
|
||||||
|
|
||||||
|
|
||||||
customDialogInput.setFocusText()
|
customDialogInput.setFocusText()
|
||||||
ma.hideKeyboard(customDialogInput.getEditText())
|
ma.hideKeyboard(customDialogInput.getEditText())
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||||
|
|
||||||
if (customDialogInput.getValue().isNotEmpty()
|
printAction()
|
||||||
) {
|
|
||||||
print()
|
|
||||||
}
|
|
||||||
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
|
@ -180,15 +170,23 @@ class SacadorFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun print() {
|
private fun printAction() {
|
||||||
if (ma.havePrinter()) {
|
try {
|
||||||
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
|
if (customDialogInput.getValue().isNotEmpty()
|
||||||
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
|
) {
|
||||||
requireContext()
|
if (ma.havePrinter()) {
|
||||||
)
|
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
|
||||||
} else {
|
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
|
||||||
getString(R.string.selectPrinter).toast(requireContext())
|
requireContext()
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
getString(R.string.selectPrinter).toast(requireContext())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
getString(R.string.errorInput)
|
||||||
}
|
}
|
||||||
|
customDialogInput.setValue("")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
|
@ -216,7 +214,7 @@ class SacadorFragment(
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (goBack) {
|
if (goBack) {
|
||||||
if (!it.response.isNullOrBlank())addCollectionToList(it.response.toInt())
|
if (!it.response.isNullOrBlank()) addCollectionToList(it.response.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goBack = false
|
goBack = false
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.smarttag.adapter
|
package es.verdnatura.presentation.view.feature.smarttag.adapter
|
||||||
|
|
||||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
|
||||||
|
|
||||||
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
@ -9,13 +7,14 @@ import android.view.ViewGroup
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.databinding.ItemSmarttagRowBinding
|
import es.verdnatura.databinding.ItemSmarttagRowBinding
|
||||||
import es.verdnatura.presentation.common.OnSmartTagRowClickListener
|
import es.verdnatura.presentation.common.OnSmartTagRowClickListener
|
||||||
|
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||||
|
|
||||||
|
|
||||||
class SmartTagAdapter(
|
class BufferAdapter(
|
||||||
private val items: List<SmartTag>,
|
private val items: List<SmartTag>,
|
||||||
private val OnSmartTagRowClickListener: OnSmartTagRowClickListener,
|
private val OnSmartTagRowClickListener: OnSmartTagRowClickListener,
|
||||||
private var showDelete: Boolean = true
|
private var showDelete: Boolean = true
|
||||||
): RecyclerView.Adapter<SmartTagAdapter.ItemHolder> () {
|
): RecyclerView.Adapter<BufferAdapter.ItemHolder> () {
|
||||||
|
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
|
@ -76,7 +76,6 @@ class AutomaticAddItemFragment(
|
||||||
if (!binding.editMatricula.text.toString().isNullOrEmpty()) {
|
if (!binding.editMatricula.text.toString().isNullOrEmpty()) {
|
||||||
contador += 1
|
contador += 1
|
||||||
setSubtitle()
|
setSubtitle()
|
||||||
// binding.editMatricula.setText(textScanned_filterDouble(binding.editMatricula.text.toString()))
|
|
||||||
try {
|
try {
|
||||||
listItems.add(
|
listItems.add(
|
||||||
0, ItemEscanerVO(
|
0, ItemEscanerVO(
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.ubicador.fragment
|
package es.verdnatura.presentation.view.feature.ubicador.fragment
|
||||||
|
|
||||||
import android.view.KeyEvent
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
@ -10,9 +8,7 @@ import es.verdnatura.databinding.FragmentAutomaticAddItemBinding
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnAutomaticItemClickListener
|
import es.verdnatura.presentation.common.OnAutomaticItemClickListener
|
||||||
import es.verdnatura.presentation.common.itemScanValue
|
import es.verdnatura.presentation.common.itemScanValue
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapter
|
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapterTEST
|
import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapterTEST
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemEscanerVO
|
|
||||||
import java.lang.Boolean.TRUE
|
import java.lang.Boolean.TRUE
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,7 +70,6 @@ class AutomaticAddItemFragmentTEST(
|
||||||
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
|
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
|
||||||
|
|
||||||
if (actionId == 0 || actionId == 5 || actionId == 6 ) {
|
if (actionId == 0 || actionId == 5 || actionId == 6 ) {
|
||||||
var l1= System.currentTimeMillis()
|
|
||||||
if (!binding.editMatricula.text.toString().isNullOrEmpty()) {
|
if (!binding.editMatricula.text.toString().isNullOrEmpty()) {
|
||||||
try {
|
try {
|
||||||
listItems.add(
|
listItems.add(
|
||||||
|
@ -95,8 +90,6 @@ class AutomaticAddItemFragmentTEST(
|
||||||
ma.messageWithSound(ex.message.toString(), true, true)
|
ma.messageWithSound(ex.message.toString(), true, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var l2=System.currentTimeMillis()
|
|
||||||
println("Lectura diferencia:${l2-l1}")
|
|
||||||
binding.editMatricula.setText("")
|
binding.editMatricula.setText("")
|
||||||
ma.hideKeyboard(binding.editMatricula)
|
ma.hideKeyboard(binding.editMatricula)
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
|
|
|
@ -251,11 +251,6 @@ class UbicadorFragment(
|
||||||
binding.editMatricula.text.toString()
|
binding.editMatricula.text.toString()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/*Tarea#5109*/
|
|
||||||
/*viewModel.getIdFromCode(
|
|
||||||
code = binding.editMatricula.text.toString()
|
|
||||||
)*/
|
|
||||||
try {
|
try {
|
||||||
binding.splashProgress.visibility = VISIBLE
|
binding.splashProgress.visibility = VISIBLE
|
||||||
viewModel.getIdFromCode(
|
viewModel.getIdFromCode(
|
||||||
|
@ -321,16 +316,8 @@ class UbicadorFragment(
|
||||||
R.string.parking
|
R.string.parking
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
viewModel.shelvingPark(
|
customDialogActionParking()
|
||||||
shelvingFk,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
parking = customDialogInput.getValue()
|
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
|
||||||
R.string.label
|
|
||||||
) + etiquetas
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
@ -346,17 +333,7 @@ class UbicadorFragment(
|
||||||
customDialogInput.getEditText()
|
customDialogInput.getEditText()
|
||||||
.setOnEditorActionListener { v, actionId, event ->
|
.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
viewModel.shelvingPark(
|
customDialogActionParking()
|
||||||
shelvingFk,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
parking = customDialogInput.getValue()
|
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
|
||||||
R.string.label
|
|
||||||
) + etiquetas
|
|
||||||
|
|
||||||
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
|
@ -372,14 +349,7 @@ class UbicadorFragment(
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setOkButton(getString(R.string.save)) {
|
.setOkButton(getString(R.string.save)) {
|
||||||
if (!customDialogInput.getValue().isNullOrBlank()) {
|
if (!customDialogInput.getValue().isNullOrBlank()) {
|
||||||
viewModel.shelvingChangeSalix(
|
customDialogActionChange()
|
||||||
shelvingFk, customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
shelvingFk = customDialogInput.getValue()
|
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
|
||||||
R.string.label
|
|
||||||
) + etiquetas
|
|
||||||
} else {
|
} else {
|
||||||
getString(R.string.errorShelving).toast(
|
getString(R.string.errorShelving).toast(
|
||||||
requireContext()
|
requireContext()
|
||||||
|
@ -400,18 +370,7 @@ class UbicadorFragment(
|
||||||
customDialogInput.getEditText()
|
customDialogInput.getEditText()
|
||||||
.setOnEditorActionListener { v, actionId, event ->
|
.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
|
customDialogActionChange()
|
||||||
viewModel.shelvingChangeSalix(
|
|
||||||
shelvingFk,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
shelvingFk = customDialogInput.getValue()
|
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
|
||||||
R.string.label
|
|
||||||
) + etiquetas
|
|
||||||
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -451,6 +410,31 @@ class UbicadorFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun customDialogActionParking() {
|
||||||
|
viewModel.shelvingPark(
|
||||||
|
shelvingFk,
|
||||||
|
customDialogInput.getValue()
|
||||||
|
)
|
||||||
|
parking = customDialogInput.getValue()
|
||||||
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
|
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
||||||
|
R.string.label
|
||||||
|
) + etiquetas
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun customDialogActionChange() {
|
||||||
|
viewModel.shelvingChangeSalix(
|
||||||
|
shelvingFk, customDialogInput.getValue()
|
||||||
|
)
|
||||||
|
shelvingFk = customDialogInput.getValue()
|
||||||
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
|
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
||||||
|
R.string.label
|
||||||
|
) + etiquetas
|
||||||
|
customDialog.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkUbications(itemScanned: Int) {
|
private fun checkUbications(itemScanned: Int) {
|
||||||
itemScannedScreen = itemScanned
|
itemScannedScreen = itemScanned
|
||||||
val listInt: ArrayList<Int> = ArrayList()
|
val listInt: ArrayList<Int> = ArrayList()
|
||||||
|
@ -1019,19 +1003,7 @@ class UbicadorFragment(
|
||||||
.setDescription(getString(R.string.selectDestiny) + item.item)
|
.setDescription(getString(R.string.selectDestiny) + item.item)
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setOkButton(getString(R.string.transfer)) {
|
.setOkButton(getString(R.string.transfer)) {
|
||||||
if (customDialogInput.getValue().isNotEmpty()) {
|
customDialogInputAction(item)
|
||||||
binding.splashProgress.visibility = VISIBLE
|
|
||||||
viewModel.itemShelvingTransfer(
|
|
||||||
item.id,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
listItems.remove(item)
|
|
||||||
adapter!!.notifyDataSetChanged()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
} else {
|
|
||||||
getString(R.string.wagonIncorrect).toast(requireContext())
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
|
@ -1041,13 +1013,7 @@ class UbicadorFragment(
|
||||||
customDialogInput.getEditText()
|
customDialogInput.getEditText()
|
||||||
.setOnEditorActionListener { v, actionId, event ->
|
.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
viewModel.itemShelvingTransfer(
|
customDialogInputAction(item)
|
||||||
item.id,
|
|
||||||
customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
listItems.remove(item)
|
|
||||||
adapter!!.notifyDataSetChanged()
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
@ -1087,5 +1053,21 @@ class UbicadorFragment(
|
||||||
customDialogTwoButtons.dismiss()
|
customDialogTwoButtons.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun customDialogInputAction(item:ItemUbicadorVO) {
|
||||||
|
if (customDialogInput.getValue().isNotEmpty()) {
|
||||||
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
viewModel.itemShelvingTransfer(
|
||||||
|
item.id,
|
||||||
|
customDialogInput.getValue()
|
||||||
|
)
|
||||||
|
listItems.remove(item)
|
||||||
|
adapter!!.notifyDataSetChanged()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
} else {
|
||||||
|
getString(R.string.wagonIncorrect).toast(requireContext())
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue