Version 9Beta, dos opciones a Paletizadores y carros de operator
This commit is contained in:
parent
6841dd28be
commit
1edbba1eba
|
@ -98,6 +98,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_mode_edit_black_24dp.xml" value="0.15052083333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_more_vert_black_24dp.xml" value="0.26" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_move_to_inbox_black_24dp.xml" value="0.15052083333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_pallet_scan_expedition.xml" value="0.1005" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_pallet_ui.xml" value="0.212" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_parking_ui.xml" value="0.212" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_parking_ui_selected.xml" value="0.212" />
|
||||
|
@ -128,6 +129,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_worker.xml" value="0.265" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/init_icon.xml" value="0.2635" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/init_selected_icon.xml" value="0.2635" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/lift.xml" value="0.1925" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/list_divider_items.xml" value="0.1985" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/movie_plus_outline.xml" value="0.134375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping.xml" value="0.1" />
|
||||
|
@ -157,7 +159,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_two_dialog.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_ubicador_dialog.xml" value="0.2453125" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.24166666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_automatic_add_item.xml" value="0.20625" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer.xml" value="0.1408514492753623" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_load.xml" value="0.20923913043478262" />
|
||||
|
@ -176,7 +178,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_general_black.xml" value="0.264" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historico.xml" value="0.1734375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historicovehiculo.xml" value="0.23052536231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary.xml" value="0.264" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary_old.xml" value="0.22604166666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_item_card.xml" value="0.22" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemdayofsale_card.xml" value="0.22" />
|
||||
|
@ -196,6 +198,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelving_parking.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_testing_print.xml" value="0.12462006079027356" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_transferencia.xml" value="0.10666666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ubicador.xml" value="0.22" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol.xml" value="0.3333333333333333" />
|
||||
|
@ -242,6 +245,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/qauality_fragment.xml" value="0.15353260869565216" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/reposicion_fragment.xml" value="0.15353260869565216" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/shelvinglog_row.xml" value="0.18385416666666668" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/testing_print.xml" value="0.1802536231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/toolbar.xml" value="0.15353260869565216" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/toolbarUI.xml" value="0.29846014492753625" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/toolbar_fragment.xml" value="0.22" />
|
||||
|
|
|
@ -13,9 +13,12 @@ android {
|
|||
applicationId "es.verdnatura"
|
||||
minSdkVersion 21 //21
|
||||
targetSdkVersion 30
|
||||
versionCode 128
|
||||
versionName = "8.8Beta"
|
||||
versionCode 130
|
||||
versionName = "9Beta"
|
||||
//versionName = "8.9Beta" versionCode 129
|
||||
//versionName = "8.8Beta" versioncode 128
|
||||
//versionName = "8.7Beta" versionCode 127
|
||||
//versionName = "8.8Beta"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 128,
|
||||
"versionName": "8.8Beta",
|
||||
"versionCode": 130,
|
||||
"versionName": "9Beta",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
|
Binary file not shown.
|
@ -197,4 +197,8 @@ val viewModelModule = module {
|
|||
ClaimViewModel(androidContext())
|
||||
}
|
||||
|
||||
viewModel {
|
||||
PalletScanViewModel(androidContext())
|
||||
}
|
||||
|
||||
}
|
|
@ -118,6 +118,16 @@ return restClient!!.getVersion("json", "1", usuario, password, "application/json
|
|||
return restClient!!.worker_getSector("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
|
||||
fun operator_getNumberOfWagons(usuario: String, password: String): Call<Int?> {
|
||||
|
||||
return restClient!!.operator_getNumberOfWagons("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
|
||||
fun operator_add(usuario: String, password: String): Call<Any> {
|
||||
|
||||
return restClient!!.operator_add("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
|
||||
fun worker_getPrinter(usuario: String, password: String): Call<List<Printers>> {
|
||||
|
||||
return restClient!!.worker_getPrinter("json", "1", usuario, password, "application/json")
|
||||
|
|
|
@ -275,6 +275,27 @@ class GetPaletizadoresUserCase(context: Context) : RestClient(context) {
|
|||
)
|
||||
}
|
||||
|
||||
fun expeditionPallet_get(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vPalletFk: String
|
||||
|
||||
|
||||
|
||||
): Call<ItemExpeditionTruckVO> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(vPalletFk)
|
||||
|
||||
return restClient!!.expeditionPallet_get(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
fun expeditionState_addByPallet(
|
||||
usuario: String,
|
||||
password: String,
|
||||
|
@ -296,8 +317,6 @@ class GetPaletizadoresUserCase(context: Context) : RestClient(context) {
|
|||
params
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun expeditionLoading_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
|
|
|
@ -170,7 +170,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
vStateFk: String,
|
||||
vIsChecked: String,
|
||||
vBuyFk: String
|
||||
): Call<String> {
|
||||
): Call<Any> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(saleFk)
|
||||
params.add(vOriginalQuantity)
|
||||
|
@ -451,6 +451,25 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
params
|
||||
)
|
||||
}
|
||||
fun debug_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
buyFk: String,
|
||||
message: String
|
||||
): Call<Unit> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(buyFk)
|
||||
params.add(message)
|
||||
return restClient!!.debug_add(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun getIdFromCode(usuario: String, password: String, code: String): Call<String> {
|
||||
|
|
|
@ -170,6 +170,26 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<SectorItemVO>
|
||||
|
||||
@POST("almacennew/operator_getNumberOfWagons")//NO SALIX
|
||||
fun operator_getNumberOfWagons(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String
|
||||
):
|
||||
Call<Int?>
|
||||
|
||||
@POST("almacennew/operator_add")//NO SALIX
|
||||
fun operator_add(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
//PRESACADORES ========================================================================>
|
||||
|
||||
@POST("almacennew/ticketToPrePrepare")//NO SALIX
|
||||
|
@ -369,7 +389,7 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<String>
|
||||
Call<Any>
|
||||
|
||||
/* @POST("almacennew/saleTracking_update")//REVISADA
|
||||
fun saleTracking_update(
|
||||
|
@ -539,6 +559,17 @@ interface VerdnaturaService {
|
|||
Call<Unit>
|
||||
|
||||
|
||||
@POST("almacennew/debug_add")//REVISADA
|
||||
fun debug_add(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<Unit>
|
||||
|
||||
@POST("almacennew/get_salesModifiedFromTicket")//REVISADA
|
||||
fun get_salesModifiedFromTicket(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
@ -1353,6 +1384,16 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Unit>
|
||||
|
||||
@POST("almacennew/expeditionPallet_get")//REVISADA
|
||||
fun expeditionPallet_get(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<ItemExpeditionTruckVO>
|
||||
|
||||
@POST("almacennew/expeditionLoading_add")//REVISADA
|
||||
fun expeditionLoading_add(
|
||||
|
|
|
@ -52,6 +52,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
protected val TOKEN = "token"
|
||||
protected val SECTORDESCRIP = "sectordescrip"
|
||||
protected val SECTORFK = "sectorFk"
|
||||
protected val NUMBEROFWAGONS="operatorNumberOfWagons"
|
||||
protected val PRINTERNAME= "printername"
|
||||
protected val PRINTERFK = "printerFk"
|
||||
protected val WAREHOUSEFK = "warehouseFk"
|
||||
|
@ -537,6 +538,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
DEPARTMENTMISTAKEID->prefs.getString(name,"").toString()
|
||||
PRINTERFK->prefs.getInt(name,0).toString()
|
||||
PRINTERNAME->prefs.getString(name,getString(R.string.noprinter)).toString()
|
||||
NUMBEROFWAGONS->prefs.getInt(name,1).toString()
|
||||
|
||||
"base_url"->{
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
|
|
@ -7,6 +7,13 @@ class ResponseItemVO(
|
|||
var codeError:Int=0
|
||||
)
|
||||
|
||||
class ResponseItemNumber(
|
||||
var response: Int? = null,
|
||||
var isError: Boolean = false,
|
||||
var errorMessage: String = "",
|
||||
var codeError:Int=0
|
||||
)
|
||||
|
||||
class ResponseItemMachineControl(
|
||||
var response: String = "",
|
||||
var isError: Boolean = false,
|
||||
|
|
|
@ -0,0 +1,503 @@
|
|||
package es.verdnatura.presentation.testing
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.pdf.PdfRenderer
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Parcel
|
||||
import android.os.ParcelFileDescriptor
|
||||
import android.os.ResultReceiver
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentTestingPrintBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.io.UnsupportedEncodingException
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class testPrint(
|
||||
var entryPoint: String = ""
|
||||
) : BaseFragment<FragmentTestingPrintBinding, QrFragmentViewModel>(QrFragmentViewModel::class) {
|
||||
|
||||
private var goBack: Boolean = false
|
||||
override fun getLayoutId(): Int = R.layout.fragment_testing_print
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var itemscaned = ""
|
||||
|
||||
companion object {
|
||||
fun newInstance(entryPoint: String) = testPrint(entryPoint)
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog = CustomDialog(requireContext())
|
||||
|
||||
setToolbar()
|
||||
setEvents()
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setToolbar() {
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
goBack = true
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
binding.buttonPrintTemplate.setOnClickListener {
|
||||
|
||||
printTemplate()
|
||||
}
|
||||
|
||||
binding.buttonPrintAll.setOnClickListener {
|
||||
|
||||
printAllData()
|
||||
}
|
||||
binding.buttonPrintZpl.setOnClickListener {
|
||||
|
||||
printZPL()
|
||||
}
|
||||
binding.buttonPrintStatus.setOnClickListener {
|
||||
printStatus()
|
||||
}
|
||||
|
||||
binding.buttonPrintDisconnect.setOnClickListener {
|
||||
printDisconnect()
|
||||
}
|
||||
|
||||
binding.buttonImgToPdf.setOnClickListener {
|
||||
convertImg()
|
||||
}
|
||||
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
|
||||
|
||||
goBack = false
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.qr_getCall(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
binding.scanInput.text.toString()
|
||||
)
|
||||
itemscaned = binding.scanInput.text.toString()
|
||||
}
|
||||
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
ma.hideKeyboard(binding.scanInput)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
// false
|
||||
|
||||
}
|
||||
@Throws(IOException::class)
|
||||
fun getFileFromAssets(context: Context, fileName: String): File = File(context.cacheDir, fileName)
|
||||
.also {
|
||||
if (!it.exists()) {
|
||||
it.outputStream().use { cache ->
|
||||
context.assets.open(fileName).use { inputStream ->
|
||||
inputStream.copyTo(cache)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun convertImg() {
|
||||
|
||||
val path: Uri = Uri.parse("file://android_asset/raw/test.pdf")
|
||||
|
||||
//val newPath: String = path.toString()
|
||||
val filePath = getFileFromAssets(requireContext(), "test.pdf").absolutePath
|
||||
val input = ParcelFileDescriptor.open(File(filePath), ParcelFileDescriptor.MODE_READ_ONLY)
|
||||
val renderer = PdfRenderer(input)
|
||||
|
||||
|
||||
val page = renderer.openPage(0)
|
||||
val bitmap = Bitmap.createBitmap(
|
||||
200, (200.toFloat() / page.width * page.height).toInt(), Bitmap.Config.ARGB_8888
|
||||
)
|
||||
page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY)
|
||||
|
||||
|
||||
|
||||
page.close()
|
||||
renderer.close()
|
||||
|
||||
|
||||
// do something with the bitmap, like putting it on an ImageView
|
||||
binding.imageView.setImageBitmap(bitmap)
|
||||
page.close()
|
||||
renderer.close()
|
||||
}
|
||||
|
||||
suspend fun renderSinglePage(filePath: String, width: Int) = withContext(Dispatchers.IO) {
|
||||
PdfRenderer(
|
||||
ParcelFileDescriptor.open(
|
||||
File(filePath),
|
||||
ParcelFileDescriptor.MODE_READ_ONLY
|
||||
)
|
||||
).use { renderer ->
|
||||
renderer.openPage(0).renderAndClose(width)
|
||||
}
|
||||
}
|
||||
|
||||
fun PdfRenderer.Page.renderAndClose(width: Int) = use {
|
||||
val bitmap = createBitmap(width)
|
||||
render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY)
|
||||
bitmap
|
||||
}
|
||||
|
||||
private fun PdfRenderer.Page.createBitmap(bitmapWidth: Int): Bitmap {
|
||||
val bitmap = Bitmap.createBitmap(
|
||||
bitmapWidth, (bitmapWidth.toFloat() / width * height).toInt(), Bitmap.Config.ARGB_8888
|
||||
)
|
||||
|
||||
val canvas = Canvas(bitmap)
|
||||
canvas.drawColor(Color.WHITE)
|
||||
canvas.drawBitmap(bitmap, 0f, 0f, null)
|
||||
|
||||
return bitmap
|
||||
}
|
||||
|
||||
|
||||
private fun printZPL() {
|
||||
var variableData = HashMap<String, String>()
|
||||
variableData.put("%PRODUCT_NAME%", "Apples")
|
||||
variableData.put("%MSRP%", "$1.00")
|
||||
variableData.put("%PCT%", "50")
|
||||
variableData.put("%FINAL%", "$0.50")
|
||||
variableData.put("%UPC_CODE%", "12345678")
|
||||
val passthroughData = """
|
||||
CT~~CD,~CC^~CT~
|
||||
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR4,4~SD10^JUS^LRN^CI0^XZ
|
||||
^XA
|
||||
^MMT
|
||||
^PW591
|
||||
^LL0203
|
||||
^LS0
|
||||
^FT171,82^A0N,27,26^FH\^FDBananas^FS
|
||||
^FT222,107^A0N,17,16^FH\^FD$0.99^FS
|
||||
^FT424,163^A0N,23,24^FB82,1,0,R^FH\^FD10^FS
|
||||
^FT314,167^A0N,28,28^FH\^FD$0.89^FS
|
||||
^FT367,107^A0N,17,16^FH\^FD8424245^FS
|
||||
^FT471,138^A0N,14,14^FH\^FDYou saved:^FS
|
||||
^FO451,119^GB103,54,2^FS
|
||||
^FT171,20^A0N,17,16^FH\^FDPrintConnect Template Print Example^FS
|
||||
^FT171,167^A0N,28,28^FH\^FDFinal Price:^FS
|
||||
^FT171,51^A0N,17,16^FH\^FDProduct:^FS
|
||||
^FT171,107^A0N,17,16^FH\^FDMSRP:^FS
|
||||
^FT508,163^A0N,23,24^FH\^FD%^FS
|
||||
^FT328,107^A0N,17,16^FH\^FDUPC:^FS
|
||||
^FO171,119^GB259,0,2^FS
|
||||
^PQ1,0,1,Y^XZ
|
||||
|
||||
""".trimIndent()
|
||||
|
||||
var passthroughDataBytes: ByteArray? = null
|
||||
|
||||
try {
|
||||
// Convert template ZPL string to a UTF-8 encoded byte array, which will be sent as an extra with the intent
|
||||
//templateBytes = templateData.getBytes("UTF-8");
|
||||
passthroughDataBytes = passthroughData.toByteArray()
|
||||
} catch (e: UnsupportedEncodingException) {
|
||||
// Handle exception
|
||||
}
|
||||
val intent = Intent()
|
||||
intent.component = ComponentName(
|
||||
"com.zebra.printconnect",
|
||||
"com.zebra.printconnect.print.PassthroughService"
|
||||
)
|
||||
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.PASSTHROUGH_DATA",
|
||||
passthroughDataBytes
|
||||
)
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
||||
|
||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
||||
super.onReceiveResult(resultCode, resultData)
|
||||
|
||||
if (resultCode == 0) {
|
||||
// Result code 0 indicates success
|
||||
} else {
|
||||
// Handle unsuccessful print
|
||||
// Error message (null on successful print)
|
||||
val errorMessage =
|
||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
)
|
||||
|
||||
requireContext().startService(intent)
|
||||
}
|
||||
|
||||
private fun printAllData() {
|
||||
|
||||
var variableData = HashMap<String, String>()
|
||||
variableData.put("%PRODUCT_NAME%", "Apples")
|
||||
variableData.put("%MSRP%", "$1.00")
|
||||
variableData.put("%PCT%", "50")
|
||||
variableData.put("%FINAL%", "$0.50")
|
||||
variableData.put("%UPC_CODE%", "12345678")
|
||||
|
||||
val templateData = """
|
||||
CT~~CD,~CC^~CT~
|
||||
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR4,4~SD10^JUS^LRN^CI0^XZ
|
||||
^XA
|
||||
^MMT
|
||||
^PW591
|
||||
^LL0203
|
||||
^LS0
|
||||
^FT171,82^A0N,27,26^FH\^FD%PRODUCT_NAME%^FS
|
||||
^FT222,107^A0N,17,16^FH\^FD%MSRP%^FS
|
||||
^FT424,163^A0N,23,24^FB82,1,0,R^FH\^FD%PCT%^FS
|
||||
^FT314,167^A0N,28,28^FH\^FD%FINAL%^FS
|
||||
^FT367,107^A0N,17,16^FH\^FD%UPC_CODE%^FS
|
||||
^FT471,138^A0N,14,14^FH\^FDYou saved:^FS
|
||||
^FO451,119^GB103,54,2^FS
|
||||
^FT171,20^A0N,17,16^FH\^FDPrintConnect Template Print Example^FS
|
||||
^FT171,167^A0N,28,28^FH\^FDFinal Price:^FS
|
||||
^FT171,51^A0N,17,16^FH\^FDProduct:^FS
|
||||
^FT171,107^A0N,17,16^FH\^FDMSRP:^FS
|
||||
^FT508,163^A0N,23,24^FH\^FD%^FS
|
||||
^FT328,107^A0N,17,16^FH\^FDUPC:^FS
|
||||
^FO171,119^GB259,0,2^FS
|
||||
^PQ1,0,1,Y^XZ
|
||||
|
||||
""".trimIndent()
|
||||
|
||||
|
||||
var templateBytes: ByteArray? = null
|
||||
|
||||
try {
|
||||
// Convert template ZPL string to a UTF-8 encoded byte array, which will be sent as an extra with the intent
|
||||
//templateBytes = templateData.getBytes("UTF-8");
|
||||
templateBytes = templateData.toByteArray()
|
||||
} catch (e: UnsupportedEncodingException) {
|
||||
// Handle exception
|
||||
Log.d("VERDNATURA::","Error"+e.message)
|
||||
}
|
||||
val intent = Intent()
|
||||
intent.component = ComponentName(
|
||||
"com.zebra.printconnect",
|
||||
"com.zebra.printconnect.print.TemplatePrintWithContentService"
|
||||
)
|
||||
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.TEMPLATE_DATA",
|
||||
templateBytes
|
||||
)
|
||||
intent.putExtra("com.zebra.printconnect.PrintService.VARIABLE_DATA", variableData)
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
||||
|
||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
||||
super.onReceiveResult(resultCode, resultData)
|
||||
|
||||
if (resultCode == 0) {
|
||||
// Result code 0 indicates success
|
||||
} else {
|
||||
// Handle unsuccessful print
|
||||
// Error message (null on successful print)
|
||||
val errorMessage =
|
||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
)
|
||||
|
||||
requireContext().startService(intent)
|
||||
}
|
||||
|
||||
private fun printTemplate() {
|
||||
// Define a hash map of variable data
|
||||
// Strings used for keys will be replaced by their corresponding values in your template file's ZPL
|
||||
var variableData = HashMap<String, String>()
|
||||
variableData.put("%PRODUCT_NAME%", "Bananas")
|
||||
variableData.put("%MSRP%", "$1.00")
|
||||
variableData.put("%PCT%", "50")
|
||||
variableData.put("%FINAL%", "$0.50")
|
||||
variableData.put("%UPC_CODE%", "12345678")
|
||||
val intent = Intent()
|
||||
intent.component = ComponentName(
|
||||
"com.zebra.printconnect",
|
||||
"com.zebra.printconnect.print.TemplatePrintService"
|
||||
)
|
||||
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.TEMPLATE_FILE_NAME",
|
||||
"PriceTagTemplate.zpl"
|
||||
)
|
||||
intent.putExtra("com.zebra.printconnect.PrintService.VARIABLE_DATA", variableData)
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
||||
|
||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
||||
super.onReceiveResult(resultCode, resultData)
|
||||
|
||||
if (resultCode == 0) {
|
||||
// Result code 0 indicates success
|
||||
} else {
|
||||
// Handle unsuccessful print
|
||||
// Error message (null on successful print)
|
||||
val errorMessage =
|
||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
)
|
||||
|
||||
requireContext().startService(intent)
|
||||
}
|
||||
|
||||
private fun printStatus() {
|
||||
val intent = Intent()
|
||||
intent.component = ComponentName(
|
||||
"com.zebra.printconnect",
|
||||
"com.zebra.printconnect.print.GetPrinterStatusService"
|
||||
)
|
||||
Log.d("VERDNATURA::","Entrando en prinStatus")
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
||||
|
||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
||||
super.onReceiveResult(resultCode, resultData)
|
||||
|
||||
if (resultCode == 0) {
|
||||
Log.d("VERDNATURA::","Result 0")
|
||||
// Result code 0 indicates success
|
||||
val printerStatusMap =
|
||||
resultData!!.getSerializable("PrinterStatusMap") as HashMap<String, String>?
|
||||
Toast.makeText(context, printerStatusMap.toString(), Toast.LENGTH_LONG).show()
|
||||
} else {
|
||||
// Handle unsuccessful print
|
||||
// Error message (null on successful print)
|
||||
Log.d("VERDNATURA::","Result <>0")
|
||||
val errorMessage =
|
||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
)
|
||||
|
||||
requireContext().startService(intent)
|
||||
}
|
||||
private fun printDisconnect() {
|
||||
val intent = Intent()
|
||||
intent.component = ComponentName(
|
||||
"com.zebra.printconnect",
|
||||
"com.zebra.printconnect.print.UnselectPrinterService"
|
||||
)
|
||||
|
||||
intent.putExtra(
|
||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
||||
|
||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
||||
super.onReceiveResult(resultCode, resultData)
|
||||
|
||||
if (resultCode == 0) {
|
||||
// Result code 0 indicates success
|
||||
val printerStatusMap =
|
||||
resultData!!.getSerializable("PrinterStatusMap") as HashMap<String, String>?
|
||||
Toast.makeText(context, printerStatusMap.toString(), Toast.LENGTH_LONG).show()
|
||||
} else {
|
||||
// Handle unsuccessful print
|
||||
// Error message (null on successful print)
|
||||
val errorMessage =
|
||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
)
|
||||
|
||||
requireContext().startService(intent)
|
||||
}
|
||||
private fun buildIPCSafeReceiver(resultReceiver: ResultReceiver): ResultReceiver? {
|
||||
val parcel = Parcel.obtain()
|
||||
resultReceiver.writeToParcel(parcel, 0)
|
||||
parcel.setDataPosition(0)
|
||||
val receiverForSending = ResultReceiver.CREATOR.createFromParcel(parcel)
|
||||
parcel.recycle()
|
||||
return receiverForSending
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
qrresponse.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage + " " + itemscaned, true, false)
|
||||
|
||||
} else {
|
||||
|
||||
customDialog.setTitle(getString(R.string.info))
|
||||
.setDescription(
|
||||
getString(R.string.operation) + itemscaned + "." + getString(
|
||||
R.string.answer
|
||||
) + it.response
|
||||
)
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
customDialog.dismiss()
|
||||
binding.mainToolbar.backButton.performClick()
|
||||
}.show()
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -20,7 +20,6 @@ import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
|||
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import timber.log.Timber.d
|
||||
|
||||
class AjustesFragment :
|
||||
BaseFragment<FragmentAjustesBinding, AjustesViewModel>(AjustesViewModel::class) {
|
||||
|
@ -45,25 +44,34 @@ class AjustesFragment :
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
prefs = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
customDialog = CustomDialog(requireContext())
|
||||
viewModel.inititializeDefaultAjusts(
|
||||
|
||||
//Tarea 4351 quitar if y dejar viewModel.operator solamente ( ya se encarga el viewmodel de hacer el initializeDefault y el WAGON POR NUMBEROFWAGONS)
|
||||
|
||||
|
||||
viewModel.operator_getNumberOfWagons(getData(USER), getData(PASSWORD))
|
||||
// }else{
|
||||
/* viewModel.inititializeDefaultAjusts(
|
||||
getData(SECTORDESCRIP),
|
||||
getData(SECTORFK).toInt(),
|
||||
getData(WAREHOUSEFK).toInt(),
|
||||
getData(WAGON),
|
||||
getData(NUMBEROFWAGONS),
|
||||
getData(TAGSTYPE),
|
||||
getData(PRINTERFK).toInt(),
|
||||
getData(PRINTERNAME),
|
||||
|
||||
|
||||
)
|
||||
)*/
|
||||
//}
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text=getString(R.string.settings)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.settings)
|
||||
// binding.splashProgress.visibility=View.VISIBLE
|
||||
hideBackButton(binding.mainToolbar)
|
||||
|
||||
|
||||
|
@ -103,7 +111,10 @@ class AjustesFragment :
|
|||
} else if (item.id == 5) {
|
||||
requireActivity().onBackPressed()
|
||||
} else if (item.id == 1) {
|
||||
val listCarros: ArrayList<String> = ArrayList()
|
||||
//Tarea 4351 quitar parte de mostrar los carros y quitar del layout el ">" del final
|
||||
|
||||
ma.messageWithSound("El número de carros ahora solo se puede modificar por los encargados", true, true,"Información",false)
|
||||
/* val listCarros: ArrayList<String> = ArrayList()
|
||||
listCarros.add("1")
|
||||
listCarros.add("2")
|
||||
listCarros.add("3")
|
||||
|
@ -114,17 +125,10 @@ class AjustesFragment :
|
|||
|
||||
val array = arrayOfNulls<String>(listCarros.size)
|
||||
|
||||
showDialogCarros(array = listCarros.toArray(array))
|
||||
|
||||
showDialogCarros(array = listCarros.toArray(array))*/
|
||||
|
||||
} else if (item.id == 2) {
|
||||
viewModel.printer_get(getData(USER),getData(PASSWORD))
|
||||
/* val listVoz: ArrayList<String> = ArrayList()
|
||||
listVoz.add("NO")
|
||||
listVoz.add("YES")
|
||||
vozList = listVoz
|
||||
val array = arrayOfNulls<String>(listVoz.size)
|
||||
showDialogVoz(array = listVoz.toArray(array))*/
|
||||
viewModel.printer_get(getData(USER), getData(PASSWORD))
|
||||
|
||||
} else if (item.id == 3) {
|
||||
val listTagsType: ArrayList<String> = ArrayList()
|
||||
|
@ -144,16 +148,36 @@ class AjustesFragment :
|
|||
}
|
||||
})
|
||||
|
||||
operatorGetNumberOfWagons.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||
setSettings()
|
||||
} else {
|
||||
saveDataInt(NUMBEROFWAGONS, it.response!!)
|
||||
setSettings()
|
||||
}
|
||||
|
||||
}
|
||||
workerupdateSector.observe(viewLifecycleOwner, {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
|
||||
ma.messageWithSound(if (it.isError) it.errorMessage else{getString(R.string.sectorUpdated)},it.isError,false)
|
||||
ma.messageWithSound(
|
||||
if (it.isError) it.errorMessage else {
|
||||
getString(R.string.sectorUpdated)
|
||||
}, it.isError, false
|
||||
)
|
||||
})
|
||||
|
||||
workerupdatePrinter.observe(viewLifecycleOwner, {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
|
||||
ma.messageWithSound(if (it.isError) it.errorMessage else{getString(R.string.printerUpdated)},it.isError,false)
|
||||
ma.messageWithSound(
|
||||
if (it.isError) it.errorMessage else {
|
||||
getString(R.string.printerUpdated)
|
||||
}, it.isError, false
|
||||
)
|
||||
})
|
||||
|
||||
binding.ajustessItems.adapter = ajustesAdapter
|
||||
|
@ -164,7 +188,8 @@ class AjustesFragment :
|
|||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
if (it.list.isNotEmpty() && it.list.get(0).isError) {
|
||||
customDialog.setTitle(getString(R.string.error)).setDescription(it.list.get(0).errorMessage)
|
||||
customDialog.setTitle(getString(R.string.error))
|
||||
.setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton(getString(R.string.Close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
@ -194,7 +219,8 @@ class AjustesFragment :
|
|||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
if (it.list.isNotEmpty() && it.list.get(0).isError) {
|
||||
customDialog.setTitle(getString(R.string.error)).setDescription(it.list.get(0).errorMessage)
|
||||
customDialog.setTitle(getString(R.string.error))
|
||||
.setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton(getString(R.string.Close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
@ -206,7 +232,7 @@ class AjustesFragment :
|
|||
listPrinters.add(it.name)
|
||||
}
|
||||
val array = arrayOfNulls<String>(listPrinters.size)
|
||||
printersList= it.list
|
||||
printersList = it.list
|
||||
showDialogPrinters(listPrinters.toArray(array))
|
||||
|
||||
} else {
|
||||
|
@ -224,6 +250,21 @@ class AjustesFragment :
|
|||
super.observeViewModel()
|
||||
}
|
||||
|
||||
private fun setSettings() {
|
||||
|
||||
//Tarea 4351 modificar el WAGON por NUMBEROFWAGONS
|
||||
viewModel.inititializeDefaultAjusts(
|
||||
getData(SECTORDESCRIP),
|
||||
getData(SECTORFK).toInt(),
|
||||
getData(WAREHOUSEFK).toInt(),
|
||||
getData(NUMBEROFWAGONS),
|
||||
getData(TAGSTYPE),
|
||||
getData(PRINTERFK).toInt(),
|
||||
getData(PRINTERNAME),
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
private fun showDialogPrinters(array: Array<String>) {
|
||||
val builder = AlertDialog.Builder(this.context)
|
||||
|
@ -240,7 +281,11 @@ class AjustesFragment :
|
|||
editor.apply()
|
||||
|
||||
viewModel.ajustesitem.get(2).selected = it.name
|
||||
viewModel.worker_updatePrinter(getData(USER),getData(PASSWORD),it.id.toString())
|
||||
viewModel.worker_updatePrinter(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
it.id.toString()
|
||||
)
|
||||
ajustesAdapter!!.notifyDataSetChanged()
|
||||
|
||||
return@forEach
|
||||
|
@ -270,7 +315,11 @@ class AjustesFragment :
|
|||
viewModel.ajustesitem.get(0).sectorFk = it.id
|
||||
viewModel.ajustesitem.get(0).warehouse = it.warehouseFk
|
||||
viewModel.ajustesitem.get(0).selected = it.description
|
||||
viewModel.worker_updateSector(getData(USER),getData(PASSWORD),it.id.toString())
|
||||
viewModel.worker_updateSector(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
it.id.toString()
|
||||
)
|
||||
ajustesAdapter!!.notifyDataSetChanged()
|
||||
|
||||
return@forEach
|
||||
|
|
|
@ -7,10 +7,12 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.GetAjustesUserCase
|
||||
import es.verdnatura.domain.GetLoginUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.ResponseItemNumber
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.*
|
||||
import retrofit2.Call
|
||||
|
@ -24,6 +26,8 @@ class AjustesViewModel(context: Context) : BaseViewModel() {
|
|||
private val contextApp=context
|
||||
|
||||
private val getAjustesUserCase: GetAjustesUserCase = GetAjustesUserCase(context)
|
||||
private val getLoginUserCase: GetLoginUserCase = GetLoginUserCase(context)
|
||||
|
||||
val version: String = "5.0.0"
|
||||
|
||||
private val _ajustesitem by lazy { ArrayList<AjustesItemVO>() }
|
||||
|
@ -47,6 +51,10 @@ class AjustesViewModel(context: Context) : BaseViewModel() {
|
|||
get
|
||||
() = _printerList
|
||||
|
||||
private val _operatorGetNumberOfWagons by lazy { MutableLiveData<ResponseItemNumber>() }
|
||||
val operatorGetNumberOfWagons: LiveData<ResponseItemNumber>
|
||||
get() = _operatorGetNumberOfWagons
|
||||
|
||||
|
||||
val loadSectorList = Transformations.map(_sectorList) { Event(it) }
|
||||
val loadprintersList = Transformations.map(_printerList) { Event(it) }
|
||||
|
@ -257,13 +265,47 @@ class AjustesViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
}
|
||||
|
||||
/*if (response.body() != null){
|
||||
_sectorList.value = response.body()?.let { SectorListVO(it) }
|
||||
}else{
|
||||
val listError:ArrayList<SectorItemVO> = ArrayList()
|
||||
listError.add(SectorItemVO(0,"",0,true,"Error en la llamada sector_get"))
|
||||
_sectorList.value = SectorListVO(listError)
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun operator_getNumberOfWagons(user: String, password: String) {
|
||||
|
||||
getLoginUserCase.operator_getNumberOfWagons(user, password)
|
||||
.enqueue(object : Callback<Int?> {
|
||||
override fun onFailure(call: Call<Int?>, t: Throwable) {
|
||||
|
||||
_operatorGetNumberOfWagons.value = ResponseItemNumber(
|
||||
null,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<Int?>,
|
||||
response: Response<Int?>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
_operatorGetNumberOfWagons.value = ResponseItemNumber(
|
||||
null, true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
|
||||
if (response.body() != null)
|
||||
_operatorGetNumberOfWagons.value =
|
||||
ResponseItemNumber(response.body(), isError = false)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
|
|
@ -85,6 +85,9 @@ class CollectionFragment(
|
|||
private lateinit var ticketToParking: String
|
||||
private lateinit var ticketScanTxt: String
|
||||
|
||||
private var itemShelvingSaleSupplyAddCall = -1
|
||||
private var saleTrackingCall = -1
|
||||
|
||||
//private var myKM: KeyguardManager? = null
|
||||
private var positionUnmarked = -1
|
||||
|
||||
|
@ -540,9 +543,24 @@ class CollectionFragment(
|
|||
mpok?.start()
|
||||
onQuantityOfShelvingSelected(itemShelvingFkStored)
|
||||
} else {
|
||||
var value = customDialogList.getValueTwo()
|
||||
customDialogList.setValueTwo("")
|
||||
//showErrorMessage("El resultado del procedimiento barcodeToItem de la etiqueta escaneada es: " +it.response)
|
||||
|
||||
if (it.response.isEmpty()) {
|
||||
showErrorMessage("Código artículo no existe. Por favor remite foto del artículo al dpto informática para comprobar si el código buyFk ha sido borrado")
|
||||
viewModel.debug_add(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
"buy_deletedFromApp",
|
||||
value + "-" + sales[storedPosition].itemFk + "-" + getData(
|
||||
USERFK
|
||||
)
|
||||
)
|
||||
} else {
|
||||
showErrorMessage(getString(R.string.lineNotExist))
|
||||
}
|
||||
|
||||
|
||||
if (mperror != null) mperror?.start()
|
||||
}
|
||||
}
|
||||
|
@ -699,7 +717,6 @@ class CollectionFragment(
|
|||
})
|
||||
responseDel.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
|
||||
if (it.isError) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
|
@ -721,6 +738,9 @@ class CollectionFragment(
|
|||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
responseItemShelvingUpdate.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
@ -742,6 +762,51 @@ class CollectionFragment(
|
|||
goBack = false
|
||||
}
|
||||
})
|
||||
|
||||
responseSaleReplace.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
/* viewModel.saleTrackingDel(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
saleFk = sales[positionUnmarked].saleFk
|
||||
)*/
|
||||
|
||||
goBack = false
|
||||
}
|
||||
})
|
||||
responseItemShelvingSaleSupplyAdd.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
/* viewModel.saleTrackingDel(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
saleFk = sales[positionUnmarked].saleFk
|
||||
)*/
|
||||
|
||||
goBack = false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
responseSalixMessage.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
|
||||
|
@ -884,12 +949,12 @@ class CollectionFragment(
|
|||
//sales = salesList.sortedWith(compareBy({it.placements.get(0).placement}))
|
||||
// SalesSorter()
|
||||
|
||||
for (s in sales) {
|
||||
/* for (s in sales) {
|
||||
Log.d(
|
||||
"VERDNATURA::",
|
||||
"La sale es ${s.saleFk} El item es ${s.itemFk} y su picked ${s.picked} y saleorder ${s.saleOrder}"
|
||||
)
|
||||
}
|
||||
}*/
|
||||
|
||||
saleAdapter =
|
||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
||||
|
@ -1079,8 +1144,12 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
} else if (type == CONTROLADOR || type == PRECHECKER) {
|
||||
//////Log.i("VERDNATURA:","El tipo es controlador")
|
||||
|
||||
// checkSaleGroup()
|
||||
|
||||
for (saleVO in sales) {
|
||||
//0-Salegroup
|
||||
|
||||
if (saleVO.isControlled == "0") {
|
||||
//1- Por itemFk
|
||||
if (txtscan == saleVO.itemFk) {
|
||||
|
@ -1098,6 +1167,7 @@ class CollectionFragment(
|
|||
isBreak = true
|
||||
}
|
||||
}
|
||||
|
||||
if (isBreak) break
|
||||
}
|
||||
index += 1
|
||||
|
@ -1106,7 +1176,7 @@ class CollectionFragment(
|
|||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
|
||||
Log.d("VERDNATURA::", "VAMOS A PARKING DESDE PANTALLA CONTROLADOR")
|
||||
// Log.d("VERDNATURA::", "VAMOS A PARKING DESDE PANTALLA CONTROLADOR")
|
||||
|
||||
if (tickets.size > 0) {
|
||||
|
||||
|
@ -1119,7 +1189,7 @@ class CollectionFragment(
|
|||
collectionFk = tickets[0]
|
||||
)
|
||||
|
||||
Log.d("VERDNATURA::", "LA COLECTION ES ${tickets[0]}")
|
||||
// Log.d("VERDNATURA::", "LA COLECTION ES ${tickets[0]}")
|
||||
|
||||
/* viewModel.parking(
|
||||
getData(USER),
|
||||
|
@ -1163,6 +1233,16 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
|
||||
/*private fun checkSaleGroup(txtscan: String) {
|
||||
|
||||
for (i in sales.indices) {
|
||||
if (sales[i].saleGroupFk == txtscan) {
|
||||
markLine(i, type)
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
private fun findSale(txtscan: String, position: Int) {
|
||||
var isOk = false
|
||||
if (type == SACADOR) {
|
||||
|
@ -1423,10 +1503,9 @@ class CollectionFragment(
|
|||
binding.splashProgress.visibility =
|
||||
VISIBLE
|
||||
|
||||
/* var working_in_test = true // sergio: en proves app
|
||||
if (working_in_test) {*/
|
||||
|
||||
viewModel.getIdFromCodeSalix(
|
||||
token = getData(USER),
|
||||
token = getData(TOKEN),
|
||||
code = customDialogList.getValueTwo(),
|
||||
)
|
||||
/* } else {
|
||||
|
@ -1504,8 +1583,7 @@ class CollectionFragment(
|
|||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
/* var working_in_test = true //sergio: en proves app
|
||||
if (working_in_test) {*/
|
||||
|
||||
viewModel.getIdFromCodeSalix(
|
||||
getData(TOKEN),
|
||||
code = customDialogList.getValueTwo()
|
||||
|
@ -1919,9 +1997,11 @@ class CollectionFragment(
|
|||
|
||||
|
||||
if (type.equals("CHECKER") && (isMarking && (getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESI) && getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESINEW)
|
||||
) )
|
||||
R.string.sectorALGEMESI
|
||||
) && getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESINEW
|
||||
)
|
||||
))
|
||||
) {
|
||||
|
||||
|
||||
|
@ -2544,6 +2624,8 @@ class CollectionFragment(
|
|||
vUserFk = mistakeSale?.workerFk!!,
|
||||
vTypeFk = it.id
|
||||
)
|
||||
|
||||
|
||||
getString(R.string.errorRegistered).toast(requireContext())
|
||||
customDialogList.dismiss()
|
||||
}
|
||||
|
|
|
@ -48,6 +48,15 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
private val _responseItemShelvingSaleSupplyAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseItemShelvingSaleSupplyAdd: LiveData<ResponseItemVO>
|
||||
get() = _responseItemShelvingSaleSupplyAdd
|
||||
|
||||
private val _responseSaleReplace by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleReplace: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleReplace
|
||||
|
||||
|
||||
private val _responseParking by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseParking: LiveData<ResponseItemVO>
|
||||
get() = _responseParking
|
||||
|
@ -187,17 +196,17 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
vStateFk,
|
||||
vIsChecked,
|
||||
vBuyFk
|
||||
).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) {
|
||||
_responseSaleReplace.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.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
_responseSaleReplace.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
|
@ -205,7 +214,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
)
|
||||
} else {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.body()!!)
|
||||
_responseSaleReplace.value = ResponseItemVO(isError = false, response = "")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -275,7 +284,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
quantity
|
||||
).enqueue(object : Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
_responseItemShelvingSaleSupplyAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
|
@ -283,7 +292,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
_responseItemShelvingSaleSupplyAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
|
@ -291,7 +300,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
)
|
||||
} else {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
_responseItemShelvingSaleSupplyAdd.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -735,6 +744,37 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
})
|
||||
}
|
||||
|
||||
fun debug_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
buyFk: String,
|
||||
message: String
|
||||
) {
|
||||
getSacadorControladorUserCase.debug_add(usuario, password, buyFk, message)
|
||||
.enqueue(object : Callback<Unit> {
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Unit>, response: Response<Unit>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = "")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun getIdFromCode(usuario: String, password: String, code: String) {
|
||||
|
@ -786,7 +826,7 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
} else {
|
||||
_responseCode.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
ResponseItemVO(isError = false, response = if (response.body()==null) "" else {response.body()!!})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -34,6 +34,7 @@ class InventaryFragment :
|
|||
private var listInvetoryAux: ArrayList<ItemInventaryVO> = ArrayList()
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
|
||||
// private var reload = false
|
||||
// private var hideLoad = true
|
||||
private var layoutManager: LinearLayoutManager? = null
|
||||
|
@ -165,7 +166,10 @@ class InventaryFragment :
|
|||
it.itemFk.contains(
|
||||
binding.filterItemFk.text.toString(),
|
||||
true
|
||||
) || it.producer.contains(binding.filterItemFk.text.toString(), true)
|
||||
) || it.producer.contains(
|
||||
binding.filterItemFk.text.toString(),
|
||||
true
|
||||
) || it.longName.contains(binding.filterItemFk.text.toString(),ignoreCase = true)
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -66,6 +66,14 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
"base_url",
|
||||
binding.edittextServer.text.toString()
|
||||
)
|
||||
val working_in_test = false
|
||||
if (working_in_test) {
|
||||
saveData(
|
||||
"base_urlSalix",
|
||||
"http://localhost:3000/api/"
|
||||
|
||||
)
|
||||
} else {
|
||||
if (binding.edittextServer.text!!.contains("test-app.verdnatura.es")) {
|
||||
saveData(
|
||||
"base_urlSalix",
|
||||
|
@ -85,7 +93,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
"${getString(R.string.serverSalix)}${getData("base_urlSalix")})".toast(
|
||||
requireContext()
|
||||
|
@ -209,6 +217,13 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
binding.edittextUsername.text.toString(),
|
||||
binding.edittextPassword.text.toString()
|
||||
)
|
||||
|
||||
|
||||
/* viewModel.operator_getNumberOfWagons(
|
||||
binding.edittextUsername.text.toString(),
|
||||
binding.edittextPassword.text.toString()
|
||||
)*/
|
||||
|
||||
viewModel.worker_getPrinter(
|
||||
binding.edittextUsername.text.toString(),
|
||||
binding.edittextPassword.text.toString()
|
||||
|
@ -274,7 +289,37 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
|
||||
|
||||
}
|
||||
operatorAdd.observe(viewLifecycleOwner) {
|
||||
|
||||
if (it.isError) {
|
||||
customDialog.setTitle(getString(R.string.info))
|
||||
.setDescription(it.errorMessage)
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
viewModel.operator_getNumberOfWagons(getData(USER),getData(PASSWORD))
|
||||
|
||||
viewModel.device_checkLogin(
|
||||
binding.edittextUsername.text.toString(),
|
||||
binding.edittextPassword.text.toString(),
|
||||
getData(ANDROID_ID)
|
||||
)
|
||||
}
|
||||
|
||||
operatorGetNumberOfWagons.observe(viewLifecycleOwner) {
|
||||
|
||||
if (!it.isError) {
|
||||
saveDataInt(NUMBEROFWAGONS, it.response!!)
|
||||
} else {
|
||||
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
devicelogresponse.observe(viewLifecycleOwner) {
|
||||
|
||||
|
@ -336,7 +381,13 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
saveTokenPref("")
|
||||
customDialog.setTitle(getString(R.string.error))
|
||||
|
||||
.setDescription(if (it.errorMessage.contains("Unauthorized")){getString(R.string.messageUserError)}else{it.errorMessage})
|
||||
.setDescription(
|
||||
if (it.errorMessage.contains("Unauthorized")) {
|
||||
getString(R.string.messageUserError)
|
||||
} else {
|
||||
it.errorMessage
|
||||
}
|
||||
)
|
||||
.setOkButton(
|
||||
getString(R.string.accept)
|
||||
) {
|
||||
|
@ -345,11 +396,15 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
}.show()
|
||||
} else {
|
||||
saveTokenPref(it.token)
|
||||
viewModel.device_checkLogin(
|
||||
|
||||
//Tarea 4351 quitar el if y poner e device_checkLogin a continuación del response de operator_add
|
||||
viewModel.operator_add(getData(USER),getData(PASSWORD))
|
||||
|
||||
/* viewModel.device_checkLogin(
|
||||
binding.edittextUsername.text.toString(),
|
||||
binding.edittextPassword.text.toString(),
|
||||
getData(ANDROID_ID)
|
||||
)
|
||||
)*/
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,23 @@
|
|||
package es.verdnatura.presentation.view.feature.login.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonObject
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import es.verdnatura.domain.GetAjustesUserCase
|
||||
import es.verdnatura.domain.GetLoginUserCase
|
||||
import es.verdnatura.domain.NodeJsService
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.ResponseItemNumber
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.WorkerPrintersList
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginDevice
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.versionApp
|
||||
|
@ -29,11 +26,8 @@ import es.verdnatura.presentation.view.feature.paletizador.model.itemsExpedition
|
|||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
import timber.log.Timber
|
||||
import timber.log.Timber.d
|
||||
|
||||
class LoginViewModel(context: Context) : BaseViewModel()
|
||||
{
|
||||
class LoginViewModel(context: Context) : BaseViewModel() {
|
||||
|
||||
private val getLoginUserCase: GetLoginUserCase = GetLoginUserCase(context)
|
||||
|
||||
|
@ -46,6 +40,10 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
val devicelogresponse: LiveData<ResponseItemVO>
|
||||
get() = _devicelogresponse
|
||||
|
||||
private val _operatorAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val operatorAdd: LiveData<ResponseItemVO>
|
||||
get() = _operatorAdd
|
||||
|
||||
private val _versionappitem by lazy { MutableLiveData<versionApp>() }
|
||||
val versionappitem: LiveData<versionApp>
|
||||
get() = _versionappitem
|
||||
|
@ -71,21 +69,21 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
val workergetPrinter: LiveData<Printers>
|
||||
get() = _workergetPrinter
|
||||
|
||||
private val _operatorGetNumberOfWagons by lazy { MutableLiveData<ResponseItemNumber>() }
|
||||
val operatorGetNumberOfWagons: LiveData<ResponseItemNumber>
|
||||
get() = _operatorGetNumberOfWagons
|
||||
|
||||
|
||||
private val _workerPrintList by lazy { MutableLiveData<WorkerPrintersList>() }
|
||||
|
||||
val loadWorkerPrintList = Transformations.map(_workerPrintList) { Event(it) }
|
||||
|
||||
fun loginSalix(user: String, password: String)
|
||||
{
|
||||
getLoginUserCase.salixLogin(user, password).enqueue(object : Callback<LoginSalixVO>
|
||||
{
|
||||
override fun onResponse(call: Call<LoginSalixVO>, response: Response<LoginSalixVO>)
|
||||
{
|
||||
fun loginSalix(user: String, password: String) {
|
||||
getLoginUserCase.salixLogin(user, password).enqueue(object : Callback<LoginSalixVO> {
|
||||
override fun onResponse(call: Call<LoginSalixVO>, response: Response<LoginSalixVO>) {
|
||||
|
||||
val loginSalixVO: LoginSalixVO?
|
||||
if (response.body() != null)
|
||||
{
|
||||
if (response.body() != null) {
|
||||
|
||||
loginSalixVO = response.body()?.token?.let {
|
||||
LoginSalixVO(
|
||||
|
@ -96,15 +94,16 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
errorMessage = ""
|
||||
)
|
||||
}
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
|
||||
loginSalixVO = LoginSalixVO(
|
||||
user,
|
||||
password,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()
|
||||
))
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
@ -112,44 +111,41 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
_loginsalixitem.value = loginSalixVO
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<LoginSalixVO>, t: Throwable)
|
||||
{
|
||||
override fun onFailure(call: Call<LoginSalixVO>, t: Throwable) {
|
||||
val loginSalixVO =
|
||||
LoginSalixVO(
|
||||
user,
|
||||
password,
|
||||
"",
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
_loginsalixitem.value = loginSalixVO
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun device_checkLogin(user: String, password: String, android_id: String)
|
||||
{
|
||||
fun device_checkLogin(user: String, password: String, android_id: String) {
|
||||
|
||||
getLoginUserCase.device_checkLogin(user, password, android_id)
|
||||
.enqueue(object : Callback<LoginDevice>
|
||||
{
|
||||
override fun onResponse(call: Call<LoginDevice>, response: Response<LoginDevice>)
|
||||
{
|
||||
.enqueue(object : Callback<LoginDevice> {
|
||||
override fun onResponse(call: Call<LoginDevice>, response: Response<LoginDevice>) {
|
||||
|
||||
val loginDevice: LoginDevice?
|
||||
|
||||
|
||||
if (!response.isSuccessful)
|
||||
{
|
||||
if (!response.isSuccessful) {
|
||||
loginDevice = LoginDevice(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
} else
|
||||
{
|
||||
if (response.body() != null)
|
||||
{
|
||||
} else {
|
||||
if (response.body() != null) {
|
||||
|
||||
loginDevice = response.body()?.let {
|
||||
|
||||
|
@ -161,26 +157,30 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
|
||||
}
|
||||
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
loginDevice = LoginDevice(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
_logindevice.value = loginDevice
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<LoginDevice>, t: Throwable)
|
||||
{
|
||||
override fun onFailure(call: Call<LoginDevice>, t: Throwable) {
|
||||
|
||||
val loginDevice =
|
||||
LoginDevice(
|
||||
"",
|
||||
"",
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
_logindevice.value = loginDevice
|
||||
}
|
||||
|
@ -188,20 +188,15 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
}
|
||||
|
||||
|
||||
|
||||
fun worker_getId(user: String, password: String)
|
||||
{
|
||||
fun worker_getId(user: String, password: String) {
|
||||
getLoginUserCase.worker_getId(user, password)
|
||||
.enqueue(object : Callback<String>
|
||||
{
|
||||
override fun onResponse(call: Call<String>, response: Response<String>)
|
||||
{
|
||||
.enqueue(object : Callback<String> {
|
||||
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||
|
||||
val workerId: workerId?
|
||||
|
||||
|
||||
if (response.body() != null)
|
||||
{
|
||||
if (response.body() != null) {
|
||||
|
||||
workerId = workerId(
|
||||
response.body().toString(),
|
||||
|
@ -209,23 +204,27 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
errorMessage = ""
|
||||
)
|
||||
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
workerId = workerId(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
_workerId.value = workerId
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<String>, t: Throwable)
|
||||
{
|
||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||
val workerId =
|
||||
workerId(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
_workerId.value = workerId
|
||||
}
|
||||
|
@ -234,55 +233,44 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
}
|
||||
|
||||
|
||||
|
||||
fun deviceLog_add(
|
||||
user: String, password: String, app: String, versionApp: String, android_id: String
|
||||
)
|
||||
{
|
||||
) {
|
||||
getLoginUserCase.deviceLog_add(user, password, app, versionApp, android_id)
|
||||
.enqueue(object : Callback<Void>
|
||||
{
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>)
|
||||
{
|
||||
.enqueue(object : Callback<Void> {
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>) {
|
||||
|
||||
if (!response.isSuccessful)
|
||||
{
|
||||
if (!response.isSuccessful) {
|
||||
|
||||
messageError(nameofFunction(this),response.message())
|
||||
messageError(nameofFunction(this), response.message())
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<Void>, t: Throwable)
|
||||
{
|
||||
override fun onFailure(call: Call<Void>, t: Throwable) {
|
||||
|
||||
messageError(nameofFunction(this),t.message!!)
|
||||
messageError(nameofFunction(this), t.message!!)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun messageError(callFunction:String,message: String)
|
||||
{
|
||||
fun messageError(callFunction: String, message: String) {
|
||||
_devicelogresponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(callFunction,message)
|
||||
errorMessage = getMessageFromAllResponse(callFunction, message)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
fun checkVersion(user: String, password: String, nameApp: String)
|
||||
{
|
||||
fun checkVersion(user: String, password: String, nameApp: String) {
|
||||
getLoginUserCase.checkVersion(user, password, nameApp)
|
||||
.enqueue(object : Callback<versionApp>
|
||||
{
|
||||
override fun onResponse(call: Call<versionApp>, response: Response<versionApp>)
|
||||
{
|
||||
.enqueue(object : Callback<versionApp> {
|
||||
override fun onResponse(call: Call<versionApp>, response: Response<versionApp>) {
|
||||
|
||||
//var versionApp: versionApp?
|
||||
|
||||
if (response.body() != null)
|
||||
{
|
||||
if (response.body() != null) {
|
||||
|
||||
_versionappitem.value = response.body()?.let {
|
||||
|
||||
|
@ -297,13 +285,15 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
|
||||
}
|
||||
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
_versionappitem.value = versionApp(
|
||||
user,
|
||||
password,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -311,14 +301,16 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<versionApp>, t: Throwable)
|
||||
{
|
||||
override fun onFailure(call: Call<versionApp>, t: Throwable) {
|
||||
_versionappitem.value =
|
||||
versionApp(
|
||||
nameApp,
|
||||
"",
|
||||
isError = true,
|
||||
errorMessage =getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
//_versionappitem.value = versionApp
|
||||
}
|
||||
|
@ -380,16 +372,14 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
})
|
||||
}*/
|
||||
|
||||
fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics>
|
||||
{
|
||||
fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics> {
|
||||
val gson = Gson()
|
||||
var list = mutableListOf<itemsExpeditionDynamics>()
|
||||
|
||||
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||
|
||||
var expeditionState: Map<String, Any> =
|
||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>()
|
||||
{}.type)
|
||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||
expeditionState.forEach {
|
||||
|
||||
list.add(itemsExpeditionDynamics(key = it.key, value = it.value.toString()))
|
||||
|
@ -397,12 +387,19 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
}
|
||||
return list
|
||||
}
|
||||
fun worker_getSector(user:String,password:String){
|
||||
|
||||
getLoginUserCase.worker_getSector(user,password).enqueue(object : Callback<SectorItemVO>{
|
||||
fun worker_getSector(user: String, password: String) {
|
||||
|
||||
getLoginUserCase.worker_getSector(user, password).enqueue(object : Callback<SectorItemVO> {
|
||||
override fun onFailure(call: Call<SectorItemVO>, t: Throwable) {
|
||||
|
||||
_workergetSector.value = SectorItemVO(0,"",0,isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||
_workergetSector.value = SectorItemVO(
|
||||
0,
|
||||
"",
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
|
@ -410,14 +407,25 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
response: Response<SectorItemVO>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful){
|
||||
_workergetSector.value= SectorItemVO(0,"",0,
|
||||
if (!response.isSuccessful) {
|
||||
_workergetSector.value = SectorItemVO(
|
||||
0, "", 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
}else{
|
||||
)
|
||||
} else {
|
||||
|
||||
_workergetSector.value = response.body()?.let { SectorItemVO(it.id,it.description,it.warehouseFk,isError = false) }
|
||||
_workergetSector.value = response.body()?.let {
|
||||
SectorItemVO(
|
||||
it.id,
|
||||
it.description,
|
||||
it.warehouseFk,
|
||||
isError = false
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -427,12 +435,96 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
})
|
||||
}
|
||||
|
||||
fun worker_getPrinter(user:String,password:String){
|
||||
fun operator_getNumberOfWagons(user: String, password: String) {
|
||||
|
||||
getLoginUserCase.worker_getPrinter(user,password).enqueue(object : Callback<List<Printers>>{
|
||||
getLoginUserCase.operator_getNumberOfWagons(user, password)
|
||||
.enqueue(object : Callback<Int?> {
|
||||
override fun onFailure(call: Call<Int?>, t: Throwable) {
|
||||
|
||||
_operatorGetNumberOfWagons.value = ResponseItemNumber(
|
||||
null,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<Int?>,
|
||||
response: Response<Int?>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
_operatorGetNumberOfWagons.value = ResponseItemNumber(
|
||||
null, true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
|
||||
if (response.body() != null)
|
||||
_operatorGetNumberOfWagons.value =
|
||||
ResponseItemNumber(response.body(), isError = false)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun operator_add(user: String, password: String) {
|
||||
|
||||
getLoginUserCase.operator_add(user, password).enqueue(object : Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_operatorAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<Any>,
|
||||
response: Response<Any>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
_operatorAdd.value = ResponseItemVO(
|
||||
"", true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
_operatorAdd.value = ResponseItemVO("", false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun worker_getPrinter(user: String, password: String) {
|
||||
|
||||
getLoginUserCase.worker_getPrinter(user, password)
|
||||
.enqueue(object : Callback<List<Printers>> {
|
||||
override fun onFailure(call: Call<List<Printers>>, t: Throwable) {
|
||||
val listError:ArrayList<Printers> = ArrayList()
|
||||
listError.add(Printers(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)))
|
||||
val listError: ArrayList<Printers> = ArrayList()
|
||||
listError.add(
|
||||
Printers(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_workerPrintList.value = WorkerPrintersList(listError)
|
||||
|
||||
}
|
||||
|
@ -441,13 +533,22 @@ class LoginViewModel(context: Context) : BaseViewModel()
|
|||
call: Call<List<Printers>>,
|
||||
response: Response<List<Printers>>
|
||||
) {
|
||||
if (response.body() != null){
|
||||
_workerPrintList.value = response.body()?.let { WorkerPrintersList(it)
|
||||
if (response.body() != null) {
|
||||
_workerPrintList.value = response.body()?.let {
|
||||
WorkerPrintersList(it)
|
||||
}
|
||||
|
||||
}else{
|
||||
val listError:ArrayList<Printers> = ArrayList()
|
||||
listError.add(Printers(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())))
|
||||
} else {
|
||||
val listError: ArrayList<Printers> = ArrayList()
|
||||
listError.add(
|
||||
Printers(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_workerPrintList.value = WorkerPrintersList(listError)
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import es.verdnatura.domain.ConstAndValues.PREITEMPICKER
|
|||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseActivity
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.testing.testPrint
|
||||
import es.verdnatura.presentation.view.component.CustomDialogMainActivity
|
||||
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesFragment
|
||||
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardFragment
|
||||
|
@ -508,6 +509,19 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
getString(R.string.titleCMRState) -> {
|
||||
addFragmentOnTop(CmrExpeditionPalletFragment.newInstance(item.title))
|
||||
}
|
||||
|
||||
getString(R.string.scanPlatform) -> {
|
||||
addFragmentOnTop(PalletScanFragment.newInstance(item.title, "receive"))
|
||||
}
|
||||
|
||||
|
||||
getString(R.string.titleScanPalletizar) -> {
|
||||
addFragmentOnTop(PalletScanFragment.newInstance(item.title, "get"))
|
||||
}
|
||||
|
||||
getString(R.string.testing) -> {
|
||||
addFragmentOnTop(testPrint.newInstance(item.title))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -523,6 +537,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
override fun onBackPressed() {
|
||||
|
||||
var index = supportFragmentManager.backStackEntryCount - 1
|
||||
var backEntry =""
|
||||
if (index >= 0) {
|
||||
backEntry = supportFragmentManager.getBackStackEntryAt(index).name.toString()
|
||||
//Log.d("VERDNATURA::", "El fragment es " + backEntry)
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
fm.executePendingTransactions()
|
||||
} catch (e: Exception) {
|
||||
|
@ -532,6 +555,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
fm.popBackStackImmediate()
|
||||
|
||||
if (!backEntry.isNullOrBlank())
|
||||
if (backEntry!!.contains("fragment.ExpeditionPalletDetailFragment.Companion")) {
|
||||
addFragmentOnTop(ExpeditionTruckListFragment.newInstance())
|
||||
}
|
||||
} else {
|
||||
customDialog.setTitle(getString(R.string.closeSession))
|
||||
.setDescription(getString(R.string.sureCloseSession))
|
||||
|
@ -547,11 +574,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
override fun onTruckClickListener(item: ItemExpeditionTruckVO, entryPoint: String) {
|
||||
//Log.d("VERDNATURA","Pulsdo item"+item.truckFk)
|
||||
addFragmentOnTop(ExpeditionPalletFragment.newInstance(item))
|
||||
|
||||
}
|
||||
|
||||
override fun onPalletClickListener(itemTruck: ItemExpeditionTruckVO, itemPallet: ItemPalletVO) {
|
||||
override fun onPalletClickListener(
|
||||
itemTruck: ItemExpeditionTruckVO,
|
||||
itemPallet: ItemPalletVO
|
||||
) {
|
||||
//Tarea #4125
|
||||
//Log.d("VERDNATURA::","Entrando en pallet2")
|
||||
addFragmentOnTop(ExpeditionScanFragment.newInstance(itemTruck, itemPallet))
|
||||
|
@ -568,6 +599,20 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
}
|
||||
|
||||
fun onComprobarPalletFromPalletScan(
|
||||
itemTruck: ItemExpeditionTruckVO,
|
||||
itemPallet: ItemPalletVO
|
||||
) {
|
||||
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
|
||||
addFragment(
|
||||
ExpeditionPalletDetailFragment.newInstance(itemTruck, itemPallet),
|
||||
R.id.main_frame_layout,
|
||||
ExpeditionPalletDetailFragment.TAG,
|
||||
true
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
/* fun onParkingSaleSelected(sales: SaleVO) {
|
||||
addFragmentOnTop(ParkingSaleFragment.newInstance(SaleVO = sales))
|
||||
|
@ -640,9 +685,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
}
|
||||
|
||||
fun openFragmentReubications(list: MutableList<Reubication>, shelving:String) {
|
||||
fun openFragmentReubications(list: MutableList<Reubication>, shelving: String) {
|
||||
|
||||
addFragmentOnTop(ReubicationCollectionFragment.newInstance(list,shelving))
|
||||
addFragmentOnTop(ReubicationCollectionFragment.newInstance(list, shelving))
|
||||
|
||||
}
|
||||
|
||||
|
@ -681,4 +726,4 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,11 +51,17 @@ class ExpeditionPalletDetailFragment(
|
|||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
binding.expeditionPalletDetailPallet.text = getString(R.string.pallet) + itemPallet!!.Pallet
|
||||
binding.expeditionPalletDetailPallet.text =
|
||||
getString(R.string.pallet) + " " + itemPallet!!.Pallet
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
|
||||
getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrEmpty()) {
|
||||
|
||||
itemExpeditionTruckVO!!.description
|
||||
}else{
|
||||
itemExpeditionTruckVO!!.Destino
|
||||
}
|
||||
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
@ -73,10 +79,7 @@ class ExpeditionPalletDetailFragment(
|
|||
|
||||
binding.buttonOk.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
// sergio: en caso de que hay problemas habrá que cambiar aquí la llamada
|
||||
// MainActivity.addFragmentOnTop(ExpeditionPalletDetailFragment.newInstance(itemTruck,itemPallet))
|
||||
// que llame diractamente al fragment para que no se repita la ultima accion
|
||||
////Log.i("VERDNATURA:", "pulsamos boton OK en detail fragment")
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -109,11 +112,22 @@ class ExpeditionPalletDetailFragment(
|
|||
itemPallet!!
|
||||
)
|
||||
} else if (item == iconBorrar) {
|
||||
|
||||
customDialog.setTitle(getString(R.string.info))
|
||||
customDialog.setDescription(getString(R.string.messageConfirm))
|
||||
customDialog.setOkButton(getString(R.string.delete)) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPalletDel(
|
||||
getData(USER),
|
||||
getData(PASSWORD), itemPallet!!.Pallet
|
||||
)
|
||||
customDialog.dismiss()
|
||||
}
|
||||
customDialog.setKoButton(getString(R.string.cancel)) {
|
||||
customDialog.dismiss()
|
||||
}
|
||||
customDialog.show()
|
||||
|
||||
} else if (item == iconPrint) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
|
|
|
@ -30,21 +30,21 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
|||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanList
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class ExpeditionPalletFragment(
|
||||
var itemExpeditionTruckVO: ItemExpeditionTruckVO? = null
|
||||
) : BaseFragment<FragmentExpeditionPalletBinding, ExpeditionPalletViewModel>(
|
||||
ExpeditionPalletViewModel::class) {
|
||||
ExpeditionPalletViewModel::class
|
||||
) {
|
||||
|
||||
|
||||
private var adapter : ExpeditionPalletAdapter? = null
|
||||
private var adapter: ExpeditionPalletAdapter? = null
|
||||
private var onPalletClickListener: OnPalletClickListener? = null
|
||||
private var onComprobarPalletViewClickListener:OnComprobarPalletViewClickListener? = null
|
||||
private var onComprobarPalletViewClickListener: OnComprobarPalletViewClickListener? = null
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private var listExpeditions:ArrayList<BarcodeVO> = ArrayList()
|
||||
private var expeditionAdapter : BarcodeAdapter? = null
|
||||
private var listExpeditions: ArrayList<BarcodeVO> = ArrayList()
|
||||
private var expeditionAdapter: BarcodeAdapter? = null
|
||||
private lateinit var customDialog: CustomDialog
|
||||
var mperror: MediaPlayer? = null
|
||||
var mpok: MediaPlayer? = null
|
||||
|
@ -57,15 +57,16 @@ class ExpeditionPalletFragment(
|
|||
|
||||
override fun onAttach(context: Context) {
|
||||
if (context is OnPalletClickListener) onPalletClickListener = context
|
||||
if (context is OnComprobarPalletViewClickListener) onComprobarPalletViewClickListener = context
|
||||
if (context is OnComprobarPalletViewClickListener) onComprobarPalletViewClickListener =
|
||||
context
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_expedition_pallet
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
@ -74,43 +75,57 @@ class ExpeditionPalletFragment(
|
|||
customDialogList = CustomDialogList(requireContext())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
||||
itemExpeditionTruckVO!!.description
|
||||
|
||||
}else{
|
||||
itemExpeditionTruckVO!!.Destino
|
||||
}
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk)
|
||||
viewModel.expeditionPallet_List(
|
||||
getData(USER),
|
||||
getData(PASSWORD), itemExpeditionTruckVO!!.truckFk
|
||||
)
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
private fun setEvents() {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun setToolBar(){
|
||||
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||
val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
|
||||
private fun setToolBar() {
|
||||
val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
val iconReload: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_autorenew_black_24dp, resources.newTheme())
|
||||
val iconPlus: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_add_black_24dp, resources.newTheme())
|
||||
listIcons.add(iconReload)
|
||||
listIcons.add(iconPlus)
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
if (item == iconReload) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk)
|
||||
}else if(item == iconPlus){
|
||||
viewModel.expeditionPallet_List(
|
||||
getData(USER),
|
||||
getData(PASSWORD), itemExpeditionTruckVO!!.truckFk
|
||||
)
|
||||
} else if (item == iconPlus) {
|
||||
expeditionScanAdd()
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun getCURDATE(date:String):String{
|
||||
private fun getCURDATE(date: String): String {
|
||||
val c = Calendar.getInstance()
|
||||
val df = SimpleDateFormat(getString(R.string.dateCompleteFormat))
|
||||
val df2 = SimpleDateFormat(getString(R.string.timeFormat))
|
||||
|
@ -119,42 +134,41 @@ class ExpeditionPalletFragment(
|
|||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
with(viewModel) {
|
||||
loadExpeditionPalletList.observe(viewLifecycleOwner, Observer { event ->
|
||||
event.getContentIfNotHandled().notNull {printExpeditionList(it) }
|
||||
event.getContentIfNotHandled().notNull { printExpeditionList(it) }
|
||||
})
|
||||
|
||||
loadScanList.observe(viewLifecycleOwner, Observer { event ->
|
||||
event.getContentIfNotHandled().notNull {showScanExpeditions(it) }
|
||||
event.getContentIfNotHandled().notNull { showScanExpeditions(it) }
|
||||
})
|
||||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
ma.messageWithSound(it.errorMessage,true,false)
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
ma.messageWithSound(it.errorMessage,true,false)
|
||||
/* customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage).setOkButton(getString(R.string.close)){
|
||||
customDialog.dismiss()
|
||||
}.show()*/
|
||||
}else{
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
|
||||
if (it.response=="0") {
|
||||
} else {
|
||||
|
||||
if (it.response == "0") {
|
||||
|
||||
//"Rutas iguales ${it.response}".toast(requireActivity())
|
||||
////Log.i("VERDNATURA:","Rutas iguales")
|
||||
}
|
||||
if (it.response=="1"){
|
||||
if (it.response == "1") {
|
||||
mperror?.start()
|
||||
// "Resultado llamada $it.response".toast(requireActivity())
|
||||
////Log.i("VERDNATURA:","Rutas distintas")
|
||||
|
||||
}}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -162,42 +176,57 @@ class ExpeditionPalletFragment(
|
|||
|
||||
}
|
||||
|
||||
private fun printExpeditionList(it: ItemPalletListVO){
|
||||
private fun printExpeditionList(it: ItemPalletListVO) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
adapter = ExpeditionPalletAdapter(it.list,onPalletClickListener!!,onComprobarPalletViewClickListener!!,itemExpeditionTruckVO!!)
|
||||
adapter = ExpeditionPalletAdapter(
|
||||
it.list,
|
||||
onPalletClickListener!!,
|
||||
onComprobarPalletViewClickListener!!,
|
||||
itemExpeditionTruckVO!!
|
||||
)
|
||||
binding.expeditionPalletRecyclerview.adapter = adapter
|
||||
binding.expeditionPalletRecyclerview.layoutManager = lm
|
||||
|
||||
}
|
||||
|
||||
private fun expeditionScanAdd(){
|
||||
private fun expeditionScanAdd() {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanAdd(getData(USER),
|
||||
getData(PASSWORD),vPalletFk = "0",vTruckFk = itemExpeditionTruckVO!!.truckFk)
|
||||
viewModel.expeditionScanAdd(
|
||||
getData(USER),
|
||||
getData(PASSWORD), vPalletFk = "0", vTruckFk = itemExpeditionTruckVO!!.truckFk
|
||||
)
|
||||
}
|
||||
|
||||
private fun showScanExpeditions(it:ItemScanList){
|
||||
private fun showScanExpeditions(it: ItemScanList) {
|
||||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
|
||||
listExpeditions = ArrayList()
|
||||
|
||||
it.list.forEach {
|
||||
if(it.expeditionFk != "0")
|
||||
if (it.expeditionFk != "0")
|
||||
listExpeditions.add(BarcodeVO(code = it.expeditionFk))
|
||||
}
|
||||
|
||||
customDialogList.setTitle(getString(R.string.expeditionP)+binding.mainToolbar.toolbarTitle.text+")").setOkButton(getString(
|
||||
R.string.test)){
|
||||
customDialogList.setTitle(getString(R.string.expeditionP) + binding.mainToolbar.toolbarTitle.text + ")")
|
||||
.setOkButton(
|
||||
getString(
|
||||
R.string.test
|
||||
)
|
||||
) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
|
||||
|
||||
if (listExpeditions.size > 0){
|
||||
onComprobarPalletViewClickListener!!.onComprobarPalletViewClickListener(itemExpeditionTruckVO!!,
|
||||
ItemPalletVO(Pallet = it.list.get(0).palletFk))
|
||||
}else{
|
||||
customDialog.setTitle(getString(R.string.info)).setDescription(getString(R.string.expeditionsError)).setOkButton(getString(R.string.accept)){
|
||||
if (listExpeditions.size > 0) {
|
||||
onComprobarPalletViewClickListener!!.onComprobarPalletViewClickListener(
|
||||
itemExpeditionTruckVO!!,
|
||||
ItemPalletVO(Pallet = it.list.get(0).palletFk)
|
||||
)
|
||||
} else {
|
||||
customDialog.setTitle(getString(R.string.info))
|
||||
.setDescription(getString(R.string.expeditionsError))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
@ -205,11 +234,13 @@ class ExpeditionPalletFragment(
|
|||
customDialogList.dismiss()
|
||||
|
||||
|
||||
}.setKoButton(getString(R.string.close)){
|
||||
}.setKoButton(getString(R.string.close)) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk)
|
||||
viewModel.expeditionPallet_List(
|
||||
getData(USER),
|
||||
getData(PASSWORD), itemExpeditionTruckVO!!.truckFk
|
||||
)
|
||||
listExpeditions = ArrayList()
|
||||
customDialogList.dismiss()
|
||||
}.setValue("").show()
|
||||
|
@ -219,21 +250,29 @@ class ExpeditionPalletFragment(
|
|||
|
||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!customDialogList.getValue().isNullOrEmpty()){
|
||||
try{
|
||||
if (!customDialogList.getValue().isNullOrEmpty()) {
|
||||
try {
|
||||
// val numExpedition = customDialogList.getValue().toDouble()
|
||||
if(customDialogList.getValue().length >= 7){
|
||||
listExpeditions.add(0,BarcodeVO(code = customDialogList.getValue()))
|
||||
customDialogList.setDescription(getString(R.string.total)+listExpeditions.size)
|
||||
viewModel.expeditionScanPut(getData(USER),
|
||||
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue())
|
||||
if (customDialogList.getValue().length >= 7) {
|
||||
listExpeditions.add(0, BarcodeVO(code = customDialogList.getValue()))
|
||||
customDialogList.setDescription(getString(R.string.total) + listExpeditions.size)
|
||||
viewModel.expeditionScanPut(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
it.list.get(0).palletFk,
|
||||
customDialogList.getValue()
|
||||
)
|
||||
////Log.i("VERDNATURA:"," palletizando ${it.list.get(0).palletFk} expedi: ${customDialogList.getValue()}")
|
||||
viewModel.checkRouteExpeditionScanPut(getData(USER),
|
||||
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue())
|
||||
}else{
|
||||
viewModel.checkRouteExpeditionScanPut(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
it.list.get(0).palletFk,
|
||||
customDialogList.getValue()
|
||||
)
|
||||
} else {
|
||||
if (mperror != null) mperror!!.start()
|
||||
}
|
||||
}catch (e:Exception){
|
||||
} catch (e: Exception) {
|
||||
if (mperror != null) mperror!!.start()
|
||||
}
|
||||
|
||||
|
@ -247,14 +286,15 @@ class ExpeditionPalletFragment(
|
|||
false
|
||||
}
|
||||
|
||||
expeditionAdapter = BarcodeAdapter(listExpeditions,object: OnBarcodeRowClickListener {
|
||||
expeditionAdapter = BarcodeAdapter(listExpeditions, object : OnBarcodeRowClickListener {
|
||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||
|
||||
}
|
||||
},showDelete = false)
|
||||
}, showDelete = false)
|
||||
customDialogList.getRecyclerView().adapter = expeditionAdapter
|
||||
|
||||
customDialogList.getRecyclerView().layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
customDialogList.getRecyclerView().layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -67,10 +67,15 @@ class ExpeditionScanFragment (
|
|||
customDialog = CustomDialog(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
|
||||
binding.expeditionScanDetailPallet.text = getString(R.string.pallet) + itemPalletVO!!.Pallet
|
||||
binding.expeditionScanDetailPallet.text = getString(R.string.pallet) + " " + itemPalletVO!!.Pallet
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
|
||||
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
||||
itemExpeditionTruckVO!!.description
|
||||
}else{
|
||||
|
||||
itemExpeditionTruckVO!!.Destino
|
||||
}
|
||||
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
@ -198,7 +203,7 @@ class ExpeditionScanFragment (
|
|||
if(it.expeditionFk != "0")
|
||||
listExpeditions.add(BarcodeVO(code = it.expeditionFk))
|
||||
}
|
||||
customDialogList.setTitle(getString(R.string.pallet) + itemPalletVO!!.Pallet+" ("+binding.mainToolbar.toolbarTitle.text+")").setOkButton(getString(R.string.test)){
|
||||
customDialogList.setTitle(getString(R.string.pallet) +" "+ itemPalletVO!!.Pallet+" \n("+binding.mainToolbar.toolbarTitle.text+")").setOkButton(getString(R.string.test)){
|
||||
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
|
||||
|
|
|
@ -108,6 +108,12 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
private fun printExpeditionList(it: ItemExpeditionTruckList){
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
// Tarea#4125 Refactor Destino por description
|
||||
for (itemExp in it.list){
|
||||
if (itemExp.description.isNullOrEmpty()){
|
||||
itemExp.description=itemExp.Destino
|
||||
}
|
||||
}
|
||||
adapter = ExpeditionListAdapter(it.list,onTruckClickListener!!)
|
||||
binding.expeditionTruckRecyclerview.adapter = adapter
|
||||
binding.expeditionTruckRecyclerview.layoutManager = lm
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.core.view.isVisible
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
|
||||
class PalletScanFragment(
|
||||
var title: String = "", var action: String
|
||||
) : BaseFragment<FragmentGeneralBlackBinding, PalletScanViewModel>(
|
||||
PalletScanViewModel::class
|
||||
) {
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_general_black
|
||||
private lateinit var customDialogList: CustomDialogInput
|
||||
private var itemScaned: String = ""
|
||||
private var isShowed = false
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(title: String, action: String) = PalletScanFragment(title, action)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
|
||||
customDialogList = CustomDialogInput(requireContext())
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
setEvents()
|
||||
setToolBar()
|
||||
showPalletScan()
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setToolBar() {
|
||||
binding.mainToolbar.toolbarTitle.text = title
|
||||
}
|
||||
|
||||
private fun expeditionState_addByPallet(vPalletId: String) {
|
||||
|
||||
customDialogList.dismiss()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
viewModel.expeditionState_addByPallet(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
vPalletId,
|
||||
"STORED"
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
private fun expeditionPallet_get(vPalletId: String) {
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
customDialogList.dismiss()
|
||||
|
||||
viewModel.expeditionPallet_get(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
vPalletId,
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
|
||||
}
|
||||
customDialogList.setOnDismissListener {
|
||||
if (!binding.splashProgress.isVisible)
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
|
||||
with(viewModel) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
responseScan.observe(viewLifecycleOwner) {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
ma.messageWithSound(
|
||||
it.errorMessage,
|
||||
true,
|
||||
true,
|
||||
isToasted = true
|
||||
)
|
||||
showPalletScan()
|
||||
|
||||
} else {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
ma.messageWithSound(getString(R.string.palletScanned) + itemScaned, false, true)
|
||||
showPalletScan()
|
||||
|
||||
}
|
||||
}
|
||||
responsePalletGet.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
|
||||
ma.messageWithSound(
|
||||
it.errorMessage,
|
||||
true,
|
||||
true,
|
||||
isToasted = true
|
||||
)
|
||||
showPalletScan()
|
||||
|
||||
} else {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
ma.messageWithSound(getString(R.string.palletScanned) + itemScaned, false, true)
|
||||
|
||||
ma.onComprobarPalletFromPalletScan(it, ItemPalletVO(Pallet = itemScaned))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun showPalletScan() {
|
||||
|
||||
//customDialogList.setCancelable(false)
|
||||
|
||||
when (action) {
|
||||
"receive" -> {
|
||||
customDialogList.setTitle(getString(R.string.palletScan))
|
||||
|
||||
}
|
||||
"get" -> {
|
||||
customDialogList.setTitle(getString(R.string.palletScanAdd))
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
|
||||
customDialogList.setOkButton(getString(R.string.end)) {
|
||||
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
customDialogList.dismiss()
|
||||
|
||||
|
||||
}.setValue("").show()
|
||||
|
||||
|
||||
|
||||
|
||||
customDialogList.setFocusText()
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
|
||||
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||
|
||||
if (customDialogList.getValue().isNotEmpty()
|
||||
) {
|
||||
itemScaned = customDialogList.getValue()
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
|
||||
when (action) {
|
||||
"receive" -> expeditionState_addByPallet(
|
||||
customDialogList.getValue()
|
||||
)
|
||||
"get" -> expeditionPallet_get(customDialogList.getValue())
|
||||
}
|
||||
customDialogList.setValue("")
|
||||
}
|
||||
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
|
||||
class PalletScanViewModel(context: Context) : BaseViewModel() {
|
||||
|
||||
private val GetPaletizadoresUserCase: GetPaletizadoresUserCase =
|
||||
GetPaletizadoresUserCase(context)
|
||||
|
||||
private val _responseScan by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseScan: LiveData<ResponseItemVO>
|
||||
get() = _responseScan
|
||||
|
||||
private val _responsePalletGet by lazy { MutableLiveData<ItemExpeditionTruckVO>() }
|
||||
val responsePalletGet: LiveData<ItemExpeditionTruckVO>
|
||||
get() = _responsePalletGet
|
||||
|
||||
|
||||
fun expeditionState_addByPallet(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vPalletId: String,
|
||||
vStatePallet: String
|
||||
) {
|
||||
GetPaletizadoresUserCase.expeditionState_addByPallet(
|
||||
usuario,
|
||||
password,
|
||||
vPalletId,
|
||||
vStatePallet
|
||||
)
|
||||
.enqueue(object : Callback<Unit> {
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
|
||||
_responseScan.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Unit>, response: Response<Unit>) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
_responseScan.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_responseScan.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionPallet_get(usuario: String, password: String, vPalletId: String) {
|
||||
GetPaletizadoresUserCase.expeditionPallet_get(usuario, password, vPalletId)
|
||||
.enqueue(object : Callback<ItemExpeditionTruckVO> {
|
||||
override fun onFailure(call: Call<ItemExpeditionTruckVO>, t: Throwable) {
|
||||
|
||||
_responsePalletGet.value = ItemExpeditionTruckVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<ItemExpeditionTruckVO>,
|
||||
response: Response<ItemExpeditionTruckVO>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
_responsePalletGet.value = ItemExpeditionTruckVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_responsePalletGet.value =
|
||||
response.body()!!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -2,12 +2,13 @@ package es.verdnatura.presentation.view.feature.paletizador.model
|
|||
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
|
||||
class ItemExpeditionTruckVO (
|
||||
var truckFk:String = "",
|
||||
var ETD:String = "",
|
||||
var Destino:String = "",
|
||||
var isError:Boolean = false,
|
||||
var errorMessage:String = ""
|
||||
class ItemExpeditionTruckVO(
|
||||
var truckFk: String = "",
|
||||
var ETD: String = "",
|
||||
var Destino: String = "",
|
||||
var description: String = "",
|
||||
var isError: Boolean = false,
|
||||
var errorMessage: String = ""
|
||||
)
|
||||
|
||||
|
||||
|
@ -16,9 +17,9 @@ class ItemExpeditionTruckList(
|
|||
)
|
||||
|
||||
class itemExpedetionState(
|
||||
var isError:Boolean = false,
|
||||
var errorMessage:String = "",
|
||||
var list:MutableList<itemsExpeditionDynamics>
|
||||
var isError: Boolean = false,
|
||||
var errorMessage: String = "",
|
||||
var list: MutableList<itemsExpeditionDynamics>
|
||||
|
||||
)
|
||||
|
||||
|
@ -27,10 +28,10 @@ class itemsExpeditionDynamics(
|
|||
var value: String? = null
|
||||
)
|
||||
|
||||
class ItemExpeditionStateRow (
|
||||
var title:String? = "",
|
||||
var value:String? = "",
|
||||
var isEditable:Boolean = true,
|
||||
var action:String = "",
|
||||
class ItemExpeditionStateRow(
|
||||
var title: String? = "",
|
||||
var value: String? = "",
|
||||
var isEditable: Boolean = true,
|
||||
var action: String = "",
|
||||
var barcodes: List<BarcodeVO> = listOf()
|
||||
)
|
||||
|
|
|
@ -2,6 +2,7 @@ package es.verdnatura.presentation.view.feature.pasillero.fragment
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -75,6 +76,7 @@ class PasilleroFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
|
|
@ -264,6 +264,31 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
)
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
30,
|
||||
R.drawable.ic_pallet_scan_expedition,
|
||||
contextApp.getString(R.string.titleScanPalletizar),
|
||||
R.string.titleScanPalletizar,
|
||||
contextApp.getString(
|
||||
R.string.titleScanPalletDescrip
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
30,
|
||||
R.drawable.lift,
|
||||
contextApp.getString(R.string.scanPlatform),
|
||||
R.string.scanPlatform,
|
||||
contextApp.getString(
|
||||
R.string.titleScanPlatform
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
50,
|
||||
|
@ -459,6 +484,19 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
val working_in_test=false
|
||||
|
||||
if (working_in_test){
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
6,
|
||||
R.drawable.ic_star_ko,
|
||||
contextApp.getString(R.string.testing),
|
||||
R.string.testing,
|
||||
contextApp.getString(R.string.testing)
|
||||
)
|
||||
)}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ class PreSacadorFragment :
|
|||
} else {
|
||||
customDialogList.setValueTwo("")
|
||||
//showErrorMessage("El resultado del procedimiento barcodeToItem de la etiqueta escaneada es: " +it.response)
|
||||
showErrorMessage("La línea de compra de la etiqueta escaneada no existe.")
|
||||
showErrorMessage(getString(R.string.lineNotExists))
|
||||
if (mperror != null) {
|
||||
mperror?.start()
|
||||
}
|
||||
|
|
|
@ -340,15 +340,15 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
|
|||
vStateFk,
|
||||
vIsChecked,
|
||||
vBuyFk
|
||||
).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>) {
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -358,7 +358,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel() {
|
|||
)
|
||||
)
|
||||
} else {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.body()!!)
|
||||
_response.value = ResponseItemVO(isError = false, response = "")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -65,7 +65,7 @@ class SacadorFragment :
|
|||
)
|
||||
|
||||
} else {
|
||||
var working_in_test = false //sergio: Ok en app
|
||||
val working_in_test = false //sergio: Ok en app
|
||||
if (!working_in_test) {
|
||||
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||
} else {
|
||||
|
@ -138,11 +138,12 @@ class SacadorFragment :
|
|||
iconAdd.drawable -> {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
// checkTagsMode()
|
||||
//Tarea 4351 cambiar getData(WAGON) por getData(NUMBEROFWAGONS)
|
||||
viewModel.collectionNew(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
getData(SECTORFK),
|
||||
getData(WAGON)
|
||||
getData(NUMBEROFWAGONS)
|
||||
)
|
||||
}
|
||||
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
|
||||
|
@ -169,12 +170,13 @@ class SacadorFragment :
|
|||
private fun checkTagsMode() {
|
||||
|
||||
//sergio:codigo smarttags
|
||||
//Tarea 4351 cambiar getData(WAGON por NUMBEROFWAGONS)
|
||||
if (getData(TAGSTYPE).equals(getString(R.string.stickers))) {
|
||||
viewModel.collectionNew(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
getData(SECTORFK),
|
||||
getData(WAGON)
|
||||
getData(NUMBEROFWAGONS)
|
||||
)
|
||||
} else if (getCollections) {
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/drawable.iml" filepath="$PROJECT_DIR$/.idea/drawable.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../../../../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="NONE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="ed05e1b0-7b08-4b0f-ac14-8b94658a9667" name="Changes" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/testing/testPrint.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanFragment.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanViewModel.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/lift.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/../layout/fragment_testing_print.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../../../../.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../../../../../.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../../../build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/../../../../build.gradle" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../../../release/output-metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/../../../../release/output-metadata.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../../../release/vn-pickingBeta.apk" beforeDir="false" afterPath="$PROJECT_DIR$/../../../../release/vn-pickingBeta.apk" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/di/viewModelModule.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/di/viewModelModule.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/domain/GetSacadorControladorUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/domain/GetSacadorControladorUserCase.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/domain/VerdnaturaService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/domain/VerdnaturaService.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../../java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../values-es/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../values-es/strings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../values/strings.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../../../.." />
|
||||
</component>
|
||||
<component name="ProjectId" id="2D9iuVe6c5lXDIRGcX0WRsHBsSb" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
<option name="showMembers" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="RunOnceActivity.cidr.known.project.marker" value="true" />
|
||||
<property name="android.sdk.path" value="$USER_HOME$/AppData/Local/Android/Sdk" />
|
||||
<property name="cidr.known.project.marker" value="true" />
|
||||
<property name="last_opened_file_path" value="$USER_HOME$/Downloads/ZSDK_DemosAndroid" />
|
||||
<property name="settings.editor.selected.configurable" value="dev.polek.adbwifi.settings.AdbWifiConfigurable" />
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="ed05e1b0-7b08-4b0f-ac14-8b94658a9667" name="Changes" comment="" />
|
||||
<created>1660117924027</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1660117924027</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,8 @@
|
|||
<!-- drawable/package_variant_closed_plus.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#F7931E" android:pathData="M13 19.3V12.6L19 9.2V13C19.7 13 20.4 13.1 21 13.4V7.5C21 7.1 20.8 6.8 20.5 6.6L12.6 2.2C12.4 2.1 12.2 2 12 2S11.6 2.1 11.4 2.2L3.5 6.6C3.2 6.8 3 7.1 3 7.5V16.5C3 16.9 3.2 17.2 3.5 17.4L11.4 21.8C11.6 21.9 11.8 22 12 22S12.4 21.9 12.6 21.8L13.5 21.3C13.2 20.7 13.1 20 13 19.3M12 4.2L18 7.5L16 8.6L10.1 5.2L12 4.2M11 19.3L5 15.9V9.2L11 12.6V19.3M12 10.8L6 7.5L8 6.3L14 9.8L12 10.8M20 15V18H23V20H20V23H18V20H15V18H18V15H20Z" />
|
||||
</vector>
|
|
@ -0,0 +1,8 @@
|
|||
<!-- drawable/forklift.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#F7931E" android:pathData="M6,4V11H4C2.89,11 2,11.89 2,13V17A3,3 0 0,0 5,20A3,3 0 0,0 8,17H10A3,3 0 0,0 13,20A3,3 0 0,0 16,17V13L12,4H6M17,5V19H22V17.5H18.5V5H17M7.5,5.5H11.2L14.5,13H7.5V5.5M5,15.5A1.5,1.5 0 0,1 6.5,17A1.5,1.5 0 0,1 5,18.5A1.5,1.5 0 0,1 3.5,17A1.5,1.5 0 0,1 5,15.5M13,15.5A1.5,1.5 0 0,1 14.5,17A1.5,1.5 0 0,1 13,18.5A1.5,1.5 0 0,1 11.5,17A1.5,1.5 0 0,1 13,15.5Z" />
|
||||
</vector>
|
|
@ -36,7 +36,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1.5"
|
||||
android:backgroundTint="@android:color/white"
|
||||
android:hint="@string/Filtro"
|
||||
android:hint="@string/itemFilter"
|
||||
android:inputType="text"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/verdnatura_black">
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/scan_input"
|
||||
style="@style/ScanLineTextSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:hint="@string/Escaneaetiqueta"
|
||||
android:inputType="textVisiblePassword"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/main_toolbar" />
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/main_toolbar"
|
||||
layout="@layout/toolbar_fragment"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_print_template"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Print template" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_print_all"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Print all data" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_print_zpl"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Print all ZPL" />
|
||||
<Button
|
||||
android:id="@+id/button_print_status"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Print status" />
|
||||
<Button
|
||||
android:id="@+id/button_print_disconnect"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Print disconnect" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_img_to_pdf"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Image to pdf" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:visibility="visible"
|
||||
app:srcCompat="@drawable/alpha_b_circle_outline" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
android:id="@+id/splash_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/verdnatura_black_8_alpha_6"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/verdnatura_logo_large_height"
|
||||
app:lottie_autoPlay="true"
|
||||
app:lottie_loop="true"
|
||||
app:lottie_rawRes="@raw/orange_loading"
|
||||
app:lottie_speed="2" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
|
@ -35,7 +35,7 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.Destino}"
|
||||
android:text="@{item.description}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -76,6 +76,7 @@
|
|||
<string name="Parking">Parking</string>
|
||||
<string name="Reject">Rechazar</string>
|
||||
<string name="cmrError">No se ha podido guardar.Revisa el código del Pallet y del CMR.</string>
|
||||
<string name="palletScanError">Vuelva a intentarlo. No se ha podido recepcionar pallet:</string>
|
||||
<string name="updatemng">Existe una versión nueva, es recomendable actualizar.</string>
|
||||
<string name="Actualizar">Actualizar</string>
|
||||
<string name="reposicion">Reposición</string>
|
||||
|
@ -320,6 +321,7 @@
|
|||
<string name="expeditionsError">No ha escaneado expediciones</string>
|
||||
<string name="expeditionNoSorter">Escanea expediciones que no han pasado por el Sorter</string>
|
||||
<string name="added">Añadida</string>
|
||||
<string name="palletScanned">Escaneado pallet:</string>
|
||||
<string name="registerAdded">Registro añadido</string>
|
||||
<string name="keepPlate">\u0020 guardada con matrícula \u0020</string>
|
||||
<string name="splitOk">Split ok</string>
|
||||
|
@ -461,4 +463,14 @@
|
|||
<string name="collectionNoTicketsError">Colección no tiene tickets, el ticket no es de ahora o ticket eliminado</string>
|
||||
<string name="stems">Tallos</string>
|
||||
<string name="itemCost">Precio coste</string>
|
||||
<string name="lineNotExists">La línea de compra de la etiqueta escaneada no existe.</string>
|
||||
<string name="testing">Testing</string>
|
||||
<string name="scanPlatform">Escáner plataforma</string>
|
||||
<string name="titleScanPlatform">Permite recepcionar pallet</string>
|
||||
<string name="palletScan">Escanea pallet para su recepción</string>
|
||||
<string name="titleScanPalletizar">Escanear pallet</string>
|
||||
<string name="titleScanPalletDescrip">Permite añadir expediciones a un pallet</string>
|
||||
<string name="palletScanAdd">Escanea pallet para añadir expediciones</string>
|
||||
<string name="messageConfirm">¿Estás seguro que deseas eliminar?</string>
|
||||
<string name="itemFilter">Filtro ítem</string>
|
||||
</resources>
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
<string name="Usuario">User</string>
|
||||
<string name="Escaneaetiqueta">Scan label</string>
|
||||
<string name="Filtro">Filter</string>
|
||||
<string name="itemFilter">Item filter</string>
|
||||
<string name="Nuevovalor">New value</string>
|
||||
<string name="Hora">Hour</string>
|
||||
<string name="Etiquetas">Labels</string>
|
||||
|
@ -330,11 +331,15 @@
|
|||
<string name="packetNumberShelves">Number of packages on shelf</string>
|
||||
<string name="packetIndicate">Indicates the number of packages that fit on a shelf</string>
|
||||
<string name="test">Check</string>
|
||||
<string name="testing">Testing</string>
|
||||
<string name="expeditionsError">You have not scanned expeditions</string>
|
||||
<string name="expeditionNoSorter">Scan expeditions that have not passed through the Sorter</string>
|
||||
<string name="expeditionPalletScan">Scan pallet expedition </string>
|
||||
<string name="palletScan">Scan pallet to receive it</string>
|
||||
<string name="palletScanAdd">Scan pallet to add expeditions</string>
|
||||
<string name="cmrScan">Scan CMR</string>
|
||||
<string name="added">Added</string>
|
||||
<string name="palletScanned">Scanned:</string>
|
||||
<string name="registerAdded">Added log</string>
|
||||
<string name="keepPlate">" saved with registration plate "</string>
|
||||
<string name="splitOk">Split OK</string>
|
||||
|
@ -345,6 +350,8 @@
|
|||
<string name="titleSmarttagPickerAssociate">Associate Punch SmartTags</string>
|
||||
<string name="titleSmarttagsRegister">Register SmartTags</string>
|
||||
<string name="titlePalletizar">Palletize</string>
|
||||
<string name="titleScanPalletizar">Scan pallet</string>
|
||||
<string name="scanPlatform">Scan platform</string>
|
||||
<string name="titleScanExpedition">Scan expedition</string>
|
||||
<string name="titleBufferManegement">Buffer management</string>
|
||||
<string name="titleClaims">Claims</string>
|
||||
|
@ -397,6 +404,7 @@
|
|||
<string name="userNotPermission">User without permissions to perform the action</string>
|
||||
<string name="messageUserError">Check your username and password. If you cannot access, contact Informatica</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="messageConfirm">Are you sure to delete ?</string>
|
||||
<string name="ticket">"Ticket: "</string>
|
||||
<string name="expedit">Expedition: </string>
|
||||
<string name="dayFormat">dd/MM/yyyy</string>
|
||||
|
@ -425,6 +433,8 @@
|
|||
<string name="titleShelParkDescrip">Shelves Parking</string>
|
||||
<string name="titleQualityDescrip">It allows to know the quality of some products by buyer</string>
|
||||
<string name="titlePalletDescrip">Allows scanning pallet to incorporate it into the system</string>
|
||||
<string name="titleScanPalletDescrip">Allows scanning expeditions to incorporate it into a pallet</string>
|
||||
<string name="titleScanPlatform">Allows scanning received pallet</string>
|
||||
<string name="titleExpeditionDescrip">Allows you to know the status of an expedition</string>
|
||||
<string name="titleCMRDescrip">Allows you to report a CMR</string>
|
||||
<string name="titleExpScanDescrip">Allows scanning shipments that have not passed through the sorter</string>
|
||||
|
@ -461,6 +471,8 @@
|
|||
<string name="in_shelve">In shelve:</string>
|
||||
<string name="successReubication">Reubication ended</string>
|
||||
<string name="cmrError">It\'s not saved. Please review pallet and CMR</string>
|
||||
<string name="palletScanError">Repeat again. Pallet does not received:</string>
|
||||
<string name="lineNotExists">Buy line of scanned label do not exist.</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue