Compare commits
31 Commits
Author | SHA1 | Date |
---|---|---|
Sergio De la torre | 84a2b8ca82 | |
Sergio De la torre | 41f9fb4a9a | |
Sergio De la torre | 7f0f69ae6f | |
Sergio De la torre | e72acd21f3 | |
Sergio De la torre | a960ff43a7 | |
Sergio De la torre | bd4ffa35bf | |
Sergio De la torre | 2bfa6c8373 | |
Sergio De la torre | 622bb221ab | |
Sergio De la torre | f2eb4d4c11 | |
Sergio De la torre | 2c32244617 | |
Sergio De la torre | 61e6aa2a5a | |
Sergio De la torre | 7837a11254 | |
Sergio De la torre | 59deb90428 | |
Sergio De la torre | 83bc9d9de4 | |
Sergio De la torre | afc8abe090 | |
Sergio De la torre | 26e13bb7d0 | |
Sergio De la torre | d0e5e5d748 | |
Sergio De la torre | 5f614e0d6d | |
Sergio De la torre | c82c591c71 | |
Sergio De la torre | 7c2e418e87 | |
Sergio De la torre | 1f4663e68f | |
Sergio De la torre | c2bdb0766f | |
Sergio De la torre | 233399dcb3 | |
Sergio De la torre | ca91beddf3 | |
Sergio De la torre | cb328f13a3 | |
Sergio De la torre | 9d84ce3a0d | |
Sergio De la torre | 071295c521 | |
Sergio De la torre | ccf56fdebf | |
Sergio De la torre | 8cecd276b0 | |
Sergio De la torre | 8e0ffe8f49 | |
Sergio De la torre | 3f88449718 |
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="2.0.0" />
|
<option name="version" value="2.0.10" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -40,6 +40,16 @@
|
||||||
</config>
|
</config>
|
||||||
</shared>
|
</shared>
|
||||||
<layouts>
|
<layouts>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/drawable/ic_click.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/drawable/ic_logout.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/activity_login.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/activity_login.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -55,6 +65,11 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_dialog.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_edit_dialog.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_edit_dialog.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -75,11 +90,21 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_hour.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_list_dialog.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_list_dialog.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_three_dialog.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_two_dialog.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_two_dialog.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -90,6 +115,16 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_searchable_dialog.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_searchable_dialog_alert.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_ajustes.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_ajustes.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -125,6 +160,11 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_expedition_loadunload_delivery.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_expedition_log_delivery.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_expedition_log_delivery.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -155,6 +195,11 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_inventary.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_item_card.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_item_card.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -170,6 +215,11 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_packaging.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_packaging_count.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_packaging_count.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -195,11 +245,21 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_route_config.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_sacador.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_sacador.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_salary_complement.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_stopmap_truck_list.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_stopmap_truck_list.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -220,6 +280,16 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_workermistake.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_ajustes_row.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_article_row_fragment.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_article_row_fragment.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -230,6 +300,11 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_expedition_loadunload_row.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_expedition_summary_row.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_expedition_summary_row.xml">
|
||||||
<config>
|
<config>
|
||||||
<state>Landscape</state>
|
<state>Landscape</state>
|
||||||
|
@ -286,6 +361,11 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_placement_row.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_roadmap_truck_row.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_roadmap_truck_row.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -296,6 +376,11 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_salary_complement_row.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_shelvinglog_row.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_shelvinglog_row.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -321,16 +406,36 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_workermistake_row.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/sale_row_fragment.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/sale_row_fragment.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/searchable_dialog.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/toolbar_fragment.xml">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/toolbar_fragment.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</layout>
|
||||||
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/navigation/nav_graph.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
|
<layout url="file://$USER_HOME$/AppData/Local/Android/Sdk/platforms/android-35/data/res/layout/simple_list_item_1.xml">
|
||||||
|
<config>
|
||||||
|
<theme>@style/AppTheme</theme>
|
||||||
|
</config>
|
||||||
|
</layout>
|
||||||
</layouts>
|
</layouts>
|
||||||
</component>
|
</component>
|
||||||
<component name="AndroidLogFilters">
|
<component name="AndroidLogFilters">
|
||||||
|
@ -373,103 +478,40 @@
|
||||||
</select>
|
</select>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="feat: refactorResponse PasillerosItem refs #7827">
|
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="feat: refs #8022 kotlin versionCatalog">
|
||||||
|
<change afterPath="$PROJECT_DIR$/app/general/release/baselineProfiles/0/app-general-release.dm" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/app/src/main/res/layout/component_searchable_dialog_alert.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/appInsightsSettings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/appInsightsSettings.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/appInsightsSettings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/appInsightsSettings.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/kotlinc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/kotlinc.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/general/release/baselineProfiles/1/app-general-release.dm" beforeDir="false" afterPath="$PROJECT_DIR$/app/general/release/baselineProfiles/1/app-general-release.dm" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/di/viewModelModule.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/di/viewModelModule.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/proguard-rules.pro" beforeDir="false" afterPath="$PROJECT_DIR$/app/proguard-rules.pro" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/MobileApplication.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/MobileApplication.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseActivity.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/GeneralAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/GeneralAdapter.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/GeneralAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/GeneralAdapter.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/UICallbacks.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/UtilFunctions.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/UtilFunctions.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemProposalAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/adapter/BufferAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/adapter/BufferAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/adapter/LocationAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/adapter/LocationAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/category/ChangeCategoryFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/category/ChangeCategoryFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/category/ChangeCategoryViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/category/ChangeCategoryViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/reubication/adapter/ReubicatorAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/reubication/adapter/ReubicatorAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/reubication/adapter/ReubicatorPlacementAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/reubication/adapter/ReubicatorPlacementAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ubication/ClaimUbicationFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ubication/ClaimUbicationFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/PlacementAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/PlacementAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapterNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapterNew.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerPreviousNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerPreviousNew.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreChecker.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreCheckerNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPreCheckerNew.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LogExpeditionFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/activity/SignedActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/activity/SignedActivity.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/RoutesFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/RoutesFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/RoutesFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/RoutesFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/SummaryFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/SummaryFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/TicketsFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/TicketsFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryParkingFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/model/LoginItemVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/model/LoginItemVO.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/adapter/DayOfSaleAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/adapter/DayOfSaleAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/adapter/ItemShelvingLogAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/adapter/ItemShelvingLogAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/adapter/InventoryAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/adapter/InventoryAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/adapter/InventoryParkingAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/adapter/InventoryParkingAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/adapter/WorkFormAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/adapter/WorkFormAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ItemSupplierAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ItemSupplierAdapter.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/adapter/ExpeditionPalletAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/adapter/ExpeditionPalletAdapter.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ListImageAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/adapter/ListImageAdapter.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionDeleteFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionDeleteFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/ObservFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/ObservFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletViewModel.kt" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPreparedStateFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPreparedStateFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPreparedStateFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPreparedStateFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragmentNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragmentNew.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionTruckListViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemExpeditionTruckVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemExpeditionTruckVO.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemPalletVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemPalletVO.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemScanVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/model/ItemScanVO.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/precontrol/PreControladorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/precontrol/PreControladorFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/precontrol/PreControladorViewModel.kt" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/adapter/PreSacadorAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/adapter/PreSacadorAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/SectorCollectionReserveFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/SectorCollectionReserveFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/roadmap/fragment/StopMapListFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/roadmap/fragment/StopMapListFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapterNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapterNew.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragmentNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragmentNew.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/PackingMistakeFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/PackingMistakeFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/fragment/WorkermistakeFragment.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/model/mistakeWorkerType.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/workermistake/model/mistakeWorkerType.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-fr/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-fr/strings.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-pt/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-pt/strings.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<list id="7b98f93d-6980-4bf1-8e61-c7afd10e56f2" name="Change_category" comment="Change_category" />
|
<list id="7b98f93d-6980-4bf1-8e61-c7afd10e56f2" name="Change_category" comment="Change_category" />
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
@ -574,7 +616,7 @@
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||||
<map>
|
<map>
|
||||||
<entry key="$PROJECT_DIR$" value="dev" />
|
<entry key="$PROJECT_DIR$" value="dev_collectionFragmentChecker" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
@ -635,63 +677,63 @@
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
<option name="showMembers" value="true" />
|
<option name="showMembers" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"Android App.app.executor": "Run",
|
"Android App.app.executor": "Run",
|
||||||
"ApkExportedModule": "Gestor_Almacén.app",
|
"ApkExportedModule": "Gestor_Almacén.app",
|
||||||
"DEBUGGABLE_DEVICE": "zebra_technologies-tc21-21114523025303",
|
"DEBUGGABLE_DEVICE": "zebra_technologies-tc21-21114523025303",
|
||||||
"DEBUGGABLE_PROCESS": "es.verdnatura.sfusion",
|
"DEBUGGABLE_PROCESS": "es.verdnatura.sfusion",
|
||||||
"DEBUGGER_ID": "Auto",
|
"DEBUGGER_ID": "Auto",
|
||||||
"ExportApk.ApkPathForGestor_Almacén.app": "C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app",
|
"ExportApk.ApkPathForGestor_Almacén.app": "C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app",
|
||||||
"Gradle.vn-warehouseManager [clean].executor": "Run",
|
"Gradle.vn-warehouseManager [clean].executor": "Run",
|
||||||
"Gradle.vn-warehouseManager.executor": "Run",
|
"Gradle.vn-warehouseManager.executor": "Run",
|
||||||
"KotlinFunctionFindUsagesOptions.isSearchForTextOccurrences": "true",
|
"KotlinFunctionFindUsagesOptions.isSearchForTextOccurrences": "true",
|
||||||
"PROJECT_TRUSTED_KEY": "true",
|
"PROJECT_TRUSTED_KEY": "true",
|
||||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||||
"RunOnceActivity.readMode.enableVisualFormatting": "true",
|
"RunOnceActivity.readMode.enableVisualFormatting": "true",
|
||||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"SHOW_ALL_PROCESSES": "false",
|
"SHOW_ALL_PROCESSES": "false",
|
||||||
"ScreenRecorder.SavePath": "C:\\Users\\sergiodt",
|
"ScreenRecorder.SavePath": "C:\\Users\\sergiodt",
|
||||||
"android-custom-viewC:/Users/sergiodt/.gradle/caches/modules-2/files-2.1/androidx.recyclerview/recyclerview/1.2.1/f0f93e67af3f7417bdd560d5142f6dec4fe629c3/recyclerview-1.2.1-sources.jar!/androidx/recyclerview/widget/RecyclerView.java_SELECTED": "RecyclerView",
|
"android-custom-viewC:/Users/sergiodt/.gradle/caches/modules-2/files-2.1/androidx.recyclerview/recyclerview/1.2.1/f0f93e67af3f7417bdd560d5142f6dec4fe629c3/recyclerview-1.2.1-sources.jar!/androidx/recyclerview/widget/RecyclerView.java_SELECTED": "RecyclerView",
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-29/android/widget/TextView.java_SELECTED": "TextView",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-29/android/widget/TextView.java_SELECTED": "TextView",
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-33/android/view/View.java_SELECTED": "View",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-33/android/view/View.java_SELECTED": "View",
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/view/View.java_SELECTED": "View",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/view/View.java_SELECTED": "View",
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/CompoundButton.java_SELECTED": "CompoundButton",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/CompoundButton.java_SELECTED": "CompoundButton",
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/TextView.java_SELECTED": "TextView",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/TextView.java_SELECTED": "TextView",
|
||||||
"cf.first.check.clang-format": "false",
|
"cf.first.check.clang-format": "false",
|
||||||
"cidr.known.project.marker": "true",
|
"cidr.known.project.marker": "true",
|
||||||
"com.developerphil.adbidea.selecteddevices": "G65TY9DQN7X4BIE6",
|
"com.developerphil.adbidea.selecteddevices": "G65TY9DQN7X4BIE6",
|
||||||
"com.google.services.firebase.aqiPopupShown": "true",
|
"com.google.services.firebase.aqiPopupShown": "true",
|
||||||
"git-widget-placeholder": "dev__6078",
|
"git-widget-placeholder": "dev__6078",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_directory_selection": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable",
|
"last_directory_selection": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable",
|
||||||
"last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout",
|
"last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app",
|
||||||
"project.structure.last.edited": "Modules",
|
"project.structure.last.edited": "Project",
|
||||||
"project.structure.proportion": "0.17",
|
"project.structure.proportion": "0.17",
|
||||||
"project.structure.side.proportion": "0.2",
|
"project.structure.side.proportion": "0.2",
|
||||||
"rearrange.code.on.save": "true",
|
"rearrange.code.on.save": "true",
|
||||||
"run.code.analysis.last.selected.profile": "pProject Default",
|
"run.code.analysis.last.selected.profile": "pProject Default",
|
||||||
"settings.editor.selected.configurable": "actions.on.save"
|
"settings.editor.selected.configurable": "preferences.pluginManager"
|
||||||
},
|
},
|
||||||
"keyToStringList": {
|
"keyToStringList": {
|
||||||
"ExportApk.BuildVariants": [
|
"ExportApk.BuildVariants": [
|
||||||
"betaRelease"
|
"generalRelease"
|
||||||
],
|
],
|
||||||
"com.android.tools.idea.sqlite.queryhistory": [
|
"com.android.tools.idea.sqlite.queryhistory": [
|
||||||
"select * from expedition where routeFk=182933;",
|
"select * from expedition where routeFk=182933;",
|
||||||
"select * from expedition;",
|
"select * from expedition;",
|
||||||
"select * from expeditionPending;",
|
"select * from expeditionPending;",
|
||||||
"select * from expedition where id = 7753995;\n\n",
|
"select * from expedition where id = 7753995;\n\n",
|
||||||
"\nselect * from expedition where id = 7753995;"
|
"\nselect * from expedition where id = 7753995;"
|
||||||
],
|
],
|
||||||
"kotlin-gradle-user-dirs": [
|
"kotlin-gradle-user-dirs": [
|
||||||
"C:\\Users\\sergiodt\\.gradle"
|
"C:\\Users\\sergiodt\\.gradle"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="PsdUISettings">
|
<component name="PsdUISettings">
|
||||||
<option name="MODULE_TAB" value="Properties" />
|
<option name="MODULE_TAB" value="Properties" />
|
||||||
<option name="LAST_EDITED_SIGNING_CONFIG" value="debug" />
|
<option name="LAST_EDITED_SIGNING_CONFIG" value="debug" />
|
||||||
|
@ -699,18 +741,18 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\layout" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\layout" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\java\es\verdnatura\domain" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\java\es\verdnatura\domain" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\xml" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\xml" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\raw" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\gradle" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\java\es\verdnatura\domain\userCases" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\java\es\verdnatura\domain\userCases" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable-v24" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\drawable-v24" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\raw" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\raw" />
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\assets" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveKotlinTopLevelDeclarationsDialog.RECENTS_KEY">
|
<key name="MoveKotlinTopLevelDeclarationsDialog.RECENTS_KEY">
|
||||||
<recent name="es.verdnatura.presentation.view.feature.claim.fragment.ubication" />
|
<recent name="es.verdnatura.presentation.view.feature.claim.fragment.ubication" />
|
||||||
|
@ -720,11 +762,11 @@
|
||||||
<recent name="es.verdnatura.presentation.view.feature.historicoshelving.fragment" />
|
<recent name="es.verdnatura.presentation.view.feature.historicoshelving.fragment" />
|
||||||
</key>
|
</key>
|
||||||
<key name="CopyKotlinDeclarationDialog.RECENTS_KEY">
|
<key name="CopyKotlinDeclarationDialog.RECENTS_KEY">
|
||||||
|
<recent name="es.verdnatura.presentation.view.feature.delivery.adapters" />
|
||||||
|
<recent name="es.verdnatura.presentation.view.feature.delivery.fragments" />
|
||||||
|
<recent name="es.verdnatura.domain.userCases" />
|
||||||
<recent name="es.verdnatura.presentation.view.feature.paletizador.fragment" />
|
<recent name="es.verdnatura.presentation.view.feature.paletizador.fragment" />
|
||||||
<recent name="es.verdnatura.presentation.view.feature.parking.fragment" />
|
<recent name="es.verdnatura.presentation.view.feature.parking.fragment" />
|
||||||
<recent name="es.verdnatura.presentation.view.feature.collection.fragment" />
|
|
||||||
<recent name="es.verdnatura.domain" />
|
|
||||||
<recent name="es.verdnatura.presentation.view.feature.truck.adapter" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="CopyClassDialog.RECENTS_KEY">
|
<key name="CopyClassDialog.RECENTS_KEY">
|
||||||
<recent name="es.verdnatura.presentation.view.feature.delivery.activity" />
|
<recent name="es.verdnatura.presentation.view.feature.delivery.activity" />
|
||||||
|
@ -873,6 +915,13 @@
|
||||||
</recent_temporary>
|
</recent_temporary>
|
||||||
</component>
|
</component>
|
||||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||||
|
<component name="StandaloneScriptsStorage">
|
||||||
|
<option name="files">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$/build.gradle.kts" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
<component name="SvnConfiguration">
|
<component name="SvnConfiguration">
|
||||||
<configuration>C:\Users\sergiodt\AppData\Roaming\Subversion</configuration>
|
<configuration>C:\Users\sergiodt\AppData\Roaming\Subversion</configuration>
|
||||||
</component>
|
</component>
|
||||||
|
@ -1228,7 +1277,7 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1709725795643</updated>
|
<updated>1709725795643</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="338" />
|
<option name="localTasksCounter" value="363" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.History.Properties">
|
<component name="Vcs.Log.History.Properties">
|
||||||
|
@ -1356,22 +1405,6 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||||
<MESSAGE value="feat refactor Ubicador #refs 6413" />
|
|
||||||
<MESSAGE value="feat notesDelivery #refs 6921" />
|
|
||||||
<MESSAGE value="feat lilium" />
|
|
||||||
<MESSAGE value="feat bugs" />
|
|
||||||
<MESSAGE value="feat ticketQr #refs 6602" />
|
|
||||||
<MESSAGE value="feat itemToBarCode refs #7614" />
|
|
||||||
<MESSAGE value="feat boxPicking #refs 7357" />
|
|
||||||
<MESSAGE value="feat itemShelvingLog #refs 7597" />
|
|
||||||
<MESSAGE value="feat roadMap #refs 7195" />
|
|
||||||
<MESSAGE value="feat inventory #refs 7023" />
|
|
||||||
<MESSAGE value="feat version24.28" />
|
|
||||||
<MESSAGE value="feat Ticketobservation refs #7541" />
|
|
||||||
<MESSAGE value="feat isF11Allowed refs #6435" />
|
|
||||||
<MESSAGE value="feat boxPickingCheck refs #7751" />
|
|
||||||
<MESSAGE value="feat barCode in ItemShelvingLog refs #7739" />
|
|
||||||
<MESSAGE value="feat Rename refs #7763" />
|
|
||||||
<MESSAGE value="feat reservas #refs 6861" />
|
<MESSAGE value="feat reservas #refs 6861" />
|
||||||
<MESSAGE value="feat issues refs #7636" />
|
<MESSAGE value="feat issues refs #7636" />
|
||||||
<MESSAGE value="feat getAddress #refs 7622" />
|
<MESSAGE value="feat getAddress #refs 7622" />
|
||||||
|
@ -1381,32 +1414,48 @@
|
||||||
<MESSAGE value="feat itemGetBalance refs #6769" />
|
<MESSAGE value="feat itemGetBalance refs #6769" />
|
||||||
<MESSAGE value="feat: boxPickingPrepared refs #7855" />
|
<MESSAGE value="feat: boxPickingPrepared refs #7855" />
|
||||||
<MESSAGE value="feat: refactorResponse PasillerosItem refs #7827" />
|
<MESSAGE value="feat: refactorResponse PasillerosItem refs #7827" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="feat: refactorResponse PasillerosItem refs #7827" />
|
<MESSAGE value="version 24.40" />
|
||||||
|
<MESSAGE value="feat: refs #7922 scanOrder" />
|
||||||
|
<MESSAGE value="feat: refs #8020 controlVehiculos" />
|
||||||
|
<MESSAGE value="feat: refs #5443 collectionFragmentChecker" />
|
||||||
|
<MESSAGE value="feat: refs #6861 reservas" />
|
||||||
|
<MESSAGE value="feat: refs #8175 crashlyticsAndUpdate" />
|
||||||
|
<MESSAGE value="feat: refs #7266 printItem" />
|
||||||
|
<MESSAGE value="feat: refs #6845 userIterface" />
|
||||||
|
<MESSAGE value="feat: refs #8150 moveExpeditions" />
|
||||||
|
<MESSAGE value="feat: refs #8099 addSalarySupplement" />
|
||||||
|
<MESSAGE value="feat: refs #8082 ticketPickup" />
|
||||||
|
<MESSAGE value="feat: refs #8176 refactorSearchDialog" />
|
||||||
|
<MESSAGE value="feat: refs #8182 zoneClickable" />
|
||||||
|
<MESSAGE value="feat: refs#8213 reservas" />
|
||||||
|
<MESSAGE value="feat: refs#6845 userInterface" />
|
||||||
|
<MESSAGE value="feat: refs #8022 kotlin versionCatalog" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="feat: refs #8022 kotlin versionCatalog" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<breakpoint-manager>
|
<breakpoint-manager>
|
||||||
<breakpoints>
|
<breakpoints>
|
||||||
<line-breakpoint enabled="true" type="kotlin-function">
|
<line-breakpoint enabled="true" type="kotlin-function">
|
||||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
||||||
<line>72</line>
|
<line>76</line>
|
||||||
<properties class="es.verdnatura.domain.SalixCallback" method="onError">
|
<properties class="es.verdnatura.domain.SalixCallback" method="errorSalixMessage">
|
||||||
<option name="WATCH_EXIT" value="false" />
|
<option name="WATCH_EXIT" value="false" />
|
||||||
</properties>
|
</properties>
|
||||||
<option name="timeStamp" value="11" />
|
<option name="timeStamp" value="11" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" type="kotlin-line">
|
<line-breakpoint enabled="true" type="kotlin-line">
|
||||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
||||||
<line>82</line>
|
<line>86</line>
|
||||||
<option name="timeStamp" value="12" />
|
<option name="timeStamp" value="12" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" type="kotlin-line">
|
<line-breakpoint enabled="true" type="kotlin-line">
|
||||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
||||||
<line>81</line>
|
<line>85</line>
|
||||||
<option name="timeStamp" value="13" />
|
<option name="timeStamp" value="13" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" type="kotlin-line">
|
<line-breakpoint enabled="true" type="kotlin-line">
|
||||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt</url>
|
||||||
<line>83</line>
|
<line>87</line>
|
||||||
<option name="timeStamp" value="14" />
|
<option name="timeStamp" value="14" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
</breakpoints>
|
</breakpoints>
|
||||||
|
|
172
app/build.gradle
172
app/build.gradle
|
@ -1,172 +0,0 @@
|
||||||
apply plugin: 'com.android.application'
|
|
||||||
apply plugin: 'kotlin-android'
|
|
||||||
apply plugin: 'kotlin-kapt'
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
|
||||||
apply plugin: 'com.google.devtools.ksp'
|
|
||||||
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace = "es.verdnatura"
|
|
||||||
compileSdk 34
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "es.verdnatura"
|
|
||||||
minSdkVersion 26
|
|
||||||
targetSdkVersion 33 // se deja con target si no Play Protect la bloquea
|
|
||||||
versionCode 351
|
|
||||||
versionName = "24.40"
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
/*debuggable false
|
|
||||||
shrinkResources true
|
|
||||||
minifyEnabled true*/
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
|
|
||||||
//package de la app general = "package_name": "es.verdnatura"
|
|
||||||
//package de la app beta = "package_name": "es.verdnatura.sfusion"
|
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
|
||||||
variant.outputs.all { output ->
|
|
||||||
def flavorName = variant.productFlavors[0].name
|
|
||||||
def apkName
|
|
||||||
|
|
||||||
if (flavorName == "beta") {
|
|
||||||
apkName = "vn-pickingBeta.apk"
|
|
||||||
} else if (flavorName == "general") {
|
|
||||||
apkName = "vn-picking.apk"
|
|
||||||
} else {
|
|
||||||
apkName = "vn-picking.apk"
|
|
||||||
}
|
|
||||||
|
|
||||||
output.outputFileName = apkName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flavorDimensions += "version"
|
|
||||||
productFlavors {
|
|
||||||
create("beta") {
|
|
||||||
applicationIdSuffix = ".sfusion"
|
|
||||||
}
|
|
||||||
create("general") {
|
|
||||||
//versionNameSuffix = "General"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildFeatures {
|
|
||||||
viewBinding = true
|
|
||||||
|
|
||||||
}
|
|
||||||
/*kotlinOptions {
|
|
||||||
jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
buildFeatures {
|
|
||||||
compose = true
|
|
||||||
}
|
|
||||||
kotlin {
|
|
||||||
jvmToolchain(8)
|
|
||||||
}
|
|
||||||
composeOptions {
|
|
||||||
kotlinCompilerExtensionVersion = "1.4.3"
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
dataBinding {
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_17
|
|
||||||
targetCompatibility JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
||||||
implementation 'com.google.firebase:firebase-crashlytics-ktx:19.0.3'
|
|
||||||
implementation 'com.google.firebase:firebase-analytics-ktx:22.0.2'
|
|
||||||
implementation 'com.google.android.gms:play-services-location:21.3.0'
|
|
||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
|
|
||||||
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
|
|
||||||
implementation 'androidx.core:core-ktx:1.13.1'
|
|
||||||
kapt "androidx.room:room-compiler:2.6.1"
|
|
||||||
implementation 'androidx.room:room-ktx:2.6.1'
|
|
||||||
debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar'])
|
|
||||||
releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar'])
|
|
||||||
|
|
||||||
//canvas
|
|
||||||
implementation 'com.simplify:ink:1.0.0'
|
|
||||||
|
|
||||||
// Kotlin and Android
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
|
||||||
implementation 'androidx.core:core-ktx:1.13.1'
|
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
|
||||||
|
|
||||||
//tests
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
||||||
implementation 'com.google.android.material:material:1.12.0'
|
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
|
|
||||||
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
|
||||||
implementation "com.airbnb.android:lottie:$lottieVersion"
|
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
|
||||||
|
|
||||||
//Fragments
|
|
||||||
implementation("androidx.fragment:fragment-ktx:1.8.2")
|
|
||||||
|
|
||||||
// Architecture components
|
|
||||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4"
|
|
||||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.4"
|
|
||||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
|
||||||
|
|
||||||
//Koin new resolve
|
|
||||||
implementation "io.insert-koin:koin-core:$koin"
|
|
||||||
implementation "io.insert-koin:koin-android:$koin"
|
|
||||||
implementation "io.insert-koin:koin-androidx-scope:$koin"
|
|
||||||
implementation "io.insert-koin:koin-androidx-viewmodel:$koin"
|
|
||||||
|
|
||||||
// Image libraries
|
|
||||||
implementation "io.coil-kt:coil:$coil"
|
|
||||||
implementation "com.github.bumptech.glide:glide:$glide"
|
|
||||||
implementation "com.github.bumptech.glide:okhttp3-integration:$glide"
|
|
||||||
//kapt "com.github.bumptech.glide:compiler:$glide"
|
|
||||||
ksp("com.github.bumptech.glide:ksp:$glide")
|
|
||||||
|
|
||||||
// Add the Firebase Crashlytics SDK.
|
|
||||||
implementation 'com.google.firebase:firebase-analytics:22.0.2'
|
|
||||||
|
|
||||||
//search
|
|
||||||
implementation 'com.github.mirrajabi:search-dialog:1.1'
|
|
||||||
|
|
||||||
//logs
|
|
||||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
|
||||||
|
|
||||||
//pickerImage
|
|
||||||
implementation 'com.github.esafirm:android-image-picker:3.0.0-beta5'
|
|
||||||
|
|
||||||
//preferences
|
|
||||||
implementation("androidx.datastore:datastore-preferences:1.1.1")
|
|
||||||
implementation 'androidx.datastore:datastore-core:1.1.1'
|
|
||||||
|
|
||||||
//qr
|
|
||||||
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
|
|
||||||
implementation 'com.google.zxing:core:3.3.0'
|
|
||||||
|
|
||||||
// Compose
|
|
||||||
/* implementation(platform("androidx.compose:compose-bom:2024.02.01"))
|
|
||||||
implementation("androidx.compose.ui:ui")
|
|
||||||
implementation("androidx.compose.material:material")
|
|
||||||
implementation("androidx.compose.runtime:runtime")
|
|
||||||
implementation("androidx.activity:activity-compose:1.8.2")
|
|
||||||
implementation("androidx.compose.ui:ui-graphics")
|
|
||||||
implementation("androidx.compose.ui:ui-tooling-preview")*/
|
|
||||||
}
|
|
|
@ -0,0 +1,143 @@
|
||||||
|
plugins {
|
||||||
|
id("com.android.application")
|
||||||
|
id("kotlin-android")
|
||||||
|
id("kotlin-kapt")
|
||||||
|
id("com.google.gms.google-services")
|
||||||
|
id("com.google.firebase.crashlytics")
|
||||||
|
id("com.google.devtools.ksp")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "es.verdnatura"
|
||||||
|
compileSdk = 35
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId = "es.verdnatura"
|
||||||
|
minSdk = 26
|
||||||
|
targetSdk = 33 // se deja con target si no Play Protect la bloquea
|
||||||
|
versionCode = 358
|
||||||
|
versionName = "24.46"
|
||||||
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
getByName("release") {
|
||||||
|
//debuggable = false
|
||||||
|
//shrinkResources = true
|
||||||
|
//minifyEnabled = true
|
||||||
|
proguardFiles(
|
||||||
|
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//package de la app general = "package_name": "es.verdnatura"
|
||||||
|
//package de la app beta = "package_name": "es.verdnatura.sfusion"
|
||||||
|
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
variant.outputs.all { output ->
|
||||||
|
val flavorName = variant.productFlavors[0].name
|
||||||
|
val buildTypeName = variant.buildType.name
|
||||||
|
|
||||||
|
val apkName = when (flavorName) {
|
||||||
|
"beta" -> "vn-pickingBeta-${buildTypeName}.apk"
|
||||||
|
else -> "vn-picking-${buildTypeName}.apk"
|
||||||
|
}
|
||||||
|
output.outputFile.renameTo(File(output.outputFile.parentFile, apkName))
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
flavorDimensions += "version"
|
||||||
|
productFlavors {
|
||||||
|
create("beta") {
|
||||||
|
applicationIdSuffix = ".sfusion"
|
||||||
|
}
|
||||||
|
create("general") {}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildFeatures {
|
||||||
|
viewBinding = true
|
||||||
|
//compose = true
|
||||||
|
|
||||||
|
/*kotlinOptions {
|
||||||
|
jvmTarget = "1.8"
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
compose = true
|
||||||
|
}
|
||||||
|
|
||||||
|
composeOptions {
|
||||||
|
kotlinCompilerExtensionVersion = "1.4.3"
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
dataBinding = true
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
/* composeOptions {
|
||||||
|
kotlinCompilerExtensionVersion = "1.5.15"
|
||||||
|
}*/
|
||||||
|
/* kotlin {
|
||||||
|
jvmToolchain(17)
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
}*/
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
|
||||||
|
implementation(libs.firebase.crashlytics.ktx)
|
||||||
|
implementation(libs.firebase.analytics.ktx)
|
||||||
|
implementation(libs.play.services.location)
|
||||||
|
implementation(libs.navigation.fragment.ktx)
|
||||||
|
implementation(libs.androidx.navigation.ui.ktx)
|
||||||
|
implementation(libs.androidx.core.ktx)
|
||||||
|
implementation(libs.androidx.recyclerview)
|
||||||
|
implementation(libs.androidx.room.ktx)
|
||||||
|
kapt(libs.androidx.room.compiler)
|
||||||
|
implementation(libs.ink)
|
||||||
|
implementation(libs.kotlin.stdlib.jdk7)
|
||||||
|
implementation(libs.androidx.appcompat)
|
||||||
|
implementation(libs.androidx.core.ktx)
|
||||||
|
implementation(libs.androidx.constraintlayout)
|
||||||
|
implementation(libs.androidx.legacy.support.v4)
|
||||||
|
implementation(libs.androidx.lifecycle.extensions)
|
||||||
|
implementation(libs.material)
|
||||||
|
implementation(libs.retrofit)
|
||||||
|
implementation(libs.converter.gson)
|
||||||
|
implementation(libs.converter.scalars)
|
||||||
|
implementation(libs.lottie)
|
||||||
|
implementation(libs.androidx.swiperefreshlayout)
|
||||||
|
implementation(libs.androidx.fragment.ktx)
|
||||||
|
implementation(libs.androidx.lifecycle.viewmodel.ktx)
|
||||||
|
implementation(libs.androidx.lifecycle.livedata.ktx)
|
||||||
|
implementation(libs.androidx.legacy.support.v4)
|
||||||
|
implementation(libs.koin.core)
|
||||||
|
implementation(libs.koin.android)
|
||||||
|
implementation(libs.koin.androidx.scope)
|
||||||
|
implementation(libs.koin.androidx.viewmodel)
|
||||||
|
implementation(libs.glide)
|
||||||
|
implementation(libs.okhttp3.integration)
|
||||||
|
ksp(libs.glide.ksp)
|
||||||
|
implementation(libs.firebase.analytics)
|
||||||
|
implementation(libs.android.image.picker)
|
||||||
|
implementation(libs.androidx.datastore.preferences)
|
||||||
|
implementation(libs.androidx.datastore.core)
|
||||||
|
implementation(libs.zxing.android.embedded) { isTransitive = false }
|
||||||
|
implementation(libs.core)
|
||||||
|
|
||||||
|
// Compose
|
||||||
|
//implementation(libs.androidx.compose.bom)
|
||||||
|
/* implementation("androidx.compose.ui:ui")
|
||||||
|
implementation("androidx.compose.material:material")
|
||||||
|
implementation("androidx.compose.runtime:runtime")
|
||||||
|
implementation("androidx.activity:activity-compose:1.8.2")
|
||||||
|
implementation("androidx.compose.ui:ui-graphics")
|
||||||
|
implementation("androidx.compose.ui:ui-tooling-preview") */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Add project specific ProGuard rules here.
|
# Add project specific ProGuard rules here.
|
||||||
# You can control the set of applied configuration files using the
|
# You can control the set of applied configuration files using the
|
||||||
# proguardFiles setting in build.gradle.
|
# proguardFiles setting in build.gradle.kts.
|
||||||
#
|
#
|
||||||
# For more details, see
|
# For more details, see
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
|
@ -44,7 +44,6 @@ class MobileApplication : Application(), InteceptorListener {
|
||||||
signListener = listener
|
signListener = listener
|
||||||
}
|
}
|
||||||
|
|
||||||
// lateinit var silex: VerdnaturaService
|
|
||||||
lateinit var salix: SalixService
|
lateinit var salix: SalixService
|
||||||
var userId: Int? = null
|
var userId: Int? = null
|
||||||
var userName: String? = null
|
var userName: String? = null
|
||||||
|
|
|
@ -124,7 +124,7 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
SECTORFKDEFAULT
|
SECTORFKDEFAULT
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (operator.sector?.isOnReservationMode != null) {
|
if (operator.sector?.isOnReservationMode != null) {
|
||||||
editDataStoreKey(
|
editDataStoreKey(
|
||||||
SECTORISONRESERVATIONMODE,
|
SECTORISONRESERVATIONMODE,
|
||||||
|
@ -178,7 +178,10 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
editDataStoreKey(
|
editDataStoreKey(
|
||||||
RESERVATIONMODE, operator.isOnReservationMode
|
RESERVATIONMODE, operator.isOnReservationMode
|
||||||
)
|
)
|
||||||
|
editDataStoreKey(
|
||||||
|
ITEMPACKING,
|
||||||
|
operator.itemPackingTypeFk
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun isPreferenceExists(key: String): Boolean {
|
suspend fun isPreferenceExists(key: String): Boolean {
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
package es.verdnatura.db
|
package es.verdnatura.db
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.room.*
|
import androidx.room.Dao
|
||||||
|
import androidx.room.Database
|
||||||
|
import androidx.room.Delete
|
||||||
|
import androidx.room.Insert
|
||||||
|
import androidx.room.OnConflictStrategy
|
||||||
|
import androidx.room.Query
|
||||||
|
import androidx.room.Room
|
||||||
|
import androidx.room.RoomDatabase
|
||||||
|
import androidx.room.TypeConverter
|
||||||
|
import androidx.room.TypeConverters
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
||||||
|
@ -68,6 +77,9 @@ interface ExpedicionDao {
|
||||||
|
|
||||||
@Query("DELETE FROM expeditionPending WHERE code = :codeState")
|
@Query("DELETE FROM expeditionPending WHERE code = :codeState")
|
||||||
suspend fun getDeleteByState(codeState: String)
|
suspend fun getDeleteByState(codeState: String)
|
||||||
|
|
||||||
|
@Query("DELETE FROM expeditionPending")
|
||||||
|
suspend fun getDeleteAllState()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
|
|
|
@ -2,11 +2,16 @@ package es.verdnatura.domain
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.text.Html
|
import android.text.Html
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.LayoutInflater
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
|
import es.verdnatura.R
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.time.ZonedDateTime
|
import java.time.ZonedDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
@ -14,7 +19,15 @@ import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
fun List<Any?>.formatWithQuotes(): String {
|
fun List<Any?>.formatWithQuotes(): String {
|
||||||
return "[" + joinToString(", ") { if (it is String) "\"$it\"" else it.toString() } + "]"
|
return "[" + joinToString(", ") {
|
||||||
|
when {
|
||||||
|
it is String && (it.trim().startsWith("{") && it.trim()
|
||||||
|
.endsWith("}")) -> "\"$it\""
|
||||||
|
|
||||||
|
it is String -> "\"$it\""
|
||||||
|
else -> it.toString()
|
||||||
|
}
|
||||||
|
} + "]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
@ -33,6 +46,28 @@ fun Any.toast(
|
||||||
return toast.apply { show() }
|
return toast.apply { show() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Context.showToastCenterWithBackground(textToShow: String) {
|
||||||
|
val inflater = LayoutInflater.from(this)
|
||||||
|
val layout = inflater.inflate(R.layout.ticket_toast_layout, null)
|
||||||
|
val text = layout.findViewById<TextView>(R.id.toast_text)
|
||||||
|
text.text = "$textToShow"
|
||||||
|
text.setTextColor(this.getColor(R.color.verdnatura_orange_salix))
|
||||||
|
text.textSize = 18f
|
||||||
|
|
||||||
|
val background = GradientDrawable().apply {
|
||||||
|
setColor(Color.parseColor("#000000"))
|
||||||
|
cornerRadius = 16f
|
||||||
|
}
|
||||||
|
layout.background = background
|
||||||
|
|
||||||
|
Toast(this).apply {
|
||||||
|
duration = Toast.LENGTH_LONG
|
||||||
|
view = layout
|
||||||
|
setGravity(Gravity.CENTER, 0, 0)
|
||||||
|
show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun <T : Any> T?.notNull(f: (it: T) -> Unit) {
|
fun <T : Any> T?.notNull(f: (it: T) -> Unit) {
|
||||||
if (this != null) f(this)
|
if (this != null) f(this)
|
||||||
}
|
}
|
||||||
|
@ -45,6 +80,7 @@ fun String.isParking(): Boolean {
|
||||||
val regex = Regex("^[^ ]+-[^ ]+$")
|
val regex = Regex("^[^ ]+-[^ ]+$")
|
||||||
return this.length > 4 && regex.matches(this)
|
return this.length > 4 && regex.matches(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun String.isShelving(): Boolean {
|
fun String.isShelving(): Boolean {
|
||||||
val regex = Regex("\\S{0,4}")
|
val regex = Regex("\\S{0,4}")
|
||||||
return regex.matches(this)
|
return regex.matches(this)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import es.verdnatura.presentation.common.ExpeditionPrintOut
|
||||||
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
||||||
import es.verdnatura.presentation.common.ItemShelving
|
import es.verdnatura.presentation.common.ItemShelving
|
||||||
import es.verdnatura.presentation.common.PackingSiteSalix
|
import es.verdnatura.presentation.common.PackingSiteSalix
|
||||||
|
import es.verdnatura.presentation.common.PickupResponse
|
||||||
import es.verdnatura.presentation.common.SaleTrackingSalix
|
import es.verdnatura.presentation.common.SaleTrackingSalix
|
||||||
import es.verdnatura.presentation.common.TicketState
|
import es.verdnatura.presentation.common.TicketState
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
|
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
|
||||||
|
@ -25,6 +26,10 @@ import es.verdnatura.presentation.view.feature.delivery.model.DeliveryInfo
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionWithTicket
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteAction
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplement
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplementAdd
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.TicketObservation
|
import es.verdnatura.presentation.view.feature.delivery.model.TicketObservation
|
||||||
|
@ -69,7 +74,6 @@ import es.verdnatura.presentation.view.feature.sacador.model.TicketStateSalix
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemBuy
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemBuy
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewer
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewer
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
|
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.ExpeditionMistakeSalix
|
import es.verdnatura.presentation.view.feature.workermistake.model.ExpeditionMistakeSalix
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
||||||
|
@ -140,6 +144,11 @@ interface SalixService {
|
||||||
@Query("filter") filter: String
|
@Query("filter") filter: String
|
||||||
): Call<List<AddressLoses>>
|
): Call<List<AddressLoses>>
|
||||||
|
|
||||||
|
@POST("Applications/buy_getUltimate/execute-func")
|
||||||
|
fun buyUltimate(
|
||||||
|
@Query("params") params: Any, @Query("schema") schema: String = "vn"
|
||||||
|
): Call<Long>
|
||||||
|
|
||||||
@GET("Buyers")
|
@GET("Buyers")
|
||||||
fun getBuyers(
|
fun getBuyers(
|
||||||
@Query("filter") filter: String
|
@Query("filter") filter: String
|
||||||
|
@ -181,10 +190,22 @@ interface SalixService {
|
||||||
fun getRoutes(
|
fun getRoutes(
|
||||||
): Call<MutableList<RouteInfo>>
|
): Call<MutableList<RouteInfo>>
|
||||||
|
|
||||||
@GET("Workers/findOne")
|
@POST("Expeditions/moveExpeditions")
|
||||||
|
fun moveExpeditions(
|
||||||
|
@Query("clientId") clientId: Number,
|
||||||
|
@Query("warehouseId") warehouseId: Number,
|
||||||
|
@Query("addressId") addressId: Number,
|
||||||
|
@Query("agencyModeId") agencyModeId: Number,
|
||||||
|
@Query("routeId") routeId: Number,
|
||||||
|
@Query("expeditionIds") expeditionIds: ArrayList<Number>,
|
||||||
|
@Query("landed") landed: String
|
||||||
|
|
||||||
|
): Call<Any>
|
||||||
|
|
||||||
|
@GET("Workers/Summary")
|
||||||
fun getNameWorker(
|
fun getNameWorker(
|
||||||
@Query("filter") filter: String
|
@Query("filter") filter: String
|
||||||
): Call<NameWorker>
|
): Call<List<NameWorker>>
|
||||||
|
|
||||||
@POST("Applications/{routine}/execute-proc")
|
@POST("Applications/{routine}/execute-proc")
|
||||||
fun executeProc(
|
fun executeProc(
|
||||||
|
@ -440,6 +461,12 @@ interface SalixService {
|
||||||
@Query("barcode") barcode: Number, @Query("warehouseFk") warehouseFk: Int
|
@Query("barcode") barcode: Number, @Query("warehouseFk") warehouseFk: Int
|
||||||
): Call<ItemCardVO>
|
): Call<ItemCardVO>
|
||||||
|
|
||||||
|
@POST("Applications/report_print/execute-proc")
|
||||||
|
fun printItem(
|
||||||
|
@Query("params") params: Any? = null,
|
||||||
|
@Query("schema") schema: String = "vn"
|
||||||
|
): Call<Unit>
|
||||||
|
|
||||||
@POST("Applications/itemPlacementSupplyAiming/execute-proc")
|
@POST("Applications/itemPlacementSupplyAiming/execute-proc")
|
||||||
fun itemPlacementSupplyAiming(
|
fun itemPlacementSupplyAiming(
|
||||||
@Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
|
@Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
|
||||||
|
@ -515,10 +542,10 @@ interface SalixService {
|
||||||
@Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
|
@Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
|
||||||
): Call<Any>
|
): Call<Any>
|
||||||
|
|
||||||
@POST("Applications/machine_getWorkerPlate/execute-proc")
|
/* @POST("Applications/machine_getWorkerPlate/execute-proc")
|
||||||
fun machineGetWorkerPlate(
|
fun machineGetWorkerPlate(
|
||||||
@Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
|
@Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
|
||||||
): Call<List<JsonObject>>
|
): Call<List<JsonObject>>*/
|
||||||
|
|
||||||
@POST("Applications/sectorCollection_get/execute-proc")
|
@POST("Applications/sectorCollection_get/execute-proc")
|
||||||
fun sectorCollectionGet(
|
fun sectorCollectionGet(
|
||||||
|
@ -540,9 +567,34 @@ interface SalixService {
|
||||||
@Query("params") params: Any, @Query("schema") schema: String = "vn"
|
@Query("params") params: Any, @Query("schema") schema: String = "vn"
|
||||||
): Call<List<WorkerFromMistake>>
|
): Call<List<WorkerFromMistake>>
|
||||||
|
|
||||||
|
@GET("RouteActions")
|
||||||
|
fun getRouteAction(
|
||||||
|
@Query("filter") filter: Any = """{"fields": {"id": true,"name": true,"price":true},"order": "name"}"""
|
||||||
|
): Call<List<RouteAction>>
|
||||||
|
|
||||||
|
@GET("Expeditions")
|
||||||
|
fun getDataFromExpedition(
|
||||||
|
@Query("filter") filter: Any,
|
||||||
|
): Call<List<ExpeditionWithTicket>>
|
||||||
|
|
||||||
|
@POST("RouteComplements")
|
||||||
|
fun addRouteComplements(
|
||||||
|
@Body params: RouteComplementAdd
|
||||||
|
): Call<Any>
|
||||||
|
|
||||||
|
@GET("RouteComplements")
|
||||||
|
fun getRouteComplements(
|
||||||
|
@Query("filter") filter: Any
|
||||||
|
): Call<List<RouteComplement>>
|
||||||
|
|
||||||
|
@DELETE("RouteComplements/{id}")
|
||||||
|
fun routeComplementDelete(
|
||||||
|
@Path("id") id: Number
|
||||||
|
): Call<Any>
|
||||||
|
|
||||||
@POST("Applications/sectorCollection_new/execute-proc")
|
@POST("Applications/sectorCollection_new/execute-proc")
|
||||||
fun sectorCollectionNew(
|
fun sectorCollectionNew(
|
||||||
@Query("params") params: Any, @Query("schema") schema: String = "vn"
|
@Query("params") filter: Any, @Query("schema") schema: String = "vn"
|
||||||
): Call<Any>
|
): Call<Any>
|
||||||
|
|
||||||
@POST("Applications/ticketStateToday_setState/execute-proc")
|
@POST("Applications/ticketStateToday_setState/execute-proc")
|
||||||
|
@ -560,6 +612,11 @@ interface SalixService {
|
||||||
@Query("filter") filter: Any, @Query("schema") schema: String = "vn"
|
@Query("filter") filter: Any, @Query("schema") schema: String = "vn"
|
||||||
): Call<List<TicketState>>
|
): Call<List<TicketState>>
|
||||||
|
|
||||||
|
@GET("Tickets")
|
||||||
|
fun ticketIsPickup(
|
||||||
|
@Query("filter") filter: Any, @Query("schema") schema: String = "vn"
|
||||||
|
): Call<List<PickupResponse>>
|
||||||
|
|
||||||
@POST("Applications/workerMachinery_isRegistered/execute-func")
|
@POST("Applications/workerMachinery_isRegistered/execute-func")
|
||||||
fun workerMachineryIsRegistered(
|
fun workerMachineryIsRegistered(
|
||||||
@Query("params") params: Any, @Query("schema") schema: String = "vn"
|
@Query("params") params: Any, @Query("schema") schema: String = "vn"
|
||||||
|
@ -643,18 +700,17 @@ interface SalixService {
|
||||||
@Query("params") params: Any,
|
@Query("params") params: Any,
|
||||||
): Call<List<ItemLocationVO>>
|
): Call<List<ItemLocationVO>>
|
||||||
|
|
||||||
@POST("Applications/itemShelving_get/execute-proc")
|
|
||||||
fun itemShelvingList(
|
|
||||||
@Query("schema") schema: String = "vn",
|
|
||||||
@Query("params") params: Any,
|
|
||||||
): Call<List<ItemUbicadorVO>>
|
|
||||||
|
|
||||||
@POST("Applications/itemShelving_get/execute-proc")
|
@POST("Applications/itemShelving_get/execute-proc")
|
||||||
fun itemShelvingListNew(
|
fun itemShelvingListNew(
|
||||||
@Query("schema") schema: String = "vn",
|
@Query("schema") schema: String = "vn",
|
||||||
@Query("params") params: Any,
|
@Query("params") params: Any,
|
||||||
): Call<List<ItemUbicador>>
|
): Call<List<ItemUbicador>>
|
||||||
|
|
||||||
|
@GET("Shelvings")
|
||||||
|
fun itemShelvingGet(
|
||||||
|
@Query("filter") filter: Any,
|
||||||
|
): Call<List<ItemUbicador>>
|
||||||
|
|
||||||
@POST("Applications/expedition_scan/execute-proc")
|
@POST("Applications/expedition_scan/execute-proc")
|
||||||
fun expeditionScan(
|
fun expeditionScan(
|
||||||
@Query("schema") schema: String = "srt",
|
@Query("schema") schema: String = "srt",
|
||||||
|
|
|
@ -1,12 +1,20 @@
|
||||||
package es.verdnatura.domain.userCases
|
package es.verdnatura.domain.userCases
|
||||||
|
|
||||||
|
|
||||||
import es.verdnatura.domain.SalixService
|
import es.verdnatura.domain.SalixService
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
|
|
||||||
|
|
||||||
class GetItemFromBarcodeUseCase(private val salixService: SalixService) {
|
class GetItemFromBarcodeUseCase(private val salixService: SalixService) {
|
||||||
fun execute(barcode: String): Call<Int?> {
|
fun execute(barcode: String): Call<Int?> {
|
||||||
return salixService.barcodesToItem(barcode)
|
return salixService.barcodesToItem(barcode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class GetItemPrintItemUseCase(private val salixService: SalixService) {
|
||||||
|
fun execute(params: Any?): Call<Unit> {
|
||||||
|
return salixService.printItem(params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun executeBuyUltimate(params: Any): Call<Long> {
|
||||||
|
return salixService.buyUltimate(params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import com.google.android.gms.location.LocationCallback
|
||||||
import com.google.android.gms.location.LocationResult
|
import com.google.android.gms.location.LocationResult
|
||||||
import com.google.android.gms.location.Priority
|
import com.google.android.gms.location.Priority
|
||||||
import es.verdnatura.MobileApplication
|
import es.verdnatura.MobileApplication
|
||||||
import timber.log.Timber.d
|
import es.verdnatura.domain.toast
|
||||||
|
|
||||||
interface LocationUpdateCallback {
|
interface LocationUpdateCallback {
|
||||||
fun onLocationReceived(location: LocationResult)
|
fun onLocationReceived(location: LocationResult)
|
||||||
|
@ -36,7 +36,7 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
|
||||||
var locationUpdateCallback: LocationUpdateCallback? = null
|
var locationUpdateCallback: LocationUpdateCallback? = null
|
||||||
|
|
||||||
protected lateinit var binding: T
|
protected lateinit var binding: T
|
||||||
private lateinit var fusedLocationClient:FusedLocationProviderClient
|
private lateinit var fusedLocationClient: FusedLocationProviderClient
|
||||||
private val locationRequest =
|
private val locationRequest =
|
||||||
com.google.android.gms.location.LocationRequest.Builder(
|
com.google.android.gms.location.LocationRequest.Builder(
|
||||||
Priority.PRIORITY_LOW_POWER,
|
Priority.PRIORITY_LOW_POWER,
|
||||||
|
@ -50,8 +50,8 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
|
||||||
setContentView(getLayoutId())
|
setContentView(getLayoutId())
|
||||||
try {
|
try {
|
||||||
initDataBinding()
|
initDataBinding()
|
||||||
}catch (ex:Exception){
|
} catch (ex: Exception) {
|
||||||
d(ex.message.toString())
|
ex.message!!.toast(context = this)
|
||||||
}
|
}
|
||||||
mobileApplication = application as MobileApplication
|
mobileApplication = application as MobileApplication
|
||||||
init()
|
init()
|
||||||
|
@ -62,7 +62,6 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
|
||||||
open fun addBindingVariables() {}
|
open fun addBindingVariables() {}
|
||||||
abstract fun init()
|
abstract fun init()
|
||||||
|
|
||||||
|
|
||||||
private fun initDataBinding() {
|
private fun initDataBinding() {
|
||||||
binding = DataBindingUtil.setContentView(this, getLayoutId())
|
binding = DataBindingUtil.setContentView(this, getLayoutId())
|
||||||
binding.lifecycleOwner = this
|
binding.lifecycleOwner = this
|
||||||
|
|
|
@ -69,10 +69,10 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(
|
||||||
addBindingVariables()
|
addBindingVariables()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun textScanned_filterDouble(textScanned: String): String {
|
fun textScannedFilterDouble(textScanned: String): String {
|
||||||
|
|
||||||
if (textScanned.length > 13) {
|
if (textScanned.length > 13) {
|
||||||
var size = textScanned.length
|
val size = textScanned.length
|
||||||
if (textScanned.substring((size / 2), size) == textScanned.substring(0, size / 2)
|
if (textScanned.substring((size / 2), size) == textScanned.substring(0, size / 2)
|
||||||
) {
|
) {
|
||||||
return textScanned.substring(0, size / 2)
|
return textScanned.substring(0, size / 2)
|
||||||
|
@ -149,8 +149,8 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(
|
||||||
fun getInfoVersionNameApp(): String {
|
fun getInfoVersionNameApp(): String {
|
||||||
val manager: PackageManager = requireContext().packageManager
|
val manager: PackageManager = requireContext().packageManager
|
||||||
val info: PackageInfo = manager.getPackageInfo(requireContext().packageName, 0)
|
val info: PackageInfo = manager.getPackageInfo(requireContext().packageName, 0)
|
||||||
mobileApplication.versionName = info.versionName
|
mobileApplication.versionName = info.versionName.toString()
|
||||||
return info.versionName
|
return mobileApplication.versionName
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getDevicePDA(): Int? {
|
fun getDevicePDA(): Int? {
|
||||||
|
|
|
@ -7,9 +7,10 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.databinding.ItemGeneralRowBinding
|
import es.verdnatura.databinding.ItemGeneralRowBinding
|
||||||
|
|
||||||
class GeneralAdapter(
|
class GeneralAdapter(
|
||||||
private val items: List<GeneralItem>,
|
private var items: List<GeneralItem>,
|
||||||
private val OnGeneralItemRowClickListener: OnGeneralItemRowClickListener,
|
private val onDeleteItemRowClickListener: OnGeneralItemRowClickListener? = null,
|
||||||
// private var showDelete: Boolean = false
|
private var showDelete: Boolean = false,
|
||||||
|
private val onRowClickListener: OnGeneralRowClickListener? = null
|
||||||
) : RecyclerView.Adapter<GeneralAdapter.ItemHolder>() {
|
) : RecyclerView.Adapter<GeneralAdapter.ItemHolder>() {
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||||
|
@ -23,10 +24,6 @@ class GeneralAdapter(
|
||||||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||||
holder.bind(items[position])
|
holder.bind(items[position])
|
||||||
|
|
||||||
holder.binding.root.setOnClickListener {
|
|
||||||
OnGeneralItemRowClickListener.onGeneralItemRowClickListener(items[position])
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class ItemHolder(
|
inner class ItemHolder(
|
||||||
|
@ -36,11 +33,31 @@ class GeneralAdapter(
|
||||||
fun bind(item: GeneralItem) {
|
fun bind(item: GeneralItem) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
this.item = item
|
this.item = item
|
||||||
/*if (showDelete) itemImage.visibility = View.VISIBLE
|
if (showDelete) itemImage.visibility = View.VISIBLE
|
||||||
else itemImage.visibility = View.GONE*/
|
else itemImage.visibility = View.GONE
|
||||||
|
|
||||||
itemCode.visibility = View.GONE
|
itemCode.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
binding.itemImage.setOnClickListener {
|
||||||
|
onDeleteItemRowClickListener?.onGeneralItemRowClickListener(item)
|
||||||
|
}
|
||||||
|
binding.itemCode.setOnClickListener {
|
||||||
|
onRowClickListener?.onRowClickListener(item)
|
||||||
|
}
|
||||||
|
binding.itemTitle.setOnClickListener {
|
||||||
|
onRowClickListener?.onRowClickListener(item)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun updateItems(list: List<GeneralItem>) {
|
||||||
|
items = list
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setShowDelete(hasVisibility: Boolean) {
|
||||||
|
showDelete = hasVisibility
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
package es.verdnatura.presentation.common
|
||||||
|
|
||||||
|
import android.app.AlertDialog
|
||||||
|
import android.content.Context
|
||||||
|
import android.text.InputType
|
||||||
|
import android.view.View
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||||
|
|
||||||
|
class PrinterDialogManager(private val context: Context) {
|
||||||
|
fun showPrintDialog(
|
||||||
|
item: Long,
|
||||||
|
itemName: String,
|
||||||
|
onPrintClick: (Long, String, Int?, Int) -> Unit
|
||||||
|
) {
|
||||||
|
val customDialogList = CustomDialogList(context)
|
||||||
|
customDialogList.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||||
|
customDialogList.getEditTextThree().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||||
|
|
||||||
|
customDialogList.setTitle(context.getString(R.string.itemName, item, itemName))
|
||||||
|
.setOkButton(context.getString(R.string.printQr)) {
|
||||||
|
handlePrintClick(item, customDialogList, onPrintClick, "qr")
|
||||||
|
}
|
||||||
|
.setOkTwoButton(context.getString(R.string.printBarcode)) {
|
||||||
|
handlePrintClick(item, customDialogList, onPrintClick, "barcode")
|
||||||
|
|
||||||
|
}
|
||||||
|
.setKoButton(context.getString(R.string.cancel)) {
|
||||||
|
customDialogList.dismiss()
|
||||||
|
}
|
||||||
|
.setHintValueThree(context.getString(R.string.labelNumber))
|
||||||
|
.setHintValue(context.getString(R.string.optionalPacking))
|
||||||
|
.setTextThree(View.VISIBLE)
|
||||||
|
.show()
|
||||||
|
customDialogList.getFocusThree()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun handlePrintClick(
|
||||||
|
item: Long,
|
||||||
|
customDialogList: CustomDialogList,
|
||||||
|
onPrintClick: (Long, String, Int?, Int) -> Unit,
|
||||||
|
labelType: String
|
||||||
|
) {
|
||||||
|
onPrintClick(
|
||||||
|
item,
|
||||||
|
labelType,
|
||||||
|
if (customDialogList.getValue().isEmpty()) null else customDialogList.getValue()
|
||||||
|
.toInt(),
|
||||||
|
if (customDialogList.getValueOptional()
|
||||||
|
.isEmpty()
|
||||||
|
) 1 else customDialogList.getValueOptional().toInt()
|
||||||
|
)
|
||||||
|
customDialogList.dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LabelDialogHelper(private val context: Context) {
|
||||||
|
fun showLabelDialog(
|
||||||
|
onItemSelected: (Int) -> Unit,
|
||||||
|
) {
|
||||||
|
val builder = AlertDialog.Builder(context)
|
||||||
|
builder.setTitle(context.getString(R.string.selectLabeltoPrint))
|
||||||
|
val labelCount = Array(10) { (it + 1).toString() }
|
||||||
|
builder.setItems(labelCount) { _, which ->
|
||||||
|
onItemSelected(which + 1)
|
||||||
|
}
|
||||||
|
builder.create().show()
|
||||||
|
}
|
||||||
|
}
|
|
@ -96,4 +96,26 @@ data class ExpeditionPrintOut(
|
||||||
val expeditionFk: Long,
|
val expeditionFk: Long,
|
||||||
val itemFk: Int,
|
val itemFk: Int,
|
||||||
val isChecked: Boolean
|
val isChecked: Boolean
|
||||||
|
)
|
||||||
|
|
||||||
|
data class PickupResponse(
|
||||||
|
val routeFk: Int,
|
||||||
|
val route: Route?
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Route(
|
||||||
|
val id: Int,
|
||||||
|
val agencyModeFk: Int,
|
||||||
|
val agencyMode: AgencyMode?
|
||||||
|
)
|
||||||
|
|
||||||
|
data class AgencyMode(
|
||||||
|
val id: Int,
|
||||||
|
val deliveryMethodFk: Int,
|
||||||
|
val deliveryMethod: DeliveryMethod?
|
||||||
|
)
|
||||||
|
|
||||||
|
data class DeliveryMethod(
|
||||||
|
val id: Int,
|
||||||
|
val code: String?
|
||||||
)
|
)
|
|
@ -10,6 +10,7 @@ import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||||
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
|
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplement
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.Ticket
|
import es.verdnatura.presentation.view.feature.delivery.model.Ticket
|
||||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||||
|
@ -50,6 +51,10 @@ interface OnMistakeWorkerClickListener {
|
||||||
fun onMistakeWorkerClickListener(item: WorkerFromMistake)
|
fun onMistakeWorkerClickListener(item: WorkerFromMistake)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface OnSalarySupplementClickListener {
|
||||||
|
fun onSalarySupplementClickListener(item: RouteComplement)
|
||||||
|
}
|
||||||
|
|
||||||
interface HideBottomNavigation {
|
interface HideBottomNavigation {
|
||||||
fun hideBottomNavigation(entryPoint: String)
|
fun hideBottomNavigation(entryPoint: String)
|
||||||
}
|
}
|
||||||
|
@ -102,6 +107,10 @@ interface OnGeneralItemRowClickListener {
|
||||||
fun onGeneralItemRowClickListener(item: GeneralItem)
|
fun onGeneralItemRowClickListener(item: GeneralItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface OnGeneralRowClickListener {
|
||||||
|
fun onRowClickListener(item: GeneralItem)
|
||||||
|
}
|
||||||
|
|
||||||
interface OnImageTrashClickListener {
|
interface OnImageTrashClickListener {
|
||||||
fun onImageTrashClickListener(item: Any)
|
fun onImageTrashClickListener(item: Any)
|
||||||
}
|
}
|
||||||
|
@ -263,6 +272,10 @@ interface OnTicketClickListener {
|
||||||
fun onTicketClickListener(sale: SaleVO)
|
fun onTicketClickListener(sale: SaleVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface OnTicketColorListener {
|
||||||
|
fun onTicketColorListener(sale: SaleVO)
|
||||||
|
}
|
||||||
|
|
||||||
interface OnTicketClickSaleListener {
|
interface OnTicketClickSaleListener {
|
||||||
fun onTicketClickListener(sale: Sale)
|
fun onTicketClickListener(sale: Sale)
|
||||||
}
|
}
|
||||||
|
@ -271,6 +284,10 @@ interface OnSaleReserveClickListener {
|
||||||
fun onSaleReserveListener(sale: Sale)
|
fun onSaleReserveListener(sale: Sale)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface OnAddItemClickListener {
|
||||||
|
fun onAddItemClickListener(sale: Sale)
|
||||||
|
}
|
||||||
|
|
||||||
interface OnBuyerSelectedListener {
|
interface OnBuyerSelectedListener {
|
||||||
fun onBuyerSelected(userFk: String)
|
fun onBuyerSelected(userFk: String)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ import android.graphics.drawable.Drawable
|
||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
@ -27,6 +29,10 @@ import com.bumptech.glide.request.transition.Transition
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
import java.text.ParseException
|
import java.text.ParseException
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.LocalDateTime
|
||||||
|
import java.time.LocalTime
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
|
@ -153,8 +159,12 @@ fun Activity.showKeyboardIn() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.hideKeyboard(view: View) {
|
fun Context.hideKeyboard(view: View) {
|
||||||
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
val inputMethodManager =
|
||||||
|
getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
|
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
||||||
|
}, 100L)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.showKeyboard() {
|
fun Context.showKeyboard() {
|
||||||
|
@ -213,7 +223,7 @@ fun PackageManager.getPackageInfoCompat(packageName: String, flags: Int = 0): Pa
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong()))
|
getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong()))
|
||||||
} else {
|
} else {
|
||||||
getPackageInfo(packageName, flags)
|
getPackageInfo(packageName, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun convertToDateString(date: String?): String? {
|
fun convertToDateString(date: String?): String? {
|
||||||
|
@ -221,8 +231,18 @@ fun convertToDateString(date: String?): String? {
|
||||||
if (date.isNullOrEmpty()) {
|
if (date.isNullOrEmpty()) {
|
||||||
return date
|
return date
|
||||||
}
|
}
|
||||||
val formatoEntrada = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault()) // Formato de entrada
|
val formatoEntrada =
|
||||||
val formatoSalida = SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()) // Formato de salida
|
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault()) // Formato de entrada
|
||||||
|
val formatoSalida = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) // Formato de salida
|
||||||
val dateToConvert = formatoEntrada.parse(date) // Convertir fecha de String a objeto Date
|
val dateToConvert = formatoEntrada.parse(date) // Convertir fecha de String a objeto Date
|
||||||
return formatoSalida.format(dateToConvert!!) // Convertir fecha a String con formato deseado
|
return formatoSalida.format(dateToConvert!!) // Convertir fecha a String con formato deseado
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getDayBounds(dateString: String): Pair<LocalDateTime, LocalDateTime> {
|
||||||
|
val formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy")
|
||||||
|
val date = LocalDate.parse(dateString, formatter)
|
||||||
|
val startOfDay = date.atTime(LocalTime.MIN)
|
||||||
|
val endOfDay = date.atTime(LocalTime.MAX)
|
||||||
|
|
||||||
|
return Pair(startOfDay, endOfDay)
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
package es.verdnatura.presentation.view.commom
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.text.Spannable
|
||||||
|
import android.text.SpannableString
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.appcompat.widget.SearchView
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
|
||||||
|
class SearchableAdapter(
|
||||||
|
private var listElements: MutableList<NameWithId>,
|
||||||
|
private var context: Context,
|
||||||
|
private val onItemClick: (NameWithId) -> Unit,
|
||||||
|
) : RecyclerView.Adapter<SearchableAdapter.NameViewHolder>() {
|
||||||
|
|
||||||
|
private var listElementsFiltered = listElements.toMutableList()
|
||||||
|
private var currentQuery: String = ""
|
||||||
|
private lateinit var searchView: SearchView
|
||||||
|
|
||||||
|
inner class NameViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||||
|
private val nameText: TextView = itemView.findViewById(android.R.id.text1)
|
||||||
|
|
||||||
|
fun bind(nameWithId: NameWithId, query: String) {
|
||||||
|
val spannableString = SpannableString(nameWithId.name)
|
||||||
|
try {
|
||||||
|
if (query.isNotEmpty()) {
|
||||||
|
val startIndex = nameWithId.name.indexOf(query, ignoreCase = true)
|
||||||
|
if (startIndex >= 0) {
|
||||||
|
val endIndex = startIndex + query.length
|
||||||
|
spannableString.setSpan(
|
||||||
|
ForegroundColorSpan(Color.RED),
|
||||||
|
startIndex,
|
||||||
|
endIndex,
|
||||||
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nameText.text = spannableString
|
||||||
|
itemView.setOnClickListener {
|
||||||
|
onItemClick(nameWithId)
|
||||||
|
}
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ex.message?.toast(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NameViewHolder {
|
||||||
|
val view = LayoutInflater.from(parent.context)
|
||||||
|
.inflate(android.R.layout.simple_list_item_1, parent, false)
|
||||||
|
return NameViewHolder(view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: NameViewHolder, position: Int) {
|
||||||
|
val nameWithId = listElementsFiltered[position]
|
||||||
|
holder.bind(nameWithId, currentQuery)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun filter(query: String) {
|
||||||
|
currentQuery = query
|
||||||
|
listElementsFiltered = if (query.isEmpty()) {
|
||||||
|
listElements.toMutableList()
|
||||||
|
} else {
|
||||||
|
listElements.filter { it.name.contains(query, ignoreCase = true) }
|
||||||
|
.toMutableList()
|
||||||
|
}
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int = listElementsFiltered.size
|
||||||
|
|
||||||
|
fun updateList(newList: MutableList<NameWithId>) {
|
||||||
|
listElements = newList
|
||||||
|
filter("")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data class NameWithId(
|
||||||
|
val id: Number,
|
||||||
|
val name: String
|
||||||
|
)
|
|
@ -0,0 +1,80 @@
|
||||||
|
package es.verdnatura.presentation.view.commom
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.appcompat.widget.SearchView
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.R
|
||||||
|
|
||||||
|
class SearchableRecyclerView @JvmOverloads constructor(
|
||||||
|
context: Context,
|
||||||
|
attrs: AttributeSet? = null,
|
||||||
|
defStyleAttr: Int = 0
|
||||||
|
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
|
val searchView: SearchView
|
||||||
|
private val recyclerView: RecyclerView
|
||||||
|
lateinit var adapter: SearchableAdapter
|
||||||
|
private var allItems: MutableList<NameWithId> = mutableListOf()
|
||||||
|
|
||||||
|
init {
|
||||||
|
LayoutInflater.from(context).inflate(R.layout.component_searchable_dialog, this, true)
|
||||||
|
searchView = findViewById(R.id.search_view)
|
||||||
|
recyclerView = findViewById(R.id.recycler_viewer)
|
||||||
|
recyclerView.layoutManager = LinearLayoutManager(context)
|
||||||
|
recyclerView.setBackgroundColor(Color.WHITE)
|
||||||
|
searchView.setBackgroundColor(Color.WHITE)
|
||||||
|
searchView.setOnCloseListener {
|
||||||
|
visibility = View.GONE
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
||||||
|
override fun onQueryTextSubmit(query: String?): Boolean {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onQueryTextChange(newText: String?): Boolean {
|
||||||
|
if (::adapter.isInitialized) adapter.filter(newText ?: "")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setAdapter(adapter: SearchableAdapter, items: MutableList<NameWithId>) {
|
||||||
|
this.adapter = adapter
|
||||||
|
this.allItems = items
|
||||||
|
recyclerView.adapter = adapter
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setOnCloseListener(listener: () -> Boolean) {
|
||||||
|
searchView.setOnCloseListener { listener() }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setVisibility() {
|
||||||
|
searchView.visibility = View.VISIBLE
|
||||||
|
recyclerView.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setSearchHint(searchHint: String): SearchableRecyclerView {
|
||||||
|
searchView.queryHint = searchHint
|
||||||
|
searchView.setIconifiedByDefault(true)
|
||||||
|
searchView.isIconified = false
|
||||||
|
searchView.post {
|
||||||
|
searchView.requestFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setSearchHintWithoutFocus(searchHint: String): SearchableRecyclerView {
|
||||||
|
searchView.queryHint = searchHint
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,49 +8,43 @@ import com.google.android.material.textfield.TextInputEditText
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ComponentCustomListDialogBinding
|
import es.verdnatura.databinding.ComponentCustomListDialogBinding
|
||||||
|
|
||||||
//import kotlinx.android.synthetic.main.component_custom_list_dialog.*
|
|
||||||
|
|
||||||
|
|
||||||
class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme) {
|
class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||||
|
|
||||||
|
|
||||||
private var binding: ComponentCustomListDialogBinding =
|
private var binding: ComponentCustomListDialogBinding =
|
||||||
ComponentCustomListDialogBinding.inflate(layoutInflater)
|
ComponentCustomListDialogBinding.inflate(layoutInflater)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
getEditText().requestFocus()
|
getEditText().requestFocus()
|
||||||
//setContentView(R.layout.component_custom_list_dialog)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getRecyclerView(): RecyclerView {
|
fun getRecyclerView(): RecyclerView {
|
||||||
|
|
||||||
return binding.itemRecyclerview
|
return binding.itemRecyclerview
|
||||||
//return item_recyclerview
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getEditText(): TextInputEditText {
|
fun getEditText(): TextInputEditText {
|
||||||
return binding.customDialogValue
|
return binding.customDialogValue
|
||||||
//return custom_dialog_value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getEditTextTwo(): TextInputEditText {
|
fun getEditTextTwo(): TextInputEditText {
|
||||||
return binding.customDialogValueTwo
|
return binding.customDialogValueTwo
|
||||||
//return custom_dialog_value_two
|
}
|
||||||
|
|
||||||
|
fun getEditTextThree(): TextInputEditText {
|
||||||
|
return binding.customDialogValueThree
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getValue(): String {
|
fun getValue(): String {
|
||||||
return binding.customDialogValue.text.toString()
|
return binding.customDialogValue.text.toString()
|
||||||
//return custom_dialog_value.text.toString()
|
}
|
||||||
|
|
||||||
|
fun getValueOptional(): String {
|
||||||
|
return binding.customDialogValueThree.text.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setValue(value: String): CustomDialogList {
|
fun setValue(value: String): CustomDialogList {
|
||||||
binding.customDialogValue.setText(value)
|
binding.customDialogValue.setText(value)
|
||||||
binding.textinputlayoutUsername.visibility = View.VISIBLE
|
binding.textinputlayoutUsername.visibility = View.VISIBLE
|
||||||
|
|
||||||
/*custom_dialog_value.setText(value)
|
|
||||||
textinputlayout_username.visibility = View.VISIBLE*/
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,96 +55,97 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
|
|
||||||
fun getValueTwo(): String {
|
fun getValueTwo(): String {
|
||||||
return binding.customDialogValueTwo.text.toString()
|
return binding.customDialogValueTwo.text.toString()
|
||||||
//return custom_dialog_value_two.text.toString()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setValueTwo(value: String): CustomDialogList {
|
fun setValueTwo(value: String): CustomDialogList {
|
||||||
binding.customDialogValueTwo.setText(value)
|
binding.customDialogValueTwo.setText(value)
|
||||||
binding.textinputlayoutTwo.visibility = View.VISIBLE
|
binding.textinputlayoutTwo.visibility = View.VISIBLE
|
||||||
|
|
||||||
/* custom_dialog_value_two.setText(value)
|
|
||||||
textinputlayout_two.visibility = View.VISIBLE*/
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTitle(title: String): CustomDialogList {
|
fun setTitle(title: String): CustomDialogList {
|
||||||
binding.customDialogTitle.visibility = View.VISIBLE
|
binding.customDialogTitle.visibility = View.VISIBLE
|
||||||
binding.customDialogTitle.text = title
|
binding.customDialogTitle.text = title
|
||||||
/* custom_dialog_title.visibility = View.VISIBLE
|
|
||||||
custom_dialog_title.text = title*/
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setDescription(title: String): CustomDialogList {
|
fun setDescription(title: String): CustomDialogList {
|
||||||
binding.customDialogDescription.visibility = View.VISIBLE
|
binding.customDialogDescription.visibility = View.VISIBLE
|
||||||
binding.customDialogDescription.text = title
|
binding.customDialogDescription.text = title
|
||||||
|
|
||||||
/*custom_dialog_description.visibility = View.VISIBLE
|
|
||||||
custom_dialog_description.text = title*/
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
||||||
|
|
||||||
binding.customDialogButtonOk.visibility = View.VISIBLE
|
binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||||
binding.customDialogButtonOk.text = text
|
binding.customDialogButtonOk.text = text
|
||||||
|
|
||||||
/*custom_dialog_button_ok.visibility = View.VISIBLE
|
|
||||||
custom_dialog_button_ok.text = text
|
|
||||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
|
||||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
fun setOkTwoButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
||||||
|
binding.customDialogButtonOkTwo.visibility = View.VISIBLE
|
||||||
|
binding.customDialogButtonOkTwo.text = text
|
||||||
|
binding.customDialogButtonOkTwo.setOnClickListener { onButtonClicked() }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
||||||
binding.customDialogButtonKo.visibility = View.VISIBLE
|
binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||||
binding.customDialogButtonKo.text = text
|
binding.customDialogButtonKo.text = text
|
||||||
/*custom_dialog_button_ko.visibility = View.VISIBLE
|
|
||||||
custom_dialog_button_ko.text = text*/
|
|
||||||
binding.customDialogButtonKo.setOnClickListener {
|
binding.customDialogButtonKo.setOnClickListener {
|
||||||
onButtonClicked()
|
onButtonClicked()
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setHintValue(text: String): CustomDialogList {
|
fun setHintValue(text: String): CustomDialogList {
|
||||||
|
|
||||||
binding.customDialogValue.hint = text
|
binding.customDialogValue.hint = text
|
||||||
// custom_dialog_value.hint = text
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setHintValueTwo(text: String): CustomDialogList {
|
fun setHintValueTwo(text: String): CustomDialogList {
|
||||||
binding.customDialogValueTwo.hint = text
|
binding.customDialogValueTwo.hint = text
|
||||||
//custom_dialog_value_two.hint = text
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTextTwoGone(): CustomDialogList {
|
fun setHintValueThree(text: String): CustomDialogList {
|
||||||
binding.textinputlayoutTwo.visibility = View.GONE
|
binding.customDialogValueThree.hint = text
|
||||||
//textinputlayout_two.visibility = View.GONE
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setTextTwoVisibility(visibility: Int): CustomDialogList {
|
||||||
|
binding.textinputlayoutTwo.visibility = visibility
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setTextThree(visibility: Int): CustomDialogList {
|
||||||
|
binding.textinputlayoutThree.visibility = visibility
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideDialog(): CustomDialogList {
|
fun hideDialog(): CustomDialogList {
|
||||||
binding.customDialogValue.visibility = View.GONE
|
binding.customDialogValue.visibility = View.GONE
|
||||||
//custom_dialog_value.visibility = View.GONE
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showDialog(): CustomDialogList {
|
||||||
|
binding.customDialogValue.visibility = View.VISIBLE
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideDescription(): CustomDialogList {
|
fun hideDescription(): CustomDialogList {
|
||||||
binding.customDialogDescription.visibility = View.GONE
|
binding.customDialogDescription.visibility = View.GONE
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideTextInput(visibility:Int = View.INVISIBLE): CustomDialogList {
|
fun hideTextInput(visibility: Int = View.INVISIBLE): CustomDialogList {
|
||||||
binding.textinputlayoutUsername.visibility = visibility
|
binding.textinputlayoutUsername.visibility = visibility
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getFocusThree() {
|
||||||
|
binding.customDialogValueThree.requestFocus()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -7,10 +7,10 @@ import com.google.android.material.textfield.TextInputEditText
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ComponentCustomThreeDialogBinding
|
import es.verdnatura.databinding.ComponentCustomThreeDialogBinding
|
||||||
|
|
||||||
|
class CustomDialogThreeButtons(context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||||
|
|
||||||
class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.DialogTheme) {
|
private var binding: ComponentCustomThreeDialogBinding =
|
||||||
|
ComponentCustomThreeDialogBinding.inflate(layoutInflater)
|
||||||
private var binding: ComponentCustomThreeDialogBinding = ComponentCustomThreeDialogBinding.inflate(layoutInflater)
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
||||||
|
@ -18,53 +18,52 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
|
||||||
//setContentView(R.layout.component_custom_three_dialog)
|
//setContentView(R.layout.component_custom_three_dialog)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun setTitle(title: String): CustomDialogThreeButtons {
|
fun setTitle(title: String): CustomDialogThreeButtons {
|
||||||
|
|
||||||
binding.customDialogTitle.visibility= View.VISIBLE
|
binding.customDialogTitle.visibility = View.VISIBLE
|
||||||
binding.customDialogTitle.text=title
|
binding.customDialogTitle.text = title
|
||||||
/* custom_dialog_title.visibility = View.VISIBLE
|
/* custom_dialog_title.visibility = View.VISIBLE
|
||||||
custom_dialog_title.text = title*/
|
custom_dialog_title.text = title*/
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setDescription(description: String): CustomDialogThreeButtons {
|
fun setDescription(description: String): CustomDialogThreeButtons {
|
||||||
binding.customDialogDescription.visibility= View.VISIBLE
|
binding.customDialogDescription.visibility = View.VISIBLE
|
||||||
binding.customDialogDescription.text=description
|
binding.customDialogDescription.text = description
|
||||||
|
|
||||||
/* custom_dialog_description.visibility = View.VISIBLE
|
/* custom_dialog_description.visibility = View.VISIBLE
|
||||||
custom_dialog_description.text = description*/
|
custom_dialog_description.text = description*/
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
|
|
||||||
binding.customDialogButtonOk.visibility = View.VISIBLE
|
binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||||
binding.customDialogButtonOk.text =text
|
binding.customDialogButtonOk.text = text
|
||||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||||
|
|
||||||
/* custom_dialog_button_ok.visibility = View.VISIBLE
|
/* custom_dialog_button_ok.visibility = View.VISIBLE
|
||||||
custom_dialog_button_ok.text = text
|
custom_dialog_button_ok.text = text
|
||||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getValue(): String {
|
||||||
fun getValue() : String {
|
|
||||||
return binding.customDialogValue.text.toString()
|
return binding.customDialogValue.text.toString()
|
||||||
//return custom_dialog_value.text.toString()
|
//return custom_dialog_value.text.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getEditText() : TextInputEditText {
|
fun getEditText(): TextInputEditText {
|
||||||
return binding.customDialogValue
|
return binding.customDialogValue
|
||||||
//return custom_dialog_value
|
//return custom_dialog_value
|
||||||
}
|
}
|
||||||
fun setValue(value : String): CustomDialogThreeButtons{
|
|
||||||
|
fun setValue(value: String): CustomDialogThreeButtons {
|
||||||
|
|
||||||
binding.customDialogValue.setText(value)
|
binding.customDialogValue.setText(value)
|
||||||
binding.textinputlayout.visibility = View.VISIBLE
|
binding.textinputlayout.visibility = View.VISIBLE
|
||||||
/* custom_dialog_value.setText(value)
|
/* custom_dialog_value.setText(value)
|
||||||
textinputlayout.visibility = View.VISIBLE*/
|
textinputlayout.visibility = View.VISIBLE*/
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,10 +116,15 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setCustomDialogValue(visibility:Int){
|
fun setCustomDialogValue(visibility: Int) {
|
||||||
binding.customDialogValue.visibility=visibility
|
binding.customDialogValue.visibility = visibility
|
||||||
}
|
}
|
||||||
fun setFocusDialogValue(){
|
|
||||||
|
fun setFocusDialogValue() {
|
||||||
binding.customDialogValue.requestFocus()
|
binding.customDialogValue.requestFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setHintDialogValue(text: String) {
|
||||||
|
binding.customDialogValue.hint = text
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -32,6 +32,8 @@ import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnAjustesItemClickListener
|
import es.verdnatura.presentation.common.OnAjustesItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.view.commom.NameWithId
|
||||||
|
import es.verdnatura.presentation.view.commom.SearchableAdapter
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.adapter.SettingsAdapter
|
import es.verdnatura.presentation.view.feature.ajustes.adapter.SettingsAdapter
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
||||||
|
@ -75,51 +77,96 @@ class AjustesFragment :
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.settings)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.settings)
|
||||||
hideBackButton(binding.mainToolbar)
|
hideBackButton(binding.mainToolbar)
|
||||||
getUserData()
|
getUserData()
|
||||||
binding.userText.text = mobileApplication.userName
|
|
||||||
binding.itemVersion.text = requireActivity().packageManager.getPackageInfo(
|
|
||||||
requireActivity().packageName, 0
|
|
||||||
).versionName!!
|
|
||||||
binding.androididText.text =
|
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey<String>(ANDROID_ID)
|
|
||||||
binding.serialNumber.text = mobileApplication.serialNumber
|
|
||||||
pasilleroViewModel = PasilleroViewModel(mobileApplication)
|
pasilleroViewModel = PasilleroViewModel(mobileApplication)
|
||||||
setToolBar()
|
setToolBar()
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setSearchable(listNames: MutableList<NameWithId>) {
|
||||||
|
val adapter =
|
||||||
|
SearchableAdapter(
|
||||||
|
listElements = listNames,
|
||||||
|
context = requireContext()
|
||||||
|
) { elementSelected ->
|
||||||
|
sectorListVO.forEach {
|
||||||
|
if (it.id == elementSelected.id) {
|
||||||
|
runBlocking {
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
PRINTERNAME, getString(R.string.noprinter)
|
||||||
|
)
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(PRINTERFK, -1)
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
SECTORDESCRIP, it.description
|
||||||
|
)
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
SECTORFK, it.id
|
||||||
|
)
|
||||||
|
it.warehouseFk?.let { it1 ->
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
WAREHOUSEFK, it1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
viewModel.settingsItem[0].sectorFk = it.id
|
||||||
|
viewModel.settingsItem[0].selected = it.description
|
||||||
|
viewModel.workerUpdateOperatorSalix(
|
||||||
|
"sector", mobileApplication.userId!!, it.id, null
|
||||||
|
)
|
||||||
|
settingsAdapter!!.notifyItemChanged(0)
|
||||||
|
return@forEach
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.searchableRecyclerView.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.searchableRecyclerView.setAdapter(adapter, listNames)
|
||||||
|
binding.searchableRecyclerView.visibility = View.VISIBLE
|
||||||
|
binding.searchableRecyclerView.setSearchHintWithoutFocus(getString(R.string.sectorSearch))
|
||||||
|
}
|
||||||
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
|
|
||||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
val iconInfo = ImageView(context)
|
val iconInfo = ImageView(context)
|
||||||
iconInfo.setImageResource(R.drawable.ic_info_delivery)
|
iconInfo.setImageResource(R.drawable.ic_info_delivery)
|
||||||
|
val iconLogout = ImageView(context)
|
||||||
|
iconLogout.setImageResource(R.drawable.ic_logout)
|
||||||
|
|
||||||
listIcons.add(iconInfo)
|
listIcons.add(iconInfo)
|
||||||
|
listIcons.add(iconLogout)
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
customDialog.setTitle(getString(R.string.info))
|
when (item) {
|
||||||
.setDescription(
|
iconInfo.drawable -> {
|
||||||
getString(R.string.version) + ":\t" +
|
customDialog.setTitle(getString(R.string.info))
|
||||||
requireActivity().packageManager.getPackageInfo(
|
.setDescription(
|
||||||
requireActivity().packageName, 0
|
getString(R.string.version) + ":\t" +
|
||||||
).versionName!! + "(${getVersionCode()})" + "\n" +
|
requireActivity().packageManager.getPackageInfo(
|
||||||
getString(R.string.user) + ":\t" +
|
requireActivity().packageName, 0
|
||||||
mobileApplication.userName + "\n" +
|
).versionName!! + "(${getVersionCode()})" + "\n" +
|
||||||
getString(R.string.androidid) + ":\t" +
|
getString(R.string.user) + ":\t" +
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
mobileApplication.userName + "\n" +
|
||||||
ANDROID_ID
|
getString(R.string.androidid) + ":\t" +
|
||||||
) + "\n" +
|
mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
if (!mobileApplication.serialNumber.isNullOrBlank()) {
|
ANDROID_ID
|
||||||
getString(R.string.serialNumber) + "\t" +
|
) + "\n" +
|
||||||
mobileApplication.serialNumber
|
if (!mobileApplication.serialNumber.isNullOrBlank()) {
|
||||||
} else ""
|
getString(R.string.serialNumber) + "\t" +
|
||||||
|
mobileApplication.serialNumber
|
||||||
|
} else ""
|
||||||
|
|
||||||
)
|
)
|
||||||
.setOkButton(getString(R.string.Close)) {
|
.setOkButton(getString(R.string.Close)) {
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
iconLogout.drawable -> {
|
||||||
|
ma.onMyBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||||
|
@ -177,6 +224,23 @@ class AjustesFragment :
|
||||||
CodeWorkerAction.STOP
|
CodeWorkerAction.STOP
|
||||||
)
|
)
|
||||||
|
|
||||||
|
getString(R.string.holdpositionAuto) -> {
|
||||||
|
|
||||||
|
runBlocking {
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
HOLDPOSITION,
|
||||||
|
viewModel.settingsItem[5].selected != getString(R.string.yes)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
viewModel.settingsItem[5].holdPosition =
|
||||||
|
!viewModel.settingsItem[5].holdPosition
|
||||||
|
viewModel.settingsItem[5].selected =
|
||||||
|
if (viewModel.settingsItem[5].holdPosition) getString(R.string.yes) else getString(
|
||||||
|
R.string.no
|
||||||
|
)
|
||||||
|
settingsAdapter!!.notifyItemChanged(5)
|
||||||
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,11 +270,13 @@ class AjustesFragment :
|
||||||
}
|
}
|
||||||
// modificar
|
// modificar
|
||||||
listSectores.sort()
|
listSectores.sort()
|
||||||
val array = arrayOfNulls<String>(listSectores.size)
|
|
||||||
sectorListVO = it.list
|
sectorListVO = it.list
|
||||||
showDialogForAll(
|
setSearchable(sectorListVO.map {
|
||||||
listSectores.toArray(array), getString(R.string.selectSector)
|
NameWithId(
|
||||||
)
|
id = it.id,
|
||||||
|
name = it.description
|
||||||
|
)
|
||||||
|
} as MutableList<NameWithId>)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
customDialog.setTitle(getString(R.string.sectors))
|
customDialog.setTitle(getString(R.string.sectors))
|
||||||
|
@ -297,16 +363,6 @@ class AjustesFragment :
|
||||||
private fun getUserData() {
|
private fun getUserData() {
|
||||||
|
|
||||||
loginViewModel = LoginViewModel(requireActivity().applicationContext)
|
loginViewModel = LoginViewModel(requireActivity().applicationContext)
|
||||||
/* try {
|
|
||||||
loginViewModel.operatorGetData(mobileApplication.userId!!)
|
|
||||||
} catch (_: Exception) {
|
|
||||||
ma.messageWithSound(
|
|
||||||
message = getString(R.string.errorGetData), isError = true, isPlayed = true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
loginViewModel.workerOperator.observe(this@AjustesFragment) { iti ->
|
|
||||||
runBlocking { mobileApplication.dataStoreApp.saveDataOperator(iti) }
|
|
||||||
}*/
|
|
||||||
handleUserCall()
|
handleUserCall()
|
||||||
loginViewModel.handleUserResponse.observe(this@AjustesFragment) { iti ->
|
loginViewModel.handleUserResponse.observe(this@AjustesFragment) { iti ->
|
||||||
runBlocking { mobileApplication.dataStoreApp.saveWorkerData(iti) }
|
runBlocking { mobileApplication.dataStoreApp.saveWorkerData(iti) }
|
||||||
|
|
|
@ -100,14 +100,17 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
action = false
|
action = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
/*Tarea 5443
|
//Tarea 5443
|
||||||
_settingsItem.add(
|
_settingsItem.add(
|
||||||
AjustesItemVO(
|
AjustesItemVO(
|
||||||
"Bajar línea al revisar",
|
context.getString(R.string.holdpositionAuto),
|
||||||
holdPosition = holdPosition,
|
holdPosition = holdPosition,
|
||||||
action = true
|
selected = if (holdPosition) context.getString(R.string.yes) else context.getString(
|
||||||
)
|
R.string.no
|
||||||
)*/
|
),
|
||||||
|
action = true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
_settingsItem.add(
|
_settingsItem.add(
|
||||||
AjustesItemVO(
|
AjustesItemVO(
|
||||||
|
@ -124,11 +127,11 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
context.getString(R.string.runActivityStop), action = true
|
context.getString(R.string.runActivityStop), action = true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
_settingsItem.add(
|
/* _settingsItem.add(
|
||||||
AjustesItemVO(
|
AjustesItemVO(
|
||||||
context.getString(R.string.closeSession), action = true
|
context.getString(R.string.closeSession), action = true
|
||||||
)
|
)
|
||||||
)
|
)*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentItemCardBinding
|
import es.verdnatura.databinding.FragmentItemCardBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PRINTERFK
|
||||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
|
@ -19,7 +20,9 @@ import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnClickDynamic
|
import es.verdnatura.presentation.common.OnClickDynamic
|
||||||
import es.verdnatura.presentation.common.OnItemCardRowClickListener
|
import es.verdnatura.presentation.common.OnItemCardRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.PrinterDialogManager
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.common.hideKeyboard
|
||||||
import es.verdnatura.presentation.common.itemScanValue
|
import es.verdnatura.presentation.common.itemScanValue
|
||||||
import es.verdnatura.presentation.common.loadUrl
|
import es.verdnatura.presentation.common.loadUrl
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogDynamicButtons
|
import es.verdnatura.presentation.view.component.CustomDialogDynamicButtons
|
||||||
|
@ -53,6 +56,8 @@ class ItemCardFragment(
|
||||||
private var quantityToDiscard = 0
|
private var quantityToDiscard = 0
|
||||||
private var itemInfoG: ItemCardVO? = null
|
private var itemInfoG: ItemCardVO? = null
|
||||||
private var positionToReturnY = 0
|
private var positionToReturnY = 0
|
||||||
|
private var originalScan: String? = null
|
||||||
|
private var buyToPrint: Long? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
|
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
|
||||||
|
@ -95,16 +100,20 @@ class ItemCardFragment(
|
||||||
iconHistory.setImageResource(R.drawable.ic_history_black_24dp)
|
iconHistory.setImageResource(R.drawable.ic_history_black_24dp)
|
||||||
val iconSalix = ImageView(context)
|
val iconSalix = ImageView(context)
|
||||||
iconSalix.setImageResource(R.drawable.ic_logo_salix)
|
iconSalix.setImageResource(R.drawable.ic_logo_salix)
|
||||||
|
val iconPrint = ImageView(context)
|
||||||
|
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
||||||
|
|
||||||
|
|
||||||
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||||
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
||||||
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
|
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
|
||||||
|
// Tarea 7266
|
||||||
|
// iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
||||||
|
|
||||||
listIcons.add(iconSalix)
|
listIcons.add(iconSalix)
|
||||||
listIcons.add(iconReload)
|
listIcons.add(iconReload)
|
||||||
listIcons.add(iconHistory)
|
listIcons.add(iconHistory)
|
||||||
|
// listIcons.add(iconPrint)
|
||||||
|
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
|
@ -112,6 +121,25 @@ class ItemCardFragment(
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
when (item) {
|
when (item) {
|
||||||
|
|
||||||
|
iconPrint.drawable -> {
|
||||||
|
|
||||||
|
if (buyToPrint != null) {
|
||||||
|
|
||||||
|
val printerDialogManager = PrinterDialogManager(requireContext())
|
||||||
|
printerDialogManager.showPrintDialog(
|
||||||
|
itemInfoG!!.id.toLong(),
|
||||||
|
itemInfoG?.longName ?: ""
|
||||||
|
) { id, labelType, copies, packing ->
|
||||||
|
printItem(id, labelType, copies, packing)
|
||||||
|
}
|
||||||
|
} else ma.messageWithSound(
|
||||||
|
getString(R.string.errorPrintBuy),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
iconReload.drawable -> {
|
iconReload.drawable -> {
|
||||||
getItemCard(itemInfoG!!.id.toString())
|
getItemCard(itemInfoG!!.id.toString())
|
||||||
}
|
}
|
||||||
|
@ -152,20 +180,42 @@ class ItemCardFragment(
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun printItem(id: Long, labelType: String, packing: Int?, copies: Int?) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
viewModel.printItem(
|
||||||
|
reportName = "LabelBuy",
|
||||||
|
printerFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
|
PRINTERFK
|
||||||
|
),
|
||||||
|
userFk = mobileApplication.userId!!,
|
||||||
|
priority = "normal",
|
||||||
|
params = """{'copies':$copies,'id':$id,'labelType':'$labelType','packing':$packing}"""
|
||||||
|
)
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ma.messageWithSound(message = ex.message.toString(), isError = true, isPlayed = true)
|
||||||
|
}
|
||||||
|
customDialogList.dismiss()
|
||||||
|
hideKeyboard()
|
||||||
|
}
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
|
|
||||||
binding.editItemFk.requestFocus()
|
binding.editItemFk.requestFocus()
|
||||||
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
if (binding.editItemFk.text.toString().isNotEmpty()) try {
|
if (binding.editItemFk.text.toString().isNotEmpty())
|
||||||
getItemCard(
|
try {
|
||||||
itemScanValue(
|
originalScan = itemScanValue(
|
||||||
binding.editItemFk.text.toString(), arrayOf("buy"), "more"
|
binding.editItemFk.text.toString(), arrayOf("buy"), "more"
|
||||||
).toString()
|
).toString()
|
||||||
)
|
getItemCard(
|
||||||
} catch (ex: Exception) {
|
originalScan!!
|
||||||
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
|
)
|
||||||
}
|
} catch (ex: Exception) {
|
||||||
|
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
|
||||||
|
}
|
||||||
|
|
||||||
binding.editItemFk.setText("")
|
binding.editItemFk.setText("")
|
||||||
ma.hideKeyboard(binding.editItemFk)
|
ma.hideKeyboard(binding.editItemFk)
|
||||||
|
@ -196,7 +246,6 @@ class ItemCardFragment(
|
||||||
|
|
||||||
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK) as Int
|
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK) as Int
|
||||||
itemFk = itemValueFk
|
itemFk = itemValueFk
|
||||||
|
|
||||||
viewModel.getItemCard(itemFk.toLong(), warehouseFk!!)
|
viewModel.getItemCard(itemFk.toLong(), warehouseFk!!)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -210,6 +259,19 @@ class ItemCardFragment(
|
||||||
binding.itemcardLayout.visibility = View.VISIBLE
|
binding.itemcardLayout.visibility = View.VISIBLE
|
||||||
setItemCard(it)
|
setItemCard(it)
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
|
/* Tarea 7266
|
||||||
|
if (originalScan == null || it.id == originalScan!!.toInt()) {
|
||||||
|
viewModel.buyUltimate(
|
||||||
|
itemFk = it.id,
|
||||||
|
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
|
WAREHOUSEFK
|
||||||
|
),
|
||||||
|
dated = LocalDate.now()
|
||||||
|
.format(DateTimeFormatter.ofPattern("yyyy-dd-MM"))
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
buyToPrint = originalScan!!.toLong()
|
||||||
|
}*/
|
||||||
} else {
|
} else {
|
||||||
binding.itemcardLayout.visibility = GONE
|
binding.itemcardLayout.visibility = GONE
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
|
||||||
|
@ -237,6 +299,11 @@ class ItemCardFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
loadBuyUltimateResponse.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
buyToPrint = it
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import androidx.lifecycle.map
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
|
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
|
||||||
|
import es.verdnatura.domain.userCases.GetItemPrintItemUseCase
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.Event
|
import es.verdnatura.presentation.common.Event
|
||||||
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
||||||
|
@ -25,6 +26,7 @@ import java.io.File
|
||||||
class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
||||||
|
private val printItemUseCase = GetItemPrintItemUseCase(salix)
|
||||||
|
|
||||||
private val _itemCard by lazy { MutableLiveData<ItemCardVO>() }
|
private val _itemCard by lazy { MutableLiveData<ItemCardVO>() }
|
||||||
val itemCard: LiveData<ItemCardVO>
|
val itemCard: LiveData<ItemCardVO>
|
||||||
|
@ -48,6 +50,10 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
val loadAddressLosesList: LiveData<Event<AddressLosesList>> =
|
val loadAddressLosesList: LiveData<Event<AddressLosesList>> =
|
||||||
_addressLosesList.map { Event(it) }
|
_addressLosesList.map { Event(it) }
|
||||||
|
|
||||||
|
private val _buyUltimateResponse by lazy { MutableLiveData<Long>() }
|
||||||
|
val buyUltimateResponse: LiveData<Long> = _buyUltimateResponse
|
||||||
|
val loadBuyUltimateResponse: LiveData<Event<Long>> = _buyUltimateResponse.map { Event(it) }
|
||||||
|
|
||||||
fun getItemCard(
|
fun getItemCard(
|
||||||
itemFk: Number,
|
itemFk: Number,
|
||||||
warehouseFk: Int,
|
warehouseFk: Int,
|
||||||
|
@ -63,6 +69,28 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun printItem(
|
||||||
|
reportName: String,
|
||||||
|
printerFk: Int,
|
||||||
|
userFk: Int,
|
||||||
|
params: Any,
|
||||||
|
priority: String
|
||||||
|
|
||||||
|
) {
|
||||||
|
|
||||||
|
printItemUseCase.execute(
|
||||||
|
params = arrayListOf(
|
||||||
|
reportName,
|
||||||
|
printerFk,
|
||||||
|
userFk,
|
||||||
|
params,
|
||||||
|
priority
|
||||||
|
).formatWithQuotes()
|
||||||
|
)
|
||||||
|
.enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun itemGetSimilar(
|
fun itemGetSimilar(
|
||||||
itemFk: Int,
|
itemFk: Int,
|
||||||
warehouseFk: Int,
|
warehouseFk: Int,
|
||||||
|
@ -210,4 +238,15 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun buyUltimate(
|
||||||
|
itemFk: Int, warehouseFk: Int, dated: String
|
||||||
|
) {
|
||||||
|
salix.buyUltimate(params = arrayListOf(itemFk, warehouseFk, dated).formatWithQuotes())
|
||||||
|
.enqueue(object : SalixCallback<Long>(context) {
|
||||||
|
override fun onSuccess(response: Response<Long>) {
|
||||||
|
_buyUltimateResponse.value = response.body()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ class ItemCardVO(
|
||||||
var size: Int? = null,
|
var size: Int? = null,
|
||||||
var stems: String? = null,
|
var stems: String? = null,
|
||||||
var itemCost: String? = null,
|
var itemCost: String? = null,
|
||||||
var category:String? = null,
|
var category: String? = null,
|
||||||
var producer: String? = null,
|
var producer: String? = null,
|
||||||
var origin: String? = null,
|
var origin: String? = null,
|
||||||
var reserva: Int? = null,
|
var reserva: Int? = null,
|
||||||
|
@ -46,13 +46,20 @@ class ItemCardRowVO(
|
||||||
class BarcodeVO(
|
class BarcodeVO(
|
||||||
var code: String?
|
var code: String?
|
||||||
)
|
)
|
||||||
|
|
||||||
data class ItemDetails(
|
data class ItemDetails(
|
||||||
var itemFk: Int? = null,
|
var itemFk: Int? = null,
|
||||||
var vShelvingFK: String = "",
|
var vShelvingFK: String = "",
|
||||||
var itemCost: Double = 0.0,
|
var itemCost: Double = 0.0,
|
||||||
var visible: Int = 0,
|
var visible: Int = 0,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
data class ItemPrint(
|
||||||
|
val id: Int,
|
||||||
|
val labelType: String,
|
||||||
|
val packing: Int? = null,
|
||||||
|
val copies: Int? = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class BuscarItemFragment(
|
||||||
if (binding.editItemFk.text.toString().isNotEmpty()) try {
|
if (binding.editItemFk.text.toString().isNotEmpty()) try {
|
||||||
getLocations(
|
getLocations(
|
||||||
itemScanValue(
|
itemScanValue(
|
||||||
binding.editItemFk.text.toString(), arrayOf("buy"), "more"
|
binding.editItemFk.text.toString(), arrayOf("buy"), "more"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
|
|
@ -6,6 +6,8 @@ import android.graphics.Color
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.View.GONE
|
||||||
|
import android.view.View.VISIBLE
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat.getColor
|
import androidx.core.content.ContextCompat.getColor
|
||||||
import androidx.core.graphics.drawable.DrawableCompat
|
import androidx.core.graphics.drawable.DrawableCompat
|
||||||
|
@ -13,6 +15,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ItemArticleRowFragmentBinding
|
import es.verdnatura.databinding.ItemArticleRowFragmentBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
||||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnPackingClickListener
|
import es.verdnatura.presentation.common.OnPackingClickListener
|
||||||
|
@ -20,11 +23,12 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||||
import es.verdnatura.presentation.common.OnTicketClickListener
|
import es.verdnatura.presentation.common.OnTicketClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnTicketColorListener
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
|
|
||||||
class SaleAdapter(
|
class SaleAdapter(
|
||||||
private val items: List<SaleVO>,
|
private var items: MutableList<SaleVO>,
|
||||||
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||||
private val onQuantityClick: OnQuantityClickListener,
|
private val onQuantityClick: OnQuantityClickListener,
|
||||||
private val onSaleClickListener: OnSaleClickListener,
|
private val onSaleClickListener: OnSaleClickListener,
|
||||||
|
@ -33,8 +37,9 @@ class SaleAdapter(
|
||||||
private var onTicketClick: OnTicketClickListener? = null,
|
private var onTicketClick: OnTicketClickListener? = null,
|
||||||
private var SaleAdapter: SaleAdapter? = null,
|
private var SaleAdapter: SaleAdapter? = null,
|
||||||
private var type: String? = null,
|
private var type: String? = null,
|
||||||
|
private var onTicketColorClickListener: OnTicketColorListener? = null
|
||||||
|
|
||||||
) : RecyclerView.Adapter<SaleAdapter.AjustesItemHolder>() {
|
) : RecyclerView.Adapter<SaleAdapter.AjustesItemHolder>() {
|
||||||
var context: Context? = null
|
var context: Context? = null
|
||||||
var position: Int = 0
|
var position: Int = 0
|
||||||
|
|
||||||
|
@ -396,8 +401,32 @@ class SaleAdapter(
|
||||||
} else {
|
} else {
|
||||||
View.GONE
|
View.GONE
|
||||||
}*/
|
}*/
|
||||||
|
println("sale ${sale.parkingCode} : ${sale.isAdvanced}")
|
||||||
//ASIGNAMOS VALOR A LA VSITA
|
//ASIGNAMOS VALOR A LA VSITA
|
||||||
|
ticketFk.setTextColor(
|
||||||
|
getColor(
|
||||||
|
context!!,
|
||||||
|
if (sale.isAdvanced != null && sale.isAdvanced == 1) {
|
||||||
|
R.color.verdnatura_red_salix
|
||||||
|
} else {
|
||||||
|
R.color.verdnatura_black
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
parkingCode.visibility = if (sale.parkingCode == null) GONE else VISIBLE
|
||||||
|
|
||||||
|
itemTicketColor.setOnClickListener {
|
||||||
|
onTicketColorClickListener?.onTicketColorListener(sale)
|
||||||
|
}
|
||||||
|
if (type == SACADOR || type == CONTROLADOR) {
|
||||||
|
itemTicketColor.tooltipText = context!!.getString(R.string.filterLevelColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ticketFk.paintFlags = ticketFk.paintFlags or Paint.UNDERLINE_TEXT_FLAG
|
||||||
|
itemArticleItemFk.paintFlags =
|
||||||
|
itemArticleItemFk.paintFlags or Paint.UNDERLINE_TEXT_FLAG*/
|
||||||
|
|
||||||
|
|
||||||
this.sale = sale
|
this.sale = sale
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -468,4 +497,14 @@ class SaleAdapter(
|
||||||
// itemTicketColor.setBackgroundResource((R.drawable.rectangle))
|
// itemTicketColor.setBackgroundResource((R.drawable.rectangle))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun updateSales(newSales: List<SaleVO>) {
|
||||||
|
items = newSales.toMutableList()
|
||||||
|
notifyDataSetChanged() // Notifica al adaptador que los datos han cambiado
|
||||||
|
}
|
||||||
|
|
||||||
|
fun orderSales(newSales: List<SaleVO>) {
|
||||||
|
|
||||||
|
notifyDataSetChanged() // Notifica al adaptador que los datos han cambiado
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -7,7 +7,6 @@ import android.graphics.drawable.Drawable
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.INVISIBLE
|
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat.getColor
|
import androidx.core.content.ContextCompat.getColor
|
||||||
|
@ -20,6 +19,7 @@ import es.verdnatura.domain.ConstAndValues.PREITEMPICKERTEST
|
||||||
import es.verdnatura.domain.ConstAndValues.PREPARED
|
import es.verdnatura.domain.ConstAndValues.PREPARED
|
||||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.presentation.common.OnAddItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnPackingClickSaleListener
|
import es.verdnatura.presentation.common.OnPackingClickSaleListener
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
@ -38,6 +38,7 @@ class SaleAdapterNew(
|
||||||
private var onTicketClick: OnTicketClickSaleListener? = null,
|
private var onTicketClick: OnTicketClickSaleListener? = null,
|
||||||
private var saleAdapter: SaleAdapterNew? = null,
|
private var saleAdapter: SaleAdapterNew? = null,
|
||||||
private var onReserveSaleClick: OnSaleReserveClickListener? = null,
|
private var onReserveSaleClick: OnSaleReserveClickListener? = null,
|
||||||
|
private var onAddItemClickListener: OnAddItemClickListener? = null,
|
||||||
private var type: String? = null,
|
private var type: String? = null,
|
||||||
|
|
||||||
) : RecyclerView.Adapter<SaleAdapterNew.AjustesItemHolder>() {
|
) : RecyclerView.Adapter<SaleAdapterNew.AjustesItemHolder>() {
|
||||||
|
@ -70,7 +71,6 @@ class SaleAdapterNew(
|
||||||
) : RecyclerView.ViewHolder(binding.root) {
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
fun bind(sale: Sale) {
|
fun bind(sale: Sale) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
// if (sale.reservedQuantity == null) sale.reservedQuantity = 0
|
|
||||||
|
|
||||||
val childLayoutManager =
|
val childLayoutManager =
|
||||||
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
||||||
|
@ -148,12 +148,15 @@ class SaleAdapterNew(
|
||||||
layoutError.visibility = VISIBLE
|
layoutError.visibility = VISIBLE
|
||||||
txtError.text =
|
txtError.text =
|
||||||
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
|
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
|
||||||
|
binding.addItem.visibility = VISIBLE
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
layoutError.visibility = GONE
|
layoutError.visibility = GONE
|
||||||
|
binding.addItem.visibility = GONE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.deleteReserve.visibility = if (sale.isAdded == 1) VISIBLE else INVISIBLE
|
binding.deleteReserve.visibility = if (sale.isAdded == 1) VISIBLE else GONE
|
||||||
|
|
||||||
if (sale.isAdded == 1) {
|
if (sale.isAdded == 1) {
|
||||||
layoutError.visibility = VISIBLE
|
layoutError.visibility = VISIBLE
|
||||||
|
@ -183,16 +186,7 @@ class SaleAdapterNew(
|
||||||
View.GONE
|
View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sale.isParent) {/* itemArticleItemFk.visibility = View.INVISIBLE
|
if (sale.isParent) {
|
||||||
itemPackingText.visibility = View.INVISIBLE
|
|
||||||
itemPackingItemFk.visibility = View.INVISIBLE
|
|
||||||
itemArticleCel1.visibility = View.INVISIBLE
|
|
||||||
itemArticleCel2.visibility = View.INVISIBLE
|
|
||||||
itemArticleCel3.visibility = View.INVISIBLE
|
|
||||||
itemArticleQuantity.visibility = View.INVISIBLE
|
|
||||||
txtdeNew.visibility = View.INVISIBLE
|
|
||||||
itemArticleQuantityPicked.visibility = View.INVISIBLE
|
|
||||||
itemArticleQuantityLine3.visibility = View.VISIBLE*/
|
|
||||||
packingTopicker.visibility = View.INVISIBLE
|
packingTopicker.visibility = View.INVISIBLE
|
||||||
quantityReserved.visibility = View.INVISIBLE
|
quantityReserved.visibility = View.INVISIBLE
|
||||||
itemArticleItemFkNew.visibility = View.INVISIBLE
|
itemArticleItemFkNew.visibility = View.INVISIBLE
|
||||||
|
@ -200,16 +194,7 @@ class SaleAdapterNew(
|
||||||
imageErrorMessage.visibility = View.INVISIBLE
|
imageErrorMessage.visibility = View.INVISIBLE
|
||||||
ivArrow.visibility = View.VISIBLE
|
ivArrow.visibility = View.VISIBLE
|
||||||
|
|
||||||
} else {/*itemArticleItemFk.visibility = View.VISIBLE
|
} else {
|
||||||
itemPackingText.visibility = View.VISIBLE
|
|
||||||
itemPackingItemFk.visibility = View.VISIBLE
|
|
||||||
itemArticleCel1.visibility = View.VISIBLE
|
|
||||||
itemArticleCel2.visibility = View.VISIBLE
|
|
||||||
itemArticleCel3.visibility = View.VISIBLE
|
|
||||||
itemArticleQuantity.visibility = View.VISIBLE
|
|
||||||
txtdeNew.visibility = View.VISIBLE
|
|
||||||
itemArticleQuantityPicked.visibility = View.VISIBLE
|
|
||||||
itemArticleQuantityLine3.visibility = View.VISIBLE*/
|
|
||||||
|
|
||||||
imageErrorMessage.visibility = View.GONE
|
imageErrorMessage.visibility = View.GONE
|
||||||
if (type != SACADOR && type != PREITEMPICKERTEST) {
|
if (type != SACADOR && type != PREITEMPICKERTEST) {
|
||||||
|
@ -347,9 +332,12 @@ class SaleAdapterNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.itemParkingCode.text =
|
binding.itemParkingCode.text =
|
||||||
// if (type == PREITEMPICKERTEST) sale.parkingCodePrevia else sale.parkingCode
|
// if (type == PREPARED) sale.parkingCodePrevia else sale.parkingCode
|
||||||
sale.parkingCodePrevia
|
sale.parkingCode ?: sale.parkingCodePrevia
|
||||||
|
|
||||||
|
binding.addItem.setOnClickListener {
|
||||||
|
onAddItemClickListener!!.onAddItemClickListener(sale)
|
||||||
|
}
|
||||||
|
|
||||||
println("parkingCodePrevia ${sale.parkingCodePrevia}")
|
println("parkingCodePrevia ${sale.parkingCodePrevia}")
|
||||||
println("parkingCode ${sale.parkingCode}")
|
println("parkingCode ${sale.parkingCode}")
|
||||||
|
|
|
@ -0,0 +1,358 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.map
|
||||||
|
import com.google.gson.JsonObject
|
||||||
|
import es.verdnatura.MobileApplication
|
||||||
|
import es.verdnatura.domain.SalixCallback
|
||||||
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
|
||||||
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
|
import es.verdnatura.presentation.common.Event
|
||||||
|
import es.verdnatura.presentation.common.PickupResponse
|
||||||
|
import es.verdnatura.presentation.common.SaleTrackingReplaceSalix
|
||||||
|
import es.verdnatura.presentation.common.TicketState
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||||
|
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
|
||||||
|
import retrofit2.Response
|
||||||
|
|
||||||
|
class CollectionCheckerViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
||||||
|
|
||||||
|
//var isPaused: Boolean = false
|
||||||
|
|
||||||
|
private val _isPaused = MutableLiveData<Boolean>()
|
||||||
|
val isPaused: LiveData<Boolean> get() = _isPaused
|
||||||
|
|
||||||
|
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
||||||
|
val collectionTicketList: LiveData<CollectionVO> = _collectionTicketList
|
||||||
|
val loadTicketList: LiveData<Event<CollectionVO>> = _collectionTicketList.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseSaleReplace by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseSaleReplace: LiveData<Boolean> = _responseSaleReplace
|
||||||
|
val loadSaleReplace: LiveData<Event<Boolean>> = _responseSaleReplace.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseCollectionAddItem by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseCollectionAddItem: LiveData<Boolean> = _responseCollectionAddItem
|
||||||
|
val loadResponseAddItem: LiveData<Event<Boolean>> = _responseCollectionAddItem.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responsePrint by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responsePrint: LiveData<Boolean> = _responsePrint
|
||||||
|
val loadPrint: LiveData<Event<Boolean>> = _responsePrint.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseTicketState by lazy { MutableLiveData<TicketState>() }
|
||||||
|
val responseTicketState: LiveData<TicketState> = _responseTicketState
|
||||||
|
val loadTicketState: LiveData<Event<TicketState>> = _responseTicketState.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseTicketIsPickup by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseTicketIsPickup: LiveData<Boolean> = _responseTicketIsPickup
|
||||||
|
val loadTicketIsPickup: LiveData<Event<Boolean>> = _responseTicketIsPickup.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseTicketClosure by lazy { MutableLiveData<String>() }
|
||||||
|
val responseTicketClosure: LiveData<String> = _responseTicketClosure
|
||||||
|
val loadTicketClousure: LiveData<Event<String>> = _responseTicketClosure.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseCollectionUnchecked by lazy { MutableLiveData<String>() }
|
||||||
|
val responseCollectionUnchecked: LiveData<String> = _responseCollectionUnchecked
|
||||||
|
val loadCollectionUnchecked: LiveData<Event<String>> =
|
||||||
|
_responseCollectionUnchecked.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseNew by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseNew: LiveData<Boolean> = _responseNew
|
||||||
|
val loadAddNew: LiveData<Event<Boolean>> = _responseNew.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseIncQuantity by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseIncQuantity: LiveData<Boolean> = _responseIncQuantity
|
||||||
|
val loadIncQuantity: LiveData<Event<Boolean>> = _responseIncQuantity.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseParking by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseParking: LiveData<Boolean> = _responseParking
|
||||||
|
val loadParking: LiveData<Event<Boolean>> = _responseParking.map { Event(it) }
|
||||||
|
|
||||||
|
private val _mistakeList by lazy { MutableLiveData<MistakeTypeListVO>() }
|
||||||
|
val mistakeList: LiveData<MistakeTypeListVO> = _mistakeList
|
||||||
|
val loadMistakes: LiveData<Event<MistakeTypeListVO>> = _mistakeList.map { Event(it) }
|
||||||
|
|
||||||
|
fun getSales(
|
||||||
|
collectionFk: Number, print: String, source: String
|
||||||
|
|
||||||
|
) {
|
||||||
|
salix.getSalesFromTicketOrCollection(
|
||||||
|
collectionOrTicketFk = collectionFk, print = print != "0", source = source
|
||||||
|
).enqueue(object : SalixCallback<CollectionVO>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_collectionTicketList.value = CollectionVO(
|
||||||
|
0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<CollectionVO>) {
|
||||||
|
try {
|
||||||
|
_collectionTicketList.value = response.body()?.let { it.map(context) }
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ex.toast(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionGetId(
|
||||||
|
ticketFk: Int, print: String, type: String
|
||||||
|
) {
|
||||||
|
salix.getCollectionId(
|
||||||
|
filter = """{"where":{"ticketFk":$ticketFk},"fields":"collectionFk"}"""
|
||||||
|
).enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_collectionTicketList.value = CollectionVO(
|
||||||
|
0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<List<JsonObject>>) {
|
||||||
|
|
||||||
|
if (response.body()!!.isNotEmpty()) {
|
||||||
|
|
||||||
|
getSales(
|
||||||
|
response.body()!![0].entrySet().first().value.toString().toInt(),
|
||||||
|
print,
|
||||||
|
type
|
||||||
|
)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_collectionTicketList.value = CollectionVO(
|
||||||
|
0, isError = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingUpdate(
|
||||||
|
saleFk: Int,
|
||||||
|
originalQuantity: Int,
|
||||||
|
code: String,
|
||||||
|
isChecked: String,
|
||||||
|
buyFk: Long,
|
||||||
|
isScanned: Boolean?
|
||||||
|
) {
|
||||||
|
salix.saleTrackingUpdate(
|
||||||
|
SaleTrackingReplaceSalix(
|
||||||
|
saleFk, originalQuantity, code, isChecked != "0", buyFk, isScanned!!
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseSaleReplace.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseSaleReplace.value = false
|
||||||
|
super.onError(t)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionStickerPrint(
|
||||||
|
collectionFk: Int, labelCount: Int?
|
||||||
|
) {
|
||||||
|
salix.collectionStickerPrint(
|
||||||
|
arrayListOf(
|
||||||
|
collectionFk, labelCount
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responsePrint.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionAddItem(
|
||||||
|
itemFk: Int, quantity: Int, ticketFk: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
salix.addSale(
|
||||||
|
id = ticketFk, barcode = itemFk.toString(), quantity = quantity
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
|
||||||
|
_responseNew.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseNew.value = true
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setParking(
|
||||||
|
ticketFk: Int, parking: String
|
||||||
|
) {
|
||||||
|
salix.setParking(arrayListOf(ticketFk, parking).formatWithQuotes())
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseParking.value = true
|
||||||
|
super.onSuccess(response)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketStateTodaySetState(
|
||||||
|
ticketFk: Int, state: String
|
||||||
|
) {
|
||||||
|
salix.ticketStateTodaySetState(arrayListOf(ticketFk, state).formatWithQuotes())
|
||||||
|
.enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
_responseTicketState.value = TicketState()
|
||||||
|
super.onSuccess(response)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionIncreaseQuantitySalix(
|
||||||
|
saleFk: Int, quantity: String
|
||||||
|
) {
|
||||||
|
salix.collectionIncreaseQuantitySalix(
|
||||||
|
SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
super.onSuccess(response)
|
||||||
|
_responseIncQuantity.value = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleMistakeAdd(
|
||||||
|
saleFk: Int, typeFk: Int
|
||||||
|
) {
|
||||||
|
salix.saleMistakeAdd(
|
||||||
|
SaleMistakeSalix(
|
||||||
|
userFk = (context as MobileApplication).userId!!, saleFk = saleFk, typeFk = typeFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun mistakeType() {
|
||||||
|
salix.getMistakeTypes().enqueue(object : SalixCallback<List<MistakeTypeVO>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<MistakeTypeVO>>) {
|
||||||
|
if (response.body() != null) {
|
||||||
|
_mistakeList.value = response.body()?.let { MistakeTypeListVO(it) }
|
||||||
|
} else {
|
||||||
|
val listError: ArrayList<MistakeTypeVO> = ArrayList()
|
||||||
|
listError.add(MistakeTypeVO(0, ""))
|
||||||
|
_mistakeList.value = MistakeTypeListVO(listError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketIsOutClosureZone(
|
||||||
|
ticketFk: Int
|
||||||
|
) {
|
||||||
|
salix.ticketIsOutClosureZone(
|
||||||
|
arrayListOf(ticketFk)
|
||||||
|
).enqueue(object : SalixCallback<Any?>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any?>) {
|
||||||
|
_responseTicketClosure.value = response.body()?.toString() ?: "false"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketState(
|
||||||
|
ticketFk: Int
|
||||||
|
) {
|
||||||
|
salix.ticketState(
|
||||||
|
"""{"where": {"ticketFk": "$ticketFk"},"include":[{"relation":"user","scope":{"fields":["username"]}}]}"""
|
||||||
|
|
||||||
|
).enqueue(object : SalixCallback<List<TicketState>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<TicketState>>) {
|
||||||
|
_responseTicketState.value = if (response.body()!!.isEmpty()) {
|
||||||
|
TicketState()
|
||||||
|
} else {
|
||||||
|
response.body()!![0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketIsPickup(
|
||||||
|
ticketFk: Number
|
||||||
|
) {
|
||||||
|
salix.ticketIsPickup(
|
||||||
|
"""{
|
||||||
|
"where": {
|
||||||
|
"id": $ticketFk
|
||||||
|
},
|
||||||
|
"fields": ["id", "routeFk"],
|
||||||
|
"include": [
|
||||||
|
{
|
||||||
|
"relation": "route",
|
||||||
|
"scope": {
|
||||||
|
"fields": ["id", "agencyModeFk"],
|
||||||
|
"include": {
|
||||||
|
"relation": "agencyMode",
|
||||||
|
"scope": {
|
||||||
|
"fields": ["id", "deliveryMethodFk","code"],
|
||||||
|
"where": {"code": "REC_ALG"},
|
||||||
|
"include": {
|
||||||
|
"relation": "deliveryMethod",
|
||||||
|
"scope": {
|
||||||
|
"fields": ["id", "code"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}""".trim()
|
||||||
|
|
||||||
|
).enqueue(object : SalixCallback<List<PickupResponse>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<PickupResponse>>) {
|
||||||
|
|
||||||
|
_responseTicketIsPickup.value =
|
||||||
|
response.body()
|
||||||
|
?.firstOrNull()?.route?.agencyMode?.deliveryMethod?.code == "PICKUP"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun hasUncheckedTicket(
|
||||||
|
collectionFk: Int
|
||||||
|
) {
|
||||||
|
salix.hasUncheckedTicket(collectionFk).enqueue(object : SalixCallback<String>(context) {
|
||||||
|
override fun onSuccess(response: Response<String>) {
|
||||||
|
_responseCollectionUnchecked.value = response.body()!!.toString()
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setPausedState(paused: Boolean) {
|
||||||
|
_isPaused.value = paused
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.collection.fragment
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
|
@ -37,6 +36,7 @@ import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.ItemScanned
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
import es.verdnatura.presentation.common.LabelDialogHelper
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
@ -410,7 +410,7 @@ class CollectionFragment(
|
||||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||||
binding.mainToolbar.toolbarIcons.visibility = VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = VISIBLE
|
||||||
//sergio:para ver si ha marcado dos veces el mismo ticket
|
//sergio:para ver si ha marcado dos veces el mismo ticket
|
||||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
binding.scanInput.setText(textScannedFilterDouble(binding.scanInput.text!!.toString()))
|
||||||
|
|
||||||
//de momento solo está el qr de artículo
|
//de momento solo está el qr de artículo
|
||||||
isScanned =
|
isScanned =
|
||||||
|
@ -969,7 +969,7 @@ class CollectionFragment(
|
||||||
myGroupList
|
myGroupList
|
||||||
},*/
|
},*/
|
||||||
saleAdapter = SaleAdapter(
|
saleAdapter = SaleAdapter(
|
||||||
myGroupList,
|
myGroupList as MutableList,
|
||||||
pasillerosItemClickListener!!,
|
pasillerosItemClickListener!!,
|
||||||
object : OnQuantityClickListener {
|
object : OnQuantityClickListener {
|
||||||
|
|
||||||
|
@ -2035,7 +2035,7 @@ class CollectionFragment(
|
||||||
"" + totalMark + "/" + total
|
"" + totalMark + "/" + total
|
||||||
|
|
||||||
if (totalMark == sales.size) {
|
if (totalMark == sales.size) {
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
getString(R.string.completCollection).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
if (canChangeState) changeTicketState()
|
if (canChangeState) changeTicketState()
|
||||||
|
@ -2276,20 +2276,20 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isTicket) {
|
if (isTicket) {
|
||||||
val builder = AlertDialog.Builder(context)
|
val labelDialogHelper = LabelDialogHelper(requireContext())
|
||||||
builder.setTitle(getString(R.string.selectLabeltoPrint))
|
labelDialogHelper.showLabelDialog(
|
||||||
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
onItemSelected = { labelCount ->
|
||||||
builder.setItems(labelCount) { dialog, which ->
|
viewModel.collectionStickerPrint(
|
||||||
viewModel.collectionStickerPrint(
|
collectionFk = collection.collectionFk,
|
||||||
collectionFk = collection.collectionFk, labelCount = (which + 1)
|
labelCount = labelCount
|
||||||
)
|
)
|
||||||
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
|
||||||
PRINTERNAME
|
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
)).toast(requireContext())
|
PRINTERNAME
|
||||||
|
)).toast(requireContext())
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
}
|
|
||||||
val dialog = builder.create()
|
|
||||||
dialog.show()
|
|
||||||
} else {
|
} else {
|
||||||
viewModel.collectionStickerPrint(
|
viewModel.collectionStickerPrint(
|
||||||
collectionFk = collection.collectionFk, null
|
collectionFk = collection.collectionFk, null
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,870 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.media.MediaPlayer
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.InputType
|
||||||
|
import android.view.KeyEvent
|
||||||
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
|
import android.widget.EditText
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.databinding.FragmentCollectionNewBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
||||||
|
import es.verdnatura.domain.ConstAndValues.SECTORFK
|
||||||
|
import es.verdnatura.domain.notNull
|
||||||
|
import es.verdnatura.domain.showToastCenterWithBackground
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.OnPackingClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnSaleClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.OnTicketClickSaleListener
|
||||||
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.common.hideKeyboard
|
||||||
|
import es.verdnatura.presentation.common.itemScanIsQr
|
||||||
|
import es.verdnatura.presentation.common.itemScanValue
|
||||||
|
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.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.SaleAdapterNew
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
|
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.CollectionTicket
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.Sale
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
|
import org.json.JSONObject
|
||||||
|
|
||||||
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
|
class CollectionFragmentCheckerPreviousNew(
|
||||||
|
) : BaseFragment<FragmentCollectionNewBinding, CollectionViewModelCheckerPreviosNew>(
|
||||||
|
CollectionViewModelCheckerPreviosNew::class
|
||||||
|
) {
|
||||||
|
private var sales: List<Sale> = listOf()
|
||||||
|
private var saleAdapter: SaleAdapterNew? = null
|
||||||
|
private var lm: LinearLayoutManager? = null
|
||||||
|
private var storedPosition: Int = 0
|
||||||
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
|
private lateinit var customDialogList: CustomDialogList
|
||||||
|
private var placementSupplyAdapter: BarcodeAdapter? = null
|
||||||
|
private var listPlacementSupply: ArrayList<BarcodeVO> = ArrayList()
|
||||||
|
private lateinit var customDialogInput: CustomDialogInput
|
||||||
|
private lateinit var customDialogThreeButtons: CustomDialogThreeButtons
|
||||||
|
private lateinit var customDialogThreeButtonsQuantity: CustomDialogThreeButtons
|
||||||
|
private var ticketSelected: Int = 0
|
||||||
|
private lateinit var customDialog: CustomDialog
|
||||||
|
var mperror: MediaPlayer? = null
|
||||||
|
var mpok: MediaPlayer? = null
|
||||||
|
private var storedBackPosition: Int = 0
|
||||||
|
private var tickets: ArrayList<String> = ArrayList()
|
||||||
|
private var lastScanned: Int = 0
|
||||||
|
private var positionUnmarked = -1
|
||||||
|
private var isScanned: Boolean? = null
|
||||||
|
private var positionConfirm = 0
|
||||||
|
private var quantityConfirm = 0
|
||||||
|
private lateinit var myGroupList: List<Sale>
|
||||||
|
private var quantityReserveToCheckItemScan = 0
|
||||||
|
private lateinit var collection: CollectionTicket
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance(
|
||||||
|
) = CollectionFragmentCheckerPreviousNew()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAttach(context: Context) {
|
||||||
|
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||||
|
super.onAttach(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getLayoutId(): Int = R.layout.fragment_collection_new
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
||||||
|
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
scanRequest()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
customDialogList = CustomDialogList(requireContext())
|
||||||
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
|
customDialog = CustomDialog(requireContext())
|
||||||
|
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||||
|
customDialogThreeButtonsQuantity = CustomDialogThreeButtons(requireContext())
|
||||||
|
ma.hideBottomNavigation(View.GONE)
|
||||||
|
setEvents()
|
||||||
|
setToolBar()
|
||||||
|
if (::collection.isInitialized) {
|
||||||
|
viewModel.getCollectionTickets(
|
||||||
|
collection.collectionFk, print = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setToolBar() {
|
||||||
|
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
||||||
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
|
binding.mainToolbar.backButton.visibility = View.VISIBLE
|
||||||
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.preControlNew)
|
||||||
|
|
||||||
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
|
val iconAdd = ImageView(context)
|
||||||
|
iconAdd.setImageResource(R.drawable.ic_playlist_add_black_24dp)
|
||||||
|
val iconParking = ImageView(context)
|
||||||
|
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
|
||||||
|
val iconUpdate = ImageView(context)
|
||||||
|
iconUpdate.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
||||||
|
|
||||||
|
iconAdd.tooltipText = getTooltip(R.drawable.ic_playlist_add_black_24dp)
|
||||||
|
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
|
||||||
|
iconUpdate.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||||
|
|
||||||
|
listIcons.add(iconAdd)
|
||||||
|
listIcons.add(iconParking)
|
||||||
|
listIcons.add(iconUpdate)
|
||||||
|
|
||||||
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
|
when (item) {
|
||||||
|
iconAdd.drawable -> addItem()
|
||||||
|
iconUpdate.drawable -> updateScreen()
|
||||||
|
iconParking.drawable -> pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.Parking
|
||||||
|
), ""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||||
|
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateScreen() {
|
||||||
|
viewModel.getCollectionTickets(
|
||||||
|
collection.collectionFk, print = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun scanRequest() {
|
||||||
|
binding.scanInput.requestFocus()
|
||||||
|
hideKeyboards()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setEvents() {
|
||||||
|
|
||||||
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
|
ma.onMyBackPressed()
|
||||||
|
}
|
||||||
|
//ESCANER =========
|
||||||
|
|
||||||
|
binding.scanInput.requestFocus()
|
||||||
|
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().isNotEmpty()) {
|
||||||
|
binding.scanInput.setText(textScannedFilterDouble(binding.scanInput.text!!.toString()))
|
||||||
|
isScanned =
|
||||||
|
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
|
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
||||||
|
val myQr = ItemScanned(JSONObject(binding.scanInput.text.toString()))
|
||||||
|
when (myQr.table) {
|
||||||
|
"saleGroup" -> {
|
||||||
|
binding.scanInput.setText(myQr.id.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
"buy" -> binding.scanInput.setText(myQr.more)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ma.hideKeyboard(binding.scanInput)
|
||||||
|
if (::collection.isInitialized) {
|
||||||
|
findSale(binding.scanInput.text.toString())
|
||||||
|
} else {
|
||||||
|
viewModel.getCollectionTickets(
|
||||||
|
collectionFk = binding.scanInput.text.toString().toLong(), false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.scanInput.setText("")
|
||||||
|
hideKeyboards()
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
hideKeyboards()
|
||||||
|
|
||||||
|
//LISTA =========
|
||||||
|
binding.collectionSwipe.setOnRefreshListener {
|
||||||
|
binding.collectionSwipe.isRefreshing = false
|
||||||
|
updateScreen()
|
||||||
|
binding.collectionSwipe.isRefreshing = false
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun hideKeyboards() {
|
||||||
|
try {
|
||||||
|
requireActivity().hideKeyboard()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
println(e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun observeViewModel() {
|
||||||
|
|
||||||
|
with(viewModel) {
|
||||||
|
|
||||||
|
loadCollectionTicketSalix.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
if (!it.isError) {
|
||||||
|
|
||||||
|
if (it.tickets.isNotEmpty()) {
|
||||||
|
collection = it
|
||||||
|
createCollectionList()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
binding.mainToolbar.toolbarSubtitle.text = "0/0"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
customDialog.setTitle(getString(R.string.error))
|
||||||
|
.setDescription(it.errorMessage)
|
||||||
|
.setOkButton(getString(R.string.accept)) {
|
||||||
|
customDialog.dismiss()
|
||||||
|
if (activity != null) ma.onMyBackPressed()
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
loadExistsResponse.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
if (it.exists) {
|
||||||
|
markLine(it.position, it.quantity, true)
|
||||||
|
} else {
|
||||||
|
getString(R.string.updateSalesReserve).toast(
|
||||||
|
requireContext()
|
||||||
|
)
|
||||||
|
viewModel.getCollectionTickets(collection.collectionFk, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadResponseAddItem.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
updateScreen()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
loadPicked.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
myGroupList[positionConfirm].isPicked = 1
|
||||||
|
saleAdapter!!.notifyItemChanged(positionConfirm)
|
||||||
|
lm!!.scrollToPositionWithOffset(positionConfirm, 0)
|
||||||
|
//lm!!.scrollToPositionWithOffset(storedBackPosition + 1, 0)
|
||||||
|
setTotalLines()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadUnpicked.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
|
||||||
|
myGroupList[positionUnmarked].isPicked = 0
|
||||||
|
myGroupList[positionUnmarked].reservedQuantity = quantityConfirm
|
||||||
|
saleAdapter!!.notifyItemChanged(positionUnmarked)
|
||||||
|
lm!!.scrollToPositionWithOffset(positionUnmarked, 0)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
responseCode.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
|
if (it == null) {
|
||||||
|
showErrorMessage(text = getString(R.string.codeNotExist))
|
||||||
|
if (mperror != null) mperror?.start()
|
||||||
|
} else {
|
||||||
|
if (checkItemScan(it.toString(), positionConfirm)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogList.dismiss()
|
||||||
|
mpok?.start()
|
||||||
|
markLine(positionConfirm, quantityReserveToCheckItemScan, false)
|
||||||
|
} else {
|
||||||
|
customDialogList.setValueTwo("")
|
||||||
|
showErrorMessage(text = getString(R.string.lineNotExist))
|
||||||
|
if (mperror != null) mperror?.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createCollectionList() {
|
||||||
|
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
||||||
|
|
||||||
|
collection.map(requireContext())
|
||||||
|
val salesList: ArrayList<Sale> = ArrayList()
|
||||||
|
|
||||||
|
tickets = ArrayList()
|
||||||
|
var observations = ""
|
||||||
|
|
||||||
|
collection.tickets.forEach { ticket ->
|
||||||
|
|
||||||
|
if (observations.isNotEmpty()) observations = observations + " " + ticket.observations
|
||||||
|
ticket.sales.forEach { sale ->
|
||||||
|
|
||||||
|
salesList.add(sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
myGroupList =
|
||||||
|
salesList.sortedWith(compareBy<Sale> { it.pickingOrderPrevia }.thenBy { it.itemFk })
|
||||||
|
saleAdapter = SaleAdapterNew(myGroupList, pasillerosItemClickListener!!,
|
||||||
|
|
||||||
|
object : OnSaleClickSaleListener {
|
||||||
|
override fun onSaleClick(sale: Sale) {
|
||||||
|
|
||||||
|
val position =
|
||||||
|
myGroupList.indexOfFirst { it.itemShelvingSaleFk == sale.itemShelvingSaleFk }
|
||||||
|
if (position > -1) {
|
||||||
|
if (sale.isPicked == 1) {
|
||||||
|
unMarkLine(position, myGroupList[position])
|
||||||
|
} else {
|
||||||
|
showScanner(position, sale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}, object : OnMistakeClickListener {
|
||||||
|
override fun onMistakeClickListener(sale: SaleVO) {
|
||||||
|
}
|
||||||
|
}, object : OnPackingClickSaleListener {
|
||||||
|
override fun onPackingClick(sale: Sale) {
|
||||||
|
|
||||||
|
if (!sale.code.isNullOrEmpty()) ma.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleUbicator,
|
||||||
|
), entryPoint = sale.code
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}, object : OnTicketClickSaleListener {
|
||||||
|
override fun onTicketClickListener(sale: Sale) {
|
||||||
|
val entryPoint = Gson().toJson(
|
||||||
|
mutableMapOf(
|
||||||
|
"entryPoint" to sale.ticketFk, "web" to "${
|
||||||
|
mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
|
BASEURLSALIX
|
||||||
|
)
|
||||||
|
}/#!/ticket/${sale.ticketFk}/sale"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
ma.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(
|
||||||
|
title = R.string.titleWebViewer,
|
||||||
|
), entryPoint = entryPoint
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}, type = "PRESACADOR"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
binding.fragmentSacadorCollections.adapter = saleAdapter
|
||||||
|
binding.fragmentSacadorCollections.layoutManager = lm
|
||||||
|
|
||||||
|
setTotalLines()
|
||||||
|
setListPosition()
|
||||||
|
setScrollListener(lm!!)
|
||||||
|
printObservations(observations)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setScrollListener(lm: LinearLayoutManager) {
|
||||||
|
binding.fragmentSacadorCollections.clearOnScrollListeners()
|
||||||
|
binding.fragmentSacadorCollections.addOnScrollListener(object :
|
||||||
|
RecyclerView.OnScrollListener() {
|
||||||
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||||
|
// storedBackPosition = lm.findFirstVisibleItemPosition()
|
||||||
|
storedPosition = lm.findFirstVisibleItemPosition()
|
||||||
|
super.onScrolled(recyclerView, dx, dy)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun printObservations(observations: String) {
|
||||||
|
if (observations.trim().isNotEmpty()) {
|
||||||
|
customDialog.setTitle(getString(R.string.observations)).setDescription(observations)
|
||||||
|
.setOkButton(getString(R.string.accept)) {
|
||||||
|
customDialog.hide()
|
||||||
|
customDialog.dismiss()
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun findSale(txtscan: String) {
|
||||||
|
/*
|
||||||
|
for (tickets in collection.tickets) {
|
||||||
|
//0-Salegroup
|
||||||
|
for (sale in tickets.sales){
|
||||||
|
if (sale == "0") {
|
||||||
|
//1- Por itemFk
|
||||||
|
if (txtscan == saleVO.itemFk.toString()) {
|
||||||
|
if (mpok != null) mpok!!.start()
|
||||||
|
isOk = true
|
||||||
|
markLine(index, type)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
//2- Por barcode
|
||||||
|
if (saleVO.barcodes.isNotEmpty())
|
||||||
|
saleVO.barcodes.forEach { barcode ->
|
||||||
|
|
||||||
|
if (txtscan == barcode) {
|
||||||
|
if (mpok != null) mpok!!.start()
|
||||||
|
isOk = true
|
||||||
|
markLine(index, type)
|
||||||
|
isBreak = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBreak) break
|
||||||
|
}
|
||||||
|
index += 1
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun findSale(txtscan: String, position: Int, sale: Sale) {
|
||||||
|
|
||||||
|
storedPosition = position
|
||||||
|
|
||||||
|
if (sale.code!!.uppercase() == txtscan.uppercase()) {
|
||||||
|
mpok!!.start()
|
||||||
|
printShelvingResult(position)
|
||||||
|
} else {
|
||||||
|
mperror!!.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun markLine(position: Int, quantity: Int, isItemShelvingSaleEmpty: Boolean?) {
|
||||||
|
|
||||||
|
isScanned = null
|
||||||
|
positionConfirm = position
|
||||||
|
quantityConfirm = quantity
|
||||||
|
|
||||||
|
runBlocking {
|
||||||
|
val sectorFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
|
||||||
|
viewModel.itemShelvingSaleSetQuantity(
|
||||||
|
myGroupList[position].itemShelvingSaleFk,
|
||||||
|
quantity,
|
||||||
|
isItemShelvingSaleEmpty = isItemShelvingSaleEmpty,
|
||||||
|
sectorFk = if (sectorFk == -1) null else sectorFk,
|
||||||
|
shelvingFk = myGroupList[position].code!!
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// storedBackPosition = position
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setListPosition() {
|
||||||
|
|
||||||
|
//if (storedPosition == 0 && storedBackPosition == 0) { // se inicia lista, se busca porqué item vamos.
|
||||||
|
if (storedPosition == 0) {
|
||||||
|
for (indice in myGroupList.indices) {
|
||||||
|
if (myGroupList[indice].isPicked == 0) {
|
||||||
|
//storedPosition = indice
|
||||||
|
lm!!.scrollToPositionWithOffset(indice - 1, 0)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// lm!!.scrollToPositionWithOffset(storedBackPosition, 0)
|
||||||
|
lm!!.scrollToPositionWithOffset(storedPosition, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun unMarkLine(position: Int, sale: Sale) {
|
||||||
|
|
||||||
|
customDialog.setTitle(getString(R.string.unmarkLine)).setDescription(
|
||||||
|
getString(R.string.goUnmark) + sale.itemFk + getString(
|
||||||
|
R.string.sure
|
||||||
|
)
|
||||||
|
).setOkButton(getString(R.string.unmark)) {
|
||||||
|
if (!sale.isParent && sale.reservedQuantity == 0 && sale.originalQuantity != sale.saleQuantity) {
|
||||||
|
getString(R.string.unmarkError).toast(requireContext())
|
||||||
|
} else {
|
||||||
|
//storedBackPosition = position
|
||||||
|
//storedPosition = position
|
||||||
|
// setListPosition()
|
||||||
|
viewModel.itemShelvingSaleUnpicked(myGroupList[position].itemShelvingSaleFk)
|
||||||
|
sale.isPicked = 0
|
||||||
|
positionUnmarked = position
|
||||||
|
setTotalLines()
|
||||||
|
scanRequest()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
customDialog.dismiss()
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialog.dismiss()
|
||||||
|
}.show()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun printShelvingResult(pos: Int) {
|
||||||
|
|
||||||
|
storedPosition = pos
|
||||||
|
customDialogList.getEditTextTwo().inputType = InputType.TYPE_CLASS_TEXT
|
||||||
|
customDialogList.getEditTextTwo().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||||
|
customDialogList.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||||
|
customDialogList.getEditTextTwo().requestFocus()
|
||||||
|
val shelving = myGroupList[pos].code
|
||||||
|
val item = myGroupList[pos].itemFk
|
||||||
|
val longName = myGroupList[pos].longName
|
||||||
|
val totalReserved = myGroupList[pos].reservedQuantity
|
||||||
|
|
||||||
|
try {
|
||||||
|
customDialogList.setTitle("$shelving($item) $totalReserved de $longName").setOkButton(
|
||||||
|
getString(
|
||||||
|
R.string.take
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
customDialogTakeAction(pos, totalReserved, false)
|
||||||
|
|
||||||
|
}.setKoButton(getString(R.string.close)) {
|
||||||
|
requireActivity().hideKeyboard(customDialogList.getEditTextTwo())
|
||||||
|
customDialogList.dismiss()
|
||||||
|
scanRequest()
|
||||||
|
|
||||||
|
}.setHintValue(getString(R.string.quantitySelect)).setValue(totalReserved.toString())
|
||||||
|
.setHintValueTwo(getString(R.string.scanItem)).setValueTwo("").show()
|
||||||
|
|
||||||
|
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
|
||||||
|
customDialogTakeAction(
|
||||||
|
pos,
|
||||||
|
totalReserved,
|
||||||
|
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
|
)
|
||||||
|
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
ma.messageWithSound(e.message.toString(), isError = true, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun customDialogTakeAction(
|
||||||
|
position: Int, totalReserved: Int, isItemScanned: Boolean?
|
||||||
|
) {
|
||||||
|
isScanned = isItemScanned
|
||||||
|
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||||
|
|
||||||
|
customDialogList.setValueTwo(
|
||||||
|
itemScanValue(
|
||||||
|
customDialogList.getValueTwo(), arrayOf("buy"), "more"
|
||||||
|
).toString()
|
||||||
|
)
|
||||||
|
val quantityToReserve = customDialogList.getValue().toInt()
|
||||||
|
|
||||||
|
if (quantityToReserve < totalReserved) {
|
||||||
|
|
||||||
|
if (customDialogList.getValueTwo() in myGroupList[position].Barcodes || customDialogList.getValueTwo() == myGroupList[position].itemFk.toString()) {
|
||||||
|
customDialogList.dismiss()
|
||||||
|
showQuestionUbicationEmpty(position, quantityToReserve)
|
||||||
|
} else {
|
||||||
|
ma.messageWithSound(
|
||||||
|
message = getString(R.string.errorItem),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true,
|
||||||
|
isToasted = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quantityToReserve > totalReserved) {
|
||||||
|
ma.hideKeyboard(customDialogList.getEditTextTwo())
|
||||||
|
getString(R.string.quantityHigh).toast(requireContext())
|
||||||
|
}
|
||||||
|
if (quantityToReserve == totalReserved) {
|
||||||
|
try {
|
||||||
|
if (checkItemScan(customDialogList.getValueTwo(), position)) {
|
||||||
|
|
||||||
|
markLine(position, quantityToReserve, false)
|
||||||
|
|
||||||
|
mpok?.start()
|
||||||
|
ma.hideKeyboard(customDialogList.getEditTextTwo())
|
||||||
|
customDialogList.dismiss()
|
||||||
|
requireContext().showToastCenterWithBackground(myGroupList[position].ticketFk.toString())
|
||||||
|
scanRequest()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
quantityReserveToCheckItemScan = quantityToReserve
|
||||||
|
viewModel.getIdFromCodeSalix(
|
||||||
|
code = customDialogList.getValueTwo(),
|
||||||
|
)
|
||||||
|
customDialogList.dismiss()
|
||||||
|
}
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
getString(R.string.errorInput).toast(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
getString(R.string.scanItemValidate).toast(requireContext())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkItemScan(valueToCheck: String, position: Int): Boolean {
|
||||||
|
println("CheckItemScan $valueToCheck")
|
||||||
|
val saleToCheck = myGroupList[position]
|
||||||
|
println("CheckItemScan saleTocheck$saleToCheck")
|
||||||
|
println("CheckItemScan saleTocheck Item ${saleToCheck.itemFk}")
|
||||||
|
println("CheckItemScan saleTocheck ItemBarcodes ${saleToCheck.Barcodes}")
|
||||||
|
if (saleToCheck.itemFk.toString() == valueToCheck) return true
|
||||||
|
else {
|
||||||
|
saleToCheck.Barcodes.forEach { barcode ->
|
||||||
|
if (barcode == valueToCheck) return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showQuestionUbicationEmpty(position: Int, quantity: Int = 0) {
|
||||||
|
customDialogThreeButtonsQuantity.setTitle(
|
||||||
|
getString(
|
||||||
|
R.string.changeQuantity, quantity, myGroupList[position].itemFk
|
||||||
|
)
|
||||||
|
).setDescription(getString(R.string.questionItemShelving, myGroupList[position].itemFk))
|
||||||
|
.setValue("").setCustomDialogValue(View.GONE)
|
||||||
|
customDialogThreeButtonsQuantity.setOkButtonAdd(text = getString(R.string.yes)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
|
getString(R.string.errorQuantityShelving).toast(requireContext())
|
||||||
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
|
showQuestionUbicationEmpty(position, quantity)
|
||||||
|
}.setOkButtonTwo(getString(R.string.no)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
|
if (quantity == 0) {
|
||||||
|
viewModel.itemShelvingSaleExists(
|
||||||
|
myGroupList[position].itemShelvingSaleFk, position, quantity
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
markLine(position, quantity, true)
|
||||||
|
}
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
|
}.show()
|
||||||
|
customDialogThreeButtons.setFocusDialogValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun addItem() {
|
||||||
|
listPlacementSupply = ArrayList()
|
||||||
|
collection.tickets.forEach {
|
||||||
|
listPlacementSupply.add(BarcodeVO(code = it.ticketFk.toString()))
|
||||||
|
}
|
||||||
|
if (listPlacementSupply.size == 1) {
|
||||||
|
ticketSelected = listPlacementSupply[0].code!!.toInt()
|
||||||
|
}
|
||||||
|
customDialogList.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||||
|
customDialogList.getEditTextTwo().inputType = InputType.TYPE_CLASS_NUMBER
|
||||||
|
customDialogList.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||||
|
customDialogList.setTitle(getString(R.string.Agregarartículoparaticket) + " " + ticketSelected)
|
||||||
|
.setOkButton(getString(R.string.Agregar)) {
|
||||||
|
customDialogAddItem()
|
||||||
|
}.setKoButton(getString(R.string.close)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogList.dismiss()
|
||||||
|
}.setHintValue(getString(R.string.Artículo)).setValue("")
|
||||||
|
.setHintValueTwo(getString(R.string.Cantidad)).setValueTwo("").show()
|
||||||
|
customDialogList.getEditText().requestFocus()
|
||||||
|
requireActivity().hideKeyboard()
|
||||||
|
|
||||||
|
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
if (customDialogList.getValue().isNotEmpty()) {
|
||||||
|
try {
|
||||||
|
customDialogList.setValue(
|
||||||
|
itemScanValue(
|
||||||
|
customDialogList.getValue(), arrayOf("buy"), "more"
|
||||||
|
).toString()
|
||||||
|
)
|
||||||
|
|
||||||
|
} catch (e: Exception) {
|
||||||
|
ma.messageWithSound(e.message.toString(), isError = true, true)
|
||||||
|
}
|
||||||
|
customDialogList.getEditTextTwo().requestFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
|
||||||
|
}
|
||||||
|
false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
customDialogAddItem()
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
placementSupplyAdapter =
|
||||||
|
BarcodeAdapter(listPlacementSupply, object : OnBarcodeRowClickListener {
|
||||||
|
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||||
|
customDialogInput.setTitle(getString(R.string.ArtículoparaTicket) + " " + item.code!!)
|
||||||
|
ticketSelected = item.code!!.toInt()
|
||||||
|
customDialogList.setTitle(getString(R.string.Agregarartículoparaticket) + " " + ticketSelected)
|
||||||
|
}
|
||||||
|
}, showDelete = false)
|
||||||
|
|
||||||
|
customDialogList.getRecyclerView().adapter = placementSupplyAdapter
|
||||||
|
|
||||||
|
customDialogList.getRecyclerView().layoutManager =
|
||||||
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun customDialogAddItem() {
|
||||||
|
|
||||||
|
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||||
|
if (ticketSelected == 0) {
|
||||||
|
getString(R.string.Seleccionaunticketdelaista).toast(requireContext())
|
||||||
|
} else if (customDialogList.getValue().isEmpty() || customDialogList.getValueTwo()
|
||||||
|
.isEmpty()
|
||||||
|
) {
|
||||||
|
getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
|
||||||
|
} else {
|
||||||
|
val saleGroupSelected =
|
||||||
|
collection.tickets.find { it.ticketFk == ticketSelected }?.sales?.get(0)?.saleGroupFk
|
||||||
|
?: 0
|
||||||
|
|
||||||
|
runBlocking {
|
||||||
|
viewModel.collectionAddWithReservation(
|
||||||
|
customDialogList.getValue().toInt(),
|
||||||
|
customDialogList.getValueTwo().toInt(),
|
||||||
|
ticketSelected,
|
||||||
|
saleGroupFk = saleGroupSelected,
|
||||||
|
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
customDialogList.dismiss()
|
||||||
|
hideKeyboards()
|
||||||
|
scanRequest()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
getString(R.string.scanItem).toast(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun toastDisponibility(item: ItemVO) {
|
||||||
|
if (item.available.isEmpty()) {
|
||||||
|
item.available = "0"
|
||||||
|
}
|
||||||
|
customDialog.setTitle(getString(R.string.itemPoints) + item.id)
|
||||||
|
.setDescription(getString(R.string.available) + ":" + item.available)
|
||||||
|
.setOkButton(getString(R.string.accept)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialog.dismiss()
|
||||||
|
}.show()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setTotalLines() {
|
||||||
|
val totalMark = myGroupList.count { it.isPicked == 1 }
|
||||||
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
|
if (collection.collectionFk != 0) collection.collectionFk.toString() else ""
|
||||||
|
binding.mainToolbar.toolbarSubtitle.text =
|
||||||
|
getString(R.string.totalsPicker, totalMark, myGroupList.size)
|
||||||
|
if (totalMark == myGroupList.size) {
|
||||||
|
getString(R.string.completCollection).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
|
viewModel.saleTrackingAddPrevOK(collection.collectionFk)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showScanner(index: Int, sale: Sale) {
|
||||||
|
customDialogInput.getEditText().inputType = InputType.TYPE_CLASS_TEXT
|
||||||
|
customDialogInput.setTitle("" + sale.itemFk)
|
||||||
|
.setDescription(getString(R.string.scanWagonForItem))
|
||||||
|
.setOkButton(getString(R.string.accept)) {
|
||||||
|
findSaleAction(index, sale)
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||||
|
}.setValue("").show()
|
||||||
|
|
||||||
|
|
||||||
|
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
|
findSaleAction(index, sale)
|
||||||
|
return@setOnEditorActionListener false
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
customDialogInput.getEditText().requestFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun findSaleAction(index: Int, sale: Sale) {
|
||||||
|
if (customDialogInput.getValue().isNotEmpty()) {
|
||||||
|
findSale(customDialogInput.getValue(), index, sale)
|
||||||
|
}
|
||||||
|
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun closeCustomDialog(scanInput: EditText, customDialogInput: CustomDialogInput) {
|
||||||
|
requireContext().hideKeyboard(customDialogInput.getEditText())
|
||||||
|
scanInput.requestFocus()
|
||||||
|
customDialogInput.dismiss()
|
||||||
|
scanInput.requestFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showErrorMessage(title: String = getString(R.string.errorMarkLine), text: String) {
|
||||||
|
customDialog.setTitle(title).setDescription(text).setKoButton(getString(R.string.close)) {
|
||||||
|
customDialog.dismiss()
|
||||||
|
}.show()
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.collection.fragment
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
|
@ -38,6 +37,7 @@ import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.ItemScanned
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
import es.verdnatura.presentation.common.LabelDialogHelper
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
@ -46,6 +46,7 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||||
import es.verdnatura.presentation.common.OnTicketClickListener
|
import es.verdnatura.presentation.common.OnTicketClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnTicketColorListener
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
import es.verdnatura.presentation.common.hideKeyboard
|
import es.verdnatura.presentation.common.hideKeyboard
|
||||||
import es.verdnatura.presentation.common.itemScanIsQr
|
import es.verdnatura.presentation.common.itemScanIsQr
|
||||||
|
@ -126,11 +127,14 @@ class CollectionFragmentPicker(
|
||||||
private var recylerViewState: Parcelable? = null
|
private var recylerViewState: Parcelable? = null
|
||||||
private var isScanned: Boolean? = null
|
private var isScanned: Boolean? = null
|
||||||
private var myPosition: Int = 0
|
private var myPosition: Int = 0
|
||||||
|
private var changePosition = false
|
||||||
|
|
||||||
private lateinit var myGroupList: List<SaleVO>
|
private lateinit var myGroupList: List<SaleVO>
|
||||||
private var canChangeState = true
|
private var canChangeState = true
|
||||||
private var isVerifiedCollection = false
|
private var isVerifiedCollection = false
|
||||||
|
|
||||||
|
private var hasFilterByLevel = false
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(collection: CollectionVO, type: String) =
|
fun newInstance(collection: CollectionVO, type: String) =
|
||||||
CollectionFragmentPicker(collection, type)
|
CollectionFragmentPicker(collection, type)
|
||||||
|
@ -377,7 +381,7 @@ class CollectionFragmentPicker(
|
||||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||||
|
|
||||||
//sergio:para ver si ha marcado dos veces el mismo ticket
|
//sergio:para ver si ha marcado dos veces el mismo ticket
|
||||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
binding.scanInput.setText(textScannedFilterDouble(binding.scanInput.text!!.toString()))
|
||||||
|
|
||||||
//de momento solo está el qr de artículo
|
//de momento solo está el qr de artículo
|
||||||
isScanned =
|
isScanned =
|
||||||
|
@ -841,7 +845,7 @@ class CollectionFragmentPicker(
|
||||||
} else {
|
} else {
|
||||||
// pintar línea
|
// pintar línea
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
myPosition = storedPosition
|
myPosition = storedBackPosition
|
||||||
|
|
||||||
ReviewQuantityForRefreshingAndSorting(
|
ReviewQuantityForRefreshingAndSorting(
|
||||||
sales[storedPosition].quantity!!.toInt(),
|
sales[storedPosition].quantity!!.toInt(),
|
||||||
|
@ -926,7 +930,7 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
|
|
||||||
saleAdapter = SaleAdapter(
|
saleAdapter = SaleAdapter(
|
||||||
myGroupList,
|
myGroupList as MutableList,
|
||||||
pasillerosItemClickListener!!,
|
pasillerosItemClickListener!!,
|
||||||
object : OnQuantityClickListener {
|
object : OnQuantityClickListener {
|
||||||
|
|
||||||
|
@ -1001,17 +1005,25 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
type = type
|
type = type,
|
||||||
|
onTicketColorClickListener = object : OnTicketColorListener {
|
||||||
|
override fun onTicketColorListener(sale: SaleVO) {
|
||||||
|
hasFilterByLevel = !hasFilterByLevel
|
||||||
|
|
||||||
|
if (hasFilterByLevel) {
|
||||||
|
saleAdapter!!.updateSales(myGroupList.filter { it.level == sale.level } as MutableList)
|
||||||
|
myGroupList = myGroupList.filter { it.level == sale.level }
|
||||||
|
} else {
|
||||||
|
createCollectionList()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
|
||||||
|
|
||||||
binding.fragmentSacadorCollections.adapter = saleAdapter
|
binding.fragmentSacadorCollections.adapter = saleAdapter
|
||||||
|
|
||||||
binding.fragmentSacadorCollections.layoutManager = lm
|
binding.fragmentSacadorCollections.layoutManager = lm
|
||||||
setTotalLines()
|
setTotalLines()
|
||||||
//Tarea #4628
|
//Tarea #4628
|
||||||
|
@ -1111,6 +1123,7 @@ class CollectionFragmentPicker(
|
||||||
RecyclerView.OnScrollListener() {
|
RecyclerView.OnScrollListener() {
|
||||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||||
storedBackPosition = lm.findFirstVisibleItemPosition()
|
storedBackPosition = lm.findFirstVisibleItemPosition()
|
||||||
|
myPosition = lm.findFirstVisibleItemPosition()
|
||||||
super.onScrolled(recyclerView, dx, dy)
|
super.onScrolled(recyclerView, dx, dy)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1368,7 +1381,7 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
|
|
||||||
//nuevo
|
//nuevo
|
||||||
var mySale = sales[position].saleFk
|
val mySale = sales[position].saleFk
|
||||||
for (indice in myGroupList.indices) {
|
for (indice in myGroupList.indices) {
|
||||||
|
|
||||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||||
|
@ -1533,11 +1546,11 @@ class CollectionFragmentPicker(
|
||||||
|
|
||||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||||
storedBackPosition = indice
|
storedBackPosition = indice
|
||||||
|
myPosition = storedBackPosition
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storedBackPosition = position
|
storedBackPosition = position
|
||||||
myPosition = position
|
|
||||||
setListPosition(position, false)
|
setListPosition(position, false)
|
||||||
if (type != PRECHECKER) {
|
if (type != PRECHECKER) {
|
||||||
|
|
||||||
|
@ -2075,7 +2088,7 @@ class CollectionFragmentPicker(
|
||||||
"" + totalMark + "/" + total
|
"" + totalMark + "/" + total
|
||||||
|
|
||||||
if (totalMark == sales.size) {
|
if (totalMark == sales.size) {
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
getString(R.string.completCollection).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
if (!goBack) ticketCollection_setUsedShelves()
|
if (!goBack) ticketCollection_setUsedShelves()
|
||||||
|
@ -2341,20 +2354,19 @@ class CollectionFragmentPicker(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isTicket) {
|
if (isTicket) {
|
||||||
val builder = AlertDialog.Builder(context)
|
val labelDialogHelper = LabelDialogHelper(requireContext())
|
||||||
builder.setTitle(getString(R.string.selectLabeltoPrint))
|
labelDialogHelper.showLabelDialog(
|
||||||
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
onItemSelected = { labelCount ->
|
||||||
builder.setItems(labelCount) { dialog, which ->
|
viewModel.collectionStickerPrint(
|
||||||
viewModel.collectionStickerPrint(
|
collectionFk = collection.collectionFk,
|
||||||
collectionFk = collection.collectionFk, labelCount = (which + 1)
|
labelCount = labelCount
|
||||||
)
|
)
|
||||||
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
|
||||||
PRINTERNAME
|
|
||||||
)).toast(requireContext())
|
|
||||||
|
|
||||||
}
|
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
val dialog = builder.create()
|
PRINTERNAME
|
||||||
dialog.show()
|
)).toast(requireContext())
|
||||||
|
}
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
viewModel.collectionStickerPrint(
|
viewModel.collectionStickerPrint(
|
||||||
collectionFk = collection.collectionFk, null
|
collectionFk = collection.collectionFk, null
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.collection.fragment
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
|
@ -27,6 +26,7 @@ import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.ItemScanned
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
import es.verdnatura.presentation.common.LabelDialogHelper
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
@ -259,7 +259,7 @@ class CollectionFragmentPickerNew(
|
||||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
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 (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().isNotEmpty()) {
|
if (binding.scanInput.text.toString().isNotEmpty()) {
|
||||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
binding.scanInput.setText(textScannedFilterDouble(binding.scanInput.text!!.toString()))
|
||||||
isScanned =
|
isScanned =
|
||||||
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
||||||
|
@ -405,29 +405,6 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
responseConfirmReservedItemShelvingSale.observe(viewLifecycleOwner) {
|
|
||||||
|
|
||||||
myGroupList[positionConfirm].isPicked = 1
|
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
|
||||||
lm!!.scrollToPositionWithOffset(storedPosition, 0)
|
|
||||||
/* viewModel.collectionTicketGetSalix(
|
|
||||||
collection.collectionFk, print = false
|
|
||||||
)*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
responseItemShelvingSale.observe(viewLifecycleOwner) {
|
|
||||||
myGroupList[positionConfirm].isPicked = 1
|
|
||||||
myGroupList[positionConfirm].reservedQuantity = quantityConfirm
|
|
||||||
viewModel.collectionTicketGetSalix(
|
|
||||||
collection.collectionFk, print = false
|
|
||||||
)
|
|
||||||
lm!!.scrollToPositionWithOffset(positionConfirm, 0)
|
|
||||||
ma.messageWithSound(
|
|
||||||
getString(R.string.operationSuccess), it.isError, !it.isError, isToasted = false
|
|
||||||
)
|
|
||||||
}*/
|
|
||||||
loadUnpicked.observe(viewLifecycleOwner) { event ->
|
loadUnpicked.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
|
|
||||||
|
@ -439,6 +416,18 @@ class CollectionFragmentPickerNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
loadPicked.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
if (it) {
|
||||||
|
myGroupList[positionConfirm].isPicked = 1
|
||||||
|
saleAdapter!!.notifyItemChanged(positionConfirm)
|
||||||
|
lm!!.scrollToPositionWithOffset(positionConfirm, 0)
|
||||||
|
setTotalLines()
|
||||||
|
} else {
|
||||||
|
updateScreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
responseItemShelvingSaleGroup.observe(viewLifecycleOwner) {
|
responseItemShelvingSaleGroup.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
viewModel.collectionTicketGetSalix(
|
viewModel.collectionTicketGetSalix(
|
||||||
|
@ -658,7 +647,10 @@ class CollectionFragmentPickerNew(
|
||||||
isMarking = true
|
isMarking = true
|
||||||
|
|
||||||
viewModel.itemShelvingSaleSetQuantity(
|
viewModel.itemShelvingSaleSetQuantity(
|
||||||
myGroupList[position].itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty
|
myGroupList[position].itemShelvingSaleFk,
|
||||||
|
quantity,
|
||||||
|
isItemShelvingSaleEmpty,
|
||||||
|
shelvingFk = myGroupList[position].code!!
|
||||||
)
|
)
|
||||||
|
|
||||||
val mySale = sales[position].itemShelvingSaleFk
|
val mySale = sales[position].itemShelvingSaleFk
|
||||||
|
@ -869,22 +861,7 @@ class CollectionFragmentPickerNew(
|
||||||
}.setOkButtonTwo(getString(R.string.no)) {
|
}.setOkButtonTwo(getString(R.string.no)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtonsQuantity.dismiss()
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
viewModel.itemShelvingSaleExists(
|
markLine(position, quantity, true)
|
||||||
myGroupList[position].itemShelvingSaleFk,
|
|
||||||
myGroupList[position].itemShelvingFk,
|
|
||||||
position,
|
|
||||||
quantity
|
|
||||||
)
|
|
||||||
/* if (quantity == 0) {
|
|
||||||
viewModel.itemShelvingSaleExists(
|
|
||||||
myGroupList[position].itemShelvingSaleFk,
|
|
||||||
myGroupList[position].itemShelvingFk,
|
|
||||||
position,
|
|
||||||
quantity
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
markLine(position, quantity, true)
|
|
||||||
}*/
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtonsQuantity.dismiss()
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
|
@ -1045,7 +1022,7 @@ class CollectionFragmentPickerNew(
|
||||||
getString(R.string.totalsPicker, totalMark, total)
|
getString(R.string.totalsPicker, totalMark, total)
|
||||||
|
|
||||||
if (totalMark == sales.size) {
|
if (totalMark == sales.size) {
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
getString(R.string.completCollection).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
changeTicketState()
|
changeTicketState()
|
||||||
|
|
||||||
|
@ -1108,20 +1085,19 @@ class CollectionFragmentPickerNew(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isTicket) {
|
if (isTicket) {
|
||||||
val builder = AlertDialog.Builder(context)
|
val labelDialogHelper = LabelDialogHelper(requireContext())
|
||||||
builder.setTitle(getString(R.string.selectLabeltoPrint))
|
labelDialogHelper.showLabelDialog(
|
||||||
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
onItemSelected = { labelCount ->
|
||||||
builder.setItems(labelCount) { dialog, which ->
|
viewModel.collectionStickerPrint(
|
||||||
viewModel.collectionStickerPrint(
|
collectionFk = collection.collectionFk,
|
||||||
collectionFk = collection.collectionFk, labelCount = (which + 1)
|
labelCount = labelCount
|
||||||
)
|
)
|
||||||
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
|
||||||
PRINTERNAME
|
|
||||||
)).toast(requireContext())
|
|
||||||
|
|
||||||
}
|
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
val dialog = builder.create()
|
PRINTERNAME
|
||||||
dialog.show()
|
)).toast(requireContext())
|
||||||
|
}
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
viewModel.collectionStickerPrint(
|
viewModel.collectionStickerPrint(
|
||||||
collectionFk = collection.collectionFk, null
|
collectionFk = collection.collectionFk, null
|
||||||
|
|
|
@ -1,42 +1,39 @@
|
||||||
package es.verdnatura.presentation.view.feature.collection.fragment
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.graphics.drawable.GradientDrawable
|
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.view.Gravity
|
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentCollectionNewBinding
|
import es.verdnatura.databinding.FragmentCollectionNewBinding
|
||||||
import es.verdnatura.domain.ConstAndValues
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
||||||
import es.verdnatura.domain.ConstAndValues.PREITEMPICKERTEST
|
import es.verdnatura.domain.ConstAndValues.PREITEMPICKERTEST
|
||||||
import es.verdnatura.domain.ConstAndValues.PREPARED
|
import es.verdnatura.domain.ConstAndValues.PREPARED
|
||||||
import es.verdnatura.domain.ConstAndValues.PRESACADOR
|
import es.verdnatura.domain.ConstAndValues.PRESACADOR
|
||||||
|
import es.verdnatura.domain.ConstAndValues.PRINTERNAME
|
||||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORFK
|
import es.verdnatura.domain.ConstAndValues.SECTORFK
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
|
import es.verdnatura.domain.showToastCenterWithBackground
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.ItemScanned
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
import es.verdnatura.presentation.common.LabelDialogHelper
|
||||||
|
import es.verdnatura.presentation.common.OnAddItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
@ -73,6 +70,7 @@ import org.json.JSONObject
|
||||||
2- AL AÑADIR ITEM A A LA COLECCIÓN , EL SACADOR SALEGROUPFK Y SECTORFK SON NULOS.
|
2- AL AÑADIR ITEM A A LA COLECCIÓN , EL SACADOR SALEGROUPFK Y SECTORFK SON NULOS.
|
||||||
3-VERIFICAR COLECCIÓN
|
3-VERIFICAR COLECCIÓN
|
||||||
4-IMPRIMIR
|
4-IMPRIMIR
|
||||||
|
5-EL SACADOR PUEDE MARCAR PREVIA, EL PRESACADOR NO.
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
isVerifiedCollection
|
isVerifiedCollection
|
||||||
|
@ -135,6 +133,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
println("Sacando test")
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
|
@ -223,7 +222,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
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 (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().isNotEmpty()) {
|
if (binding.scanInput.text.toString().isNotEmpty()) {
|
||||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
binding.scanInput.setText(textScannedFilterDouble(binding.scanInput.text!!.toString()))
|
||||||
isScanned =
|
isScanned =
|
||||||
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
if (itemScanIsQr(binding.scanInput.text.toString())) {
|
||||||
|
@ -328,12 +327,16 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
|
|
||||||
loadPicked.observe(viewLifecycleOwner) { event ->
|
loadPicked.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
myGroupList[positionConfirm].isPicked = 1
|
if (it) {
|
||||||
saleAdapter!!.notifyItemChanged(positionConfirm)
|
myGroupList[positionConfirm].isPicked = 1
|
||||||
lm!!.scrollToPositionWithOffset(positionConfirm, 0)
|
saleAdapter!!.notifyItemChanged(positionConfirm)
|
||||||
//lm!!.scrollToPositionWithOffset(storedBackPosition + 1, 0)
|
lm!!.scrollToPositionWithOffset(positionConfirm, 0)
|
||||||
setTotalLines()
|
//lm!!.scrollToPositionWithOffset(storedBackPosition + 1, 0)
|
||||||
|
setTotalLines()
|
||||||
|
} else {
|
||||||
|
println("updating")
|
||||||
|
updateScreen()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,24 +351,25 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
responseCode.observe(viewLifecycleOwner) {
|
loadResponseCode.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
|
||||||
if (it == null) {
|
if (it == null) {
|
||||||
showErrorMessage(text = getString(R.string.codeNotExist))
|
showErrorMessage(text = getString(R.string.codeNotExist))
|
||||||
if (mperror != null) mperror?.start()
|
|
||||||
} else {
|
|
||||||
if (checkItemScan(it.toString(), positionConfirm)) {
|
|
||||||
scanRequest()
|
|
||||||
customDialogList.dismiss()
|
|
||||||
mpok?.start()
|
|
||||||
markLine(positionConfirm, quantityReserveToCheckItemScan, false)
|
|
||||||
} else {
|
|
||||||
customDialogList.setValueTwo("")
|
|
||||||
showErrorMessage(text = getString(R.string.lineNotExist))
|
|
||||||
if (mperror != null) mperror?.start()
|
if (mperror != null) mperror?.start()
|
||||||
|
} else {
|
||||||
|
if (checkItemScan(it.toString(), positionConfirm)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogList.dismiss()
|
||||||
|
mpok?.start()
|
||||||
|
markLine(positionConfirm, quantityReserveToCheckItemScan, false)
|
||||||
|
} else {
|
||||||
|
customDialogList.setValueTwo("")
|
||||||
|
showErrorMessage(text = getString(R.string.lineNotExist))
|
||||||
|
if (mperror != null) mperror?.start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -402,7 +406,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
when (type) {
|
when (type) {
|
||||||
PREITEMPICKERTEST -> {
|
PREITEMPICKERTEST -> {
|
||||||
myGroupList =
|
myGroupList =
|
||||||
salesList.sortedWith(compareBy<Sale> { it.pickingOrderPrevia }.thenBy { it.itemFk })
|
salesList.sortedWith(compareBy<Sale> { it.pickingOrder }.thenBy { it.itemFk })
|
||||||
}
|
}
|
||||||
|
|
||||||
SACADOR -> {
|
SACADOR -> {
|
||||||
|
@ -464,6 +468,12 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
showDeleteItemShelving(sale)
|
showDeleteItemShelving(sale)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}, onAddItemClickListener = object : OnAddItemClickListener {
|
||||||
|
|
||||||
|
override fun onAddItemClickListener(sale: Sale) {
|
||||||
|
customDialogAddItemFromSale(sale)
|
||||||
|
}
|
||||||
|
|
||||||
}, type = type
|
}, type = type
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -528,29 +538,65 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
var isFoundSale = false
|
var isFoundSale = false
|
||||||
//Se busca la matricula en las lineas
|
//Se busca la matricula en las lineas
|
||||||
for (indice in myGroupList.indices) {
|
for (indice in myGroupList.indices) {
|
||||||
|
//como cuando es presacador no hay parent no entrará
|
||||||
|
if (myGroupList[indice].isParent && myGroupList[indice].saleGroupFk == txtscan.toInt()) {
|
||||||
|
isFoundSale = true
|
||||||
|
storedPosition = indice
|
||||||
|
viewModel.itemShelvingSaleSetSaleGroup(txtscan.toInt())
|
||||||
|
break
|
||||||
|
}
|
||||||
if (myGroupList[indice].isPicked != 1 && myGroupList[indice].code != null && myGroupList[indice].code!!.uppercase() == txtscan.uppercase()) {
|
if (myGroupList[indice].isPicked != 1 && myGroupList[indice].code != null && myGroupList[indice].code!!.uppercase() == txtscan.uppercase()) {
|
||||||
mpok!!.start()
|
|
||||||
isFoundSale = true
|
isFoundSale = true
|
||||||
printShelvingResult(indice)
|
printShelvingResult(indice)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isFoundSale) mperror!!.start()
|
if (!isFoundSale) mperror!!.start() else mpok!!.start()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun markPrevia(saleGroupScanned: String): Boolean {
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (indice in sales.indices) {
|
||||||
|
if (sales[indice].saleGroupFk != null && sales[indice].saleGroupFk == saleGroupScanned.toInt()) {
|
||||||
|
viewModel.itemShelvingSaleSetSaleGroup(saleGroupScanned.toInt())
|
||||||
|
storedPosition = indice
|
||||||
|
mpok!!.start()
|
||||||
|
return true
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
private fun findSale(txtscan: String, position: Int, sale: Sale) {
|
private fun findSale(txtscan: String, position: Int, sale: Sale) {
|
||||||
|
|
||||||
storedPosition = position
|
storedPosition = position
|
||||||
|
|
||||||
if (sale.code!!.uppercase() == txtscan.uppercase()) {
|
val isOk = markPrevia(txtscan)
|
||||||
mpok!!.start()
|
|
||||||
printShelvingResult(position)
|
|
||||||
} else {
|
|
||||||
mperror!!.start()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (isOk) {
|
||||||
|
//Se ha escanado un ticket y se ha marcado la previa
|
||||||
|
ma.messageWithSound(
|
||||||
|
getString(R.string.previousCollected),
|
||||||
|
isPlayed = false,
|
||||||
|
isError = false,
|
||||||
|
isToasted = true
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (sale.code!!.uppercase() == txtscan.uppercase()) {
|
||||||
|
mpok!!.start()
|
||||||
|
printShelvingResult(position)
|
||||||
|
} else {
|
||||||
|
mperror!!.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun markLine(position: Int, quantity: Int, isItemShelvingSaleEmpty: Boolean?) {
|
private fun markLine(position: Int, quantity: Int, isItemShelvingSaleEmpty: Boolean?) {
|
||||||
|
@ -565,7 +611,8 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
myGroupList[position].itemShelvingSaleFk,
|
myGroupList[position].itemShelvingSaleFk,
|
||||||
quantity,
|
quantity,
|
||||||
isItemShelvingSaleEmpty = isItemShelvingSaleEmpty,
|
isItemShelvingSaleEmpty = isItemShelvingSaleEmpty,
|
||||||
sectorFk = if (sectorFk == -1) null else sectorFk
|
sectorFk = if (sectorFk == -1) null else sectorFk,
|
||||||
|
shelvingFk = myGroupList[position].code!!
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// storedBackPosition = position
|
// storedBackPosition = position
|
||||||
|
@ -708,8 +755,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
mpok?.start()
|
mpok?.start()
|
||||||
ma.hideKeyboard(customDialogList.getEditTextTwo())
|
ma.hideKeyboard(customDialogList.getEditTextTwo())
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
showTicket(myGroupList[position].ticketFk)
|
requireContext().showToastCenterWithBackground(myGroupList[position].ticketFk.toString())
|
||||||
|
|
||||||
scanRequest()
|
scanRequest()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -731,24 +777,6 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showTicket(ticketFk: Int) {
|
|
||||||
val inflater = LayoutInflater.from(requireContext())
|
|
||||||
val layout = inflater.inflate(R.layout.ticket_toast_layout, null)
|
|
||||||
val text = layout.findViewById<TextView>(R.id.toast_text)
|
|
||||||
text.text = "$ticketFk"
|
|
||||||
text.setTextColor(requireContext().getColor(R.color.verdnatura_orange_salix))
|
|
||||||
text.textSize = 18f
|
|
||||||
val background = GradientDrawable()
|
|
||||||
background.setColor(Color.parseColor("#000000"))
|
|
||||||
background.cornerRadius = 16f
|
|
||||||
layout.background = background
|
|
||||||
val toast = Toast(requireContext())
|
|
||||||
toast.duration = Toast.LENGTH_LONG
|
|
||||||
toast.view = layout
|
|
||||||
toast.setGravity(Gravity.CENTER, 0, 0)
|
|
||||||
toast.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun checkItemScan(valueToCheck: String, position: Int): Boolean {
|
private fun checkItemScan(valueToCheck: String, position: Int): Boolean {
|
||||||
println("CheckItemScan $valueToCheck")
|
println("CheckItemScan $valueToCheck")
|
||||||
val saleToCheck = myGroupList[position]
|
val saleToCheck = myGroupList[position]
|
||||||
|
@ -781,12 +809,13 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}.setOkButtonTwo(getString(R.string.no)) {
|
}.setOkButtonTwo(getString(R.string.no)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtonsQuantity.dismiss()
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
viewModel.itemShelvingSaleExists(
|
/* viewModel.itemShelvingSaleExists(
|
||||||
myGroupList[position].itemShelvingSaleFk,
|
myGroupList[position].itemShelvingSaleFk,
|
||||||
myGroupList[position].itemShelvingFk,
|
myGroupList[position].itemShelvingFk,
|
||||||
position,
|
position,
|
||||||
quantity
|
quantity
|
||||||
)
|
)*/
|
||||||
|
markLine(position, quantity, true)
|
||||||
/* if (quantity == 0) {
|
/* if (quantity == 0) {
|
||||||
|
|
||||||
/* viewModel.itemShelvingGet(
|
/* viewModel.itemShelvingGet(
|
||||||
|
@ -914,6 +943,44 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun customDialogAddItemFromSale(sale: Sale) {
|
||||||
|
|
||||||
|
customDialogThreeButtonsQuantity.setTitle(
|
||||||
|
"${getString(R.string.ticket)}${sale.ticketFk}"
|
||||||
|
).setDescription(
|
||||||
|
getString(
|
||||||
|
R.string.addItemQuantity, sale.itemFk
|
||||||
|
)
|
||||||
|
)
|
||||||
|
customDialogThreeButtonsQuantity.setOkButtonAdd(text = getString(R.string.add)) {
|
||||||
|
ticketSelected = sale.ticketFk
|
||||||
|
if (customDialogThreeButtonsQuantity.getValue().isNotEmpty()) {
|
||||||
|
viewModel.collectionAddWithReservation(
|
||||||
|
sale.itemFk,
|
||||||
|
customDialogThreeButtonsQuantity.getValue().toInt(),
|
||||||
|
ticketSelected = sale.ticketFk,
|
||||||
|
saleGroupFk = if (type == PREPARED) null else collection.tickets.find { it.ticketFk == ticketSelected }?.sales?.get(
|
||||||
|
0
|
||||||
|
)?.saleGroupFk
|
||||||
|
?: 0,
|
||||||
|
sectorFk = if (type == PREPARED) null else mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
|
SECTORFK
|
||||||
|
)
|
||||||
|
)
|
||||||
|
customDialogThreeButtonsQuantity.setValue("")
|
||||||
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
|
hideKeyboardFragment()
|
||||||
|
} else {
|
||||||
|
getString(R.string.indicateQuantity).toast(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtonsQuantity.dismiss()
|
||||||
|
}.show()
|
||||||
|
customDialogThreeButtonsQuantity.getEditText().requestFocus()
|
||||||
|
}
|
||||||
|
|
||||||
private fun hideKeyboardFragment() {
|
private fun hideKeyboardFragment() {
|
||||||
Handler(Looper.getMainLooper()).postDelayed({
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
val inputMethodManager =
|
val inputMethodManager =
|
||||||
|
@ -944,7 +1011,7 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
binding.mainToolbar.toolbarSubtitle.text =
|
binding.mainToolbar.toolbarSubtitle.text =
|
||||||
getString(R.string.totalsPicker, totalMark, myGroupList.size)
|
getString(R.string.totalsPicker, totalMark, myGroupList.size)
|
||||||
if (totalMark == myGroupList.size) {
|
if (totalMark == myGroupList.size) {
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
getString(R.string.completCollection).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
when (type) {
|
when (type) {
|
||||||
PREPARED -> {
|
PREPARED -> {
|
||||||
tickets.forEach {
|
tickets.forEach {
|
||||||
|
@ -1149,20 +1216,18 @@ class CollectionFragmentPickerPreviousNew(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isTicket) {
|
if (isTicket) {
|
||||||
val builder = AlertDialog.Builder(context)
|
val labelDialogHelper = LabelDialogHelper(requireContext())
|
||||||
builder.setTitle(getString(R.string.selectLabeltoPrint))
|
labelDialogHelper.showLabelDialog(
|
||||||
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
onItemSelected = { labelCount ->
|
||||||
builder.setItems(labelCount) { dialog, which ->
|
viewModel.collectionStickerPrint(
|
||||||
viewModel.collectionStickerPrint(
|
collectionFk = collection.collectionFk,
|
||||||
collectionFk = collection.collectionFk, labelCount = (which + 1)
|
labelCount = labelCount
|
||||||
)
|
)
|
||||||
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
ConstAndValues.PRINTERNAME
|
PRINTERNAME
|
||||||
)).toast(requireContext())
|
)).toast(requireContext())
|
||||||
|
}
|
||||||
}
|
)
|
||||||
val dialog = builder.create()
|
|
||||||
dialog.show()
|
|
||||||
} else {
|
} else {
|
||||||
viewModel.collectionStickerPrint(
|
viewModel.collectionStickerPrint(
|
||||||
collectionFk = collection.collectionFk, null
|
collectionFk = collection.collectionFk, null
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.collection.fragment
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
|
@ -38,6 +37,7 @@ import es.verdnatura.domain.toLong
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.ItemScanned
|
import es.verdnatura.presentation.common.ItemScanned
|
||||||
|
import es.verdnatura.presentation.common.LabelDialogHelper
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
@ -205,8 +205,8 @@ class CollectionFragmentPreChecker(
|
||||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
val iconPrint = ImageView(context)
|
val iconPrint = ImageView(context)
|
||||||
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
||||||
val iconAdd = ImageView(context)
|
// val iconAdd = ImageView(context)
|
||||||
iconAdd.setImageResource(R.drawable.ic_playlist_add_black_24dp)
|
// iconAdd.setImageResource(R.drawable.ic_playlist_add_black_24dp)
|
||||||
val iconViewCollection = ImageView(context)
|
val iconViewCollection = ImageView(context)
|
||||||
iconViewCollection.setImageResource(R.drawable.ic_collection)
|
iconViewCollection.setImageResource(R.drawable.ic_collection)
|
||||||
val iconWorker = ImageView(context)
|
val iconWorker = ImageView(context)
|
||||||
|
@ -220,7 +220,7 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
||||||
iconAdd.tooltipText = getTooltip(R.drawable.ic_playlist_add_black_24dp)
|
// iconAdd.tooltipText = getTooltip(R.drawable.ic_playlist_add_black_24dp)
|
||||||
iconViewCollection.tooltipText = getTooltip(R.drawable.ic_collection)
|
iconViewCollection.tooltipText = getTooltip(R.drawable.ic_collection)
|
||||||
iconPhone.tooltipText = getTooltip(R.drawable.phone_call)
|
iconPhone.tooltipText = getTooltip(R.drawable.phone_call)
|
||||||
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
|
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
|
||||||
|
@ -237,7 +237,7 @@ class CollectionFragmentPreChecker(
|
||||||
listIcons.add(iconWorker)
|
listIcons.add(iconWorker)
|
||||||
}
|
}
|
||||||
|
|
||||||
listIcons.add(iconAdd)
|
// listIcons.add(iconAdd)
|
||||||
|
|
||||||
if (type == SACADOR) {
|
if (type == SACADOR) {
|
||||||
listIcons.add(iconUpdate)
|
listIcons.add(iconUpdate)
|
||||||
|
@ -255,7 +255,7 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
when (item) {
|
when (item) {
|
||||||
iconPrint.drawable -> print()
|
iconPrint.drawable -> print()
|
||||||
iconAdd.drawable -> addItem()
|
// iconAdd.drawable -> addItem()
|
||||||
iconWorker.drawable -> showUser()
|
iconWorker.drawable -> showUser()
|
||||||
iconUpdate.drawable -> updateScreen()
|
iconUpdate.drawable -> updateScreen()
|
||||||
iconParking.drawable -> pasillerosItemClickListener?.onPasillerosItemClickListener(
|
iconParking.drawable -> pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||||
|
@ -362,7 +362,7 @@ class CollectionFragmentPreChecker(
|
||||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||||
|
|
||||||
//sergio:para ver si ha marcado dos veces el mismo ticket
|
//sergio:para ver si ha marcado dos veces el mismo ticket
|
||||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
binding.scanInput.setText(textScannedFilterDouble(binding.scanInput.text!!.toString()))
|
||||||
|
|
||||||
//de momento solo está el qr de artículo
|
//de momento solo está el qr de artículo
|
||||||
isScanned =
|
isScanned =
|
||||||
|
@ -399,10 +399,10 @@ class CollectionFragmentPreChecker(
|
||||||
it.sales.forEach { at ->
|
it.sales.forEach { at ->
|
||||||
if (at.saleGroupFk != saleGroup) {
|
if (at.saleGroupFk != saleGroup) {
|
||||||
viewModel.setParking(
|
viewModel.setParking(
|
||||||
ticketFk = at.saleGroupFk.toInt(),
|
ticketFk = at.saleGroupFk!!.toInt(),
|
||||||
parking = myQr.more
|
parking = myQr.more
|
||||||
)
|
)
|
||||||
saleGroup = at.saleGroupFk
|
saleGroup = at.saleGroupFk!!
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -964,15 +964,16 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
val isOnReservationMode = mobileApplication.dataStoreApp.readDataStoreKey<Boolean>(
|
val isOnReservationMode = mobileApplication.dataStoreApp.readDataStoreKey<Boolean>(
|
||||||
ConstAndValues.RESERVATIONMODE
|
ConstAndValues.RESERVATIONMODE
|
||||||
)
|
) || (mobileApplication.dataStoreApp.readDataStoreKey<Boolean?>(
|
||||||
//lolass
|
ConstAndValues.SECTORISONRESERVATIONMODE
|
||||||
if (isOnReservationMode) {
|
) == true)
|
||||||
|
|
||||||
sales = salesList.filter {
|
sales = if (isOnReservationMode) {
|
||||||
|
salesList.filter {
|
||||||
it.sectorFk == mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
|
it.sectorFk == mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
|
||||||
}.sortedWith(compareBy({ it.saleOrder }))
|
}.sortedWith(compareBy({ it.saleOrder }))
|
||||||
} else {
|
} else {
|
||||||
sales = salesList.filter {
|
salesList.filter {
|
||||||
it.sectorFk == mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
|
it.sectorFk == mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
|
||||||
}.sortedWith(compareBy({ it.picked }))
|
}.sortedWith(compareBy({ it.picked }))
|
||||||
}
|
}
|
||||||
|
@ -983,7 +984,7 @@ class CollectionFragmentPreChecker(
|
||||||
|
|
||||||
saleAdapter =
|
saleAdapter =
|
||||||
SaleAdapter(
|
SaleAdapter(
|
||||||
sales,
|
sales as MutableList,
|
||||||
pasillerosItemClickListener!!,
|
pasillerosItemClickListener!!,
|
||||||
object : OnQuantityClickListener {
|
object : OnQuantityClickListener {
|
||||||
|
|
||||||
|
@ -2014,7 +2015,7 @@ class CollectionFragmentPreChecker(
|
||||||
"" + totalMark + "/" + total
|
"" + totalMark + "/" + total
|
||||||
|
|
||||||
if (totalMark == sales.size) {
|
if (totalMark == sales.size) {
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
getString(R.string.completCollection).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
saleAdapter!!.notifyDataSetChanged()
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
|
||||||
if (!goBack)
|
if (!goBack)
|
||||||
|
@ -2266,21 +2267,19 @@ class CollectionFragmentPreChecker(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isTicket) {
|
if (isTicket) {
|
||||||
val builder = AlertDialog.Builder(context)
|
val labelDialogHelper = LabelDialogHelper(requireContext())
|
||||||
builder.setTitle(getString(R.string.selectLabeltoPrint))
|
labelDialogHelper.showLabelDialog(
|
||||||
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
onItemSelected = { labelCount ->
|
||||||
builder.setItems(labelCount) { dialog, which ->
|
viewModel.collectionStickerPrint(
|
||||||
viewModel.collectionStickerPrint(
|
collectionFk = collection.collectionFk,
|
||||||
collectionFk = collection.collectionFk,
|
labelCount = labelCount
|
||||||
labelCount = (which + 1)
|
)
|
||||||
)
|
|
||||||
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
|
||||||
PRINTERNAME
|
|
||||||
)).toast(requireContext())
|
|
||||||
|
|
||||||
}
|
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
val dialog = builder.create()
|
PRINTERNAME
|
||||||
dialog.show()
|
)).toast(requireContext())
|
||||||
|
}
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
viewModel.collectionStickerPrint(
|
viewModel.collectionStickerPrint(
|
||||||
collectionFk = collection.collectionFk,
|
collectionFk = collection.collectionFk,
|
||||||
|
|
|
@ -180,8 +180,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val loadAddNew: LiveData<Event<ResponseItemVO>> = _responseNew.map { Event(it) }
|
val loadAddNew: LiveData<Event<ResponseItemVO>> = _responseNew.map { Event(it) }
|
||||||
|
|
||||||
private val _responseCode by lazy { MutableLiveData<Int?>() }
|
private val _responseCode by lazy { MutableLiveData<Int?>() }
|
||||||
val responseCode: LiveData<Int?>
|
val responseCode: LiveData<Int?> = _responseCode
|
||||||
get() = _responseCode
|
val loadResponseCode: LiveData<Event<Int?>> = _responseCode.map { Event(it) }
|
||||||
|
|
||||||
private val _responseIncQuantity by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseIncQuantity by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseIncQuantity: LiveData<ResponseItemVO>
|
val responseIncQuantity: LiveData<ResponseItemVO>
|
||||||
|
@ -431,10 +431,18 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
itemShelvingSaleFk: Int,
|
itemShelvingSaleFk: Int,
|
||||||
quantity: Int,
|
quantity: Int,
|
||||||
isItemShelvingSaleEmpty: Boolean?,
|
isItemShelvingSaleEmpty: Boolean?,
|
||||||
sectorFk: Int? = null
|
sectorFk: Int? = null,
|
||||||
|
shelvingFk: String
|
||||||
) {
|
) {
|
||||||
salix.itemShelvingSaleSetquantitySalix(
|
salix.itemShelvingSaleSetquantitySalix(
|
||||||
params = arrayListOf(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty, sectorFk)
|
params = arrayListOf(
|
||||||
|
itemShelvingSaleFk,
|
||||||
|
quantity,
|
||||||
|
isItemShelvingSaleEmpty,
|
||||||
|
sectorFk,
|
||||||
|
shelvingFk
|
||||||
|
|
||||||
|
).formatWithQuotes()
|
||||||
).enqueue(object : SalixCallback<Any>(context) {
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
@ -444,6 +452,12 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
_responseCollectionAddItem.value = true
|
_responseCollectionAddItem.value = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseConfirmReservedItemShelvingSale.value = false
|
||||||
|
super.onError(t)
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,922 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.map
|
||||||
|
import com.google.gson.JsonObject
|
||||||
|
import es.verdnatura.MobileApplication
|
||||||
|
import es.verdnatura.domain.SalixCallback
|
||||||
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
|
||||||
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
|
import es.verdnatura.presentation.common.Event
|
||||||
|
import es.verdnatura.presentation.common.ResponseItemExistsItemShelvingSale
|
||||||
|
import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
|
import es.verdnatura.presentation.common.SaleTrackingReplaceSalix
|
||||||
|
import es.verdnatura.presentation.common.SaleTrackingSalix
|
||||||
|
import es.verdnatura.presentation.common.TicketState
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||||
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||||
|
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
|
||||||
|
import es.verdnatura.presentation.view.feature.workermistake.model.SaleTrackingDelSalix
|
||||||
|
import retrofit2.Response
|
||||||
|
|
||||||
|
class CollectionViewModelCheckerPreviosNew(val context: Context) : BaseViewModel(context) {
|
||||||
|
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
||||||
|
private val contextApp = context
|
||||||
|
|
||||||
|
private val _responseState by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseState: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseState
|
||||||
|
|
||||||
|
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
||||||
|
val collectionTicketList: LiveData<CollectionVO>
|
||||||
|
get() = _collectionTicketList
|
||||||
|
|
||||||
|
private val _responseExistsItemShelvingSale by lazy { MutableLiveData<ResponseItemExistsItemShelvingSale>() }
|
||||||
|
val responseExistsItemShelvingSale: LiveData<ResponseItemExistsItemShelvingSale>
|
||||||
|
get() = _responseExistsItemShelvingSale
|
||||||
|
|
||||||
|
val loadExistsResponse: LiveData<Event<ResponseItemExistsItemShelvingSale>> =
|
||||||
|
_responseExistsItemShelvingSale.map { Event(it) }
|
||||||
|
|
||||||
|
private val _collectionTicketSalix by lazy { MutableLiveData<CollectionTicket>() }
|
||||||
|
val collectionTicketSalix: LiveData<CollectionTicket>
|
||||||
|
get() = _collectionTicketSalix
|
||||||
|
|
||||||
|
private val _getSalesResponse by lazy { MutableLiveData<CollectionVO>() }
|
||||||
|
val getSalesResponse: LiveData<CollectionVO>
|
||||||
|
get() = _getSalesResponse
|
||||||
|
|
||||||
|
val loadCollectionTicketSalix: LiveData<Event<CollectionTicket>> =
|
||||||
|
_collectionTicketSalix.map { Event(it) }
|
||||||
|
|
||||||
|
private val _placementSuppleyList by lazy { MutableLiveData<PlacementSupplyListVO>() }
|
||||||
|
val placementSuppleyList: LiveData<PlacementSupplyListVO>
|
||||||
|
get() = _placementSuppleyList
|
||||||
|
|
||||||
|
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val response: LiveData<ResponseItemVO>
|
||||||
|
get() = _response
|
||||||
|
|
||||||
|
private val _responseSaleMistakeAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseSaleMistakeAdd: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseSaleMistakeAdd
|
||||||
|
val loadSaleMistakeAdd: LiveData<Event<ResponseItemVO>> =
|
||||||
|
_responseSaleMistakeAdd.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseItemShelvingSaleSupplyAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseItemShelvingSaleSupplyAdd: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseItemShelvingSaleSupplyAdd
|
||||||
|
|
||||||
|
private val _responseSaleReplace by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseSaleReplace: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseSaleReplace
|
||||||
|
|
||||||
|
private val _responseSaleTracking_mark by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseSaleTracking_mark: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseSaleTracking_mark
|
||||||
|
|
||||||
|
private val _responseConfirmReservedItemShelvingSale by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseConfirmReservedItemShelvingSale: LiveData<Boolean>
|
||||||
|
get() = _responseConfirmReservedItemShelvingSale
|
||||||
|
|
||||||
|
val loadPicked: LiveData<Event<Boolean>> =
|
||||||
|
_responseConfirmReservedItemShelvingSale.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseItemShelvingSale by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseItemShelvingSale: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseItemShelvingSale
|
||||||
|
|
||||||
|
private val _responseItemShelvingSaleUnPicked by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseItemShelvingSaleUnPicked: LiveData<Boolean>
|
||||||
|
get() = _responseItemShelvingSaleUnPicked
|
||||||
|
|
||||||
|
val loadUnpicked: LiveData<Event<Boolean>> = _responseItemShelvingSaleUnPicked.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseCollectionAddItem by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseCollectionAddItem: LiveData<Boolean>
|
||||||
|
get() = _responseCollectionAddItem
|
||||||
|
|
||||||
|
private val _responseParking by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseParking: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseParking
|
||||||
|
|
||||||
|
val loadParking: LiveData<Event<ResponseItemVO>> = _responseParking.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responsePrint by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responsePrint: LiveData<ResponseItemVO>
|
||||||
|
get() = _responsePrint
|
||||||
|
|
||||||
|
private val _responseDel by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseDel: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseDel
|
||||||
|
|
||||||
|
private val _responseItemShelvingUpdate by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseItemShelvingUpdate: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseItemShelvingUpdate
|
||||||
|
|
||||||
|
private val _responseTicketState by lazy { MutableLiveData<TicketState>() }
|
||||||
|
val responseTicketState: LiveData<TicketState> = _responseTicketState
|
||||||
|
|
||||||
|
val loadTicketState: LiveData<Event<TicketState>> = _responseTicketState.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseUsedShelves by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseUsedShelves: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseUsedShelves
|
||||||
|
|
||||||
|
private val _responseSaleGroup by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseSaleGroup: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseSaleGroup
|
||||||
|
|
||||||
|
val loadResponseSaleGroup: LiveData<Event<ResponseItemVO>> =
|
||||||
|
_responseSaleGroup.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseItemShelvingSaleGroup by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseItemShelvingSaleGroup: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseItemShelvingSaleGroup
|
||||||
|
|
||||||
|
private val _responseTicketClosure by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseTicketClosure: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseTicketClosure
|
||||||
|
val loadTicketClousure: LiveData<Event<ResponseItemVO>> =
|
||||||
|
_responseTicketClosure.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseCollectionUnchecked by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseCollectionUnchecked: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseCollectionUnchecked
|
||||||
|
|
||||||
|
private val _responseSplit by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseSplit: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseSplit
|
||||||
|
|
||||||
|
private val _responseNew by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseNew: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseNew
|
||||||
|
|
||||||
|
val loadAddNew: LiveData<Event<ResponseItemVO>> = _responseNew.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseCode by lazy { MutableLiveData<Int?>() }
|
||||||
|
val responseCode: LiveData<Int?>
|
||||||
|
get() = _responseCode
|
||||||
|
|
||||||
|
private val _responseIncQuantity by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseIncQuantity: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseIncQuantity
|
||||||
|
val loadIncQuantity: LiveData<Event<ResponseItemVO>> = _responseIncQuantity.map { Event(it) }
|
||||||
|
|
||||||
|
private val _mistakeList by lazy { MutableLiveData<MistakeTypeListVO>() }
|
||||||
|
val mistakeList: LiveData<MistakeTypeListVO>
|
||||||
|
get() = _mistakeList
|
||||||
|
|
||||||
|
private val _item by lazy { MutableLiveData<ItemVO>() }
|
||||||
|
val item: LiveData<ItemVO>
|
||||||
|
get() = _item
|
||||||
|
|
||||||
|
val loadResponseDel: LiveData<Event<ResponseItemVO>> = _responseDel.map { Event(it) }
|
||||||
|
|
||||||
|
val loadResponseAddItem: LiveData<Event<Boolean>> =
|
||||||
|
_responseCollectionAddItem.map { Event(it) }
|
||||||
|
|
||||||
|
val loadResponseSaleTrackingMark: LiveData<Event<ResponseItemVO>> =
|
||||||
|
_responseSaleTracking_mark.map { Event(it) }
|
||||||
|
|
||||||
|
val loadResponseItemShelvingUpdate: LiveData<Event<ResponseItemVO>> =
|
||||||
|
_responseItemShelvingUpdate.map { Event(it) }
|
||||||
|
|
||||||
|
private val _responseSaleAddPrevOK by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseSaleAddPrevOK: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseSaleAddPrevOK
|
||||||
|
|
||||||
|
fun getSales(
|
||||||
|
collectionFk: Number, print: String, source: String
|
||||||
|
|
||||||
|
) {
|
||||||
|
salix.getSalesFromTicketOrCollection(
|
||||||
|
collectionOrTicketFk = collectionFk, print = print != "0", source = source
|
||||||
|
).enqueue(object : SalixCallback<CollectionVO>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_collectionTicketList.value = CollectionVO(
|
||||||
|
0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<CollectionVO>) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
|
||||||
|
} catch (
|
||||||
|
ex: Exception
|
||||||
|
) {
|
||||||
|
ex.toast(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionTicketGet(
|
||||||
|
collectionFk: Int, sectorFk: Int, print: String, type: String
|
||||||
|
) {
|
||||||
|
|
||||||
|
getSales(collectionFk, print, type)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getCollectionTickets(
|
||||||
|
collectionFk: Number,
|
||||||
|
print: Boolean,
|
||||||
|
|
||||||
|
) {
|
||||||
|
salix.getCollectionTickets(
|
||||||
|
collectionFk, hashMapOf("print" to print)
|
||||||
|
).enqueue(object : SalixCallback<CollectionTicket>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_collectionTicketSalix.value = CollectionTicket(
|
||||||
|
0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<CollectionTicket>) {
|
||||||
|
|
||||||
|
if (response.body() != null) {
|
||||||
|
_collectionTicketSalix.value = response.body()?.let { it.map(contextApp) }
|
||||||
|
} else {
|
||||||
|
_collectionTicketSalix.value = CollectionTicket(
|
||||||
|
0, isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), response.message()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionGetId(
|
||||||
|
ticketFk: Int, sectorFk: Int, print: String, type: String
|
||||||
|
) {
|
||||||
|
salix.getCollectionId(
|
||||||
|
filter = """{"where":{"ticketFk":$ticketFk},"fields":"collectionFk"}"""
|
||||||
|
).enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_collectionTicketList.value = CollectionVO(
|
||||||
|
0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<List<JsonObject>>) {
|
||||||
|
|
||||||
|
if (response.body()!!.isNotEmpty()) {
|
||||||
|
collectionTicketGet(
|
||||||
|
response.body()!![0].entrySet().first().value.toString().toInt(),
|
||||||
|
sectorFk,
|
||||||
|
print,
|
||||||
|
type
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
_collectionTicketList.value = CollectionVO(
|
||||||
|
0, isError = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleExists(
|
||||||
|
itemShelvingSaleFk: Number, position: Int, quantity: Int
|
||||||
|
|
||||||
|
) {
|
||||||
|
salix.itemShelvingSaleExists(
|
||||||
|
itemShelvingSaleFk
|
||||||
|
).enqueue(object : SalixCallback<JsonObject>(context) {
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<JsonObject>) {
|
||||||
|
_responseExistsItemShelvingSale.value = ResponseItemExistsItemShelvingSale(
|
||||||
|
response.body()!!.entrySet().first().value.asBoolean, position, quantity
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingReplace(
|
||||||
|
saleFk: Int,
|
||||||
|
originalQuantity: Int,
|
||||||
|
code: String,
|
||||||
|
isChecked: String,
|
||||||
|
buyFk: Long,
|
||||||
|
isScanned: Boolean?
|
||||||
|
) {
|
||||||
|
salix.saleTrackingUpdate(
|
||||||
|
SaleTrackingReplaceSalix(
|
||||||
|
saleFk, originalQuantity, code, isChecked != "0", buyFk, isScanned!!
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseSaleReplace.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseSaleReplace.value = ResponseItemVO(isError = false, response = "")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTracking_mark(
|
||||||
|
saleFk: Int,
|
||||||
|
originalQuantity: Int,
|
||||||
|
code: String,
|
||||||
|
isChecked: String,
|
||||||
|
buyFk: Long,
|
||||||
|
itemShelvingFk: Int,
|
||||||
|
quantity: Int,
|
||||||
|
isScanned: Boolean?
|
||||||
|
) {
|
||||||
|
salix.saleTrackingMark(
|
||||||
|
SaleTrackingSalix(
|
||||||
|
saleFk = saleFk,
|
||||||
|
originalQuantity = originalQuantity,
|
||||||
|
code = code,
|
||||||
|
isChecked = isChecked != "0",
|
||||||
|
buyFk = buyFk,
|
||||||
|
itemShelvingFk = itemShelvingFk,
|
||||||
|
quantity = quantity,
|
||||||
|
isScanned = isScanned!!
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseSaleTracking_mark.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
if (!response.isSuccessful) {
|
||||||
|
_responseSaleTracking_mark.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), response.message()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
_responseSaleTracking_mark.value =
|
||||||
|
ResponseItemVO(isError = false, response = "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleSetQuantity(
|
||||||
|
itemShelvingSaleFk: Int,
|
||||||
|
quantity: Int,
|
||||||
|
isItemShelvingSaleEmpty: Boolean?,
|
||||||
|
sectorFk: Int? = null,
|
||||||
|
shelvingFk: String
|
||||||
|
) {
|
||||||
|
salix.itemShelvingSaleSetquantitySalix(
|
||||||
|
params = arrayListOf(
|
||||||
|
itemShelvingSaleFk,
|
||||||
|
quantity,
|
||||||
|
isItemShelvingSaleEmpty,
|
||||||
|
sectorFk,
|
||||||
|
shelvingFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseConfirmReservedItemShelvingSale.value = true
|
||||||
|
|
||||||
|
if (isItemShelvingSaleEmpty == true)
|
||||||
|
_responseCollectionAddItem.value = true
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionAddWithReservation(
|
||||||
|
item: Int, quantity: Int, ticketSelected: Int, saleGroupFk: Int?, sectorFk: Int?
|
||||||
|
) {
|
||||||
|
salix.collectionAddWithReservation(
|
||||||
|
params = arrayListOf(
|
||||||
|
item, quantity, ticketSelected, saleGroupFk, if (sectorFk == -1) null else sectorFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseCollectionAddItem.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemPlacementSupplyAiming(
|
||||||
|
shelvingFk: String, quantity: Int, itemFk: Int
|
||||||
|
) {
|
||||||
|
salix.itemPlacementSupplyAiming(
|
||||||
|
arrayListOf(
|
||||||
|
shelvingFk, quantity, itemFk
|
||||||
|
).formatWithQuotes()
|
||||||
|
).enqueue(object : SalixCallback<List<PlacementSupplyVO>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<PlacementSupplyVO>>) {
|
||||||
|
if (response.body() != null) {
|
||||||
|
_placementSuppleyList.value = response.body()?.let { PlacementSupplyListVO(it) }
|
||||||
|
} else {
|
||||||
|
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||||
|
listError.add(
|
||||||
|
PlacementSupplyVO(
|
||||||
|
itemShelvingFk = 0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), response.message()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||||
|
listError.add(
|
||||||
|
PlacementSupplyVO(
|
||||||
|
itemShelvingFk = 0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionStickerPrint(
|
||||||
|
collectionFk: Int, labelCount: Int?
|
||||||
|
) {
|
||||||
|
salix.collectionStickerPrint(
|
||||||
|
arrayListOf(
|
||||||
|
collectionFk, labelCount
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responsePrint.value =
|
||||||
|
ResponseItemVO(isError = false, response = response.message())
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responsePrint.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketCollection_setUsedShelves(
|
||||||
|
ticketFk: Int, usedShelves: Int
|
||||||
|
) {
|
||||||
|
salix.ticketCollectionUpdate(
|
||||||
|
"""where={"ticketFk":$ticketFk}""", hashMapOf("usedShelves" to usedShelves)
|
||||||
|
).enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
|
||||||
|
_responseUsedShelves.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
_responseUsedShelves.value = ResponseItemVO(isError = false)
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleUnpicked(
|
||||||
|
itemShelvingSaleFk: Int
|
||||||
|
) {
|
||||||
|
salix.itemShelvingSaleUnpicked(
|
||||||
|
arrayListOf(
|
||||||
|
itemShelvingSaleFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
_responseItemShelvingSaleUnPicked.value = true
|
||||||
|
super.onSuccess(response)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingAddPreparedSaleGroup(
|
||||||
|
saleGroupFk: Int
|
||||||
|
) {
|
||||||
|
salix.saleTrackingAddPreparedSaleGroup(
|
||||||
|
arrayListOf(
|
||||||
|
saleGroupFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseSaleGroup.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
//Tarea 7926
|
||||||
|
updateParkingFromSaleGroup(saleGroupFk)
|
||||||
|
_responseSaleGroup.value = ResponseItemVO(isError = false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateParkingFromSaleGroup(
|
||||||
|
saleGroupFk: Number
|
||||||
|
) {
|
||||||
|
salix.saleGroupUpdate(
|
||||||
|
id = saleGroupFk, params = hashMapOf("parkingFk" to null)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleSetSaleGroup(
|
||||||
|
saleGroupFk: Int
|
||||||
|
) {
|
||||||
|
salix.itemShelvingSaleSetSaleGroup(
|
||||||
|
arrayListOf(
|
||||||
|
saleGroupFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseItemShelvingSaleGroup.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
_responseItemShelvingSaleGroup.value = ResponseItemVO(isError = false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionAddItem(
|
||||||
|
itemFk: Int, quantity: Int, ticketFk: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
//Tarea 6889
|
||||||
|
salix.addSale(
|
||||||
|
id = ticketFk, barcode = itemFk.toString(), quantity = quantity
|
||||||
|
)/* salix.addSaleByCode(
|
||||||
|
CollectionItemSalix(
|
||||||
|
itemFk.toString(),
|
||||||
|
quantityFk,
|
||||||
|
ticketFk,
|
||||||
|
warehouseFk
|
||||||
|
)
|
||||||
|
)*/
|
||||||
|
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
|
||||||
|
_responseNew.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseNew.value =
|
||||||
|
ResponseItemVO(isError = false, response = response.message()!!)
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingDel(saleFk: Int) {
|
||||||
|
|
||||||
|
salix.saleTrackingDel(
|
||||||
|
SaleTrackingDelSalix(
|
||||||
|
saleFk = saleFk, stateCodes = listOf("CHECKED", "OK", "PREPARED")
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseDel.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseDel.value =
|
||||||
|
ResponseItemVO(isError = false, response = response.message())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingUpdateFromSale(
|
||||||
|
saleFk: Int
|
||||||
|
) {
|
||||||
|
salix.itemShelvingUpdateFromSale(hashMapOf("saleFk" to saleFk))
|
||||||
|
// silex.itemShelving_updateFromSale(saleFk)
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseItemShelvingUpdate.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
|
||||||
|
_responseItemShelvingUpdate.value =
|
||||||
|
ResponseItemVO(isError = false, response = response.message()!!)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setParking(
|
||||||
|
ticketFk: Int, parking: String
|
||||||
|
) {
|
||||||
|
salix.setParking(arrayListOf(ticketFk, parking).formatWithQuotes())
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseParking.value =
|
||||||
|
ResponseItemVO(isError = false, response = response.message())
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseParking.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketStateTodaySetState(
|
||||||
|
ticketFk: Int, state: String
|
||||||
|
) {
|
||||||
|
salix.ticketStateTodaySetState(arrayListOf(ticketFk, state).formatWithQuotes())
|
||||||
|
.enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
_response.value = ResponseItemVO(isError = false, response = "")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_response.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getIdFromCodeSalix(code: String) {
|
||||||
|
getItemFromBarcodeUseCase.execute(code).enqueue(object : SalixCallback<Int?>(context) {
|
||||||
|
override fun onSuccess(response: Response<Int?>) {
|
||||||
|
_responseCode.value = response.body()
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionIncreaseQuantitySalix(
|
||||||
|
saleFk: Int, quantity: String
|
||||||
|
) {
|
||||||
|
salix.collectionIncreaseQuantitySalix(
|
||||||
|
SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseIncQuantity.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
super.onSuccess(response)
|
||||||
|
|
||||||
|
_responseIncQuantity.value = ResponseItemVO(
|
||||||
|
isError = false, response = response.message().toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleMistakeAdd(
|
||||||
|
saleFk: Int, typeFk: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
salix.saleMistakeAdd(
|
||||||
|
SaleMistakeSalix(
|
||||||
|
userFk = (context as MobileApplication).userId!!, saleFk = saleFk, typeFk = typeFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseSaleMistakeAdd.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
super.onSuccess(response)
|
||||||
|
_responseSaleMistakeAdd.value =
|
||||||
|
ResponseItemVO(isError = false, response = response.message())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun mistakeType() {
|
||||||
|
salix.getMistakeTypes().enqueue(object : SalixCallback<List<MistakeTypeVO>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<MistakeTypeVO>>) {
|
||||||
|
if (response.body() != null) {
|
||||||
|
_mistakeList.value = response.body()?.let { MistakeTypeListVO(it) }
|
||||||
|
} else {
|
||||||
|
val listError: ArrayList<MistakeTypeVO> = ArrayList()
|
||||||
|
listError.add(MistakeTypeVO(0, ""))
|
||||||
|
_mistakeList.value = MistakeTypeListVO(listError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
val listError: ArrayList<MistakeTypeVO> = ArrayList()
|
||||||
|
listError.add(MistakeTypeVO(0, ""))
|
||||||
|
_mistakeList.value = MistakeTypeListVO(listError)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketIsOutClosureZone(
|
||||||
|
ticketFk: Int
|
||||||
|
) {
|
||||||
|
salix.ticketIsOutClosureZone(
|
||||||
|
arrayListOf(ticketFk)
|
||||||
|
).enqueue(object : SalixCallback<Any?>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any?>) {
|
||||||
|
_responseTicketClosure.value = ResponseItemVO(
|
||||||
|
isError = false,
|
||||||
|
response = response.body()?.toString() ?: "false",
|
||||||
|
errorMessage = ""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseTicketClosure.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketState(
|
||||||
|
ticketFk: Int
|
||||||
|
) {
|
||||||
|
salix.ticketState(
|
||||||
|
"""{"where": {"ticketFk": "$ticketFk"},"include":[{"relation":"user","scope":{"fields":["username"]}}]}"""
|
||||||
|
|
||||||
|
).enqueue(object : SalixCallback<List<TicketState>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<TicketState>>) {
|
||||||
|
_responseTicketState.value = if (response.body()!!.isEmpty()) {
|
||||||
|
TicketState()
|
||||||
|
} else {
|
||||||
|
response.body()!![0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun callBackSalix(function: String, params: ArrayList<Any>) {
|
||||||
|
salix.executeFunc(
|
||||||
|
routine = function, params = params
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseTicketClosure.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseTicketClosure.value = ResponseItemVO(
|
||||||
|
isError = false, response = response.body()!!.toString(), errorMessage = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun hasUncheckedTicket(
|
||||||
|
collectionFk: Int
|
||||||
|
) {
|
||||||
|
salix.hasUncheckedTicket(collectionFk)
|
||||||
|
//silex.collection_getUncheckedTicket(collectionFk)
|
||||||
|
.enqueue(object : SalixCallback<String>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseCollectionUnchecked.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<String>) {
|
||||||
|
if (response.body() != null) {
|
||||||
|
|
||||||
|
_responseCollectionUnchecked.value = ResponseItemVO(
|
||||||
|
isError = false, response = response.body()!!, errorMessage = ""
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
_responseCollectionUnchecked.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
response = response.body()!!.toString(),
|
||||||
|
errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), response.message()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collection_setState(
|
||||||
|
collectionFk: Int, state: String
|
||||||
|
) {
|
||||||
|
salix.collectionSetState(
|
||||||
|
params = arrayListOf(
|
||||||
|
collectionFk, state
|
||||||
|
).formatWithQuotes()
|
||||||
|
).enqueue(object : SalixCallback<Any?>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
|
||||||
|
_responseState.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
super.onError(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any?>) {
|
||||||
|
_responseState.value = ResponseItemVO(isError = false, response = "")
|
||||||
|
super.onSuccess(response)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingAddPrevOK(
|
||||||
|
sectorCollectionFk: Int
|
||||||
|
) {
|
||||||
|
salix.saleTrackingAddPrevOK(arrayListOf(sectorCollectionFk))
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseSaleAddPrevOK.value = ResponseItemVO(
|
||||||
|
isError = true, errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), t.message!!
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseSaleAddPrevOK.value = ResponseItemVO(
|
||||||
|
isError = false, errorMessage = "" + getMessageFromAllResponse(
|
||||||
|
nameofFunction(this), response.message()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.collection.fragment
|
package es.verdnatura.presentation.view.feature.collection.fragment
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
@ -8,7 +7,6 @@ import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentCollectionBinding
|
import es.verdnatura.databinding.FragmentCollectionBinding
|
||||||
|
@ -17,6 +15,7 @@ import es.verdnatura.domain.ConstAndValues.SECTORFK
|
||||||
import es.verdnatura.domain.ConstAndValues.VERTICKET
|
import es.verdnatura.domain.ConstAndValues.VERTICKET
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
import es.verdnatura.presentation.common.LabelDialogHelper
|
||||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
import es.verdnatura.presentation.common.OnPackingClickListener
|
import es.verdnatura.presentation.common.OnPackingClickListener
|
||||||
|
@ -138,16 +137,20 @@ class CollectionShowTicketFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isTicket) {
|
if (isTicket) {
|
||||||
val builder = AlertDialog.Builder(context)
|
val labelDialogHelper = LabelDialogHelper(requireContext())
|
||||||
builder.setTitle(getString(R.string.selectLabeltoPrint))
|
labelDialogHelper.showLabelDialog(
|
||||||
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
onItemSelected = { labelCount ->
|
||||||
builder.setItems(labelCount) { dialog, which ->
|
viewModel.collectionStickerPrint(
|
||||||
viewModel.collectionStickerPrint(
|
collectionFk = collection.collectionFk,
|
||||||
collectionFk = collection.collectionFk, labelCount = (which + 1)
|
labelCount = labelCount
|
||||||
)
|
)
|
||||||
}
|
|
||||||
val dialog = builder.create()
|
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
dialog.show()
|
PRINTERNAME
|
||||||
|
)).toast(requireContext())
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
viewModel.collectionStickerPrint(
|
viewModel.collectionStickerPrint(
|
||||||
|
|
||||||
|
@ -166,22 +169,18 @@ class CollectionShowTicketFragment(
|
||||||
|
|
||||||
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
|
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()) {
|
if (binding.scanInput.text.toString().isNotEmpty()) {
|
||||||
buttonPushedGetCollection = false
|
buttonPushedGetCollection = false
|
||||||
try {
|
try {
|
||||||
viewModel.getSales(
|
viewModel.getSales(
|
||||||
collectionFk = itemScanValue(
|
collectionFk = itemScanValue(
|
||||||
binding.scanInput.text.toString(), arrayOf("ticket","saleGroup"), "id"
|
binding.scanInput.text.toString(),
|
||||||
|
arrayOf("ticket", "saleGroup"),
|
||||||
|
"id"
|
||||||
).toString().toInt(),
|
).toString().toInt(),
|
||||||
print = "0",
|
print = "0",
|
||||||
source = type
|
source = type
|
||||||
)
|
)
|
||||||
|
|
||||||
println("qrTest2")
|
|
||||||
|
|
||||||
/* viewModel.getSales(
|
|
||||||
binding.scanInput.text.toString().toInt(), print = "0", type
|
|
||||||
)*/
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
getString(R.string.scanLabelTicket).toast(requireContext())
|
getString(R.string.scanLabelTicket).toast(requireContext())
|
||||||
}
|
}
|
||||||
|
@ -213,13 +212,14 @@ class CollectionShowTicketFragment(
|
||||||
try {
|
try {
|
||||||
requireActivity().hideKeyboard()
|
requireActivity().hideKeyboard()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
e.message!!.toast(requireContext())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
|
|
||||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
collectionTicketList.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
if (!it.isError) {
|
if (!it.isError) {
|
||||||
if (it.tickets.isNotEmpty()) {
|
if (it.tickets.isNotEmpty()) {
|
||||||
|
@ -232,18 +232,18 @@ class CollectionShowTicketFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
ma.messageWithSound(it.errorMessage, isError = true, false)
|
||||||
if (activity != null) ma.onMyBackPressed()
|
if (activity != null) ma.onMyBackPressed()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
}
|
||||||
|
|
||||||
responsePrint.observe(viewLifecycleOwner, Observer {
|
responsePrint.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
it.errorMessage, it.isError, true
|
it.errorMessage, isError = true, true
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
|
||||||
|
@ -251,7 +251,7 @@ class CollectionShowTicketFragment(
|
||||||
)).toast(requireContext())
|
)).toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,27 +277,30 @@ class CollectionShowTicketFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
sales = salesList.sortedWith(compareBy { it.saleOrder })
|
||||||
/*salesList.sortedWith(compareBy<SaleVO> { it.isPrepared == "0" }
|
|
||||||
.thenBy { it.isControlled == "0" }*/
|
|
||||||
|
|
||||||
saleAdapter =
|
saleAdapter =
|
||||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
SaleAdapter(
|
||||||
|
sales as MutableList,
|
||||||
|
pasillerosItemClickListener!!,
|
||||||
|
object : OnQuantityClickListener {
|
||||||
|
|
||||||
override fun onQuantityClick(sale: SaleVO) {
|
override fun onQuantityClick(sale: SaleVO) {
|
||||||
}
|
}
|
||||||
}, object : OnSaleClickListener {
|
},
|
||||||
override fun onSaleClick(sale: SaleVO) {
|
object : OnSaleClickListener {
|
||||||
}
|
override fun onSaleClick(sale: SaleVO) {
|
||||||
|
}
|
||||||
|
|
||||||
}, object : OnMistakeClickListener {
|
},
|
||||||
override fun onMistakeClickListener(sale: SaleVO) {
|
object : OnMistakeClickListener {
|
||||||
}
|
override fun onMistakeClickListener(sale: SaleVO) {
|
||||||
}, object : OnPackingClickListener {
|
}
|
||||||
override fun onPackingClick(sale: SaleVO) {
|
},
|
||||||
}
|
object : OnPackingClickListener {
|
||||||
|
override fun onPackingClick(sale: SaleVO) {
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
binding.fragmentSacadorCollections.adapter = saleAdapter
|
binding.fragmentSacadorCollections.adapter = saleAdapter
|
||||||
|
@ -310,8 +313,13 @@ class CollectionShowTicketFragment(
|
||||||
|
|
||||||
private fun setPosition() {
|
private fun setPosition() {
|
||||||
val firstIndex =
|
val firstIndex =
|
||||||
sales.indexOfFirst { it.isPreviousPrepared == "0" && (it.isPrepared == "0" || it.isControlled == "0") }
|
sales.indexOfFirst { it.isPreviousPrepared == "0" && it.isPrepared == "0" && it.isControlled == "0" }
|
||||||
lm!!.scrollToPositionWithOffset(firstIndex, 0)
|
val resultIndex = if (firstIndex != -1) {
|
||||||
|
firstIndex
|
||||||
|
} else {
|
||||||
|
sales.indexOfFirst { it.isPreviousPrepared == "0" && it.isPrepared == "0" }
|
||||||
|
}
|
||||||
|
lm!!.scrollToPositionWithOffset(resultIndex, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun printObservations(observations: String) {
|
private fun printObservations(observations: String) {
|
||||||
|
@ -331,9 +339,10 @@ class CollectionShowTicketFragment(
|
||||||
if (it.isControlled == "1") totalMark += 1
|
if (it.isControlled == "1") totalMark += 1
|
||||||
}
|
}
|
||||||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
||||||
binding.mainToolbar.toolbarSubtitle.text = "" + totalMark + "/" + sales.size
|
binding.mainToolbar.toolbarSubtitle.text =
|
||||||
|
getString(R.string.totalsPicker, totalMark, sales.size)
|
||||||
if (totalMark == sales.size) {
|
if (totalMark == sales.size) {
|
||||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
getString(R.string.completCollection).toast(this.context, Toast.LENGTH_SHORT)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ fun CollectionVO.map(context: Context): CollectionVO {
|
||||||
this.tickets.forEach { ticket ->
|
this.tickets.forEach { ticket ->
|
||||||
// if (ticket.sales.size>0){
|
// if (ticket.sales.size>0){
|
||||||
ticket.sales.forEach {
|
ticket.sales.forEach {
|
||||||
|
it.parkingCode = ticket.parkingCode
|
||||||
|
it.isAdvanced = ticket.isAdvanced
|
||||||
it.ticketFk = ticket.ticketFk
|
it.ticketFk = ticket.ticketFk
|
||||||
it.level = ticket.level
|
it.level = ticket.level
|
||||||
it.rgb = ticket.rgb
|
it.rgb = ticket.rgb
|
||||||
|
|
|
@ -55,7 +55,7 @@ class ControladorFragment :
|
||||||
goBack = false
|
goBack = false
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
|
|
||||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
binding.scanInput.setText(textScannedFilterDouble(binding.scanInput.text!!.toString()))
|
||||||
try {
|
try {
|
||||||
binding.scanInput.setText(
|
binding.scanInput.setText(
|
||||||
itemScanValue(
|
itemScanValue(
|
||||||
|
|
|
@ -52,7 +52,7 @@ class ControlVehiculoUsuarioFragment(
|
||||||
|
|
||||||
if (userFk == vUserFK) {
|
if (userFk == vUserFK) {
|
||||||
val androidId: String = mobileApplication.dataStoreApp.readDataStoreKey(ANDROID_ID)
|
val androidId: String = mobileApplication.dataStoreApp.readDataStoreKey(ANDROID_ID)
|
||||||
viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
// viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
||||||
viewModel.deviceProductionGetnameDevice(
|
viewModel.deviceProductionGetnameDevice(
|
||||||
androidId
|
androidId
|
||||||
)
|
)
|
||||||
|
@ -64,7 +64,8 @@ class ControlVehiculoUsuarioFragment(
|
||||||
binding.userInformation.visibility = INVISIBLE
|
binding.userInformation.visibility = INVISIBLE
|
||||||
binding.nameVehiclecontrol.visibility = INVISIBLE
|
binding.nameVehiclecontrol.visibility = INVISIBLE
|
||||||
binding.userImage.setOnClickListener { binding.mainToolbar.backButton.performClick() }
|
binding.userImage.setOnClickListener { binding.mainToolbar.backButton.performClick() }
|
||||||
viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
// viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
||||||
|
binding.nameVehiclecontrol.visibility = VISIBLE
|
||||||
viewModel.getNameWorker(userFk)
|
viewModel.getNameWorker(userFk)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,35 +108,15 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun machineGetWorkerPlate(userId: Int) {
|
|
||||||
salix.machineGetWorkerPlate(
|
|
||||||
arrayListOf(userId)
|
|
||||||
).enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
|
||||||
override fun onSuccess(response: Response<List<JsonObject>>) {
|
|
||||||
_responseMachine.value =
|
|
||||||
ResponseItemMachineControl(
|
|
||||||
response = if (response.body()!!.isEmpty()) {
|
|
||||||
""
|
|
||||||
} else {
|
|
||||||
response.body()!![0].entrySet().first().value.toString()
|
|
||||||
.replace("\"", "")
|
|
||||||
},
|
|
||||||
type = "getWorkerPlate"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getNameWorker(
|
fun getNameWorker(
|
||||||
workerId: Int
|
workerId: Int
|
||||||
) {
|
) {
|
||||||
salix.getNameWorker(
|
salix.getNameWorker(
|
||||||
"""{"fields": ["firstName","lastName"],"where": {"id":$workerId}}"""
|
"""{"limit":1, "where":{"id":$workerId},"skip":0,"fields":["firstName","lastName"]}"""
|
||||||
).enqueue(object : SalixCallback<NameWorker>(context) {
|
).enqueue(object : SalixCallback<List<NameWorker>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<NameWorker>) {
|
override fun onSuccess(response: Response<List<NameWorker>>) {
|
||||||
_responseGetName.value = response.body()
|
_responseGetName.value = response.body()?.get(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package es.verdnatura.presentation.view.feature.delivery.adapters
|
package es.verdnatura.presentation.view.feature.delivery.adapters
|
||||||
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat.getColor
|
import androidx.core.content.ContextCompat.getColor
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
@ -57,8 +58,14 @@ class ExpeditionLoadUnloadAdapter(
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.scanOrderTxt.visibility =
|
||||||
|
if (item.scanOrder == null) View.GONE else View.VISIBLE
|
||||||
|
binding.scanOrderLabel.visibility =
|
||||||
|
if (item.scanOrder == null) View.GONE else View.VISIBLE
|
||||||
|
|
||||||
|
|
||||||
this.item = item
|
this.item = item
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.delivery.adapters
|
||||||
|
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.databinding.ItemSalaryComplementRowBinding
|
||||||
|
import es.verdnatura.presentation.common.OnSalarySupplementClickListener
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplement
|
||||||
|
|
||||||
|
class SalarySupplementAdapter(
|
||||||
|
private var items: List<RouteComplement>,
|
||||||
|
private val onSalarySupplementClickListener: OnSalarySupplementClickListener
|
||||||
|
) : RecyclerView.Adapter<SalarySupplementAdapter.ItemHolder>() {
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||||
|
return ItemHolder(
|
||||||
|
ItemSalaryComplementRowBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context),
|
||||||
|
parent,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() = items.size
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||||
|
holder.bind(items[position])
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateData(list: List<RouteComplement>) {
|
||||||
|
items = list
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class ItemHolder(
|
||||||
|
val binding: ItemSalaryComplementRowBinding
|
||||||
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
|
private val res = binding.root.context.resources
|
||||||
|
fun bind(item: RouteComplement) {
|
||||||
|
binding.apply {
|
||||||
|
this.item = item
|
||||||
|
}
|
||||||
|
binding.imageDelete.setOnClickListener {
|
||||||
|
onSalarySupplementClickListener.onSalarySupplementClickListener(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -24,12 +24,14 @@ import es.verdnatura.presentation.common.OnBackPressedListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||||
import es.verdnatura.presentation.view.feature.delivery.activity.SignedActivity
|
import es.verdnatura.presentation.view.feature.delivery.activity.SignedActivity
|
||||||
import es.verdnatura.presentation.view.feature.delivery.adapters.ExpeditionLoadUnloadAdapter
|
import es.verdnatura.presentation.view.feature.delivery.adapters.ExpeditionLoadUnloadAdapter
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoPending
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoPending
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalix
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalixPosition
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteLoaded
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteLoaded
|
||||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
@ -51,12 +53,11 @@ class LoadUnloadFragment(
|
||||||
private var adapter: ExpeditionLoadUnloadAdapter? = null
|
private var adapter: ExpeditionLoadUnloadAdapter? = null
|
||||||
private var originalItem: Int = 0
|
private var originalItem: Int = 0
|
||||||
private lateinit var myList: MutableList<ExpeditionInfoLoadUnload>
|
private lateinit var myList: MutableList<ExpeditionInfoLoadUnload>
|
||||||
private var counterCalls = 0
|
|
||||||
private var counterResponse = 0
|
|
||||||
private var route = 0
|
private var route = 0
|
||||||
private var addressFk = 0
|
private var addressFk = 0
|
||||||
private lateinit var db: DeliveryDatabase
|
private lateinit var db: DeliveryDatabase
|
||||||
private lateinit var backDispatcher: OnBackPressedDispatcher
|
private lateinit var backDispatcher: OnBackPressedDispatcher
|
||||||
|
private lateinit var customDialogConfirmExpedition: CustomDialogThreeButtons
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
var scanned = false
|
var scanned = false
|
||||||
|
@ -75,8 +76,7 @@ class LoadUnloadFragment(
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
requireActivity().onBackPressedDispatcher.addCallback(
|
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner,
|
||||||
viewLifecycleOwner,
|
|
||||||
object : OnBackPressedCallback(true) {
|
object : OnBackPressedCallback(true) {
|
||||||
override fun handleOnBackPressed() {
|
override fun handleOnBackPressed() {
|
||||||
if (!onBackPressedHandled()) {
|
if (!onBackPressedHandled()) {
|
||||||
|
@ -101,6 +101,7 @@ class LoadUnloadFragment(
|
||||||
setSwitchButon()
|
setSwitchButon()
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
viewModel.getExpeditionFromRoute(route)
|
viewModel.getExpeditionFromRoute(route)
|
||||||
|
customDialogConfirmExpedition = CustomDialogThreeButtons(requireContext())
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,25 +179,43 @@ class LoadUnloadFragment(
|
||||||
|
|
||||||
private fun setExpeditionsState(list: MutableList<ExpeditionInfoLoadUnload>, state: String) {
|
private fun setExpeditionsState(list: MutableList<ExpeditionInfoLoadUnload>, state: String) {
|
||||||
scanning(false)
|
scanning(false)
|
||||||
val mlist = mutableListOf<ExpeditionSalix>()
|
/* val mlist = mutableListOf<ExpeditionSalix>()
|
||||||
|
for (l in list) {
|
||||||
|
mlist.add(
|
||||||
|
ExpeditionSalix(
|
||||||
|
expeditionFk = l.id,
|
||||||
|
stateCode = if (l.code != state && l.code != "FOUND" && l.code != "DELIVERED") {
|
||||||
|
if (state == "ON DELIVERY") "NOT SCANNED" else "LOST"
|
||||||
|
} else {
|
||||||
|
l.code
|
||||||
|
},
|
||||||
|
isScanned = l.isScanned
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}*/
|
||||||
|
val mlistPosition = mutableListOf<ExpeditionSalixPosition>()
|
||||||
for (l in list) {
|
for (l in list) {
|
||||||
mlist.add(
|
mlistPosition.add(
|
||||||
ExpeditionSalix(
|
ExpeditionSalixPosition(
|
||||||
expeditionFk = l.id,
|
expeditionFk = l.id,
|
||||||
stateCode = if (l.code != state && l.code != "FOUND" && l.code != "DELIVERED") {
|
stateCode = if (l.code == "FOUND") (l.code) else {
|
||||||
"LOST"
|
if (state == "ON DELIVERY" && l.code != "ON DELIVERY" && l.code != "DELIVERED" && l.code != "LOST") {
|
||||||
} else {
|
"NOT SCANNED"
|
||||||
l.code
|
} else {
|
||||||
|
if (state == "DELIVERED" && l.code != "DELIVERED") "LOST" else l.code
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isScanned = l.isScanned
|
isScanned = l.isScanned,
|
||||||
|
scanOrder = l.scanOrder
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val expeditionBack = hashMapOf("expeditions" to mlist as List<ExpeditionSalix>)
|
val expeditionBackPosition =
|
||||||
|
hashMapOf("expeditions" to mlistPosition as List<ExpeditionSalixPosition>)
|
||||||
|
//val expeditionBack = hashMapOf("expeditions" to mlist as List<ExpeditionSalix>)
|
||||||
if (list.any { it.code == state }) {
|
if (list.any { it.code == state }) {
|
||||||
if (list.filter { it.code == state }.size == list.size) {
|
if (list.filter { it.code == state }.size == list.size) {
|
||||||
viewModel.expeditionStateAddSalix(expeditionBack)
|
viewModel.expeditionStateAddSalix(expeditionBackPosition)
|
||||||
counterCalls = 1
|
|
||||||
} else {
|
} else {
|
||||||
val alertDialog = android.app.AlertDialog.Builder(requireContext()).create()
|
val alertDialog = android.app.AlertDialog.Builder(requireContext()).create()
|
||||||
alertDialog.setTitle(getString(R.string.info))
|
alertDialog.setTitle(getString(R.string.info))
|
||||||
|
@ -204,8 +223,7 @@ class LoadUnloadFragment(
|
||||||
alertDialog.setButton(
|
alertDialog.setButton(
|
||||||
android.app.AlertDialog.BUTTON_NEUTRAL, getString(R.string.save)
|
android.app.AlertDialog.BUTTON_NEUTRAL, getString(R.string.save)
|
||||||
) { _, _ ->
|
) { _, _ ->
|
||||||
counterCalls = 1
|
viewModel.expeditionStateAddSalix(expeditionBackPosition)
|
||||||
viewModel.expeditionStateAddSalix(expeditionBack)
|
|
||||||
}
|
}
|
||||||
alertDialog.setButton(
|
alertDialog.setButton(
|
||||||
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.ordenar)
|
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.ordenar)
|
||||||
|
@ -261,6 +279,8 @@ class LoadUnloadFragment(
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
val isScanned =
|
val isScanned =
|
||||||
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
|
//Tarea 8152
|
||||||
|
// showconfirmExpedition(binding.scanInput.text.toString().toInt(), isScanned)
|
||||||
try {
|
try {
|
||||||
markExpedition(
|
markExpedition(
|
||||||
binding.scanInput.text.toString().toInt(),
|
binding.scanInput.text.toString().toInt(),
|
||||||
|
@ -295,6 +315,70 @@ class LoadUnloadFragment(
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showconfirmExpedition(expeditionFk: Int, isScanned: Boolean) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
customDialogConfirmExpedition.setHintDialogValue("Indica expedición")
|
||||||
|
customDialogConfirmExpedition.setDescription("No está escanenado la caja. Escríbala de nuevo:")
|
||||||
|
.setValue("").setOkButtonAdd(getString(R.string.confirm)) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (expeditionFk == customDialogConfirmExpedition.getValue().toInt()) {
|
||||||
|
takeActionConfirmed(isScanned)
|
||||||
|
binding.scanInput.requestFocus()
|
||||||
|
customDialogConfirmExpedition.dismiss()
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ma.messageWithSound(
|
||||||
|
message = getString(R.string.errorInputQuantity),
|
||||||
|
isPlayed = true,
|
||||||
|
isError = true,
|
||||||
|
isToasted = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
binding.scanInput.requestFocus()
|
||||||
|
binding.scanInput.setText("")
|
||||||
|
customDialogConfirmExpedition.dismiss()
|
||||||
|
|
||||||
|
}.show()
|
||||||
|
customDialogConfirmExpedition.setFocusDialogValue()
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ex.message!!.toast(requireContext())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun takeActionConfirmed(isScanned: Boolean) {
|
||||||
|
try {
|
||||||
|
markExpedition(
|
||||||
|
binding.scanInput.text.toString().toInt(),
|
||||||
|
if (!binding.mainToolbar.switchButton.isChecked) {
|
||||||
|
state
|
||||||
|
} else {
|
||||||
|
"FOUND"
|
||||||
|
},
|
||||||
|
isScanned = if (isScanned) 1 else 0
|
||||||
|
)
|
||||||
|
if (state != "DELIVERED") {
|
||||||
|
|
||||||
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
|
if (!binding.mainToolbar.switchButton.isChecked) {
|
||||||
|
getString(R.string.loading)
|
||||||
|
} else {
|
||||||
|
getString(R.string.unloading)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
getString(R.string.errorExpedition).toast(context, Toast.LENGTH_SHORT)
|
||||||
|
}
|
||||||
|
binding.scanInput.setText("")
|
||||||
|
}
|
||||||
|
|
||||||
private fun markExpedition(expedNumber: Int, state: String, isScanned: Int) {
|
private fun markExpedition(expedNumber: Int, state: String, isScanned: Int) {
|
||||||
|
|
||||||
var found = false
|
var found = false
|
||||||
|
@ -307,15 +391,14 @@ class LoadUnloadFragment(
|
||||||
found = true
|
found = true
|
||||||
exped.code = state
|
exped.code = state
|
||||||
exped.isScanned = isScanned
|
exped.isScanned = isScanned
|
||||||
|
if (state == "ON DELIVERY") exped.scanOrder =
|
||||||
|
myList.filter { it.code == state }.size
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found) {
|
if (found) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
message = "",
|
message = "", isError = false, isPlayed = true, isToasted = false
|
||||||
isError = false,
|
|
||||||
isPlayed = true,
|
|
||||||
isToasted = false
|
|
||||||
)
|
)
|
||||||
scanning(true)
|
scanning(true)
|
||||||
} else {
|
} else {
|
||||||
|
@ -324,7 +407,6 @@ class LoadUnloadFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (binding.mainToolbar.switchButton.isChecked) {
|
if (binding.mainToolbar.switchButton.isChecked) {
|
||||||
counterCalls = 1
|
|
||||||
val pendingExpeditionSend = myList.map { l ->
|
val pendingExpeditionSend = myList.map { l ->
|
||||||
ExpeditionSalix(
|
ExpeditionSalix(
|
||||||
expeditionFk = l.id, stateCode = l.code, isScanned = l.isScanned
|
expeditionFk = l.id, stateCode = l.code, isScanned = l.isScanned
|
||||||
|
@ -353,20 +435,17 @@ class LoadUnloadFragment(
|
||||||
}
|
}
|
||||||
responseStateAdd.observe(viewLifecycleOwner) {
|
responseStateAdd.observe(viewLifecycleOwner) {
|
||||||
if (it) {
|
if (it) {
|
||||||
counterResponse += 1
|
|
||||||
if (counterResponse == counterCalls) {
|
if (!binding.mainToolbar.switchButton.isChecked) {
|
||||||
if (!binding.mainToolbar.switchButton.isChecked) {
|
if (state == "DELIVERED") {
|
||||||
if (state == "DELIVERED") {
|
openSignActivity()
|
||||||
openSignActivity()
|
|
||||||
} else {
|
|
||||||
ma.onMyBackPressed()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
binding.mainToolbar.switchButton.isChecked = false
|
ma.onMyBackPressed()
|
||||||
}
|
}
|
||||||
counterResponse = 0
|
} else {
|
||||||
counterCalls = 0
|
binding.mainToolbar.switchButton.isChecked = false
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
openSignActivity()
|
openSignActivity()
|
||||||
}
|
}
|
||||||
|
@ -456,6 +535,7 @@ class LoadUnloadFragment(
|
||||||
it.routeFk == route
|
it.routeFk == route
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = ExpeditionLoadUnloadAdapter(myList)
|
adapter = ExpeditionLoadUnloadAdapter(myList)
|
||||||
binding.expeditionloadunloadRecyclerview.adapter = adapter
|
binding.expeditionloadunloadRecyclerview.adapter = adapter
|
||||||
binding.expeditionloadunloadRecyclerview.layoutManager =
|
binding.expeditionloadunloadRecyclerview.layoutManager =
|
||||||
|
|
|
@ -175,7 +175,7 @@ class LogExpeditionFragment(
|
||||||
binding.routeLayout.visibility = View.VISIBLE
|
binding.routeLayout.visibility = View.VISIBLE
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
binding.route.text = routeDelivery.ticket.routeFk.toString()
|
binding.route.text = routeDelivery.ticket.routeFk.toString()
|
||||||
binding.agency.text = routeDelivery.ticket.route.agencyMode.agency.name ?: ""
|
binding.agency.text = routeDelivery.ticket.route?.agencyMode?.agency?.name ?: ""
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,11 @@ import android.os.Bundle
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentRouteBinding
|
import es.verdnatura.databinding.FragmentRouteBinding
|
||||||
|
@ -17,14 +19,21 @@ import es.verdnatura.domain.toDateString
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.base.database
|
import es.verdnatura.presentation.base.database
|
||||||
|
import es.verdnatura.presentation.common.GeneralAdapter
|
||||||
|
import es.verdnatura.presentation.common.GeneralItem
|
||||||
import es.verdnatura.presentation.common.ItemDescorationCustomized
|
import es.verdnatura.presentation.common.ItemDescorationCustomized
|
||||||
|
import es.verdnatura.presentation.common.OnGeneralItemRowClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnGeneralRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnItemImageRouteRowClickListener
|
import es.verdnatura.presentation.common.OnItemImageRouteRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.common.hideKeyboard
|
||||||
|
import es.verdnatura.presentation.common.itemScanValue
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||||
import es.verdnatura.presentation.view.feature.delivery.adapters.RouteAdapter
|
import es.verdnatura.presentation.view.feature.delivery.adapters.RouteAdapter
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalixPosition
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteLoaded
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteLoaded
|
||||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||||
|
@ -45,6 +54,34 @@ class RoutesFragment(
|
||||||
private lateinit var myListRoute: MutableList<RouteInfo>
|
private lateinit var myListRoute: MutableList<RouteInfo>
|
||||||
private lateinit var db: DeliveryDatabase
|
private lateinit var db: DeliveryDatabase
|
||||||
private lateinit var myListRouteLoaded: List<RouteLoaded>
|
private lateinit var myListRouteLoaded: List<RouteLoaded>
|
||||||
|
private val customDialogList: CustomDialogList by lazy {
|
||||||
|
CustomDialogList(requireContext())
|
||||||
|
}
|
||||||
|
private var listExpeditionScan: ArrayList<GeneralItem> = ArrayList()
|
||||||
|
private var listMyRoutes: ArrayList<GeneralItem> = ArrayList()
|
||||||
|
|
||||||
|
private val expeditionScanAdapter: GeneralAdapter? by lazy {
|
||||||
|
GeneralAdapter(listExpeditionScan, object : OnGeneralItemRowClickListener {
|
||||||
|
override fun onGeneralItemRowClickListener(item: GeneralItem) {
|
||||||
|
|
||||||
|
listExpeditionScan.remove(item)
|
||||||
|
expeditionScanAdapter?.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
}, onRowClickListener = object : OnGeneralRowClickListener {
|
||||||
|
override fun onRowClickListener(item: GeneralItem) {
|
||||||
|
getDataForMoveExpeditions(item.code!!)
|
||||||
|
}
|
||||||
|
}, showDelete = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val recyclerViewConfigured: RecyclerView by lazy {
|
||||||
|
customDialogList.getRecyclerView().apply {
|
||||||
|
layoutManager =
|
||||||
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
adapter = expeditionScanAdapter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(title: String) = RoutesFragment(title)
|
fun newInstance(title: String) = RoutesFragment(title)
|
||||||
|
@ -78,30 +115,15 @@ class RoutesFragment(
|
||||||
}
|
}
|
||||||
val pendingExpedition = db.expedicionDao().getAllPendingExpeditions()
|
val pendingExpedition = db.expedicionDao().getAllPendingExpeditions()
|
||||||
|
|
||||||
val pendingExpeditionSend = pendingExpedition.map { l ->
|
if (pendingExpedition.isNotEmpty()) {
|
||||||
ExpeditionSalix(
|
val pendingExpeditionSend = pendingExpedition.map { l ->
|
||||||
expeditionFk = l.id, stateCode = l.code, l.isScanned
|
ExpeditionSalixPosition(
|
||||||
)
|
expeditionFk = l.id, stateCode = l.code, l.isScanned, l.scanOrder
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (pendingExpeditionSend.any { it.stateCode == "DELIVERED" }) {
|
|
||||||
viewModel.expeditionStateAddSalix(
|
viewModel.expeditionStateAddSalix(
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "DELIVERED" })
|
hashMapOf("expeditions" to pendingExpeditionSend)
|
||||||
)
|
|
||||||
}
|
|
||||||
if (pendingExpeditionSend.any { it.stateCode == "ON DELIVERY" }) {
|
|
||||||
viewModel.expeditionStateAddSalix(
|
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "ON DELIVERY" })
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (pendingExpeditionSend.any { it.stateCode == "LOST" }) {
|
|
||||||
viewModel.expeditionStateAddSalix(
|
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "LOST" })
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (pendingExpeditionSend.any { it.stateCode == "FOUND" }) {
|
|
||||||
viewModel.expeditionStateAddSalix(
|
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "FOUND" })
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,10 +145,10 @@ class RoutesFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun deleteExpeditionsPending(codeState: String) {
|
private fun deleteExpeditionsPending() {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
db.expedicionDao().getDeleteByState(codeState)
|
db.expedicionDao().getDeleteAllState()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -152,6 +174,13 @@ class RoutesFragment(
|
||||||
iconInfo.tooltipText = getTooltip(R.drawable.ic_info_delivery)
|
iconInfo.tooltipText = getTooltip(R.drawable.ic_info_delivery)
|
||||||
iconRefresh.tooltipText = getTooltip(R.drawable.ic_info_refresh)
|
iconRefresh.tooltipText = getTooltip(R.drawable.ic_info_refresh)
|
||||||
iconSearch.tooltipText = getTooltip(R.drawable.expedition_find)
|
iconSearch.tooltipText = getTooltip(R.drawable.expedition_find)
|
||||||
|
|
||||||
|
val iconMove = ImageView(context)
|
||||||
|
iconMove.setImageResource(R.drawable.ic_move_expedition)
|
||||||
|
iconMove.tooltipText = getString(R.string.moveExpedition)
|
||||||
|
|
||||||
|
//Tarea 8150
|
||||||
|
listIcons.add(iconMove)
|
||||||
listIcons.add(iconInfo)
|
listIcons.add(iconInfo)
|
||||||
listIcons.add(iconRefresh)
|
listIcons.add(iconRefresh)
|
||||||
listIcons.add(iconSearch)
|
listIcons.add(iconSearch)
|
||||||
|
@ -179,6 +208,10 @@ class RoutesFragment(
|
||||||
getString(R.string.titleLog)
|
getString(R.string.titleLog)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iconMove.drawable -> {
|
||||||
|
showExpeditionScan()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -188,6 +221,81 @@ class RoutesFragment(
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showExpeditionScan() {
|
||||||
|
listExpeditionScan.clear()
|
||||||
|
listMyRoutes.clear()
|
||||||
|
expeditionScanAdapter!!.updateItems(listExpeditionScan)
|
||||||
|
expeditionScanAdapter!!.setShowDelete(true)
|
||||||
|
customDialogList.setTitle(getString(R.string.scanExpeditionForMove))
|
||||||
|
.setOkButton(getString(R.string.moveToRoute)) {
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
customDialogList.dismiss()
|
||||||
|
showRoutes()
|
||||||
|
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
customDialogList.dismiss()
|
||||||
|
requireContext().hideKeyboard(binding.scanInput)
|
||||||
|
}.setValue("").showDialog().show()
|
||||||
|
|
||||||
|
customDialogList.getEditText().requestFocus()
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
if (customDialogList.getValue().isNotEmpty()) {
|
||||||
|
val expeditionScan = itemScanValue(
|
||||||
|
customDialogList.getValue(), arrayOf("expeditionPallet"), "id"
|
||||||
|
).toString()
|
||||||
|
listExpeditionScan.add(
|
||||||
|
GeneralItem(
|
||||||
|
expeditionScan, expeditionScan
|
||||||
|
)
|
||||||
|
)
|
||||||
|
expeditionScanAdapter?.notifyItemChanged(0)
|
||||||
|
}
|
||||||
|
customDialogList.setValue("")
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
recyclerViewConfigured
|
||||||
|
requireContext().hideKeyboard(customDialogList.getEditText())
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showRoutes() {
|
||||||
|
listMyRoutes.clear()
|
||||||
|
expeditionScanAdapter!!.updateItems(
|
||||||
|
ArrayList(myListRoute.map { routeInfo ->
|
||||||
|
GeneralItem(
|
||||||
|
code = routeInfo.id.toString(), text = routeInfo.id.toString()
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
expeditionScanAdapter!!.setShowDelete(false)
|
||||||
|
customDialogList.setTitle(getString(R.string.selectRoute))
|
||||||
|
.setKoButton(getString(R.string.cancel)) {
|
||||||
|
customDialogList.dismiss()
|
||||||
|
requireContext().hideKeyboard(binding.scanInput)
|
||||||
|
}.setValue("").hideDialog().show()
|
||||||
|
requireContext().hideKeyboard(customDialogList.getEditText())
|
||||||
|
recyclerViewConfigured
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getDataForMoveExpeditions(routeId: String) {
|
||||||
|
val routeItem = myListRoute.find { it.id == routeId.toLong() }
|
||||||
|
for (expedition in listExpeditionScan) {
|
||||||
|
viewModel.getDataFromExpedition(
|
||||||
|
routeId = routeId.toLong(),
|
||||||
|
expeditionId = expedition.code!!.toLong(),
|
||||||
|
landed = routeItem!!.created.toString()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
customDialogList.dismiss()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
ma.onMyBackPressed()
|
ma.onMyBackPressed()
|
||||||
|
@ -204,7 +312,6 @@ class RoutesFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun afterTextChanged(s: Editable?) {
|
override fun afterTextChanged(s: Editable?) {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -262,7 +369,7 @@ class RoutesFragment(
|
||||||
|
|
||||||
if (it) {
|
if (it) {
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
deleteExpeditionsPending("")
|
deleteExpeditionsPending()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,8 +409,7 @@ class RoutesFragment(
|
||||||
|
|
||||||
"showTickets" -> {
|
"showTickets" -> {
|
||||||
ma.onPasillerosItemClickListener(
|
ma.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(title = R.string.tickets),
|
PasillerosItemVO(title = R.string.tickets), Gson().toJson(item)
|
||||||
Gson().toJson(item)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,175 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.delivery.fragments
|
||||||
|
|
||||||
|
import android.app.DatePickerDialog
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.ImageView
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.databinding.FragmentSalaryComplementBinding
|
||||||
|
import es.verdnatura.domain.toDateString
|
||||||
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.OnSalarySupplementClickListener
|
||||||
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.view.commom.NameWithId
|
||||||
|
import es.verdnatura.presentation.view.commom.SearchableAdapter
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.adapters.SalarySupplementAdapter
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteActionList
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplement
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplementAdd
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
import java.util.Calendar
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
|
class SalaryComplementFragment(
|
||||||
|
var entryPoint: String = ""
|
||||||
|
|
||||||
|
) : BaseFragment<FragmentSalaryComplementBinding, DeliveryViewModel>(
|
||||||
|
DeliveryViewModel::class
|
||||||
|
) {
|
||||||
|
|
||||||
|
private val adapterComplement: SalarySupplementAdapter by lazy {
|
||||||
|
SalarySupplementAdapter(emptyList(), object : OnSalarySupplementClickListener {
|
||||||
|
override fun onSalarySupplementClickListener(item: RouteComplement) {
|
||||||
|
viewModel.routeComplementDelete(
|
||||||
|
item.id,
|
||||||
|
binding.date.text.toString(),
|
||||||
|
mobileApplication.userId!!
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private val layoutManager: LinearLayoutManager by lazy {
|
||||||
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
private lateinit var routeActionComplementsList: RouteActionList
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance(entryPoint: String) = SalaryComplementFragment(entryPoint)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getLayoutId(): Int = R.layout.fragment_salary_complement
|
||||||
|
|
||||||
|
private fun showDatePicker() {
|
||||||
|
val currentDate = Calendar.getInstance()
|
||||||
|
val year = currentDate[Calendar.YEAR]
|
||||||
|
val month = currentDate[Calendar.MONTH]
|
||||||
|
val day = currentDate[Calendar.DAY_OF_MONTH]
|
||||||
|
|
||||||
|
DatePickerDialog(
|
||||||
|
requireContext(), { _, selectedYear, selectedMonth, selectedDay ->
|
||||||
|
binding.date.text =
|
||||||
|
getString(R.string.dateDay, selectedDay, selectedMonth + 1, selectedYear)
|
||||||
|
viewModel.getRouteComplements(
|
||||||
|
binding.date.text.toString(),
|
||||||
|
mobileApplication.userId!!
|
||||||
|
)
|
||||||
|
}, year, month, day
|
||||||
|
).apply {
|
||||||
|
setTitle(getString(R.string.selectDate))
|
||||||
|
show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
viewModel.getRouteAction()
|
||||||
|
binding.date.text = toDateString(Date())
|
||||||
|
viewModel.getRouteComplements(binding.date.text.toString(), mobileApplication.userId!!)
|
||||||
|
ma.hideBottomNavigation(View.GONE)
|
||||||
|
setToolBar()
|
||||||
|
setEvents()
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setToolBar() {
|
||||||
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.supplementDelivery)
|
||||||
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
|
val iconAdd = ImageView(context).apply {
|
||||||
|
setImageResource(R.drawable.ic_add_black_24dp)
|
||||||
|
tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
|
ToolBarAdapterTooltip(listOf(iconAdd), object : OnOptionsSelectedListener {
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
|
when (item) {
|
||||||
|
iconAdd.drawable -> {
|
||||||
|
binding.salarySearchableRecyclerView.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||||
|
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setEvents() {
|
||||||
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
|
ma.onMyBackPressed()
|
||||||
|
}
|
||||||
|
binding.date.setOnClickListener {
|
||||||
|
showDatePicker()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setSearchable(listElements: MutableList<NameWithId>) {
|
||||||
|
|
||||||
|
val searchableRecyclerView = binding.salarySearchableRecyclerView
|
||||||
|
val adapter =
|
||||||
|
SearchableAdapter(
|
||||||
|
listElements = listElements,
|
||||||
|
context = requireContext()
|
||||||
|
) { nameWithId ->
|
||||||
|
val foundItem = routeActionComplementsList.list.find { item ->
|
||||||
|
item.id == nameWithId.id
|
||||||
|
}
|
||||||
|
foundItem?.apply {
|
||||||
|
val dateFormatted = LocalDate.parse(
|
||||||
|
binding.date.text.toString(), DateTimeFormatter.ofPattern("dd-MM-yyyy")
|
||||||
|
).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
|
||||||
|
viewModel.addRouteComplements(
|
||||||
|
RouteComplementAdd(
|
||||||
|
workerFk = mobileApplication.userId!!,
|
||||||
|
routeActionFk = foundItem.id,
|
||||||
|
price = foundItem.price,
|
||||||
|
dated = dateFormatted,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
searchableRecyclerView.visibility = View.GONE
|
||||||
|
}
|
||||||
|
searchableRecyclerView.setAdapter(adapter, listElements)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun observeViewModel() {
|
||||||
|
with(viewModel) {
|
||||||
|
routeActionList.observe(viewLifecycleOwner) { list ->
|
||||||
|
routeActionComplementsList = list
|
||||||
|
setSearchable(list.list.map { item ->
|
||||||
|
NameWithId(
|
||||||
|
id = item.id,
|
||||||
|
name = item.name
|
||||||
|
)
|
||||||
|
}.toMutableList())
|
||||||
|
}
|
||||||
|
routeComplementList.observe(viewLifecycleOwner) {
|
||||||
|
adapterComplement.updateData(it.list)
|
||||||
|
binding.salaryComplementRecyclerview.adapter = adapterComplement
|
||||||
|
binding.salaryComplementRecyclerview.layoutManager = layoutManager
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
import es.verdnatura.presentation.view.feature.delivery.adapters.ExpeditionSummaryAdapter
|
import es.verdnatura.presentation.view.feature.delivery.adapters.ExpeditionSummaryAdapter
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalixPosition
|
||||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
|
||||||
|
@ -39,8 +39,6 @@ class SummaryFragment(
|
||||||
private var originalItem: Int = 0
|
private var originalItem: Int = 0
|
||||||
private lateinit var myList: MutableList<ExpeditionInfoLoadUnload>
|
private lateinit var myList: MutableList<ExpeditionInfoLoadUnload>
|
||||||
private lateinit var myListSummary: List<ExpeditionInfoSummary>
|
private lateinit var myListSummary: List<ExpeditionInfoSummary>
|
||||||
private var counterCalls = 0
|
|
||||||
private var counterResponse = 0
|
|
||||||
private var positionOnScreen = 0
|
private var positionOnScreen = 0
|
||||||
private var addressFkSelected = 0
|
private var addressFkSelected = 0
|
||||||
private var routeSelected = 0
|
private var routeSelected = 0
|
||||||
|
@ -151,19 +149,20 @@ class SummaryFragment(
|
||||||
list: MutableList<ExpeditionInfoLoadUnload>, state: String, address: Int
|
list: MutableList<ExpeditionInfoLoadUnload>, state: String, address: Int
|
||||||
) {
|
) {
|
||||||
val listExpedition = list.filter { it.addressFk == address }.map { l ->
|
val listExpedition = list.filter { it.addressFk == address }.map { l ->
|
||||||
ExpeditionSalix(
|
ExpeditionSalixPosition(
|
||||||
expeditionFk = l.id, stateCode = if (l.code == state && l.code != "DELIVERED") {
|
expeditionFk = l.id, stateCode = if (l.code == "FOUND") (l.code) else {
|
||||||
state
|
if (state == "ON DELIVERY" && l.code != "ON DELIVERY" && l.code != "DELIVERED" && l.code != "LOST") {
|
||||||
} else {
|
"NOT SCANNED"
|
||||||
"FOUND"
|
} else {
|
||||||
},
|
if (state == "DELIVERED" && l.code != "DELIVERED") "LOST" else l.code
|
||||||
isScanned = l.isScanned
|
}
|
||||||
|
}, isScanned = l.isScanned, scanOrder = l.scanOrder
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list.filter { it.addressFk == address }
|
if (list.filter { it.addressFk == address }
|
||||||
.filter { it.code == state }.size == list.filter { it.addressFk == address }.size) {
|
.filter { it.code == state }.size == list.filter { it.addressFk == address }.size) {
|
||||||
counterCalls = 1
|
|
||||||
viewModel.expeditionStateAddSalix(
|
viewModel.expeditionStateAddSalix(
|
||||||
hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state })
|
hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state })
|
||||||
)
|
)
|
||||||
|
@ -178,8 +177,7 @@ class SummaryFragment(
|
||||||
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.save)
|
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.save)
|
||||||
) { _, _ ->
|
) { _, _ ->
|
||||||
|
|
||||||
counterCalls = 1
|
viewModel.expeditionStateAddSalix(hashMapOf("expeditions" to listExpedition))
|
||||||
viewModel.expeditionStateAddSalix(hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state }))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
alertDialog.setButton(
|
alertDialog.setButton(
|
||||||
|
@ -235,15 +233,22 @@ class SummaryFragment(
|
||||||
found = true
|
found = true
|
||||||
exped.code = state
|
exped.code = state
|
||||||
exped.isScanned = isScanned
|
exped.isScanned = isScanned
|
||||||
|
|
||||||
|
println(
|
||||||
|
"scanOrder markExpedition${
|
||||||
|
myList.filter { it.addressFk == addressFkSelected }
|
||||||
|
.filter { it.code == state }.size
|
||||||
|
}"
|
||||||
|
)
|
||||||
|
|
||||||
|
exped.scanOrder = myList.filter { it.addressFk == addressFkSelected }
|
||||||
|
.filter { it.code == state }.size
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found) {
|
if (found) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
message = "",
|
message = "", isError = false, isPlayed = true, isToasted = false
|
||||||
isError = false,
|
|
||||||
isPlayed = true,
|
|
||||||
isToasted = false
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(message = "", isError = true, isPlayed = true, isToasted = null)
|
ma.messageWithSound(message = "", isError = true, isPlayed = true, isToasted = null)
|
||||||
|
@ -279,13 +284,10 @@ class SummaryFragment(
|
||||||
}
|
}
|
||||||
responseStateAdd.observe(viewLifecycleOwner) {
|
responseStateAdd.observe(viewLifecycleOwner) {
|
||||||
if (it) {
|
if (it) {
|
||||||
counterResponse += 1
|
|
||||||
if (counterResponse == counterCalls) {
|
viewModel.routeGetExpeditionSummary(routeSelected)
|
||||||
viewModel.routeGetExpeditionSummary(routeSelected)
|
checkNextAddress()
|
||||||
counterResponse = 0
|
|
||||||
counterCalls = 0
|
|
||||||
checkNextAddress()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -338,7 +340,14 @@ class SummaryFragment(
|
||||||
viewModel.getExpeditionFromRoute(routeSelected)
|
viewModel.getExpeditionFromRoute(routeSelected)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
println("address $addressFkSelected")
|
||||||
|
println("address isScanning $isScanning")
|
||||||
|
|
||||||
if (addressFkSelected != item.addressFk && isScanning) {
|
if (addressFkSelected != item.addressFk && isScanning) {
|
||||||
|
println("address isScanning $isScanning")
|
||||||
|
println("address setSTATE $state")
|
||||||
|
println("address address $addressFkSelected")
|
||||||
|
|
||||||
setExpeditionsState(myList, state, addressFkSelected)
|
setExpeditionsState(myList, state, addressFkSelected)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ import es.verdnatura.presentation.common.GeneralAdapter
|
||||||
import es.verdnatura.presentation.common.GeneralItem
|
import es.verdnatura.presentation.common.GeneralItem
|
||||||
import es.verdnatura.presentation.common.ItemDescorationCustomized
|
import es.verdnatura.presentation.common.ItemDescorationCustomized
|
||||||
import es.verdnatura.presentation.common.OnGeneralItemRowClickListener
|
import es.verdnatura.presentation.common.OnGeneralItemRowClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnGeneralRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnItemButtonCMRRowClickListener
|
import es.verdnatura.presentation.common.OnItemButtonCMRRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnItemButtonTicketRowClickListener
|
import es.verdnatura.presentation.common.OnItemButtonTicketRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
@ -102,7 +103,6 @@ class TicketsFragment : BaseFragment<FragmentTicketsBinding, DeliveryViewModel>(
|
||||||
binding.mainToolbar.toolbarTitle.text = route.name
|
binding.mainToolbar.toolbarTitle.text = route.name
|
||||||
viewModel.getTickets(route.id)
|
viewModel.getTickets(route.id)
|
||||||
db = database(requireContext().applicationContext)
|
db = database(requireContext().applicationContext)
|
||||||
println("tickets in ")
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,32 +608,33 @@ class TicketsFragment : BaseFragment<FragmentTicketsBinding, DeliveryViewModel>(
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}.hideDialog().show()
|
}.hideDialog().show()
|
||||||
|
|
||||||
val listPhonesAdapter = GeneralAdapter(phones, object : OnGeneralItemRowClickListener {
|
val listPhonesAdapter =
|
||||||
override fun onGeneralItemRowClickListener(item: GeneralItem) {
|
GeneralAdapter(phones, onRowClickListener = object : OnGeneralRowClickListener {
|
||||||
phones.forEach {
|
override fun onRowClickListener(item: GeneralItem) {
|
||||||
if (it.code == item.code) {
|
phones.forEach {
|
||||||
if (ContextCompat.checkSelfPermission(
|
if (it.code == item.code) {
|
||||||
requireContext(), Manifest.permission.CALL_PHONE
|
if (ContextCompat.checkSelfPermission(
|
||||||
) == PackageManager.PERMISSION_GRANTED
|
requireContext(), Manifest.permission.CALL_PHONE
|
||||||
) {
|
) == PackageManager.PERMISSION_GRANTED
|
||||||
val callIntent = Intent(Intent.ACTION_CALL)
|
) {
|
||||||
callIntent.data = Uri.parse("tel:${it.code}")
|
val callIntent = Intent(Intent.ACTION_CALL)
|
||||||
startActivity(callIntent)
|
callIntent.data = Uri.parse("tel:${it.code}")
|
||||||
return@forEach
|
startActivity(callIntent)
|
||||||
|
return@forEach
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ActivityCompat.requestPermissions(
|
||||||
|
context as Activity,
|
||||||
|
arrayOf(Manifest.permission.CALL_PHONE),
|
||||||
|
REQUEST_CALL_PERMISSION
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} else {
|
customDialogList.dismiss()
|
||||||
ActivityCompat.requestPermissions(
|
|
||||||
context as Activity,
|
|
||||||
arrayOf(Manifest.permission.CALL_PHONE),
|
|
||||||
REQUEST_CALL_PERMISSION
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
customDialogList.dismiss()
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
customDialogList.getRecyclerView().adapter = listPhonesAdapter
|
customDialogList.getRecyclerView().adapter = listPhonesAdapter
|
||||||
customDialogList.getRecyclerView().layoutManager =
|
customDialogList.getRecyclerView().layoutManager =
|
||||||
|
|
|
@ -5,6 +5,7 @@ import androidx.room.PrimaryKey
|
||||||
import androidx.room.TypeConverters
|
import androidx.room.TypeConverters
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import es.verdnatura.db.MapTypeConverter
|
import es.verdnatura.db.MapTypeConverter
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
class ClientTicketList(
|
class ClientTicketList(
|
||||||
|
@ -58,12 +59,13 @@ data class TicketObservation
|
||||||
(
|
(
|
||||||
var ticketFk: Long,
|
var ticketFk: Long,
|
||||||
var description: String,
|
var description: String,
|
||||||
var observationType:ObservationType?=null
|
var observationType: ObservationType? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
data class ObservationType(
|
data class ObservationType(
|
||||||
var code:String?
|
var code: String?
|
||||||
)
|
)
|
||||||
|
|
||||||
@Entity(tableName = "signedPending")
|
@Entity(tableName = "signedPending")
|
||||||
data class SignedTickets(
|
data class SignedTickets(
|
||||||
@TypeConverters(MapTypeConverter::class) val queryMapList: MutableMap<String?, String?>,
|
@TypeConverters(MapTypeConverter::class) val queryMapList: MutableMap<String?, String?>,
|
||||||
|
@ -71,3 +73,48 @@ data class SignedTickets(
|
||||||
val fileName: String
|
val fileName: String
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data class RouteActionList(
|
||||||
|
var list: List<RouteAction> = listOf()
|
||||||
|
)
|
||||||
|
|
||||||
|
data class RouteAction(
|
||||||
|
val id: Number,
|
||||||
|
val price: Double,
|
||||||
|
val name: String,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class RouteComplementList(
|
||||||
|
var list: List<RouteComplement> = listOf()
|
||||||
|
)
|
||||||
|
|
||||||
|
data class RouteComplement(
|
||||||
|
val id: Number,
|
||||||
|
val price: Number,
|
||||||
|
val workerFk: Number,
|
||||||
|
val routeAction: RouteAction
|
||||||
|
) {
|
||||||
|
var dated: String = ""
|
||||||
|
get() {
|
||||||
|
return field.isoToString(returnOnlyDate = true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data class RouteComplementAdd(
|
||||||
|
val price: Number,
|
||||||
|
val workerFk: Number,
|
||||||
|
val routeActionFk: Number,
|
||||||
|
val dated: String,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class ExpeditionWithTicket(
|
||||||
|
val id: Number,
|
||||||
|
val ticket: TicketExpedition,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
data class TicketExpedition(
|
||||||
|
val clientFk: Number,
|
||||||
|
val warehouseFk: Number,
|
||||||
|
val addressFk: Number,
|
||||||
|
val agencyModeFk: Number
|
||||||
|
)
|
||||||
|
|
|
@ -31,6 +31,17 @@ class ExpeditionSalix(
|
||||||
val isScanned: Int? = 0
|
val isScanned: Int? = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data class ExpeditionsPosition(
|
||||||
|
val expeditions: List<ExpeditionSalixPosition> = listOf()
|
||||||
|
)
|
||||||
|
|
||||||
|
data class ExpeditionSalixPosition(
|
||||||
|
val expeditionFk: Number,
|
||||||
|
val stateCode: String? = null,
|
||||||
|
val isScanned: Int? = 0,
|
||||||
|
val scanOrder: Int? = null
|
||||||
|
)
|
||||||
|
|
||||||
class ExpeditionInfoList(
|
class ExpeditionInfoList(
|
||||||
var list: List<ExpeditionInfoLog> = listOf()
|
var list: List<ExpeditionInfoLog> = listOf()
|
||||||
)
|
)
|
||||||
|
@ -67,7 +78,7 @@ data class Agency(
|
||||||
class TicketSalix(
|
class TicketSalix(
|
||||||
var id: Int,
|
var id: Int,
|
||||||
var routeFk: Int?,
|
var routeFk: Int?,
|
||||||
var route: RouteSalix,
|
var route: RouteSalix?,
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -106,7 +117,8 @@ class ExpeditionInfoLoadUnload(
|
||||||
var code: String?,
|
var code: String?,
|
||||||
var nickname: String,
|
var nickname: String,
|
||||||
var postalCode: String,
|
var postalCode: String,
|
||||||
var isScanned: Int? = null
|
var isScanned: Int? = null,
|
||||||
|
var scanOrder: Int? = null
|
||||||
) : Serializable
|
) : Serializable
|
||||||
|
|
||||||
@Entity(tableName = "expeditionPending")
|
@Entity(tableName = "expeditionPending")
|
||||||
|
@ -121,7 +133,8 @@ class ExpeditionInfoPending(
|
||||||
var code: String?,
|
var code: String?,
|
||||||
var nickname: String,
|
var nickname: String,
|
||||||
var postalCode: String,
|
var postalCode: String,
|
||||||
var isScanned: Int? = 0
|
var isScanned: Int? = 0,
|
||||||
|
var scanOrder: Int? = null
|
||||||
|
|
||||||
) : Serializable
|
) : Serializable
|
||||||
|
|
||||||
|
@ -167,7 +180,8 @@ class RouteInfo(
|
||||||
var finished: String,
|
var finished: String,
|
||||||
var header: Boolean = false,
|
var header: Boolean = false,
|
||||||
//tarea 5867
|
//tarea 5867
|
||||||
var email: String? = null
|
var email: String? = null,
|
||||||
|
var agencyModeFk: Int
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "$driver$id$name$numberPlate$m3$created$hour$"
|
return "$driver$id$name$numberPlate$m3$created$hour$"
|
||||||
|
|
|
@ -11,6 +11,7 @@ import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.Event
|
import es.verdnatura.presentation.common.Event
|
||||||
import es.verdnatura.presentation.common.ExpeditionPrintOut
|
import es.verdnatura.presentation.common.ExpeditionPrintOut
|
||||||
import es.verdnatura.presentation.common.ResponseSign
|
import es.verdnatura.presentation.common.ResponseSign
|
||||||
|
import es.verdnatura.presentation.common.getDayBounds
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketList
|
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketList
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.DeliveryInfo
|
import es.verdnatura.presentation.view.feature.delivery.model.DeliveryInfo
|
||||||
|
@ -20,7 +21,13 @@ import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionList
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionList
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSummaryList
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSummaryList
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionWithTicket
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.FreeLanceDeliveryInfoList
|
import es.verdnatura.presentation.view.feature.delivery.model.FreeLanceDeliveryInfoList
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteAction
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteActionList
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplement
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplementAdd
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplementList
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteDeliveryList
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteDeliveryList
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
||||||
|
@ -35,6 +42,8 @@ import org.json.JSONObject
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
|
@ -106,6 +115,143 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _responseStateList by lazy { MutableLiveData<Boolean>() }
|
private val _responseStateList by lazy { MutableLiveData<Boolean>() }
|
||||||
val responseStateList: LiveData<Boolean> = _responseStateList
|
val responseStateList: LiveData<Boolean> = _responseStateList
|
||||||
|
|
||||||
|
private val _routeActionList by lazy { MutableLiveData<RouteActionList>() }
|
||||||
|
val routeActionList: LiveData<RouteActionList> = _routeActionList
|
||||||
|
|
||||||
|
private val _routeComplementList by lazy { MutableLiveData<RouteComplementList>() }
|
||||||
|
val routeComplementList: LiveData<RouteComplementList> = _routeComplementList
|
||||||
|
|
||||||
|
private val _routeActionAdd by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val routeActionAdd: LiveData<Boolean> = _routeActionAdd
|
||||||
|
|
||||||
|
fun getRouteAction() {
|
||||||
|
salix.getRouteAction()
|
||||||
|
.enqueue(object : SalixCallback<List<RouteAction>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<RouteAction>>) {
|
||||||
|
_routeActionList.value =
|
||||||
|
response.body()?.let { RouteActionList(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getDataFromExpedition(expeditionId: Number, routeId: Number, landed: String) {
|
||||||
|
salix.getDataFromExpedition(
|
||||||
|
filter = """
|
||||||
|
|{
|
||||||
|
|"where":
|
||||||
|
|{"id":$expeditionId},
|
||||||
|
|"fields":["id","ticketFk"],
|
||||||
|
|"include":
|
||||||
|
|{
|
||||||
|
|"relation":"ticket",
|
||||||
|
|"scope":{
|
||||||
|
|"fields":["clientFk","addressFk","warehouseFk","agencyModeFk"]
|
||||||
|
| }
|
||||||
|
|}
|
||||||
|
|}""".trimMargin()
|
||||||
|
)
|
||||||
|
.enqueue(object : SalixCallback<List<ExpeditionWithTicket>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<ExpeditionWithTicket>>) {
|
||||||
|
val myTicketData = response.body()!![0]
|
||||||
|
moveExpeditions(
|
||||||
|
clientId = myTicketData.ticket.clientFk,
|
||||||
|
addressId = myTicketData.ticket.addressFk,
|
||||||
|
warehouseId = myTicketData.ticket.warehouseFk,
|
||||||
|
routeId = routeId,
|
||||||
|
agencyModeId = myTicketData.ticket.agencyModeFk,
|
||||||
|
expeditionsId = arrayListOf(expeditionId),
|
||||||
|
landed = landed
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun addRouteComplements(routeComplementAdd: RouteComplementAdd) {
|
||||||
|
salix.addRouteComplements(routeComplementAdd)
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
getRouteComplements(
|
||||||
|
LocalDate.parse(
|
||||||
|
routeComplementAdd.dated,
|
||||||
|
DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
||||||
|
)
|
||||||
|
.format(DateTimeFormatter.ofPattern("dd-MM-yyyy")),
|
||||||
|
workerFk = routeComplementAdd.workerFk
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun moveExpeditions(
|
||||||
|
clientId: Number,
|
||||||
|
warehouseId: Number,
|
||||||
|
addressId: Number,
|
||||||
|
agencyModeId: Number,
|
||||||
|
routeId: Number,
|
||||||
|
expeditionsId: ArrayList<Number>,
|
||||||
|
landed: String
|
||||||
|
) {
|
||||||
|
salix.moveExpeditions(
|
||||||
|
clientId, warehouseId, addressId, agencyModeId, routeId, expeditionsId, landed
|
||||||
|
|
||||||
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getRouteComplements(date: String, workerFk: Number) {
|
||||||
|
val (startOfDay, endOfDay) = getDayBounds(date)
|
||||||
|
salix.getRouteComplements(
|
||||||
|
"""{
|
||||||
|
|"where": {
|
||||||
|
|"and": [
|
||||||
|
|{
|
||||||
|
|"dated": {
|
||||||
|
|"between": ["$startOfDay", "$endOfDay"]
|
||||||
|
|}
|
||||||
|
|},
|
||||||
|
|{
|
||||||
|
|"workerFK": "$workerFk"
|
||||||
|
|}
|
||||||
|
|]
|
||||||
|
|},
|
||||||
|
|"include": [
|
||||||
|
|{
|
||||||
|
|"relation": "routeAction",
|
||||||
|
|"scope": {
|
||||||
|
|"fields": {
|
||||||
|
|"routeActionFk": true,
|
||||||
|
|"name": true
|
||||||
|
|}
|
||||||
|
|}
|
||||||
|
|}
|
||||||
|
|]
|
||||||
|
|}""".trimMargin()
|
||||||
|
)
|
||||||
|
.enqueue(object : SalixCallback<List<RouteComplement>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<RouteComplement>>) {
|
||||||
|
_routeComplementList.value =
|
||||||
|
response.body()?.let { RouteComplementList(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun routeComplementDelete(id: Number, date: String, workerFk: Number) {
|
||||||
|
salix.routeComplementDelete(id)
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
getRouteComplements(date, workerFk)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun getTicketObservations(
|
fun getTicketObservations(
|
||||||
listTickets: List<Long>
|
listTickets: List<Long>
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,13 @@ import es.verdnatura.presentation.common.OnInvetoryNichoClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.view.commom.NameWithId
|
||||||
|
import es.verdnatura.presentation.view.commom.SearchableAdapter
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogTwoButtons
|
import es.verdnatura.presentation.view.component.CustomDialogTwoButtons
|
||||||
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.InventoryAdapter
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
|
@ -39,10 +39,8 @@ class InventaryFragment :
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
private var layoutManager: LinearLayoutManager? = null
|
private var layoutManager: LinearLayoutManager? = null
|
||||||
private var firstVisiblePosition = 0
|
private var firstVisiblePosition = 0
|
||||||
private var secondVisiblePosition = 1
|
|
||||||
private lateinit var itemClicked: ItemInventaryVO
|
private lateinit var itemClicked: ItemInventaryVO
|
||||||
private val items = ArrayList<SearchBuyerModel>()
|
private var buyerId: Number = -1
|
||||||
private lateinit var buyerId: String
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance() = InventaryFragment()
|
fun newInstance() = InventaryFragment()
|
||||||
|
@ -59,39 +57,17 @@ class InventaryFragment :
|
||||||
|
|
||||||
viewModel.itemShelvingBuyerGet()
|
viewModel.itemShelvingBuyerGet()
|
||||||
binding.filterBuyer.text = mobileApplication.dataStoreApp.readDataStoreKey<String>((BUYER))
|
binding.filterBuyer.text = mobileApplication.dataStoreApp.readDataStoreKey<String>((BUYER))
|
||||||
buyerId = mobileApplication.dataStoreApp.readDataStoreKey((BUYERID))
|
buyerId = mobileApplication.dataStoreApp.readDataStoreKey<Int>((BUYERID))
|
||||||
if (buyerId.isNotBlank()) {
|
if (buyerId != -1) {
|
||||||
viewModel.getInventory(
|
viewModel.getInventory(
|
||||||
buyerId.toInt(), mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
buyerId, mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
binding.filterBuyer.setOnClickListener {
|
binding.filterBuyer.setOnClickListener {
|
||||||
SimpleSearchDialogCompat(
|
binding.searchableRecyclerView.visibility = View.VISIBLE
|
||||||
context,
|
binding.searchableRecyclerView.setSearchHint(getString(R.string.BuyerSearch))
|
||||||
getString(R.string.compradores),
|
|
||||||
getString(R.string.escribirparteNombre),
|
|
||||||
null,
|
|
||||||
items
|
|
||||||
) { baseSearchDialogCompat, nombre, position ->
|
|
||||||
|
|
||||||
binding.filterBuyer.text = (nombre.title)
|
|
||||||
buyerId = nombre.getBuyerId()
|
|
||||||
|
|
||||||
lifecycleScope.launch {
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
BUYER, nombre.getBuyerNickname()
|
|
||||||
)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
BUYERID, nombre.getBuyerId()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
viewModel.getInventory(
|
|
||||||
nombre.getBuyerId().toInt(),
|
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
|
||||||
)
|
|
||||||
baseSearchDialogCompat.dismiss()
|
|
||||||
}.show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialogTwoButtons(requireContext())
|
customDialog = CustomDialogTwoButtons(requireContext())
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemShelvingRadar)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemShelvingRadar)
|
||||||
|
@ -100,6 +76,36 @@ class InventaryFragment :
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setSearchable(listNames: MutableList<NameWithId>) {
|
||||||
|
|
||||||
|
val adapter =
|
||||||
|
SearchableAdapter(
|
||||||
|
listElements = listNames,
|
||||||
|
context = requireContext()
|
||||||
|
) { elementSelected ->
|
||||||
|
|
||||||
|
lifecycleScope.launch {
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
BUYER, elementSelected.name
|
||||||
|
)
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
BUYERID, elementSelected.id
|
||||||
|
)
|
||||||
|
}
|
||||||
|
viewModel.getInventory(
|
||||||
|
elementSelected.id,
|
||||||
|
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
||||||
|
)
|
||||||
|
binding.filterBuyer.text = (elementSelected.name)
|
||||||
|
buyerId = elementSelected.id
|
||||||
|
binding.searchableRecyclerView.visibility = View.GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.searchableRecyclerView.setAdapter(adapter, listNames)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
|
@ -114,9 +120,9 @@ class InventaryFragment :
|
||||||
if (item == iconReload.drawable) {
|
if (item == iconReload.drawable) {
|
||||||
|
|
||||||
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
||||||
if (buyerId.isNotBlank()) {
|
if (buyerId != -1) {
|
||||||
viewModel.getInventory(
|
viewModel.getInventory(
|
||||||
buyerId.toInt(),
|
buyerId,
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -157,7 +163,7 @@ class InventaryFragment :
|
||||||
setFilterItem()
|
setFilterItem()
|
||||||
|
|
||||||
}
|
}
|
||||||
adapter!!.notifyDataSetChanged()
|
adapter?.notifyDataSetChanged()
|
||||||
return@setOnKeyListener false
|
return@setOnKeyListener false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,8 +184,13 @@ class InventaryFragment :
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
buyersList.observe(viewLifecycleOwner) {
|
buyersList.observe(viewLifecycleOwner) { item ->
|
||||||
createBuyerList(it.list)
|
setSearchable(item.list.map {
|
||||||
|
NameWithId(
|
||||||
|
it.userFk,
|
||||||
|
it.nickname
|
||||||
|
)
|
||||||
|
} as MutableList<NameWithId>)
|
||||||
}
|
}
|
||||||
|
|
||||||
inventaryList.observe(viewLifecycleOwner) { it ->
|
inventaryList.observe(viewLifecycleOwner) { it ->
|
||||||
|
@ -265,13 +276,6 @@ class InventaryFragment :
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createBuyerList(list: List<BuyerVO>) {
|
|
||||||
items.clear()
|
|
||||||
if (list.isNotEmpty()) list.forEach { buyer ->
|
|
||||||
items.add(SearchBuyerModel(buyer.nickname, buyer.userFk))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisi
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisibleZero
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisibleZero
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import timber.log.Timber.d
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class InventaryParkingFragment(
|
class InventaryParkingFragment(
|
||||||
|
@ -77,13 +76,15 @@ class InventaryParkingFragment(
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_inventory_parking
|
override fun getLayoutId(): Int = R.layout.fragment_inventory_parking
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
|
if (binding.inventoryParkingRecyclerview.layoutManager != null) {
|
||||||
val layoutManager =
|
val layoutManager =
|
||||||
binding.inventoryParkingRecyclerview.layoutManager as LinearLayoutManager
|
binding.inventoryParkingRecyclerview.layoutManager as LinearLayoutManager
|
||||||
scrollPosition = layoutManager.findFirstVisibleItemPosition()
|
scrollPosition = layoutManager.findFirstVisibleItemPosition()
|
||||||
} catch (exception: Exception) {
|
|
||||||
d(exception)
|
|
||||||
}
|
}
|
||||||
|
/* } catch (ex: Exception) {
|
||||||
|
ex.message!! + "hola".toast(requireContext())
|
||||||
|
}*/
|
||||||
|
|
||||||
isBack = true
|
isBack = true
|
||||||
super.onPause()
|
super.onPause()
|
||||||
|
@ -193,7 +194,7 @@ class InventaryParkingFragment(
|
||||||
)
|
)
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
d(ex)
|
ex.message!!.toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -475,10 +476,14 @@ class InventaryParkingFragment(
|
||||||
ex.message!!.toast(requireContext())
|
ex.message!!.toast(requireContext())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
positionShelvingChecking = try {
|
||||||
positionShelvingChecking = myListInventory.indexOfFirst { item ->
|
myListInventory.indexOfFirst { item ->
|
||||||
item.shelvingFk.uppercase() == binding.editMatricula.text.toString()
|
item.shelvingFk.uppercase() == binding.editMatricula.text.toString()
|
||||||
|
}
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
-1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (positionShelvingChecking != -1) {
|
if (positionShelvingChecking != -1) {
|
||||||
shelvingSaved =
|
shelvingSaved =
|
||||||
myListInventory[positionShelvingChecking].shelvingFk.uppercase()
|
myListInventory[positionShelvingChecking].shelvingFk.uppercase()
|
||||||
|
@ -611,7 +616,7 @@ class InventaryParkingFragment(
|
||||||
positionShelvingChecking = -1
|
positionShelvingChecking = -1
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
d(ex)
|
ex.message!!.toast(requireContext())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
val loadInventaryList: LiveData<Event<InventaryListVO>> = _inventaryList.map { Event(it) }
|
val loadInventaryList: LiveData<Event<InventaryListVO>> = _inventaryList.map { Event(it) }
|
||||||
|
|
||||||
fun getInventory(buyerFk: Int, warehouseFk: Int) {
|
fun getInventory(buyerFk: Number, warehouseFk: Int) {
|
||||||
salix.itemShelvingFilterBuyer(params = arrayListOf(buyerFk, warehouseFk))
|
salix.itemShelvingFilterBuyer(params = arrayListOf(buyerFk, warehouseFk))
|
||||||
.enqueue(object : SalixCallback<List<ItemInventaryVO>>(context) {
|
.enqueue(object : SalixCallback<List<ItemInventaryVO>>(context) {
|
||||||
override fun onSuccess(response: Response<List<ItemInventaryVO>>) {
|
override fun onSuccess(response: Response<List<ItemInventaryVO>>) {
|
||||||
|
@ -146,7 +146,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun workerGetFromHasMistake(departmentFk: Int) {
|
fun workerGetFromHasMistake(departmentFk: Number) {
|
||||||
salix.workerGetFromHasMistake(arrayListOf(departmentFk))
|
salix.workerGetFromHasMistake(arrayListOf(departmentFk))
|
||||||
.enqueue(object : SalixCallback<List<WorkerFromMistake>>(context) {
|
.enqueue(object : SalixCallback<List<WorkerFromMistake>>(context) {
|
||||||
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
|
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.feature.inventario.fragment
|
|
||||||
|
|
||||||
import ir.mirrajabi.searchdialog.core.Searchable
|
|
||||||
|
|
||||||
class SearchBuyerModel(private var nickname: String?, private var buyerId: Int?) : Searchable {
|
|
||||||
|
|
||||||
override fun getTitle(): String {
|
|
||||||
|
|
||||||
return nickname!!
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getBuyerId(): String {
|
|
||||||
return buyerId.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getBuyerNickname(): String {
|
|
||||||
return nickname!!
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class SearchDepartmentModel(private var name: String?, private var departmentId: Int?) :
|
|
||||||
Searchable {
|
|
||||||
|
|
||||||
override fun getTitle(): String {
|
|
||||||
|
|
||||||
return name!!
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getDepartmentId(): Int {
|
|
||||||
return departmentId!!
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getDepartmentName(): String {
|
|
||||||
return name!!
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class SearchSupplierModel(
|
|
||||||
private var name: String?,
|
|
||||||
private var id: String?,
|
|
||||||
private var observation: String?
|
|
||||||
) : Searchable {
|
|
||||||
|
|
||||||
fun getId(): String {
|
|
||||||
return id!!
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getName(): String {
|
|
||||||
return name!!
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getTitle(): String {
|
|
||||||
return name!!
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getObservation(): String {
|
|
||||||
return observation ?: ""
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.login.fragment
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.os.Bundle
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
|
@ -41,7 +42,7 @@ import kotlinx.coroutines.runBlocking
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import kotlin.system.exitProcess
|
import kotlin.system.exitProcess
|
||||||
|
|
||||||
class LoginFragment(private var imageUri: Uri?) :
|
class LoginFragment() :
|
||||||
BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
|
BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
|
||||||
|
|
||||||
private lateinit var customDialogInput: CustomDialogInput
|
private lateinit var customDialogInput: CustomDialogInput
|
||||||
|
@ -50,9 +51,23 @@ class LoginFragment(private var imageUri: Uri?) :
|
||||||
private var workFormAdapter: WorkFormAdapter? = null
|
private var workFormAdapter: WorkFormAdapter? = null
|
||||||
private lateinit var customDialogList: CustomDialogList
|
private lateinit var customDialogList: CustomDialogList
|
||||||
private lateinit var listForms: List<WorkForms>
|
private lateinit var listForms: List<WorkForms>
|
||||||
|
private var imageUri: Uri? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(imageUri: Uri?) = LoginFragment(imageUri)
|
private const val ARG_IMAGE_URI = "image_uri"
|
||||||
|
|
||||||
|
fun newInstance(imageUri: Uri?): LoginFragment {
|
||||||
|
return LoginFragment().apply {
|
||||||
|
arguments = Bundle().apply {
|
||||||
|
putParcelable(ARG_IMAGE_URI, imageUri)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
imageUri = arguments?.getParcelable(ARG_IMAGE_URI)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_login
|
override fun getLayoutId(): Int = R.layout.fragment_login
|
||||||
|
|
|
@ -18,8 +18,8 @@ data class WorkerData(
|
||||||
val labelerFk: Int,
|
val labelerFk: Int,
|
||||||
val sectorFk: Int,
|
val sectorFk: Int,
|
||||||
val sector: Sector?,
|
val sector: Sector?,
|
||||||
val printer: Printer,
|
val printer: Printer?,
|
||||||
val train: Train,
|
val train: Train?,
|
||||||
val id: Int,
|
val id: Int,
|
||||||
val name: String,
|
val name: String,
|
||||||
val nickname: String,
|
val nickname: String,
|
||||||
|
|
|
@ -77,6 +77,7 @@ import es.verdnatura.presentation.view.feature.delivery.fragments.InfoFragment
|
||||||
import es.verdnatura.presentation.view.feature.delivery.fragments.LoadUnloadFragment
|
import es.verdnatura.presentation.view.feature.delivery.fragments.LoadUnloadFragment
|
||||||
import es.verdnatura.presentation.view.feature.delivery.fragments.LogExpeditionFragment
|
import es.verdnatura.presentation.view.feature.delivery.fragments.LogExpeditionFragment
|
||||||
import es.verdnatura.presentation.view.feature.delivery.fragments.RoutesFragment
|
import es.verdnatura.presentation.view.feature.delivery.fragments.RoutesFragment
|
||||||
|
import es.verdnatura.presentation.view.feature.delivery.fragments.SalaryComplementFragment
|
||||||
import es.verdnatura.presentation.view.feature.delivery.fragments.SummaryFragment
|
import es.verdnatura.presentation.view.feature.delivery.fragments.SummaryFragment
|
||||||
import es.verdnatura.presentation.view.feature.delivery.fragments.TicketsFragment
|
import es.verdnatura.presentation.view.feature.delivery.fragments.TicketsFragment
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
||||||
|
@ -142,7 +143,6 @@ import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import timber.log.Timber.d
|
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
import java.util.concurrent.ScheduledExecutorService
|
import java.util.concurrent.ScheduledExecutorService
|
||||||
|
@ -544,23 +544,23 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
// Ya no se utiliza : addFragmentOnTop(ControladorFragment.newInstance())
|
// Ya no se utiliza : addFragmentOnTop(ControladorFragment.newInstance())
|
||||||
|
|
||||||
if (mobileApplication.userId == 19591) {
|
// if (mobileApplication.userId == 19591) {
|
||||||
println("Revisando nueva")
|
println("Revisando nueva")
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
CollectionFragmentChecker.newInstance(
|
CollectionFragmentChecker.newInstance(
|
||||||
CollectionVO(collectionFk = 0),
|
CollectionVO(collectionFk = 0),
|
||||||
type = CONTROLADOR
|
type = CONTROLADOR
|
||||||
)
|
|
||||||
)
|
)
|
||||||
} else {
|
)
|
||||||
println("Revisando vieja")
|
/* } else {
|
||||||
addFragmentOnTop(
|
println("Revisando vieja")
|
||||||
CollectionFragment.newInstance(
|
addFragmentOnTop(
|
||||||
CollectionVO(collectionFk = 0),
|
CollectionFragment.newInstance(
|
||||||
type = CONTROLADOR
|
CollectionVO(collectionFk = 0),
|
||||||
)
|
type = CONTROLADOR
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
|
}*/
|
||||||
/* addFragmentOnTop(
|
/* addFragmentOnTop(
|
||||||
CollectionFragment.newInstance(
|
CollectionFragment.newInstance(
|
||||||
CollectionVO(collectionFk = 0),
|
CollectionVO(collectionFk = 0),
|
||||||
|
@ -944,6 +944,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
addFragmentOnTop(PickerHelperFragment.newInstance(itemTitle))
|
addFragmentOnTop(PickerHelperFragment.newInstance(itemTitle))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getString(R.string.salarySupplementTitle) -> {
|
||||||
|
addFragmentOnTop(SalaryComplementFragment.newInstance(itemTitle))
|
||||||
|
}
|
||||||
|
|
||||||
"PREITEMPICKERTEST" -> {
|
"PREITEMPICKERTEST" -> {
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
CollectionFragmentPickerPreviousNew.newInstance(
|
CollectionFragmentPickerPreviousNew.newInstance(
|
||||||
|
@ -986,7 +990,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
d("$ex")
|
ex.message!!.toast(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1217,7 +1221,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
userFk = (application as MobileApplication).userId!!
|
userFk = (application as MobileApplication).userId!!
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
d(ex.message.toString())
|
ex.message!!.toast(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,15 +12,13 @@ import es.verdnatura.domain.ConstAndValues.SUPPLIERID
|
||||||
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
|
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.view.commom.NameWithId
|
||||||
|
import es.verdnatura.presentation.view.commom.SearchableAdapter
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchSupplierModel
|
|
||||||
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
|
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
|
||||||
import es.verdnatura.presentation.view.feature.packaging.model.Supplier
|
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
|
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
|
||||||
class SupplierFragment(
|
class SupplierFragment(
|
||||||
var entryPoint: String = ""
|
var entryPoint: String = ""
|
||||||
|
|
||||||
|
@ -31,8 +29,7 @@ class SupplierFragment(
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
private var layoutManager: LinearLayoutManager? = null
|
private var layoutManager: LinearLayoutManager? = null
|
||||||
private var onBack = false
|
private var onBack = false
|
||||||
private val suppliers = ArrayList<SearchSupplierModel>()
|
private val entries = ArrayList<EntrySalix>()
|
||||||
private val entries = ArrayList<SearchSupplierModel>()
|
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -59,27 +56,14 @@ class SupplierFragment(
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
binding.filterSupplier.setOnClickListener {
|
binding.filterSupplier.setOnClickListener {
|
||||||
SimpleSearchDialogCompat(
|
binding.searchableSuplierRecyclerView.visibility = View.VISIBLE
|
||||||
context,
|
binding.searchableSuplierRecyclerView.setSearchHint(getString(R.string.supplierSearch))
|
||||||
getString(R.string.suppliers),
|
|
||||||
getString(R.string.escribirparteNombre),
|
}
|
||||||
null,
|
binding.filterEntry.setOnClickListener {
|
||||||
suppliers
|
binding.searchableEntriesRecyclerView.visibility = View.VISIBLE
|
||||||
) { baseSearchDialogCompat, nombre, position ->
|
binding.searchableEntriesRecyclerView.setSearchHint(getString(R.string.entrySearch))
|
||||||
binding.filterSupplier.text = (nombre.getName())
|
|
||||||
runBlocking {
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
SUPPLIERNAME,
|
|
||||||
nombre.getName()
|
|
||||||
)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
SUPPLIERID,
|
|
||||||
nombre.getId().toInt()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
viewModel.getEntriesFromSupplier(nombre.getId().toInt())
|
|
||||||
baseSearchDialogCompat.dismiss()
|
|
||||||
}.show()
|
|
||||||
}
|
}
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
|
@ -89,6 +73,64 @@ class SupplierFragment(
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setSearchable(listNames: MutableList<NameWithId>) {
|
||||||
|
|
||||||
|
val adapter =
|
||||||
|
SearchableAdapter(
|
||||||
|
listElements = listNames,
|
||||||
|
context = requireContext()
|
||||||
|
) { elementSelected ->
|
||||||
|
binding.filterSupplier.text = (elementSelected.name)
|
||||||
|
runBlocking {
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
SUPPLIERNAME,
|
||||||
|
elementSelected.name
|
||||||
|
)
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
SUPPLIERID,
|
||||||
|
elementSelected.id
|
||||||
|
)
|
||||||
|
}
|
||||||
|
viewModel.getEntriesFromSupplier(elementSelected.id)
|
||||||
|
binding.searchableSuplierRecyclerView.visibility = View.GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.searchableSuplierRecyclerView.setAdapter(adapter, listNames)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setSearchableEntries(listNames: MutableList<NameWithId>) {
|
||||||
|
|
||||||
|
val adapter =
|
||||||
|
SearchableAdapter(
|
||||||
|
listElements = listNames,
|
||||||
|
context = requireContext()
|
||||||
|
) { elementSelected ->
|
||||||
|
binding.filterEntry.text = elementSelected.name
|
||||||
|
runBlocking {
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
ENTRYID,
|
||||||
|
elementSelected.id
|
||||||
|
)
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
ENTRYOBSERVATIONORIGINAL,
|
||||||
|
entries.find { it.id == elementSelected.id }?.observation ?: ""
|
||||||
|
)
|
||||||
|
mobileApplication.dataStoreApp.deleteImages()
|
||||||
|
}
|
||||||
|
ma.onPasillerosItemClickListener(
|
||||||
|
PasillerosItemVO(title = R.string.titlePackagingCount),
|
||||||
|
getString(R.string.titlePackagingCount)
|
||||||
|
)
|
||||||
|
binding.searchableEntriesRecyclerView.visibility = View.GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.searchableEntriesRecyclerView.setAdapter(adapter, listNames)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||||
}
|
}
|
||||||
|
@ -103,41 +145,18 @@ class SupplierFragment(
|
||||||
|
|
||||||
private fun setEntryDialog() {
|
private fun setEntryDialog() {
|
||||||
binding.filterEntry.visibility = View.VISIBLE
|
binding.filterEntry.visibility = View.VISIBLE
|
||||||
binding.filterEntry.setOnClickListener {
|
|
||||||
SimpleSearchDialogCompat(
|
|
||||||
context,
|
|
||||||
getString(R.string.entry),
|
|
||||||
getString(R.string.escribirparteNombre),
|
|
||||||
null,
|
|
||||||
entries
|
|
||||||
) { baseSearchDialogCompat, nombre, position ->
|
|
||||||
binding.filterEntry.text = nombre.getName()
|
|
||||||
runBlocking {
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
ENTRYID,
|
|
||||||
nombre.getId().toInt()
|
|
||||||
)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
ENTRYOBSERVATIONORIGINAL,
|
|
||||||
nombre.getObservation()
|
|
||||||
)
|
|
||||||
mobileApplication.dataStoreApp.deleteImages()
|
|
||||||
}
|
|
||||||
ma.onPasillerosItemClickListener(
|
|
||||||
PasillerosItemVO(title = R.string.titlePackagingCount),
|
|
||||||
getString(R.string.titlePackagingCount)
|
|
||||||
)
|
|
||||||
// }
|
|
||||||
baseSearchDialogCompat.dismiss()
|
|
||||||
}.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
supplierList.observe(viewLifecycleOwner) {
|
supplierList.observe(viewLifecycleOwner) { item ->
|
||||||
createSupplierList(it.list)
|
setSearchable(item.list.map {
|
||||||
|
NameWithId(
|
||||||
|
it.id!!,
|
||||||
|
it.name!!
|
||||||
|
)
|
||||||
|
} as MutableList<NameWithId>)
|
||||||
}
|
}
|
||||||
entryList.observe(viewLifecycleOwner) {
|
entryList.observe(viewLifecycleOwner) {
|
||||||
createEntryList(it.list)
|
createEntryList(it.list)
|
||||||
|
@ -162,57 +181,20 @@ class SupplierFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createSupplierList(list: List<Supplier>) {
|
|
||||||
suppliers.clear()
|
|
||||||
if (list.isNotEmpty())
|
|
||||||
|
|
||||||
list.forEach { supplier ->
|
|
||||||
|
|
||||||
try {
|
|
||||||
suppliers.add(
|
|
||||||
SearchSupplierModel(
|
|
||||||
supplier.name,
|
|
||||||
supplier.id.toString(),
|
|
||||||
observation = ""
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
ma.messageWithSound(
|
|
||||||
message = ex.message.toString(),
|
|
||||||
isError = true,
|
|
||||||
isPlayed = true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createEntryList(list: List<EntrySalix>) {
|
private fun createEntryList(list: List<EntrySalix>) {
|
||||||
list.sortedBy { it.travel?.landed }
|
list.sortedBy { it.travel?.landed }
|
||||||
entries.clear()
|
entries.clear()
|
||||||
list.forEach { entry ->
|
if (list.isNotEmpty() && !list[0].isError) {
|
||||||
if (!entry.isError) {
|
setSearchableEntries(list.map { entry ->
|
||||||
|
NameWithId(
|
||||||
try {
|
entry.id!!,
|
||||||
entries.add(
|
entry.id.toString() + "->" + (entry.travel?.landed)
|
||||||
SearchSupplierModel(
|
)
|
||||||
entry.id.toString() + "->" + (entry.travel?.landed),
|
} as MutableList<NameWithId>)
|
||||||
id = entry.id.toString(),
|
entries.addAll(list.sortedBy { it.travel?.landed })
|
||||||
observation = entry.observation
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
ma.messageWithSound(
|
|
||||||
message = ex.message.toString(),
|
|
||||||
isError = true,
|
|
||||||
isPlayed = true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
binding.filterEntry.visibility = View.VISIBLE
|
||||||
|
|
||||||
setEntryDialog()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ class SupplierViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getEntriesFromSupplier(supplier: Int) {
|
fun getEntriesFromSupplier(supplier: Number) {
|
||||||
val calendar = Calendar.getInstance()
|
val calendar = Calendar.getInstance()
|
||||||
calendar.add(Calendar.DAY_OF_YEAR, 0)
|
calendar.add(Calendar.DAY_OF_YEAR, 0)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.paletizador.adapter
|
package es.verdnatura.presentation.view.feature.paletizador.adapter
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
@ -12,47 +11,63 @@ import es.verdnatura.presentation.common.OnComprobarPalletViewClickListener
|
||||||
import es.verdnatura.presentation.common.OnPalletClickListener
|
import es.verdnatura.presentation.common.OnPalletClickListener
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||||
import timber.log.Timber.d
|
|
||||||
|
|
||||||
class ExpeditionPalletAdapter (
|
class ExpeditionPalletAdapter(
|
||||||
private val items: List<ItemPalletVO>,
|
private val items: List<ItemPalletVO>,
|
||||||
private val onPalletClickListener: OnPalletClickListener,
|
private val onPalletClickListener: OnPalletClickListener,
|
||||||
private val onComprobarPalletViewClickListener: OnComprobarPalletViewClickListener,
|
private val onComprobarPalletViewClickListener: OnComprobarPalletViewClickListener,
|
||||||
private val itemExpeditionTruckVO: ItemExpeditionTruckVO
|
private val itemExpeditionTruckVO: ItemExpeditionTruckVO
|
||||||
): RecyclerView.Adapter<ExpeditionPalletAdapter.ItemHolder> () {
|
) : RecyclerView.Adapter<ExpeditionPalletAdapter.ItemHolder>() {
|
||||||
|
|
||||||
private var context:Context? = null
|
private var context: Context? = null
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||||
this.context = parent.context
|
this.context = parent.context
|
||||||
return ItemHolder(
|
return ItemHolder(
|
||||||
ItemExpeditionpalletRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
|
ItemExpeditionpalletRowBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context),
|
||||||
|
parent,
|
||||||
|
false
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getItemCount() =items.size
|
override fun getItemCount() = items.size
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||||
holder.bind(items[position])
|
holder.bind(items[position])
|
||||||
holder.binding.root.setOnClickListener {
|
holder.binding.root.setOnClickListener {
|
||||||
onPalletClickListener.onPalletClickListener(itemExpeditionTruckVO,items[position])
|
onPalletClickListener.onPalletClickListener(itemExpeditionTruckVO, items[position])
|
||||||
}
|
}
|
||||||
holder.binding.root.setOnLongClickListener {
|
holder.binding.root.setOnLongClickListener {
|
||||||
onComprobarPalletViewClickListener.onComprobarPalletViewClickListener(itemExpeditionTruckVO,items[position])
|
onComprobarPalletViewClickListener.onComprobarPalletViewClickListener(
|
||||||
|
itemExpeditionTruckVO,
|
||||||
|
items[position]
|
||||||
|
)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class ItemHolder(
|
inner class ItemHolder(
|
||||||
val binding: ItemExpeditionpalletRowBinding
|
val binding: ItemExpeditionpalletRowBinding
|
||||||
) : RecyclerView.ViewHolder(binding.root){
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
private val res = binding.root.context.resources
|
private val res = binding.root.context.resources
|
||||||
fun bind(item: ItemPalletVO) {
|
fun bind(item: ItemPalletVO) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
this.item = item
|
this.item = item
|
||||||
if (item.Rutas != 1){
|
if (item.Rutas != 1) {
|
||||||
expeditionPalletRutas.setTextColor(ContextCompat.getColor(context!!, R.color.verdnatura_red))
|
expeditionPalletRutas.setTextColor(
|
||||||
}else {
|
ContextCompat.getColor(
|
||||||
expeditionPalletRutas.setTextColor(ContextCompat.getColor(context!!, R.color.verdnatura_white))
|
context!!,
|
||||||
|
R.color.verdnatura_red
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
expeditionPalletRutas.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
context!!,
|
||||||
|
R.color.verdnatura_white
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ class ExpeditionDeleteFragment(var title: String = "") :
|
||||||
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
||||||
try {
|
try {
|
||||||
val itemScaned = itemScanValue(
|
val itemScaned = itemScanValue(
|
||||||
textScanned_filterDouble(binding.editMatricula.text.toString()),
|
textScannedFilterDouble(binding.editMatricula.text.toString()),
|
||||||
arrayOf("expedition"),
|
arrayOf("expedition"),
|
||||||
"id"
|
"id"
|
||||||
).toString().toLong()
|
).toString().toLong()
|
||||||
|
@ -104,7 +104,7 @@ class ExpeditionDeleteFragment(var title: String = "") :
|
||||||
adapter!!.updateItems(listExpeditions.map { it.expeditionFk.toLong() } as ArrayList<Long>)
|
adapter!!.updateItems(listExpeditions.map { it.expeditionFk.toLong() } as ArrayList<Long>)
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
message = "Caja ya escaneada",
|
message = getString(R.string.boxScanned),
|
||||||
isError = true,
|
isError = true,
|
||||||
isPlayed = true,
|
isPlayed = true,
|
||||||
isToasted = true
|
isToasted = true
|
||||||
|
|
|
@ -93,7 +93,7 @@ class ExpeditionPreparedStateFragment(var codeState: String = "PREPARED", var ti
|
||||||
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
||||||
try {
|
try {
|
||||||
val itemScaned = itemScanValue(
|
val itemScaned = itemScanValue(
|
||||||
textScanned_filterDouble(binding.editMatricula.text.toString()),
|
textScannedFilterDouble(binding.editMatricula.text.toString()),
|
||||||
arrayOf("expedition"),
|
arrayOf("expedition"),
|
||||||
"id"
|
"id"
|
||||||
).toString().toLong()
|
).toString().toLong()
|
||||||
|
|
|
@ -513,6 +513,14 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
||||||
R.drawable.ic_packaging, R.string.titlePackingHolland, R.string.titleUbicatorDescrip
|
R.drawable.ic_packaging, R.string.titlePackingHolland, R.string.titleUbicatorDescrip
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
//tarea 8099
|
||||||
|
/* _pasillerositem.add(
|
||||||
|
PasillerosItemVO(
|
||||||
|
R.drawable.ic_salary_supplement,
|
||||||
|
R.string.salarySupplementTitle,
|
||||||
|
R.string.salarySupplementTitle
|
||||||
|
)
|
||||||
|
)*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.sacador.fragment
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
|
import android.util.Log.d
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
@ -242,7 +243,12 @@ class SacadorFragmentNew(
|
||||||
} else {
|
} else {
|
||||||
if (it.response.isNotBlank()) {
|
if (it.response.isNotBlank()) {
|
||||||
if (collectionsList.isNotEmpty()) {
|
if (collectionsList.isNotEmpty()) {
|
||||||
addCollectionToList(it.response.toInt())
|
try {
|
||||||
|
addCollectionToList(it.response.toInt())
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
d("vn", ex.message.toString())
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
callBack(type)
|
callBack(type)
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,9 @@ class CollectionVO(
|
||||||
var errorMessage: String = "",
|
var errorMessage: String = "",
|
||||||
var itemPackingTypeFk: String = "",
|
var itemPackingTypeFk: String = "",
|
||||||
var rgb: String? = null,
|
var rgb: String? = null,
|
||||||
var ticketTotalCount: Int? = null
|
var ticketTotalCount: Int? = null,
|
||||||
|
var parkingCode: String? = null,
|
||||||
|
var idAdvanced: Boolean? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
class CollectionSalix(
|
class CollectionSalix(
|
||||||
|
@ -154,7 +156,7 @@ class SaleVO(
|
||||||
var cel1: String = "",
|
var cel1: String = "",
|
||||||
var cel2: String = "",
|
var cel2: String = "",
|
||||||
var cel3: String = "",
|
var cel3: String = "",
|
||||||
var saleGroupFk: String = "",
|
var saleGroupFk: String? = "",
|
||||||
var picked: String? = "",
|
var picked: String? = "",
|
||||||
var isParent: Boolean = false,
|
var isParent: Boolean = false,
|
||||||
var totalSales: Int = 0,
|
var totalSales: Int = 0,
|
||||||
|
@ -162,7 +164,9 @@ class SaleVO(
|
||||||
var code: String? = "",
|
var code: String? = "",
|
||||||
var hasMistake: Any? = false,
|
var hasMistake: Any? = false,
|
||||||
var sectorFk: Int? = null,
|
var sectorFk: Int? = null,
|
||||||
var packingChecked: Int = 1
|
var packingChecked: Int = 1,
|
||||||
|
var isAdvanced: Int? = 0,
|
||||||
|
var parkingCode: String? = ""
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -175,8 +179,10 @@ class TicketVO(
|
||||||
var sales: List<SaleVO> = listOf(),
|
var sales: List<SaleVO> = listOf(),
|
||||||
@SerializedName(value = "observations", alternate = ["observaciones"])
|
@SerializedName(value = "observations", alternate = ["observaciones"])
|
||||||
var observations: String = "",
|
var observations: String = "",
|
||||||
|
var isAdvanced: Int? = 0,
|
||||||
|
var parkingCode: String? = ""
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data class CollectionIdSalix(
|
data class CollectionIdSalix(
|
||||||
var id: Int
|
var id: Int
|
||||||
|
|
|
@ -86,7 +86,7 @@ class AutomaticAddItemFragment(
|
||||||
listItems.add(
|
listItems.add(
|
||||||
0,
|
0,
|
||||||
itemScanValue(
|
itemScanValue(
|
||||||
textScanned_filterDouble(binding.editMatricula.text.toString()),
|
textScannedFilterDouble(binding.editMatricula.text.toString()),
|
||||||
arrayOf("buy"),
|
arrayOf("buy"),
|
||||||
"more"
|
"more"
|
||||||
).toString().toLong()
|
).toString().toLong()
|
||||||
|
@ -161,7 +161,7 @@ class AutomaticAddItemFragment(
|
||||||
customDialogList.setDescription(
|
customDialogList.setDescription(
|
||||||
getString(R.string.scanShelvingsLocate)
|
getString(R.string.scanShelvingsLocate)
|
||||||
).setOkButton(getString(R.string.locate)) {
|
).setOkButton(getString(R.string.locate)) {
|
||||||
|
listItems.clear()
|
||||||
listShelvings.forEach {
|
listShelvings.forEach {
|
||||||
viewModel.itemShelvingMakeMulti(
|
viewModel.itemShelvingMakeMulti(
|
||||||
it.code!!,
|
it.code!!,
|
||||||
|
|
|
@ -15,6 +15,7 @@ import android.widget.Toast
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentUbicadorBinding
|
import es.verdnatura.databinding.FragmentUbicadorBinding
|
||||||
|
import es.verdnatura.domain.ConstAndValues
|
||||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
||||||
import es.verdnatura.domain.isShelving
|
import es.verdnatura.domain.isShelving
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
|
@ -28,6 +29,7 @@ import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnVisibleClickListenerNew
|
import es.verdnatura.presentation.common.OnVisibleClickListenerNew
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
|
import es.verdnatura.presentation.common.hideKeyboard
|
||||||
import es.verdnatura.presentation.common.itemScanValue
|
import es.verdnatura.presentation.common.itemScanValue
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||||
|
@ -39,6 +41,7 @@ import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapterNew
|
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapterNew
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
||||||
|
import kotlin.math.ceil
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewModel>(
|
class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewModel>(
|
||||||
|
@ -214,18 +217,20 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
listItems.clear()
|
||||||
when (item) {
|
when (item) {
|
||||||
iconAdd.drawable -> showAddItemNew(
|
iconAdd.drawable -> showAddItemNew(
|
||||||
isEditItem = false, null
|
isEditItem = false, null
|
||||||
)
|
)
|
||||||
|
|
||||||
iconAddMultiple.drawable ->
|
iconAddMultiple.drawable -> {
|
||||||
|
|
||||||
ma.onPasillerosItemClickListener(
|
ma.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
title = R.string.addItemMultipleShelving,
|
title = R.string.addItemMultipleShelving,
|
||||||
), entryPoint = getString(R.string.addItemMultipleShelving)
|
), entryPoint = getString(R.string.addItemMultipleShelving)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
iconReload.drawable -> {
|
iconReload.drawable -> {
|
||||||
|
|
||||||
|
@ -339,6 +344,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
|
|
||||||
|
|
||||||
binding.automaticImg.setOnClickListener {
|
binding.automaticImg.setOnClickListener {
|
||||||
|
|
||||||
if (shelvingFk.isNotBlank()) ma.onPasillerosItemClickListener(
|
if (shelvingFk.isNotBlank()) ma.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(title = R.string.titleAuto), entryPoint = shelvingFk
|
PasillerosItemVO(title = R.string.titleAuto), entryPoint = shelvingFk
|
||||||
)
|
)
|
||||||
|
@ -519,21 +525,28 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
|
|
||||||
loadShelvingListNew.observe(viewLifecycleOwner) { event ->
|
loadShelvingListNew.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
listItems.clear()
|
||||||
|
event.getContentIfNotHandled().notNull { it ->
|
||||||
if (isShelvinLogfromMainScreen) {
|
if (isShelvinLogfromMainScreen) {
|
||||||
viewModel.shelvingLogAdd(shelvingFk)
|
viewModel.shelvingLogAdd(shelvingFk)
|
||||||
}
|
}
|
||||||
listItems = ArrayList()
|
|
||||||
val totalStickers = it.list.sumOf { item -> item.stickers }
|
|
||||||
parking = it.list.firstOrNull { item -> item.code != null }?.code ?: ""
|
|
||||||
listItems.addAll(it.list)
|
listItems.addAll(it.list)
|
||||||
|
listItems.forEach { item ->
|
||||||
|
if (item.description.isNullOrEmpty()) {
|
||||||
|
item.description =
|
||||||
|
item.longName ?: "${item.name ?: ""} ${item.size ?: ""}"
|
||||||
|
}
|
||||||
|
item.stickers =
|
||||||
|
if (item.packing == null) 0 else ceil((item.visible.toDouble() / item.packing!!.toDouble())).toInt()
|
||||||
|
}
|
||||||
|
val totalStickers = listItems.sumOf { item -> item.stickers }
|
||||||
|
parking = it.list.firstOrNull { item -> item.code != null }?.code ?: ""
|
||||||
|
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
||||||
R.string.label
|
R.string.label
|
||||||
) + totalStickers
|
) + totalStickers
|
||||||
if (listItems.isNotEmpty()) binding.editPrioridad.setText(it.list[0].priority.toString())
|
if (listItems.isNotEmpty()) binding.editPrioridad.setText(listItems[0].priority?.toString())
|
||||||
|
|
||||||
if (!binding.mainToolbar.switchButton.isChecked && listItems.isNotEmpty()) {
|
if (!binding.mainToolbar.switchButton.isChecked && listItems.isNotEmpty()) {
|
||||||
listItems = listItems.asReversed()
|
listItems = listItems.asReversed()
|
||||||
|
@ -649,7 +662,15 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
loadBuyUltimateResponse.observe(viewLifecycleOwner) { event ->
|
||||||
|
event.getContentIfNotHandled().notNull {
|
||||||
|
ma.messageWithSound(
|
||||||
|
getString(R.string.errorPrintBuy),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -842,6 +863,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
customDialogUbicador.getPackingValue().toIntOrNull()
|
customDialogUbicador.getPackingValue().toIntOrNull()
|
||||||
|
|
||||||
) else {
|
) else {
|
||||||
|
|
||||||
viewModel.itemShelvingAdd(
|
viewModel.itemShelvingAdd(
|
||||||
shelving = shelvingFk,
|
shelving = shelvingFk,
|
||||||
item = customDialogUbicador.getItemValue().toLong(),
|
item = customDialogUbicador.getItemValue().toLong(),
|
||||||
|
@ -1031,7 +1053,6 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
if (!isAutoSelf) {
|
if (!isAutoSelf) {
|
||||||
listItems.remove(item)
|
listItems.remove(item)
|
||||||
adapter!!.notifyItemRemoved(listItems.indexOf(item))
|
adapter!!.notifyItemRemoved(listItems.indexOf(item))
|
||||||
//adapter!!.notifyDataSetChanged()
|
|
||||||
viewModel.itemShelvingDelete(
|
viewModel.itemShelvingDelete(
|
||||||
item.id
|
item.id
|
||||||
)
|
)
|
||||||
|
@ -1049,7 +1070,46 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
customDialogTwoButtons.dismiss()
|
customDialogTwoButtons.dismiss()
|
||||||
}
|
}
|
||||||
customDialogConfirm.show()
|
customDialogConfirm.show()
|
||||||
}//Tarea 7763
|
}
|
||||||
|
//Tarea 7266
|
||||||
|
/* .setOkButtonThree(getString(R.string.print)) {
|
||||||
|
val printerDialogManager = PrinterDialogManager(requireContext())
|
||||||
|
printerDialogManager.showPrintDialog(
|
||||||
|
item.item,
|
||||||
|
item.description ?: ""
|
||||||
|
) { id, labelType, packing, copies ->
|
||||||
|
|
||||||
|
if (item.buyFk == null) {
|
||||||
|
viewModel.buyUltimate(
|
||||||
|
itemFk = item.id,
|
||||||
|
warehouseFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
|
WAREHOUSEFK
|
||||||
|
),
|
||||||
|
dated = LocalDate.now()
|
||||||
|
.format(
|
||||||
|
DateTimeFormatter.ofPattern("yyyy-dd-MM")
|
||||||
|
),
|
||||||
|
reportName = "LabelBuy",
|
||||||
|
printerFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
|
ConstAndValues.PRINTERFK
|
||||||
|
),
|
||||||
|
userFk = mobileApplication.userId!!,
|
||||||
|
priority = "normal",
|
||||||
|
copies = copies,
|
||||||
|
labelType = labelType,
|
||||||
|
packing = packing
|
||||||
|
)
|
||||||
|
customDialogTwoButtons.dismiss()
|
||||||
|
} else {
|
||||||
|
printItem(
|
||||||
|
item.buyFk!!, labelType, packing, copies
|
||||||
|
)
|
||||||
|
customDialogTwoButtons.dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
customDialogInput.getEditText().requestFocus()
|
||||||
|
}*/
|
||||||
|
//Tarea 7763
|
||||||
/*
|
/*
|
||||||
.setOkButtonThree(getString(R.string.rename)) {
|
.setOkButtonThree(getString(R.string.rename)) {
|
||||||
customDialogInput.setTitle(getString(R.string.itemNew))
|
customDialogInput.setTitle(getString(R.string.itemNew))
|
||||||
|
@ -1080,6 +1140,24 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
|
||||||
customDialogTwoButtons.show()
|
customDialogTwoButtons.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun printItem(id: Number?, labelType: String, packing: Int?, copies: Int?) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
viewModel.printItem(
|
||||||
|
reportName = "LabelBuy",
|
||||||
|
printerFk = mobileApplication.dataStoreApp.readDataStoreKey<Int>(
|
||||||
|
ConstAndValues.PRINTERFK
|
||||||
|
),
|
||||||
|
userFk = mobileApplication.userId!!,
|
||||||
|
priority = "normal",
|
||||||
|
params = """{'copies':$copies,'id':$id,'labelType':'$labelType','packing':$packing}"""
|
||||||
|
)
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
ma.messageWithSound(message = ex.message.toString(), isError = true, isPlayed = true)
|
||||||
|
}
|
||||||
|
hideKeyboard()
|
||||||
|
}
|
||||||
|
|
||||||
private fun actionRename(item: ItemUbicador, itemScan: String) {
|
private fun actionRename(item: ItemUbicador, itemScan: String) {
|
||||||
|
|
||||||
if (itemScan.isNotEmpty()) {
|
if (itemScan.isNotEmpty()) {
|
||||||
|
|
|
@ -9,9 +9,8 @@ import es.verdnatura.R
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
|
import es.verdnatura.domain.userCases.GetItemFromBarcodeUseCase
|
||||||
|
import es.verdnatura.domain.userCases.GetItemPrintItemUseCase
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.common.Event
|
import es.verdnatura.presentation.common.Event
|
||||||
import es.verdnatura.presentation.common.ItemShelvingSalix
|
import es.verdnatura.presentation.common.ItemShelvingSalix
|
||||||
import es.verdnatura.presentation.common.ResponseHasOlder
|
import es.verdnatura.presentation.common.ResponseHasOlder
|
||||||
|
@ -22,16 +21,13 @@ import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewer
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewerList
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewerList
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorListNew
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorListNew
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorListVO
|
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.MakeMultiSalix
|
import es.verdnatura.presentation.view.feature.workermistake.model.MakeMultiSalix
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
private val getItemFromBarcodeUseCase = GetItemFromBarcodeUseCase(salix)
|
||||||
|
private val printItemUseCase = GetItemPrintItemUseCase(salix)
|
||||||
private val _shelvingList by lazy { MutableLiveData<ItemUbicadorListVO>() }
|
|
||||||
|
|
||||||
private val _responseUbicator by lazy { MutableLiveData<Boolean>() }
|
private val _responseUbicator by lazy { MutableLiveData<Boolean>() }
|
||||||
val responseUbicator: LiveData<Boolean>
|
val responseUbicator: LiveData<Boolean>
|
||||||
|
@ -43,8 +39,6 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val loadResponseHasOlder: LiveData<Event<ResponseHasOlder>> =
|
val loadResponseHasOlder: LiveData<Event<ResponseHasOlder>> =
|
||||||
_responseHasOlder.map { Event(it) }
|
_responseHasOlder.map { Event(it) }
|
||||||
|
|
||||||
val loadShelvingList: LiveData<Event<ItemUbicadorListVO>> = _shelvingList.map { Event(it) }
|
|
||||||
|
|
||||||
private val _shelvingListNew by lazy { MutableLiveData<ItemUbicadorListNew>() }
|
private val _shelvingListNew by lazy { MutableLiveData<ItemUbicadorListNew>() }
|
||||||
val loadShelvingListNew: LiveData<Event<ItemUbicadorListNew>> =
|
val loadShelvingListNew: LiveData<Event<ItemUbicadorListNew>> =
|
||||||
_shelvingListNew.map { Event(it) }
|
_shelvingListNew.map { Event(it) }
|
||||||
|
@ -65,45 +59,81 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _responseAddList by lazy { MutableLiveData<Boolean>() }
|
private val _responseAddList by lazy { MutableLiveData<Boolean>() }
|
||||||
val responseAddList: LiveData<Boolean> = _responseAddList
|
val responseAddList: LiveData<Boolean> = _responseAddList
|
||||||
|
|
||||||
val loadAddList: LiveData<Event<Boolean>> = _responseAddList.map { Event(it) }
|
val loadAddList: LiveData<Event<Boolean>> = _responseAddList.map { Event(it) }
|
||||||
|
|
||||||
private val _responseLogAdd by lazy { MutableLiveData<Any>() }
|
private val _responseLogAdd by lazy { MutableLiveData<Any>() }
|
||||||
val responseLogAdd: LiveData<Any>
|
val responseLogAdd: LiveData<Any>
|
||||||
get() = _responseLogAdd
|
get() = _responseLogAdd
|
||||||
|
|
||||||
fun itemShelvingList(
|
private val _buyUltimateResponse by lazy { MutableLiveData<Boolean>() }
|
||||||
vShelvingFk: String
|
val buyUltimateResponse: LiveData<Boolean> = _buyUltimateResponse
|
||||||
) {
|
val loadBuyUltimateResponse: LiveData<Event<Boolean>> = _buyUltimateResponse.map { Event(it) }
|
||||||
salix.itemShelvingList(params = listOf(vShelvingFk.uppercase()).formatWithQuotes()).enqueue(
|
|
||||||
object : SalixCallback<List<ItemUbicadorVO>>(context) {
|
|
||||||
override fun onSuccess(response: Response<List<ItemUbicadorVO>>) {
|
|
||||||
_shelvingList.value = response.body()?.let { ItemUbicadorListVO(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onError(t: Throwable) {
|
|
||||||
val listError: ArrayList<ItemUbicadorVO> = ArrayList()
|
|
||||||
listError.add(
|
|
||||||
ItemUbicadorVO(
|
|
||||||
0,
|
|
||||||
isError = true,
|
|
||||||
errorMessage = getMessageFromAllResponse(
|
|
||||||
nameofFunction(this),
|
|
||||||
t.message!!,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
_shelvingList.value = ItemUbicadorListVO(listError)
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun itemShelvingListNew(
|
fun itemShelvingListNew(
|
||||||
vShelvingFk: String
|
shelvingFk: String
|
||||||
) {
|
) {
|
||||||
salix.itemShelvingListNew(params = listOf(vShelvingFk.uppercase()).formatWithQuotes())
|
salix.itemShelvingListNew(params = listOf(shelvingFk.uppercase()).formatWithQuotes())
|
||||||
|
.enqueue(
|
||||||
|
object : SalixCallback<List<ItemUbicador>>(context) {
|
||||||
|
override fun onSuccess(response: Response<List<ItemUbicador>>) {
|
||||||
|
_shelvingListNew.value = response.body()?.let { ItemUbicadorListNew(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//Tarea 6869
|
||||||
|
fun itemShelvingGet(
|
||||||
|
shelvingFk: String
|
||||||
|
) {
|
||||||
|
salix.itemShelvingGet(
|
||||||
|
filter = """{
|
||||||
|
"fields":[
|
||||||
|
"priority",
|
||||||
|
"parkingFk",
|
||||||
|
"code"
|
||||||
|
],
|
||||||
|
"include":[
|
||||||
|
{
|
||||||
|
"relation":"parking",
|
||||||
|
"scope":{
|
||||||
|
"fields":[
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"relation":"itemShelving",
|
||||||
|
"scope":{
|
||||||
|
"fields":[
|
||||||
|
"id",
|
||||||
|
"itemFk",
|
||||||
|
"visible",
|
||||||
|
"packing",
|
||||||
|
"grouping",
|
||||||
|
"isChecked",
|
||||||
|
"available",
|
||||||
|
"buyFk"
|
||||||
|
],
|
||||||
|
"include":{
|
||||||
|
"relation":"item",
|
||||||
|
"scope":{
|
||||||
|
"fields":[
|
||||||
|
"name",
|
||||||
|
"longName",
|
||||||
|
"size"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"where":{
|
||||||
|
"code":"$shelvingFk"
|
||||||
|
}
|
||||||
|
}""".trim()
|
||||||
|
)
|
||||||
.enqueue(
|
.enqueue(
|
||||||
object : SalixCallback<List<ItemUbicador>>(context) {
|
object : SalixCallback<List<ItemUbicador>>(context) {
|
||||||
override fun onSuccess(response: Response<List<ItemUbicador>>) {
|
override fun onSuccess(response: Response<List<ItemUbicador>>) {
|
||||||
|
@ -430,6 +460,67 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun printItem(
|
||||||
|
reportName: String,
|
||||||
|
printerFk: Int,
|
||||||
|
userFk: Int,
|
||||||
|
params: Any,
|
||||||
|
priority: String
|
||||||
|
|
||||||
|
) {
|
||||||
|
|
||||||
|
printItemUseCase.execute(
|
||||||
|
params = arrayListOf(
|
||||||
|
reportName,
|
||||||
|
printerFk,
|
||||||
|
userFk,
|
||||||
|
params,
|
||||||
|
priority
|
||||||
|
).formatWithQuotes()
|
||||||
|
)
|
||||||
|
.enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun buyUltimate(
|
||||||
|
itemFk: Number,
|
||||||
|
warehouseFk: Int,
|
||||||
|
dated: String,
|
||||||
|
reportName: String,
|
||||||
|
printerFk: Int,
|
||||||
|
priority: String,
|
||||||
|
userFk: Int,
|
||||||
|
copies: Int,
|
||||||
|
labelType: String,
|
||||||
|
packing: Int?
|
||||||
|
|
||||||
|
) {
|
||||||
|
printItemUseCase.executeBuyUltimate(
|
||||||
|
params = arrayListOf(
|
||||||
|
itemFk,
|
||||||
|
warehouseFk,
|
||||||
|
dated
|
||||||
|
).formatWithQuotes()
|
||||||
|
)
|
||||||
|
.enqueue(object : SalixCallback<Long>(context) {
|
||||||
|
override fun onSuccess(response: Response<Long>) {
|
||||||
|
|
||||||
|
if (response.body() == null) _buyUltimateResponse.value = false
|
||||||
|
else {
|
||||||
|
val params =
|
||||||
|
"""{'copies':$copies,'id':${response.body()},'labelType':'$labelType','packing':$packing}"""
|
||||||
|
printItem(
|
||||||
|
reportName = reportName,
|
||||||
|
printerFk = printerFk,
|
||||||
|
priority = priority,
|
||||||
|
userFk = userFk,
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun itemShelvingMakeMulti(
|
fun itemShelvingMakeMulti(
|
||||||
shelvingFk: String, items: List<Long>, warehouseFk: Int
|
shelvingFk: String, items: List<Long>, warehouseFk: Int
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -22,7 +22,10 @@ class ItemUbicadorVO(
|
||||||
|
|
||||||
class ItemUbicador(
|
class ItemUbicador(
|
||||||
var item: Long,
|
var item: Long,
|
||||||
var description: String = "",
|
var description: String? = null,
|
||||||
|
var size: Int? = null,
|
||||||
|
var name: String? = null,
|
||||||
|
var longName: String? = null,
|
||||||
var visible: Int = 0,
|
var visible: Int = 0,
|
||||||
var stickers: Int = 0,
|
var stickers: Int = 0,
|
||||||
var packing: Int? = null,
|
var packing: Int? = null,
|
||||||
|
@ -39,7 +42,8 @@ class ItemUbicador(
|
||||||
var isNew: Boolean = false,
|
var isNew: Boolean = false,
|
||||||
var isChecked: Int? = null,
|
var isChecked: Int? = null,
|
||||||
var url: String = "",
|
var url: String = "",
|
||||||
var units: Int = 0
|
var units: Int = 0,
|
||||||
|
var buyFk: Long? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
class ItemEscanerVO(
|
class ItemEscanerVO(
|
||||||
|
|
|
@ -4,7 +4,6 @@ import android.content.Context
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.core.widget.addTextChangedListener
|
import androidx.core.widget.addTextChangedListener
|
||||||
import androidx.lifecycle.lifecycleScope
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentWorkermistakeBinding
|
import es.verdnatura.databinding.FragmentWorkermistakeBinding
|
||||||
|
@ -15,23 +14,19 @@ import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.common.OnMistakeWorkerClickListener
|
import es.verdnatura.presentation.common.OnMistakeWorkerClickListener
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.view.commom.NameWithId
|
||||||
|
import es.verdnatura.presentation.view.commom.SearchableAdapter
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||||
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
||||||
import es.verdnatura.presentation.view.feature.inventario.fragment.SearchDepartmentModel
|
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.adapter.WorkermistakeAdapter
|
import es.verdnatura.presentation.view.feature.workermistake.adapter.WorkermistakeAdapter
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
|
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
||||||
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
|
||||||
class WorkermistakeFragment(
|
class WorkermistakeFragment(
|
||||||
var entryPoint: String = ""
|
var entryPoint: String = ""
|
||||||
|
|
||||||
|
@ -49,7 +44,6 @@ class WorkermistakeFragment(
|
||||||
private var listMistakes: ArrayList<BarcodeVO> = ArrayList()
|
private var listMistakes: ArrayList<BarcodeVO> = ArrayList()
|
||||||
private var listMistakesAdapter: BarcodeAdapter? = null
|
private var listMistakesAdapter: BarcodeAdapter? = null
|
||||||
private var workerMistakeName: WorkerFromMistake? = null
|
private var workerMistakeName: WorkerFromMistake? = null
|
||||||
private val departments = ArrayList<SearchDepartmentModel>()
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = WorkermistakeFragment(entryPoint)
|
fun newInstance(entryPoint: String) = WorkermistakeFragment(entryPoint)
|
||||||
|
@ -83,32 +77,8 @@ class WorkermistakeFragment(
|
||||||
|
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
binding.filterDepartment.setOnClickListener {
|
binding.filterDepartment.setOnClickListener {
|
||||||
SimpleSearchDialogCompat(
|
binding.searchableRecyclerView.visibility = View.VISIBLE
|
||||||
context,
|
binding.searchableRecyclerView.setSearchHint(getString(R.string.departamentSearch))
|
||||||
getString(R.string.departamentos),
|
|
||||||
getString(R.string.escribirparteNombre),
|
|
||||||
null,
|
|
||||||
departments
|
|
||||||
) { baseSearchDialogCompat, nombre, position ->
|
|
||||||
|
|
||||||
binding.filterDepartment.text = (nombre.title)
|
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
DEPARTMENTMISTAKE,
|
|
||||||
nombre.getDepartmentName()
|
|
||||||
)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
DEPARTMENTMISTAKEID,
|
|
||||||
nombre.getDepartmentId()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.workerGetFromHasMistake(
|
|
||||||
nombre.getDepartmentId()
|
|
||||||
)
|
|
||||||
binding.filterItemFk.isEnabled = true
|
|
||||||
baseSearchDialogCompat.dismiss()
|
|
||||||
}.show()
|
|
||||||
}
|
}
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
|
@ -122,6 +92,36 @@ class WorkermistakeFragment(
|
||||||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setSearchable(listNames: MutableList<NameWithId>) {
|
||||||
|
|
||||||
|
val adapter =
|
||||||
|
SearchableAdapter(
|
||||||
|
listElements = listNames,
|
||||||
|
context = requireContext()
|
||||||
|
) { elementSelected ->
|
||||||
|
|
||||||
|
runBlocking {
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
DEPARTMENTMISTAKE,
|
||||||
|
elementSelected.name
|
||||||
|
)
|
||||||
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
DEPARTMENTMISTAKEID,
|
||||||
|
elementSelected.id
|
||||||
|
)
|
||||||
|
viewModel.workerGetFromHasMistake(
|
||||||
|
elementSelected.id
|
||||||
|
)
|
||||||
|
}
|
||||||
|
binding.filterDepartment.text = elementSelected.name
|
||||||
|
binding.searchableRecyclerView.visibility = View.GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.searchableRecyclerView.setAdapter(adapter, listNames)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
ma.onMyBackPressed()
|
ma.onMyBackPressed()
|
||||||
|
@ -151,7 +151,12 @@ class WorkermistakeFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
mistakeDepartmentList.observe(viewLifecycleOwner) {
|
mistakeDepartmentList.observe(viewLifecycleOwner) {
|
||||||
createDepartmentList(it.list)
|
setSearchable(it.list.map { item ->
|
||||||
|
NameWithId(
|
||||||
|
id = item.id,
|
||||||
|
name = item.name
|
||||||
|
)
|
||||||
|
} as MutableList<NameWithId>)
|
||||||
}
|
}
|
||||||
workerFromMistakeList.observe(viewLifecycleOwner) {
|
workerFromMistakeList.observe(viewLifecycleOwner) {
|
||||||
createWorkerList(it.list)
|
createWorkerList(it.list)
|
||||||
|
@ -214,32 +219,20 @@ class WorkermistakeFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createDepartmentList(list: List<DepartmentMistake>) {
|
|
||||||
departments.clear()
|
|
||||||
list.forEach { department ->
|
|
||||||
try {
|
|
||||||
departments.add(SearchDepartmentModel(department.name, department.id))
|
|
||||||
} catch (e: Exception) {
|
|
||||||
e.message!!.toast(requireContext())
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createWorkerList(list: List<WorkerFromMistake>) {
|
private fun createWorkerList(list: List<WorkerFromMistake>) {
|
||||||
listWorker.clear()
|
try {
|
||||||
|
listWorker.apply {
|
||||||
list.forEach { worker ->
|
clear()
|
||||||
try {
|
addAll(list)
|
||||||
listWorker.add(worker)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
e.message!!.toast(requireContext())
|
|
||||||
}
|
}
|
||||||
|
listWorkerAuxiliary.apply {
|
||||||
|
clear()
|
||||||
|
addAll(listWorker)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.message?.toast(requireContext())
|
||||||
}
|
}
|
||||||
listWorkerAuxiliary.clear()
|
|
||||||
listWorkerAuxiliary.addAll(listWorker)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ data class ExpeditionMistakeSalix(
|
||||||
)
|
)
|
||||||
|
|
||||||
data class DepartmentMistake(
|
data class DepartmentMistake(
|
||||||
var id: Int? = null,
|
var id: Int,
|
||||||
var name: String = ""
|
var name: String
|
||||||
)
|
)
|
||||||
|
|
||||||
data class WorkerFromMistake(
|
data class WorkerFromMistake(
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960"
|
||||||
|
android:tint="?attr/colorPrimary">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M200,880Q167,880 143.5,856.5Q120,833 120,800L120,240Q120,207 143.5,183.5Q167,160 200,160L240,160L240,80L320,80L320,160L640,160L640,80L720,80L720,160L760,160Q793,160 816.5,183.5Q840,207 840,240L840,800Q840,833 816.5,856.5Q793,880 760,880L200,880ZM200,800L760,800Q760,800 760,800Q760,800 760,800L760,400L200,400L200,800Q200,800 200,800Q200,800 200,800ZM200,320L760,320L760,240Q760,240 760,240Q760,240 760,240L200,240Q200,240 200,240Q200,240 200,240L200,320ZM200,320L200,240Q200,240 200,240Q200,240 200,240L200,240Q200,240 200,240Q200,240 200,240L200,320ZM480,560Q463,560 451.5,548.5Q440,537 440,520Q440,503 451.5,491.5Q463,480 480,480Q497,480 508.5,491.5Q520,503 520,520Q520,537 508.5,548.5Q497,560 480,560ZM320,560Q303,560 291.5,548.5Q280,537 280,520Q280,503 291.5,491.5Q303,480 320,480Q337,480 348.5,491.5Q360,503 360,520Q360,537 348.5,548.5Q337,560 320,560ZM640,560Q623,560 611.5,548.5Q600,537 600,520Q600,503 611.5,491.5Q623,480 640,480Q657,480 668.5,491.5Q680,503 680,520Q680,537 668.5,548.5Q657,560 640,560ZM480,720Q463,720 451.5,708.5Q440,697 440,680Q440,663 451.5,651.5Q463,640 480,640Q497,640 508.5,651.5Q520,663 520,680Q520,697 508.5,708.5Q497,720 480,720ZM320,720Q303,720 291.5,708.5Q280,697 280,680Q280,663 291.5,651.5Q303,640 320,640Q337,640 348.5,651.5Q360,663 360,680Q360,697 348.5,708.5Q337,720 320,720ZM640,720Q623,720 611.5,708.5Q600,697 600,680Q600,663 611.5,651.5Q623,640 640,640Q657,640 668.5,651.5Q680,663 680,680Q680,697 668.5,708.5Q657,720 640,720Z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="16dp"
|
||||||
|
android:height="16dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M320,550L399,440L569,440L320,244L320,550ZM551,880L406,568L240,800L240,80L800,520L516,520L660,829L551,880ZM399,440L399,440L399,440L399,440Z" />
|
||||||
|
</vector>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="16dp"
|
||||||
|
android:height="16dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/black"
|
||||||
|
android:pathData="M320,550L399,440L569,440L320,244L320,550ZM551,880L406,568L240,800L240,80L800,520L516,520L660,829L551,880ZM399,440L399,440L399,440L399,440Z" />
|
||||||
|
</vector>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960"
|
||||||
|
android:tint="@android:color/white"
|
||||||
|
android:autoMirrored="true">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M200,840Q167,840 143.5,816.5Q120,793 120,760L120,200Q120,167 143.5,143.5Q167,120 200,120L480,120L480,200L200,200Q200,200 200,200Q200,200 200,200L200,760Q200,760 200,760Q200,760 200,760L480,760L480,840L200,840ZM640,680L585,622L687,520L360,520L360,440L687,440L585,338L640,280L840,480L640,680Z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960"
|
||||||
|
android:tint="?attr/colorOnPrimaryFixed">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M280,840L280,597Q280,597 280,597Q280,597 280,597Q192,583 136,515.5Q80,448 80,360Q80,260 150,190Q220,120 320,120Q408,120 475.5,176Q543,232 557,320Q557,320 557,320Q557,320 557,320L727,320L664,256L720,200L880,360L720,520L663,464L727,400L556,400Q527,400 505,381Q483,362 478,333Q468,275 423.5,237.5Q379,200 320,200Q254,200 207,247Q160,294 160,360Q160,419 197.5,463.5Q235,508 293,518Q322,523 341,545Q360,567 360,596L360,840L280,840Z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960"
|
||||||
|
android:tint="?attr/colorPrimary">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M521,82Q664,96 764.5,196.5Q865,297 879,440L593,440Q584,414 565.5,394.5Q547,375 521,366L521,82ZM601,184L601,320Q612,329 622,339Q632,349 641,360L777,360Q753,300 707,254Q661,208 601,184ZM441,82L441,366Q405,379 383,410.5Q361,442 361,480Q361,518 383,548.5Q405,579 441,592L441,878Q287,863 184,749Q81,635 81,480Q81,325 184,211Q287,97 441,82ZM361,184Q270,219 215.5,300Q161,381 161,480Q161,579 215.5,660Q270,741 361,778L361,640Q323,611 302,569.5Q281,528 281,480Q281,432 302,390.5Q323,349 361,320L361,184ZM593,520L879,520Q865,663 764.5,763.5Q664,864 521,878L521,592Q547,583 565.5,564.5Q584,546 593,520ZM641,600Q633,611 622.5,621Q612,631 601,640L601,776Q661,752 707,706Q753,660 777,600L641,600ZM281,481L281,481Q281,481 281,481Q281,481 281,481Q281,481 281,481Q281,481 281,481L281,481Q281,481 281,481Q281,481 281,481Q281,481 281,481Q281,481 281,481ZM641,360Q641,360 641,360Q641,360 641,360L641,360Q641,360 641,360Q641,360 641,360ZM641,600L641,600Q641,600 641,600Q641,600 641,600L641,600Q641,600 641,600Q641,600 641,600Z"/>
|
||||||
|
</vector>
|
|
@ -11,24 +11,24 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="@dimen/default_layout_margin"
|
|
||||||
android:descendantFocusability="beforeDescendants"
|
android:descendantFocusability="beforeDescendants"
|
||||||
android:focusableInTouchMode="true">
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/default_layout_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/custom_dialog_title"
|
android:id="@+id/custom_dialog_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/layout_margin_1"
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
android:layout_marginBottom="@dimen/layout_margin_min"
|
android:layout_marginBottom="@dimen/layout_margin_min"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/h6"
|
android:textSize="@dimen/h6"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="¿Estás seguro de que deseas eliminar el dispositivo de celia?"
|
tools:text="¿Estás seguro de que deseas eliminar el dispositivo de celia?"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/custom_dialog_description"
|
android:id="@+id/custom_dialog_description"
|
||||||
|
@ -44,13 +44,12 @@
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/textinputlayout_username"
|
android:id="@+id/textinputlayout_username"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColorHint="@android:color/darker_gray"
|
android:layout_marginTop="@dimen/layout_margin_min"
|
||||||
android:layout_marginTop="@dimen/layout_margin_min">
|
android:textColorHint="@android:color/darker_gray">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/custom_dialog_value"
|
android:id="@+id/custom_dialog_value"
|
||||||
|
@ -61,7 +60,28 @@
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textColorHint="@android:color/darker_gray"/>
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/textinputlayout_three"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/layout_margin_min"
|
||||||
|
android:textColorHint="@android:color/darker_gray"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/custom_dialog_value_three"
|
||||||
|
style="@style/DefaultButton.TransparentButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:inputType="text"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,9 +89,10 @@
|
||||||
android:id="@+id/textinputlayout_two"
|
android:id="@+id/textinputlayout_two"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColorHint="@android:color/darker_gray"
|
|
||||||
android:layout_marginTop="@dimen/layout_margin_min"
|
android:layout_marginTop="@dimen/layout_margin_min"
|
||||||
|
android:textColorHint="@android:color/darker_gray"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/custom_dialog_value_two"
|
android:id="@+id/custom_dialog_value_two"
|
||||||
style="@style/InputLineTextSearch"
|
style="@style/InputLineTextSearch"
|
||||||
|
@ -90,7 +111,7 @@
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
tools:listitem="@layout/item_barcode_row"/>
|
tools:listitem="@layout/item_barcode_row" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/custom_dialog_button_ok"
|
android:id="@+id/custom_dialog_button_ok"
|
||||||
|
@ -101,6 +122,15 @@
|
||||||
tools:text="@string/delete"
|
tools:text="@string/delete"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/custom_dialog_button_ok_two"
|
||||||
|
style="@style/DefaultButton.NormalButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/default_layout_margin"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="@string/delete"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/custom_dialog_button_ko"
|
android:id="@+id/custom_dialog_button_ko"
|
||||||
style="@style/DefaultButton.TransparentButton"
|
style="@style/DefaultButton.TransparentButton"
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SearchView
|
||||||
|
android:id="@+id/search_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:queryHint="Buscar..."
|
||||||
|
android:text=""
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_viewer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:visibility="visible" />
|
||||||
|
</LinearLayout>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SearchView
|
||||||
|
android:id="@+id/search_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_viewer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</es.verdnatura.presentation.view.commom.SearchableRecyclerView>
|
|
@ -21,139 +21,44 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="@color/verdnatura_white"
|
android:background="@color/verdnatura_white"
|
||||||
app:layout_constraintTop_toBottomOf="@id/main_toolbar"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintTop_toBottomOf="@id/main_toolbar" />
|
||||||
|
|
||||||
<!-- RecyclerView en la parte superior -->
|
<!-- RecyclerView en la parte superior -->
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/setttings_items"
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="@dimen/toolbar_height"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/setttings_items"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
|
<!-- Contenedor de los demás datos debajo del RecyclerView -->
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView
|
||||||
|
android:id="@+id/searchableRecyclerView"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toBottomOf="@id/divider"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/scrollView"
|
|
||||||
app:layout_constraintVertical_bias="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- Contenedor de los demás datos debajo del RecyclerView -->
|
|
||||||
<ScrollView
|
|
||||||
android:id="@+id/scrollView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/setttings_items"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="@dimen/navigation_row_min_padding"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toTopOf="@id/main_toolbar"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/setttings_items"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
>
|
app:layout_constraintTop_toBottomOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
<!-- Resto de los elementos, como versiones, usuarios, etc. -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="150dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="@dimen/default_layout_margin"
|
|
||||||
android:text="@string/version"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/item_version"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/default_layout_margin"
|
|
||||||
android:text=""
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="150dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="@dimen/default_layout_margin"
|
|
||||||
android:text="@string/user"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/user_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/default_layout_margin"
|
|
||||||
android:text=""
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="150dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="@dimen/default_layout_margin"
|
|
||||||
android:text="@string/Androidid"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/androidid_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/default_layout_margin"
|
|
||||||
android:text=""
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1"
|
|
||||||
android:tooltipText="@string/copied" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="150dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="@dimen/default_layout_margin"
|
|
||||||
android:text="@string/serialNumber"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/serial_number"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/default_layout_margin"
|
|
||||||
android:text=""
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="@dimen/body1" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Splash progress en el centro de la pantalla -->
|
<!-- Splash progress en el centro de la pantalla -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -163,7 +68,7 @@
|
||||||
android:background="@color/verdnatura_black_8_alpha_6"
|
android:background="@color/verdnatura_black_8_alpha_6"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
android:textColor="@color/verdnatura_pumpkin_orange"
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
android:textColorHint="#78909C"
|
android:textColorHint="#78909C"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
tools:ignore="TextContrastCheck"
|
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp"
|
||||||
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp" />
|
tools:ignore="TextContrastCheck" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -111,9 +111,19 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
tools:listitem="@layout/item_inventary_row" />
|
tools:listitem="@layout/item_inventary_row" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView
|
||||||
|
android:id="@+id/searchableRecyclerView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/main_toolbar"
|
android:id="@+id/main_toolbar"
|
||||||
layout="@layout/toolbar_fragment"
|
layout="@layout/toolbar_fragment"
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:backgroundTint="@android:color/white"
|
android:backgroundTint="@android:color/white"
|
||||||
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp"
|
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:hint="@string/suppliers"
|
android:hint="@string/suppliers"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
|
@ -57,7 +56,8 @@
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/verdnatura_pumpkin_orange"
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
android:textColorHint="@android:color/darker_gray"
|
android:textColorHint="@android:color/darker_gray"
|
||||||
android:visibility="visible" />
|
android:visibility="visible"
|
||||||
|
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -73,10 +73,9 @@
|
||||||
android:id="@+id/filter_entry"
|
android:id="@+id/filter_entry"
|
||||||
style="@style/InputLineTextSearch"
|
style="@style/InputLineTextSearch"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:backgroundTint="@android:color/white"
|
android:backgroundTint="@android:color/white"
|
||||||
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp"
|
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:hint="@string/entry"
|
android:hint="@string/entry"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
|
@ -84,11 +83,34 @@
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/verdnatura_pumpkin_orange"
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
android:textColorHint="@android:color/darker_gray"
|
android:textColorHint="@android:color/darker_gray"
|
||||||
android:visibility="invisible" />
|
android:visibility="invisible"
|
||||||
|
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView
|
||||||
|
android:id="@+id/searchableSuplierRecyclerView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView
|
||||||
|
android:id="@+id/searchableEntriesRecyclerView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/main_toolbar"
|
android:id="@+id/main_toolbar"
|
||||||
layout="@layout/toolbar_fragment"
|
layout="@layout/toolbar_fragment"
|
||||||
|
@ -96,5 +118,5 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
@ -8,228 +7,227 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView20"
|
android:id="@+id/textView20"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:text="@string/km"
|
android:text="@string/km"
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView28"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:text="@string/hours"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="18sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1.0"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout7" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout2"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView20" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout6"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView2"
|
android:id="@+id/textView28"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_marginStart="8dp"
|
||||||
android:text="@string/km_init"
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:text="@string/hours"
|
||||||
|
android:textAllCaps="true"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="1.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout7" />
|
||||||
|
|
||||||
<EditText
|
<LinearLayout
|
||||||
android:id="@+id/editText"
|
android:id="@+id/linearLayout2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView20" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout6"
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_marginStart="8dp"
|
||||||
android:background="@color/verdnatura_white"
|
android:layout_marginTop="8dp"
|
||||||
android:ems="10"
|
android:layout_marginEnd="8dp"
|
||||||
android:autofillHints="phone"
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/km_init"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autofillHints="phone"
|
||||||
|
android:background="@color/verdnatura_white"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/zero"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="number"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="@string/zero" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout7"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:padding="5dp"
|
android:orientation="horizontal"
|
||||||
android:text="@string/zero"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:hint="@string/zero"
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
android:imeOptions="actionDone"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:maxLines="1"/>
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout6">
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:id="@+id/linearLayout7"
|
android:id="@+id/textView21"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_weight="1"
|
||||||
android:layout_marginTop="8dp"
|
android:text="@string/km_end"
|
||||||
android:layout_marginEnd="8dp"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:orientation="horizontal"
|
android:textSize="18sp" />
|
||||||
android:inputType="number"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout6">
|
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editText1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autofillHints="phone"
|
||||||
|
android:background="@color/verdnatura_white"
|
||||||
|
android:ems="10"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="number"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="@string/zero" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout8"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView28" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout9"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout8">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView212"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/hour_start"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editText12"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autofillHints="text"
|
||||||
|
android:background="@color/verdnatura_white"
|
||||||
|
android:ems="10"
|
||||||
|
android:focusable="false"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="@string/zeroHour" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout9">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2123"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
|
||||||
|
android:text="@string/hour_end"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editText123"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autofillHints="text"
|
||||||
|
android:background="@color/verdnatura_white"
|
||||||
|
android:ems="10"
|
||||||
|
android:focusable="false"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="@string/zeroHour" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView21"
|
android:id="@+id/textView37"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_marginBottom="17dp"
|
||||||
android:text="@string/km_end"
|
android:text="@string/save"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textAlignment="center"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
<EditText
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:id="@+id/editText1"
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@color/verdnatura_white"
|
|
||||||
android:ems="10"
|
|
||||||
android:autofillHints="phone"
|
|
||||||
android:inputType="number"
|
|
||||||
android:padding="5dp"
|
|
||||||
android:text="@string/zero"
|
|
||||||
android:imeOptions="actionDone"
|
|
||||||
android:maxLines="1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout8"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView28" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout9"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout8">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView212"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
|
|
||||||
android:text="@string/hour_start"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/editText12"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@color/verdnatura_white"
|
|
||||||
android:ems="10"
|
|
||||||
android:padding="5dp"
|
|
||||||
android:inputType="text"
|
|
||||||
android:autofillHints="text"
|
|
||||||
android:text="@string/zeroHour"
|
|
||||||
android:imeOptions="actionDone"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:focusable="false"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout9">
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView2123"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
|
|
||||||
android:text="@string/hour_end"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/editText123"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@color/verdnatura_white"
|
|
||||||
android:ems="10"
|
|
||||||
android:padding="5dp"
|
|
||||||
android:text="@string/zeroHour"
|
|
||||||
android:imeOptions="actionDone"
|
|
||||||
android:inputType="text"
|
|
||||||
android:autofillHints="text"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:focusable="false"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView37"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="17dp"
|
|
||||||
android:text="@string/save"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="18sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?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:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="@dimen/toolbar_height"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/textinputlayout_username"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColorHint="@android:color/darker_gray">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/date"
|
||||||
|
style="@style/InputLineTextSearch"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:drawableEnd="@drawable/ic_calendar"
|
||||||
|
android:gravity="center"
|
||||||
|
android:hint="@string/Fecha"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/layout_margin_min"
|
||||||
|
android:layout_marginBottom="@dimen/layout_margin_1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="@dimen/layout_margin_min"
|
||||||
|
android:paddingEnd="@dimen/layout_margin_min">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/complement"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/body2" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/salaryComplementRecyclerview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
tools:listitem="@layout/item_salary_complement_row" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView
|
||||||
|
android:id="@+id/salarySearchableRecyclerView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/main_toolbar"
|
||||||
|
layout="@layout/toolbar_fragment"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
|
@ -101,6 +101,7 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/workermistake_recyclerview"
|
android:id="@+id/workermistake_recyclerview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -110,6 +111,17 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView
|
||||||
|
android:id="@+id/searchableRecyclerView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/main_toolbar"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/main_toolbar"
|
android:id="@+id/main_toolbar"
|
||||||
layout="@layout/toolbar_fragment"
|
layout="@layout/toolbar_fragment"
|
||||||
|
|
|
@ -50,16 +50,17 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
|
||||||
android:text="@string/Nivel"
|
android:text="@string/Nivel"
|
||||||
android:textColor="@color/verdnatura_black"
|
android:textColor="@color/verdnatura_black"
|
||||||
android:textSize="@dimen/h8" />
|
android:textSize="@dimen/h9" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/level"
|
android:id="@+id/level"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:text="@{sale.level}"
|
android:text="@{sale.level}"
|
||||||
android:textColor="@color/verdnatura_black"
|
android:textColor="@color/verdnatura_black"
|
||||||
android:textSize="@dimen/h8"
|
android:textSize="@dimen/h8"
|
||||||
|
@ -69,10 +70,9 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
|
||||||
android:text="@string/Ticket"
|
android:text="@string/Ticket"
|
||||||
android:textColor="@color/verdnatura_black"
|
android:textColor="@color/verdnatura_black"
|
||||||
android:textSize="@dimen/h8" />
|
android:textSize="@dimen/h9" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ticketFk"
|
android:id="@+id/ticketFk"
|
||||||
|
@ -81,10 +81,18 @@
|
||||||
android:text="@{sale.ticketFk}"
|
android:text="@{sale.ticketFk}"
|
||||||
android:textColor="@color/verdnatura_black"
|
android:textColor="@color/verdnatura_black"
|
||||||
android:textSize="@dimen/h8"
|
android:textSize="@dimen/h8"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold" />
|
||||||
tool:text="123456789"
|
<!-- app:drawableEndCompat="@drawable/ic_click_black"-->
|
||||||
|
|
||||||
/>
|
<TextView
|
||||||
|
android:id="@+id/parkingCode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text='@{String.format("(%s)", sale.parkingCode)}'
|
||||||
|
android:textColor="@color/verdnatura_black"
|
||||||
|
android:textSize="@dimen/caption"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -184,7 +192,6 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/layout_margin_min_to_modify"
|
android:layout_marginStart="@dimen/layout_margin_min_to_modify"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="@{Long.toString(sale.itemFk)}"
|
android:text="@{Long.toString(sale.itemFk)}"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
|
@ -193,7 +200,7 @@
|
||||||
app:layout_constraintStart_toEndOf="@+id/linearLayout3"
|
app:layout_constraintStart_toEndOf="@+id/linearLayout3"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tool:text="85478" />
|
tool:text="85478" />
|
||||||
|
<!--app:drawableEndCompat="@drawable/ic_click"-->
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_article_quantity_pickedOld"
|
android:id="@+id/item_article_quantity_pickedOld"
|
||||||
|
@ -440,7 +447,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/verdnatura_background_item_picker"
|
android:background="@color/verdnatura_background_item_picker"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
|
|
||||||
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
tools:listitem="@layout/item_placement_row"
|
tools:listitem="@layout/item_placement_row"
|
||||||
tools:orientation="horizontal" />
|
tools:orientation="horizontal" />
|
||||||
|
|
|
@ -14,17 +14,16 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="@dimen/ef_padding_small"
|
android:padding="@dimen/ef_padding_small">
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/expeditionDivider"
|
android:id="@+id/expeditionDivider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="@color/verdnatura_white"
|
android:background="@color/verdnatura_white"
|
||||||
android:orientation="horizontal" />
|
android:orientation="horizontal" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/expeditionConsign"
|
android:id="@+id/expeditionConsign"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -84,6 +83,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/expeditionViewAdress"
|
android:id="@+id/expeditionViewAdress"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
android:id="@+id/itemStreet"
|
android:id="@+id/itemStreet"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="4"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:text="@{item.street + ` - ` + item.city + ` - ` + String.valueOf(item.postalCode)}"
|
android:text="@{item.street + ` - ` + item.city + ` - ` + String.valueOf(item.postalCode)}"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
|
@ -103,6 +103,24 @@
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/scanOrderLabel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Orden:"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/delivery_body_2" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/scanOrderTxt"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{String.valueOf(item.scanOrder)}"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/delivery_body_2" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,63 +8,67 @@
|
||||||
name="item"
|
name="item"
|
||||||
type="es.verdnatura.presentation.view.feature.sacador.model.PlacementVO" />
|
type="es.verdnatura.presentation.view.feature.sacador.model.PlacementVO" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/item_root_layout"
|
android:id="@+id/item_root_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="@dimen/layout_margin_1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"
|
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||||
android:background="@color/verdnatura_background_item_picker">
|
android:background="@color/verdnatura_background_item_picker"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/layout_margin_1">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{item.placement}"
|
|
||||||
tool:text="053-05"
|
|
||||||
android:textColor="@color/verdnatura_pumpkin_orange"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textSize="@dimen/h7"
|
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{item.shelving}"
|
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||||
tool:text="YIC"
|
android:text="@{item.placement}"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
|
android:textSize="@dimen/h7"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textSize="@dimen/h8"/>
|
tool:text="053-05" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/placementcode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{item.shelving}"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textSize="@dimen/h8"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:text="YIC" />
|
||||||
|
<!-- app:drawableEndCompat="@drawable/ic_click"-->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/layout_margin_min"
|
||||||
android:text="@{item.created}"
|
android:text="@{item.created}"
|
||||||
tool:text="28/05 "
|
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/h8"
|
android:textSize="@dimen/h8"
|
||||||
android:layout_marginEnd="@dimen/layout_margin_min"/>
|
tool:text="28/05 " />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{item.visible}"
|
android:text="@{item.visible}"
|
||||||
tool:text="260"
|
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/h8"/>
|
android:textSize="@dimen/h8"
|
||||||
|
tool:text="260" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?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="item"
|
||||||
|
type="es.verdnatura.presentation.view.feature.delivery.model.RouteComplement" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/verdnatura_black_5"
|
||||||
|
android:paddingStart="@dimen/pasilleros_margin_main_picker"
|
||||||
|
android:paddingTop="@dimen/pasilleros_margin_main_menu"
|
||||||
|
android:paddingEnd="@dimen/pasilleros_margin_main_picker"
|
||||||
|
android:paddingBottom="@dimen/pasilleros_margin_main_menu">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_date"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1.75"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@{item.dated}"
|
||||||
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
|
android:textSize="@dimen/row"
|
||||||
|
tool:text="6-11-2024" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_complement"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@{item.routeAction.name}"
|
||||||
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
|
android:textSize="@dimen/row"
|
||||||
|
tool:text="de la Torre Nebot" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_prize"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@{String.valueOf(item.price)}"
|
||||||
|
android:textColor="@color/verdnatura_pumpkin_orange"
|
||||||
|
android:textSize="@dimen/row"
|
||||||
|
android:visibility="gone"
|
||||||
|
tool:text="30" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageDelete"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:contentDescription="@string/error"
|
||||||
|
android:gravity="center"
|
||||||
|
app:srcCompat="@drawable/ic_delete_black_24dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
|
@ -448,6 +448,18 @@
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
tool:text="Cantidad original 100" />
|
tool:text="Cantidad original 100" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/addItem"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/verdnatura_red"
|
||||||
|
android:gravity="end"
|
||||||
|
android:src="@drawable/ic_add_black_24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/delete_reserve"
|
android:id="@+id/delete_reserve"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -456,7 +468,7 @@
|
||||||
android:background="@color/verdnatura_red"
|
android:background="@color/verdnatura_red"
|
||||||
android:gravity="end"
|
android:gravity="end"
|
||||||
android:src="@drawable/ic_delete_black_24dp"
|
android:src="@drawable/ic_delete_black_24dp"
|
||||||
android:visibility="invisible"
|
android:visibility="gone"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<es.verdnatura.presentation.view.commom.SearchableRecyclerView
|
||||||
|
android:id="@+id/searchable_recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="8dp" />
|
||||||
|
</LinearLayout>
|
|
@ -9,7 +9,7 @@
|
||||||
<string name="Pallet">Pallet</string>
|
<string name="Pallet">Pallet</string>
|
||||||
<string name="Ruta">Ruta</string>
|
<string name="Ruta">Ruta</string>
|
||||||
<string name="Cajas">Cajas</string>
|
<string name="Cajas">Cajas</string>
|
||||||
<string name="Nivel">Niv:</string>
|
<string name="Nivel">N:</string>
|
||||||
<string name="de">de</string>
|
<string name="de">de</string>
|
||||||
<string name="Ticket">T:</string>
|
<string name="Ticket">T:</string>
|
||||||
<string name="Concepto">Concepto</string>
|
<string name="Concepto">Concepto</string>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<string name="BasuraRechazar">Basura</string>
|
<string name="BasuraRechazar">Basura</string>
|
||||||
<string name="Indicanuevacantidad">Indica nueva cantidad</string>
|
<string name="Indicanuevacantidad">Indica nueva cantidad</string>
|
||||||
<string name="packingQuantity">Indica nuevo packing para el item :</string>
|
<string name="packingQuantity">Indica nuevo packing para el item :</string>
|
||||||
<string name="Coleccióncompleta">Colección completa</string>
|
<string name="completCollection">Colección completa</string>
|
||||||
<string name="Parking">Parking</string>
|
<string name="Parking">Parking</string>
|
||||||
<string name="Reject">Rechazar</string>
|
<string name="Reject">Rechazar</string>
|
||||||
<string name="cmrError">No se ha podido asociar el pallet al CMR.</string>
|
<string name="cmrError">No se ha podido asociar el pallet al CMR.</string>
|
||||||
|
@ -728,6 +728,7 @@
|
||||||
<string name="m3">m3</string>
|
<string name="m3">m3</string>
|
||||||
<string name="options">Opciones</string>
|
<string name="options">Opciones</string>
|
||||||
<string name="hourMinute">%1$d:%2$d</string>
|
<string name="hourMinute">%1$d:%2$d</string>
|
||||||
|
<string name="dateDay">%1$02d-%2$02d-%3$04d</string>
|
||||||
<string name="level">Nivel:</string>
|
<string name="level">Nivel:</string>
|
||||||
<string name="ticketAbb">-T:</string>
|
<string name="ticketAbb">-T:</string>
|
||||||
<string name="signPackaging">Firma:</string>
|
<string name="signPackaging">Firma:</string>
|
||||||
|
@ -882,6 +883,32 @@
|
||||||
<string name="deleteExpedition">Borrar expedición</string>
|
<string name="deleteExpedition">Borrar expedición</string>
|
||||||
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
||||||
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
||||||
|
<string name="indicateQuantity">Indica la cantidad</string>
|
||||||
|
<string name="addItemQuantity">El artículo: %1$s va a ser añadido con la siguiente cantidad:</string>
|
||||||
|
<string name="errorPrintBuy">El artículo no se puede imprimir. No se ha obtenido el código de compra(buy)</string>
|
||||||
|
<string name="itemName">Artículo %1$d : %2$s</string>
|
||||||
|
<string name="printQr">Imprimir QR</string>
|
||||||
|
<string name="printBarcode">Imprimir BARCODE</string>
|
||||||
|
<string name="labelNumber">Indica número de etiquetas</string>
|
||||||
|
<string name="optionalPacking">Packing(opcional)</string>
|
||||||
|
<string name="holdpositionAuto">Al revisar desplazar:</string>
|
||||||
|
<string name="parkingIn">Aparcado en %1$s</string>
|
||||||
|
<string name="filterLevelColor">Al pulsar filtras o no la lista por el color del nivel</string>
|
||||||
|
<string name="salarySupplementTitle">Complementos salariales reparto</string>
|
||||||
|
<string name="complement">Tus complementos:</string>
|
||||||
|
<string name="supplementDelivery">Complementos reparto</string>
|
||||||
|
<string name="moveExpedition">Mueve expedición/es a otra ruta</string>
|
||||||
|
<string name="boxScanned">Caja ya escaneada</string>
|
||||||
|
<string name="selectRoute">Selecciona ruta destino</string>
|
||||||
|
<string name="moveToRoute">Mover a nueva ruta</string>
|
||||||
|
<string name="scanExpeditionForMove">Escanea la/s caja/s que cambia/n de ruta</string>
|
||||||
|
<string name="ticketPickup">Ticket de recogida</string>
|
||||||
|
<string name="ticketPickupDescr">El ticket %1$s van a pasar a recogerlo</string>
|
||||||
|
<string name="departamentSearch">Escribe departamento</string>
|
||||||
|
<string name="BuyerSearch">Escribe comprador</string>
|
||||||
|
<string name="sectorSearch">Escribe sector</string>
|
||||||
|
<string name="supplierSearch">Escribe proveedor</string>
|
||||||
|
<string name="entrySearch">Escribe entrada</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<string name="Pallet">Pallet</string>
|
<string name="Pallet">Pallet</string>
|
||||||
<string name="Ruta">Route</string>
|
<string name="Ruta">Route</string>
|
||||||
<string name="Cajas">Cajas</string>
|
<string name="Cajas">Cajas</string>
|
||||||
<string name="Nivel">Niv:</string>
|
<string name="Nivel">N:</string>
|
||||||
<string name="de">de</string>
|
<string name="de">de</string>
|
||||||
<string name="Ticket">T:</string>
|
<string name="Ticket">T:</string>
|
||||||
<string name="Concepto">Concepto</string>
|
<string name="Concepto">Concepto</string>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<string name="BasuraRechazar">Basura</string>
|
<string name="BasuraRechazar">Basura</string>
|
||||||
<string name="Indicanuevacantidad">Indica nueva cantidad</string>
|
<string name="Indicanuevacantidad">Indica nueva cantidad</string>
|
||||||
<string name="packingQuantity">Indica nuevo packing para el item :</string>
|
<string name="packingQuantity">Indica nuevo packing para el item :</string>
|
||||||
<string name="Coleccióncompleta">Colección completa</string>
|
<string name="completCollection">Colección completa</string>
|
||||||
<string name="Parking">Parking</string>
|
<string name="Parking">Parking</string>
|
||||||
<string name="Reject">Rechazar</string>
|
<string name="Reject">Rechazar</string>
|
||||||
<string name="cmrError">No se ha podido asociar el pallet al CMR.</string>
|
<string name="cmrError">No se ha podido asociar el pallet al CMR.</string>
|
||||||
|
@ -728,6 +728,7 @@
|
||||||
<string name="m3">m3</string>
|
<string name="m3">m3</string>
|
||||||
<string name="options">Opciones</string>
|
<string name="options">Opciones</string>
|
||||||
<string name="hourMinute">%1$d:%2$d</string>
|
<string name="hourMinute">%1$d:%2$d</string>
|
||||||
|
<string name="dateDay">%1$02d-%2$02d-%3$04d</string>
|
||||||
<string name="level">Nivel:</string>
|
<string name="level">Nivel:</string>
|
||||||
<string name="ticketAbb">-T:</string>
|
<string name="ticketAbb">-T:</string>
|
||||||
<string name="signPackaging">Firma:</string>
|
<string name="signPackaging">Firma:</string>
|
||||||
|
@ -882,5 +883,31 @@
|
||||||
<string name="deleteExpedition">Borrar expedición</string>
|
<string name="deleteExpedition">Borrar expedición</string>
|
||||||
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
<string name="deleleExpeditionDescrip">Borrar expedición de reparto ,MRW o ViaExpress</string>
|
||||||
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
<string name="errorBoxpicking">Caja preparada no válida.</string>
|
||||||
|
<string name="indicateQuantity">Indica la cantidad</string>
|
||||||
|
<string name="addItemQuantity">El artículo: %1$s va a ser añadido con la siguiente cantidad:</string>
|
||||||
|
<string name="errorPrintBuy">El artículo no se puede imprimir. No se ha obtenido el código de compra(buy)</string>
|
||||||
|
<string name="itemName">Artículo %1$d : %2$s</string>
|
||||||
|
<string name="printQr">Imprimir QR</string>
|
||||||
|
<string name="printBarcode">Imprimir BARCODE</string>
|
||||||
|
<string name="labelNumber">Indica número de etiquetas</string>
|
||||||
|
<string name="optionalPacking">Packing(opcional)</string>
|
||||||
|
<string name="holdpositionAuto">Al revisar desplazar:</string>
|
||||||
|
<string name="parkingIn">Aparcado en %1$s</string>
|
||||||
|
<string name="filterLevelColor">Al pulsar filtras o no la lista por color del nivel</string>
|
||||||
|
<string name="salarySupplementTitle">Complementos salariales reparto</string>
|
||||||
|
<string name="complement">Tus complementos:</string>
|
||||||
|
<string name="supplementDelivery">Complementos reparto</string>
|
||||||
|
<string name="moveExpedition">Mueve expedición/es a otra ruta</string>
|
||||||
|
<string name="boxScanned">Caja ya escaneada</string>
|
||||||
|
<string name="selectRoute">Selecciona ruta destino</string>
|
||||||
|
<string name="moveToRoute">Mover a nueva ruta</string>
|
||||||
|
<string name="scanExpeditionForMove">Escanea la/s caja/s que cambia/n de ruta</string>
|
||||||
|
<string name="ticketPickup">Ticket de recogida</string>
|
||||||
|
<string name="ticketPickupDescr">El ticket %1$s van a pasar a recogerlo</string>
|
||||||
|
<string name="departamentSearch">Escribe departamento</string>
|
||||||
|
<string name="BuyerSearch">Escribe comprador</string>
|
||||||
|
<string name="sectorSearch">Escribe sector</string>
|
||||||
|
<string name="supplierSearch">Escribe proveedor</string>
|
||||||
|
<string name="entrySearch">Escribe entrada</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue