Merge branch 'testBeta_embalajes_pantallas' into 4021_embalajes

# Conflicts:
#	.idea/workspace.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values/strings.xml
This commit is contained in:
Sergio De la torre 2023-03-23 11:44:38 +01:00
commit db8ce4725f
14 changed files with 212 additions and 49 deletions

View File

@ -535,7 +535,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
ITEMPACKINGFK -> prefs.getString(name, "").toString()
WORKFORMSELECTED -> prefs.getString(name, "Producción").toString()
"SUPPLIERNAME" -> prefs.getString(name, "").toString()
"SUPPLIERID" -> prefs.getInt(name, 0).toString()
"SUPPLIERID" -> prefs.getString(name, "").toString()
"ENTRYTYPE" -> prefs.getString(name, "").toString()
"ENTRYNUMBERIMAGES" -> prefs.getString(name, "0").toString()
"ENTRYOBSERVATIONS" -> prefs.getString(name, "").toString()

View File

@ -42,11 +42,11 @@ class ItemSupplierAdapter(
binding.apply {
this.item = item
itemImageUpdate.setOnClickListener {
itemAdd.setOnClickListener {
onImageUpdateClickListener.OnImageUpdateClickListener(
item
)
itemImageTrash.setOnClickListener {
itemRemove.setOnClickListener {
onImageTrashClickListener.OnImageUpdateClickListener(item)
}
}

View File

@ -79,7 +79,7 @@ class ObservFragment(
listImages!!.size.toString()
}
)
saveData("ENTRYOBSERVATIONS",binding.observations.text.toString())
saveData("ENTRYOBSERVATIONS", binding.observations.text.toString())
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingSummary)),
getString(R.string.titlePackagingSummary)
@ -105,6 +105,7 @@ class ObservFragment(
d("VERDNATURA::", "el nombre es " + image.uri)
//binding.imageView30.setImageURI(image.uri)
}
if (listImages != null)
listImages = it as MutableList<Image>
setAdapter(listImages!!)
}

View File

@ -41,10 +41,12 @@ class PackagingCountFragment(
override fun onCreate(savedInstanceState: Bundle?) {
viewModel.supplier_getItems(
getData("SUPPLIERID") as Int
getData("SUPPLIERID")
)
super.onCreate(savedInstanceState)
}
@ -56,7 +58,7 @@ class PackagingCountFragment(
getString(R.string.titlePackagingObs)
)
}
binding.splashProgress.visibility = View.VISIBLE
// binding.splashProgress.visibility = View.VISIBLE
customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext())
@ -117,16 +119,37 @@ class PackagingCountFragment(
override fun OnImageUpdateClickListener(item: Any) {
d("VERDNATURA::", "Seleccionado update" + (item as ItemSupplier).name)
printCustomDialog("quantity")
customDialogInput.setTitle(getString(R.string.quantityReviewed))
.setDescription(getString(R.string.quantityToReview))
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
requireActivity().hideKeyboard()
}
customDialogInput.setValue("")
customDialogInput.dismiss()
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("").show()
}
}, object : OnImageTrashClickListener {
override fun OnImageUpdateClickListener(item: Any) {
d("VERDNATURA::", "Seleccionado trash" + (item as ItemSupplier).name)
printCustomDialog("delete")
}
}, object : OnEditSubQuantityListener {
override fun OnEditSubQuantityListener(item: Any, text: String) {
d("VERDNATURA::", "la subquantity es " + (item as ItemSupplier).name+"el valor es :"+text)
d(
"VERDNATURA::",
"la subquantity es " + (item as ItemSupplier).name + "el valor es :" + text
)
hideKeyboard()
}
})
@ -141,6 +164,54 @@ class PackagingCountFragment(
}
}
private fun printCustomDialog(action: String) {
when (action) {
"quantity" -> {
customDialogInput.setTitle(getString(R.string.quantityReviewed))
.setDescription(getString(R.string.Indicanuevacantidad))
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
requireActivity().hideKeyboard()
}
customDialogInput.setValue("")
customDialogInput.dismiss()
requireActivity().showKeyboard()
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
requireActivity().showKeyboard()
}.setValue("").show()
customDialogInput.setInputText()
customDialogInput.currentFocus
customDialogInput.setFocusText()
requireActivity().showKeyboard()
}
"delete" -> {
customDialog.setTitle(getString(R.string.deleteEntryReviewed))
.setDescription(getString(R.string.sure))
.setOkButton(
getString(
R.string.delete
)
) {
d("VERDNATURA::", "borrado")
}
.setKoButton(getString(R.string.cancel)) {
customDialog.cancel()
customDialog.dismiss()
}
}
}
customDialog.show()
}
}

View File

@ -72,7 +72,7 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun supplier_getItems(supplierFk: Int) {
fun supplier_getItems(supplierFk: Any) {
silex.supplier_getItems(supplierFk)
.enqueue(object : SilexCallback<List<ItemSupplier>>(context) {

View File

@ -1,13 +1,16 @@
package es.verdnatura.presentation.view.feature.packaging.fragment
import android.app.AlertDialog
import android.content.Context
import android.os.Bundle
import android.util.Log.d
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentPackagingBinding
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchSupplierModel
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
@ -28,6 +31,7 @@ class SupplierFragment(
private var layoutManager: LinearLayoutManager? = null
private var onBack = false
private val suppliers = ArrayList<SearchSupplierModel>()
private lateinit var customDialog: CustomDialog
companion object {
@ -79,7 +83,7 @@ class SupplierFragment(
setEvents()
val entry = EntrySalix(supplierFk = "591", travelFk = "186025", companyFk = "442")
viewModel.entry_addSalix(entry)
// viewModel.entry_addSalix(entry)
super.init()
}
@ -93,7 +97,46 @@ class SupplierFragment(
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
binding.filterEntry.setOnClickListener {
val builder = AlertDialog.Builder(context)
builder.setTitle(getString(R.string.selectEntryToFill))
val labelCount = arrayOf("Entrada 1", "Entrada 2", "Añadir Nueva")
builder.setItems(labelCount) { dialog, which ->
if (labelCount[which] == "Añadir Nueva") {
customDialog = CustomDialog(requireContext())
customDialog.setTitle(getString(R.string.newEntry))
.setDescription(getString(R.string.confirmEntry))
.setOkButton(
getString(
R.string.createEntry
)
) {
d("VERDNATURA::", "borrado")
}
.setKoButton(getString(R.string.cancel)) {
customDialog.cancel()
customDialog.dismiss()
}
customDialog.show()
}
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
getString(R.string.titlePackagingCount)
)
}
val dialog = builder.create()
dialog.show()
}
binding.radiobuttonTypePackaging.setOnCheckedChangeListener { buttonView, isChecked ->
when (isChecked) {
R.id.radioButtonRec -> {
@ -105,11 +148,12 @@ class SupplierFragment(
}
}
binding.filterEntry.visibility = View.VISIBLE
if (!onBack) {
ma.onPasillerosItemClickListener(
/* ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
getString(R.string.titlePackagingCount)
)
)*/
}
onBack = false

View File

@ -522,7 +522,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
)
//#tarea4021
/* _pasillerositem.add(
_pasillerositem.add(
PasillerosItemVO(
6,
R.drawable.ic_packaging,
@ -530,7 +530,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
R.string.titlePackaging,
contextApp.getString(R.string.titlePackagingDescrip)
)
)*/
)
val working_in_test=false
if (working_in_test){

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@ -12,11 +11,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/toolbar_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingTop="@dimen/toolbar_height">
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textinputlayout_username"
@ -40,10 +39,10 @@
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:visibility="gone"
android:textAlignment="center"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/darker_gray" />
android:textColorHint="@android:color/darker_gray"
android:visibility="gone" />
<TextView
android:id="@+id/filter_supplier"
@ -73,11 +72,12 @@
android:id="@+id/radiobuttonTypePackaging"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_marginTop="25dp"
android:gravity="center_horizontal"
android:visibility="invisible"
>
<RadioButton
android:id="@+id/radioButtonRec"
android:layout_width="wrap_content"
@ -99,10 +99,42 @@
</RadioGroup>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/filter_entry"
style="@style/InputLineTextSearch"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_marginTop="24dp"
android:backgroundTint="@android:color/white"
android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp"
android:focusable="false"
android:hint="@string/Entrada"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textAlignment="center"
android:textColor="@color/verdnatura_pumpkin_orange"
android:textColorHint="@android:color/darker_gray"
android:visibility="gone" />
<ImageView
android:id="@+id/addEntry"
style="@style/InputLineTextSearch"
android:layout_width="48dp"
android:layout_height="48dp"
android:focusable="false"
android:visibility="gone"
app:srcCompat="@drawable/ic_add_black_24dp" />
</LinearLayout>
</LinearLayout>
<include
android:id="@+id/main_toolbar"
@ -112,19 +144,18 @@
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
@ -138,7 +169,5 @@
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -90,6 +90,7 @@
android:layout_weight="1"
android:gravity="center"
android:text="@string/Cantidad"
android:visibility="gone"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
@ -103,6 +104,7 @@
android:paddingStart="@dimen/layout_margin_3"
android:textSize="@dimen/body2" />
</LinearLayout>
</com.google.android.material.textfield.TextInputLayout>

View File

@ -32,12 +32,13 @@
app:layout_constraintTop_toBottomOf="@+id/textObs" />
<TextView
android:id="@+id/textImage"
android:id="@+id/openPickerImages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Imágenes : "
android:textColor="#FFF"
android:textSize="18dp"
android:drawableEnd="@drawable/ic_add_black_24dp"
app:layout_constraintStart_toEndOf="@+id/observations"
app:layout_constraintTop_toBottomOf="@+id/observations" />
<LinearLayout
@ -49,16 +50,18 @@
android:layout_marginBottom="@dimen/layout_margin_1"
android:paddingLeft="@dimen/layout_margin_min"
android:paddingRight="@dimen/layout_margin_min"
app:layout_constraintStart_toEndOf="@+id/textImage"
app:layout_constraintTop_toBottomOf="@+id/textImage" >
app:layout_constraintTop_toBottomOf="@+id/openPickerImages" >
<TextView
android:id="@+id/openPickerImages"
android:id="@+id/openPickerImagesOld"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:gravity="center"
android:text="Añadir nueva..."
android:visibility="gone"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
</LinearLayout>

View File

@ -45,16 +45,16 @@
<ImageView
android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image_update"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/default_layout_margin"
android:layout_weight="1"
android:gravity="center_vertical"
android:scaleType="centerCrop"
android:layout_gravity="center"
android:visibility="visible"
android:src="@drawable/ic_history_black_24dp" />
android:src="@drawable/ic_history_black_24dp"
android:visibility="gone" />
<ImageView
android:layout_marginLeft="@dimen/default_layout_margin"

View File

@ -49,13 +49,14 @@
<EditText
android:id="@+id/item_subquantity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.25"
android:text="@{Integer.toString(item.subquantity)}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h8"
android:gravity="center_vertical"
android:visibility="visible"
android:visibility="gone"
android:imeOptions="actionDone"
android:singleLine="true"
android:layout_gravity="center"
@ -77,18 +78,18 @@
<ImageView
android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image_update"
android:id="@+id/item_add"
android:layout_width="24dp"
android:gravity="center_vertical"
android:layout_height="24dp"
android:scaleType="centerCrop"
android:layout_gravity="center"
android:visibility="visible"
android:src="@drawable/ic_history_black_24dp" />
android:src="@drawable/ic_add_black_24dp" />
<ImageView
android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image_trash"
android:id="@+id/item_remove"
android:layout_width="24dp"
android:gravity="center_vertical"
android:layout_height="24dp"

View File

@ -271,6 +271,7 @@
<string name="deleteStock">Indica la causa de eliminar stock:</string>
<string name="quantityToRegister">Indica la cantidad a dar de alta</string>
<string name="quantityToUnregister">"Indica la cantidad a dar de baja "</string>
<string name="quantityToReview">"Indica la cantidad a sumar a la cantidad total revisada"</string>
<string name="fault">Falta</string>
<string name="trash">Basura</string>
<string name="errorNotNumber">El elemento introducido no es un número</string>
@ -319,6 +320,7 @@
<string name="shlevesNumber">Número de baldas del ticket</string>
<string name="shlevesNumberTicket">Indica el número de baldas que ocupa el ticket</string>
<string name="packetNumberShelves">Número de paquetes en balda</string>
<string name="quantityReviewed">Cantidad revisada</string>
<string name="packetIndicate">Indica el número de paquetes que caben en una balda</string>
<string name="test">Comprobar</string>
<string name="expeditionsError">No ha escaneado expediciones</string>
@ -546,5 +548,9 @@
<string name="deleteQuantity">Va a eliminar para Autoconsumo la cantidad del artículo:</string>
<string name="tickets">" Tickets:"</string>
<string name="problemUpdate">No es posible actualizar. Problema con la descarga de la app</string>
<string name="selectEntryToFill">Selecciona la entrada</string>
<string name="deleteEntryReviewed">Va a borrar el ítem y cantidad revisada.</string>
<string name="newEntry">Va a crear una nueva entrada</string>
<string name="createEntry">Crear entrada</string>
</resources>

View File

@ -236,7 +236,8 @@
<string name="fillFields">Fill required fields</string>
<string name="mandatoryPacking">Packing required</string>
<string name="selectAction">Select an action</string>
<string name="delete">Delete</string>
<string name="deleteEntryReviewed">"You are going to delete quantity and item "</string>
<string name="newEntry">"You are going to create a new entry"</string>
<string name="lookWithpermission">You can only view when you have taken the vehicle yourself unless you have permission to do so.</string>
<string name="info">Information</string>
<string name="accept">Accept</string>
@ -258,6 +259,7 @@
<string name="unmarkLine">Unmark line</string>
<string name="goUnmark">You are going to unmark the line: </string>
<string name="sure">are you sure?</string>
<string name="createEntry">New entry</string>
<string name="unmark">Unmark</string>
<string name="sectorALGEMESI">ALGEMESI V</string>
<string name="sectorALGEMESINEW">SACADOR V</string>
@ -538,10 +540,14 @@
<string name="scanValues">Scan values : </string>
<string name="titleChecker">Check items</string>
<string name="selectLabeltoPrint">Select label to print</string>
<string name="selectEntryToFill">Select entry to fill</string>
<string name="formatError">Expedition format no valid</string>
<string name="errorQuantity">Insert the amount correctly</string>
<string name="operationSuccessful">Operación realizada correctamente</string>
<string name="selfConsumption">Self-consumption</string>
<string name="quantityReviewed">Quantity Reviewed</string>
<string name="quantityToReview">Put the reviewed quantity</string>
<string name="delete">Delete</string>
<string name="adress">Address</string>
<string name="modify">Modify</string>
<string name="problemUpdate">It\'s not possible to update. Problem with the download of app</string>