Version 8.4.1Beta, strings y return finish

This commit is contained in:
Sergio De la torre 2022-05-27 11:34:06 +02:00
parent 43350c66d6
commit 575bfd06be
54 changed files with 688 additions and 517 deletions

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="21114523025303" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-05-27T04:55:50.268970300Z" />
</component>
</project>

View File

@ -1,6 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'//deprecated:sergio
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.google.firebase.crashlytics'

View File

@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 117,
"versionName": "8.4Beta",
"versionCode": 118,
"versionName": "8.4.1Beta",
"outputFile": "app-release.apk"
}
],

Binary file not shown.

View File

@ -1,5 +1,8 @@
package es.verdnatura.domain
import android.content.Context
import android.util.Log.d
import androidx.preference.PreferenceManager
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
@ -8,11 +11,30 @@ class ApiSalixUtils {
//const val BASE_URL:String = "http://192.168.1.155:9009/"
//const val BASE_URL: String = "https://test-salix.verdnatura.es/api/"
const val BASE_URL: String = "https://salix.verdnatura.es/api/"
fun getApiService(): SalixService {
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
fun getApiService(context: Context): SalixService {
val salixRetrofit = Retrofit.Builder().baseUrl(getBaseUrlLocal(context = context)).addConverterFactory(
GsonConverterFactory.create()
).build()
d("VERDNATURA::","El server Salix es "+getBaseUrlLocal(context = context))
return salixRetrofit.create(SalixService::class.java)
}
fun getBaseUrlLocal(context: Context): String {
var url = this.getDefaults("base_urlSalix", context)
if (url.isNullOrEmpty()) {
ApiUtils.setDefaults("base_urlSalix", ApiSalixUtils.BASE_URL, context)
} else {
if (!url.contains("http")) {
url = "https://" + url
}
}
return if (url.isNullOrEmpty()) ApiSalixUtils.BASE_URL else url
}
fun getDefaults(key: String?, context: Context?): String? {
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
return preferences.getString(key, null)
}
}
}

View File

@ -50,7 +50,7 @@ class GetDayOfSaleUSerCase(context: Context) : RestClient(context) {
password: String,
shelving: String,
parking: String
): Call<String> {
): Call<Any> {
val params: ArrayList<String> = ArrayList()
params.add(shelving)
params.add(parking)

View File

@ -129,7 +129,7 @@ class GetUbicadorUserCase(context: Context) : RestClient(context) {
password: String,
shelving: String,
parking: String
): Call<String> {
): Call<Any> {
val params: ArrayList<String> = ArrayList()
params.add(shelving)
params.add(parking)

View File

@ -9,7 +9,7 @@ open class RestClient(context: Context) {
init {
restClient = ApiUtils.getApiService(context)
salixClient = ApiSalixUtils.getApiService()
salixClient = ApiSalixUtils.getApiService(context)
nodejsClient = ApiNodeJsUtils.getApiService()
}

View File

@ -1011,7 +1011,7 @@ interface VerdnaturaService {
@Header("Content-Type") content_type: String,
@Body params: List<String>
):
Call<String>
Call<Any>
@POST("almacennew/shelvingChange")//REVISADA
fun shelvingChange(

View File

@ -249,6 +249,11 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
R.drawable.alpha_b_circle_outline->getString(R.string.showTrash)
R.drawable.filter_outline->getString(R.string.filterFlower)
R.drawable.ic_mode_edit_black_24dp->getString(R.string.allowChangeShelving)
R.drawable.ic_delete_forever_black_24dp->getString(R.string.deleteAllitems)
R.drawable.ic_flash_auto_black_24dp->getString(R.string.allowAutomaticAddItem)
else -> {""}
}
@ -364,7 +369,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
val listo = getMatch(text, "listo")
//check for cancelar
val cancelar = getMatch(text, "cancelar")
val cancelar = getMatch(text, getString(R.string.cancel))
//check for volver
val volver = getMatch(text, "volver")
@ -575,6 +580,12 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
editorPref.commit()
}
"base_urlSalix"->{
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
val editorPref = preferences.edit()
editorPref.putString("base_urlSalix", value)
editorPref.commit()
}
else -> {
editor.putString(name, value)

View File

@ -179,7 +179,7 @@ class ItemCardFragment(
this.itemFk = itemFk
binding.splashProgressTwo.visibility = View.VISIBLE
viewModel.getItemCard(itemFk, warehouseFk, user, password, "item_card")
viewModel.getItemCard(itemFk, warehouseFk, user, password)
binding.splashProgress.visibility = View.VISIBLE
@ -409,12 +409,12 @@ class ItemCardFragment(
if (item.action != "toBarcode" && item.action != "buscarItem" && item.action != "itemStockUpdateAdd" && item.action != "itemStockUpdateRemove") {
customDialogInput.setTitle(item.title!!)
.setDescription("Valor actual: " + item.value!!)
.setOkButton("Guardar") {
.setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue())
customDialogInput.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.dismiss()
}.setValue("").show()
@ -443,12 +443,12 @@ class ItemCardFragment(
} else if (item.action == "itemStockUpdateAdd") {
customDialogInput.setTitle(item.title!!)
.setDescription("Indica la cantidad a dar de alta")
.setOkButton("Guardar") {
.setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue())
customDialogInput.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.dismiss()
}.setValue("").show()
@ -468,12 +468,12 @@ class ItemCardFragment(
} else if (item.action == "itemStockUpdateRemove") {
customDialogInput.setTitle(item.title!!)
.setDescription("Indica la cantidad a dar de baja ")
.setOkButton("Guardar") {
.setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogInput.getEditText())
editItemCardRow(item, customDialogInput.getValue())
customDialogInput.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.dismiss()
}.setValue("").show()
@ -530,30 +530,26 @@ class ItemCardFragment(
user = user,
password = password,
value = value,
warehouseFk = warehouseFk,
"buy_updateGrouping"
warehouseFk = warehouseFk
)
"updatePacking" -> viewModel.updatePacking(
itemFk = itemFk,
user = user,
password = password,
value = value,
warehouseFk = warehouseFk,
"buy_updatePacking"
warehouseFk = warehouseFk
)
"itemSaveMin" -> viewModel.itemSaveMin(
itemFk = itemFk,
user = user,
password = password,
value = value,
"itemSaveMin"
value = value
)
"item_saveReference" -> viewModel.item_saveReference(
itemFk = itemFk,
user = user,
password = password,
value = value,
"item_saveReference"
value = value
)
@ -603,7 +599,7 @@ class ItemCardFragment(
changeOfflineValue(itemB,value, listBarcodes)
customDialogTwo.dismiss()
}.setKoButton("Cancelar"){
}.setKoButton(getString(R.string.cancel)){
customDialogTwo.dismiss()
}.show()
@ -613,7 +609,7 @@ class ItemCardFragment(
}
}catch (e:Exception){
binding.itemcardLayout.visibility = View.GONE
customDialog.setTitle(getString(R.string.error)).setDescription("El elemento introducido no es un número").setKoButton("Cancelar"){
customDialog.setTitle(getString(R.string.error)).setDescription("El elemento introducido no es un número").setKoButton(getString(R.string.cancel)){
customDialog.dismiss()
}.show()
}
@ -654,7 +650,7 @@ class ItemCardFragment(
showProgress()
customDialogTwo.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogTwo.dismiss()
}.show()
@ -680,7 +676,7 @@ class ItemCardFragment(
private fun prepareBarcodeDialog(itemB: ItemCardRowVO) {
customDialogList.setTitle("Barcodes").setOkButton("Guardar") {
customDialogList.setTitle("Barcodes").setOkButton(getString(R.string.save)) {
ma.hideKeyboard(customDialogList.getEditText())
if (!customDialogList.getValue().isNullOrEmpty())
updateBarcode(customDialogList.getValue(), "0", itemB)

View File

@ -40,8 +40,8 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
itemFk: String,
warehouseFk: String,
user: String,
password: String,
callFunction: String
password: String
) {
getItemCardUserCase.getItemCard(user, password, itemFk, warehouseFk)
.enqueue(object : Callback<ItemCardVO> {
@ -80,8 +80,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
vShipped: String,
vIsShowedByType: String,
user: String,
password: String,
callFunction: String
password: String
) {
getItemCardUserCase.item_getSimilar(
user,
@ -286,8 +285,8 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
user: String,
password: String,
value: String,
warehouseFk: String,
callFunction: String
warehouseFk: String
) {
getItemCardUserCase.updateGrouping(user, password, itemFk, value, warehouseFk)
.enqueue(object : Callback<Any> {
@ -322,8 +321,8 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
user: String,
password: String,
value: String,
warehouseFk: String,
callFunction: String
warehouseFk: String
) {
getItemCardUserCase.updatePacking(user, password, itemFk, value, warehouseFk)
.enqueue(object : Callback<Any> {
@ -406,8 +405,8 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
itemFk: String,
user: String,
password: String,
value: String,
callFunction: String
value: String
) {
getItemCardUserCase.itemSaveMin(user, password, itemFk, value)
.enqueue(object : Callback<Any> {
@ -441,8 +440,8 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
itemFk: String,
user: String,
password: String,
value: String,
callFunction: String
value: String
) {
getItemCardUserCase.item_saveReference(user, password, itemFk, value)
.enqueue(object : Callback<Unit> {

View File

@ -53,7 +53,7 @@ class ItemProposalFragment(
vShipped = currentDay(),
vIsShowedByType = filter,
user = getData(USER),
password = getData(PASSWORD),"item_getSimilar"
password = getData(PASSWORD)
)
super.onCreate(savedInstanceState)
}
@ -105,8 +105,8 @@ class ItemProposalFragment(
vIsShowedByType = filter,
vShipped = currentDay(),
user = getData(USER),
password = getData(PASSWORD) ,
callFunction = "item_getSimilar")
password = getData(PASSWORD)
)
}

View File

@ -119,8 +119,8 @@ class CollectionFragment(
viewModel.ticket_checkFullyControlled(
getData(USER),
getData(PASSWORD),
collection.collectionFk,
"ticket_checkFullyControlled"
collection.collectionFk
)
workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk
}
@ -132,8 +132,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
}
@ -252,7 +251,7 @@ class CollectionFragment(
/* var working_in_test = true // sergio: en proves app
if (working_in_test) {*/
viewModel.sip_getExtensionSalix(getData(TOKEN), workerFkFromTicket, "sip_getExtension")
viewModel.sip_getExtensionSalix(getData(TOKEN), workerFkFromTicket)
/* } else {
viewModel.sip_getExtension(
getData(USER),
@ -322,7 +321,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type, "collection_getTickets"
type
)
binding.collectionSwipe.isRefreshing = false
//}
@ -367,7 +366,7 @@ class CollectionFragment(
}
} else {
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
if (activity != null) requireActivity().onBackPressed()
}.show()
@ -380,12 +379,24 @@ class CollectionFragment(
if (!goBack) {
ma.messageWithSound(
if (it.isError) it.errorMessage else "Baldas guardadas",
if (it.isError) it.errorMessage else getString(R.string.savedShelves),
it.isError, true
)
}
})
responseParking.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) {
ma.messageWithSound(
if (it.isError) it.errorMessage else getString(R.string.Aparcado),
it.isError, true
)
}
})
responsePrint.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
@ -430,8 +441,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
}
@ -450,8 +460,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
}
})
@ -494,8 +503,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type, "collection_getTickets"
)
type)
// //Log.i("VERDNATURA:","La collection es ${collection.collectionFk}")
}
@ -612,7 +620,7 @@ class CollectionFragment(
if (it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, false)
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
} else {
@ -621,7 +629,7 @@ class CollectionFragment(
customDialog.setTitle("Aviso")
.setDescription("Pendiente de revisar : " + it.response)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}
@ -632,8 +640,7 @@ class CollectionFragment(
getData(PASSWORD),
it.response,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
customDialog.dismiss()
}
@ -662,7 +669,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type, "collection_getTickets"
type
)
goBack = false
@ -702,7 +709,7 @@ class CollectionFragment(
}
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
}
@ -941,7 +948,7 @@ class CollectionFragment(
private fun printObservations(observations: String) {
if (observations.trim().isNotEmpty()) {
customDialog.setTitle("Observaciones").setDescription(observations)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.hide()
customDialog.dismiss()
}.show()
@ -969,8 +976,7 @@ class CollectionFragment(
viewModel.saleTracking_add(
getData(USER),
getData(PASSWORD),
txtscan,
"saleTracking_add"
txtscan
)
if ((isOk) && mpok != null) {
mpok!!.start()
@ -1026,13 +1032,12 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
ticketFk = tickets[0],
parking = txtscan,
"shelvingPark"
parking = txtscan
)
}
Timber.i("La coleccion es " + tickets[0])
if (mpok != null) mpok!!.start()
"Ticket aparcado".toast(requireContext())
/* if (mpok != null) mpok!!.start()
"Ticket aparcado".toast(requireContext())*/
} else {
if (mperror != null) mperror!!.start()
}
@ -1070,12 +1075,11 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
ticketFk = tickets[0],
parking = txtscan,
"shelvingPark"
parking = txtscan
)
}
if (mpok != null) mpok!!.start()
getString(R.string.Ticketaparcado).toast(requireContext())
/* if (mpok != null) mpok!!.start()
getString(R.string.Ticketaparcado).toast(requireContext())*/
} else {
if (binding.splashProgress != null) binding.splashProgress.visibility =
View.VISIBLE
@ -1088,16 +1092,15 @@ class CollectionFragment(
getData(PASSWORD),
txtscan,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
if (type.equals(CONTROLADOR)) {
viewModel.ticket_checkFullyControlled(
getData(USER),
getData(PASSWORD),
txtscan,
"ticket_checkFullyControlled"
txtscan
)
}
// } else {
@ -1155,12 +1158,11 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
ticketFk = it,
parking = txtscan,
"shelvingPark"
parking = txtscan
)
}
if (mpok != null) mpok!!.start()
"Ticket aparcado".toast(requireContext())
/* if (mpok != null) mpok!!.start()
"Ticket aparcado".toast(requireContext())*/
} else {
if (mperror != null) mperror!!.start()
@ -1238,8 +1240,8 @@ class CollectionFragment(
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
vOriginalQuantity = sales[position].pickedQuantity,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan,
callFunction = "saleTrackingReplace"
vBuyFk = originalItemScan
)
}
@ -1262,8 +1264,7 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
sales[position].saleFk,
sales[position].quantity,
""
sales[position].quantity
)
positionUnmarked = position
@ -1279,7 +1280,7 @@ class CollectionFragment(
setTotalLines()
scanRequest()
customDialog.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialog.dismiss()
}.show()
@ -1304,8 +1305,8 @@ class CollectionFragment(
getData(PASSWORD),
itemFk = sales[position].itemFk,
quantity = quantityGet,
shelvingFk = sales[position].placements[shelvingPosition].shelving,
callFunction = "itemPlacementSupplyAiming"
shelvingFk = sales[position].placements[shelvingPosition].shelving
)
}
@ -1521,8 +1522,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
}
@ -1610,8 +1610,7 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
collectionFk = collection.collectionFk,
sectorFk = getData(SECTORFK),
"collectionStickerPrint"
sectorFk = getData(SECTORFK)
)
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(requireContext())
} else {
@ -1772,7 +1771,7 @@ class CollectionFragment(
scanRequest()
customDialogInput.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
if (binding.splashProgress != null) {
binding.splashProgress.visibility = View.GONE
}
@ -1808,7 +1807,7 @@ class CollectionFragment(
}
customDialog.setTitle("Artículo: " + item.id)
.setDescription("Disponible: " + item.available).setOkButton("Aceptar") {
.setDescription("Disponible: " + item.available).setOkButton(getString(R.string.accept)) {
scanRequest()
customDialog.dismiss()
}.show()
@ -1875,7 +1874,7 @@ class CollectionFragment(
customDialogInput.setTitle("Número de baldas del ticket")
.setDescription("Indica el número de baldas que ocupa el ticket")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
@ -1883,8 +1882,7 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
ticketFk = collection.collectionFk,
usedShelves = customDialogInput.getValue(),
"ticketCollection_setUsedShelves"
usedShelves = customDialogInput.getValue()
)
hideKeyboards()
// showKeyboards()
@ -1895,7 +1893,7 @@ class CollectionFragment(
showKeyboards()
//hideKeyboards()
//showKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
// hideKeyboards()
showKeyboards()
@ -1915,8 +1913,7 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
ticketFk = collection.collectionFk,
usedShelves = customDialogInput.getValue(),
"ticketCollection_setUsedShelves"
usedShelves = customDialogInput.getValue()
)
hideKeyboards()
}
@ -1941,7 +1938,7 @@ class CollectionFragment(
isMarking = false
customDialogInput.setTitle("Número de paquetes en balda")
.setDescription("Indica el número de paquetes que caben en una balda")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
@ -1949,8 +1946,7 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
vSelf = itemFk,
vPacking = customDialogInput.getValue(),
"item_updatePackingShelve"
vPacking = customDialogInput.getValue()
)
hideKeyboards()
//showKeyboards()
@ -1960,7 +1956,7 @@ class CollectionFragment(
customDialogInput.dismiss()
// hideKeyboards()
showKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
//hideKeyboards()
@ -1981,8 +1977,7 @@ class CollectionFragment(
getData(USER),
getData(PASSWORD),
ticketFk = collection.collectionFk,
usedShelves = customDialogInput.getValue(),
"ticketCollection_setUsedShelves"
usedShelves = customDialogInput.getValue()
)
}
@ -2041,7 +2036,7 @@ class CollectionFragment(
getString(R.string.Agregar)
)
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
@ -2125,8 +2120,7 @@ class CollectionFragment(
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = typeCollectionTrashMissingReject,
originalQuantity = quantity,
callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
/* sales[position].quantity = quantity
saleAdapter!!.notifyDataSetChanged()
@ -2224,7 +2218,7 @@ class CollectionFragment(
quantity = totalQuantity.toString(),
warehouseFk = warehouseFk,
type = "reject",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
//sales[position].originalQuantity = quantity
@ -2297,8 +2291,7 @@ class CollectionFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
}
@ -2369,7 +2362,7 @@ class CollectionFragment(
viewModel.collectionIncreaseQuantitySalix(
getData(TOKEN),
saleFk = sales[position].saleFk,
quantity = quantity, "collection_increaseQuantity"
quantity = quantity
)
/* }*/
@ -2384,8 +2377,7 @@ class CollectionFragment(
usuario = getData(USER),
password = getData(PASSWORD),
ticketFk = it,
state = "CHECKED",
callFunction = "ticket_setState"
state = "CHECKED"
)
}
} else if (type == SACADOR) {
@ -2394,8 +2386,7 @@ class CollectionFragment(
usuario = getData(USER),
password = getData(PASSWORD),
ticketFk = it,
state = "PREPARED",
callFunction = "ticket_setState"
state = "PREPARED"
)
}
////Refactor #4030
@ -2441,7 +2432,7 @@ class CollectionFragment(
Log.d("VERDNATURA", "Entrant en el show scanner al punxar sobre la sale")
customDialogInput.setTitle("" + sale.itemFk)
.setDescription(getString(R.string.Escaneaelcarroparaelitemseleccionado))
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
findSale(customDialogInput.getValue(), index)
}
@ -2449,7 +2440,7 @@ class CollectionFragment(
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("").show()
customDialogInput.getEditText().requestFocus()
@ -2484,7 +2475,7 @@ class CollectionFragment(
}
customDialogList.setTitle("Causa de error").setKoButton("Cancelar") {
customDialogList.setTitle("Causa de error").setKoButton(getString(R.string.cancel)) {
scanRequest()
hideKeyboards()
customDialogList.dismiss()

View File

@ -46,6 +46,10 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
val response: LiveData<ResponseItemVO>
get() = _response
private val _responseParking by lazy { MutableLiveData<ResponseItemVO>() }
val responseParking: LiveData<ResponseItemVO>
get() = _responseParking
private val _responsePrint by lazy { MutableLiveData<ResponseItemVO>() }
val responsePrint: LiveData<ResponseItemVO>
get() = _responsePrint
@ -117,8 +121,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
password: String,
collectionFk: String,
sectorFk: String,
type: String,
callFunction: String
type: String
) {
getSacadorControladorUserCase.collectionTicketGet(
usuario,
@ -163,7 +166,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
vOriginalQuantity: String,
vStateFk: String,
vIsChecked: String,
vBuyFk: String, callFunction: String
vBuyFk: String
) {
getSacadorControladorUserCase.saleTrackingReplace(
usuario,
@ -202,7 +205,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
password: String,
shelvingFk: String,
quantity: String,
itemFk: String, callFunction: String
itemFk: String
) {
getSacadorControladorUserCase.itemPlacementSupplyAiming(
usuario,
@ -287,7 +290,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
collectionFk: String,
sectorFk: String, callFunction: String
sectorFk: String
) {
getSacadorControladorUserCase.collectionStickerPrint(
usuario,
@ -324,8 +327,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
ticketFk: String,
usedShelves: String,
callFunction: String
usedShelves: String
) {
getSacadorControladorUserCase.ticketCollection_setUsedShelves(
usuario,
@ -360,8 +362,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
vSelf: String,
vPacking: String,
callFunction: String
vPacking: String
) {
getSacadorControladorUserCase.item_updatePackingShelve(
usuario,
@ -396,8 +397,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
fun saleTracking_add(
usuario: String,
password: String,
saleGroupFk: String,
callFunction: String
saleGroupFk: String
) {
getSacadorControladorUserCase.saleTracking_add(
usuario,
@ -527,7 +527,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
quantity: String,
type: String,
warehouseFk: String,
originalQuantity: String, callFunction: String
originalQuantity: String
) {
getSacadorControladorUserCase.collectionMissingTrash(
usuario,
@ -593,8 +593,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
itemShelvingFk: String,
visible: String,
callFunction: String
visible: String
) {
getSacadorControladorUserCase.itemShelving_updateFromSale(
usuario,
@ -631,22 +630,21 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
ticketFk: String,
parking: String,
callFunction: String
parking: String
) {
getUbicadorUserCase.shelvingPark(usuario, password, ticketFk, parking)
.enqueue(object : Callback<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
_response.value = ResponseItemVO(
.enqueue(object : Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_responseParking.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(call: Call<String>, response: Response<String>) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (response.body() == null) {
_response.value = ResponseItemVO(
if (!response.isSuccessful) {
_responseParking.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
@ -654,8 +652,8 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
)
)
} else {
_response.value =
ResponseItemVO(isError = false, response = response.body()!!)
_responseParking.value =
ResponseItemVO(isError = false, response = response.message())
}
}
})
@ -665,7 +663,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
ticketFk: String,
state: String, callFunction: String
state: String
) {
getSacadorControladorUserCase.ticket_setState(usuario, password, ticketFk, state)
.enqueue(object : Callback<Unit> {
@ -854,7 +852,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
token: String,
saleFk: String,
quantity: String, callFunction: String
quantity: String
) {
getSacadorControladorUserCase.collectionIncreaseQuantitySalix(
token,
@ -990,8 +988,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
fun sip_getExtension(
usuario: String,
password: String,
workerId: String,
callFunction: String
workerId: String
) {
getSacadorControladorUserCase.sip_getExtension(
usuario,
@ -1030,8 +1027,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
fun sip_getExtensionSalix(
token: String,
workerId: String,
callFunction: String
workerId: String
) {
getSacadorControladorUserCase.sip_getExtensionSalix(
token,
@ -1090,7 +1086,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
fun ticket_checkFullyControlled(
usuario: String,
password: String,
collectionFk: String, callFunction: String
collectionFk: String
) {
getSacadorControladorUserCase.ticket_checkFullyControlled(
usuario,

View File

@ -57,8 +57,7 @@ class CollectionShowTicketFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type,
"collection_getTickets"
type
)
}
@ -111,8 +110,8 @@ class CollectionShowTicketFragment(
usuario = getData(USER),
password = getData(PASSWORD),
collectionFk = collection.collectionFk,
sectorFk = getData(SECTORFK),
"collectionStickerPrint"
sectorFk = getData(SECTORFK)
)
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(requireContext())
@ -137,7 +136,7 @@ class CollectionShowTicketFragment(
getData(PASSWORD),
binding.scanInput.text.toString(),
getData(SECTORFK),
type, "collection_getTickets"
type
)
@ -162,7 +161,7 @@ class CollectionShowTicketFragment(
getData(PASSWORD),
collection.collectionFk,
getData(SECTORFK),
type, "collection_getTickets"
type
)
binding.collectionSwipe.isRefreshing = false
@ -254,7 +253,7 @@ class CollectionShowTicketFragment(
private fun printObservations(observations: String) {
if (observations.trim().isNotEmpty()) {
customDialog.setTitle("Observaciones").setDescription(observations)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.hide()
customDialog.dismiss()
}.show()

View File

@ -87,7 +87,7 @@ class ControladorFragment :
if (it.isError) {
ma.messageWithSound(it.errorMessage,isError = true, isPlayed = false)
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
} else {

View File

@ -135,7 +135,7 @@ class ControlVehiculoFragment(
private fun showScanner(description: String, action: String) {
customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription(description)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (customDialogInput.getValue().isNotEmpty()) {
// "$description ${customDialogInput.getValue()} OK".toast(requireContext())
insertControlTimeVehicle(customDialogInput.getValue(), action)
@ -146,7 +146,7 @@ class ControlVehiculoFragment(
hideKeyboards()
}
.setKoButton("Cancelar") {
.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
ma.onBackPressed()
@ -285,7 +285,7 @@ class ControlVehiculoFragment(
}
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
@ -307,7 +307,7 @@ class ControlVehiculoFragment(
}
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()

View File

@ -145,22 +145,22 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel() {
fun parking(usuario: String,password: String,scanItem: String,parking:String){
GetDayOfSaleUSerCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
Callback<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
}
override fun onResponse(call: Call<String>, response: Response<String>) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (response.body() == null){
/*
if (response.isSuccessful == null){
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
}else{
if (response.body() == "Finish")
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}else{*/
if (response.isSuccessful)
_response.value = ResponseItemVO(isError = false,response = response.message())
else
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
}
}
})
}

View File

@ -153,7 +153,7 @@ class FaltasFragment :
)
changeOfflineValue(item)
customDialogInput.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("0").show()

View File

@ -35,6 +35,7 @@ class HistoricoAdapter (
fun bind(item: ItemHistoricoVO) {
binding.apply {
this.item = item
val sdf = SimpleDateFormat("yyyy-MM-dd")
val currentDate = sdf.format(Date())
if (currentDate == item.shipped){

View File

@ -35,7 +35,7 @@ class HistoricoVehiculoAdapter (
fun bind(item: ItemHistoricoVehiculo) {
binding.apply {
this.item = item
val sdf = SimpleDateFormat("yyyy-MM-dd")
val sdf = SimpleDateFormat(binding.root.context.getString(R.string.dateFormat))
val currentDate = sdf.format(Date())
if (currentDate == item.inTimed){
historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.context,R.color.verdnatura_pumpkin_orange))

View File

@ -60,10 +60,12 @@ class HistoricoVehiculoFragment (
navigateToToday(it)
if (it.list.isEmpty()){
ma.messageWithSound("Solo puedes visualizar cuando has cogido tu mismo el vehículo a no ser que tengas permisos para ello.",true,true,"Información")
ma.messageWithSound(getString(R.string.lookWithpermission),true,true,getString(
R.string.info))
}else{
if (it.list[0].isError){
ma.messageWithSound(it.list[0].errorMessage,true,true,"Información")
ma.messageWithSound(it.list[0].errorMessage,true,true,getString(
R.string.info))
}
}

View File

@ -220,7 +220,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
changeOfflineValue(item)
// customDialogInput.dismiss()
customDialog.dismiss()
}.setKoButton("Cancelar"){
}.setKoButton(getString(R.string.cancel)){
// customDialogInput.dismiss()
customDialog.dismiss()
}.show()

View File

@ -14,12 +14,8 @@ import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeListVO
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
import es.verdnatura.presentation.view.feature.workermistake.model.*
import retrofit2.Call
import retrofit2.Callback
@ -31,7 +27,7 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
private val getInventaryUserCase: GetInventaryUserCase = GetInventaryUserCase(context)
private val getItemCardUserCase: GetItemCardUserCase = GetItemCardUserCase(context)
private val getWorkerMistakeUserCase:GetWokerMistakeUSerCase= GetWokerMistakeUSerCase(context)
private val getWorkerMistakeUserCase: GetWokerMistakeUSerCase = GetWokerMistakeUSerCase(context)
private val _inventaryList by lazy { MutableLiveData<InventaryListVO>() }
val inventaryList: LiveData<InventaryListVO>
@ -55,7 +51,7 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
val workerFromMistakeList: LiveData<workerFromMistakeList>
get() = _workerFromMistakeList
private val _mistakeWorkerList by lazy { MutableLiveData<workerMistakeTypeList>()}
private val _mistakeWorkerList by lazy { MutableLiveData<workerMistakeTypeList>() }
val mistakeWorkerList: LiveData<workerMistakeTypeList>
get() = _mistakeWorkerList
@ -64,12 +60,17 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
get() = _responseAddMistake
//sergio para obtener comprador
fun itemShelvingBuyerGet(user:String,password:String){
getInventaryUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
fun itemShelvingBuyerGet(user: String, password: String) {
getInventaryUserCase.itemShelvingBuyerGet(user, password).enqueue(object :
Callback<List<BuyerVO>> {
override fun onFailure(call: Call<List<BuyerVO>>, t: Throwable) {
val listError:ArrayList<BuyerVO> = ArrayList()
listError.add(BuyerVO(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)))
val listError: ArrayList<BuyerVO> = ArrayList()
listError.add(
BuyerVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
)
_buyersList.value = BuyerListVO(listError)
}
@ -77,12 +78,19 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
call: Call<List<BuyerVO>>,
response: Response<List<BuyerVO>>
) {
if (response.body() != null){
if (response.body() != null) {
_buyersList.value = response.body()?.let { BuyerListVO(it) }
}else{
val listError:ArrayList<BuyerVO> = ArrayList()
listError.add(BuyerVO(isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())))
} else {
val listError: ArrayList<BuyerVO> = ArrayList()
listError.add(
BuyerVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_buyersList.value = BuyerListVO(listError)
}
}
@ -121,13 +129,22 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
})
}*/
fun getInventory(user:String,password:String,buyerFk:String,warehouseFk: String){
fun getInventory(user: String, password: String, buyerFk: String, warehouseFk: String) {
// getInventaryUserCase.itemShelvingRadar(user,password,buyerFk).enqueue(object :
getInventaryUserCase.itemShelvingRadarFilterBuyer(user,password,buyerFk,warehouseFk).enqueue(object :
getInventaryUserCase.itemShelvingRadarFilterBuyer(user, password, buyerFk, warehouseFk)
.enqueue(object :
Callback<List<ItemInventaryVO>> {
override fun onFailure(call: Call<List<ItemInventaryVO>>, t: Throwable) {
val listError:ArrayList<ItemInventaryVO> = ArrayList()
listError.add(ItemInventaryVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)))
val listError: ArrayList<ItemInventaryVO> = ArrayList()
listError.add(
ItemInventaryVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_inventaryList.value = InventaryListVO(listError)
}
@ -135,11 +152,19 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
call: Call<List<ItemInventaryVO>>,
response: Response<List<ItemInventaryVO>>
) {
if (response.body() != null){
if (response.body() != null) {
_inventaryList.value = response.body()?.let { InventaryListVO(it) }
}else{
val listError:ArrayList<ItemInventaryVO> = ArrayList()
listError.add(ItemInventaryVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())))
} else {
val listError: ArrayList<ItemInventaryVO> = ArrayList()
listError.add(
ItemInventaryVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_inventaryList.value = InventaryListVO(listError)
}
@ -149,7 +174,6 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
}
/*fun itemStockUpdate(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String){
//sergio: se modifica por CAU a itemTrash
// https://cau.verdnatura.es/scp/tickets.php?id=21043 al nuevo procedimiento itemTrash
@ -173,51 +197,73 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
}*/
//sergio: se modifica por CAU a itemTrash
fun itemTrash(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String){
fun itemTrash(
itemFk: String,
warehouseFk: String,
user: String,
password: String,
newValue: String,
isTrash: String
) {
getItemCardUserCase.itemTrash(user,password,itemFk,warehouseFk,newValue,isTrash).enqueue(object : Callback<Any>{
getItemCardUserCase.itemTrash(user, password, itemFk, warehouseFk, newValue, isTrash)
.enqueue(object : Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (!response.isSuccessful){
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = response.message())
if (!response.isSuccessful) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_response.value =
ResponseItemVO(isError = false, response = response.message())
}
}
})
}
fun department_getHasMistakeSalix(token:String)
{
fun department_getHasMistakeSalix(token: String) {
getWorkerMistakeUserCase.department_getHasMistakeSalix(token)
.enqueue(object : Callback<List<DepartmentMistake>>
{
override fun onFailure(call: Call<List<DepartmentMistake>>, t: Throwable)
{
.enqueue(object : Callback<List<DepartmentMistake>> {
override fun onFailure(call: Call<List<DepartmentMistake>>, t: Throwable) {
val listError: ArrayList<DepartmentMistake> = ArrayList()
listError.add(DepartmentMistake(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)))
listError.add(
DepartmentMistake(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_mistakeDepartmentList.value = departmentMistakeList(listError)
}
override fun onResponse(
call: Call<List<DepartmentMistake>>,
response: Response<List<DepartmentMistake>>
)
{
if (response.body() != null)
{
_mistakeDepartmentList.value = response.body()?.let { departmentMistakeList(it) }
} else
{
) {
if (response.body() != null) {
_mistakeDepartmentList.value =
response.body()?.let { departmentMistakeList(it) }
} else {
val listError: ArrayList<DepartmentMistake> = ArrayList()
listError.add(DepartmentMistake("0", ""))
_mistakeDepartmentList.value = departmentMistakeList(listError)
@ -227,29 +273,32 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
})
}
fun department_getHasMistake(usuario:String, password:String)
{
fun department_getHasMistake(usuario: String, password: String) {
getWorkerMistakeUserCase.department_getHasMistake(usuario, password)
.enqueue(object : Callback<List<DepartmentMistake>>
{
override fun onFailure(call: Call<List<DepartmentMistake>>, t: Throwable)
{
.enqueue(object : Callback<List<DepartmentMistake>> {
override fun onFailure(call: Call<List<DepartmentMistake>>, t: Throwable) {
val listError: ArrayList<DepartmentMistake> = ArrayList()
listError.add(DepartmentMistake(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)))
listError.add(
DepartmentMistake(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_mistakeDepartmentList.value = departmentMistakeList(listError)
}
override fun onResponse(
call: Call<List<DepartmentMistake>>,
response: Response<List<DepartmentMistake>>
)
{
if (response.body() != null)
{
_mistakeDepartmentList.value = response.body()?.let { departmentMistakeList(it) }
} else
{
) {
if (response.body() != null) {
_mistakeDepartmentList.value =
response.body()?.let { departmentMistakeList(it) }
} else {
val listError: ArrayList<DepartmentMistake> = ArrayList()
listError.add(DepartmentMistake("0", ""))
_mistakeDepartmentList.value = departmentMistakeList(listError)
@ -259,12 +308,21 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
})
}
fun worker_getFromHasMistake(usuario:String,password:String,departmentFk:String){
getWorkerMistakeUserCase.worker_getFromHasMistake(usuario,password,departmentFk).enqueue(object :
fun worker_getFromHasMistake(usuario: String, password: String, departmentFk: String) {
getWorkerMistakeUserCase.worker_getFromHasMistake(usuario, password, departmentFk)
.enqueue(object :
Callback<List<WorkerFromMistake>> {
override fun onFailure(call: Call<List<WorkerFromMistake>>, t: Throwable) {
val listError:ArrayList<WorkerFromMistake> = ArrayList()
listError.add(WorkerFromMistake(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)))
val listError: ArrayList<WorkerFromMistake> = ArrayList()
listError.add(
WorkerFromMistake(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_workerFromMistakeList.value = workerFromMistakeList(listError)
}
@ -272,12 +330,21 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
call: Call<List<WorkerFromMistake>>,
response: Response<List<WorkerFromMistake>>
) {
if (response.body() != null){
if (response.body() != null) {
_workerFromMistakeList.value = response.body()?.let { workerFromMistakeList(it) }
}else{
val listError:ArrayList<WorkerFromMistake> = ArrayList()
listError.add(WorkerFromMistake(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())))
_workerFromMistakeList.value =
response.body()?.let { workerFromMistakeList(it) }
} else {
val listError: ArrayList<WorkerFromMistake> = ArrayList()
listError.add(
WorkerFromMistake(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_workerFromMistakeList.value = workerFromMistakeList(listError)
}
}
@ -285,30 +352,45 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
})
}
fun workerMistakeType_get(usuario: String, password: String)
{
fun workerMistakeType_get(usuario: String, password: String) {
getWorkerMistakeUserCase.workerMistakeType_get(usuario, password)
.enqueue(object : Callback<List<MistakeWorkerType>>
{
override fun onFailure(call: Call<List<MistakeWorkerType>>, t: Throwable)
{
.enqueue(object : Callback<List<MistakeWorkerType>> {
override fun onFailure(call: Call<List<MistakeWorkerType>>, t: Throwable) {
val listError: ArrayList<MistakeWorkerType> = ArrayList()
listError.add(MistakeWorkerType(isError=true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!),id="0", description = ""))
listError.add(
MistakeWorkerType(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
),
id = "0",
description = ""
)
)
_mistakeWorkerList.value = workerMistakeTypeList(listError)
}
override fun onResponse(
call: Call<List<MistakeWorkerType>>,
response: Response<List<MistakeWorkerType>>
)
{
if (response.body() != null)
{
_mistakeWorkerList.value = response.body()?.let { workerMistakeTypeList(it) }
} else
{
) {
if (response.body() != null) {
_mistakeWorkerList.value =
response.body()?.let { workerMistakeTypeList(it) }
} else {
val listError: ArrayList<MistakeWorkerType> = ArrayList()
listError.add(MistakeWorkerType(isError=true,errorMessage =getMessageFromAllResponse(nameofFunction(this),response.message()),id="0", description = ""))
listError.add(
MistakeWorkerType(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
),
id = "0",
description = ""
)
)
_mistakeWorkerList.value = workerMistakeTypeList(listError)
}
}
@ -320,47 +402,51 @@ class InventaryViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
vUserFk: String,
vTypeFk: String,callFunction:String
)
{
vTypeFk: String
) {
getWorkerMistakeUserCase.workerMistake_Add(usuario, password, vUserFk, vTypeFk)
.enqueue(object :
Callback<Unit>
{
override fun onFailure(call: Call<Unit>, t: Throwable)
{
d("Error message "+t.message)
Callback<Unit> {
override fun onFailure(call: Call<Unit>, t: Throwable) {
d("Error message " + t.message)
_responseAddMistake.value = ResponseItemVO(
isError = true,
errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(
call: Call<Unit>,
response: Response<Unit>
)
{
if (!response.isSuccessful)
{
if (response.code()==403){
) {
if (!response.isSuccessful) {
if (response.code() == 403) {
_responseAddMistake.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this),"Usuario sin permisos para realizar la acción")
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
"Usuario sin permisos para realizar la acción"
)
}else{
d("Error message:"+{response.errorBody()}+"-"+response.message()+"-"+response.raw())
)
} else {
d("Error message:" + { response.errorBody() } + "-" + response.message() + "-" + response.raw())
_responseAddMistake.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
} else
{
} else {
// sergio:refactor:solo debería haber un mensaje no un response o errorMessage
_responseAddMistake.value =
ResponseItemVO(isError = false, response ="Causa del error registrada", errorMessage = "Causa del error registrada")
ResponseItemVO(
isError = false,
response = "Causa del error registrada",
errorMessage = "Causa del error registrada"
)
}
}
})

View File

@ -57,7 +57,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
binding.edittextServer.setText(getData("base_url"))
binding.edittextServer.setText(getData(getString(R.string.baseurl)))
binding.edittextServer.setOnKeyListener { _, keyCode, event ->
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) {
@ -65,6 +65,17 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
"base_url",
binding.edittextServer.text.toString()
)
if (binding.edittextServer.text!!.contains("test-app.verdnatura.es")){
saveData(
"base_urlSalix",
"https://test-salix.verdnatura.es/api/"
)
}else{
saveData(
"base_urlSalix",
"https://salix.verdnatura.es/api/"
)
}
this.hideKeyboard()
//sergio: deberia lanzar la funcion nueva creada por mi restartapp de BaseFragment. Pero no vuelve a arrancar
@ -139,7 +150,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
if (it.IsVersionCritical == 1) {
customDialog.setDescription(getString(R.string.updatecritical))
} else {
customDialog.setKoButton("Cancelar") {
customDialog.setKoButton(getString(R.string.cancel)) {
customDialog.dismiss()
goToMain()
}
@ -192,9 +203,9 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
deviceLog_add(
binding.edittextUsername.text.toString(),
binding.edittextPassword.text.toString(),
"warehouse",
getString(R.string.app_name),
getInfoVersionNameApp(),
getData(ANDROID_ID), "deviceLog_add"
getData(ANDROID_ID)
)
if (binding.switchRemember.isChecked) {
@ -216,7 +227,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
}
if (it.vIsAuthorized == "1" && !it.vMessage.isNullOrEmpty()) {
binding.splashProgress.visibility = View.GONE
customDialog.setTitle("Mensaje").setDescription(it.vMessage)
customDialog.setTitle(getString(R.string.info)).setDescription(it.vMessage)
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
/* binding.splashProgress.visibility = View.VISIBLE
@ -254,7 +265,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
customDialog.setTitle(getString(R.string.error))
.setDescription(it.errorMessage)
.setOkButton(
"Aceptar"
getString(R.string.accept)
) {
customDialog.dismiss()
getVersion()
@ -284,7 +295,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
event.getContentIfNotHandled().notNull {
if (it.list.isEmpty()) {
"Tiene que seleccionar impresora.".toast(context)
getString(R.string.selectPrinter).toast(context)
} else {
if (!it.list.get(0).isError) {
saveDataInt(PRINTERFK, it.list.get(0).id!!)
@ -309,7 +320,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
// .setDescription(it.errorMessage + ". Puedes continuar pero algunas funcionalidades no estarán disponibles.")
.setDescription(it.errorMessage)
.setOkButton(
"Entendido"
getString(R.string.accept)
) {
customDialog.dismiss()
//getVersion()

View File

@ -236,7 +236,7 @@ class LoginViewModel(context: Context) : BaseViewModel()
fun deviceLog_add(
user: String, password: String, app: String, versionApp: String, android_id: String,callFunction: String
user: String, password: String, app: String, versionApp: String, android_id: String
)
{
getLoginUserCase.deviceLog_add(user, password, app, versionApp, android_id)
@ -248,7 +248,7 @@ class LoginViewModel(context: Context) : BaseViewModel()
if (!response.isSuccessful)
{
messageError(callFunction,response.message())
messageError(nameofFunction(this),response.message())
}
}
@ -256,7 +256,7 @@ class LoginViewModel(context: Context) : BaseViewModel()
override fun onFailure(call: Call<Void>, t: Throwable)
{
messageError(callFunction,t.message!!)
messageError(nameofFunction(this),t.message!!)
}
})

View File

@ -545,7 +545,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
customDialog.dismiss()
finish()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialog.dismiss()
}.show()
@ -674,7 +674,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
message.toast(this, Toast.LENGTH_SHORT)
} else {
customDialog.setTitle(titleWithError).setDescription(message)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()
}

View File

@ -170,7 +170,7 @@ class ExpeditionScanFragment (
viewModel.expeditionScanDel(getData(USER),
getData(PASSWORD),itemExpeditionScanVO.id)
customDialogTwoButtons.dismiss()
}.setKoButton("Cancelar"){
}.setKoButton(getString(R.string.cancel)){
customDialogTwoButtons.dismiss()
}.show()
}

View File

@ -46,7 +46,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
override fun init() {
customDialogHor = CustomDialogHour(requireContext())
binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = "PScan: "+getCURDATE()
binding.mainToolbar.toolbarTitle.text = getString(R.string.psScan)+getCURDATE()
//binding.mainToolbar.backButton.visibility = View.GONE
setToolBar()
////Log.i("VERDNATURA:","1-cargamos expediciones")
@ -111,7 +111,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
}
private fun addTruck(){
customDialogHor.setTitle("Nuevo Camión").setOkButton("Guardar"){
customDialogHor.setTitle(getString(R.string.newTruck)).setOkButton(getString(R.string.save)){
ma.hideKeyboard(customDialogHor.getDestinoEditText())
if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){
viewModel.expeditionTruckAdd(getData(USER),
@ -121,7 +121,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
}
ma.hideKeyboard(customDialogHor.getDestinoEditText())
customDialogHor.dismiss()
}.setKoButton("Cancelar"){
}.setKoButton(getString(R.string.cancel)){
customDialogHor.dismiss()
}.setHoraValue("").setDestinoValue("").show()

View File

@ -69,14 +69,10 @@ class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBindi
with(viewModel){
response.observe(viewLifecycleOwner, Observer {
if (it.isError){
// mperror?.start()
// binding.splashProgress.visibility = View.GONE
ma.messageWithSound(it.errorMessage, isError = true,isPlayed = true)
/*customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton(getString(R.string.close)){
customDialog.dismiss()
}.show()*/
}else{
ma.messageWithSound(message="Parking ok", isError = false,isPlayed = false, isToasted = true)
ma.messageWithSound(message=getString(R.string.Aparcado), isError = false,isPlayed = false, isToasted = true)
numParking -= 1
if (numParking <= 0) {
// binding.splashProgress.visibility = View.GONE

View File

@ -42,21 +42,21 @@ class ParkingViewModel(context: Context) : BaseViewModel() {
fun parking(usuario: String,password: String,scanItem: String,parking:String){
ProgressLoading(VISIBLE)
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
Callback<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
}
override fun onResponse(call: Call<String>, response: Response<String>) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
ProgressLoading(GONE)
if (response.body() == null){
/*if (response.body() == null){
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
}else{
if (response.body() == "Finish")
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}else{*/
if (response.isSuccessful)
_response.value = ResponseItemVO(isError = false,response = response.message())
else
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
}
}
})
}

View File

@ -48,17 +48,17 @@ class ParkingSaleViewModel(context: Context) : BaseViewModel() {
fun parking(usuario: String,password: String,scanItem: String,parking:String){
ProgressLoading(VISIBLE)
getUbicadorUserCase.shelvingPark(usuario,password,scanItem,parking).enqueue(object :
Callback<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
}
override fun onResponse(call: Call<String>, response: Response<String>) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
ProgressLoading(GONE)
if (!response.isSuccessful){
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = "Parking ok")
_response.value = ResponseItemVO(isError = false,response = response.message())
}
}
})

View File

@ -214,7 +214,7 @@ class EndSacadorFragment(
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
}
@ -242,7 +242,7 @@ class EndSacadorFragment(
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
} else {
@ -558,7 +558,7 @@ class EndSacadorFragment(
binding.splashProgress.visibility = View.VISIBLE
viewModel.sectorCollectionSaleGroup_add(
getData(USER), getData(PASSWORD), ticketFk,
collection.collectionFk, "sectorCollectionSaleGroup_add"
collection.collectionFk
)
}
@ -674,7 +674,7 @@ class EndSacadorFragment(
binding.splashProgress.visibility = VISIBLE
viewModel.saleTracking_addPrevOK(
usuario = getData(USER), password = getData(PASSWORD),
vSectorCollectionFk = collection.collectionFk, callFunction = "saleTracking_addPrevOK"
vSectorCollectionFk = collection.collectionFk
)
@ -777,8 +777,8 @@ class EndSacadorFragment(
usuario = getData(USER),
password = getData(PASSWORD),
vSaleFk = sales[position].idMovimiento,
vIsChecked = if (sales[position].picked == sales[position].quantity) "1" else "0",
callFunction = "saleTracking_updateIsChecked"
vIsChecked = if (sales[position].picked == sales[position].quantity) "1" else "0"
)
}
if (sales[position].picked == 0) {
@ -786,8 +786,8 @@ class EndSacadorFragment(
usuario = getData(USER),
password = getData(PASSWORD),
vSaleFk = sales[position].idMovimiento,
vIsChecked = if (sales[position].picked == sales[position].quantity) "1" else "0",
callFunction = "saleTracking_updateIsChecked"
vIsChecked = if (sales[position].picked == sales[position].quantity) "1" else "0"
)
}
@ -819,8 +819,7 @@ class EndSacadorFragment(
usuario = getData(USER),
password = getData(PASSWORD),
saleFk = sales[position].idMovimiento,
visible = sales[position].quantity.toString(),
"itemShelving_updateFromSale"
visible = sales[position].quantity.toString()
)
positionUnmarked = position
//sergio: anterior previa
@ -834,7 +833,7 @@ class EndSacadorFragment(
//setTotalLines()
scanRequest()
customDialog.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialog.dismiss()
}.show()
@ -858,8 +857,7 @@ class EndSacadorFragment(
password = getData(PASSWORD),
itemFk = sales[position].itemFk,
quantity = quantityGet,
shelvingFk = sales[position].carros[shelvingPosition].shelving,
callFunction = "itemPlacementSupplyAiming"
shelvingFk = sales[position].carros[shelvingPosition].shelving
)
}
@ -1030,7 +1028,7 @@ class EndSacadorFragment(
/* private fun showScannerParking(ticket: String) {
customDialogInputParking.setTitle("Parking").setDescription("Escanea el parking")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (!customDialogInputParking.getValue().isNullOrEmpty()) {
//findSale(customDialogInput.getValue(),index)
parkingTicket(ticket, customDialogInputParking.getValue())
@ -1040,7 +1038,7 @@ class EndSacadorFragment(
scanRequest()
customDialogInputParking.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInputParking.dismiss()
}.setValue("").show()
customDialogInputParking.getEditText().requestFocus()
@ -1063,7 +1061,7 @@ class EndSacadorFragment(
/*private fun showScannerTicket() {
customDialogInput.setTitle("Ticket a aparcar").setDescription("Escanea el ticket a aparcar")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
showScannerParking(customDialogInput.getValue())
@ -1072,7 +1070,7 @@ class EndSacadorFragment(
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("").show()
customDialogInput.getEditText().requestFocus()
@ -1096,7 +1094,7 @@ class EndSacadorFragment(
private fun showScanner(index: Int, sale: PreSacadorItemVO) {
customDialogInput.setTitle("" + sale.itemFk)
.setDescription("Escanea el carro para el item seleccionado").setOkButton("Aceptar") {
.setDescription("Escanea el carro para el item seleccionado").setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
findSale(customDialogInput.getValue(), index)
}
@ -1104,7 +1102,7 @@ class EndSacadorFragment(
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("").show()
customDialogInput.getEditText().requestFocus()
@ -1264,7 +1262,7 @@ class EndSacadorFragment(
getString(R.string.Agregar)
)
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
@ -1311,7 +1309,7 @@ class EndSacadorFragment(
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "FALSE",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
}
@ -1361,7 +1359,7 @@ class EndSacadorFragment(
scanRequest()
customDialogThreeButtons.dismiss()
}
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
@ -1426,7 +1424,7 @@ class EndSacadorFragment(
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "FALSE",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
//sales[position].originalQuantity = quantity
try {
@ -1466,7 +1464,7 @@ class EndSacadorFragment(
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "TRUE",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
//sales[position].originalQuantity = quantity
try {
@ -1508,7 +1506,7 @@ class EndSacadorFragment(
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "reject",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
//enviar mensaje a salix
@ -1541,8 +1539,8 @@ class EndSacadorFragment(
usuario = getData(USER),
password = getData(PASSWORD),
saleFk = sales[position].idMovimiento,
quantity = quantity,
callFunction = "collection_increaseQuantity"
quantity = quantity
)
try {
@ -1579,8 +1577,7 @@ class EndSacadorFragment(
usuario = getData(USER),
password = getData(PASSWORD),
saleFk = sales[position].idMovimiento,
quantity = quantity,
callFunction = "collection_increaseQuantity"
quantity = quantity
)

View File

@ -91,7 +91,7 @@ class InitPreSacadorFragment (
iconAdd.drawable -> {
binding.splashProgress.visibility = View.VISIBLE
viewModel.sectorCollection_new(getData(USER),
getData(PASSWORD),getData(SECTORFK),"sectorCollection_new")
getData(PASSWORD),getData(SECTORFK))
}
}
@ -177,7 +177,7 @@ class InitPreSacadorFragment (
} else {
customDialog.setTitle("Atención")
.setDescription("La colección " + collection + " sigue pendiente de preparar")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()
}

View File

@ -179,7 +179,7 @@ class PreSacadorFragment :
if (it.isError) {
ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
}
@ -201,7 +201,7 @@ class PreSacadorFragment :
if (it.isError) {
ma.messageWithSound(it.errorMessage,true,false)
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
} else {
@ -413,7 +413,7 @@ class PreSacadorFragment :
/* customDialog.setTitle("Pre Sacador")
.setDescription("No hemos podido obtener movimientos para el ticket escaneado")
.setKoButton("Cancelar") {
.setKoButton(getString(R.string.cancel)) {
customDialog.dismiss()
}.show()*/
} else {
@ -604,7 +604,7 @@ class PreSacadorFragment :
vIsChecked = if (sales[position].picked == sales[position].quantity) "1" else "0",
vOriginalQuantity = sales[position].picked.toString(),
vStateFk = PRESACADOR,
vBuyFk = originalItemScan, callFunction = "saleTrackingReplace"
vBuyFk = originalItemScan
)
@ -615,7 +615,7 @@ class PreSacadorFragment :
vIsChecked = if (sales[position].picked == sales[position].quantity) "1" else "0",
vOriginalQuantity = sales[position].picked.toString(),
vStateFk = PRESACADOR,
vBuyFk = originalItemScan, callFunction = "saleTrackingReplace"
vBuyFk = originalItemScan
)
@ -640,7 +640,7 @@ class PreSacadorFragment :
setTotalLines()
scanRequest()
customDialog.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialog.dismiss()
}.show()
@ -664,8 +664,8 @@ class PreSacadorFragment :
password = getData(PASSWORD),
itemFk = sales[position].itemFk,
quantity = quantityGet,
shelvingFk = sales[position].carros[shelvingPosition].shelving,
callFunction = "itemPlacementSupplyAiming"
shelvingFk = sales[position].carros[shelvingPosition].shelving
)
}
@ -830,7 +830,7 @@ class PreSacadorFragment :
/* private fun showScannerParking(ticket: String) {
customDialogInputParking.setTitle("Parking").setDescription("Escanea el parking")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (!customDialogInputParking.getValue().isNullOrEmpty()) {
//findSale(customDialogInput.getValue(),index)
parkingTicket(ticket, customDialogInputParking.getValue())
@ -840,7 +840,7 @@ class PreSacadorFragment :
scanRequest()
customDialogInputParking.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInputParking.dismiss()
}.setValue("").show()
customDialogInputParking.getEditText().requestFocus()
@ -863,7 +863,7 @@ class PreSacadorFragment :
/*private fun showScannerTicket() {
customDialogInput.setTitle("Ticket a aparcar").setDescription("Escanea el ticket a aparcar")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
showScannerParking(customDialogInput.getValue())
@ -872,7 +872,7 @@ class PreSacadorFragment :
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("").show()
customDialogInput.getEditText().requestFocus()
@ -896,7 +896,7 @@ class PreSacadorFragment :
private fun showScanner(index: Int, sale: PreSacadorItemVO) {
customDialogInput.setTitle("" + sale.itemFk)
.setDescription("Escanea el carro para el item seleccionado").setOkButton("Aceptar") {
.setDescription("Escanea el carro para el item seleccionado").setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
findSale(customDialogInput.getValue(), index)
}
@ -904,7 +904,7 @@ class PreSacadorFragment :
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("").show()
customDialogInput.getEditText().requestFocus()
@ -1055,7 +1055,7 @@ class PreSacadorFragment :
getString(R.string.Agregar)
)
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
@ -1101,7 +1101,7 @@ class PreSacadorFragment :
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "FALSE",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
}
@ -1151,7 +1151,7 @@ class PreSacadorFragment :
scanRequest()
customDialogThreeButtons.dismiss()
}
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialogThreeButtons.dismiss()
}.show()
@ -1215,7 +1215,7 @@ class PreSacadorFragment :
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "FALSE",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
//sales[position].originalQuantity = quantity
try {
@ -1255,7 +1255,7 @@ class PreSacadorFragment :
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "TRUE",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
//sales[position].originalQuantity = quantity
try {
@ -1297,7 +1297,7 @@ class PreSacadorFragment :
quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK),
type = "reject",
originalQuantity = quantity, callFunction = "collectionMissingTrash"
originalQuantity = quantity
)
//enviar mensaje a salix
@ -1330,8 +1330,7 @@ class PreSacadorFragment :
usuario = getData(USER),
password = getData(PASSWORD),
saleFk = sales[position].idMovimiento,
quantity = quantity,
callFunction = "collection_increaseQuantity"
quantity = quantity
)
try {
@ -1367,8 +1366,7 @@ class PreSacadorFragment :
usuario = getData(USER),
password = getData(PASSWORD),
saleFk = sales[position].idMovimiento,
quantity = quantity,
callFunction = "collection_increaseQuantity"
quantity = quantity
)

View File

@ -131,7 +131,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
collectionFk: String,
sectorFk: String, callFunction: String
sectorFk: String
) {
getSacadorControladorUserCase.collectionStickerPrint(
usuario,
@ -167,20 +167,19 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
ticketFk: String,
parking: String,
callFunction: String
parking: String
) {
getUbicadorUserCase.shelvingPark(usuario, password, ticketFk, parking)
.enqueue(object : Callback<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
.enqueue(object : Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(call: Call<String>, response: Response<String>) {
if (response.body() == null) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (!response.isSuccessful) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
@ -190,7 +189,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
)
} else {
_response.value =
ResponseItemVO(isError = false, response = response.body()!!)
ResponseItemVO(isError = false, response = response.message())
}
}
})
@ -232,7 +231,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
password: String,
shelvingFk: String,
quantity: String,
itemFk: String, callFunction: String
itemFk: String
) {
getSacadorControladorUserCase.itemPlacementSupplyAiming(
usuario,
@ -321,7 +320,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
vOriginalQuantity: String,
vStateFk: String,
vIsChecked: String,
vBuyFk: String, callFunction: String
vBuyFk: String
) {
//Lo ultimo que se envia
//sergio: se quita el 0 que habia por defecto para la previa se añada el buyFk que sera el item escaneado.
@ -458,7 +457,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
quantity: String,
type: String,
warehouseFk: String,
originalQuantity: String, callFunction: String
originalQuantity: String
) {
getSacadorControladorUserCase.collectionMissingTrash(
usuario,
@ -497,7 +496,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
saleFk: String,
quantity: String, callFunction: String
quantity: String
) {
getSacadorControladorUserCase.collectionIncreaseQuantity(
usuario,
@ -612,8 +611,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
fun sectorCollection_new(
usuario: String,
password: String,
sectorFk: String,
callFunction: String
sectorFk: String
) {
getPreSacadorUseCase.sectorCollection_new(usuario, password, sectorFk).enqueue(
object :
@ -710,8 +708,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
vSaleGroupFk: String,
vSectorCollectionFk: String,
callFunction: String
vSectorCollectionFk: String
) {
getPreSacadorUseCase.sectorCollectionSaleGroup_add(
usuario,
@ -764,8 +761,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
fun saleTracking_addPrevOK(
usuario: String,
password: String,
vSectorCollectionFk: String,
callFunction: String
vSectorCollectionFk: String
) {
getPreSacadorUseCase.saleTracking_addPrevOK(usuario, password, vSectorCollectionFk).enqueue(
object :
@ -815,8 +811,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
vSaleFk: String,
vIsChecked: String,
callFunction: String
vIsChecked: String
) {
getPreSacadorUseCase.saleTracking_updateIsChecked(usuario, password, vSaleFk, vIsChecked)
.enqueue(
@ -868,8 +863,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
saleFk: String,
visible: String,
callFunction: String
visible: String
) {
getSacadorControladorUserCase.itemShelving_updateFromSale(
usuario,

View File

@ -85,14 +85,14 @@ class QrFragment(
// getMessageFromJSON(it.errorMessage)
ma.messageWithSound(it.errorMessage+ " "+itemscaned,true,false)
/*customDialog.setTitle(getString(R.string.error)).setDescription( it.errorMessage+ " "+itemscaned)
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()*/
} else {
customDialog.setTitle("Mensaje")
.setDescription("Operación " + itemscaned + ". " + it.response)
.setOkButton("Aceptar") {
customDialog.setTitle(getString(R.string.info))
.setDescription(getString(R.string.operation) + itemscaned + ". " + it.response)
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
binding.mainToolbar.backButton.performClick()
}.show()

View File

@ -105,14 +105,14 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
viewModel.itemPlacementSupplyGetOrder(
usuario = getData(USER),
password = getData(PASSWORD),
sectorFk = getData(SECTORFK),
"itemPlacementSupplyGetOrder"
sectorFk = getData(SECTORFK)
)
}
binding.btnCancelar.setOnClickListener {
customDialog.setTitle("Confirmar").setDescription("¿Estás seguro de cerrar el pedido?")
customDialog.setTitle(getString(R.string.confirm)).setDescription(getString(R.string.closeOdrder))
.setKoButton(getString(R.string.close)) {
scanRequest()
customDialog.dismiss()
@ -164,8 +164,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
viewModel.itemPlacementSupplyGetOrder(
usuario = getData(USER),
password = getData(PASSWORD),
sectorFk = getData(SECTORFK),
"itemPlacementSupplyGetOrder"
sectorFk = getData(SECTORFK)
)
binding.collectionSwipe.isRefreshing = false
}
@ -233,7 +233,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
binding.splashProgress.visibility = View.GONE
if (salesList.isNullOrEmpty()) {
customDialog.setTitle("Reposición").setDescription("No existen pedidos para reponer")
.setKoButton("Cancelar") {
.setKoButton(getString(R.string.cancel)) {
if (sales.count() > 0) {
sales.clear()
saleAdapter!!.notifyDataSetChanged()
@ -356,8 +356,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
password = getData(PASSWORD),
itemFk = sales[position].itemFk,
quantity = quantityGet,
shelvingFk = sales[position].carros[shelvingPosition].shelving,
callFunction = "itemPlacementSupplyAiming"
shelvingFk = sales[position].carros[shelvingPosition].shelving
)
}
@ -483,7 +482,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
password = getData(PASSWORD),
itemShelvingFk = itemShelvingFk,
itemPlacementSupplyFk = sales[storedPosition].id,
quantity = customDialogList.getValue(), "itemShelvingPlacementSupplyAdd"
quantity = customDialogList.getValue()
)
} catch (e: Exception) {
@ -555,7 +554,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
private fun showScanner(index: Int, sale: PreSacadorItemVO) {
customDialogInput.setTitle("" + sale.itemFk)
.setDescription("Escanea el carro para el item seleccionado").setOkButton("Aceptar") {
.setDescription("Escanea el carro para el item seleccionado").setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) {
findSale(customDialogInput.getValue(), index)
}
@ -563,7 +562,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
scanRequest()
customDialogInput.dismiss()
hideKeyboards()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.setValue("").show()
customDialogInput.getEditText().requestFocus()
@ -600,7 +599,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
)*/
scanRequest()
customDialog.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
scanRequest()
customDialog.dismiss()
}.show()

View File

@ -47,8 +47,8 @@ class ReposicionViewModel(context: Context) : BaseViewModel() {
fun itemPlacementSupplyGetOrder(
usuario: String,
password: String,
sectorFk: String,
callFunction: String
sectorFk: String
) {
getPreSacadorUseCase.itemPlacementSupplyGetOrder(usuario, password, sectorFk)
.enqueue(object :
@ -74,20 +74,20 @@ class ReposicionViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
ticketFk: String,
parking: String,
callFunction: String
parking: String
) {
getUbicadorUserCase.shelvingPark(usuario, password, ticketFk, parking)
.enqueue(object : Callback<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
.enqueue(object : Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(call: Call<String>, response: Response<String>) {
if (response.body() == null) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (!response.isSuccessful) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
@ -97,7 +97,7 @@ class ReposicionViewModel(context: Context) : BaseViewModel() {
)
} else {
_response.value =
ResponseItemVO(isError = false, response = response.body()!!)
ResponseItemVO(isError = false, response = response.message())
}
}
})
@ -108,8 +108,8 @@ class ReposicionViewModel(context: Context) : BaseViewModel() {
password: String,
shelvingFk: String,
quantity: String,
itemFk: String,
callFunction: String
itemFk: String
) {
getSacadorControladorUserCase.itemPlacementSupplyAiming(
usuario,
@ -186,8 +186,8 @@ class ReposicionViewModel(context: Context) : BaseViewModel() {
password: String,
itemShelvingFk: String,
itemPlacementSupplyFk: String,
quantity: String,
callFunction: String
quantity: String
) {
getSacadorControladorUserCase.itemShelvingPlacementSupplyAdd(
usuario,

View File

@ -207,7 +207,7 @@ class SacadorFragment :
/* collectionTicketList.observe(viewLifecycleOwner, Observer {
binding.splashProgress_two.visibility = View.GONE
if (it.isError){
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton("Aceptar"){
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton(getString(R.string.accept)){
customDialog.dismiss()
}.show()
}else{
@ -300,7 +300,7 @@ class SacadorFragment :
} else {
customDialog.setTitle("Atención")
.setDescription("La colección " + collection + " sigue pendiente de preparar")
.setOkButton("Aceptar") {
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
}.show()
}

View File

@ -98,7 +98,7 @@ class UbicadorFragment(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
iconAdd.tooltipText = "Añade item al carro"
iconAdd.tooltipText = getString(R.string.addItemShelving)
}
listIcons.add(iconAdd)
listIcons.add(iconReload)
@ -184,24 +184,24 @@ class UbicadorFragment(
entryPoint = shelvingFk
)
else
"Escanea una matrícula".toast(requireActivity(), Toast.LENGTH_SHORT)
getString(R.string.scanShelving).toast(requireActivity(), Toast.LENGTH_SHORT)
}
binding.parkingImg.setOnClickListener {
customDialogInput.setTitle("Aparcar carro").setValue("").setOkButton("Aparcar") {
customDialogInput.setTitle(getString(R.string.parkingShelving)).setValue("").setOkButton(getString(
R.string.parking)) {
viewModel.shelvingPark(
getData(USER),
getData(PASSWORD),
shelvingFk,
customDialogInput.getValue(),
"shelvingPark"
customDialogInput.getValue()
)
parking = customDialogInput.getValue()
binding.mainToolbar.toolbarTitle.text =
shelvingFk.uppercase() + " P: " + parking + " E: " + etiquetas
if (mpok != null) mpok!!.start()
customDialogInput.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.show()
@ -214,8 +214,7 @@ class UbicadorFragment(
getData(USER),
getData(PASSWORD),
shelvingFk,
customDialogInput.getValue(),
"shelvingPark"
customDialogInput.getValue()
)
customDialogInput.dismiss()
parking = customDialogInput.getValue()
@ -237,7 +236,7 @@ class UbicadorFragment(
}
binding.editImg.setOnClickListener {
customDialogInput.setTitle("Cambiar matrícula").setValue("").setOkButton("Guardar") {
customDialogInput.setTitle("Cambiar matrícula").setValue("").setOkButton(getString(R.string.save)) {
viewModel.shelvingChange(
getData(USER),
getData(PASSWORD),
@ -249,7 +248,7 @@ class UbicadorFragment(
shelvingFk.uppercase() + " P: " + parking + " E: " + etiquetas
if (mpok != null) mpok!!.start()
customDialogInput.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.show()
@ -291,7 +290,7 @@ class UbicadorFragment(
adapter!!.notifyDataSetChanged()
}
customDialog.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialog.dismiss()
}.show()
@ -302,13 +301,13 @@ class UbicadorFragment(
private fun setTooltips() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
binding.editImg.tooltipText = "Permite cambiar la matrícula al carro"
binding.deleteImg.tooltipText = "Borra todos los items del carro"
binding.editImg.tooltipText = getTooltip(R.drawable.ic_mode_edit_black_24dp)
binding.deleteImg.tooltipText = getTooltip(R.drawable.ic_delete_forever_black_24dp)
binding.editPrioridad.tooltipText =
"Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores."
binding.parkingImg.tooltipText = "Permite aparcar el carro"
binding.automaticImg.tooltipText =
"Permite añadir items al carro de manera continuada. No uno a uno"
getString(R.string.changePriority)
binding.parkingImg.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
binding.automaticImg.tooltipText =getTooltip(R.drawable.ic_flash_auto_black_24dp)
}
}
@ -382,6 +381,8 @@ class UbicadorFragment(
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()*/
}else{
ma.messageWithSound(getString(R.string.Aparcado), it.isError, true)
}
})
@ -426,11 +427,11 @@ class UbicadorFragment(
itemUbicador: ItemUbicadorVO,
grouping: String
) {
var title = "Nuevo Item"
if (delete) title = "Editar item " + itemFk
var title = getString(R.string.newItem)
if (delete) title = getString(R.string.editItem) + itemFk
customDialogUbicador.setTitle(title).setItemValue(itemFk).setPackingValue(packing)
.setGroupingValue(grouping).setEtiquetaValue(etiquetas).setVisibleValue(visible)
.setOkButton("Guardar") {
.setOkButton(getString(R.string.save)) {
var packingUpdate = false
if (packing != customDialogUbicador.getPackingValue() || etiquetas != customDialogUbicador.getEtiquetaValue()) {
packingUpdate = true
@ -561,7 +562,7 @@ class UbicadorFragment(
customDialogUbicador.dismiss()
} else {
"Rellena campos obligatorios".toast(
getString(R.string.fillFields).toast(
(activity as MainActivity),
Toast.LENGTH_LONG
)
@ -628,7 +629,7 @@ class UbicadorFragment(
customDialogUbicador.dismiss()
} else {
"Rellena campos obligatorios".toast(
getString(R.string.fillFields).toast(
(activity as MainActivity),
Toast.LENGTH_LONG
)
@ -636,7 +637,7 @@ class UbicadorFragment(
}
} else {
"Packing obligatorio".toast((activity as MainActivity), Toast.LENGTH_LONG)
getString(R.string.mandatoryPacking).toast((activity as MainActivity), Toast.LENGTH_LONG)
}
}
@ -670,7 +671,7 @@ class UbicadorFragment(
}
private fun showMoreOptions(item: ItemUbicadorVO) {
customDialogTwoButtons.setTitle(item.item).setDescription("Selecciona una acción")
customDialogTwoButtons.setTitle(item.item).setDescription(getString(R.string.selectAction))
.setOkButton("Transferir") {
customDialogInput.setTitle("Nueva matrícula")
.setDescription("Introduce el destino para item: " + item.item).setValue("")
@ -690,7 +691,7 @@ class UbicadorFragment(
}
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.show()
customDialogInput.getEditText().requestFocus()
@ -711,10 +712,10 @@ class UbicadorFragment(
false
}
customDialogTwoButtons.dismiss()
}.setOkButtonTwo("Eliminar") {
customDialog.setTitle("Confirmar")
}.setOkButtonTwo(getString(R.string.delete)) {
customDialog.setTitle(getString(R.string.confirm))
.setDescription("Confirmas eliminar el artículo: " + item.item + "?")
.setOkButton("Eliminar") {
.setOkButton(getString(R.string.delete)) {
listItems.remove(item)
adapter!!.notifyDataSetChanged()
viewModel.itemShelvingDelete(
@ -723,12 +724,12 @@ class UbicadorFragment(
)
customDialogTwoButtons.dismiss()
customDialog.dismiss()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialog.dismiss()
customDialogTwoButtons.dismiss()
}.show()
}.setKoButton("Cancelar") {
}.setKoButton(getString(R.string.cancel)) {
customDialogTwoButtons.dismiss()
}.show()
}

View File

@ -229,20 +229,19 @@ class UbicadorViewModel(context: Context) : BaseViewModel() {
usuario: String,
password: String,
shelving: String,
parking: String,
callFunction: String
parking: String
) {
getUbicadorUserCase.shelvingPark(usuario, password, shelving, parking)
.enqueue(object : Callback<String> {
override fun onFailure(call: Call<String>, t: Throwable) {
.enqueue(object : Callback<Any> {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(call: Call<String>, response: Response<String>) {
if (response.body() == null) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (!response.isSuccessful) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
@ -252,7 +251,7 @@ class UbicadorViewModel(context: Context) : BaseViewModel() {
)
} else {
_response.value =
ResponseItemVO(isError = false, response = response.body()!!)
ResponseItemVO(isError = false, response = response.message())
}
}
})

View File

@ -210,7 +210,8 @@ class WorkermistakeFragment( var entryPoint: String = ""
}
customDialogList.setTitle("Causa de error para : ${workerMistakeName!!.firstName}").setKoButton("Cancelar") {
customDialogList.setTitle(getString(R.string.errorCause)+ workerMistakeName!!.firstName).setKoButton(getString(
R.string.cancel)) {
customDialogList.dismiss()
}.hideDialog().show()
@ -223,7 +224,7 @@ class WorkermistakeFragment( var entryPoint: String = ""
viewModel.workerMistake_Add(usuario = getData(USER),
password = getData(PASSWORD),
vUserFk = workerMistakeName!!.id,
vTypeFk = it.code, callFunction ="workerMistake_Add"
vTypeFk = it.code
)
// "Causa del error registrado".toast(requireContext())
customDialogList.dismiss()

View File

@ -47,7 +47,7 @@
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Eliminar"
tools:text="@string/delete"
tools:visibility="visible" />
<Button
@ -57,7 +57,7 @@
android:layout_marginTop="@dimen/default_layout_margin"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:text="@string/cancel"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -65,7 +65,7 @@
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Eliminar"
tools:text="@string/delete"
tools:visibility="visible" />
<Button
@ -75,7 +75,7 @@
android:layout_marginTop="@dimen/default_layout_margin"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:text="@string/cancel"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -120,7 +120,7 @@
android:layout_marginTop="@dimen/default_layout_margin"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:text="@string/cancel"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -98,7 +98,7 @@
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Eliminar"
tools:text="@string/delete"
tools:visibility="visible" />
<Button
@ -108,7 +108,7 @@
android:layout_marginTop="@dimen/default_layout_margin"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:text="@string/cancel"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -111,7 +111,7 @@
android:layout_marginTop="@dimen/layout_margin_1"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:text="@string/cancel"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -64,7 +64,7 @@
android:layout_marginTop="@dimen/default_layout_margin"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:text="@string/cancel"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -155,7 +155,7 @@
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Eliminar"
tools:text="@string/delete"
tools:visibility="visible" />
<Button
@ -165,7 +165,7 @@
android:layout_marginTop="@dimen/default_layout_margin"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:text="@string/cancel"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -73,7 +73,7 @@
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="@drawable/btn_blue"
android:text="Cancelar"
android:text="@string/cancel"
android:textColor="@color/verdnatura_white"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -208,4 +208,32 @@
<string name="showTrash">Ver movimientos de Basura</string>
<string name="filterFlower">Filtra por tipo de flor</string>
<string name="noprinter">Sin impresora</string>
<string name="dateFormat">yyyy-MM-dd</string>
<string name="cancel">Cancelar</string>
<string name="errorCause">Causa de error para :</string>
<string name="scanShelving">Escanea una matrícula</string>
<string name="parkingShelving">Aparcar carro</string>
<string name="parking">Aparcar</string>
<string name="addItemShelving">Añade item al carro</string>
<string name="save">Guardar</string>
<string name="allowChangeShelving">Permite cambiar la matrícula a un carro</string>
<string name="deleteAllitems">Borra todos los items del carro</string>
<string name="changePriority">Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.</string>
<string name="allowAutomaticAddItem">Permite añadir items al carro de manera continuada. No uno a uno</string>
<string name="newItem">Nuevo Item</string>
<string name="editItem">\"Editar item \"</string>
<string name="fillFields">Rellena campos obligatorios</string>
<string name="mandatoryPacking">Packing obligatorio</string>
<string name="selectAction">Selecciona una acción</string>
<string name="delete">Eliminar</string>
<string name="lookWithpermission">Solo puedes visualizar cuando has cogido tu mismo el vehículo a no ser que tengas permisos para ello.</string>
<string name="info">Información</string>
<string name="accept">Aceptar</string>
<string name="selectPrinter">Tiene que seleccionar impresora.</string>
<string name="newTruck">Nuevo Camión</string>
<string name="psScan">\"PScan: \"</string>
<string name="savedShelves">Baldas guardadas</string>
<string name="operation">\"Operación \"</string>
<string name="closeOdrder">¿Estás seguro de cerrar el pedido?</string>
<string name="confirm">Confirmar</string>
</resources>

View File

@ -201,10 +201,38 @@
<string name="allowParking">Permite aparcar ticket/carro</string>
<string name="allowTakeoffVehicle">Permite dejar el vehículo</string>
<string name="newCollection">Genera colección para sacar</string>
<string name="showFilter">\"Ver filtro \"</string>
<string name="showFilter">"Ver filtro"</string>
<string name="showFaults">Ver movimientos de Faltas</string>
<string name="showTrash">Ver movimientos de Basura</string>
<string name="filterFlower">Filtra por tipo de flor</string>
<string name="noprinter">Sin impresora</string>
<string name="dateFormat">yyyy-MM-dd</string>
<string name="cancel">Cancelar</string>
<string name="errorCause">Causa de error para :</string>
<string name="scanShelving">Escanea una matrícula</string>
<string name="parkingShelving">Aparcar carro</string>
<string name="parking">Aparcar</string>
<string name="addItemShelving">Añade item al carro</string>
<string name="save">Guardar</string>
<string name="allowChangeShelving">Permite cambiar la matrícula a un carro</string>
<string name="deleteAllitems">Borra todos los items del carro</string>
<string name="changePriority">Cambia la prioridad de los items del carro. Cuanto más alta antes cogerán los sacadores.</string>
<string name="allowAutomaticAddItem">Permite añadir items al carro de manera continuada. No uno a uno</string>
<string name="newItem">Nuevo Item</string>
<string name="editItem">\"Editar item \"</string>
<string name="fillFields">Rellena campos obligatorios</string>
<string name="mandatoryPacking">Packing obligatorio</string>
<string name="selectAction">Selecciona una acción</string>
<string name="delete">Eliminar</string>
<string name="lookWithpermission">Solo puedes visualizar cuando has cogido tu mismo el vehículo a no ser que tengas permisos para ello.</string>
<string name="info">Información</string>
<string name="accept">Aceptar</string>
<string name="selectPrinter">Tiene que seleccionar impresora.</string>
<string name="newTruck">Nuevo Camión</string>
<string name="psScan">\"PScan: \"</string>
<string name="savedShelves">Baldas guardadas</string>
<string name="operation">\"Operación \"</string>
<string name="closeOdrder">¿Estás seguro de cerrar el pedido?</string>
<string name="confirm">Confirmar</string>
</resources>