Version 7.3: añade parking de sales, número de baldas que ocupa un ticket, número items en balda, filtro si no funciona tecla ENTER y pinta colores del ticket
This commit is contained in:
parent
7fb7825a6b
commit
f36ab51499
|
@ -29,6 +29,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/crane.xml" value="0.23802083333333332" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/day_of_sale.xml" value="0.184375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/delete.xml" value="0.19166666666666668" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/eraser.xml" value="0.26564102564102565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/face_man_outline.xml" value="0.22708333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/filter_outline.xml" value="0.22239583333333332" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/human_dolly.xml" value="0.2111111111111111" />
|
||||
|
@ -71,6 +72,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_black.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_selected.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/qrcode_scan.xml" value="0.17395833333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/rectangle.xml" value="0.31979166666666664" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/revision_icon.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_av_timer_24.xml" value="0.15052083333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_outline.xml" value="0.11979166666666667" />
|
||||
|
@ -80,6 +82,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_main.xml" value="0.17916666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/buyers_fragment.xml" value="0.18333333333333332" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_dialog.xml" value="0.1490036231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog.xml" value="0.10208333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_list_dialog.xml" value="0.1490036231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.12817028985507245" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.3333333333333333" />
|
||||
|
@ -108,18 +111,20 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_paletizador_menu.xml" value="0.13829787234042554" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_parking.xml" value="0.5" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pasillero.xml" value="0.13829787234042554" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pre_sacador.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_qr.xml" value="0.19882246376811594" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador.xml" value="0.12952898550724637" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador_associatesmarttag.xml" value="0.22" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.13269927536231885" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_transferencia.xml" value="0.10666666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ubicador.xml" value="0.15729166666666666" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ubicador.xml" value="0.22" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol.xml" value="0.1546875" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol_user.xml" value="0.23052536231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_web.xml" value="0.2463768115942029" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ajustes_row.xml" value="0.10009057971014493" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.4466666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_presacador.xml" value="0.4466666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_card_row.xml" value="0.2269021739130435" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionstate_row.xml" value="0.23489583333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historicovehiculo_row.xml" value="0.18795289855072464" />
|
||||
|
|
|
@ -14,15 +14,22 @@ android {
|
|||
applicationId "es.verdnatura"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 84
|
||||
versionName "6.4" //VERSION CODE 84. Modificados menus buffer y añadido hsitorico carro por items y por carro.
|
||||
versionCode 94
|
||||
versionName "7.3" //VERSION CODE 94. Se ve productos en balda y posibilidad de modificarlo.
|
||||
//versionName "7.2.1" //VERSION CODE 93. Si eliges sector en V no aparece insertar las baldas.
|
||||
//versionName "7.2" //VERSION CODE 92. Ordena sales en presacador por pickingOrder, ya no llama siempre para poner numero de baldas.
|
||||
//versionName "7" //VERSION CODE 88. Se añade llamadas a parkingsales,incorpora poner numero de baldas
|
||||
//versionName "6.6" //VERSION CODE 87. Modificado parking presacador.faltaba ver el ticket y se añade carro al historico de shelving.
|
||||
//versionName "6.5.1" //VERSION CODE 86. Modificado parking presacador.faltaba ver el ticket y se añade carro al historico de shelving.
|
||||
//versionName "6.5" //VERSION CODE 85. Modificado parking presacador. Llama a saleParking.
|
||||
//versionName "6.4" //VERSION CODE 84. Modificados menus buffer y añadido hsitorico carro por items y por carro.
|
||||
//versionName "6.3" //VERSION CODE 83 Nueva funcionalidad Cargar expedición en buffer
|
||||
//versionName "6.2.1" // VERSION CODE 82 Aparece mensaje de error completo en "Error al construir la colección".
|
||||
//versionName "6.2" //VERSION CODE 81, arreglado el null de grouping en ubicador.
|
||||
//versionName "6.1.9.1" //VERSION CODE 80, arreglado el null de grouping en ubicador.
|
||||
//versionName "6.1.9" VERSION CODE 76, añadido grouping, reference, prioridad, controladores vs scadores, boton mensaje error,rocket salix y error al añadir elemento a colección.
|
||||
// Sin subir, Modificado y añadido mensajes de error, añadido opcion Dia de venta y su parking, teclado numerico para controlador
|
||||
// versionName "6.1.8.5" VERSION CODE 75 // 23-10-2021//VERSION CODE 74-75 .Pantalla "Dia de venta y parking" Modificado itemtrash, deprecated preferenceManager, quitados ;,puesto menu general al controlador
|
||||
//versionName "6.1.8.5" VERSION CODE 75 // 23-10-2021//VERSION CODE 74-75 .Pantalla "Dia de venta y parking" Modificado itemtrash, deprecated preferenceManager, quitados ;,puesto menu general al controlador
|
||||
//versionName "6.1.8.4.1" //VERSION CODE 73 . Modificar itemtrash
|
||||
//versionName "6.1.8.4" //VERSION CODE 72 . Se añade ExpedtionScan para el Sorter, y modificion llamadas itemtrash y collectionGetTicket.
|
||||
//versionName "6.1.8.3.1"//(VERSION CODE 71) Se añade ViewModel.collectionGet cuando se hace un collectionNew y un refresco de adapter
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 84,
|
||||
"versionName": "6.4",
|
||||
"versionCode": 94,
|
||||
"versionName": "7.3",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
|
Binary file not shown.
|
@ -20,7 +20,7 @@ import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
|
|||
import es.verdnatura.presentation.view.feature.paletizador.fragment.*
|
||||
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingViewModel
|
||||
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel
|
||||
import es.verdnatura.presentation.view.feature.precontrol.PreControladorViewModel
|
||||
import es.verdnatura.presentation.view.feature.precontrol.ShowTicketViewModel
|
||||
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorViewModel
|
||||
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
|
||||
import es.verdnatura.presentation.view.feature.reposicion.fragment.ReposicionViewModel
|
||||
|
@ -66,7 +66,7 @@ val viewModelModule = module {
|
|||
// Pasilleros / Buscar Item 2
|
||||
|
||||
viewModel {
|
||||
PreControladorViewModel(androidContext())
|
||||
ShowTicketViewModel(androidContext())
|
||||
}
|
||||
|
||||
// Pasilleros / Inventario
|
||||
|
|
|
@ -11,5 +11,8 @@ object ConstAndValues {
|
|||
const val ON_CHECKING = "ON_CHECKING"
|
||||
const val PRECHECKER = "PRECHECKER"
|
||||
const val MAINACTIVITY = "MAIN"
|
||||
const val VERTICKET = "SHOWTICKET"
|
||||
const val SECTORFKDEFAULT=37
|
||||
const val WAREHOUSEFKDEFAULT=1
|
||||
}
|
||||
|
||||
|
|
|
@ -86,15 +86,16 @@ class GetLoginUserCase(context: Context) : RestClient(context)
|
|||
params.add(version)
|
||||
return restClient!!.version("json", "1", usuario, password, "application/json", params)
|
||||
|
||||
//SALIX MENSAJE :SERGIO: PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO.
|
||||
*/
|
||||
*/
|
||||
//SALIX SERGIO MENSAJE : PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO.
|
||||
|
||||
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))
|
||||
}
|
||||
|
||||
// SERGIO: PARA DESARROLLO Y PRUEBAS SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA
|
||||
// SERGIO: PARA DESARROLLO SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA
|
||||
|
||||
/* fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>
|
||||
/* fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>
|
||||
{
|
||||
return salixClient!!.sendGroup(
|
||||
content_type = "application/json",
|
||||
|
|
|
@ -29,4 +29,21 @@ class GetPreControladorUserCase(context: Context) : RestClient(context) {
|
|||
)
|
||||
}
|
||||
|
||||
fun ticket_get(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vParamFk: String
|
||||
): Call<String> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(vParamFk)
|
||||
return restClient!!.ticket_get(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.domain
|
||||
|
||||
import android.content.Context
|
||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
|
@ -214,16 +213,16 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
)
|
||||
}
|
||||
|
||||
/* fun itemGetAvailable(
|
||||
fun ticketCollection_setUsedShelves(
|
||||
usuario: String,
|
||||
password: String,
|
||||
itemFk: String,
|
||||
warehouseFk: String
|
||||
): Call<ItemVO> {
|
||||
ticketFk: String,
|
||||
usedShelves: String
|
||||
): Call<Void> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(itemFk)
|
||||
params.add(warehouseFk)
|
||||
return restClient!!.itemGetAvailable(
|
||||
params.add(ticketFk)
|
||||
params.add(usedShelves)
|
||||
return restClient!!.ticketCollection_setUsedShelves(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
|
@ -231,7 +230,63 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
"application/json",
|
||||
params
|
||||
)
|
||||
}*/
|
||||
}
|
||||
|
||||
fun item_updatePackingShelve(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vSelf : String,
|
||||
vPacking : String
|
||||
): Call<Void> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(vSelf)
|
||||
params.add(vPacking)
|
||||
return restClient!!.item_updatePackingShelve(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun saleTracking_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
saleGroupFk: String
|
||||
): Call<Void> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(saleGroupFk)
|
||||
return restClient!!.saleTracking_add(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
/* fun itemGetAvailable(
|
||||
usuario: String,
|
||||
password: String,
|
||||
itemFk: String,
|
||||
warehouseFk: String
|
||||
): Call<ItemVO> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(itemFk)
|
||||
params.add(warehouseFk)
|
||||
return restClient!!.itemGetAvailable(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}*/
|
||||
|
||||
fun collectionAddItem(
|
||||
usuario: String,
|
||||
|
|
|
@ -144,6 +144,18 @@ class GetUbicadorUserCase(context: Context) : RestClient(context) {
|
|||
return restClient!!.shelvingPark("json", "1", usuario, password, "application/json", params)
|
||||
}
|
||||
|
||||
fun saleParking_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
sales:List<String>,
|
||||
parking: String
|
||||
): Call<String> {
|
||||
val params: ArrayList<Any> = ArrayList()
|
||||
params.add(sales)
|
||||
params.add(parking)
|
||||
return restClient!!.saleParking_add("json", "1", usuario, password, "application/json", params)
|
||||
}
|
||||
|
||||
fun shelvingChange(
|
||||
usuario: String,
|
||||
password: String,
|
||||
|
|
|
@ -202,6 +202,17 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<CollectionVO>
|
||||
|
||||
@POST("almacennew/ticket_get")//REVISADA
|
||||
fun ticket_get(
|
||||
@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/saleTrackingReplace")//REVISADA
|
||||
fun saleTrackingReplace(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
@ -257,6 +268,40 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<String>
|
||||
|
||||
@POST("almacennew/ticketCollection_setUsedShelves")//REVISADA
|
||||
fun ticketCollection_setUsedShelves(
|
||||
@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<Void>
|
||||
|
||||
@POST("almacennew/item_updatePackingShelve")//REVISADA
|
||||
fun item_updatePackingShelve(
|
||||
@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<Void>
|
||||
|
||||
|
||||
@POST("almacennew/saleTracking_add")//REVISADA
|
||||
fun saleTracking_add(
|
||||
@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<Void>
|
||||
|
||||
/*sergio:modificada en el caso de que quiera utilizarse por item_Card
|
||||
@POST("almacennew/itemGetAvailable")//REVISADA
|
||||
fun itemGetAvailable(
|
||||
|
@ -732,6 +777,18 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<String>
|
||||
|
||||
@POST("almacennew/saleParking_add")//REVISADA
|
||||
fun saleParking_add(
|
||||
@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<Any>
|
||||
):
|
||||
Call<String>
|
||||
|
||||
|
||||
@POST("almacennew/shelvingPark")//REVISADA
|
||||
fun shelvingPark(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
|
|
@ -107,6 +107,10 @@ interface OnQuantityClickListener {
|
|||
fun onQuantityClick(sale: SaleVO)
|
||||
}
|
||||
|
||||
interface onPackingClickListener {
|
||||
fun onPackingClick(sale:SaleVO)
|
||||
}
|
||||
|
||||
interface OnSaleClickListener {
|
||||
fun onSaleClick(sale: SaleVO)
|
||||
}
|
||||
|
|
|
@ -7,12 +7,14 @@ import android.graphics.Bitmap
|
|||
import android.graphics.drawable.Drawable
|
||||
import android.media.AudioManager
|
||||
import android.os.Bundle
|
||||
import android.text.InputType
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewTreeObserver
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.ImageView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentManager
|
||||
|
@ -139,12 +141,27 @@ fun Fragment.hideKeyboard() {
|
|||
fun Activity.hideKeyboard() {
|
||||
hideKeyboard(currentFocus ?: View(this))
|
||||
}
|
||||
fun Activity.showKeyboardIn() {
|
||||
showKeyboardIn(currentFocus ?: View(this))
|
||||
}
|
||||
|
||||
fun Context.hideKeyboard(view: View) {
|
||||
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
||||
}
|
||||
|
||||
fun Context.showKeyboard(){
|
||||
val imm = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?
|
||||
imm!!.toggleSoftInput(InputType.TYPE_CLASS_NUMBER, 0)
|
||||
|
||||
}
|
||||
|
||||
fun Context.showKeyboardIn(view:View){
|
||||
val imm = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?
|
||||
imm!!.showSoftInput(view, 0)
|
||||
|
||||
}
|
||||
|
||||
// Extension function to change media volume programmatically
|
||||
fun AudioManager.setMediaVolume(volumeIndex:Int) {
|
||||
// Set media volume level
|
||||
|
|
|
@ -2,10 +2,13 @@ package es.verdnatura.presentation.view.component
|
|||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.text.InputType
|
||||
import android.view.View
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ComponentCustomEditDialogBinding
|
||||
import es.verdnatura.presentation.common.showKeyboard
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
|
||||
class CustomDialogInput (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
@ -86,4 +89,10 @@ class CustomDialogInput (context: Context) : Dialog(context, R.style.DialogTheme
|
|||
return this
|
||||
}
|
||||
|
||||
fun setInputText(){
|
||||
binding.customDialogValue.inputType= InputType.TYPE_CLASS_NUMBER
|
||||
}
|
||||
fun setFocusText(){
|
||||
binding.customDialogValue.requestFocus()
|
||||
}
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.ajustes.fragment
|
||||
|
||||
//import android.preference.PreferenceManager
|
||||
//import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
|
@ -28,51 +25,44 @@ import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
|||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
//import kotlinx.android.synthetic.main.activity_main.view.*
|
||||
|
||||
//import kotlinx.android.synthetic.main.fragment_login.*
|
||||
class AjustesFragment :
|
||||
BaseFragment<FragmentAjustesBinding, AjustesViewModel>(AjustesViewModel::class) {
|
||||
|
||||
class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(AjustesViewModel::class) {
|
||||
|
||||
private var user:String? = ""
|
||||
private var userFk:String?=""
|
||||
private var password:String? = ""
|
||||
private var user: String? = ""
|
||||
private var userFk: String? = ""
|
||||
private var password: String? = ""
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var sectorListVO:List<SectorItemVO> = listOf()
|
||||
private var vozList:List<String> = listOf()
|
||||
private var sectorListVO: List<SectorItemVO> = listOf()
|
||||
private var vozList: List<String> = listOf()
|
||||
private var prefs: SharedPreferences? = null
|
||||
private var ajustesAdapter: AjustesAdapter? = null
|
||||
|
||||
//añadido
|
||||
private var wagonList:List<String> = listOf()
|
||||
private var tagsList:List<String> = listOf()
|
||||
private var wagonList: List<String> = listOf()
|
||||
private var tagsList: List<String> = listOf()
|
||||
|
||||
companion object {
|
||||
fun newInstance() = AjustesFragment()
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_ajustes
|
||||
|
||||
|
||||
|
||||
|
||||
/* override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
// binding=FragmentAjustesBinding.inflate(inflater,container,false)
|
||||
//val view=binding.root
|
||||
//return view
|
||||
return super.onCreateView(inflater, container, savedInstanceState)
|
||||
}*/
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
prefs = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
prefs = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
customDialog = CustomDialog(requireContext())
|
||||
// binding = DataBindingUtil.setContentView(requireActivity(), R.layout.activity_main)
|
||||
|
||||
|
||||
//modificat el InitilializeAjusts
|
||||
viewModel.inititializeDefaultAjusts(prefs!!.getString(SECTORDESCRIP,getString(R.string.Sinsector)).toString(),prefs!!.getInt(SECTORFK,0),prefs!!.getInt(WAREHOUSEFK,0),prefs!!.getString(VOZ,"NO").toString(),prefs!!.getInt(WAGON,2).toString(),prefs!!.getString(TAGSTYPE,"Stickers").toString())
|
||||
viewModel.inititializeDefaultAjusts(
|
||||
prefs!!.getString(
|
||||
SECTORDESCRIP,
|
||||
getString(R.string.Sinsector)
|
||||
).toString(),
|
||||
prefs!!.getInt(SECTORFK, 0),
|
||||
prefs!!.getInt(WAREHOUSEFK, 0),
|
||||
prefs!!.getString(VOZ, "NO").toString(),
|
||||
prefs!!.getInt(WAGON, 2).toString(),
|
||||
prefs!!.getString(TAGSTYPE, "Stickers").toString()
|
||||
)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
}
|
||||
|
@ -80,40 +70,24 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
|
||||
override fun init() {
|
||||
|
||||
//ActivityMainBinding.bind(main_bottom_navigation).mainBottomNavigation.visibility=View.VISIBLE
|
||||
(activity as MainActivity).hideBottomNavigation(View.VISIBLE)
|
||||
//requireActivity().main_bottom_navigation.visibility = View.VISIBLE
|
||||
binding.userText.setText(prefs!!.getString(USERFK,""))
|
||||
//user_text.setText(prefs!!.getString(USERFK,""))
|
||||
val versionName = requireActivity().packageManager.getPackageInfo(requireActivity().packageName,0).versionName!!
|
||||
binding.userText.setText(prefs!!.getString(USERFK, ""))
|
||||
val versionName = requireActivity().packageManager.getPackageInfo(
|
||||
requireActivity().packageName,
|
||||
0
|
||||
).versionName!!
|
||||
binding.itemVersion.setText(versionName)
|
||||
//item_version.setText(versionName)
|
||||
user = prefs!!.getString(USER,"")
|
||||
userFk =prefs!!.getString(USERFK,"")
|
||||
password = prefs!!.getString(PASSWORD,"")
|
||||
binding.androididText.setText(Settings.Secure.getString(context?.contentResolver, Settings.Secure.ANDROID_ID))
|
||||
//androidid_text.setText(Settings.Secure.getString(context?.contentResolver, Settings.Secure.ANDROID_ID))
|
||||
|
||||
binding.txtserver.setText(this.getDefaults("base_url",this.requireContext()))
|
||||
//txtserver.setText(this.getDefaults("base_url",this.requireContext()))
|
||||
binding.txtserver.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
|
||||
//binding.txtserver.setOnKeyListener((View.OnKeyListener { v, keyCode, event ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) {
|
||||
//this.setDefaults("base_url",txtserver.text.toString(),this.requireContext())
|
||||
this.setDefaults("base_url",binding.txtserver.toString(),this.requireContext())
|
||||
// sergio: se comenta línea de abajo porque da fallo en la app//
|
||||
// this.setDefaults("base_url", edittext_server.text.toString(), this.requireContext())
|
||||
this.hideKeyboard()
|
||||
//sergio:creada restartapp en BaseFragment por si es necesario utilizarla de nuevo.
|
||||
// se hace un restart por si se cambia el servidor para que tome nuevos valores
|
||||
|
||||
restartapp(this)
|
||||
|
||||
return@OnKeyListener false
|
||||
}
|
||||
|
||||
false
|
||||
})
|
||||
user = prefs!!.getString(USER, "")
|
||||
userFk = prefs!!.getString(USERFK, "")
|
||||
password = prefs!!.getString(PASSWORD, "")
|
||||
binding.androididText.setText(
|
||||
Settings.Secure.getString(
|
||||
context?.contentResolver,
|
||||
Settings.Secure.ANDROID_ID
|
||||
)
|
||||
)
|
||||
binding.txtserver.setText(this.getDefaults("base_url", this.requireContext()))
|
||||
|
||||
super.init()
|
||||
|
||||
|
@ -121,27 +95,24 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
}
|
||||
|
||||
fun setEvents() {
|
||||
binding.androididText.setOnClickListener{copyanddrag(binding.androididText.text.toString()) }
|
||||
binding.androididText.setOnLongClickListener{copyanddrag(binding.androididText.text.toString()) }
|
||||
binding.androididText.setOnClickListener { copyanddrag(binding.androididText.text.toString()) }
|
||||
binding.androididText.setOnLongClickListener { copyanddrag(binding.androididText.text.toString()) }
|
||||
|
||||
|
||||
/*androidid_text.setOnClickListener { copyanddrag(androidid_text.text.toString()) }
|
||||
androidid_text.setOnLongClickListener { copyanddrag(androidid_text.text.toString()) }*/
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
ajustesAdapter = AjustesAdapter(ajustesitem,object: OnAjustesItemClickListener{
|
||||
with(viewModel) {
|
||||
ajustesAdapter = AjustesAdapter(ajustesitem, object : OnAjustesItemClickListener {
|
||||
override fun onAjustesItemClickListener(item: AjustesItemVO) {
|
||||
if (item.id == 0){
|
||||
if (item.id == 0) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
//splash_progress.visibility = View.VISIBLE
|
||||
viewModel.getSectors(user!!,password!!)
|
||||
} else if (item.id == 5){
|
||||
viewModel.getSectors(user!!, password!!)
|
||||
} else if (item.id == 5) {
|
||||
requireActivity().onBackPressed()
|
||||
}else if (item.id == 1){
|
||||
// //////Log.i("VERDNATURA:","Carros pulsados")
|
||||
val listCarros : ArrayList<String> = ArrayList()
|
||||
} else if (item.id == 1) {
|
||||
val listCarros: ArrayList<String> = ArrayList()
|
||||
listCarros.add("1")
|
||||
listCarros.add("2")
|
||||
listCarros.add("3")
|
||||
|
@ -150,49 +121,52 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
listCarros.add("6")
|
||||
wagonList = listCarros
|
||||
|
||||
val array= arrayOfNulls<String>(listCarros.size)
|
||||
val array = arrayOfNulls<String>(listCarros.size)
|
||||
|
||||
showDialogCarros(array=listCarros.toArray(array))
|
||||
showDialogCarros(array = listCarros.toArray(array))
|
||||
|
||||
|
||||
}else if (item.id == 2){
|
||||
val listVoz : ArrayList<String> = ArrayList()
|
||||
} else if (item.id == 2) {
|
||||
val listVoz: ArrayList<String> = ArrayList()
|
||||
listVoz.add("NO")
|
||||
listVoz.add("YES")
|
||||
vozList = listVoz
|
||||
val array = arrayOfNulls<String>(listVoz.size)
|
||||
showDialogVoz(array = listVoz.toArray(array))
|
||||
|
||||
}else if (item.id == 3){
|
||||
val listTagsType : ArrayList<String> = ArrayList()
|
||||
} else if (item.id == 3) {
|
||||
val listTagsType: ArrayList<String> = ArrayList()
|
||||
listTagsType.add("Stickers")
|
||||
listTagsType.add("SmartTags")
|
||||
tagsList = listTagsType
|
||||
val array = arrayOfNulls<String>(listTagsType.size)
|
||||
showItemPickerType(array = listTagsType.toArray(array))
|
||||
}else if (item.id == 4){
|
||||
(activity as MainActivity).onPasillerosItemClickListener( PasillerosItemVO(title = "Control de usuario de vehículo"),userFk!!)
|
||||
} else if (item.id == 4) {
|
||||
(activity as MainActivity).onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = "Control de usuario de vehículo"
|
||||
), userFk!!
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.ajustessItems.adapter=ajustesAdapter
|
||||
binding.ajustessItems.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
//austess_items.adapter = ajustesAdapter
|
||||
//ajustess_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.ajustessItems.adapter = ajustesAdapter
|
||||
binding.ajustessItems.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
loadSectorList.observe(viewLifecycleOwner, { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
//splash_progress.visibility = View.INVISIBLE
|
||||
if (it.list.isNotEmpty() && it.list.get(0).isError){
|
||||
customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage).setOkButton(getString(R.string.Close)){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (it.list.isNotEmpty() && it.list.get(0).isError) {
|
||||
customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton(getString(R.string.Close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
|
||||
if (it.list != null && it.list.size > 0){
|
||||
val listSectores : ArrayList<String> = ArrayList()
|
||||
if (it.list != null && it.list.size > 0) {
|
||||
val listSectores: ArrayList<String> = ArrayList()
|
||||
it.list.forEach {
|
||||
listSectores.add(it.description)
|
||||
}
|
||||
|
@ -200,10 +174,12 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
sectorListVO = it.list
|
||||
showDialogSector(listSectores.toArray(array))
|
||||
|
||||
}else{
|
||||
customDialog.setTitle("Sectores").setDescription(getString(R.string.Noexistessectores)).setOkButton(getString(R.string.Close)){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
customDialog.setTitle("Sectores")
|
||||
.setDescription(getString(R.string.Noexistessectores))
|
||||
.setOkButton(getString(R.string.Close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -213,7 +189,7 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
super.observeViewModel()
|
||||
}
|
||||
|
||||
private fun showDialogSector(array:Array<String>){
|
||||
private fun showDialogSector(array: Array<String>) {
|
||||
val builder = AlertDialog.Builder(this.context)
|
||||
|
||||
|
||||
|
@ -221,10 +197,10 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
builder.setItems(array) { _, which ->
|
||||
val selected = array[which]
|
||||
sectorListVO.forEach {
|
||||
if (it.description.equals(selected)){
|
||||
if (it.description.equals(selected)) {
|
||||
val editor = prefs!!.edit()
|
||||
editor.putString(SECTORDESCRIP,it.description)
|
||||
editor.putInt(SECTORFK,it.id)
|
||||
editor.putString(SECTORDESCRIP, it.description)
|
||||
editor.putInt(SECTORFK, it.id)
|
||||
it.warehouseFk?.let { it1 -> editor.putInt(WAREHOUSEFK, it1) }
|
||||
editor.apply()
|
||||
|
||||
|
@ -242,7 +218,7 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
dialog.show()
|
||||
}
|
||||
|
||||
private fun showDialogVoz(array:Array<String>){
|
||||
private fun showDialogVoz(array: Array<String>) {
|
||||
val builder = AlertDialog.Builder(this.context)
|
||||
|
||||
|
||||
|
@ -250,9 +226,9 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
builder.setItems(array) { _, which ->
|
||||
val selected = array[which]
|
||||
vozList.forEach {
|
||||
if (it.equals(selected)){
|
||||
if (it.equals(selected)) {
|
||||
val editor = prefs!!.edit()
|
||||
editor.putString(VOZ,it)
|
||||
editor.putString(VOZ, it)
|
||||
editor.apply()
|
||||
viewModel.ajustesitem.get(2).selected = it
|
||||
ajustesAdapter!!.notifyDataSetChanged()
|
||||
|
@ -268,19 +244,15 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
dialog.show()
|
||||
}
|
||||
|
||||
|
||||
//sergio : guardar datos
|
||||
private fun showDialogCarros(array:Array<String>){
|
||||
private fun showDialogCarros(array: Array<String>) {
|
||||
val builder = AlertDialog.Builder(this.context)
|
||||
|
||||
|
||||
builder.setTitle(getString(R.string.Seleccionauncarro))
|
||||
builder.setItems(array) { _, which ->
|
||||
val selected = array[which]
|
||||
wagonList.forEach {
|
||||
if (it.equals(selected)){
|
||||
if (it.equals(selected)) {
|
||||
val editor = prefs!!.edit()
|
||||
editor.putInt(WAGON,it.toInt())
|
||||
editor.putInt(WAGON, it.toInt())
|
||||
editor.apply()
|
||||
|
||||
viewModel.ajustesitem.get(1).selected = it
|
||||
|
@ -297,7 +269,7 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
dialog.show()
|
||||
}
|
||||
|
||||
private fun showItemPickerType(array:Array<String>){
|
||||
private fun showItemPickerType(array: Array<String>) {
|
||||
val builder = AlertDialog.Builder(this.context)
|
||||
|
||||
|
||||
|
@ -305,9 +277,9 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
builder.setItems(array) { _, which ->
|
||||
val selected = array[which]
|
||||
tagsList.forEach {
|
||||
if (it.equals(selected)){
|
||||
if (it.equals(selected)) {
|
||||
val editor = prefs!!.edit()
|
||||
editor.putString(TAGSTYPE,it)
|
||||
editor.putString(TAGSTYPE, it)
|
||||
editor.apply()
|
||||
|
||||
viewModel.ajustesitem.get(3).selected = it
|
||||
|
@ -325,7 +297,6 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
}
|
||||
|
||||
|
||||
|
||||
fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editor = preferences.edit()
|
||||
|
@ -333,19 +304,16 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
editor.commit()
|
||||
}
|
||||
|
||||
fun getDefaults(key: String?, context: Context?): String? {
|
||||
private fun getDefaults(key: String?, context: Context?): String? {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return preferences.getString(key, null)
|
||||
}
|
||||
|
||||
|
||||
fun copyanddrag(string:String): Boolean {
|
||||
private fun copyanddrag(string: String): Boolean {
|
||||
val clipboard = getActivity()?.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clip: ClipData = ClipData.newPlainText("Android_id", string)
|
||||
clipboard.setPrimaryClip(clip)
|
||||
//androidid_text.performLongClick()
|
||||
//Log.i(TD,"se copia $string")
|
||||
//getString(R.string.copied).toast(requireContext())
|
||||
setTooltipText(binding.androididText, getString(R.string.copied))
|
||||
return false
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemCardBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
|
@ -163,7 +164,7 @@ class ItemCardFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
this.itemFk = itemFk
|
||||
|
||||
binding.splashProgressTwo.visibility = View.VISIBLE
|
||||
|
|
|
@ -9,6 +9,8 @@ import androidx.lifecycle.Observer
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBufferBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -59,8 +61,8 @@ class BufferFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
type = ConstAndValues.PRECHECKER
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -109,8 +111,8 @@ class BufferLoadFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBuscarItemBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
|
@ -75,7 +76,7 @@ class BuscarItemFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
this.itemFk = itemFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getLocations(user,password,itemFk,"getItemUbication")
|
||||
|
|
|
@ -9,6 +9,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.BuyersFragmentBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnAjustesItemClickListener
|
||||
import es.verdnatura.presentation.common.OnBuyerSelectedListener
|
||||
|
@ -54,8 +56,8 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
viewModel.itemShelvingBuyerGet(user = user,password = password,"itemShelving_BuyerGet")
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.QaualityFragmentBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -60,8 +62,8 @@ class QaualityFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -6,24 +6,25 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.ContextCompat.getColor
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ItemArticleRowBinding
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
||||
class SaleAdapter (
|
||||
|
||||
class SaleAdapter(
|
||||
private val items: List<SaleVO>,
|
||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||
private val onQuantityClick: OnQuantityClickListener,
|
||||
private val onSaleClickListener: OnSaleClickListener,
|
||||
private val onMistakeClickListener: OnMistakeClickListener
|
||||
private val onMistakeClickListener: OnMistakeClickListener,
|
||||
private val onPackingClick: onPackingClickListener,
|
||||
): RecyclerView.Adapter<SaleAdapter.AjustesItemHolder> () {
|
||||
var context:Context? = null
|
||||
var position:Int = 0
|
||||
|
@ -65,6 +66,9 @@ class SaleAdapter (
|
|||
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = "Consultar artículo"),sale.itemFk)
|
||||
}
|
||||
|
||||
itemPackingItemFk.setOnClickListener{
|
||||
onPackingClick.onPackingClick(sale)
|
||||
}
|
||||
|
||||
itemArticleQuantity.setOnClickListener {
|
||||
onQuantityClick.onQuantityClick(sale)
|
||||
|
@ -108,11 +112,7 @@ class SaleAdapter (
|
|||
|
||||
}
|
||||
|
||||
/*if (sale.level.equals("AMARILLO")){
|
||||
level.setTextColor(Color.YELLOW)
|
||||
}else{
|
||||
level.setTextColor(Color.GREEN)
|
||||
}*/
|
||||
paintTicketcolor(sale.level,itemTicketColor)
|
||||
|
||||
|
||||
if (!sale.isNew && sale.originalQuantity == sale.quantity){
|
||||
|
@ -139,6 +139,7 @@ class SaleAdapter (
|
|||
itemArticleRowSemaforoCon.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_warm_grey))
|
||||
}
|
||||
|
||||
|
||||
if (sale.isControlled == "1"){
|
||||
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_dark_mint))
|
||||
}else if (sale.isPrepared == "1"){
|
||||
|
@ -149,6 +150,8 @@ class SaleAdapter (
|
|||
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_black))
|
||||
}
|
||||
|
||||
|
||||
|
||||
//sergio: para de momento que pinten las lineas sin actualizar ni nada
|
||||
if (sale.isControlled == "2"){
|
||||
itemArticleRowSemaforoCon.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_white))
|
||||
|
@ -162,4 +165,40 @@ class SaleAdapter (
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun paintTicketcolor(color: String, itemTicketColor: View) {
|
||||
|
||||
when (color){
|
||||
"ROJO"-> itemTicketColor.setBackgroundColor(Color.RED)
|
||||
"AMARILLO"->itemTicketColor.setBackgroundColor(Color.YELLOW)
|
||||
"VERDE"->itemTicketColor.setBackgroundColor(Color.GREEN)
|
||||
"AZUL"->itemTicketColor.setBackgroundColor(Color.BLUE)
|
||||
"BLANCO"->itemTicketColor.setBackgroundColor(Color.WHITE)
|
||||
// "NEGRO"-> itemTicketColor.setBackgroundResource((R.drawable.rectangle))
|
||||
|
||||
"NEGRO"-> {itemTicketColor.setBackgroundColor(Color.BLACK)
|
||||
itemTicketColor.setBackgroundResource((R.drawable.border))}
|
||||
"VIOLETA"-> itemTicketColor.setBackgroundColor(0xFF4c2882.toInt())
|
||||
"GRIS"-> itemTicketColor.setBackgroundColor(Color.GRAY)
|
||||
"ORANGE"-> itemTicketColor.setBackgroundColor(getColor(context!!,android.R.color.holo_orange_light))
|
||||
"MORADO"-> itemTicketColor.setBackgroundColor(getColor(context!!,android.R.color.holo_purple))
|
||||
"CELESTE"-> itemTicketColor.setBackgroundColor(0xFF5b85F5.toInt())
|
||||
"ROSA"-> itemTicketColor.setBackgroundColor(0xFFfc0fc0.toInt())
|
||||
"DORADO"-> itemTicketColor.setBackgroundColor(0xFFb8860b.toInt())
|
||||
"MARRON"-> itemTicketColor.setBackgroundColor(0xFF663300.toInt())
|
||||
"PERLA"-> itemTicketColor.setBackgroundColor(0xFFcdcecf.toInt())
|
||||
"MARFIL"-> itemTicketColor.setBackgroundColor(0xFFf7eada.toInt())
|
||||
"CIAN"-> itemTicketColor.setBackgroundColor(0xFF00ffff.toInt())
|
||||
"BEIGE"-> itemTicketColor.setBackgroundColor(0xFFf2e7bf.toInt())
|
||||
|
||||
|
||||
|
||||
else->{
|
||||
|
||||
}
|
||||
}
|
||||
// itemTicketColor.setBackgroundResource((R.drawable.rectangle))
|
||||
|
||||
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -40,6 +40,18 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
private val _responseUsedShelves by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseUsedShelves: LiveData<ResponseItemVO>
|
||||
get() = _responseUsedShelves
|
||||
|
||||
private val _responseItem_updatePackingShelve by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseItem_updatePackingShelve: LiveData<ResponseItemVO>
|
||||
get() = _responseItem_updatePackingShelve
|
||||
|
||||
private val _responseSaleGroup by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleGroup: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleGroup
|
||||
|
||||
private val _responsecheckfully by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responsecheckfully: LiveData<ResponseItemVO>
|
||||
get() = _responsecheckfully
|
||||
|
@ -115,6 +127,9 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
fun saleTrackingReplace(
|
||||
usuario: String,
|
||||
password: String,
|
||||
|
@ -283,6 +298,113 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
fun ticketCollection_setUsedShelves(
|
||||
usuario: String,
|
||||
password: String,
|
||||
ticketFk: String,
|
||||
usedShelves: String,
|
||||
callFunction:String)
|
||||
|
||||
{
|
||||
getSacadorControladorUserCase.ticketCollection_setUsedShelves(
|
||||
usuario,
|
||||
password,
|
||||
ticketFk,
|
||||
usedShelves
|
||||
).enqueue(object : Callback<Void>
|
||||
{
|
||||
override fun onFailure(call: Call<Void>, t: Throwable)
|
||||
{
|
||||
_responseUsedShelves.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>)
|
||||
{
|
||||
if (!response.isSuccessful)
|
||||
{
|
||||
_responseUsedShelves.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,response.message())
|
||||
)
|
||||
} else
|
||||
{
|
||||
_responseUsedShelves.value = ResponseItemVO(isError = false)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
fun item_updatePackingShelve(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vSelf: String,
|
||||
vPacking: String,
|
||||
callFunction:String)
|
||||
|
||||
{
|
||||
getSacadorControladorUserCase.item_updatePackingShelve(
|
||||
usuario,
|
||||
password,
|
||||
vSelf,
|
||||
vPacking
|
||||
).enqueue(object : Callback<Void>
|
||||
{
|
||||
override fun onFailure(call: Call<Void>, t: Throwable)
|
||||
{
|
||||
_responseItem_updatePackingShelve.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>)
|
||||
{
|
||||
if (!response.isSuccessful)
|
||||
{
|
||||
_responseItem_updatePackingShelve.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,response.message())
|
||||
)
|
||||
} else
|
||||
{
|
||||
_responseItem_updatePackingShelve.value = ResponseItemVO(isError = false)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun saleTracking_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
saleGroupFk: String,
|
||||
callFunction:String)
|
||||
|
||||
{
|
||||
getSacadorControladorUserCase.saleTracking_add(
|
||||
usuario,
|
||||
password,
|
||||
saleGroupFk
|
||||
).enqueue(object : Callback<Void>
|
||||
{
|
||||
override fun onFailure(call: Call<Void>, t: Throwable)
|
||||
{
|
||||
_responseSaleGroup.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>)
|
||||
{
|
||||
if (!response.isSuccessful)
|
||||
{
|
||||
_responseSaleGroup.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,response.message())
|
||||
)
|
||||
} else
|
||||
{
|
||||
_responseSaleGroup.value = ResponseItemVO(isError = false)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* fun itemGetAvailable(usuario: String, password: String, itemFk: String, warehouseFk: String,callFunction:String)
|
||||
{
|
||||
getSacadorControladorUserCase.itemGetAvailable(usuario, password, itemFk, warehouseFk)
|
||||
|
|
|
@ -0,0 +1,332 @@
|
|||
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentCollectionBinding
|
||||
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
||||
import es.verdnatura.domain.ConstAndValues.PRECHECKER
|
||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.VERTICKET
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
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.feature.collection.adapter.SaleAdapter
|
||||
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.SaleVO
|
||||
import timber.log.Timber.d
|
||||
|
||||
class CollectionShowTicketFragment(
|
||||
var collection: CollectionVO = CollectionVO(),
|
||||
var type: String = VERTICKET
|
||||
) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var SectorDescription = ""
|
||||
private var token = ""
|
||||
private var voz = ""
|
||||
private var sales: List<SaleVO> = listOf()
|
||||
private var saleAdapter: SaleAdapter? = null
|
||||
private var lm: LinearLayoutManager? = null
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var tickets: ArrayList<String> = ArrayList()
|
||||
private var state = 0
|
||||
|
||||
companion object {
|
||||
fun newInstance(collection: CollectionVO, type: String) =
|
||||
CollectionShowTicketFragment(collection, type)
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_collection
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
token = prefs.getString(TOKEN, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
voz = prefs.getString(VOZ, "NO").toString()
|
||||
SectorDescription = prefs.getString(SECTORDESCRIP, "Sin Sector").toString()
|
||||
if (collection.tickets.isEmpty()) {
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
(activity as MainActivity).hideBottomNavigation(GONE)
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
setEvents()
|
||||
setToolBarIcon()
|
||||
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
||||
|
||||
if (collection.tickets.isNotEmpty()) {
|
||||
createCollectionList()
|
||||
}
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setToolBarIcon() {
|
||||
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
||||
|
||||
|
||||
val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
val iconPrint: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_print_black_24dp, resources.newTheme())
|
||||
listIcons.add(iconPrint)
|
||||
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconPrint) {
|
||||
print()
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun print() {
|
||||
viewModel.collectionStickerPrint(
|
||||
usuario = user,
|
||||
password = password,
|
||||
collectionFk = collection.collectionFk,
|
||||
sectorFk = sectorFk,
|
||||
"collectionStickerPrint"
|
||||
)
|
||||
|
||||
(getString(R.string.Imprimiendo) + " por " + SectorDescription).toast(requireContext())
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
|
||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
binding.scanInput.text.toString(),
|
||||
sectorFk,
|
||||
type, "collection_getTickets"
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
hideKeyboards()
|
||||
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
hideKeyboards()
|
||||
|
||||
|
||||
binding.collectionSwipe.setOnRefreshListener {
|
||||
|
||||
binding.collectionSwipe.isRefreshing = false
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
type, "collection_getTickets"
|
||||
)
|
||||
binding.collectionSwipe.isRefreshing = false
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideKeyboards() {
|
||||
try {
|
||||
requireActivity().hideKeyboard()
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
binding.splashProgress.visibility = GONE
|
||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (!it.isError) {
|
||||
if (it.tickets.isNotEmpty()) {
|
||||
collection = it
|
||||
createCollectionList()
|
||||
|
||||
|
||||
} else {
|
||||
binding.mainToolbar.toolbarSubtitle.text = "0/0"
|
||||
}
|
||||
} else {
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
if (activity != null) requireActivity().onBackPressed()
|
||||
}.show()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun createCollectionList() {
|
||||
state = 0
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
|
||||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
var salesList: ArrayList<SaleVO> = ArrayList()
|
||||
tickets = ArrayList()
|
||||
var observations = ""
|
||||
collection.tickets.forEach { ticket ->
|
||||
ticket.sales.forEach { saleVO ->
|
||||
if (type == SACADOR && saleVO.quantity != "0") {
|
||||
salesList.add(saleVO)
|
||||
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
|
||||
tickets.add(saleVO.ticketFk)
|
||||
} else if (type == CONTROLADOR || type == PRECHECKER || type == VERTICKET) {
|
||||
salesList.add(saleVO)
|
||||
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
|
||||
tickets.add(saleVO.ticketFk)
|
||||
}
|
||||
}
|
||||
|
||||
observations = observations + " " + ticket.observations
|
||||
}
|
||||
|
||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||
|
||||
saleAdapter =
|
||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
||||
|
||||
override fun onQuantityClick(sale: SaleVO) {
|
||||
}
|
||||
}, object : OnSaleClickListener {
|
||||
override fun onSaleClick(sale: SaleVO) {
|
||||
}
|
||||
|
||||
}, object : OnMistakeClickListener {
|
||||
override fun onMistakeClickListener(sale: SaleVO) {
|
||||
}
|
||||
},object : onPackingClickListener{
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.fragmentSacadorCollections.adapter = saleAdapter
|
||||
binding.fragmentSacadorCollections.layoutManager = lm
|
||||
setTotalLines()
|
||||
printObservations(observations)
|
||||
binding.scanInput.requestFocus()
|
||||
}
|
||||
|
||||
|
||||
private fun printObservations(observations: String) {
|
||||
if (observations.trim().isNotEmpty()) {
|
||||
customDialog.setTitle("Observaciones").setDescription(observations)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.hide()
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* private fun setListPosition(position: Int, isFromBack: Boolean) {
|
||||
storedPosition = position
|
||||
if (type == SACADOR) {
|
||||
if (binding.fragmentSacadorCollections != null) {
|
||||
binding.fragmentSacadorCollections.addViewObserver {
|
||||
lm!!.scrollToPositionWithOffset(position, 0)
|
||||
}
|
||||
}
|
||||
|
||||
} else if (isFromBack) {
|
||||
if (binding.fragmentSacadorCollections != null) {
|
||||
binding.fragmentSacadorCollections.addViewObserver {
|
||||
lm!!.scrollToPositionWithOffset(position, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
private fun setTotalLines() {
|
||||
var totalMark = 0
|
||||
sales.forEach {
|
||||
if (type == SACADOR) {
|
||||
if (it.isPrepared == "1" || it.isControlled == "1" || it.isPreviousPrepared == "1") {
|
||||
totalMark += 1
|
||||
} else if (it.quantity == "0") {
|
||||
totalMark += 1
|
||||
}
|
||||
} else if (type == CONTROLADOR || type == PRECHECKER) {
|
||||
if (it.isControlled == "1" || it.isControlled == "2")
|
||||
totalMark += 1
|
||||
}
|
||||
}
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
collection.collectionFk
|
||||
if (sales != null) binding.mainToolbar.toolbarSubtitle.text =
|
||||
"" + totalMark + "/" + sales.size
|
||||
if (totalMark == sales.size) {
|
||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -18,6 +18,7 @@ fun CollectionVO.map(): CollectionVO {
|
|||
it.agencyName = ticket.agencyName
|
||||
it.isNew = it.isAdded == "1"
|
||||
|
||||
|
||||
// sergio: OBLIGAR A ACTUALIZAR VERSIÓN PARA SUBIR DESPUÉS FICHEROS DEL BACK collection_getTickets al mismo tiempo")
|
||||
|
||||
//it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))
|
||||
|
|
|
@ -3,19 +3,19 @@ package es.verdnatura.presentation.view.feature.controlador.fragment
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentControladorBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import timber.log.Timber.d
|
||||
import timber.log.Timber.i
|
||||
|
||||
/*
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
@ -23,14 +23,15 @@ import kotlinx.android.synthetic.main.fragment_controlador.*
|
|||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
*/
|
||||
|
||||
class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorViewModel>(ControladorViewModel::class) {
|
||||
class ControladorFragment :
|
||||
BaseFragment<FragmentControladorBinding, ControladorViewModel>(ControladorViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack:Boolean = false
|
||||
private var onCollectionSelectedListener : OnCollectionSelectedListener? = null
|
||||
private var goBack: Boolean = false
|
||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_controlador
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var type = ""
|
||||
|
@ -50,8 +51,7 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
customDialog = CustomDialog(requireContext())
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
|
||||
setEvents()
|
||||
//requireActivity().main_bottom_navigation.visibility = View.VISIBLE
|
||||
(activity as MainActivity).hideBottomNavigation(View.VISIBLE)
|
||||
(activity as MainActivity).hideBottomNavigation(View.VISIBLE)
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -62,19 +62,18 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 60).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
type=ConstAndValues.CONTROLADOR
|
||||
type = ConstAndValues.CONTROLADOR
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
|
||||
private fun setEvents() {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
@ -82,20 +81,30 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
d("Action id "+actionId)
|
||||
goBack=false
|
||||
// d("Action id "+actionId)
|
||||
goBack = false
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
|
||||
//sergio: para ver si ha marcado dos veces el mismo ticket
|
||||
if (binding.scanInput.text!!.length > 13) {
|
||||
|
||||
var size = binding.scanInput.text!!.length
|
||||
if (binding.scanInput.text!!.substring((size / 2), size).equals(binding.scanInput.text!!.substring( 0,size / 2))){
|
||||
binding.scanInput.setText(binding.scanInput.text!!.substring(0, size / 2))
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
usuario = user,
|
||||
password = password,
|
||||
sectorFk = sectorFk,
|
||||
collectionFk = binding.scanInput.text.toString(),
|
||||
type = type
|
||||
,callFunction = "collection_getTickets")
|
||||
// viewModel.ticket_checkControlled(user,password,scan_input.text.toString())
|
||||
}
|
||||
type = type, callFunction = "collection_getTickets"
|
||||
)
|
||||
// viewModel.ticket_checkControlled(user,password,scan_input.text.toString())
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.scanInput)
|
||||
return@setOnEditorActionListener true
|
||||
|
@ -105,16 +114,17 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
with(viewModel) {
|
||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (it.isError) {
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
|
||||
if (!goBack)navigateToCollectionList(it)
|
||||
if (!goBack) navigateToCollectionList(it)
|
||||
goBack = false
|
||||
}
|
||||
|
||||
|
@ -123,12 +133,10 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
}
|
||||
}
|
||||
|
||||
private fun navigateToCollectionList(collection: CollectionVO){
|
||||
private fun navigateToCollectionList(collection: CollectionVO) {
|
||||
////Log.i("VERDNATURA:","vamos a oncolecctionSelected ${collection.isError}")
|
||||
onCollectionSelectedListener?.onCollectionSelected(collection, ConstAndValues.CONTROLADOR)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package es.verdnatura.presentation.view.feature.controlador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||
|
@ -38,8 +39,13 @@ class ControladorViewModel(context: Context) : BaseViewModel() {
|
|||
response: Response<CollectionVO>
|
||||
) {
|
||||
if (response.body() != null){
|
||||
|
||||
_collectionTicketList.value = response.body()?.let { it.map()
|
||||
}
|
||||
/* response.body()?.let {
|
||||
Log.d("VERDNTURA::","el itempacking es "+it.tickets.get(0).itemPackingTypeFk)
|
||||
}.also { }*/
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
|
|
|
@ -10,6 +10,8 @@ import androidx.lifecycle.Observer
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentWebBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
||||
|
@ -96,8 +98,8 @@ class WebFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
type = ConstAndValues.PRECHECKER
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -234,8 +236,8 @@ class ControlVehiculoFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import android.view.View.*
|
|||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.loadUrl
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -56,7 +58,7 @@ class ControlVehiculoUsuarioFragment(
|
|||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
token = prefs.getString(TOKEN, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
android_id = getANDROIDID()
|
||||
|
||||
if (userFk.equals(vUserFK)) {
|
||||
|
@ -87,8 +89,8 @@ class ControlVehiculoUsuarioFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemdayofsaleCardBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -118,7 +119,7 @@ class DayOfSaleFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelving_getSaleDate(user, password,vShelvingFK,"itemShelving_getSaleDate")
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentFaltasBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnFaltasNichoClickListener
|
||||
import es.verdnatura.presentation.common.OnFaltasReviewClickListener
|
||||
|
@ -55,8 +56,8 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,60).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
viewModel.getFaltas(user,password,warehouseFk)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ import es.verdnatura.R
|
|||
import es.verdnatura.R.color.verdnatura_pumpkin_orange
|
||||
import es.verdnatura.R.color.verdnatura_white
|
||||
import es.verdnatura.databinding.FragmentHistoricoBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -61,8 +63,8 @@ class HistoricoArticuloFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
|
|
|
@ -7,6 +7,7 @@ package es.verdnatura.presentation.view.feature.historicoshelving.fragment
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemshelvinglogBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
@ -89,7 +90,7 @@ class itemShelvingLogFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingLog_get(user, password,vShelvingFK,"itemShelvingLog_get")
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentShelvinglogBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -93,7 +94,7 @@ class shelvingLogFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.shelvingLog_get(user, password,vShelvingFK,"shelvingLog_get")
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentHistoricovehiculoBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -49,8 +51,8 @@ class HistoricoVehiculoFragment (
|
|||
user = prefs.getString(USER,"").toString()
|
||||
userFk=prefs.getString(USERFK,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.main.activity
|
|||
//import kotlinx.android.synthetic.main.activity_main.*
|
||||
import android.content.SharedPreferences
|
||||
import android.media.MediaPlayer
|
||||
import android.util.Log.d
|
||||
import android.view.Menu
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.ContextCompat
|
||||
|
@ -25,6 +26,7 @@ import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFra
|
|||
import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersFragment
|
||||
import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityFragment
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
|
||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionShowTicketFragment
|
||||
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorFragment
|
||||
import es.verdnatura.presentation.view.feature.controlador.fragment.WebFragment
|
||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoFragment
|
||||
|
@ -41,14 +43,17 @@ import es.verdnatura.presentation.view.feature.paletizador.fragment.*
|
|||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingFragment
|
||||
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingSaleFragment
|
||||
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroFragment
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.precontrol.PreControladorFragment
|
||||
import es.verdnatura.presentation.view.feature.precontrol.ShowTicketFragment
|
||||
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.qr.QrFragment
|
||||
import es.verdnatura.presentation.view.feature.reposicion.fragment.ReposicionFragment
|
||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
import es.verdnatura.presentation.view.feature.shelvingparking.fragment.ShelvingParkingFragment
|
||||
import es.verdnatura.presentation.view.feature.smarttag.register.RegisterSmartTagsFragment
|
||||
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.AssociateSmartTagsFragment
|
||||
|
@ -75,8 +80,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
override fun init() {
|
||||
|
||||
mperror = MediaPlayer.create((this),R.raw.error)
|
||||
mpok = MediaPlayer.create((this),R.raw.ok)
|
||||
mperror = MediaPlayer.create((this), R.raw.error)
|
||||
mpok = MediaPlayer.create((this), R.raw.ok)
|
||||
|
||||
customDialog = CustomDialogMainActivity(this)
|
||||
setBottomMenu()
|
||||
|
@ -99,7 +104,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun haveSector(): Boolean {
|
||||
|
@ -246,7 +250,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
false
|
||||
)
|
||||
|
||||
// true
|
||||
// true
|
||||
}
|
||||
getString(R.string.Paletizadores) -> {
|
||||
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
|
@ -259,7 +263,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
false
|
||||
)
|
||||
|
||||
// true
|
||||
// true
|
||||
}
|
||||
getString(R.string.Ajustes) -> {
|
||||
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
|
@ -333,7 +337,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
"Ver Ticket" -> {
|
||||
addFragmentOnTop(PreControladorFragment.newInstance())
|
||||
addFragmentOnTop(ShowTicketFragment.newInstance())
|
||||
}
|
||||
"Historial del vehículo" -> {
|
||||
addFragmentOnTop(ControlVehiculoFragment.newInstance(HistoricoVehiculoFragment.TAG))
|
||||
|
@ -354,12 +358,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
"Parking" -> {
|
||||
addFragmentOnTop(ParkingFragment.newInstance())
|
||||
}
|
||||
|
||||
|
||||
"Buscar item" -> {
|
||||
addFragmentOnTop(BuscarItemFragment.newInstance(entryPoint))
|
||||
}
|
||||
// "Buscar item full" -> {
|
||||
// addFragmentOnTop(BuscarItemAllFragment.newInstance(entryPoint))
|
||||
// }
|
||||
|
||||
"Historico" -> {
|
||||
addFragmentOnTop(HistoricoArticuloFragment.newInstance(entryPoint))
|
||||
|
@ -412,10 +415,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
"Desactivado buffer" -> {
|
||||
addFragmentOnTop(BufferFragment.newInstance(item.title))
|
||||
}
|
||||
"Cargar expedición en buffer"->{
|
||||
"Cargar expedición en buffer" -> {
|
||||
addFragmentOnTop(BufferLoadFragment.newInstance("Cargar expedición en buffer"))
|
||||
}
|
||||
"Flejado buffer"->{
|
||||
"Flejado buffer" -> {
|
||||
addFragmentOnTop(BufferFragment.newInstance(item.title))
|
||||
}
|
||||
/*sergio:pruebas*/
|
||||
|
@ -424,10 +427,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
"Histórico Shelving" -> {
|
||||
addFragmentOnTop(itemShelvingLogFragment.newInstance("Histórico Shelving"))
|
||||
d("VERDNATURA::", "es el historico ")
|
||||
}
|
||||
"Log Shelving" -> {
|
||||
addFragmentOnTop(shelvingLogFragment.newInstance("Log Shelving"))
|
||||
}
|
||||
"Log Shelving" -> {
|
||||
addFragmentOnTop(shelvingLogFragment.newInstance("Log Shelving"))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -486,10 +490,20 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
}
|
||||
|
||||
|
||||
fun onParkingSaleSelected(sales: SaleVO) {
|
||||
addFragmentOnTop(ParkingSaleFragment.newInstance(SaleVO = sales))
|
||||
}
|
||||
|
||||
|
||||
override fun onCollectionSelected(collection: CollectionVO, type: String) {
|
||||
// fm.popBackStack()
|
||||
addFragmentOnTop(CollectionFragment.newInstance(collection, type))
|
||||
|
||||
if (type.equals("SHOWTICKET")) {
|
||||
addFragmentOnTop(CollectionShowTicketFragment.newInstance(collection, type))
|
||||
} else {
|
||||
addFragmentOnTop(CollectionFragment.newInstance(collection, type))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBuyerSelected(userFk: String) {
|
||||
|
@ -529,18 +543,18 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(ExpeditionStateFragment.newInstance("main"))
|
||||
|
||||
}
|
||||
fun hideBottomNavigation(visible:Int){
|
||||
|
||||
fun hideBottomNavigation(visible: Int) {
|
||||
binding.mainBottomNavigation.visibility = visible
|
||||
}
|
||||
|
||||
fun messageWithSound(message:String,isSuccess:Boolean){
|
||||
fun messageWithSound(message: String, isError: Boolean) {
|
||||
|
||||
if (isSuccess){
|
||||
mpok?.start()
|
||||
}
|
||||
else{
|
||||
mperror?.start()
|
||||
if (!isError) {
|
||||
mpok?.start()
|
||||
message.toast(this, Toast.LENGTH_SHORT)
|
||||
} else {
|
||||
mperror?.start()
|
||||
customDialog.setTitle("Error").setDescription(message)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
|
|
|
@ -12,6 +12,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionPalletDetailBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
@ -63,8 +65,8 @@ class ExpeditionPalletDetailFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
SectorDescription=prefs.getString(SECTORDESCRIP,"Sin Sector").toString()
|
||||
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionPalletBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
|
@ -72,8 +73,8 @@ class ExpeditionPalletFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,60).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -14,6 +14,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionScanBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -68,8 +70,8 @@ class ExpeditionScanFragment (
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -18,6 +18,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnItemExpeditionStateRowClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -95,7 +96,7 @@ class ExpeditionStateFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
// this.itemFk = itemFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expedition_getStateJSON(expeditionFk, user, password,"expedition_getState")
|
||||
|
|
|
@ -12,6 +12,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionTruckListBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -54,8 +56,8 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentParkingBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.hideKeyboard
|
||||
|
@ -149,8 +151,8 @@ class ParkingFragment : BaseFragment<FragmentParkingBinding,ParkingViewModel>(Pa
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/*package es.verdnatura.presentation.view.feature.parking.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.databinding.ItemBarcodeRowBinding
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
/*
|
||||
|
||||
class ParkingAdapter (
|
||||
private val items: List<BarcodeVO>,
|
||||
private val onBarcodeRowClickListener: OnBarcodeRowClickListener
|
||||
): RecyclerView.Adapter<ParkingAdapter.ItemHolder> () {
|
||||
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||
return ItemHolder(
|
||||
ItemBarcodeRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
|
||||
)
|
||||
}
|
||||
|
||||
override fun getItemCount() =items.size
|
||||
|
||||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
holder.binding.root.setOnClickListener {
|
||||
onBarcodeRowClickListener.onBarcodeRowClickListener(items[position])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inner class ItemHolder(
|
||||
val binding: ItemBarcodeRowBinding
|
||||
) : RecyclerView.ViewHolder(binding.root){
|
||||
fun bind(item: BarcodeVO) {
|
||||
binding.apply {
|
||||
this.item = item
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
|
@ -0,0 +1,167 @@
|
|||
package es.verdnatura.presentation.view.feature.parking.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import android.content.SharedPreferences
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentParkingBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.hideKeyboard
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.parking.adapter.ParkingAdapter
|
||||
|
||||
class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewModel>(ParkingSaleViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var scanerList:ArrayList<BarcodeVO> = ArrayList()
|
||||
private var adapter : ParkingAdapter? = null
|
||||
private var numParking : Int = 0
|
||||
var mperror: MediaPlayer? = null
|
||||
var mpok: MediaPlayer? = null
|
||||
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_parking
|
||||
companion object {
|
||||
fun newInstance(SaleVO: Any?) = ParkingFragment()
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
setEvents()
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.Parking)
|
||||
//sergio: después de las últimas actualizaciones se queda activo. Se cambia opción visibilidad.
|
||||
//viewModel.hideProgressLoading()
|
||||
binding.splashProgress.visibility=View.GONE
|
||||
setList()
|
||||
customDialog = CustomDialog(requireContext())
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
checkScan(binding.scanInput.text.toString())
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
requireActivity().hideKeyboard()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
mperror?.start()
|
||||
// binding.splashProgress.visibility = View.GONE
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
numParking -= 1
|
||||
if (numParking <= 0) {
|
||||
// binding.splashProgress.visibility = View.GONE
|
||||
//viewModel.hideProgressLoading()
|
||||
mpok?.start()
|
||||
setList()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
isLoading.observe(viewLifecycleOwner, Observer {
|
||||
if (it){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
}else{
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
isLoadingProgress.observe(viewLifecycleOwner, {
|
||||
|
||||
binding.splashProgress.visibility = it
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun setList(){
|
||||
scanerList = ArrayList()
|
||||
adapter = ParkingAdapter(scanerList,object: OnBarcodeRowClickListener{
|
||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||
scanerList.removeAt(scanerList.indexOf(item))
|
||||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
})
|
||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
binding.fragmentParkingScanList.adapter = adapter
|
||||
binding.fragmentParkingScanList.layoutManager = lm
|
||||
}
|
||||
|
||||
private fun checkScan(txtScan:String){
|
||||
var isParking:Boolean = false
|
||||
if (txtScan.trim().length == 4 && isLetter(txtScan.substring(txtScan.length - 1)) || txtScan.contains("-")){
|
||||
isParking = true
|
||||
}
|
||||
|
||||
if (isParking){
|
||||
numParking = scanerList.size
|
||||
scanerList.forEach {
|
||||
// binding.splashProgress.visibility = View.VSIIBLE
|
||||
viewModel.parking(
|
||||
usuario = user,
|
||||
password = password,
|
||||
parking = txtScan,
|
||||
scanItem = it.code!!,callFunction = "shelvingPark"
|
||||
)
|
||||
}
|
||||
}else{
|
||||
scanerList.add(BarcodeVO(code = txtScan))
|
||||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
@Throws(NumberFormatException::class)
|
||||
fun isLetter(text: String): Boolean {
|
||||
return text.matches("[a-zA-Z ]+".toRegex())
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package es.verdnatura.presentation.view.feature.parking.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class ParkingSaleViewModel(context: Context) : BaseViewModel() {
|
||||
private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase(context)
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
private val _isLoading by lazy { MutableLiveData<Boolean>() }
|
||||
val isLoading: LiveData<Boolean> = _isLoading
|
||||
|
||||
private val _isLoadingProgress by lazy { MutableLiveData<Int>() }
|
||||
val isLoadingProgress: LiveData<Int> = _isLoadingProgress
|
||||
|
||||
|
||||
private val _responseParkingAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseParkingAdd: LiveData<ResponseItemVO>
|
||||
get() = _responseParkingAdd
|
||||
|
||||
|
||||
private fun showProgressLoading() {
|
||||
_isLoading.value = true
|
||||
}
|
||||
|
||||
fun hideProgressLoading() {
|
||||
_isLoading.value = false
|
||||
}
|
||||
fun ProgressLoading(visibility:Int) {
|
||||
_isLoadingProgress.value = visibility
|
||||
}
|
||||
|
||||
fun parking(usuario: String,password: String,scanItem: String,parking:String,callFunction:String){
|
||||
ProgressLoading(VISIBLE)
|
||||
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
|
||||
Callback<String> {
|
||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||
ProgressLoading(GONE)
|
||||
if (response.body() == null){
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
|
||||
}else{
|
||||
if (response.body() == "Finish")
|
||||
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||
else
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
fun saleParking_add(usuario: String, password: String, sales:List<String>,parking: String,callFunction:String)
|
||||
{
|
||||
getUbicadorUserCase.saleParking_add(usuario, password, sales, parking)
|
||||
.enqueue(object : Callback<String>
|
||||
{
|
||||
override fun onFailure(call: Call<String>, t: Throwable)
|
||||
{
|
||||
_responseParkingAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<String>, response: Response<String>)
|
||||
{
|
||||
if (response.body() == null)
|
||||
{
|
||||
_responseParkingAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,response.message())
|
||||
)
|
||||
} else
|
||||
{
|
||||
_responseParkingAdd.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -30,12 +30,12 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
|||
*/
|
||||
|
||||
|
||||
_pasillerositem.add(
|
||||
/* _pasillerositem.add(
|
||||
PasillerosItemVO(7,
|
||||
R.drawable.ic_streetview_black_24dp,
|
||||
"Pre Control",R.string.precontrolprevious)
|
||||
)
|
||||
|
||||
*/
|
||||
|
||||
//sergio para que aparezca el nuevo menu
|
||||
|
||||
|
|
|
@ -3,13 +3,14 @@ package es.verdnatura.presentation.view.feature.precontrol
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentControladorBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -18,7 +19,7 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
|||
/*import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class PreControladorFragment: BaseFragment<FragmentControladorBinding,PreControladorViewModel>(PreControladorViewModel::class) {
|
||||
class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicketViewModel>(ShowTicketViewModel::class) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
|
@ -46,7 +47,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,PreControl
|
|||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog = CustomDialog(requireContext())
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.verticket)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.precontrolprevious)
|
||||
setEvents()
|
||||
super.init()
|
||||
}
|
||||
|
@ -60,8 +61,8 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,PreControl
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
type=ConstAndValues.PRECHECKER
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
@ -74,7 +75,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,PreControl
|
|||
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
goBack=false;
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,6 +2,7 @@ package es.verdnatura.presentation.view.feature.presacador.fragment
|
|||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.util.Log.d
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetLoginUserCase
|
||||
|
@ -25,6 +26,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
private val getPreSacadorUseCase: GetPreSacadorUseCase = GetPreSacadorUseCase(context)
|
||||
private val getSacadorControladorUserCase: GetSacadorControladorUserCase =
|
||||
GetSacadorControladorUserCase(context)
|
||||
|
||||
private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase(context)
|
||||
private val getLoginUserCase: GetLoginUserCase = GetLoginUserCase(context)
|
||||
|
||||
|
@ -36,6 +38,11 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
|
||||
private val _responseParkingAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseParkingAdd: LiveData<ResponseItemVO>
|
||||
get() = _responseParkingAdd
|
||||
|
||||
private val _placementSuppleyList by lazy { MutableLiveData<PlacementSupplyListVO>() }
|
||||
val placementSuppleyList: LiveData<PlacementSupplyListVO>
|
||||
get() = _placementSuppleyList
|
||||
|
@ -60,6 +67,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
{
|
||||
override fun onFailure(call: Call<List<PreSacadorItemVO>>, t: Throwable)
|
||||
{
|
||||
d("VERDNATURA::","ha fallado")
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
|
||||
|
@ -70,9 +78,11 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
{
|
||||
if (response.body() != null)
|
||||
{
|
||||
d("VERDNATURA::","entra con lineas")
|
||||
_salesList.value = response.body()?.let { it }
|
||||
} else
|
||||
{
|
||||
d("VERDNATURA::","ES NULO")
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
}
|
||||
|
@ -147,6 +157,37 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
fun saleParking_add(usuario: String, password: String, sales:List<String>,parking: String,callFunction:String)
|
||||
{
|
||||
getUbicadorUserCase.saleParking_add(usuario, password, sales, parking)
|
||||
.enqueue(object : Callback<String>
|
||||
{
|
||||
override fun onFailure(call: Call<String>, t: Throwable)
|
||||
{
|
||||
_responseParkingAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<String>, response: Response<String>)
|
||||
{
|
||||
if (response.body() == null)
|
||||
{
|
||||
_responseParkingAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,response.message())
|
||||
)
|
||||
} else
|
||||
{
|
||||
_responseParkingAdd.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemPlacementSupplyAiming(
|
||||
usuario: String,
|
||||
password: String,
|
||||
|
|
|
@ -13,7 +13,9 @@ class PreSacadorItemVO (
|
|||
var picked : Int = 45,
|
||||
var idMovimiento : String = "",
|
||||
var trabajador : String = "",
|
||||
var carros : List<PlacementVO> = listOf()
|
||||
var carros : List<PlacementVO> = listOf(),
|
||||
var priority:Int =0,
|
||||
var pickingOrder:Int =0
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ import androidx.lifecycle.Observer
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentQrBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
@ -67,8 +69,8 @@ class QrFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
type = ConstAndValues.PRECHECKER
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ReposicionFragmentBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -94,8 +96,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
|
|
|
@ -10,6 +10,8 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentSacadorBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -58,8 +60,8 @@ class SacadorFragment :
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
wagons = prefs.getInt(WAGON, 2).toString()
|
||||
//sergio:listener para collectionnew
|
||||
/* setFragmentResultListener("requestKey") { key, bundle ->
|
||||
|
|
|
@ -9,7 +9,8 @@ class CollectionVO(
|
|||
var created: String = "",
|
||||
var tickets: List<TicketVO> = listOf(),
|
||||
var isError: Boolean = false,
|
||||
var errorMessage: String = ""
|
||||
var errorMessage: String = "",
|
||||
var itemPackingTypeFk:String=""
|
||||
)
|
||||
|
||||
class TicketVO(
|
||||
|
@ -57,7 +58,10 @@ class SaleVO(
|
|||
var packingType: String = "",
|
||||
var cel1: String = "",
|
||||
var cel2: String = "",
|
||||
var cel3: String = ""
|
||||
var cel3: String = "",
|
||||
var saleGroupFk: String = "",
|
||||
var packingShelve:String=""
|
||||
|
||||
)
|
||||
|
||||
class PlacementVO(
|
||||
|
@ -76,7 +80,8 @@ class PlacementVO(
|
|||
var isPreviousPrepared: String = "",
|
||||
var itemShelvingSaleFk: String = "",
|
||||
var ticketFk: String = "",
|
||||
var id: String = ""
|
||||
var id: String = "",
|
||||
var pickingOrder:Int=0
|
||||
)
|
||||
|
||||
class PlacementSupplyVO(
|
||||
|
|
|
@ -8,6 +8,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentShelvingParkingBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -44,8 +46,8 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
package es.verdnatura.presentation.view.feature.precontrol
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentControladorBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class ShowTicketFragment: BaseFragment<FragmentControladorBinding,ShowTicketViewModel>(ShowTicketViewModel::class) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack:Boolean = false
|
||||
private var onCollectionSelectedListener : OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_controlador
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var type = ""
|
||||
|
||||
companion object {
|
||||
fun newInstance() = ShowTicketFragment()
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
if (context is OnCollectionSelectedListener) onCollectionSelectedListener = context
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog = CustomDialog(requireContext())
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.verticket)
|
||||
setEvents()
|
||||
super.init()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
goBack = true
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
type=ConstAndValues.VERTICKET
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
goBack=false;
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
usuario = user,
|
||||
password = password,
|
||||
sectorFk = sectorFk,
|
||||
collectionFk = binding.scanInput.text.toString(),
|
||||
type = type,
|
||||
callFunction = "collection_getTickets"
|
||||
)
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.scanInput)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (!goBack)navigateToCollectionList(it)
|
||||
goBack = false
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun navigateToCollectionList(collection: CollectionVO){
|
||||
onCollectionSelectedListener?.onCollectionSelected(collection, ConstAndValues.VERTICKET)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package es.verdnatura.presentation.view.feature.precontrol
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.domain.GetPreControladorUserCase
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class ShowTicketViewModel(context: Context) : BaseViewModel() {
|
||||
|
||||
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
||||
private val getPreControladorUserCase: GetPreControladorUserCase = GetPreControladorUserCase(context)
|
||||
|
||||
val collectionTicketList: LiveData<CollectionVO>
|
||||
get() = _collectionTicketList
|
||||
|
||||
private val _responseTicket by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseTicket: LiveData<ResponseItemVO>
|
||||
get() = _responseTicket
|
||||
|
||||
fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String,callFunction:String){
|
||||
getPreControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object :
|
||||
Callback<CollectionVO> {
|
||||
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||
_collectionTicketList.value = CollectionVO(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!))
|
||||
}
|
||||
override fun onResponse(
|
||||
call: Call<CollectionVO>,
|
||||
response: Response<CollectionVO>
|
||||
) {
|
||||
if (response.body() != null){
|
||||
_collectionTicketList.value = response.body()?.let { it.map() }
|
||||
}else{
|
||||
_collectionTicketList.value = CollectionVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -12,6 +12,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentSacadorAssociatesmarttagBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -167,8 +169,8 @@ class RegisterSmartTagsFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -164,8 +166,8 @@ class AssociateSmartTagsFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentAutomaticAddItemBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnAutomaticItemClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -46,8 +48,8 @@ class AutomaticAddItemFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogUbicador = CustomDialogUbicador(requireContext())
|
||||
|
|
|
@ -13,6 +13,8 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentUbicadorBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
@ -72,8 +74,8 @@ class UbicadorFragment(
|
|||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogUbicador = CustomDialogUbicador(requireContext())
|
||||
|
@ -196,7 +198,7 @@ class UbicadorFragment(
|
|||
|
||||
}
|
||||
|
||||
binding.editPrioridad.setOnClickListener {
|
||||
binding.editImg.setOnClickListener {
|
||||
customDialogInput.setTitle("Cambiar matrícula").setValue("").setOkButton("Guardar"){
|
||||
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue(),"shelvingChange")
|
||||
shelvingFk = customDialogInput.getValue()
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
<solid android:color="@android:color/black" />
|
||||
<stroke android:width="1dip"
|
||||
android:color="@color/verdnatura_warm_grey"/>
|
||||
</shape>
|
|
@ -0,0 +1,8 @@
|
|||
<!-- drawable/eraser.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#FFF" android:pathData="M16.24,3.56L21.19,8.5C21.97,9.29 21.97,10.55 21.19,11.34L12,20.53C10.44,22.09 7.91,22.09 6.34,20.53L2.81,17C2.03,16.21 2.03,14.95 2.81,14.16L13.41,3.56C14.2,2.78 15.46,2.78 16.24,3.56M4.22,15.58L7.76,19.11C8.54,19.9 9.8,19.9 10.59,19.11L14.12,15.58L9.17,10.63L4.22,15.58Z" />
|
||||
</vector>
|
|
@ -83,6 +83,15 @@
|
|||
android:gravity="right"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Carro"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -121,7 +121,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
|
||||
<View
|
||||
android:id="@+id/item_article_row_semaforo_pre"
|
||||
|
@ -146,6 +147,8 @@
|
|||
</LinearLayout>
|
||||
|
||||
<!--CONTENIDO=================================================-->
|
||||
<!--app:layout_constraintEnd_toStartOf="@+id/item_article_quantity_picked"-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_article_itemFk"
|
||||
android:layout_width="0dp"
|
||||
|
@ -157,11 +160,41 @@
|
|||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/h6"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/item_article_quantity_picked"
|
||||
app:layout_constraintStart_toEndOf="@+id/linearLayout3"
|
||||
app:layout_constraintStart_toEndOf="@+id/linearLayout3"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:maxLines="1"/>
|
||||
<TextView
|
||||
android:id="@+id/item_packing_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||
android:paddingTop="2dp"
|
||||
android:text="En balda:"
|
||||
tool:text="En balda:"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/h7"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/item_packing_itemFk"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_article_itemFk"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:maxLines="1"/>
|
||||
<TextView
|
||||
android:id="@+id/item_packing_itemFk"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||
android:text="@{sale.packingShelve}"
|
||||
tool:text="Number"
|
||||
android:paddingTop="2dp"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/h7"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/item_article_quantity_picked"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_packing_text"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:maxLines="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_article_quantity_picked"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -190,14 +223,15 @@
|
|||
android:id="@+id/item_article_quantity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||
android:layout_marginEnd="@dimen/layout_margin_1"
|
||||
android:text="@{sale.quantity}"
|
||||
tool:text="10"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/h6"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_article_quantity_line1"
|
||||
|
@ -219,7 +253,7 @@
|
|||
android:id="@+id/item_article_cel1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||
android:layout_marginEnd="@dimen/layout_margin_1"
|
||||
android:text="@{sale.cel1}"
|
||||
tool:text="cel1"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
|
@ -252,7 +286,7 @@
|
|||
android:id="@+id/item_article_cel2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||
android:layout_marginEnd="@dimen/layout_margin_1"
|
||||
android:text="@{sale.cel2}"
|
||||
tool:text="cel2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
|
@ -268,7 +302,7 @@
|
|||
android:id="@+id/item_article_quantity_line3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/layout_margin_min"
|
||||
android:layout_marginStart="@dimen/layout_margin_1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{sale.line3}"
|
||||
|
@ -284,7 +318,7 @@
|
|||
android:id="@+id/item_article_cel3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||
android:layout_marginEnd="@dimen/layout_margin_1"
|
||||
android:text="@{sale.cel3}"
|
||||
tool:text="cel3"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
|
@ -293,7 +327,25 @@
|
|||
app:layout_constraintEnd_toEndOf="@+id/item_article_quantity_line3"
|
||||
app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line3" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayoutColor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
|
||||
<View
|
||||
android:id="@+id/item_ticketColor"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="@dimen/ticketColor_height"
|
||||
android:background="@drawable/border"
|
||||
android:layout_marginBottom="1dp"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<LinearLayout
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.shelvingFk}"
|
||||
|
|
|
@ -84,6 +84,10 @@
|
|||
<dimen name="semaforo_width">20dp</dimen>
|
||||
<dimen name="semaforo_height">30dp</dimen>
|
||||
|
||||
<!-- Pintar ticket -->
|
||||
<dimen name="ticketColor_height">90dp</dimen>
|
||||
<dimen name="ticketColor_width">10dp</dimen>
|
||||
|
||||
|
||||
|
||||
</resources>
|
Loading…
Reference in New Issue