This commit is contained in:
Sergio De la torre 2023-06-06 08:50:14 +02:00
parent 0031abf841
commit 491008a4a3
2 changed files with 25 additions and 8 deletions

View File

@ -41,9 +41,9 @@ class PackagingCountFragment(
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
viewModel.supplier_getItemsSalix( /* viewModel.supplier_getItemsSalix(
2, 1 2, 1
) )*/
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
} }

View File

@ -1,6 +1,8 @@
package es.verdnatura.presentation.view.feature.packaging.fragment package es.verdnatura.presentation.view.feature.packaging.fragment
import android.content.ContentResolver
import android.content.Context import android.content.Context
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
@ -10,7 +12,6 @@ import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener import es.verdnatura.presentation.common.OnPasillerosItemClickListener
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
@ -47,13 +48,28 @@ class SupplierFragment(
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
viewModel.getSuppliers( /* viewModel.getSuppliers(
)*/
val drawableId: Int =
R.drawable.background_test // Reemplaza "mi_drawable" con el nombre de tu recurso Drawable
/* val uri: Uri = Uri.parse(
ContentResolver.SCHEME_ANDROID_RESOURCE + "://" +
context!!.resources.getResourcePackageName(drawableId) + '/' +
context!!.resources.getResourceTypeName(drawableId) + '/' +
context!!.resources.getResourceEntryName(drawableId)
) )
/*val file = File(data.getSign()) val rutaAbsoluta: String = uri.toString()*/
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.getName(), file.name,
RequestBody.create(MediaType.parse("image/png"), file) RequestBody.create(MediaType.parse("image/png"), file)
) )
viewModel.entry_uploadPhotoSalix( viewModel.entry_uploadPhotoSalix(
@ -65,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)
} }
@ -128,7 +144,8 @@ class SupplierFragment(
} }
if (!onBack) { if (!onBack) {
binding.splashProgress.visibility=View.VISIBLE binding.splashProgress.visibility=View.VISIBLE
viewModel.addFromPackaging(getDataInt("SUPPLIERID"), getData("ENTRYTYPE")=="Rec")
//viewModel.addFromPackaging(getDataInt("SUPPLIERID"), getData("ENTRYTYPE")=="Rec")
} }
onBack = false onBack = false