Merge branch '4021-gestion_embalajes' into dev-embalajes

# Conflicts:
#	.idea/deploymentTargetDropDown.xml
#	.idea/workspace.xml
#	app/build.gradle
#	app/src/main/java/es/verdnatura/domain/SalixService.kt
#	app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt
#	app/src/main/java/es/verdnatura/presentation/common/UIExtensions.kt
#	app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/ObservFragment.kt
#	app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt
#	app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingSummaryFragment.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/pasillero/fragment/PasilleroViewModel.kt
#	app/src/main/res/layout/fragment_packaging.xml
#	app/src/main/res/layout/fragment_packaging_obs.xml
#	app/src/main/res/layout/fragment_packaging_summary.xml
#	app/src/main/res/layout/item_image_row.xml
#	app/src/main/res/layout/item_itemsupplier_row.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values-fr/strings.xml
#	app/src/main/res/values-pt/strings.xml
#	app/src/main/res/values/strings.xml
This commit is contained in:
Sergio De la torre 2024-03-06 14:16:36 +01:00
commit 669b05826e
23 changed files with 942 additions and 584 deletions

View File

@ -50,19 +50,11 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.reubication.model.Reubication import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
import es.verdnatura.presentation.view.feature.packaging.model.*
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
import es.verdnatura.presentation.view.feature.sacador.model.TicketStateSalix
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import es.verdnatura.presentation.view.feature.workermistake.model.ExpeditionMistakeSalix
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeSalix
import okhttp3.MultipartBody import okhttp3.MultipartBody
import org.json.JSONObject
import retrofit2.Call import retrofit2.Call
import retrofit2.http.* import retrofit2.http.*
@ -694,7 +686,9 @@ interface SalixService {
@Path("id") id: Number, @Path("id") id: Number,
@Query("item") item: Number, @Query("item") item: Number,
@Query("printedStickers") printedStickers: Number @Query("printedStickers") printedStickers: Number
): Call<Any> ):
Call<EntrySalix>
@POST("tickets/{idTicket}/transferSales") //-->saleMove en Silex @POST("tickets/{idTicket}/transferSales") //-->saleMove en Silex
fun transferSalesSalix( fun transferSalesSalix(
@ -807,13 +801,44 @@ interface SalixService {
"\"scope\":{" + "\"scope\":{" +
"\"fields\":[\"email\"],\"order\":\"id DESC\",\"limit\":1," + "\"fields\":[\"email\"],\"order\":\"id DESC\",\"limit\":1," +
"\"where\":{ \"email\":{\"neq\":null } }}}]})"*/ "\"where\":{ \"email\":{\"neq\":null } }}}]})"*/
//@Query("filter") filter:String? = """""\"order\":\"name DESC\""""
): Call<List<Supplier>> ): 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 @PUT("Entries")//REVISADA
fun Entries( 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 @Body entry:EntrySalix
): Call<EntrySalix> ):
Call<EntrySalix>
@PATCH("Entries/{entryId}")//REVISADA
fun entry_updateObserv(
@Path("entryId") entryId:Int,
@Body entry: obervationEntry
):
Call<EntrySalix>
@GET("Shelvings") @GET("Shelvings")
fun Shelvings( fun Shelvings(
@ -833,10 +858,17 @@ interface SalixService {
@POST("Entries/addFromPackaging") @POST("Entries/addFromPackaging")
fun addFromPackaging( fun addFromPackaging(
@Query("supplier") supplier: Int, @Query("isTravelReception") isTravelReception: Boolean @Query("supplier") supplier: Number,
@Query("isTravelReception") isTravelReception: Boolean
): Call<EntrySalix> ): Call<EntrySalix>
@POST("notificationQueues")
fun notificationQueues(
@Body notificationQueue: notificationQueue
):
Call<Void>
@POST("Images/upload") @POST("Images/upload")
@Multipart @Multipart
fun uploadImage( fun uploadImage(

View File

@ -92,7 +92,7 @@ interface OnGeneralItemRowClickListener {
} }
interface OnImageTrashClickListener { interface OnImageTrashClickListener {
fun OnImageUpdateClickListener(item: Any) fun OnImageTrashClickListener(item: Any)
} }
interface OnEditSubQuantityListener { interface OnEditSubQuantityListener {

View File

@ -1,6 +1,7 @@
package es.verdnatura.presentation.view.feature.packaging.adapter package es.verdnatura.presentation.view.feature.packaging.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
@ -10,11 +11,10 @@ import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
class ItemSupplierAdapter( class ItemSupplierAdapter(
private val items: List<ItemSupplier>, private val items: List<ItemSupplier>,
private val onImageUpdateClickListener: OnImageUpdateClickListener, private val onImageUpdateClickListener: OnImageUpdateClickListener? ,
private val onImageTrashClickListener: OnImageTrashClickListener, private val onImageTrashClickListener: OnImageTrashClickListener?,
private val onEditSubQuantityListener: OnEditSubQuantityListener private val onEditSubQuantityListener: OnEditSubQuantityListener?,
// private val OnGeneralItemRowClickListener: OnGeneralItemRowClickListener, private var showItems: Boolean = true
// private var showDelete: Boolean = false
) : RecyclerView.Adapter<ItemSupplierAdapter.ItemHolder>() { ) : RecyclerView.Adapter<ItemSupplierAdapter.ItemHolder>() {
@ -42,16 +42,20 @@ class ItemSupplierAdapter(
binding.apply { binding.apply {
this.item = item this.item = item
itemImageUpdate.setOnClickListener { if (!showItems){
onImageUpdateClickListener.OnImageUpdateClickListener( itemAdd.visibility= View.GONE
itemRemove.visibility=View.GONE
}
itemAdd.setOnClickListener {
onImageUpdateClickListener!!.OnImageUpdateClickListener(
item item
) )
itemImageTrash.setOnClickListener {
onImageTrashClickListener.OnImageUpdateClickListener(item)
} }
itemRemove.setOnClickListener {
onImageTrashClickListener!!.OnImageTrashClickListener(item)
} }
itemSubquantity.setOnEditorActionListener { v, actionId, event -> /* itemSubquantity.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
onEditSubQuantityListener.OnEditSubQuantityListener( onEditSubQuantityListener.OnEditSubQuantityListener(
@ -61,7 +65,7 @@ class ItemSupplierAdapter(
v.clearFocus() v.clearFocus()
} }
return@setOnEditorActionListener false return@setOnEditorActionListener false
} }*/
} }
} }

View File

@ -41,7 +41,7 @@ class ListImageAdapter(
item item
) )
itemImageTrash.setOnClickListener { itemImageTrash.setOnClickListener {
onImageTrashClickListener.OnImageUpdateClickListener(item) onImageTrashClickListener.OnImageTrashClickListener(item)
} }
} }
} }

View File

@ -7,34 +7,27 @@ import android.os.Build
import android.util.Log.d import android.util.Log.d
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.esafirm.imagepicker.features.ImagePickerConfig import com.esafirm.imagepicker.features.ImagePickerConfig
import com.esafirm.imagepicker.features.registerImagePicker import com.esafirm.imagepicker.features.registerImagePicker
import com.esafirm.imagepicker.model.Image import com.esafirm.imagepicker.model.Image
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentPackagingObsBinding import es.verdnatura.databinding.FragmentPackagingObsBinding
import es.verdnatura.domain.ConstAndValues.ENTRYNUMBERIMAGES
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONS
import es.verdnatura.domain.ConstAndValues.ENTRYTYPE
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogList import es.verdnatura.presentation.view.component.CustomDialogList
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
import es.verdnatura.presentation.view.feature.packaging.adapter.ListImageAdapter import es.verdnatura.presentation.view.feature.packaging.adapter.ListImageAdapter
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
@Suppress("UNUSED_ANONYMOUS_PARAMETER") @Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ObservFragment( class ObservFragment(
var entryPoint: String = "" var entryPoint: String = ""
) : BaseFragment<FragmentPackagingObsBinding, InventaryViewModel>( ) : BaseFragment<FragmentPackagingObsBinding, PackagingViewModel>(
InventaryViewModel::class PackagingViewModel::class
) { ) {
private var adapterListImage: ListImageAdapter? = null private var adapterListImage: ListImageAdapter? = null
@ -65,12 +58,7 @@ class ObservFragment(
private fun setToolBar() { private fun setToolBar() {
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text = getData("ENTRYTYPE") + ": " + getData("SUPPLIERNAME")
runBlocking {
mobileApplication.dataStoreApp.readDataStoreKey<String>(ENTRYTYPE) + ":" + mobileApplication.dataStoreApp.readDataStoreKey<String>(
SUPPLIERNAME
)
}
val listIcons: ArrayList<ImageView> = ArrayList() val listIcons: ArrayList<ImageView> = ArrayList()
val iconNext = ImageView(context) val iconNext = ImageView(context)
@ -84,18 +72,15 @@ class ObservFragment(
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
when (item) { when (item) {
iconNext.drawable -> { iconNext.drawable -> {
lifecycleScope.launch(Dispatchers.IO) { saveData(
mobileApplication.dataStoreApp.editDataStoreKey( "ENTRYNUMBERIMAGES",
ENTRYNUMBERIMAGES, if (listImages.isNullOrEmpty()) 0 else { if (listImages.isNullOrEmpty()) "0" else {
listImages!!.size.toString() listImages!!.size.toString()
} }
) )
saveData("ENTRYOBSERVATIONS",binding.observations.text.toString() )
mobileApplication.dataStoreApp.editDataStoreKey( viewModel.entry_updateObserv(getDataInt("ENTRYID"),binding.observations.text.toString())
ENTRYOBSERVATIONS,
binding.observations.text.toString()
)
}
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingSummary)), PasillerosItemVO(title = getString(R.string.titlePackagingSummary)),
@ -103,8 +88,10 @@ class ObservFragment(
) )
} }
} }
} }
}) })
@ -114,18 +101,21 @@ class ObservFragment(
} }
private fun setEvents() { private fun setEvents() {
val launcher = registerImagePicker { val launcher = registerImagePicker {
for (image in it) { for (image in it) {
d("VERDNATURA::", "el nombre es " + image.name) d("VERDNATURA::", "el nombre es " + image.name)
d("VERDNATURA::", "el nombre es " + image.uri) d("VERDNATURA::", "el nombre es " + image.uri)
//binding.imageView30.setImageURI(image.uri) //binding.imageView30.setImageURI(image.uri)
} }
listImages?.clear()
listImages = it as MutableList<Image> listImages = it as MutableList<Image>
setAdapter(listImages!!) setAdapter(listImages!!)
} }
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed() requireActivity().onBackPressed()
} }
binding.openPickerImages.setOnClickListener { binding.openPickerImages.setOnClickListener {
val config = ImagePickerConfig { val config = ImagePickerConfig {
@ -155,6 +145,7 @@ class ObservFragment(
launcher.launch(config) launcher.launch(config)
} }
} }
override fun observeViewModel() { override fun observeViewModel() {
@ -167,11 +158,12 @@ class ObservFragment(
adapterListImage = adapterListImage =
ListImageAdapter(list, object : OnImageUpdateClickListener { ListImageAdapter(list, object : OnImageUpdateClickListener {
override fun OnImageUpdateClickListener(item: Any) { override fun OnImageUpdateClickListener(item: Any) {
d("VERDNATURA::", "Seleccionado update" + (item as Image).name) d("VERDNATURA::", "Seleccionado update" + (item as Image).name)
} }
}, object : OnImageTrashClickListener { }, object : OnImageTrashClickListener {
override fun OnImageUpdateClickListener(item: Any) { override fun OnImageTrashClickListener(item: Any) {
d("VERDNATURA::", "Seleccionado trash" + (item as Image).name) d("VERDNATURA::", "Seleccionado trash" + (item as Image).name)
list.remove(item) list.remove(item)
adapterListImage!!.notifyDataSetChanged() adapterListImage!!.notifyDataSetChanged()

View File

@ -2,15 +2,12 @@ package es.verdnatura.presentation.view.feature.packaging.fragment
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Build import android.os.Build
import android.os.Bundle import android.text.InputType
import android.util.Log.d
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentPackagingCountBinding import es.verdnatura.databinding.FragmentPackagingCountBinding
import es.verdnatura.domain.ConstAndValues.ENTRYTYPE
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
@ -20,6 +17,7 @@ import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewM
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
@Suppress("UNUSED_ANONYMOUS_PARAMETER") @Suppress("UNUSED_ANONYMOUS_PARAMETER")
class PackagingCountFragment( class PackagingCountFragment(
var entryPoint: String = "" var entryPoint: String = ""
@ -40,22 +38,12 @@ class PackagingCountFragment(
override fun getLayoutId(): Int = R.layout.fragment_packaging_count override fun getLayoutId(): Int = R.layout.fragment_packaging_count
override fun onCreate(savedInstanceState: Bundle?) {
/* viewModel.supplier_getItemsSalix(
2, 1
)*/
super.onCreate(savedInstanceState)
}
override fun init() { override fun init() {
binding.quantityPackaging.setOnClickListener { binding.splashProgress.visibility = View.VISIBLE
ma.onPasillerosItemClickListener( viewModel.getItemsPackaging(
PasillerosItemVO(title = getString(R.string.titlePackagingObs)), getDataInt("SUPPLIERID"), getDataInt("ENTRYID")
getString(R.string.titlePackagingObs)
) )
}
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
ma.hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
@ -67,9 +55,7 @@ class PackagingCountFragment(
private fun setToolBar() { private fun setToolBar() {
binding.mainToolbar.toolbarTitle.text = binding.mainToolbar.toolbarTitle.text =
mobileApplication.dataStoreApp.readDataStoreKey<String>(ENTRYTYPE) + ":" + mobileApplication.dataStoreApp.readDataStoreKey( "${getData("ENTRYTYPE")}: ${getData("SUPPLIERNAME")}"
SUPPLIERNAME
)
val listIcons: ArrayList<ImageView> = ArrayList() val listIcons: ArrayList<ImageView> = ArrayList()
val iconNext = ImageView(context) val iconNext = ImageView(context)
@ -102,33 +88,48 @@ class PackagingCountFragment(
private fun setEvents() { private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed() requireActivity().onBackPressed()
} }
} }
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
entryAdd.observe(viewLifecycleOwner) {
if (it.isError) {
binding.splashProgress.visibility = View.INVISIBLE
ma.messageWithSound(it.errorMessage, true, true)
} else {
ma.messageWithSound(it.errorMessage, false, true)
binding.splashProgress.visibility = View.VISIBLE
viewModel.getItemsPackaging(
getDataInt("SUPPLIERID"), getDataInt("ENTRYID")
)
}
}
itemSupplierList.observe(viewLifecycleOwner) { itemSupplierList.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = View.GONE
adapteritemsupplier = adapteritemsupplier =
ItemSupplierAdapter(it.list, object : OnImageUpdateClickListener { ItemSupplierAdapter(it.list, object : OnImageUpdateClickListener {
override fun OnImageUpdateClickListener(item: Any) { override fun OnImageUpdateClickListener(item: Any) {
d("VERDNATURA::", "Seleccionado update" + (item as ItemSupplier).name) showCustomDialog("quantity", item as ItemSupplier)
} }
}, object : OnImageTrashClickListener { }, object : OnImageTrashClickListener {
override fun OnImageUpdateClickListener(item: Any) { override fun OnImageTrashClickListener(item: Any) {
d("VERDNATURA::", "Seleccionado trash" + (item as ItemSupplier).name) showCustomDialog("delete", item as ItemSupplier)
} }
}, object : OnEditSubQuantityListener { }, object : OnEditSubQuantityListener {
override fun OnEditSubQuantityListener(item: Any, text: String) { override fun OnEditSubQuantityListener(item: Any, text: String) {
d(
"VERDNATURA::",
"la subquantity es " + (item as ItemSupplier).name + "el valor es :" + text
)
hideKeyboard() hideKeyboard()
} }
}) })
@ -143,5 +144,73 @@ class PackagingCountFragment(
} }
} }
private fun showCustomDialog(action: String, item: ItemSupplier) {
when (action) {
"quantity" -> {
customDialogInput.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
customDialogInput.setTitle(getString(R.string.quantityReviewed))
.setDescription(getString(R.string.Indicanuevacantidad))
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isEmpty()) {
requireActivity().hideKeyboard()
} }
binding.splashProgress.visibility = View.VISIBLE
viewModel.entry_addFromBuy(
getDataInt("ENTRYID"), item = item.id!!.toInt(),
(if (getData("ENTRYTYPE") == "Rec") {
(item.printedStickers.plus(customDialogInput.getValue().toInt()))
} else {
item.printedStickers.plus(customDialogInput.getValue().toInt() * -1)
}) as Number
)
customDialog.cancel()
customDialogInput.dismiss()
customDialogInput.setValue("")
}.setKoButton(getString(R.string.cancel)) {
customDialog.cancel()
customDialogInput.dismiss()
}.setValue("")
.show()
customDialogInput.currentFocus
customDialogInput.setFocusText()
}
"delete" -> {
customDialog.setTitle(getString(R.string.deleteEntryReviewed))
.setDescription(getString(R.string.sure))
.setOkButton(
getString(
R.string.delete
)
) {
customDialog.cancel()
customDialog.dismiss()
binding.splashProgress.visibility = View.VISIBLE
viewModel.entry_addFromBuy(
getDataInt("ENTRYID"), item = item.id!!.toInt(),
0
)
}
.setKoButton(getString(R.string.cancel)) {
customDialog.cancel()
customDialog.dismiss()
}
.show()
}
}
}
}

View File

@ -7,51 +7,25 @@ import android.widget.ImageView
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentPackagingSummaryBinding import es.verdnatura.databinding.FragmentPackagingSummaryBinding
import es.verdnatura.domain.ConstAndValues.ENTRYNUMBERIMAGES
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONS
import es.verdnatura.domain.ConstAndValues.ENTRYTYPE
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput import es.verdnatura.presentation.view.feature.packaging.adapter.ItemSupplierAdapter
import es.verdnatura.presentation.view.component.CustomDialogList import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchDepartmentModel
import es.verdnatura.presentation.view.feature.workermistake.adapter.WorkermistakeAdapter
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
import kotlinx.coroutines.runBlocking
@Suppress("UNUSED_ANONYMOUS_PARAMETER") @Suppress("UNUSED_ANONYMOUS_PARAMETER")
class PackagingSummaryFragment( class PackagingSummaryFragment(
var entryPoint: String = "" var entryPoint: String = ""
) : BaseFragment<FragmentPackagingSummaryBinding, InventaryViewModel>( ) : BaseFragment<FragmentPackagingSummaryBinding, PackagingViewModel>(
InventaryViewModel::class PackagingViewModel::class
) { ) {
private var adapteritemsupplier: ItemSupplierAdapter? = null
private var adapterworker: WorkermistakeAdapter? = null
private lateinit var customDialogInput: CustomDialogInput
private var listWorker: MutableList<WorkerFromMistake> = ArrayList()
private var listWorkerAuxiliary: MutableList<WorkerFromMistake> = ArrayList()
private lateinit var customDialog: CustomDialog private lateinit var customDialog: CustomDialog
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
private var layoutManager: LinearLayoutManager? = null private var layoutManager: LinearLayoutManager? = null
private lateinit var customDialogList: CustomDialogList
private var listMistakes: ArrayList<BarcodeVO> = ArrayList()
private var listMistakesAdapter: BarcodeAdapter? = null
private var workerMistakeName: WorkerFromMistake? = null
private val departments = ArrayList<SearchDepartmentModel>()
private lateinit var departmentId: String
companion object { companion object {
fun newInstance(entryPoint: String) = PackagingSummaryFragment(entryPoint) fun newInstance(entryPoint: String) = PackagingSummaryFragment(entryPoint)
} }
@ -59,20 +33,17 @@ class PackagingSummaryFragment(
override fun getLayoutId(): Int = R.layout.fragment_packaging_summary override fun getLayoutId(): Int = R.layout.fragment_packaging_summary
override fun init() { override fun init() {
binding.totalImages.text = mobileApplication.dataStoreApp.readDataStoreKey(ENTRYNUMBERIMAGES)
binding.observations.text = mobileApplication.dataStoreApp.readDataStoreKey(ENTRYOBSERVATIONS)
customDialogList = CustomDialogList(requireContext())
/*
if (!departmentId.isEmpty()) {
viewModel.workerGetFromHasMistake(
getData(DEPARTMENTMISTAKEID).toInt()
)
}*/
customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
binding.totalImages.text = getData("ENTRYNUMBERIMAGES")
binding.observations.text = getData("ENTRYOBSERVATIONS")
binding.splashProgress.visibility = View.VISIBLE
viewModel.getItemsPackaging(
getDataInt("SUPPLIERID"), getDataInt("ENTRYID")
)
ma.hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
binding.splashProgress.visibility = View.GONE
setToolBar() setToolBar()
setEvents() setEvents()
super.init() super.init()
@ -80,11 +51,7 @@ class PackagingSummaryFragment(
private fun setToolBar() { private fun setToolBar() {
binding.mainToolbar.toolbarTitle.text = runBlocking { binding.mainToolbar.toolbarTitle.text = getData("ENTRYTYPE") + ": " + getData("SUPPLIERNAME")
mobileApplication.dataStoreApp.readDataStoreKey<String>(ENTRYTYPE) + ":" + mobileApplication.dataStoreApp.readDataStoreKey<String>(
SUPPLIERNAME
)
}
val listIcons: ArrayList<ImageView> = ArrayList() val listIcons: ArrayList<ImageView> = ArrayList()
val iconConfirm = ImageView(context) val iconConfirm = ImageView(context)
@ -99,7 +66,7 @@ class PackagingSummaryFragment(
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
when (item) { when (item) {
iconConfirm.drawable -> { iconConfirm.drawable -> {
// TODO() showWarning()
} }
} }
} }
@ -112,148 +79,55 @@ class PackagingSummaryFragment(
private fun setEvents() { private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed() requireActivity().onBackPressed()
} }
} }
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
mistakeDepartmentList.observe(viewLifecycleOwner) { itemSupplierList.observe(viewLifecycleOwner) {
createDepartmentList(it.list) binding.splashProgress.visibility = View.GONE
var mySummaryList = it.list.filter { it.quantity > 0 }
} adapteritemsupplier =
workerFromMistakeList.observe(viewLifecycleOwner) { ItemSupplierAdapter(mySummaryList, null, null, null, showItems = false)
createWorkerList(it.list) binding.itemsupplierRecyclerview.adapter = adapteritemsupplier
adapterworker =
WorkermistakeAdapter(listWorker, object : onMistakeWorkerClickListener {
override fun onMistakeWorkerClickListener(item: WorkerFromMistake) {
viewModel.workerMistakeTypeGet(
)
workerMistakeName =
WorkerFromMistake(
item.id,
item.firstName,
item.lastName,
true,
""
)
}
})
binding.workermistakeRecyclerview.adapter = adapterworker
layoutManager = layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.workermistakeRecyclerview.layoutManager = layoutManager binding.itemsupplierRecyclerview.layoutManager = layoutManager
}
}
} }
mistakeWorkerList.observe(viewLifecycleOwner, {
showMistakeList(it.list)
//goBack = false
}) private fun showWarning() {
responseAddMistake.observe(viewLifecycleOwner, { customDialog.setTitle(getString(R.string.sendEntry))
customDialog.setTitle(getString(R.string.warningEntry))
ma.messageWithSound( .setOkButton(
if (it.isError) { getString(
if (it.codeError == 403) { R.string.accept
getString(R.string.userNotPermission)
} else {
it.errorMessage
}
} else {
getString(R.string.errorCauseRegistered)
}, it.isError, true, isToasted = true
) )
) {
}) viewModel.notificationQueues("modified-entry",getDataInt(USERFK),"""{"url":"${getData("base_urlSalix")}/#!/entry/${getDataInt("ENTRYID")}/summary"}""")
customDialog.dismiss()
response.observe(viewLifecycleOwner, {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
}
})
}
} }
private fun showMistakeList(list: List<MistakeType>) {
listMistakes = ArrayList()
list.forEach {
listMistakes.add(BarcodeVO(code = it.description))
}
customDialogList.setTitle(getString(R.string.errorCause) + workerMistakeName!!.firstName)
.setKoButton( .setKoButton(
getString( getString(
R.string.cancel R.string.cancel
) )
) { ) {
customDialogList.dismiss() customDialog.dismiss()
}.hideDialog().show() }.show()
listMistakesAdapter =
BarcodeAdapter(listMistakes, object : OnBarcodeRowClickListener {
override fun onBarcodeRowClickListener(item: BarcodeVO) {
list.forEach {
if (it.description == item.code) {
/* viewModel.workerMistake_Add(
vUserFk = workerMistakeName!!.id!!,
vTypeFk = it.code
)*/
// getString(R.string.errorRegistered).toast(requireContext())
customDialogList.dismiss()
}
}
}
}, showDelete = false)
customDialogList.getRecyclerView().adapter = listMistakesAdapter
customDialogList.getRecyclerView().layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
} }
private fun createDepartmentList(list: List<DepartmentMistake>) {
departments.clear()
list.forEach { department ->
if (!department.isError) {
try {
departments.add(SearchDepartmentModel(department.name, department.id))
} catch (e: Exception) {
}
}
}
}
private fun createWorkerList(list: List<WorkerFromMistake>) {
listWorker.clear()
list.forEach { worker ->
if (!worker.isError) {
try {
listWorker.add(worker)
} catch (e: Exception) {
}
}
} }
listWorker.add(WorkerFromMistake(0, "Añadir nuevo", "", false))
listWorkerAuxiliary.clear()
listWorkerAuxiliary.addAll(listWorker)
listWorkerAuxiliary.add(WorkerFromMistake(0, "Añadir nuevo", "", false))
}
}

View File

@ -3,16 +3,14 @@ package es.verdnatura.presentation.view.feature.packaging.fragment.PackagingView
import android.content.Context import android.content.Context
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback import androidx.lifecycle.Transformations
import es.verdnatura.domain.SilexCallback
import es.verdnatura.presentation.base.BaseViewModel import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix import es.verdnatura.presentation.view.feature.packaging.model.*
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
import es.verdnatura.presentation.view.feature.packaging.model.Supplier
import es.verdnatura.presentation.view.feature.packaging.model.SupplierList
import es.verdnatura.presentation.view.feature.packaging.model.itemSupplierList
import okhttp3.MultipartBody import okhttp3.MultipartBody
import retrofit2.Response import retrofit2.Response
@ -27,18 +25,32 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
val supplierList: LiveData<SupplierList> val supplierList: LiveData<SupplierList>
get() = _supplierList get() = _supplierList
private val _entryList by lazy { MutableLiveData<EntryList>() }
val entryList: LiveData<EntryList>
get() = _entryList
private val _entry by lazy { MutableLiveData<EntrySalix>() } private val _entry by lazy { MutableLiveData<EntrySalix>() }
val entry: LiveData<EntrySalix> val entry: LiveData<EntrySalix>
get() = _entry get() = _entry
private val _entryUpdate by lazy { MutableLiveData<EntrySalix>() }
val entryUpdate: LiveData<EntrySalix>
get() = _entryUpdate
private val _entryAdd by lazy { MutableLiveData<EntrySalix>() }
val entryAdd: LiveData<EntrySalix>
get() = _entryAdd
private val _response by lazy { MutableLiveData<ResponseItemVO>() } private val _response by lazy { MutableLiveData<ResponseItemVO>() }
val response: LiveData<ResponseItemVO> val response: LiveData<ResponseItemVO>
get() = _response get() = _response
val loadEntryAdd = Transformations.map(_entryAdd) { Event(it) }
fun getSuppliers() { fun getSuppliers() {
salix.getSuppliers() salix.getSuppliers()
.enqueue(object : .enqueue(object :
SalixCallback<List<Supplier>>(context) { SilexCallback<List<Supplier>>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
val listError: ArrayList<Supplier> = ArrayList() val listError: ArrayList<Supplier> = ArrayList()
listError.add( listError.add(
@ -75,10 +87,50 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
}) })
} }
fun supplier_getItems(supplierFk: Int) { fun getEntries_fromSupplier(supplier: Int) {
salix.getEntries_fromSupplier("""{"where": {"supplierFk": "$supplier"},"limit":5, "order":"created DESC"}""")
.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) silex.supplier_getItems(supplierFk)
.enqueue(object : SalixCallback<List<ItemSupplier>>(context) { .enqueue(object : SilexCallback<List<ItemSupplier>>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
val listError: ArrayList<ItemSupplier> = ArrayList() val listError: ArrayList<ItemSupplier> = ArrayList()
listError.add( listError.add(
@ -108,9 +160,9 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
} }
fun entry_addSalix(entry: EntrySalix) { fun entry_addSalix(entry: EntrySalix) {
salix.Entries(entry = entry) salix.add_entry(entry)
.enqueue(object : .enqueue(object :
SalixCallback<EntrySalix> (context){ SilexCallback<EntrySalix>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_entry.value = EntrySalix( _entry.value = EntrySalix(
isError = true, isError = true,
@ -138,13 +190,152 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
}) })
} }
fun entry_updateObserv(entryId: Int, observation: String) {
salix.entry_updateObserv(entryId,obervationEntry(observation))
.enqueue(object :
SilexCallback<EntrySalix>(context) {
override fun onError(t: Throwable) {
_entryUpdate.value = EntrySalix(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
}
override fun onSuccess(response: Response<EntrySalix>) {
if (response.body() != null) {
_entryUpdate.value = response.body()
} else {
_entryUpdate.value = EntrySalix(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}
fun entry_uploadPhotoSalix(id: Number, warehouseId: Number, companyId: Number, dmsTypeId: Number, reference: String, description: String, hasFile: Boolean, file: MultipartBody.Part) { fun entry_uploadPhotoSalix(id: Number, warehouseId: Number, companyId: Number, dmsTypeId: Number, reference: String, description: String, hasFile: Boolean, file: MultipartBody.Part) {
salix.uploadEntryPhoto(id, warehouseId, companyId, dmsTypeId, reference, description, hasFile, file) salix.uploadEntryPhoto(id, warehouseId, companyId, dmsTypeId, reference, description, hasFile, file)
.enqueue(object : SalixCallback<Any>(context){}) .enqueue(object : SilexCallback<Any>(context){})
} }
fun entry_addFromBuy(id: Number, item: Number, printedStickers: Number) { fun entry_addFromBuy(id: Number, item: Number, printedStickers: Number) {
salix.addFromBuy(id, item, printedStickers) salix.addFromBuy(id, item, printedStickers)
.enqueue(object : SalixCallback<Any>(context){}) .enqueue(object : SilexCallback<EntrySalix>(context){override fun onError(t: Throwable) {
_entryAdd.value = EntrySalix(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
}
override fun onSuccess(response: Response<EntrySalix>) {
if (response.body() != null) {
_entryAdd.value = response.body()
} else {
_entryAdd.value = EntrySalix(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}
fun notificationQueues(notification: String, workerfk: Int, bodyUrl: String) {
salix.notificationQueues(notificationQueue(notification,workerfk,bodyUrl))
.enqueue(object : SilexCallback<Void>(context){override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
}
override fun onSuccess(response: Response<Void>) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
})
}
fun entry_addFromPackaging(supplier: Number,isPackaging: Boolean) {
salix.addFromPackaging(supplier, isPackaging)
.enqueue(object : SilexCallback<EntrySalix>(context) {
override fun onError(t: Throwable) {
_entryAdd.value = EntrySalix(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
}
override fun onSuccess(response: Response<EntrySalix>) {
if (response.body() != null) {
_entryAdd.value = response.body()
} else {
_entryAdd.value = EntrySalix(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}
fun getItemsPackaging(supplierId: Int,entryId: Int) {
salix.getItemsPackaging(supplierId, entryId)
.enqueue(object : SilexCallback<List<ItemSupplier>>(context){
override fun onError(t: Throwable) {
val listError: ArrayList<ItemSupplier> = ArrayList()
listError.add(
ItemSupplier(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_itemSupplierList.value = itemSupplierList(listError)
}
override fun onSuccess(response: Response<List<ItemSupplier>>) {
if (response.body() != null) {
_itemSupplierList.value =
response.body()?.let { itemSupplierList(it) }
} else {
val listError: ArrayList<ItemSupplier> = ArrayList()
listError.add(ItemSupplier(null, null))
_itemSupplierList.value = itemSupplierList(listError)
}
}
})
} }
} }

View File

@ -6,22 +6,18 @@ import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentPackagingBinding import es.verdnatura.databinding.FragmentPackagingBinding
import es.verdnatura.domain.ConstAndValues.ENTRY import es.verdnatura.domain.notNull
import es.verdnatura.domain.ConstAndValues.ENTRYTYPE
import es.verdnatura.domain.ConstAndValues.SUPPLIERID
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener 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.inventario.fragment.SearchSupplierModel
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
import es.verdnatura.presentation.view.feature.packaging.model.Supplier import es.verdnatura.presentation.view.feature.packaging.model.Supplier
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
import kotlinx.coroutines.runBlocking
import okhttp3.MediaType
import okhttp3.MultipartBody
import okhttp3.RequestBody
import java.io.File
@Suppress("UNUSED_ANONYMOUS_PARAMETER") @Suppress("UNUSED_ANONYMOUS_PARAMETER")
class SupplierFragment( class SupplierFragment(
@ -35,6 +31,10 @@ class SupplierFragment(
private var layoutManager: LinearLayoutManager? = null private var layoutManager: LinearLayoutManager? = null
private var onBack = false private var onBack = false
private val suppliers = ArrayList<SearchSupplierModel>() private val suppliers = ArrayList<SearchSupplierModel>()
private val entries = ArrayList<SearchSupplierModel>()
private lateinit var customDialog: CustomDialog
companion object { companion object {
fun newInstance(entryPoint: String) = SupplierFragment(entryPoint) fun newInstance(entryPoint: String) = SupplierFragment(entryPoint)
@ -49,12 +49,12 @@ class SupplierFragment(
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
/* viewModel.getSuppliers( viewModel.getSuppliers()
)*/
val drawableId: Int = val drawableId: Int =
R.drawable.background_test // Reemplaza "mi_drawable" con el nombre de tu recurso Drawable R.drawable.background_test // Reemplaza "mi_drawable" con el nombre de tu recurso Drawable
/* val uri: Uri = Uri.parse( /* val uri: Uri = Uri.parse(
ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + ContentResolver.SCHEME_ANDROID_RESOURCE + "://" +
context!!.resources.getResourcePackageName(drawableId) + '/' + context!!.resources.getResourcePackageName(drawableId) + '/' +
@ -64,8 +64,9 @@ class SupplierFragment(
val rutaAbsoluta: String = uri.toString()*/ val rutaAbsoluta: String = uri.toString()*/
val file =
File("/storage/emulated/0/Android/data/es.verdnatura.sfusion/files/Pictures/test.png") /*
val file = File("/storage/emulated/0/Android/data/es.verdnatura.sfusion/files/Pictures/test.png")
val filePart = MultipartBody.Part.createFormData( val filePart = MultipartBody.Part.createFormData(
"file", "file",
file.name, file.name,
@ -80,7 +81,7 @@ class SupplierFragment(
"Example description", "Example description",
false, false,
file = filePart file = filePart
) )*/
// viewModel.entry_addFromBuy(8,1,100) // viewModel.entry_addFromBuy(8,1,100)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
} }
@ -93,6 +94,7 @@ class SupplierFragment(
override fun init() { override fun init() {
binding.splashProgress.visibility = View.VISIBLE
binding.filterSupplier.setOnClickListener { binding.filterSupplier.setOnClickListener {
SimpleSearchDialogCompat( SimpleSearchDialogCompat(
context, context,
@ -103,18 +105,13 @@ class SupplierFragment(
) { baseSearchDialogCompat, nombre, position -> ) { baseSearchDialogCompat, nombre, position ->
binding.filterSupplier.setText((nombre.getName())) binding.filterSupplier.setText((nombre.getName()))
binding.radiobuttonTypePackaging.visibility = View.VISIBLE binding.radiobuttonTypePackaging.visibility = View.VISIBLE
saveData("SUPPLIERNAME", nombre.getName())
runBlocking { saveDataInt("SUPPLIERID", nombre.getId().toInt())
mobileApplication.dataStoreApp.editDataStoreKey(SUPPLIERNAME, nombre.getName()) viewModel.getEntries_fromSupplier(nombre.getId().toInt())
mobileApplication.dataStoreApp.editDataStoreKey(
SUPPLIERID,
nombre.getId() as Int
)
}
baseSearchDialogCompat.dismiss() baseSearchDialogCompat.dismiss()
}.show() }.show()
} }
customDialog = CustomDialog(requireContext())
ma.hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
setToolBar() setToolBar()
setEvents() setEvents()
@ -129,46 +126,64 @@ class SupplierFragment(
private fun setEvents() { private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed() requireActivity().onBackPressed()
} }
binding.radiobuttonTypePackaging.setOnCheckedChangeListener { buttonView, isChecked -> binding.radiobuttonTypePackaging.setOnCheckedChangeListener { buttonView, isChecked ->
when (isChecked) { when (isChecked) {
R.id.radioButtonRec -> { R.id.radioButtonRec -> {
runBlocking { saveData("ENTRYTYPE", "Rec")
mobileApplication.dataStoreApp.editDataStoreKey(
ENTRYTYPE,
"Rec"
)
} }
}
R.id.radioButtonDev -> { R.id.radioButtonDev -> {
runBlocking {
mobileApplication.dataStoreApp.editDataStoreKey( saveData("ENTRYTYPE", "Dev")
ENTRYTYPE, }
"Dev"
}
binding.filterEntry.visibility = View.VISIBLE
}
}
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
if (nombre.getName() == getString(R.string.newEntry)) {
addEntry()
} else {
saveDataInt("ENTRYID", nombre.getId().toInt())
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
getString(R.string.titlePackagingCount)
) )
} }
baseSearchDialogCompat.dismiss()
}.show()
} }
} }
if (!onBack) {
//viewModel.addFromPackaging(getDataInt("SUPPLIERID"), getData("ENTRYTYPE")=="Rec")
}
onBack = false
}
}
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
supplierList.observe(viewLifecycleOwner) { supplierList.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = View.GONE
createSupplierList(it.list) createSupplierList(it.list)
} }
entryList.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = View.GONE
createEntryList(it.list)
}
response.observe(viewLifecycleOwner) { response.observe(viewLifecycleOwner) {
if (it.isError) { if (it.isError) {
@ -176,13 +191,46 @@ class SupplierFragment(
} }
} }
entry.observe(viewLifecycleOwner) {
loadEntryAdd.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false) ma.messageWithSound(it.errorMessage, true, false)
} else { } else {
runBlocking { mobileApplication.dataStoreApp.editDataStoreKey(ENTRY, it.id!!) } saveDataInt("ENTRYID", it.id!!.toInt())
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
it.id!!.toString()
)
}
}
}
/* entryAdd.observe(viewLifecycleOwner) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
saveDataInt("ENTRYID", it.id!!.toInt())
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
it.id!!.toString()
)
}
}*/
entry.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = View.GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
saveDataInt("ENTRYID", it.id!!.toInt())
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titlePackagingCount)), PasillerosItemVO(title = getString(R.string.titlePackagingCount)),
getString(R.string.titlePackagingCount) getString(R.string.titlePackagingCount)
@ -192,6 +240,7 @@ class SupplierFragment(
} }
} }
private fun createSupplierList(list: List<Supplier>) { private fun createSupplierList(list: List<Supplier>) {
suppliers.clear() suppliers.clear()
list.forEach { supplier -> list.forEach { supplier ->
@ -204,5 +253,54 @@ 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.created),
id = entry.id.toString()
)
)
} catch (e: Exception) {
}
}
}
entries.add(SearchSupplierModel(getString(R.string.newEntry), ""))
setEntryDialog()
}
private fun addEntry() {
customDialog.setTitle(getString(R.string.createEntryDescrip))
.setDescription(getString(R.string.sure))
.setOkButton(
getString(
R.string.accept
)
) {
customDialog.cancel()
customDialog.dismiss()
binding.splashProgress.visibility = View.VISIBLE
viewModel.entry_addFromPackaging(
getDataInt("SUPPLIERID"),
getData("ENTRYTYPE") == "Rec"
)
}
.setKoButton(getString(R.string.cancel)) {
customDialog.cancel()
customDialog.dismiss()
}
.show()
}
} }

View File

@ -1,10 +1,38 @@
package es.verdnatura.presentation.view.feature.packaging.model package es.verdnatura.presentation.view.feature.packaging.model
import es.verdnatura.presentation.common.convertToDateString
class EntrySalix( class EntrySalix(
var id: Int? = null, var id: Number? = null,
var supplierFk: String? = null, var dated: String? = null,
var travelFk: String? = null, var created: String? = null,
var companyFk: String? = null, var supplierFk: Number? = null,
var travelFk: Number? = null,
var companyFk: Number? = null,
var isError: Boolean = false, var isError: Boolean = false,
var errorMessage: String = "" var errorMessage: String = ""
) )
fun List<EntrySalix>.toDateFormat(): ArrayList<EntrySalix> {
val entries: ArrayList<EntrySalix> = ArrayList()
this.forEach {
entries.add(
EntrySalix(
dated = convertToDateString(it.dated),
created = convertToDateString(it.created)
)
)
}
return entries.sortedBy { it.dated } as ArrayList
}
data class obervationEntry(
val observation:String
)
data class notificationQueue(
val notificationFk:String,
val authorFk:Int,
val params: String
)

View File

@ -12,6 +12,10 @@ class SupplierList(
var list: List<Supplier> = listOf() var list: List<Supplier> = listOf()
) )
class EntryList(
var list: List<EntrySalix> = listOf()
)
class itemSupplierList( class itemSupplierList(
var list: List<ItemSupplier> = listOf() var list: List<ItemSupplier> = listOf()
) )
@ -19,8 +23,9 @@ class itemSupplierList(
data class ItemSupplier( data class ItemSupplier(
var id: Int? = null, var id: Int? = null,
var name: String? = null, var name: String? = null,
var quantity: Int? = 0, var quantity: Int = 0,
var quantityTotal: Int? = 0, var quantityTotal: Int = 0,
var printedStickers: Int = 0,
var buy: Int? = null, var buy: Int? = null,
var isError: Boolean = false, var isError: Boolean = false,
var errorMessage: String? = null var errorMessage: String? = null

View File

@ -438,17 +438,18 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
) )
) )
*/
//#tarea4021 //#tarea4021
/* _pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6, 6,
R.drawable.ic_packaging, R.drawable.ic_packaging_entries,
contextApp.getString(R.string.titlePackaging), contextApp.getString(R.string.titlePackaging),
R.string.titlePackaging, R.string.titlePackaging,
contextApp.getString(R.string.titlePackagingDescrip) contextApp.getString(R.string.titlePackagingDescrip)
) )
)*/ )
//Tarea 5322
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6, 6,
@ -457,7 +458,6 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
R.string.titlePhotos, R.string.titlePhotos,
contextApp.getString(R.string.titlePhotos) contextApp.getString(R.string.titlePhotos)
) )
)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(

View File

@ -35,7 +35,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_weight="1.5" android:layout_weight="1.5"
android:backgroundTint="@android:color/white" android:backgroundTint="@android:color/white"
android:hint="@string/nameSurname" android:hint="Nombre o apellido"
android:inputType="text" android:inputType="text"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
@ -50,15 +50,16 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:backgroundTint="@android:color/white" android:backgroundTint="@android:color/white"
android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp"
android:focusable="false" android:focusable="false"
android:hint="@string/suppliers" android:hint="Proveedor"
android:inputType="text"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@color/verdnatura_pumpkin_orange" android:textColor="@color/verdnatura_pumpkin_orange"
android:textColorHint="@android:color/darker_gray" android:textColorHint="@android:color/darker_gray"
android:visibility="visible" android:visibility="visible" />
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp" />
</LinearLayout> </LinearLayout>
@ -95,8 +96,44 @@
android:text="@string/comeback" android:text="@string/comeback"
android:textColor="@color/verdnatura_white" /> android:textColor="@color/verdnatura_white" />
</RadioGroup> </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> </LinearLayout>
<include <include
@ -107,5 +144,30 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
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">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

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

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -12,9 +12,9 @@
android:id="@+id/textObs" android:id="@+id/textObs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/observations" android:text="Observaciones : "
android:textColor="#FFF" android:textColor="#FFF"
android:textSize="18sp" android:textSize="18dp"
app:layout_constraintStart_toEndOf="@+id/main_toolbar" app:layout_constraintStart_toEndOf="@+id/main_toolbar"
app:layout_constraintTop_toBottomOf="@+id/main_toolbar" /> app:layout_constraintTop_toBottomOf="@+id/main_toolbar" />
@ -23,7 +23,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="100dp"
android:gravity="center" android:gravity="center"
android:hint="@string/observations" android:hint="Observaciones"
android:inputType="textCapSentences|textMultiLine" android:inputType="textCapSentences|textMultiLine"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/tertiary_text_light" android:textColorHint="@android:color/tertiary_text_light"
@ -32,34 +32,38 @@
app:layout_constraintTop_toBottomOf="@+id/textObs" /> app:layout_constraintTop_toBottomOf="@+id/textObs" />
<TextView <TextView
android:id="@+id/textImage" android:id="@+id/openPickerImages"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/images" android:text="Imágenes : "
android:textColor="#FFF" android:textColor="#FFF"
android:textSize="18sp" android:textSize="18dp"
android:drawableEnd="@drawable/ic_add_black_24dp"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@+id/observations" app:layout_constraintStart_toEndOf="@+id/observations"
app:layout_constraintTop_toBottomOf="@+id/observations" /> app:layout_constraintTop_toBottomOf="@+id/observations" />
<LinearLayout <LinearLayout
android:id="@+id/textImages" android:id="@+id/textImages"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/layout_margin_min" android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1" android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal" android:paddingLeft="@dimen/layout_margin_min"
android:paddingStart="@dimen/layout_margin_min" android:paddingRight="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min" android:visibility="gone"
app:layout_constraintStart_toEndOf="@+id/textImage" app:layout_constraintTop_toBottomOf="@+id/openPickerImages" >
app:layout_constraintTop_toBottomOf="@+id/textImage">
<TextView <TextView
android:id="@+id/openPickerImages" android:id="@+id/openPickerImagesOld"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="@string/addNew" android:text="Añadir nueva..."
android:visibility="visible"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" /> android:textSize="@dimen/body2" />
</LinearLayout> </LinearLayout>
@ -68,10 +72,11 @@
android:id="@+id/listImagesRecycler" android:id="@+id/listImagesRecycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="550dp" android:layout_height="550dp"
android:visibility="visible" android:visibility="gone"
app:layout_constraintStart_toEndOf="@+id/textImages" app:layout_constraintStart_toEndOf="@+id/textImages"
app:layout_constraintTop_toBottomOf="@+id/textImages" app:layout_constraintTop_toBottomOf="@+id/textImages"
tools:listitem="@layout/item_image_row" /> tools:listitem="@layout/item_image_row"
/>
<include <include
@ -81,5 +86,25 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -19,7 +19,7 @@
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/textinputlayout_username" android:id="@+id/textinputlayout_data"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColorHint="@android:color/darker_gray"> android:textColorHint="@android:color/darker_gray">
@ -27,128 +27,106 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" />
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/filter_itemFk"
style="@style/InputLineTextSearch"
android:layout_width="match_parent"
android:layout_weight="1.5"
android:backgroundTint="@android:color/white"
android:hint="Nombre o apellido"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textAlignment="center"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/darker_gray"
android:visibility="gone" />
<TextView
android:id="@+id/filter_department"
style="@style/InputLineTextSearch"
android:layout_width="match_parent"
android:layout_weight="1"
android:backgroundTint="@android:color/white"
android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp"
android:focusable="false"
android:hint="Embalajes"
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" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/layout_margin_min" android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1" android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal" android:paddingLeft="@dimen/layout_margin_min"
android:paddingStart="@dimen/layout_margin_min" android:paddingRight="@dimen/layout_margin_min">
android:paddingEnd="@dimen/layout_margin_min">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.25" android:layout_weight="0.75"
android:gravity="center" android:text="Descripción"
android:text="@string/description" android:textAlignment="viewStart"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" /> android:textSize="@dimen/body2" />
<TextView <TextView
android:id="@+id/quantityPackaging"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="@string/total" android:text="@string/Cantidad"
android:visibility="gone"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" /> android:textSize="@dimen/body2" />
</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:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:text="Total"
android:textAlignment="textStart"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" android:paddingStart="@dimen/layout_margin_3"
tools:text="CC ROJO"/> android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
tools:text="220"/>
<ImageButton
android:layout_width="25dp"
android:layout_height="25dp"
android:background="@drawable/ic_delete_black_24dp"
android:contentDescription="@string/trash"/>
</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:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
tools:text="DC"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
tools:text="30"/>
<ImageButton
android:layout_width="25dp"
android:layout_height="25dp"
android:background="@drawable/ic_delete_black_24dp"
android:contentDescription="@string/trash"/>
</LinearLayout> </LinearLayout>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout <androidx.recyclerview.widget.RecyclerView
android:id="@+id/layout_total_images" android:id="@+id/itemsupplier_recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_min" android:clipToPadding="false"
android:layout_marginBottom="@dimen/layout_margin_1" android:visibility="visible"
android:orientation="horizontal" tools:listitem="@layout/item_itemsupplier_row" />
android:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/h5"
android:layout_marginTop="@dimen/h5">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/imageToSend" android:text="@string/attachImage"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" android:textSize="@dimen/body2"
android:textStyle="bold" /> android:textStyle="bold" />
@ -157,106 +135,36 @@
android:id="@+id/totalImages" android:id="@+id/totalImages"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/verdnatura_white" android:text=""
android:textSize="@dimen/body2" android:textColor="@color/verdnatura_pumpkin_orange"
android:textStyle="bold"
tools:text="0"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/observationsTxt"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" android:textSize="@dimen/body2"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_observations" android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_min" android:orientation="horizontal">
android:layout_marginBottom="@dimen/layout_margin_1" <TextView
android:orientation="horizontal" android:id="@+id/observa"
android:paddingStart="@dimen/layout_margin_min" android:layout_width="wrap_content"
android:paddingEnd="@dimen/layout_margin_min"> android:layout_height="wrap_content"
android:text="@string/observations"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/observations" android:id="@+id/observations"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="100dp" android:layout_height="wrap_content"
android:gravity="center"
android:hint="@string/observations" android:hint="@string/observations"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_pumpkin_orange"
android:textColorHint="@android:color/tertiary_text_light"
android:visibility="visible"
app:layout_constraintStart_toEndOf="@+id/layout_total_images"
app:layout_constraintTop_toBottomOf="@+id/layout_total_images" />
</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:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@dimen/layout_margin_min">
<TextView
android:id="@+id/sign"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:text="@string/signPackaging"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" android:textSize="@dimen/body2"
android:textStyle="bold" /> 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:paddingStart="@dimen/layout_margin_min"
android:paddingEnd="@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> </LinearLayout>
</com.google.android.material.textfield.TextInputLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/workermistake_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:visibility="gone"
tools:listitem="@layout/item_general_row" />
</LinearLayout> </LinearLayout>
<include <include
@ -267,5 +175,30 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
android:textSize="@dimen/body2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools" <layout xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
> >
@ -26,8 +27,7 @@
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1" android:layout_weight="1"
tools:srcCompat="@tools:sample/avatars" tools:srcCompat="@tools:sample/avatars" />
android:contentDescription="@string/images"/>
<TextView <TextView
android:id="@+id/item_name" android:id="@+id/item_name"
@ -35,7 +35,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="48dp" android:layout_marginRight="48dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@{item.name}" android:text="@{item.name}"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
@ -45,20 +45,19 @@
<ImageView <ImageView
android:layout_marginStart="@dimen/default_layout_margin"
android:id="@+id/item_image_update" android:id="@+id/item_image_update"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/default_layout_margin"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:scaleType="centerCrop" 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:contentDescription="@string/update"/> android:visibility="gone" />
<ImageView <ImageView
android:layout_marginStart="@dimen/default_layout_margin" android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image_trash" android:id="@+id/item_image_trash"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -67,8 +66,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="visible" android:visibility="visible"
android:src="@drawable/ic_delete_black_24dp" android:src="@drawable/ic_delete_black_24dp" />
android:contentDescription="@string/trash"/>
</LinearLayout> </LinearLayout>

View File

@ -31,7 +31,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:visibility="gone" android:visibility="gone"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="@dimen/pasilleros_margin_main_menu" android:layout_marginLeft="@dimen/pasilleros_margin_main_menu"
tools:text="1" /> tools:text="1" />
<TextView <TextView
@ -49,29 +49,27 @@
<EditText <EditText
android:id="@+id/item_subquantity" android:id="@+id/item_subquantity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.25" android:layout_weight="1.25"
android:text="@{Integer.toString(item.quantityTotal)}" android:text="@{Integer.toString(item.quantityTotal)}"
android:hint="@string/total"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h8" android:textSize="@dimen/h8"
android:gravity="center_vertical" android:gravity="center_vertical"
android:visibility="visible" android:visibility="gone"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:singleLine="true" android:singleLine="true"
android:layout_gravity="center" android:layout_gravity="center"
android:autofillHints="phone"
android:inputType="number"
tools:text="20" /> tools:text="20" />
<TextView <TextView
android:id="@+id/item_quantity" android:id="@+id/item_quantity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/pasilleros_margin_main_menu" android:layout_marginLeft="@dimen/pasilleros_margin_main_menu"
android:layout_weight="1.25" android:layout_weight="1.25"
android:layout_gravity="center" android:layout_gravity="center"
android:text="@{Integer.toString(item.quantity)}" android:text="@{Integer.toString(item.printedStickers)}"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h8" android:textSize="@dimen/h8"
android:visibility="visible" android:visibility="visible"
@ -79,28 +77,26 @@
<ImageView <ImageView
android:layout_marginStart="@dimen/default_layout_margin" android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image_update" android:id="@+id/item_add"
android:layout_width="24dp" android:layout_width="24dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_height="24dp" android:layout_height="24dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="visible" android:visibility="visible"
android:src="@drawable/ic_history_black_24dp" android:src="@drawable/ic_add_black_24dp" />
android:contentDescription="@string/selectAction"/>
<ImageView <ImageView
android:layout_marginStart="@dimen/default_layout_margin" android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image_trash" android:id="@+id/item_remove"
android:layout_width="24dp" android:layout_width="24dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_height="24dp" android:layout_height="24dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="visible" android:visibility="visible"
android:src="@drawable/ic_delete_black_24dp" android:src="@drawable/ic_delete_black_24dp" />
android:contentDescription="@string/trash"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Gestor Almacén</string> <string name="app_name">Gestor Almacén</string>
<string name="Fecha">Fecha</string> <string name="Fecha">Fecha</string>
<string name="Cliente">Cliente</string> <string name="Cliente">Cliente</string>
@ -740,5 +739,19 @@
<string name="addWorkForm">Añadir…</string> <string name="addWorkForm">Añadir…</string>
<string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string> <string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string>
<string name="checkItemShelvingDescrip">Revisión del carro</string>
<string name="quantityReviewed">Cantidad revisada a sumar/restar del total</string>
<string name="deleteEntryReviewed">Vas a borrar la cantidad de la compra de la entrada</string>
<string name="quantityToReview">Cantidad a revisar</string>
<string name="selectEntryToFill">Selecciona entrada</string>
<string name="entryCreate">Crear entrada</string>
<string name="entryNew">Añadir nueva</string>
<string name="newEntry">Añadir nueva</string>
<string name="createEntry">Crear entrada</string>
<string name="createEntryDescrip">Va a crear una entrada para el proveedor seleccionado.</string>
<string name="warningEntry">Va a notificar la entrada al dpto de Logística</string>
<string name="sendEntry">Enviar entrada embalajes</string>
<string name="attachImage">"Imágenes: "</string>
</resources> </resources>

View File

@ -739,5 +739,17 @@
<string name="addWorkForm">Añadir…</string> <string name="addWorkForm">Añadir…</string>
<string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string> <string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string>
<string name="quantityReviewed">Cantidad revisada a sumar/restar del total</string>
<string name="deleteEntryReviewed">Borrar entrada</string>
<string name="quantityToReview">Cantidad a revisar</string>
<string name="selectEntryToFill">Selecciona entrada</string>
<string name="entryCreate">Crear entrada</string>
<string name="entryNew">Añadir nueva</string>
<string name="newEntry">Añadir nueva</string>
<string name="createEntry">Crear entrada</string>
<string name="createEntryDescrip">Va a crear una entrada para el proveedor seleccionado.</string>
<string name="warningEntry">Va a notificar la entrada al dpto de Logística</string>
<string name="sendEntry">Enviar entrada embalajes</string>
<string name="attachImage">"Imágenes: "</string>
</resources> </resources>

View File

@ -738,5 +738,17 @@
<string name="imageToSend">Imágenes adjuntas:</string> <string name="imageToSend">Imágenes adjuntas:</string>
<string name="addWorkForm">Añadir...</string> <string name="addWorkForm">Añadir...</string>
<string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string> <string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string>
<string name="quantityReviewed">Cantidad revisada a sumar/restar del total</string>
<string name="deleteEntryReviewed">Borrar entrada</string>
<string name="quantityToReview">Cantidad a revisar</string>
<string name="selectEntryToFill">Selecciona entrada</string>
<string name="entryCreate">Crear entrada</string>
<string name="entryNew">Añadir nueva</string>
<string name="newEntry">Añadir nueva</string>
<string name="createEntry">Crear entrada</string>
<string name="createEntryDescrip">Va a crear una entrada para el proveedor seleccionado.</string>
<string name="warningEntry">Va a notificar la entrada al dpto de Logística</string>
<string name="sendEntry">Enviar entrada embalajes</string>
<string name="attachImage">"Imágenes: "</string>
</resources> </resources>

View File

@ -738,5 +738,17 @@
<string name="imageToSend">Imágenes adjuntas:</string> <string name="imageToSend">Imágenes adjuntas:</string>
<string name="addWorkForm">Añadir…</string> <string name="addWorkForm">Añadir…</string>
<string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string> <string name="itemOlderInfo">¿Estás seguro que quieres parkinear la matricula %1$s? Tienes material mas antiguo en otra ubicación.</string>
<string name="quantityReviewed">Cantidad revisada a sumar/restar del total</string>
<string name="deleteEntryReviewed">Borrar entrada</string>
<string name="quantityToReview">Cantidad a revisar</string>
<string name="selectEntryToFill">Selecciona entrada</string>
<string name="entryCreate">Crear entrada</string>
<string name="entryNew">Añadir nueva</string>
<string name="createEntry">Crear entrada</string>
<string name="newEntry">Añadir nueva</string>
<string name="createEntryDescrip">Va a crear una entrada para el proveedor seleccionado.</string>
<string name="warningEntry">Va a notificar la entrada al dpto de Logística</string>
<string name="sendEntry">Enviar entrada embalajes</string>
<string name="attachImage">Imágenes: </string>
</resources> </resources>