v5.1.3
|
@ -12,8 +12,8 @@ android {
|
|||
applicationId "es.verdnatura"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 19
|
||||
versionName "5.0.19"
|
||||
versionCode 23
|
||||
versionName "5.1.3"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 20 KiB |
|
@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit
|
|||
|
||||
class ApiUtils {
|
||||
companion object {
|
||||
//const val BASE_URL:String = "http://192.168.1.104:8009/"
|
||||
//const val BASE_URL:String = "http://192.168.1.106:8009/"
|
||||
const val BASE_URL:String = "https://app.verdnatura.es/"
|
||||
fun getApiService():VerdnaturaService{
|
||||
val retrofit = Retrofit.Builder()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package es.verdnatura.domain
|
||||
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.SalixMessageVO
|
||||
import retrofit2.Call
|
||||
|
||||
class GetLoginUserCase() : RestClient() {
|
||||
|
@ -13,7 +14,6 @@ class GetLoginUserCase() : RestClient() {
|
|||
}
|
||||
|
||||
fun salixLogin(usuario:String,password:String) : Call<LoginSalixVO>{
|
||||
|
||||
return salixClient!!.login("application/json", LoginSalixVO(usuario,password))
|
||||
}
|
||||
|
||||
|
@ -23,4 +23,8 @@ class GetLoginUserCase() : RestClient() {
|
|||
return restClient!!.version("json","1",usuario,password,"application/json",params)
|
||||
}
|
||||
|
||||
fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
|
||||
return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message))
|
||||
}
|
||||
|
||||
}
|
|
@ -15,6 +15,12 @@ class GetSacadorControladorUserCase : RestClient() {
|
|||
return restClient!!.collectionTicketGet("json","1",usuario,password,"application/json",params)
|
||||
}
|
||||
|
||||
fun collectionNew(usuario:String,password:String,sectorFk:String) : Call<String> {
|
||||
val params:ArrayList<String> = ArrayList();
|
||||
params.add(sectorFk)
|
||||
return restClient!!.collectionNew("json","1",usuario,password,"application/json",params)
|
||||
}
|
||||
|
||||
fun collectionGet(usuario:String,password:String) : Call<List<CollectionVO>> {
|
||||
val params:ArrayList<String> = ArrayList();
|
||||
return restClient!!.collectionGet("json","1",usuario,password,"application/json")
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package es.verdnatura.domain
|
||||
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.SalixMessageVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.Header
|
||||
|
@ -12,4 +13,11 @@ interface SalixService {
|
|||
fun login(@Header("Content-Type") content_type: String,
|
||||
@Body params: LoginSalixVO):
|
||||
Call<LoginSalixVO>
|
||||
|
||||
@POST("chats/sendCheckingPresence")
|
||||
fun sendChekingPresence(
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Header("Authorization") authorization: String,
|
||||
@Body params: SalixMessageVO):
|
||||
Call<Boolean>
|
||||
}
|
|
@ -53,6 +53,8 @@ interface VerdnaturaService {
|
|||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String):
|
||||
Call<List<SectorItemVO>>
|
||||
|
||||
|
||||
//PRESACADORES ========================================================================>
|
||||
|
||||
@POST("almacennew/ticketToPrePrepare")
|
||||
|
@ -76,6 +78,15 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String):
|
||||
Call<List<CollectionVO>>
|
||||
|
||||
@POST("almacennew/collectionNew")
|
||||
fun collectionNew(@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>):
|
||||
Call<String>
|
||||
|
||||
@POST("almacennew/collectionTicketGet")
|
||||
fun collectionTicketGet(@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
|
|
@ -10,7 +10,6 @@ import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
|||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
|
|
|
@ -6,7 +6,6 @@ import android.view.View
|
|||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.*
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ko
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok_two
|
||||
|
|
|
@ -4,11 +4,7 @@ import android.app.Dialog
|
|||
import android.content.Context
|
||||
import android.view.View
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ko
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok_two
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_description
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_title
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.*
|
||||
|
||||
class CustomDialogTwoButtons (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentAjustesBinding
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnAjustesItemClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -60,6 +61,10 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
viewModel.getSectors(user!!,password!!)
|
||||
} else if (item.id == 1){
|
||||
activity!!.onBackPressed()
|
||||
}else if (item.id == 2){
|
||||
"No disponible en esta versión".toast(requireContext())
|
||||
}else if (item.id == 3){
|
||||
"No disponible en esta versión".toast(requireContext())
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -71,7 +76,7 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
splash_progress.visibility = View.INVISIBLE
|
||||
if (it.list != null && it.list.size > 0 && it.list.get(0).isError){
|
||||
customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
|
||||
|
@ -86,7 +91,7 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
|
||||
}else{
|
||||
customDialog.setTitle("Sectores").setDescription("No existes sectores.").setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,20 @@ class AjustesViewModel : BaseViewModel() {
|
|||
0,
|
||||
0)
|
||||
)
|
||||
_ajustesitem.add(
|
||||
AjustesItemVO(2,
|
||||
"Carros",
|
||||
"",
|
||||
0,
|
||||
0)
|
||||
)
|
||||
_ajustesitem.add(
|
||||
AjustesItemVO(3,
|
||||
"Voz",
|
||||
"",
|
||||
0,
|
||||
0)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ class ItemCardFragment(
|
|||
itemcard_layout.visibility = View.GONE
|
||||
toolbar_title.text = "ItemCard"
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (it.id != "0"){
|
||||
|
@ -156,7 +156,7 @@ class ItemCardFragment(
|
|||
itemcard_layout.visibility = View.GONE
|
||||
toolbar_title.text = "ItemCard"
|
||||
customDialog.setTitle("Sin resultados").setDescription("No hemos podido encontrar el articulo. Revisa el sector.").setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ class ItemCardFragment(
|
|||
splash_progress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
})
|
||||
|
@ -208,11 +208,11 @@ class ItemCardFragment(
|
|||
customDialogInput.setTitle(item.title!!).setDescription("Valor actual: "+item.value!!).setOkButton("Guardar"){
|
||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||
editItemCardRow(item,customDialogInput.getValue())
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
|
||||
}.setKoButton("Cancelar"){
|
||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.setValue("").show()
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
|
@ -220,7 +220,7 @@ class ItemCardFragment(
|
|||
if (!customDialogInput.getValue().isNullOrEmpty())
|
||||
editItemCardRow(item,customDialogInput.getValue())
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
|
@ -280,16 +280,16 @@ class ItemCardFragment(
|
|||
customDialogTwo.setTitle(itemB.title!!).setDescription("Indica la causa de eliminar stock:").setOkButton("Falta"){
|
||||
viewModel.itemStockUpdate(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "0")
|
||||
changeOfflineValue(itemB,value, listBarcodes)
|
||||
customDialogTwo.hide()
|
||||
customDialogTwo.dismiss()
|
||||
|
||||
}.setOkButtonTwo("Basura"){
|
||||
viewModel.itemStockUpdate(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "1")
|
||||
changeOfflineValue(itemB,value, listBarcodes)
|
||||
customDialogTwo.hide()
|
||||
customDialogTwo.dismiss()
|
||||
|
||||
}.setKoButton("Cancelar"){
|
||||
|
||||
customDialogTwo.hide()
|
||||
customDialogTwo.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
changeOfflineValue(itemB,value, listBarcodes)
|
||||
|
@ -305,11 +305,11 @@ class ItemCardFragment(
|
|||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
||||
if (!customDialogList.getValue().isNullOrEmpty())
|
||||
updateBarcode(customDialogList.getValue(),"0",itemB)
|
||||
customDialogList.hide()
|
||||
customDialogList.dismiss()
|
||||
|
||||
}.setKoButton("Cerrar"){
|
||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
||||
customDialogList.hide()
|
||||
customDialogList.dismiss()
|
||||
}.setValue("").show()
|
||||
|
||||
|
||||
|
@ -319,7 +319,7 @@ class ItemCardFragment(
|
|||
if (!customDialogList.getValue().isNullOrEmpty())
|
||||
updateBarcode(customDialogList.getValue(),"0",itemB)
|
||||
customDialogList.setValue("")
|
||||
customDialogList.hide()
|
||||
customDialogList.dismiss()
|
||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
|
|
|
@ -77,9 +77,9 @@ class SaleAdapter (
|
|||
//ERROR
|
||||
if (sale.originalQuantity != sale.quantity){
|
||||
layoutError.visibility = View.VISIBLE
|
||||
txtError.text = "Cantidad original: "+sale.quantity
|
||||
txtError.text = "Cantidad original: "+sale.originalQuantity
|
||||
if (sale.isPrepared == "1" || sale.isControlled == "1")
|
||||
sale.pickedQuantity = sale.originalQuantity
|
||||
sale.pickedQuantity = sale.quantity
|
||||
}
|
||||
|
||||
if (sale.isNew){
|
||||
|
|
|
@ -34,6 +34,7 @@ import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
|||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
|
@ -47,6 +48,7 @@ class CollectionFragment(
|
|||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var token = ""
|
||||
private var sales:List<SaleVO> = listOf()
|
||||
private var saleAdapter:SaleAdapter? = null
|
||||
private var lm : LinearLayoutManager? = null
|
||||
|
@ -84,6 +86,7 @@ class CollectionFragment(
|
|||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
token = prefs.getString(TOKEN,"").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
|
@ -313,9 +316,9 @@ class CollectionFragment(
|
|||
fragment_sacador_collections.layoutManager = lm
|
||||
setTotalLines()
|
||||
if (storedPosition != 0)
|
||||
setListPosition(storedPosition)
|
||||
setListPosition(storedPosition,true)
|
||||
else if (storedBackPosition != 0)
|
||||
setListPosition(storedBackPosition)
|
||||
setListPosition(storedBackPosition,true)
|
||||
|
||||
setScrollListener(lm!!)
|
||||
}
|
||||
|
@ -336,7 +339,7 @@ class CollectionFragment(
|
|||
var isOk = false
|
||||
if (type == SACADOR){
|
||||
for (saleVO in sales) {
|
||||
if(saleVO.isPrepared != "1"){
|
||||
if(saleVO.isPrepared != "1" && saleVO.isPreviousPrepared != "1"){
|
||||
//1- Por itemFk
|
||||
if (txtscan == saleVO.itemFk){
|
||||
mpok!!.start()
|
||||
|
@ -347,7 +350,7 @@ class CollectionFragment(
|
|||
//2- Por carro
|
||||
var shelvingIndex = 0
|
||||
for (placementVO in saleVO.placements){
|
||||
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()){
|
||||
if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase() && placementVO.visible != "(0)"){
|
||||
mpok!!.start()
|
||||
isOk = true
|
||||
showShelving(index,shelvingIndex)
|
||||
|
@ -419,7 +422,7 @@ class CollectionFragment(
|
|||
if (type == SACADOR){
|
||||
var saleVO = sales[position]
|
||||
|
||||
if(saleVO.isPrepared != "1"){
|
||||
if(saleVO.isPrepared != "1" && saleVO.isPreviousPrepared != "1"){
|
||||
//1- Por itemFk
|
||||
if (txtscan == saleVO.itemFk){
|
||||
mpok!!.start()
|
||||
|
@ -461,24 +464,28 @@ class CollectionFragment(
|
|||
if (type == SACADOR){
|
||||
sales[position].isPrepared = if (sales[position].isPrepared == "1") "0" else "1"
|
||||
if (sales[position].isPrepared == "1"){
|
||||
sales[position].pickedQuantity = sales[position].originalQuantity
|
||||
sales[position].pickedQuantity = sales[position].quantity
|
||||
}
|
||||
}else if (type == CONTROLADOR)
|
||||
sales[position].isControlled = if (sales[position].isControlled == "1") "0" else "1"
|
||||
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
setListPosition(position)
|
||||
setListPosition(position,false)
|
||||
saleTrackingReplace(position,newType)
|
||||
setTotalLines()
|
||||
}
|
||||
|
||||
private fun setListPosition(position:Int){
|
||||
private fun setListPosition(position:Int,isFromBack:Boolean){
|
||||
storedPosition = position
|
||||
if (type == SACADOR){
|
||||
fragment_sacador_collections.addViewObserver {
|
||||
lm!!.scrollToPositionWithOffset(position,0)
|
||||
}
|
||||
}else if (isFromBack){
|
||||
fragment_sacador_collections.addViewObserver {
|
||||
lm!!.scrollToPositionWithOffset(position,0)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -501,7 +508,7 @@ class CollectionFragment(
|
|||
sales[position].isPrepared = "0"
|
||||
sales[position].pickedQuantity = "0"
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
setListPosition(position)
|
||||
setListPosition(position,false)
|
||||
viewModel.saleTrackingDel(
|
||||
usuario = user,
|
||||
password = password,
|
||||
|
@ -528,7 +535,7 @@ class CollectionFragment(
|
|||
splash_progress.visibility = View.VISIBLE
|
||||
var quantityGet = "0"
|
||||
try{
|
||||
quantityGet = (sales[position].originalQuantity.toInt() - sales[position].pickedQuantity.toInt()).toString()
|
||||
quantityGet = (sales[position].quantity.toInt() - sales[position].pickedQuantity.toInt()).toString()
|
||||
}catch (e:Exception){}
|
||||
viewModel.itemPlacementSupplyAiming(
|
||||
usuario = user,
|
||||
|
@ -563,47 +570,61 @@ class CollectionFragment(
|
|||
var total = "0"
|
||||
var itemShelvingFk = "0"
|
||||
if (!placementSupplyListVO.list.isEmpty()){
|
||||
val placement = placementSupplyListVO.list[0]
|
||||
shelving = placement.shelving
|
||||
item = placement.itemFk
|
||||
longName = placement.longName
|
||||
total = placement.total
|
||||
itemShelvingFk = placement.itemShelvingFk
|
||||
var placement:PlacementSupplyVO? = null
|
||||
placementSupplyListVO.list.forEach { placementVO ->
|
||||
if (placementVO.stock != "0" && placement == null)
|
||||
placement = placementVO
|
||||
}
|
||||
if (placement != null){
|
||||
shelving = placement!!.shelving
|
||||
item = placement!!.itemFk
|
||||
longName = placement!!.longName
|
||||
total = placement!!.total
|
||||
itemShelvingFk = placement!!.itemShelvingFk
|
||||
}
|
||||
|
||||
}
|
||||
listPlacementSupply = ArrayList()
|
||||
placementSupplyListVO.list.forEach {
|
||||
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
||||
if (it.stock != "0")
|
||||
listPlacementSupply.add(BarcodeVO(code = it.proposal))
|
||||
}
|
||||
try {
|
||||
customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton("Coger") {
|
||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||
if (customDialogList.getValue().toInt() > total.toInt()) {
|
||||
"La cantidad supera a la disponible".toast(requireContext())
|
||||
} else {
|
||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
mpok?.start()
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
code = customDialogList.getValueTwo()
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
}
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
}
|
||||
|
||||
customDialogList.setTitle("$shelving($item) $total de $longName").setOkButton("Coger"){
|
||||
if (customDialogList.getValueTwo().isNotEmpty()){
|
||||
if (checkItemScan(customDialogList.getValueTwo())){
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
mpok?.start()
|
||||
customDialogList.dismiss()
|
||||
}else{
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
code = customDialogList.getValueTwo()
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
"Escanea item para validar".toast(requireContext())
|
||||
}
|
||||
|
||||
|
||||
}.setKoButton("Cerrar") {
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
}else{
|
||||
"Escanea item para validar".toast(requireContext())
|
||||
}
|
||||
|
||||
|
||||
}.setKoButton("Cerrar"){
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
customDialogList.dismiss()
|
||||
}.setHintValue("Cantidad que coges:").setValue(total).setHintValueTwo("Escanea item").setValueTwo("").show()
|
||||
|
||||
customDialogList.dismiss()
|
||||
}.setHintValue("Cantidad que coges:").setValue(total).setHintValueTwo("Escanea item")
|
||||
.setValueTwo("").show()
|
||||
}catch (e:Exception){}
|
||||
|
||||
customDialogList.getEditTextTwo().post(Runnable {
|
||||
customDialogList.getEditTextTwo().requestFocusFromTouch()
|
||||
|
@ -611,34 +632,40 @@ class CollectionFragment(
|
|||
activity!!.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
lManager.hideSoftInputFromWindow(customDialogList.getEditTextTwo().windowToken, InputMethodManager.SHOW_FORCED)
|
||||
})
|
||||
try {
|
||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||
if (customDialogList.getValue().toInt() > total.toInt()) {
|
||||
"La cantidad supera a la disponible".toast(requireContext())
|
||||
} else {
|
||||
if (checkItemScan(customDialogList.getValueTwo())) {
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
mpok?.start()
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
code = customDialogList.getValueTwo()
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (customDialogList.getValueTwo().isNotEmpty()){
|
||||
if (checkItemScan(customDialogList.getValueTwo())){
|
||||
onQuantityOfShelvingSelected(itemShelvingFk)
|
||||
mpok?.start()
|
||||
customDialogList.dismiss()
|
||||
}else{
|
||||
itemShelvingFkStored = itemShelvingFk
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
code = customDialogList.getValueTwo()
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
} else {
|
||||
"Escanea item para validar".toast(requireContext())
|
||||
}
|
||||
}else{
|
||||
"Escanea item para validar".toast(requireContext())
|
||||
}
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
|
||||
}
|
||||
false
|
||||
}
|
||||
false
|
||||
}
|
||||
}catch (e:Exception){}
|
||||
|
||||
placementSupplyAdapter = BarcodeAdapter(listPlacementSupply,object: OnBarcodeRowClickListener {
|
||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||
|
@ -696,7 +723,7 @@ class CollectionFragment(
|
|||
}catch (e:Exception){}
|
||||
|
||||
//3- MARCAR LINEA
|
||||
if (sales[storedPosition].pickedQuantity != sales[storedPosition].originalQuantity){
|
||||
if (sales[storedPosition].pickedQuantity != sales[storedPosition].quantity){
|
||||
sales[storedPosition].isPrepared = "1"
|
||||
markLine(storedPosition, OK)
|
||||
}else{
|
||||
|
@ -930,16 +957,16 @@ class CollectionFragment(
|
|||
private fun split(position: Int,quantity:String){
|
||||
var totalQuantity: Int = 0
|
||||
try {
|
||||
totalQuantity = sales[position].originalQuantity.toInt() - quantity.toInt()
|
||||
totalQuantity = sales[position].quantity.toInt() - quantity.toInt()
|
||||
}catch (e:Exception){}
|
||||
viewModel.saleMove(
|
||||
usuario = user,
|
||||
password = password,
|
||||
saleFk = sales[position].saleFk,
|
||||
quantity = totalQuantity.toString(),
|
||||
originalQuantity = quantity
|
||||
originalQuantity = sales[position].quantity
|
||||
)
|
||||
sales[position].originalQuantity = quantity
|
||||
//sales[position].originalQuantity = quantity
|
||||
sales[position].quantity = quantity
|
||||
//sales[position].startQuantity = quantity
|
||||
|
||||
|
@ -948,12 +975,18 @@ class CollectionFragment(
|
|||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
|
||||
//enviar mensaje a salix
|
||||
val ticket = "[" + sales[position].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].ticketFk + "/summary)"
|
||||
val message = "Se ha enviado a Split el articulo "+sales[position].itemFk+" del ticket "+ticket
|
||||
viewModel.sendChekingPresence(token = token,workerId = sales[position].salePersonFk,message = message)
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun trash(position: Int,quantity:String){
|
||||
var totalQuantity: Int = 0
|
||||
try {
|
||||
totalQuantity = sales[position].originalQuantity.toInt() - quantity.toInt()
|
||||
totalQuantity = sales[position].quantity.toInt() - quantity.toInt()
|
||||
}catch (e:Exception){}
|
||||
viewModel.collectionMissingTrash(
|
||||
usuario = user,
|
||||
|
@ -964,18 +997,24 @@ class CollectionFragment(
|
|||
type = "FALSE",
|
||||
originalQuantity = quantity
|
||||
)
|
||||
sales[position].originalQuantity = quantity
|
||||
//sales[position].originalQuantity = quantity
|
||||
sales[position].quantity = quantity
|
||||
//sales[position].startQuantity = quantity
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
if (quantity == "0")
|
||||
markLine(position,type)
|
||||
|
||||
|
||||
//enviar mensaje a salix
|
||||
val ticket = "[" + sales[position].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].ticketFk + "/summary)"
|
||||
val message = "Se ha enviado a Faltas el articulo "+sales[position].itemFk+" del ticket "+ticket
|
||||
viewModel.sendChekingPresence(token = token,workerId = sales[position].salePersonFk,message = message)
|
||||
}
|
||||
|
||||
private fun missing(position: Int,quantity:String){
|
||||
var totalQuantity: Int = 0
|
||||
try {
|
||||
totalQuantity = sales[position].originalQuantity.toInt() - quantity.toInt()
|
||||
totalQuantity = sales[position].quantity.toInt() - quantity.toInt()
|
||||
}catch (e:Exception){}
|
||||
viewModel.collectionMissingTrash(
|
||||
usuario = user,
|
||||
|
@ -986,13 +1025,19 @@ class CollectionFragment(
|
|||
type = "TRUE",
|
||||
originalQuantity = quantity
|
||||
)
|
||||
sales[position].originalQuantity = quantity
|
||||
//sales[position].originalQuantity = quantity
|
||||
sales[position].quantity = quantity
|
||||
//sales[position].startQuantity = quantity
|
||||
|
||||
if (quantity == "0")
|
||||
markLine(position,type)
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
|
||||
//enviar mensaje a salix
|
||||
val ticket = "[" + sales[position].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].ticketFk + "/summary)"
|
||||
val message = "Se ha enviado a Basura el articulo "+sales[position].itemFk+" del ticket "+ticket
|
||||
viewModel.sendChekingPresence(token = token,workerId = sales[position].salePersonFk,message = message)
|
||||
}
|
||||
|
||||
private fun increaseQuantity(position:Int,quantity:String){
|
||||
|
@ -1002,20 +1047,19 @@ class CollectionFragment(
|
|||
saleFk = sales[position].saleFk,
|
||||
quantity = quantity
|
||||
)
|
||||
try {
|
||||
val quantityPicked = (quantity.toInt() - sales[position].quantity.toInt()).toString()
|
||||
sales[position].originalQuantity = quantity
|
||||
sales[position].quantity = quantity
|
||||
if (type == CONTROLADOR){
|
||||
showShelving(position,0,quantityPicked)
|
||||
}
|
||||
try {
|
||||
//val quantityPicked = (quantity.toInt() - sales[position].quantity.toInt()).toString()
|
||||
//sales[position].originalQuantity = quantity
|
||||
sales[position].quantity = quantity
|
||||
/*if (type == CONTROLADOR){
|
||||
showShelving(position,0,quantityPicked)
|
||||
}*/
|
||||
}catch (e:Exception){}
|
||||
saleAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
||||
//ESTADOS
|
||||
|
||||
private fun changeTicketState(){
|
||||
if (type == CONTROLADOR){
|
||||
viewModel.collectionUpdateState(
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetLoginUserCase
|
||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||
import es.verdnatura.domain.GetShelvingParkingUserCase
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
import es.verdnatura.presentation.view.feature.login.model.SalixMessageVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
|
@ -22,6 +24,7 @@ class CollectionViewModel : BaseViewModel() {
|
|||
|
||||
private val getSacadorControladorUserCase: GetSacadorControladorUserCase = GetSacadorControladorUserCase()
|
||||
private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase()
|
||||
private val getLoginUserCase: GetLoginUserCase = GetLoginUserCase()
|
||||
|
||||
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
||||
val collectionTicketList: LiveData<CollectionVO>
|
||||
|
@ -288,4 +291,19 @@ class CollectionViewModel : BaseViewModel() {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun sendChekingPresence(token:String,workerId:String,message:String){
|
||||
try{
|
||||
getLoginUserCase.sendChekingPresence(token,workerId.toInt(),message).enqueue(object : Callback<Boolean>{
|
||||
override fun onResponse(call: Call<Boolean>, response: Response<Boolean>) {
|
||||
Log.i("Salix","Mensaje enviado a salix")
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<Boolean>, t: Throwable) {
|
||||
Log.i("Salix Error",""+t.message)
|
||||
}
|
||||
})
|
||||
}catch (e:Exception){}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.collection.mapper
|
|||
|
||||
import es.verdnatura.presentation.common.convertToDateString
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import java.lang.NumberFormatException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
@ -12,6 +11,7 @@ fun CollectionVO.map() : CollectionVO{
|
|||
ticket.sales.forEach {
|
||||
it.ticketFk = ticket.ticketFk
|
||||
it.level = ticket.level
|
||||
it.salePersonFk = ticket.salesPersonFk
|
||||
it.agencyName = ticket.agencyName
|
||||
it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))
|
||||
it.isNew = it.isAdded == "1"
|
||||
|
@ -33,7 +33,7 @@ fun CollectionVO.map() : CollectionVO{
|
|||
}
|
||||
placement.created =
|
||||
getCalendarFromDate(placement.created).convertToDateString()
|
||||
placement.visible = "(" + placement.visible + ")"
|
||||
placement.visible = "(" + (if(placement.visible.toInt() > 0) placement.visible else "0") + ")"
|
||||
}
|
||||
} else {
|
||||
it.placements = listOf()
|
||||
|
@ -43,7 +43,7 @@ fun CollectionVO.map() : CollectionVO{
|
|||
}
|
||||
}catch (e:Exception){
|
||||
this.isError = true
|
||||
this.errorMessage = "La colección no tiene tickets"
|
||||
this.errorMessage = "Error al construir la colección"
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
splash_progress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (!goBack)navigateToCollectionList(it)
|
||||
|
|
|
@ -146,9 +146,9 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
customDialogInput.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){
|
||||
viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0")
|
||||
changeOfflineValue(item)
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.setValue("0").show()
|
||||
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
|
@ -159,7 +159,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
changeOfflineValue(item)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
})
|
||||
|
|
|
@ -156,9 +156,9 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
customDialogInput.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){
|
||||
viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0")
|
||||
changeOfflineValue(item)
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.setValue("0").show()
|
||||
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
|
@ -169,7 +169,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
changeOfflineValue(item)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
})
|
||||
|
|
|
@ -57,7 +57,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding,LoginViewModel> (LoginVi
|
|||
splash_progress.visibility = View.INVISIBLE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
|
@ -78,7 +78,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding,LoginViewModel> (LoginVi
|
|||
if (it.isError){
|
||||
saveTokenPref("")
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage+". Puedes continuar pero algunas funcionalidades no estarán disponibles.").setOkButton("Entendido"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
getVersion()
|
||||
}.show()
|
||||
}else{
|
||||
|
@ -90,12 +90,13 @@ class LoginFragment : BaseFragment<FragmentLoginBinding,LoginViewModel> (LoginVi
|
|||
version.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = View.INVISIBLE
|
||||
if (it){
|
||||
customDialog.setTitle("Atención").setDescription("La aplicación se encuentra en fase de desarrollo. Algunas funcionalidades están desactivadas y se van a ir añadiendo de forma progresiva.").setOkButton("Entrar"){
|
||||
/* customDialog.setTitle("Atención").setDescription("La aplicación se encuentra en fase de desarrollo. Algunas funcionalidades están desactivadas y se van a ir añadiendo de forma progresiva.").setOkButton("Entrar"){
|
||||
goToMain()
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialog.hide()
|
||||
}.show()
|
||||
customDialog.dismiss()
|
||||
}.show()*/
|
||||
goToMain()
|
||||
|
||||
}else{
|
||||
customDialog.setTitle("Actualizar").setDescription("Existe una versión nueva, es recomendable actualizar.").setOkButton("Actualizar"){
|
||||
|
@ -103,7 +104,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding,LoginViewModel> (LoginVi
|
|||
openURL.data = Uri.parse("https://app.verdnatura.es/bin/vn-pickingV2.apk")
|
||||
startActivity(openURL)
|
||||
}.setKoButton("Omitir"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
goToMain()
|
||||
}.show()
|
||||
}
|
||||
|
|
|
@ -53,9 +53,6 @@ class LoginViewModel() : BaseViewModel() {
|
|||
}
|
||||
|
||||
fun loginSalix(user:String,password:String){
|
||||
val loginSalixVO = LoginSalixVO(user,password, "aaa")
|
||||
_loginsalixitem.value = loginSalixVO
|
||||
/*
|
||||
getLoginUserCase.salixLogin(user,password).enqueue(object : Callback<LoginSalixVO>{
|
||||
override fun onResponse(call: Call<LoginSalixVO>, response: Response<LoginSalixVO>) {
|
||||
|
||||
|
@ -73,7 +70,7 @@ class LoginViewModel() : BaseViewModel() {
|
|||
val loginSalixVO = LoginSalixVO(user,password, "",isError = true,errorMessage = t.message!!)
|
||||
_loginsalixitem.value = loginSalixVO
|
||||
}
|
||||
})*/
|
||||
})
|
||||
}
|
||||
|
||||
fun checkVersion(user:String,password:String,version:String){
|
||||
|
|
|
@ -12,4 +12,12 @@ class LoginSalixVO (
|
|||
val token:String = "",
|
||||
var isError:Boolean = false,
|
||||
var errorMessage:String = ""
|
||||
)
|
||||
|
||||
class SalixMessageVO (
|
||||
val workerId:Int = 0,
|
||||
val message:String = "",
|
||||
val token:String = "",
|
||||
var isError:Boolean = false,
|
||||
var errorMessage:String = ""
|
||||
)
|
|
@ -8,7 +8,6 @@ import androidx.fragment.app.Fragment
|
|||
import androidx.fragment.app.FragmentManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ActivityMainBinding
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseActivity
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -216,10 +215,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClick
|
|||
fm.popBackStackImmediate()
|
||||
}else {
|
||||
customDialog.setTitle("Cerrar sesión").setDescription("¿Estás seguro de cerrar la sesión?").setOkButton("Salir"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
finish()
|
||||
}.setKoButton("Cancelar") {
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
|
|
@ -3,17 +3,10 @@ package es.verdnatura.presentation.view.feature.paletizador.adapter
|
|||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ItemExpeditionpalletRowBinding
|
||||
import es.verdnatura.databinding.ItemExpeditionscanRowBinding
|
||||
import es.verdnatura.presentation.common.OnComprobarPalletViewClickListener
|
||||
import es.verdnatura.presentation.common.OnPalletClickListener
|
||||
import es.verdnatura.presentation.common.OnScanLongClickListener
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
|
||||
class ExpeditionScanAdapter (
|
||||
private val items: List<ItemExpeditionScanVO>,
|
||||
|
|
|
@ -3,40 +3,28 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionPalletBinding
|
||||
import es.verdnatura.databinding.FragmentExpeditionPalletDetailBinding
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.OnPalletClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
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.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionPalletAdapter
|
||||
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionPalletViewAdapter
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.*
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewListVO
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_pallet_detail.*
|
||||
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class ExpeditionPalletDetailFragment(
|
||||
|
@ -147,7 +135,7 @@ class ExpeditionPalletDetailFragment(
|
|||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
activity!!.onBackPressed()
|
||||
|
|
|
@ -7,7 +7,8 @@ import es.verdnatura.domain.GetPaletizadoresUserCase
|
|||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.*
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewListVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
|
|
@ -17,7 +17,6 @@ import es.verdnatura.presentation.common.OnComprobarPalletViewClickListener
|
|||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.OnPalletClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogHour
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
|
@ -135,7 +134,7 @@ class ExpeditionPalletFragment(
|
|||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
})
|
||||
|
@ -171,11 +170,11 @@ class ExpeditionPalletFragment(
|
|||
ItemPalletVO(Pallet = it.list.get(0).palletFk))
|
||||
}else{
|
||||
customDialog.setTitle("Atención").setDescription("No ha escaneado expediciones").setOkButton("Ok"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
customDialogList.hide()
|
||||
customDialogList.dismiss()
|
||||
|
||||
|
||||
}.setKoButton("Cerrar"){
|
||||
|
@ -183,7 +182,7 @@ class ExpeditionPalletFragment(
|
|||
splash_progress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk)
|
||||
listExpeditions = ArrayList()
|
||||
customDialogList.hide()
|
||||
customDialogList.dismiss()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogList.getEditText().requestFocus()
|
||||
|
|
|
@ -3,18 +3,12 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionPalletBinding
|
||||
import es.verdnatura.databinding.FragmentExpeditionScanBinding
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
@ -26,16 +20,13 @@ 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.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionPalletAdapter
|
||||
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionScanAdapter
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.*
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_scan.*
|
||||
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class ExpeditionScanFragment (
|
||||
|
@ -142,7 +133,7 @@ class ExpeditionScanFragment (
|
|||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
})
|
||||
|
@ -150,7 +141,7 @@ class ExpeditionScanFragment (
|
|||
responseDeleteScan.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
|
||||
|
@ -170,9 +161,9 @@ class ExpeditionScanFragment (
|
|||
.setOkButton("Borrar"){
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanDel(user,password,itemExpeditionScanVO.id)
|
||||
customDialogTwoButtons.hide()
|
||||
customDialogTwoButtons.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogTwoButtons.hide()
|
||||
customDialogTwoButtons.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
@ -206,17 +197,17 @@ class ExpeditionScanFragment (
|
|||
)
|
||||
}else{
|
||||
customDialog.setTitle("Atención").setDescription("No ha escaneado expediciones").setOkButton("Ok"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
customDialogList.hide()
|
||||
customDialogList.dismiss()
|
||||
|
||||
|
||||
}.setKoButton("Cerrar"){
|
||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
||||
listExpeditions = ArrayList()
|
||||
customDialogList.hide()
|
||||
customDialogList.dismiss()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogList.getEditText().requestFocus()
|
||||
|
|
|
@ -3,12 +3,14 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import androidx.lifecycle.ViewModel
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.*
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanList
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanList
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
|
|
@ -74,7 +74,7 @@ class ParkingFragment : BaseFragment<FragmentParkingBinding,ParkingViewModel>(Pa
|
|||
mperror?.start()
|
||||
splash_progress.visibility = View.GONE
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
numParking -= 1
|
||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.presacador.adapter
|
|||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -10,10 +9,8 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ItemArticleRowBinding
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||
import es.verdnatura.presentation.view.feature.collection.adapter.PlacementAdapter
|
||||
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapter
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.presacador.mapper.toSale
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
|
|
|
@ -14,10 +14,12 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentPreSacadorBinding
|
||||
import es.verdnatura.domain.ConstAndValues.PRESACADOR
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
|
@ -31,8 +33,6 @@ import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
|||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_pre_sacador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import es.verdnatura.domain.ConstAndValues.PRESACADOR
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
|
||||
class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorViewModel>(PreSacadorViewModel::class) {
|
||||
private var user = ""
|
||||
|
@ -560,11 +560,11 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
|||
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||
val iconPrint : Drawable = resources.getDrawable(R.drawable.ic_print_black_24dp,resources.newTheme())
|
||||
val iconParking : Drawable = resources.getDrawable(R.drawable.ic_local_parking_black_24dp,resources.newTheme())
|
||||
val iconTransferir : Drawable = resources.getDrawable(R.drawable.ic_swap_horiz_black_24dp,resources.newTheme())
|
||||
//val iconTransferir : Drawable = resources.getDrawable(R.drawable.ic_swap_horiz_black_24dp,resources.newTheme())
|
||||
|
||||
listIcons.add(iconPrint)
|
||||
listIcons.add(iconParking)
|
||||
listIcons.add(iconTransferir)
|
||||
//listIcons.add(iconTransferir)
|
||||
|
||||
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
@ -572,8 +572,6 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
|||
print()
|
||||
}else if (item == iconParking){
|
||||
pasillerosItemClickListener?.onPasillerosItemClickListener(PasillerosItemVO(title = "Parking"),"")
|
||||
}else if (item == iconTransferir){
|
||||
"Transferir".toast(requireContext())
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -19,9 +19,6 @@ import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter
|
|||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(SacadorViewModel::class) {
|
||||
|
||||
|
@ -84,7 +81,7 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if(item == iconAdd){
|
||||
splash_progress_two.visibility = View.VISIBLE
|
||||
viewModel.collectionTicketGet(user,password,"",sectorFk,"1")
|
||||
viewModel.collectionNew(user,password,sectorFk)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -106,16 +103,27 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
|||
createCollectionList(it.list)
|
||||
goBack2 = false
|
||||
})
|
||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||
/* collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress_two.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (!goBack)navigateToCollectionList(it)
|
||||
}
|
||||
goBack = false
|
||||
})*/
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress_two.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (!goBack)addCollectionToList(it.response)
|
||||
}
|
||||
goBack = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -132,6 +140,23 @@ class SacadorFragment : BaseFragment<FragmentSacadorBinding,SacadorViewModel>(Sa
|
|||
|
||||
}
|
||||
|
||||
private fun addCollectionToList(collection:String){
|
||||
var isNew = true
|
||||
collectionsList.forEach {
|
||||
if (it.collectionFk == collection){
|
||||
isNew = false
|
||||
}
|
||||
}
|
||||
if (isNew){
|
||||
collectionsList.add(CollectionVO(collectionFk = collection,created = "Nuevo"))
|
||||
adapter?.notifyDataSetChanged()
|
||||
}else{
|
||||
customDialog.setTitle("Atención").setDescription("La colección "+collection+" sigue pendiente de preparar").setOkButton("Aceptar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun navigateToCollectionList(collection:CollectionVO){
|
||||
collectionsList.add(collection)
|
||||
adapter?.notifyDataSetChanged()
|
||||
|
|
|
@ -5,6 +5,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
import es.verdnatura.presentation.view.feature.sacador.mapper.toDateFormat
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionListVO
|
||||
|
@ -27,6 +28,10 @@ class SacadorViewModel : BaseViewModel() {
|
|||
val collectionTicketList: LiveData<CollectionVO>
|
||||
get() = _collectionTicketList
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
|
||||
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,print:String){
|
||||
getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,print).enqueue(object :
|
||||
|
@ -47,6 +52,25 @@ class SacadorViewModel : BaseViewModel() {
|
|||
})
|
||||
}
|
||||
|
||||
fun collectionNew(usuario:String,password:String,sectorFk:String){
|
||||
getSacadorControladorUserCase.collectionNew(usuario,password,sectorFk).enqueue(object :
|
||||
Callback<String> {
|
||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||
}
|
||||
override fun onResponse(
|
||||
call: Call<String>,
|
||||
response: Response<String>
|
||||
) {
|
||||
if (response.body() != null){
|
||||
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||
}else{
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionNew")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun collectionGet(usuario:String,password:String){
|
||||
getSacadorControladorUserCase.collectionGet(usuario,password).enqueue(object :
|
||||
Callback<List<CollectionVO>> {
|
||||
|
|
|
@ -16,6 +16,7 @@ class TicketVO(
|
|||
var ticketFk : String = "",
|
||||
var level : String = "",
|
||||
var agencyName : String = "",
|
||||
var salesPersonFk : String = "",
|
||||
var sales : List<SaleVO> = listOf()
|
||||
)
|
||||
class SaleVO(
|
||||
|
@ -49,7 +50,8 @@ class SaleVO(
|
|||
var workerFk : String = "",
|
||||
var placements : List<PlacementVO> = listOf(),
|
||||
var Barcodes : List<String> = listOf(),
|
||||
var isNew : Boolean = false
|
||||
var isNew : Boolean = false,
|
||||
var salePersonFk : String = ""
|
||||
)
|
||||
|
||||
class PlacementVO(
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package es.verdnatura.presentation.view.feature.transferencia.fragment
|
||||
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentTransferenciaBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
||||
class TransferenciaFragment : BaseFragment<FragmentTransferenciaBinding,TransferenciaViewModel>(TransferenciaViewModel::class) {
|
||||
|
||||
companion object {
|
||||
fun newInstance() = TransferenciaFragment()
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_transferencia
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package es.verdnatura.presentation.view.feature.transferencia.fragment
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class TransferenciaViewModel : BaseViewModel() {
|
||||
|
||||
private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase()
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
fun itemShelvingTransfer(usuario:String,password:String,itemFk:String,shelvingFk:String){
|
||||
getUbicadorUserCase.itemShelvingTransfer(usuario,password,itemFk,shelvingFk).enqueue(object :
|
||||
Callback<String> {
|
||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage ="Error al guardar item: "+itemFk+ " Respuesta:"+t.message!!)
|
||||
}
|
||||
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||
if (response.body() == null){
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelvingTransfer")
|
||||
}else{
|
||||
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -58,6 +58,9 @@ class UbicadorAdapter (
|
|||
moreImg.setOnClickListener {
|
||||
onMoreClickListener.onMoreClickListener(item)
|
||||
}
|
||||
namelayout.setOnClickListener {
|
||||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = "Consultar artículo"),item.item)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ class AutomaticAddItemFragment(
|
|||
splash_progress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
activity!!.onBackPressed()
|
||||
|
|
|
@ -152,9 +152,9 @@ class UbicadorFragment(
|
|||
parking = customDialogInput.getValue()
|
||||
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking + " E: "+etiquetas
|
||||
mpok!!.start()
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.show()
|
||||
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
|
@ -163,7 +163,7 @@ class UbicadorFragment(
|
|||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue())
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
parking = customDialogInput.getValue()
|
||||
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas
|
||||
mpok!!.start()
|
||||
|
@ -180,9 +180,9 @@ class UbicadorFragment(
|
|||
shelvingFk = customDialogInput.getValue()
|
||||
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas
|
||||
mpok!!.start()
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
}.show()
|
||||
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
|
@ -191,7 +191,7 @@ class UbicadorFragment(
|
|||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue())
|
||||
customDialogInput.hide()
|
||||
customDialogInput.dismiss()
|
||||
shelvingFk = customDialogInput.getValue()
|
||||
toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas
|
||||
mpok!!.start()
|
||||
|
@ -210,9 +210,9 @@ class UbicadorFragment(
|
|||
it.visible = "0"
|
||||
}
|
||||
adapter!!.notifyDataSetChanged()
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
||||
|
||||
|
@ -243,36 +243,7 @@ class UbicadorFragment(
|
|||
|
||||
},onMoreClickListener = object: OnMoreClickListener{
|
||||
override fun onMoreClickListener(item: ItemUbicadorVO) {
|
||||
customDialogTwoButtons.setTitle(item.item).setDescription("Selecciona una acción").setOkButton("Transferir"){
|
||||
customDialogInput.setTitle("Nueva matrícula").setDescription("Introduce el destino para item: "+item.item).setValue("").setOkButton("Transferir"){
|
||||
viewModel.itemShelvingTransfer(user,password,item.id,customDialogInput.getValue())
|
||||
listItems.remove(item)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
customDialogInput.hide()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogInput.hide()
|
||||
}.show()
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
viewModel.itemShelvingTransfer(user,password,item.id,customDialogInput.getValue())
|
||||
listItems.remove(item)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
customDialogInput.hide()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
customDialogTwoButtons.hide()
|
||||
}.setOkButtonTwo("Eliminar"){
|
||||
listItems.remove(item)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
viewModel.itemShelvingDelete(user,password,item.id)
|
||||
customDialogTwoButtons.hide()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogTwoButtons.hide()
|
||||
}.show()
|
||||
showMoreOptions(item)
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -287,7 +258,7 @@ class UbicadorFragment(
|
|||
if (it.isError){
|
||||
mperror!!.start()
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
})
|
||||
|
@ -317,7 +288,7 @@ class UbicadorFragment(
|
|||
}
|
||||
saveNewItem(customDialogUbicador.getItemValue(),customDialogUbicador.getEtiquetaValue(),customDialogUbicador.getPackingValue(),customDialogUbicador.getVisibleValue(),if (delete)packingUpdate else null)
|
||||
}.setKoButton("Cerrar"){
|
||||
customDialogUbicador.hide()
|
||||
customDialogUbicador.dismiss()
|
||||
}.show()
|
||||
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
|
@ -368,7 +339,7 @@ class UbicadorFragment(
|
|||
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.hide()
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()){
|
||||
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
||||
|
@ -377,7 +348,7 @@ class UbicadorFragment(
|
|||
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.hide()
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
}else{
|
||||
"Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
||||
|
@ -389,7 +360,7 @@ class UbicadorFragment(
|
|||
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.hide()
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
}else if(!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty() && updatePacking){
|
||||
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
||||
|
@ -398,7 +369,7 @@ class UbicadorFragment(
|
|||
customDialogUbicador.setItemValue("").setPackingValue("").setEtiquetaValue("").setVisibleValue("")
|
||||
customDialogUbicador.getEditItem().requestFocus()
|
||||
(activity as MainActivity).hideKeyboard(customDialogUbicador.getEditItem())
|
||||
customDialogUbicador.hide()
|
||||
customDialogUbicador.dismiss()
|
||||
|
||||
}else{
|
||||
"Rellena campos obligatorios".toast((activity as MainActivity), Toast.LENGTH_LONG)
|
||||
|
@ -437,4 +408,44 @@ class UbicadorFragment(
|
|||
listItems.add(item)
|
||||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
private fun showMoreOptions(item:ItemUbicadorVO){
|
||||
customDialogTwoButtons.setTitle(item.item).setDescription("Selecciona una acción").setOkButton("Transferir"){
|
||||
customDialogInput.setTitle("Nueva matrícula").setDescription("Introduce el destino para item: "+item.item).setValue("").setOkButton("Transferir"){
|
||||
viewModel.itemShelvingTransfer(user,password,item.id,customDialogInput.getValue())
|
||||
listItems.remove(item)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
customDialogInput.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogInput.dismiss()
|
||||
}.show()
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
(activity as MainActivity).hideKeyboard(customDialogInput.getEditText())
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
viewModel.itemShelvingTransfer(user,password,item.id,customDialogInput.getValue())
|
||||
listItems.remove(item)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
customDialogInput.dismiss()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
customDialogTwoButtons.dismiss()
|
||||
}.setOkButtonTwo("Eliminar"){
|
||||
customDialog.setTitle("Confirmar").setDescription("Confirmas eliminar el artículo: "+item.item+"?").setOkButton("Eliminar"){
|
||||
listItems.remove(item)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
viewModel.itemShelvingDelete(user,password,item.id)
|
||||
customDialogTwoButtons.dismiss()
|
||||
customDialog.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialog.dismiss()
|
||||
customDialogTwoButtons.dismiss()
|
||||
}.show()
|
||||
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogTwoButtons.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
|
@ -4,27 +4,6 @@
|
|||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
<path android:fillColor="#ffffff" android:pathData="M8.55,12c-1.07,-0.71 -2.25,-1.27 -3.53,-1.61 1.28,0.34 2.46,0.9 3.53,1.61zM18.98,10.39c-1.29,0.34 -2.49,0.91 -3.57,1.64 1.08,-0.73 2.28,-1.3 3.57,-1.64z"/>
|
||||
<path android:fillColor="#ffffff" android:pathData="M15.49,9.63c-0.18,-2.79 -1.31,-5.51 -3.43,-7.63 -2.14,2.14 -3.32,4.86 -3.55,7.63 1.28,0.68 2.46,1.56 3.49,2.63 1.03,-1.06 2.21,-1.94 3.49,-2.63zM8.99,12.28c-0.14,-0.1 -0.3,-0.19 -0.45,-0.29 0.15,0.11 0.31,0.19 0.45,0.29zM15.41,12.03c-0.13,0.09 -0.27,0.16 -0.4,0.26 0.13,-0.1 0.27,-0.17 0.4,-0.26zM12,15.45C9.85,12.17 6.18,10 2,10c0,5.32 3.36,9.82 8.03,11.49 0.63,0.23 1.29,0.4 1.97,0.51 0.68,-0.12 1.33,-0.29 1.97,-0.51C18.64,19.82 22,15.32 22,10c-4.18,0 -7.85,2.17 -10,5.45z"/>
|
||||
</vector>
|
|
@ -5,166 +5,7 @@
|
|||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:fillColor="#F7931E"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
|
||||
</vector>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#607D8B" android:pathData="M8.55,12c-1.07,-0.71 -2.25,-1.27 -3.53,-1.61 1.28,0.34 2.46,0.9 3.53,1.61zM18.98,10.39c-1.29,0.34 -2.49,0.91 -3.57,1.64 1.08,-0.73 2.28,-1.3 3.57,-1.64z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="M15.49,9.63c-0.18,-2.79 -1.31,-5.51 -3.43,-7.63 -2.14,2.14 -3.32,4.86 -3.55,7.63 1.28,0.68 2.46,1.56 3.49,2.63 1.03,-1.06 2.21,-1.94 3.49,-2.63zM8.99,12.28c-0.14,-0.1 -0.3,-0.19 -0.45,-0.29 0.15,0.11 0.31,0.19 0.45,0.29zM15.41,12.03c-0.13,0.09 -0.27,0.16 -0.4,0.26 0.13,-0.1 0.27,-0.17 0.4,-0.26zM12,15.45C9.85,12.17 6.18,10 2,10c0,5.32 3.36,9.82 8.03,11.49 0.63,0.23 1.29,0.4 1.97,0.51 0.68,-0.12 1.33,-0.29 1.97,-0.51C18.64,19.82 22,15.32 22,10c-4.18,0 -7.85,2.17 -10,5.45z"/>
|
||||
</vector>
|
|
@ -0,0 +1,164 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.transferencia.fragment.TransferenciaViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_margin="@dimen/default_layout_margin"
|
||||
android:paddingTop="@dimen/toolbar_height">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView13"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Escanear etiqueta:"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editText7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/verdnatura_white"
|
||||
android:ems="10"
|
||||
android:hint="etiqueta"
|
||||
android:inputType="number"
|
||||
android:padding="8dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/numEtiquetas"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/verdnatura_white"
|
||||
android:ems="10"
|
||||
android:hint="cantidad"
|
||||
android:inputType="number"
|
||||
android:padding="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView19"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Carro de origen:"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editText10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:background="@color/verdnatura_white"
|
||||
android:padding="8dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:hint="carro de origen"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView21"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Carro destino:"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editText11"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:background="@color/verdnatura_white"
|
||||
android:padding="8dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:hint="carro destino"/>
|
||||
|
||||
<Button
|
||||
style="@style/DefaultButton"
|
||||
android:id="@+id/button15"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Transferir"
|
||||
android:background="@drawable/btn_orange"
|
||||
android:layout_marginTop="20dp"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:onClick="transferir"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/main_toolbar"
|
||||
layout="@layout/toolbar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/splash_progress"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/verdnatura_black_8_alpha_6"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:gravity="center">
|
||||
|
||||
<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>
|
||||
</layout>
|
|
@ -12,7 +12,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
style="@style/LayoutClickable">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -170,7 +170,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||
android:text="@{sale.originalQuantity}"
|
||||
android:text="@{sale.quantity}"
|
||||
tool:text="10"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/h6"
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
style="@style/LayoutClickable">
|
||||
<LinearLayout
|
||||
android:id="@+id/item_row_layout"
|
||||
android:orientation="horizontal"
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
style="@style/LayoutClickable">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
style="@style/LayoutClickable">
|
||||
<LinearLayout
|
||||
android:id="@+id/item_row_layout"
|
||||
android:orientation="horizontal"
|
||||
|
|
|
@ -43,9 +43,11 @@
|
|||
/>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<LinearLayout
|
||||
android:id="@+id/namelayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
style="@style/LayoutClickable">
|
||||
<TextView
|
||||
android:id="@+id/itemfk_text"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 998 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#F7931E</color>
|
||||
</resources>
|
|
@ -0,0 +1,154 @@
|
|||
|
||||
|
||||
//AJUSTES ======================================================================================================>
|
||||
|
||||
@POST("almacennew/sector_get")
|
||||
|
||||
//PRESACADORES ================================================================================================>
|
||||
|
||||
@POST("almacennew/ticketToPrePrepare")
|
||||
|
||||
|
||||
//SACADORES / CONTROLADORES ====================================================================================>
|
||||
|
||||
@POST("almacennew/collectionGet")
|
||||
|
||||
|
||||
@POST("almacennew/collectionTicketGet")
|
||||
|
||||
|
||||
@POST("almacennew/saleTrackingReplace")
|
||||
|
||||
|
||||
@POST("almacennew/itemPlacementSupplyAiming")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingSaleSupplyAdd")
|
||||
|
||||
|
||||
@POST("almacennew/collectionStickerPrint")
|
||||
|
||||
|
||||
@POST("almacennew/itemGetAvailable")
|
||||
|
||||
|
||||
@POST("almacennew/collectionAddItem")
|
||||
|
||||
|
||||
@POST("almacennew/saleMove")
|
||||
|
||||
|
||||
@POST("almacennew/collectionMissingTrash")
|
||||
|
||||
|
||||
@POST("almacennew/saleTrackingDel")
|
||||
|
||||
|
||||
@POST("almacennew/collectionUpdateState")
|
||||
|
||||
|
||||
@POST("almacennew/barcodeToItem")
|
||||
|
||||
|
||||
@POST("almacennew/collectionIncreaseQuantity")
|
||||
|
||||
|
||||
//CONSULTAR ARTICULO ==========================================================================================>
|
||||
@POST("almacennew/itemDiary")
|
||||
|
||||
|
||||
@POST("almacennew/item_card")
|
||||
|
||||
|
||||
@POST("almacennew/itemStockUpdate")
|
||||
|
||||
|
||||
@POST("almacennew/item_placement_save")
|
||||
|
||||
|
||||
@POST("almacennew/buy_updateGrouping")
|
||||
|
||||
|
||||
@POST("almacennew/buy_updatePacking")
|
||||
|
||||
|
||||
@POST("almacennew/itemSaveMin")
|
||||
|
||||
|
||||
|
||||
@POST("almacennew/barcodes_edit")
|
||||
|
||||
|
||||
//BUSCAR ITEM ================================================================================================>
|
||||
@POST("almacennew/getItemUbication")
|
||||
|
||||
|
||||
//INVENTARIO ================================================================================================>
|
||||
@POST("almacennew/itemShelvingRadar")
|
||||
|
||||
|
||||
@POST("almacennew/faultsReview")
|
||||
|
||||
|
||||
@POST("almacennew/faultsReview_isChecked")
|
||||
|
||||
|
||||
//SHELVING PARKING ==========================================================================================>
|
||||
@POST("almacennew/shelvingParking_get")
|
||||
|
||||
|
||||
//UBICADOR ==================================================================================================>
|
||||
@POST("almacennew/itemShelvingList")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingMake")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingMake_multi")
|
||||
|
||||
|
||||
@POST("almacennew/shelvingPark")
|
||||
|
||||
|
||||
@POST("almacennew/shelvingChange")
|
||||
|
||||
|
||||
@POST("almacennew/clearShelvingList")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingTransfer")
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingDelete")
|
||||
|
||||
|
||||
//PALETIZADORES ==========================================================================================>
|
||||
@POST("almacennew/expeditionTruckList")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionTruckAdd")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletList")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanAdd")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanPut")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletView")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletDel")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanList")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionScanDel")
|
||||
|
||||
|
||||
@POST("almacennew/expeditionPalletPrintSet")
|
||||
|