Merge branch '4021_embalajes' into 4021-gestion_embalajes
# Conflicts: # .idea/workspace.xml # app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt # app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingViewModel/SupplierViewModel.kt # app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt # app/src/main/java/es/verdnatura/presentation/view/feature/packaging/model/EntrySalix.kt # app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt # app/src/main/res/values-es/strings.xml # app/src/main/res/values/strings.xml
This commit is contained in:
commit
4c59d4cb10
|
@ -143,12 +143,35 @@ interface SalixService {
|
|||
"\"scope\":{" +
|
||||
"\"fields\":[\"email\"],\"order\":\"id DESC\",\"limit\":1," +
|
||||
"\"where\":{ \"email\":{\"neq\":null } }}}]})"*/
|
||||
//@Query("filter") filter:String? = """""\"order\":\"name DESC\""""
|
||||
|
||||
):
|
||||
Call<List<Supplier>>
|
||||
|
||||
/* fun getEntries(
|
||||
//@Body params:JSONObject=JSONObject("""filter"={"fields":{"id":true,"name":true},"include":[{"relation":"contacts","scope":{"fields":["email"],"order":"id DESC","limit":1,"where":{"email":{"neq":null}}}}]}""")
|
||||
*//* @Query("filter") filter:String="{\"fields\":{\"id\":true,\"name\":true},\"include\":[{\"relation\":\"contacts\"," +
|
||||
"\"scope\":{" +
|
||||
"\"fields\":[\"email\"],\"order\":\"id DESC\",\"limit\":1," +
|
||||
"\"where\":{ \"email\":{\"neq\":null } }}}]})"*//*
|
||||
|
||||
):
|
||||
Call<List<EntrySalix>>*/
|
||||
|
||||
@PUT("Entries")//REVISADA
|
||||
fun Entries(
|
||||
@Body supplier: Any
|
||||
):
|
||||
Call<List<EntrySalix>>
|
||||
|
||||
@GET("Entries")//REVISADA
|
||||
fun getEntries_fromSupplier(
|
||||
@Query("filter") filter:String
|
||||
):
|
||||
Call<List<EntrySalix>>
|
||||
|
||||
@GET("Entries")//REVISADA
|
||||
fun add_entry(
|
||||
@Body entry:EntrySalix
|
||||
):
|
||||
Call<EntrySalix>
|
||||
|
|
|
@ -548,12 +548,13 @@ 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()
|
||||
"SERIALNUMBER" -> prefs.getString(name, "").toString()
|
||||
|
||||
|
||||
"base_url" -> {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
preferences.getString(getString(R.string.baseurl), "").toString()
|
||||
|
|
|
@ -72,7 +72,7 @@ interface OnGeneralItemRowClickListener {
|
|||
}
|
||||
|
||||
interface OnImageTrashClickListener {
|
||||
fun OnImageUpdateClickListener(item: Any)
|
||||
fun OnImageTrashClickListener(item: Any)
|
||||
}
|
||||
|
||||
interface OnEditSubQuantityListener {
|
||||
|
|
|
@ -21,6 +21,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.target.CustomTarget
|
||||
import com.bumptech.glide.request.transition.Transition
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
||||
|
@ -89,6 +90,17 @@ fun ImageView.loadUrl(url: String) {
|
|||
inline val <reified T> T.TAG: String
|
||||
get() = T::class.java.canonicalName ?: T::class.simpleName ?: T::class.java.simpleName
|
||||
|
||||
fun convertToDateString(date: String?): String? {
|
||||
|
||||
if (date.isNullOrEmpty()) {
|
||||
return date
|
||||
}
|
||||
val formatoEntrada = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") // Formato de entrada
|
||||
val formatoSalida = SimpleDateFormat("yyyy-MM-dd") // Formato de salida
|
||||
val fechaDate = formatoEntrada.parse(date) // Convertir fecha de String a objeto Date
|
||||
return formatoSalida.format(fechaDate) // Convertir fecha a String con formato deseado
|
||||
}
|
||||
|
||||
fun Calendar.convertToDateString(): String {
|
||||
var dayOfWeek = ""
|
||||
var dayOfMonth = ""
|
||||
|
|
|
@ -42,12 +42,12 @@ class ItemSupplierAdapter(
|
|||
binding.apply {
|
||||
this.item = item
|
||||
|
||||
itemImageUpdate.setOnClickListener {
|
||||
itemAdd.setOnClickListener {
|
||||
onImageUpdateClickListener.OnImageUpdateClickListener(
|
||||
item
|
||||
)
|
||||
itemImageTrash.setOnClickListener {
|
||||
onImageTrashClickListener.OnImageUpdateClickListener(item)
|
||||
itemRemove.setOnClickListener {
|
||||
onImageTrashClickListener.OnImageTrashClickListener(item)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class ListImageAdapter(
|
|||
item
|
||||
)
|
||||
itemImageTrash.setOnClickListener {
|
||||
onImageTrashClickListener.OnImageUpdateClickListener(item)
|
||||
onImageTrashClickListener.OnImageTrashClickListener(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,13 +99,16 @@ class ObservFragment(
|
|||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
val launcher = registerImagePicker {
|
||||
for (image in it) {
|
||||
d("VERDNATURA::", "el nombre es " + image.name)
|
||||
d("VERDNATURA::", "el nombre es " + image.uri)
|
||||
//binding.imageView30.setImageURI(image.uri)
|
||||
}
|
||||
listImages?.clear()
|
||||
listImages = it as MutableList<Image>
|
||||
|
||||
setAdapter(listImages!!)
|
||||
}
|
||||
|
||||
|
@ -158,7 +161,7 @@ class ObservFragment(
|
|||
d("VERDNATURA::", "Seleccionado update" + (item as Image).name)
|
||||
}
|
||||
}, object : OnImageTrashClickListener {
|
||||
override fun OnImageUpdateClickListener(item: Any) {
|
||||
override fun OnImageTrashClickListener(item: Any) {
|
||||
d("VERDNATURA::", "Seleccionado trash" + (item as Image).name)
|
||||
list.remove(item)
|
||||
adapterListImage!!.notifyDataSetChanged()
|
||||
|
|
|
@ -41,9 +41,11 @@ class PackagingCountFragment(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
/* viewModel.supplier_getItemsSalix(
|
||||
2, 1
|
||||
)*/
|
||||
|
||||
viewModel.supplier_getItems(
|
||||
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) {
|
||||
override fun OnImageTrashClickListener(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,61 @@ 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("")
|
||||
customDialog.cancel()
|
||||
customDialogInput.dismiss()
|
||||
requireActivity().showKeyboard()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
customDialog.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
|
||||
)
|
||||
|
||||
) {
|
||||
customDialog.cancel()
|
||||
customDialog.dismiss()
|
||||
d("VERDNATURA::", "borrado")
|
||||
}
|
||||
|
||||
.setKoButton(getString(R.string.cancel)) {
|
||||
customDialog.cancel()
|
||||
customDialog.dismiss()
|
||||
|
||||
|
||||
}
|
||||
.show()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val supplierList: LiveData<SupplierList>
|
||||
get() = _supplierList
|
||||
|
||||
private val _entryList by lazy { MutableLiveData<EntryList>() }
|
||||
val entryList: LiveData<EntryList>
|
||||
get() = _entryList
|
||||
|
||||
private val _entry by lazy { MutableLiveData<EntrySalix>() }
|
||||
val entry: LiveData<EntrySalix>
|
||||
get() = _entry
|
||||
|
@ -73,7 +77,47 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun supplier_getItems(supplierFk: Int) {
|
||||
fun getEntries_fromSupplier(supplier: Int) {
|
||||
salix.getEntries_fromSupplier("""{"where": {"supplierFk": "$supplier","isReceived":"false"},"limit":5}""")
|
||||
.enqueue(object :
|
||||
SilexCallback<List<EntrySalix>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<EntrySalix> = ArrayList()
|
||||
listError.add(
|
||||
EntrySalix(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_entryList.value = EntryList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<EntrySalix>>) {
|
||||
if (response.body() != null) {
|
||||
_entryList.value = response.body()?.let { EntryList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<EntrySalix> = ArrayList()
|
||||
listError.add(
|
||||
EntrySalix(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_entryList.value = EntryList(listError)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun supplier_getItems(supplierFk: Any) {
|
||||
|
||||
silex.supplier_getItems(supplierFk)
|
||||
.enqueue(object : SilexCallback<List<ItemSupplier>>(context) {
|
||||
|
@ -106,7 +150,7 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun entry_addSalix(entry: EntrySalix) {
|
||||
salix.Entries(entry = entry)
|
||||
salix.add_entry(entry)
|
||||
.enqueue(object :
|
||||
SilexCallback<EntrySalix>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
|
|
@ -4,12 +4,15 @@ import android.content.ContentResolver
|
|||
import android.content.Context
|
||||
import android.net.Uri
|
||||
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.common.convertToDateString
|
||||
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.Supplier
|
||||
|
@ -33,6 +36,8 @@ class SupplierFragment(
|
|||
private var layoutManager: LinearLayoutManager? = null
|
||||
private var onBack = false
|
||||
private val suppliers = ArrayList<SearchSupplierModel>()
|
||||
private val entries = ArrayList<SearchSupplierModel>()
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
||||
|
||||
companion object {
|
||||
|
@ -48,6 +53,8 @@ class SupplierFragment(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
viewModel.getSuppliers()
|
||||
|
||||
/* viewModel.getSuppliers(
|
||||
)*/
|
||||
|
||||
|
@ -106,9 +113,8 @@ class SupplierFragment(
|
|||
binding.filterSupplier.setText((nombre.getName()))
|
||||
binding.radiobuttonTypePackaging.visibility = View.VISIBLE
|
||||
saveData("SUPPLIERNAME", nombre.getName())
|
||||
println("el id es "+nombre.getId())
|
||||
println("el nombre es "+nombre.getName())
|
||||
saveDataInt("SUPPLIERID", nombre.getId().toInt())
|
||||
saveData("SUPPLIERID", nombre.getId())
|
||||
viewModel.getEntries_fromSupplier(nombre.getId().toInt())
|
||||
baseSearchDialogCompat.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
@ -129,12 +135,51 @@ 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 -> {
|
||||
saveData("ENTRYTYPE", "Rec")
|
||||
|
||||
}
|
||||
R.id.radioButtonDev -> {
|
||||
|
||||
|
@ -142,10 +187,12 @@ class SupplierFragment(
|
|||
}
|
||||
|
||||
}
|
||||
binding.filterEntry.visibility = View.VISIBLE
|
||||
if (!onBack) {
|
||||
binding.splashProgress.visibility=View.VISIBLE
|
||||
|
||||
//viewModel.addFromPackaging(getDataInt("SUPPLIERID"), getData("ENTRYTYPE")=="Rec")
|
||||
ma.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
|
||||
getString(R.string.titlePackagingCount)
|
||||
)
|
||||
|
||||
}
|
||||
onBack = false
|
||||
|
@ -153,6 +200,29 @@ class SupplierFragment(
|
|||
}
|
||||
}
|
||||
|
||||
private fun setEntryDialog() {
|
||||
binding.filterEntry.setOnClickListener {
|
||||
SimpleSearchDialogCompat(
|
||||
context,
|
||||
getString(R.string.Entrada),
|
||||
getString(R.string.escribirparteNombre),
|
||||
null,
|
||||
entries
|
||||
) { baseSearchDialogCompat, nombre, position ->
|
||||
binding.filterEntry.setText((nombre.getName()))
|
||||
binding.radiobuttonTypePackaging.visibility = View.VISIBLE
|
||||
saveData("ENTRYID", nombre.getId())
|
||||
d("VERDNATURA::","Ha seleccionado:"+nombre.getId())
|
||||
ma.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
|
||||
getString(R.string.titlePackagingCount)
|
||||
)
|
||||
baseSearchDialogCompat.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
@ -160,6 +230,10 @@ class SupplierFragment(
|
|||
binding.splashProgress.visibility = View.GONE
|
||||
createSupplierList(it.list)
|
||||
}
|
||||
entryList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createEntryList(it.list)
|
||||
}
|
||||
|
||||
response.observe(viewLifecycleOwner) {
|
||||
if (it.isError) {
|
||||
|
@ -198,5 +272,35 @@ class SupplierFragment(
|
|||
}
|
||||
}
|
||||
|
||||
private fun createEntryList(list: List<EntrySalix>) {
|
||||
entries.clear()
|
||||
list.forEach { entry ->
|
||||
if (!entry.isError!!) {
|
||||
try {
|
||||
entries.add(
|
||||
SearchSupplierModel(
|
||||
entry.id.toString() + "->" + convertToDateString( entry.dated.toString()),
|
||||
id = entry.id.toString()
|
||||
)
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
entries.add(SearchSupplierModel("Añadir Nueva", ""))
|
||||
setEntryDialog()
|
||||
}
|
||||
|
||||
private fun addEntry(){
|
||||
|
||||
|
||||
if (getData("ENTRYTYPE" )=="Rec"){
|
||||
viewModel.entry_addSalix(EntrySalix(supplierFk = getData("SUPPLIERID").toInt(), travelFk = 186025, companyFk = 442))
|
||||
}else{
|
||||
viewModel.entry_addSalix(EntrySalix(supplierFk = getData("SUPPLIERID").toInt(), travelFk = 186025, companyFk = 442))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,28 @@
|
|||
package es.verdnatura.presentation.view.feature.packaging.model
|
||||
|
||||
import android.content.Context
|
||||
import es.verdnatura.presentation.common.convertToDateString
|
||||
import java.util.ArrayList
|
||||
|
||||
class EntrySalix(
|
||||
var id: Int? = null,
|
||||
var supplierFk: String? = null,
|
||||
var travelFk: String? = null,
|
||||
var companyFk: String? = null,
|
||||
var dated: String? = null,
|
||||
var supplierFk: Int? = null,
|
||||
var travelFk: Int? = null,
|
||||
var companyFk: Int? = null,
|
||||
var isError: Boolean = false,
|
||||
var errorMessage: String = ""
|
||||
)
|
||||
|
||||
fun List<EntrySalix>.toDateFormat(): ArrayList<EntrySalix> {
|
||||
val entries: ArrayList<EntrySalix> = ArrayList()
|
||||
this.forEach {
|
||||
entries.add(
|
||||
EntrySalix(
|
||||
dated = convertToDateString(it.dated),
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
return entries.sortedBy{it.dated} as ArrayList
|
||||
}
|
|
@ -11,7 +11,9 @@ data class Supplier(
|
|||
class SupplierList(
|
||||
var list: List<Supplier> = listOf()
|
||||
)
|
||||
|
||||
class EntryList(
|
||||
var list: List<EntrySalix> = listOf()
|
||||
)
|
||||
class itemSupplierList(
|
||||
var list: List<ItemSupplier> = listOf()
|
||||
)
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<vector android:height="24dp"
|
||||
android:viewportHeight="30"
|
||||
android:viewportWidth="32"
|
||||
android:width="24dp"
|
||||
android:tint="#FFF"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFF" android:pathData="M24.667,21.733c-1.733,0 -3.2,1.467 -3.2,3.2s1.467,3.2 3.2,3.2 3.2,-1.467 3.2,-3.2c0,-1.867 -1.467,-3.2 -3.2,-3.2zM24.667,26.533c-0.933,0 -1.6,-0.667 -1.6,-1.6s0.667,-1.6 1.6,-1.6 1.6,0.667 1.6,1.6c0,0.8 -0.8,1.6 -1.6,1.6z"/>
|
||||
<path android:fillColor="#FFF" android:pathData="M7.867,21.733c-1.733,0 -3.2,1.467 -3.2,3.2s1.467,3.2 3.2,3.2c1.733,0 3.2,-1.467 3.2,-3.2 0,-1.867 -1.467,-3.2 -3.2,-3.2zM7.867,26.533c-0.933,0 -1.6,-0.667 -1.6,-1.6s0.667,-1.6 1.6,-1.6c0.933,0 1.6,0.667 1.6,1.6 0,0.8 -0.8,1.6 -1.6,1.6z"/>
|
||||
<path android:fillColor="#FFF" android:pathData="M31.467,13.2l-6.133,-6c-0.4,-0.4 -0.933,-0.533 -1.467,-0.533h-3.067v-1.2c0,-0.8 -0.667,-1.6 -1.6,-1.6h-17.6c-0.933,0 -1.6,0.667 -1.6,1.6v17.333c0,0.933 0.8,1.6 1.6,1.6h2.133c0.267,-2 2,-3.6 4.133,-3.6 2,0 3.867,1.6 4.133,3.6h8.4c0.267,-2 2,-3.6 4.133,-3.6s4,1.6 4.267,3.6h1.6c0.933,0 1.6,-0.8 1.6,-1.6v-8.133c0,-0.533 -0.267,-1.067 -0.533,-1.467zM22.667,8.667c0,-0.133 0.133,-0.267 0.267,-0.267h1.067c0,0 0.133,0 0.133,0.133l4.8,4.533c0.133,0 0,0.4 -0.133,0.4h-5.867c-0.267,0 -0.267,-0.133 -0.267,-0.267v-4.533z"/>
|
||||
</vector>
|
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
android:textSize="@dimen/body2" />
|
||||
|
||||
<ImageButton
|
||||
android:visibility="gone"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@drawable/ic_delete_black_24dp" />
|
||||
|
@ -134,6 +135,7 @@
|
|||
android:textSize="@dimen/body2" />
|
||||
|
||||
<ImageButton
|
||||
android:visibility="gone"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@drawable/ic_delete_black_24dp" />
|
||||
|
@ -211,55 +213,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/layout_margin_min"
|
||||
android:layout_marginBottom="@dimen/layout_margin_1"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/layout_margin_min"
|
||||
android:paddingRight="@dimen/layout_margin_min">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sign"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="Firma:"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/layout_margin_min"
|
||||
android:layout_marginBottom="@dimen/layout_margin_1"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/layout_margin_min"
|
||||
android:paddingRight="@dimen/layout_margin_min">
|
||||
|
||||
<com.simplify.ink.InkView
|
||||
android:id="@+id/ink"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="102dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@color/verdnatura_white"
|
||||
app:inkFlags="interpolation|responsiveWeight"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView36"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/sign"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sign"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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.quantityTotal)}"
|
||||
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"
|
||||
|
|
Loading…
Reference in New Issue