Version 9.2 Error encajado y en ver Ticket aparece ver la colección

This commit is contained in:
Sergio De la torre 2022-10-20 16:43:13 +02:00
parent 16def8477c
commit d371048d3b
25 changed files with 450 additions and 178 deletions

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\sergiodt\.android\avd\Pixel_3a_API_30_x86.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-10-18T14:11:38.332474100Z" />
</component>
</project>

View File

@ -13,8 +13,12 @@ android {
applicationId "es.verdnatura" applicationId "es.verdnatura"
minSdkVersion 21 //21 minSdkVersion 21 //21
targetSdkVersion 30 targetSdkVersion 30
versionCode 136 versionCode 138
versionName = "9.1" versionName = 9.2
//versionName = "9.3.1Beta" versioncode 138
//versionName = "9.3Beta" versionCode 137
//versionName = "9.2.2Beta" versioncode 136
// versionName = "9.1" versionCode 136
//versionName = "9.2.1Beta" versioncode 135 //versionName = "9.2.1Beta" versioncode 135
//versionName = "9.2Beta" versionCode 133 //versionName = "9.2Beta" versionCode 133
//versionName = "9" versionCode 133 //versionName = "9" versionCode 133

View File

@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 135, "versionCode": 138,
"versionName": "9.2.1Beta", "versionName": "9.2",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
], ],

View File

@ -79,7 +79,7 @@ class GetLoginUserCase(context: Context) : RestClient(context)
fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{ fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
var working_in_test=false // Enviar a grupo test Android o a los usuarios var working_in_test=true // Enviar a grupo test Android o a los usuarios
if (!working_in_test) { if (!working_in_test) {
return salixClient!!.sendChekingPresence( return salixClient!!.sendChekingPresence(

View File

@ -41,7 +41,7 @@ class GetWokerMistakeUSerCase(context: Context) : RestClient(context) {
params params
) )
} }
fun expeditionMistake_Add( fun expeditionMistake_add(
usuario: String, usuario: String,
password: String, password: String,
vExpeditionFk: String, vExpeditionFk: String,
@ -50,7 +50,7 @@ class GetWokerMistakeUSerCase(context: Context) : RestClient(context) {
val params: ArrayList<String> = ArrayList() val params: ArrayList<String> = ArrayList()
params.add(vExpeditionFk) params.add(vExpeditionFk)
params.add(vTypeFk) params.add(vTypeFk)
return restClient!!.expeditionMistake_Add( return restClient!!.expeditionMistake_add(
"json", "json",
"1", "1",
usuario, usuario,

View File

@ -710,8 +710,8 @@ interface VerdnaturaService {
): ):
Call<Unit> Call<Unit>
@POST("almacennew/expeditionMistake_Add")//REVISADA @POST("almacennew/expeditionMistake_add")//REVISADA
fun expeditionMistake_Add( fun expeditionMistake_add(
@Header("aplicacion") aplicacion: String, @Header("aplicacion") aplicacion: String,
@Header("version") version: String, @Header("version") version: String,
@Header("user") user: String, @Header("user") user: String,

View File

@ -655,7 +655,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
urlSalix = "https://test-salix.verdnatura.es/api/" urlSalix = "https://test-salix.verdnatura.es/api/"
) )
) )
/* saveWorkForm( saveWorkForm(
WorkForms( WorkForms(
"TestLocalhost", "TestLocalhost",
"http://10.1.4.42:9000", "http://10.1.4.42:9000",
@ -668,7 +668,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
"http://192.168.1.132:9000", "http://192.168.1.132:9000",
urlSalix = "https://test-salix.verdnatura.es/api/" urlSalix = "https://test-salix.verdnatura.es/api/"
) )
)*/ )
saveWorkForm( saveWorkForm(
WorkForms( WorkForms(

View File

@ -5,6 +5,5 @@ import org.json.JSONObject
data class itemScanned(var scanned: JSONObject) { data class itemScanned(var scanned: JSONObject) {
// var schema: String = scanned!!.get("schema").toString() // var schema: String = scanned!!.get("schema").toString()
var table: String = scanned!!.get("table").toString() var table: String = scanned!!.get("table").toString()
var field: String = scanned!!.get("field").toString() var id: String = scanned!!.get("id").toString()
var value: String = scanned!!.get("value").toString()
} }

View File

@ -109,11 +109,11 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
} }
fun setInputText() { fun setInputText() {
binding.customDialogValue.inputType = InputType.TYPE_CLASS_NUMBER // binding.customDialogValue.inputType = InputType.TYPE_CLASS_NUMBER
} }
fun setInputTextTwo() { fun setInputTextTwo() {
binding.customDialogValueTwo.inputType = InputType.TYPE_CLASS_NUMBER // binding.customDialogValueTwo.inputType = InputType.TYPE_CLASS_NUMBER
} }
fun setInfoTex(text:String){ fun setInfoTex(text:String){
binding.textinputlayoutUsername.hint = text binding.textinputlayoutUsername.hint = text

View File

@ -74,9 +74,7 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
binding.customDialogButtonOkTwo.text = text binding.customDialogButtonOkTwo.text = text
binding.customDialogButtonOkTwo.setOnClickListener { onButtonClicked() } binding.customDialogButtonOkTwo.setOnClickListener { onButtonClicked() }
/* custom_dialog_button_ok_two.visibility = View.VISIBLE
custom_dialog_button_ok_two.text = text
custom_dialog_button_ok_two.setOnClickListener { onButtonClicked() }*/
return this return this
} }
@ -86,9 +84,7 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
binding.customDialogButtonOkThree.text = text binding.customDialogButtonOkThree.text = text
binding.customDialogButtonOkThree.setOnClickListener { onButtonClicked() } binding.customDialogButtonOkThree.setOnClickListener { onButtonClicked() }
/* custom_dialog_button_ok_three.visibility = View.VISIBLE
custom_dialog_button_ok_three.text = text
custom_dialog_button_ok_three.setOnClickListener { onButtonClicked() }*/
return this return this
} }
@ -97,9 +93,7 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
binding.customDialogButtonOkFour.text = text binding.customDialogButtonOkFour.text = text
binding.customDialogButtonOkFour.setOnClickListener { onButtonClicked() } binding.customDialogButtonOkFour.setOnClickListener { onButtonClicked() }
/* custom_dialog_button_ok_four.visibility = View.VISIBLE
custom_dialog_button_ok_four.text = text
custom_dialog_button_ok_four.setOnClickListener { onButtonClicked() }*/
return this return this
} }
@ -109,9 +103,7 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
binding.customDialogButtonAdd.text = text binding.customDialogButtonAdd.text = text
binding.customDialogButtonAdd.setOnClickListener { onButtonClicked() } binding.customDialogButtonAdd.setOnClickListener { onButtonClicked() }
/* custom_dialog_button_add.visibility = View.VISIBLE
custom_dialog_button_add.text = text
custom_dialog_button_add.setOnClickListener { onButtonClicked() }*/
return this return this
} }
@ -121,9 +113,7 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
binding.customDialogButtonKo.text = text binding.customDialogButtonKo.text = text
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() } binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
/* custom_dialog_button_ko.visibility = View.VISIBLE
custom_dialog_button_ko.text = text
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
return this return this
} }

View File

@ -35,6 +35,7 @@ class AjustesFragment :
private var ajustesAdapter: AjustesAdapter? = null private var ajustesAdapter: AjustesAdapter? = null
private var isWorkerAllowed: Boolean = false private var isWorkerAllowed: Boolean = false
private var itemPackingList: List<ItemPackingType> = listOf() private var itemPackingList: List<ItemPackingType> = listOf()
private var messagePrinter:String? = null
//añadido //añadido
private var wagonList: List<String> = listOf() private var wagonList: List<String> = listOf()
@ -125,8 +126,10 @@ class AjustesFragment :
showDialogCarros(array = listCarros.toArray(array))*/ showDialogCarros(array = listCarros.toArray(array))*/
} else if (item.id == 2) { } else if (item.id == 2) {
messagePrinter=getString(R.string.Selecccionaimpresoara)
viewModel.printer_get(getData(USER), getData(PASSWORD)) viewModel.printer_get(getData(USER), getData(PASSWORD))
} else if (item.id == 3) { } else if (item.id == 3) {
val listTagsType: ArrayList<String> = ArrayList() val listTagsType: ArrayList<String> = ArrayList()
listTagsType.add(getString(R.string.stickers)) listTagsType.add(getString(R.string.stickers))
@ -216,6 +219,7 @@ class AjustesFragment :
) )
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
messagePrinter=getString(R.string.Selecccionaimpresoara)+"\n"+getString(R.string.printerRemoved)
viewModel.printer_get(getData(USER), getData(PASSWORD)) viewModel.printer_get(getData(USER), getData(PASSWORD))
// viewModel.worker_isF11Allowed(getData(USER), getData(PASSWORD)) // viewModel.worker_isF11Allowed(getData(USER), getData(PASSWORD))
@ -385,7 +389,9 @@ class AjustesFragment :
private fun showDialogPrinters(array: Array<String>) { private fun showDialogPrinters(array: Array<String>) {
val builder = AlertDialog.Builder(this.context) val builder = AlertDialog.Builder(this.context)
builder.setTitle(getString(R.string.Selecccionaimpresoara)) builder.setTitle(messagePrinter)
// builder.setMessage("La impresora que tenía se ha eliminado ")
builder.setItems(array) { _, which -> builder.setItems(array) { _, which ->
val selected = array[which] val selected = array[which]
printersList.forEach { printersList.forEach {

View File

@ -8,7 +8,7 @@ import android.media.MediaPlayer
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.speech.SpeechRecognizer import android.util.Log.d
import android.view.View import android.view.View
import android.view.View.GONE import android.view.View.GONE
import android.view.View.VISIBLE import android.view.View.VISIBLE
@ -16,7 +16,6 @@ import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.ImageView import android.widget.ImageView
import android.widget.Toast import android.widget.Toast
import androidx.core.net.toUri
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
@ -122,9 +121,7 @@ class CollectionFragment(
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)
if (type.equals(CONTROLADOR)) { if (type.equals(CONTROLADOR)) {
//sergio: comprueba si viene de la pantalla de controlador //sergio: comprueba si viene de la pantalla de controlador
viewModel.ticket_checkFullyControlled( viewModel.ticket_checkFullyControlled(
getData(USER), getData(USER),
@ -132,11 +129,20 @@ class CollectionFragment(
collection.collectionFk collection.collectionFk
) )
//Tarea 4280
/* var customDialogWarning = CustomDialog(requireContext())
customDialogWarning.setTitle("Aviso urgente")
customDialogWarning.setDescription("Urge el ticket que está revisando, la hora de la zona web del ticket ya se ha cerrado")
.setOkButton("ENTERADO") {
customDialogWarning.dismiss()
requireActivity().onBackPressed()
}.show()*/
workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk
} }
if (collection.tickets.isEmpty()) { if (collection.tickets.isEmpty()) {
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
getData(USER), getData(USER),
getData(PASSWORD), getData(PASSWORD),
@ -146,7 +152,6 @@ class CollectionFragment(
) )
} }
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
} }
@ -197,6 +202,9 @@ class CollectionFragment(
val listIcons: ArrayList<ImageView> = ArrayList() val listIcons: ArrayList<ImageView> = ArrayList()
/* val iconPrevia = ImageView(context)
iconPrevia.setImageResource(R.drawable.ic_local_parking_orange_24dp)*/
val iconPrint = ImageView(context) val iconPrint = ImageView(context)
iconPrint.setImageResource(R.drawable.ic_print_black_24dp) iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
@ -206,7 +214,6 @@ class CollectionFragment(
val iconViewCollection = ImageView(context) val iconViewCollection = ImageView(context)
iconViewCollection.setImageResource(R.drawable.ic_collection) iconViewCollection.setImageResource(R.drawable.ic_collection)
val iconWorker = ImageView(context) val iconWorker = ImageView(context)
iconWorker.setImageResource(R.drawable.ic_worker) iconWorker.setImageResource(R.drawable.ic_worker)
@ -216,6 +223,7 @@ class CollectionFragment(
val iconParking = ImageView(context) val iconParking = ImageView(context)
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp) iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp) iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
@ -223,23 +231,21 @@ class CollectionFragment(
iconViewCollection.tooltipText = getTooltip(R.drawable.ic_collection) iconViewCollection.tooltipText = getTooltip(R.drawable.ic_collection)
iconPhone.tooltipText = getTooltip(R.drawable.phone_call) iconPhone.tooltipText = getTooltip(R.drawable.phone_call)
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp) iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
} }
if (type.equals("CHECKER")) {
// listIcons.add(iconPhone)
}
listIcons.add(iconPrint) listIcons.add(iconPrint)
if (type == CONTROLADOR) { if (type == CONTROLADOR) {
listIcons.add(iconViewCollection) listIcons.add(iconViewCollection)
binding.previaButton.visibility = VISIBLE
binding.previaButton.setOnClickListener {
showPrevia()
}
} }
listIcons.add(iconAdd) listIcons.add(iconAdd)
listIcons.add(iconWorker) listIcons.add(iconWorker)
if (type.equals(PRECHECKER)) { if (type.equals(PRECHECKER)) {
listIcons.add(iconParking) listIcons.add(iconParking)
listIcons.remove(iconPrint) listIcons.remove(iconPrint)
@ -270,6 +276,48 @@ class CollectionFragment(
} }
private fun showPrevia() {
customDialogList.setTitle("Escanea ticket de previa")
.setOkButton(getString(R.string.end)) {
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.dismiss()
requireActivity().onBackPressed()
}.setValue("").show()
customDialogList.getEditText().requestFocus()
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
if (!customDialogList.getValue().isEmpty()) {
ma.hideKeyboard(customDialogList.getEditText())
var saleGroupScanned = customDialogList.getValue()
sales.forEachIndexed { pos, s ->
if (!s.saleGroupFk.isNullOrEmpty() && s.saleGroupFk == saleGroupScanned) {
markLine(pos, type)
}
}
customDialogList.dismiss()
}
customDialogList.setValue("")
ma.hideKeyboard(customDialogList.getEditText())
return@setOnEditorActionListener true
}
false
}
hideKeyboard()
}
private fun getCollection() { private fun getCollection() {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
@ -985,12 +1033,6 @@ class CollectionFragment(
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
/* d("VERDNATURA:","el comercial es " + salePerson)
d("VERDNATURA:","el item es " + item)
d("VERDNATURA:","el ticket es es " + ticketFk)
d("VERDNATURA:","la cantidad es " + quantity)*/
viewModel.sendChekingPresence( viewModel.sendChekingPresence(
token = getData(TOKEN), token = getData(TOKEN),
workerId = salePerson, workerId = salePerson,
@ -1032,6 +1074,9 @@ class CollectionFragment(
sales = salesList.sortedWith(compareBy({ it.saleOrder })) sales = salesList.sortedWith(compareBy({ it.saleOrder }))
for (s in sales) {
d("VERDNATURA::", "El id es " + s.saleFk + " tiene saleOrder" + s.saleOrder)
}
if (type == CONTROLADOR) { if (type == CONTROLADOR) {
@ -2248,9 +2293,14 @@ class CollectionFragment(
} }
//FALTAS / BASURA / SPLIT //FALTAS / BASURA / SPLIT
private fun showQuantityDialog(position: Int) { private fun showQuantityDialog(position: Int) {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("") customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("")
.setOkButton(getString(R.string.titleFaults)) {
//Tarea4495
// if (type != SACADOR) {
customDialogThreeButtons.setOkButton(getString(R.string.titleFaults)) {
checkAndCall( checkAndCall(
position, position,
customDialogThreeButtons.getValue(), customDialogThreeButtons.getValue(),
@ -2264,8 +2314,10 @@ class CollectionFragment(
customDialogThreeButtons.getValue(), customDialogThreeButtons.getValue(),
getString(R.string.BasuraRechazar) getString(R.string.BasuraRechazar)
) )
}
// }
}.setOkButtonThree(getString(R.string.Reject)) { customDialogThreeButtons.setOkButtonThree(getString(R.string.Reject)) {
checkAndCall( checkAndCall(
position, position,
customDialogThreeButtons.getValue(), customDialogThreeButtons.getValue(),
@ -2291,6 +2343,8 @@ class CollectionFragment(
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
}.show() }.show()
} }
private fun checkAndCall(position: Int, value: String, action: String) { private fun checkAndCall(position: Int, value: String, action: String) {
@ -2300,8 +2354,16 @@ class CollectionFragment(
when (action) { when (action) {
getString(R.string.Agregar) -> increaseQuantity(position, value.toInt()) getString(R.string.Agregar) -> increaseQuantity(position, value.toInt())
getString(R.string.BasuraRechazar) -> TrashMissingReject(position, value.toInt(), "TRUE") getString(R.string.BasuraRechazar) -> TrashMissingReject(
getString(R.string.titleFaults) -> TrashMissingReject(position, value.toInt(), "FALSE") position,
value.toInt(),
"TRUE"
)
getString(R.string.titleFaults) -> TrashMissingReject(
position,
value.toInt(),
"FALSE"
)
getString(R.string.Reject) -> TrashMissingReject(position, value.toInt(), "reject") getString(R.string.Reject) -> TrashMissingReject(position, value.toInt(), "reject")
getString(R.string.Split) -> split(position, value.toInt()) getString(R.string.Split) -> split(position, value.toInt())

View File

@ -37,6 +37,8 @@ class CollectionShowTicketFragment(
private lateinit var customDialog: CustomDialog private lateinit var customDialog: CustomDialog
private var tickets: ArrayList<String> = ArrayList() private var tickets: ArrayList<String> = ArrayList()
private var lastScanned: String = ""
private var buttonPushedGetCollection = false
companion object { companion object {
fun newInstance(collection: CollectionVO, type: String) = fun newInstance(collection: CollectionVO, type: String) =
@ -84,6 +86,9 @@ class CollectionShowTicketFragment(
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
val listIcons: ArrayList<ImageView> = ArrayList() val listIcons: ArrayList<ImageView> = ArrayList()
val iconPrint = ImageView(context) val iconPrint = ImageView(context)
val iconViewCollection = ImageView(context)
iconViewCollection.setImageResource(R.drawable.ic_collection)
iconPrint.setImageResource(R.drawable.ic_print_black_24dp) iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@ -91,18 +96,47 @@ class CollectionShowTicketFragment(
} }
listIcons.add(iconPrint) listIcons.add(iconPrint)
listIcons.add(iconViewCollection)
binding.mainToolbar.toolbarIcons.adapter = binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
when (item){ when (item){
iconPrint.drawable->print()} iconPrint.drawable->print()
iconViewCollection.drawable->getCollection()
}
} }
}) })
binding.mainToolbar.toolbarIcons.layoutManager = binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun getCollection() {
binding.splashProgress.visibility = VISIBLE
if (!buttonPushedGetCollection) {
viewModel.collection_get(
getData(USER),
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type
)
buttonPushedGetCollection = true
} else {
viewModel.collectionTicketGet(
getData(USER),
getData(PASSWORD),
lastScanned,
getData(SECTORFK),
type
)
buttonPushedGetCollection = false
}
lastScanned = collection.collectionFk
}
private fun print() { private fun print() {

View File

@ -419,13 +419,13 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
} }
}) })
} }
fun expeditionMistake_Add( fun expeditionMistake_add(
usuario: String, usuario: String,
password: String, password: String,
vExpeditionFk: String, vExpeditionFk: String,
vTypeFk: String vTypeFk: String
) { ) {
getWorkerMistakeUserCase.expeditionMistake_Add(usuario, password, vExpeditionFk, vTypeFk) getWorkerMistakeUserCase.expeditionMistake_add(usuario, password, vExpeditionFk, vTypeFk)
.enqueue(object : .enqueue(object :
Callback<Unit> { Callback<Unit> {
override fun onFailure(call: Call<Unit>, t: Throwable) { override fun onFailure(call: Call<Unit>, t: Throwable) {

View File

@ -367,10 +367,10 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
saveRemember(false) saveRemember(false)
} }
saveUserAccesPref( /*saveUserAccesPref(
binding.edittextUsername.text.toString(), binding.edittextUsername.text.toString(),
binding.edittextPassword.text.toString() binding.edittextPassword.text.toString()
) )*/
if (it.vIsAuthorized == "1" && it.vMessage.isNullOrEmpty()) { if (it.vIsAuthorized == "1" && it.vMessage.isNullOrEmpty()) {
@ -518,6 +518,10 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
}.show() }.show()
} else { } else {
saveTokenPref(it.token) saveTokenPref(it.token)
saveUserAccesPref(
binding.edittextUsername.text.toString(),
binding.edittextPassword.text.toString()
)
//Tarea 4351 quitar el if y poner e device_checkLogin a continuación del response de operator_add //Tarea 4351 quitar el if y poner e device_checkLogin a continuación del response de operator_add
viewModel.operator_add(getData(USER), getData(PASSWORD)) viewModel.operator_add(getData(USER), getData(PASSWORD))

View File

@ -1,6 +1,6 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.util.Log import android.util.Log.d
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import es.verdnatura.R import es.verdnatura.R
@ -20,6 +20,7 @@ class CmrExpeditionPalletFragment(
private lateinit var customDialogList: CustomDialogInputTwoValues private lateinit var customDialogList: CustomDialogInputTwoValues
private var itemScaned: String = "" private var itemScaned: String = ""
private lateinit var dataScanned: itemScanned private lateinit var dataScanned: itemScanned
private lateinit var dataScannedTwo: itemScanned
companion object { companion object {
fun newInstance(title: String) = CmrExpeditionPalletFragment(title) fun newInstance(title: String) = CmrExpeditionPalletFragment(title)
@ -91,14 +92,13 @@ class CmrExpeditionPalletFragment(
} }
private fun showExpeditionPalletScan() { private fun showExpeditionPalletScan() {
customDialogList.setValue("")
customDialogList.setInfoTex(getString(R.string.pallet)) customDialogList.setValueTwo("")
customDialogList.setInfoTextTwo(getString(R.string.cmr)) customDialogList.setInfoTex("")
customDialogList.setInputTextVisibility(View.GONE) customDialogList.setInfoTextTwo("")
customDialogList.setInfoTex(getString(R.string.expeditionPalletOrCMR))
customDialogList.setTitle(getString(R.string.expeditionPalletScan)) customDialogList.setTitle(getString(R.string.expeditionPalletCMR))
.setOkButton(getString(R.string.end)) { .setOkButton(getString(R.string.end)) {
ma.hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
customDialogList.dismiss() customDialogList.dismiss()
binding.mainToolbar.backButton.performClick() binding.mainToolbar.backButton.performClick()
@ -115,8 +115,25 @@ class CmrExpeditionPalletFragment(
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().isNotEmpty()) { if (customDialogList.getValue().isNotEmpty()) {
customDialogList.setInputTextVisibility(View.VISIBLE) dataScanned = itemScan(customDialogList.getValue())
customDialogList.setTitle(getString(R.string.cmrScan)) d("VERDNATURA::","tabla v1 es "+dataScanned.table)
when (itemScaned(customDialogList.getValue())) {
"cmr" -> {
customDialogList.setInfoTex(getString(R.string.cmr))
customDialogList.setInfoTextTwo(getString(R.string.pallet))
customDialogList.setValue(dataScanned.id)
}
"expeditionPallet" -> {
customDialogList.setInfoTex(getString(R.string.pallet))
customDialogList.setInfoTextTwo(getString(R.string.cmr))
//customDialogList.setInputTextVisibility(View.GONE)
customDialogList.setValue(dataScanned.id)
}
else ->
customDialogList.setValue("No ha escaneado ni pallet ni CMR")
}
customDialogList.setFocusTextTwo() customDialogList.setFocusTextTwo()
} }
@ -131,9 +148,97 @@ class CmrExpeditionPalletFragment(
if (customDialogList.getValue().isNotEmpty() && customDialogList.getValueTwo() if (customDialogList.getValue().isNotEmpty() && customDialogList.getValueTwo()
.isNotEmpty() .isNotEmpty()
) { ) {
ma.hideKeyboard(customDialogList.getEditText()) dataScannedTwo = itemScan(customDialogList.getValueTwo())
d("VERDNATURA::","tabla v1 es "+dataScanned.table)
d("VERDNATURA::","tabla v2 es "+itemScaned(customDialogList.getValueTwo()))
if (itemScanedIsCMR(customDialogList.getValueTwo())) { // customDialogList.setValueTwo(itemScanedValue(customDialogList.getValueTwo()))
when (itemScaned(customDialogList.getValueTwo())){
"cmr" -> {
if (dataScanned.table == "cmr"){
ma.messageWithSound(
"Escanea pallet",
true,
true,
isToasted = true
)
customDialogList.setValueTwo("")
}
if (dataScanned.table == "expeditionPallet"){
cmrExpeditionPallet_add(
dataScanned.id,
dataScannedTwo.id)
}
customDialogList.setValueTwo(dataScannedTwo.id)
}
"expeditionPallet"->{
/* d("VERDNATURA::","tabla v1 es "+dataScanned.table)
d("VERDNATURA::","tabla v2 es "+itemScaned(customDialogList.getValueTwo()))*/
if (dataScanned.table == "cmr"){
cmrExpeditionPallet_add(
dataScannedTwo.id,
dataScanned.id)
customDialogList.setValueTwo(dataScannedTwo.id)
}
if (dataScanned.table == "expeditionPallet"){
ma.messageWithSound(
"Escanea CMR",
true,
true,
isToasted = true
)
customDialogList.setValueTwo("")
}
}
}
// ma.hideKeyboard(customDialogList.getEditText())
/* dataScannedTwo = itemScan(customDialogList.getValueTwo())
d("VERDNATURA::","el valor es " + dataScannedTwo.id + "y tabla " + dataScannedTwo.table)
*/
/* when (itemScaned(customDialogList.getValueTwo())) {
"cmr" -> {
customDialogList.setValueTwo(dataScanned.id)
*//* if (dataScanned.table == "cmr") {
ma.messageWithSound(
getString(R.string.palletScanError),
true,
true,
isToasted = true
)
}*//*
}
*//* "expeditionPallet" -> {
if (dataScanned.table == "expeditionPallet") {
ma.messageWithSound(
getString(R.string.errorCmrNotScanned),
true,
true,
isToasted = true
)
}
if (dataScanned.table == "cmr") {
cmrExpeditionPallet_add(
itemScanedValue(customDialogList.getValueTwo()),
itemScanedValue(customDialogList.getValue()),
)
}
}*//*
else ->
customDialogList.setValueTwo("No ha escanado ni pallet ni CMR")
}*/
// customDialogList.setFocusTextTwo()
/* if (itemScaned(customDialogList.getValueTwo())) {
itemScaned = dataScanned.value itemScaned = dataScanned.value
customDialogList.setValueTwo("") customDialogList.setValueTwo("")
cmrExpeditionPallet_add( cmrExpeditionPallet_add(
@ -142,10 +247,15 @@ class CmrExpeditionPalletFragment(
) )
} else { } else {
customDialogList.setValueTwo("") customDialogList.setValueTwo("")
ma.messageWithSound(getString(R.string.errorCmrNotScanned), true, true, isToasted = true) ma.messageWithSound(
getString(R.string.errorCmrNotScanned),
true,
true,
isToasted = true
)
} }
*/
} }
return@setOnEditorActionListener true return@setOnEditorActionListener true
@ -154,18 +264,43 @@ class CmrExpeditionPalletFragment(
} }
} }
private fun itemScanedIsCMR(valueTwo: String): Boolean { private fun itemScanedValue(valueTwo: String): String {
return try { return try {
dataScanned = itemScanned(JSONObject(valueTwo)) return itemScanned(JSONObject(valueTwo)).id
dataScanned.table == "cmr"
} catch (Ex: Exception) { } catch (Ex: Exception) {
false return valueTwo
}
}
private fun itemScan(value: String): itemScanned {
return try {
itemScanned(JSONObject(value))
} catch (Ex: Exception) {
return itemScan("")
}
}
private fun itemScaned(valueTwo: String): String {
try {
return itemScanned(JSONObject(valueTwo)).table
} catch (Ex: Exception) {
d("VERDNATURA::", "EL VALUE ES " + Ex.message.toString())
return ""
} }
} }
} }

View File

@ -155,8 +155,8 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
) )
) )
) )
//Tarea 4585 //tarea 4585
/* _pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7, 7,
R.drawable.ic_packing_mistake, R.drawable.ic_packing_mistake,
@ -166,7 +166,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
R.string.titlePackingMistakeDescrip R.string.titlePackingMistakeDescrip
) )
) )
)*/ )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
@ -312,8 +312,8 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
) )
) )
//Tarea #3986 /* //Tarea #3986
/* _pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
31, 31,
R.drawable.ic_cmr, R.drawable.ic_cmr,

View File

@ -149,7 +149,7 @@ class PackingMistakeFragment(var menuOrigin: String) :
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
d("VERDNATURA::", "el code es " + item.code + it.description) d("VERDNATURA::", "el code es " + item.code + it.description)
viewModel.expeditionMistake_Add( viewModel.expeditionMistake_add(
usuario = getData(USER), usuario = getData(USER),
password = getData(PASSWORD), password = getData(PASSWORD),
vExpeditionFk = expeditionScan, vExpeditionFk = expeditionScan,

View File

@ -55,7 +55,7 @@
android:background="@drawable/background_round" android:background="@drawable/background_round"
android:enabled="true" android:enabled="true"
android:hint="@string/quantity" android:hint="@string/quantity"
android:inputType="number" android:inputType="text"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"

View File

@ -28,7 +28,16 @@
app:layout_constraintTop_toTopOf="@+id/main_toolbar" app:layout_constraintTop_toTopOf="@+id/main_toolbar"
android:paddingLeft="@dimen/default_layout_margin"/> android:paddingLeft="@dimen/default_layout_margin"/>
<ImageView
android:id="@+id/previaButton"
android:layout_width="32dp"
android:layout_height="32dp"
android:visibility="invisible"
android:tooltipText="Permite marcar las líneas de previa escaneando ticket"
app:srcCompat="@drawable/ic_streetview_black_24dp"
app:layout_constraintStart_toEndOf="@+id/scan_input"
app:layout_constraintTop_toTopOf="@+id/scan_input"
/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/collection_swipe" android:id="@+id/collection_swipe"
@ -47,6 +56,8 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
tools:listitem="@layout/item_article_row_fragment" /> tools:listitem="@layout/item_article_row_fragment" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout <LinearLayout
android:id="@+id/splash_progress" android:id="@+id/splash_progress"
@ -64,6 +75,7 @@
app:lottie_loop="true" app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading" app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" /> app:lottie_speed="2" />
</LinearLayout> </LinearLayout>
<include <include

View File

@ -363,20 +363,22 @@
app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2" app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2"
tool:text="cel2" /> tool:text="cel2" />
<TextView <TextView
android:id="@+id/item_article_quantity" android:id="@+id/item_article_quantity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingTop="@dimen/layout_margin_minest"
android:paddingBottom="@dimen/layout_margin_minest"
android:paddingLeft="@dimen/layout_margin_1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="@dimen/layout_margin_minest"
android:paddingBottom="@dimen/default_layout_margin"
android:paddingLeft="@dimen/layout_collection_quantity"
android:text="@{Integer.toString(sale.quantity)}" android:text="@{Integer.toString(sale.quantity)}"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body3" android:textSize="@dimen/body3"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@+id/item_article_quantity_line2" app:layout_constraintEnd_toEndOf="@+id/item_article_quantity_line2"
app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2" app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2"
tool:text="100" /> tool:text="100"
/>
<TextView <TextView
android:id="@+id/item_article_quantity_line3" android:id="@+id/item_article_quantity_line3"

View File

@ -491,5 +491,8 @@
<string name="noAssigned">No asignado</string> <string name="noAssigned">No asignado</string>
<string name="titlePackingMistake">Fallo encajado</string> <string name="titlePackingMistake">Fallo encajado</string>
<string name="titlePackingMistakeDescrip">Permite añadir error al encajado de una expedición</string> <string name="titlePackingMistakeDescrip">Permite añadir error al encajado de una expedición</string>
<string name="printerRemoved">(Su impresora ha sido borrada)</string>
<string name="expeditionPalletCMR">Escanea Pallet y CMR</string>
<string name="expeditionPalletOrCMR">Escanea pallet o cmr</string>
</resources> </resources>

View File

@ -7,6 +7,7 @@
<dimen name="layout_margin_minest">1dp</dimen> <dimen name="layout_margin_minest">1dp</dimen>
<dimen name="layout_margin_min">4dp</dimen> <dimen name="layout_margin_min">4dp</dimen>
<dimen name="layout_margin_1">8dp</dimen> <dimen name="layout_margin_1">8dp</dimen>
<dimen name="layout_collection_quantity">10dp</dimen>
<dimen name="default_layout_margin">16dp</dimen> <dimen name="default_layout_margin">16dp</dimen>
<dimen name="layout_end_ticket_color">20dp</dimen> <dimen name="layout_end_ticket_color">20dp</dimen>
<dimen name="layout_margin_3">32dp</dimen> <dimen name="layout_margin_3">32dp</dimen>

View File

@ -50,6 +50,7 @@
<string name="Noprinters">There are no printers.</string> <string name="Noprinters">There are no printers.</string>
<string name="Seleccionaunsector">Select a sector</string> <string name="Seleccionaunsector">Select a sector</string>
<string name="Selecccionaimpresoara">Select a printer</string> <string name="Selecccionaimpresoara">Select a printer</string>
<string name="printerRemoved">Printer that you had selected has been removed</string>
<string name="titleCorridors">Corridors</string> <string name="titleCorridors">Corridors</string>
<string name="titleControllers">Controllers</string> <string name="titleControllers">Controllers</string>
<string name="titlePalletizers">Palletizers</string> <string name="titlePalletizers">Palletizers</string>
@ -340,6 +341,8 @@
<string name="expeditionsError">You have not scanned expeditions</string> <string name="expeditionsError">You have not scanned expeditions</string>
<string name="expeditionNoSorter">Scan expeditions that have not passed through the Sorter</string> <string name="expeditionNoSorter">Scan expeditions that have not passed through the Sorter</string>
<string name="expeditionPalletScan">Scan pallet expedition </string> <string name="expeditionPalletScan">Scan pallet expedition </string>
<string name="expeditionPalletCMR">Scan pallet and CMR </string>
<string name="expeditionPalletOrCMR">Scan pallet or CMR </string>
<string name="palletScan">Scan pallet to receive it</string> <string name="palletScan">Scan pallet to receive it</string>
<string name="palletScanAdd">Scan pallet to add expeditions</string> <string name="palletScanAdd">Scan pallet to add expeditions</string>
<string name="cmrScan">Scan CMR</string> <string name="cmrScan">Scan CMR</string>