feat: regularizar Parking #7817
This commit is contained in:
parent
f3882c7f9a
commit
f569c45f80
|
@ -42,8 +42,8 @@ fun EditText.toInt(): Int {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun String.isParking(): Boolean {
|
fun String.isParking(): Boolean {
|
||||||
val regex = Regex("[\\S-\\S]{5}")
|
val regex = Regex("^[^ ]+-[^ ]+$")
|
||||||
return regex.matches(this)
|
return this.length > 4 && regex.matches(this)
|
||||||
}
|
}
|
||||||
fun String.isShelving(): Boolean {
|
fun String.isShelving(): Boolean {
|
||||||
val regex = Regex("\\S{0,4}")
|
val regex = Regex("\\S{0,4}")
|
||||||
|
|
|
@ -48,14 +48,24 @@ class ExpeditionPalletDetailFragment(
|
||||||
override fun init() {
|
override fun init() {
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
binding.expeditionPalletDetailPallet.text =
|
binding.expeditionPalletDetailPallet.text =
|
||||||
getString(R.string.pallet) + " " + itemPallet!!.Pallet
|
buildString {
|
||||||
|
append(getString(R.string.pallet))
|
||||||
|
append(" ")
|
||||||
|
append(itemPallet!!.Pallet)
|
||||||
|
}
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
itemExpeditionTruckVO!!.eta.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrEmpty()) {
|
buildString {
|
||||||
|
append(itemExpeditionTruckVO!!.eta)
|
||||||
|
append(" ")
|
||||||
|
append(
|
||||||
|
if (itemExpeditionTruckVO!!.Destino.isNullOrEmpty()) {
|
||||||
|
|
||||||
itemExpeditionTruckVO!!.description
|
itemExpeditionTruckVO!!.description
|
||||||
} else {
|
} else {
|
||||||
itemExpeditionTruckVO!!.Destino
|
itemExpeditionTruckVO!!.Destino
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
setToolBar()
|
setToolBar()
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.view.inputmethod.EditorInfo
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentParkingBinding
|
import es.verdnatura.databinding.FragmentParkingBinding
|
||||||
|
import es.verdnatura.domain.isParking
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
|
@ -103,7 +104,6 @@ class ParkingFragment(var menuOrigin: String) :
|
||||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||||
try {
|
try {
|
||||||
val position = scanerList.indexOf(item)
|
val position = scanerList.indexOf(item)
|
||||||
println("parking $position")
|
|
||||||
if (position != -1) {
|
if (position != -1) {
|
||||||
scanerList.removeAt(position)
|
scanerList.removeAt(position)
|
||||||
adapter!!.notifyItemRangeChanged(position,scanerList.size-position+1)
|
adapter!!.notifyItemRangeChanged(position,scanerList.size-position+1)
|
||||||
|
@ -121,11 +121,8 @@ class ParkingFragment(var menuOrigin: String) :
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkScan(txtScan: String) {
|
private fun checkScan(txtScan: String) {
|
||||||
println("txtScan $txtScan")
|
|
||||||
var isParking = false
|
var isParking = false
|
||||||
if (txtScan.trim().length == 4 && isLetter(txtScan.substring(txtScan.length - 1)) || txtScan.contains(
|
if (txtScan.isParking()
|
||||||
"-"
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
isParking = true
|
isParking = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue