refs #3520 feat:refactorSilex→Salix

This commit is contained in:
Sergio De la torre 2024-05-07 12:20:38 +02:00
parent 643d2dd994
commit 51d5bcf6ae
118 changed files with 1388 additions and 3233 deletions

View File

@ -49,6 +49,72 @@
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/component_custom_edit_dialog_three_values.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_automatic_add_item.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_collection.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_expedition_log_delivery.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_expedition_summary.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_info_delivery.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_item_card.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_route.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_sacador.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/fragment_tickets.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_article_row_fragment.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_collection_row.xml">
<config>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_expedition_summary_row.xml">
<config>
<state>Landscape</state>
<theme>@style/AppTheme</theme>
</config>
</layout>
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_expeditionpallet_row.xml">
<config>
<theme>@style/AppTheme</theme>
@ -116,15 +182,130 @@
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #6607 feat:checking_boxes">
<change afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivityViewModel.kt" afterDir="false" />
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #7278 feat:newUI SummaryFragment">
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.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/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/beta/release/output-metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/app/beta/release/output-metadata.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/dataStore/DataStoreLocal.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/dataStore/DataStoreLocal.kt" 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/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/ConstAndValues.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/ConstAndValues.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/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/UIExtensions.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/UIExtensions.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogInputThreeValues.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogInputThreeValues.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogList.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialogList.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/ajustes/fragment/AjustesViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/model/AjustesItemVO.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/articulo/fragment/ItemProposalFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemProposalFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemCardVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemCardVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemPackingType.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemPackingType.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemProposal.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/model/ItemProposal.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.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/buscaritem/fragment/BuscarItemFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/model/BuyerVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/model/BuyerVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimFragment.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/claim/fragment/ClaimViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ubication/ClaimViewModel.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/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/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/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/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/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/ShowTicketFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.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/controlador/fragment/ControladorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorViewModel.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/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.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/adapters/ExpeditionSummaryAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/adapters/ExpeditionSummaryAdapter.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/InfoFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/InfoFragment.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/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/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/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/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/diadeventa/fragment/DayOfSaleFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.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/historicoarticulo/model/ItemHistoricoVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/model/ItemHistoricoVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.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/historicoshelvinglog/model/ShelvingLog.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/model/ShelvingLog.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.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/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/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/inventario/model/ItemInventaryVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/model/ItemInventaryVO.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/login/model/WorkForms.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/model/WorkForms.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/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/PackagingSummaryFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingSummaryFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingViewModel/SupplierViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingViewModel/SupplierViewModel.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/packingHolland/fragment/PackingHollandViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packingHolland/fragment/PackingHollandViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/CmrExpeditionPalletViewModel.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/ExpeditionStateFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateViewModel.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/fragment/PalletScanFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanViewModel.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/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/pasillero/fragment/PasilleroFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroFragment.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/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/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/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/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/reubication/fragment/ReubicationCollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/reubication/fragment/ReubicationCollectionFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/fragment/ReubicationFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/reubication/fragment/ReubicationFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/reubication/model/Reubication.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/reubication/model/Reubication.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragment.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/sacador/fragment/showticket/ShowTicketViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/mapper/SacadoresMapper.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/mapper/SacadoresMapper.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/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/smarttag/model/SmartTag.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/model/SmartTag.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ticket/fragment/TicketAdvanceFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ticket/fragment/TicketAdvanceFragment.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/AutomaticAddItemFragmentOld.kt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt" beforeDir="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/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$/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/layout/item_article_row_fragment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_article_row_fragment.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_article_row_reubication_fragment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_article_row_reubication_fragment.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_collection_row.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_collection_row.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_placement_reubication_row.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_placement_reubication_row.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_route_row.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_route_row.xml" 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/dimens.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/dimens.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>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -138,7 +319,7 @@
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[21114523025303]" />
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[23208524700332]" />
<component name="ExportToHTMLSettings">
<option name="OPEN_IN_BROWSER" value="true" />
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
@ -230,7 +411,7 @@
</option>
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="dev_updateAGP" />
<entry key="$PROJECT_DIR$" value="testBeta" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
@ -275,6 +456,10 @@
<option name="selectedTabId" value="CurrentFile" />
<option name="sortByName" value="true" />
</component>
<component name="ProjectColorInfo">{
&quot;customColor&quot;: &quot;&quot;,
&quot;associatedIndex&quot;: 3
}</component>
<component name="ProjectId" id="1rNnmCWH3aNvnQwcp2vPrEIlvP2" />
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
@ -300,8 +485,9 @@
&quot;android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/view/View.java_SELECTED&quot;: &quot;View&quot;,
&quot;android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/CompoundButton.java_SELECTED&quot;: &quot;CompoundButton&quot;,
&quot;android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/TextView.java_SELECTED&quot;: &quot;TextView&quot;,
&quot;cf.first.check.clang-format&quot;: &quot;false&quot;,
&quot;cidr.known.project.marker&quot;: &quot;true&quot;,
&quot;com.developerphil.adbidea.selecteddevices&quot;: &quot;21114523025303&quot;,
&quot;com.developerphil.adbidea.selecteddevices&quot;: &quot;23086B3FFD&quot;,
&quot;com.google.services.firebase.aqiPopupShown&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;dev&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout&quot;,
@ -309,7 +495,7 @@
&quot;project.structure.proportion&quot;: &quot;0.17&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
&quot;run.code.analysis.last.selected.profile&quot;: &quot;pProject Default&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;
&quot;settings.editor.selected.configurable&quot;: &quot;device.mirroring&quot;
},
&quot;keyToStringList&quot;: {
&quot;ExportApk.BuildVariants&quot;: [
@ -345,11 +531,11 @@
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\font" />
</key>
<key name="MoveKotlinTopLevelDeclarationsDialog.RECENTS_KEY">
<recent name="es.verdnatura.presentation.view.feature.claim.fragment.ubication" />
<recent name="es.verdnatura.presentation.view.feature.packingHolland.fragment" />
<recent name="es.verdnatura.presentation.view.feature.packaging.fragment.SupplierViewModel" />
<recent name="es.verdnatura.presentation.view.feature.workermistake.fragment" />
<recent name="es.verdnatura.presentation.view.feature.historicoshelving.fragment" />
<recent name="es.verdnatura.presentation.view.feature.buffer.fragment" />
</key>
<key name="CopyKotlinDeclarationDialog.RECENTS_KEY">
<recent name="es.verdnatura.presentation.view.feature.main.activity" />
@ -385,6 +571,7 @@
<option name="ALL_USERS" value="false" />
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
<option name="CLEAR_APP_STORAGE" value="false" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="CLEAR_LOGCAT" value="false" />
@ -458,6 +645,7 @@
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
<configuration default="true" type="JetRunConfigurationType">
@ -838,7 +1026,7 @@
<option name="project" value="LOCAL" />
<updated>1709725795643</updated>
</task>
<option name="localTasksCounter" value="275" />
<option name="localTasksCounter" value="276" />
<servers />
</component>
<component name="Vcs.Log.History.Properties">
@ -852,6 +1040,21 @@
</option>
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list>
<RecentGroup>
<option name="FILTER_VALUES">
<option value="appverdnatura/master" />
</option>
</RecentGroup>
</list>
</value>
</entry>
</map>
</option>
<option name="TAB_STATES">
<map>
<entry key="1">
@ -875,6 +1078,12 @@
<value>
<State>
<option name="BEK_SORT_TYPE" value="1" />
<option name="COLUMN_ID_WIDTH">
<map>
<entry key="Table.Default.Author.ColumnIdWidth" value="115" />
<entry key="Table.Default.Date.ColumnIdWidth" value="114" />
</map>
</option>
<option name="FILTERS">
<map>
<entry key="branch">
@ -886,12 +1095,6 @@
</entry>
</map>
</option>
<option name="COLUMN_ID_WIDTH">
<map>
<entry key="Table.Default.Author.ColumnIdWidth" value="115" />
<entry key="Table.Default.Date.ColumnIdWidth" value="114" />
</map>
</option>
</State>
</value>
</entry>
@ -921,25 +1124,9 @@
</entry>
</map>
</option>
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list>
<RecentGroup>
<option name="FILTER_VALUES">
<option value="appverdnatura/master" />
</option>
</RecentGroup>
</list>
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="refs #6078feat:activityWorker" />
<MESSAGE value="refs #6531feat:showLastTickets" />
<MESSAGE value="refs #6440: errorNaturPhotos" />
<MESSAGE value="refs #6651feat:itemShelving_get" />
@ -964,7 +1151,8 @@
<MESSAGE value="version 24.5Beta" />
<MESSAGE value="version 24.8Beta" />
<MESSAGE value="refs #6607 feat:checking_boxes" />
<option name="LAST_COMMIT_MESSAGE" value="refs #6607 feat:checking_boxes" />
<MESSAGE value="refs #7278 feat:newUI SummaryFragment" />
<option name="LAST_COMMIT_MESSAGE" value="refs #7278 feat:newUI SummaryFragment" />
</component>
<component name="XDebuggerManager">
<pin-to-top-manager>

View File

@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 251,
"versionName": "24.2Beta",
"versionCode": 290,
"versionName": "24.20Beta",
"outputFile": "app-beta-release.apk"
}
],

View File

@ -13,8 +13,8 @@ android {
applicationId "es.verdnatura"
minSdkVersion 26
targetSdkVersion 33 // se deja con target si no Play Protect la bloquea
versionCode 285
versionName = "24.18Beta"
versionCode 290
versionName = "24.20Beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -12,7 +12,6 @@ import androidx.datastore.preferences.preferencesDataStore
import com.google.gson.Gson
import es.verdnatura.MobileApplication
import es.verdnatura.R
import es.verdnatura.domain.ConstAndValues
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
import es.verdnatura.domain.ConstAndValues.NUMBEROFWAGONS
@ -160,7 +159,6 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
saveWorkForm(
WorkForms(
"Producción",
"https://app.verdnatura.es",
"https://salix.verdnatura.es"
)
)
@ -169,19 +167,18 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
}
suspend fun getWorkForm(): List<WorkForms> {
var listForms: ArrayList<WorkForms> = ArrayList()
val listForms: ArrayList<WorkForms> = ArrayList()
val preferences = mobileApplication.dataStoreWork.data.first()
preferences.asMap().forEach { entry ->
val key = entry.key
val value = entry.value
var json2 = JSONObject(value.toString())
val json2 = JSONObject(value.toString())
listForms.add(
WorkForms(
key.name,
json2.get("urlSilex").toString(),
json2.get("urlSalix").toString(),
json2.get("isShowDelete").toString().toBoolean(),
json2.get("created") as Long
@ -199,27 +196,24 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
return listForms.sortedBy { it.created }
}
suspend fun createWorksDefault() {
private suspend fun createWorksDefault() {
saveWorkForm(
WorkForms(
"Producción",
"https://app.verdnatura.es",
"https://salix.verdnatura.es"
)
)
saveWorkForm(
WorkForms(
"Test",
"https://test-app.verdnatura.es",
urlSalix = "https://test-salix.verdnatura.es"
)
)
var working_in_test = true
val working_in_test = true
if (working_in_test) {
saveWorkForm(
WorkForms(
"TestLocalhost",
"http://10.1.4.42:9000",
urlSalix = "https://test-salix.verdnatura.es"
)
)
@ -227,28 +221,24 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
saveWorkForm(
WorkForms(
"TestHome",
"http://192.168.1.132:9000",
urlSalix = "https://test-salix.verdnatura.es"
)
)
saveWorkForm(
WorkForms(
"TestLOCAL",
"http://10.1.4.42:9000",
urlSalix = "http://10.1.4.42:3000"
)
)
saveWorkForm(
WorkForms(
"TestLOCALHOME",
"http://192.168.1.132:9000",
urlSalix = "http://192.168.1.132:3000"
urlSalix = "http://192.168.1.139:3000"
)
)
saveWorkForm(
WorkForms(
"DEV SALIX",
"http://10.1.4.42:9000",
urlSalix = "https://dev-salix.verdnatura.es"
)
)
@ -259,7 +249,7 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
WorkForms(
mobileApplication.getString(R.string.addWorkForm),
"",
"",
isShowDelete = false,
created = Calendar.getInstance().timeInMillis + Calendar.getInstance().timeInMillis
)
@ -269,17 +259,14 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
suspend fun saveWorkForm(workForm: WorkForms) {
var gson = Gson()
var json = gson.toJson(workForm)
val gson = Gson()
val json = gson.toJson(workForm)
mobileApplication.dataStoreWork.edit { preferences ->
preferences[stringPreferencesKey(workForm.name)] = json
}
runBlocking {
mobileApplication.dataStoreApp.editDataStoreKey(
ConstAndValues.BASEURL,
workForm.urlSilex
)
mobileApplication.dataStoreApp.editDataStoreKey(
BASEURLSALIX,
workForm.urlSalix
@ -292,7 +279,7 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
var url =
readDataStoreKey<String>(BASEURLSALIX)
if (url.isNullOrBlank()) {
if (url.isBlank()) {
url = BASE_URL_SALIX
}
return url

View File

@ -4,7 +4,7 @@ import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
import es.verdnatura.presentation.view.feature.claim.fragment.ClaimViewModel
import es.verdnatura.presentation.view.feature.claim.fragment.ubication.ClaimViewModel
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel

View File

@ -3,9 +3,7 @@ package es.verdnatura.domain
import android.content.Context
import com.google.gson.GsonBuilder
import es.verdnatura.MobileApplication
import es.verdnatura.domain.ConstAndValues.BASEURL
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
import es.verdnatura.domain.ConstAndValues.BASE_URL
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
import es.verdnatura.presentation.common.InteceptorListener
import kotlinx.coroutines.runBlocking
@ -41,20 +39,14 @@ class ApiSalixUtils {
var list = (context).dataStoreApp.getWorkForm()
for (l in list) {
if (l.name == myWorkFormSelected) {
context.dataStoreApp.editDataStoreKey(
BASEURL,
l.urlSilex
)
context.dataStoreApp.editDataStoreKey(BASEURLSALIX, l.urlSalix)
}
}
}
} else {
runBlocking {
context.dataStoreApp.editDataStoreKey(
BASEURL,
BASE_URL
)
context.dataStoreApp.editDataStoreKey(
BASEURLSALIX,
BASE_URL_SALIX

View File

@ -52,10 +52,8 @@ object ConstAndValues {
const val ENTRYOBSERVATIONS = "ENTRYOBSERVATIONS"
const val ENTRYNUMBERIMAGES = "ENTRYNUMBERIMAGES"
const val ENTRYTYPE = "ENTRYTYPE"
const val BASEURL = "base_url"
const val BASEURLSALIX = "base_urlSalix"
const val BASE_URL_SALIX = "https://salix.verdnatura.es"
const val BASE_URL = "https://app.verdnatura.es"
const val ENTRY = "ENTRY"
const val RENEWINTERVAL = "renewInterval"
const val RENEWPERIOD = "renewPeriod"

View File

@ -14,6 +14,7 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
@ -52,7 +53,6 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
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.MistakeTypeVO
@ -224,12 +224,6 @@ interface SalixService {
@Query("schema") schema: String = "vn"
): Call<List<ItemHistoricoVO>>
@POST("Applications/itemTrash/execute-proc")
fun itemTrash(
@Query("params") params: Any? = null,
@Query("schema") schema: String = "vn"
): Call<Any>
@POST("workerActivities")
fun workerActivityAdd(
@Body workerActionSalix: WorkerActionSalix
@ -293,12 +287,12 @@ interface SalixService {
@Query("schema") schema: String = "vn"
): Call<Unit>
@GET("ExpeditionPallets/getPallet")//REVISADA
@GET("ExpeditionPallets/getPallet")
fun expeditionPalletGetPallet(
@Query("expeditionFk") expeditionFk: Number,
): Call<ItemExpeditionTruckVO>
@GET("ExpeditionPallets")//REVISADA
@GET("ExpeditionPallets")
fun expeditionPalletGet(
@Query("filter") filter: Any?,
): Call<List<ItemExpeditionTruckSalix>>
@ -309,7 +303,7 @@ interface SalixService {
):
Call<List<Printers>>
@GET("Collections/getSales")//REVISADA
@GET("Collections/getSales")
fun getSalesFromTicketOrCollection(
@Query("collectionOrTicketFk") collectionOrTicketFk: Number,
@Query("print") print: Boolean,
@ -317,14 +311,14 @@ interface SalixService {
):
Call<CollectionVO>
@GET("TicketCollections/hasUncheckedTicket")//REVISADA
@GET("TicketCollections/hasUncheckedTicket")
fun hasUncheckedTicket(
@Query("ticketFk") ticketFk: Number,
):
Call<String>
@POST("SaleTrackings/setPicked")//REVISADA
@POST("SaleTrackings/setPicked")
fun saleTrackingMark(
@Body saleTRackingSalix: SaleTrackingSalix
):
@ -337,7 +331,7 @@ interface SalixService {
):
Call<List<PreSacadorItemVO>>
@POST("Tickets/addSaleByCode")//REVISADA
@POST("Tickets/addSaleByCode")
fun addSaleByCode(
@Body params: Any
):
@ -353,43 +347,43 @@ interface SalixService {
):
Call<Int>
@POST("ItemShelvings/updateFromSale")//REVISADA
@POST("ItemShelvings/updateFromSale")
fun itemShelvingUpdateFromSale(
@Body params: Any
):
Call<Any>
@POST("SaleTrackings/delete")//REVISADA
@POST("SaleTrackings/delete")
fun saleTrackingDel(
@Body params: SaleTrackingDelSalix
):
Call<Any>
@POST("Shelvings/addLog")//REVISADA
@POST("Shelvings/addLog")
fun shelvingLogAdd(
@Body params: Any
):
Call<Any>
@POST("ItemShelvings/upsertItem")//REVISADA
@POST("ItemShelvings/upsertItem")
fun upsertItem(
@Body params: Any
):
Call<Any>
@POST("MachineWorkers/updateInTime")//REVISADA
@POST("MachineWorkers/updateInTime")
fun machineWorkerUpdateInTime(
@Body params: Any
):
Call<Any>
@POST("MachineWorkers/add")//REVISADA
@POST("MachineWorkers/add")
fun machineWorkerAdd(
@Query("plate") plate: Any
):
Call<Any>
@POST("SaleTrackings/updateTracking")//REVISADA
@POST("SaleTrackings/updateTracking")
fun saleTrackingUpdate(
@Body params: Any
):
@ -407,7 +401,7 @@ interface SalixService {
):
Call<ArrayList<Reubication>>
@GET("MobileAppVersionControls/getVersion")//REVISADA
@GET("MobileAppVersionControls/getVersion")
fun getVersion(
@Query("app") app: String
):
@ -845,23 +839,23 @@ interface SalixService {
@Body parms: packingSiteSalix
): Call<Unit>
@PUT("ItemBarCodes")//REVISADA
@PUT("ItemBarCodes")
fun barcodesEdit(
@Body params: ItemBarCodeSalix
): Call<Any>
@DELETE("ItemBarcodes/delete")//REVISADA
@DELETE("ItemBarcodes/delete")
fun barcodesDelete(
@Query("barcode") barcode: String,
@Query("itemFk") itemFk: Int,
): Call<Any>
@GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA
@GET("ItemBarCodes/{barCodeValue}/toItem")
fun barcodes_toitem(
@Path("barCodeValue") barCodeValue: String
): Call<String?>
@GET("Suppliers")//REVISADA
@GET("Suppliers")
fun getSuppliers(
//@Query("filter") filter:String="""{"fields":{"id":true,"name":true}}"""
//@Body params:JSONObject=JSONObject("""filter"={"fields":{"id":true,"name":true},"include":[{"relation":"contacts","scope":{"fields":["email"],"order":"id DESC","limit":1,"where":{"email":{"neq":null}}}}]}""")
@ -884,25 +878,25 @@ interface SalixService {
):
Call<List<EntrySalix>>*/
@PUT("Entries")//REVISADA
@PUT("Entries")
fun Entries(
@Body supplier: Any
):
Call<List<EntrySalix>>
@GET("Entries")//REVISADA
@GET("Entries")
fun getEntries_fromSupplier(
@Query("filter") filter: String
):
Call<List<EntrySalix>>
@GET("Entries")//REVISADA
@GET("Entries")
fun add_entry(
@Body entry: EntrySalix
):
Call<EntrySalix>
@PATCH("Entries/{entryId}")//REVISADA
@PATCH("Entries/{entryId}")
fun entry_updateObserv(
@Path("entryId") entryId: Int,
@Body entry: obervationEntry

View File

@ -18,7 +18,7 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionS
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
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.Sale

View File

@ -27,13 +27,12 @@ import com.bumptech.glide.request.transition.Transition
import java.text.DecimalFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.Calendar
import java.util.Locale
inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) =
beginTransaction().func().commit()
fun <T> Context.openActivity(it: Class<T>, extras: Bundle.() -> Unit = {}) {
val intent = Intent(this, it)
intent.putExtras(Bundle().apply(extras))
@ -170,7 +169,6 @@ fun Context.showKeyboardIn(view: View) {
}
// Extension function to change media volume programmatically
fun AudioManager.setMediaVolume(volumeIndex: Int) {
// Set media volume level
@ -190,10 +188,11 @@ val AudioManager.mediaCurrentVolume: Int
get() = this.getStreamVolume(AudioManager.STREAM_MUSIC)
fun getHourDay(date: String): String? {
val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
val cal = Calendar.getInstance()
return try {
cal.time = format.parse(date)
val format = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault())
val cal = Calendar.getInstance()
cal.time = format.parse(date)!!
val f = DecimalFormat("00")
"" + f.format(cal[Calendar.HOUR_OF_DAY]) + ":" + f.format(cal[Calendar.MINUTE])
} catch (e: ParseException) {
@ -210,7 +209,6 @@ fun addDateToTime(time: String): String {
return "$currentDate $time"
}
fun PackageManager.getPackageInfoCompat(packageName: String, flags: Int = 0): PackageInfo =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong()))

View File

@ -15,6 +15,7 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
init {
setContentView(binding.root)
//binding.textinputlayoutThree.visibility = View.GONE
}

View File

@ -148,8 +148,8 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
return this
}
fun hideTextInput(): CustomDialogList {
binding.textinputlayoutUsername.visibility = View.INVISIBLE
fun hideTextInput(visibility:Int = View.INVISIBLE): CustomDialogList {
binding.textinputlayoutUsername.visibility = visibility
return this
}

View File

@ -86,8 +86,11 @@ class AjustesFragment :
getString(R.string.closeSession) -> ma.onMyBackPressed()
getString(R.string.printerLabel) -> {
messagePrinter = getString(R.string.SelectPrinter)
viewModel.printerGet(mobileApplication.dataStoreApp.readDataStoreKey(
SECTORFK))
viewModel.printerGet(
mobileApplication.dataStoreApp.readDataStoreKey(
SECTORFK
)
)
}
getString(R.string.vehicleControl) -> ma.onPasillerosItemClickListener(
@ -97,8 +100,8 @@ class AjustesFragment :
)
getString(R.string.menuByDefault) -> showMenuByDefault()
getString(R.string.settingsTitleItemPacking) -> viewModel.getItemPackingTypeSalix()
getString(R.string.settingsTitleTrain) -> viewModel.trainGet()
getString(R.string.settingsTitleItemPacking) -> if (item.action) viewModel.getItemPackingTypeSalix()
getString(R.string.settingsTitleTrain) -> if (item.action) viewModel.trainGet()
else -> {}
}
@ -108,14 +111,14 @@ class AjustesFragment :
workerAllowedResponse.observe(viewLifecycleOwner) {
isWorkerAllowed = it.response.toBoolean()
isWorkerAllowed = it
loginViewModel = LoginViewModel(context as MobileApplication)
loginViewModel.operator_getDataSalix(mobileApplication.userId!!)
loginViewModel.workerOperator.observe(this@AjustesFragment) { iti ->
if (!iti.isError) {
runBlocking { mobileApplication.dataStoreApp.saveDataOperator(iti) }
} else {
ma.messageWithSound(it.errorMessage, isError = true, isPlayed = true)
ma.messageWithSound(iti.errorMessage, isError = true, isPlayed = true)
}
}
@ -125,12 +128,6 @@ class AjustesFragment :
loadActionUpdate.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
ma.messageWithSound(
if (it.isError) it.errorMessage else {
getString(R.string.itemUpdated)
}, it.isError, false
)
messagePrinter =
getString(R.string.SelectPrinter) + "\n" + getString(R.string.printerRemoved)
viewModel.printerGet(mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK))
@ -194,34 +191,26 @@ class AjustesFragment :
}
loadPrintersList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { it ->
if (it.list.isNotEmpty() && it.list[0].isError) {
customDialog.setTitle(getString(R.string.error))
.setDescription(it.list[0].errorMessage)
if (it.list.isNotEmpty()) {
val listPrinters: ArrayList<String> = ArrayList()
it.list.forEach {
listPrinters.add(it.name)
}
val array = arrayOfNulls<String>(listPrinters.size)
printersList = it.list
showDialogForAll(listPrinters.toArray(array), messagePrinter ?: "")
} else {
viewModel.settingsItem[2].selected = getString(R.string.noprinter)
settingsAdapter!!.notifyItemChanged(2)
customDialog.setTitle(getString(R.string.printers))
.setDescription(getString(R.string.Noprinters))
.setOkButton(getString(R.string.Close)) {
customDialog.dismiss()
}.show()
} else {
if (it.list.isNotEmpty()) {
val listPrinters: ArrayList<String> = ArrayList()
it.list.forEach {
listPrinters.add(it.name)
}
val array = arrayOfNulls<String>(listPrinters.size)
printersList = it.list
showDialogForAll(listPrinters.toArray(array), messagePrinter ?: "")
} else {
viewModel.settingsItem[2].selected = getString(R.string.noprinter)
settingsAdapter!!.notifyItemChanged(2)
customDialog.setTitle(getString(R.string.printers))
.setDescription(getString(R.string.Noprinters))
.setOkButton(getString(R.string.Close)) {
customDialog.dismiss()
}.show()
}
}
}
}
loadTrainList.observe(viewLifecycleOwner) { event ->

View File

@ -9,10 +9,7 @@ import es.verdnatura.MobileApplication
import es.verdnatura.R
import es.verdnatura.domain.SalixCallback
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.ResponseItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
import es.verdnatura.presentation.view.feature.ajustes.model.PrintersList
@ -35,16 +32,16 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
val sectorList: LiveData<SectorListVO>
get() = _sectorList
private val _actionUpdate by lazy { MutableLiveData<ResponseItemVO>() }
val actionUpdate: LiveData<ResponseItemVO>
private val _actionUpdate by lazy { MutableLiveData<String>() }
val actionUpdate: LiveData<String>
get() = _actionUpdate
private val _printerList by lazy { MutableLiveData<PrintersList>() }
val printerList: LiveData<PrintersList>
get() = _printerList
private val _workerAllowedResponse by lazy { MutableLiveData<ResponseItemVO>() }
val workerAllowedResponse: LiveData<ResponseItemVO>
private val _workerAllowedResponse by lazy { MutableLiveData<Boolean>() }
val workerAllowedResponse: LiveData<Boolean>
get() = _workerAllowedResponse
private val _itemspackinglist by lazy { MutableLiveData<ItemPackingTypeList>() }
@ -55,7 +52,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
val trainList: LiveData<TrainList>
get() = _trainList
val loadActionUpdate: LiveData<Event<ResponseItemVO>> = _actionUpdate.map { Event(it) }
val loadActionUpdate: LiveData<Event<String>> = _actionUpdate.map { Event(it) }
val loadSectorList: LiveData<Event<SectorListVO>> = _sectorList.map { Event(it) }
val loadPrintersList: LiveData<Event<PrintersList>> = _printerList.map { Event(it) }
val loadItemPackingList: LiveData<Event<ItemPackingTypeList>> =
@ -174,23 +171,14 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun printerGet(sectorFk:Int) {
//Tarea 6276
fun printerGet(sectorFk: Int) {
salix.getprinters(
"""{"fields":["id","name"],"where":{"sectorFk":$sectorFk,"isLabeler":{"neq":false}}}"""
).enqueue(object : SalixCallback<List<Printers>>(context) {
//silex.printer_get().enqueue(object : SalixCallback<List<Printers>>(context) {
override fun onSuccess(response: Response<List<Printers>>) {
_printerList.value = response.body()?.let { PrintersList(it) }
}
override fun onError(t: Throwable) {
val listError: ArrayList<Printers> = ArrayList()
listError.add(Printers(0, "", true, t.message!!))
_printerList.value = PrintersList(listError)
}
})
}
@ -207,10 +195,10 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
salix.worker_isF11Allowed("""{"where":{"id":${(context as MobileApplication).userId}},"fields":{"isF11Allowed":true}}""")
.enqueue(object : SalixCallback<JsonObject>(context) {
override fun onSuccess(response: Response<JsonObject>) {
_workerAllowedResponse.value = ResponseItemVO(
response = response.body()!!.entrySet().first().value.toString(),
isError = false,
)
_workerAllowedResponse.value =
response.body()!!.entrySet().first().value.toString().toBoolean()
}
})
@ -219,22 +207,10 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
fun workerUpdateOperatorSalix(entity: String, workerFk: Int, sectorFk: Int?, labelerFk: Int?) {
salix.update_operator(id = workerFk, Operator(sectorFk, labelerFk))
.enqueue(object : SalixCallback<Unit>(context) {
override fun onError(t: Throwable) {
_actionUpdate.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
throw t
}
override fun onSuccess(response: Response<Unit>) {
if (entity == "sector") {
_actionUpdate.value = ResponseItemVO(
response = response.message(),
isError = false,
errorMessage = ""
)
_actionUpdate.value = response.message()
}
super.onSuccess(response)

View File

@ -13,9 +13,7 @@ class AjustesItemVO(
class SectorItemVO(
var id: Int,
var description: String,
val warehouseFk: Int?,
val isError: Boolean = false,
var errorMessage: String = ""
val warehouseFk: Int?
)
class SectorListVO(
@ -28,10 +26,7 @@ class PrintersList(
class Printers(
var id: Int,
var name: String,
val isError: Boolean = false,
var errorMessage: String = ""
var name: String
)
class WorkerPrintersList(
@ -40,9 +35,7 @@ class WorkerPrintersList(
class Train(
var id: Int,
var name: String,
val isError: Boolean = false,
var errorMessage: String = ""
var name: String
)
class TrainList(

View File

@ -1,16 +1,12 @@
package es.verdnatura.presentation.view.feature.articulo.fragment
import android.app.AlertDialog
import android.content.Intent
import android.graphics.drawable.Drawable
import android.os.Build
import android.text.InputType
import android.view.View
import android.view.View.GONE
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import androidx.annotation.RequiresApi
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.gson.Gson
import es.verdnatura.R
@ -55,6 +51,8 @@ class ItemCardFragment(
private var itemsPackingType: ArrayList<ItemPackingType> = ArrayList()
private var quantityToDiscard = 0
private var itemInfoG: ItemCardVO? = null
private var firstVisiblePositionX: Int = 0
private var firstVisiblePositionY: Int = 0
companion object {
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
@ -67,7 +65,6 @@ class ItemCardFragment(
override fun getLayoutId(): Int = R.layout.fragment_item_card
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
binding.itemcardLayout.visibility = GONE
@ -99,11 +96,11 @@ class ItemCardFragment(
val iconSalix = ImageView(context)
iconSalix.setImageResource(R.drawable.ic_logo_salix)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
}
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
listIcons.add(iconSalix)
listIcons.add(iconReload)
listIcons.add(iconHistory)
@ -112,7 +109,6 @@ class ItemCardFragment(
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
@RequiresApi(Build.VERSION_CODES.O)
override fun onOptionsItemSelected(item: Drawable) {
when (item) {
@ -134,8 +130,7 @@ class ItemCardFragment(
val itemId = itemInfoG!!.id
val entryPoint = Gson().toJson(
mutableMapOf(
"entryPoint" to itemId,
"web" to "${
"entryPoint" to itemId, "web" to "${
mobileApplication.dataStoreApp.getServerSalix()
}/#!/item/$itemId/summary"
)
@ -157,24 +152,23 @@ class ItemCardFragment(
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setEvents() {
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
firstVisiblePositionX = binding.scrollView.scrollX
firstVisiblePositionY = binding.scrollView.scrollY
}
binding.editItemFk.requestFocus()
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (binding.editItemFk.text.toString().isNotEmpty())
try {
getItemCard(
itemScanValue(
binding.editItemFk.text.toString(),
"buy",
"more"
).toString()
)
} catch (ex: Exception) {
ma.messageWithSound(ex.message.toString(), true, true)
}
if (binding.editItemFk.text.toString().isNotEmpty()) try {
getItemCard(
itemScanValue(
binding.editItemFk.text.toString(), "buy", "more"
).toString()
)
} catch (ex: Exception) {
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
}
binding.editItemFk.setText("")
ma.hideKeyboard(binding.editItemFk)
@ -210,90 +204,62 @@ class ItemCardFragment(
override fun observeViewModel() {
with(viewModel) {
itemcard.observe(viewLifecycleOwner, Observer {
if (it.isError) {
binding.itemcardLayout.visibility = GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
ma.messageWithSound(it.errorMessage, true, false)
itemCard.observe(viewLifecycleOwner) {
if (it.id != 0) {
binding.itemcardLayout.visibility = View.VISIBLE
setItemCard(it)
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
} else {
if (it.id != 0) {
binding.itemcardLayout.visibility = View.VISIBLE
setItemCard(it)
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
} else {
binding.itemcardLayout.visibility = GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
ma.messageWithSound(
getString(R.string.itemNotFound),
true,
false,
getString(R.string.noResults)
)
}
binding.itemcardLayout.visibility = GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
ma.messageWithSound(
getString(R.string.itemNotFound),
isError = true,
isPlayed = false,
getString(R.string.noResults)
)
}
})
itemspackinglist.observe(viewLifecycleOwner, Observer {
createItemTypeTypeList(it.list)
})
response.observe(viewLifecycleOwner, Observer {
}
responseItemCard.observe(viewLifecycleOwner) {
getItemCard(itemInfoG!!.id.toString())
})
addressLosesList.observe(viewLifecycleOwner, Observer {
}
addressLosesList.observe(viewLifecycleOwner) {
if (it.list.isEmpty()) {
ma.messageWithSound(getString(R.string.NotAddress), true, false)
ma.messageWithSound(
getString(R.string.NotAddress), isError = true, isPlayed = false
)
} else {
showDialogTrashFault(it.list)
}
})
}
}
private fun createItemTypeTypeList(list: List<ItemPackingType>) {
itemsPackingType.clear()
list.forEach { item ->
if (!item.isError) {
try {
itemsPackingType.add(ItemPackingType(item.code, item.description))
} catch (e: Exception) {
getString(R.string.errorInput).toast(requireContext())
}
}
}
}
private fun setItemCard(itemInfo: ItemCardVO) {
itemInfoG = itemInfo
binding.mainToolbar.toolbarTitle.text = itemInfo.id.toString() + "-" + itemInfo.longName
binding.mainToolbar.toolbarTitle.text =
getString(R.string.itemCardTitle, itemInfo.id.toString(), itemInfo.longName)
titleImage = itemInfo.id.toString() + "-" + itemInfo.longName
binding.itemcardImage.loadUrl(itemInfo.urlImage200)
urlLarge = itemInfo.urlImage
binding.itemcardTag1.text = itemInfo.size.toString()
binding.itemcardTag2.text = itemInfo.value5
binding.itemcardTag3.text = itemInfo.value6
binding.itemcardTag4.text = itemInfo.value7 + " " + itemInfo.origin
binding.itemcardTag4.text =
getString(R.string.itemCardTag, itemInfo.value7, itemInfo.origin)
binding.itemcardBuyer.text = itemInfo.buyer
listItemsRow = ArrayList()
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.total),
value = (itemInfo.visible?:"0").toString(),
value = (itemInfo.visible ?: "0").toString(),
isEditable = false
)
)
@ -301,7 +267,7 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Disponible),
value = (itemInfo.available?:"0").toString(),
value = (itemInfo.available ?: "0").toString(),
isEditable = false
)
)
@ -309,11 +275,11 @@ class ItemCardFragment(
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.Ubicado),
value = (itemInfo.vVisibleItemShelving?:"0").toString(),
value = (itemInfo.vVisibleItemShelving ?: "0").toString(),
isEditable = false
)
)
var unlocated = ((itemInfo.visible?:0) - (itemInfo.vVisibleItemShelving?:0)).toString()
val unlocated = ((itemInfo.visible ?: 0) - (itemInfo.vVisibleItemShelving ?: 0)).toString()
listItemsRow.add(
ItemCardRowVO(
title = getString(R.string.SINUBICAR),
@ -407,7 +373,6 @@ class ItemCardFragment(
listBarcodes = itemInfo.barcodes as ArrayList<BarcodeVO>
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
@RequiresApi(Build.VERSION_CODES.O)
override fun onItemCardRowClickListener(item: ItemCardRowVO) {
when (item.action) {
@ -463,12 +428,17 @@ class ItemCardFragment(
binding.scrollView.scrollTo(0, position[1])
}
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
firstVisiblePositionX = binding.scrollView.scrollX
firstVisiblePositionY = binding.scrollView.scrollY
}
binding.scrollView.scrollTo(firstVisiblePositionX, firstVisiblePositionY)
}
private fun showCustomDialog(item: ItemCardRowVO, textDescrip: String) {
customDialogInput.setTitle(item.title!!)
.setDescription(textDescrip)
customDialogInput.setTitle(item.title!!).setDescription(textDescrip)
.setOkButton(getString(R.string.save)) {
customDialogAdd(item)
customDialogInput.dismiss()
@ -478,32 +448,28 @@ class ItemCardFragment(
customDialogInput.dismiss()
}.setValue("").show()
customDialogInput.getEditText().requestFocus()
customDialogInput.getEditText()
.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
customDialogAdd(item)
return@setOnEditorActionListener true
}
false
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
customDialogAdd(item)
return@setOnEditorActionListener true
}
false
}
}
private fun customDialogAdd(item: ItemCardRowVO) {
try {
editItemCardRow(
item,
customDialogInput.getValue().toInt()
item, customDialogInput.getValue().toInt()
)
customDialogInput.setValue("")
customDialogInput.dismiss()
ma.hideKeyboard(customDialogInput.getEditText())
} catch (ex: Exception) {
if (item.action == "itemSaveStem"
) {
viewModel.item_saveStems(
itemFk = itemInfoG!!.id,
value = null
if (item.action == "itemSaveStem") {
viewModel.updateStems(
itemFk = itemInfoG!!.id, value = null
)
} else {
getString(R.string.errorInput).toast(requireContext())
@ -514,18 +480,20 @@ class ItemCardFragment(
private fun editItemCardRow(item: ItemCardRowVO, value: Int) {
when (item.action) {
"itemStockUpdateAdd" -> {
showProgress()
viewModel.setVisibleDiscard(itemInfoG!!.id, warehouseFk!!, value * -1, null)
}
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value)
"updateGrouping" ->
viewModel.updateGrouping(
warehouseFk = warehouseFk!!,
itemFk = itemInfoG!!.id,
value = value,
"itemStockUpdateRemove" -> {
viewModel.getAddress()
quantityToDiscard = value
}
)
"updateGrouping" -> viewModel.updateGrouping(
warehouseFk = warehouseFk!!,
itemFk = itemInfoG!!.id,
value = value,
)
"updatePacking" -> viewModel.updatePacking(
warehouseFk = warehouseFk!!,
@ -534,43 +502,18 @@ class ItemCardFragment(
)
"itemSaveStem" -> viewModel.item_saveStems(
itemFk = itemInfoG!!.id,
value = value
"itemSaveStem" -> viewModel.updateStems(
itemFk = itemInfoG!!.id, value = value
)
"item_saveReference" -> viewModel.item_saveReference(
itemFk = itemInfoG!!.id,
value = value
"item_saveReference" -> viewModel.updateReference(
itemFk = itemInfoG!!.id, value = value
)
}
if (item.action != "itemStockUpdate" && item.action != "itemStockUpdateRemove" && item.action != "itemStockUpdateAdd")
showProgress()
}
private fun prepareItemStockAdd(value: Int) {
showProgress()
viewModel.itemTrash(
itemFk = itemInfoG!!.id,
warehouseFk = warehouseFk!!,
newValue = (value * -1),
isTrash = false
)
}
private fun showProgress() {
}
private fun prepareItemStockUpdate2(itemB: ItemCardRowVO, value: Int) {
viewModel.getAddress()
quantityToDiscard = value
}
private fun showDialogTrashFault(listAddress: List<AddressLoses>) {
@ -614,8 +557,10 @@ class ItemCardFragment(
private fun setUpdateBarcode() {
try {
ma.hideKeyboard(customDialogList.getEditText())
if (customDialogList.getValue().isNotEmpty())
updateBarcode(customDialogList.getValue(), false)
if (customDialogList.getValue().isNotEmpty()) updateBarcode(
customDialogList.getValue(),
false
)
customDialogList.setValue("")
customDialogList.dismiss()
@ -626,60 +571,16 @@ class ItemCardFragment(
}
private fun updateBarcode(code: String, delete: Boolean) {
if (delete) {
var i = 0
var posDelete = 0
listBarcodes.forEach {
if (it.code == code)
posDelete = i
i += 1
}
listBarcodes.removeAt(posDelete)
} else {
listBarcodes.add(BarcodeVO(code))
}
viewModel.barcodesEditSalix(
itemFk = itemInfoG!!.id,
barCodeValue = code,
delete = delete,
)
barcodeAdapter!!.notifyDataSetChanged()
showProgress()
}
private fun showDialogSelectItemTypePacking() {
var array = arrayOfNulls<String>(itemsPackingType.size)
for (indice in array.indices) {
array[indice] =
itemsPackingType[indice].code + " : " + itemsPackingType[indice].description
}
val builder = AlertDialog.Builder(this.context)
builder.setTitle(getString(R.string.mensajeseleccionencajado))
.setItems(
array
) { _, position ->
updateItemPackingType(itemsPackingType[position].code)
}
builder.create().show()
}
private fun updateItemPackingType(itemPackingType: String) {
viewModel.updatePackingTypeSalix(
itemInfoG!!.id,
itemPackingType
)
}
override fun onClickDynamic(addressFK: Int) {
viewModel.setVisibleDiscard(itemInfoG!!.id, warehouseFk!!, quantityToDiscard, addressFK)
customDynamic.dismiss()
customDynamic.cancel()

View File

@ -6,15 +6,12 @@ import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ItemBarCodeSalix
import es.verdnatura.presentation.common.ItemDiscardSalixShortage
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
import es.verdnatura.presentation.view.feature.articulo.model.AddressLosesList
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingTypeList
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposalList
import okhttp3.MediaType
@ -25,25 +22,21 @@ import java.io.File
class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
private val _itemcard by lazy { MutableLiveData<ItemCardVO>() }
val itemcard: LiveData<ItemCardVO>
get() = _itemcard
private val _itemCard by lazy { MutableLiveData<ItemCardVO>() }
val itemCard: LiveData<ItemCardVO>
get() = _itemCard
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
val response: LiveData<ResponseItemVO>
get() = _response
private val _responseItemCard by lazy { MutableLiveData<Any>() }
val responseItemCard: LiveData<Any>
get() = _responseItemCard
private val _responseCode by lazy { MutableLiveData<ResponseItemVO>() }
val responseCode: LiveData<ResponseItemVO>
private val _responseCode by lazy { MutableLiveData<String>() }
val responseCode: LiveData<String>
get() = _responseCode
private val _itemspackinglist by lazy { MutableLiveData<ItemPackingTypeList>() }
val itemspackinglist: LiveData<ItemPackingTypeList>
get() = _itemspackinglist
private val _itemProposallist by lazy { MutableLiveData<ItemProposalList>() }
val itemProposallist: LiveData<ItemProposalList>
get() = _itemProposallist
private val _itemProposalList by lazy { MutableLiveData<ItemProposalList>() }
val itemProposalList: LiveData<ItemProposalList>
get() = _itemProposalList
private val _addressLosesList by lazy { MutableLiveData<AddressLosesList>() }
val addressLosesList: LiveData<AddressLosesList>
@ -56,31 +49,9 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
//Tarea 6276
salix.getCard(barcode = itemFk, warehouseFk = warehouseFk)
.enqueue(object : SalixCallback<ItemCardVO>(context) {
override fun onError(t: Throwable) {
_itemcard.value = ItemCardVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!),
stems = "", itemCost = ""
)
}
override fun onSuccess(response: Response<ItemCardVO>) {
if (response.body() != null) {
_itemcard.value = response.body()!!
} else {
_itemcard.value = ItemCardVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
),
stems = "",
itemCost = ""
)
}
_itemCard.value = response.body() ?: ItemCardVO()
}
})
@ -96,35 +67,13 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
params = arrayListOf(itemFk, warehouseFk, shipped, isShowedByType).formatWithQuotes()
).enqueue(object : SalixCallback<List<ItemProposal>>(context) {
override fun onSuccess(response: Response<List<ItemProposal>>) {
_itemProposallist.value = response.body()?.let {
_itemProposalList.value = response.body()?.let {
ItemProposalList(it)
}
}
})
}
fun itemTrash(
itemFk: Int,
warehouseFk: Int,
newValue: Int,
isTrash: Boolean
) {
salix.itemTrash(arrayListOf(itemFk, warehouseFk, newValue, isTrash).formatWithQuotes())
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
}
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
})
}
fun setVisibleDiscard(
itemFk: Int,
warehouseFk: Int,
@ -135,111 +84,74 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
salix.setVisibleDiscard(
ItemDiscardSalixShortage(itemFk, warehouseFk, quantity, addressFk)
)
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
}
})
override fun onSuccess(response: Response<Any>) {
_responseItemCard.value = response.message()
}
})
}
fun updateGrouping(
itemFk: Int,
value: Int?,
warehouseFk: Int
itemFk: Int, value: Int?, warehouseFk: Int
) {
salix.updateGrouping(params = arrayListOf(warehouseFk, itemFk, value))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_responseItemCard.value = response.message()
}
})
}
fun updatePacking(
itemFk: Int,
value: Int,
warehouseFk: Int
itemFk: Int, value: Int, warehouseFk: Int
) {
salix.updatePacking(params = arrayListOf(warehouseFk, itemFk, value))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_responseItemCard.value = response.message()
}
})
}
fun updatePackingTypeSalix(itemFk: Int, itemPackingTypeFk: String) {
salix.updateItem(itemFk, hashMapOf("itemPackingTypeFk" to itemPackingTypeFk))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.body()!!.toString())
}
})
}
fun item_saveStems(
itemFk: Int,
value: Int?
fun updateStems(
itemFk: Int, value: Int?
) {
salix.updateItem(itemFk, hashMapOf("stems" to value))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_responseItemCard.value = response.message()
}
})
}
fun item_saveReference(
itemFk: Int,
value: Int
fun updateReference(
itemFk: Int, value: Int
) {
salix.updateItem(itemFk, hashMapOf("comment" to value))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(isError = false)
_responseItemCard.value = response.message()
}
})
}
fun getIdFromCodeSalix(code: String) {
salix.barcodes_toitem(code)
.enqueue(object : SalixCallback<String?>(context) {
salix.barcodes_toitem(code).enqueue(object : SalixCallback<String?>(context) {
override fun onSuccess(response: Response<String?>) {
_responseCode.value =
ResponseItemVO(
isError = false,
response = if (response.body() == null) "" else {
response!!.body().toString()
}
)
override fun onSuccess(response: Response<String?>) {
_responseCode.value = response.body() ?: ""
}
})
}
})
}
fun barcodesEditSalix(itemFk: Int, barCodeValue: String, delete: Boolean) {
if (delete) {
@ -249,14 +161,13 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
ItemBarCodeSalix(itemFk, barCodeValue)
)
}
.enqueue(object : SalixCallback<Any>(context) {
}.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message()!!)
}
})
override fun onSuccess(response: Response<Any>) {
_responseItemCard.value =
ResponseItemVO(isError = false, response = response.message()!!)
}
})
}
private val _responseinsert by lazy { MutableLiveData<ResponseItemVO>() }
@ -269,9 +180,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
file: File = File(urlImage),
fileRequestBody: RequestBody = RequestBody.create(MediaType.parse("image/jpeg"), file),
filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
"file",
file.name,
fileRequestBody
"file", file.name, fileRequestBody
),
) {
salix.uploadImage("catalog", itemFK, filePart)
@ -294,5 +203,3 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
})
}
}
class itemGetSimilar(var a: Int, var b: Int, var c: String, var d: Boolean)

View File

@ -2,10 +2,10 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
import android.widget.ImageView
import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentItemproposalBinding
@ -29,7 +29,6 @@ class ItemProposalFragment(
private var adapter: ItemProposalAdapter? = null
private var listProposal: ArrayList<ItemProposal> = ArrayList()
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
private var hideLoad = true
private var layoutManager: LinearLayoutManager? = null
private var filter = true
@ -73,10 +72,8 @@ class ItemProposalFragment(
val iconFilter = ImageView(context)
iconFilter.setImageResource(R.drawable.filter_outline)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconFilter.tooltipText = getTooltip(R.drawable.filter_outline)
}
resources.getDrawable(R.drawable.filter_outline, resources.newTheme())
iconFilter.tooltipText = getTooltip(R.drawable.filter_outline)
ResourcesCompat.getDrawable(resources, R.drawable.filter_outline, resources.newTheme())
listIcons.add(iconFilter)
binding.mainToolbar.toolbarIcons.adapter =
@ -117,13 +114,9 @@ class ItemProposalFragment(
override fun observeViewModel() {
with(viewModel) {
itemProposallist.observe(viewLifecycleOwner) { it ->
if (hideLoad) {
} else {
hideLoad = true
}
itemProposalList.observe(viewLifecycleOwner) { it ->
listProposal = ArrayList()
if (!it.list.isNullOrEmpty()) {
if (it.list.isNotEmpty()) {
it.list.forEach {
listProposal.add(it)

View File

@ -8,18 +8,15 @@ class ItemCardVO(
var value7: String? = null,
var image: String? = null,
var size: Int? = null,
var stems: String?,
var itemCost: String?,
var stems: String? = null,
var itemCost: String? = null,
var category:String? = null,
var producer: String? = null,
var origin: String? = null,
//var nicho: Int? = null,
var reserva: Int? = null,
var enNicho: Int? = null,
var available: Int? = null,
//var enAltillo: Int? = null,
var repo: Int? = null,
//var total: Int? = null,
var min: Int? = null,
var grouping: Int? = null,
var packing: Int? = null,
@ -27,17 +24,14 @@ class ItemCardVO(
var tag5: String? = null,
var tag6: String? = null,
var tag7: String? = null,
var isError: Boolean = false,
var errorMessage: String = "",
var urlImage200: String? = null,
var urlImage: String? = null,
var itemPackingTypeFk: String? = null,
var reference: String? = null,
var buyer: String? = null,
//sergio para modificar la llamada de itemCard a item_getInfo
var vVisibleItemShelving: Int? = null, // = enAltillo
var visible: Int? = null,// = total
var unlocated: Int? = null //= enNicho
var vVisibleItemShelving: Int? = null,
var visible: Int? = null,
var unlocated: Int? = null
)

View File

@ -6,9 +6,7 @@ class ItemPackingType (
var code:String= "",
var description:String = "",
var isActive:Boolean = false,
var isError: Boolean = false,
var errorMessage:String = ""
var isActive:Boolean = false
)
class ItemPackingTypeList (

View File

@ -21,9 +21,6 @@ class ItemProposal(
var counter: Int? = null,
var minQuantity: Int? = null,
var isError: Boolean = false,
var errorMessage: String = ""
)
class ItemProposalList(

View File

@ -1,7 +1,6 @@
package es.verdnatura.presentation.view.feature.buffer.fragment
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import es.verdnatura.R
import es.verdnatura.databinding.FragmentBufferBinding
import es.verdnatura.domain.toInt
@ -72,10 +71,14 @@ class BufferFragment(
override fun observeViewModel() {
with(viewModel) {
itembuffertype.observe(viewLifecycleOwner, Observer {
binding.mainToolbar.backButton.performClick()
itemBufferType.observe(viewLifecycleOwner) {
if (itemBufferType.value == false) {
ma.messageWithSound(getString(R.string.errorInput), isError = true, isPlayed = true, isToasted = true)
} else {
binding.mainToolbar.backButton.performClick()
}
})
}
}
}

View File

@ -4,52 +4,44 @@ import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.google.gson.JsonObject
import es.verdnatura.R
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.ResponseItemVO
import retrofit2.Response
class BufferFragmentViewModel(val context: Context) : BaseViewModel(context) {
private val _itembuffertype by lazy { MutableLiveData<ResponseItemVO>() }
val itembuffertype: LiveData<ResponseItemVO>
get() = _itembuffertype
private val _itemBufferType by lazy { MutableLiveData<Boolean>() }
val itemBufferType: LiveData<Boolean>
get() = _itemBufferType
private val _bufferloadresponse by lazy { MutableLiveData<ResponseItemVO>() }
val bufferloadresponse: LiveData<ResponseItemVO>
get() = _bufferloadresponse
private val _bufferLoadResponse by lazy { MutableLiveData<String>() }
val bufferLoadResponse: LiveData<String>
get() = _bufferLoadResponse
fun bufferSetTypeByName(vBufferFk: Int, vType: String) {
salix.buffer_setTypeByName(params = listOf(vBufferFk, vType).formatWithQuotes())
.enqueue(object : SalixCallback<List<JsonObject>>(context) {
override fun onSuccess(response: Response<List<JsonObject>>) {
var responseCall = response.body()!![0].entrySet().first().value.toString()
_itembuffertype.value = ResponseItemVO(
isError = responseCall != "1",
errorMessage = if (responseCall == "0") {
context.getString(R.string.errorOperation)
} else {
""
}
)
super.onSuccess(response)
_itemBufferType.value =
response.body()?.get(0)?.entrySet()?.first()?.value.toString() == "1"
if (_itemBufferType.value == true) {
super.onSuccess(response)
}
}
})
}
fun expeditionLoadingAdd(vExpeditionFk: Int, vBufferFk: Int) {
salix.expeditionLoadingAdd(arrayListOf(vExpeditionFk, vBufferFk), schema = "srt")
salix.expeditionLoadingAdd(
arrayListOf(vExpeditionFk, vBufferFk),
schema = "srt"
)
.enqueue(object : SalixCallback<List<Map<String, Any>>>(context) {
override fun onSuccess(response: Response<List<Map<String, Any>>>) {
_bufferloadresponse.value =
ResponseItemVO(
isError = false,
response = response.body()!![0]["vMessage"].toString()
)
_bufferLoadResponse.value = response.body()!![0]["vMessage"].toString()
}
})

View File

@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.buffer.fragment
import android.media.MediaPlayer
import android.view.View.GONE
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
@ -11,8 +10,8 @@ import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnSmartTagRowClickListener
import es.verdnatura.presentation.view.component.CustomDialogList
import es.verdnatura.presentation.view.feature.buffer.fragment.adapter.BufferAdapter
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.smarttag.adapter.BufferAdapter
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
class BufferLoadFragment(
@ -65,7 +64,7 @@ class BufferLoadFragment(
)
)
customDialogList.setTitle(getString(R.string.scanBuffer))
tagsAdapter!!.notifyDataSetChanged()
tagsAdapter!!.notifyItemInserted(listTags.size - 1)
if (listTags.size == 2) {
viewModel.expeditionLoadingAdd(
@ -89,20 +88,23 @@ class BufferLoadFragment(
override fun observeViewModel() {
with(viewModel) {
bufferloadresponse.observe(viewLifecycleOwner, Observer {
bufferLoadResponse.observe(viewLifecycleOwner) {
if (it.response == getString(R.string.registerAdded)) {
ma.messageWithSound(
it,
isError = it != getString(R.string.registerAdded),
isPlayed = true,
isToasted = true
)
it.response?.let { it1 -> ma.messageWithSound(it1, false, true) }
} else {
ma.messageWithSound(it.response, isError = true, true)
}
listTags.clear()
tagsAdapter!!.notifyDataSetChanged()
tagsAdapter!!.notifyItemRangeRemoved(
0, 2
)
customDialogList.dismiss()
showExpeditionOrBufferScan()
})
}
}
@ -138,8 +140,8 @@ class BufferLoadFragment(
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
if (!customDialogList.getValue().isNullOrEmpty()) {
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (customDialogList.getValue().isNotEmpty()) {
try {
checkLoadExpedition(customDialogList.getValue().toInt())
} catch (ex: Exception) {

View File

@ -1,4 +1,4 @@
package es.verdnatura.presentation.view.feature.smarttag.adapter
package es.verdnatura.presentation.view.feature.buffer.fragment.adapter
import android.view.LayoutInflater
@ -12,7 +12,7 @@ import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
class BufferAdapter(
private val items: List<SmartTag>,
private val OnSmartTagRowClickListener: OnSmartTagRowClickListener,
private val onSmartTagRowClickListener: OnSmartTagRowClickListener,
private var showDelete: Boolean = true
): RecyclerView.Adapter<BufferAdapter.ItemHolder> () {
@ -29,7 +29,7 @@ class BufferAdapter(
holder.bind(items[position])
holder.binding.root.setOnClickListener {
OnSmartTagRowClickListener.OnSmartTagRowClickListener(items[position])
onSmartTagRowClickListener.OnSmartTagRowClickListener(items[position])
}
}

View File

@ -1,10 +1,7 @@
package es.verdnatura.presentation.view.feature.buscaritem.fragment
import android.content.Context
import android.os.Build
import android.view.inputmethod.EditorInfo
import androidx.annotation.RequiresApi
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentBuscarItemBinding
@ -32,7 +29,6 @@ class BuscarItemFragment(
override fun getLayoutId(): Int = R.layout.fragment_buscar_item
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
binding.mainToolbar.toolbarTitle.text = getString(R.string.getubicaition)
setEvents()
@ -42,7 +38,6 @@ class BuscarItemFragment(
super.init()
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setEvents() {
binding.editItemFk.requestFocus()
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
@ -54,7 +49,7 @@ class BuscarItemFragment(
)
)
} catch (ex: Exception) {
ma.messageWithSound(ex.message.toString(), true, true)
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
}
binding.editItemFk.setText("")
ma.hideKeyboard(binding.editItemFk)
@ -76,12 +71,12 @@ class BuscarItemFragment(
override fun observeViewModel() {
with(viewModel) {
loadLocationList.observe(viewLifecycleOwner, Observer { event ->
loadLocationList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
event.getContentIfNotHandled().notNull { itemResponse ->
try {
adapter = LocationAdapter(it.list, pasillerosItemClickListener!!)
adapter = LocationAdapter(itemResponse.list, pasillerosItemClickListener!!)
binding.locationRecyclerview.adapter = adapter
binding.locationRecyclerview.layoutManager =
LinearLayoutManager(
@ -96,10 +91,16 @@ class BuscarItemFragment(
isPlayed = true
)
}
binding.mainToolbar.toolbarTitle.text =
getString(R.string.item) + itemFk + " " + getString(R.string.visibleTotal) + it.list.sumOf { it.visible }
binding.mainToolbar.toolbarTitle.text = (
getString(
R.string.itemsTotal,
itemFk,
getString(R.string.visibleTotal),
itemResponse.list.sumOf { it.visible })
)
}
})
}
}
}

View File

@ -19,8 +19,6 @@ class BuscarItemViewModel(val context: Context) : BaseViewModel(context) {
val loadLocationList: LiveData<Event<LocationListVO>> = _locationList.map { Event(it) }
fun itemshelvingGetInfo(itemFk: Any) {
//salix falla fecha
// silex.searchItemsUbicador(itemFk)
salix.itemshelvingGetInfo(params = arrayListOf(itemFk).formatWithQuotes())
.enqueue(object : SalixCallback<List<ItemLocationVO>>(context) {
override fun onSuccess(response: Response<List<ItemLocationVO>>) {

View File

@ -1,28 +1,22 @@
package es.verdnatura.presentation.view.feature.buscaritem.model
import android.os.Build
import androidx.annotation.RequiresApi
import es.verdnatura.domain.isoToString
class ItemLocationVO @RequiresApi(Build.VERSION_CODES.O) constructor(
class ItemLocationVO(
var Parking: String = "",
var Matricula: String = "",
var visible: Int = 0,
var itemFk: Int = 0,
val isError: Boolean = false,
var errorMessage: String = "",
var priority: Int = 0
) {
@RequiresApi(Build.VERSION_CODES.O)
var created: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get(){
var created: String = ""
get() {
return field.isoToString()
}
}
class LocationListVO(
var list: List<ItemLocationVO> = listOf()
var list: List<ItemLocationVO> = listOf()
)

View File

@ -1,32 +1,25 @@
package es.verdnatura.presentation.view.feature.calidad.model
//import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
class BuyerVO (
var userFk:Int,
var nickname:String,
var isError:Boolean = false,
var errorMessage:String = ""
class BuyerVO(
var userFk: Int,
var nickname: String,
)
class BuyerListVO (
class BuyerListVO(
var list: List<BuyerVO> = listOf()
)
class ItemBuyerVO (
var id:String = "",
var itemFk:String = "",
var longName:String = "",
var image:String = "",
var parking:String = "",
var shelvingFk:String = "",
var visible:String = "",
var created:String = "",
var stars:String = "",
var isError:Boolean = false,
var errorMessage:String = "",
var showStars:Boolean = false,
class ItemBuyerVO(
var id: String = "",
var itemFk: String = "",
var longName: String = "",
var image: String = "",
var parking: String = "",
var shelvingFk: String = "",
var visible: String = "",
var created: String = "",
var stars: String = "",
var showStars: Boolean = false,
var iconResourceOk: Int = 0,
var iconResourceKo: Int = 0
)

View File

@ -1,4 +1,4 @@
package es.verdnatura.presentation.view.feature.reubication.adapter
package es.verdnatura.presentation.view.feature.claim.fragment.reubication.adapter
import android.content.Context
import android.view.LayoutInflater
@ -10,7 +10,7 @@ import es.verdnatura.databinding.ItemArticleRowReubicationFragmentBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.OnReubicationClickListener
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
class ReubicatorAdapter(

View File

@ -1,4 +1,4 @@
package es.verdnatura.presentation.view.feature.reubication.adapter
package es.verdnatura.presentation.view.feature.claim.fragment.reubication.adapter
import android.content.Context
import android.view.LayoutInflater
@ -8,7 +8,7 @@ import es.verdnatura.R
import es.verdnatura.databinding.ItemPlacementReubicationRowBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.reubication.model.PlacementReubication
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.PlacementReubication
class ReubicatorPlacementAdapter(
private val items: List<PlacementReubication>,

View File

@ -1,9 +1,8 @@
package es.verdnatura.presentation.view.feature.reubication.fragment
package es.verdnatura.presentation.view.feature.claim.fragment.reubication.fragment
import android.annotation.SuppressLint
import android.content.Context
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
@ -14,8 +13,8 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.OnReubicationClickListener
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
import es.verdnatura.presentation.view.feature.reubication.adapter.ReubicatorAdapter
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.adapter.ReubicatorAdapter
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
@ -63,7 +62,7 @@ class ReubicationCollectionFragment(
for (item in list) {
item.code = shelving.uppercase()
if (!item.carros.isNullOrEmpty()) {
if (item.carros.isNotEmpty()) {
for (i in item.carros) {
i.visible = "(" + i.visible + ")"
}
@ -90,7 +89,9 @@ class ReubicationCollectionFragment(
}
binding.collectionSwipe.setOnRefreshListener {
callItemShelvingReturn()
viewModel.itemShelvingAlternative(
shelvingFk = shelving,
)
binding.collectionSwipe.isRefreshing = false
}
@ -104,7 +105,9 @@ class ReubicationCollectionFragment(
scanPlate(binding.scanInput.text.toString().uppercase())
} else {
shelving = binding.scanInput.text.toString().uppercase()
callItemShelvingReturn()
viewModel.itemShelvingAlternative(
shelvingFk = shelving,
)
}
}
@ -131,7 +134,10 @@ class ReubicationCollectionFragment(
}
if (!found) {
ma.messageWithSound(
getString(R.string.itemScanetNotFound), true, true, isToasted = true
getString(R.string.itemScanetNotFound),
isError = true,
isPlayed = true,
isToasted = true
)
}
}
@ -146,7 +152,7 @@ class ReubicationCollectionFragment(
customDialogInputTwoValues.setInfoTextTwo(getString(R.string.shelving))
customDialogInputTwoValues.setDescription(messageDescrip)
.setValue(itemReubication.quantity.toString())
.setValue(itemReubication.quantity)
.setOkButton(getString(R.string.leaveItem)) {
customDialogMerge(itemReubication)
@ -175,12 +181,12 @@ class ReubicationCollectionFragment(
private fun customDialogMerge(itemReubication: Reubication) {
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
viewModel.itemShelving_merge(
viewModel.itemShelvingMerge(
itemReubication.id, customDialogInputTwoValues.getValueTwo().uppercase()
)
} else {
ma.messageWithSound(
getString(R.string.returnScan), true, true, isToasted = true
getString(R.string.returnScan), isError = true, isPlayed = true, isToasted = true
)
}
customDialogInputTwoValues.setValue("")
@ -204,38 +210,28 @@ class ReubicationCollectionFragment(
if (it.list.isEmpty()) {
ma.messageWithSound(
getString(R.string.successReubication), false, true, getString(
getString(R.string.successReubication),
isError = false,
isPlayed = true,
getString(
R.string.info
)
)
ma.onMyBackPressed()
} else {
if (it.list[0].isError) {
ma.messageWithSound(
it.list[0].errorMessage, true, true, getString(
R.string.info
)
)
} else {
showList(it.list)
}
showList(it.list)
}
}
}
response.observe(viewLifecycleOwner) {
callItemShelvingReturn()
viewModel.itemShelvingAlternative(
shelvingFk = shelving,
)
}
}
}
private fun callItemShelvingReturn() {
viewModel.itemShelvingAlternative(
shelvingFk = shelving,
)
}
}

View File

@ -1,7 +1,6 @@
package es.verdnatura.presentation.view.feature.reubication.fragment
package es.verdnatura.presentation.view.feature.claim.fragment.reubication.fragment
import android.content.Context
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import es.verdnatura.R
@ -9,7 +8,6 @@ import es.verdnatura.databinding.FragmentGeneralBlackBinding
import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
class ReubicationFragment(var entrypoint: String) :
@ -45,7 +43,6 @@ class ReubicationFragment(var entrypoint: String) :
super.onPause()
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
@ -61,7 +58,7 @@ class ReubicationFragment(var entrypoint: String) :
shelvingScaned = binding.scanInput.text.toString()
viewModel.itemShelvingAlternative(
shelvingFk = binding.scanInput.text.toString(),
)
)
}
@ -80,40 +77,25 @@ class ReubicationFragment(var entrypoint: String) :
if (it.list.isEmpty()) {
ma.messageWithSound(
getString(R.string.errorReubication), true, true, getString(
getString(R.string.errorReubication),
isError = true,
isPlayed = true,
getString(
R.string.info
)
)
} else {
if (it.list[0].isError) {
ma.messageWithSound(
it.list[0].errorMessage, true, true, getString(
R.string.info
)
)
} else {
ma.openFragmentReubications(it.list, shelvingScaned)
createReubications(it.list)
}
}
}
}
}
}
private fun createReubications(list: List<Reubication>) {
ma.openFragmentReubications(list as MutableList<Reubication>, shelvingScaned)
}
}

View File

@ -1,4 +1,4 @@
package es.verdnatura.presentation.view.feature.reubication.model
package es.verdnatura.presentation.view.feature.claim.fragment.reubication.model
import com.google.gson.annotations.SerializedName
@ -16,8 +16,6 @@ class Reubication(
@SerializedName(value = "carros", alternate = ["shelvings"])
var carros: MutableList<PlacementReubication> = mutableListOf(),//placements
var pickingOrder:Int=0,//no
var isError: Boolean=false,
var errorMessage: String=""
)
class PlacementReubication(

View File

@ -1,13 +1,13 @@
@file:Suppress("UNUSED_ANONYMOUS_PARAMETER")
package es.verdnatura.presentation.view.feature.claim.fragment
package es.verdnatura.presentation.view.feature.claim.fragment.ubication
import android.view.View.GONE
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentGeneralBlackBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.GeneralAdapter
import es.verdnatura.presentation.common.GeneralItem
@ -16,7 +16,7 @@ import es.verdnatura.presentation.common.hideKeyboard
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogList
class ClaimFragment(
class ClaimUbicationFragment(
var entryPoint: String = ""
) : BaseFragment<FragmentGeneralBlackBinding, ClaimViewModel>(
ClaimViewModel::class
@ -31,7 +31,7 @@ class ClaimFragment(
private var claimAdapter: GeneralAdapter? = null
companion object {
fun newInstance(entryPoint: String) = ClaimFragment(entryPoint)
fun newInstance(entryPoint: String) = ClaimUbicationFragment(entryPoint)
}
override fun init() {
@ -73,13 +73,12 @@ class ClaimFragment(
override fun observeViewModel() {
with(viewModel) {
responseadd.observe(viewLifecycleOwner, Observer {
responseadd.observe(viewLifecycleOwner) {
customDialogList.dismiss()
listClaims.clear()
claimAdapter!!.notifyDataSetChanged()
showInputClaim()
})
}
}
}
@ -107,7 +106,7 @@ class ClaimFragment(
val nameClaim: String = getTextScaned(listClaims.size + 1) + itemScaned
customDialogList.setTitle(getTextToPosition(listClaims.size + 1))
listClaims.add(GeneralItem(itemScaned, nameClaim))
claimAdapter!!.notifyDataSetChanged()
claimAdapter!!.notifyItemInserted(listClaims.size - 1)
}
@ -130,11 +129,18 @@ class ClaimFragment(
if (customDialogList.getValue().isNotEmpty()) {
addItem(customDialogList.getValue())
if (listClaims.size > 1) {
viewModel.itemShelvingAddByClaim(
listClaims.first().code!!.toInt(),
customDialogList.getValue().uppercase()
)
customDialogList.dismiss()
try {
viewModel.itemShelvingAddByClaim(
listClaims.first().code!!.toInt(),
customDialogList.getValue().uppercase()
)
customDialogList.dismiss()
} catch (e: Exception) {
getString(R.string.errorInput).toast(requireContext())
listClaims.clear()
claimAdapter!!.notifyItemRangeRemoved(0,1)
showInputClaim()
}
}
}

View File

@ -1,4 +1,4 @@
package es.verdnatura.presentation.view.feature.claim.fragment
package es.verdnatura.presentation.view.feature.claim.fragment.ubication
import android.content.Context
import androidx.lifecycle.LiveData

View File

@ -2174,7 +2174,7 @@ class CollectionFragment(
private fun showQuantityDialog(position: Int) {
try {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
.setValue("").setOkButtonAdd(getString(R.string.Agregar)) {
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
scanRequest()

View File

@ -2225,7 +2225,7 @@ class CollectionFragmentPicker(
//FALTAS / BASURA / SPLIT
private fun showQuantityDialog(position: Int) {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
.setValue("")
.setOkButtonAdd(getString(R.string.Agregar)) {

View File

@ -2145,7 +2145,7 @@ class CollectionFragmentPreChecker(
//FALTAS / BASURA / SPLIT
private fun showQuantityDialog(position: Int) {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
.setValue("")
//Tarea4495

View File

@ -9,6 +9,7 @@ import es.verdnatura.MobileApplication
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
@ -225,7 +226,13 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
override fun onSuccess(response: Response<CollectionVO>) {
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
try {
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
} catch (
ex: Exception
) {
ex.toast(context)
}
}
})
@ -279,8 +286,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun collectionGetId(
ticketFk: Int,
sectorFk: Int,
@ -469,10 +474,11 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
fun collectionAddWithReservation(
item: Int,
quantity: Int,
ticketSelected: Int
ticketSelected: Int,
saleGroupFk :Int ?
) {
salix.collectionAddWithReservation(
params = arrayListOf(item, quantity, ticketSelected)
params = arrayListOf(item, quantity, ticketSelected, saleGroupFk)
).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_responseCollectionAddItem.value =

View File

@ -4,7 +4,6 @@ import android.app.AlertDialog
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
@ -167,7 +166,7 @@ class CollectionShowTicketFragment(
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 (!binding.scanInput.text.toString().isNullOrEmpty()) {
buttonPushedGetCollection = false
try {
viewModel.getSales(
binding.scanInput.text.toString().toInt(), print = "0", type

View File

@ -33,7 +33,6 @@ class ControladorFragment :
override fun init() {
binding.scanInput.visibility = VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
setEvents()
@ -78,29 +77,23 @@ class ControladorFragment :
)
.setOkButton(getString(R.string.aware)) {
customDialogWarning.dismiss()
viewModel.collectionTicketGet(
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(
ConstAndValues.SECTORFK
),
viewModel.getSales(
collectionFk = binding.scanInput.text.toString()
.toInt(),
print = "0",
type = ConstAndValues.ON_CHECKING
print = false,
source = ConstAndValues.ON_CHECKING
)
}.setKoButton(getString(R.string.cancel)){
}.setKoButton(getString(R.string.cancel)) {
binding.scanInput.setText("")
binding.scanInput.requestFocus()
customDialogWarning.dismiss()
}.show()
customDialogWarning.currentFocus
} else {
viewModel.collectionTicketGet(
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(
ConstAndValues.SECTORFK
),
viewModel.getSales(
collectionFk = binding.scanInput.text.toString().toInt(),
print = "0",
type = ConstAndValues.ON_CHECKING
print = false,
source = ConstAndValues.ON_CHECKING
)
}
})
@ -116,17 +109,12 @@ class ControladorFragment :
override fun observeViewModel() {
with(viewModel) {
collectionTicketList.observe(viewLifecycleOwner, Observer {
collectionTicketList.observe(viewLifecycleOwner) {
binding.scanInput.setText("")
if (it.isError) {
ma.messageWithSound(it.errorMessage, isError = true, isPlayed = false)
} else {
if (!goBack) navigateToCollectionList(it)
goBack = false
if (!goBack) navigateToCollectionList(it)
goBack = false
}
})
}
}

View File

@ -5,8 +5,6 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.collection.mapper.map
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
@ -32,33 +30,11 @@ class ControladorViewModel(var context: Context) : BaseViewModel(context) {
salix.getSalesFromTicketOrCollection(collectionFk, print, 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>) {
if (response.body() != null) {
_collectionTicketList.value = response.body()?.let { it.map(context) }
} else {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
_collectionTicketList.value = response.body()?.let { it.map(context) }
}
})
}
fun collectionTicketGet(collectionFk: Int, sectorFk: Int, print: String, type: String) {
getSales(collectionFk, false, type)
}
}

View File

@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.util.TypedValue
import android.view.View.GONE
import android.view.inputmethod.EditorInfo
@ -26,7 +25,7 @@ import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ControlVehiculoFragment(
var tagName: String = ""
private var tagName: String = ""
) : BaseFragment<FragmentVehiclecontrolBinding, ControlVehiculoViewModel>(
ControlVehiculoViewModel::class
) {
@ -86,14 +85,9 @@ class ControlVehiculoFragment(
val iconVehicleOut = ImageView(context)
iconVehicleOut.setImageResource(R.drawable.car_off)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
iconVehicleOut.tooltipText = getTooltip(R.drawable.car_off)
}
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
iconVehicleOut.tooltipText = getTooltip(R.drawable.car_off)
when (direction) {
"OUT" -> {
@ -141,7 +135,7 @@ class ControlVehiculoFragment(
.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
if (tagName == HistoricoVehiculoFragment.TAG) {
ma.onMyBackPressed()
}
@ -171,19 +165,24 @@ class ControlVehiculoFragment(
private fun insertControlTimeVehicle(plateNumber: String, direction: String) {
if (direction.equals("HISTORY")) {
when (direction) {
"HISTORY" -> {
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titleHistoricalHide)), plateNumber
)
}
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titleHistoricalHide)), plateNumber
)
} else if (direction.equals("IN")) {
viewModel.machineWorker_add(plateNumber)
"IN" -> {
viewModel.machineWorkerUpdate(plateNumber)
}
} else if (direction.equals("OUT")) {
viewModel.machineWorker_update(plateNumber)
"OUT" -> {
viewModel.machineWorkerUpdate(plateNumber)
}
} else if (direction.equals("")) {
ma.openFragmentPickers(true)
"" -> {
ma.openFragmentPickers(true)
}
}
customDialogInput.setValue("")
@ -201,6 +200,7 @@ class ControlVehiculoFragment(
try {
requireActivity().hideKeyboard()
} catch (e: Exception) {
println(e.message)
}
}
@ -216,7 +216,7 @@ class ControlVehiculoFragment(
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (!binding.scanInput.text.isNullOrEmpty()) {
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
if (tagName == HistoricoVehiculoFragment.TAG) {
showOptionsHistorical(binding.scanInput.text.toString())
} else {
showOptionsVehicleControl(binding.scanInput.text.toString())
@ -236,7 +236,7 @@ class ControlVehiculoFragment(
customDialogThreeButtons.setDescription(getString(R.string.doVehiclePlate) + plate + "?")
.setValue(plate)
if (isWorkedTimed.equals("UNREGISTERED")) {
if (isWorkedTimed == "UNREGISTERED") {
customDialogThreeButtons.setOkButtonTwo("COGER") {
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
getString(R.string.returnScan).toast(requireContext())
@ -296,44 +296,23 @@ class ControlVehiculoFragment(
override fun observeViewModel() {
with(viewModel) {
responseinsert.observe(viewLifecycleOwner) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false, isToasted = true)
} else {
if (it.response == "false") {
customDialog.setTitle(getString(R.string.error))
.setDescription(getString(R.string.reviewCAllhistorical))
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
} else {
if (it.response == "true") {
ma.openFragmentPickers(false)
}
}
}
responseUpdate.observe(viewLifecycleOwner) {
ma.openFragmentPickers(false)
}
responsecontrol.observe(viewLifecycleOwner) {
responseControl.observe(viewLifecycleOwner) {
if (it.response == "1") {
if (it == "1") {
isWorkedTimed = "REGISTERED"
setToolBar("OUT")
if (!tagName.equals(SacadorFragment.TAG)) {
if (tagName != SacadorFragment.TAG) {
ma.openFragmentPickers(false)
}
} else {
if (it.response == "0") {
if (it == "0") {
setToolBar("IN")
customDialogInput.setTitle(getString(R.string.vehiclecontrol))

View File

@ -3,11 +3,9 @@ package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
import android.content.Intent
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Build
import android.view.View.*
import android.view.View.INVISIBLE
import android.view.View.VISIBLE
import android.widget.ImageView
import androidx.annotation.RequiresApi
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
@ -34,7 +32,6 @@ class ControlVehiculoUsuarioFragment(
fun newInstance(vUserFK: Int) = ControlVehiculoUsuarioFragment(vUserFK)
}
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontroluser)
goBack = false
@ -44,7 +41,6 @@ class ControlVehiculoUsuarioFragment(
super.init()
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
@ -73,7 +69,7 @@ class ControlVehiculoUsuarioFragment(
}
private fun getExtensionFromUser() {
viewModel.sip_getExtensionSalix(vUserFK)
viewModel.sipGetExtensionSalix(vUserFK)
}
override fun onPause() {
@ -86,9 +82,9 @@ class ControlVehiculoUsuarioFragment(
userFk = mobileApplication.userId!!
if (userFk == vUserFK) {
var androidId: String = mobileApplication.dataStoreApp.readDataStoreKey(ANDROID_ID)
val androidId: String = mobileApplication.dataStoreApp.readDataStoreKey(ANDROID_ID)
viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
viewModel.deviceProduction_getnameDevice(
viewModel.deviceProductionGetnameDevice(
androidId
)
viewModel.deviceProductionUserGetWorker(
@ -131,13 +127,8 @@ class ControlVehiculoUsuarioFragment(
responsemachine.observe(viewLifecycleOwner) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
if (it.response == "false") {
if (it.type.equals("getWorker")) {
if (it.type == "getWorker") {
binding.assignedDevicename.text =
getString(R.string.noAssigned)
}
@ -151,26 +142,24 @@ class ControlVehiculoUsuarioFragment(
"getWorkerPlate" -> binding.registeredVehiclecontrol.text = it.response
}
}
}
}
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
responseGetExtensionFromUserId.observe(viewLifecycleOwner) {
if (it.isError) {
if (it!="") {
ma.messageWithSound(
getString(R.string.noSIP) + it.errorMessage + getString(R.string.user) + vUserFK,
getString(R.string.noSIP) +"."+ getString(R.string.user) + vUserFK,
isError = true,
true
)
} else {
callPicker(it.response)
callPicker(it.toString())
}
})
}
}

View File

@ -12,123 +12,97 @@ import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ResponseItemMachineControl
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
import org.json.JSONObject
import retrofit2.Response
class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
private val _responseinsert by lazy { MutableLiveData<ResponseItemVO>() }
val responseinsert: LiveData<ResponseItemVO>
get() = _responseinsert
private val _responseUpdate by lazy { MutableLiveData<Any>() }
val responseUpdate: LiveData<Any>
get() = _responseUpdate
private val _responsecontrol by lazy { MutableLiveData<ResponseItemVO>() }
val responsecontrol: LiveData<ResponseItemVO>
get() = _responsecontrol
private val _responseControl by lazy { MutableLiveData<String>() }
val responseControl: LiveData<String>
get() = _responseControl
private val _responsemachine by lazy { MutableLiveData<ResponseItemMachineControl>() }
val responsemachine: LiveData<ResponseItemMachineControl>
get() = _responsemachine
private val _responseGetExtensionFromUserId by lazy { MutableLiveData<ResponseItemVO>() }
val responseGetExtensionFromUserId: LiveData<ResponseItemVO>
private val _responseGetExtensionFromUserId by lazy { MutableLiveData<Any>() }
val responseGetExtensionFromUserId: LiveData<Any>
get() = _responseGetExtensionFromUserId
fun machineWorker_add(
fun machineWorkerUpdate(
plate: String
) {
//tarea 6276 vehiculo
salix.machineWorkerUpdateInTime(hashMapOf("plate" to plate))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) {
if (response.body().toString() == "false") {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_responseinsert.value = ResponseItemVO(
isError = false,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
),
response = "true"//6276
)
}
_responseUpdate.value = response.body()
}
})
}
fun machineWorker_update(
plate: String
) {
//Tarea 6276 //vehiculo
salix.machineWorkerUpdateInTime( params = hashMapOf("plate" to plate))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
/* fun machineWorker_update(
plate: String
) {
//Tarea 6276 //vehiculo
salix.machineWorkerUpdateInTime( params = hashMapOf("plate" to plate))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) {
override fun onSuccess(response: Response<Any>) {
//sergio devuelve true o false
//sergio devuelve true o false
if (response.body().toString() == "false") {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
if (response.body().toString() == "false") {
_responseinsert.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_responseinsert.value =
ResponseItemVO(isError = false, response = "")
_responseinsert.value =
ResponseItemVO(isError = false, response = "")
}
}
}
}
})
}
})
}*/
fun workerMachineryIsRegistered(userId: Int) {
salix.workerMachineryIsRegistered(arrayListOf(userId))
.enqueue(object : SalixCallback<String>(context) {
override fun onSuccess(response: Response<String>) {
_responsecontrol.value =
ResponseItemVO(isError = false, response = response.body()!!)
_responseControl.value =
response.body()!!
}
})
}
fun deviceProduction_getnameDevice(android_id: String) {
fun deviceProductionGetnameDevice(androidId: String) {
salix.deviceProductionsGetName(
Gson().toJson(
Filter(
mapOf("id" to true),
mapOf("android_id" to mapOf("eq" to android_id))
mapOf("android_id" to mapOf("eq" to androidId))
)
)
)
@ -198,7 +172,7 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
arrayListOf(userId)
).enqueue(object : SalixCallback<List<JsonObject>>(context) {
override fun onSuccess(response: Response<List<JsonObject>>) {
var myArray = response.body()
val myArray = response.body()
_responsemachine.value =
ResponseItemMachineControl(
isError = false,
@ -211,46 +185,24 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
)
}
override fun onError(t: Throwable) {
_responsemachine.value = ResponseItemMachineControl(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!),
type = ""
)
}
})
}
fun sip_getExtensionSalix(
fun sipGetExtensionSalix(
workerId: Int
) {
salix.sip_getExtension(
workerId
).enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseGetExtensionFromUserId.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) {
if (response.body() != null) {
_responseGetExtensionFromUserId.value = ResponseItemVO(
isError = false,
response = JSONObject(response.body()!!.toString()).get("extension")
.toString(),
errorMessage = ""
)
_responseGetExtensionFromUserId.value = if (response.body() != null) {
JSONObject(response.body()!!.toString()).get("extension").toString()
} else {
_responseGetExtensionFromUserId.value = ResponseItemVO(
isError = true,
response = "",
errorMessage = response.message()!!
)
""
}
}
})
}

View File

@ -34,11 +34,10 @@ class ExpeditionSummaryAdapter(
onAddressRowClickListener.onAddressRowClickListener(items[position])
}
holder.binding.txtConsignatario.setOnClickListener {
positionSelected = holder.absoluteAdapterPosition
notifyDataSetChanged()
/* holder.binding.txtConsignatario.setOnClickListener {
onAddressRowClickListener.onAddressRowClickListener(items[position])
}
*/
}
inner class ItemHolder(

View File

@ -34,21 +34,23 @@ class InfoFragment(var title: String) :
companyInfoList.observe(viewLifecycleOwner) {
if (it.list.isNotEmpty()) {
binding.itemName.text = it.list[0]?.name
binding.itemNif.text = it.list[0]?.nif
binding.itemAdress.text = it.list[0]?.street + "-" + it.list[0]?.city
binding.itemName.text = it.list[0].name
binding.itemNif.text = it.list[0].nif
binding.itemAdress.text =
getString(R.string.itemAddress, it.list[0].street, it.list[0].city)
}
}
freelanceInfoList.observe(viewLifecycleOwner) {
if (it.list.isNotEmpty()) {
binding.linearInfoFreelance.visibility=View.VISIBLE
binding.freelanceName.text = it.list[0]?.name
binding.freelanceNif.text = it.list[0]?.nif
binding.freelanceAddress.text = it.list[0]?.street + "-" + it.list[0]?.city
binding.freelanceName.text = it.list[0].name
binding.freelanceNif.text = it.list[0].nif
binding.freelanceAddress.text = getString(R.string.itemAddress, it.list[0].street, it.list[0].city)
}
}
}
}
}
}

View File

@ -1,12 +1,10 @@
package es.verdnatura.presentation.view.feature.delivery.fragments
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentExpeditionLogDeliveryBinding
@ -54,7 +52,7 @@ class LogExpeditionFragment(
})
}
*/
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
ma.hideBottomNavigation(View.GONE)
@ -65,7 +63,6 @@ class LogExpeditionFragment(
super.init()
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
binding.mainToolbar.switchButton.tooltipText = getString(R.string.expeditionMarkFound)
@ -73,10 +70,7 @@ class LogExpeditionFragment(
val listIcons: ArrayList<ImageView> = ArrayList()
val iconDelivery = ImageView(context)
iconDelivery.setImageResource(R.drawable.ic_delivery_truck)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconDelivery.tooltipText = getTooltip(R.drawable.ic_delivery_truck)
}
iconDelivery.tooltipText = getTooltip(R.drawable.ic_delivery_truck)
listIcons.add(iconDelivery)
binding.mainToolbar.toolbarIcons.adapter =
@ -112,7 +106,11 @@ class LogExpeditionFragment(
viewModel.expeditionGetLog(binding.scanInput.toInt())
originalItem = binding.scanInput.toInt()
binding.mainToolbar.toolbarTitle.text =
"""${getString(R.string.expedition)} ${binding.scanInput.text}"""
getString(
R.string.titleLogExpedition,
getString(R.string.expedition),
binding.scanInput.text
)
} catch (ex: Exception) {
getString(R.string.errorScanExpedition).toast(context, Toast.LENGTH_SHORT)
}
@ -124,14 +122,14 @@ class LogExpeditionFragment(
}
}
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
expeditionInfoList.observe(viewLifecycleOwner) {
createList(it.list)
setSwitchButon()
viewModel.get_routesFromExpedition(originalItem)
setSwitchButon()
viewModel.getRoutesFromExpedition(originalItem)
}
routeInfoList.observe(viewLifecycleOwner) {
@ -152,10 +150,9 @@ class LogExpeditionFragment(
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setSwitchButon() {
binding.mainToolbar.switchButton.setOnCheckedChangeListener { buttonView, isChecked ->
binding.mainToolbar.switchButton.setOnCheckedChangeListener { _, isChecked ->
binding.mainToolbar.switchButton.tooltipText =
if (isChecked) getString(R.string.expeditionMarkLost) else getString(R.string.expeditionMarkFound)

View File

@ -1,13 +1,11 @@
package es.verdnatura.presentation.view.feature.delivery.fragments
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import android.view.View
import android.widget.ImageView
import androidx.annotation.RequiresApi
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.gson.Gson
@ -53,7 +51,7 @@ class RoutesFragment(
override fun getLayoutId(): Int = R.layout.fragment_route
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
super.init()
setEvents()
@ -67,6 +65,7 @@ class RoutesFragment(
super.onViewCreated(view, savedInstanceState)
pendingOperations()
}
private fun pendingOperations() {
db = database(requireContext().applicationContext)
@ -85,23 +84,22 @@ class RoutesFragment(
)
}
if (pendingExpeditionSend.filter { it.stateCode == "DELIVERED" }.isNotEmpty()) {
if (pendingExpeditionSend.any { it.stateCode == "DELIVERED" }) {
viewModel.expeditionStateAddSalix(
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "DELIVERED" })
)
}
if (pendingExpeditionSend.filter { it.stateCode == "ON DELIVERY" }
.isNotEmpty()) {
if (pendingExpeditionSend.any { it.stateCode == "ON DELIVERY" }) {
viewModel.expeditionStateAddSalix(
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "ON DELIVERY" })
)
}
if (pendingExpeditionSend.filter { it.stateCode == "LOST" }.isNotEmpty()) {
if (pendingExpeditionSend.any { it.stateCode == "LOST" }) {
viewModel.expeditionStateAddSalix(
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "LOST" })
)
}
if (pendingExpeditionSend.filter { it.stateCode == "FOUND" }.isNotEmpty()) {
if (pendingExpeditionSend.any { it.stateCode == "FOUND" }) {
viewModel.expeditionStateAddSalix(
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "FOUND" })
)
@ -133,8 +131,6 @@ class RoutesFragment(
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
@ -152,11 +148,9 @@ class RoutesFragment(
iconRefresh.setImageResource(R.drawable.ic_info_refresh)
iconSearch.setImageResource(R.drawable.expedition_find)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconInfo.tooltipText = getTooltip(R.drawable.ic_info_delivery)
iconRefresh.tooltipText = getTooltip(R.drawable.ic_info_refresh)
iconSearch.tooltipText = getTooltip(R.drawable.expedition_find)
}
iconInfo.tooltipText = getTooltip(R.drawable.ic_info_delivery)
iconRefresh.tooltipText = getTooltip(R.drawable.ic_info_refresh)
iconSearch.tooltipText = getTooltip(R.drawable.expedition_find)
listIcons.add(iconInfo)
listIcons.add(iconRefresh)
listIcons.add(iconSearch)
@ -223,7 +217,6 @@ class RoutesFragment(
adapter!!.updateList(filteredList)
}
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
loadRouteList.observe(viewLifecycleOwner) { event ->
@ -249,14 +242,14 @@ class RoutesFragment(
if (it.isError) {
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
ma.messageWithSound(it.errorMessage, false, false, "", true)
ma.messageWithSound(it.errorMessage, isError = false, isPlayed =false, titleWithError = "", isToasted = true)
} else {
deleteSignTickets(it.response)
}
}
responseLoadList.observe(viewLifecycleOwner) {
ma.messageWithSound(getString(R.string.offline), false, false, "", true)
ma.messageWithSound(getString(R.string.offline), isError = false, isPlayed = false, titleWithError = "", isToasted = true)
ma.onApplicationEventAnimation(View.INVISIBLE)
createListRoutes(mutableListOf(), getSaved = true)
}
@ -283,7 +276,7 @@ class RoutesFragment(
db.routesDao().getAll() as MutableList<RouteInfo>
} else {
db.routesDao().delete()
db.routesDao().insert(list!!)
db.routesDao().insert(list)
list
}
@ -331,7 +324,7 @@ class RoutesFragment(
binding.routeRecyclerview.adapter = adapter
binding.routeRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter!!.notifyDataSetChanged()
// adapter!!.notifyDataSetChanged()
if (!binding.scanInput.text.isNullOrBlank()) {
filteredList(binding.scanInput.text.toString())
}

View File

@ -1,12 +1,10 @@
package es.verdnatura.presentation.view.feature.delivery.fragments
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.gson.Gson
@ -43,7 +41,7 @@ class SummaryFragment(
private var counterResponse = 0
private var positionOnScreen = 0
private var addressFkSelected = 0
private var routeSelected = 161059
private var routeSelected = 0
private var isScanning = false
private var positionSelected = -1
@ -54,7 +52,6 @@ class SummaryFragment(
override fun getLayoutId(): Int = R.layout.fragment_expedition_summary
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
super.init()
setEvents()
@ -77,7 +74,7 @@ class SummaryFragment(
}
private fun callBack(routeGetexpeditionsummary: Unit) {
routeGetexpeditionsummary
return routeGetexpeditionsummary
}
private fun setViews() {
@ -91,7 +88,6 @@ class SummaryFragment(
})
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
@ -107,10 +103,9 @@ class SummaryFragment(
iconLoad.setImageResource(R.drawable.camion)
iconExit.setImageResource(R.drawable.exit)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconLoad.tooltipText = getTooltip(R.drawable.camion)
iconExit.tooltipText = getTooltip(R.drawable.exit)
}
iconLoad.tooltipText = getTooltip(R.drawable.camion)
iconExit.tooltipText = getTooltip(R.drawable.exit)
listIcons.add(iconLoad)
listIcons.add(iconExit)
@ -139,28 +134,23 @@ class SummaryFragment(
private fun openLoadUnLoad(adress: Int) {
var entryPoint = Gson().toJson(
val entryPoint = Gson().toJson(
mutableMapOf(
"route" to routeSelected,
"address" to adress
"route" to routeSelected, "address" to adress
)
)
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.titleLoadTruck)),
entryPoint
PasillerosItemVO(title = getString(R.string.titleLoadTruck)), entryPoint
)
}
private fun setExpeditionsState(
list: MutableList<ExpeditionInfoLoadUnload>,
state: String,
address: Int
list: MutableList<ExpeditionInfoLoadUnload>, state: String, address: Int
) {
val listExpedition = list.filter { it.addressFk == address }.map { l ->
ExpeditionSalix(
expeditionFk = l.id,
stateCode = if (l.code == state) {
expeditionFk = l.id, stateCode = if (l.code == state) {
state
} else {
"FOUND"
@ -176,8 +166,7 @@ class SummaryFragment(
hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state })
)
)
/* callBack(viewModel.expeditionState_add(list.filter { it.addressFk == address }
.filter { it.code == state }, state))*/
isScanning = false
} else {
@ -186,20 +175,15 @@ class SummaryFragment(
alertDialog.setMessage(getString(R.string.expeditionTotal))
alertDialog.setButton(
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.save)
) { dialog, which ->
) { _, _ ->
counterCalls = 1
viewModel.expeditionStateAddSalix(hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state }))
/*
viewModel.expeditionState_add(list.filter { it.addressFk == address }
.filter { it.code == state }, state)
viewModel.expeditionState_add(list.filter { it.addressFk == address }
.filter { it.code != state }, "LOST")*/
}
alertDialog.setButton(
android.app.AlertDialog.BUTTON_NEUTRAL, getString(R.string.find)
) { dialog, which ->
) { _, _ ->
//createList(list.sortedByDescending { it.code })
}
alertDialog.show()
@ -219,8 +203,7 @@ class SummaryFragment(
isScanning = true
try {
markExpedition(
binding.scanInput.text.toString().toInt(),
"ON DELIVERY"
binding.scanInput.text.toString().toInt(), state
)
} catch (ex: Exception) {
@ -237,10 +220,9 @@ class SummaryFragment(
}
private fun markExpedition(expedNumber: Int, state: String) {
var found = false
if (myList.filter { it.addressFk == addressFkSelected }.filter { it.id == expedNumber }
.filter { it.code == state }.isNotEmpty()) {
.any { it.code == state }) {
ma.messageWithSound(getString(R.string.expeditionMarked), null, true)
} else {
for (exped in myList.filter { it.addressFk == addressFkSelected }) {
@ -252,9 +234,9 @@ class SummaryFragment(
}
}
if (found) {
ma.messageWithSound("", false, true, isToasted = false)
ma.messageWithSound(message ="", isError = false, isPlayed = true, isToasted = false)
} else {
ma.messageWithSound("", true, true, isToasted = null)
ma.messageWithSound(message = "", isError = true, isPlayed = true, isToasted = null)
}
}
@ -264,7 +246,6 @@ class SummaryFragment(
}
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
@ -288,7 +269,7 @@ class SummaryFragment(
}
responseStateAdd.observe(viewLifecycleOwner) {
if (!it.isError) {
counterResponse = counterResponse + 1
counterResponse += 1
if (counterResponse == counterCalls) {
callBack(viewModel.routeGetExpeditionSummary(routeSelected))
counterResponse = 0
@ -310,7 +291,7 @@ class SummaryFragment(
for ((indice, elemento) in myListSummary.withIndex()) {
if (indice >= startIndex) {
// Realiza las operaciones necesarias con el elemento
if (myList.filter { it.addressFk == elemento.addressFk }
.filter { it.code == state }.size != myList.filter { it.addressFk == elemento.addressFk }.size) {
addressFkSelected = myListSummary[indice].addressFk
@ -345,7 +326,6 @@ class SummaryFragment(
}
if (addressFkSelected != item.addressFk && isScanning) {
//actualiza el estado de las expediciones escaneadas
setExpeditionsState(myList, state, addressFkSelected)
}
@ -358,13 +338,12 @@ class SummaryFragment(
override fun onItemImageLoadRowClickListener(item: ExpeditionInfoSummary) {
openLoadUnLoad(item.addressFk)
}
}
)
})
binding.expeditionSummaryRecyclerview.adapter = adapter
binding.expeditionSummaryRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter!!.notifyDataSetChanged()
// adapter!!.notifyDataSetChanged()
//tarea 7278
//adapter!!.changePositionSelected(3)
}
@ -402,10 +381,13 @@ class SummaryFragment(
if (::myList.isInitialized) {
val countMarked =
myList.filter { it.addressFk == addressFkSelected }.filter { it.code == state }.size
binding.mainToolbar.toolbarTitle.text = "R:${routeSelected} C:${addressFkSelected} "
binding.mainToolbar.toolbarSubtitle.text = "${
countMarked
}/${myList.filter { it.addressFk == addressFkSelected }.size}"
binding.mainToolbar.toolbarTitle.text =
getString(R.string.routeTxtDouble, routeSelected, addressFkSelected)
binding.mainToolbar.toolbarSubtitle.text = getString(
R.string.subTitleRouteDouble,
countMarked,
myList.filter { it.addressFk == addressFkSelected }.size
)
}
}

View File

@ -20,6 +20,7 @@ import es.verdnatura.R
import es.verdnatura.databinding.FragmentTicketsBinding
import es.verdnatura.db.DeliveryDatabase
import es.verdnatura.domain.ConstAndValues.TOKEN
import es.verdnatura.domain.isoToString
import es.verdnatura.domain.notNull
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
@ -81,7 +82,8 @@ class TicketsFragment(
binding.mainToolbar.toolbarTitle.text = route.name
viewModel.getTickets(route.id)
db = database(requireContext().applicationContext)
println("route started ${route.started}")
println("route finished ${route.finished}")
}
private fun setTitle() {
@ -96,6 +98,9 @@ class TicketsFragment(
private fun setToolBar() {
ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed()
}
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
binding.mainToolbar.toolbarTitle.visibility = View.VISIBLE
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
@ -135,8 +140,15 @@ class TicketsFragment(
showSigned = !showSigned
changeVisibleSettings(showSigned)
changeColorIcon(iconSettings.drawable, showSigned)
binding.kmStart.setText(route?.kmStart?.toString())
binding.kmEnd.setText(route?.kmEnd?.toString())
binding.kmStart.setText(route.kmStart?.toString())
binding.kmEnd.setText(route.kmEnd?.toString())
binding.hourInit.setText(getHourDay(route.started.isoToString()))
if (route.started == "0000-00-00 00:00:00" || route.started > route.finished) {
binding.hourEnd.setText(getHourDay("00:00"))
} else {
binding.hourEnd.setText(getHourDay(route.finished.isoToString()))
}
}
@ -228,25 +240,28 @@ class TicketsFragment(
binding.kmStart.setText(route.kmStart.toString())
binding.kmEnd.setText(route.kmEnd.toString())
binding.hourInit.setText(getHourDay(route.started))
binding.hourEnd.setText(getHourDay(route.finished))
binding.saveButton.setOnClickListener {
route.kmStart = binding.kmStart.text.toString().toLong()
route.kmEnd = binding.kmEnd.text.toString().toLong()
route.started = addDateToTime(binding.hourInit.text.toString())
route.finished = addDateToTime(binding.hourEnd.text.toString())
println()
viewModel.routeUpdate(route)
}
binding.hourInit.setOnFocusChangeListener { view, b ->
binding.hourInit.setOnFocusChangeListener { _, b ->
if (b) {
showTimePicker(binding.hourInit)
}
}
binding.hourEnd.setOnClickListener {
showTimePicker(binding.hourEnd)
binding.hourEnd.setOnFocusChangeListener { _, b ->
if (b) {
showTimePicker(binding.hourEnd)
}
}
/* binding.hourEnd.setOnClickListener {
showTimePicker(binding.hourEnd)
}*/
}
override fun observeViewModel() {
@ -267,7 +282,7 @@ class TicketsFragment(
responseStateAdd.observe(viewLifecycleOwner) {}
response.observe(viewLifecycleOwner) {
if (!it.isError) {
ma.messageWithSound(it.response, false, false, "", true)
ma.messageWithSound(it.response, isError = false, isPlayed = false, titleWithError = "", isToasted = true)
}
}
responseUpdateRoute.observe(viewLifecycleOwner) {
@ -276,7 +291,7 @@ class TicketsFragment(
setToolBar()
}
responseLoadList.observe(viewLifecycleOwner) {
ma.messageWithSound(getString(R.string.offline), true, false, "", true)
ma.messageWithSound(getString(R.string.offline), isError = true, isPlayed = false, titleWithError = "", isToasted = true)
createLisTickets(mutableListOf(), getSaved = true)
}
}

View File

@ -1,7 +1,5 @@
package es.verdnatura.presentation.view.feature.delivery.model
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
@ -9,9 +7,7 @@ import com.google.gson.annotations.SerializedName
import es.verdnatura.db.MapTypeConverter
import es.verdnatura.domain.isoToString
import java.io.Serializable
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
class FreeLanceDeliveryInfoList(
var list: List<DeliveryInfo> = listOf()
@ -49,7 +45,6 @@ data class ExpeditionInfoLog(
var routeSalix: RouteSalix
) {
var created: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get() {
return field.isoToString()
}
@ -86,7 +81,6 @@ class RouteDelivery(
) {
var created: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get(){
return field.isoToString(returnOnlyDate = true)
}
@ -167,8 +161,8 @@ class RouteInfo(
var numberPlate: String?,
@SerializedName(value = "name", alternate = ["agencyName"])
var name: String,
var kmStart: Long,
var kmEnd: Long,
var kmStart: Long?,
var kmEnd: Long?,
var started: String,
var finished: String,
var header: Boolean = false,
@ -179,5 +173,3 @@ class RouteInfo(
return "$driver$id$name$numberPlate$m3$created$hour$"
}
}
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())

View File

@ -119,15 +119,10 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
_expeditionInfoLoadUnloadList.value =
response.body()?.let { ExpeditionList(it) }
}
override fun onError(t: Throwable) {
_responseLoadList.value = ResponseItemVO("", true, t.message.toString(), 0)
}
})
}
fun get_routesFromExpedition(
fun getRoutesFromExpedition(
expedition: Int
) {
salix.getRoutesFromExpedition(
@ -180,19 +175,11 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
}
]
}""".trim()
)
// silex.get_routesFromExpedition(expedition)
.enqueue(object : SalixCallback<List<RouteDelivery>>(context) {
).enqueue(object : SalixCallback<List<RouteDelivery>>(context) {
override fun onSuccess(response: Response<List<RouteDelivery>>) {
if (response.body() != null) {
_routeInfoList.value = response.body()?.let { RouteDeliveryList(it) }
}
}
_routeInfoList.value = response.body()?.let { RouteDeliveryList(it) }
override fun onError(t: Throwable) {
_routeInfoList.value = RouteDeliveryList()
super.onError(t)
}
})
@ -200,6 +187,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
fun expeditionStateAddSalix(expeditions: Any) {
// No se quita ResponseItem ya que en caso de fallo hay que guardar datos
salix.addExpeditionState(expeditions).enqueue(object : SalixCallback<Unit>(context) {
override fun onSuccess(response: Response<Unit>) {
_responseStateAdd.value = ResponseItemVO("", false, "", 0)
@ -211,7 +199,8 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
}
override fun onFailure(call: Call<Unit>, t: Throwable) {
_responseStateAdd.value = ResponseItemVO("", true, t.message.toString(), 0)
//Fallo de red guardamos pendientes
_responseStateList.value = ResponseItemVO("", true, t.message.toString(), 0)
}
})
@ -235,25 +224,14 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
fun routeGetExpeditionSummary(
route: Int
) {
//Tarea 6275
salix.routeGetExpeditionSummary(route)
.enqueue(object : SalixCallback<List<ExpeditionInfoSummary>>(context) {
override fun onSuccess(response: Response<List<ExpeditionInfoSummary>>) {
if (response.body() != null) {
_expeditionInfoSummary.value =
response.body()?.let { ExpeditionSummaryList(it) }
} else {
_expeditionInfoSummary.value = ExpeditionSummaryList()
}
}
override fun onError(t: Throwable) {
_expeditionInfoSummary.value = ExpeditionSummaryList()
super.onError(t)
_expeditionInfoSummary.value =
response.body()?.let { ExpeditionSummaryList(it) }
}
})
}
@ -289,7 +267,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
}
override fun onError(t: Throwable) {
_responseLoadList.value = ResponseItemVO("", true, t.message.toString(), 0)
_responseLoadList.value = ResponseItemVO("", true, t.message.toString(), 0)
}
})
@ -329,6 +307,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
arrayListOf(listTickets[0].Id, note).formatWithQuotes()
).enqueue(object : SalixCallback<Any>(context) {})
}
fun addNotesFromDropOff(
ticketObservation: TicketObservation
@ -337,16 +316,17 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
ticketObservation
).enqueue(object : SalixCallback<Any>(context) {})
}
fun updateNotesFromDropOff(
ticketFK:Long, description:String
ticketFK: Long, description: String
) {
salix.updateNoteFromDropOff(
where ="""{"ticketFk" : $ticketFK,"observationTypeFk":10}""" , params= hashMapOf("description" to description)
where = """{"ticketFk" : $ticketFK,"observationTypeFk":10}""",
params = hashMapOf("description" to description)
).enqueue(object : SalixCallback<Any>(context) {})
}
fun imageUpload(
warehouseId: Number,
companyId: Number,

View File

@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.diadeventa.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import androidx.recyclerview.widget.LinearLayoutManager
@ -18,7 +17,7 @@ import es.verdnatura.presentation.view.feature.diadeventa.adapter.DayOfSaleAdapt
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class DayOfSaleFragment(
var entryPoint: String = ""
var title: String = ""
) : BaseFragment<FragmentItemdayofsaleCardBinding, DayOfSaleViewModel>(DayOfSaleViewModel::class) {
private lateinit var customDialogList: CustomDialogList
@ -28,7 +27,7 @@ class DayOfSaleFragment(
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
companion object {
fun newInstance(entryPoint: String) = DayOfSaleFragment(entryPoint)
fun newInstance(title: String) = DayOfSaleFragment(title)
}
override fun onAttach(context: Context) {
@ -43,7 +42,7 @@ class DayOfSaleFragment(
customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext())
setEvents()
setToolBar(entryPoint)
setToolBar(title)
super.init()
}
@ -53,11 +52,7 @@ class DayOfSaleFragment(
val listIcons: ArrayList<ImageView> = ArrayList()
val iconParking = ImageView(context)
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
}
iconParking.tooltipText = getTooltip(R.drawable.ic_local_parking_black_24dp)
listIcons.add(iconParking)
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
@ -79,10 +74,14 @@ class DayOfSaleFragment(
binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
if (binding.scanInput.text.toString().isNotEmpty()) {
viewModel.itemShelvingGetSaleDate(binding.scanInput.text.toString())
binding.mainToolbar.toolbarTitle.text =
entryPoint + ":" + binding.scanInput.text.toString().uppercase()
getString(
R.string.doubleText,
title,
binding.scanInput.text.toString().uppercase()
)
}
binding.scanInput.setText("")
ma.hideKeyboard(binding.scanInput)
@ -119,21 +118,6 @@ class DayOfSaleFragment(
}
response.observe(viewLifecycleOwner) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
customDialog.setTitle(getString(R.string.info))
.setDescription(getString(R.string.parkingOk))
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
}
}
}
}
@ -156,6 +140,7 @@ class DayOfSaleFragment(
parking = customDialogList.getValue(),
scanItem = itemScan
)
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.dismiss()
}
customDialogList.setValue("")

View File

@ -3,74 +3,30 @@ package es.verdnatura.presentation.view.feature.diadeventa.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.map
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
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.ResponseItemVO
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDateList
import retrofit2.Response
class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
val response: LiveData<ResponseItemVO>
get() = _response
private val _itemShelvingSaleDateList by lazy { MutableLiveData<ItemShelvingSaleDateList>() }
val itemShelvingSaleDateList: LiveData<ItemShelvingSaleDateList>
get() = _itemShelvingSaleDateList
val loadItemShelvingSaleDateList: LiveData<Event<ItemShelvingSaleDateList>> = _itemShelvingSaleDateList.map { Event(it) }
fun itemShelvingGetSaleDate(vShelvingFK: String) {
//salix falla fecha
// silex.itemShelving_getSaleDate(vShelvingFK)
salix.itemShelvingGetSaleDate(params = listOf(vShelvingFK).formatWithQuotes())
.enqueue(object :
SalixCallback<List<ItemShelvingSaleDate>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<ItemShelvingSaleDate> = ArrayList()
listError.add(
ItemShelvingSaleDate(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_itemShelvingSaleDateList.value = ItemShelvingSaleDateList(listError)
}
.enqueue(object : SalixCallback<List<ItemShelvingSaleDate>>(context) {
override fun onSuccess(response: Response<List<ItemShelvingSaleDate>>) {
if (response.body() != null) {
_itemShelvingSaleDateList.value = response.body()?.let {
ItemShelvingSaleDateList(it)
}
} else {
if (!response.isSuccessful) {
val listError: ArrayList<ItemShelvingSaleDate> = ArrayList()
listError.add(
ItemShelvingSaleDate(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_itemShelvingSaleDateList.value = ItemShelvingSaleDateList(listError)
}
_itemShelvingSaleDateList.value = response.body()?.let {
ItemShelvingSaleDateList(it)
}
}
})
@ -78,9 +34,7 @@ class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
fun setParking(scanItem: String, parking: String) {
salix.setParking(arrayListOf(scanItem, parking).formatWithQuotes())
.enqueue(object :
SalixCallback<Any>(context) {
})
.enqueue(object : SalixCallback<Any>(context) {})
}
}

View File

@ -1,30 +1,24 @@
package es.verdnatura.presentation.view.feature.diadeventa.model
import android.os.Build
import androidx.annotation.RequiresApi
import es.verdnatura.domain.isoToString
class ItemShelvingSaleDate (
var itemFk:Int? = null,
var longName:String? = null,
// var dated:String? = null,
var amount:Int? = null,
var visible:Int? = null,
var stock:Int? = null,
var isError:Boolean = false,
var errorMessage:String = ""
) {
class ItemShelvingSaleDate(
var itemFk: Int? = null,
var longName: String? = null,
var amount: Int? = null,
var visible: Int? = null,
var stock: Int? = null,
) {
var dated: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get(){
return field.isoToString(returnOnlyDate = true)
}
get() {
return field.isoToString(returnOnlyDate = true)
}
}
class ItemShelvingSaleDateList(
var list:List<ItemShelvingSaleDate> = listOf()
)
class ItemShelvingSaleDateList(
var list: List<ItemShelvingSaleDate> = listOf()
)

View File

@ -25,6 +25,7 @@ import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHisto
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class HistoricoArticuloFragment(
@ -249,7 +250,7 @@ class HistoricoArticuloFragment(
private fun navigateToToday(it: ItemHistoricoListVO) {
var positionToday = 0
val sdf = SimpleDateFormat(getString(R.string.dateFormat))
val sdf = SimpleDateFormat(getString(R.string.dateFormat), Locale.getDefault())
val currentDate = sdf.format(Date())
for (item in it.list) {

View File

@ -16,8 +16,6 @@ class ItemHistoricoVO(
var balance: Int? = null,
var isTicket: Int? = 0,
var order: Int? = 0,
var isError: Boolean = false,
var errorMessage: String = ""
) {
var shipped: String = ""
@RequiresApi(Build.VERSION_CODES.O)

View File

@ -1,32 +1,26 @@
package es.verdnatura.presentation.view.feature.historicoshelving.model
import android.os.Build
import androidx.annotation.RequiresApi
import es.verdnatura.domain.isoToString
class ItemShelvingLog(
var itemFk:Int? = null,
var longName:String? = null,
var shelvingFk:String? = null,
var visible:Int? = null,
var accion:String? = null,
//var created:String? = null,
var code:String? = null,
var isError:Boolean = false,
var errorMessage:String = ""
){
@RequiresApi(Build.VERSION_CODES.O)
var itemFk: Int? = null,
var longName: String? = null,
var shelvingFk: String? = null,
var visible: Int? = null,
var accion: String? = null,
var code: String? = null,
) {
var created: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get(){
return field.isoToString(returnOnlyDate = false)
}
get() {
return field.isoToString(returnOnlyDate = false)
}
}
class ItemShelvingSaleDateList(
var list:List<ItemShelvingLog> = listOf())
var list: List<ItemShelvingLog> = listOf()
)
class ItemShelvingLogList(
var list:List<ItemShelvingLog> = listOf()
class ItemShelvingLogList(
var list: List<ItemShelvingLog> = listOf()
)

View File

@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.gson.Gson
import es.verdnatura.R
@ -50,7 +49,7 @@ class ShelvingLogFragment(
binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
if (binding.scanInput.text.toString().isNotEmpty()) {
viewModel.shelvings((binding.scanInput.text.toString()))
itemScan = binding.scanInput.text.toString()
}
@ -70,7 +69,7 @@ class ShelvingLogFragment(
override fun observeViewModel() {
with(viewModel) {
loadShelvingLogSalixList.observe(viewLifecycleOwner, Observer { event ->
loadShelvingLogSalixList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.itemshelvinglogRecyclerview.adapter = adapter
binding.itemshelvinglogRecyclerview.layoutManager =
@ -98,7 +97,7 @@ class ShelvingLogFragment(
}
}
})
}
}
}

View File

@ -30,9 +30,7 @@ class ShelvingLogSalix(
var isPrinted: Boolean? = null,
var priority: Int? = null,
var userFk: Int? = null,
var isRecyclable: Boolean? = null,
var isError: Boolean? = null,
var errorMessage: String? = null,
var isRecyclable: Boolean? = null
)
data class DeviceLogSalix(

View File

@ -1,9 +1,6 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
import android.os.Build
import android.view.View
import androidx.annotation.RequiresApi
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentHistoricovehiculoBinding
@ -13,7 +10,7 @@ import es.verdnatura.presentation.view.feature.historicovehiculo.adapter.Histori
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
class HistoricoVehiculoFragment(
private var numberPlate: String = ""
@ -45,15 +42,17 @@ class HistoricoVehiculoFragment(
}
}
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
loadHistoricoVehiculoList.observe(viewLifecycleOwner, Observer { event ->
loadHistoricoVehiculoList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
if (it.list.isEmpty()) {
ma.messageWithSound(
getString(R.string.lookWithpermission), isError = true, isPlayed = true, getString(
getString(R.string.lookWithpermission),
isError = true,
isPlayed = true,
getString(
R.string.info
)
)
@ -61,19 +60,23 @@ class HistoricoVehiculoFragment(
adapter = HistoricoVehiculoAdapter(it.list)
binding.historicovehiculoRecyclerview.adapter = adapter
binding.historicovehiculoRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
LinearLayoutManager(
requireContext(),
LinearLayoutManager.VERTICAL,
false
)
navigateToToday(it)
}
}
})
}
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun navigateToToday(it: ItemHistoricoVehiculoList) {
var positionToday = 0
val sdf = SimpleDateFormat(getString(R.string.dateFormat))
val sdf = SimpleDateFormat(getString(R.string.dateFormat), Locale.getDefault())
val currentDate = sdf.format(Date())
for (item in it.list) {

View File

@ -18,8 +18,6 @@ class HistoricoVehiculoViewModel(var context: Context) : BaseViewModel(context)
val loadHistoricoVehiculoList: LiveData<Event<ItemHistoricoVehiculoList>> = _historicovehiculoList.map { Event(it) }
fun machineWorkeGetHistorical(plateNumber: String, workerId:Int) {
//salix falla fecha
//silex.machineWorker_getHistorical(plateNumber,workerId)
salix.machineWorkerGetHistorical(arrayListOf(plateNumber,workerId).formatWithQuotes())
.enqueue(object :
SalixCallback<List<ItemHistoricoVehiculo>>(context) {

View File

@ -1,24 +1,17 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.model
import android.os.Build
import androidx.annotation.RequiresApi
import es.verdnatura.domain.isoToString
class ItemHistoricoVehiculo(
//var inTimed: String? = null,
var workerName: String? = null,
//var outTimed: String? = null,
var isError: Boolean = false,
var errorMessage: String = ""
) {
) {
var inTimed: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get(){
return field.isoToString()
}
get() {
return field.isoToString()
}
var outTimed: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get(){
get() {
return field.isoToString()
}

View File

@ -82,11 +82,8 @@ class InventoryParkingAdapter(
fun bind(item: ItemInventoryParking) {
binding.apply {
this.item = item
//Quitar if cuadndo se suba a producción https://redmine.verdnatura.es/issues/6193
imgItem.loadUrl(
if (item.urlImage.isNullOrBlank()) { "http://${item.url}/catalog/1600x900/$item.image"} else {
item.urlImage
}
"http://${item.url}/catalog/1600x900/${item.image}"
)
imgItem.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(

View File

@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.inventario.fragment
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
import android.widget.ImageView
import androidx.lifecycle.lifecycleScope
@ -26,7 +25,6 @@ import es.verdnatura.presentation.view.feature.inventario.adapter.InventoryAdapt
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
import ir.mirrajabi.searchdialog.core.SearchResultListener
import kotlinx.coroutines.launch
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
@ -35,8 +33,8 @@ class InventaryFragment :
private var adapter: InventoryAdapter? = null
private lateinit var customDialogInput: CustomDialogInput
private var listInvetory: ArrayList<ItemInventaryVO> = ArrayList()
private var listInvetoryAux: ArrayList<ItemInventaryVO> = ArrayList()
private var listInventory: ArrayList<ItemInventaryVO> = ArrayList()
private var listInventoryAux: ArrayList<ItemInventaryVO> = ArrayList()
private lateinit var customDialog: CustomDialogTwoButtons
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
private var layoutManager: LinearLayoutManager? = null
@ -69,33 +67,33 @@ class InventaryFragment :
)
}
binding.filterBuyer.setOnClickListener {
SimpleSearchDialogCompat(context,
SimpleSearchDialogCompat(
context,
getString(R.string.compradores),
getString(R.string.escribirparteNombre),
null,
items,
SearchResultListener { baseSearchDialogCompat, nombre, position ->
items
) { baseSearchDialogCompat, nombre, position ->
binding.filterBuyer.text = (nombre.title)
buyerId = nombre.getBuyerId()
binding.filterBuyer.text = (nombre.title)
buyerId = nombre.getBuyerId()
lifecycleScope.launch {
mobileApplication.dataStoreApp.editDataStoreKey(
BUYER,
nombre.getBuyerNickname()
)
mobileApplication.dataStoreApp.editDataStoreKey(
BUYERID,
nombre.getBuyerId()
)
}
// saveBuyer(nombre.getBuyerNickname(), nombre.getBuyerId())
viewModel.getInventory(
nombre.getBuyerId().toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
lifecycleScope.launch {
mobileApplication.dataStoreApp.editDataStoreKey(
BUYER,
nombre.getBuyerNickname()
)
baseSearchDialogCompat.dismiss()
}).show()
mobileApplication.dataStoreApp.editDataStoreKey(
BUYERID,
nombre.getBuyerId()
)
}
viewModel.getInventory(
nombre.getBuyerId().toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
)
baseSearchDialogCompat.dismiss()
}.show()
}
customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialogTwoButtons(requireContext())
@ -111,9 +109,7 @@ class InventaryFragment :
val iconReload = ImageView(context)
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
}
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
listIcons.add(iconReload)
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
@ -153,17 +149,17 @@ class InventaryFragment :
binding.filterItemFk.setOnKeyListener { v, keyCode, event ->
if (binding.filterItemFk.text.toString().isEmpty()) {
if (listInvetory.size != listInvetoryAux.size) {
listInvetory.removeAll(listInvetoryAux)
listInvetory.addAll(listInvetoryAux)
if (listInventory.size != listInventoryAux.size) {
listInventory.removeAll(listInventoryAux.toSet())
listInventory.addAll(listInventoryAux)
}
} else {
listInvetory.removeAll(listInvetoryAux)
listInventory.removeAll(listInventoryAux.toSet())
listInvetory.addAll(listInvetoryAux.filter {
listInventory.addAll(listInventoryAux.filter {
it.itemFk!!.toString().contains(
binding.filterItemFk.text.toString(), true
) || it.producer?.contains(
@ -187,7 +183,7 @@ class InventaryFragment :
override fun onResume() {
super.onResume()
if (binding.locationRecyclerview.layoutManager != null) {
if (firstVisiblePosition <= listInvetory.size) {
if (firstVisiblePosition <= listInventory.size) {
binding.locationRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
}
}
@ -200,32 +196,25 @@ class InventaryFragment :
}
inventaryList.observe(viewLifecycleOwner) { it ->
listInvetory = ArrayList()
listInvetoryAux = ArrayList()
listInventory = ArrayList()
listInventoryAux = ArrayList()
it.list.forEach {
if (it.nicho != 0) {
listInvetory.add(it)
listInvetoryAux.add(it)
listInventory.add(it)
listInventoryAux.add(it)
}
}
adapter = InventoryAdapter(listInvetory, object : OnInvetoryNichoClickListener {
adapter = InventoryAdapter(listInventory, object : OnInvetoryNichoClickListener {
override fun onInvetoryNichoClickListener(item: ItemInventaryVO) {
customDialog.setTitle(item.itemFk.toString() + "\n" + item.longName)
.setDescription(getString(R.string.quantityReal) + item.nicho + ")")
.setOkButton(getString(R.string.pull)) {
viewModel.itemTrash(
item.itemFk!!.toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
item.nicho!!,
false
)
//Tarea 7161
/* viewModel.itemSetVisibleDiscard(
item.itemFk!!.toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
item.nicho!!,
false
)*/
viewModel.itemSetVisibleDiscard(
item.itemFk!!.toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
item.nicho!!
)
itemClicked = item
customDialog.dismiss()
}.setOkButtonTwo(getString(R.string.titleUbicator)) {
@ -247,7 +236,7 @@ class InventaryFragment :
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.locationRecyclerview.layoutManager = layoutManager
if (firstVisiblePosition <= listInvetory.size) {
if (firstVisiblePosition <= listInventory.size) {
binding.locationRecyclerview.layoutManager!!.scrollToPosition(
firstVisiblePosition
)
@ -260,16 +249,16 @@ class InventaryFragment :
}
}
}
@SuppressLint("NotifyDataSetChanged")
private fun changeOfflineValue(item: ItemInventaryVO) {
try {
listInvetory.removeAt(listInvetory.indexOf(item))
listInvetoryAux.removeAt(listInvetoryAux.indexOf(item))
listInventory.removeAt(listInventory.indexOf(item))
listInventoryAux.removeAt(listInventoryAux.indexOf(item))
} catch (ex: Exception) {
ex.message!!.toast(requireContext())
}
adapter?.notifyDataSetChanged()
adapter?.notifyItemRemoved(listInventory.indexOf(item))
}
private fun createBuyerList(list: List<BuyerVO>) {

View File

@ -3,15 +3,13 @@ package es.verdnatura.presentation.view.feature.inventario.fragment
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.text.InputType
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import androidx.annotation.RequiresApi
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.gson.JsonArray
@ -21,8 +19,15 @@ import es.verdnatura.databinding.FragmentInventoryParkingBinding
import es.verdnatura.domain.notNull
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.view.component.*
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
import es.verdnatura.presentation.common.OnMoreClickListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.OnVisibleInventoryClickListener
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.common.itemScanValue
import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.component.CustomDialogList
import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
import es.verdnatura.presentation.view.feature.inventario.adapter.InventoryParkingAdapter
@ -31,6 +36,7 @@ import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingChec
import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisible
import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisibleZero
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
import timber.log.Timber.d
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class InventaryParkingFragment(
@ -67,7 +73,7 @@ class InventaryParkingFragment(
binding.inventoryParkingRecyclerview.layoutManager as LinearLayoutManager
scrollPosition = layoutManager.findFirstVisibleItemPosition()
} catch (exception: Exception) {
d(exception)
}
isBack = true
@ -80,7 +86,6 @@ class InventaryParkingFragment(
super.onAttach(context)
}
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
customDialogInput = CustomDialogInput(requireContext())
@ -108,7 +113,6 @@ class InventaryParkingFragment(
})
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
val iconAdd = ImageView(context)
@ -126,14 +130,11 @@ class InventaryParkingFragment(
val iconParkingFrom = ImageView(context)
iconParkingFrom.setImageResource(R.drawable.ic_eye_inventory)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconParkingFrom.tooltipText = getTooltip(R.drawable.ic_eye_inventory)
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
iconAdd.tooltipText = getString(R.string.addItemShelving)
iconReset.tooltipText = getTooltip(R.drawable.ic_remove_checks)
iconFilter.tooltipText = getTooltip(R.drawable.ic_filter_inventory)
}
iconParkingFrom.tooltipText = getTooltip(R.drawable.ic_eye_inventory)
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
iconAdd.tooltipText = getString(R.string.addItemShelving)
iconReset.tooltipText = getTooltip(R.drawable.ic_remove_checks)
iconFilter.tooltipText = getTooltip(R.drawable.ic_filter_inventory)
if (listIcons.isEmpty()) {
listIcons.add(iconParkingFrom)
@ -168,12 +169,13 @@ class InventaryParkingFragment(
)
} catch (ex: Exception) {
d(ex)
}
}
iconReset.drawable -> {
if (!myListInventory.isNullOrEmpty()) {
if (myListInventory.isNotEmpty()) {
binding.textinputlayoutMatricula.visibility = VISIBLE
showResetShelving()
} else {
@ -205,7 +207,8 @@ class InventaryParkingFragment(
(binding.mainToolbar.toolbarIcons.adapter as ToolBarAdapterTooltip).setItemsList(
filterList.filter {
it.drawable.constantState?.equals(
context?.getDrawable(
AppCompatResources.getDrawable(
requireContext(),
R.drawable.ic_remove_checks
)?.constantState
) != true
@ -247,7 +250,13 @@ class InventaryParkingFragment(
}
}
if (inqValues.size() == 0) {
ma.messageWithSound("", true, true, "", null)
ma.messageWithSound(
"",
isError = true,
isPlayed = true,
titleWithError = "",
isToasted = null
)
} else {
filter.add("id", JsonObject().apply { add("inq", inqValues) })
viewModel.itemShelvingsReset(
@ -295,7 +304,13 @@ class InventaryParkingFragment(
}
} catch (e: Exception) {
ma.messageWithSound(e.message.toString(), true, true, "", true)
ma.messageWithSound(
e.message.toString(),
isError = true,
isPlayed = true,
titleWithError = "",
isToasted = true
)
}
listWagonsAdapter!!.notifyItemInserted(listParkings.size - 1)
@ -327,15 +342,20 @@ class InventaryParkingFragment(
viewModel.getInventoryParking(
parkingFromScan, parkingToScan
)
binding.mainToolbar.toolbarTitle.text = "$parkingFrom$parkingTo"
binding.mainToolbar.toolbarTitle.text =
getString(
R.string.doubleParkingText,
parkingFrom,
parkingTo
)
}
@RequiresApi(Build.VERSION_CODES.O)
@SuppressLint("SetTextI18n")
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
isBack = true
if (shelvingSaved.isNullOrBlank()) {
if (shelvingSaved.isBlank()) {
ma.onMyBackPressed()
} else {
resetChecking()
@ -355,7 +375,8 @@ class InventaryParkingFragment(
binding.editMatricula.hint = getString(R.string.scanShelving)
chageListAdapter(listIcons.filter {
it.drawable.constantState?.equals(
context?.getDrawable(
AppCompatResources.getDrawable(
requireContext(),
R.drawable.ic_remove_checks
)?.constantState
) != true
@ -368,7 +389,7 @@ class InventaryParkingFragment(
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.editMatricula.text.toString().isEmpty()) {
if (binding.editMatricula.text.toString().isNotEmpty()) {
if (positionShelvingChecking == -1) {
@ -387,10 +408,11 @@ class InventaryParkingFragment(
item.shelvingFk.uppercase() == binding.editMatricula.text.toString()
}
if (positionShelvingChecking != -1) {
shelvingSaved = myListInventory[positionShelvingChecking].shelvingFk.uppercase()
shelvingSaved =
myListInventory[positionShelvingChecking].shelvingFk.uppercase()
}
var allChecked = if (positionShelvingChecking != -1) {
val allChecked = if (positionShelvingChecking != -1) {
myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() }
.all { item ->
item.isChecked != null && item.isChecked!! > 0
@ -401,7 +423,11 @@ class InventaryParkingFragment(
if (allChecked) {
ma.messageWithSound(
getString(R.string.plateChecked), false, true, "", isToasted = true
getString(R.string.plateChecked),
isError = false,
isPlayed = true,
titleWithError = "",
isToasted = true
)
chageListAdapter(listIcons)
adapter!!.setItems(myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() })
@ -415,7 +441,11 @@ class InventaryParkingFragment(
if (positionShelvingChecking == -1) {
ma.messageWithSound(
getString(R.string.shelvingNotFound), true, true, "", true
getString(R.string.shelvingNotFound),
isError = true,
isPlayed = true,
titleWithError = "",
isToasted = true
)
} else {
@ -439,7 +469,13 @@ class InventaryParkingFragment(
)
} catch (ex: Exception) {
ma.messageWithSound(ex.message!!, true, true, "", null)
ma.messageWithSound(
ex.message!!,
isError = true,
isPlayed = true,
titleWithError = "",
isToasted = null
)
}
}
@ -471,7 +507,11 @@ class InventaryParkingFragment(
if (positionItemChecking == -1) {
ma.messageWithSound(
getString(R.string.itemNotFoundScanAgain), true, true, "", true
getString(R.string.itemNotFoundScanAgain),
isError = true,
isPlayed = true,
titleWithError = "",
isToasted = true
)
positionShelvingChecking = -1
@ -484,10 +524,10 @@ class InventaryParkingFragment(
ItemShelvingChecked(true, mobileApplication.userId!!)
)
myListInventory[positionItemChecking].isChecked = 1
adapter!!.notifyDataSetChanged()
adapter!!.notifyItemChanged(positionItemChecking)
binding.editMatricula.hint = getString(R.string.scanShelving)
var allChecked =
val allChecked =
myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() }
.all { item ->
item.isChecked != null && item.isChecked!! > 0
@ -499,7 +539,7 @@ class InventaryParkingFragment(
positionShelvingChecking = -1
} catch (ex: Exception) {
d(ex)
}
}
}
@ -509,44 +549,37 @@ class InventaryParkingFragment(
with(viewModel) {
inventoryListParking.observe(viewLifecycleOwner, Observer {
inventoryListParking.observe(viewLifecycleOwner) {
if (it.list.isNotEmpty()) {
if (it.list[0].isError) {
ma.messageWithSound(
it.list[0].errorMessage, it.list[0].isError, false
)
myListInventory = it.list as MutableList<ItemInventoryParking>
createListInventoryParking()
customDialogInput.dismiss()
binding.textinputlayoutMatricula.visibility = VISIBLE
binding.editMatricula.requestFocus()
} else {
myListInventory = it.list as MutableList<ItemInventoryParking>
createListInventoryParking()
customDialogInput.dismiss()
binding.textinputlayoutMatricula.visibility = VISIBLE
binding.editMatricula.requestFocus()
}
}
})
loadReponseCode.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
checkItem(it.response)
}
}
response.observe(viewLifecycleOwner, Observer {
loadReponseCode.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
checkItem(it)
}
}
response.observe(viewLifecycleOwner) {
chageListAdapter(listIcons, true)
callGetInventory(
parkingFrom, parkingTo
)
})
responseReset.observe(viewLifecycleOwner, Observer {
}
responseReset.observe(viewLifecycleOwner) {
callGetInventory(
parkingFrom, parkingTo
)
chageListAdapter(listIcons, true)
})
}
}
}
@ -555,14 +588,14 @@ class InventaryParkingFragment(
) {
adapter = InventoryParkingAdapter((if (filterActivated) {
if (!shelvingSaved.isNullOrEmpty()) {
if (shelvingSaved.isNotEmpty()) {
myListInventory.filter { (it.isChecked == null || it.isChecked == 0) && it.shelvingFk.uppercase() == shelvingSaved.uppercase() }
} else {
myListInventory.filter { it.isChecked == null || it.isChecked == 0 }
}
} else {
if (!shelvingSaved.isNullOrEmpty()) {
if (shelvingSaved.isNotEmpty()) {
myListInventory.filter { it.shelvingFk.uppercase() == shelvingSaved.uppercase() }
} else {
myListInventory
@ -593,7 +626,8 @@ class InventaryParkingFragment(
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
customDialogInput.setTitle(getString(R.string.quantity))
customDialogInput.setDescription(getString(R.string.quantityVisible)).setValue(item.visible.toString())
customDialogInput.setDescription(getString(R.string.quantityVisible))
.setValue(item.visible.toString())
.setOkButton(getString(R.string.modify)) {
try {
if (customDialogInput.getValue().toInt() >= 0) {

View File

@ -7,7 +7,6 @@ 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.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
@ -21,13 +20,13 @@ import es.verdnatura.presentation.view.feature.inventario.model.InventoryParking
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistakeList
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.WorkerFromMistake
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistakeList
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeSalix
import es.verdnatura.presentation.view.feature.workermistake.model.departmentMistakeList
import es.verdnatura.presentation.view.feature.workermistake.model.workerFromMistakeList
import es.verdnatura.presentation.view.feature.workermistake.model.workerMistakeTypeList
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeTypeList
import retrofit2.Response
class InventaryViewModel(val context: Context) : BaseViewModel(context) {
@ -36,28 +35,28 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
val inventaryList: LiveData<InventaryListVO>
get() = _inventaryList
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
val response: LiveData<ResponseItemVO>
private val _response by lazy { MutableLiveData<Any>() }
val response: LiveData<Any>
get() = _response
private val _responseReset by lazy { MutableLiveData<ResponseItemVO>() }
val responseReset: LiveData<ResponseItemVO>
private val _responseReset by lazy { MutableLiveData<String>() }
val responseReset: LiveData<String>
get() = _responseReset
private val _buyersList by lazy { MutableLiveData<BuyerListVO>() }
val buyersList: LiveData<BuyerListVO>
get() = _buyersList
private val _mistakeDepartmentList by lazy { MutableLiveData<departmentMistakeList>() }
val mistakeDepartmentList: LiveData<departmentMistakeList>
private val _mistakeDepartmentList by lazy { MutableLiveData<DepartmentMistakeList>() }
val mistakeDepartmentList: LiveData<DepartmentMistakeList>
get() = _mistakeDepartmentList
private val _workerFromMistakeList by lazy { MutableLiveData<workerFromMistakeList>() }
val workerFromMistakeList: LiveData<workerFromMistakeList>
private val _workerFromMistakeList by lazy { MutableLiveData<WorkerFromMistakeList>() }
val workerFromMistakeList: LiveData<WorkerFromMistakeList>
get() = _workerFromMistakeList
private val _mistakeWorkerList by lazy { MutableLiveData<workerMistakeTypeList>() }
val mistakeWorkerList: LiveData<workerMistakeTypeList>
private val _mistakeWorkerList by lazy { MutableLiveData<WorkerMistakeTypeList>() }
val mistakeWorkerList: LiveData<WorkerMistakeTypeList>
get() = _mistakeWorkerList
private val _responseAddMistake by lazy { MutableLiveData<ResponseItemVO>() }
@ -67,12 +66,13 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
private val _inventoryListParking by lazy { MutableLiveData<InventoryParkingList>() }
val inventoryListParking: LiveData<InventoryParkingList>
get() = _inventoryListParking
val loadInventaryParkingList: LiveData<Event<InventoryParkingList>> = _inventoryListParking.map { Event(it) }
val loadInventaryParkingList: LiveData<Event<InventoryParkingList>> =
_inventoryListParking.map { Event(it) }
private val _responseCode by lazy { MutableLiveData<ResponseItemVO>() }
val responseCode: LiveData<ResponseItemVO>
private val _responseCode by lazy { MutableLiveData<String>() }
val responseCode: LiveData<String>
get() = _responseCode
val loadReponseCode: LiveData<Event<ResponseItemVO>> = _responseCode.map { Event(it) }
val loadReponseCode: LiveData<Event<String>> = _responseCode.map { Event(it) }
//sergio para obtener comprador
fun itemShelvingBuyerGet() {
@ -84,6 +84,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
})
}
val loadInventaryList: LiveData<Event<InventaryListVO>> = _inventaryList.map { Event(it) }
fun getInventory(buyerFk: Int, warehouseFk: Int) {
@ -105,7 +106,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
salix.itemShelvingUpdate(itemShelvingFk, params)
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(isError = false, response = response.message())
_responseReset.value = response.message()
super.onSuccess(response)
}
@ -121,30 +122,19 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
salix.itemShelvingsUpdate(where, params).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_responseReset.value =
ResponseItemVO(isError = false, response = response.message())
_responseReset.value = response.message()
super.onSuccess(response)
}
})
}
fun itemTrash(
itemFk: Int, warehouseFk: Int, newValue: Int, isTrash: Boolean
) {
salix.itemTrash(arrayListOf(itemFk, warehouseFk, newValue, isTrash).formatWithQuotes())
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(isError = false, response = response.message())
}
})
}
fun itemSetVisibleDiscard(
itemFk: Int, warehouseFk: Int, newValue: Int, isTrash: Boolean
itemFk: Int, warehouseFk: Int, newValue: Int
) {
salix.setVisibleDiscard( ItemDiscardSalixShortage(itemFk, warehouseFk, newValue, null))
salix.setVisibleDiscard(ItemDiscardSalixShortage(itemFk, warehouseFk, newValue, null))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(isError = false, response = response.message())
@ -157,7 +147,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
.enqueue(object : SalixCallback<List<DepartmentMistake>>(context) {
override fun onSuccess(response: Response<List<DepartmentMistake>>) {
_mistakeDepartmentList.value =
response.body()?.let { departmentMistakeList(it) }
response.body()?.let { DepartmentMistakeList(it) }
}
})
}
@ -167,7 +157,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
.enqueue(object : SalixCallback<List<WorkerFromMistake>>(context) {
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
_workerFromMistakeList.value =
response.body()?.let { workerFromMistakeList(it) }
response.body()?.let { WorkerFromMistakeList(it) }
}
override fun onError(t: Throwable) {
@ -179,7 +169,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
)
)
)
_workerFromMistakeList.value = workerFromMistakeList(listError)
_workerFromMistakeList.value = WorkerFromMistakeList(listError)
}
})
@ -189,7 +179,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
salix.workerMistakesTypes().enqueue(object : SalixCallback<List<MistakeType>>(context) {
override fun onSuccess(response: Response<List<MistakeType>>) {
_mistakeWorkerList.value = response.body()?.let { workerMistakeTypeList(it) }
_mistakeWorkerList.value = response.body()?.let { WorkerMistakeTypeList(it) }
}
@ -223,179 +213,24 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
salix.getInventoryParking(vParkingFrom, vParkingTo)
.enqueue(object : SalixCallback<List<ItemInventoryParking>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<ItemInventoryParking> = ArrayList()
listError.add(
ItemInventoryParking(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this), t.message!!
),
)
)
_inventoryListParking.value = InventoryParkingList(listError)
}
override fun onSuccess(response: Response<List<ItemInventoryParking>>) {
if (response.body() != null) {
_inventoryListParking.value =
response.body()?.let { InventoryParkingList(it) }
_inventoryListParking.value =
response.body()?.let { InventoryParkingList(it) }
} else {
val listError: ArrayList<ItemInventoryParking> = ArrayList()
listError.add(
ItemInventoryParking(
isError = false,
errorMessage = getMessageFromAllResponse(
nameofFunction(this), response.message()
),
)
)
_inventoryListParking.value = InventoryParkingList(listError)
}
}
})
}
fun ItemListInventoryParking_(
vParkingFrom: String, vParkingTo: String
) {
var myList = InventoryParkingList(
listOf(
ItemInventoryParking(
1,
31,
vParkingFrom,
vParkingTo,
19897,
"Dendrobium Galaxy",
510,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/dgalaxy",
0,
2
), ItemInventoryParking(
2,
31,
"F-01-1",
"OZR",
92400,
"Cymbidium Avalanche",
14,
37,
"Sergio de la Torre Nebot",
"http://verdnatura.es/vn-image-data/catalog/1600x900/92400",
1,
2
), ItemInventoryParking(
3,
31,
"F-01-1",
"OZR",
92400,
"Cymbidium Avalanche",
2,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/92400",
null,
2
), ItemInventoryParking(
4,
32,
"F-01-2",
"PLY",
19897,
"Dendrobium Galaxy",
520,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/dgalaxy",
0,
2
), ItemInventoryParking(
5,
33,
"F-01-3",
"ZLZ",
2912,
"HEL Tropical Red",
2,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/002912",
0,
0
), ItemInventoryParking(
6,
34,
"F-01-4",
"JXU",
25942,
"HEL BQ Amor (x bouquet)",
0,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/bqamor",
2,
0
), ItemInventoryParking(
7,
34,
"F-01-4",
"MUU",
25942,
"HEL BQ Amor (x bouquet)",
5,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/bqamor",
0,
0
), ItemInventoryParking(
8,
34,
"F-01-4",
"JXU",
50001,
"Monstera I",
130,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/50001",
0,
2
), ItemInventoryParking(
9,
34,
"F-01-4",
"JXU",
50004,
"Monstera IV",
240,
37,
"Jose Alarcan Gomex",
"http://verdnatura.es/vn-image-data/catalog/1600x900/50003",
0,
2
)
)
)
}
fun expeditionMistakeTypeGet() {
salix.getExpeditionMistakeTypes()
.enqueue(object : SalixCallback<List<MistakeType>>(context) {
override fun onSuccess(response: Response<List<MistakeType>>) {
_mistakeWorkerList.value =
response.body()?.let { workerMistakeTypeList(it) }
response.body()?.let { WorkerMistakeTypeList(it) }
}
})
@ -405,7 +240,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
salix.barcodes_toitem(code).enqueue(object : SalixCallback<String?>(context) {
override fun onSuccess(response: Response<String?>) {
_responseCode.value =
ResponseItemVO(isError = false, response = response.body()!!.toString())
response.body()!!.toString()
}
})
}

View File

@ -8,8 +8,6 @@ class ItemInventaryVO(
var downstairs: Int? = null,
var upstairs: Int? = null,
var nicho: Int? = null,
var isError: Boolean = false,
var errorMessage: String = "",
var itemColour: String = ""
)
@ -41,12 +39,8 @@ data class ItemInventoryParking(
var visible: Int = 0,
var sectorFk: Int = 0,
var buyer: String = "",
// Campo A borrar cuando https://redmine.verdnatura.es/issues/6193 esté en producción
var urlImage: String = "",
var isChecked: Int? = null,
var priority: Int = 0,
var isError: Boolean = false,
var errorMessage: String = "",
var url:String? = null,
var image:String? = null
)

View File

@ -5,13 +5,10 @@ import android.content.Intent
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.provider.Settings
import android.view.View.GONE
import android.view.View.VISIBLE
import androidx.annotation.RequiresApi
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.firebase.crashlytics.ktx.crashlytics
import com.google.firebase.ktx.Firebase
@ -19,6 +16,7 @@ import es.verdnatura.MobileApplication
import es.verdnatura.R
import es.verdnatura.databinding.FragmentLoginBinding
import es.verdnatura.domain.ConstAndValues.ANDROID_ID
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
import es.verdnatura.domain.ConstAndValues.PASSWORD
import es.verdnatura.domain.ConstAndValues.REMEMBER
import es.verdnatura.domain.ConstAndValues.RENEWINTERVAL
@ -43,7 +41,7 @@ import kotlinx.coroutines.runBlocking
import java.util.Date
import kotlin.system.exitProcess
class LoginFragment(var imageUri: Uri?) :
class LoginFragment(private var imageUri: Uri?) :
BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
private lateinit var customDialog: CustomDialog
@ -58,7 +56,6 @@ class LoginFragment(var imageUri: Uri?) :
override fun getLayoutId(): Int = R.layout.fragment_login
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
customDialogList = CustomDialogList(requireContext())
customDialog = CustomDialog(requireContext())
@ -76,7 +73,6 @@ class LoginFragment(var imageUri: Uri?) :
if (mobileApplication.dataStoreApp.readDataStoreKey<String>(TOKEN)
.isNotBlank() && binding.switchRemember.isChecked
) {
//viewModel.operator_add()
if (getDevicePDA() != null) {
viewModel.getSerialNumber(getDevicePDA()!!)
} else {
@ -96,8 +92,9 @@ class LoginFragment(var imageUri: Uri?) :
runBlocking { mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, false) }
}
var myWorkFormSlected =
val myWorkFormSlected =
mobileApplication.dataStoreApp.readDataStoreKey(WORKFORMSELECTED) as String
if (myWorkFormSlected.isBlank()) {
runBlocking {
mobileApplication.dataStoreApp.editDataStoreKey(
@ -105,9 +102,7 @@ class LoginFragment(var imageUri: Uri?) :
)
mobileApplication.dataStoreApp.saveWorkForm(
WorkForms(
"Producción",
"https://app.verdnatura.es",
"https://salix.verdnatura.es"
"Producción", "https://salix.verdnatura.es"
)
)
}
@ -116,12 +111,10 @@ class LoginFragment(var imageUri: Uri?) :
mobileApplication.dataStoreApp.readDataStoreKey(WORKFORMSELECTED) as String
)
if (binding.edittextServer.text.toString() == "TestLOCAL") {
binding.edittextUsername.setText("developer")
binding.edittextPassword.setText("nightmare")
binding.edittextUsername.setText(getString(R.string.userDev))
binding.edittextPassword.setText(getString(R.string.passDev))
}
// se crean/listan las opciones de formas de trabajo
//deleteWorkForm("all")
listForms = runBlocking { mobileApplication.dataStoreApp.getWorkForm() }
binding.edittextServer.keyListener = null
@ -140,8 +133,7 @@ class LoginFragment(var imageUri: Uri?) :
private fun getDevicePDA(): Int? {
return try {
Settings.Global.getString(
mobileApplication.contentResolver,
Settings.Global.DEVICE_NAME
mobileApplication.contentResolver, Settings.Global.DEVICE_NAME
).toInt()
} catch (ex: Exception) {
null
@ -149,24 +141,24 @@ class LoginFragment(var imageUri: Uri?) :
}
/* private fun createFolderSerial() {
/* private fun createFolderSerial() {
val directory = File(
requireContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS), "/dataSerial"
)
val directory = File(
requireContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS), "/dataSerial"
)
if (!directory.exists()) {
directory.mkdirs()
}
try {
val filename = "serial.txt"
val file = File(directory, filename)
mobileApplication.serialNumber = file.readText()
} catch (ex: Exception) {
d("VERDNATURA:", getString(R.string.errorFile))
}
if (!directory.exists()) {
directory.mkdirs()
}
try {
val filename = "serial.txt"
val file = File(directory, filename)
mobileApplication.serialNumber = file.readText()
} catch (ex: Exception) {
d("VERDNATURA:", getString(R.string.errorFile))
}
}*/
}*/
private fun setAdapter(listWorkForms: List<WorkForms>) {
@ -183,10 +175,7 @@ class LoginFragment(var imageUri: Uri?) :
binding.edittextServer.setText(item.name)
runBlocking {
mobileApplication.dataStoreApp.editDataStoreKey(
"base_url", item.urlSilex
)
mobileApplication.dataStoreApp.editDataStoreKey(
"base_urlSalix", item.urlSalix
BASEURLSALIX, item.urlSalix
)
}
@ -203,7 +192,7 @@ class LoginFragment(var imageUri: Uri?) :
}
}, object : OnTrashItemRowClickListener {
override fun OnTrashItemRowClickListener(workForm: WorkForms) {
override fun OnTrashItemRowClickListener(item: WorkForms) {
customDialog.setTitle(getString(R.string.deleteWorkForm))
.setDescription(getString(R.string.deleteWorkFormConfirmation))
@ -211,15 +200,14 @@ class LoginFragment(var imageUri: Uri?) :
customDialog.dismiss()
}.setOkButton(getString(R.string.ok)) {
val workFormNameKey = stringPreferencesKey(workForm.name)
val workFormNameKey = stringPreferencesKey(item.name)
runBlocking {
mobileApplication.dataStoreApp.deleteWorkForm(
workFormNameKey
)
}
// deleteWorkForm(workForm.name)
workFormAdapter!!.notifyDataSetChanged()
workFormAdapter!!.notifyItemRemoved(listWorkForms.indexOf(item))
customDialog.dismiss()
customDialogList.dismiss()
exitProcess(1)
@ -257,7 +245,7 @@ class LoginFragment(var imageUri: Uri?) :
private fun showWorkingForms() {
var listForms = runBlocking { mobileApplication.dataStoreApp.getWorkForm() }
val listForms = runBlocking { mobileApplication.dataStoreApp.getWorkForm() }
setAdapter(listForms)
}
@ -276,10 +264,7 @@ class LoginFragment(var imageUri: Uri?) :
runBlocking {
mobileApplication.dataStoreApp.saveWorkForm(
WorkForms(
customNewForm.getValue(),
customNewForm.getValueTwo(),
customNewForm.getValueThree(),
true
customNewForm.getValue(), customNewForm.getValueThree(), true
)
)
}
@ -369,7 +354,7 @@ class LoginFragment(var imageUri: Uri?) :
}
}
serialNumber.observe(viewLifecycleOwner){
serialNumber.observe(viewLifecycleOwner) {
mobileApplication.serialNumber = it
viewModel.getCurrentUserData(
getString(R.string.logAppName),
@ -398,10 +383,8 @@ class LoginFragment(var imageUri: Uri?) :
runBlocking {
if (binding.switchRemember.isChecked) {
mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, true)
//saveRemember(true)
} else {
mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, false)
//saveRemember(false)
}
}
if (it.vIsAuthorized == "1") {
@ -439,8 +422,6 @@ class LoginFragment(var imageUri: Uri?) :
)
}
//saveDataOperator(it)
}
}
operatorAdd.observe(viewLifecycleOwner) {
@ -488,18 +469,13 @@ class LoginFragment(var imageUri: Uri?) :
}.show()
} else {
saveTokenPref(it.token, it.ttl)
//test
//saveTokenPref("RTymwJzRuVchAMY5u8xG2wpgcjPf7t0DQImLvMsTdNFmbFwDiVsa8lA6fr1XSaBo","2026-29-06")
// local
//saveTokenPref("1ZGV1OGhpcrZZwvNALXnPeSVe0GCE4tgpKbv8nZu4EXay75QZrVY5GZDnpsqlxFz",it.ttl )
app.userName = binding.edittextUsername.text.toString()
app.userPassword = binding.edittextPassword.text.toString()
viewModel.getAccessTokenConfigs()
}
}
loadAccessConfigSalixList.observe(viewLifecycleOwner, Observer { event ->
loadAccessConfigSalixList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
@ -517,8 +493,7 @@ class LoginFragment(var imageUri: Uri?) :
)
}
// viewModel.operator_add()
if (getDevicePDA() != null) {
if (getDevicePDA() != null) {
viewModel.getSerialNumber(getDevicePDA()!!)
} else {
viewModel.getCurrentUserData(
@ -528,14 +503,13 @@ class LoginFragment(var imageUri: Uri?) :
)
}
} else {
it.list[0].errorMessage.toast(context)
}
}
}
})
}
}
super.observeViewModel()
@ -577,6 +551,4 @@ class LoginFragment(var imageUri: Uri?) :
)
}
}

View File

@ -27,7 +27,7 @@ import es.verdnatura.presentation.view.feature.login.model.RenewToken
import es.verdnatura.presentation.view.feature.login.model.VersionApp
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalix
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalixList
import es.verdnatura.presentation.view.feature.paletizador.model.itemsExpeditionDynamics
import es.verdnatura.presentation.view.feature.paletizador.model.ItemsExpeditionDynamics
import kotlinx.coroutines.runBlocking
import retrofit2.Response
import java.util.Date
@ -228,14 +228,14 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics> {
fun getListFromJSON(json: JsonObject): MutableList<ItemsExpeditionDynamics> {
val gson = Gson()
val list = mutableListOf<itemsExpeditionDynamics>()
val list = mutableListOf<ItemsExpeditionDynamics>()
val expeditionState: Map<String, Any> =
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
expeditionState.forEach {
list.add(itemsExpeditionDynamics(key = it.key, value = it.value.toString()))
list.add(ItemsExpeditionDynamics(key = it.key, value = it.value.toString()))
}
return list

View File

@ -1,10 +1,9 @@
package es.verdnatura.presentation.view.feature.login.model
import java.util.*
import java.util.Calendar
class WorkForms(
val name: String,
val urlSilex: String,
val urlSalix: String,
val isShowDelete: Boolean = false,
val created: Long = Calendar.getInstance().timeInMillis

View File

@ -1,6 +1,6 @@
package es.verdnatura.presentation.view.feature.main.activity
import PhotosFragment
import es.verdnatura.presentation.view.feature.photos.fragment.PhotosFragment
import android.content.Context
import android.content.Intent
import android.media.MediaPlayer
@ -51,7 +51,7 @@ import es.verdnatura.presentation.view.feature.articulo.fragment.ItemProposalFra
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragment
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferLoadFragment
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFragment
import es.verdnatura.presentation.view.feature.claim.fragment.ClaimFragment
import es.verdnatura.presentation.view.feature.claim.fragment.ubication.ClaimUbicationFragment
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPicker
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPickerNew
@ -101,9 +101,9 @@ import es.verdnatura.presentation.view.feature.precontrol.PreControladorFragment
import es.verdnatura.presentation.view.feature.presacador.fragment.EndSacadorFragment
import es.verdnatura.presentation.view.feature.presacador.fragment.SectorCollectionReserveFragment
import es.verdnatura.presentation.view.feature.qr.QrFragment
import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationCollectionFragment
import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationFragment
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.fragment.ReubicationCollectionFragment
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.fragment.ReubicationFragment
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.sacador.fragment.PickerHelperFragment
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragmentNew
@ -143,9 +143,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
private val _renewTokenResponse = MutableLiveData<RenewToken>()
private lateinit var networkUtils: NetworkUtilsApp
private var myTimeUserInteraction = (System.currentTimeMillis() / 1000 / 3600)
private var comeFromDelivery: Boolean? = null
private lateinit var mainActivityViewmodel: MainActivityViewModel
val backDispatcher = onBackPressedDispatcher
private val backDispatcher = onBackPressedDispatcher
override fun getLayoutId(): Int = R.layout.activity_main
override fun onPause() {
@ -701,7 +700,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
}
getString(R.string.titleClaimUbication) -> {
addFragmentOnTop(ClaimFragment.newInstance(item.title))
addFragmentOnTop(ClaimUbicationFragment.newInstance(item.title))
}
getString(R.string.titleReUbicator) -> {
@ -755,11 +754,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
getString(R.string.titleInfo) -> {
addFragmentOnTop(
InfoFragment.newInstance(item.title), if (comeFromDelivery == true) {
InfoFragment.newInstance(item.title),
getString(R.string.titleInfo)
} else {
null
}
)
}
@ -767,11 +764,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
getString(R.string.titleLog) -> {
addFragmentOnTop(
LogExpeditionFragment.newInstance(item.title), if (comeFromDelivery == true) {
LogExpeditionFragment.newInstance(item.title),
getString(R.string.titleLog)
} else {
null
}
)
}
@ -779,11 +773,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
getString(R.string.titleLoadTruck) -> {
addFragmentOnTop(
LoadUnloadFragment.newInstance(item.title, "ON DELIVERY", entryPoint),
if (comeFromDelivery == true) {
getString(R.string.titleLoadTruck)
} else {
getString(R.string.titleLoadTruck)
}
)
}
@ -797,11 +788,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
} else {
null
}
), if (comeFromDelivery == true) {
),
getString(R.string.titleUnLoadTruck)
} else {
getString(R.string.titleUnLoadTruck)
}, delete = true
, delete = true
)
}
@ -810,11 +799,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
addFragmentOnTop(
SummaryFragment.newInstance(item.title, "ON DELIVERY", entryPoint.toInt()),
if (comeFromDelivery == true) {
getString(R.string.titleDeliverySummary)
} else {
null
}
)
}
@ -822,11 +807,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
getString(R.string.titleDeliveryRoute) -> {
addFragmentOnTop(
RoutesFragment.newInstance(item.title), if (comeFromDelivery == true) {
RoutesFragment.newInstance(item.title),
getString(R.string.titleDeliverySummary)
} else {
null
}
)
}
@ -845,7 +827,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
getString(R.string.testing) -> {
// addFragmentOnTop(
// PhotosFragment.newInstance(item.title))
// es.verdnatura.presentation.view.feature.photos.fragment.PhotosFragment.newInstance(item.title))
//addFragmentOnTop(testPrint.newInstance(item.title))
}

View File

@ -9,7 +9,12 @@ import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentPackagingCountBinding
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.common.OnEditSubQuantityListener
import es.verdnatura.presentation.common.OnImageTrashClickListener
import es.verdnatura.presentation.common.OnImageUpdateClickListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.common.hideKeyboard
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.component.CustomDialogInput
import es.verdnatura.presentation.view.feature.packaging.adapter.ItemSupplierAdapter
@ -17,7 +22,6 @@ import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewM
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class PackagingCountFragment(
var entryPoint: String = ""
@ -89,7 +93,7 @@ class PackagingCountFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -14,12 +14,13 @@ import es.verdnatura.domain.ConstAndValues.ENTRYTYPE
import es.verdnatura.domain.ConstAndValues.SUPPLIERID
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.*
import es.verdnatura.presentation.common.OnOptionsSelectedListener
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.packaging.adapter.ItemSupplierAdapter
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class PackagingSummaryFragment(
var entryPoint: String = ""
@ -91,7 +92,7 @@ class PackagingSummaryFragment(
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -52,7 +52,6 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
get() = _response
val loadEntryAdd: LiveData<Event<EntrySalix>> = _entryAdd.map { Event(it) }
//val loadEntryAdd = Transformations.map(_entryAdd) { Event(it) }
fun getSuppliers() {
salix.getSuppliers()

View File

@ -129,7 +129,7 @@ class SupplierFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
ma.onMyBackPressed()
}
@ -269,7 +269,7 @@ class SupplierFragment(
private fun createEntryList(list: List<EntrySalix>) {
entries.clear()
list.forEach { entry ->
if (!entry.isError!!) {
if (!entry.isError) {
try {
entries.add(
SearchSupplierModel(

View File

@ -1,18 +1,11 @@
package es.verdnatura.presentation.view.feature.packingHolland.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.ResponseItemVO
class PackingHollandViewModel(val context: Context) : BaseViewModel(context) {
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
val response: LiveData<ResponseItemVO>
get() = _response
fun travelUpdatePacking(
itemFk: Int,
packingFk: Int

View File

@ -39,12 +39,13 @@ class CmrExpeditionPalletFragment(
binding.mainToolbar.toolbarTitle.text = title
}
private fun cmrExpeditionPallet_add(vExpeditionPallet: Int?, vCmrId: Int?) {
private fun cmrExpeditionPalletAdd(vExpeditionPallet: Int?, vCmrId: Int?) {
customDialogList.dismiss()
viewModel.cmrExpeditionPalletAdd(
vExpeditionPallet!!, vCmrId!!
)
customDialogList.dismiss()
showExpeditionPalletScan()
}
@ -57,18 +58,6 @@ class CmrExpeditionPalletFragment(
}
override fun observeViewModel() {
with(viewModel) {
responsescan.observe(viewLifecycleOwner) {
showExpeditionPalletScan()
}
}
}
private fun showExpeditionPalletScan() {
customDialogList.setHint(true)
customDialogList.setValue("")
@ -118,7 +107,7 @@ class CmrExpeditionPalletFragment(
) {
dataScannedTwo = itemScan(customDialogList.getValueTwo())
if (dataScannedTwo == null) {
cmrExpeditionPallet_add(
cmrExpeditionPalletAdd(
customDialogList.getValue().toInt(),
customDialogList.getValueTwo().toInt()
)
@ -137,7 +126,7 @@ class CmrExpeditionPalletFragment(
customDialogList.setValueTwo("")
} else {
customDialogList.setValueTwo(dataScanned!!.id.toString())
cmrExpeditionPallet_add(
cmrExpeditionPalletAdd(
if (dataScannedTwo!!.table == "cmr") {
dataScanned!!.id
} else {
@ -150,7 +139,7 @@ class CmrExpeditionPalletFragment(
)
}
} else {
cmrExpeditionPallet_add(
cmrExpeditionPalletAdd(
customDialogList.getValue().toInt(), dataScannedTwo!!.id
)

View File

@ -1,37 +1,14 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ResponseItemVO
import retrofit2.Response
class CmrExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
private val _responsescan by lazy { MutableLiveData<ResponseItemVO>() }
val responsescan: LiveData<ResponseItemVO>
get() = _responsescan
fun cmrExpeditionPalletAdd(vExpeditionPallet: Int, cmrFk: Int) {
salix.cmrPalletAdd(arrayListOf(vExpeditionPallet, cmrFk))
.enqueue(object : SalixCallback<Unit>(context) {
override fun onSuccess(response: Response<Unit>) {
_responsescan.value =
ResponseItemVO(isError = false, response = response.message()!!)
super.onSuccess(response)
}
override fun onError(t: Throwable) {
_responsescan.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
super.onError(t)
}
})
}

View File

@ -5,22 +5,19 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.ResponseItemVO
import retrofit2.Response
class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(context) {
private val _responsescan by lazy { MutableLiveData<ResponseItemVO>() }
val responsescan: LiveData<ResponseItemVO>
get() = _responsescan
private val _responseScan by lazy { MutableLiveData<String>() }
val responsescan: LiveData<String>
get() = _responseScan
fun expeditionScan(vExpeditionId: String) {
salix.expeditionScan(params = arrayListOf(vExpeditionId))
.enqueue(object : SalixCallback<Unit>(context) {
override fun onSuccess(response: Response<Unit>) {
_responsescan.value =
ResponseItemVO(isError = false, response = response.message()!!)
_responseScan.value = response.message()
super.onSuccess(response)
}

View File

@ -8,8 +8,8 @@ import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding
import es.verdnatura.domain.toInt
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionStateAdapter
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpedetionState
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionStateRow
import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ExpeditionStateFragment(
@ -72,13 +72,13 @@ class ExpeditionStateFragment(
override fun observeViewModel() {
with(viewModel) {
itemexpedition.observe(viewLifecycleOwner) {
itemExpedition.observe(viewLifecycleOwner) {
setItemExpeditionState(it)
}
}
}
private fun setItemExpeditionState(itemInfo: itemExpedetionState) {
private fun setItemExpeditionState(itemInfo: ItemExpedetionState) {
setToolBar(getString(R.string.expedition) + " " + itemScan)
binding.itemcardLayout.visibility = View.VISIBLE

View File

@ -2,8 +2,6 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
//import es.verdnatura.presentation.view.feature.paletizador.model.itemExpeditionDynamicsList
import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.google.gson.Gson
@ -12,24 +10,22 @@ import com.google.gson.reflect.TypeToken
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.isoToString
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState
import es.verdnatura.presentation.view.feature.paletizador.model.itemsExpeditionDynamics
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpedetionState
import es.verdnatura.presentation.view.feature.paletizador.model.ItemsExpeditionDynamics
import retrofit2.Response
class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
private val _itemexpedition by lazy { MutableLiveData<itemExpedetionState>() }
val itemexpedition: LiveData<itemExpedetionState>
get() = _itemexpedition
private val _itemExpedition by lazy { MutableLiveData<ItemExpedetionState>() }
val itemExpedition: LiveData<ItemExpedetionState>
get() = _itemExpedition
fun expeditionGetStateJSON(expeditionFk: Int) {
salix.expedition_getState(params = arrayListOf(expeditionFk))
.enqueue(object : SalixCallback<ArrayList<JsonObject>>(context) {
@RequiresApi(Build.VERSION_CODES.O)
override fun onSuccess(response: Response<ArrayList<JsonObject>>) {
_itemexpedition.value = itemExpedetionState(
isError = false,
errorMessage = "",
_itemExpedition.value = ItemExpedetionState(
list = if (response.body()!!.size > 0) {
getListFromJSON(response.body()!![0].asJsonObject)
} else {
@ -42,14 +38,13 @@ class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
})
}
@RequiresApi(Build.VERSION_CODES.O)
fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics> {
fun getListFromJSON(json: JsonObject): MutableList<ItemsExpeditionDynamics> {
val gson = Gson()
var list = mutableListOf<itemsExpeditionDynamics>()
var expeditionState: Map<String, String?> =
val list = mutableListOf<ItemsExpeditionDynamics>()
val expeditionState: Map<String, String?> =
gson.fromJson(json, object : TypeToken<Map<String, String?>>() {}.type)
expeditionState.forEach {
list.add(itemsExpeditionDynamics(key = it.key, it.value ?: ""))
list.add(ItemsExpeditionDynamics(key = it.key, it.value ?: ""))
}
list.forEach { element ->
if (element.value!!.takeLast(4).matches(Regex("[0-9]{3}Z"))) {

View File

@ -3,11 +3,8 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.inputmethod.EditorInfo
import androidx.annotation.RequiresApi
import androidx.core.content.res.ResourcesCompat
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentExpeditionTruckListBinding
@ -20,9 +17,8 @@ import es.verdnatura.presentation.view.component.CustomDialogHour
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionListAdapter
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckList
import java.text.SimpleDateFormat
import java.util.*
import java.util.Calendar.getInstance as getInstance1
import java.time.LocalDate
import java.time.format.DateTimeFormatter
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ExpeditionTruckListFragment :
@ -45,11 +41,11 @@ class ExpeditionTruckListFragment :
override fun getLayoutId(): Int = R.layout.fragment_expedition_truck_list
@RequiresApi(Build.VERSION_CODES.O)
@SuppressLint("SetTextI18n")
override fun init() {
customDialogHor = CustomDialogHour(requireContext())
binding.mainToolbar.toolbarTitle.text = getString(R.string.psScan) + getCURDATE()
binding.mainToolbar.toolbarTitle.text = getString(R.string.psScan) + LocalDate.now()
.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))
binding.mainToolbar.backButton.setOnClickListener {
ma.onMyBackPressed()
}
@ -75,7 +71,6 @@ class ExpeditionTruckListFragment :
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
@RequiresApi(Build.VERSION_CODES.O)
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload) {
viewModel.expeditionTruckList()
@ -91,34 +86,25 @@ class ExpeditionTruckListFragment :
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
private fun getCURDATE(): String {
val c: Date = getInstance1().getTime()
val df = SimpleDateFormat(getString(R.string.dayFormat))
return df.format(c)
}
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
loadExpeditionTruckList.observe(viewLifecycleOwner, Observer { event ->
loadExpeditionTruckList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { printExpeditionList(it) }
})
loadResponseExpeditionAdd.observe(viewLifecycleOwner, Observer { event ->
}
loadResponseExpeditionAdd.observe(viewLifecycleOwner) { event ->
viewModel.expeditionTruckList()
})
}
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun printExpeditionList(it: ItemExpeditionTruckList) {
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
it.list.filter { it.eta != null }.map { it.eta = it.eta.isoToString() }
it.list.map { it.eta = it.eta.isoToString() }
adapter = ExpeditionListAdapter(it.list, onTruckClickListener!!)
binding.expeditionTruckRecyclerview.adapter = adapter
binding.expeditionTruckRecyclerview.layoutManager = lm
}
@RequiresApi(Build.VERSION_CODES.O)
private fun addTruck() {
customDialogHor.setTitle(getString(R.string.newTruck))
.setOkButton(getString(R.string.save)) {
@ -150,7 +136,6 @@ class ExpeditionTruckListFragment :
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun customDialogActionTruck() {
viewModel.expeditionTruckAdd(
customDialogHor.getHoraValue(), customDialogHor.getDestinoValue()

View File

@ -1,15 +1,12 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.map
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.paletizador.model.ExpeditionTruckSalix
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckList
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
@ -21,14 +18,13 @@ import java.time.LocalTime
class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context) {
private val _expeditionTruckList by lazy { MutableLiveData<ItemExpeditionTruckList>() }
val loadExpeditionTruckList: LiveData<Event<ItemExpeditionTruckList>> = _expeditionTruckList.map { Event(it) }
val loadExpeditionTruckList: LiveData<Event<ItemExpeditionTruckList>> =
_expeditionTruckList.map { Event(it) }
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
val loadResponseExpeditionAdd: LiveData<Event<ResponseItemVO>> = _response.map { Event(it) }
private val _response by lazy { MutableLiveData<String>() }
val loadResponseExpeditionAdd: LiveData<Event<String>> = _response.map { Event(it) }
@RequiresApi(Build.VERSION_CODES.O)
fun expeditionTruckList() {
// Tarea 5134 modificar fecha para que se vea correctamente y no con 0.00Z
salix.expeditionTruckGet(
"""{"where": { "eta": {
"between": ["${LocalDate.now().atTime(LocalTime.MIN)}",
@ -43,7 +39,6 @@ class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context
})
}
@RequiresApi(Build.VERSION_CODES.O)
fun expeditionTruckAdd(vHour: String, vDescription: String) {
salix.expeditionTrucksInsert(
ExpeditionTruckSalix(
@ -52,7 +47,7 @@ class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context
)
).enqueue(object : SalixCallback<Any>(context) {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
_response.value = ResponseItemVO(isError = false, response = response.message())
_response.value = response.message()
}
})

View File

@ -55,23 +55,9 @@ class PalletScanFragment(
override fun observeViewModel() {
with(viewModel) {
responseScan.observe(viewLifecycleOwner) {
if (it.isError) {
ma.messageWithSound(
it.errorMessage, true, true, isToasted = true
)
showPalletScan()
} else {
ma.messageWithSound(getString(R.string.palletScanned) + itemScaned, false, true)
showPalletScan()
}
}
responsePalletGet.observe(viewLifecycleOwner) {
ma.messageWithSound(getString(R.string.palletScanned) + itemScaned, false, true)
ma.messageWithSound(message = "", isError = false, isPlayed = true, isToasted = false)
ma.onComprobarPalletFromPalletScan(
ItemExpeditionTruckVO(it.truckFk), ItemPalletVO(Pallet = itemScaned)
)
@ -117,9 +103,12 @@ class PalletScanFragment(
ma.hideKeyboard(customDialogList.getEditText())
when (action) {
"receive" -> viewModel.expeditionStateAddByPallet(
itemScaned, "STORED"
)
"receive" -> {
viewModel.expeditionStateAddByPallet(
itemScaned, "STORED"
)
showPalletScan()
}
"get" -> viewModel.expeditionPalletGet(
itemScaned

View File

@ -6,18 +6,11 @@ import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckSalix
import retrofit2.Response
class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
private val _responseScan by lazy { MutableLiveData<ResponseItemVO>() }
val responseScan: LiveData<ResponseItemVO>
get() = _responseScan
private val _responsePalletGet by lazy { MutableLiveData<ItemExpeditionTruckSalix>() }
val responsePalletGet: LiveData<ItemExpeditionTruckSalix>
get() = _responsePalletGet
@ -33,33 +26,17 @@ class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
).formatWithQuotes()
)
.enqueue(object : SalixCallback<Unit>(context) {
override fun onError(t: Throwable) {
_responseScan.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Unit>) {
_responseScan.value =
ResponseItemVO(isError = false, response = response.message()!!)
}
})
}
fun expeditionPalletGet(vPalletId: Int) {
//Tarea 6276
salix.expeditionPalletGet("""{"fields": ["truckFk"], "where": {"id": $vPalletId}, "include": [{"relation": "expeditionTruck", "scope": {"fields": ["eta", "description"]}}]}""")
// silex.expeditionPallet_get(vPalletId)
.enqueue(object : SalixCallback<List<ItemExpeditionTruckSalix>>(context) {
override fun onSuccess(response: Response<List<ItemExpeditionTruckSalix>>) {
_responsePalletGet.value =
response.body()!![0]
_responsePalletGet.value =
response.body()?.get(0)
}
})

View File

@ -30,14 +30,12 @@ class ItemExpeditionTruckList(
var list: List<ItemExpeditionTruckVO> = listOf()
)
class itemExpedetionState(
var isError: Boolean = false,
var errorMessage: String = "",
var list: MutableList<itemsExpeditionDynamics>
class ItemExpedetionState(
var list: MutableList<ItemsExpeditionDynamics>
)
class itemsExpeditionDynamics(
class ItemsExpeditionDynamics(
var key: String = "",
var value: String? = null
)

View File

@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.parking.fragment
import android.media.MediaPlayer
import android.os.Bundle
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentParkingBinding
@ -65,7 +64,7 @@ class ParkingFragment(var menuOrigin: String) :
override fun observeViewModel() {
with(viewModel) {
response.observe(viewLifecycleOwner, Observer {
response.observe(viewLifecycleOwner) {
ma.messageWithSound(
message = getString(R.string.Aparcado),
@ -79,7 +78,7 @@ class ParkingFragment(var menuOrigin: String) :
setList()
}
})
}
}
}
@ -89,7 +88,7 @@ class ParkingFragment(var menuOrigin: String) :
adapter = ParkingAdapter(scanerList, object : OnBarcodeRowClickListener {
override fun onBarcodeRowClickListener(item: BarcodeVO) {
scanerList.removeAt(scanerList.indexOf(item))
adapter?.notifyDataSetChanged()
adapter?.notifyItemRemoved(scanerList.indexOf(item))
}
})
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
@ -116,7 +115,7 @@ class ParkingFragment(var menuOrigin: String) :
}
} else {
scanerList.add(BarcodeVO(code = txtScan))
adapter?.notifyDataSetChanged()
adapter?.notifyItemInserted(scanerList.size-1)
}
}

View File

@ -6,12 +6,11 @@ import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.ResponseItemVO
import retrofit2.Response
class ParkingViewModel(val context: Context) : BaseViewModel(context) {
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
val response: LiveData<ResponseItemVO>
private val _response by lazy { MutableLiveData<Any>() }
val response: LiveData<Any>
get() = _response
fun setParking(scanItem: String, parking: String) {
@ -19,7 +18,7 @@ class ParkingViewModel(val context: Context) : BaseViewModel(context) {
.enqueue(object :
SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(isError = false, response = response.message())
_response.value = response.message()
}
})
}

View File

@ -17,8 +17,7 @@ import es.verdnatura.presentation.view.feature.pasillero.adapter.PasillerosAdapt
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
class PasilleroFragment(
private var tagName: String = "",
var isInitMenu: Boolean
private var tagName: String = "", var isInitMenu: Boolean
) : BaseFragment<FragmentPasilleroBinding, PasilleroViewModel>(PasilleroViewModel::class) {
constructor() : this("", false)
@ -130,7 +129,6 @@ class PasilleroFragment(
}
else -> {
//Tarea 5313
viewModel.inititializeDefaultDataInit()
}
}
@ -150,8 +148,7 @@ class PasilleroFragment(
if (!isInitMenu) {
val dividerItemDecoration = DividerItemDecoration(
context,
LinearLayoutManager.VERTICAL
context, LinearLayoutManager.VERTICAL
)
dividerItemDecoration.setDrawable(

View File

@ -1,3 +1,4 @@
package es.verdnatura.presentation.view.feature.photos.fragment
import android.app.Activity.RESULT_OK
import android.content.Context
import android.content.Intent
@ -5,14 +6,12 @@ import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import android.view.View.*
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.core.net.toUri
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
@ -29,16 +28,16 @@ import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.*
import java.util.Date
import java.util.Locale
class PhotosFragment(
var title: String,
var uriImage: Uri?
private var uriImage: Uri?
) : BaseFragment<FragmentPhotosBinding, ItemCardViewModel>(
ItemCardViewModel::class
) {
private val PICK_IMAGE_REQUEST = 1
private val REQUEST_IMAGE_CAPTURE = 2
private val imageUri: Uri? = null
private var originalItem: String = ""
private val pickImageLauncher = registerForActivityResult(
@ -65,7 +64,6 @@ class PhotosFragment(
fun newInstance(title: String, uriImage: String) = PhotosFragment(title, uriImage.toUri())
}
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
binding.mainToolbar.toolbarTitle.text = title
setEvents()
@ -80,7 +78,6 @@ class PhotosFragment(
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
@ -125,7 +122,7 @@ class PhotosFragment(
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.editItemFk.text.toString().isEmpty()) {
if (binding.editItemFk.text.toString().isNotEmpty()) {
try {
originalItem = itemScanValue(
binding.editItemFk.text.toString(),
@ -136,7 +133,7 @@ class PhotosFragment(
viewModel.getIdFromCodeSalix(originalItem)
} catch (ex: Exception) {
ma.messageWithSound(ex.message.toString(), true, true)
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed =true)
}
}
binding.editItemFk.setText("")
@ -170,12 +167,10 @@ class PhotosFragment(
}
}
itemcard.observe(viewLifecycleOwner) {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
itemCard.observe(viewLifecycleOwner) {
if (it.id != 0) {
binding.itemData.text = "${it.id}: ${it.longName}"
binding.itemData.text = getString(R.string.itemDataText, it.id, it.longName)
if (!it.urlImage200.isNullOrEmpty()) {
binding.itemcardOriginal.visibility = VISIBLE
binding.itemcardOriginal.loadUrl(it.urlImage200)
@ -183,26 +178,25 @@ class PhotosFragment(
} else {
ma.messageWithSound(
getString(R.string.itemNotFound),
true,
false,
isError = true,
isPlayed = false,
getString(R.string.noResults)
)
}
}
}
responseCode.observe(viewLifecycleOwner) {
if (it.response.isNotBlank()) {
if (it.isNotBlank()) {
viewModel.getItemCard(
it.response.toLong(),
it.toLong(),
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
)
} else {
ma.messageWithSound(
getString(R.string.itemScanetNotFound),
true,
false,
isError = true,
isPlayed = false,
getString(R.string.noResults)
)
}
@ -226,7 +220,7 @@ class PhotosFragment(
}
}
fun saveBitmapAsTempFile(context: Context, bitmap: Bitmap): String {
private fun saveBitmapAsTempFile(context: Context, bitmap: Bitmap): String {
val timeStamp = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
val fileName = "IMG_$timeStamp.jpg"

View File

@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.precontrol
import android.content.Context
import android.os.Bundle
import android.view.View
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
@ -63,14 +62,8 @@ class PreControladorFragment :
goBack = false
if (!binding.scanInput.text.isNullOrEmpty()) {
try {
//Tara 6276
/*viewModel.getSalesFromTicketOrCollection(
collectionFk = binding.scanInput.text.toString().toInt(),
print = false,
source = type
)*/
viewModel.getSales(
collectionFk = binding.scanInput.text.toString().toInt(),
print = false,
@ -93,13 +86,8 @@ class PreControladorFragment :
with(viewModel) {
collectionTicketList.observe(viewLifecycleOwner, Observer {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
if (!goBack) navigateToCollectionList(it)
goBack = false
}
if (!goBack) navigateToCollectionList(it)
goBack = false
})
}

View File

@ -976,7 +976,7 @@ class EndSacadorFragment(
private fun showQuantityDialog(position: Int) {
try {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
.setValue("")
.setOkButtonAdd(getString(R.string.Agregar)) {
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())

View File

@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.sacador.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.text.InputType
import android.view.View
import android.view.inputmethod.EditorInfo
@ -96,13 +95,10 @@ class SacadorFragment(
val iconPrint = ImageView(context)
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
}
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
if (type == "PREPARED") {
listIcons.add(iconVehicleIn)
@ -122,7 +118,11 @@ class SacadorFragment(
viewModel.collection_assign(
)
} else {
viewModel.sectorCollectionNew(mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK))
viewModel.sectorCollectionNew(
mobileApplication.dataStoreApp.readDataStoreKey(
SECTORFK
)
)
}
}
@ -155,7 +155,7 @@ class SacadorFragment(
ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
printAction()
@ -172,7 +172,9 @@ class SacadorFragment(
) {
if (ma.havePrinter()) {
viewModel.ticketPrintLabelPrevious(customDialogInput.getValue().toInt())
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(PRINTERNAME)).toast(
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
PRINTERNAME
)).toast(
requireContext()
)
} else {
@ -205,8 +207,14 @@ class SacadorFragment(
if (goBack) {
if (!it.response.isNullOrBlank()) addCollectionToList(it.response.toInt())
}
if (it.isError){
ma.messageWithSound(it.errorMessage,true,true,"", isToasted = true)
if (it.isError) {
ma.messageWithSound(
it.errorMessage,
isError = true,
isPlayed = true,
titleWithError = "",
isToasted = true
)
}
goBack = false
callBack(type)

View File

@ -7,8 +7,6 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
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.TicketStateList
@ -23,64 +21,14 @@ class ShowTicketViewModel(val context: Context) : BaseViewModel(context) {
private val _lastTicketList by lazy { MutableLiveData<TicketStateList>() }
val lastTicketList: LiveData<TicketStateList> = _lastTicketList
/* fun collectionTicketGet(collectionFk: Int, sectorFk: Int, print: String, type: String) {
silex.collection_getTickets(collectionFk, sectorFk, print, type)
.enqueue(object :
SilexCallback<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>) {
if (response.body() != null) {
_collectionTicketList.value = response.body()?.let { it.map(context) }
} else {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}*/
//Tarea 6276
//salix.collectionGetTickets(collectionFk,sectorFk,print.toInt(),type)
fun getSales(collectionFk: Int, print: Boolean, source: String) {
salix.getSalesFromTicketOrCollection(collectionFk,print,source)
salix.getSalesFromTicketOrCollection(collectionFk, print, 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>) {
if (response.body() != null) {
_collectionTicketList.value = response.body()?.let { it.map(context) }
} else {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
_collectionTicketList.value = response.body()?.let { it.map(context) }
}
})
}
@ -90,7 +38,8 @@ class ShowTicketViewModel(val context: Context) : BaseViewModel(context) {
.enqueue(object : SalixCallback<List<TicketStateSalix>>(context) {
@RequiresApi(Build.VERSION_CODES.O)
override fun onSuccess(response: Response<List<TicketStateSalix>>) {
_lastTicketList.value = response.body()?.let { TicketStateList(it.sortedByDescending { it.created }) }
_lastTicketList.value = response.body()
?.let { TicketStateList(it.sortedByDescending { it.created }) }
}
})

View File

@ -2,6 +2,7 @@ package es.verdnatura.presentation.view.feature.sacador.mapper
import android.content.Context
import es.verdnatura.R
import es.verdnatura.domain.isoToString
import es.verdnatura.presentation.common.convertToDateString
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
@ -14,7 +15,7 @@ fun List<CollectionVO>.toDateFormat(context: Context): ArrayList<CollectionVO> {
collections.add(
CollectionVO(
collectionFk = it.collectionFk,
created = getCalendarFromDate(it.created, context).convertToDateString(),
created = getCalendarFromDate(it.created.isoToString(), context).convertToDateString(),
ticketTotalCount = it.ticketTotalCount
)
)

View File

@ -1,11 +1,6 @@
package es.verdnatura.presentation.view.feature.smarttag.model
class SmartTag(
var code:String? = "",
var text:String? = " "
var code: String? = "",
var text: String? = " "
)
class BufferLoad(
var code:String? = "",
var text:String? = " "
)

View File

@ -34,7 +34,7 @@ class TicketAdvanceFragment(var title: String) :
}
binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.scanInput.text.isNullOrEmpty()) {
try {

Some files were not shown because too many files have changed in this diff Show More