Version 7.6, no subida, fija estados ticket_setState, revisados databinding layouts y posibilidad de envio rockets desde previa.
This commit is contained in:
parent
5b5171ab1d
commit
964850c4af
|
@ -10,6 +10,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/alpha_b_circle_outline.xml" value="0.2359375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/alpha_f_circle_outline.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_oval_checked.xml" value="0.2359375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_oval_unchecked.xml" value="0.30052083333333335" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode.xml" value="0.2359375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode_scan.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/border_parental.xml" value="0.11979166666666667" />
|
||||
|
@ -22,6 +23,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_full.xml" value="0.18489583333333334" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_off.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_outline.xml" value="0.22407407407407406" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car.xml" value="0.30052083333333335" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_control.xml" value="0.22407407407407406" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_info.xml" value="0.2916666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/circleshape.xml" value="0.11979166666666667" />
|
||||
|
@ -84,8 +86,10 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/buyers_fragment.xml" value="0.18333333333333332" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_dialog.xml" value="0.1490036231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog.xml" value="0.10208333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_hour.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_list_dialog.xml" value="0.1490036231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.12817028985507245" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_two_dialog.xml" value="0.1793478260869565" />
|
||||
<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_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" />
|
||||
|
@ -95,9 +99,13 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item_all.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_collection.xml" value="0.23007246376811594" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_controlador.xml" value="0.20153985507246377" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_pallet.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_pallet_detail.xml" value="0.15579710144927536" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_scan.xml" value="0.21666666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_truck_list.xml" value="0.15579710144927536" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionscan_sorter.xml" value="0.196875" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionstate.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_faltas.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_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.11271529888551166" />
|
||||
|
@ -116,6 +124,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_qr.xml" value="0.19882246376811594" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador.xml" value="0.12952898550724637" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador_associatesmarttag.xml" value="0.22" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelving_parking.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.13269927536231885" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_transferencia.xml" value="0.10666666666666667" />
|
||||
|
@ -126,22 +135,36 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ajustes_row.xml" value="0.10009057971014493" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.4466666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_presacador.xml" value="0.4466666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_barcode_row.xml" value="0.15579710144927536" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_buyer_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_card_row.xml" value="0.2269021739130435" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_collection_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_escaner_row.xml" value="0.15353260869565216" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expedition_view_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionpallet_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionscan_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionstate_row.xml" value="0.23489583333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditiontruck_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_faltas_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historico_row.xml" value="0.15353260869565216" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historicovehiculo_row.xml" value="0.18795289855072464" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_inventary_row.xml" value="0.22604166666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_itemshelvingdayofsale_row.xml" value="0.18206521739130435" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_all_row.xml" value="0.12259371833839919" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_row.xml" value="0.16875" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_pasilleros_main_menu.xml" value="0.13829787234042554" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_placement_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_proposal_row.xml" value="0.22604166666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_reposicion.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvingdayofsale_row.xml" value="0.2375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvinglog_row.xml" value="0.21739130434782608" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvingparking_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_smarttag_row.xml" value="0.20153985507246377" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_toolbar_row.xml" value="0.15307971014492755" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ubication_row.xml" value="0.11822916666666666" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_worker_image.xml" value="0.23177083333333334" />
|
||||
<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/toolbar.xml" value="0.15353260869565216" />
|
||||
</map>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RenderSettings">
|
||||
<option name="showDecorations" value="true" />
|
||||
</component>
|
||||
</project>
|
|
@ -14,32 +14,11 @@ android {
|
|||
applicationId "es.verdnatura"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 97
|
||||
versionName "7.5.1" //VERSION CODE 97. Control de previa, Llamadas ok, menú ok y textos en iconos y imágenes.
|
||||
//versionName "7.5" //VERSION CODE 96. Control de previa, Llamadas ok, menú ok y textos en iconos y imágenes.
|
||||
//versionName "7.4" //VERSION CODE 95. Envio desde App enlaces correctos, un click controladores y llamadas sacador-controlador hecho pero no probado.
|
||||
//versionName "7.3" //VERSION CODE 94. Se ve productos en balda y posibilidad de modificarlo.
|
||||
//versionName "7.2.1" //VERSION CODE 93. Si eliges sector en V no aparece insertar las baldas.
|
||||
//versionName "7.2" //VERSION CODE 92. Ordena sales en presacador por pickingOrder, ya no llama siempre para poner numero de baldas.
|
||||
//versionName "7" //VERSION CODE 88. Se añade llamadas a parkingsales,incorpora poner numero de baldas
|
||||
//versionName "6.6" //VERSION CODE 87. Modificado parking presacador.faltaba ver el ticket y se añade carro al historico de shelving.
|
||||
//versionName "6.5.1" //VERSION CODE 86. Modificado parking presacador.faltaba ver el ticket y se añade carro al historico de shelving.
|
||||
//versionName "6.5" //VERSION CODE 85. Modificado parking presacador. Llama a saleParking.
|
||||
//versionName "6.4" //VERSION CODE 84. Modificados menus buffer y añadido hsitorico carro por items y por carro.
|
||||
//versionName "6.3" //VERSION CODE 83 Nueva funcionalidad Cargar expedición en buffer
|
||||
//versionName "6.2.1" // VERSION CODE 82 Aparece mensaje de error completo en "Error al construir la colección".
|
||||
//versionName "6.2" //VERSION CODE 81, arreglado el null de grouping en ubicador.
|
||||
//versionName "6.1.9.1" //VERSION CODE 80, arreglado el null de grouping en ubicador.
|
||||
//versionName "6.1.9" VERSION CODE 76, añadido grouping, reference, prioridad, controladores vs scadores, boton mensaje error,rocket salix y error al añadir elemento a colección.
|
||||
// Sin subir, Modificado y añadido mensajes de error, añadido opcion Dia de venta y su parking, teclado numerico para controlador
|
||||
//versionName "6.1.8.5" VERSION CODE 75 // 23-10-2021//VERSION CODE 74-75 .Pantalla "Dia de venta y parking" Modificado itemtrash, deprecated preferenceManager, quitados ;,puesto menu general al controlador
|
||||
//versionName "6.1.8.4.1" //VERSION CODE 73 . Modificar itemtrash
|
||||
//versionName "6.1.8.4" //VERSION CODE 72 . Se añade ExpedtionScan para el Sorter, y modificion llamadas itemtrash y collectionGetTicket.
|
||||
//versionName "6.1.8.3.1"//(VERSION CODE 71) Se añade ViewModel.collectionGet cuando se hace un collectionNew y un refresco de adapter
|
||||
//versionName "6.1.8.3" //(VERSION CODE 69) Tres campos más en pantalla cel1,cel2,cel3, obtener artículos similares con filtro, mostrar foto del sacador.
|
||||
//versionName "6.1.8.2" //(VERSIONCODE 68) Menu Operaciones buffer, pantalla mas grande en control vehiculo, deletefragments a todos los menus.
|
||||
//versionName "6.1.8.1" //(VERSIONCODE 67) Control vehiculo , visualizar y filtrar historico
|
||||
// versionName "5.4.4" //version inicial
|
||||
versionCode 100
|
||||
versionName "7.6" //VERSION CODE 100. Envios rocket a previa, revisados databinding layouts,
|
||||
//versionName "7.5.1" //VERSION CODE 97. Control de previa, Llamadas ok, menú ok y textos en iconos y imágenes.
|
||||
//versionName "7.5.1" VERSION CODE 99 PARA TESTEAR APP-->INSTALADA EN VARIOS USUARIO 24-01-2022
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
@ -71,6 +50,10 @@ dependencies {
|
|||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar'])
|
||||
releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar'])
|
||||
//navigation
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
|
||||
implementation("androidx.drawerlayout:drawerlayout:1.1.1")
|
||||
|
||||
// Kotlin and Android
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 97,
|
||||
"versionCode": 99,
|
||||
"versionName": "7.5.1",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -16,36 +16,36 @@
|
|||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="com.zebra.provider.READ"/>-->
|
||||
|
||||
<queries>
|
||||
<provider android:authorities="oem_info" />
|
||||
</queries>
|
||||
<!--<queries>
|
||||
<provider android:authorities="oem_info" />
|
||||
</queries>-->
|
||||
|
||||
<application
|
||||
android:name=".MobileApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity android:name=".presentation.view.feature.imageview.activity.ImageViewActivity" android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".presentation.view.feature.main.activity.MainActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".presentation.view.feature.login.activity.LoginActivity"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<application
|
||||
android:name=".MobileApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity android:name=".presentation.view.feature.imageview.activity.ImageViewActivity" android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".presentation.view.feature.main.activity.MainActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".presentation.view.feature.login.activity.LoginActivity"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -5,8 +5,9 @@ import retrofit2.converter.gson.GsonConverterFactory
|
|||
|
||||
class ApiSalixUtils {
|
||||
companion object {
|
||||
//const val BASE_URL:String = "http://192.168.1.108:8000/"
|
||||
//const val BASE_URL:String = "http://192.168.1.155:9009/"
|
||||
const val BASE_URL: String = "https://salix.verdnatura.es/api/"
|
||||
//const val BASE_URL: String = "https://test-salix.verdnatura.es/api/"
|
||||
fun getApiService(): SalixService {
|
||||
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
|
||||
GsonConverterFactory.create()
|
||||
|
|
|
@ -10,4 +10,7 @@ class GetAjustesUserCase(context: Context) : RestClient(context) {
|
|||
return restClient!!.getSectors("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
|
||||
fun getSectorsSalix(token:String): Call<List<SectorItemVO>> {
|
||||
return salixClient!!.getSectorsSalix(content_type = "application/json", authorization = token)
|
||||
}
|
||||
}
|
|
@ -89,20 +89,20 @@ class GetLoginUserCase(context: Context) : RestClient(context)
|
|||
*/
|
||||
//SALIX SERGIO MENSAJE : PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO.
|
||||
|
||||
/*fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
|
||||
fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
|
||||
return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message))
|
||||
}*/
|
||||
}
|
||||
|
||||
// SERGIO: PARA DESARROLLO SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA
|
||||
|
||||
fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>
|
||||
/*fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>
|
||||
{
|
||||
return salixClient!!.sendGroup(
|
||||
content_type = "application/json",
|
||||
authorization = token,
|
||||
params = SalixGrupo(to = "#android-test", message = message)
|
||||
)
|
||||
}
|
||||
}*/
|
||||
|
||||
fun checkVersion(usuario: String, password: String, nameApp: String): Call<versionApp>
|
||||
{
|
||||
|
|
|
@ -120,6 +120,10 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
// val params:ArrayList<String> = ArrayList()
|
||||
return restClient!!.collectionGet("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
fun collectionGetSalix(token:String): Call<List<CollectionVO>> {
|
||||
// val params:ArrayList<String> = ArrayList()
|
||||
return salixClient!!.getCollectionSalix(content_type = "application/json",token)
|
||||
}
|
||||
|
||||
fun saleTrackingReplace(
|
||||
usuario: String,
|
||||
|
@ -378,16 +382,16 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
)
|
||||
}
|
||||
|
||||
fun collectionUpdateState(
|
||||
fun ticket_setState(
|
||||
usuario: String,
|
||||
password: String,
|
||||
collectionFk: String,
|
||||
ticketFk: String,
|
||||
state: String
|
||||
): Call<String> {
|
||||
): Call<Unit> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(collectionFk)
|
||||
params.add(ticketFk)
|
||||
params.add(state)
|
||||
return restClient!!.collectionUpdateState(
|
||||
return restClient!!.ticket_setState(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package es.verdnatura.domain
|
||||
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.SalixGrupo
|
||||
import es.verdnatura.presentation.view.feature.login.model.SalixMessageVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.POST
|
||||
|
||||
|
@ -30,5 +33,19 @@ interface SalixService {
|
|||
):
|
||||
Call<Boolean>
|
||||
|
||||
@GET("collections/getSectors")
|
||||
fun getSectorsSalix(
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Header("Authorization") authorization: String,
|
||||
//@Body params: SalixGrupo
|
||||
):
|
||||
Call<List<SectorItemVO>>
|
||||
|
||||
@GET("collections/getCollection")
|
||||
fun getCollectionSalix(
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Header("Authorization") authorization: String,
|
||||
):
|
||||
Call<List<CollectionVO>>
|
||||
|
||||
}
|
|
@ -369,8 +369,8 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<String>
|
||||
|
||||
@POST("almacennew/collectionUpdateState")//REVISADA
|
||||
fun collectionUpdateState(
|
||||
@POST("almacennew/ticket_setState")//REVISADA
|
||||
fun ticket_setState(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
|
@ -378,7 +378,7 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<String>
|
||||
Call<Unit>
|
||||
|
||||
@POST("almacennew/barcodeToItem")//REVISADA
|
||||
fun getIdFromCode(
|
||||
|
@ -470,7 +470,7 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<ItemPackingType>>
|
||||
|
||||
@POST("almacennew/itemStockUpdate")//REVISADA
|
||||
/* @POST("almacennew/itemStockUpdate")//REVISADA
|
||||
fun itemStockUpdate(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -479,9 +479,9 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<String>
|
||||
Call<String>*/
|
||||
|
||||
@POST("almacennew/itemTrash")//REVISADA
|
||||
@POST("almacennew/itemTrash")//REVISADA
|
||||
fun itemTrash(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -582,7 +582,7 @@ interface VerdnaturaService {
|
|||
Call<List<ItemLocationVO>>
|
||||
|
||||
// BUSCAR ITEM ALL
|
||||
/* @POST("almacennew/getItemUbication")//REVISADA
|
||||
/* @POST("almacennew/getItemUbication")//REVISADAc
|
||||
fun searchItemsUbicadorAll(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.speech.RecognizerIntent
|
|||
import android.speech.SpeechRecognizer
|
||||
import android.speech.tts.TextToSpeech
|
||||
import android.speech.tts.UtteranceProgressListener
|
||||
import android.text.Editable
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
@ -26,6 +27,8 @@ import androidx.fragment.app.Fragment
|
|||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.common.mediaCurrentVolume
|
||||
import org.koin.androidx.viewmodel.ext.android.viewModel
|
||||
|
@ -51,7 +54,6 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
protected val ANDROID_ID = "ANDROID_ID"
|
||||
protected val DEVICENAME = "devicename"
|
||||
protected val VOZ = "voz"
|
||||
|
||||
//nuevo campo número carros ajustes y campos para guardar el buyerid y buyernickname
|
||||
protected val BUYER = "buyernickname"
|
||||
protected val BUYERID = "buyerid"
|
||||
|
@ -63,7 +65,6 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
protected lateinit var binding: T
|
||||
private var isOnReadyForSpeech = false
|
||||
|
||||
|
||||
private var textToSpeech: TextToSpeech? = null
|
||||
private var mAudioManager: AudioManager? = null
|
||||
protected var mSpeechRecognizer: SpeechRecognizer? = null
|
||||
|
@ -117,6 +118,8 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
requestRecordAudioPermissionNew()
|
||||
requestCallPhonePermissionNew()
|
||||
init()
|
||||
|
||||
|
||||
}
|
||||
|
||||
@LayoutRes
|
||||
|
@ -167,6 +170,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
} catch (e: Exception) {
|
||||
cancelSpeech()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun initDataBinding() {
|
||||
|
@ -176,6 +180,22 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
lifecycle.addObserver(this@BaseFragment.viewModel)
|
||||
addBindingVariables()
|
||||
}
|
||||
|
||||
fun textScanned_filterDouble(textScanned: String):String{
|
||||
|
||||
if (textScanned.length>13) {
|
||||
var size = textScanned.length
|
||||
if (textScanned!!.substring((size / 2), size)
|
||||
.equals(textScanned.substring(0, size / 2))
|
||||
) {
|
||||
return textScanned.substring(0, size / 2)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return textScanned
|
||||
|
||||
}
|
||||
fun getTooltip(image: Int):String {
|
||||
|
||||
return when (image) {
|
||||
|
@ -203,6 +223,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
R.drawable.alpha_f_circle_outline->"Ver movimientos de Faltas"
|
||||
R.drawable.alpha_b_circle_outline->"Ver movimientos de Basura"
|
||||
|
||||
R.drawable.filter_outline->"Filtra por tipo de flor"
|
||||
else -> {""}
|
||||
}
|
||||
|
||||
|
@ -458,6 +479,29 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
}
|
||||
}
|
||||
|
||||
fun getData(name:String):String{
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
return when (name){
|
||||
TOKEN->prefs.getString(name, "").toString()
|
||||
ANDROID_ID->prefs.getString(name, "0").toString()
|
||||
USERFK->prefs.getString(USERFK, "").toString() //el id
|
||||
USER->prefs.getString(USER, "").toString()
|
||||
PASSWORD -> prefs.getString(PASSWORD, "").toString()
|
||||
SECTORFK->prefs.getInt(name, SECTORFKDEFAULT).toString()
|
||||
WAREHOUSEFK->prefs.getInt(name, ConstAndValues.WAREHOUSEFKDEFAULT).toString()
|
||||
VOZ->prefs.getString(name, "NO").toString()
|
||||
WAGON->prefs.getInt(name, 2).toString()
|
||||
TAGSTYPE-> prefs.getString(name, "Stickers").toString()
|
||||
SECTORDESCRIP->prefs.getString(name,getString(R.string.Sinsector)).toString()
|
||||
BUYER->prefs.getString(name,"").toString()
|
||||
BUYERID->prefs.getString(name,"").toString()
|
||||
|
||||
|
||||
else -> {""}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun saveBuyer(buyernickname: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
|
@ -478,23 +522,23 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
return imei.toString()
|
||||
}
|
||||
|
||||
fun getANDROIDID(): String {
|
||||
/* fun getANDROIDID(): String {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val androidid = prefs.getString(ANDROID_ID, "0")
|
||||
return androidid.toString()
|
||||
}
|
||||
}*/
|
||||
|
||||
fun getWagons(): Int {
|
||||
/*fun getWagons(): Int {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val wagons = prefs.getInt(WAGON, 2)
|
||||
return wagons
|
||||
}
|
||||
}*/
|
||||
|
||||
fun getTagsType(): String {
|
||||
/* fun getTagsType(): String {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val tagstype = prefs.getString(TAGSTYPE, "Stickers")
|
||||
return tagstype.toString()
|
||||
}
|
||||
}*/
|
||||
|
||||
fun getMessageFromJSON(json: String): String {
|
||||
val gson = Gson()
|
||||
|
|
|
@ -10,39 +10,10 @@ abstract class BaseViewModel : ViewModel(), LifecycleObserver
|
|||
|
||||
fun nameofFunction(function: Any): String
|
||||
{
|
||||
|
||||
// return Thread.currentThread().stackTrace[1].methodName
|
||||
|
||||
return function.javaClass.enclosingMethod!!.name
|
||||
}
|
||||
|
||||
fun getMessageFromResponse(ResponseMessage: String): String
|
||||
{
|
||||
return try
|
||||
{
|
||||
val answerError = JSONObject(ResponseMessage)
|
||||
answerError.get("Message").toString()
|
||||
} catch (e: Exception)
|
||||
{
|
||||
ResponseMessage
|
||||
}
|
||||
}
|
||||
|
||||
fun getMessageError(callFunction: String): String
|
||||
{
|
||||
|
||||
return when (callFunction)
|
||||
{
|
||||
"collection_getTickets" -> "No hay tickets para sacar. Llamada $callFunction."
|
||||
"collection_new_wagon" -> "No hay tickets para sacar. Llamada $callFunction."
|
||||
else ->
|
||||
{
|
||||
"Error en la llamada $callFunction."
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun getMessageFromAllResponse(callFunction: String, ResponseMessage: String): String
|
||||
{
|
||||
|
||||
|
@ -58,8 +29,6 @@ fun getMessageFromAllResponse(callFunction: String, ResponseMessage: String): St
|
|||
messageFromError = ResponseMessage
|
||||
}
|
||||
|
||||
// if (messageFromError.isEmpty()) {
|
||||
|
||||
//sergio:para personalizar los mensajes de respuesta según la llamada.
|
||||
when (callFunction)
|
||||
{
|
||||
|
@ -72,4 +41,4 @@ fun getMessageFromAllResponse(callFunction: String, ResponseMessage: String): St
|
|||
//}
|
||||
return "$messageFromError.$returnMessage"
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,9 +29,6 @@ import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
|||
class AjustesFragment :
|
||||
BaseFragment<FragmentAjustesBinding, AjustesViewModel>(AjustesViewModel::class) {
|
||||
|
||||
private var user: String? = ""
|
||||
private var userFk: String? = ""
|
||||
private var password: String? = ""
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var sectorListVO: List<SectorItemVO> = listOf()
|
||||
private var vozList: List<String> = listOf()
|
||||
|
@ -53,7 +50,7 @@ class AjustesFragment :
|
|||
prefs = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
customDialog = CustomDialog(requireContext())
|
||||
viewModel.inititializeDefaultAjusts(
|
||||
prefs!!.getString(
|
||||
/*prefs!!.getString(
|
||||
SECTORDESCRIP,
|
||||
getString(R.string.Sinsector)
|
||||
).toString(),
|
||||
|
@ -61,7 +58,15 @@ class AjustesFragment :
|
|||
prefs!!.getInt(WAREHOUSEFK, 0),
|
||||
prefs!!.getString(VOZ, "NO").toString(),
|
||||
prefs!!.getInt(WAGON, 2).toString(),
|
||||
prefs!!.getString(TAGSTYPE, "Stickers").toString()
|
||||
prefs!!.getString(TAGSTYPE, "Stickers").toString()*/
|
||||
getData(SECTORDESCRIP),
|
||||
getData(SECTORFK).toInt(),
|
||||
getData(WAREHOUSEFK).toInt(),
|
||||
getData(VOZ),
|
||||
getData(WAGON),
|
||||
getData(TAGSTYPE)
|
||||
|
||||
|
||||
)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
@ -71,21 +76,19 @@ class AjustesFragment :
|
|||
override fun init() {
|
||||
|
||||
(activity as MainActivity).hideBottomNavigation(View.VISIBLE)
|
||||
binding.userText.setText(prefs!!.getString(USERFK, ""))
|
||||
binding.userText.setText(getData(USER))
|
||||
val versionName = requireActivity().packageManager.getPackageInfo(
|
||||
requireActivity().packageName,
|
||||
0
|
||||
).versionName!!
|
||||
binding.itemVersion.setText(versionName)
|
||||
|
||||
user = prefs!!.getString(USER, "")
|
||||
userFk = prefs!!.getString(USERFK, "")
|
||||
password = prefs!!.getString(PASSWORD, "")
|
||||
binding.androididText.setText(
|
||||
Settings.Secure.getString(
|
||||
getData(ANDROID_ID)
|
||||
/*Settings.Secure.getString(
|
||||
context?.contentResolver,
|
||||
Settings.Secure.ANDROID_ID
|
||||
)
|
||||
)*/
|
||||
)
|
||||
binding.txtserver.setText(this.getDefaults("base_url", this.requireContext()))
|
||||
|
||||
|
@ -108,7 +111,8 @@ class AjustesFragment :
|
|||
override fun onAjustesItemClickListener(item: AjustesItemVO) {
|
||||
if (item.id == 0) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getSectors(user!!, password!!)
|
||||
// viewModel.getSectors(getData(USER),getData(PASSWORD))
|
||||
viewModel.getSectorsSalix(getData(TOKEN))
|
||||
} else if (item.id == 5) {
|
||||
requireActivity().onBackPressed()
|
||||
} else if (item.id == 1) {
|
||||
|
@ -145,7 +149,7 @@ class AjustesFragment :
|
|||
(activity as MainActivity).onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = "Control de usuario de vehículo"
|
||||
), userFk!!
|
||||
), getData(USERFK)
|
||||
)
|
||||
|
||||
}
|
||||
|
|
|
@ -2,11 +2,14 @@ package es.verdnatura.presentation.view.feature.ajustes.fragment
|
|||
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetAjustesUserCase
|
||||
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.view.feature.ajustes.model.AjustesItemVO
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
|
@ -106,5 +109,31 @@ class AjustesViewModel(context: Context) : BaseViewModel() {
|
|||
|
||||
})
|
||||
}
|
||||
fun getSectorsSalix(token:String){
|
||||
getAjustesUserCase.getSectorsSalix(token).enqueue(object : Callback<List<SectorItemVO>>{
|
||||
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
|
||||
val listError:ArrayList<SectorItemVO> = ArrayList()
|
||||
listError.add(SectorItemVO(0,"",0,true,t.message!!))
|
||||
_sectorList.value = SectorListVO(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<SectorItemVO>>,
|
||||
response: Response<List<SectorItemVO>>
|
||||
) {
|
||||
|
||||
|
||||
if (response.body() != null){
|
||||
_sectorList.value = response.body()?.let { SectorListVO(it) }
|
||||
}else{
|
||||
val listError:ArrayList<SectorItemVO> = ArrayList()
|
||||
listError.add(SectorItemVO(0,"",0,true,
|
||||
getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
))
|
||||
_sectorList.value = SectorListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
|
|||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
|
@ -14,7 +13,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemCardBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -32,6 +30,7 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
|||
import es.verdnatura.presentation.view.feature.imageview.activity.ImageViewActivity
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import timber.log.Timber.d
|
||||
|
||||
class ItemCardFragment(
|
||||
var itemFk: String = ""
|
||||
|
@ -103,14 +102,6 @@ class ItemCardFragment(
|
|||
listIcons.add(iconReload)
|
||||
listIcons.add(iconHistory)
|
||||
|
||||
|
||||
/*
|
||||
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||
val iconHistory : Drawable = resources.getDrawable(R.drawable.ic_history_black_24dp,resources.newTheme())
|
||||
listIcons.add(iconReload)
|
||||
listIcons.add(iconHistory)*/
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
|
||||
|
@ -135,50 +126,12 @@ class ItemCardFragment(
|
|||
|
||||
}
|
||||
}
|
||||
/* if (item == iconReload.drawable) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
getItemCard(itemFk)
|
||||
}
|
||||
if (item == iconHistory.drawable) {
|
||||
if (itemFk.isNullOrEmpty()) {
|
||||
"Escanea un item".toast(requireActivity())
|
||||
} else {
|
||||
(activity as MainActivity).onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = "Historico"),
|
||||
itemInfoG!!.id
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
/* binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
|
||||
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
// binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
getItemCard(itemFk)
|
||||
}
|
||||
if (item == iconHistory){
|
||||
if (itemFk.isNullOrEmpty()){
|
||||
"Escanea un item".toast(requireActivity())
|
||||
}else{
|
||||
// //Log.i("VERDNATURA:","el item es ${itemInfoG!!.id}")
|
||||
//(activity as MainActivity).onPasillerosItemClickListener( PasillerosItemVO(title = "Historico"),itemFk)
|
||||
(activity as MainActivity).onPasillerosItemClickListener( PasillerosItemVO(title = "Historico"),itemInfoG!!.id)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})*/
|
||||
//toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
@ -215,16 +168,17 @@ class ItemCardFragment(
|
|||
}
|
||||
|
||||
private fun getItemCard(itemFk: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
user = getData(USER)
|
||||
password = getData(PASSWORD)
|
||||
warehouseFk = getData(WAREHOUSEFK)
|
||||
|
||||
this.itemFk = itemFk
|
||||
|
||||
binding.splashProgressTwo.visibility = View.VISIBLE
|
||||
viewModel.getItemCard(itemFk, warehouseFk, user, password, "item_card")
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getItemPackingType(user, password, "get_ItemPackingType")
|
||||
viewModel.getItemPackingType(getData(USER), getData(PASSWORD), "get_ItemPackingType")
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,10 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
|
|||
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetItemCardUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
@ -16,8 +14,6 @@ import retrofit2.Call
|
|||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
import timber.log.Timber
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class ItemCardViewModel(context: Context) : BaseViewModel() {
|
||||
private val getItemCardUserCase:GetItemCardUserCase = GetItemCardUserCase(context)
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package es.verdnatura.presentation.view.feature.articulo.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import android.widget.ImageView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -16,15 +15,12 @@ import es.verdnatura.presentation.base.BaseFragment
|
|||
import es.verdnatura.presentation.common.OnItemProposalClickListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.feature.articulo.adapter.ItemProposalAdapter
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_buscar_item.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
@ -35,28 +31,22 @@ class ItemProposalFragment(
|
|||
ItemCardViewModel::class
|
||||
) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
|
||||
private var adapter: ItemProposalAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private var listInvetory: ArrayList<ItemProposal> = ArrayList()
|
||||
private var listInvetoryAux: ArrayList<ItemProposal> = ArrayList()
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
private var reload = false
|
||||
private var hideLoad = true
|
||||
private var layoutManager: LinearLayoutManager? = null
|
||||
private var firstVisiblePosition = 0
|
||||
private var filter = "TRUE"
|
||||
private var prefs: SharedPreferences? = null
|
||||
|
||||
companion object {
|
||||
fun newInstance(entryPoint: String) = ItemProposalFragment(entryPoint)
|
||||
}
|
||||
|
||||
//override fun getLayoutId(): Int = R.layout.fragment_inventary
|
||||
override fun getLayoutId(): Int = R.layout.fragment_itemproposal
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
|
@ -65,18 +55,13 @@ class ItemProposalFragment(
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
prefs = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs!!.getString(USER, "").toString()
|
||||
password = prefs!!.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs!!.getInt(WAREHOUSEFK, 60).toString()
|
||||
|
||||
viewModel.item_getSimilar(
|
||||
itemFk,
|
||||
warehouseFk,
|
||||
getData(WAREHOUSEFK),
|
||||
vShipped = currentDay(),
|
||||
vIsShowedByType = "TRUE",
|
||||
user = user,
|
||||
password = password,"item_getSimilar"
|
||||
user = getData(USER),
|
||||
password = getData(PASSWORD),"item_getSimilar"
|
||||
)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
@ -85,12 +70,6 @@ class ItemProposalFragment(
|
|||
|
||||
val calendar = Calendar.getInstance()
|
||||
val format = SimpleDateFormat("yyyy-MM-dd")
|
||||
System.out.println(format.format(calendar.time))
|
||||
|
||||
/* val current = LocalDateTime.now()
|
||||
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
||||
val currentDay = current.format(formatter)*/
|
||||
|
||||
|
||||
return format.format(calendar.time)
|
||||
}
|
||||
|
@ -99,7 +78,6 @@ class ItemProposalFragment(
|
|||
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.ArticleSimilar) + ":" + itemFk
|
||||
|
@ -110,66 +88,54 @@ class ItemProposalFragment(
|
|||
}
|
||||
|
||||
private fun setToolBar() {
|
||||
val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
val iconReload: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_autorenew_black_24dp, resources.newTheme())
|
||||
val iconFilter: Drawable =
|
||||
resources.getDrawable(R.drawable.filter_outline, resources.newTheme())
|
||||
/* listIcons.add(iconReload)*/
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconFilter=ImageView(context)
|
||||
iconFilter.setImageResource(R.drawable.filter_outline)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconFilter.tooltipText = getTooltip(R.drawable.filter_outline)
|
||||
|
||||
}
|
||||
resources.getDrawable(R.drawable.filter_outline, resources.newTheme())
|
||||
|
||||
listIcons.add(iconFilter)
|
||||
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
||||
viewModel.item_getSimilar(
|
||||
itemFk,
|
||||
warehouseFk,
|
||||
vIsShowedByType = filter,
|
||||
vShipped = currentDay(),
|
||||
user = user,
|
||||
password = password
|
||||
,callFunction = "item_getSimilar")
|
||||
when (item){
|
||||
iconFilter.drawable-> {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
||||
|
||||
}
|
||||
if (item == iconFilter) {
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
||||
|
||||
|
||||
if (filter.equals("TRUE")) {
|
||||
showMessage("Sin Filtrar por tipo de flor")
|
||||
filter = "FALSE"
|
||||
iconFilter.setTint(
|
||||
ContextCompat.getColor(
|
||||
if (filter.equals("TRUE")) {
|
||||
filter = "FALSE"
|
||||
iconFilter.drawable.setTint(ContextCompat.getColor(
|
||||
context!!,
|
||||
R.color.verdnatura_white
|
||||
)
|
||||
)
|
||||
R.color.verdnatura_white))
|
||||
|
||||
} else {
|
||||
filter = "TRUE"
|
||||
iconFilter.drawable.setTint(
|
||||
ContextCompat.getColor(
|
||||
context!!,
|
||||
R.color.verdnatura_pumpkin_orange))
|
||||
}
|
||||
viewModel.item_getSimilar(
|
||||
itemFk,
|
||||
getData(WAREHOUSEFK),
|
||||
vIsShowedByType = filter,
|
||||
vShipped = currentDay(),
|
||||
user = getData(USER),
|
||||
password = getData(PASSWORD) ,
|
||||
callFunction = "item_getSimilar")
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
filter = "TRUE"
|
||||
showMessage("Filtrado por tipo de flor")
|
||||
iconFilter.setTint(
|
||||
ContextCompat.getColor(
|
||||
context!!,
|
||||
R.color.verdnatura_pumpkin_orange
|
||||
)
|
||||
)
|
||||
}
|
||||
viewModel.item_getSimilar(
|
||||
itemFk,
|
||||
warehouseFk,
|
||||
vIsShowedByType = filter,
|
||||
vShipped = currentDay(),
|
||||
user = user,
|
||||
password = password ,
|
||||
callFunction = "item_getSimilar")
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -178,15 +144,6 @@ class ItemProposalFragment(
|
|||
|
||||
}
|
||||
|
||||
private fun showMessage(message:String){
|
||||
val mytoast = Toast.makeText(
|
||||
requireContext(),
|
||||
message,
|
||||
Toast.LENGTH_SHORT
|
||||
)
|
||||
mytoast.setGravity(Gravity.TOP or Gravity.RIGHT, 0, -100)
|
||||
mytoast.show()
|
||||
}
|
||||
private fun setEvents() {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
|
|
|
@ -1,37 +1,23 @@
|
|||
package es.verdnatura.presentation.view.feature.buffer.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBufferBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
//import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
//import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
class BufferFragment(
|
||||
var entryPoint: String = ""
|
||||
) : BaseFragment<FragmentBufferBinding, BufferFragmentViewModel>(BufferFragmentViewModel::class) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
override fun getLayoutId(): Int = R.layout.fragment_buffer
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var type = ""
|
||||
|
||||
companion object {
|
||||
fun newInstance(entryPoint: String) = BufferFragment(entryPoint)
|
||||
|
@ -52,18 +38,9 @@ class BufferFragment(
|
|||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
goBack = true
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
type = ConstAndValues.PRECHECKER
|
||||
|
||||
password = getData(PASSWORD)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
@ -76,7 +53,7 @@ class BufferFragment(
|
|||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
goBack = false
|
||||
// goBack = false
|
||||
if (! binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
|
@ -90,8 +67,8 @@ class BufferFragment(
|
|||
}
|
||||
|
||||
viewModel.buffer_setTypeByName(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
binding.scanInput.text.toString(),
|
||||
entryPoint,
|
||||
"buffer_setTypeByName"
|
||||
|
@ -115,11 +92,11 @@ class BufferFragment(
|
|||
if (it.isError) {
|
||||
|
||||
(activity as MainActivity).messageWithSound(
|
||||
it.errorMessage,false)
|
||||
it.errorMessage,true,isPlayed = true)
|
||||
|
||||
} else {
|
||||
|
||||
(activity as MainActivity).messageWithSound("Operación "+entryPoint.lowercase() + " buffer realizada correctamente",true)
|
||||
(activity as MainActivity).messageWithSound("Operación "+entryPoint.lowercase() + " buffer realizada correctamente",false,isPlayed = true)
|
||||
binding.mainToolbar.backButton.performClick()
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package es.verdnatura.presentation.view.feature.buffer.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -1,24 +1,17 @@
|
|||
package es.verdnatura.presentation.view.feature.buffer.fragment
|
||||
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
import android.view.View.*
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.smarttag.adapter.SmartTagAdapter
|
||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||
|
@ -29,18 +22,9 @@ class BufferLoadFragment(
|
|||
BufferFragmentViewModel::class
|
||||
) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
private var userFk = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
override fun getLayoutId(): Int = R.layout.fragment_buffer_loadexpedition
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||
private var listTags: ArrayList<SmartTag> = ArrayList()
|
||||
private var tagsAdapter: SmartTagAdapter? = null
|
||||
private var itemScaned: String = ""
|
||||
|
@ -55,13 +39,11 @@ class BufferLoadFragment(
|
|||
|
||||
override fun init() {
|
||||
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
goBack = false
|
||||
(activity as MainActivity).hideBottomNavigation(GONE)
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok= MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
|
||||
|
@ -95,8 +77,8 @@ class BufferLoadFragment(
|
|||
if (listTags.size==2) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.expeditionLoading_add(
|
||||
usuario = user,
|
||||
password=password,
|
||||
usuario = getData(USER),
|
||||
password=getData(PASSWORD),
|
||||
vBufferFk = ExpeditionOrBuffer,
|
||||
vExpeditionFk = listTags.first().code.toString(),
|
||||
callFunction = "expeditionLoading_add")
|
||||
|
@ -107,19 +89,6 @@ class BufferLoadFragment(
|
|||
}
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
|
@ -136,36 +105,22 @@ class BufferLoadFragment(
|
|||
binding.splashProgress.visibility = GONE
|
||||
bufferloadresponse.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Cerrar") {
|
||||
customDialog.dismiss()
|
||||
|
||||
}.show()
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage,it.isError,true)
|
||||
} else {
|
||||
|
||||
it.response.toast(requireContext())
|
||||
if (it.response.equals("Registro añadido")){
|
||||
mpok?.start()
|
||||
|
||||
(activity as MainActivity).messageWithSound(it.response,false,true)
|
||||
}else{
|
||||
mperror?.start()
|
||||
it.response.toast(requireContext())
|
||||
}
|
||||
listTags.clear()
|
||||
tagsAdapter!!.notifyDataSetChanged()
|
||||
showExpeditionOrBufferScan()
|
||||
|
||||
/* var nameSmartTagwithWagon: String
|
||||
|
||||
nameSmartTagwithWagon =
|
||||
getTextScaned(listTags.size + 1) + itemScaned
|
||||
getTextScaned(1) + itemScaned
|
||||
customDialogList.setTitle(getTextToPosition(listTags.size + 1))
|
||||
|
||||
|
||||
listTags.add(SmartTag(itemScaned, nameSmartTagwithWagon))
|
||||
tagsAdapter!!.notifyDataSetChanged()
|
||||
customDialogList.setValue("")*/
|
||||
|
||||
}
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
@ -176,33 +131,23 @@ class BufferLoadFragment(
|
|||
}
|
||||
|
||||
private fun getTextToPosition(TagsScaned: Int): String {
|
||||
var message = ""
|
||||
|
||||
when (TagsScaned) {
|
||||
1 -> message = "Escanea buffer"
|
||||
//2 -> message = "Escanea etiqueta del medio"
|
||||
//3 -> message = "Escanea etiqueta inferior"
|
||||
//4 -> message = "Carro escaneado"
|
||||
else -> { message="Escanea buffer"}
|
||||
return when (TagsScaned) {
|
||||
1 -> "Escanea buffer"
|
||||
else -> {"Escanea buffer"}
|
||||
}
|
||||
|
||||
return message
|
||||
|
||||
}
|
||||
|
||||
private fun getTextScaned(TagScaned: Int): String {
|
||||
var message = ""
|
||||
|
||||
when (TagScaned) {
|
||||
1 -> message = "Expedición:"
|
||||
2 -> message = "Buffer:"
|
||||
//3 -> message = ""
|
||||
//4 -> message = ""
|
||||
else -> { message=""}
|
||||
return when (TagScaned) {
|
||||
1 -> "Expedición:"
|
||||
2 -> "Buffer:"
|
||||
else -> { ""}
|
||||
|
||||
}
|
||||
|
||||
return message
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.buscaritem.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
@ -9,7 +8,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBuscarItemBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
|
@ -22,9 +20,6 @@ class BuscarItemFragment(
|
|||
var itemFk:String = ""
|
||||
) : BaseFragment<FragmentBuscarItemBinding,BuscarItemViewModel>(BuscarItemViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter : LocationAdapter? = null
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
|
@ -73,13 +68,9 @@ class BuscarItemFragment(
|
|||
}
|
||||
|
||||
private fun getLocations(itemFk:String){
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
this.itemFk = itemFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getLocations(user,password,itemFk,"getItemUbication")
|
||||
viewModel.getLocations(getData(USER),getData(PASSWORD),itemFk,"getItemUbication")
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
@ -87,13 +78,12 @@ class BuscarItemFragment(
|
|||
loadLocationList.observe(viewLifecycleOwner, Observer { event ->
|
||||
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
adapter = LocationAdapter(it.list,pasillerosItemClickListener!!)
|
||||
|
||||
binding.locationRecyclerview.adapter = adapter
|
||||
binding.locationRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
var totalVisible:Int = 0
|
||||
var totalVisible = 0
|
||||
it.list.forEach {
|
||||
if (!it.visible.isNullOrEmpty())
|
||||
totalVisible += it.visible.toInt()
|
||||
|
|
|
@ -6,7 +6,6 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetBuscarItemUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
|
|
@ -11,8 +11,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.BuyersFragmentBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnAjustesItemClickListener
|
||||
import es.verdnatura.presentation.common.OnBuyerSelectedListener
|
||||
|
@ -22,22 +20,11 @@ import es.verdnatura.presentation.view.component.CustomDialog
|
|||
import es.verdnatura.presentation.view.feature.ajustes.adapter.AjustesAdapter
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_ajustes.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(BuyersViewModel::class) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var onBuyerSelectedListener : OnBuyerSelectedListener? = null
|
||||
private var buyersAdapter: AjustesAdapter? = null
|
||||
|
@ -54,18 +41,12 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
viewModel.itemShelvingBuyerGet(user = user,password = password,"itemShelving_BuyerGet")
|
||||
viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelving_BuyerGet")
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.quality)
|
||||
|
@ -88,16 +69,12 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
}
|
||||
listIcons.add(iconReload)
|
||||
|
||||
/* val listIcons:ArrayList<Drawable> = ArrayList()
|
||||
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||
listIcons.add(iconReload)*/
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons,object: OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
when(item){
|
||||
iconReload.drawable->{
|
||||
binding.splashProgress.visibility= View.VISIBLE
|
||||
viewModel.itemShelvingBuyerGet(user = user,password = password,"itemShelving_BuyerGet")
|
||||
viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelving_BuyerGet")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,13 +5,10 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetQualityUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
@ -12,21 +11,12 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.QaualityFragmentBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.calidad.adapter.ItemBuyersAdapter
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
import kotlinx.android.synthetic.main.qauality_fragment.*
|
||||
import kotlinx.android.synthetic.main.qauality_fragment. binding.scanInput
|
||||
import kotlinx.android.synthetic.main.qauality_fragment.binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
@ -35,10 +25,6 @@ class QaualityFragment(
|
|||
var userFk : String = "0"
|
||||
) : BaseFragment<QaualityFragmentBinding,QaualityViewModel>(QaualityViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var buyersAdapter: ItemBuyersAdapter? = null
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
|
@ -61,19 +47,13 @@ class QaualityFragment(
|
|||
override fun getLayoutId(): Int = R.layout.qauality_fragment
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
|
||||
viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk,"itemShelving_BuyerTask")
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = "itemShelving_BuyerTask"
|
||||
setToolBar()
|
||||
|
@ -88,10 +68,6 @@ class QaualityFragment(
|
|||
}
|
||||
|
||||
private fun setToolBar(){
|
||||
/*val listIcons:ArrayList<Drawable> = ArrayList()
|
||||
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||
listIcons.add(iconReload)
|
||||
*/
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconReload = ImageView(context)
|
||||
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
||||
|
@ -105,7 +81,7 @@ class QaualityFragment(
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
|
||||
viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk,"itemShelving_BuyerTask")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -147,7 +123,7 @@ class QaualityFragment(
|
|||
})
|
||||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
|
||||
viewModel.itemShelvingBuyerTask(user = getData(USER),password = getData(PASSWORD),userFk = userFk,"itemShelving_BuyerTask")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +150,7 @@ class QaualityFragment(
|
|||
buyersAdapter = ItemBuyersAdapter(listItems,pasillerosItemClickListener!!,object: OnStarSelectedListener{
|
||||
override fun onStarSelected(vId: String, vStars: String) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingStarsUpdate(user,password,vId,vStars)
|
||||
viewModel.itemShelvingStarsUpdate(getData(USER),getData(PASSWORD),vId,vStars)
|
||||
}
|
||||
|
||||
})
|
||||
|
|
|
@ -5,12 +5,9 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetQualityUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerListVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||
import retrofit2.Call
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.media.MediaPlayer
|
||||
import android.net.Uri
|
||||
|
@ -31,8 +28,6 @@ import es.verdnatura.domain.ConstAndValues.ON_CHECKING
|
|||
import es.verdnatura.domain.ConstAndValues.ON_PREPARATION
|
||||
import es.verdnatura.domain.ConstAndValues.PRECHECKER
|
||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -44,7 +39,6 @@ import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
|||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapter
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.*
|
||||
|
@ -58,13 +52,13 @@ class CollectionFragment(
|
|||
) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) {
|
||||
|
||||
private lateinit var dataMessageSalix: DataMessageSalix
|
||||
private var user = ""
|
||||
/* private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var SectorDescription = ""
|
||||
private var token = ""
|
||||
private var voz = ""
|
||||
private var voz = ""*/
|
||||
private var sales: List<SaleVO> = listOf()
|
||||
private var saleAdapter: SaleAdapter? = null
|
||||
private var lm: LinearLayoutManager? = null
|
||||
|
@ -120,25 +114,15 @@ class CollectionFragment(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
token = prefs.getString(TOKEN, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
voz = prefs.getString(VOZ, "NO").toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
||||
SectorDescription = prefs.getString(SECTORDESCRIP, "Sin Sector").toString()
|
||||
|
||||
|
||||
if ((collection.collectionFk != null) && type.equals(CONTROLADOR)) {
|
||||
|
||||
|
||||
//sergio: comprueba si viene de la pantalla de controlador
|
||||
viewModel.ticket_checkFullyControlled(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
"ticket_checkFullyControlled"
|
||||
)
|
||||
|
@ -147,10 +131,10 @@ class CollectionFragment(
|
|||
|
||||
if (collection.tickets.isEmpty()) {
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
@ -177,7 +161,7 @@ class CollectionFragment(
|
|||
setEvents()
|
||||
setToolBar()
|
||||
|
||||
if (type == SACADOR && voz != "NO") {
|
||||
if (type == SACADOR && getData(VOZ) != "NO") {
|
||||
setSpeak()
|
||||
}
|
||||
|
||||
|
@ -200,20 +184,6 @@ class CollectionFragment(
|
|||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
|
||||
}
|
||||
|
||||
/* val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
|
||||
val iconPrint: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_print_black_24dp, resources.newTheme())
|
||||
val iconAdd: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_playlist_add_black_24dp, resources.newTheme())
|
||||
val iconFace: Drawable =
|
||||
resources.getDrawable(R.drawable.face_man_outline, resources.newTheme())
|
||||
val iconPhone: Drawable =
|
||||
resources.getDrawable(R.drawable.phone_call, resources.newTheme())
|
||||
*/
|
||||
/*val iconSearch: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_visibility, resources.newTheme())*/
|
||||
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconPrint = ImageView(context)
|
||||
|
@ -265,7 +235,8 @@ class CollectionFragment(
|
|||
|
||||
|
||||
binding.splashProgress.visibility=VISIBLE
|
||||
viewModel.sip_getExtension(user,password, workerFkFromTicket,"sip_getExtension")
|
||||
viewModel.sip_getExtension(getData(USER),
|
||||
getData(PASSWORD), workerFkFromTicket,"sip_getExtension")
|
||||
|
||||
|
||||
}
|
||||
|
@ -300,23 +271,10 @@ class CollectionFragment(
|
|||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
|
||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||
// d("La tecla es " + actionId)
|
||||
|
||||
|
||||
//sergio:para ver si ha marcado dos veces el mismo ticket
|
||||
if (binding.scanInput.text!!.length > 13) {
|
||||
|
||||
var size = binding.scanInput.text!!.length
|
||||
if (binding.scanInput.text!!.substring((size / 2), size)
|
||||
.equals(binding.scanInput.text!!.substring(0, size / 2))
|
||||
) {
|
||||
binding.scanInput.setText(
|
||||
binding.scanInput.text!!.substring(
|
||||
0,
|
||||
size / 2
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
||||
|
||||
findSale(binding.scanInput.text.toString())
|
||||
|
||||
|
@ -338,10 +296,10 @@ class CollectionFragment(
|
|||
// if (type != PRECHECKER) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type, "collection_getTickets"
|
||||
)
|
||||
binding.collectionSwipe.isRefreshing = false
|
||||
|
@ -399,7 +357,7 @@ class CollectionFragment(
|
|||
|
||||
(activity as MainActivity).messageWithSound(
|
||||
if (it.isError) it.errorMessage else "Baldas guardadas",
|
||||
it.isError
|
||||
it.isError,true
|
||||
)
|
||||
|
||||
})
|
||||
|
@ -407,14 +365,14 @@ class CollectionFragment(
|
|||
binding.splashProgress.visibility = GONE
|
||||
(activity as MainActivity).messageWithSound(
|
||||
if (it.isError) it.errorMessage else "Packing guardado",
|
||||
it.isError
|
||||
it.isError,!it.isError
|
||||
)
|
||||
if (!it.isError) {
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
@ -426,15 +384,15 @@ class CollectionFragment(
|
|||
|
||||
if (it.isError) {
|
||||
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, true)
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, true,true)
|
||||
} else {
|
||||
(activity as MainActivity).messageWithSound("Previa recogida", false)
|
||||
(activity as MainActivity).messageWithSound("Previa recogida", false,true)
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
@ -473,10 +431,10 @@ class CollectionFragment(
|
|||
salePerson = dataMessageSalix.personSale
|
||||
)
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type, "collection_getTickets"
|
||||
)
|
||||
|
||||
|
@ -519,24 +477,22 @@ class CollectionFragment(
|
|||
responseMissingTrash.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true)
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true)
|
||||
|
||||
} else {
|
||||
|
||||
missingTrashSuccesful()
|
||||
|
||||
|
||||
|
||||
} //sergio:esto ya estaba
|
||||
/* binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/
|
||||
viewModel.collectionTicketGet(user,password,collection.collectionFk,getData(SECTORFK))*/
|
||||
})
|
||||
|
||||
|
||||
responseIncQuantity.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true)
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true)
|
||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
|
@ -544,16 +500,14 @@ class CollectionFragment(
|
|||
} else {
|
||||
incresaseSuccesful()
|
||||
}
|
||||
//sergio:esto ya estaba
|
||||
/* binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/
|
||||
|
||||
})
|
||||
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
binding.splashProgress.visibility=GONE
|
||||
|
||||
if (it.isError) {
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage+"Usuario:"+workerFkFromTicket, isError = true)
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage+"Usuario:"+workerFkFromTicket, isError = true,true)
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -589,10 +543,10 @@ class CollectionFragment(
|
|||
.setKoButton("Revisar") {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
it.response,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
@ -664,7 +618,7 @@ class CollectionFragment(
|
|||
d("VERDNATURA:","la cantidad es " + quantity)*/
|
||||
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
token = getData(TOKEN),
|
||||
workerId = salePerson,
|
||||
message = message, "sendChekingPresence"
|
||||
)
|
||||
|
@ -673,7 +627,7 @@ class CollectionFragment(
|
|||
//CREATE LIST
|
||||
private fun createCollectionList() {
|
||||
state = 0
|
||||
if (type == SACADOR && voz != "NO") {
|
||||
if (type == SACADOR && getData(VOZ) != "NO") {
|
||||
// initialize()
|
||||
speak("Colección cargada, diga listo para empezar.")
|
||||
}
|
||||
|
@ -775,7 +729,8 @@ class CollectionFragment(
|
|||
if (binding.splashProgress != null) binding.splashProgress.visibility =
|
||||
View.VISIBLE
|
||||
mistakeSale = sale
|
||||
viewModel.mistakeType(usuario = user, password = password)
|
||||
viewModel.mistakeType(usuario = getData(USER),
|
||||
getData(PASSWORD))
|
||||
}
|
||||
}
|
||||
}, object : onPackingClickListener {
|
||||
|
@ -841,8 +796,8 @@ class CollectionFragment(
|
|||
// if (saleVO.ticketFk == txtscan ) {
|
||||
isOk = true
|
||||
viewModel.saleTracking_add(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
txtscan,
|
||||
"saleTracking_add"
|
||||
)
|
||||
|
@ -897,8 +852,8 @@ class CollectionFragment(
|
|||
if (txtscan.contains("-")) {
|
||||
if (tickets.size > 0) {
|
||||
viewModel.parking(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = tickets[0],
|
||||
parking = txtscan,
|
||||
"shelvingPark"
|
||||
|
@ -941,8 +896,8 @@ class CollectionFragment(
|
|||
if (txtscan.contains("-")) {
|
||||
if (tickets.size > 0) {
|
||||
viewModel.parking(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = tickets[0],
|
||||
parking = txtscan,
|
||||
"shelvingPark"
|
||||
|
@ -958,18 +913,18 @@ class CollectionFragment(
|
|||
// if (type != PRECHECKER) {
|
||||
isMarking = false
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
txtscan,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
||||
if (type.equals(CONTROLADOR)) {
|
||||
viewModel.ticket_checkFullyControlled(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
txtscan,
|
||||
"ticket_checkFullyControlled"
|
||||
)
|
||||
|
@ -1026,8 +981,8 @@ class CollectionFragment(
|
|||
if (txtscan.contains("-")) {
|
||||
tickets.forEach {
|
||||
viewModel.parking(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = it,
|
||||
parking = txtscan,
|
||||
"shelvingPark"
|
||||
|
@ -1067,17 +1022,17 @@ class CollectionFragment(
|
|||
saleAdapter!!.notifyDataSetChanged()
|
||||
setListPosition(position, false)
|
||||
|
||||
if (type != PRECHECKER) {
|
||||
/* if (type != PRECHECKER) {
|
||||
saleTrackingReplace(position, newType)
|
||||
isMarking = true
|
||||
}
|
||||
|
||||
// sergio: a borrar. Solo para hacer pruebas
|
||||
if (type == PRECHECKER) {
|
||||
*/
|
||||
// sergio
|
||||
/* if (type == PRECHECKER) {
|
||||
saleTrackingReplace(position, newType)
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
saleTrackingReplace(position, newType)
|
||||
setTotalLines()
|
||||
}
|
||||
|
||||
|
@ -1104,8 +1059,8 @@ class CollectionFragment(
|
|||
//////Log.i("VERDNATURA:","POSICION $position y el tipo $type")
|
||||
//////Log.i("VERDNATURA:","El buyfk que no es real es $originalItemScan")
|
||||
viewModel.saleTrackingReplace(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
saleFk = sales[position].saleFk,
|
||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR ) sales[position].isControlled else if (type=="PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity,
|
||||
|
@ -1128,8 +1083,8 @@ class CollectionFragment(
|
|||
setListPosition(position, false)
|
||||
if (type != PRECHECKER) {
|
||||
viewModel.saleTrackingDel(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
saleFk = sales[position].saleFk,
|
||||
"saleTracking_del"
|
||||
)
|
||||
|
@ -1158,8 +1113,8 @@ class CollectionFragment(
|
|||
}
|
||||
//Log.i("VERDNATURA:","Aparece para enviar")
|
||||
viewModel.itemPlacementSupplyAiming(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemFk = sales[position].itemFk,
|
||||
quantity = quantityGet,
|
||||
shelvingFk = sales[position].placements[shelvingPosition].shelving,
|
||||
|
@ -1220,9 +1175,8 @@ class CollectionFragment(
|
|||
itemShelvingFkStored = itemShelvingFk
|
||||
if (binding.splashProgress != null) binding.splashProgress.visibility =
|
||||
View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
viewModel.getIdFromCode(usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
|
@ -1291,8 +1245,8 @@ class CollectionFragment(
|
|||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
|
@ -1355,10 +1309,10 @@ class CollectionFragment(
|
|||
// SalesSorter()
|
||||
// Log.i("VERDNATURA::","Lanzamos collection para que refresque adaptador y ordene")
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
@ -1405,8 +1359,8 @@ class CollectionFragment(
|
|||
}
|
||||
|
||||
viewModel.itemShelvingSaleSupplyAdd(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
saleFk = sales[storedPosition].saleFk,
|
||||
quantity = if (quantity != "0") quantity else customDialogList.getValue(),
|
||||
|
@ -1443,15 +1397,15 @@ class CollectionFragment(
|
|||
//OPTIONS
|
||||
private fun print() {
|
||||
viewModel.collectionStickerPrint(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collectionFk = collection.collectionFk,
|
||||
sectorFk = sectorFk,
|
||||
sectorFk = getData(SECTORFK),
|
||||
"collectionStickerPrint"
|
||||
)
|
||||
|
||||
|
||||
(getString(R.string.Imprimiendo) + " por " + SectorDescription).toast(requireContext())
|
||||
(getString(R.string.Imprimiendo) + " por " + getData(SECTORDESCRIP)).toast(requireContext())
|
||||
}
|
||||
|
||||
private fun addItem() {
|
||||
|
@ -1485,12 +1439,12 @@ class CollectionFragment(
|
|||
)
|
||||
|
||||
viewModel.collectionAddItem(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemFk = customDialogList.getValue(),
|
||||
ticketFk = ticketSelected,
|
||||
quantityFk = customDialogList.getValueTwo(),
|
||||
warehouseFk = warehouseFk,
|
||||
warehouseFk = getData(WAREHOUSEFK),
|
||||
callFunction = "collection_addItem"
|
||||
)
|
||||
|
||||
|
@ -1540,12 +1494,12 @@ class CollectionFragment(
|
|||
)
|
||||
|
||||
viewModel.collectionAddItem(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemFk = customDialogList.getValue(),
|
||||
ticketFk = ticketSelected,
|
||||
quantityFk = customDialogList.getValueTwo(),
|
||||
warehouseFk = warehouseFk,
|
||||
warehouseFk = getData(WAREHOUSEFK),
|
||||
callFunction = "collection_addItem"
|
||||
)
|
||||
scanRequest()
|
||||
|
@ -1672,14 +1626,15 @@ class CollectionFragment(
|
|||
|
||||
//showBottomNavigation(View.VISIBLE)
|
||||
//sergio: se quita porque se realiza desde triggers
|
||||
//changeTicketState()
|
||||
|
||||
changeTicketState()
|
||||
}
|
||||
}
|
||||
|
||||
private fun ticketCollection_setUsedShelves() {
|
||||
|
||||
|
||||
if (type.equals("CHECKER") && (isMarking && SectorDescription.uppercase() != "ALGEMESI V")
|
||||
if (type.equals("CHECKER") && (isMarking && getData(SECTORDESCRIP).uppercase() != "ALGEMESI V")
|
||||
) {
|
||||
|
||||
|
||||
|
@ -1690,8 +1645,8 @@ class CollectionFragment(
|
|||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.ticketCollection_setUsedShelves(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = collection.collectionFk,
|
||||
usedShelves = customDialogInput.getValue(),
|
||||
"ticketCollection_setUsedShelves"
|
||||
|
@ -1722,8 +1677,8 @@ class CollectionFragment(
|
|||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.ticketCollection_setUsedShelves(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = collection.collectionFk,
|
||||
usedShelves = customDialogInput.getValue(),
|
||||
"ticketCollection_setUsedShelves"
|
||||
|
@ -1756,8 +1711,8 @@ class CollectionFragment(
|
|||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.item_updatePackingShelve(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
vSelf = itemFk,
|
||||
vPacking = customDialogInput.getValue(),
|
||||
"item_updatePackingShelve"
|
||||
|
@ -1788,8 +1743,8 @@ class CollectionFragment(
|
|||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.ticketCollection_setUsedShelves(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = collection.collectionFk,
|
||||
usedShelves = customDialogInput.getValue(),
|
||||
"ticketCollection_setUsedShelves"
|
||||
|
@ -1889,8 +1844,8 @@ class CollectionFragment(
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.saleMove(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
saleFk = sales[position].saleFk,
|
||||
quantity = totalQuantity.toString(),
|
||||
originalQuantity = sales[position].quantity,
|
||||
|
@ -1910,7 +1865,7 @@ class CollectionFragment(
|
|||
val message =
|
||||
"Se ha enviado a Split el articulo " + sales[position].itemFk + " del ticket " + ticket
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
token = getData(TOKEN),
|
||||
workerId = sales[position].salePersonFk,
|
||||
message = message, "sendChekingPresence"
|
||||
)
|
||||
|
@ -1933,11 +1888,11 @@ class CollectionFragment(
|
|||
}
|
||||
|
||||
viewModel.collectionMissingTrash(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
saleFk = sales[position].saleFk,
|
||||
quantity = totalQuantity.toString(),
|
||||
warehouseFk = warehouseFk,
|
||||
warehouseFk = getData(WAREHOUSEFK),
|
||||
type = typeCollectionTrashMissingReject,
|
||||
originalQuantity = quantity,
|
||||
callFunction = "collectionMissingTrash"
|
||||
|
@ -2101,10 +2056,10 @@ class CollectionFragment(
|
|||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
@ -2147,7 +2102,7 @@ class CollectionFragment(
|
|||
private fun sendSalixMessageNew(message: String, workerId: String) {
|
||||
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
token = getData(TOKEN),
|
||||
workerId = workerId,
|
||||
message = message,
|
||||
"sendChekingPresence"
|
||||
|
@ -2159,8 +2114,8 @@ class CollectionFragment(
|
|||
quantityIncrease = quantity
|
||||
|
||||
viewModel.collectionIncreaseQuantity(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
saleFk = sales[position].saleFk,
|
||||
quantity = quantity, "collection_increaseQuantity"
|
||||
)
|
||||
|
@ -2169,35 +2124,37 @@ class CollectionFragment(
|
|||
}
|
||||
|
||||
//ESTADOS
|
||||
/* private fun changeTicketState() {
|
||||
private fun changeTicketState() {
|
||||
if (type == CONTROLADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.collectionUpdateState(
|
||||
usuario = user,
|
||||
password = password,
|
||||
collectionFk = it,
|
||||
state = CHECKED,"collection_updateState"
|
||||
viewModel.ticket_setState(
|
||||
usuario=getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
ticketFk = it,
|
||||
state = "CHECKED",
|
||||
callFunction = "ticket_setState"
|
||||
)
|
||||
}
|
||||
} else if (type == SACADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.collectionUpdateState(
|
||||
usuario = user,
|
||||
password = password,
|
||||
collectionFk = it,
|
||||
state = PREPARED,"collection_updateState"
|
||||
viewModel.ticket_setState(
|
||||
usuario=getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
ticketFk = it,
|
||||
state = "PREPARED",
|
||||
callFunction = "ticket_setState"
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private fun changeInitTicketState() {
|
||||
/* private fun changeInitTicketState() {
|
||||
if (type == CONTROLADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.collectionUpdateState(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collectionFk = it,
|
||||
state = ON_CHECKING, "collection_updateState"
|
||||
)
|
||||
|
@ -2205,14 +2162,14 @@ class CollectionFragment(
|
|||
} else if (type == SACADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.collectionUpdateState(
|
||||
usuario = user,
|
||||
password = password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collectionFk = it,
|
||||
state = ON_PREPARATION, "collection_updateState"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//OTROS
|
||||
private fun showScanner(index: Int, sale: SaleVO) {
|
||||
|
@ -2275,9 +2232,8 @@ class CollectionFragment(
|
|||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||
list.forEach {
|
||||
if (it.description == item.code) {
|
||||
viewModel.saleMistakeAdd(
|
||||
usuario = user,
|
||||
password = password,
|
||||
viewModel.saleMistakeAdd(usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
vSaleFk = mistakeSale?.saleFk!!,
|
||||
vUserFk = mistakeSale?.workerFk!!,
|
||||
vTypeFk = it.id, "saleMistake_Add"
|
||||
|
|
|
@ -635,17 +635,17 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
})
|
||||
}
|
||||
|
||||
fun collectionUpdateState(
|
||||
fun ticket_setState(
|
||||
usuario: String,
|
||||
password: String,
|
||||
collectionFk: String,
|
||||
ticketFk: String,
|
||||
state: String,callFunction:String
|
||||
)
|
||||
{
|
||||
getSacadorControladorUserCase.collectionUpdateState(usuario, password, collectionFk, state)
|
||||
.enqueue(object : Callback<String>
|
||||
getSacadorControladorUserCase.ticket_setState(usuario, password, ticketFk, state)
|
||||
.enqueue(object : Callback<Unit>
|
||||
{
|
||||
override fun onFailure(call: Call<String>, t: Throwable)
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable)
|
||||
{
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -653,9 +653,9 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<String>, response: Response<String>)
|
||||
override fun onResponse(call: Call<Unit>, response: Response<Unit>)
|
||||
{
|
||||
if (response.body() == null)
|
||||
if (!response.isSuccessful)
|
||||
{
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -664,7 +664,7 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
} else
|
||||
{
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
ResponseItemVO(isError = false, response = "Cambiado estado")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -725,6 +725,15 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
|
||||
override fun onResponse(call: Call<String>, response: Response<String>)
|
||||
{
|
||||
|
||||
/* if (response.isSuccessful){
|
||||
_responseIncQuantity.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
}else{
|
||||
_responseIncQuantity.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
}*/
|
||||
if (response.body() == null)
|
||||
{
|
||||
_responseIncQuantity.value = ResponseItemVO(
|
||||
|
@ -754,8 +763,8 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
{
|
||||
_responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error en la llamada $calledFunction al enviar mensaje rocket." + getMessageFromResponse(
|
||||
response.message()
|
||||
errorMessage = "Error en la llamada $calledFunction al enviar mensaje rocket." + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
//Log.i("Salix","Mensaje enviado a salix")
|
||||
}
|
||||
|
@ -764,7 +773,11 @@ class CollectionViewModel(context: Context) : BaseViewModel()
|
|||
|
||||
override fun onFailure(call: Call<Boolean>, t: Throwable)
|
||||
{
|
||||
|
||||
/*_responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error en la llamada $calledFunction al enviar mensaje rocket." + getMessageFromAllResponse(
|
||||
nameofFunction(this),t.message!!))
|
||||
*/
|
||||
//Log.i("Salix Error",""+t.message)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
@ -15,34 +14,21 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentCollectionBinding
|
||||
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
||||
import es.verdnatura.domain.ConstAndValues.PRECHECKER
|
||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.VERTICKET
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.collection.adapter.SaleAdapter
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
|
||||
class CollectionShowTicketFragment(
|
||||
var collection: CollectionVO = CollectionVO(),
|
||||
var type: String = VERTICKET
|
||||
var type: String = ""
|
||||
) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var SectorDescription = ""
|
||||
private var token = ""
|
||||
private var voz = ""
|
||||
private var sales: List<SaleVO> = listOf()
|
||||
private var saleAdapter: SaleAdapter? = null
|
||||
private var lm: LinearLayoutManager? = null
|
||||
|
@ -65,20 +51,12 @@ class CollectionShowTicketFragment(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
token = prefs.getString(TOKEN, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
voz = prefs.getString(VOZ, "NO").toString()
|
||||
SectorDescription = prefs.getString(SECTORDESCRIP, "Sin Sector").toString()
|
||||
if (collection.tickets.isEmpty()) {
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type,
|
||||
"collection_getTickets"
|
||||
)
|
||||
|
@ -104,13 +82,6 @@ class CollectionShowTicketFragment(
|
|||
|
||||
private fun setToolBarIcon() {
|
||||
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
||||
|
||||
|
||||
/*val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
val iconPrint: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_print_black_24dp, resources.newTheme())
|
||||
listIcons.add(iconPrint)
|
||||
*/
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconPrint = ImageView(context)
|
||||
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
||||
|
@ -135,14 +106,14 @@ class CollectionShowTicketFragment(
|
|||
|
||||
private fun print() {
|
||||
viewModel.collectionStickerPrint(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
collectionFk = collection.collectionFk,
|
||||
sectorFk = sectorFk,
|
||||
sectorFk = getData(SECTORFK),
|
||||
"collectionStickerPrint"
|
||||
)
|
||||
|
||||
(getString(R.string.Imprimiendo) + " por " + SectorDescription).toast(requireContext())
|
||||
(getString(R.string.Imprimiendo) + " por " + getData(SECTORDESCRIP)).toast(requireContext())
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
@ -156,10 +127,10 @@ class CollectionShowTicketFragment(
|
|||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
binding.scanInput.text.toString(),
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type, "collection_getTickets"
|
||||
)
|
||||
|
||||
|
@ -181,10 +152,10 @@ class CollectionShowTicketFragment(
|
|||
binding.collectionSwipe.isRefreshing = false
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk,
|
||||
sectorFk,
|
||||
getData(SECTORFK),
|
||||
type, "collection_getTickets"
|
||||
)
|
||||
binding.collectionSwipe.isRefreshing = false
|
||||
|
@ -215,11 +186,9 @@ class CollectionShowTicketFragment(
|
|||
binding.mainToolbar.toolbarSubtitle.text = "0/0"
|
||||
}
|
||||
} else {
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
if (activity != null) requireActivity().onBackPressed()
|
||||
}.show()
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage,it.isError,false)
|
||||
if (activity != null) requireActivity().onBackPressed()
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
|
|
@ -1,40 +1,25 @@
|
|||
package es.verdnatura.presentation.view.feature.controlador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentControladorBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
|
||||
/*
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
*/
|
||||
|
||||
class ControladorFragment :
|
||||
BaseFragment<FragmentControladorBinding, ControladorViewModel>(ControladorViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_controlador
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var type = ""
|
||||
|
||||
companion object {
|
||||
fun newInstance() = ControladorFragment()
|
||||
|
@ -61,18 +46,6 @@ class ControladorFragment :
|
|||
}
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 60).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
type = ConstAndValues.CONTROLADOR
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
|
@ -87,23 +60,17 @@ class ControladorFragment :
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
|
||||
//sergio: para ver si ha marcado dos veces el mismo ticket
|
||||
if (binding.scanInput.text!!.length > 13) {
|
||||
|
||||
var size = binding.scanInput.text!!.length
|
||||
if (binding.scanInput.text!!.substring((size / 2), size).equals(binding.scanInput.text!!.substring( 0,size / 2))){
|
||||
binding.scanInput.setText(binding.scanInput.text!!.substring(0, size / 2))
|
||||
}
|
||||
}
|
||||
//sergio: para ver si ha marcado dos veces el mismo ticket. El laser falla
|
||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
usuario = user,
|
||||
password = password,
|
||||
sectorFk = sectorFk,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
sectorFk = getData(SECTORFK),
|
||||
collectionFk = binding.scanInput.text.toString(),
|
||||
type = type, callFunction = "collection_getTickets"
|
||||
type = ConstAndValues.CONTROLADOR, callFunction = "collection_getTickets"
|
||||
)
|
||||
// viewModel.ticket_checkControlled(user,password,scan_input.text.toString())
|
||||
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.scanInput)
|
||||
|
@ -134,7 +101,6 @@ class ControladorFragment :
|
|||
}
|
||||
|
||||
private fun navigateToCollectionList(collection: CollectionVO) {
|
||||
////Log.i("VERDNATURA:","vamos a oncolecctionSelected ${collection.isError}")
|
||||
onCollectionSelectedListener?.onCollectionSelected(collection, ConstAndValues.CONTROLADOR)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package es.verdnatura.presentation.view.feature.controlador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -2,38 +2,20 @@ package es.verdnatura.presentation.view.feature.controlador.fragment
|
|||
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.webkit.WebChromeClient
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentWebBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import kotlinx.android.synthetic.main.fragment_web.**/
|
||||
|
||||
|
||||
class WebFragment(
|
||||
var entryPoint: String = ""
|
||||
) : BaseFragment<FragmentWebBinding, ControladorViewModel>(ControladorViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
override fun getLayoutId(): Int = R.layout.fragment_web
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var type = ""
|
||||
private var itemscaned = ""
|
||||
//private lateinit var webView: WebViewClient
|
||||
|
||||
companion object {
|
||||
fun newInstance(entryPoint: String) = WebFragment(entryPoint)
|
||||
|
@ -41,20 +23,17 @@ class WebFragment(
|
|||
|
||||
override fun init() {
|
||||
|
||||
// splash_progress.visibility = View.GONE
|
||||
|
||||
customDialog = CustomDialog(requireContext())
|
||||
setToolbar()
|
||||
//setEvents()
|
||||
setWeb()
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setWeb() {
|
||||
// webView = WebViewClient()
|
||||
|
||||
|
||||
binding.webView.setWebChromeClient (WebChromeClient())
|
||||
// webView.setWebViewClient (wvClient);
|
||||
|
||||
binding.webView.getSettings (). setJavaScriptEnabled (true)
|
||||
// sergio:deprecated
|
||||
//webView.getSettings (). setPluginState (WebSettings.PluginState.ON)
|
||||
|
@ -76,12 +55,6 @@ class WebFragment(
|
|||
openURL.data = Uri.parse("https://salix.verdnatura.es/#!/item/index")
|
||||
startActivity(openURL)
|
||||
|
||||
//webView.loadUrl("http://www.google.com")
|
||||
//webView.loadUrl("https://test-salix.verdnatura.es/#!/ticket/3271614/tracking/index")
|
||||
/* webView.loadUrl("https://test-salix.verdnatura.es/")
|
||||
webView.settings.javaScriptEnabled = true
|
||||
webView.settings.setSupportZoom(true)*/
|
||||
|
||||
}
|
||||
|
||||
private fun setToolbar() {
|
||||
|
@ -89,74 +62,8 @@ class WebFragment(
|
|||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
goBack = true
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
type = ConstAndValues.PRECHECKER
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
/* private fun setEvents() {
|
||||
|
||||
backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
scan_input.requestFocus()
|
||||
scan_input.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
goBack = false;
|
||||
if (!scan_input.text.isNullOrEmpty()) {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
viewModel.qr_getCall(user, password, scan_input.text.toString())
|
||||
itemscaned = scan_input.text.toString()
|
||||
}
|
||||
|
||||
}
|
||||
scan_input.setText("")
|
||||
(activity as MainActivity).hideKeyboard(scan_input)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}*/
|
||||
|
||||
/*
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
//splash_progress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
|
||||
// getMessageFromJSON(it.errorMessage)
|
||||
customDialog.setTitle("Error").setDescription( it.errorMessage+ " "+itemscaned)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
|
||||
customDialog.setTitle("Mensaje")
|
||||
.setDescription("Operación " + itemscaned + ". " + it.response)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
binding.mainToolbar.backButton.performClick()
|
||||
}.show()
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.View.*
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
@ -14,28 +11,16 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
|
||||
/*import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.binding.scanInput
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_login.*
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
@ -45,18 +30,11 @@ class ControlVehiculoFragment(
|
|||
ControlVehiculoViewModel::class
|
||||
) {
|
||||
|
||||
private var user = ""
|
||||
private var userFk = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_vehiclecontrol
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var isWorkedTimed = "UNREGISTERED"
|
||||
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||
|
||||
|
@ -72,7 +50,6 @@ class ControlVehiculoFragment(
|
|||
override fun init() {
|
||||
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
goBack = false
|
||||
|
@ -108,11 +85,6 @@ class ControlVehiculoFragment(
|
|||
binding.mainToolbar.toolbarTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13F)
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
/* val iconHistory: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_history_black_24dp, resources.newTheme())
|
||||
val iconVehicleIn: Drawable = resources.getDrawable(R.drawable.car, resources.newTheme())
|
||||
val iconVehicleOut: Drawable =
|
||||
resources.getDrawable(R.drawable.car_off, resources.newTheme())*/
|
||||
val iconHistory = ImageView(context)
|
||||
iconHistory.setImageResource(R.drawable.ic_history_black_24dp)
|
||||
val iconVehicleIn = ImageView(context)
|
||||
|
@ -129,9 +101,25 @@ class ControlVehiculoFragment(
|
|||
|
||||
}
|
||||
|
||||
when (direction){
|
||||
"OUT"-> {
|
||||
listIcons.remove(iconVehicleIn)
|
||||
listIcons.add(iconVehicleOut)
|
||||
listIcons.add(iconHistory)
|
||||
}
|
||||
"IN"->{
|
||||
listIcons.remove(iconVehicleOut)
|
||||
listIcons.add(iconVehicleIn)
|
||||
listIcons.add(iconHistory)
|
||||
}
|
||||
"OUT"->{
|
||||
listIcons.remove(iconVehicleOut)
|
||||
listIcons.remove(iconVehicleIn)
|
||||
listIcons.add(iconHistory)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (direction.equals("OUT")) {
|
||||
/* if (direction.equals("OUT")) {
|
||||
listIcons.remove(iconVehicleIn)
|
||||
listIcons.add(iconVehicleOut)
|
||||
listIcons.add(iconHistory)
|
||||
|
@ -145,7 +133,7 @@ class ControlVehiculoFragment(
|
|||
listIcons.remove(iconVehicleOut)
|
||||
listIcons.remove(iconVehicleIn)
|
||||
listIcons.add(iconHistory)
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
|
@ -156,17 +144,6 @@ class ControlVehiculoFragment(
|
|||
iconVehicleIn.drawable-> showScanner("Escanea matrícula del vehículo", "IN")
|
||||
iconVehicleOut.drawable-> showScanner("Escanea matrícula para dejar vehículo", "OUT")
|
||||
}
|
||||
/* if (item == iconHistory.drawable) {
|
||||
showScanner("Escanea matrícula para ver histórico", "HISTORY")
|
||||
}
|
||||
|
||||
if (item == iconVehicleIn.drawable) {
|
||||
showScanner("Escanea matrícula del vehículo", "IN")
|
||||
}
|
||||
if (item == iconVehicleOut.drawable) {
|
||||
showScanner("Escanea matrícula para dejar vehículo", "OUT")
|
||||
}*/
|
||||
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
|
@ -197,8 +174,7 @@ class ControlVehiculoFragment(
|
|||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
// //Log.i("VERDNATURA:", "El valor es ${customDialogInput.getValue()}")
|
||||
// "$description ${customDialogInput.getValue()} OK".toast(requireContext())
|
||||
|
||||
insertControlTimeVehicle(customDialogInput.getValue(), action)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
|
@ -216,7 +192,7 @@ class ControlVehiculoFragment(
|
|||
|
||||
if (!goBack) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.workerMachinery_isRegistered(user, password,"workerMachinery_isRegistered")
|
||||
viewModel.workerMachinery_isRegistered(getData(USER),getData(PASSWORD),"workerMachinery_isRegistered")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,10 +205,10 @@ class ControlVehiculoFragment(
|
|||
)
|
||||
} else if (direction.equals("IN")) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.machineWorker_add(user, password, plateNumber,"machineWorker_add")
|
||||
viewModel.machineWorker_add(getData(USER),getData(PASSWORD), plateNumber,"machineWorker_add")
|
||||
|
||||
} else if (direction.equals("OUT")) {
|
||||
viewModel.machineWorker_update(user, password, plateNumber,"machineWorker_update")
|
||||
viewModel.machineWorker_update(getData(USER),getData(PASSWORD), plateNumber,"machineWorker_update")
|
||||
|
||||
} else if (direction.equals("")) {
|
||||
(activity as MainActivity).openFragmentPickers()
|
||||
|
@ -254,15 +230,6 @@ class ControlVehiculoFragment(
|
|||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
|
@ -358,10 +325,6 @@ class ControlVehiculoFragment(
|
|||
with(viewModel) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
responseinsert.observe(viewLifecycleOwner, Observer {
|
||||
Log.i(
|
||||
"VERDNATURA",
|
||||
"Respuesta call vehicle_insert en el viewmodel es : ${it.response}"
|
||||
)
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
|
|
|
@ -1,20 +1,13 @@
|
|||
package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.View.*
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.loadUrl
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_vehiclecontrol_user.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class ControlVehiculoUsuarioFragment(
|
||||
var vUserFK: String = ""
|
||||
|
@ -22,14 +15,8 @@ class ControlVehiculoUsuarioFragment(
|
|||
ControlVehiculoViewModel::class
|
||||
) {
|
||||
|
||||
private var user = ""
|
||||
private var userFk = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var token = ""
|
||||
private var goBack: Boolean = false
|
||||
private var android_id: String = ""
|
||||
override fun getLayoutId(): Int = R.layout.fragment_vehiclecontrol_user
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
||||
|
@ -44,7 +31,6 @@ class ControlVehiculoUsuarioFragment(
|
|||
binding.splashProgress.visibility = GONE
|
||||
setEvents()
|
||||
setControlVehicleUser()
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -54,19 +40,15 @@ class ControlVehiculoUsuarioFragment(
|
|||
}
|
||||
|
||||
private fun setControlVehicleUser() {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
token = prefs.getString(TOKEN, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
android_id = getANDROIDID()
|
||||
|
||||
userFk=getData(USERFK)
|
||||
|
||||
if (userFk.equals(vUserFK)) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.machine_getWorkerPlate(user, password,"machine_getWorkerPlate")
|
||||
viewModel.deviceProduction_getnameDevice(user, password, android_id,"deviceProduction_getnameDevice")
|
||||
viewModel.deviceProductionUser_getWorker(user, password, android_id,"deviceProductionUser_getWorker")
|
||||
viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD),"machine_getWorkerPlate")
|
||||
viewModel.deviceProduction_getnameDevice(getData(USER),getData(PASSWORD), getData(ANDROID_ID),"deviceProduction_getnameDevice")
|
||||
viewModel.deviceProductionUser_getWorker(getData(USER),getData(PASSWORD), getData(ANDROID_ID),"deviceProductionUser_getWorker")
|
||||
|
||||
} else {
|
||||
userFk = vUserFK
|
||||
|
@ -76,27 +58,17 @@ class ControlVehiculoUsuarioFragment(
|
|||
binding.userInformation.setOnClickListener({binding.mainToolbar.backButton.performClick()})
|
||||
|
||||
}
|
||||
binding.userImage.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=$token")
|
||||
viewModel.machine_getWorkerPlate(user, password,"machine_getWorkerPlate")
|
||||
binding.nameVehiclecontrol.text = user
|
||||
binding.userImage.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=${getData(TOKEN)}")
|
||||
viewModel.machine_getWorkerPlate(getData(USER),getData(PASSWORD),"machine_getWorkerPlate")
|
||||
binding.nameVehiclecontrol.text = getData(USER)
|
||||
binding.registeredVehiclecontrol.text = ""
|
||||
binding.deviceName.text = ""
|
||||
binding.assignedDevicename.text = ""
|
||||
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
@ -104,39 +76,6 @@ class ControlVehiculoUsuarioFragment(
|
|||
|
||||
}
|
||||
|
||||
private fun setDialog(){
|
||||
/* user_image.setOnClickListener({backButton.performClick()})
|
||||
val builder = AlertDialog.Builder(requireContext())
|
||||
val inflater = layoutInflater
|
||||
val view: View = inflater.inflate(R.layout.item_worker_image, null)
|
||||
builder.setView(view)
|
||||
val imgView: ImageView = view.findViewById(R.id.workerimage) as ImageView
|
||||
imgView.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=$token")
|
||||
|
||||
val dialog = builder.create()
|
||||
dialog.show()
|
||||
|
||||
*/
|
||||
/* val image = ImageView(requireContext())
|
||||
image.setImageResource(R.drawable.barcode_scan)
|
||||
|
||||
image.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=$token")
|
||||
|
||||
val builderr: AlertDialog.Builder =
|
||||
AlertDialog.Builder(requireContext(),R.style.DialogTheme)
|
||||
.setMessage("Sacador:")
|
||||
.setPositiveButton("Cerrar") { dialogInterface: DialogInterface, i: Int ->
|
||||
fun onClick(dialog: DialogInterface, which: Int) {
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
.setView(image)
|
||||
builderr.create().show()
|
||||
|
||||
// image.setOnClickListener { builderr.dismiss() }*/
|
||||
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
|
@ -159,7 +98,6 @@ private fun setDialog(){
|
|||
|
||||
} else {
|
||||
|
||||
// Log.i("VERDNATURA::", "valor devuelto ${it.response}")
|
||||
|
||||
if (it.type.equals("getnameDevice")) {
|
||||
binding.deviceName.text = it.response
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetVehicleControlTimeUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemMachineControl
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.diadeventa.fragment
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
|
@ -10,7 +9,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemdayofsaleCardBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -18,28 +16,14 @@ import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
|||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.adapter.DayOfSaleAdapter
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||
import kotlinx.android.synthetic.main.fragment_historicovehiculo.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.edit_itemFk
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_itemexpeditionstate_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_itemshelvingdayofsale.*
|
||||
import kotlinx.android.synthetic.main.fragment_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class DayOfSaleFragment(
|
||||
var entryPoint: String = ""
|
||||
) : BaseFragment<FragmentItemdayofsaleCardBinding, DayOfSaleViewModel>(DayOfSaleViewModel::class) {
|
||||
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter: DayOfSaleAdapter? = null
|
||||
private var itemScan = ""
|
||||
|
||||
|
@ -116,12 +100,8 @@ class DayOfSaleFragment(
|
|||
|
||||
|
||||
private fun getItemsSaleDate(vShelvingFK: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelving_getSaleDate(user, password,vShelvingFK,"itemShelving_getSaleDate")
|
||||
viewModel.itemShelving_getSaleDate(getData(USER), getData(PASSWORD),vShelvingFK,"itemShelving_getSaleDate")
|
||||
|
||||
}
|
||||
|
||||
|
@ -146,11 +126,12 @@ class DayOfSaleFragment(
|
|||
}else{
|
||||
|
||||
if (it.list.get(0).isError){
|
||||
customDialog.setTitle("Error")
|
||||
(activity as MainActivity).messageWithSound(it.list.get(0).errorMessage,it.list.get(0).isError,isPlayed = false)
|
||||
/*customDialog.setTitle("Error")
|
||||
.setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton("Cerrar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}.show()*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,8 +192,8 @@ class DayOfSaleFragment(
|
|||
|
||||
fun parking(parking:String){
|
||||
viewModel.parking(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
parking = parking,
|
||||
scanItem = itemScan,
|
||||
callFunction="shelvingPark")
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.faltas.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
@ -12,25 +11,17 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentFaltasBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.feature.faltas.adapter.FaltasAdapter
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_faltas.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
|
||||
class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(FaltasViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter : FaltasAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private var listInvetory:ArrayList<ItemFaltasVO> = ArrayList()
|
||||
|
@ -52,12 +43,8 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
override fun getLayoutId(): Int = R.layout.fragment_faltas
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,60).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
viewModel.getFaltas(user,password,warehouseFk)
|
||||
|
||||
viewModel.getFaltas(getData(USER),getData(PASSWORD),getData(WAREHOUSEFK))
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
@ -74,7 +61,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
reload = false
|
||||
hideLoad = false
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getFaltas(user,password,warehouseFk)
|
||||
viewModel.getFaltas(getData(USER),getData(PASSWORD),getData(WAREHOUSEFK))
|
||||
}
|
||||
super.init()
|
||||
}
|
||||
|
@ -95,7 +82,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload.drawable){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getFaltas(user,password,warehouseFk)
|
||||
viewModel.getFaltas(getData(USER),getData(PASSWORD),getData(WAREHOUSEFK))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,7 +138,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
adapter = FaltasAdapter(listInvetory,object: OnFaltasNichoClickListener {
|
||||
override fun onFaltasNichoClickListener(item: ItemFaltasVO) {
|
||||
customDialogInput.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){
|
||||
viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0","temTrash")
|
||||
viewModel.itemStockUpdate(item.itemFk,getData(WAREHOUSEFK),getData(USER),getData(PASSWORD),customDialogInput.getValue(),"0","temTrash")
|
||||
changeOfflineValue(item)
|
||||
customDialogInput.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
|
@ -162,7 +149,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()){
|
||||
viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0","temTrash")
|
||||
viewModel.itemStockUpdate(item.itemFk,getData(WAREHOUSEFK),getData(USER),getData(PASSWORD),customDialogInput.getValue(),"0","temTrash")
|
||||
changeOfflineValue(item)
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
|
@ -176,7 +163,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
}
|
||||
},object: OnFaltasReviewClickListener{
|
||||
override fun onFaltasReviewClickListener(item: ItemFaltasVO) {
|
||||
viewModel.faultsReview_isChecked(user,password,item.itemFk,warehouseFk,"faultsReview_isChecked")
|
||||
viewModel.faultsReview_isChecked(getData(USER),getData(PASSWORD),item.itemFk,getData(WAREHOUSEFK),"faultsReview_isChecked")
|
||||
changeOfflineValue(item)
|
||||
}
|
||||
|
||||
|
@ -189,9 +176,10 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage,it.isError,false)
|
||||
/* customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}.show()*/
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import androidx.lifecycle.Transformations
|
|||
import es.verdnatura.domain.GetInventaryUserCase
|
||||
import es.verdnatura.domain.GetItemCardUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
|
|
@ -1,15 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.historicoarticulo.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_buscar_item.*
|
||||
import kotlinx.android.synthetic.main.fragment_historico.*
|
||||
import kotlinx.android.synthetic.main.fragment_historico. binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.fragment_inventary.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import java.text.SimpleDateFormat*/
|
||||
import android.content.SharedPreferences
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.graphics.Color.*
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
|
@ -22,8 +12,6 @@ import es.verdnatura.R
|
|||
import es.verdnatura.R.color.verdnatura_pumpkin_orange
|
||||
import es.verdnatura.R.color.verdnatura_white
|
||||
import es.verdnatura.databinding.FragmentHistoricoBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -33,7 +21,6 @@ import es.verdnatura.presentation.view.component.CustomDialogInput
|
|||
import es.verdnatura.presentation.view.feature.historicoarticulo.adapter.HistoricoAdapter
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoListVO
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
@ -44,11 +31,6 @@ class HistoricoArticuloFragment(
|
|||
) : BaseFragment<FragmentHistoricoBinding, HistoricoArticuloViewModel>(
|
||||
HistoricoArticuloViewModel::class
|
||||
) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter: HistoricoAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
@ -63,16 +45,12 @@ class HistoricoArticuloFragment(
|
|||
override fun getLayoutId(): Int = R.layout.fragment_historico
|
||||
|
||||
override fun init() {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
filter = "all"
|
||||
viewModel.itemDiary(user, password, itemFk, warehouseFk,"itemDiary")
|
||||
viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK),"itemDiary")
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
@ -80,35 +58,8 @@ class HistoricoArticuloFragment(
|
|||
super.init()
|
||||
}
|
||||
|
||||
fun generateColorStateList(
|
||||
uncheckedColor: Int = Color.WHITE,
|
||||
checkedColor: Int = verdnatura_pumpkin_orange
|
||||
|
||||
|
||||
): ColorStateList {
|
||||
val states = arrayOf(
|
||||
|
||||
intArrayOf(-android.R.attr.state_pressed),
|
||||
intArrayOf(android.R.attr.state_pressed)
|
||||
|
||||
)
|
||||
val colors = intArrayOf(
|
||||
|
||||
uncheckedColor,
|
||||
checkedColor
|
||||
|
||||
)
|
||||
return ColorStateList(states, colors)
|
||||
}
|
||||
|
||||
private fun setToolBar() {
|
||||
/* val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
val iconReload: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_transaction, resources.newTheme())
|
||||
val iconGargabe: Drawable =
|
||||
resources.getDrawable(R.drawable.alpha_b_circle_outline, resources.newTheme())
|
||||
val iconFault: Drawable =
|
||||
resources.getDrawable(R.drawable.alpha_f_circle_outline, resources.newTheme())*/
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconReload = ImageView(context)
|
||||
|
@ -140,29 +91,14 @@ class HistoricoArticuloFragment(
|
|||
item.setTint(getColor(context!!, verdnatura_pumpkin_orange))}
|
||||
iconFault.drawable->viewModelwithFilter("falta")
|
||||
}
|
||||
/* if (item == iconReload) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModelwithFilter("all")
|
||||
|
||||
}
|
||||
|
||||
if (item == iconGargabe) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModelwithFilter("contenedor")
|
||||
view?.performLongClick()
|
||||
|
||||
}
|
||||
if (item == iconFault) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModelwithFilter("falta")
|
||||
|
||||
}*/
|
||||
for (it in listIcons) {
|
||||
if (it != item) {
|
||||
it.drawable.setTint(getColor(context!!, verdnatura_white))
|
||||
}
|
||||
}
|
||||
item.setTint(getColor(context!!, verdnatura_pumpkin_orange))
|
||||
|
||||
view?.performLongClick()
|
||||
}
|
||||
|
||||
|
@ -175,7 +111,7 @@ class HistoricoArticuloFragment(
|
|||
private fun viewModelwithFilter(keyfilter: String) {
|
||||
filter = keyfilter
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemDiary(user, password, itemFk, warehouseFk,"itemDiary")
|
||||
viewModel.itemDiary(getData(USER), getData(PASSWORD), itemFk, getData(WAREHOUSEFK),"itemDiary")
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
|
|
@ -1,40 +1,24 @@
|
|||
package es.verdnatura.presentation.view.feature.historicoshelving.fragment
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemshelvinglogBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.adapter.ItemShelvingLogAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
/* import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||
import kotlinx.android.synthetic.main.fragment_historicovehiculo.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.binding.scanInput
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_itemexpeditionstate_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_itemshelvingdayofsale.*
|
||||
import kotlinx.android.synthetic.main.fragment_itemshelvinglog.*
|
||||
import kotlinx.android.synthetic.main.fragment_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
|
||||
class itemShelvingLogFragment(
|
||||
var entryPoint: String = ""
|
||||
// ) : BaseFragment<FragmentItemdayofsaleCardBinding, itemShelvingLogViewModel>(itemShelvingLogViewModel::class) {
|
||||
) : BaseFragment<FragmentItemshelvinglogBinding, itemShelvingLogViewModel>(itemShelvingLogViewModel::class) {
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter: ItemShelvingLogAdapter? = null
|
||||
private var itemScan = ""
|
||||
|
||||
|
@ -87,12 +71,8 @@ class itemShelvingLogFragment(
|
|||
|
||||
|
||||
private fun itemShelvingLog_get(vShelvingFK: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingLog_get(user, password,vShelvingFK,"itemShelvingLog_get")
|
||||
viewModel.itemShelvingLog_get(getData(USER), getData(PASSWORD),vShelvingFK,"itemShelvingLog_get")
|
||||
|
||||
}
|
||||
|
||||
|
@ -127,26 +107,7 @@ class itemShelvingLogFragment(
|
|||
|
||||
}
|
||||
})
|
||||
/* response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
||||
}else{
|
||||
|
||||
it.response.toast(requireContext())
|
||||
*//* customDialog.setTitle("Información").setDescription(it.response).setOkButton("Cerrar") {
|
||||
customDialog.dismiss()
|
||||
}.show()*//*
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentShelvinglogBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -15,27 +13,12 @@ import es.verdnatura.presentation.view.component.CustomDialogList
|
|||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.adapter.ShelvingLogAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||
import kotlinx.android.synthetic.main.fragment_historicovehiculo.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.binding.scanInput
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_itemexpeditionstate_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_itemshelvingdayofsale.*
|
||||
import kotlinx.android.synthetic.main.fragment_itemshelvinglog.*
|
||||
import kotlinx.android.synthetic.main.fragment_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class shelvingLogFragment(
|
||||
var entryPoint: String = ""
|
||||
// ) : BaseFragment<FragmentItemdayofsaleCardBinding, itemShelvingLogViewModel>(itemShelvingLogViewModel::class) {
|
||||
|
||||
) : BaseFragment<FragmentShelvinglogBinding, shelvingLogViewModel>(
|
||||
shelvingLogViewModel::class) {
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter: ShelvingLogAdapter? = null
|
||||
private var itemScan = ""
|
||||
|
||||
|
@ -91,12 +74,8 @@ class shelvingLogFragment(
|
|||
|
||||
|
||||
private fun shelvingLog_get(vShelvingFK: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.shelvingLog_get(user, password,vShelvingFK,"shelvingLog_get")
|
||||
viewModel.shelvingLog_get(getData(USER), getData(PASSWORD),vShelvingFK,"shelvingLog_get")
|
||||
|
||||
}
|
||||
|
||||
|
@ -131,25 +110,6 @@ class shelvingLogFragment(
|
|||
|
||||
}
|
||||
})
|
||||
/* response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
||||
}else{
|
||||
|
||||
it.response.toast(requireContext())
|
||||
customDialog.setTitle("Información").setDescription(it.response).setOkButton("Cerrar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
||||
}
|
||||
|
||||
|
||||
})*/
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
|
||||
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentHistoricovehiculoBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -16,9 +12,6 @@ import es.verdnatura.presentation.view.component.CustomDialogInput
|
|||
import es.verdnatura.presentation.view.feature.historicovehiculo.adapter.HistoricoVehiculoAdapter
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_historicovehiculo.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
@ -28,11 +21,6 @@ class HistoricoVehiculoFragment (
|
|||
) : BaseFragment<FragmentHistoricovehiculoBinding, HistoricoVehiculoViewModel>(
|
||||
HistoricoVehiculoViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var userFk = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter : HistoricoVehiculoAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
@ -47,17 +35,12 @@ class HistoricoVehiculoFragment (
|
|||
|
||||
override fun init()
|
||||
{
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
userFk=prefs.getString(USERFK,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
|
||||
viewModel.machineWorker_getHistorical(user,password,numberPlate,"machineWorker_getHistorical")
|
||||
viewModel.machineWorker_getHistorical(getData(USER),getData(PASSWORD),numberPlate,"machineWorker_getHistorical")
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclediary)
|
||||
setEvents()
|
||||
super.init()
|
||||
|
|
|
@ -20,26 +20,14 @@ import es.verdnatura.presentation.view.component.CustomDialog
|
|||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.InventoryAdapter
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
|
||||
import ir.mirrajabi.searchdialog.core.SearchResultListener
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||
import kotlinx.android.synthetic.main.fragment_ajustes.*
|
||||
import kotlinx.android.synthetic.main.fragment_buscar_item.location_recyclerview
|
||||
import kotlinx.android.synthetic.main.fragment_buscar_item.binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.fragment_inventary.*
|
||||
import kotlinx.android.synthetic.main.fragment_inventary.binding.filterItemFk
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewModel>(InventaryViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
|
||||
private var adapter : InventoryAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private var listInvetory:ArrayList<ItemInventaryVO> = ArrayList()
|
||||
|
@ -55,7 +43,6 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
|
||||
//sergio : cmbios para insertar lista compradores en inventary en el searchable
|
||||
private val items=ArrayList<SearchBuyerModel>()
|
||||
private var prefs: SharedPreferences? = null
|
||||
private lateinit var buyerId:String
|
||||
|
||||
|
||||
|
@ -71,25 +58,20 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
prefs = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs!!.getString(USER,"").toString()
|
||||
password = prefs!!.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs!!.getInt(SECTORFK,1).toString()
|
||||
warehouseFk = prefs!!.getInt(WAREHOUSEFK,1).toString()
|
||||
|
||||
//sergio. se quita para subir version.A la espera de como será el inventario
|
||||
viewModel.itemShelvingBuyerGet(user = user,password = password,"itemShelvingBuyerGet")
|
||||
viewModel.itemShelvingBuyerGet(user = getData(USER),password = getData(PASSWORD),"itemShelvingBuyerGet")
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
binding.filterBuyer.setText(prefs!!.getString(BUYER,""))
|
||||
binding.filterBuyer.setText(getData(BUYER))
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
buyerId=prefs!!.getString(BUYERID,"").toString()
|
||||
buyerId=getData(BUYERID)
|
||||
|
||||
viewModel.getInventory(user,password,buyerId,warehouseFk,"itemShelving_filterBuyer")
|
||||
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer")
|
||||
binding.filterBuyer.setOnClickListener{
|
||||
//SimpleSearchDialogCompat(context,getString(R.string.compradores),getString(R.string.escribirparteNombre),null,initData(),
|
||||
SimpleSearchDialogCompat(context,getString(R.string.compradores),getString(R.string.escribirparteNombre),null,items,
|
||||
|
@ -99,7 +81,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
saveBuyer(nombre.getBuyerNickname())
|
||||
saveBuyerId(nombre.getBuyerId())
|
||||
buyerId=nombre.getBuyerId()
|
||||
viewModel.getInventory(user,password,nombre.getBuyerId(),warehouseFk,"itemShelving_filterBuyer")
|
||||
viewModel.getInventory(getData(USER),getData(PASSWORD),nombre.getBuyerId(),getData(WAREHOUSEFK),"itemShelving_filterBuyer")
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
baseSearchDialogCompat.dismiss()
|
||||
}).show()
|
||||
|
@ -118,7 +100,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
reload = false
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
hideLoad = false
|
||||
viewModel.getInventory(user,password,buyerId,warehouseFk,"itemShelving_filterBuyer")
|
||||
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer")
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,7 +126,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
if (item == iconReload.drawable){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
||||
viewModel.getInventory(user,password,buyerId,warehouseFk,"itemShelving_filterBuyer")
|
||||
viewModel.getInventory(getData(USER),getData(PASSWORD),buyerId,getData(WAREHOUSEFK),"itemShelving_filterBuyer")
|
||||
|
||||
}
|
||||
|
||||
|
@ -232,7 +214,7 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
//sergio: cambiado customdialogInput pòr customdialog 6.1.4
|
||||
customDialog.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){
|
||||
//customDialogInput.setTitle(item.itemFk+"\n"+item.longName+" "+item.size).setDescription("Cantidad real("+item.nicho+")").setOkButton("Tirar"){
|
||||
viewModel.itemTrash(item.itemFk,warehouseFk,user,password,item.nicho,"0","itemTrash")
|
||||
viewModel.itemTrash(item.itemFk,getData(WAREHOUSEFK),getData(USER),getData(PASSWORD),item.nicho,"0","itemTrash")
|
||||
//viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,"0","0")
|
||||
// viewModel.itemStockUpdate(item.itemFk,warehouseFk,user,password,customDialogInput.getValue(),"0")
|
||||
changeOfflineValue(item)
|
||||
|
@ -301,7 +283,6 @@ class InventaryFragment : BaseFragment<FragmentInventaryBinding,InventaryViewMod
|
|||
if (!buyer.isError){
|
||||
try {
|
||||
items.add(SearchBuyerModel(buyer.nickname,buyer.userFk));
|
||||
////Log.i("VERDNATURA:","Nombre comprador ${buyer.nickname} : ${buyer.userFk}")
|
||||
}catch (e:Exception){}
|
||||
}
|
||||
}}
|
||||
|
|
|
@ -7,7 +7,6 @@ import androidx.lifecycle.Transformations
|
|||
import es.verdnatura.domain.GetInventaryUserCase
|
||||
import es.verdnatura.domain.GetItemCardUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
@ -16,7 +15,6 @@ import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
|||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.errorMessage
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.login.fragment
|
||||
|
||||
//import android.preference.PreferenceManager
|
||||
/*import kotlinx.android.synthetic.main.fragment_ajustes.*
|
||||
import kotlinx.android.synthetic.main.fragment_login.*
|
||||
import kotlinx.android.synthetic.main.fragment_login.binding.splashProgress*/
|
||||
import android.app.AlarmManager
|
||||
import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
|
@ -48,7 +44,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
viewModel.device_checkLogin(
|
||||
binding.edittextUsername.text.toString(),
|
||||
binding.edittextPassword.text.toString(),
|
||||
getANDROIDID(), callFunction = "device_checkLogin"
|
||||
getData(ANDROID_ID), callFunction = "device_checkLogin"
|
||||
)
|
||||
|
||||
})
|
||||
|
@ -193,7 +189,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
binding.edittextPassword.text.toString(),
|
||||
"warehouse",
|
||||
getInfoVersionNameApp(),
|
||||
getANDROIDID(), "deviceLog_add"
|
||||
getData(ANDROID_ID), "deviceLog_add"
|
||||
)
|
||||
|
||||
//saveUserFkPref(it)
|
||||
|
|
|
@ -77,15 +77,21 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
var mperror: MediaPlayer? = null
|
||||
var mpok: MediaPlayer? = null
|
||||
override fun getLayoutId(): Int = R.layout.activity_main
|
||||
|
||||
override fun init() {
|
||||
|
||||
mperror = MediaPlayer.create((this), R.raw.error)
|
||||
mpok = MediaPlayer.create((this), R.raw.ok)
|
||||
|
||||
|
||||
|
||||
customDialog = CustomDialogMainActivity(this)
|
||||
setBottomMenu()
|
||||
if (haveSector()) addFragment(
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (haveSector()) addFragment(
|
||||
PasilleroFragment.newInstance("Verdnatura"),
|
||||
R.id.main_frame_layout,
|
||||
PasilleroFragment.TAG,
|
||||
|
@ -104,12 +110,39 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
//navigationDrawer()
|
||||
|
||||
}
|
||||
private fun navigationDrawer(){
|
||||
|
||||
|
||||
val drawerLayout = binding.drawerLayout
|
||||
drawerLayout.open()
|
||||
|
||||
/* val toggle = ActionBarDrawerToggle(
|
||||
this,
|
||||
drawerLayout,
|
||||
toolbar,
|
||||
"abierto",
|
||||
"cerrado"
|
||||
)
|
||||
drawerLayout.addDrawerListener(toggle)
|
||||
toggle.syncState()*/
|
||||
|
||||
}
|
||||
/* private fun navigateToFragment(){
|
||||
val navHostFragment =
|
||||
supportFragmentManager.findFragmentById(R.id.main_frame_layout) as NavHostFragment
|
||||
val navController = navHostFragment.navController
|
||||
navController.navigate(R.id.action_pasilleroFragment_to_ajustesFragment)
|
||||
}
|
||||
*/
|
||||
private fun haveSector(): Boolean {
|
||||
val prefs: SharedPreferences = getSharedPreferences("es.verdnatura.user.prefs", 0)
|
||||
val sectorFk = prefs.getInt("sectorFk", -1)
|
||||
return sectorFk != -1
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun setBottomMenu() {
|
||||
|
@ -341,6 +374,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
"Ver Ticket" -> {
|
||||
|
||||
addFragmentOnTop(ShowTicketFragment.newInstance())
|
||||
}
|
||||
"Historial del vehículo" -> {
|
||||
|
@ -552,13 +586,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
binding.mainBottomNavigation.visibility = visible
|
||||
}
|
||||
|
||||
fun messageWithSound(message: String, isError: Boolean) {
|
||||
fun messageWithSound(message: String, isError: Boolean,isPlayed:Boolean?) {
|
||||
|
||||
if (!isError) {
|
||||
mpok?.start()
|
||||
message.toast(this, Toast.LENGTH_SHORT)
|
||||
} else {
|
||||
mperror?.start()
|
||||
|
||||
if (isPlayed == true)( mperror?.start())
|
||||
|
||||
customDialog.setTitle("Error").setDescription(message)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
|
@ -568,5 +604,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_pallet_detail.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionPalletDetailBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
@ -37,11 +31,6 @@ class ExpeditionPalletDetailFragment(
|
|||
) : BaseFragment<FragmentExpeditionPalletDetailBinding, ExpeditionPalletDetailViewModel>(
|
||||
ExpeditionPalletDetailViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var SectorDescription = ""
|
||||
private var adapter : ExpeditionPalletViewAdapter? = null
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private var onPalletClickListener:OnPalletClickListener? = null
|
||||
|
@ -61,18 +50,6 @@ class ExpeditionPalletDetailFragment(
|
|||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_expedition_pallet_detail
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
SectorDescription=prefs.getString(SECTORDESCRIP,"Sin Sector").toString()
|
||||
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
|
@ -84,7 +61,8 @@ class ExpeditionPalletDetailFragment(
|
|||
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View")
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemPallet!!.Pallet,"expeditionPallet_View")
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -116,17 +94,20 @@ class ExpeditionPalletDetailFragment(
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(user,password,itemPallet!!.Pallet,"expeditionPallet_View")
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemPallet!!.Pallet,"expeditionPallet_View")
|
||||
}else if(item == iconEditar){
|
||||
onPalletClickListener!!.onPalletClickListener(itemExpeditionTruckVO!!,itemPallet!!)
|
||||
}else if(item == iconBorrar){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPalletDel(user,password,itemPallet!!.Pallet,"expeditionPallet_Del")
|
||||
viewModel.expeditionPalletDel(getData(USER),
|
||||
getData(PASSWORD),itemPallet!!.Pallet,"expeditionPallet_Del")
|
||||
}else if(item == iconPrint){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
(getString(R.string.Imprimiendo)+" por " +SectorDescription).toast(requireContext())
|
||||
viewModel.expeditionPalletPrintSet(user,password,itemPallet!!.Pallet,sectorFk,"expeditionPallet_PrintSet")
|
||||
(getString(R.string.Imprimiendo)+" por " +getData(SECTORDESCRIP)).toast(requireContext())
|
||||
viewModel.expeditionPalletPrintSet(getData(USER),
|
||||
getData(PASSWORD),itemPallet!!.Pallet,getData(SECTORFK),"expeditionPallet_PrintSet")
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_pallet.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
|
@ -14,7 +11,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionPalletBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
|
@ -41,10 +37,7 @@ class ExpeditionPalletFragment(
|
|||
) : BaseFragment<FragmentExpeditionPalletBinding, ExpeditionPalletViewModel>(
|
||||
ExpeditionPalletViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
|
||||
private var adapter : ExpeditionPalletAdapter? = null
|
||||
private var onPalletClickListener: OnPalletClickListener? = null
|
||||
private var onComprobarPalletViewClickListener:OnComprobarPalletViewClickListener? = null
|
||||
|
@ -70,11 +63,6 @@ class ExpeditionPalletFragment(
|
|||
override fun getLayoutId(): Int = R.layout.fragment_expedition_pallet
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,60).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
@ -89,7 +77,8 @@ class ExpeditionPalletFragment(
|
|||
binding.mainToolbar.toolbarTitle.text = getCURDATE(itemExpeditionTruckVO!!.ETD) + " " + itemExpeditionTruckVO!!.Destino
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
||||
////Log.i("VERDNATURA:","4-listamos listado de pallets para la expedicion")
|
||||
super.init()
|
||||
}
|
||||
|
@ -111,7 +100,8 @@ class ExpeditionPalletFragment(
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
||||
}else if(item == iconPlus){
|
||||
expeditionScanAdd()
|
||||
}
|
||||
|
@ -183,7 +173,8 @@ class ExpeditionPalletFragment(
|
|||
|
||||
private fun expeditionScanAdd(){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanAdd(usuario = user,password = password,vPalletFk = "0",vTruckFk = itemExpeditionTruckVO!!.truckFk,"expeditionScan_Add")
|
||||
viewModel.expeditionScanAdd(getData(USER),
|
||||
getData(PASSWORD),vPalletFk = "0",vTruckFk = itemExpeditionTruckVO!!.truckFk,"expeditionScan_Add")
|
||||
}
|
||||
|
||||
private fun showScanExpeditions(it:ItemScanList){
|
||||
|
@ -217,7 +208,8 @@ class ExpeditionPalletFragment(
|
|||
}.setKoButton("Cerrar"){
|
||||
(activity as MainActivity).hideKeyboard(customDialogList.getEditText())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(user,password,itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
||||
viewModel.expeditionPallet_List(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionTruckVO!!.truckFk,"expeditionPallet_List")
|
||||
listExpeditions = ArrayList()
|
||||
customDialogList.dismiss()
|
||||
}.setValue("").show()
|
||||
|
@ -233,9 +225,11 @@ class ExpeditionPalletFragment(
|
|||
if(customDialogList.getValue().length >= 7){
|
||||
listExpeditions.add(0,BarcodeVO(code = customDialogList.getValue()))
|
||||
customDialogList.setDescription("Total: "+listExpeditions.size)
|
||||
viewModel.expeditionScanPut(user,password,it.list.get(0).palletFk,customDialogList.getValue(),"expeditionScan_Put")
|
||||
viewModel.expeditionScanPut(getData(USER),
|
||||
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue(),"expeditionScan_Put")
|
||||
////Log.i("VERDNATURA:"," palletizando ${it.list.get(0).palletFk} expedi: ${customDialogList.getValue()}")
|
||||
viewModel.checkRouteExpeditionScanPut(user,password,it.list.get(0).palletFk,customDialogList.getValue(),"expedition_checkRoute")
|
||||
viewModel.checkRouteExpeditionScanPut(getData(USER),
|
||||
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue(),"expedition_checkRoute")
|
||||
}else{
|
||||
if (mperror != null) mperror!!.start()
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_scan.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
|
@ -14,8 +10,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionScanBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -38,10 +32,6 @@ class ExpeditionScanFragment (
|
|||
) : BaseFragment<FragmentExpeditionScanBinding, ExpeditionScanViewModel>(
|
||||
ExpeditionScanViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter : ExpeditionScanAdapter? = null
|
||||
private var onPalletClickListener: OnPalletClickListener? = null
|
||||
private var onComprobarPalletViewClickListener: OnComprobarPalletViewClickListener? = null
|
||||
|
@ -67,11 +57,6 @@ class ExpeditionScanFragment (
|
|||
override fun getLayoutId(): Int = R.layout.fragment_expedition_scan
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
@ -89,7 +74,8 @@ class ExpeditionScanFragment (
|
|||
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
|
||||
viewModel.expeditionScanList(getData(USER),
|
||||
getData(PASSWORD),itemPalletVO!!.Pallet)
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -110,7 +96,8 @@ class ExpeditionScanFragment (
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
|
||||
viewModel.expeditionScanList(getData(USER),
|
||||
getData(PASSWORD),itemPalletVO!!.Pallet)
|
||||
}else if(item == iconPlus){
|
||||
//Log.i("VERDNATURA:","ENTRAMOS A SCAN ADD")
|
||||
expeditionScanAdd ()
|
||||
|
@ -177,7 +164,8 @@ class ExpeditionScanFragment (
|
|||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
viewModel.expeditionScanList(user,password,itemPalletVO!!.Pallet)
|
||||
viewModel.expeditionScanList(getData(USER),
|
||||
getData(PASSWORD),itemPalletVO!!.Pallet)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -193,7 +181,8 @@ class ExpeditionScanFragment (
|
|||
.setDescription("Expedition: "+itemExpeditionScanVO!!.expeditionFk)
|
||||
.setOkButton("Borrar"){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanDel(user,password,itemExpeditionScanVO.id)
|
||||
viewModel.expeditionScanDel(getData(USER),
|
||||
getData(PASSWORD),itemExpeditionScanVO.id)
|
||||
customDialogTwoButtons.dismiss()
|
||||
}.setKoButton("Cancelar"){
|
||||
customDialogTwoButtons.dismiss()
|
||||
|
@ -209,7 +198,8 @@ class ExpeditionScanFragment (
|
|||
|
||||
private fun expeditionScanAdd(){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanAdd(usuario = user,password = password,vPalletFk = itemPalletVO!!.Pallet,vTruckFk = itemExpeditionTruckVO!!.truckFk)
|
||||
viewModel.expeditionScanAdd(usuario = getData(USER),
|
||||
getData(PASSWORD),vPalletFk = itemPalletVO!!.Pallet,vTruckFk = itemExpeditionTruckVO!!.truckFk)
|
||||
//Log.i("VERDNATURA:","entramos a escanear ticket del pallet")
|
||||
|
||||
}
|
||||
|
@ -265,8 +255,8 @@ class ExpeditionScanFragment (
|
|||
|
||||
listExpeditions.add(BarcodeVO(code = customDialogList.getValue()))
|
||||
viewModel.expeditionScanPut(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
it.list.get(0).palletFk,
|
||||
customDialogList.getValue()
|
||||
)
|
||||
|
@ -275,7 +265,8 @@ class ExpeditionScanFragment (
|
|||
|
||||
// ////Log.i("VERDNATURA:","misma ruta ?")
|
||||
//sergio:comprueba si es de la misma ruta. Check_route_expedition.
|
||||
checkRouteExpeditionScanPut(user, password,it.list.get(0).palletFk,customDialogList.getValue())
|
||||
checkRouteExpeditionScanPut(getData(USER),
|
||||
getData(PASSWORD),it.list.get(0).palletFk,customDialogList.getValue())
|
||||
|
||||
////Log.i("VERDNATURA:", "scan put pallet ${it.list.get(0).palletFk}");
|
||||
////Log.i("VERDNATURA:", "scan put list ${customDialogList.getValue()}");
|
||||
|
|
|
@ -84,8 +84,8 @@ class ExpeditionScanSorterFragment(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
user = getData(USER)
|
||||
password = getData(PASSWORD)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -18,7 +18,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnItemExpeditionStateRowClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -94,9 +93,9 @@ class ExpeditionStateFragment(
|
|||
|
||||
private fun getExpedtionState(expeditionFk: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
user = getData(USER)
|
||||
password = getData(PASSWORD)
|
||||
warehouseFk = getData(WAREHOUSEFK)
|
||||
// this.itemFk = itemFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expedition_getStateJSON(expeditionFk, user, password,"expedition_getState")
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.google.gson.JsonObject
|
|||
import com.google.gson.reflect.TypeToken
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -1,19 +1,14 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_expedition_truck_list.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionTruckListBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
|
@ -32,10 +27,6 @@ import java.util.Calendar.getInstance as getInstance1
|
|||
class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBinding, ExpeditionTruckListViewModel>(
|
||||
ExpeditionTruckListViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter : ExpeditionListAdapter? = null
|
||||
private lateinit var customDialogHor: CustomDialogHour
|
||||
private var onTruckClickListener: OnTruckClickListener? = null
|
||||
|
@ -52,15 +43,6 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_expedition_truck_list
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
customDialogHor = CustomDialogHour(requireContext())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
@ -68,7 +50,8 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
binding.mainToolbar.backButton.visibility = View.GONE
|
||||
setToolBar()
|
||||
////Log.i("VERDNATURA:","1-cargamos expediciones")
|
||||
viewModel.expeditionTruckList(user,password,"expeditionTruck_List")
|
||||
viewModel.expeditionTruckList(getData(USER),
|
||||
getData(PASSWORD),"expeditionTruck_List")
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -87,7 +70,8 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionTruckList(user,password,"expeditionTruck_List")
|
||||
viewModel.expeditionTruckList(getData(USER),
|
||||
getData(PASSWORD),"expeditionTruck_List")
|
||||
}else if(item == iconPlus){
|
||||
addTruck()
|
||||
}
|
||||
|
@ -111,7 +95,8 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
event.getContentIfNotHandled().notNull {printExpeditionList(it) }
|
||||
})
|
||||
loadResponseExpeditionAdd.observe(viewLifecycleOwner, Observer { event ->
|
||||
viewModel.expeditionTruckList(user,password,"expeditionTruck_List")
|
||||
viewModel.expeditionTruckList(getData(USER),
|
||||
getData(PASSWORD),"expeditionTruck_List")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +114,8 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
customDialogHor.setTitle("Nuevo Camión").setOkButton("Guardar"){
|
||||
(activity as MainActivity).hideKeyboard(customDialogHor.getDestinoEditText())
|
||||
if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){
|
||||
viewModel.expeditionTruckAdd(user,password,customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add")
|
||||
viewModel.expeditionTruckAdd(getData(USER),
|
||||
getData(PASSWORD),customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add")
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
customDialogHor.dismiss()
|
||||
}
|
||||
|
@ -143,7 +129,8 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
customDialogHor.getDestinoEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogHor.getDestinoValue().isNullOrEmpty() && !customDialogHor.getHoraValue().isNullOrEmpty()){
|
||||
viewModel.expeditionTruckAdd(user,password,customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add")
|
||||
viewModel.expeditionTruckAdd(getData(USER),
|
||||
getData(PASSWORD),customDialogHor.getHoraValue(),customDialogHor.getDestinoValue(),"expeditionTruck_Add")
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
customDialogHor.dismiss()
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetPaletizadoresUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.parking.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
|
@ -11,8 +10,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentParkingBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.hideKeyboard
|
||||
|
@ -23,10 +20,6 @@ import es.verdnatura.presentation.view.feature.parking.adapter.ParkingAdapter
|
|||
|
||||
class ParkingFragment : BaseFragment<FragmentParkingBinding,ParkingViewModel>(ParkingViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var scanerList:ArrayList<BarcodeVO> = ArrayList()
|
||||
private var adapter : ParkingAdapter? = null
|
||||
|
@ -135,8 +128,8 @@ class ParkingFragment : BaseFragment<FragmentParkingBinding,ParkingViewModel>(Pa
|
|||
scanerList.forEach {
|
||||
// binding.splashProgress.visibility = View.VSIIBLE
|
||||
viewModel.parking(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
parking = txtScan,
|
||||
scanItem = it.code!!,callFunction = "shelvingPark"
|
||||
)
|
||||
|
@ -149,10 +142,6 @@ class ParkingFragment : BaseFragment<FragmentParkingBinding,ParkingViewModel>(Pa
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -7,7 +7,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.parking.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import android.content.SharedPreferences
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
|
@ -11,8 +8,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentParkingBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.hideKeyboard
|
||||
|
@ -23,10 +18,7 @@ import es.verdnatura.presentation.view.feature.parking.adapter.ParkingAdapter
|
|||
|
||||
class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewModel>(ParkingSaleViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var scanerList:ArrayList<BarcodeVO> = ArrayList()
|
||||
private var adapter : ParkingAdapter? = null
|
||||
|
@ -133,8 +125,8 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
|
|||
scanerList.forEach {
|
||||
// binding.splashProgress.visibility = View.VSIIBLE
|
||||
viewModel.parking(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
parking = txtScan,
|
||||
scanItem = it.code!!,callFunction = "shelvingPark"
|
||||
)
|
||||
|
@ -146,11 +138,7 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -7,7 +7,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -10,9 +10,7 @@ import es.verdnatura.presentation.base.BaseFragment
|
|||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.adapter.PasillerosAdapter
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_pasillero.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
|
||||
class PasilleroFragment(
|
||||
var tagName: String = ""
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.precontrol
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
@ -9,23 +8,14 @@ import androidx.lifecycle.Observer
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentControladorBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
|
||||
class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicketViewModel>(ShowTicketViewModel::class) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack:Boolean = false
|
||||
private var onCollectionSelectedListener : OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_controlador
|
||||
|
@ -58,11 +48,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicket
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
type=ConstAndValues.PRECHECKER
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
@ -81,9 +67,9 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicket
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
usuario = user,
|
||||
password = password,
|
||||
sectorFk = sectorFk,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
sectorFk = getData(SECTORFK),
|
||||
collectionFk = binding.scanInput.text.toString(),
|
||||
type = type,callFunction = "collection_getTickets"
|
||||
)
|
||||
|
@ -115,7 +101,7 @@ class PreControladorFragment: BaseFragment<FragmentControladorBinding,ShowTicket
|
|||
}
|
||||
|
||||
private fun navigateToCollectionList(collection: CollectionVO){
|
||||
onCollectionSelectedListener?.onCollectionSelected(collection, ConstAndValues.PRECHECKER)
|
||||
onCollectionSelectedListener?.onCollectionSelected(collection, type)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.domain.GetPreControladorUserCase
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
|
|
|
@ -38,20 +38,9 @@ import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
|||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_pre_sacador.*
|
||||
import kotlinx.android.synthetic.main.fragment_pre_sacador.binding.fragmentSacadorCollections
|
||||
import kotlinx.android.synthetic.main.fragment_pre_sacador.binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class PreSacadorFragment :
|
||||
BaseFragment<FragmentPreSacadorBinding, PreSacadorViewModel>(PreSacadorViewModel::class) {
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var SectorDescription = ""
|
||||
var mperror: MediaPlayer? = null
|
||||
var mpok: MediaPlayer? = null
|
||||
//private var sales: ArrayList<PreSacadorItemVO> = ArrayList()
|
||||
|
@ -73,9 +62,13 @@ class PreSacadorFragment :
|
|||
private lateinit var customDialogInputParking: CustomDialogInput
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||
private var token = ""
|
||||
private var ticketFk = ""
|
||||
private var originalScanned = ""
|
||||
private var typeCollectionMissing = ""
|
||||
private var positionCollectionMissing = 0
|
||||
private var quantityCollectionMissing = ""
|
||||
private var positionIncreaseQuantity = 0
|
||||
private var quantityIncrease = ""
|
||||
|
||||
//sergio: se añada para leer el articulo leido que era el buyFk
|
||||
private var originalItemScan: String = ""
|
||||
|
@ -86,15 +79,9 @@ class PreSacadorFragment :
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, 37).toString()
|
||||
token = prefs.getString(TOKEN, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
||||
SectorDescription = prefs.getString(SECTORDESCRIP, "Sin Sector").toString()
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
@ -193,6 +180,17 @@ class PreSacadorFragment :
|
|||
}
|
||||
})
|
||||
|
||||
responseIncQuantity.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true)
|
||||
} else {
|
||||
incresaseSuccesful()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
responseParkingAdd.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (it.isError) {
|
||||
|
@ -206,6 +204,16 @@ class PreSacadorFragment :
|
|||
}
|
||||
})
|
||||
|
||||
responseMissingTrash.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
(activity as MainActivity).messageWithSound(it.errorMessage, isError = true,true)
|
||||
|
||||
} else {
|
||||
missingTrashSuccesful()
|
||||
}
|
||||
})
|
||||
|
||||
responseCode.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (!goBack2) {
|
||||
|
@ -238,6 +246,90 @@ class PreSacadorFragment :
|
|||
}
|
||||
}
|
||||
|
||||
private fun incresaseSuccesful() {
|
||||
|
||||
|
||||
try {
|
||||
sales[positionIncreaseQuantity].saldo = quantityIncrease.toInt()
|
||||
} catch (e: Exception) {
|
||||
sales[positionIncreaseQuantity].saldo = 0
|
||||
}
|
||||
|
||||
saleAdapter?.notifyDataSetChanged()
|
||||
|
||||
val ticket =
|
||||
"[" + sales[positionIncreaseQuantity].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].id + "/summary)"
|
||||
val message =
|
||||
"Se ha modificado desde previa la cantidad original " + sales[positionIncreaseQuantity].quantity + " del artículo " + sales[positionIncreaseQuantity].itemFk + " a nueva cantidad: " + quantityIncrease + " del ticket " + ticket
|
||||
|
||||
sendSalixMessageNew(message, sales[positionIncreaseQuantity].salesPersonFk)
|
||||
}
|
||||
|
||||
|
||||
private fun missingTrashSuccesful() {
|
||||
|
||||
var totalQuantity: Int = 0
|
||||
try {
|
||||
totalQuantity = sales[positionCollectionMissing].saldo.toInt() - quantityCollectionMissing.toInt()
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
sales[positionCollectionMissing].saldo = quantityCollectionMissing.toInt()
|
||||
} catch (e: Exception) {
|
||||
sales[positionCollectionMissing].saldo = 0
|
||||
}
|
||||
|
||||
if (quantityCollectionMissing == "0")
|
||||
markLine(positionCollectionMissing)
|
||||
|
||||
|
||||
|
||||
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
|
||||
|
||||
var message=""
|
||||
|
||||
val ticket =
|
||||
"[" + sales[positionCollectionMissing].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionMissing].id + "/summary)"
|
||||
|
||||
when (typeCollectionMissing){
|
||||
|
||||
"TRUE"->{
|
||||
message = "Se ha enviado desde previa a Basura " + totalQuantity + " del articulo " + sales[positionCollectionMissing].itemFk + " ticket " + ticket
|
||||
}
|
||||
|
||||
|
||||
"FALSE"->{
|
||||
message= "Se ha enviado desde previa a Faltas la cantidad de " + totalQuantity + " del articulo " + sales[positionCollectionMissing].itemFk + " ticket " + ticket
|
||||
}
|
||||
|
||||
|
||||
|
||||
"reject"->{
|
||||
var quantityOriginal=totalQuantity.toInt()+quantityCollectionMissing.toInt()
|
||||
message = "Se ha modificado desde previa la cantidad de " +quantityOriginal+ " del artículo " + sales[positionCollectionMissing].itemFk + " a nueva cantidad: " + quantityCollectionMissing+ " del ticket " + ticket
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//sendSalixMessageNew(message, sales[positionCollectionMissing].trabajador)
|
||||
sendSalixMessageNew(message, sales[positionCollectionMissing].salesPersonFk)
|
||||
|
||||
|
||||
}
|
||||
private fun sendSalixMessageNew(message: String, workerId: String) {
|
||||
|
||||
viewModel.sendChekingPresence(
|
||||
token = getData(TOKEN),
|
||||
workerId = workerId,
|
||||
message = message,
|
||||
"sendChekingPresence"
|
||||
)
|
||||
}
|
||||
//CREATE LIST
|
||||
private fun searchTicket(ticketFk: String) {
|
||||
Log.i(TAG, "Escaneamos ticket en previa")
|
||||
|
@ -246,10 +338,10 @@ class PreSacadorFragment :
|
|||
|
||||
d("VERDNATURA::", "ticket:" + ticket)
|
||||
viewModel.ticketToPrePrepare(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
getData(PASSWORD),
|
||||
ticketFk = ticketFk,
|
||||
sectorFk = sectorFk
|
||||
sectorFk = getData(SECTORFK)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -273,6 +365,7 @@ class PreSacadorFragment :
|
|||
|
||||
for (s in sales){
|
||||
Log.d("VERDNATURA::","sales "+s.longName)
|
||||
Log.d("VERDNATURA::","sales "+s.salesPersonFk)
|
||||
//sergio: para que no de error si no hay carros. Ya está asignado a 0 el pickingorder si no hay item en el carro
|
||||
if (!s.carros.isNullOrEmpty()){
|
||||
s.pickingOrder=s.carros.get(0).pickingOrder
|
||||
|
@ -441,8 +534,8 @@ class PreSacadorFragment :
|
|||
|
||||
private fun saleTrackingReplace(position: Int) {
|
||||
viewModel.saleTrackingReplace(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
vIsChecked = if (sales[position].picked == sales[position].quantity) "1" else "0",
|
||||
vOriginalQuantity = sales[position].picked.toString(),
|
||||
|
@ -470,8 +563,8 @@ class PreSacadorFragment :
|
|||
saleAdapter!!.notifyDataSetChanged()
|
||||
setListPosition(position)
|
||||
viewModel.saleTrackingDel(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario =getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento, "saleTracking_del"
|
||||
)
|
||||
setTotalLines()
|
||||
|
@ -497,8 +590,8 @@ class PreSacadorFragment :
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.itemPlacementSupplyAiming(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
itemFk = sales[position].itemFk,
|
||||
quantity = quantityGet,
|
||||
shelvingFk = sales[position].carros[shelvingPosition].shelving,
|
||||
|
@ -539,8 +632,8 @@ class PreSacadorFragment :
|
|||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
|
@ -586,8 +679,8 @@ class PreSacadorFragment :
|
|||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo(), "barcodeToItem"
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
|
@ -633,8 +726,8 @@ class PreSacadorFragment :
|
|||
(shelvingVisible.toInt() - customDialogList.getValue().toInt()).toString()
|
||||
|
||||
viewModel.itemShelvingSaleSupplyAdd(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
saleFk = sales[storedPosition].idMovimiento,
|
||||
quantity = customDialogList.getValue(), callFunction = "itemShelvingSaleSupplyAdd"
|
||||
|
@ -884,8 +977,99 @@ class PreSacadorFragment :
|
|||
}.show()
|
||||
}
|
||||
|
||||
//FALTAS / BASURA / SPLIT
|
||||
|
||||
private fun showQuantityDialog(position: Int) {
|
||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("")
|
||||
.setOkButton(getString(R.string.Faltas)) {
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.Faltas)
|
||||
)
|
||||
|
||||
}.setOkButtonTwo(getString(R.string.BasuraRechazar)) {
|
||||
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.BasuraRechazar)
|
||||
)
|
||||
|
||||
}.setOkButtonThree(getString(R.string.Reject)) {
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.Reject)
|
||||
)
|
||||
|
||||
}.setOkButtonFour(getString(R.string.Split)) {
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.Split)
|
||||
)
|
||||
|
||||
|
||||
}.setOkButtonAdd(getString(R.string.Agregar)) {
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.Agregar)
|
||||
)
|
||||
|
||||
}.setKoButton("Cancelar") {
|
||||
scanRequest()
|
||||
customDialogThreeButtons.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
private fun checkAndCall(position: Int, value: String, action: String) {
|
||||
if (value.trim().isNullOrEmpty()) {
|
||||
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
||||
} else {
|
||||
|
||||
when (action) {
|
||||
getString(R.string.Agregar) -> increaseQuantity(position, value)
|
||||
getString(R.string.BasuraRechazar) -> TrashMissingReject(position, value,"TRUE")
|
||||
getString(R.string.Faltas) -> TrashMissingReject(position, value,"FALSE")
|
||||
getString(R.string.Reject) -> TrashMissingReject(position, value,"reject")
|
||||
getString(R.string.Split) -> split(position, value)
|
||||
|
||||
}
|
||||
|
||||
scanRequest()
|
||||
customDialogThreeButtons.dismiss()
|
||||
}
|
||||
}
|
||||
private fun TrashMissingReject(
|
||||
position: Int,
|
||||
quantity: String,
|
||||
typeCollectionTrashMissingReject: String
|
||||
) {
|
||||
typeCollectionMissing = typeCollectionTrashMissingReject
|
||||
positionCollectionMissing = position
|
||||
quantityCollectionMissing = quantity
|
||||
|
||||
var totalQuantity: Int = 0
|
||||
try {
|
||||
totalQuantity = sales[position].saldo.toInt() - quantity.toInt()
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
||||
viewModel.collectionMissingTrash(
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
quantity = totalQuantity.toString(),
|
||||
warehouseFk = getData(WAREHOUSEFK),
|
||||
type = "FALSE",
|
||||
originalQuantity = quantity, callFunction = "collectionMissingTrash"
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
//FALTAS / BASURA / SPLIT
|
||||
private fun showQuantityDialogOld(position: Int) {
|
||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("")
|
||||
.setOkButton(getString(R.string.Faltas)) {
|
||||
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
|
||||
|
@ -942,8 +1126,8 @@ class PreSacadorFragment :
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.saleMove(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
quantity = totalQuantity.toString(),
|
||||
originalQuantity = sales[position].quantity.toString(), "saleMove"
|
||||
|
@ -963,12 +1147,12 @@ class PreSacadorFragment :
|
|||
|
||||
//enviar mensaje a salix
|
||||
val ticket =
|
||||
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
||||
"[" + sales[position].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].id + "/summary)"
|
||||
val message =
|
||||
"Se ha enviado a Split el articulo " + sales[position].itemFk + " del ticket " + ticket
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
workerId = sales[position].trabajador,
|
||||
token = getData(TOKEN),
|
||||
workerId = sales[position].salesPersonFk,
|
||||
message = message,
|
||||
"sendChekingPresence"
|
||||
)
|
||||
|
@ -983,11 +1167,11 @@ class PreSacadorFragment :
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.collectionMissingTrash(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
quantity = totalQuantity.toString(),
|
||||
warehouseFk = warehouseFk,
|
||||
warehouseFk = getData(WAREHOUSEFK),
|
||||
type = "FALSE",
|
||||
originalQuantity = quantity, callFunction = "collectionMissingTrash"
|
||||
)
|
||||
|
@ -1005,12 +1189,12 @@ class PreSacadorFragment :
|
|||
|
||||
//enviar mensaje a salix
|
||||
val ticket =
|
||||
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
||||
"[" + sales[position].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].id + "/summary)"
|
||||
val message =
|
||||
"Se ha enviado a Faltas la cantidad de " + totalQuantity + " del articulo " + sales[position].itemFk + " ticket " + ticket
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
workerId = sales[position].trabajador,
|
||||
token = getData(TOKEN),
|
||||
workerId = sales[position].salesPersonFk,
|
||||
message = message,
|
||||
"sendChekingPresence"
|
||||
)
|
||||
|
@ -1023,11 +1207,11 @@ class PreSacadorFragment :
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.collectionMissingTrash(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
quantity = totalQuantity.toString(),
|
||||
warehouseFk = warehouseFk,
|
||||
warehouseFk = getData(WAREHOUSEFK),
|
||||
type = "TRUE",
|
||||
originalQuantity = quantity, callFunction = "collectionMissingTrash"
|
||||
)
|
||||
|
@ -1047,12 +1231,12 @@ class PreSacadorFragment :
|
|||
|
||||
//enviar mensaje a salix
|
||||
val ticket =
|
||||
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
||||
"[" + sales[position].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].id + "/summary)"
|
||||
val message =
|
||||
"Se ha enviado a Basura " + totalQuantity + " del articulo " + sales[position].itemFk + " ticket " + ticket
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
workerId = sales[position].trabajador,
|
||||
token = getData(TOKEN),
|
||||
workerId = sales[position].salesPersonFk,
|
||||
message = message,
|
||||
"sendChekingPresence"
|
||||
)
|
||||
|
@ -1065,11 +1249,11 @@ class PreSacadorFragment :
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.collectionMissingTrash(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
quantity = totalQuantity.toString(),
|
||||
warehouseFk = warehouseFk,
|
||||
warehouseFk = getData(WAREHOUSEFK),
|
||||
type = "reject",
|
||||
originalQuantity = quantity, callFunction = "collectionMissingTrash"
|
||||
)
|
||||
|
@ -1080,8 +1264,8 @@ class PreSacadorFragment :
|
|||
val message =
|
||||
"Se ha modificado la cantidad original " + sales[position].saldo + " del artículo " + sales[position].itemFk + " a nueva cantidad: " + quantity + " del ticket " + ticket
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
workerId = sales[position].trabajador,
|
||||
token = getData(TOKEN),
|
||||
workerId = sales[position].salesPersonFk,
|
||||
message = message,
|
||||
"sendChekingPresence"
|
||||
)
|
||||
|
@ -1099,10 +1283,10 @@ class PreSacadorFragment :
|
|||
|
||||
}
|
||||
|
||||
private fun increaseQuantity(position: Int, quantity: String) {
|
||||
private fun increaseQuantityOld(position: Int, quantity: String) {
|
||||
viewModel.collectionIncreaseQuantity(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
quantity = quantity,
|
||||
callFunction = "collection_increaseQuantity"
|
||||
|
@ -1111,16 +1295,17 @@ class PreSacadorFragment :
|
|||
|
||||
//enviar mensaje a salix
|
||||
val ticket =
|
||||
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
||||
"[" + sales[position].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].id + "/summary)"
|
||||
val message =
|
||||
"Se ha modificado la cantidad original " + sales[position].saldo + " del artículo " + sales[position].itemFk + " a nueva cantidad: " + quantity + " del ticket " + ticket
|
||||
viewModel.sendChekingPresence(
|
||||
token = token,
|
||||
workerId = sales[position].trabajador,
|
||||
token = getData(TOKEN),
|
||||
workerId = sales[position].salesPersonFk,
|
||||
message = message,
|
||||
"sendChekingPresence"
|
||||
)
|
||||
|
||||
Log.d("VERDNATURA","el trabajador es "+sales[position].salesPersonFk)
|
||||
try {
|
||||
sales[position].saldo = quantity.toInt()
|
||||
} catch (e: Exception) {
|
||||
|
@ -1131,6 +1316,20 @@ class PreSacadorFragment :
|
|||
saleAdapter?.notifyDataSetChanged()
|
||||
|
||||
|
||||
}
|
||||
private fun increaseQuantity(position: Int, quantity: String) {
|
||||
positionIncreaseQuantity = position
|
||||
quantityIncrease = quantity
|
||||
|
||||
viewModel.collectionIncreaseQuantity(
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk = sales[position].idMovimiento,
|
||||
quantity = quantity,
|
||||
callFunction = "collection_increaseQuantity"
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,6 +56,10 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
val responseSalixMessage: LiveData<ResponseItemVO>
|
||||
get() = _responseSalixMessage
|
||||
|
||||
private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseMissingTrash: LiveData<ResponseItemVO>
|
||||
get() = _responseMissingTrash
|
||||
|
||||
fun ticketToPrePrepare(usuario: String, password: String, ticketFk: String, sectorFk: String)
|
||||
{
|
||||
getPreSacadorUseCase.ticketToPrePrepare(usuario, password, ticketFk, sectorFk)
|
||||
|
@ -433,7 +437,7 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
{
|
||||
override fun onFailure(call: Call<String>, t: Throwable)
|
||||
{
|
||||
_response.value = ResponseItemVO(
|
||||
_responseMissingTrash.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)
|
||||
)
|
||||
|
@ -443,12 +447,12 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
{
|
||||
if (response.body() == null)
|
||||
{
|
||||
_response.value = ResponseItemVO(
|
||||
_responseMissingTrash.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
|
||||
} else
|
||||
{
|
||||
_response.value = ResponseItemVO(isError = false, response = response.body()!!)
|
||||
_responseMissingTrash.value = ResponseItemVO(isError = false, response = response.body()!!)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -509,8 +513,8 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
{
|
||||
_responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error en la llamada $calledFunction al enviar mensaje rocket." + getMessageFromResponse(
|
||||
response.message()
|
||||
errorMessage = "Error en la llamada $calledFunction al enviar mensaje rocket." + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
)
|
||||
)
|
||||
//Log.i("Salix","Mensaje enviado a salix")
|
||||
|
@ -520,12 +524,16 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
|
||||
override fun onFailure(call: Call<Boolean>, t: Throwable)
|
||||
{
|
||||
/* _responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error en la llamada $calledFunction al enviar mensaje rocket." + getMessageFromAllResponse(
|
||||
nameofFunction(this),t.message!!))*/
|
||||
|
||||
Log.i("Salix Error", "" + t.message)
|
||||
}
|
||||
})
|
||||
} catch (e: Exception)
|
||||
{
|
||||
Log.d("VERDNATURA","error "+e.message)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,10 @@ fun PreSacadorItemVO.toSale() : SaleVO {
|
|||
originalQuantity = quantity.toString(),
|
||||
placements = carros,
|
||||
agencyName = if (trabajador.isNullOrEmpty()) { "" } else trabajador,
|
||||
packingType=packingType
|
||||
packingType=packingType,
|
||||
salePersonFk=if (salesPersonFk.isNullOrEmpty()){""}else salesPersonFk
|
||||
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
|
|
|
@ -15,7 +15,8 @@ class PreSacadorItemVO (
|
|||
var trabajador : String = "",
|
||||
var carros : List<PlacementVO> = listOf(),
|
||||
//var priority:Int =0, 7-1-2022
|
||||
var pickingOrder:Int =0
|
||||
var pickingOrder:Int =0,
|
||||
var salesPersonFk:String= "sergio"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,36 +1,24 @@
|
|||
package es.verdnatura.presentation.view.feature.qr
|
||||
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.KeyEvent.*
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentQrBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class QrFragment(
|
||||
var entryPoint: String = ""
|
||||
) : BaseFragment<FragmentQrBinding, QrFragmentViewModel>(QrFragmentViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
override fun getLayoutId(): Int = R.layout.fragment_qr
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var type = ""
|
||||
private var itemscaned = ""
|
||||
|
||||
companion object {
|
||||
|
@ -58,16 +46,6 @@ class QrFragment(
|
|||
super.onPause()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
type = ConstAndValues.PRECHECKER
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
|
@ -84,7 +62,7 @@ class QrFragment(
|
|||
goBack = false
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.qr_getCall(user, password, binding.scanInput.text.toString(),"qr_getCall")
|
||||
viewModel.qr_getCall(getData(USER), getData(PASSWORD), binding.scanInput.text.toString(),"qr_getCall")
|
||||
itemscaned = binding.scanInput.text.toString()
|
||||
}
|
||||
|
||||
|
@ -95,11 +73,8 @@ class QrFragment(
|
|||
}
|
||||
// false
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetQrReaderUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.reposicion.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Build
|
||||
|
@ -14,8 +13,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ReposicionFragmentBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -25,25 +22,17 @@ import es.verdnatura.presentation.view.component.CustomDialogList
|
|||
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
import es.verdnatura.presentation.view.feature.reposicion.adapter.ReposicionAdapter
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.reposicion_fragment.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
|
||||
class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionViewModel>(
|
||||
ReposicionViewModel::class){
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
@ -95,12 +84,6 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
|
||||
|
@ -121,7 +104,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
|
||||
binding.btnObtener.setOnClickListener {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemPlacementSupplyGetOrder(usuario = user,password = password,sectorFk = sectorFk,"itemPlacementSupplyGetOrder")
|
||||
viewModel.itemPlacementSupplyGetOrder(usuario = getData(USER),password = getData(PASSWORD),sectorFk = getData(SECTORFK),"itemPlacementSupplyGetOrder")
|
||||
}
|
||||
|
||||
binding.btnCancelar.setOnClickListener {
|
||||
|
@ -132,7 +115,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
}.setOkButton("Cerrar"){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
if (sales.count() > 0){
|
||||
viewModel.itemPlacementSupplyCloseOrder(usuario = user,password = password,id = sales[0].id,quantity = sales[0].quantity.toString(),"itemPlacementSupplyCloseOrder")
|
||||
viewModel.itemPlacementSupplyCloseOrder(usuario = getData(USER),password = getData(PASSWORD),id = sales[0].id,quantity = sales[0].quantity.toString(),"itemPlacementSupplyCloseOrder")
|
||||
}
|
||||
customDialog.dismiss()
|
||||
|
||||
|
@ -170,7 +153,7 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
//LISTA =========
|
||||
binding.collectionSwipe.setOnRefreshListener {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemPlacementSupplyGetOrder(usuario = user,password = password,sectorFk = sectorFk,"itemPlacementSupplyGetOrder")
|
||||
viewModel.itemPlacementSupplyGetOrder(usuario = getData(USER),password = getData(PASSWORD),sectorFk = getData(SECTORFK),"itemPlacementSupplyGetOrder")
|
||||
binding.collectionSwipe.isRefreshing = false
|
||||
}
|
||||
|
||||
|
@ -353,8 +336,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
quantityGet = (sales[position].saldo - sales[position].picked).toString()
|
||||
}catch (e:Exception){}
|
||||
viewModel.itemPlacementSupplyAiming(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
itemFk = sales[position].itemFk,
|
||||
quantity = quantityGet,
|
||||
shelvingFk = sales[position].carros[shelvingPosition].shelving,
|
||||
|
@ -391,8 +374,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo(),"barcodeToItem"
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
|
@ -429,8 +412,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
itemShelvingFkStored = itemShelvingFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getIdFromCode(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
code = customDialogList.getValueTwo(),"barcodeToItem"
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
|
@ -473,8 +456,8 @@ class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionVie
|
|||
sales[storedPosition].carros[storedShelvingPosition].stockTotal = (shelvingVisible.toInt() - customDialogList.getValue().toInt()).toString()
|
||||
|
||||
viewModel.itemShelvingPlacementSupplyAdd(
|
||||
usuario = user,
|
||||
password = password,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
itemPlacementSupplyFk = sales[storedPosition].id,
|
||||
quantity = customDialogList.getValue(),"itemShelvingPlacementSupplyAdd"
|
||||
|
|
|
@ -7,7 +7,7 @@ import es.verdnatura.domain.GetPreSacadorUseCase
|
|||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package es.verdnatura.presentation.view.feature.sacador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.lifecycle.Observer
|
||||
|
@ -12,35 +10,24 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentSacadorBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.AssociateSmartTagsFragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class SacadorFragment :
|
||||
BaseFragment<FragmentSacadorBinding, SacadorViewModel>(SacadorViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
private var goBack: Boolean = false
|
||||
private var goBack2: Boolean = false
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var collectionsList: ArrayList<CollectionVO> = ArrayList()
|
||||
private var adapter: CollectionAdapter? = null
|
||||
private var wagons = ""
|
||||
private var resultTagMode:String? = ""
|
||||
|
||||
|
||||
|
@ -55,25 +42,6 @@ class SacadorFragment :
|
|||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_sacador
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
wagons = prefs.getInt(WAGON, 2).toString()
|
||||
//sergio:listener para collectionnew
|
||||
/* setFragmentResultListener("requestKey") { key, bundle ->
|
||||
resultTagMode = bundle.getString("tagMode")
|
||||
Log.i("VERDNATURA:", "el result es ${resultTagMode}")
|
||||
checkTagsMode()
|
||||
|
||||
}*/
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
|
||||
|
@ -83,8 +51,9 @@ class SacadorFragment :
|
|||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getcollection)
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.collectionGet(user, password,"collection_get")
|
||||
|
||||
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||
/*viewModel.collectionGet( getData(USER),
|
||||
getData(PASSWORD),"collection_get")*/
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -127,7 +96,8 @@ class SacadorFragment :
|
|||
|
||||
iconAdd.drawable -> {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.collectionNew(user,password,sectorFk,wagons,getTagsType(),"collection_new_wagon")
|
||||
viewModel.collectionNew(getData(USER),
|
||||
getData(PASSWORD),getData(SECTORFK),getData(WAGON),getData(TAGSTYPE),"collection_new_wagon")
|
||||
}
|
||||
iconVehicleIn.drawable-> (activity as MainActivity).onVehicleSelected(SacadorFragment.TAG)
|
||||
}
|
||||
|
@ -150,8 +120,10 @@ class SacadorFragment :
|
|||
|
||||
private fun setEvents() {
|
||||
binding.sacadorSwipe.setOnRefreshListener {
|
||||
viewModel.collectionGet(user, password,"collection_get")
|
||||
binding.sacadorSwipe.isRefreshing = false
|
||||
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||
/* viewModel.collectionGet(getData(USER),
|
||||
getData(PASSWORD),"collection_get")
|
||||
binding.sacadorSwipe.isRefreshing = false*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,13 +133,15 @@ class SacadorFragment :
|
|||
|
||||
// Log.i("VERDNATURA:", "Tag type: ${getTagsType()}")
|
||||
|
||||
if (getTagsType().equals("Stickers")) {
|
||||
if (getData(TAGSTYPE).equals("Stickers")) {
|
||||
//viewModel.collectionNew(user, password, sectorFk, wagons, "Stickers")
|
||||
viewModel.collectionNew(user, password, sectorFk, wagons,"collection_new_wagon")
|
||||
viewModel.collectionNew(getData(USER),
|
||||
getData(PASSWORD), getData(SECTORFK), getData(WAGON),"collection_new_wagon")
|
||||
} else {
|
||||
// Log.i("VERDNATURA:", " el resultTagmode es ${resultTagMode}")
|
||||
if (resultTagMode.equals("complete")) {
|
||||
viewModel.collectionNew(user, password, sectorFk, wagons, getTagsType(),"collection_new_wagon")
|
||||
viewModel.collectionNew(getData(USER),
|
||||
getData(PASSWORD), getData(SECTORFK), getData(WAGON), getData(TAGSTYPE),"collection_new_wagon")
|
||||
} else {
|
||||
requireActivity().addFragment(
|
||||
AssociateSmartTagsFragment.newInstance(AssociateSmartTagsFragment.TAG),
|
||||
|
@ -217,7 +191,8 @@ class SacadorFragment :
|
|||
}
|
||||
goBack = false
|
||||
//sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta.
|
||||
viewModel.collectionGet(user,password,"collection_get")
|
||||
/* viewModel.collectionGet(getData(USER),getData(PASSWORD),"collection_get")*/
|
||||
viewModel.collectionGetSalix(token=getData(TOKEN))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
@ -175,4 +175,36 @@ class SacadorViewModel(context: Context) : BaseViewModel() {
|
|||
})
|
||||
}
|
||||
|
||||
fun collectionGetSalix(token:String){
|
||||
getSacadorControladorUserCase.collectionGetSalix(token).enqueue(object :
|
||||
Callback<List<CollectionVO>> {
|
||||
override fun onFailure(call: Call<List<CollectionVO>>, t: Throwable) {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(CollectionVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)))
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
}
|
||||
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<CollectionVO>>,
|
||||
response: Response<List<CollectionVO>>
|
||||
) {
|
||||
if (response.body() != null) {
|
||||
_collectionList.value =
|
||||
response.body()?.let { CollectionListVO(it.toDateFormat()) }
|
||||
} else {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(
|
||||
CollectionVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
)
|
||||
)
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ class SaleVO(
|
|||
var saleGroupFk: String = "",
|
||||
var packingShelve:String=""
|
||||
|
||||
|
||||
)
|
||||
|
||||
class PlacementVO(
|
||||
|
|
|
@ -1,40 +1,23 @@
|
|||
package es.verdnatura.presentation.view.feature.shelvingparking.fragment
|
||||
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentShelvingParkingBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.shelvingparking.adapter.ShelvingParkingAdapter
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_shelving_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
|
||||
class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, ShelvingParkingViewModel>(
|
||||
ShelvingParkingViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
|
||||
private var adapter : ShelvingParkingAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private var listInvetory:ArrayList<ItemInventaryVO> = ArrayList()
|
||||
private var listInvetoryAux:ArrayList<ItemInventaryVO> = ArrayList()
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance() = ShelvingParkingFragment()
|
||||
}
|
||||
|
@ -43,14 +26,8 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
|
|||
|
||||
|
||||
override fun init() {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.shelvingParking_get)
|
||||
setEvents()
|
||||
|
@ -69,7 +46,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
|
|||
if (!binding.shelvingText.text.toString().isNullOrEmpty()){
|
||||
binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.shelvingParking_get(user,password,binding.shelvingText.text.toString(),warehouseFk,binding.dayrange.text.toString(),"shelvingParking_get")
|
||||
viewModel.shelvingParking_get( getData(USER),getData(PASSWORD),binding.shelvingText.text.toString(),getData(WAREHOUSEFK),binding.dayrange.text.toString(),"shelvingParking_get")
|
||||
}
|
||||
|
||||
binding.shelvingText.setText("")
|
||||
|
@ -88,7 +65,7 @@ class ShelvingParkingFragment : BaseFragment<FragmentShelvingParkingBinding, She
|
|||
binding.shelvingText.requestFocus()
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text = binding.shelvingText.text.toString()
|
||||
viewModel.shelvingParking_get(user,password,binding.shelvingText.text.toString(),warehouseFk,binding.dayrange.text.toString(),"shelvingParking_get")
|
||||
viewModel.shelvingParking_get( getData(USER),getData(PASSWORD),binding.shelvingText.text.toString(),getData(WAREHOUSEFK),binding.dayrange.text.toString(),"shelvingParking_get")
|
||||
binding.shelvingText.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.dayrange)
|
||||
return@setOnEditorActionListener true
|
||||
|
|
|
@ -6,7 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetShelvingParkingUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.showticket
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
@ -9,25 +8,16 @@ import androidx.lifecycle.Observer
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentControladorBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.precontrol.ShowTicketViewModel
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class ShowTicketFragment: BaseFragment<FragmentControladorBinding, ShowTicketViewModel>(
|
||||
ShowTicketViewModel::class) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack:Boolean = false
|
||||
private var onCollectionSelectedListener : OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_controlador
|
||||
|
@ -58,11 +48,7 @@ class ShowTicketFragment: BaseFragment<FragmentControladorBinding, ShowTicketVie
|
|||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
type=ConstAndValues.VERTICKET
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
@ -81,9 +67,9 @@ class ShowTicketFragment: BaseFragment<FragmentControladorBinding, ShowTicketVie
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
usuario = user,
|
||||
password = password,
|
||||
sectorFk = sectorFk,
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
sectorFk = getData(SECTORFK),
|
||||
collectionFk = binding.scanInput.text.toString(),
|
||||
type = type,
|
||||
callFunction = "collection_getTickets"
|
||||
|
@ -113,14 +99,11 @@ class ShowTicketFragment: BaseFragment<FragmentControladorBinding, ShowTicketVie
|
|||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun navigateToCollectionList(collection: CollectionVO){
|
||||
onCollectionSelectedListener?.onCollectionSelected(collection, ConstAndValues.VERTICKET)
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@ package es.verdnatura.presentation.view.feature.smarttag.register
|
|||
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.View.*
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
@ -12,8 +10,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentSacadorAssociatesmarttagBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -25,16 +21,6 @@ import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
|||
import es.verdnatura.presentation.view.feature.smarttag.adapter.SmartTagAdapter
|
||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.SmartTagsViewModel
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.scan_input
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_scan.*
|
||||
import kotlinx.android.synthetic.main.fragment_login.*
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.**/
|
||||
//import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
class RegisterSmartTagsFragment(
|
||||
var entryPoint: String = ""
|
||||
|
@ -42,12 +28,6 @@ class RegisterSmartTagsFragment(
|
|||
SmartTagsViewModel::class
|
||||
) {
|
||||
|
||||
|
||||
private var user = ""
|
||||
private var userFk = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
//private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_sacador_associatesmarttag
|
||||
|
@ -123,7 +103,8 @@ class RegisterSmartTagsFragment(
|
|||
binding.splashProgress.visibility = VISIBLE
|
||||
//poner el bindshelving aqui
|
||||
|
||||
viewModel.workerShelving_add(user, password, shelvingOrSmarttag)
|
||||
viewModel.workerShelving_add(getData(USER),
|
||||
getData(PASSWORD), shelvingOrSmarttag)
|
||||
if (listSmartTags.size < 1) {
|
||||
|
||||
} else {
|
||||
|
@ -165,20 +146,6 @@ class RegisterSmartTagsFragment(
|
|||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.smarttag.sacador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.View.*
|
||||
|
@ -14,8 +12,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -26,18 +22,6 @@ import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
|||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.smarttag.adapter.SmartTagAdapter
|
||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.scan_input
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_scan.*
|
||||
import kotlinx.android.synthetic.main.fragment_login.*
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.*
|
||||
import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import timber.log.Timber
|
||||
|
||||
class AssociateSmartTagsFragment(
|
||||
|
@ -46,13 +30,8 @@ class AssociateSmartTagsFragment(
|
|||
SmartTagsViewModel::class
|
||||
) {
|
||||
|
||||
private var user = ""
|
||||
private var userFk = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
|
||||
private var goBack: Boolean = false
|
||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_sacador_associatesmarttag
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
|
@ -122,7 +101,8 @@ class AssociateSmartTagsFragment(
|
|||
binding.splashProgress.visibility = VISIBLE
|
||||
//poner el bindshelving aqui
|
||||
|
||||
viewModel.workerShelving_add(user, password, shelvingOrSmarttag)
|
||||
viewModel.workerShelving_add(getData(USER),
|
||||
getData(PASSWORD), shelvingOrSmarttag)
|
||||
if (listSmartTags.size < 1) {
|
||||
|
||||
} else {
|
||||
|
@ -140,7 +120,8 @@ class AssociateSmartTagsFragment(
|
|||
//ponser el unbindshleving aqui
|
||||
//sergio:esto se debe hacer en
|
||||
|
||||
viewModel.workerShelving_delete(user, password, listSmartTags.last().code.toString())
|
||||
viewModel.workerShelving_delete(getData(USER),
|
||||
getData(PASSWORD), listSmartTags.last().code.toString())
|
||||
|
||||
("http://localhost:7777/unbindShelving/${listSmartTags.first().code}" + "&" + listSmartTags.last().code + "&${listSmartTags.size}").toast(
|
||||
requireContext()
|
||||
|
@ -162,17 +143,6 @@ class AssociateSmartTagsFragment(
|
|||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
userFk = prefs.getString(USERFK, "0").toString()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
|
@ -260,31 +230,32 @@ class AssociateSmartTagsFragment(
|
|||
}
|
||||
|
||||
private fun getTextToPosition(TagsScaned: Int): String {
|
||||
var message = ""
|
||||
|
||||
when (TagsScaned) {
|
||||
0 -> message = "Escanea etiqueta/s electrónica/s o matrícula/s"
|
||||
1 -> message = "Escanea etiqueta superior"
|
||||
2 -> message = "Escanea etiqueta del medio"
|
||||
3 -> message = "Escanea etiqueta inferior"
|
||||
4 -> message = "Carro escaneado"
|
||||
|
||||
return when (TagsScaned) {
|
||||
0 -> "Escanea etiqueta/s electrónica/s o matrícula/s"
|
||||
1 -> "Escanea etiqueta superior"
|
||||
2 -> "Escanea etiqueta del medio"
|
||||
3 -> "Escanea etiqueta inferior"
|
||||
4 -> "Carro escaneado"
|
||||
else -> {""}
|
||||
}
|
||||
return message
|
||||
|
||||
}
|
||||
|
||||
private fun getTextScaned(TagScaned: Int): String {
|
||||
var message = ""
|
||||
|
||||
|
||||
when (TagScaned) {
|
||||
0 -> message = "Escaneado:"
|
||||
1 -> message = "Carro:"
|
||||
2 -> message = "Etiqueta superior:"
|
||||
3 -> message = "Escanea del medio:"
|
||||
4 -> message = "Etiqueta inferior:"
|
||||
return when (TagScaned) {
|
||||
0 -> "Escaneado:"
|
||||
1 -> "Carro:"
|
||||
2 -> "Etiqueta superior:"
|
||||
3 -> "Escanea del medio:"
|
||||
4 -> "Etiqueta inferior:"
|
||||
else -> {""}
|
||||
}
|
||||
|
||||
return message
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package es.verdnatura.presentation.view.feature.ubicador.fragment
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentAutomaticAddItemBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnAutomaticItemClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -17,18 +14,12 @@ import es.verdnatura.presentation.view.component.CustomDialogUbicador
|
|||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapter
|
||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemEscanerVO
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_automatic_add_item.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
|
||||
class AutomaticAddItemFragment(
|
||||
var shelvingFk : String = ""
|
||||
) : BaseFragment<FragmentAutomaticAddItemBinding,AutomaticAddItemViewModel>(AutomaticAddItemViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter : AutomaticAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private lateinit var customDialogUbicador : CustomDialogUbicador
|
||||
|
@ -45,15 +36,10 @@ class AutomaticAddItemFragment(
|
|||
|
||||
override fun init() {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
password = prefs.getString(PASSWORD,"").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK,SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,WAREHOUSEFKDEFAULT).toString()
|
||||
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogUbicador = CustomDialogUbicador(requireContext())
|
||||
// requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = "itemShelvingMake"
|
||||
setEvents()
|
||||
|
@ -111,7 +97,7 @@ class AutomaticAddItemFragment(
|
|||
}
|
||||
listItems = ArrayList()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingMake_multi(user,password,shelvingFk,listString,deep.toString(),warehouseFk,"1")
|
||||
viewModel.itemShelvingMake_multi( getData(USER),getData(PASSWORD),shelvingFk,listString,deep.toString(),getData(WAREHOUSEFK),"1")
|
||||
}
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
|
|
|
@ -14,8 +14,6 @@ import androidx.lifecycle.Observer
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentUbicadorBinding
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
|
@ -24,15 +22,11 @@ import es.verdnatura.presentation.view.component.CustomDialog
|
|||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.component.CustomDialogTwoButtons
|
||||
import es.verdnatura.presentation.view.component.CustomDialogUbicador
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter
|
||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_ubicador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class UbicadorFragment(
|
||||
var shelvingFk: String = ""
|
||||
|
@ -40,10 +34,6 @@ class UbicadorFragment(
|
|||
UbicadorViewModel::class
|
||||
) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter: UbicadorAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
private lateinit var customDialogUbicador: CustomDialogUbicador
|
||||
|
@ -71,16 +61,11 @@ class UbicadorFragment(
|
|||
|
||||
override fun init() {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
sectorFk = prefs.getInt(SECTORFK, SECTORFKDEFAULT).toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, WAREHOUSEFKDEFAULT).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogUbicador = CustomDialogUbicador(requireContext())
|
||||
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.locator)
|
||||
setEvents()
|
||||
|
@ -88,7 +73,7 @@ class UbicadorFragment(
|
|||
if (!shelvingFk.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = shelvingFk
|
||||
viewModel.itemShelvingList(user, password, shelvingFk, "itemShelvingList")
|
||||
viewModel.itemShelvingList( getData(USER), getData(PASSWORD), shelvingFk, "itemShelvingList")
|
||||
}
|
||||
super.init()
|
||||
}
|
||||
|
@ -101,7 +86,6 @@ class UbicadorFragment(
|
|||
|
||||
private fun setToolBar() {
|
||||
|
||||
|
||||
/* val listIcons:ArrayList<Drawable> = ArrayList()
|
||||
val iconAdd : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
|
||||
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||
|
@ -128,8 +112,8 @@ class UbicadorFragment(
|
|||
iconReload.drawable -> {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingList(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
"itemShelvingList"
|
||||
)
|
||||
|
@ -162,8 +146,8 @@ class UbicadorFragment(
|
|||
shelvingFk = binding.editMatricula.text.toString()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingList(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
binding.editMatricula.text.toString(),
|
||||
"itemShelvingList"
|
||||
)
|
||||
|
@ -181,8 +165,8 @@ class UbicadorFragment(
|
|||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!binding.editPrioridad.text.toString().isNullOrEmpty()) {
|
||||
viewModel.shelvingPriorityUpdate(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
binding.editPrioridad.text.toString(),
|
||||
shelvingFk,
|
||||
"shelvingPriority_update"
|
||||
|
@ -210,8 +194,8 @@ class UbicadorFragment(
|
|||
binding.parkingImg.setOnClickListener {
|
||||
customDialogInput.setTitle("Aparcar carro").setValue("").setOkButton("Aparcar") {
|
||||
viewModel.shelvingPark(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
customDialogInput.getValue(),
|
||||
"shelvingPark"
|
||||
|
@ -231,8 +215,8 @@ class UbicadorFragment(
|
|||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
viewModel.shelvingPark(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
customDialogInput.getValue(),
|
||||
"shelvingPark"
|
||||
|
@ -259,8 +243,8 @@ class UbicadorFragment(
|
|||
binding.editImg.setOnClickListener {
|
||||
customDialogInput.setTitle("Cambiar matrícula").setValue("").setOkButton("Guardar") {
|
||||
viewModel.shelvingChange(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
customDialogInput.getValue(),
|
||||
"shelvingChange"
|
||||
|
@ -280,8 +264,8 @@ class UbicadorFragment(
|
|||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
viewModel.shelvingChange(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
customDialogInput.getValue(),
|
||||
"shelvingChange"
|
||||
|
@ -301,7 +285,8 @@ class UbicadorFragment(
|
|||
binding.deleteImg.setOnClickListener {
|
||||
customDialog.setTitle("Vaciar carro")
|
||||
.setDescription("Esta operación no se puede rectificar.").setOkButton("Vaciar") {
|
||||
viewModel.clearShelvingList(user, password, shelvingFk, "clearShelvingList")
|
||||
viewModel.clearShelvingList(getData(USER),
|
||||
getData(PASSWORD), shelvingFk, "clearShelvingList")
|
||||
listItems.forEach {
|
||||
it.stickers = "0"
|
||||
it.visible = "0"
|
||||
|
@ -415,7 +400,8 @@ class UbicadorFragment(
|
|||
if (!shelvingFk.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = shelvingFk
|
||||
viewModel.itemShelvingList(user, password, shelvingFk, "itemShelvingList")
|
||||
viewModel.itemShelvingList(getData(USER),
|
||||
getData(PASSWORD), shelvingFk, "itemShelvingList")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -510,14 +496,14 @@ class UbicadorFragment(
|
|||
if (updatePacking == null) {
|
||||
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty()) {
|
||||
viewModel.itemShelvingMake(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
itemFk,
|
||||
deep.toString(),
|
||||
visible,
|
||||
packing,
|
||||
warehouseFk,
|
||||
getData(WAREHOUSEFK),
|
||||
"1",
|
||||
"itemShelvingMake",
|
||||
groupingPack
|
||||
|
@ -538,14 +524,14 @@ class UbicadorFragment(
|
|||
} else if (!itemFk.isNullOrEmpty() && !etiquetas.isNullOrEmpty()) {
|
||||
val visible_calc = (etiquetas.toInt() * packing.toInt()).toString()
|
||||
viewModel.itemShelvingMake(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
itemFk,
|
||||
deep.toString(),
|
||||
visible_calc,
|
||||
packing,
|
||||
warehouseFk,
|
||||
getData(WAREHOUSEFK),
|
||||
"1",
|
||||
"itemShelvingMake",
|
||||
groupingPack
|
||||
|
@ -573,14 +559,14 @@ class UbicadorFragment(
|
|||
} else {
|
||||
if (!itemFk.isNullOrEmpty() && !visible.isNullOrEmpty() && !updatePacking) {
|
||||
viewModel.itemShelvingMakeEdit(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
itemFk,
|
||||
deep.toString(),
|
||||
visible,
|
||||
packing,
|
||||
warehouseFk,
|
||||
getData(WAREHOUSEFK),
|
||||
"1",
|
||||
itemShelvingFk,
|
||||
"itemShelvingMakeEdit",
|
||||
|
@ -606,14 +592,14 @@ class UbicadorFragment(
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
viewModel.itemShelvingMakeEdit(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
shelvingFk,
|
||||
itemFk,
|
||||
deep.toString(),
|
||||
visible_calc,
|
||||
packing,
|
||||
warehouseFk,
|
||||
getData(WAREHOUSEFK),
|
||||
"1",
|
||||
itemShelvingFk,
|
||||
"itemShelvingMakeEdit",
|
||||
|
@ -683,8 +669,8 @@ class UbicadorFragment(
|
|||
.setOkButton("Transferir") {
|
||||
if (customDialogInput.getValue().isNotEmpty()) {
|
||||
viewModel.itemShelvingTransfer(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
item.id,
|
||||
customDialogInput.getValue(),
|
||||
"itemShelvingTransfer"
|
||||
|
@ -705,8 +691,8 @@ class UbicadorFragment(
|
|||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
viewModel.itemShelvingTransfer(
|
||||
user,
|
||||
password,
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
item.id,
|
||||
customDialogInput.getValue(),
|
||||
"itemShelvingTransfer"
|
||||
|
@ -725,7 +711,8 @@ class UbicadorFragment(
|
|||
.setOkButton("Eliminar") {
|
||||
listItems.remove(item)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
viewModel.itemShelvingDelete(user, password, item.id, "itemShelvingDelete")
|
||||
viewModel.itemShelvingDelete(getData(USER),
|
||||
getData(PASSWORD), item.id, "itemShelvingDelete")
|
||||
customDialogTwoButtons.dismiss()
|
||||
customDialog.dismiss()
|
||||
}.setKoButton("Cancelar") {
|
||||
|
|
|
@ -6,7 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageError
|
||||
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
|
|
Binary file not shown.
|
@ -2,7 +2,13 @@
|
|||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_gravity="left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -31,4 +37,5 @@
|
|||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
</layout>
|
|
@ -3,12 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.calidad.fragment.BuyersViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tool="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel" />
|
||||
</data>
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
|
||||
type="es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.smarttag.sacador.model.SmartTagScan" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:clickable="false">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.sacador.fragment.SacadorViewModel" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionPalletViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionPalletDetailViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue