Version 8.8Beta precio coste artículo, modificar tallos, mensajes error para items sin buyFk y ticket eliminado o viejo
This commit is contained in:
parent
e41a12e7a9
commit
6841dd28be
|
@ -66,6 +66,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_chevron_right_black_24dp.xml" value="0.1775" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_claim_ui.xml" value="0.186" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_claims.xml" value="0.2425" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_cmr.xml" value="0.267" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_controller_ui.xml" value="0.212" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_controller_ui_selected.xml" value="0.212" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_corridor_ui.xml" value="0.186" />
|
||||
|
@ -172,7 +173,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionscan_sorter.xml" value="0.196875" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionstate.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_faltas.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_general_black.xml" value="0.20878623188405798" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_general_black.xml" value="0.264" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historico.xml" value="0.1734375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historicovehiculo.xml" value="0.23052536231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary.xml" value="0.1" />
|
||||
|
|
|
@ -13,17 +13,9 @@ android {
|
|||
applicationId "es.verdnatura"
|
||||
minSdkVersion 21 //21
|
||||
targetSdkVersion 30
|
||||
versionCode 127
|
||||
versionName = "8.7Beta"
|
||||
//versionName = "8.6.1Beta" versionCode 126
|
||||
//versionName = "8.5.1Beta" versionCode 122
|
||||
//versionName = "8.5Beta" //versionCode 121
|
||||
//versionName = "8.4"// versionCode 120
|
||||
//versionName "8.4.2Beta" versioncode 119
|
||||
//versionName "8.4.1Beta" //versionCode 118: arreglat rocket a Alex i llevat callFunction,strings ok
|
||||
//versionName "8.4Beta" //versionCode 117: return i workerAppTester
|
||||
//versionName "8.3" //versionCode 116: versionCode 116: cambios finales en return, diseño grafico...
|
||||
|
||||
versionCode 128
|
||||
versionName = "8.8Beta"
|
||||
//versionName = "8.7Beta" versionCode 127
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 127,
|
||||
"versionName": "8.7Beta",
|
||||
"versionCode": 128,
|
||||
"versionName": "8.8Beta",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
|
Binary file not shown.
|
@ -112,6 +112,11 @@ val viewModelModule = module {
|
|||
ExpeditionScanSorterViewModel(androidContext())
|
||||
}
|
||||
|
||||
|
||||
viewModel {
|
||||
CmrExpeditionPalletViewModel(androidContext())
|
||||
}
|
||||
|
||||
viewModel {
|
||||
BufferFragmentViewModel(androidContext())
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ object ConstAndValues {
|
|||
const val PRECHECKER = "PRECHECKER"
|
||||
const val MAINACTIVITY = "MAIN"
|
||||
const val VERTICKET = "SHOWTICKET"
|
||||
const val SECTORFKDEFAULT=37
|
||||
const val WAREHOUSEFKDEFAULT=1
|
||||
const val SECTORFKDEFAULT=0
|
||||
const val WAREHOUSEFKDEFAULT=60
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ class GetItemCardUserCase(context: Context) : RestClient(context) {
|
|||
params = params
|
||||
)
|
||||
}
|
||||
fun itemSaveMin(
|
||||
fun item_saveStems(
|
||||
usuario: String,
|
||||
password: String,
|
||||
itemFk: String,
|
||||
|
@ -229,7 +229,7 @@ class GetItemCardUserCase(context: Context) : RestClient(context) {
|
|||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(itemFk)
|
||||
params.add(value)
|
||||
return restClient!!.itemSaveMin(
|
||||
return restClient!!.item_saveStems(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
|
|
|
@ -41,6 +41,26 @@ class GetPaletizadoresUserCase(context: Context) : RestClient(context) {
|
|||
)
|
||||
}
|
||||
|
||||
//informar cmr paletizadores
|
||||
fun cmrExpeditionPallet_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vExpeditionPallet: String,
|
||||
vCmrId: String
|
||||
): Call<Void> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(vExpeditionPallet)
|
||||
params.add(vCmrId)
|
||||
|
||||
return restClient!!.cmrExpeditionPallet_add(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}
|
||||
//expedition
|
||||
|
||||
fun expedition_getState(
|
||||
|
@ -78,7 +98,7 @@ class GetPaletizadoresUserCase(context: Context) : RestClient(context) {
|
|||
}
|
||||
|
||||
fun expeditionTruckList(usuario: String, password: String): Call<List<ItemExpeditionTruckVO>> {
|
||||
// val params: ArrayList<String> = ArrayList()
|
||||
// val params: ArrayList<String> = ArrayList()
|
||||
return restClient!!.expeditionTruckList("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
|
||||
|
@ -259,7 +279,7 @@ class GetPaletizadoresUserCase(context: Context) : RestClient(context) {
|
|||
usuario: String,
|
||||
password: String,
|
||||
vPalletFk: String,
|
||||
vStateCode:String
|
||||
vStateCode: String
|
||||
|
||||
|
||||
): Call<Unit> {
|
||||
|
|
|
@ -750,8 +750,8 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Boolean>*/
|
||||
|
||||
@POST("almacennew/itemSaveMin")//REVISADA
|
||||
fun itemSaveMin(
|
||||
@POST("almacennew/item_saveStems")//REVISADA
|
||||
fun item_saveStems(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
|
@ -1131,6 +1131,17 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Void>
|
||||
|
||||
@POST("almacennew/cmrExpeditionPallet_add")//REVISADA
|
||||
fun cmrExpeditionPallet_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>
|
||||
|
||||
@POST("almacennew/expedition_getState")//REVISADA
|
||||
fun expedition_getState(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
|
|
@ -31,6 +31,7 @@ import es.verdnatura.R
|
|||
import es.verdnatura.databinding.ToolbarFragmentBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.common.mediaCurrentVolume
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
@ -524,7 +525,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
USER->prefs.getString(USER, "").toString()
|
||||
PASSWORD -> prefs.getString(PASSWORD, "").toString()
|
||||
SECTORFK->prefs.getInt(name, SECTORFKDEFAULT).toString()
|
||||
WAREHOUSEFK->prefs.getInt(name, ConstAndValues.WAREHOUSEFKDEFAULT).toString()
|
||||
WAREHOUSEFK->prefs.getInt(name, WAREHOUSEFKDEFAULT).toString()
|
||||
//VOZ->prefs.getString(name, "NO").toString()
|
||||
WAGON->prefs.getInt(name, 2).toString()
|
||||
TAGSTYPE-> prefs.getString(name, getString(R.string.stickers)).toString()
|
||||
|
|
|
@ -65,7 +65,13 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
|
|||
|
||||
return this
|
||||
}
|
||||
fun setEnableValue(isEnabled: Boolean): CustomDialogInputTwoValues {
|
||||
|
||||
binding.customDialogValue.isEnabled=isEnabled
|
||||
|
||||
|
||||
return this
|
||||
}
|
||||
fun setTitle(title: String): CustomDialogInputTwoValues {
|
||||
|
||||
binding.customDialogTitle.visibility = View.VISIBLE
|
||||
|
@ -109,14 +115,25 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
|
|||
fun setInputTextTwo() {
|
||||
binding.customDialogValueTwo.inputType = InputType.TYPE_CLASS_NUMBER
|
||||
}
|
||||
fun setInfoTex(text:String){
|
||||
binding.textinputlayoutUsername.hint = text
|
||||
}
|
||||
|
||||
fun setInfoTextTwo(text:String){
|
||||
binding.textinputlayoutTwo.hint = text
|
||||
}
|
||||
|
||||
|
||||
fun setInputTextTwoVisibility() {
|
||||
binding.textinputlayoutTwo.visibility = View.VISIBLE
|
||||
}
|
||||
fun setInputTextVisibility(visibility:Int) {
|
||||
binding.textinputlayoutTwo.visibility = visibility
|
||||
}
|
||||
|
||||
/* fun setFocusText() {
|
||||
fun setFocusText() {
|
||||
binding.customDialogValue.requestFocus()
|
||||
}*/
|
||||
}
|
||||
|
||||
fun setFocusTextTwo() {
|
||||
binding.customDialogValueTwo.requestFocus()
|
||||
|
|
|
@ -65,10 +65,7 @@ class ItemCardFragment(
|
|||
ma.hideBottomNavigation(GONE)
|
||||
|
||||
setEvents()
|
||||
//toolbar_title.text = getString(R.string.ConsultarArticulo)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.titleItemConsult)
|
||||
|
||||
//customDialog = CustomDialog(requireContext())
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
customDialogTwo = CustomDialogTwoButtons(requireContext())
|
||||
|
@ -214,7 +211,7 @@ class ItemCardFragment(
|
|||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
|
||||
} else {
|
||||
if (it.id != "0") {
|
||||
if (!it.id.isNullOrEmpty()) {
|
||||
binding.itemcardLayout.visibility = View.VISIBLE
|
||||
setItemCard(it)
|
||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||
|
@ -270,7 +267,6 @@ class ItemCardFragment(
|
|||
itemInfoG = itemInfo
|
||||
binding.mainToolbar.toolbarTitle.text = itemInfo.id + "-" + itemInfo.longName
|
||||
titleImage = itemInfo.id + "-" + itemInfo.longName
|
||||
// binding.itemcardImage.setImageDrawable(resources.getDrawable(R.drawable.loadphoto,resources.newTheme()))
|
||||
binding.itemcardImage.loadUrl(itemInfo.urlImage200)
|
||||
urlLarge = itemInfo.urlImage
|
||||
binding.itemcardTag1.text = itemInfo.size
|
||||
|
@ -337,6 +333,14 @@ class ItemCardFragment(
|
|||
action = "itemStockUpdate"
|
||||
)
|
||||
)
|
||||
listItemsRow.add(
|
||||
ItemCardRowVO(
|
||||
title = getString(R.string.itemCost),
|
||||
value = itemInfo.itemCost,
|
||||
isEditable = false,
|
||||
action = ""
|
||||
)
|
||||
)
|
||||
|
||||
//EDITABLES
|
||||
|
||||
|
@ -389,15 +393,15 @@ class ItemCardFragment(
|
|||
action = "updatePacking"
|
||||
)
|
||||
)
|
||||
/* sergio: quitar de back cuando ya tengan la app actualizada todos
|
||||
//sergio: quitar de back cuando ya tengan la app actualizada todos
|
||||
listItemsRow.add(
|
||||
ItemCardRowVO(
|
||||
title = getString(R.string.MINIMO),
|
||||
value = itemInfo.min,
|
||||
title = getString(R.string.stems),
|
||||
value = itemInfo.stems,
|
||||
isEditable = true,
|
||||
action = "itemSaveMin"
|
||||
action = "itemSaveStem"
|
||||
)
|
||||
)*/
|
||||
)
|
||||
listItemsRow.add(
|
||||
ItemCardRowVO(
|
||||
title = getString(R.string.Referencia),
|
||||
|
@ -446,7 +450,7 @@ class ItemCardFragment(
|
|||
} else {
|
||||
if (item.action != "toBarcode" && item.action != "buscarItem" && item.action != "itemStockUpdateAdd" && item.action != "itemStockUpdateRemove") {
|
||||
customDialogInput.setTitle(item.title!!)
|
||||
.setDescription(getString(R.string.currentVAlue) + item.value!!)
|
||||
.setDescription(getString(R.string.currentVAlue) + if(item.value.isNullOrEmpty()) "" else{item.value})
|
||||
.setOkButton(getString(R.string.save)) {
|
||||
ma.hideKeyboard(customDialogInput.getEditText())
|
||||
editItemCardRow(item, customDialogInput.getValue())
|
||||
|
@ -576,7 +580,7 @@ class ItemCardFragment(
|
|||
value = value,
|
||||
warehouseFk = warehouseFk
|
||||
)
|
||||
"itemSaveMin" -> viewModel.itemSaveMin(
|
||||
"itemSaveStem" -> viewModel.item_saveStems(
|
||||
itemFk = itemFk,
|
||||
user = user,
|
||||
password = password,
|
||||
|
|
|
@ -48,15 +48,17 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
|
|||
override fun onFailure(call: Call<ItemCardVO>, t: Throwable) {
|
||||
_itemcard.value = ItemCardVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!),
|
||||
stems = ""
|
||||
, itemCost = "")
|
||||
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<ItemCardVO>, response: Response<ItemCardVO>) {
|
||||
|
||||
|
||||
if (response.body() != null) {
|
||||
if (response.body() != null ) {
|
||||
|
||||
_itemcard.value = response.body()!!
|
||||
} else {
|
||||
_itemcard.value = ItemCardVO(
|
||||
|
@ -64,7 +66,9 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
|
|||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
),
|
||||
stems = "",
|
||||
itemCost = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -346,14 +350,14 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
|
|||
})
|
||||
}
|
||||
|
||||
fun itemSaveMin(
|
||||
fun item_saveStems(
|
||||
itemFk: String,
|
||||
user: String,
|
||||
password: String,
|
||||
value: String
|
||||
|
||||
) {
|
||||
getItemCardUserCase.itemSaveMin(user, password, itemFk, value)
|
||||
getItemCardUserCase.item_saveStems(user, password, itemFk, value)
|
||||
.enqueue(object : Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package es.verdnatura.presentation.view.feature.articulo.model
|
||||
|
||||
class ItemCardVO (
|
||||
var id:String = "0",
|
||||
var id:String = "",
|
||||
var longName:String = "0",
|
||||
var value5:String = "",
|
||||
var value6:String = "0",
|
||||
var value7:String = "0",
|
||||
var image:String = "0",
|
||||
var size:String = "0",
|
||||
var stems:String = "0",
|
||||
var stems:String?,
|
||||
var itemCost:String?,
|
||||
var category:String = "0",
|
||||
var producer:String = "0",
|
||||
var origin:String = "0",
|
||||
|
|
|
@ -887,7 +887,7 @@ class CollectionFragment(
|
|||
for (s in sales) {
|
||||
Log.d(
|
||||
"VERDNATURA::",
|
||||
"El item es ${s.itemFk} y su picked ${s.picked} y saleorder ${s.saleOrder}"
|
||||
"La sale es ${s.saleFk} El item es ${s.itemFk} y su picked ${s.picked} y saleorder ${s.saleOrder}"
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
|
@ -222,6 +223,7 @@ class CollectionShowTicketFragment(
|
|||
}
|
||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||
|
||||
|
||||
saleAdapter =
|
||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ fun CollectionVO.map(context: Context): CollectionVO {
|
|||
}
|
||||
} catch (e: Exception) {
|
||||
this.isError = true
|
||||
if (this.tickets.isEmpty()) {
|
||||
this.errorMessage = context.getString(R.string.collectionNoTickets)
|
||||
if (this.tickets.isNullOrEmpty()) {
|
||||
this.errorMessage = context.getString(R.string.collectionNoTicketsError)
|
||||
} else {
|
||||
|
||||
this.errorMessage =
|
||||
|
|
|
@ -70,13 +70,18 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
saveData(
|
||||
"base_urlSalix",
|
||||
"https://test-salix.verdnatura.es/api/"
|
||||
// "https://test-salix.verdnatura.es/" //localhost desde emulador 10.0.2.2:3000
|
||||
// "http://localhost:3000/api/"
|
||||
//"http://10.0.2.2:3000/api/" //-> desde emulador 10.0.2.2:3000
|
||||
)
|
||||
|
||||
} else {
|
||||
saveData(
|
||||
"base_urlSalix",
|
||||
/*working_in_test*/
|
||||
"https://salix.verdnatura.es/api/"
|
||||
/*working_in_test*/
|
||||
// "http://localhost:3000/api/"
|
||||
//"http://10.0.2.2:3000/api/" //-> desde emulador 10.0.2.2:3000
|
||||
)
|
||||
|
||||
}
|
||||
|
@ -154,10 +159,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
) {
|
||||
val openURL = Intent(Intent.ACTION_VIEW)
|
||||
openURL.data =
|
||||
// sergio Redmine Tarea #3730
|
||||
//Uri.parse("https://app.verdnatura.es/bin/vn-picking.apk")
|
||||
Uri.parse(it.url)
|
||||
//Log.d("VERDNATURA::","Datos"+ openURL.data)
|
||||
startActivity(openURL)
|
||||
|
||||
}
|
||||
|
@ -294,12 +296,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
|
||||
if (it.isError) {
|
||||
removeSector()
|
||||
//Log.d("VERDNATURA::",getString(R.string.error))
|
||||
} else {
|
||||
if (it.id != 0) {
|
||||
saveDataInt(SECTORFK, it.id)
|
||||
saveData(SECTORDESCRIP, it.description)
|
||||
it.warehouseFk?.let { it1 -> saveDataInt("warehouseFk", it1) }
|
||||
it.warehouseFk?.let { it1 -> saveDataInt(WAREHOUSEFK, it1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -411,14 +411,12 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
) {
|
||||
|
||||
if (!response.isSuccessful){
|
||||
d("El sector is not successfull")
|
||||
_workergetSector.value= SectorItemVO(0,"",0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
)
|
||||
}else{
|
||||
|
||||
d("El sector is successfull")
|
||||
_workergetSector.value = response.body()?.let { SectorItemVO(it.id,it.description,it.warehouseFk,isError = false) }
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.main.activity
|
|||
|
||||
import android.content.SharedPreferences
|
||||
import android.media.MediaPlayer
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.ContextCompat
|
||||
|
@ -504,6 +505,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
getString(R.string.titleReUbicator) -> {
|
||||
addFragmentOnTop(ReubicationFragment.newInstance(item.title))
|
||||
}
|
||||
getString(R.string.titleCMRState) -> {
|
||||
addFragmentOnTop(CmrExpeditionPalletFragment.newInstance(item.title))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -548,6 +552,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
override fun onPalletClickListener(itemTruck: ItemExpeditionTruckVO, itemPallet: ItemPalletVO) {
|
||||
//Tarea #4125
|
||||
//Log.d("VERDNATURA::","Entrando en pallet2")
|
||||
addFragmentOnTop(ExpeditionScanFragment.newInstance(itemTruck, itemPallet))
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
|
@ -11,6 +12,7 @@ import es.verdnatura.presentation.common.OnComprobarPalletViewClickListener
|
|||
import es.verdnatura.presentation.common.OnPalletClickListener
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
import timber.log.Timber.d
|
||||
|
||||
class ExpeditionPalletAdapter (
|
||||
private val items: List<ItemPalletVO>,
|
||||
|
@ -32,6 +34,8 @@ class ExpeditionPalletAdapter (
|
|||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
holder.binding.root.setOnClickListener {
|
||||
//Tarea #4125
|
||||
Log.d("VERDNATURA::","Entrando en el pallet")
|
||||
onPalletClickListener.onPalletClickListener(itemExpeditionTruckVO,items[position])
|
||||
}
|
||||
holder.binding.root.setOnLongClickListener {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
@ -26,6 +27,8 @@ class ExpeditionScanAdapter (
|
|||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
holder.binding.root.setOnClickListener {
|
||||
//Tarea #4125
|
||||
Log.d("VERDNATURA::","ENtranado en las expediciones del pallet")
|
||||
onScanLongClickListener.onScanLongClickListener(items[position])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionscanSorterBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
|
||||
|
||||
class CmrExpeditionPalletFragment(
|
||||
var title: String = ""
|
||||
) : BaseFragment<FragmentExpeditionscanSorterBinding, CmrExpeditionPalletViewModel>(
|
||||
CmrExpeditionPalletViewModel::class
|
||||
) {
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_expeditionscan_sorter
|
||||
private lateinit var customDialogList: CustomDialogInputTwoValues
|
||||
private var itemScaned: String = ""
|
||||
|
||||
companion object {
|
||||
fun newInstance(title: String) = CmrExpeditionPalletFragment(title)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
|
||||
customDialogList = CustomDialogInputTwoValues(requireContext())
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
setEvents()
|
||||
setToolBar()
|
||||
showExpeditionPalletScan()
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setToolBar() {
|
||||
binding.mainToolbar.toolbarTitle.text = title
|
||||
}
|
||||
|
||||
private fun cmrExpeditionPallet_add(vExpeditionPallet: String, vCmrId: String) {
|
||||
|
||||
customDialogList.dismiss()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.cmrExpeditionPallet_add(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
vExpeditionPallet,
|
||||
vCmrId
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
responsescan.observe(viewLifecycleOwner) {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
ma.messageWithSound(getString(R.string.cmrError)+it.errorMessage, true, true, isToasted =true)
|
||||
showExpeditionPalletScan()
|
||||
|
||||
} else {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
ma.messageWithSound(getString(R.string.added), false, true)
|
||||
showExpeditionPalletScan()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun showExpeditionPalletScan() {
|
||||
|
||||
customDialogList.setInfoTex(getString(R.string.pallet))
|
||||
customDialogList.setInfoTextTwo(getString(R.string.cmr))
|
||||
customDialogList.setInputTextVisibility(View.GONE)
|
||||
|
||||
customDialogList.setTitle(getString(R.string.expeditionPalletScan))
|
||||
.setOkButton(getString(R.string.end)) {
|
||||
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
customDialogList.dismiss()
|
||||
binding.mainToolbar.backButton.performClick()
|
||||
|
||||
|
||||
}.setValue("").show()
|
||||
|
||||
|
||||
|
||||
|
||||
customDialogList.setFocusText()
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||
|
||||
if (customDialogList.getValue().isNotEmpty()) {
|
||||
customDialogList.setInputTextVisibility(View.VISIBLE)
|
||||
customDialogList.setTitle(getString(R.string.cmrScan))
|
||||
customDialogList.setFocusTextTwo()
|
||||
|
||||
}
|
||||
|
||||
return@setOnEditorActionListener false
|
||||
}
|
||||
false
|
||||
}
|
||||
customDialogList.getEditTextTwo().setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||
|
||||
if (customDialogList.getValue().isNotEmpty() && customDialogList.getValueTwo()
|
||||
.isNotEmpty()
|
||||
) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
customDialogList.setValueTwo("")
|
||||
cmrExpeditionPallet_add(
|
||||
customDialogList.getValue(),
|
||||
customDialogList.getValueTwo()
|
||||
)
|
||||
}
|
||||
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
|
||||
class CmrExpeditionPalletViewModel(context: Context) : BaseViewModel() {
|
||||
|
||||
private val GetPaletizadoresUserCase: GetPaletizadoresUserCase =
|
||||
GetPaletizadoresUserCase(context)
|
||||
|
||||
private val _responsescan by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responsescan: LiveData<ResponseItemVO>
|
||||
get() = _responsescan
|
||||
|
||||
|
||||
fun cmrExpeditionPallet_add(usuario: String, password: String, vExpeditionPallet: String,vCmrId:String) {
|
||||
GetPaletizadoresUserCase.cmrExpeditionPallet_add(usuario, password, vExpeditionPallet, vCmrId)
|
||||
.enqueue(object : Callback<Void> {
|
||||
override fun onFailure(call: Call<Void>, t: Throwable) {
|
||||
|
||||
_responsescan.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
_responsescan.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_responsescan.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -73,14 +73,13 @@ class ExpeditionPalletFragment(
|
|||
customDialog = CustomDialog(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk)
|
||||
////Log.i("VERDNATURA:","4-listamos listado de pallets para la expedicion")
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
|
|
@ -153,11 +153,11 @@ class ExpeditionStateViewModel(context: Context) : BaseViewModel() {
|
|||
|
||||
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||
|
||||
var expeditionState: Map<String, Any> =
|
||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||
var expeditionState: Map<String, String?> =
|
||||
gson.fromJson(json, object : TypeToken<Map<String, String?>>() {}.type)
|
||||
expeditionState.forEach {
|
||||
|
||||
list.add(itemsExpeditionDynamics(key=it.key, it.value.toString()))
|
||||
list.add(itemsExpeditionDynamics(key=it.key, it.value?:""))
|
||||
|
||||
}
|
||||
return list
|
||||
|
|
|
@ -264,16 +264,25 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
)
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
31,
|
||||
50,
|
||||
R.drawable.ic_visibility_black_24dp,
|
||||
contextApp.getString(R.string.titleExpeditionState),
|
||||
R.string.titleExpeditionState,
|
||||
contextApp.getString(R.string.titleExpeditionDescrip)
|
||||
)
|
||||
)
|
||||
/*
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
31,
|
||||
R.drawable.ic_cmr,
|
||||
contextApp.getString(R.string.titleCMRState),
|
||||
R.string.titleCMRState,
|
||||
contextApp.getString(R.string.titleCMRDescrip)
|
||||
)
|
||||
)*/
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
40,
|
||||
|
|
|
@ -169,6 +169,8 @@ class ReubicationCollectionFragment(
|
|||
val messageDescrip =
|
||||
getString(R.string.scanPlateToLeave) + itemReubication.itemFk + "-" + itemReubication.longName
|
||||
|
||||
customDialogInputTwoValues.setEnableValue(false)
|
||||
|
||||
customDialogInputTwoValues.setDescription(messageDescrip)
|
||||
.setValue(itemReubication.quantity)
|
||||
.setOkButton(getString(R.string.leaveItem)) {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<!-- drawable/truck.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="#F7931E" android:pathData="M18,18.5A1.5,1.5 0 0,1 16.5,17A1.5,1.5 0 0,1 18,15.5A1.5,1.5 0 0,1 19.5,17A1.5,1.5 0 0,1 18,18.5M19.5,9.5L21.46,12H17V9.5M6,18.5A1.5,1.5 0 0,1 4.5,17A1.5,1.5 0 0,1 6,15.5A1.5,1.5 0 0,1 7.5,17A1.5,1.5 0 0,1 6,18.5M20,8H17V4H3C1.89,4 1,4.89 1,6V17H3A3,3 0 0,0 6,20A3,3 0 0,0 9,17H15A3,3 0 0,0 18,20A3,3 0 0,0 21,17H23V12L20,8Z" />
|
||||
</vector>
|
|
@ -53,14 +53,14 @@
|
|||
style="@style/DefaultButton.NormalButton"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/background_round"
|
||||
android:enabled="false"
|
||||
android:enabled="true"
|
||||
android:hint="@string/quantity"
|
||||
android:inputType="number"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textColorHint="@android:color/darker_gray"
|
||||
android:visibility="gone" />
|
||||
android:visibility="visible" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
<string name="Coleccióncompleta">Colección completa</string>
|
||||
<string name="Parking">Parking</string>
|
||||
<string name="Reject">Rechazar</string>
|
||||
<string name="cmrError">No se ha podido guardar.Revisa el código del Pallet y del CMR.</string>
|
||||
<string name="updatemng">Existe una versión nueva, es recomendable actualizar.</string>
|
||||
<string name="Actualizar">Actualizar</string>
|
||||
<string name="reposicion">Reposición</string>
|
||||
|
@ -224,7 +225,7 @@
|
|||
<string name="closeOdrder">¿Estás seguro de cerrar el pedido?</string>
|
||||
<string name="confirm">Confirmar</string>
|
||||
<string name="scanItem">Escanea un item</string>
|
||||
<string name="itemNotFound">No hemos podido encontrar el articulo. Revisa el sector.</string>
|
||||
<string name="itemNotFound">No hemos podido encontrar el artículo. Revisa el sector.</string>
|
||||
<string name="errorOperation">Error al realizar la operación</string>
|
||||
<string name="scanLabelExpedition">Escanea etiqueta de la expedición.</string>
|
||||
<string name="buffer">Buffer:</string>
|
||||
|
@ -382,7 +383,7 @@
|
|||
<string name="labelType">Tipo etiqueta</string>
|
||||
<string name="vehicleControl">Control de vehículos</string>
|
||||
<string name="userNotPermission">Usuario sin permisos para realizar la acción</string>
|
||||
<string name="messageUserError">Revisa tu usuario y contraseña. En caso de no poder acceder contacta co Informática</string>
|
||||
<string name="messageUserError">Revisa tu usuario y contraseña. En caso de no poder acceder contacta con Informática</string>
|
||||
<string name="ok">Ok</string>
|
||||
<string name="ticket">Ticket: </string>
|
||||
<string name="expedit">Expedición: </string>
|
||||
|
@ -452,4 +453,12 @@
|
|||
<string name="in_shelve">En balda:</string>
|
||||
<string name="pendingReviewParking">No es posible aparcar el ticket porque hay un ticket pendiente:</string>
|
||||
<string name="sectorALGEMESINEW">SACADOR V</string>
|
||||
<string name="titleCMRState">Informar CMR</string>
|
||||
<string name="titleCMRDescrip">Permite infomar de un CMR</string>
|
||||
<string name="expeditionPalletScan">Escanea el Pallet</string>
|
||||
<string name="cmrScan">Escanea CMR</string>
|
||||
<string name="cmr">CMR</string>
|
||||
<string name="collectionNoTicketsError">Colección no tiene tickets, el ticket no es de ahora o ticket eliminado</string>
|
||||
<string name="stems">Tallos</string>
|
||||
<string name="itemCost">Precio coste</string>
|
||||
</resources>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<string name="Salida">Departure</string>
|
||||
<string name="Balance">Balance</string>
|
||||
<string name="Pallet">Pallet</string>
|
||||
<string name="cmr">CMR</string>
|
||||
<string name="Ruta">Route</string>
|
||||
<string name="Cajas">Boxes</string>
|
||||
<string name="Nivel">Level:</string>
|
||||
|
@ -57,7 +58,9 @@
|
|||
<string name="Disponible">Available</string>
|
||||
<string name="Ubicado">Located</string>
|
||||
<string name="SINUBICAR">Unlocated</string>
|
||||
<string name="itemCost">Item cost</string>
|
||||
<string name="MINIMO">Minimun</string>
|
||||
<string name="stems">Steams</string>
|
||||
<string name="txtparking">First scan as many cars or tickets as you want to park and finally scan the parking to finish the process</string>
|
||||
<string name="Ticketaparcado">Parked ticket</string>
|
||||
<string name="Imprimiendo">Printing by </string>
|
||||
|
@ -128,6 +131,7 @@
|
|||
<string name="assigned_user">User assigned to device name</string>
|
||||
<string name="ScanPlateOrSmarttag">Scan plate or smartag</string>
|
||||
<string name="titleExpeditionState">Expedition state</string>
|
||||
<string name="titleCMRState">Report CMR</string>
|
||||
<string name="BuffersManegement">Buffer Management</string>
|
||||
<string name="PalletMake">Pallet make</string>
|
||||
<string name="scanPallet">Scan pallet</string>
|
||||
|
@ -299,6 +303,7 @@
|
|||
<string name="scanBuffer">Scan buffer</string>
|
||||
<string name="barcodes">Barcodes</string>
|
||||
<string name="collectionNoTickets">Collection has no ticket</string>
|
||||
<string name="collectionNoTicketsError">Collection has no ticket or ticket is old</string>
|
||||
<string name="reviewCAllhistorical">Check vehicle registration call</string>
|
||||
<string name="takeVehicle">Pick up vehicle</string>
|
||||
<string name="noVehicle">Without vehicle</string>
|
||||
|
@ -327,6 +332,8 @@
|
|||
<string name="test">Check</string>
|
||||
<string name="expeditionsError">You have not scanned expeditions</string>
|
||||
<string name="expeditionNoSorter">Scan expeditions that have not passed through the Sorter</string>
|
||||
<string name="expeditionPalletScan">Scan pallet expedition </string>
|
||||
<string name="cmrScan">Scan CMR</string>
|
||||
<string name="added">Added</string>
|
||||
<string name="registerAdded">Added log</string>
|
||||
<string name="keepPlate">" saved with registration plate "</string>
|
||||
|
@ -419,6 +426,7 @@
|
|||
<string name="titleQualityDescrip">It allows to know the quality of some products by buyer</string>
|
||||
<string name="titlePalletDescrip">Allows scanning pallet to incorporate it into the system</string>
|
||||
<string name="titleExpeditionDescrip">Allows you to know the status of an expedition</string>
|
||||
<string name="titleCMRDescrip">Allows you to report a CMR</string>
|
||||
<string name="titleExpScanDescrip">Allows scanning shipments that have not passed through the sorter</string>
|
||||
<string name="titleBufferMangDescrip">Access to the operations menu with the sorter buffers</string>
|
||||
<string name="titleQrDescrip">Allows you to read information in a qr</string>
|
||||
|
@ -452,6 +460,7 @@
|
|||
<string name="scanPlateToLeave">Scan the plate where you want to leave the item :</string>
|
||||
<string name="in_shelve">In shelve:</string>
|
||||
<string name="successReubication">Reubication ended</string>
|
||||
<string name="cmrError">It\'s not saved. Please review pallet and CMR</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue